@@ -394,13 +394,13 @@ ViewSceneDialog::ViewSceneDialog(const std::string& name, ModuleStateHandle stat
394394 state->connectSpecificStateChanged (Parameters::GeomData,[this ](){Q_EMIT newGeometryValueForwarder ();});
395395 connect (this , SIGNAL (newGeometryValueForwarder ()), this , SLOT (updateModifiedGeometriesAndSendScreenShot ()));
396396
397- state->connectSpecificStateChanged (Modules::Render::ViewScene::CameraRotation ,[this ](){Q_EMIT cameraRotationChangeForwarder ();});
397+ state->connectSpecificStateChanged (Parameters::CameraRotation1 ,[this ](){Q_EMIT cameraRotationChangeForwarder ();});
398398 connect (this , SIGNAL (cameraRotationChangeForwarder ()), this , SLOT (pullCameraRotation ()));
399399
400- state->connectSpecificStateChanged (Modules::Render::ViewScene ::CameraLookAt,[this ](){Q_EMIT cameraLookAtChangeForwarder ();});
400+ state->connectSpecificStateChanged (Parameters ::CameraLookAt,[this ](){Q_EMIT cameraLookAtChangeForwarder ();});
401401 connect (this , SIGNAL (cameraLookAtChangeForwarder ()), this , SLOT (pullCameraLookAt ()));
402402
403- state->connectSpecificStateChanged (Modules::Render::ViewScene ::CameraDistance,[this ](){Q_EMIT cameraDistnaceChangeForwarder ();});
403+ state->connectSpecificStateChanged (Parameters ::CameraDistance,[this ](){Q_EMIT cameraDistnaceChangeForwarder ();});
404404 connect (this , SIGNAL (cameraDistnaceChangeForwarder ()), this , SLOT (pullCameraDistance ()));
405405
406406 state->connectSpecificStateChanged (Parameters::VSMutex, [this ](){Q_EMIT lockMutexForwarder ();});
@@ -771,9 +771,9 @@ void ViewSceneDialog::pullCameraRotation()
771771 return ;
772772
773773 glm::quat q;
774- auto rotVariable = state_->getValue (Modules::Render::ViewScene::CameraRotation );
774+ auto rotVariable = state_->getValue (Parameters::CameraRotation1 );
775775 if (rotVariable.value ().type () == typeid (std::string)) // Legacy interpreter for networks that have this stored as string
776- q = ViewSceneUtility::stringToQuat (state_->getValue (Modules::Render::ViewScene::CameraRotation ).toString ());
776+ q = ViewSceneUtility::stringToQuat (state_->getValue (Parameters::CameraRotation1 ).toString ());
777777 else
778778 {
779779 auto rotation = toDoubleVector (rotVariable.toVector ());
@@ -784,6 +784,7 @@ void ViewSceneDialog::pullCameraRotation()
784784 " values. " + std::to_string (rotation.size ()) + " values were provided." );
785785 }
786786
787+ qDebug () << name_.c_str () << " setCameraRotation" << q.w << q.x << q.y << q.z ;
787788 spire->setCameraRotation (q);
788789}
789790
@@ -794,7 +795,7 @@ void ViewSceneDialog::pullCameraLookAt()
794795 auto spire = mSpire .lock ();
795796 if (!spire) return ;
796797
797- auto lookAtVariable = state_->getValue (Modules::Render::ViewScene ::CameraLookAt);
798+ auto lookAtVariable = state_->getValue (Parameters ::CameraLookAt);
798799 if (lookAtVariable.value ().type () == typeid (std::string)) // Legacy interpreter for networks that have this stored as string
799800 {
800801 auto lookAtPoint = pointFromString (lookAtVariable.toString ());
@@ -818,8 +819,8 @@ void ViewSceneDialog::pullCameraDistance()
818819 auto spire = mSpire .lock ();
819820 if (!spire) return ;
820821
821- double distance = state_->getValue (Modules::Render::ViewScene ::CameraDistance).toDouble ();
822- double distanceMin = state_->getValue (Modules::Render::ViewScene ::CameraDistanceMinimum).toDouble ();
822+ double distance = state_->getValue (Parameters ::CameraDistance).toDouble ();
823+ double distanceMin = state_->getValue (Parameters ::CameraDistanceMinimum).toDouble ();
823824 distance = std::max (std::abs (distance), distanceMin);
824825 spire->setCameraDistance (distance);
825826}
@@ -839,7 +840,7 @@ void ViewSceneDialog::pushCameraDistance()
839840 auto spire = mSpire .lock ();
840841 if (!spire) return ;
841842
842- state_->setValue (Modules::Render::ViewScene ::CameraDistance, (double )spire->getCameraDistance ());
843+ state_->setValue (Parameters ::CameraDistance, (double )spire->getCameraDistance ());
843844 pushingCameraState_ = false ;
844845}
845846
@@ -852,7 +853,7 @@ void ViewSceneDialog::pushCameraLookAt()
852853
853854 auto v = spire->getCameraLookAt ();
854855 auto lookAt = makeAnonymousVariableList ((double )v.x , (double )v.y , (double )v.z );
855- state_->setValue (Modules::Render::ViewScene ::CameraLookAt, lookAt);
856+ state_->setValue (Parameters ::CameraLookAt, lookAt);
856857 pushingCameraState_ = false ;
857858}
858859
@@ -861,10 +862,11 @@ void ViewSceneDialog::pushCameraRotation()
861862{
862863 pushingCameraState_ = true ;
863864 auto spire = mSpire .lock ();
864- if (!spire) return ;
865+ if (!spire) return ;
865866
866867 auto q = spire->getCameraRotation ();
867- state_->setValue (Modules::Render::ViewScene::CameraRotation, makeAnonymousVariableList (q.w , q.x , q.y , q.z ));
868+ state_->setValue (Parameters::CameraRotation1, makeAnonymousVariableList (q.w , q.x , q.y , q.z ));
869+ qDebug () << name_.c_str () << " pushCameraRotation" << q.w << q.x << q.y << q.z ;
868870 pushingCameraState_ = false ;
869871}
870872
@@ -938,24 +940,30 @@ void ViewSceneDialog::pullSpecial()
938940
939941 if (parentWidget ())
940942 {
941- if (savedPos_)
942- {
943- parentWidget ()->move (*savedPos_);
944- }
945- else
946- {
947- const auto x = state_->getValue (Parameters::WindowPositionX).toInt ();
948- const auto y = state_->getValue (Parameters::WindowPositionY).toInt ();
949- parentWidget ()->move (x, y);
950- }
951943 auto dock = qobject_cast<QDockWidget*>(parentWidget ());
944+ const auto isFloating = state_->getValue (Parameters::IsFloating).toBool ();
952945 if (dock)
953- dock->setFloating (state_->getValue (Parameters::IsFloating).toBool ());
946+ dock->setFloating (isFloating);
947+
948+ if (isFloating)
949+ {
950+ if (savedPos_)
951+ {
952+ parentWidget ()->move (*savedPos_);
953+ }
954+ else
955+ {
956+ const auto x = state_->getValue (Parameters::WindowPositionX).toInt ();
957+ const auto y = state_->getValue (Parameters::WindowPositionY).toInt ();
958+ parentWidget ()->move (x, y);
959+ }
960+ }
954961 }
955962
956963 pulledSavedVisibility_ = true ;
964+
965+ pullCameraState ();
957966 }
958- pullCameraState ();
959967}
960968
961969void ViewSceneDialog::adjustToolbar ()
@@ -1237,11 +1245,13 @@ void ViewSceneDialog::resizingDone()
12371245
12381246void ViewSceneDialog::postMoveEventCallback (const QPoint& p)
12391247{
1240- if (pulling_)
1241- return ;
12421248 if (!savedPos_)
12431249 savedPos_ = QPoint{ state_->getValue (Parameters::WindowPositionX).toInt (),
12441250 state_->getValue (Parameters::WindowPositionY).toInt () };
1251+
1252+ if (pulling_)
1253+ return ;
1254+
12451255 state_->setValue (Parameters::WindowPositionX, p.x ());
12461256 state_->setValue (Parameters::WindowPositionY, p.y ());
12471257}
@@ -1290,7 +1300,7 @@ void ViewSceneDialog::inputMouseWheelHelper(int32_t delta)
12901300 scaleBarGeom_ = buildGeometryScaleBar ();
12911301 updateModifiedGeometries ();
12921302 }
1293- state_->setValue (Modules::Render::ViewScene ::CameraDistance, (double )spire->getCameraDistance ());
1303+ state_->setValue (Parameters ::CameraDistance, (double )spire->getCameraDistance ());
12941304}
12951305
12961306void ViewSceneDialog::setViewScenesToUpdate (const std::unordered_set<ViewSceneDialog*>& scenes)
0 commit comments