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

A modifier that will draw a series of curved line segments. More...

#include <cycloidmodifier.h>

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

Public Types

enum  CycloidParameter {
  CP_Param_R = 1, CP_Param_r = 2, CP_Param_d = 3, CP_Param_e = 4,
  CP_Param_k = 5, CP_LargeCircleRadius = CP_Param_R, CP_SmallCircleRadius = CP_Param_r, CP_DistanceFromCenter = CP_Param_d,
  CP_RotationAngle = CP_Param_e, CP_BasePetals = CP_Param_k
}
 An enum describing the parameters that can be altered for each type of Cycloid. More...
 
enum  CycloidType {
  CT_Hypocycloid = 1, CT_Hypotrochoid = 2, CT_Epicycloid = 3, CT_Epitrochoid = 4,
  CT_RoseCurve = 5, CT_LissajousCurve = 6
}
 The type of Cycloid to draw. More...
 

Public Member Functions

 CycloidModifier ()
 Blank constructor.
 
virtual ~CycloidModifier ()
 Class destructor.
 
virtual String GetName () const
 Gets the name of this modifier. More...
 
virtual void Modify (TextureBuffer &Buffer)
 Alters the generated pixels in a TextureBuffer. More...
 
CycloidModifierSetColour (const ColourValue &Colour)
 Sets the colour of the lines to be drawn for the Cycloid. More...
 
CycloidModifierSetColour (const Real Red, const Real Green, const Real Blue, const Real Alpha=1.0)
 Sets the colour of the lines to be drawn for the Cycloid. More...
 
CycloidModifierSetCycloidCenter (const Vector2 &Center)
 Sets the center position of the Cycloid. More...
 
CycloidModifierSetCycloidCenter (const Real CenterX, const Real CenterY)
 Sets the center position of the Cycloid. More...
 
CycloidModifierSetCycloidCenterX (const Real X)
 Sets the center position of the Cycloid on the X axis. More...
 
CycloidModifierSetCycloidCenterY (const Real Y)
 Sets the center position of the Cycloid on the Y axis. More...
 
CycloidModifierSetCycloidParameter (const CycloidParameter Param, const Real Value)
 Sets a Cycloid parameter. More...
 
CycloidModifierSetCycloidPenSize (const Real Size)
 Sets the size of the line to draw for the Cycloid. More...
 
CycloidModifierSetCycloidType (const CycloidType ToDraw)
 Sets the type of Cycloid that will be rendered. More...
 
CycloidModifierSetDefaultParameters (const Whole SquareSize)
 Sets the default values for every parameter. More...
 
CycloidModifierSetDefaultParameters (const Whole TextureWidth, const Whole TextureHeight)
 Sets the default values for every parameter. More...
 
- Public Member Functions inherited from Mezzanine::Graphics::Procedural::TextureModifier
 TextureModifier ()
 Blank constructor.
 
virtual ~TextureModifier ()
 Class destructor.
 

Protected Member Functions

void Paint (const Integer XPos, const Integer YPos, const Real Step, TextureBuffer &Buffer)
 Convenience method for the setting of the actual pixels being drawn. More...
 
void ProcessEpicycloid (const Integer XPos, const Integer YPos, const Real Step, TextureBuffer &Buffer)
 Draws a Epicycloid to the texture. More...
 
void ProcessEpitrochoid (const Integer XPos, const Integer YPos, const Real Step, TextureBuffer &Buffer)
 Draws a Epitrochoid to the texture. More...
 
void ProcessHypocycloid (const Integer XPos, const Integer YPos, const Real Step, TextureBuffer &Buffer)
 Draws a Hypocycloid to the texture. More...
 
void ProcessHypotrochoid (const Integer XPos, const Integer YPos, const Real Step, TextureBuffer &Buffer)
 Draws a Hypotrochoid to the texture. More...
 
void ProcessLissajousCurve (const Integer XPos, const Integer YPos, const Real Step, TextureBuffer &Buffer)
 Draws a Lissajous Curve to the texture. More...
 
void ProcessRoseCurve (const Integer XPos, const Integer YPos, const Real Step, TextureBuffer &Buffer)
 Draws a Rose Curve to the texture. More...
 

Protected Attributes

Vector2 CycloidCenter
 The center of the cycloid on the target texture. More...
 
ColourValue CycloidColour
 The colour of the curve line to draw. More...
 
Whole CycloidPenSize
 The size of the curved line to draw. More...
 
Real Parameter_d
 See CycloidParameter enum for details. More...
 
Real Parameter_e
 See CycloidParameter enum for details. More...
 
Real Parameter_R
 See CycloidParameter enum for details. More...
 
Real Parameter_r
 See CycloidParameter enum for details. More...
 
CycloidType Type
 The type of Cycloid to draw. More...
 

Detailed Description

A modifier that will draw a series of curved line segments.

Wikipedia says this about Cycloids: "A cycloid is the curve traced by a point on the rim of a circular wheel as the wheel rolls along a line without slippage. It is an example of a roulette, a curve generated by a curve rolling on another curve."
Currently this modifier supports 6 types of curves that can be drawn:
Hypocyloid - http://en.wikipedia.org/wiki/Hypocycloid
Hypotrochoid - http://en.wikipedia.org/wiki/Hypotrochoid
Epicycloid - http://en.wikipedia.org/wiki/Epicycloid
Epitrochoid - http://en.wikipedia.org/wiki/Epitrochoid
Rose Curve - http://en.wikipedia.org/wiki/Rose_(mathematics)
Lissajous Curve - http://en.wikipedia.org/wiki/Lissajous_curve

Setting the type will also set sane defaults for that type of Cycloid, but those default parameters are not strictly required and can be tinkered with, although you may get odd results depending on which parameter you alter and by how much. Consult the documentation on the types of Cycloids if you feel adventurous. The default parameters are as follows:

Default parameters
NameParameter RParameter rParameter dParameter eParameter k
Hypocycloid3/6 * Size1/6 * Sizeunsusedunsusedk = R / r3
Hypotrochoid5/14 * Size3/14 * Size5/14 * Size2
Epicycloid3/10 * Size1/10 * Sizeunsused3
Epitrochoid3/10 * Size1/10 * Size1/20 * Size3
Rose curve1/2 * Size41k = r / d4
Lissajous curve1/2 * Size54π/25/4

Definition at line 103 of file cycloidmodifier.h.

Member Enumeration Documentation

An enum describing the parameters that can be altered for each type of Cycloid.

Enumerator
CP_Param_R 

Generally this is altering the radius of the base circle that the drawing circle rotates around.

CP_Param_r 

Generally this is altering the radius of the drawing circle.

CP_Param_d 

Generally this is altering the distance of the drawing pen from the center of the drawing circle.

CP_Param_e 

This is exclusively used by a Lissajous Curve and skews the angle at which the drawing perspective is done, usually making it look more compressed.

CP_Param_k 

In a Rose Curve this will generate k petals if 2*k is even. If k is odd then it will generate k petals.

CP_LargeCircleRadius 

Generally this is altering the radius of the base circle that the drawing circle rotates around.

CP_SmallCircleRadius 

Generally this is altering the radius of the drawing circle.

CP_DistanceFromCenter 

Generally this is altering the distance of the drawing pen from the center of the drawing circle.

CP_RotationAngle 

This is exclusively used by a Lissajous Curve and skews the angle at which the drawing perspective is done, usually making it look more compressed.

CP_BasePetals 

In a Rose Curve this will generate k petals if 2*k is even. If k is odd then it will generate k petals.

Definition at line 117 of file cycloidmodifier.h.

The type of Cycloid to draw.

Enumerator
CT_Hypocycloid 

Sets defaults for drawing a Hypocyloid. See class detailed description for more information.

CT_Hypotrochoid 

Sets defaults for drawing a Hypotrochoid. See class detailed description for more information.

CT_Epicycloid 

Sets defaults for drawing a Epicycloid. See class detailed description for more information.

CT_Epitrochoid 

Sets defaults for drawing a Epitrochoid. See class detailed description for more information.

CT_RoseCurve 

Sets defaults for drawing a Rose Curve. See class detailed description for more information.

CT_LissajousCurve 

Sets defaults for drawing a Lissajous Curve. See class detailed description for more information.

Definition at line 107 of file cycloidmodifier.h.

Member Function Documentation

String Mezzanine::Graphics::Procedural::CycloidModifier::GetName ( ) const
virtual

Gets the name of this modifier.

Returns
Returns a string containing the name of this modifier.

Implements Mezzanine::Graphics::Procedural::TextureModifier.

Definition at line 305 of file cycloidmodifier.cpp.

void Mezzanine::Graphics::Procedural::CycloidModifier::Modify ( TextureBuffer Buffer)
virtual

Alters the generated pixels in a TextureBuffer.

Parameters
BufferThe buffer to be modified.

Implements Mezzanine::Graphics::Procedural::TextureModifier.

Definition at line 257 of file cycloidmodifier.cpp.

void Mezzanine::Graphics::Procedural::CycloidModifier::Paint ( const Integer  XPos,
const Integer  YPos,
const Real  Step,
TextureBuffer Buffer 
)
protected

Convenience method for the setting of the actual pixels being drawn.

Parameters
XPosThe position on the X axis of the pixel to paint to the texture.
YPosThe position on the Y axis of the pixel to paint to the texture.
StepThe pixel distance at which to end the current drawing segment.
BufferThe buffer being drawn to.

Definition at line 230 of file cycloidmodifier.cpp.

void Mezzanine::Graphics::Procedural::CycloidModifier::ProcessEpicycloid ( const Integer  XPos,
const Integer  YPos,
const Real  Step,
TextureBuffer Buffer 
)
protected

Draws a Epicycloid to the texture.

Parameters
XPosThe central position on the X axis of the shape to draw on the texture.
YPosThe central position on the Y axis of the shape to draw on the texture.
StepThe pixel distance at which to end the current drawing segment.
BufferThe buffer being drawn to.

Definition at line 139 of file cycloidmodifier.cpp.

void Mezzanine::Graphics::Procedural::CycloidModifier::ProcessEpitrochoid ( const Integer  XPos,
const Integer  YPos,
const Real  Step,
TextureBuffer Buffer 
)
protected

Draws a Epitrochoid to the texture.

Parameters
XPosThe central position on the X axis of the shape to draw on the texture.
YPosThe central position on the Y axis of the shape to draw on the texture.
StepThe pixel distance at which to end the current drawing segment.
BufferThe buffer being drawn to.

Definition at line 161 of file cycloidmodifier.cpp.

void Mezzanine::Graphics::Procedural::CycloidModifier::ProcessHypocycloid ( const Integer  XPos,
const Integer  YPos,
const Real  Step,
TextureBuffer Buffer 
)
protected

Draws a Hypocycloid to the texture.

Parameters
XPosThe central position on the X axis of the shape to draw on the texture.
YPosThe central position on the Y axis of the shape to draw on the texture.
StepThe pixel distance at which to end the current drawing segment.
BufferThe buffer being drawn to.

Definition at line 95 of file cycloidmodifier.cpp.

void Mezzanine::Graphics::Procedural::CycloidModifier::ProcessHypotrochoid ( const Integer  XPos,
const Integer  YPos,
const Real  Step,
TextureBuffer Buffer 
)
protected

Draws a Hypotrochoid to the texture.

Parameters
XPosThe central position on the X axis of the shape to draw on the texture.
YPosThe central position on the Y axis of the shape to draw on the texture.
StepThe pixel distance at which to end the current drawing segment.
BufferThe buffer being drawn to.

Definition at line 117 of file cycloidmodifier.cpp.

void Mezzanine::Graphics::Procedural::CycloidModifier::ProcessLissajousCurve ( const Integer  XPos,
const Integer  YPos,
const Real  Step,
TextureBuffer Buffer 
)
protected

Draws a Lissajous Curve to the texture.

Parameters
XPosThe central position on the X axis of the shape to draw on the texture.
YPosThe central position on the Y axis of the shape to draw on the texture.
StepThe pixel distance at which to end the current drawing segment.
BufferThe buffer being drawn to.

Definition at line 207 of file cycloidmodifier.cpp.

void Mezzanine::Graphics::Procedural::CycloidModifier::ProcessRoseCurve ( const Integer  XPos,
const Integer  YPos,
const Real  Step,
TextureBuffer Buffer 
)
protected

Draws a Rose Curve to the texture.

Parameters
XPosThe central position on the X axis of the shape to draw on the texture.
YPosThe central position on the Y axis of the shape to draw on the texture.
StepThe pixel distance at which to end the current drawing segment.
BufferThe buffer being drawn to.

Definition at line 183 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetColour ( const ColourValue Colour)

Sets the colour of the lines to be drawn for the Cycloid.

Parameters
ColourThe colour of the Cycloid to draw. Initial Value: (1.0,1.0,1.0,1.0).
Returns
Returns a reference to this.

Definition at line 380 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetColour ( const Real  Red,
const Real  Green,
const Real  Blue,
const Real  Alpha = 1.0 
)

Sets the colour of the lines to be drawn for the Cycloid.

Parameters
RedThe amount of red in the Cycloid that will be drawn. Initial Value: 1.0.
GreenThe amount of green in the Cycloid that will be drawn. Initial Value: 1.0.
BlueThe amount of blue in the Cycloid that will be drawn. Initial Value: 1.0.
AlphaThe amount of alpha in the Cycloid that will be drawn. Initial Value: 1.0.
Returns
Returns a reference to this.

Definition at line 386 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetCycloidCenter ( const Vector2 Center)

Sets the center position of the Cycloid.

Parameters
CenterThe center position of the Cycloid on the texture in relative units. Initial Value: (0.5,0.5).
Returns
Returns a reference to this.

Definition at line 392 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetCycloidCenter ( const Real  CenterX,
const Real  CenterY 
)

Sets the center position of the Cycloid.

Parameters
CenterXThe center position of the Cycloid on the texture on the X axis in relative units. Initial Value: 0.5.
CenterYThe center position of the Cycloid on the texture on the Y axis in relative units. Initial Value: 0.5.
Returns
Returns a reference to this.

Definition at line 398 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetCycloidCenterX ( const Real  X)

Sets the center position of the Cycloid on the X axis.

Parameters
XThe center position of the Cycloid on the texture on the X axis in relative units. Initial Value: 0.5.
Returns
Returns a reference to this.

Definition at line 404 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetCycloidCenterY ( const Real  Y)

Sets the center position of the Cycloid on the Y axis.

Parameters
YThe center position of the Cycloid on the texture on the Y axis in relative units. Initial Value: 0.5.
Returns
Returns a reference to this.

Definition at line 410 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetCycloidParameter ( const CycloidParameter  Param,
const Real  Value 
)

Sets a Cycloid parameter.

Parameters
ParamThe parameter to be altered. See the CycloidParameter enum for more details.
ValueThe value to be assigned to the specified parameter. See Default Parameters table in the class detailed description for more information.
Returns
Returns a reference to this.

Definition at line 416 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetCycloidPenSize ( const Real  Size)

Sets the size of the line to draw for the Cycloid.

Parameters
SizeThe pixel width of the lines drawn for the Cycloid. Initial Value: 1.
Returns
Returns a reference to this.

Definition at line 468 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetCycloidType ( const CycloidType  ToDraw)

Sets the type of Cycloid that will be rendered.

Parameters
ToDrawThe type of Cycloid to draw. Initial Value: CT_Hypocycloid.
Returns
Returns a reference to this.

Definition at line 311 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetDefaultParameters ( const Whole  SquareSize)

Sets the default values for every parameter.

Parameters
SquareSizeThe pixel width and height of the texture to draw to.
Returns
Returns a reference to this.

Definition at line 317 of file cycloidmodifier.cpp.

CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetDefaultParameters ( const Whole  TextureWidth,
const Whole  TextureHeight 
)

Sets the default values for every parameter.

Parameters
TextureWidthThe pixel width of the texture to draw to.
TextureHeightThe pixel height of the texture to draw to.
Returns
Returns a reference to this.

Definition at line 322 of file cycloidmodifier.cpp.

Member Data Documentation

Vector2 Mezzanine::Graphics::Procedural::CycloidModifier::CycloidCenter
protected

The center of the cycloid on the target texture.

Definition at line 137 of file cycloidmodifier.h.

ColourValue Mezzanine::Graphics::Procedural::CycloidModifier::CycloidColour
protected

The colour of the curve line to draw.

Definition at line 134 of file cycloidmodifier.h.

Whole Mezzanine::Graphics::Procedural::CycloidModifier::CycloidPenSize
protected

The size of the curved line to draw.

Definition at line 140 of file cycloidmodifier.h.

Real Mezzanine::Graphics::Procedural::CycloidModifier::Parameter_d
protected

See CycloidParameter enum for details.

Definition at line 149 of file cycloidmodifier.h.

Real Mezzanine::Graphics::Procedural::CycloidModifier::Parameter_e
protected

See CycloidParameter enum for details.

Definition at line 152 of file cycloidmodifier.h.

Real Mezzanine::Graphics::Procedural::CycloidModifier::Parameter_R
protected

See CycloidParameter enum for details.

Definition at line 143 of file cycloidmodifier.h.

Real Mezzanine::Graphics::Procedural::CycloidModifier::Parameter_r
protected

See CycloidParameter enum for details.

Definition at line 146 of file cycloidmodifier.h.

CycloidType Mezzanine::Graphics::Procedural::CycloidModifier::Type
protected

The type of Cycloid to draw.

Definition at line 155 of file cycloidmodifier.h.


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