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

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

#include <roundedboxgenerator.h>

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

Public Member Functions

 RoundedBoxGenerator (const Vector3 &Size, const Real ChamferSize, const Whole SegX=1, const Whole SegY=1, const Whole SegZ=1, const Whole ChamferSeg=1)
 Vector constructor. More...
 
 RoundedBoxGenerator (const Real SizeX, const Real SizeY, const Real SizeZ, const Real ChamferSize, const Whole SegX=1, const Whole SegY=1, const Whole SegZ=1, const Whole ChamferSeg=1)
 Real constructor. More...
 
virtual ~RoundedBoxGenerator ()
 Class destructor.
 
virtual void AddToTriangleBuffer (TriangleBuffer &Buffer) const
 Adds the vertices and indices as configured in this generator to a triangle buffer. More...
 
RoundedBoxGeneratorSetChamferSize (const Real ChamferSize)
 Sets the size of the chamfer, ie the radius of the rounded part

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.
More...
 
RoundedBoxGeneratorSetNumChamferSeg (const Whole ChamferSeg)
 Sets the number of segments along the rounded edge of the box.

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.
More...
 
RoundedBoxGeneratorSetNumSegX (const Whole SegX)
 Sets the number of segments along X axis

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.
More...
 
RoundedBoxGeneratorSetNumSegY (const Whole SegY)
 Sets the number of segments along Y axis

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.
More...
 
RoundedBoxGeneratorSetNumSegZ (const Whole SegZ)
 Sets the number of segments along Z axis

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.
More...
 
RoundedBoxGeneratorSetSize (const Vector3 &Size)
 Sets the size of the box.

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.
More...
 
RoundedBoxGeneratorSetSizeX (const Real SizeX)
 Sets the size of the box along X axis.

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.
More...
 
RoundedBoxGeneratorSetSizeY (const Real SizeY)
 Sets the size of the box along Y axis.

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.
More...
 
RoundedBoxGeneratorSetSizeZ (const Real SizeZ)
 Sets the size of the box along Z axis.

Exceptions
Ifthe size is set to 0 or less, a PARAMETERS_EXCEPTION will be thrown.
More...
 
- Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< RoundedBoxGenerator >
 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...
 
RoundedBoxGeneratorResetTransforms ()
 Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More...
 
RoundedBoxGeneratorSetEnableNormals (Boole EnableNormals)
 Sets whether normals are enabled or not. More...
 
RoundedBoxGeneratorSetNumTexCoordSet (const UInt8 NumSets)
 Sets the number of texture coordintate sets. More...
 
RoundedBoxGeneratorSetOrientation (const Quaternion &Ori)
 Sets an orientation baked into the resulting mesh. More...
 
RoundedBoxGeneratorSetOrientation (const Real X, const Real Y, const Real Z, const Real W)
 Sets an orientation baked into the resulting mesh. More...
 
RoundedBoxGeneratorSetPosition (const Vector3 &Loc)
 Sets a translation baked into the resulting mesh. More...
 
RoundedBoxGeneratorSetPosition (const Real X, const Real Y, const Real Z)
 Sets a translation baked into the resulting mesh. More...
 
RoundedBoxGeneratorSetScale (const Vector3 &Scaling)
 Sets a scale baked into the resulting mesh. More...
 
RoundedBoxGeneratorSetScale (const Real Scaling)
 Sets a uniform scale baked into the resulting mesh. More...
 
RoundedBoxGeneratorSetScale (const Real X, const Real Y, const Real Z)
 Sets a scale baked into the resulting mesh. More...
 
RoundedBoxGeneratorSetSwitchUV (Boole SwitchUV)
 Sets whether to switch U and V texture coordinates. More...
 
RoundedBoxGeneratorSetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom)
 Sets the texture rectangle. More...
 
RoundedBoxGeneratorSetUTile (const Real uTile)
 Sets the U Tile. More...
 
RoundedBoxGeneratorSetVTile (const Real vTile)
 Sets the V Tile. More...
 

Protected Member Functions

void _AddCorner (TriangleBuffer &Buffer, Boole IsXPositive, Boole IsYPositive, Boole IsZPositive) const
 Builds a "corner" of the rounded box, ie a 1/8th of a sphere. More...
 
void _AddEdge (TriangleBuffer &Buffer, Int16 XPos, Int16 YPos, Int16 ZPos) const
 Builds an "edge" of the rounded box, ie a quarter cylinder. More...
 
- Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< RoundedBoxGenerator >
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 BoxChamferSize
 The radius of the rounded portion of the box corners. More...
 
Vector3 BoxSize
 The size of the box to generate. More...
 
Whole NumChamferSeg
 The number of segments to generate along the length of the rounded edges. More...
 
Whole NumSegX
 The number of segments to generate along the X axis for each side. More...
 
Whole NumSegY
 The number of segments to generate along the Y axis for each side. More...
 
Whole NumSegZ
 The number of segments to generate along the Z axis for each side. More...
 
- Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< RoundedBoxGenerator >
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< RoundedBoxGenerator >
enum  GeneratorOptions
 A convenience enum used to describe boolean options for a generator.
 

Detailed Description

A generator class for a rounded box mesh.

Definition at line 82 of file roundedboxgenerator.h.

Constructor & Destructor Documentation

Mezzanine::Graphics::Procedural::RoundedBoxGenerator::RoundedBoxGenerator ( const Vector3 Size,
const Real  ChamferSize,
const Whole  SegX = 1,
const Whole  SegY = 1,
const Whole  SegZ = 1,
const Whole  ChamferSeg = 1 
)

Vector constructor.

Parameters
SizeThe size of the box to generate.
ChamferSizeThe radius of the rounded portion of the box corners.
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.
ChamferSegThe number of segments to generate along the length of the rounded edges.

Definition at line 82 of file roundedboxgenerator.cpp.

Mezzanine::Graphics::Procedural::RoundedBoxGenerator::RoundedBoxGenerator ( const Real  SizeX,
const Real  SizeY,
const Real  SizeZ,
const Real  ChamferSize,
const Whole  SegX = 1,
const Whole  SegY = 1,
const Whole  SegZ = 1,
const Whole  ChamferSeg = 1 
)

Real constructor.

Parameters
SizeXThe size of the box to generate on the X axis.
SizeYThe size of the box to generate on the Y axis.
SizeZThe size of the box to generate on the Z axis.
ChamferSizeThe radius of the rounded portion of the box corners.
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.
ChamferSegThe number of segments to generate along the length of the rounded edges.

Definition at line 92 of file roundedboxgenerator.cpp.

Member Function Documentation

void Mezzanine::Graphics::Procedural::RoundedBoxGenerator::_AddCorner ( TriangleBuffer Buffer,
Boole  IsXPositive,
Boole  IsYPositive,
Boole  IsZPositive 
) const
protected

Builds a "corner" of the rounded box, ie a 1/8th of a sphere.

Parameters
BufferThe buffer to append the corner data to.
IsXPositiveWhether or not the corner needing to be generated is on the positive side of the X axis.
IsYPositiveWhether or not the corner needing to be generated is on the positive side of the Y axis.
IsZPositiveWhether or not the corner needing to be generated is on the positive side of the Z axis.

Definition at line 165 of file roundedboxgenerator.cpp.

void Mezzanine::Graphics::Procedural::RoundedBoxGenerator::_AddEdge ( TriangleBuffer Buffer,
Int16  XPos,
Int16  YPos,
Int16  ZPos 
) const
protected

Builds an "edge" of the rounded box, ie a quarter cylinder.

Parameters
BufferThe buffer to append the edge data to.
XPosExpects either "1" or "-1" based on the side of the X axis to generate the edge on.
YPosExpects either "1" or "-1" based on the side of the Y axis to generate the edge on.
ZPosExpects either "1" or "-1" based on the side of the Z axis to generate the edge on.

Definition at line 107 of file roundedboxgenerator.cpp.

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

Definition at line 221 of file roundedboxgenerator.cpp.

RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetChamferSize ( const Real  ChamferSize)

Sets the size of the chamfer, ie the radius of the rounded part

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

Parameters
ChamferSizeThe radius of the rounded portion of the box corners.
Returns
Returns a reference to this.

Definition at line 324 of file roundedboxgenerator.cpp.

RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetNumChamferSeg ( const Whole  ChamferSeg)

Sets the number of segments along the rounded edge of the box.

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.

Parameters
ChamferSegThe number of segments to generate along the length of the rounded edges.
Returns
Returns a reference to this.

Definition at line 360 of file roundedboxgenerator.cpp.

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

Sets the number of segments along X axis

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.

Parameters
SegXThe number of segments to generate along the X axis for each side.
Returns
Returns a reference to this.

Definition at line 333 of file roundedboxgenerator.cpp.

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

Sets the number of segments along Y axis

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.

Parameters
SegYThe number of segments to generate along the Y axis for each side.
Returns
Returns a reference to this.

Definition at line 342 of file roundedboxgenerator.cpp.

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

Sets the number of segments along Z axis

Exceptions
Ifthe number of segments is set to 0, a PARAMETERS_EXCEPTION will be thrown.

Parameters
SegZThe number of segments to generate along the Z axis for each side.
Returns
Returns a reference to this.

Definition at line 351 of file roundedboxgenerator.cpp.

RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetSize ( const Vector3 Size)

Sets the size of the box.

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

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

Definition at line 316 of file roundedboxgenerator.cpp.

RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetSizeX ( const Real  SizeX)

Sets the size of the box along X axis.

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

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

Definition at line 289 of file roundedboxgenerator.cpp.

RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetSizeY ( const Real  SizeY)

Sets the size of the box along Y axis.

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

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

Definition at line 298 of file roundedboxgenerator.cpp.

RoundedBoxGenerator & Mezzanine::Graphics::Procedural::RoundedBoxGenerator::SetSizeZ ( const Real  SizeZ)

Sets the size of the box along Z axis.

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

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

Definition at line 307 of file roundedboxgenerator.cpp.

Member Data Documentation

Real Mezzanine::Graphics::Procedural::RoundedBoxGenerator::BoxChamferSize
protected

The radius of the rounded portion of the box corners.

Definition at line 90 of file roundedboxgenerator.h.

Vector3 Mezzanine::Graphics::Procedural::RoundedBoxGenerator::BoxSize
protected

The size of the box to generate.

Definition at line 87 of file roundedboxgenerator.h.

Whole Mezzanine::Graphics::Procedural::RoundedBoxGenerator::NumChamferSeg
protected

The number of segments to generate along the length of the rounded edges.

Definition at line 93 of file roundedboxgenerator.h.

Whole Mezzanine::Graphics::Procedural::RoundedBoxGenerator::NumSegX
protected

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

Definition at line 96 of file roundedboxgenerator.h.

Whole Mezzanine::Graphics::Procedural::RoundedBoxGenerator::NumSegY
protected

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

Definition at line 99 of file roundedboxgenerator.h.

Whole Mezzanine::Graphics::Procedural::RoundedBoxGenerator::NumSegZ
protected

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

Definition at line 102 of file roundedboxgenerator.h.


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