Commit 8e4d8cf4 authored by Jan Möbius's avatar Jan Möbius
Browse files

Isaak: Manipulatornode conversion to GLPrimitives

refs #285



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13478 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9d278d6a
......@@ -105,7 +105,7 @@ ManipulatorNode::
~ManipulatorNode()
{
if (cylinder_)
gluDeleteQuadric(cylinder_);
delete cylinder_;
}
......@@ -186,9 +186,7 @@ ManipulatorNode::draw(GLState& _state, const DrawModes::DrawMode& /* _drawMode *
if (!cylinder_)
{
cylinder_ = gluNewQuadric();
gluQuadricDrawStyle(cylinder_, GLU_FILL);
gluQuadricNormals(cylinder_, GLU_SMOOTH);
cylinder_ = new GLCylinder(cylinder_slices_, cylinder_stacks_, cylinder_radius_, false, false);
}
_state.push_modelview_matrix();
......@@ -211,12 +209,9 @@ ManipulatorNode::draw(GLState& _state, const DrawModes::DrawMode& /* _drawMode *
glRotatef(-90, 0.0, 1.0, 0.0);*/
ACG::GLState::shadeModel(GL_SMOOTH);
gluCylinder(cylinder_,
cylinder_radius_,
cylinder_radius_,
cylinder_height_,
cylinder_slices_,
cylinder_stacks_);
cylinder_->setBottomRadius(cylinder_radius_);
cylinder_->setTopRadius(cylinder_radius_);
cylinder_->draw(_state, cylinder_height_);
//glPopMatrix();
......@@ -554,8 +549,9 @@ void ManipulatorNode::pick(GLState& _state, PickTarget _target) {
setup_cylinder_system(_state);
//glLoadName(1);
_state.pick_set_name(0);
gluCylinder(cylinder_, cylinder_radius_, cylinder_radius_, cylinder_height_, cylinder_slices_,
cylinder_stacks_);
cylinder_->setBottomRadius(cylinder_radius_);
cylinder_->setTopRadius(cylinder_radius_);
cylinder_->draw(_state, cylinder_height_);
_state.pop_modelview_matrix();
// sphere
......
......@@ -64,6 +64,8 @@
#include <QEvent>
#include <QMouseEvent>
#include <ACG/GL/GLPrimitives.hh>
//== NAMESPACES ===============================================================
......@@ -166,7 +168,7 @@ private:
bool draw_cylinder_;
Vec3d direction_;
GLUquadricObj* cylinder_;
GLCylinder* cylinder_;
double cylinder_radius_;
double cylinder_height_;
int cylinder_slices_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment