Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::Procedural::Extruder Class Reference

A generator that will create a 3D model by moving a 2D shape along a 3D Path. More...

#include <extruder.h>

+ Inheritance diagram for Mezzanine::Graphics::Procedural::Extruder:
+ Collaboration diagram for Mezzanine::Graphics::Procedural::Extruder:

Public Types

typedef TrackMap::const_iterator ConstTrackMapIterator
 Const Iterator type for ParameterTracks.
 
typedef Track< LinearInterpolator< Real > > ParameterTrack
 Convenience type for a Track that stores additional optional data.
 
typedef std::map< Whole, ParameterTrack * > TrackMap
 Container type for storing ParameterTracks.
 
typedef TrackMap::iterator TrackMapIterator
 Iterator type for ParameterTracks.
 
- Public Types inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Extruder >
enum  GeneratorOptions
 A convenience enum used to describe boolean options for a generator.
 

Public Member Functions

 Extruder ()
 Class constructor.
 
virtual ~Extruder ()
 Class destructor.
 
virtual void AddToTriangleBuffer (TriangleBuffer &Buffer) const
 Adds the vertices and indices as configured in this generator to a triangle buffer. More...
 
ExtruderSetCapped (const Boole Cap)
 Sets whether or not the ends of each Path extruded are to be enclosed. More...
 
ExtruderSetMultiPathToExtrude (const MultiPath &ToExtrude)
 Sets a MultiPath to be extruded along. More...
 
ExtruderSetMultiShapeToExtrude (const MultiShape &ToExtrude)
 Sets a Multishape to be extruded. More...
 
ExtruderSetPathToExtrude (const Path &ToExtrude)
 Sets a single Path to be extruded along. More...
 
ExtruderSetPathUTextureTrack (const Whole PathIndex, ParameterTrack *PathU)
 Sets how the "U" component texture coordinates are to be generated for extruded shapes. More...
 
ExtruderSetRotationTrack (const Whole PathIndex, ParameterTrack *Rotation)
 Sets how shapes are to be rotated on a specific Path. More...
 
ExtruderSetScaleTrack (const Whole PathIndex, ParameterTrack *Scale)
 Sets how shapes are to be scaled on a specific Path. More...
 
ExtruderSetShapeToExtrude (const Shape &ToExtrude)
 Sets a single Shape to be extruded. More...
 
ExtruderSetShapeVTextureTrack (const Whole ShapeIndex, ParameterTrack *ShapeV)
 Sets how the "V" component texture coordinates are to be generated for extruded shapes. More...
 
- Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Extruder >
 MeshGenerator ()
 Class constructor.
 
virtual ~MeshGenerator ()
 Class destructor.
 
TriangleBuffer BuildTriangleBuffer () const
 Creates a TriangleBuffer with the the vertices and indices as configured in this generator. More...
 
MeshGenerateMesh (const String &MeshName, const String &MeshGroup, const String &MatName, const String &MatGroup) const
 Generates the mesh. More...
 
ExtruderResetTransforms ()
 Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More...
 
ExtruderSetEnableNormals (Boole EnableNormals)
 Sets whether normals are enabled or not. More...
 
ExtruderSetNumTexCoordSet (const UInt8 NumSets)
 Sets the number of texture coordintate sets. More...
 
ExtruderSetOrientation (const Quaternion &Ori)
 Sets an orientation baked into the resulting mesh. More...
 
ExtruderSetOrientation (const Real X, const Real Y, const Real Z, const Real W)
 Sets an orientation baked into the resulting mesh. More...
 
ExtruderSetPosition (const Vector3 &Loc)
 Sets a translation baked into the resulting mesh. More...
 
ExtruderSetPosition (const Real X, const Real Y, const Real Z)
 Sets a translation baked into the resulting mesh. More...
 
ExtruderSetScale (const Vector3 &Scaling)
 Sets a scale baked into the resulting mesh. More...
 
ExtruderSetScale (const Real Scaling)
 Sets a uniform scale baked into the resulting mesh. More...
 
ExtruderSetScale (const Real X, const Real Y, const Real Z)
 Sets a scale baked into the resulting mesh. More...
 
ExtruderSetSwitchUV (Boole SwitchUV)
 Sets whether to switch U and V texture coordinates. More...
 
ExtruderSetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom)
 Sets the texture rectangle. More...
 
ExtruderSetUTile (const Real uTile)
 Sets the U Tile. More...
 
ExtruderSetVTile (const Real vTile)
 Sets the V Tile. More...
 

Protected Member Functions

void GenerateExtrusionCaps (TriangleBuffer &Buffer) const
 Creates the caps at the end of each shape extruded along a given Path. More...
 
void GenerateExtrusionIntersection (TriangleBuffer &Buffer, const MultiPath::PathIntersection &Intersection, const Whole ShapeIndex) const
 Creates an intersection of segments. More...
 
void GenerateExtrusionSegment (TriangleBuffer &Buffer, const Whole ShapeIndex, const Whole PathIndex, const Whole PathSegBegin, const Whole PathSegEnd) const
 Creates a sequence of non-intersecting segments. More...
 
void GenerateExtrusionShape (TriangleBuffer &Buffer, const Whole PathIndex, const Whole ShapeIndex, const Real PathCoord, const Vector3 &Position, const Quaternion &LeftOri, const Quaternion &RightOri, const Real Scale, const Real ScaleLeftCorrect, const Real ScaleRightCorrect, const Boole JoinWithNextShape) const
 Creates a single part of a segment being extruded. More...
 
Vector2 GenerateUVs (const Whole PathIndex, const Whole ShapeIndex, const Real PathCoord, const Real ShapeCoord) const
 Creates appropriate UV coordinates for a given Vertex. More...
 
- Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Extruder >
void AddPoint (TriangleBuffer &Buffer, const Vector3 &Loc, const Vector3 &Norm, const Vector2 &UV) const
 Adds a new point to a triangle buffer, using the format defined for that MeshGenerator. More...
 

Protected Attributes

Boole Capped
 Whether or not the ends of each Path will be capped. More...
 
MultiPath PathsToExtrude
 A MultiPath storing all of the Paths the 2D shapes will be extruded along. More...
 
TrackMap PathUTextureTracks
 A map of optional Tracks that store how texture coordinates are to be assigned along the Paths being extruded along. More...
 
TrackMap RotationTracks
 A map of optional Tracks that store how the shapes on a given Path are to be rotated. More...
 
TrackMap ScaleTracks
 A map of optional Tracks that store how the shapes on a given Path are to be scaled. More...
 
MultiShape ShapesToExtrude
 A MultiShape storing all of the 2D shapes that will be extruded along the specified Paths. More...
 
TrackMap ShapeVTextureTracks
 A map of optional Tracks that store how texture coordinates are to be assigned along the Shapes being extruded. More...
 
- Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Extruder >
UInt8 GeneratorOpts
 Storage for the boolean options to be used by this generator. More...
 
UInt8 NumTexCoordSet
 The number of texture coordinate sets to include. More...
 
Quaternion Orientation
 Orientation to apply the mesh. More...
 
Vector3 Position
 Position to apply to the mesh. More...
 
Vector3 Scale
 Scale to apply to the mesh. More...
 
Real UTile
 U tile for texture coords generation. More...
 
Vector2 UVOrigin
 Rectangle in which the texture coordinates will be placed. More...
 
Real VTile
 V tile for texture coords generation. More...
 

Detailed Description

A generator that will create a 3D model by moving a 2D shape along a 3D Path.

Definition at line 84 of file extruder.h.

Member Function Documentation

void Mezzanine::Graphics::Procedural::Extruder::AddToTriangleBuffer ( TriangleBuffer Buffer) const
virtual

Adds the vertices and indices as configured in this generator to a triangle buffer.

Parameters
BufferThe buffer to append this generators vertices and indices to.
Exceptions
Ifneither the shape or multishape are defined an INVALID_STATE_EXCEPTION will be thrown.

Implements Mezzanine::Graphics::Procedural::MeshGenerator< Extruder >.

Definition at line 376 of file extruder.cpp.

void Mezzanine::Graphics::Procedural::Extruder::GenerateExtrusionCaps ( TriangleBuffer Buffer) const
protected

Creates the caps at the end of each shape extruded along a given Path.

Parameters
BufferThe buffer to be modified.

Definition at line 142 of file extruder.cpp.

void Mezzanine::Graphics::Procedural::Extruder::GenerateExtrusionIntersection ( TriangleBuffer Buffer,
const MultiPath::PathIntersection Intersection,
const Whole  ShapeIndex 
) const
protected

Creates an intersection of segments.

Parameters
BufferThe buffer to be modified.
IntersectionA single intersection of multiple segments in the MultiPath.
ShapeIndexThe index of the Shape to be extruded.

Definition at line 301 of file extruder.cpp.

void Mezzanine::Graphics::Procedural::Extruder::GenerateExtrusionSegment ( TriangleBuffer Buffer,
const Whole  ShapeIndex,
const Whole  PathIndex,
const Whole  PathSegBegin,
const Whole  PathSegEnd 
) const
protected

Creates a sequence of non-intersecting segments.

Parameters
BufferThe buffer to be modified.
ShapeIndexThe index of the Shape to be extruded.
PathIndexThe index of the Path to be extruded along.
PathSegBeginThe index of the start of the segment on the specified Path.
PathSegEndThe index of the end of the segment on the specified Path.

Definition at line 237 of file extruder.cpp.

void Mezzanine::Graphics::Procedural::Extruder::GenerateExtrusionShape ( TriangleBuffer Buffer,
const Whole  PathIndex,
const Whole  ShapeIndex,
const Real  PathCoord,
const Vector3 Position,
const Quaternion LeftOri,
const Quaternion RightOri,
const Real  Scale,
const Real  ScaleLeftCorrect,
const Real  ScaleRightCorrect,
const Boole  JoinWithNextShape 
) const
protected

Creates a single part of a segment being extruded.

Parameters
BufferThe buffer to be modified.
PathIndexThe index of the Path being extruded.
ShapeIndexThe index of the Shape being extruded.
PathCoordThe coordinate position on the current Path being extruded.
PositionThe position on the Path the Shape will be extruded at.
LeftOriThe rotation to be applied to Negative-X positioned points in the Shape being extruded.
RightOriThe rotation to be applied to Positive-X positioned points in the Shape being extruded.
ScaleThe scaling to be applied to the Shape being extruded at this segment.
ScaleLeftCorrectThe scaling adjustment to apply on the Negative-X positioned points in the Shape being extruded.
ScaleRightCorrectThe scaling adjustment to apply on the Positive-X positioned points in the Shape being extruded.
JoinWithNextShapeWhether or not to set up the indicies to

Definition at line 107 of file extruder.cpp.

Vector2 Mezzanine::Graphics::Procedural::Extruder::GenerateUVs ( const Whole  PathIndex,
const Whole  ShapeIndex,
const Real  PathCoord,
const Real  ShapeCoord 
) const
protected

Creates appropriate UV coordinates for a given Vertex.

Parameters
PathIndexThe index of the Path being extruded.
ShapeIndexThe index of the Shape being extruded.
PathCoordThe coordinate position on the current Path being extruded.
ShapeCoordThe coordinate position on the current Shape being extruded.
Returns
Returns a Vector2 with Path and Shape appropriate UV coordinates.

Definition at line 93 of file extruder.cpp.

Extruder & Mezzanine::Graphics::Procedural::Extruder::SetCapped ( const Boole  Cap)

Sets whether or not the ends of each Path extruded are to be enclosed.

Parameters
CapTrue to enclose the Mesh at the ends of each Path, false otherwise.
Returns
Returns a reference to this.

Definition at line 480 of file extruder.cpp.

Extruder & Mezzanine::Graphics::Procedural::Extruder::SetMultiPathToExtrude ( const MultiPath ToExtrude)

Sets a MultiPath to be extruded along.

Parameters
ToExtrudeA MultiPath storing all of the Paths the 2D shapes will be extruded along.
Returns
Returns a reference to this.

Definition at line 425 of file extruder.cpp.

Extruder & Mezzanine::Graphics::Procedural::Extruder::SetMultiShapeToExtrude ( const MultiShape ToExtrude)

Sets a Multishape to be extruded.

Parameters
ToExtrudeA MultiShape storing all of the 2D shapes that will be extruded along the specified Paths.
Returns
Returns a reference to this.

Definition at line 440 of file extruder.cpp.

Extruder & Mezzanine::Graphics::Procedural::Extruder::SetPathToExtrude ( const Path ToExtrude)

Sets a single Path to be extruded along.

Parameters
ToExtrudeA Path to be extruded along.
Returns
Returns a reference to this.

Definition at line 417 of file extruder.cpp.

Extruder & Mezzanine::Graphics::Procedural::Extruder::SetPathUTextureTrack ( const Whole  PathIndex,
ParameterTrack PathU 
)

Sets how the "U" component texture coordinates are to be generated for extruded shapes.

Parameters
PathIndexThe index of the Path this Track is to be applied to.
PathUA pointer to an optional Track that stores how texture coordinates are to be assigned along the Path being extruded along. Initial Value: NULL.
Returns
Returns a reference to this.

Definition at line 463 of file extruder.cpp.

Extruder & Mezzanine::Graphics::Procedural::Extruder::SetRotationTrack ( const Whole  PathIndex,
ParameterTrack Rotation 
)

Sets how shapes are to be rotated on a specific Path.

Parameters
PathIndexThe index of the Path this Track is to be applied to.
RotationA pointer to an optional Track that stores how the shapes on a given Path are to be rotated. Initial Value: NULL.
Returns
Returns a reference to this.

Definition at line 455 of file extruder.cpp.

Extruder & Mezzanine::Graphics::Procedural::Extruder::SetScaleTrack ( const Whole  PathIndex,
ParameterTrack Scale 
)

Sets how shapes are to be scaled on a specific Path.

Parameters
PathIndexThe index of the Path this Track is to be applied to.
ScaleA pointer to an optional Track that stores how the shapes on a given Path are to be scaled. Initial Value: NULL.
Returns
Returns a reference to this.

Definition at line 447 of file extruder.cpp.

Extruder & Mezzanine::Graphics::Procedural::Extruder::SetShapeToExtrude ( const Shape ToExtrude)

Sets a single Shape to be extruded.

Parameters
ToExtrudeA Shape to be extruded.
Returns
Returns a reference to this.

Definition at line 433 of file extruder.cpp.

Extruder & Mezzanine::Graphics::Procedural::Extruder::SetShapeVTextureTrack ( const Whole  ShapeIndex,
ParameterTrack ShapeV 
)

Sets how the "V" component texture coordinates are to be generated for extruded shapes.

Parameters
ShapeIndexThe index of the Shape this Track is to be applied to.
ShapeVA pointer to an optional Track that stores how texture coordinates are to be assigned along the shape being extruded. Initial Value: NULL.
Returns
Returns a reference to this.

Definition at line 471 of file extruder.cpp.

Member Data Documentation

Boole Mezzanine::Graphics::Procedural::Extruder::Capped
protected

Whether or not the ends of each Path will be capped.

Definition at line 116 of file extruder.h.

MultiPath Mezzanine::Graphics::Procedural::Extruder::PathsToExtrude
protected

A MultiPath storing all of the Paths the 2D shapes will be extruded along.

Definition at line 98 of file extruder.h.

TrackMap Mezzanine::Graphics::Procedural::Extruder::PathUTextureTracks
protected

A map of optional Tracks that store how texture coordinates are to be assigned along the Paths being extruded along.

Definition at line 110 of file extruder.h.

TrackMap Mezzanine::Graphics::Procedural::Extruder::RotationTracks
protected

A map of optional Tracks that store how the shapes on a given Path are to be rotated.

Definition at line 107 of file extruder.h.

TrackMap Mezzanine::Graphics::Procedural::Extruder::ScaleTracks
protected

A map of optional Tracks that store how the shapes on a given Path are to be scaled.

Definition at line 104 of file extruder.h.

MultiShape Mezzanine::Graphics::Procedural::Extruder::ShapesToExtrude
protected

A MultiShape storing all of the 2D shapes that will be extruded along the specified Paths.

Definition at line 101 of file extruder.h.

TrackMap Mezzanine::Graphics::Procedural::Extruder::ShapeVTextureTracks
protected

A map of optional Tracks that store how texture coordinates are to be assigned along the Shapes being extruded.

Definition at line 113 of file extruder.h.


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