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

A generator that produces a Mesh by rotating a 2D shape around the Y axis. More...

#include <lathe.h>

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

Public Member Functions

 Lathe ()
 Class constructor.
 
 Lathe (Shape *ToLathe, const Whole Segments)
 Shape constructor. More...
 
 Lathe (MultiShape *ToLathe, const Whole Segments)
 MultiShape constructor. More...
 
virtual ~Lathe ()
 Class destructor.
 
virtual void AddToTriangleBuffer (TriangleBuffer &Buffer) const
 Adds the vertices and indices as configured in this generator to a triangle buffer. More...
 
LatheSetAngleBegin (const Real Begin)
 Sets the starting angle for the rotation. More...
 
LatheSetAngleEnd (const Real End)
 Sets the endng angle for the rotation. More...
 
LatheSetCapped (const Boole ShapeCapped)
 Sets whether or not the outside ends of the rotated shape should be enclosed. More...
 
LatheSetClosed (const Boole ShapeClosed)
 Sets whether or not the start and end segments should be connected. More...
 
LatheSetMultiShapeToLathe (MultiShape *ToLathe)
 Sets the MultiShape to to be Lathe'd. More...
 
LatheSetNumSegments (const Whole Segments)
 Sets the number of segments in the rotation to generate.

Exceptions
Ifthe number of segments is being set to a number less than 3, an INVALID_PARAMETERS exception will be thrown.
More...
 
LatheSetShapeToLathe (Shape *ToLathe)
 Sets the Shape to to be Lathe'd. More...
 
- Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Lathe >
 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...
 
LatheResetTransforms ()
 Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More...
 
LatheSetEnableNormals (Boole EnableNormals)
 Sets whether normals are enabled or not. More...
 
LatheSetNumTexCoordSet (const UInt8 NumSets)
 Sets the number of texture coordintate sets. More...
 
LatheSetOrientation (const Quaternion &Ori)
 Sets an orientation baked into the resulting mesh. More...
 
LatheSetOrientation (const Real X, const Real Y, const Real Z, const Real W)
 Sets an orientation baked into the resulting mesh. More...
 
LatheSetPosition (const Vector3 &Loc)
 Sets a translation baked into the resulting mesh. More...
 
LatheSetPosition (const Real X, const Real Y, const Real Z)
 Sets a translation baked into the resulting mesh. More...
 
LatheSetScale (const Vector3 &Scaling)
 Sets a scale baked into the resulting mesh. More...
 
LatheSetScale (const Real Scaling)
 Sets a uniform scale baked into the resulting mesh. More...
 
LatheSetScale (const Real X, const Real Y, const Real Z)
 Sets a scale baked into the resulting mesh. More...
 
LatheSetSwitchUV (Boole SwitchUV)
 Sets whether to switch U and V texture coordinates. More...
 
LatheSetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom)
 Sets the texture rectangle. More...
 
LatheSetUTile (const Real uTile)
 Sets the U Tile. More...
 
LatheSetVTile (const Real vTile)
 Sets the V Tile. More...
 

Protected Member Functions

void GenerateBody (TriangleBuffer &Buffer, const Shape *ToLathe) const
 Creates the main body of the lathe'd shape. More...
 
void GenerateCaps (TriangleBuffer &Buffer) const
 Creates the caps at the ends of the rotated shape. More...
 
- Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Lathe >
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

Real AngleBegin
 The angle at which the rotation will start. More...
 
Real AngleEnd
 The angle at which the rotation will end. More...
 
Boole Capped
 Whether or not the ends should be capped if the shape isn't rotated a full 360 degrees. More...
 
Boole Closed
 Whether or not the Lathe is configured to rotate a full 360 degrees. More...
 
MultiShapeMultiShapeToLathe
 A pointer to the MultiShape that will be used to generate a Mesh. More...
 
Whole NumSegments
 The number of segments to have when rotating the shape to produce the Mesh. Large number of segments means smoother shape. More...
 
ShapeShapeToLathe
 A pointer to the Shape that will be used to generate a Mesh. More...
 
- Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Lathe >
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...
 

Additional Inherited Members

- Public Types inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Lathe >
enum  GeneratorOptions
 A convenience enum used to describe boolean options for a generator.
 

Detailed Description

A generator that produces a Mesh by rotating a 2D shape around the Y axis.

Shapes that are Lathe'd do not need to be closed, and in general are assumed to be defined in the ( X >= 0 ) half-plane. In other words, the Y axis in local space for the generated Mesh will line up with "0" on the X axis in the shape, and be rotated to produce a mesh.

Definition at line 86 of file lathe.h.

Constructor & Destructor Documentation

Mezzanine::Graphics::Procedural::Lathe::Lathe ( Shape ToLathe,
const Whole  Segments 
)

Shape constructor.

Parameters
ToLatheA pointer to the Shape to be Lathed.
SegmentsThe number of segments to have when rotating the shape to produce the Mesh. Large number of segments means smoother shape. Will be clamped to be at least 3.

Definition at line 95 of file lathe.cpp.

Mezzanine::Graphics::Procedural::Lathe::Lathe ( MultiShape ToLathe,
const Whole  Segments 
)

MultiShape constructor.

Parameters
ToLatheA pointer to the MultiShape to be Lathed.
SegmentsThe number of segments to have when rotating the shape to produce the Mesh. Large number of segments means smoother shape. Will be clamped to be at least 3.

Definition at line 105 of file lathe.cpp.

Member Function Documentation

void Mezzanine::Graphics::Procedural::Lathe::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< Lathe >.

Definition at line 245 of file lathe.cpp.

void Mezzanine::Graphics::Procedural::Lathe::GenerateBody ( TriangleBuffer Buffer,
const Shape ToLathe 
) const
protected

Creates the main body of the lathe'd shape.

Parameters
BufferThe buffer to append this generators vertices and indices to.
ToLatheThe shape to be rotated to produce a Mesh.

Definition at line 181 of file lathe.cpp.

void Mezzanine::Graphics::Procedural::Lathe::GenerateCaps ( TriangleBuffer Buffer) const
protected

Creates the caps at the ends of the rotated shape.

Parameters
BufferThe buffer to append this generators vertices and indices to.

Definition at line 118 of file lathe.cpp.

Lathe & Mezzanine::Graphics::Procedural::Lathe::SetAngleBegin ( const Real  Begin)

Sets the starting angle for the rotation.

Parameters
BeginThe angle at which the rotation will start. Initial Value: 0.0.
Returns
Returns a reference to this.

Definition at line 293 of file lathe.cpp.

Lathe & Mezzanine::Graphics::Procedural::Lathe::SetAngleEnd ( const Real  End)

Sets the endng angle for the rotation.

Parameters
EndThe angle at which the rotation will end. Initial Value: 2Pi.
Returns
Returns a reference to this.

Definition at line 300 of file lathe.cpp.

Lathe & Mezzanine::Graphics::Procedural::Lathe::SetCapped ( const Boole  ShapeCapped)

Sets whether or not the outside ends of the rotated shape should be enclosed.

Parameters
ShapeCappedWhether or not the ends should be capped if the shape isn't rotated a full 360 degrees.
Returns
Returns a reference to this.

Definition at line 313 of file lathe.cpp.

Lathe & Mezzanine::Graphics::Procedural::Lathe::SetClosed ( const Boole  ShapeClosed)

Sets whether or not the start and end segments should be connected.

Parameters
ShapeClosedWhether or not the Lathe is configured to rotate a full 360 degrees.
Returns
Returns a reference to this.

Definition at line 307 of file lathe.cpp.

Lathe & Mezzanine::Graphics::Procedural::Lathe::SetMultiShapeToLathe ( MultiShape ToLathe)

Sets the MultiShape to to be Lathe'd.

Remarks
This will remove any Shape that is set.
Parameters
ToLatheA pointer to the MultiShape that will be used to generate a Mesh.
Returns
Returns a reference to this.

Definition at line 277 of file lathe.cpp.

Lathe & Mezzanine::Graphics::Procedural::Lathe::SetNumSegments ( const Whole  Segments)

Sets the number of segments in the rotation to generate.

Exceptions
Ifthe number of segments is being set to a number less than 3, an INVALID_PARAMETERS exception will be thrown.

Parameters
SegmentsThe number of segments to have when rotating the shape to produce the Mesh. Large number of segments means smoother shape.
Returns
Returns a reference to this.

Definition at line 284 of file lathe.cpp.

Lathe & Mezzanine::Graphics::Procedural::Lathe::SetShapeToLathe ( Shape ToLathe)

Sets the Shape to to be Lathe'd.

Remarks
This will remove any MultiShape that is set.
Parameters
ToLatheA pointer to the Shape that will be used to generate a Mesh.
Returns
Returns a reference to this.

Definition at line 270 of file lathe.cpp.

Member Data Documentation

Real Mezzanine::Graphics::Procedural::Lathe::AngleBegin
protected

The angle at which the rotation will start.

Definition at line 100 of file lathe.h.

Real Mezzanine::Graphics::Procedural::Lathe::AngleEnd
protected

The angle at which the rotation will end.

Definition at line 103 of file lathe.h.

Boole Mezzanine::Graphics::Procedural::Lathe::Capped
protected

Whether or not the ends should be capped if the shape isn't rotated a full 360 degrees.

Definition at line 109 of file lathe.h.

Boole Mezzanine::Graphics::Procedural::Lathe::Closed
protected

Whether or not the Lathe is configured to rotate a full 360 degrees.

Definition at line 106 of file lathe.h.

MultiShape* Mezzanine::Graphics::Procedural::Lathe::MultiShapeToLathe
protected

A pointer to the MultiShape that will be used to generate a Mesh.

Definition at line 94 of file lathe.h.

Whole Mezzanine::Graphics::Procedural::Lathe::NumSegments
protected

The number of segments to have when rotating the shape to produce the Mesh. Large number of segments means smoother shape.

Definition at line 97 of file lathe.h.

Shape* Mezzanine::Graphics::Procedural::Lathe::ShapeToLathe
protected

A pointer to the Shape that will be used to generate a Mesh.

Definition at line 91 of file lathe.h.


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