Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The Extrusion class generates a Geometry extruding a silhouette along a path. More...
#include <Extrusions.hpp>
Public Member Functions | |
Extrusions () | |
Constructor. More... | |
vl::ref< vl::Geometry > | extrude (bool compatibilityProfile=true) |
Performs the actual extrusion. More... | |
void | setSilhouettes (const std::vector< unsigned int > &silhouettes) |
Sets the number of points in each silhouette. More... | |
const std::vector< unsigned int > & | silhouettes () const |
Return the number of points in each silhouette. More... | |
std::vector< unsigned int > & | silhouettes () |
Return the number of points in each silhouette. More... | |
void | setSilhouette (const std::vector< vl::fvec2 > &silhouette) |
Sets the silhouette to be extruded. More... | |
const std::vector< vl::fvec2 > & | silhouette () const |
Returns the silhouette to be extruded. More... | |
std::vector< vl::fvec2 > & | silhouette () |
Returns the silhouette to be extruded. More... | |
void | setSilhouetteMode (ESilhouetteMode mode) |
Wether the silhouette is considered closed, i.e. a line-loop, or open. More... | |
ESilhouetteMode | silhouetteMode () const |
Wether the silhouette is considered closed, i.e. a line-loop, or open. More... | |
void | setSmooth (bool smooth) |
If true the normals of the geometry are smoothed. More... | |
bool | smooth () const |
If true the normals of the geometry are smoothed. More... | |
void | setFillBottom (bool fill) |
Whether a set of triangles should be generated to fill the beginning of the extrusion (default is true ). More... | |
bool | fillBottom () const |
Whether a set of triangles should be generated to fill the beginning of the extrusion (default is true ). More... | |
void | setFillTop (bool fill) |
Whether a set of triangles should be generated to fill the ending of the extrusion (default is true ). More... | |
bool | fillTop () const |
Whether a set of triangles should be generated to fill the ending of the extrusion (default is true ). More... | |
const std::vector< vl::fvec3 > & | positionPath () const |
The path along which the silhouette is extruded. More... | |
std::vector< vl::fvec3 > & | positionPath () |
The path along which the silhouette is extruded. More... | |
const std::vector< float > & | scalingPath () const |
The scaling to be applied along the extrusion. More... | |
std::vector< float > & | scalingPath () |
The scaling to be applied along the extrusion. More... | |
const std::vector< float > & | rotationPath () const |
The rotation to be applied along the extrusion. More... | |
std::vector< float > & | rotationPath () |
The rotation to be applied along the extrusion. More... | |
const std::vector< vl::fvec4 > & | colorPath () const |
The color to be applied to the extrusion. More... | |
std::vector< vl::fvec4 > & | colorPath () |
The color to be applied to the extrusion. More... | |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Attributes | |
std::vector< unsigned int > | mSilhouettes |
std::vector< vl::fvec2 > | mSilhouette |
std::vector< vl::fvec3 > | mPositionPath |
std::vector< float > | mScalingPath |
std::vector< float > | mRotationPath |
std::vector< vl::fvec4 > | mColorPath |
ESilhouetteMode | mSilhouetteMode |
bool | mSmooth |
bool | mFillBottom |
bool | mFillTop |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
The Extrusion class generates a Geometry extruding a silhouette along a path.
Definition at line 53 of file Extrusions.hpp.
|
inline |
|
inline |
The color to be applied to the extrusion.
There must be one color control point for each position control point in the positionPath() with the exclusion of the starting and ending control points, i.e colorPath().size() must be equal to positionPath().size()-2.
Definition at line 130 of file Extrusions.hpp.
Referenced by extrude().
|
inline |
The color to be applied to the extrusion.
There must be one color control point for each position control point in the positionPath() with the exclusion of the starting and ending control points, i.e colorPath().size() must be equal to positionPath().size()-2.
Definition at line 134 of file Extrusions.hpp.
Performs the actual extrusion.
Definition at line 38 of file Extrusions.cpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), colorPath(), vl::Geometry::computeNormals(), vl::Tessellator::contours(), vl::Tessellator::contourVerts(), vl::Geometry::convertDrawCallToDrawArrays(), vl::dot(), vl::Geometry::drawCalls(), vl::Log::error(), fillBottom(), fillTop(), vl::ref< T >::get(), vl::Matrix4< float >::getRotation(), vl::DrawElements< arr_type >::indexBuffer(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::initFrom(), vl::Vector3< T_Scalar >::normalize(), vl::normalize(), NULL, positionPath(), vl::PT_QUADS, vl::PT_TRIANGLES, vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize(), rotationPath(), scalingPath(), vl::Geometry::setColorArray(), vl::Geometry::setVertexArray(), vl::Geometry::setVertexAttribArray(), vl::Tessellator::setWindingRule(), silhouette(), vl::SilhouetteClosed, silhouetteMode(), silhouettes(), vl::ArrayAbstract::size(), smooth(), vl::Tessellator::tessellate(), vl::Tessellator::tessellatedTris(), vl::TW_TESS_WINDING_NONZERO, vl::TW_TESS_WINDING_ODD, vl::VA_Color, vl::VA_Position, and vl::Geometry::vertexArray().
|
inline |
Whether a set of triangles should be generated to fill the beginning of the extrusion (default is true
).
Definition at line 98 of file Extrusions.hpp.
Referenced by extrude().
|
inline |
Whether a set of triangles should be generated to fill the ending of the extrusion (default is true
).
Definition at line 103 of file Extrusions.hpp.
Referenced by extrude().
|
inline |
The path along which the silhouette is extruded.
The path starts and ends with one extra control point on each side that define the orientation of the start/end extruded segments.
Definition at line 107 of file Extrusions.hpp.
Referenced by extrude().
|
inline |
The path along which the silhouette is extruded.
The path starts and ends with one extra control point on each side that define the orientation of the start/end extruded segments.
Definition at line 110 of file Extrusions.hpp.
|
inline |
The rotation to be applied along the extrusion.
There must be one rotation control point for each position control point in the positionPath() with the exclusion of the starting and ending control points, i.e rotationPath().size() must be equal to positionPath().size()-2.
Definition at line 122 of file Extrusions.hpp.
Referenced by extrude().
|
inline |
The rotation to be applied along the extrusion.
There must be one rotation control point for each position control point in the positionPath() with the exclusion of the starting and ending control points, i.e rotationPath().size() must be equal to positionPath().size()-2.
Definition at line 126 of file Extrusions.hpp.
|
inline |
The scaling to be applied along the extrusion.
There must be one scaling control point for each position control point in the positionPath() with the exclusion of the starting and ending control points, i.e scalingPath().size() must be equal to positionPath().size()-2.
Definition at line 114 of file Extrusions.hpp.
Referenced by extrude().
|
inline |
The scaling to be applied along the extrusion.
There must be one scaling control point for each position control point in the positionPath() with the exclusion of the starting and ending control points, i.e scalingPath().size() must be equal to positionPath().size()-2.
Definition at line 118 of file Extrusions.hpp.
|
inline |
Whether a set of triangles should be generated to fill the beginning of the extrusion (default is true
).
Definition at line 96 of file Extrusions.hpp.
|
inline |
Whether a set of triangles should be generated to fill the ending of the extrusion (default is true
).
Definition at line 101 of file Extrusions.hpp.
|
inline |
Sets the silhouette to be extruded.
Definition at line 79 of file Extrusions.hpp.
|
inline |
Wether the silhouette is considered closed, i.e. a line-loop, or open.
Definition at line 86 of file Extrusions.hpp.
|
inline |
Sets the number of points in each silhouette.
Definition at line 72 of file Extrusions.hpp.
|
inline |
If true the normals of the geometry are smoothed.
Definition at line 91 of file Extrusions.hpp.
|
inline |
Returns the silhouette to be extruded.
Definition at line 81 of file Extrusions.hpp.
Referenced by extrude().
|
inline |
Returns the silhouette to be extruded.
Definition at line 83 of file Extrusions.hpp.
|
inline |
Wether the silhouette is considered closed, i.e. a line-loop, or open.
Definition at line 88 of file Extrusions.hpp.
Referenced by extrude().
|
inline |
Return the number of points in each silhouette.
Definition at line 74 of file Extrusions.hpp.
Referenced by extrude().
|
inline |
Return the number of points in each silhouette.
Definition at line 76 of file Extrusions.hpp.
|
inline |
If true the normals of the geometry are smoothed.
Definition at line 93 of file Extrusions.hpp.
Referenced by extrude().
|
protected |
Definition at line 142 of file Extrusions.hpp.
|
protected |
Definition at line 145 of file Extrusions.hpp.
|
protected |
Definition at line 146 of file Extrusions.hpp.
|
protected |
Definition at line 139 of file Extrusions.hpp.
|
protected |
Definition at line 141 of file Extrusions.hpp.
|
protected |
Definition at line 140 of file Extrusions.hpp.
|
protected |
Definition at line 138 of file Extrusions.hpp.
|
protected |
Definition at line 143 of file Extrusions.hpp.
|
protected |
Definition at line 137 of file Extrusions.hpp.
|
protected |
Definition at line 144 of file Extrusions.hpp.
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:08.
© Copyright Michele Bosi. All rights reserved.