61 #include <ObjectTypes/Coordsys/CoordinateSystemNode.hh> 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);
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);
DrawMode SOLID_SMOOTH_SHADED
draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode)
draw Coordsys
void push_modelview_matrix()
push modelview matrix
Matrix4x4d rotation()
Get current rotation of the coordinate system;.
PickTarget
What target to use for picking.
void identity()
setup an identity matrix
vector_type & maximize(const vector_type &_rhs)
maximize values: same as *this = max(*this, _rhs), but faster
static void enable(GLenum _cap)
replaces glEnable, but supports locking
CoordinateSystemNode(BaseNode *_parent=0, std::string _name="<TextNode>")
const Vec4f & base_color() const
get base color (used when lighting is off)
Vec3d position()
Get current position of the coordinate system;.
Vec3d position_
3d position of the coordsys origin
void translate(double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
translate by (_x, _y, _z)
bool pick_set_maximum(unsigned int _idx)
Set the maximal number of primitives/components of your object.
void set_modelview(const GLMatrixd &_m)
set modelview
Namespace providing different geometric functions concerning angles.
void pop_modelview_matrix()
pop modelview matrix
void pick_set_name(unsigned int _idx)
sets the current name/color (like glLoadName(_idx))
void rotate(double _angle, double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
rotate around axis (_x, _y, _z) by _angle
const GLMatrixd & modelview() const
get modelview matrix
~CoordinateSystemNode()
destructor
void pick(GLState &_state, PickTarget _target)
draw Coordsys for object picking
pick any of the prior targets (should be implemented for all nodes)
vector_type & minimize(const vector_type &_rhs)
minimize values: same as *this = min(*this, _rhs), but faster
double coordsysSize_
Size of the coordsys.
Matrix4x4d rotation_
Orientation of coordsys.
VectorT< double, 3 > Vec3d
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax)
update bounding box
double size()
Get current size.
ACG::SceneGraph::DrawModes::DrawMode availableDrawModes() const
return available draw modes
static void shadeModel(GLenum _mode)
replaces glShadeModel, supports locking
Scalar * data()
access to Scalar array