Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ACG::SceneGraph::ACG::SceneGraph::DrawModes::DrawMode Class Reference

Specifies a DrawMode. More...

Public Member Functions

 DrawMode (size_t _index)
 constructor for unsigned int. More...
 
 DrawMode (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 (DrawMode _atomicDrawMode) const
 Check whether an Atomic DrawMode is active in this draw Mode.
 
std::vector< DrawModegetAtomicDrawModes () 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 DrawModePropertiesgetDrawModeProperties () 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
DrawModeoperator= (const DrawMode &_mode)
 
bool operator== (const DrawMode &_mode) const
 
DrawMode operator& (const DrawMode &_mode) const
 
DrawModeoperator++ ()
 
DrawModeoperator|= (const DrawMode &_mode2)
 
DrawModeoperator&= (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 DrawModePropertiesgetLayer (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< DrawModePropertieslayers_
 

Detailed Description

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 294 of file MeshNode2T.cc.

Constructor & Destructor Documentation

ACG::SceneGraph::DrawModes::DrawMode::DrawMode ( size_t  _index)

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!

Parameters
_indexIndex of the new DrawMode

Definition at line 194 of file DrawModes.cc.

ACG::SceneGraph::DrawModes::DrawMode::DrawMode ( ModeFlagSet  _flags)

constructor for ModeFlags.

This constructor creates a DrawMode from a bitset. This makes it easier to predefine draw modes using a bitset.

Parameters
_flagsFlags for the new drawmode defined by a bitset

Definition at line 211 of file DrawModes.cc.

Member Function Documentation

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

Parameters
_propsProperty that should be added

Definition at line 546 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 579 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 450 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 469 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 501 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:

  • NONE
  • DEFAULT

getDrawModeProperties returns 0 for these.

Definition at line 573 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 440 of file DrawModes.cc.

const DrawModeProperties * ACG::SceneGraph::DrawModes::DrawMode::getLayer ( unsigned int  _i) const

returns the property set at layer i

Parameters
_iLayer that is requested

Definition at line 541 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

Parameters
_propProperty to be searched for

Definition at line 617 of file DrawModes.cc.

int ACG::SceneGraph::DrawModes::DrawMode::getLayerIndexByPrimitive ( DrawModePrimitive  _type) const

search for layer with specified primitive

Parameters
_typeprimitive type
Returns
layer id if layer exists, -1 otherwise

Definition at line 632 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 518 of file DrawModes.cc.

bool ACG::SceneGraph::DrawModes::DrawMode::removeLayer ( unsigned int  _i)

remove layer at index i

Parameters
_iLayer that is requested

Definition at line 552 of file DrawModes.cc.

bool ACG::SceneGraph::DrawModes::DrawMode::removeLayer ( const DrawModeProperties _prop)

remove layer if it is in list

Parameters
_propProperty that should be removed if it's available

Definition at line 563 of file DrawModes.cc.

void ACG::SceneGraph::DrawModes::DrawMode::setDrawModeProperties ( const DrawModeProperties _props)

set the base properties of this draw mode

Parameters
_propsProperties to be set

Definition at line 257 of file DrawModes.cc.

void ACG::SceneGraph::DrawModes::DrawMode::setDrawModeProperties ( const DrawModeProperties _props)

set the base properties of this draw mode

Parameters
_propsProperties to be set

Definition at line 269 of file DrawModes.cc.

Member Data Documentation

std::vector<DrawModeProperties> ACG::SceneGraph::ACG::SceneGraph::DrawModes::DrawMode::layers_
private

vector for combined DrawModes -> holds DrawModeProperties for each layer -> original layer at index 0

Definition at line 505 of file MeshNode2T.cc.


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