Visualization Library 2.1.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes | List of all members
vl::Extrusions Class Reference

The Extrusions class generates a Geometry extruding a silhouette along a path. More...

#include <Extrusions.hpp>

+ Inheritance diagram for vl::Extrusions:

Public Member Functions

 Extrusions ()
 Constructor. More...
 
vl::ref< vl::Geometryextrude (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...
 
Objectoperator= (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...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () 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::fvec2mSilhouette
 
std::vector< vl::fvec3mPositionPath
 
std::vector< float > mScalingPath
 
std::vector< float > mRotationPath
 
std::vector< vl::fvec4mColorPath
 
ESilhouetteMode mSilhouetteMode
 
bool mSmooth
 
bool mFillBottom
 
bool mFillTop
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Additional Inherited Members

- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Detailed Description

The Extrusions class generates a Geometry extruding a silhouette along a path.

As opposed to the legacy Extrusion class, this class allows you to extrude multiple contours.

See also

Definition at line 55 of file Extrusions.hpp.

Constructor & Destructor Documentation

◆ Extrusions()

vl::Extrusions::Extrusions ( )
inline

Constructor.

Definition at line 61 of file Extrusions.hpp.

References vl::SilhouetteClosed.

Member Function Documentation

◆ colorPath() [1/2]

const std::vector<vl::fvec4>& vl::Extrusions::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 132 of file Extrusions.hpp.

Referenced by extrude().

◆ colorPath() [2/2]

std::vector<vl::fvec4>& vl::Extrusions::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 136 of file Extrusions.hpp.

◆ extrude()

ref< Geometry > Extrusions::extrude ( bool  compatibilityProfile = true)

◆ fillBottom()

bool vl::Extrusions::fillBottom ( ) const
inline

Whether a set of triangles should be generated to fill the beginning of the extrusion (default is true).

Definition at line 100 of file Extrusions.hpp.

Referenced by extrude().

◆ fillTop()

bool vl::Extrusions::fillTop ( ) const
inline

Whether a set of triangles should be generated to fill the ending of the extrusion (default is true).

Definition at line 105 of file Extrusions.hpp.

Referenced by extrude().

◆ positionPath() [1/2]

const std::vector<vl::fvec3>& vl::Extrusions::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 109 of file Extrusions.hpp.

Referenced by extrude().

◆ positionPath() [2/2]

std::vector<vl::fvec3>& vl::Extrusions::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 112 of file Extrusions.hpp.

◆ rotationPath() [1/2]

const std::vector<float>& vl::Extrusions::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 124 of file Extrusions.hpp.

Referenced by extrude().

◆ rotationPath() [2/2]

std::vector<float>& vl::Extrusions::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 128 of file Extrusions.hpp.

◆ scalingPath() [1/2]

const std::vector<float>& vl::Extrusions::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 116 of file Extrusions.hpp.

Referenced by extrude().

◆ scalingPath() [2/2]

std::vector<float>& vl::Extrusions::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 120 of file Extrusions.hpp.

◆ setFillBottom()

void vl::Extrusions::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 98 of file Extrusions.hpp.

◆ setFillTop()

void vl::Extrusions::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 103 of file Extrusions.hpp.

◆ setSilhouette()

void vl::Extrusions::setSilhouette ( const std::vector< vl::fvec2 > &  silhouette)
inline

Sets the silhouette to be extruded.

Definition at line 81 of file Extrusions.hpp.

◆ setSilhouetteMode()

void vl::Extrusions::setSilhouetteMode ( ESilhouetteMode  mode)
inline

Wether the silhouette is considered closed, i.e. a line-loop, or open.

Definition at line 88 of file Extrusions.hpp.

◆ setSilhouettes()

void vl::Extrusions::setSilhouettes ( const std::vector< unsigned int > &  silhouettes)
inline

Sets the number of points in each silhouette.

Definition at line 74 of file Extrusions.hpp.

◆ setSmooth()

void vl::Extrusions::setSmooth ( bool  smooth)
inline

If true the normals of the geometry are smoothed.

Definition at line 93 of file Extrusions.hpp.

◆ silhouette() [1/2]

const std::vector<vl::fvec2>& vl::Extrusions::silhouette ( ) const
inline

Returns the silhouette to be extruded.

Definition at line 83 of file Extrusions.hpp.

Referenced by extrude().

◆ silhouette() [2/2]

std::vector<vl::fvec2>& vl::Extrusions::silhouette ( )
inline

Returns the silhouette to be extruded.

Definition at line 85 of file Extrusions.hpp.

◆ silhouetteMode()

ESilhouetteMode vl::Extrusions::silhouetteMode ( ) const
inline

Wether the silhouette is considered closed, i.e. a line-loop, or open.

Definition at line 90 of file Extrusions.hpp.

Referenced by extrude().

◆ silhouettes() [1/2]

const std::vector<unsigned int>& vl::Extrusions::silhouettes ( ) const
inline

Return the number of points in each silhouette.

Definition at line 76 of file Extrusions.hpp.

Referenced by extrude().

◆ silhouettes() [2/2]

std::vector<unsigned int>& vl::Extrusions::silhouettes ( )
inline

Return the number of points in each silhouette.

Definition at line 78 of file Extrusions.hpp.

◆ smooth()

bool vl::Extrusions::smooth ( ) const
inline

If true the normals of the geometry are smoothed.

Definition at line 95 of file Extrusions.hpp.

Referenced by extrude().

Member Data Documentation

◆ mColorPath

std::vector<vl::fvec4> vl::Extrusions::mColorPath
protected

Definition at line 144 of file Extrusions.hpp.

◆ mFillBottom

bool vl::Extrusions::mFillBottom
protected

Definition at line 147 of file Extrusions.hpp.

◆ mFillTop

bool vl::Extrusions::mFillTop
protected

Definition at line 148 of file Extrusions.hpp.

◆ mPositionPath

std::vector<vl::fvec3> vl::Extrusions::mPositionPath
protected

Definition at line 141 of file Extrusions.hpp.

◆ mRotationPath

std::vector<float> vl::Extrusions::mRotationPath
protected

Definition at line 143 of file Extrusions.hpp.

◆ mScalingPath

std::vector<float> vl::Extrusions::mScalingPath
protected

Definition at line 142 of file Extrusions.hpp.

◆ mSilhouette

std::vector<vl::fvec2> vl::Extrusions::mSilhouette
protected

Definition at line 140 of file Extrusions.hpp.

◆ mSilhouetteMode

ESilhouetteMode vl::Extrusions::mSilhouetteMode
protected

Definition at line 145 of file Extrusions.hpp.

◆ mSilhouettes

std::vector<unsigned int> vl::Extrusions::mSilhouettes
protected

Definition at line 139 of file Extrusions.hpp.

◆ mSmooth

bool vl::Extrusions::mSmooth
protected

Definition at line 146 of file Extrusions.hpp.


The documentation for this class was generated from the following files: