61 #include <ObjectTypes/Coordsys/CoordinateSystemNode.hh>
68 namespace SceneGraph {
83 sphere_ =
new GLSphere(slices_, stacks_);
84 cone_ =
new GLCone(slices_, stacks_, 1.0f, 1.0f,
false,
true);
85 cylinder_ =
new GLCylinder(slices_, stacks_, 1.0f,
false,
false);
86 disk_ =
new GLDisk(slices_, loops_, 0.1f, 1.0f);
114 _bbMin.minimize( topLeft );
117 _bbMax.maximize( topLeft );
137 CoordinateSystemNode::
138 drawCoordsys(
GLState& _state) {
147 glColor3f(0.5, 0.5, 0.5);
148 sphere_->draw(_state, sphereRadius);
151 glColor3f(1.0, 0.0, 0.0);
153 _state.
rotate (-90, 0, 1, 0);
155 cylinder_->setBottomRadius(bodyRadius);
156 cylinder_->setTopRadius(bodyRadius);
157 cylinder_->draw(_state, bodyLength);
158 disk_->setInnerRadius(0.0f);
159 disk_->setOuterRadius(topRadius);
162 cone_->setBottomRadius(0.0f);
163 cone_->setTopRadius(topRadius);
164 cone_->draw(_state, arrowLength);
168 glColor3f(0.0, 1.0, 0.0);
170 _state.
rotate (90, 1, 0, 0);
172 cylinder_->draw(_state, bodyLength);
175 cone_->draw(_state, arrowLength);
179 glColor3f(0.0, 0.0, 1.0);
181 _state.
rotate (180, 0, 1, 0);
183 cylinder_->draw(_state, bodyLength);
186 cone_->draw(_state, arrowLength);
194 CoordinateSystemNode::drawCoordsysPick(
GLState& _state) {
204 sphere_->draw(_state, sphereRadius);
209 _state.
rotate (-90, 0, 1, 0);
211 cylinder_->setBottomRadius(bodyRadius);
212 cylinder_->setTopRadius(bodyRadius);
213 cylinder_->draw(_state, bodyLength);
214 disk_->setInnerRadius(0.0f);
215 disk_->setOuterRadius(topRadius);
218 cone_->setBottomRadius(0.0f);
219 cone_->setTopRadius(topRadius);
220 cone_->draw(_state, arrowLength);
226 _state.
rotate (90, 1, 0, 0);
228 cylinder_->draw(_state, bodyLength);
231 cone_->draw(_state, arrowLength);
237 _state.
rotate (180, 0, 1, 0);
239 cylinder_->draw(_state, bodyLength);
242 cone_->draw(_state, arrowLength);
254 glPushAttrib(GL_ENABLE_BIT);
261 glColorMaterial ( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ) ;
275 drawCoordsys(_state);
277 glColor4fv(lastBaseColor.data());
346 drawCoordsysPick(_state);
Namespace providing different geometric functions concerning angles.
Vec3d position()
Get current position of the coordinate system;.
static void enable(GLenum _cap)
replaces glEnable, but supports locking
Matrix4x4d rotation()
Get current rotation of the coordinate system;.
void pick_set_name(unsigned int _idx)
sets the current name/color (like glLoadName(_idx))
PickTarget
What target to use for picking.
bool pick_set_maximum(unsigned int _idx)
Set the maximal number of primitives/components of your object.
pick any of the prior targets (should be implemented for all nodes)
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode)
draw Coordsys
void translate(double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
translate by (_x, _y, _z)
~CoordinateSystemNode()
destructor
void rotate(double _angle, double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
rotate around axis (_x, _y, _z) by _angle
static void shadeModel(GLenum _mode)
replaces glShadeModel, supports locking
VectorT< double, 3 > Vec3d
const GLMatrixd & modelview() const
get modelview matrix
DrawMode SOLID_SMOOTH_SHADED
draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)
void push_modelview_matrix()
push modelview matrix
Matrix4x4d rotation_
Orientation of coordsys.
void pick(GLState &_state, PickTarget _target)
draw Coordsys for object picking
CoordinateSystemNode(BaseNode *_parent=0, std::string _name="<TextNode>")
void pop_modelview_matrix()
pop modelview matrix
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax)
update bounding box
void identity()
setup an identity matrix
double size()
Get current size.
void set_modelview(const GLMatrixd &_m)
set modelview
double coordsysSize_
Size of the coordsys.
const Vec4f & base_color() const
get base color (used when lighting is off)
ACG::SceneGraph::DrawModes::DrawMode availableDrawModes() const
return available draw modes
Vec3d position_
3d position of the coordsys origin