A modifier that will draw a series of curved line segments. More...
#include <cycloidmodifier.h>
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... | |
CycloidModifier & | SetColour (const ColourValue &Colour) |
Sets the colour of the lines to be drawn for the Cycloid. More... | |
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. More... | |
CycloidModifier & | SetCycloidCenter (const Vector2 &Center) |
Sets the center position of the Cycloid. More... | |
CycloidModifier & | SetCycloidCenter (const Real CenterX, const Real CenterY) |
Sets the center position of the Cycloid. More... | |
CycloidModifier & | SetCycloidCenterX (const Real X) |
Sets the center position of the Cycloid on the X axis. More... | |
CycloidModifier & | SetCycloidCenterY (const Real Y) |
Sets the center position of the Cycloid on the Y axis. More... | |
CycloidModifier & | SetCycloidParameter (const CycloidParameter Param, const Real Value) |
Sets a Cycloid parameter. More... | |
CycloidModifier & | SetCycloidPenSize (const Real Size) |
Sets the size of the line to draw for the Cycloid. More... | |
CycloidModifier & | SetCycloidType (const CycloidType ToDraw) |
Sets the type of Cycloid that will be rendered. More... | |
CycloidModifier & | SetDefaultParameters (const Whole SquareSize) |
Sets the default values for every parameter. More... | |
CycloidModifier & | SetDefaultParameters (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... | |
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:
Name | Parameter R | Parameter r | Parameter d | Parameter e | Parameter k | |
---|---|---|---|---|---|---|
Hypocycloid | 3/6 * Size | 1/6 * Size | unsused | unsused | k = R / r | 3 |
Hypotrochoid | 5/14 * Size | 3/14 * Size | 5/14 * Size | 2 | ||
Epicycloid | 3/10 * Size | 1/10 * Size | unsused | 3 | ||
Epitrochoid | 3/10 * Size | 1/10 * Size | 1/20 * Size | 3 | ||
Rose curve | 1/2 * Size | 4 | 1 | k = r / d | 4 | |
Lissajous curve | 1/2 * Size | 5 | 4 | π/2 | 5/4 |
Definition at line 103 of file cycloidmodifier.h.
An enum describing the parameters that can be altered for each type of Cycloid.
Definition at line 117 of file cycloidmodifier.h.
The type of Cycloid to draw.
Definition at line 107 of file cycloidmodifier.h.
|
virtual |
Gets the name of this modifier.
Implements Mezzanine::Graphics::Procedural::TextureModifier.
Definition at line 305 of file cycloidmodifier.cpp.
|
virtual |
Alters the generated pixels in a TextureBuffer.
Buffer | The buffer to be modified. |
Implements Mezzanine::Graphics::Procedural::TextureModifier.
Definition at line 257 of file cycloidmodifier.cpp.
|
protected |
Convenience method for the setting of the actual pixels being drawn.
XPos | The position on the X axis of the pixel to paint to the texture. |
YPos | The position on the Y axis of the pixel to paint to the texture. |
Step | The pixel distance at which to end the current drawing segment. |
Buffer | The buffer being drawn to. |
Definition at line 230 of file cycloidmodifier.cpp.
|
protected |
Draws a Epicycloid to the texture.
XPos | The central position on the X axis of the shape to draw on the texture. |
YPos | The central position on the Y axis of the shape to draw on the texture. |
Step | The pixel distance at which to end the current drawing segment. |
Buffer | The buffer being drawn to. |
Definition at line 139 of file cycloidmodifier.cpp.
|
protected |
Draws a Epitrochoid to the texture.
XPos | The central position on the X axis of the shape to draw on the texture. |
YPos | The central position on the Y axis of the shape to draw on the texture. |
Step | The pixel distance at which to end the current drawing segment. |
Buffer | The buffer being drawn to. |
Definition at line 161 of file cycloidmodifier.cpp.
|
protected |
Draws a Hypocycloid to the texture.
XPos | The central position on the X axis of the shape to draw on the texture. |
YPos | The central position on the Y axis of the shape to draw on the texture. |
Step | The pixel distance at which to end the current drawing segment. |
Buffer | The buffer being drawn to. |
Definition at line 95 of file cycloidmodifier.cpp.
|
protected |
Draws a Hypotrochoid to the texture.
XPos | The central position on the X axis of the shape to draw on the texture. |
YPos | The central position on the Y axis of the shape to draw on the texture. |
Step | The pixel distance at which to end the current drawing segment. |
Buffer | The buffer being drawn to. |
Definition at line 117 of file cycloidmodifier.cpp.
|
protected |
Draws a Lissajous Curve to the texture.
XPos | The central position on the X axis of the shape to draw on the texture. |
YPos | The central position on the Y axis of the shape to draw on the texture. |
Step | The pixel distance at which to end the current drawing segment. |
Buffer | The buffer being drawn to. |
Definition at line 207 of file cycloidmodifier.cpp.
|
protected |
Draws a Rose Curve to the texture.
XPos | The central position on the X axis of the shape to draw on the texture. |
YPos | The central position on the Y axis of the shape to draw on the texture. |
Step | The pixel distance at which to end the current drawing segment. |
Buffer | The 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.
Colour | The colour of the Cycloid to draw. Initial Value: (1.0,1.0,1.0,1.0). |
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.
Red | The amount of red in the Cycloid that will be drawn. Initial Value: 1.0. |
Green | The amount of green in the Cycloid that will be drawn. Initial Value: 1.0. |
Blue | The amount of blue in the Cycloid that will be drawn. Initial Value: 1.0. |
Alpha | The amount of alpha in the Cycloid that will be drawn. Initial Value: 1.0. |
Definition at line 386 of file cycloidmodifier.cpp.
CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetCycloidCenter | ( | const Vector2 & | Center | ) |
Sets the center position of the Cycloid.
Center | The center position of the Cycloid on the texture in relative units. Initial Value: (0.5,0.5). |
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.
CenterX | The center position of the Cycloid on the texture on the X axis in relative units. Initial Value: 0.5. |
CenterY | The center position of the Cycloid on the texture on the Y axis in relative units. Initial Value: 0.5. |
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.
X | The center position of the Cycloid on the texture on the X axis in relative units. Initial Value: 0.5. |
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.
Y | The center position of the Cycloid on the texture on the Y axis in relative units. Initial Value: 0.5. |
Definition at line 410 of file cycloidmodifier.cpp.
CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetCycloidParameter | ( | const CycloidParameter | Param, |
const Real | Value | ||
) |
Sets a Cycloid parameter.
Param | The parameter to be altered. See the CycloidParameter enum for more details. |
Value | The value to be assigned to the specified parameter. See Default Parameters table in the class detailed description for more information. |
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.
Size | The pixel width of the lines drawn for the Cycloid. Initial Value: 1. |
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.
ToDraw | The type of Cycloid to draw. Initial Value: CT_Hypocycloid. |
Definition at line 311 of file cycloidmodifier.cpp.
CycloidModifier & Mezzanine::Graphics::Procedural::CycloidModifier::SetDefaultParameters | ( | const Whole | SquareSize | ) |
Sets the default values for every parameter.
SquareSize | The pixel width and height of the texture to draw to. |
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.
TextureWidth | The pixel width of the texture to draw to. |
TextureHeight | The pixel height of the texture to draw to. |
Definition at line 322 of file cycloidmodifier.cpp.
|
protected |
The center of the cycloid on the target texture.
Definition at line 137 of file cycloidmodifier.h.
|
protected |
The colour of the curve line to draw.
Definition at line 134 of file cycloidmodifier.h.
|
protected |
The size of the curved line to draw.
Definition at line 140 of file cycloidmodifier.h.
|
protected |
See CycloidParameter enum for details.
Definition at line 149 of file cycloidmodifier.h.
|
protected |
See CycloidParameter enum for details.
Definition at line 152 of file cycloidmodifier.h.
|
protected |
See CycloidParameter enum for details.
Definition at line 143 of file cycloidmodifier.h.
|
protected |
See CycloidParameter enum for details.
Definition at line 146 of file cycloidmodifier.h.
|
protected |
The type of Cycloid to draw.
Definition at line 155 of file cycloidmodifier.h.