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

A modifier that draws a simple coloured circle onto the texture. More...

#include <circlemodifier.h>

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

Public Member Functions

 CircleModifier ()
 Blank constructor.
 
virtual ~CircleModifier ()
 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...
 
CircleModifierSetColour (const ColourValue &Colour)
 Sets the colour of the circle. More...
 
CircleModifierSetColour (const Real Red, const Real Green, const Real Blue, const Real Alpha=1.0)
 Sets the colour of the circle. More...
 
CircleModifierSetPosition (const Real XRel, const Real YRel, const Integer XAdj, const Integer YAdj)
 Sets the relative and offset values for the rectangle position. More...
 
CircleModifierSetRadius (const Whole Radius)
 Sets the radius of the circle. More...
 
CircleModifierSetXPositionAdj (const Integer X)
 Sets the absolute component of the center position on the X axis. More...
 
CircleModifierSetXPositionRel (const Real X)
 Sets the relative component of the center position on the X axis. More...
 
CircleModifierSetYPositionAdj (const Integer Y)
 Sets the absolute component of the center position on the Y axis. More...
 
CircleModifierSetYPositionRel (const Real Y)
 Sets the relative component of the center position on the Y axis. More...
 
- Public Member Functions inherited from Mezzanine::Graphics::Procedural::TextureModifier
 TextureModifier ()
 Blank constructor.
 
virtual ~TextureModifier ()
 Class destructor.
 

Protected Member Functions

void PutPixel (const Integer XPos, const Integer YPos, TextureBuffer &Buffer)
 Convenience method for placing a pixel for the circle. More...
 

Protected Attributes

ColourValue CircleColour
 The colour of the circle to be drawn. More...
 
Whole CircleRadius
 The radius of the circle. More...
 
Integer CircleXAdj
 The position on the X axis of the circle. More...
 
Real CircleXRel
 The position on the X axis of the circle. More...
 
Integer CircleYAdj
 The position on the Y axis of the circle. More...
 
Real CircleYRel
 The position on the Y axis of the circle. More...
 

Detailed Description

A modifier that draws a simple coloured circle onto the texture.

Definition at line 82 of file circlemodifier.h.

Member Function Documentation

String Mezzanine::Graphics::Procedural::CircleModifier::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 152 of file circlemodifier.cpp.

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

Alters the generated pixels in a TextureBuffer.

Parameters
BufferThe buffer to be modified.
Todo:
Investigate the proper implementation of this algorithm. This appears to be the Midpoint Circle Algorithm, but also can't handle the left and right edges after the angle becomes perfectly diagonal. This should be able to produce superior results, faster, compared to the brute force algorithm above.

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

Definition at line 104 of file circlemodifier.cpp.

void Mezzanine::Graphics::Procedural::CircleModifier::PutPixel ( const Integer  XPos,
const Integer  YPos,
TextureBuffer Buffer 
)
protected

Convenience method for placing a pixel for the circle.

Parameters
XPosThe position on the X axis to place the pixel.
YPosThe position on the Y axis to place the pixel.
BufferA reference to the buffer being worked on.

Definition at line 90 of file circlemodifier.cpp.

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

Sets the colour of the circle.

Parameters
ColourThe colour of the circle to be drawn. Initial Value: 1.0,1.0,1.0,1.0.
Returns
Returns a reference to this.

Definition at line 158 of file circlemodifier.cpp.

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

Sets the colour of the circle.

Parameters
RedThe red colour component of the circle to be drawn. Initial Value: 1.0.
GreenThe red colour component of the circle to be drawn. Initial Value: 1.0.
BlueThe red colour component of the circle to be drawn. Initial Value: 1.0.
AlphaThe red colour component of the circle to be drawn. Initial Value: 1.0.
Returns
Returns a reference to this.

Definition at line 164 of file circlemodifier.cpp.

CircleModifier & Mezzanine::Graphics::Procedural::CircleModifier::SetPosition ( const Real  XRel,
const Real  YRel,
const Integer  XAdj,
const Integer  YAdj 
)

Sets the relative and offset values for the rectangle position.

Parameters
XRelThe left edge of the rectangle in relative coordinates. Initial Value: 0.5.
YRelThe top edge of the rectangle in relative coordinates. Initial Value: 0.5.
XAdjThe left edge adjustment of the rectangle after relative coordinates are calculated. Initial Value: 0.
YAdjThe top edge adjustment of the rectangle after relative coordinates are calculated. Initial Value: 0.
Returns
Returns a reference to this.

Definition at line 176 of file circlemodifier.cpp.

CircleModifier & Mezzanine::Graphics::Procedural::CircleModifier::SetRadius ( const Whole  Radius)

Sets the radius of the circle.

Parameters
RadiusThe radius of the circle to be drawn. Initial Value: 0.
Returns
Returns a reference to this.

Definition at line 170 of file circlemodifier.cpp.

CircleModifier & Mezzanine::Graphics::Procedural::CircleModifier::SetXPositionAdj ( const Integer  X)

Sets the absolute component of the center position on the X axis.

Parameters
XThe X axis adjustment of the rectangle after relative coordinates are calculated. Initial Value: 0.
Returns
Returns a reference to this.

Definition at line 197 of file circlemodifier.cpp.

CircleModifier & Mezzanine::Graphics::Procedural::CircleModifier::SetXPositionRel ( const Real  X)

Sets the relative component of the center position on the X axis.

Parameters
XThe X axis center position of the circle in relative coordinates. Initial Value: 0.5.
Returns
Returns a reference to this.

Definition at line 185 of file circlemodifier.cpp.

CircleModifier & Mezzanine::Graphics::Procedural::CircleModifier::SetYPositionAdj ( const Integer  Y)

Sets the absolute component of the center position on the Y axis.

Parameters
YThe Y axis adjustment of the rectangle after relative coordinates are calculated. Initial Value: 0.
Returns
Returns a reference to this.

Definition at line 203 of file circlemodifier.cpp.

CircleModifier & Mezzanine::Graphics::Procedural::CircleModifier::SetYPositionRel ( const Real  Y)

Sets the relative component of the center position on the Y axis.

Parameters
YThe Y axis center position of the circle in relative coordinates. Initial Value: 0.5.
Returns
Returns a reference to this.

Definition at line 191 of file circlemodifier.cpp.

Member Data Documentation

ColourValue Mezzanine::Graphics::Procedural::CircleModifier::CircleColour
protected

The colour of the circle to be drawn.

Definition at line 87 of file circlemodifier.h.

Whole Mezzanine::Graphics::Procedural::CircleModifier::CircleRadius
protected

The radius of the circle.

Definition at line 90 of file circlemodifier.h.

Integer Mezzanine::Graphics::Procedural::CircleModifier::CircleXAdj
protected

The position on the X axis of the circle.

Definition at line 99 of file circlemodifier.h.

Real Mezzanine::Graphics::Procedural::CircleModifier::CircleXRel
protected

The position on the X axis of the circle.

Definition at line 93 of file circlemodifier.h.

Integer Mezzanine::Graphics::Procedural::CircleModifier::CircleYAdj
protected

The position on the Y axis of the circle.

Definition at line 102 of file circlemodifier.h.

Real Mezzanine::Graphics::Procedural::CircleModifier::CircleYRel
protected

The position on the Y axis of the circle.

Definition at line 96 of file circlemodifier.h.


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