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

A generator class for a box mesh. More...

#include <boxgenerator.h>

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

Public Member Functions

 BoxGenerator (const Vector3 &HalfExtents, const Whole SegX=1, const Whole SegY=1, const Whole SegZ=1)
 Vector constructor. More...
 
 BoxGenerator (const Real HalfSizeX, const Real HalfSizeY, const Real HalfSizeZ, const Whole SegX=1, const Whole SegY=1, const Whole SegZ=1)
 Real constructor. More...
 
virtual ~BoxGenerator ()
 Class destructor.
 
virtual void AddToTriangleBuffer (TriangleBuffer &Buffer) const
 Adds the vertices and indices as configured in this generator to a triangle buffer. More...
 
BoxGeneratorSetHalfExtents (const Vector3 &HalfExtents)
 Sets the half size of the box. More...
 
BoxGeneratorSetHalfSizeX (const Real HalfSizeX)
 Sets the half size along the X axis.

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.
More...
 
BoxGeneratorSetHalfSizeY (const Real HalfSizeY)
 Sets the half size along the Y axis.

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.
More...
 
BoxGeneratorSetHalfSizeZ (const Real HalfSizeZ)
 Sets the half size along the Z axis.

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.
More...
 
BoxGeneratorSetNumSegX (const Whole SegX)
 Sets the number of segments along X axis. More...
 
BoxGeneratorSetNumSegY (const Whole SegY)
 Sets the number of segments along Y axis. More...
 
BoxGeneratorSetNumSegZ (const Whole SegZ)
 Sets the number of segments along Z axis. More...
 
- Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< BoxGenerator >
 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...
 
BoxGeneratorResetTransforms ()
 Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More...
 
BoxGeneratorSetEnableNormals (Boole EnableNormals)
 Sets whether normals are enabled or not. More...
 
BoxGeneratorSetNumTexCoordSet (const UInt8 NumSets)
 Sets the number of texture coordintate sets. More...
 
BoxGeneratorSetOrientation (const Quaternion &Ori)
 Sets an orientation baked into the resulting mesh. More...
 
BoxGeneratorSetOrientation (const Real X, const Real Y, const Real Z, const Real W)
 Sets an orientation baked into the resulting mesh. More...
 
BoxGeneratorSetPosition (const Vector3 &Loc)
 Sets a translation baked into the resulting mesh. More...
 
BoxGeneratorSetPosition (const Real X, const Real Y, const Real Z)
 Sets a translation baked into the resulting mesh. More...
 
BoxGeneratorSetScale (const Vector3 &Scaling)
 Sets a scale baked into the resulting mesh. More...
 
BoxGeneratorSetScale (const Real Scaling)
 Sets a uniform scale baked into the resulting mesh. More...
 
BoxGeneratorSetScale (const Real X, const Real Y, const Real Z)
 Sets a scale baked into the resulting mesh. More...
 
BoxGeneratorSetSwitchUV (Boole SwitchUV)
 Sets whether to switch U and V texture coordinates. More...
 
BoxGeneratorSetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom)
 Sets the texture rectangle. More...
 
BoxGeneratorSetUTile (const Real uTile)
 Sets the U Tile. More...
 
BoxGeneratorSetVTile (const Real vTile)
 Sets the V Tile. More...
 

Static Public Attributes

static const String TAG_NEGX = "box.negx"
 A String containing the name of the Negative X face of the box.
 
static const String TAG_NEGY = "box.negy"
 A String containing the name of the Negative Y face of the box.
 
static const String TAG_NEGZ = "box.negz"
 A String containing the name of the Negative Z face of the box.
 
static const String TAG_X = "box.x"
 A String containing the name of the X face of the box.
 
static const String TAG_Y = "box.y"
 A String containing the name of the Y face of the box.
 
static const String TAG_Z = "box.z"
 A String containing the name of the Z face of the box.
 

Protected Attributes

Vector3 BoxHalf
 The size of the box to generate. More...
 
Whole NumSegX
 The number of segments to generate along the X axis for each face. More...
 
Whole NumSegY
 The number of segments to generate along the Y axis for each face. More...
 
Whole NumSegZ
 The number of segments to generate along the Z axis for each face. More...
 
- Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< BoxGenerator >
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< BoxGenerator >
enum  GeneratorOptions
 A convenience enum used to describe boolean options for a generator.
 
- Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< BoxGenerator >
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...
 

Detailed Description

A generator class for a box mesh.

Definition at line 82 of file boxgenerator.h.

Constructor & Destructor Documentation

Mezzanine::Graphics::Procedural::BoxGenerator::BoxGenerator ( const Vector3 HalfExtents,
const Whole  SegX = 1,
const Whole  SegY = 1,
const Whole  SegZ = 1 
)

Vector constructor.

Parameters
HalfExtentsThe half size of the box to generate.
SegXThe number of segments to generate along the X axis for each face.
SegYThe number of segments to generate along the Y axis for each face.
SegZThe number of segments to generate along the Z axis for each face.

Definition at line 88 of file boxgenerator.cpp.

Mezzanine::Graphics::Procedural::BoxGenerator::BoxGenerator ( const Real  HalfSizeX,
const Real  HalfSizeY,
const Real  HalfSizeZ,
const Whole  SegX = 1,
const Whole  SegY = 1,
const Whole  SegZ = 1 
)

Real constructor.

Parameters
HalfSizeXThe half size of the box to generate on the X axis.
HalfSizeYThe half size of the box to generate on the Y axis.
HalfSizeZThe half size of the box to generate on the Z axis.
SegXThe number of segments to generate along the X axis for each face.
SegYThe number of segments to generate along the Y axis for each face.
SegZThe number of segments to generate along the Z axis for each face.

Definition at line 96 of file boxgenerator.cpp.

Member Function Documentation

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

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

Definition at line 112 of file boxgenerator.cpp.

BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetHalfExtents ( const Vector3 HalfExtents)

Sets the half size of the box.

Parameters
HalfExtentsThe half size of the box that will be generated.
Returns
Returns a reference to this.

Definition at line 182 of file boxgenerator.cpp.

BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetHalfSizeX ( const Real  HalfSizeX)

Sets the half size along the X axis.

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.

Parameters
HalfSizeXThe half size to set for the generated box on the X axis.
Returns
Returns a reference to this.

Definition at line 155 of file boxgenerator.cpp.

BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetHalfSizeY ( const Real  HalfSizeY)

Sets the half size along the Y axis.

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.

Parameters
HalfSizeYThe half size to set for the generated box on the Y axis.
Returns
Returns a reference to this.

Definition at line 164 of file boxgenerator.cpp.

BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetHalfSizeZ ( const Real  HalfSizeZ)

Sets the half size along the Z axis.

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.

Parameters
HalfSizeZThe half size to set for the generated box on the Z axis.
Returns
Returns a reference to this.

Definition at line 173 of file boxgenerator.cpp.

BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetNumSegX ( const Whole  SegX)

Sets the number of segments along X axis.

Remarks
The default number of segments on the X axis is 1.
Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.
Parameters
SegXThe number of segments to set along the X axis.
Returns
Returns a reference to this.

Definition at line 190 of file boxgenerator.cpp.

BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetNumSegY ( const Whole  SegY)

Sets the number of segments along Y axis.

Remarks
The default number of segments on the Y axis is 1.
Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.
Parameters
SegXThe number of segments to set along the Y axis.
Returns
Returns a reference to this.

Definition at line 199 of file boxgenerator.cpp.

BoxGenerator & Mezzanine::Graphics::Procedural::BoxGenerator::SetNumSegZ ( const Whole  SegZ)

Sets the number of segments along Z axis.

Remarks
The default number of segments on the Z axis is 1.
Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.
Parameters
SegXThe number of segments to set along the Z axis.
Returns
Returns a reference to this.

Definition at line 208 of file boxgenerator.cpp.

Member Data Documentation

Vector3 Mezzanine::Graphics::Procedural::BoxGenerator::BoxHalf
protected

The size of the box to generate.

Definition at line 100 of file boxgenerator.h.

Whole Mezzanine::Graphics::Procedural::BoxGenerator::NumSegX
protected

The number of segments to generate along the X axis for each face.

Definition at line 103 of file boxgenerator.h.

Whole Mezzanine::Graphics::Procedural::BoxGenerator::NumSegY
protected

The number of segments to generate along the Y axis for each face.

Definition at line 106 of file boxgenerator.h.

Whole Mezzanine::Graphics::Procedural::BoxGenerator::NumSegZ
protected

The number of segments to generate along the Z axis for each face.

Definition at line 109 of file boxgenerator.h.


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