56#include "MeshNode2T.hh"
58#include <ACG/Geometry/GPUCacheOptimizer.hh>
59#include <ACG/GL/DrawMesh.hh>
60#include <ACG/GL/GLError.hh>
61#include <ACG/GL/GLState.hh>
78 const std::string& _name ):
85 updateVertexPicking_(true),
86 vertexPickingBaseIndex_(0),
87 updateEdgePicking_(true),
88 edgePickingBaseIndex_(0),
89 updateFacePicking_(true),
90 facePickingBaseIndex_(0),
91 updateAnyPicking_(true),
92 anyPickingBaseIndex_(0),
93 perFaceTextureIndexAvailable_(false),
95 draw_with_offset_(false)
103 MeshNodeBase::supplyDrawMesh(drawMesh_);
126 if (mesh_.has_vertex_normals())
133 if (mesh_.has_face_normals())
136 if (mesh_.has_halfedge_normals())
139 if (mesh_.has_vertex_colors())
144 if (mesh_.has_vertex_normals())
148 if(mesh_.has_edge_colors())
153 if(mesh_.has_halfedge_colors())
158 bool enableTexturedFaces = drawMesh_->perFaceTextureCoordinateAvailable() != 0;
160 if (mesh_.has_face_colors()) {
163 if( mesh_.has_face_normals() )
166 if (mesh().has_vertex_normals()) {
169 if (enableTexturedFaces)
174 if ( mesh_.has_vertex_texcoords2D() ) {
177 if (mesh_.has_vertex_normals())
181 if ( enableTexturedFaces ) {
184 if (mesh_.has_face_normals())
226 glPushAttrib(GL_ENABLE_BIT);
228 GLenum prev_depth_offset = _state.
depthFunc();
229 if(draw_with_offset_)
232 glPolygonOffset(-1.0f, -10.0f);
260 drawMesh_->usePerVertexColors();
269 drawMesh_->disableColors();
294 drawMesh_->disableColors();
309 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
312 drawMesh_->disableColors();
315 clear_color[3] = 1.0;
333 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
339 enable_arrays( PER_EDGE_VERTEX_ARRAY | PER_EDGE_COLOR_ARRAY );
349 enable_arrays( PER_HALFEDGE_VERTEX_ARRAY);
357 enable_arrays( PER_HALFEDGE_VERTEX_ARRAY | PER_HALFEDGE_COLOR_ARRAY );
369 drawMesh_->usePerVertexColors();
380 if ( enableNormals_ ) {
386 drawMesh_->usePerVertexColors();
398 drawMesh_->setFlatShading();
399 drawMesh_->disableColors();
411 drawMesh_->usePerVertexNormals();
412 drawMesh_->setSmoothShading();
413 drawMesh_->disableColors();
435 drawMesh_->usePerVertexNormals();
436 drawMesh_->setSmoothShading();
437 drawMesh_->disableColors();
458 drawMesh_->usePerFaceColors();
473 drawMesh_->disableColors();
474 drawMesh_->setSmoothShading();
475 drawMesh_->usePerHalfedgeNormals();
491 drawMesh_->setFlatShading();
492 drawMesh_->usePerFaceColors();
509 drawMesh_->setSmoothShading();
510 drawMesh_->usePerVertexNormals();
511 drawMesh_->usePerFaceColors();
514 drawMesh_->draw(textureMap_,
true);
536 drawMesh_->setSmoothShading();
537 drawMesh_->usePerVertexNormals();
538 drawMesh_->usePerFaceColors();
539 drawMesh_->usePerHalfedgeTexcoords();
541 drawMesh_->draw(textureMap_,
true);
556 drawMesh_->disableColors();
557 drawMesh_->usePerVertexTexcoords();
561 GLint prevTexEnvMode = 0;
562 glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &prevTexEnvMode);
563 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
569 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, prevTexEnvMode);
579 drawMesh_->disableColors();
580 drawMesh_->usePerVertexTexcoords();
584 GLint prevTexEnvMode = 0;
585 glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &prevTexEnvMode);
586 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
592 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, prevTexEnvMode);
603 drawMesh_->setSmoothShading();
604 drawMesh_->disableColors();
605 drawMesh_->usePerVertexTexcoords();
624 drawMesh_->disableColors();
625 drawMesh_->usePerHalfedgeTexcoords();
627 glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
647 drawMesh_->setFlatShading();
648 drawMesh_->disableColors();
649 drawMesh_->usePerHalfedgeTexcoords();
662 if(draw_with_offset_)
676 ro.debugName =
"MeshNode";
680 for (
unsigned int i = 0; i < _drawMode.
getNumLayers(); ++i)
689 ro.depthWrite =
true;
691 ro.setMaterial(_mat);
706 switch (props->colorSource())
712 drawMesh_->disableColors();
718 if (props->primitive() == DrawModes::PRIMITIVE_POLYGON)
720 switch (props->normalSource())
728 drawMesh_->setFlatShading();
730 drawMesh_->setSmoothShading();
736 switch (props->texcoordSource())
757 switch (props->lightStage())
780 if (props->primitive() == DrawModes::PRIMITIVE_WIREFRAME)
782 ro.debugName =
"MeshNode.Wireframe";
785 drawMesh_->disableColors();
789 ro.emissive = ro.specular;
791 ro.emissive = OpenMesh::color_cast<ACG::Vec3f>(_state.
overlay_color());
799 applyRenderObjectSettings(props->primitive(), &ro);
800 drawMesh_->addLineRenderObjects(_renderer, &ro);
803 if (props->primitive() == DrawModes::PRIMITIVE_HIDDENLINE)
806 drawMesh_->disableColors();
810 ro.emissive = ro.specular;
812 ro.emissive = OpenMesh::color_cast<ACG::Vec3f>(_state.
overlay_color());
816 if ( (polyLayer >
int(i) || polyLayer < 0) && ( mesh_.n_faces() != 0 ))
820 applyRenderObjectSettings(DrawModes::PRIMITIVE_POLYGON, &ro);
823 ro.glColorMask(0,0,0,0);
825 ro.debugName =
"MeshNode.HiddenLine.faces";
826 add_face_RenderObjects(_renderer, &ro);
832 ro.glColorMask(1,1,1,1);
837 applyRenderObjectSettings(DrawModes::PRIMITIVE_HIDDENLINE, &ro);
839 ro.debugName =
"MeshNode.HiddenLine.lines";
840 drawMesh_->addLineRenderObjects(_renderer, &ro);
843 if (props->
colored() && props->primitive() == DrawModes::PRIMITIVE_EDGE)
849 ro.emissive = ro.specular;
854 applyRenderObjectSettings(props->primitive(), &ro);
855 ro.debugName =
"MeshNode.Edges";
856 drawMesh_->addLineRenderObjects(_renderer, &ro);
862 if (props->primitive() == DrawModes::PRIMITIVE_HALFEDGE)
867 drawMesh_->updateEdgeHalfedgeVertexDeclarations();
868 halfedgeDecl.clear();
873 ro.emissive = ro.specular;
876 ro.glDrawArrays(GL_LINES, 0,
int(mesh_.n_halfedges() * 2));
878 ro.debugName =
"MeshNode.HalfEdges";
888 switch (props->primitive())
890 case DrawModes::PRIMITIVE_POINT:
892 if (ro.
shaderDesc.shadeMode == SG_SHADE_UNLIT)
896 ro.emissive = ro.specular;
898 ro.emissive = OpenMesh::color_cast<ACG::Vec3f>(_state.
overlay_color());
904 applyRenderObjectSettings(props->primitive(), &ro);
905 ro.debugName =
"MeshNode.Points";
906 add_point_RenderObjects(_renderer, &ro);
908 case DrawModes::PRIMITIVE_EDGE:
911 ro.emissive = ro.specular;
916 applyRenderObjectSettings(props->primitive(), &ro);
917 ro.debugName =
"MeshNode.Edges";
918 drawMesh_->addLineRenderObjects(_renderer, &ro);
920 case DrawModes::PRIMITIVE_POLYGON:
922 applyRenderObjectSettings(props->primitive(), &ro);
924 if (!ro.
shaderDesc.vertexTemplateFile.isEmpty())
925 drawMesh_->scanVertexShaderForInput(ro.
shaderDesc.vertexTemplateFile.toStdString());
931 ro.debugName =
"MeshNode.Faces";
932 add_face_RenderObjects(_renderer, &ro, useNonIndexed);
947 drawMesh_->addPointRenderObjects(_renderer, _baseObj);
954 drawMesh_->drawVertices();
962 if ((enabled_arrays_ & PER_EDGE_COLOR_ARRAY) && (enabled_arrays_ & PER_EDGE_VERTEX_ARRAY))
965 glDrawArrays(GL_LINES, 0,
int(mesh_.n_edges() * 2));
968 drawMesh_->drawLines();
976 if ( enabled_arrays_ & PER_HALFEDGE_VERTEX_ARRAY )
977 glDrawArrays(GL_LINES, 0,
int(mesh_.n_halfedges() * 2));
980 std::cerr <<
"Unable to Draw! halfedge array configuration is invalid!!" << std::endl;
987 drawMesh_->draw(textureMap_);
994 drawMesh_->addTriRenderObjects(_renderer, _baseObj, textureMap_, _nonindexed);
1011 if (_arrays & PER_EDGE_VERTEX_ARRAY) {
1014 if (!(enabled_arrays_ & PER_EDGE_VERTEX_ARRAY)) {
1015 enabled_arrays_ |= PER_EDGE_VERTEX_ARRAY;
1024 }
else if (enabled_arrays_ & PER_EDGE_VERTEX_ARRAY) {
1026 enabled_arrays_ &= ~PER_EDGE_VERTEX_ARRAY;
1035 if ( mesh_.has_edge_colors() && ( _arrays & PER_EDGE_COLOR_ARRAY) ) {
1038 if (!(enabled_arrays_ & PER_EDGE_COLOR_ARRAY)) {
1039 enabled_arrays_ |= PER_EDGE_COLOR_ARRAY;
1048 }
else if (enabled_arrays_ & PER_EDGE_COLOR_ARRAY) {
1050 enabled_arrays_ &= ~PER_EDGE_COLOR_ARRAY;
1060 if (_arrays & PER_HALFEDGE_VERTEX_ARRAY) {
1063 if (!(enabled_arrays_ & PER_HALFEDGE_VERTEX_ARRAY)) {
1064 enabled_arrays_ |= PER_HALFEDGE_VERTEX_ARRAY;
1073 }
else if (enabled_arrays_ & PER_HALFEDGE_VERTEX_ARRAY) {
1075 enabled_arrays_ &= ~PER_HALFEDGE_VERTEX_ARRAY;
1084 if ( mesh_.has_halfedge_colors() && ( _arrays & PER_HALFEDGE_COLOR_ARRAY) ) {
1087 if (!(enabled_arrays_ & PER_HALFEDGE_COLOR_ARRAY)) {
1088 enabled_arrays_ |= PER_HALFEDGE_COLOR_ARRAY;
1097 }
else if (enabled_arrays_ & PER_HALFEDGE_COLOR_ARRAY) {
1099 enabled_arrays_ &= ~PER_HALFEDGE_COLOR_ARRAY;
1118 pick_vertices(_state);
1123 pick_vertices(_state,
true);
1146 pick_edges(_state,
true);
1163 if (!_state.
pick_set_maximum (
static_cast<unsigned int>(mesh_.n_vertices()))) {
1164 omerr() <<
"MeshNode::pick_vertices: color range too small, " <<
"picking failed\n";
1168 if ( mesh_.n_vertices() == 0 ) {
1169 std::cerr <<
"pick_vertices: No vertices in Mesh!" << std::endl;
1173 if (_front && ( mesh_.n_faces() != 0 ) ) {
1177 clear_color[3] = 1.0;
1179 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1186 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
1190 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1196 int pickImplementationMethod = 0;
1200 if (drawMesh_->supportsPickingVertices_opt())
1205 if ( updateVertexPicking_ || _state.
pick_current_index () != vertexPickingBaseIndex_) {
1206 if (pickImplementationMethod == 0)
1207 drawMesh_->updatePickingVertices(_state);
1209 drawMesh_->updatePickingVertices_opt(_state);
1211 updateVertexPicking_ =
false;
1214 if (mesh_.n_vertices()) {
1216 if (pickImplementationMethod == 0) {
1227 glDrawArrays(GL_POINTS, 0,
int(mesh_.n_vertices()));
1235 else if (pickImplementationMethod == 1){
1238 drawMesh_->drawPickingVertices_opt(_state.
projection() * _state.
modelview(), vertexPickingBaseIndex_);
1244 std::cerr <<
"pick_vertices: No vertices in Mesh!" << std::endl;
1248 std::cerr <<
"No fallback pick_vertices!" << std::endl;
1262 if (!_state.
pick_set_maximum (
static_cast<unsigned int>(mesh_.n_edges()))) {
1263 omerr() <<
"MeshNode::pick_edges: color range too small, " <<
"picking failed\n";
1267 if ( mesh_.n_vertices() == 0 ) {
1268 std::cerr <<
"pick_edges: No vertices in Mesh!" << std::endl;
1272 if ( _front && ( mesh_.n_faces() != 0 ) ) {
1276 clear_color[3] = 1.0;
1278 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1285 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
1289 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1300 int pickImplementationMethod = 0;
1303 if (drawMesh_->supportsPickingEdges_opt())
1307 if (pickImplementationMethod == 0)
1308 drawMesh_->updatePickingEdges(_state);
1310 drawMesh_->updatePickingEdges_opt(_state);
1312 updateEdgePicking_ =
false;
1315 if ( mesh_.n_edges() != 0 && drawMesh_) {
1317 if (pickImplementationMethod == 0){
1327 glDrawArrays(GL_LINES, 0,
int(mesh_.n_edges() * 2));
1335 else if (pickImplementationMethod == 1){
1337 drawMesh_->drawPickingEdges_opt(_state.
projection() * _state.
modelview(), edgePickingBaseIndex_);
1344 std::cerr <<
"No fallback pick_edges!" << std::endl;
1357 if ( mesh_.n_vertices() == 0 ) {
1358 std::cerr <<
"pick_faces: No vertices in Mesh!" << std::endl;
1362 if ( mesh_.n_faces() > 0 ) {
1363 if (!_state.
pick_set_maximum (
static_cast<unsigned int>(mesh_.n_faces()))) {
1364 omerr() <<
"MeshNode::pick_faces: color range too small, " <<
"picking failed\n";
1369 omerr() <<
"Strange pickSetMAximum failed for index 1 in MeshNode\n";
1377 int pickImplementationMethod = 0;
1381 if (drawMesh_->supportsPickingFaces_opt())
1388 if (pickImplementationMethod == 0) {
1392 drawMesh_->updatePickingFaces(_state);
1394 updateFacePicking_ =
false;
1397 if ( mesh_.n_faces() != 0 ) {
1408 glDrawArrays(GL_TRIANGLES, 0,
int(3 * drawMesh_->getNumTris()));
1419 else if (pickImplementationMethod == 1) {
1424 drawMesh_->updatePickingFaces_opt(_state);
1426 updateFacePicking_ =
false;
1429 if ( mesh_.n_faces() != 0 ) {
1431 drawMesh_->drawPickingFaces_opt(_state.
projection() * _state.
modelview(), facePickingBaseIndex_);
1445 std::cerr <<
"Unknown picking method in pick_faces!" << std::endl;
1449 std::cerr <<
"No fallback pick_faces!" << std::endl;
1459 size_t numElements = mesh_.n_faces() + mesh_.n_edges() + mesh_.n_vertices();
1461 if ( mesh_.n_vertices() == 0 ) {
1462 std::cerr <<
"pick_any: No vertices in Mesh!" << std::endl;
1467 if (numElements == 0) {
1468 std::cerr <<
"pick_any: Number of elements : 0 " << std::endl;
1474 omerr() <<
"MeshNode::pick_any: color range too small, " <<
"picking failed\n";
1483 int pickImplementationMethod = 0;
1486 if (drawMesh_->supportsPickingAny_opt())
1491 if (pickImplementationMethod == 0)
1492 drawMesh_->updatePickingAny(_state);
1494 drawMesh_->updatePickingAny_opt(_state);
1496 updateAnyPicking_ =
false;
1499 if (pickImplementationMethod == 0){
1510 if ( mesh_.n_faces() != 0 && drawMesh_) {
1515 glDrawArrays(GL_TRIANGLES, 0,
int(3 * drawMesh_->getNumTris()));
1521 if ( mesh_.n_edges() != 0 && drawMesh_) {
1526 glDrawArrays(GL_LINES, 0,
int(mesh_.n_edges() * 2));
1535 glDrawArrays(GL_POINTS, 0,
int(mesh_.n_vertices()));
1544 drawMesh_->drawPickingAny_opt(_state.
projection() * _state.
modelview(), anyPickingBaseIndex_);
1548 std::cerr <<
"No fallback pick_any!" << std::endl;
1566 updateVertexPicking_ =
true;
1567 updateEdgePicking_ =
true;
1568 updateFacePicking_ =
true;
1569 updateAnyPicking_ =
true;
1572 drawMesh_->invalidatePerEdgeBuffers();
1575 drawMesh_->invalidatePerHalfedgeBuffers();
1577 drawMesh_->updateGeometry();
1579 drawMesh_->invalidateFullVBO();
1582 bbMin_ =
Vec3d(FLT_MAX, FLT_MAX, FLT_MAX);
1583 bbMax_ =
Vec3d(-FLT_MAX, -FLT_MAX, -FLT_MAX);
1586 for (; v_it!=v_end; ++v_it)
1588 bbMin_.minimize(mesh_.point(*v_it));
1589 bbMax_.maximize(mesh_.point(*v_it));
1598 drawMesh_->invalidatePerEdgeBuffers();
1599 drawMesh_->invalidatePerHalfedgeBuffers();
1602 drawMesh_->updateTopology();
1612 drawMesh_->updateTextures();
1614 updateVertexPicking_ =
true;
1615 updateFacePicking_ =
true;
1616 updateAnyPicking_ =
true;
1626 drawMesh_->invalidatePerEdgeBuffers();
1627 drawMesh_->invalidatePerHalfedgeBuffers();
1632 drawMesh_->updateFull();
1640 drawMesh_->setTextureIndexPropertyName(_indexPropertyName);
1641 perFaceTextureIndexAvailable_ = drawMesh_->perFaceTextureIndexAvailable() != 0;
1649 return drawMesh_->getTextureIndexPropertyName();
1656 drawMesh_->setPerFaceTextureCoordinatePropertyName(_halfedgeTextcoordPropertyName);
1666 unsigned int res = 0;
1669 res += drawMesh_->getMemoryUsage();
static void disableClientState(GLenum _cap)
replaces glDisableClientState, supports locking
static void colorPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glColorPointer, supports locking
static void vertexPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glVertexPointer, supports locking
static void enable(GLenum _cap, bool _warnRemoved=true)
replaces glEnable, but supports locking
static void bindTexture(GLenum _target, GLuint _buffer)
replaces glBindTexture, supports locking
const Vec4f & specular_color() const
get specular color
const GLMatrixd & modelview() const
get modelview matrix
bool color_picking() const
Is color picking active?
static void enableClientState(GLenum _cap)
replaces glEnableClientState, supports locking
int viewport_width() const
get viewport width
const Vec4f & base_color() const
get base color (used when lighting is off)
bool pick_set_maximum(size_t _idx)
Set the maximal number of primitives/components of your object.
const Vec4f & overlay_color() const
Get overlay color.
const GLMatrixd & projection() const
get projection matrix
void set_color(const Vec4f &_col)
set color
static GLuint getBoundTextureBuffer()
get bound texture
static void depthRange(GLclampd _zNear, GLclampd _zFar)
replaces glDepthRange, supports locking
static void disable(GLenum _cap, bool _warnRemoved=true)
replaces glDisable, but supports locking
const Vec4f & color()
set color
size_t pick_current_index() const
Returns the current color picking index (can be used for caching)
const Vec4f & clear_color() const
get background color
int viewport_height() const
get viewport height
bool twosided_lighting()
get whether transparenet or solid objects should be drawn
void set_base_color(const Vec4f &_col)
set base color (used when lighting is off)
float line_width() const
get line width
static void shadeModel(GLenum _mode)
replaces glShadeModel, supports locking
const GLenum & depthFunc() const
get glDepthFunc() that is supposed to be active
static void bindBuffer(GLenum _target, GLuint _buffer)
replaces glBindBuffer, supports locking
static GLenum getBoundTextureTarget()
get bound texture target
virtual void addRenderObject(RenderObject *_renderObject)
Callback for the scenegraph nodes, which send new render objects via this function.
DrawModeProperties stores a set of properties that defines, how to render an object.
bool colored() const
Are colors used?
bool flatShaded() const
Is flat shading used (Normals per face)?
bool lighting() const
Is lighting enabled?
int getLayerIndexByPrimitive(DrawModePrimitive _type) const
search for layer with specified primitive
const DrawModeProperties * getLayer(unsigned int _i) const
returns the property set at layer i
bool isAtomic() const
Check if this is an atomic draw Mode.
size_t getNumLayers() const
returns the layer count
void pointSize(float _sz)
set point size (default: 1.0)
void setHalfedgeTextcoordPropertyName(std::string _halfedgeTextcoordPropertyName)
Set the name of the per face texture coordinate property.
void update_color()
the colors of the mesh have changed
virtual ~MeshNodeT()
Destructor.
void pick(GLState &_state, PickTarget _target) override
Draws the object in picking mode.
void draw_halfedges()
draws all halfedges of the mesh
void add_face_RenderObjects(IRenderer *_renderer, const RenderObject *_baseObj, bool _nonindexed=false)
Draws the object.
Mesh & mesh_
The mesh this node works on.
const std::string & indexPropertyName() const
Get current texture index property name.
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode) override
Draws the object.
void pick_faces(GLState &_state)
Renders picking for faces _front: Only render front faces (not occluded by geometry)
DrawMeshT< Mesh > * getDrawMesh()
Get DrawMesh instance.
void enable_arrays(unsigned int _arrays)
enable/disable vertex arrays according to the bits in _arrays
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax) override
Current bounding box.
void update_geometry()
the geometry of the mesh has changed
void pick_any(GLState &_state)
Renders picking for all primitives.
unsigned int getMemoryUsage()
measures the size in bytes of allocated memory
ACG::SceneGraph::DrawModes::DrawMode availableDrawModes() const override
return available draw modes
void pick_edges(GLState &_state, bool _front=false)
Renders picking for edges _front: Only render front edges (not occluded by geometry)
void pick_vertices(GLState &_state, bool _front=false)
Renders picking for vertices _front: Only render front vertices (not occluded by geometry)
void setIndexPropertyName(std::string _indexPropertyName)
set the name of the property used for texture index specification
MeshNodeT(Mesh &_mesh, BaseNode *_parent=0, const std::string &_name="<MeshNode>")
Default constructor.
void update_topology()
the topology of the mesh has changed
void draw_lines()
draws all edges of the mesh
void update_textures()
force an texture update
void draw_faces()
draws all faces of the mesh
void getRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat) override
Draws the object deferred.
void add_point_RenderObjects(IRenderer *_renderer, const RenderObject *_baseObj)
Draws the object.
void draw_vertices()
draws all vertices of the mesh
QString vertexColorsInterpolator
interpolation qualifier for input vertex colors: "flat", "smooth", "noperspective"
QString vertexNormalInterpolator
interpolation qualifier for vertex shader normal outputs: "flat", "smooth", "noperspective"
void addTextureType(GLenum _type, bool _shadow, size_t _stage)
adds a texture type to the shader and enables texturing.
void clearTextures()
disables texture support and removes all texture types
Kernel::ConstVertexIter ConstVertexIter
Scalar type.
vector_type & maximize(const vector_type &_rhs)
maximize values: same as *this = max(*this, _rhs), but faster
vector_type & minimize(const vector_type &_rhs)
minimize values: same as *this = min(*this, _rhs), but faster
DrawMode SOLID_SMOOTH_SHADED
draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)
DrawMode SOLID_PHONG_SHADED
draw phong shaded faces
DrawMode HALFEDGES
draw halfedges
DrawMode SOLID_ENV_MAPPED
draw environment mapped
DrawMode SOLID_POINTS_COLORED_SHADED
draw faces, but use Gouraud shading to interpolate vertex colors
DrawMode SOLID_FACES_COLORED_SMOOTH_SHADED
draw smooth shaded and colored faces (requires vertex normals and face colors)
DrawMode POINTS_COLORED
draw colored, but not lighted points (requires point colors)
DrawMode HALFEDGES_COLORED
draw halfedges with colors (without shading)
DrawMode SOLID_TEXTURED_SHADED
draw smooth shaded textured faces
DrawMode SOLID_2DTEXTURED_FACE
draw per halfedge textured faces
DrawMode SOLID_2DTEXTURED_FACE_SHADED
draw per halfedge textured faces
DrawMode SOLID_FACES_COLORED
draw colored, but not lighted faces using face colors
DrawMode SOLID_FACES_COLORED_FLAT_SHADED
draw flat shaded and colored faces (requires face normals and colors)
DrawMode WIREFRAME
draw wireframe
DrawMode HIDDENLINE
draw hidden line (2 rendering passes needed)
DrawMode SOLID_FACES_COLORED_2DTEXTURED_FACE_SMOOTH_SHADED
draw per halfedge texture faces modulated with face colors with smooth shading
DrawMode POINTS
draw unlighted points using the default base color
DrawMode POINTS_SHADED
draw shaded points (requires point normals)
DrawMode EDGES_COLORED
draw edges with colors (without shading)
DrawMode NONE
not a valid draw mode
DrawMode SOLID_POINTS_COLORED
draw colored, but not lighted faces using interpolated vertex colors
DrawMode SOLID_SMOOTH_SHADED_FEATURES
draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)
DrawMode SOLID_TEXTURED
draw textured faces
DrawMode SOLID_FLAT_SHADED
draw flat shaded faces (requires face normals)
PickTarget
What target to use for picking.
@ PICK_EDGE
picks edges (may not be implemented for all nodes)
@ PICK_ANYTHING
pick any of the prior targets (should be implemented for all nodes)
@ PICK_FRONT_VERTEX
picks only visible front verices (may not be implemented for all nodes)
@ PICK_FACE
picks faces (should be implemented for all nodes)
@ PICK_VERTEX
picks verices (may not be implemented for all nodes)
@ PICK_FRONT_EDGE
picks only visible front edges (may not be implemented for all nodes)
Namespace providing different geometric functions concerning angles.
void glColor(const Vec3f &_v)
Wrapper: glColor for Vec3f.
bool ACGDLLEXPORT openGLVersionTest(const int _major, const int _minor)
VectorT< float, 2 > Vec2f
@ VERTEX_USAGE_POSITION
"inPosition"
VectorT< double, 3 > Vec3d
Interface class between scenegraph and renderer.
ShaderGenDesc shaderDesc
Drawmode and other shader params.
void setupLineRendering(float _lineWidth, const Vec2f &_screenSize)
Setup rendering of thick lines.
const VertexDeclaration * vertexDecl
Defines the vertex buffer layout, ignored if VAO is provided.
GLuint indexBuffer
Use vertex array object.
int priority
Priority to allow sorting of objects.
GLuint vertexBuffer
VBO, IBO ids, ignored if VAO is provided.
Vec2f depthRange
glDepthRange: (znear, zmax)
void initFromState(GLState *_glState)
Initializes a RenderObject instance.
GLenum depthFunc
GL_LESS, GL_LEQUAL, GL_GREATER ..
void setupPointRendering(float _pointSize, const Vec2f &_screenSize)
Setup rendering of circle points.