Ogre Procedural  0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Procedural::Polygon Class Reference

Draw a polygon. More...

#include <ProceduralTextureModifiers.h>

Inheritance diagram for Procedural::Polygon:
Inheritance graph
[legend]

Public Member Functions

 Polygon (TextureBufferPtr pBuffer)
 Default constructor. More...
 
PolygonsetColour (Ogre::ColourValue colour)
 Set the fill colour of the polygon. More...
 
PolygonsetColour (Ogre::Real red, Ogre::Real green, Ogre::Real blue, Ogre::Real alpha=1.0f)
 Set the fill colour of the polygon. More...
 
PolygonsetRadius (size_t radius)
 Set the absolute radius of the polygon edges. More...
 
PolygonsetRadius (Ogre::Real radius)
 Set the relative radius of the polygon edges. More...
 
PolygonsetCenterX (size_t x)
 Set absolute x position of polygon center point in px. More...
 
PolygonsetCenterX (Ogre::Real x)
 Set relative x position of polygon center point as Real. More...
 
PolygonsetCenterY (size_t y)
 Set absolute y position of polygon center point in px. More...
 
PolygonsetCenterY (Ogre::Real y)
 Set relative y position of polygon center point as Real. More...
 
PolygonsetCenter (Ogre::Vector2 pos, bool relative=true)
 Set the position of polygon center point. More...
 
PolygonsetCenter (size_t x, size_t y)
 Set the position of polygon center point. More...
 
PolygonsetCenter (Ogre::Real x, Ogre::Real y, bool relative=true)
 Set the position of polygon center point. More...
 
PolygonsetSides (size_t n)
 Set number of polygon sides. More...
 
TextureBufferPtr process ()
 Run image manipulation. More...
 
Ogre::String getName ()
 Get name of the filter as string. More...
 
void setLog (bool enable=true)
 Enable/Disable logging. More...
 

Protected Member Functions

void logMsg (Ogre::String msg)
 

Protected Attributes

TextureBufferPtr mBuffer
 
Ogre::String mName
 
bool mLog
 

Detailed Description

Draw a polygon.

Draw a regular polygon on top of previous content.

Example:

dot_texture_35.png

Constructor & Destructor Documentation

◆ Polygon()

Procedural::Polygon::Polygon ( TextureBufferPtr  pBuffer)

Default constructor.

Parameters
pBufferImage buffer where to modify the image.

References Procedural::TextureBuffer::getHeight(), and Procedural::TextureBuffer::getWidth().

Member Function Documentation

◆ getName()

Ogre::String Procedural::TextureProcessing::getName ( )
inherited

Get name of the filter as string.

◆ logMsg()

void Procedural::TextureProcessing::logMsg ( Ogre::String  msg)
protectedinherited

◆ process()

TextureBufferPtr Procedural::Polygon::process ( )
virtual

Run image manipulation.

Returns
Pointer to image buffer which has been set in the constructor.

Implements Procedural::TextureProcessing.

◆ setCenter() [1/3]

Polygon& Procedural::Polygon::setCenter ( Ogre::Real  x,
Ogre::Real  y,
bool  relative = true 
)

Set the position of polygon center point.

Parameters
xNew relative x position of polygon center [0.0, 1.0] (default 0.5)
yNew relative y position of polygon center [0.0, 1.0] (default 0.5)
relativeIf this is set to true (default) the vector data are relative [0.0, 1.0]; else absolut [px]

◆ setCenter() [2/3]

Polygon& Procedural::Polygon::setCenter ( Ogre::Vector2  pos,
bool  relative = true 
)

Set the position of polygon center point.

Parameters
posVector to the center point of the polygon (default: x=0.5, y=0.5)
relativeIf this is set to true (default) the vector data are relative [0.0, 1.0]; else absolut [px]

◆ setCenter() [3/3]

Polygon& Procedural::Polygon::setCenter ( size_t  x,
size_t  y 
)

Set the position of polygon center point.

Parameters
xNew absolute x position of polygon center (default 1/2 * image width)
yNew absolute y position of polygon center (default 1/2 * image width)

◆ setCenterX() [1/2]

Polygon& Procedural::Polygon::setCenterX ( Ogre::Real  x)

Set relative x position of polygon center point as Real.

Parameters
xNew relative x position of polygon center [0.0, 1.0] (default 0.5)

◆ setCenterX() [2/2]

Polygon& Procedural::Polygon::setCenterX ( size_t  x)

Set absolute x position of polygon center point in px.

Parameters
xNew absolute x position of polygon center (default 1/2 * image width)

◆ setCenterY() [1/2]

Polygon& Procedural::Polygon::setCenterY ( Ogre::Real  y)

Set relative y position of polygon center point as Real.

Parameters
yNew relative y position of polygon center [0.0, 1.0] (default 0.5)

◆ setCenterY() [2/2]

Polygon& Procedural::Polygon::setCenterY ( size_t  y)

Set absolute y position of polygon center point in px.

Parameters
yNew absolute y position of polygon center (default 1/2 * image width)

◆ setColour() [1/2]

Polygon& Procedural::Polygon::setColour ( Ogre::ColourValue  colour)

Set the fill colour of the polygon.

Parameters
colourNew colour for processing (default Ogre::ColourValue::White)

◆ setColour() [2/2]

Polygon& Procedural::Polygon::setColour ( Ogre::Real  red,
Ogre::Real  green,
Ogre::Real  blue,
Ogre::Real  alpha = 1.0f 
)

Set the fill colour of the polygon.

Parameters
redRed value of the fill colour [0.0, 1.0] (default 1.0)
greenGreen value of the fill colour [0.0, 1.0] (default 1.0)
blueBlue value of the fill colour [0.0, 1.0] (default 1.0)
alphaAlpha value of the fill colour [0.0, 1.0] (default 1.0)

◆ setLog()

void Procedural::TextureProcessing::setLog ( bool  enable = true)
inherited

Enable/Disable logging.

Parameters
enabletrue enables logging of filter actions

◆ setRadius() [1/2]

Polygon& Procedural::Polygon::setRadius ( Ogre::Real  radius)

Set the relative radius of the polygon edges.

Parameters
radiusNew relative radius of the polygon edges [0.0, 1.0] (default 0.5)

◆ setRadius() [2/2]

Polygon& Procedural::Polygon::setRadius ( size_t  radius)

Set the absolute radius of the polygon edges.

Parameters
radiusNew absolute radius of the polygon edges in px (default smaller value of 1/2 * image width and 1/2 * image height)

◆ setSides()

Polygon& Procedural::Polygon::setSides ( size_t  n)

Set number of polygon sides.

Parameters
nNew number of polygon sides (default 3)

Member Data Documentation

◆ mBuffer

TextureBufferPtr Procedural::TextureProcessing::mBuffer
protectedinherited

◆ mLog

bool Procedural::TextureProcessing::mLog
protectedinherited

◆ mName

Ogre::String Procedural::TextureProcessing::mName
protectedinherited

The documentation for this class was generated from the following file:
Procedural::Polygon::setSides
Polygon & setSides(size_t n)
Set number of polygon sides.
Ogre::ColourValue::Red
static const ColourValue Red
Ogre::ColourValue
Procedural::Polygon
Draw a polygon.
Definition: ProceduralTextureModifiers.h:2118
Procedural::Solid
Fills full image with given colour.
Definition: ProceduralTextureGenerator.h:563
Procedural::TextureBuffer
class to store image data while processing
Definition: ProceduralTextureBuffer.h:50
Procedural::Solid::process
TextureBufferPtr process()
Run image generation.
Procedural::Solid::setColour
Solid & setColour(Ogre::ColourValue colour)
Sets the fill colour of the image.
Procedural::Polygon::setColour
Polygon & setColour(Ogre::ColourValue colour)
Set the fill colour of the polygon.
Procedural::Polygon::process
TextureBufferPtr process()
Run image manipulation.