Visualization Library v1.0.3A 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 <Extrusion.hpp>
Public Member Functions | |
Extrusion () | |
Constructor. | |
vl::ref< vl::Geometry > | extrude () |
Performs the actual extrusion. | |
void | setSilhouette (const std::vector< vl::fvec2 > &silhouette) |
Sets the silhouette to be extruded. | |
const std::vector< vl::fvec2 > & | silhouette () const |
Returns the silhouette to be extruded. | |
std::vector< vl::fvec2 > & | silhouette () |
Returns the silhouette to be extruded. | |
void | setSilhouetteMode (ESilhouetteMode mode) |
Wether the silhouette is considered closed, i.e. a line-loop, or open. | |
ESilhouetteMode | silhouetteMode () const |
Wether the silhouette is considered closed, i.e. a line-loop, or open. | |
void | setSmooth (bool smooth) |
If true the normals of the geometry are smoothed. | |
bool | smooth () const |
If true the normals of the geometry are smoothed. | |
void | setFillBottom (bool fill) |
Whether a set of triangles should be generated to fill the beginning of the extrusion (default is true ). | |
bool | fillBottom () const |
Whether a set of triangles should be generated to fill the beginning of the extrusion (default is true ). | |
void | setFillTop (bool fill) |
Whether a set of triangles should be generated to fill the ending of the extrusion (default is true ). | |
bool | fillTop () const |
Whether a set of triangles should be generated to fill the ending of the extrusion (default is true ). | |
const std::vector< vl::fvec3 > & | positionPath () const |
The path along which the silhouette is extruded. | |
std::vector< vl::fvec3 > & | positionPath () |
The path along which the silhouette is extruded. | |
const std::vector< float > & | scalingPath () const |
The scaling to be applied along the extrusion. | |
std::vector< float > & | scalingPath () |
The scaling to be applied along the extrusion. | |
const std::vector< float > & | rotationPath () const |
The rotation to be applied along the extrusion. | |
std::vector< float > & | rotationPath () |
The rotation to be applied along the extrusion. | |
const std::vector< vl::fvec4 > & | colorPath () const |
The color to be applied to the extrusion. | |
std::vector< vl::fvec4 > & | colorPath () |
The color to be applied to the extrusion. | |
Protected Attributes | |
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 |
The Extrusion class generates a Geometry extruding a silhouette along a path.
Definition at line 53 of file Extrusion.hpp.
vl::Extrusion::Extrusion | ( | ) | [inline] |
Constructor.
Definition at line 59 of file Extrusion.hpp.
References vl::SilhouetteClosed, and VL_DEBUG_SET_OBJECT_NAME.
Performs the actual extrusion.
Definition at line 38 of file Extrusion.cpp.
References colorPath(), vl::Tessellator::contours(), vl::Tessellator::contourVerts(), vl::dot(), vl::Log::error(), fillBottom(), fillTop(), vl::ref< T >::get(), vl::Matrix4< float >::getRotation(), vl::normalize(), vl::Vector3< T_Scalar >::normalize(), NULL, positionPath(), vl::PT_QUADS, vl::PT_TRIANGLES, rotationPath(), scalingPath(), vl::Tessellator::setWindingRule(), silhouette(), vl::SilhouetteClosed, silhouetteMode(), smooth(), vl::Tessellator::tessellate(), vl::Tessellator::tessellatedTris(), and vl::TW_TESS_WINDING_NONZERO.
void vl::Extrusion::setSilhouette | ( | const std::vector< vl::fvec2 > & | silhouette ) | [inline] |
Sets the silhouette to be extruded.
Definition at line 72 of file Extrusion.hpp.
const std::vector<vl::fvec2>& vl::Extrusion::silhouette | ( | ) | const [inline] |
Returns the silhouette to be extruded.
Definition at line 74 of file Extrusion.hpp.
Referenced by extrude().
std::vector<vl::fvec2>& vl::Extrusion::silhouette | ( | ) | [inline] |
Returns the silhouette to be extruded.
Definition at line 76 of file Extrusion.hpp.
void vl::Extrusion::setSilhouetteMode | ( | ESilhouetteMode | mode ) | [inline] |
Wether the silhouette is considered closed, i.e. a line-loop, or open.
Definition at line 79 of file Extrusion.hpp.
ESilhouetteMode vl::Extrusion::silhouetteMode | ( | ) | const [inline] |
Wether the silhouette is considered closed, i.e. a line-loop, or open.
Definition at line 81 of file Extrusion.hpp.
Referenced by extrude().
void vl::Extrusion::setSmooth | ( | bool | smooth ) | [inline] |
If true the normals of the geometry are smoothed.
Definition at line 84 of file Extrusion.hpp.
bool vl::Extrusion::smooth | ( | ) | const [inline] |
If true the normals of the geometry are smoothed.
Definition at line 86 of file Extrusion.hpp.
Referenced by extrude().
void vl::Extrusion::setFillBottom | ( | bool | fill ) | [inline] |
Whether a set of triangles should be generated to fill the beginning of the extrusion (default is true
).
Definition at line 89 of file Extrusion.hpp.
bool vl::Extrusion::fillBottom | ( | ) | const [inline] |
Whether a set of triangles should be generated to fill the beginning of the extrusion (default is true
).
Definition at line 91 of file Extrusion.hpp.
Referenced by extrude().
void vl::Extrusion::setFillTop | ( | bool | fill ) | [inline] |
Whether a set of triangles should be generated to fill the ending of the extrusion (default is true
).
Definition at line 94 of file Extrusion.hpp.
bool vl::Extrusion::fillTop | ( | ) | const [inline] |
Whether a set of triangles should be generated to fill the ending of the extrusion (default is true
).
Definition at line 96 of file Extrusion.hpp.
Referenced by extrude().
const std::vector<vl::fvec3>& vl::Extrusion::positionPath | ( | ) | const [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 100 of file Extrusion.hpp.
Referenced by extrude().
std::vector<vl::fvec3>& vl::Extrusion::positionPath | ( | ) | [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 103 of file Extrusion.hpp.
const std::vector<float>& vl::Extrusion::scalingPath | ( | ) | const [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 107 of file Extrusion.hpp.
Referenced by extrude().
std::vector<float>& vl::Extrusion::scalingPath | ( | ) | [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 111 of file Extrusion.hpp.
const std::vector<float>& vl::Extrusion::rotationPath | ( | ) | const [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 115 of file Extrusion.hpp.
Referenced by extrude().
std::vector<float>& vl::Extrusion::rotationPath | ( | ) | [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 119 of file Extrusion.hpp.
const std::vector<vl::fvec4>& vl::Extrusion::colorPath | ( | ) | const [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 123 of file Extrusion.hpp.
Referenced by extrude().
std::vector<vl::fvec4>& vl::Extrusion::colorPath | ( | ) | [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 127 of file Extrusion.hpp.
std::vector<vl::fvec2> vl::Extrusion::mSilhouette [protected] |
Definition at line 130 of file Extrusion.hpp.
std::vector<vl::fvec3> vl::Extrusion::mPositionPath [protected] |
Definition at line 131 of file Extrusion.hpp.
std::vector<float> vl::Extrusion::mScalingPath [protected] |
Definition at line 132 of file Extrusion.hpp.
std::vector<float> vl::Extrusion::mRotationPath [protected] |
Definition at line 133 of file Extrusion.hpp.
std::vector<vl::fvec4> vl::Extrusion::mColorPath [protected] |
Definition at line 134 of file Extrusion.hpp.
ESilhouetteMode vl::Extrusion::mSilhouetteMode [protected] |
Definition at line 135 of file Extrusion.hpp.
bool vl::Extrusion::mSmooth [protected] |
Definition at line 136 of file Extrusion.hpp.
bool vl::Extrusion::mFillBottom [protected] |
Definition at line 137 of file Extrusion.hpp.
bool vl::Extrusion::mFillTop [protected] |
Definition at line 138 of file Extrusion.hpp.