62 #include "CoordFrameNode.hh"
64 #include "../GL/gltext.hh"
65 #include "../GL/stipple_alpha.hh"
74 namespace SceneGraph {
84 bb_min_ = bb_max_ =
Vec3f(0,0,0);
105 _bbMin.minimize(bb_min_);
106 _bbMax.maximize(bb_max_);
121 glBegin(GL_LINE_LOOP);
122 glVertex3f(bb_min_[0], bb_min_[1], bb_min_[2]);
123 glVertex3f(bb_max_[0], bb_min_[1], bb_min_[2]);
124 glVertex3f(bb_max_[0], bb_max_[1], bb_min_[2]);
125 glVertex3f(bb_min_[0], bb_max_[1], bb_min_[2]);
128 glBegin(GL_LINE_LOOP);
129 glVertex3f(bb_min_[0], bb_min_[1], bb_max_[2]);
130 glVertex3f(bb_max_[0], bb_min_[1], bb_max_[2]);
131 glVertex3f(bb_max_[0], bb_max_[1], bb_max_[2]);
132 glVertex3f(bb_min_[0], bb_max_[1], bb_max_[2]);
136 glVertex3f(bb_min_[0], bb_min_[1], bb_min_[2]);
137 glVertex3f(bb_min_[0], bb_min_[1], bb_max_[2]);
138 glVertex3f(bb_max_[0], bb_min_[1], bb_min_[2]);
139 glVertex3f(bb_max_[0], bb_min_[1], bb_max_[2]);
140 glVertex3f(bb_max_[0], bb_max_[1], bb_min_[2]);
141 glVertex3f(bb_max_[0], bb_max_[1], bb_max_[2]);
142 glVertex3f(bb_min_[0], bb_max_[1], bb_min_[2]);
143 glVertex3f(bb_min_[0], bb_max_[1], bb_max_[2]);
150 std::vector<float>::const_iterator p_it, p_end;
151 Vec3f v0, v1, v2, v3;
157 p_it = x_planes_.begin();
158 p_end = x_planes_.end();
162 for (
bool finished(
false); !finished; )
170 p_it = y_planes_.begin();
171 p_end = y_planes_.end();
176 p_it = z_planes_.begin();
177 p_end = z_planes_.end();
192 v0 =
Vec3f(*p_it, bb_min_[1], bb_min_[2]);
193 v1 =
Vec3f(*p_it, bb_max_[1], bb_min_[2]);
194 v2 =
Vec3f(*p_it, bb_max_[1], bb_max_[2]);
195 v3 =
Vec3f(*p_it, bb_min_[1], bb_max_[2]);
199 v0 =
Vec3f(bb_min_[0], *p_it, bb_min_[2]);
200 v1 =
Vec3f(bb_max_[0], *p_it, bb_min_[2]);
201 v2 =
Vec3f(bb_max_[0], *p_it, bb_max_[2]);
202 v3 =
Vec3f(bb_min_[0], *p_it, bb_max_[2]);
206 v0 =
Vec3f(bb_min_[0], bb_min_[1], *p_it);
207 v1 =
Vec3f(bb_max_[0], bb_min_[1], *p_it);
208 v2 =
Vec3f(bb_max_[0], bb_max_[1], *p_it);
209 v3 =
Vec3f(bb_min_[0], bb_max_[1], *p_it);
221 glBegin(GL_LINE_LOOP);
227 sprintf(s,
"%c=%f", axis, *p_it);
248 bb_min_ = bb_action.
bbMin();
249 bb_max_ = bb_action.
bbMax();
Namespace providing different geometric functions concerning angles.
static void disable(GLenum _cap)
replaces glDisable, but supports locking
DrawMode SOLID_FLAT_SHADED
draw flat shaded faces (requires face normals)
static void shadeModel(GLenum _mode)
replaces glShadeModel, supports locking
CoordFrameNode(BaseNode *_parent=0, const std::string &_name="<CoordFrameNode>")
Default constructor.
void update_bounding_box()
update bounding box (compute in from BB of children)
void set_bounding_box(const Vec3f &_bb_min, const Vec3f &_bb_max)
set bounding box
const Vec3d & bbMax() const
Returns maximum point of the bounding box.
VectorT< float, 3 > Vec3f
const Vec3d & bbMin() const
Returns minimum point of the bounding box.
DrawMode WIREFRAME
draw wireframe
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode)
drawing the primitive
void traverse(BaseNode *_node, Action &_action)
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax)
update bounding box
void glVertex(const Vec2i &_v)
Wrapper: glVertex for Vec2i.
void glText(const Vec3f &_pos, const std::string &_text, void *_font)
Text output in OpenGL, given 3D text position.
DrawModes::DrawMode availableDrawModes() const
return available draw modes