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

Create a texture consisting of cells aligned in a grid, or a chessboard. More...

#include <ProceduralTextureGenerator.h>

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

Public Types

enum  CELL_MODE { MODE_GRID, MODE_CHESSBOARD }
 Mode how to paint cells. More...
 
enum  CELL_PATTERN { PATTERN_BOTH, PATTERN_CROSS, PATTERN_CONE }
 Mode how to construct cells. More...
 

Public Member Functions

 Cell (TextureBufferPtr pBuffer)
 Default constructor. More...
 
CellsetColour (Ogre::ColourValue colour)
 Set the colour of the cell top. More...
 
CellsetColour (Ogre::Real red, Ogre::Real green, Ogre::Real blue, Ogre::Real alpha=1.0f)
 Set the colour of the cell top. More...
 
CellsetSeed (Ogre::uint seed)
 Set the seed for "random" number generator. More...
 
CellsetRegularity (Ogre::uchar regularity)
 Set the regularity of texture. More...
 
CellsetDensity (Ogre::uint density)
 Set the density of cells in texture. More...
 
CellsetMode (CELL_MODE mode)
 Set the cell mode of texture. More...
 
CellsetPattern (CELL_PATTERN pattern)
 Set the cell pattern of texture. More...
 
TextureBufferPtr process ()
 Run image generation. 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

Create a texture consisting of cells aligned in a grid, or a chessboard.

Cells can be irregular. If considered bump map, they have pyramid form.

Examples:

Default (MODE_GRID + PATTERN_BOTH)

Procedural::TextureBuffer bufferCellDefault(256);
Procedural::Cell(&bufferCellDefault).setDensity(4).process();

MODE_CHESSBOARD + PATTERN_CONE

MODE_GRID + PATTERN_CROSS

Member Enumeration Documentation

◆ CELL_MODE

Mode how to paint cells.

Enumerator
MODE_GRID 

Paint cells on a grid.

MODE_CHESSBOARD 

Paint cells on a chessboard.

◆ CELL_PATTERN

Mode how to construct cells.

Enumerator
PATTERN_BOTH 

PATTERN_CROSS | PATTERN_CONE.

PATTERN_CROSS 

Construct cells from vertices.

PATTERN_CONE 

Construct cells from cicles.

Constructor & Destructor Documentation

◆ Cell()

Procedural::Cell::Cell ( TextureBufferPtr  pBuffer)

Default constructor.

Parameters
pBufferImage buffer where to store the generated image.

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::Cell::process ( )
virtual

Run image generation.

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

Implements Procedural::TextureProcessing.

◆ setColour() [1/2]

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

Set the colour of the cell top.

Parameters
colourNew colour of the cell top (default Ogre::ColourValue::White)

◆ setColour() [2/2]

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

Set the colour of the cell top.

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

◆ setDensity()

Cell& Procedural::Cell::setDensity ( Ogre::uint  density)

Set the density of cells in texture.

At least you have to set number of rows and columns in the grid to 1 or above.

Parameters
densityNew number of columns and rows (default 8)

◆ setLog()

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

Enable/Disable logging.

Parameters
enabletrue enables logging of filter actions

◆ setMode()

Cell& Procedural::Cell::setMode ( CELL_MODE  mode)

Set the cell mode of texture.

Parameters
modeNew mode for cell ground (default MODE_GRID)

◆ setPattern()

Cell& Procedural::Cell::setPattern ( CELL_PATTERN  pattern)

Set the cell pattern of texture.

Parameters
patternNew base of cell construction (default PATTERN_BOTH)

◆ setRegularity()

Cell& Procedural::Cell::setRegularity ( Ogre::uchar  regularity)

Set the regularity of texture.

The maximum value of 255 creates identical cells. The minimum 0 creates random forms for each cells.

Parameters
regularityNew value for chaotic cell forms (default 128)

◆ setSeed()

Cell& Procedural::Cell::setSeed ( Ogre::uint  seed)

Set the seed for "random" number generator.

Parameters
seedSeed value where to set the random number generator (default 5120)

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::Cell::setDensity
Cell & setDensity(Ogre::uint density)
Set the density of cells in texture.
Procedural::Cell::setMode
Cell & setMode(CELL_MODE mode)
Set the cell mode of texture.
Procedural::Cell::setPattern
Cell & setPattern(CELL_PATTERN pattern)
Set the cell pattern of texture.
Procedural::Cell
Create a texture consisting of cells aligned in a grid, or a chessboard.
Definition: ProceduralTextureGenerator.h:71
Procedural::Cell::process
TextureBufferPtr process()
Run image generation.
Procedural::Cell::MODE_CHESSBOARD
@ MODE_CHESSBOARD
Paint cells on a chessboard.
Definition: ProceduralTextureGenerator.h:78
Procedural::Cell::MODE_GRID
@ MODE_GRID
Paint cells on a grid.
Definition: ProceduralTextureGenerator.h:77
Procedural::TextureBuffer
class to store image data while processing
Definition: ProceduralTextureBuffer.h:50
Procedural::Cell::PATTERN_CROSS
@ PATTERN_CROSS
Construct cells from vertices.
Definition: ProceduralTextureGenerator.h:85
Procedural::Cell::PATTERN_CONE
@ PATTERN_CONE
Construct cells from cicles.
Definition: ProceduralTextureGenerator.h:86