56 #include "TriangleNode.hh" 69 TriangleNode::TriangleNode(
BaseNode* _parent,
70 const std::string& _name )
79 TriangleNode::~TriangleNode()
90 Vec3f bbMin(FLT_MAX,FLT_MAX,FLT_MAX);
91 Vec3f bbMax(-FLT_MAX,-FLT_MAX,-FLT_MAX);
93 PointVector::const_iterator p_it = point_.begin(),
96 for ( ; p_it != p_end; ++p_it )
140 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
142 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
147 _drawMode & DrawModes::HIDDENLINE )
182 TriangleNode::draw_faces()
184 glBegin(GL_TRIANGLES);
189 for ( ; i < point_.size(); i += 3, j += 1 )
206 TriangleNode::draw_wireframe()
208 glBegin(GL_TRIANGLES);
209 for (
unsigned int i = 0; i < point_.size(); ++i )
static void enable(GLenum _cap, bool _warnRemoved=true)
replaces glEnable, but supports locking
static void shadeModel(GLenum _mode)
replaces glShadeModel, supports locking
void glNormal(const Vec3f &_n)
Wrapper: glNormal for Vec3f.
Namespace providing different geometric functions concerning angles.
void pick(GLState &_state, PickTarget _target) override
DrawMode HIDDENLINE
draw hidden line (2 rendering passes needed)
vector_type & maximize(const vector_type &_rhs)
maximize values: same as *this = max(*this, _rhs), but faster
static void depthRange(GLclampd _zNear, GLclampd _zFar)
replaces glDepthRange, supports locking
PickTarget
What target to use for picking.
static void disable(GLenum _cap, bool _warnRemoved=true)
replaces glDisable, but supports locking
bool pick_set_maximum(size_t _idx)
Set the maximal number of primitives/components of your object.
DrawModes::DrawMode availableDrawModes() const override
vector_type & minimize(const vector_type &_rhs)
minimize values: same as *this = min(*this, _rhs), but faster
void glVertex(const Vec2i &_v)
Wrapper: glVertex for Vec2i.
DrawMode NONE
not a valid draw mode
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax) override
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode) override
Draw this node using the draw modes _drawMode.
DrawMode SOLID_FLAT_SHADED
draw flat shaded faces (requires face normals)
DrawMode WIREFRAME
draw wireframe
DrawMode SOLID_FACES_COLORED
draw colored, but not lighted faces using face colors
void pick_set_name(size_t _idx)
sets the current name/color (like glLoadName(_idx))
VectorT< double, 3 > Vec3d