diff --git a/source/plugins/org.custusx.core.view/cxViewGroup.cpp b/source/plugins/org.custusx.core.view/cxViewGroup.cpp index 333a8cdcf0..99d1c5ca1d 100644 --- a/source/plugins/org.custusx.core.view/cxViewGroup.cpp +++ b/source/plugins/org.custusx.core.view/cxViewGroup.cpp @@ -121,14 +121,6 @@ ViewWrapperPtr ViewGroup::getViewWrapperFromViewUid(QString viewUid) return ViewWrapperPtr(); } -void ViewGroup::syncOrientationMode(SyncedValuePtr val) -{ - for (unsigned i = 0; i < mViewWrappers.size(); ++i) - { - mViewWrappers[i]->setOrientationMode(val); - } -} - void ViewGroup::mouseClickInViewGroupSlot() { std::vector images = mViewGroupData->getImages(DataViewProperties::createFull()); diff --git a/source/plugins/org.custusx.core.view/cxViewGroup.h b/source/plugins/org.custusx.core.view/cxViewGroup.h index 74cdcbb05c..231413c597 100644 --- a/source/plugins/org.custusx.core.view/cxViewGroup.h +++ b/source/plugins/org.custusx.core.view/cxViewGroup.h @@ -85,7 +85,6 @@ Q_OBJECT CameraStylePtr getCameraStyle() { return mCameraStyle; } bool contains3DView() const; - void syncOrientationMode(SyncedValuePtr val); void initializeActiveView(SyncedValuePtr val); private slots: diff --git a/source/plugins/org.custusx.core.view/cxViewManager.cpp b/source/plugins/org.custusx.core.view/cxViewManager.cpp index 3ba57003b9..15a31dc087 100644 --- a/source/plugins/org.custusx.core.view/cxViewManager.cpp +++ b/source/plugins/org.custusx.core.view/cxViewManager.cpp @@ -127,7 +127,6 @@ ViewManager::ViewManager(VisServicesPtr backend) : connect(mLayoutRepository.get(), &LayoutRepository::layoutChanged, this, &ViewManager::onLayoutRepositoryChanged); this->initializeGlobal2DZoom(); this->initializeActiveView(); - this->syncOrientationMode(SyncedValue::create(0)); // set start layout this->setActiveLayout("LAYOUT_3D_ACS_SINGLE", 0); @@ -310,14 +309,6 @@ int ViewManager::getActiveViewGroup() const return retval; } -void ViewManager::syncOrientationMode(SyncedValuePtr val) -{ - for (unsigned i = 0; i < mViewGroups.size(); ++i) - { - mViewGroups[i]->syncOrientationMode(val); - } -} - void ViewManager::addXml(QDomNode& parentNode) { XMLNodeAdder parent(parentNode); diff --git a/source/plugins/org.custusx.core.view/cxViewManager.h b/source/plugins/org.custusx.core.view/cxViewManager.h index 46d1b26e2d..ec4b3a4a24 100644 --- a/source/plugins/org.custusx.core.view/cxViewManager.h +++ b/source/plugins/org.custusx.core.view/cxViewManager.h @@ -192,9 +192,6 @@ protected slots: protected: ViewManager(VisServicesPtr backend); - - void syncOrientationMode(SyncedValuePtr val); -// void storeLayoutData(const LayoutData& data); std::vector getViewGroups() { return mViewGroups; } void activateView(ViewCollectionWidget* widget, LayoutViewData viewData); diff --git a/source/plugins/org.custusx.core.view/cxViewWrapper.h b/source/plugins/org.custusx.core.view/cxViewWrapper.h index f3639465bc..a0ddeffe2b 100644 --- a/source/plugins/org.custusx.core.view/cxViewWrapper.h +++ b/source/plugins/org.custusx.core.view/cxViewWrapper.h @@ -99,10 +99,6 @@ Q_OBJECT virtual ViewPtr getView() = 0; virtual void setSlicePlanesProxy(SlicePlanesProxyPtr proxy) = 0; virtual void setViewGroup(ViewGroupDataPtr group); - -// virtual void setZoom2D(SyncedValuePtr value) {} - virtual void setOrientationMode(SyncedValuePtr value) {} - virtual void updateView() = 0; signals: diff --git a/source/plugins/org.custusx.core.view/cxViewWrapper2D.cpp b/source/plugins/org.custusx.core.view/cxViewWrapper2D.cpp index efea5dc525..8bc4599feb 100644 --- a/source/plugins/org.custusx.core.view/cxViewWrapper2D.cpp +++ b/source/plugins/org.custusx.core.view/cxViewWrapper2D.cpp @@ -125,7 +125,6 @@ ViewWrapper2D::ViewWrapper2D(ViewPtr view, VisServicesPtr backend) : mZoom2D.reset(new Zoom2DHandler()); connect(mZoom2D.get(), SIGNAL(zoomChanged()), this, SLOT(viewportChanged())); - setOrientationMode(SyncedValue::create(0)); // must set after addreps() connect(mServices->tracking().get(), SIGNAL(activeToolChanged(const QString&)), this, SLOT(activeToolChangedSlot())); connect(mView.get(), SIGNAL(resized(QSize)), this, SLOT(viewportChanged())); @@ -160,27 +159,7 @@ void ViewWrapper2D::samplePoint(Vector3D click_vp) void ViewWrapper2D::appendToContextMenu(QMenu& contextMenu) { - QAction* obliqueAction = new QAction("Oblique", &contextMenu); - obliqueAction->setCheckable(true); - obliqueAction->setData(qstring_cast(otOBLIQUE)); - obliqueAction->setChecked(getOrientationType() == otOBLIQUE); - connect(obliqueAction, SIGNAL(triggered()), this, SLOT(orientationActionSlot())); - - QAction* ortogonalAction = new QAction("Ortogonal", &contextMenu); - ortogonalAction->setCheckable(true); - ortogonalAction->setData(qstring_cast(otORTHOGONAL)); - ortogonalAction->setChecked(getOrientationType() == otORTHOGONAL); - connect(ortogonalAction, SIGNAL(triggered()), this, SLOT(orientationActionSlot())); - - //TODO remove actiongroups? - mOrientationActionGroup->addAction(obliqueAction); - mOrientationActionGroup->addAction(ortogonalAction); - - contextMenu.addSeparator(); - contextMenu.addAction(obliqueAction); - contextMenu.addAction(ortogonalAction); - contextMenu.addSeparator(); - + contextMenu.addSeparator(); mZoom2D->addActionsToMenu(&contextMenu); } @@ -203,19 +182,6 @@ void ViewWrapper2D::optionChangedSlot() } } -/** Slot for the orientation action. - * Set the orientation mode. - */ -void ViewWrapper2D::orientationActionSlot() -{ - QAction* theAction = static_cast(sender());if(!theAction) - return; - - ORIENTATION_TYPE type = string2enum(theAction->data().toString()); - mOrientationMode->set(type); -} - - void ViewWrapper2D::addReps() { // annotation rep @@ -408,9 +374,6 @@ void ViewWrapper2D::initializePlane(PLANE_TYPE plane) // mSliceProxy->initializeFromPlane(plane, false, Vector3D(0, 0, 1), true, 1, 0); mOrientationAnnotationRep->setSliceProxy(mSliceProxy); - // do this to force sync global and local type - must think on how we want this to work - this->changeOrientationType(getOrientationType()); - bool isOblique = mSliceProxy->getComputer().getOrientationType() == otOBLIQUE; mToolRep2D->setUseCrosshair(!isOblique); // mToolRep2D->setUseToolLine(!isOblique); @@ -424,34 +387,6 @@ ORIENTATION_TYPE ViewWrapper2D::getOrientationType() const return mSliceProxy->getComputer().getOrientationType(); } -/** Slot called when the synced orientation has changed. - * Update the slice proxy orientation. - */ -void ViewWrapper2D::orientationModeChanged() -{ - ORIENTATION_TYPE type = static_cast(mOrientationMode->get().toInt()); - - if (type == this->getOrientationType()) - return; - if (!mSliceProxy) - return; - - SliceComputer computer = mSliceProxy->getComputer(); - computer.switchOrientationMode(type); - - PLANE_TYPE plane = computer.getPlaneType(); -// mOrientationAnnotationRep->setPlaneType(plane); - mPlaneTypeText->setText(0, qstring_cast(plane)); - mSliceProxy->setComputer(computer); - } - - /** Set the synced orientation mode. - */ -void ViewWrapper2D::changeOrientationType(ORIENTATION_TYPE type) -{ - mOrientationMode->set(type); -} - ViewPtr ViewWrapper2D::getView() { return mView; @@ -621,17 +556,6 @@ void ViewWrapper2D::activeToolChangedSlot() mSliceProxy->setTool(activeTool); } -void ViewWrapper2D::setOrientationMode(SyncedValuePtr value) -{ - if (mOrientationMode) - disconnect(mOrientationMode.get(), SIGNAL(changed()), this, SLOT(orientationModeChanged())); - mOrientationMode = value; - if (mOrientationMode) - connect(mOrientationMode.get(), SIGNAL(changed()), this, SLOT(orientationModeChanged())); - - orientationModeChanged(); -} - /**Part of the mouse interactor: * Move manual tool tip when mouse pressed * diff --git a/source/plugins/org.custusx.core.view/cxViewWrapper2D.h b/source/plugins/org.custusx.core.view/cxViewWrapper2D.h index 1be82f6d52..b5831f3e09 100644 --- a/source/plugins/org.custusx.core.view/cxViewWrapper2D.h +++ b/source/plugins/org.custusx.core.view/cxViewWrapper2D.h @@ -82,7 +82,6 @@ Q_OBJECT virtual ~ViewWrapper2D(); virtual void initializePlane(PLANE_TYPE plane); virtual ViewPtr getView(); - virtual void setOrientationMode(SyncedValuePtr value); virtual void setSlicePlanesProxy(SlicePlanesProxyPtr proxy); virtual void setViewGroup(ViewGroupDataPtr group); @@ -104,8 +103,6 @@ private slots: void mousePressSlot(int x, int y, Qt::MouseButtons buttons); void mouseMoveSlot(int x, int y, Qt::MouseButtons buttons); void mouseWheelSlot(int x, int y, int delta, int orientation, Qt::MouseButtons buttons); - void orientationActionSlot(); - void orientationModeChanged(); void settingsChangedSlot(QString key); void optionChangedSlot(); @@ -121,7 +118,6 @@ protected slots: void shiftAxisPos(Vector3D delta_vp); ORIENTATION_TYPE getOrientationType() const; - void changeOrientationType(ORIENTATION_TYPE type); virtual void imageAdded(ImagePtr image); //virtual void imageRemoved(const QString& uid); @@ -166,7 +162,6 @@ protected slots: // synchronized data Zoom2DHandlerPtr mZoom2D; - SyncedValuePtr mOrientationMode; Vector3D mLastClickPos_vp; QActionGroup* mOrientationActionGroup; diff --git a/source/resource/core/utilities/cxSliceComputer.cpp b/source/resource/core/utilities/cxSliceComputer.cpp index c075ee231b..43c8e18532 100644 --- a/source/resource/core/utilities/cxSliceComputer.cpp +++ b/source/resource/core/utilities/cxSliceComputer.cpp @@ -100,43 +100,6 @@ void SliceComputer::initializeFromPlane(PLANE_TYPE plane, bool useGravity, const } } -/**Switch an existing plane definition to its dual definition, i.e. - * Axial<->Radial - * Coronal<->Any - * Sagittal<->Dual - * Use initializeFromPlane() to set connected parameters. - */ -void SliceComputer::switchOrientationMode(ORIENTATION_TYPE type) -{ - if (type==mOrientType) - return; // no change - - PLANE_TYPE newType = mPlaneType; - - if (type==otOBLIQUE) // ACS->ADR - { - switch (mPlaneType) - { - case ptSAGITTAL : newType = ptSIDEPLANE; break; - case ptCORONAL : newType = ptANYPLANE; break; - case ptAXIAL : newType = ptRADIALPLANE; break; - default: break; - } - } - else if (type==otORTHOGONAL) - { - switch (mPlaneType) - { - case ptSIDEPLANE : newType = ptSAGITTAL; break; - case ptANYPLANE : newType = ptCORONAL; break; - case ptRADIALPLANE : newType = ptAXIAL; break; - default: break; - } - } - - initializeFromPlane(newType, mUseGravity, mGravityDirection, mUseViewOffset, mViewportHeight, mViewOffset, mClinicalApplication); -} - void SliceComputer::setClinicalApplication(CLINICAL_VIEW application) { mClinicalApplication = application; diff --git a/source/resource/core/utilities/cxSliceComputer.h b/source/resource/core/utilities/cxSliceComputer.h index f0ec2bc52f..f4d0be5bcf 100644 --- a/source/resource/core/utilities/cxSliceComputer.h +++ b/source/resource/core/utilities/cxSliceComputer.h @@ -89,7 +89,6 @@ class cxResource_EXPORT SliceComputer SlicePlane getPlane() const; void initializeFromPlane(PLANE_TYPE plane, bool useGravity, const Vector3D& gravityDir, bool useViewOffset, double viewportHeight, double toolViewOffset, CLINICAL_VIEW application, bool useConstrainedViewOffset = false); - void switchOrientationMode(ORIENTATION_TYPE type); ORIENTATION_TYPE getOrientationType() const; PLANE_TYPE getPlaneType() const; Transform3D getToolPosition() const;