Commit f92e2af9 authored by Jan Möbius's avatar Jan Möbius

Don't addroot joint twice

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12509 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 25a3f587
...@@ -17,7 +17,8 @@ SkeletonEditingPlugin::SkeletonEditingPlugin() ...@@ -17,7 +17,8 @@ SkeletonEditingPlugin::SkeletonEditingPlugin()
currentJoint_(-1), currentJoint_(-1),
jointPreview_(false), jointPreview_(false),
transformChildJoints_(false), transformChildJoints_(false),
transformAllFrames_(true) transformAllFrames_(true),
dblClick_(false)
{ {
manip_size_ = 1.0; manip_size_ = 1.0;
manip_size_modifier_ = 1.0; manip_size_modifier_ = 1.0;
...@@ -690,6 +691,8 @@ void SkeletonEditingPlugin::insertJoint(QMouseEvent* _event) ...@@ -690,6 +691,8 @@ void SkeletonEditingPlugin::insertJoint(QMouseEvent* _event)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
else if ( _event->type() == QEvent::MouseButtonDblClick ){ else if ( _event->type() == QEvent::MouseButtonDblClick ){
dblClick_ = true;
// end the path in the skeleton // end the path in the skeleton
if (currentSkeleton_ != -1){ if (currentSkeleton_ != -1){
cancelJointInsertion(); cancelJointInsertion();
...@@ -707,6 +710,7 @@ void SkeletonEditingPlugin::insertJoint(QMouseEvent* _event) ...@@ -707,6 +710,7 @@ void SkeletonEditingPlugin::insertJoint(QMouseEvent* _event)
lastHitPoint = PluginFunctions::viewerProperties().glState().unproject(viewCoords); lastHitPoint = PluginFunctions::viewerProperties().glState().unproject(viewCoords);
} }
int newSkeletonID = -1; int newSkeletonID = -1;
emit addEmptyObject(DATA_SKELETON, newSkeletonID); emit addEmptyObject(DATA_SKELETON, newSkeletonID);
...@@ -776,7 +780,9 @@ void SkeletonEditingPlugin::insertJoint(QMouseEvent* _event) ...@@ -776,7 +780,9 @@ void SkeletonEditingPlugin::insertJoint(QMouseEvent* _event)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// handle RELEASE events // handle RELEASE events
//---------------------------------------------------------------------- //----------------------------------------------------------------------
} else if ( _event->type() == QEvent::MouseButtonRelease ){ } else if ( _event->type() == QEvent::MouseButtonRelease){
if (!dblClick_) {
// CASE 1 : this is a release on a joint from which the insertion should be started // CASE 1 : this is a release on a joint from which the insertion should be started
if ( !jointPreview_ ){ if ( !jointPreview_ ){
...@@ -858,8 +864,11 @@ void SkeletonEditingPlugin::insertJoint(QMouseEvent* _event) ...@@ -858,8 +864,11 @@ void SkeletonEditingPlugin::insertJoint(QMouseEvent* _event)
} }
} else
dblClick_ = false;
} }
// keep the joint selection correct // keep the joint selection correct
if ( (_event->type() != QEvent::MouseButtonPress) ){ if ( (_event->type() != QEvent::MouseButtonPress) ){
BaseObjectData* baseObject = 0; BaseObjectData* baseObject = 0;
......
...@@ -206,6 +206,8 @@ class SkeletonEditingPlugin : public QObject, BaseInterface, MouseInterface, Key ...@@ -206,6 +206,8 @@ class SkeletonEditingPlugin : public QObject, BaseInterface, MouseInterface, Key
bool transformChildJoints_; bool transformChildJoints_;
bool transformAllFrames_; bool transformAllFrames_;
bool dblClick_;
private: private:
// object ids of all objects with active Manipulator // object ids of all objects with active Manipulator
std::vector< int > activeManipulators_; std::vector< int > activeManipulators_;
......
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