SO3Engine
Public Types | Public Member Functions | List of all members
SO3::SColourGradient Class Reference

#include <SO3ColourGradient.h>

Public Types

typedef ColourFrames::value_type ColourFrame
 A single colour frame.
 

Public Member Functions

 SColourGradient (const bool &fillBoundsWithDefault=true)
 
 SColourGradient (const Ogre::ColourValue &overridedMinDefaultColour, const Ogre::ColourValue &overridedMaxDefaultColour)
 
 ~SColourGradient ()
 
void AddColourFrame (const ColourFrame &colourFrame)
 
void AddColourFrame (const float &gradientPosition, const Ogre::ColourValue &colour)
 
void Clear ()
 
const Ogre::ColourValue GetColour (const float &gradientPosition) const
 

Detailed Description

Optimized gradient class, idea comes from SkyX, but totally rewritten in order to be more efficient.

Definition at line 36 of file SO3ColourGradient.h.

Member Typedef Documentation

◆ ColourFrame

typedef ColourFrames::value_type SO3::SColourGradient::ColourFrame

A single colour frame.

Definition at line 47 of file SO3ColourGradient.h.

Constructor & Destructor Documentation

◆ SColourGradient() [1/2]

SO3::SColourGradient::SColourGradient ( const bool &  fillBoundsWithDefault = true)
    Constructor
Parameters
fillBoundsWithDefaultIf true, and no colour frame with index 0.0 was provided, provide a default black colour for this position of the gradient. In the same way, if no colour frame is provided for 1.0 value, a default white colour is provided for this position of the gradient.

Definition at line 30 of file SO3ColourGradient.cpp.

◆ SColourGradient() [2/2]

SO3::SColourGradient::SColourGradient ( const Ogre::ColourValue &  overridedMinDefaultColour,
const Ogre::ColourValue &  overridedMaxDefaultColour 
)
    Constructor, bound filling is automatically activated when using this constructor.
Parameters
overridedMinDefaultColourThe default "black" colour used by automatic bound filling will be replaced by the provided colour
overridedMaxDefaultColour

Definition at line 36 of file SO3ColourGradient.cpp.

◆ ~SColourGradient()

SO3::SColourGradient::~SColourGradient ( )

Destructor

Definition at line 42 of file SO3ColourGradient.cpp.

Member Function Documentation

◆ AddColourFrame() [1/2]

void SO3::SColourGradient::AddColourFrame ( const ColourFrame colourFrame)
inline

Add colour frame

Parameters
colourFrameColour frame

Definition at line 72 of file SO3ColourGradient.h.

◆ AddColourFrame() [2/2]

void SO3::SColourGradient::AddColourFrame ( const float &  gradientPosition,
const Ogre::ColourValue &  colour 
)
inline
    Add colour frame
    @param colour Coulour of this frame
Parameters
gradientPositionPosition of this frame in the gradient (overwrite if value exists).

Definition at line 82 of file SO3ColourGradient.h.

◆ Clear()

void SO3::SColourGradient::Clear ( )
inline

Clear colour gradient

Definition at line 94 of file SO3ColourGradient.h.

◆ GetColour()

const Ogre::ColourValue SO3::SColourGradient::GetColour ( const float &  gradientPosition) const

Get colour value

Parameters
gradientPositionThe gradient point in [0,1] range
Returns
Colour at the given gradient position

Definition at line 46 of file SO3ColourGradient.cpp.


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