Developer Documentation
|
#include <OpenFlipper/libs_required/ACG/Scenegraph/DrawModes.hh>
Public Member Functions | |
DrawMode (size_t _index) | |
constructor for unsigned int. More... | |
DrawMode (const ModeFlagSet &_flags) | |
constructor for ModeFlags. More... | |
size_t | getIndex () const |
get an index of the current drawMode More... | |
void | filter (DrawMode _filter) |
filter out one drawmode More... | |
void | combine (DrawMode _mode) |
combine with another drawmode | |
std::string | description () const |
bool | isAtomic () const |
Check if this is an atomic draw Mode. More... | |
bool | containsAtomicDrawMode (const DrawMode &_atomicDrawMode) const |
Check whether an Atomic DrawMode is active in this draw Mode. | |
std::vector< DrawMode > | getAtomicDrawModes () const |
Separates this drawMode into a list of all separate atomic draw modes. More... | |
size_t | maxModes () const |
Get the number of maximum Modes which could be handled by the current implementation. | |
const DrawModeProperties * | getDrawModeProperties () const |
returns the base properties of this draw mode More... | |
void | setDrawModeProperties (const DrawModeProperties *_props) |
set the base properties of this draw mode More... | |
void | setDrawModeProperties (const DrawModeProperties &_props) |
set the base properties of this draw mode More... | |
bool | checkConsistency () const |
checks consistency of property layers More... | |
int | getLayerIndexByPrimitive (DrawModePrimitive _type) const |
search for layer with specified primitive More... | |
Operators | |
DrawMode & | operator= (const DrawMode &_mode) |
bool | operator== (const DrawMode &_mode) const |
DrawMode | operator & (const DrawMode &_mode) const |
DrawMode & | operator++ () |
DrawMode & | operator|= (const DrawMode &_mode2) |
DrawMode & | operator &= (const DrawMode &_mode2) |
bool | operator!= (const DrawMode &_mode2) const |
DrawMode | operator| (const DrawMode &_mode2) const |
DrawMode | operator^ (const DrawMode &_mode2) const |
DrawMode | operator~ () const |
operator bool () const | |
Layer Management | |
void | addLayer (const DrawModeProperties *_props) |
add another layer on top of this drawmode More... | |
size_t | getNumLayers () const |
returns the layer count | |
const DrawModeProperties * | getLayer (unsigned int _i) const |
returns the property set at layer i More... | |
bool | removeLayer (unsigned int _i) |
remove layer at index i More... | |
bool | removeLayer (const DrawModeProperties *_prop) |
remove layer if it is in list More... | |
int | getLayerIndex (const DrawModeProperties *_prop) const |
returns layer index of a property, -1 if not in list More... | |
Static Public Member Functions | |
static DrawMode | getFromDescription (std::string _description) |
Private Attributes | |
ModeFlagSet | modeFlags_ |
std::vector< DrawModeProperties > | layers_ |
Specifies a DrawMode.
This class specifies a DrawMode. It can contain several properties and layers that define, how objects will be rendered.
Definition at line 288 of file DrawModes.hh.
|
explicit |
constructor for unsigned int.
This constructor creates a DrawMode with the given drawMode index. Be CareFull! this constructor can only be used to construct atomic draw modes! The int will not be handled like an bitset but really as an index. See the list of draw modes below to check for the right numbers. You should use the predefined drawModes or create new ones using the other functions and ignore this constructor!
_index | Index of the new DrawMode |
Definition at line 188 of file DrawModes.cc.
|
explicit |
constructor for ModeFlags.
This constructor creates a DrawMode from a bitset. This makes it easier to predefine draw modes using a bitset.
_flags | Flags for the new drawmode defined by a bitset |
Definition at line 205 of file DrawModes.cc.
void ACG::SceneGraph::DrawModes::DrawMode::addLayer | ( | const DrawModeProperties * | _props | ) |
add another layer on top of this drawmode
This allows for combinations of DrawModes. The renderer will iterator over all layers of the drawmode and issue a new draw call for each layer. Example: layer 0 : flat shading properties layer 1 : edge drawing properties
The result will be a flat shaded object with it's wireframe on top of it. Does duplicate check, in case the property set is already in the layer list.
addLayer is also called in bitwise | operator for backwards compatibility with bitset DrawModes
_props | Property that should be added |
Definition at line 540 of file DrawModes.cc.
bool ACG::SceneGraph::DrawModes::DrawMode::checkConsistency | ( | ) | const |
checks consistency of property layers
There should only be at most one layer for each primitive type for example
Definition at line 573 of file DrawModes.cc.
std::string ACG::SceneGraph::DrawModes::DrawMode::description | ( | ) | const |
Get a description string for this DrawMode An empty string is returned if this is not a valid draw mode. this list has the format DrawModeName+DrawMOdeName+...
Definition at line 444 of file DrawModes.cc.
void ACG::SceneGraph::DrawModes::DrawMode::filter | ( | DrawMode | _filter | ) |
filter out one drawmode
This removes one or more drawmodes if this drawode is not atomic.
Definition at line 463 of file DrawModes.cc.
std::vector< DrawMode > ACG::SceneGraph::DrawModes::DrawMode::getAtomicDrawModes | ( | ) | const |
Separates this drawMode into a list of all separate atomic draw modes.
A drawMode can consist of several atomic draw modes. This function returns a list of the separated atomic draw modes.
Definition at line 495 of file DrawModes.cc.
const DrawModeProperties * ACG::SceneGraph::DrawModes::DrawMode::getDrawModeProperties | ( | ) | const |
returns the base properties of this draw mode
Base properties are the original properties that defined the DrawMode before any merge operation. They are located at layer 0, so actually this function has the same effect as getLayer(0).
Every DrawMode is property based with only two exceptions:
getDrawModeProperties returns 0 for these.
Definition at line 567 of file DrawModes.cc.
size_t ACG::SceneGraph::DrawModes::DrawMode::getIndex | ( | ) | const |
get an index of the current drawMode
If this drawMode is a combination of different drawModes, the returned value will be 0. Otherwise the internal flag index will be returned
Definition at line 434 of file DrawModes.cc.
const DrawModeProperties * ACG::SceneGraph::DrawModes::DrawMode::getLayer | ( | unsigned int | _i | ) | const |
returns the property set at layer i
_i | Layer that is requested |
Definition at line 535 of file DrawModes.cc.
int ACG::SceneGraph::DrawModes::DrawMode::getLayerIndex | ( | const DrawModeProperties * | _prop | ) | const |
returns layer index of a property, -1 if not in list
_prop | Property to be searched for |
Definition at line 611 of file DrawModes.cc.
int ACG::SceneGraph::DrawModes::DrawMode::getLayerIndexByPrimitive | ( | DrawModePrimitive | _type | ) | const |
search for layer with specified primitive
_type | primitive type |
Definition at line 626 of file DrawModes.cc.
bool ACG::SceneGraph::DrawModes::DrawMode::isAtomic | ( | ) | const |
Check if this is an atomic draw Mode.
This function checks, if this is a atomic draw mode ( no combination of multiple draw modes )
Definition at line 512 of file DrawModes.cc.
bool ACG::SceneGraph::DrawModes::DrawMode::removeLayer | ( | unsigned int | _i | ) |
remove layer at index i
_i | Layer that is requested |
Definition at line 546 of file DrawModes.cc.
bool ACG::SceneGraph::DrawModes::DrawMode::removeLayer | ( | const DrawModeProperties * | _prop | ) |
remove layer if it is in list
_prop | Property that should be removed if it's available |
Definition at line 557 of file DrawModes.cc.
void ACG::SceneGraph::DrawModes::DrawMode::setDrawModeProperties | ( | const DrawModeProperties * | _props | ) |
set the base properties of this draw mode
_props | Properties to be set |
Definition at line 251 of file DrawModes.cc.
void ACG::SceneGraph::DrawModes::DrawMode::setDrawModeProperties | ( | const DrawModeProperties & | _props | ) |
set the base properties of this draw mode
_props | Properties to be set |
Definition at line 263 of file DrawModes.cc.
|
private |
vector for combined DrawModes -> holds DrawModeProperties for each layer -> original layer at index 0
Definition at line 499 of file DrawModes.hh.