Commit c5970778 authored by Marlin Frickenschmidt's avatar Marlin Frickenschmidt

Fixed a few bugs in Coordsys display and picking

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10483 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f20282de
......@@ -243,7 +243,7 @@ draw(GLState& _state , DrawModes::DrawMode /*_drawMode*/)
if (projectionMode_ == PERSPECTIVE_PROJECTION)
_state.perspective(45.0, aspect, 0.8, 20.0);
else
_state.ortho(-0.5*aspect, 0.5*aspect, -0.5, 0.5, 0.8, 20.0);
_state.ortho(-0.65*aspect, 0.65*aspect, -0.65, 0.65, 0.8, 20.0);
_state.push_modelview_matrix();
_state.reset_modelview();
......@@ -411,7 +411,7 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
if (projectionMode_ == PERSPECTIVE_PROJECTION)
_state.perspective(45.0, aspect, 0.8, 20.0);
else
_state.ortho(-0.5*aspect, 0.5*aspect, -0.5, 0.5, 0.8, 20.0);
_state.ortho(-0.65*aspect, 0.65*aspect, -0.65, 0.65, 0.8, 20.0);
_state.push_modelview_matrix();
_state.reset_modelview();
......
......@@ -534,7 +534,7 @@ Core::init() {
this, SLOT( viewUpdated()) ,Qt::DirectConnection);
connect( coreWidget_->examiner_widgets_[i], SIGNAL( viewChanged() ),
this, SIGNAL( pluginViewChanged() ) ,Qt::DirectConnection);
coreWidget_->examiner_widgets_[i], SLOT( updateGL() ) ,Qt::DirectConnection);
}
}
......
......@@ -184,21 +184,24 @@ ACG::SceneGraph::CoordsysNode::ProjectionMode CoreWidget::getCoordsysProjection(
}
/// Toggle coordsys projection mode of the active viewer
void CoreWidget::slotContextSwitchCoordsysProjection() {
void CoreWidget::slotContextSwitchCoordsysProjection() {
// Find coordsys node
ACG::SceneGraph::BaseNode* node = 0;
node = PluginFunctions::getSceneGraphRootNode()->find("Core Coordsys Node");
if (node != 0) {
ACG::SceneGraph::CoordsysNode* cnode = dynamic_cast<ACG::SceneGraph::CoordsysNode*> (node);
if (cnode->getProjectionMode() == ACG::SceneGraph::CoordsysNode::PERSPECTIVE_PROJECTION) {
cnode->setProjectionMode(ACG::SceneGraph::CoordsysNode::ORTHOGRAPHIC_PROJECTION);
}
else {
cnode->setProjectionMode(ACG::SceneGraph::CoordsysNode::PERSPECTIVE_PROJECTION);
}
ACG::SceneGraph::CoordsysNode* cnode = dynamic_cast<ACG::SceneGraph::CoordsysNode*> (node);
if (cnode->getProjectionMode() == ACG::SceneGraph::CoordsysNode::PERSPECTIVE_PROJECTION) {
cnode->setProjectionMode(ACG::SceneGraph::CoordsysNode::ORTHOGRAPHIC_PROJECTION);
}
else {
cnode->setProjectionMode(ACG::SceneGraph::CoordsysNode::PERSPECTIVE_PROJECTION);
}
} else {
emit statusMessage(QString(tr("slotContextSwitchCoordsysProjection(): Could not find coordsys node, thus its projection mode will not be toggled.")));
}
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
examiner_widgets_[i]->updateGL();
}
/// Toggle projection mode of all viewers to perspective projection
......
Markdown is supported
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