|
Developer Documentation
|
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< DrawModeInternal > | VecDrawModes |
| 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 DrawMode & | addDrawMode (const std::string &_name, bool _propertyBased=false) |
| Add a custom DrawMode. | |
| ACGDLLEXPORT const DrawMode & | addDrawMode (const std::string &_name, const DrawModeProperties &_properties) |
| Add a custom property based DrawMode. | |
| const DrawMode & | getDrawMode (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 | |
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 std::bitset<128> ACG::SceneGraph::DrawModes::ModeFlagSet |
Definition at line 167 of file DrawModes.hh.
| typedef std::vector< DrawModeInternal > ACG::SceneGraph::DrawModes::VecDrawModes |
Definition at line 162 of file DrawModes.cc.
Source of Primitive Colors.
This is interpreted as a per vertex diffuse and ambient color and multiplied with the material diffuse/ambient colors.
Definition at line 134 of file DrawModes.hh.
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.
Source of Normals.
This must be specified if lighting is enabled.
Definition at line 159 of file DrawModes.hh.
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.
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.
| 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.
| _name | Name of the draw mode to add |
| _propertyBased | If set to true a property based draw mode is created. |
Definition at line 755 of file DrawModes.cc.
| 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.
Property based draw modes consist of various flags, which define which primitives and additional information are send to the gpu.
| _name | Name of the draw mode to add |
| _properties | Properties of the drawmode |
Definition at line 777 of file DrawModes.cc.
| 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.
| 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.
| _name | Name of the DrawMode |
Definition at line 797 of file DrawModes.cc.
| 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.
| 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.
Definition at line 100 of file DrawModes.cc.
draw cells with colors (without shading)
Definition at line 101 of file DrawModes.cc.
use the default (global) draw mode and not the node's own.
Definition at line 72 of file DrawModes.cc.
draw edges
Definition at line 76 of file DrawModes.cc.
draw edges with colors (without shading)
Definition at line 77 of file DrawModes.cc.
Definition at line 79 of file DrawModes.cc.
draw halfedges
Definition at line 102 of file DrawModes.cc.
| 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.
draw hidden line (2 rendering passes needed)
Definition at line 80 of file DrawModes.cc.
not a valid draw mode
Definition at line 71 of file DrawModes.cc.
draw unlighted points using the default base color
Definition at line 73 of file DrawModes.cc.
draw colored, but not lighted points (requires point colors)
Definition at line 74 of file DrawModes.cc.
draw shaded points (requires point normals)
Definition at line 75 of file DrawModes.cc.
| ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_1DTEXTURED = DrawMode( ModeFlagSet(1) << 18 ) |
draw textured faces
Definition at line 90 of file DrawModes.cc.
| 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.
| 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.
| 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.
| ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_3DTEXTURED = DrawMode( ModeFlagSet(1) << 20 ) |
draw textured faces
Definition at line 92 of file DrawModes.cc.
| 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.
| ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_ENV_MAPPED = DrawMode( ModeFlagSet(1) << 15 ) |
draw environment mapped
Definition at line 87 of file DrawModes.cc.
| 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.
| 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.
| 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.
| 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.
| 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.
| ACGDLLEXPORT DrawMode ACG::SceneGraph::DrawModes::SOLID_PHONG_SHADED = DrawMode( ModeFlagSet(1) << 11 ) |
draw phong shaded faces
Definition at line 83 of file DrawModes.cc.
| 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.
| 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.
drawing is controlled by shaders ( Use shadernodes to set them before the actual object to render)
Definition at line 98 of file DrawModes.cc.
| 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.
| 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.
draw textured faces
Definition at line 88 of file DrawModes.cc.
| 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.
marks the last used ID
Definition at line 105 of file DrawModes.cc.
draw wireframe
Definition at line 78 of file DrawModes.cc.