Commit dc16ad3b authored by Dirk Wilden's avatar Dirk Wilden

some bugfixes + removed planeNode stuff

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6756 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cc6a6a1a
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
#include <ACG/GL/GLState.hh> #include <ACG/GL/GLState.hh>
#include <QStringList> #include <QStringList>
#include <ACG/QtScenegraph/QtTranslationManipulatorNode.hh> #include <ACG/QtScenegraph/QtTranslationManipulatorNode.hh>
#include <ACG/Scenegraph/PlaneNode.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh> #include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <OpenFlipper/common/GlobalOptions.hh> #include <OpenFlipper/common/GlobalOptions.hh>
...@@ -251,9 +250,6 @@ void MovePlugin::slotMouseWheelEvent(QWheelEvent * _event, const std::string & / ...@@ -251,9 +250,6 @@ void MovePlugin::slotMouseWheelEvent(QWheelEvent * _event, const std::string & /
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it) for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it)
o_it->manipulatorNode()->set_size(manip_size_ * manip_size_modifier_); o_it->manipulatorNode()->set_size(manip_size_ * manip_size_modifier_);
for (uint i=0; i < additionalManipulators_.size(); i++)
(additionalManipulators_[i])->set_size(manip_size_ * manip_size_modifier_);
emit visibilityChanged (-1); emit visibilityChanged (-1);
} }
...@@ -477,25 +473,24 @@ void MovePlugin::manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseE ...@@ -477,25 +473,24 @@ void MovePlugin::manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseE
_node->loadIdentity(); _node->loadIdentity();
_node->set_center(mat.transform_point(_node->center())); _node->set_center(mat.transform_point(_node->center()));
// Always move the object which corresponds to the manipulator // move the object which corresponds to the manipulator
if (PluginFunctions::pickMode() != "MoveSelection") if (PluginFunctions::pickMode() != "MoveSelection")
moveObject( mat, objectId ); moveObject( mat, objectId );
else else
moveSelection( mat, objectId ); moveSelection( mat, objectId );
// move all other targets without manipulator
if(allTargets_) { if(allTargets_) {
for (PluginFunctions::ObjectIterator o_it( for (PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS); o_it
PluginFunctions::TARGET_OBJECTS); o_it != PluginFunctions::objectsEnd(); ++o_it) {
!= PluginFunctions::objectsEnd(); ++o_it) { if ((o_it->id() != objectId) && !o_it->manipulatorNode()->visible()) { // If it has its own manipulator active, dont move it
if ((o_it->id() != objectId) if (PluginFunctions::pickMode() != "MoveSelection")
&& !o_it->manipulatorNode()->visible()) { // If it has its own manipulator active, dont move it moveObject(mat, o_it->id());
if (PluginFunctions::pickMode() != "MoveSelection") else
moveObject(mat, o_it->id()); moveSelection(mat, o_it->id());
else }
moveSelection(mat, o_it->id()); }
} }
}
}
lastActiveManipulator_ = objectId; lastActiveManipulator_ = objectId;
updateManipulatorDialog(); updateManipulatorDialog();
...@@ -577,46 +572,11 @@ void MovePlugin::placeManip(QMouseEvent * _event) ...@@ -577,46 +572,11 @@ void MovePlugin::placeManip(QMouseEvent * _event)
lastActiveManipulator_ = object->id(); lastActiveManipulator_ = object->id();
emit updateView(); emit updateView();
} else {
ACG::SceneGraph::BaseNode* node = ACG::SceneGraph::find_node( PluginFunctions::getSceneGraphRootNode(), node_idx );
ACG::SceneGraph::PlaneNode* planeNode = dynamic_cast< ACG::SceneGraph::PlaneNode* > (node);
if (planeNode){
ACG::SceneGraph::QtTranslationManipulatorNode* manipNode = dynamic_cast< ACG::SceneGraph::QtTranslationManipulatorNode* > (node->parent());
if (manipNode != 0){
manipNode->loadIdentity();
manipNode->set_center(hitPoint);
manipNode->set_draw_cylinder(true);
manipNode->set_autosize(QtTranslationManipulatorNode::Once);
manipNode->set_size(manip_size_ * manip_size_modifier_);
manipNode->setMode (manMode_);
manipNode->show();
manipNode->apply_transformation( PluginFunctions::pickMode() == "Move" );
connect(manipNode , SIGNAL(manipulatorMoved(QtTranslationManipulatorNode*,QMouseEvent*)),
this , SLOT( manipulatorMoved(QtTranslationManipulatorNode*,QMouseEvent*)));
connect(manipNode , SIGNAL(positionChanged(QtTranslationManipulatorNode*)),
this , SLOT( ManipulatorPositionChanged(QtTranslationManipulatorNode*)));
additionalManipulators_.push_back( manipNode );
}
} else {
emit log(LOGERR,"Picking ok, but Object was not found in the Object list");
}
} }
} else { } else {
emit log(LOGWARN,"Picking failed"); emit log(LOGWARN,"Picking failed");
} }
} }
...@@ -639,34 +599,11 @@ void MovePlugin::showManipulators( ) ...@@ -639,34 +599,11 @@ void MovePlugin::showManipulators( )
PluginFunctions::pickMode() == "Move"); PluginFunctions::pickMode() == "Move");
} }
for (uint i=0; i < additionalManipulators_.size(); i++)
(additionalManipulators_[i])->show();
} else { } else {
for (PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS); o_it for (PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS); o_it
!= PluginFunctions::objectsEnd(); ++o_it) != PluginFunctions::objectsEnd(); ++o_it)
o_it->manipulatorNode()->hide(); o_it->manipulatorNode()->hide();
for (uint i=0; i < additionalManipulators_.size(); i++){
//apply the transformation for planeNode
ACG::SceneGraph::BaseNode* node = (additionalManipulators_[i])->find("Plane");
if (node){
ACG::SceneGraph::PlaneNode* plane = dynamic_cast< ACG::SceneGraph::PlaneNode* > (node);
if (plane){
plane->setPosition( plane->position(), plane->normal() );
(additionalManipulators_[i])->set_center( (additionalManipulators_[i])->matrix().transform_point( (additionalManipulators_[i])->center() ) );
(additionalManipulators_[i])->loadIdentity();
}
}
(additionalManipulators_[i])->hide();
}
} }
emit updateView(); emit updateView();
......
...@@ -445,8 +445,6 @@ public slots : ...@@ -445,8 +445,6 @@ public slots :
bool allTargets_; bool allTargets_;
std::vector< ACG::SceneGraph::QtTranslationManipulatorNode* > additionalManipulators_;
}; };
#endif //MOVEPLUGIN_HH #endif //MOVEPLUGIN_HH
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