55 #include <ObjectTypes/Coordsys/CoordinateSystemNode.hh> 77 sphere_ =
new GLSphere(slices_, stacks_);
78 cone_ =
new GLCone(slices_, stacks_, 1.0f, 1.0f,
false,
true);
79 cylinder_ =
new GLCylinder(slices_, stacks_, 1.0f,
false,
false);
80 disk_ =
new GLDisk(slices_, loops_, 0.1f, 1.0f);
131 CoordinateSystemNode::
132 drawCoordsys(
GLState& _state) {
141 glColor3f(0.5, 0.5, 0.5);
142 sphere_->draw(_state, sphereRadius);
145 glColor3f(1.0, 0.0, 0.0);
147 _state.
rotate (-90, 0, 1, 0);
149 cylinder_->setBottomRadius(bodyRadius);
150 cylinder_->setTopRadius(bodyRadius);
151 cylinder_->draw(_state, bodyLength);
152 disk_->setInnerRadius(0.0f);
153 disk_->setOuterRadius(topRadius);
156 cone_->setBottomRadius(0.0f);
157 cone_->setTopRadius(topRadius);
158 cone_->draw(_state, arrowLength);
162 glColor3f(0.0, 1.0, 0.0);
164 _state.
rotate (90, 1, 0, 0);
166 cylinder_->draw(_state, bodyLength);
169 cone_->draw(_state, arrowLength);
173 glColor3f(0.0, 0.0, 1.0);
175 _state.
rotate (180, 0, 1, 0);
177 cylinder_->draw(_state, bodyLength);
180 cone_->draw(_state, arrowLength);
188 CoordinateSystemNode::drawCoordsysPick(
GLState& _state) {
198 sphere_->draw(_state, sphereRadius);
203 _state.
rotate (-90, 0, 1, 0);
205 cylinder_->setBottomRadius(bodyRadius);
206 cylinder_->setTopRadius(bodyRadius);
207 cylinder_->draw(_state, bodyLength);
208 disk_->setInnerRadius(0.0f);
209 disk_->setOuterRadius(topRadius);
212 cone_->setBottomRadius(0.0f);
213 cone_->setTopRadius(topRadius);
214 cone_->draw(_state, arrowLength);
220 _state.
rotate (90, 1, 0, 0);
222 cylinder_->draw(_state, bodyLength);
225 cone_->draw(_state, arrowLength);
231 _state.
rotate (180, 0, 1, 0);
233 cylinder_->draw(_state, bodyLength);
236 cone_->draw(_state, arrowLength);
248 glPushAttrib(GL_ENABLE_BIT);
255 glColorMaterial ( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ) ;
269 drawCoordsys(_state);
271 glColor4fv(lastBaseColor.
data());
340 drawCoordsysPick(_state);
void pop_modelview_matrix()
pop modelview matrix
CoordinateSystemNode(BaseNode *_parent=0, std::string _name="<TextNode>")
~CoordinateSystemNode()
destructor
Namespace providing different geometric functions concerning angles.
const Vec4f & base_color() const
get base color (used when lighting is off)
double coordsysSize_
Size of the coordsys.
void identity()
setup an identity matrix
Matrix4x4d rotation()
Get current rotation of the coordinate system;.
vector_type & maximize(const vector_type &_rhs)
maximize values: same as *this = max(*this, _rhs), but faster
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax) override
update bounding box
DrawMode SOLID_SMOOTH_SHADED
draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode) override
draw Coordsys
Scalar * data()
access to Scalar array
double size()
Get current size.
PickTarget
What target to use for picking.
void push_modelview_matrix()
push modelview matrix
void set_modelview(const GLMatrixd &_m)
set modelview
Vec3d position_
3d position of the coordsys origin
Vec3d position()
Get current position of the coordinate system;.
pick any of the prior targets (should be implemented for all nodes)
ACG::SceneGraph::DrawModes::DrawMode availableDrawModes() const override
return available draw modes
bool pick_set_maximum(size_t _idx)
Set the maximal number of primitives/components of your object.
vector_type & minimize(const vector_type &_rhs)
minimize values: same as *this = min(*this, _rhs), but faster
void pick(GLState &_state, PickTarget _target) override
draw Coordsys for object picking
void rotate(double _angle, double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
rotate around axis (_x, _y, _z) by _angle
void pick_set_name(size_t _idx)
sets the current name/color (like glLoadName(_idx))
const GLMatrixd & modelview() const
get modelview matrix
static void enable(GLenum _cap, bool _warnRemoved=true)
replaces glEnable, but supports locking
Matrix4x4d rotation_
Orientation of coordsys.
static void shadeModel(GLenum _mode)
replaces glShadeModel, supports locking
void translate(double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
translate by (_x, _y, _z)
VectorT< double, 3 > Vec3d