Developer Documentation
Loading...
Searching...
No Matches
ACG::SceneGraph::DrawModes Namespace Reference

Classes

class  DrawMode
 Specifies a DrawMode. More...
 
class  DrawModeInternal
 Definition of a draw mode. More...
 
class  DrawModeProperties
 DrawModeProperties stores a set of properties that defines, how to render an object. More...
 

Typedefs

typedef std::vector< DrawModeInternalVecDrawModes
 
typedef std::bitset< 128 > ModeFlagSet
 

Enumerations

enum  DrawModeLightStage { LIGHTSTAGE_UNLIT , LIGHTSTAGE_SMOOTH , LIGHTSTAGE_PHONG }
 Lighting stage of a mesh: unlit, smooth, phong. More...
 
enum  DrawModePrimitive {
  PRIMITIVE_POINT , PRIMITIVE_EDGE , PRIMITIVE_HALFEDGE , PRIMITIVE_WIREFRAME ,
  PRIMITIVE_HIDDENLINE , PRIMITIVE_POLYGON , PRIMITIVE_CELL
}
 Primitive mode of a mesh. More...
 
enum  DrawModeColorSource {
  COLOR_NONE , COLOR_PER_VERTEX , COLOR_PER_EDGE , COLOR_PER_HALFEDGE ,
  COLOR_PER_FACE
}
 Source of Primitive Colors. More...
 
enum  DrawModeTexCoordSource { TEXCOORD_NONE , TEXCOORD_PER_VERTEX , TEXCOORD_PER_HALFEDGE }
 Source of Texture Coordinates. More...
 
enum  DrawModeNormalSource { NORMAL_NONE , NORMAL_PER_VERTEX , NORMAL_PER_HALFEDGE , NORMAL_PER_FACE }
 Source of Normals. More...
 

Functions

void initializeDefaultDrawModes (void)
 
const DrawModeaddDrawMode (const std::string &_name, bool _propertyBased=false)
 Add a custom DrawMode.
 
ACGDLLEXPORT const DrawModeaddDrawMode (const std::string &_name, const DrawModeProperties &_properties)
 Add a custom property based DrawMode.
 
const DrawModegetDrawMode (const std::string &_name)
 Get a custom DrawMode.
 
bool drawModeExists (const std::string &_name)
 Check if the given draw mode exists.
 
DrawMode getDrawModeFromIndex (unsigned int _index)
 given an index of an atomic draw mode, return the drawmode
 

Variables

DrawMode NONE = DrawMode( ModeFlagSet(0) )
 not a valid draw mode
 
DrawMode DEFAULT = DrawMode( ModeFlagSet(1) )
 use the default (global) draw mode and not the node's own.
 
DrawMode POINTS = DrawMode( ModeFlagSet(1) << 1 )
 draw unlighted points using the default base color
 
DrawMode POINTS_COLORED = DrawMode( ModeFlagSet(1) << 2 )
 draw colored, but not lighted points (requires point colors)
 
DrawMode POINTS_SHADED = DrawMode( ModeFlagSet(1) << 3 )
 draw shaded points (requires point normals)
 
DrawMode EDGES = DrawMode( ModeFlagSet(1) << 4 )
 draw edges
 
DrawMode EDGES_COLORED = DrawMode( ModeFlagSet(1) << 5 )
 draw edges with colors (without shading)
 
DrawMode WIREFRAME = DrawMode( ModeFlagSet(1) << 6 )
 draw wireframe
 
DrawMode FACES = DrawMode( ModeFlagSet(1) << 7 )
 
DrawMode HIDDENLINE = DrawMode( ModeFlagSet(1) << 8 )
 draw hidden line (2 rendering passes needed)
 
DrawMode SOLID_FLAT_SHADED = DrawMode( ModeFlagSet(1) << 9 )
 draw flat shaded faces (requires face normals)
 
DrawMode SOLID_SMOOTH_SHADED = DrawMode( ModeFlagSet(1) << 10 )
 draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)

 
DrawMode SOLID_PHONG_SHADED = DrawMode( ModeFlagSet(1) << 11 )
 draw phong shaded faces
 
DrawMode SOLID_FACES_COLORED = DrawMode( ModeFlagSet(1) << 12 )
 draw colored, but not lighted faces using face colors
 
DrawMode SOLID_POINTS_COLORED = DrawMode( ModeFlagSet(1) << 13 )
 draw colored, but not lighted faces using interpolated vertex colors
 
DrawMode SOLID_POINTS_COLORED_SHADED = DrawMode( ModeFlagSet(1) << 14 )
 draw faces, but use Gouraud shading to interpolate vertex colors
 
DrawMode SOLID_ENV_MAPPED = DrawMode( ModeFlagSet(1) << 15 )
 draw environment mapped

 
DrawMode SOLID_TEXTURED = DrawMode( ModeFlagSet(1) << 16 )
 draw textured faces
 
DrawMode SOLID_TEXTURED_SHADED = DrawMode( ModeFlagSet(1) << 17 )
 draw smooth shaded textured faces
 
DrawMode SOLID_1DTEXTURED = DrawMode( ModeFlagSet(1) << 18 )
 draw textured faces
 
DrawMode SOLID_1DTEXTURED_SHADED = DrawMode( ModeFlagSet(1) << 19 )
 draw smooth shaded textured faces
 
DrawMode SOLID_3DTEXTURED = DrawMode( ModeFlagSet(1) << 20 )
 draw textured faces
 
DrawMode SOLID_3DTEXTURED_SHADED = DrawMode( ModeFlagSet(1) << 21 )
 draw smooth shaded textured faces
 
DrawMode SOLID_FACES_COLORED_FLAT_SHADED = DrawMode( ModeFlagSet(1) << 22 )
 draw flat shaded and colored faces (requires face normals and colors)
 
DrawMode SOLID_FACES_COLORED_SMOOTH_SHADED = DrawMode( ModeFlagSet(1) << 23 )
 draw smooth shaded and colored faces (requires vertex normals and face colors)
 
DrawMode SOLID_2DTEXTURED_FACE = DrawMode( ModeFlagSet(1) << 24 )
 draw per halfedge textured faces
 
DrawMode SOLID_2DTEXTURED_FACE_SHADED = DrawMode( ModeFlagSet(1) << 25 )
 draw per halfedge textured faces
 
DrawMode SOLID_SHADER = DrawMode( ModeFlagSet(1) << 26 )
 
DrawMode SOLID_SMOOTH_SHADED_FEATURES = DrawMode( ModeFlagSet(1) << 27 )
 draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)
 
DrawMode CELLS = DrawMode( ModeFlagSet(1) << 28 )
 
DrawMode CELLS_COLORED = DrawMode( ModeFlagSet(1) << 29 )
 draw cells with colors (without shading)
 
DrawMode HALFEDGES = DrawMode( ModeFlagSet(1) << 30 )
 draw halfedges
 
DrawMode HALFEDGES_COLORED = DrawMode( ModeFlagSet(1) << 31 )
 draw halfedges with colors (without shading)
 
DrawMode SOLID_FACES_COLORED_2DTEXTURED_FACE_SMOOTH_SHADED = DrawMode( ModeFlagSet(1) << 32 )
 draw per halfedge texture faces modulated with face colors with smooth shading
 
DrawMode UNUSED = DrawMode( ModeFlagSet(1) << 33 )
 marks the last used ID
 

Detailed Description

This namespace consists of the definition of all available draw modes,
function to get their name (description()) and to include them in a QPopupMenu.

Typedef Documentation

◆ ModeFlagSet

typedef std::bitset<128> ACG::SceneGraph::DrawModes::ModeFlagSet

Definition at line 167 of file DrawModes.hh.

◆ VecDrawModes

typedef std::vector< DrawModeInternal > ACG::SceneGraph::DrawModes::VecDrawModes

Definition at line 162 of file DrawModes.cc.

Enumeration Type Documentation

◆ DrawModeColorSource

Source of Primitive Colors.

This is interpreted as a per vertex diffuse and ambient color and multiplied with the material diffuse/ambient colors.

Enumerator
COLOR_NONE 

Use material colors only

COLOR_PER_VERTEX 

Load per vertex colors and modulate with material color

COLOR_PER_EDGE 

Load per edge colors and modulate with material color

COLOR_PER_HALFEDGE 

Load per halfedge colors and modulate with material color

COLOR_PER_FACE 

Load per face colors and modulate with material color

Definition at line 134 of file DrawModes.hh.

◆ DrawModeLightStage

Lighting stage of a mesh: unlit, smooth, phong.

Don't confuse this with the interpolation mode of vertex attributes. This only says where to apply lighting, and nothing else.

Instead the interpolation mode is customizable for each attribute, making DrawModeProperties more flexible.

flat shading can be achieved by using LIGHTSTAGE_SMOOTH and setting the normal source to NORMAL_PER_FACE

Enumerator
LIGHTSTAGE_UNLIT 

No lighting, normals may be used by user defined shaders

LIGHTSTAGE_SMOOTH 

Perform lighting in vertex shader

LIGHTSTAGE_PHONG 

Perform lighting in fragment shader

Definition at line 107 of file DrawModes.hh.

◆ DrawModeNormalSource

Source of Normals.

This must be specified if lighting is enabled.

Enumerator
NORMAL_NONE 

Disable lighting

NORMAL_PER_VERTEX 

Use per vertex normals

NORMAL_PER_HALFEDGE 

Use per halfedge normals

NORMAL_PER_FACE 

Use per face normals

Note
per face is implicitly used in SHADE_FLAT mode

Definition at line 159 of file DrawModes.hh.

◆ DrawModePrimitive

Primitive mode of a mesh.

Example: PRIMITIVE_EDGE on a polygon mesh renders only edges of the mesh.

Definition at line 118 of file DrawModes.hh.

◆ DrawModeTexCoordSource

Source of Texture Coordinates.

This must be specified for a textured draw.

Enumerator
TEXCOORD_NONE 

Disable texture mapping

TEXCOORD_PER_VERTEX 

Use per vertex texcoords for texture mapping

TEXCOORD_PER_HALFEDGE 

Use per halfedge texcoords for texture mapping

Definition at line 147 of file DrawModes.hh.

Function Documentation

◆ addDrawMode() [1/2]

ACGDLLEXPORT const DrawMode & ACG::SceneGraph::DrawModes::addDrawMode ( const std::string &  _name,
bool  _propertyBased = false 
)

Add a custom DrawMode.

The id of the new draw mode is returned. If it already exists, the id of the existing one is returned.

Property based draw modes consist of various flags, which define which primitives and additional information are send to the gpu.

Parameters
_nameName of the draw mode to add
_propertyBasedIf set to true a property based draw mode is created.
Returns
Id of the new draw mode

Definition at line 755 of file DrawModes.cc.

◆ addDrawMode() [2/2]

ACGDLLEXPORT const DrawMode & ACG::SceneGraph::DrawModes::addDrawMode ( const std::string &  _name,
const DrawModeProperties _properties 
)

Add a custom property based DrawMode.

The id of the new draw mode is returned. If it already exists, the id of the existing one is returned.

Note
If the DrawMode already exists, the properties will be applied to the existing mode!!

Property based draw modes consist of various flags, which define which primitives and additional information are send to the gpu.

Parameters
_nameName of the draw mode to add
_propertiesProperties of the drawmode
Returns
Id of the new draw mode

Definition at line 777 of file DrawModes.cc.

◆ drawModeExists()

ACGDLLEXPORT bool ACG::SceneGraph::DrawModes::drawModeExists ( const std::string &  _name)

Check if the given draw mode exists.

Definition at line 814 of file DrawModes.cc.

◆ getDrawMode()

ACGDLLEXPORT const DrawMode & ACG::SceneGraph::DrawModes::getDrawMode ( const std::string &  _name)

Get a custom DrawMode.

The id of the draw mode is returned or if it does not exist, DrawMode::NONE is returned.

Parameters
_nameName of the DrawMode
Returns
Id of the draw mode or DrawModes::NONE

Definition at line 797 of file DrawModes.cc.

◆ getDrawModeFromIndex()

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::getDrawModeFromIndex ( unsigned int  _index)

given an index of an atomic draw mode, return the drawmode

Definition at line 830 of file DrawModes.cc.

◆ initializeDefaultDrawModes()

ACGDLLEXPORT void ACG::SceneGraph::DrawModes::initializeDefaultDrawModes ( void  )

Initialize the default modes. This function has to be called at least once at application startup.

Definition at line 629 of file DrawModes.cc.

Variable Documentation

◆ CELLS

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::CELLS = DrawMode( ModeFlagSet(1) << 28 )

Definition at line 100 of file DrawModes.cc.

◆ CELLS_COLORED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::CELLS_COLORED = DrawMode( ModeFlagSet(1) << 29 )

draw cells with colors (without shading)

Definition at line 101 of file DrawModes.cc.

◆ DEFAULT

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::DEFAULT = DrawMode( ModeFlagSet(1) )

use the default (global) draw mode and not the node's own.

Definition at line 72 of file DrawModes.cc.

◆ EDGES

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::EDGES = DrawMode( ModeFlagSet(1) << 4 )

draw edges

Definition at line 76 of file DrawModes.cc.

◆ EDGES_COLORED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::EDGES_COLORED = DrawMode( ModeFlagSet(1) << 5 )

draw edges with colors (without shading)

Definition at line 77 of file DrawModes.cc.

◆ FACES

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::FACES = DrawMode( ModeFlagSet(1) << 7 )

Definition at line 79 of file DrawModes.cc.

◆ HALFEDGES

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::HALFEDGES = DrawMode( ModeFlagSet(1) << 30 )

draw halfedges

Definition at line 102 of file DrawModes.cc.

◆ HALFEDGES_COLORED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::HALFEDGES_COLORED = DrawMode( ModeFlagSet(1) << 31 )

draw halfedges with colors (without shading)

Definition at line 103 of file DrawModes.cc.

◆ HIDDENLINE

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::HIDDENLINE = DrawMode( ModeFlagSet(1) << 8 )

draw hidden line (2 rendering passes needed)

Definition at line 80 of file DrawModes.cc.

◆ NONE

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::NONE = DrawMode( ModeFlagSet(0) )

not a valid draw mode

Definition at line 71 of file DrawModes.cc.

◆ POINTS

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::POINTS = DrawMode( ModeFlagSet(1) << 1 )

draw unlighted points using the default base color

Definition at line 73 of file DrawModes.cc.

◆ POINTS_COLORED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::POINTS_COLORED = DrawMode( ModeFlagSet(1) << 2 )

draw colored, but not lighted points (requires point colors)

Definition at line 74 of file DrawModes.cc.

◆ POINTS_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::POINTS_SHADED = DrawMode( ModeFlagSet(1) << 3 )

draw shaded points (requires point normals)

Definition at line 75 of file DrawModes.cc.

◆ SOLID_1DTEXTURED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_1DTEXTURED = DrawMode( ModeFlagSet(1) << 18 )

draw textured faces

Definition at line 90 of file DrawModes.cc.

◆ SOLID_1DTEXTURED_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_1DTEXTURED_SHADED = DrawMode( ModeFlagSet(1) << 19 )

draw smooth shaded textured faces

Definition at line 91 of file DrawModes.cc.

◆ SOLID_2DTEXTURED_FACE

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_2DTEXTURED_FACE = DrawMode( ModeFlagSet(1) << 24 )

draw per halfedge textured faces

Definition at line 96 of file DrawModes.cc.

◆ SOLID_2DTEXTURED_FACE_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_2DTEXTURED_FACE_SHADED = DrawMode( ModeFlagSet(1) << 25 )

draw per halfedge textured faces

Definition at line 97 of file DrawModes.cc.

◆ SOLID_3DTEXTURED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_3DTEXTURED = DrawMode( ModeFlagSet(1) << 20 )

draw textured faces

Definition at line 92 of file DrawModes.cc.

◆ SOLID_3DTEXTURED_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_3DTEXTURED_SHADED = DrawMode( ModeFlagSet(1) << 21 )

draw smooth shaded textured faces

Definition at line 93 of file DrawModes.cc.

◆ SOLID_ENV_MAPPED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_ENV_MAPPED = DrawMode( ModeFlagSet(1) << 15 )

draw environment mapped

Definition at line 87 of file DrawModes.cc.

◆ SOLID_FACES_COLORED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED = DrawMode( ModeFlagSet(1) << 12 )

draw colored, but not lighted faces using face colors

Definition at line 84 of file DrawModes.cc.

◆ SOLID_FACES_COLORED_2DTEXTURED_FACE_SMOOTH_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED_2DTEXTURED_FACE_SMOOTH_SHADED = DrawMode( ModeFlagSet(1) << 32 )

draw per halfedge texture faces modulated with face colors with smooth shading

Definition at line 104 of file DrawModes.cc.

◆ SOLID_FACES_COLORED_FLAT_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED_FLAT_SHADED = DrawMode( ModeFlagSet(1) << 22 )

draw flat shaded and colored faces (requires face normals and colors)

Definition at line 94 of file DrawModes.cc.

◆ SOLID_FACES_COLORED_SMOOTH_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED_SMOOTH_SHADED = DrawMode( ModeFlagSet(1) << 23 )

draw smooth shaded and colored faces (requires vertex normals and face colors)

Definition at line 95 of file DrawModes.cc.

◆ SOLID_FLAT_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_FLAT_SHADED = DrawMode( ModeFlagSet(1) << 9 )

draw flat shaded faces (requires face normals)

Definition at line 81 of file DrawModes.cc.

◆ SOLID_PHONG_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_PHONG_SHADED = DrawMode( ModeFlagSet(1) << 11 )

draw phong shaded faces

Definition at line 83 of file DrawModes.cc.

◆ SOLID_POINTS_COLORED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED = DrawMode( ModeFlagSet(1) << 13 )

draw colored, but not lighted faces using interpolated vertex colors

Definition at line 85 of file DrawModes.cc.

◆ SOLID_POINTS_COLORED_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED_SHADED = DrawMode( ModeFlagSet(1) << 14 )

draw faces, but use Gouraud shading to interpolate vertex colors

Definition at line 86 of file DrawModes.cc.

◆ SOLID_SHADER

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_SHADER = DrawMode( ModeFlagSet(1) << 26 )

drawing is controlled by shaders ( Use shadernodes to set them before the actual object to render)

Definition at line 98 of file DrawModes.cc.

◆ SOLID_SMOOTH_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED = DrawMode( ModeFlagSet(1) << 10 )

draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)

Definition at line 82 of file DrawModes.cc.

◆ SOLID_SMOOTH_SHADED_FEATURES

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED_FEATURES = DrawMode( ModeFlagSet(1) << 27 )

draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)

Definition at line 99 of file DrawModes.cc.

◆ SOLID_TEXTURED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_TEXTURED = DrawMode( ModeFlagSet(1) << 16 )

draw textured faces

Definition at line 88 of file DrawModes.cc.

◆ SOLID_TEXTURED_SHADED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED = DrawMode( ModeFlagSet(1) << 17 )

draw smooth shaded textured faces

Definition at line 89 of file DrawModes.cc.

◆ UNUSED

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::UNUSED = DrawMode( ModeFlagSet(1) << 33 )

marks the last used ID

Definition at line 105 of file DrawModes.cc.

◆ WIREFRAME

ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::WIREFRAME = DrawMode( ModeFlagSet(1) << 6 )

draw wireframe

Definition at line 78 of file DrawModes.cc.