62 #include "TriangleNode.hh"
69 namespace SceneGraph {
75 TriangleNode::TriangleNode(
BaseNode* _parent,
85 TriangleNode::~TriangleNode()
96 Vec3f bbMin(FLT_MAX,FLT_MAX,FLT_MAX);
97 Vec3f bbMax(-FLT_MAX,-FLT_MAX,-FLT_MAX);
99 PointVector::const_iterator p_it = point_.begin(),
100 p_end = point_.end();
102 for ( ; p_it != p_end; ++p_it )
104 bbMin.minimize( *p_it );
105 bbMax.maximize( *p_it );
111 _bbMin.minimize(bbMind);
112 _bbMax.maximize(bbMaxd);
146 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
148 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
153 _drawMode & DrawModes::HIDDENLINE )
188 TriangleNode::draw_faces()
190 glBegin(GL_TRIANGLES);
195 for ( ; i < point_.size(); i += 3, j += 1 )
212 TriangleNode::draw_wireframe()
214 glBegin(GL_TRIANGLES);
215 for (
unsigned int i = 0; i < point_.size(); ++i )
225 TriangleNode::pick( GLState & _state,
PickTarget )
227 _state.pick_set_maximum (1);
228 _state.pick_set_name (0);
Namespace providing different geometric functions concerning angles.
static void enable(GLenum _cap)
replaces glEnable, but supports locking
DrawMode HIDDENLINE
draw hidden line (2 rendering passes needed)
PickTarget
What target to use for picking.
static void disable(GLenum _cap)
replaces glDisable, but supports locking
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax)
DrawModes::DrawMode availableDrawModes() const
DrawMode SOLID_FLAT_SHADED
draw flat shaded faces (requires face normals)
static void shadeModel(GLenum _mode)
replaces glShadeModel, supports locking
VectorT< double, 3 > Vec3d
void glNormal(const Vec3f &_n)
Wrapper: glNormal for Vec3f.
DrawMode WIREFRAME
draw wireframe
DrawMode SOLID_FACES_COLORED
draw colored, but not lighted faces using face colors
static void depthRange(GLclampd _zNear, GLclampd _zFar)
replaces glDepthRange, supports locking
void glVertex(const Vec2i &_v)
Wrapper: glVertex for Vec2i.
DrawMode NONE
not a valid draw mode