diff --git a/Modules/Core/include/mitkAffineInteractor.h b/Modules/Core/include/mitkAffineInteractor.h index e77b0836e2..34e32b2ee2 100755 --- a/Modules/Core/include/mitkAffineInteractor.h +++ b/Modules/Core/include/mitkAffineInteractor.h @@ -1,84 +1,89 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKAFFINEINTERACTOR_H_HEADER_INCLUDED_C188C29F #define MITKAFFINEINTERACTOR_H_HEADER_INCLUDED_C188C29F #include #include "mitkInteractor.h" #include "mitkNumericTypes.h" namespace mitk { class DisplayPositionEvent; //##Documentation //## @brief Interactor for Affine transformations translate, rotate and scale //## //## An object of this class can translate, rotate and scale the data objects //## by modifying its geometry. //## @ingroup Interaction //create events for interactions #pragma GCC visibility push(default) itkEventMacro(AffineInteractionEvent, itk::AnyEvent); itkEventMacro(ScaleEvent, AffineInteractionEvent); itkEventMacro(RotateEvent, AffineInteractionEvent); itkEventMacro(TranslateEvent, AffineInteractionEvent); #pragma GCC visibility pop +/** +* \deprecatedSince{2015_05} AffineInteractor is deprecated. It will be removed in the next release. +* Refer to mitk::AffineDataInteractor3D for a substitude. +*/ + class MITKCORE_EXPORT AffineInteractor : public Interactor { public: mitkClassMacro(AffineInteractor,Interactor); // itkFactorylessNewMacro(Self) // itkCloneMacro(Self) mitkNewMacro2Param(Self, const char*, DataNode*); protected: // AffineInteractor(); //obsolete //##Documentation //## @brief Constructor //## //## @param dataNode is the node, this Interactor is connected to //## @param type is the type of StateMachine like declared in the XML-Configure-File AffineInteractor(const char * type, DataNode* dataNode); //##Documentation //## @brief Destructor ~AffineInteractor(){}; virtual bool ExecuteAction(Action* action, mitk::StateEvent const* stateEvent) override; //##Documentation //## @brief calculates how good the data this state machine handles is hit by the event. //## //## Returns a value between 0 and 1. //## (Used by GlobalInteraction to decide which DESELECTED state machine to send the event to.) //## //## \WARNING This is interactor currently does not work for interaction in 3D. Try using mitkAffineInteractor3D instead. virtual float CanHandleEvent(StateEvent const* stateEvent) const override; bool CheckSelected(const mitk::Point3D& worldPoint, int timestep); bool ConvertDisplayEventToWorldPosition(mitk::DisplayPositionEvent const* displayEvent, mitk::Point3D& worldPoint); mitk::Point3D m_LastMousePosition; }; } // namespace mitk #endif /* MITKAFFINEINTERACTOR_H_HEADER_INCLUDED_C188C29F */ diff --git a/Modules/Core/include/mitkDisplayGeometry.h b/Modules/Core/include/mitkDisplayGeometry.h index 6d17decdb0..9623a995b6 100644 --- a/Modules/Core/include/mitkDisplayGeometry.h +++ b/Modules/Core/include/mitkDisplayGeometry.h @@ -1,238 +1,244 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkDisplayGeometry_h #define mitkDisplayGeometry_h #include "mitkPlaneGeometry.h" namespace mitk { /** \brief Describes the geometry on the display/screen for 2D display. The main purpose of this class is to convert between display coordinates (in display-units) and world coordinates (in mm). DisplayGeometry depends on the size of the display area (widget width and height, m_SizeInDisplayUnits) and on a PlaneGeometry (m_WoldGeometry). It represents a recangular view on this world-geometry. E.g., you can tell the DisplayGeometry to fit the world-geometry in the display area by calling Fit(). Provides methods for zooming and panning. Zooming and panning can be restricted within reasonable bounds by setting the ConstrainZoomingAndPanning flag. In these cases you can re-define what bounds you accept as "reasonable" by calling \warning \em Units refers to the units of the underlying world-geometry. Take care, whether these are really the units you want to convert to. E.g., when you want to convert a point \a pt_display (which is 2D) given in display coordinates into a point in units of a BaseData-object @a datum (the requested point is 3D!), use \code displaygeometry->DisplayToWorld(pt_display, pt2d_mm); displaygeometry->Map(pt2d_mm, pt3d_mm); datum->GetGeometry()->WorldToIndex(pt3d_mm, pt3d_datum_units); \endcode Even, if you want to convert the 2D point \a pt_display into a 2D point in units on a certain 2D geometry \a certaingeometry, it is safer to use \code displaygeometry->DisplayToWorld(pt_display, pt_mm); certaingeometry->WorldToIndex(pt_mm, pt_certain_geometry_units); \endcode unless you can be sure that the underlying geometry of \a displaygeometry is really the \a certaingeometry. \ingroup Geometry */ + +/** +* \deprecatedSince{2015_05} DisplayGeometry is deprecated. It will become obsolete, as functions will be implemented in mitk::BaseRenderer and +* mitk::CameraController. +*/ + class MITKCORE_EXPORT DisplayGeometry : public PlaneGeometry { public: mitkClassMacro(DisplayGeometry, PlaneGeometry); /// Method for creation through the object factory. itkFactorylessNewMacro(Self) itkCloneMacro(Self) /// \brief duplicates the geometry, NOT useful for this sub-class virtual itk::LightObject::Pointer InternalClone() const override; /// \return this objects modified time. virtual unsigned long GetMTime() const override; //virtual const TimeBounds& GetTimeBounds() const; // size definition methods virtual void SetWorldGeometry(const PlaneGeometry* aWorldGeometry); itkGetConstObjectMacro(WorldGeometry, PlaneGeometry); /// \return if new origin was within accepted limits virtual bool SetOriginInMM(const Vector2D& origin_mm); virtual Vector2D GetOriginInMM() const; virtual Vector2D GetOriginInDisplayUnits() const; /** \brief Set the size of the display in display units. This method must be called every time the display is resized (normally, the GUI-toolkit informs about resizing). \param keepDisplayedRegion: if \a true (the default), the displayed contents is zoomed/shrinked so that the displayed region is (approximately) the same as before: The point at the center will be kept at the center and the length of the diagonal of the displayed region \em in \em units will also be kept. When the aspect ration changes, the displayed region includes the old displayed region, but cannot be exaclty the same. */ virtual void SetSizeInDisplayUnits(unsigned int width, unsigned int height, bool keepDisplayedRegion = true); virtual Vector2D GetSizeInDisplayUnits() const; virtual Vector2D GetSizeInMM() const; unsigned int GetDisplayWidth() const; unsigned int GetDisplayHeight() const; // zooming, panning, restriction of both virtual void SetConstrainZoomingAndPanning(bool constrain); virtual bool GetConstrainZommingAndPanning() const; /// what percentage of the world should be visible at maximum zoom out (default 1.0, i.e. 100% of width or height) itkGetMacro(MaxWorldViewPercentage, float); itkSetMacro(MaxWorldViewPercentage, float); /// what percentage of the world should be visible at maximum zoom in (default 0.1, i.e. 10% of width or height) itkGetMacro(MinWorldViewPercentage, float); itkSetMacro(MinWorldViewPercentage, float); virtual bool SetScaleFactor(ScalarType mmPerDisplayUnit); ScalarType GetScaleFactorMMPerDisplayUnit() const; /** * \brief Zooms with a factor (1.0=identity) to/from the specified center in display units * \return true if zoom request was within accepted limits */ virtual bool Zoom(ScalarType factor, const Point2D& centerInDisplayUnits); /** * \brief Zooms with a factor (1.0=identity) to/from the specified center, trying to preserve the center of zoom in world coordiantes * * Same zoom as mentioned above but tries (if it's within view contraints) to match the center in display units with the center in world coordinates. * * \return true if zoom request was within accepted limits */ virtual bool ZoomWithFixedWorldCoordinates(ScalarType factor, const Point2D& focusDisplayUnits, const Point2D& focusUnitsInMM); // \return true if move request was within accepted limits virtual bool MoveBy(const Vector2D& shiftInDisplayUnits); // \brief align display with world, make world completely visible virtual void Fit(); // conversion methods virtual void DisplayToWorld(const Point2D &pt_display, Point2D &pt_mm) const; virtual void WorldToDisplay(const Point2D &pt_mm, Point2D &pt_display) const; virtual void DisplayToWorld(const Vector2D &vec_display, Vector2D &vec_mm) const; virtual void WorldToDisplay(const Vector2D &vec_mm, Vector2D &vec_display) const; virtual void ULDisplayToMM(const Point2D &pt_ULdisplay, Point2D &pt_mm) const; virtual void MMToULDisplay(const Point2D &pt_mm, Point2D &pt_ULdisplay) const; virtual void ULDisplayToMM(const Vector2D &vec_ULdisplay, Vector2D &vec_mm) const; virtual void MMToULDisplay(const Vector2D &vec_mm, Vector2D &vec_ULdisplay) const; virtual void ULDisplayToDisplay(const Point2D &pt_ULdisplay, Point2D &pt_display) const; virtual void DisplayToULDisplay(const Point2D &pt_display, Point2D &pt_ULdisplay) const; virtual void ULDisplayToDisplay(const Vector2D &vec_ULdisplay, Vector2D &vec_display) const; virtual void DisplayToULDisplay(const Vector2D &vec_display, Vector2D &vec_ULdisplay) const; /** * \brief projects the given point onto current 2D world geometry plane */ virtual bool Project(const Point3D &pt3d_mm, Point3D &projectedPt3d_mm) const override; /** * \brief projects the given vector onto current 2D world geometry plane. * \warning DEPRECATED, please use Project(const Vector3D &vec3d_mm, Vector3D &projectedVec3d_mm) instead */ virtual bool Project(const Point3D & atPt3d_mm, const Vector3D &vec3d_mm, Vector3D &projectedVec3d_mm) const override; /** * \brief projects the given vector onto current 2D world geometry plane */ virtual bool Project(const Vector3D &vec3d_mm, Vector3D &projectedVec3d_mm) const override; virtual bool Map(const Point3D &pt3d_mm, Point2D &pt2d_mm) const override; virtual void Map(const Point2D &pt2d_mm, Point3D &pt3d_mm) const override; virtual bool Map(const Point3D & atPt3d_mm, const Vector3D &vec3d_mm, Vector2D &vec2d_mm) const override; virtual void Map(const Point2D & atPt2d_mm, const Vector2D &vec2d_mm, Vector3D &vec3d_mm) const override; virtual bool IsValid() const override; virtual bool IsAbove(const Point3D &pt3d_mm, bool /*considerBoundingBox=false*/) const override { return Superclass::IsAbove(pt3d_mm, true); }; protected: DisplayGeometry(); virtual ~DisplayGeometry(); /** \brief Called after zooming/panning to restrict these operations to sensible measures. \return true if a correction in either zooming or panning was made Enforces a couple of constraints on the relation of the current viewport and the current world geometry. The basic logic in this lengthy method is:
  1. Make display region big enough (in case of too large zoom factors)
  2. Make display region small enough (so that the image cannot be scaled into a single screen pixel
  3. Correct panning for each border (left, right, bottom, top)
The little more complicated implementation is illustrated in the code itself. */ virtual bool RefitVisibleRect(); virtual void PrintSelf(std::ostream& os, itk::Indent indent) const override; Vector2D m_OriginInMM; Vector2D m_OriginInDisplayUnits; ScalarType m_ScaleFactorMMPerDisplayUnit; Vector2D m_SizeInMM; Vector2D m_SizeInDisplayUnits; PlaneGeometry::ConstPointer m_WorldGeometry; bool m_ConstrainZoomingAndPanning; float m_MaxWorldViewPercentage; float m_MinWorldViewPercentage; //##Documentation //## @brief PreSetSpacing //## //## These virtual function allows a different beahiour in subclasses. //## Do implement them in every subclass of BaseGeometry. If not needed, use //## {Superclass::PreSetSpacing();}; virtual void PreSetSpacing(const mitk::Vector3D& aSpacing) override{ Superclass::PreSetSpacing(aSpacing); }; }; } // namespace #endif // include guard diff --git a/Modules/Core/include/mitkModeOperation.h b/Modules/Core/include/mitkModeOperation.h index a76cfe76ca..7afca7aa6d 100644 --- a/Modules/Core/include/mitkModeOperation.h +++ b/Modules/Core/include/mitkModeOperation.h @@ -1,51 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MODEOPERATION_H_HEADER_INCLUDED #define MODEOPERATION_H_HEADER_INCLUDED #include #include "mitkOperation.h" #include namespace mitk { // class Operation; //##Documentation //## @brief class that holds the information for a change of the modus of an interactor object //## //## @ingroup Undo + +/** +* \deprecatedSince{2015_05} ModeOperation is deprecated. It will be removed in the next release. +* It becomes obsolete. Refer to http://docs.mitk.org/nightly/DataInteractionPage.html for updated Interaction documentation. +*/ + class MITKCORE_EXPORT ModeOperation : public Operation { public: typedef Interactor::ModeType ModeType; mitkClassMacro(ModeOperation, Operation) //##Documentation //## Constructor ModeOperation(OperationType operationType, ModeType mode); virtual ~ModeOperation(); ModeType GetMode(); protected: ModeType m_Mode; }; }//namespace mitk #endif /* MODEOPERATION_H_HEADER_INCLUDED */ diff --git a/Modules/Core/include/mitkMoveBaseDataInteractor.h b/Modules/Core/include/mitkMoveBaseDataInteractor.h index 92da0d4574..8b11502973 100644 --- a/Modules/Core/include/mitkMoveBaseDataInteractor.h +++ b/Modules/Core/include/mitkMoveBaseDataInteractor.h @@ -1,82 +1,86 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKMoveBaseDataInteractor_H_HEADER_INCLUDED #define MITKMoveBaseDataInteractor_H_HEADER_INCLUDED #include namespace mitk { class DataNode; /** * \brief Interaction to move an object by the arrow keys. See tutorial step 10 for explanation. * * Left- and right-arrows move the x-direction. * Shift + up-and down-arrows move the y-direction. * Up- and down-arrows move the z-direction. * Every move is one unit in world coordinates (usually 1mm). * This class offers three properties: * - \b "MovingInteractor.SelectedColor": This color is used to mark that * the object is selected and the interactor can be used. * - \b "MovingInteractor.DeselectedColor": Marks that the interactor is * is added to the data node, but the node is not selected. * - \b "MovingInteractor.PriorColor": Temporary property used to * save the old color of the data node in order to restore it * uppon removal of the interactor. * * All properties are deleted when the interactor is destroyed. * * \warning After moving an object, the user has to perform a reinit manually, in order to change the geoemtrie. * * \warning The picking seems not to work on a single point. If you want to move pointsets, * they should atleast have 2 or more points. * * \ingroup Interaction */ + /** + * \deprecatedSince{2015_05} MoveBaseDataInteractor is deprecated. It will be removed in the next release. + * Refer to mitk::mitk::AffineDataInteractor3D as a substitude. + */ class MITKCORE_EXPORT MoveBaseDataInteractor : public Interactor { public: mitkClassMacro(MoveBaseDataInteractor, Interactor); mitkNewMacro2Param(Self, const char*, DataNode*); protected: /** * \brief Constructor */ MoveBaseDataInteractor(const char * type, DataNode* dataNode); /** * \brief Default Destructor **/ virtual ~MoveBaseDataInteractor(); /** * @brief Convert the given Actions to Operations and send to data and UndoController **/ virtual bool ExecuteAction( Action* action, mitk::StateEvent const* stateEvent ) override; }; } /** \example mitkMoveBaseDataInteractor.h * This is an example of how to implement a new Interactor. * See more details about this example in tutorial Step10. */ #endif /* MITKMoveBaseDataInteractor_H_HEADER_INCLUDED */ diff --git a/Modules/Core/include/mitkPointSetInteractor.h b/Modules/Core/include/mitkPointSetInteractor.h index 89c40669f4..4354556ebd 100644 --- a/Modules/Core/include/mitkPointSetInteractor.h +++ b/Modules/Core/include/mitkPointSetInteractor.h @@ -1,128 +1,133 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPOINTSETINTERACTOR_H_HEADER_INCLUDED_C11202FF #define MITKPOINTSETINTERACTOR_H_HEADER_INCLUDED_C11202FF #include #include "mitkNumericTypes.h" #include namespace mitk { class DataNode; /** * \brief Interaction with a set of points. * * Points can be added, removed and moved. * In case the interaction shall be done on a * loaded set of points, the associated data * object (mitkPointSet) needs to be loaded * prior to the instanciation of this object. * The number of points are checked and the internal * statemachine set to the apropriate state. * The management of 0 points is not supported. * In this case, the amount of managed points is set to 1. * \ingroup Interaction */ + + /** + * \deprecatedSince{2015_05} PointSetInteractor is deprecated. It will be removed in the next release. + * Refer to mitk::PointSetDataInteractor as a substitude. + */ class MITKCORE_EXPORT PointSetInteractor : public Interactor { public: mitkClassMacro(PointSetInteractor, Interactor); mitkNewMacro3Param(Self, const char*, DataNode*, int); mitkNewMacro2Param(Self, const char*, DataNode*); /** * @brief Clears all the elements from the given timeStep in the list with undo-functionality and * resets the statemachine */ void Clear( unsigned int timeStep = 0, ScalarType timeInMS = 0.0 ); itkGetMacro( Precision, unsigned int ); itkSetMacro( Precision, unsigned int ); /** * \brief calculates how good the data, this statemachine handles, is hit * by the event. * * overwritten, cause we don't look at the boundingbox, we look at each point */ virtual float CanHandleEvent(StateEvent const* stateEvent) const override; /** *@brief If data changed then initialize according to numbers of loaded points **/ virtual void DataChanged() override; protected: /** * \brief Constructor with Param n for limited Set of Points * * If no n is set, then the number of points is unlimited * n=0 is not supported. In this case, n is set to 1. */ PointSetInteractor(const char * type, DataNode* dataNode, int n = -1); /** * \brief Default Destructor **/ virtual ~PointSetInteractor(); /** * @brief Convert the given Actions to Operations and send to data and UndoController */ virtual bool ExecuteAction( Action* action, mitk::StateEvent const* stateEvent ) override; /** \brief Deselects the Points in the PointSet. * supports Undo if enabled */ void UnselectAll( unsigned int timeStep = 0, ScalarType timeInMS = 0.0 ); /** * \brief Selects the point. * supports Undo if enabled. * \param position Needed for declaring operations */ void SelectPoint( int position, unsigned int timeStep = 0, ScalarType timeInMS = 0.0 ); /** \brief to calculate a direction vector from last point and actual * point */ Point3D m_LastPoint; /** \brief summ-vector for Movement */ Vector3D m_SumVec; /** \brief to store the value of precision to pick a point */ unsigned int m_Precision; private: /** * \brief the number of possible points in this object * * if -1, then no limit set */ int m_N; /** * @brief Init the StatateMachine according to the current number of points in case of a loaded pointset. **/ void InitAccordingToNumberOfPoints(); }; } #endif /* MITKPOINTSETINTERACTOR_H_HEADER_INCLUDED_C11202FF */ diff --git a/Modules/Core/include/mitkPositionTracker.h b/Modules/Core/include/mitkPositionTracker.h index d781ec3965..ed4bd83f24 100755 --- a/Modules/Core/include/mitkPositionTracker.h +++ b/Modules/Core/include/mitkPositionTracker.h @@ -1,53 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPositionTracker_H #define MITKPositionTracker_H #include #include "mitkStateMachine.h" namespace mitk { class Operation; class OperationActor; //##Documentation //## @brief Interactor for Mouse Tracking //## //## Tracks a Point from an input device (usaly mouse pointer) //## @ingroup Interaction + + /** + * \deprecatedSince{2015_05} PositionTracker is deprecated. It will be removed in the next release. + * It will be integrated into the mitk::DisplayInteractor. + */ + + class MITKCORE_EXPORT PositionTracker : public StateMachine { public: mitkClassMacro(PositionTracker, StateMachine); mitkNewMacro2Param(Self, const char*, OperationActor*); protected: //##Documentation //## @brief Constructor with needed arguments //## @param type: string, that describes the StateMachine-Scheme to take from all SM (see XML-File) //## @param operationActor: the Data, operations (+ points) are send to PositionTracker(const char * type, OperationActor* operationActor); //##Documentation //## @brief executes the actions that are sent to this statemachine //## derived from StateMachine virtual bool ExecuteAction(Action* action, mitk::StateEvent const* stateEvent) override; }; } // namespace mitk #endif /* MITKPositionTracker_H */ diff --git a/Modules/Core/include/mitkSlicesRotator.h b/Modules/Core/include/mitkSlicesRotator.h index 0f51c6de2c..339690a917 100644 --- a/Modules/Core/include/mitkSlicesRotator.h +++ b/Modules/Core/include/mitkSlicesRotator.h @@ -1,165 +1,171 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SLICESROTATOR_H_HEADER_INCLUDED_C1C55A2F #define SLICESROTATOR_H_HEADER_INCLUDED_C1C55A2F #include #pragma GCC visibility push(default) #include #pragma GCC visibility pop #include namespace mitk { /** \brief Coordinates rotation of multiple visible rendering planes (represented as lines in other render windows). \ingroup NavigationControl This class takes care of several SliceNavigationControllers and handles slice selection / slice rotation. It is added as listener to GlobalInteraction by QmitkStdMultiWidget. The SlicesRotator class adds the possibility of slice rotation to the "normal" behaviour of SliceNavigationControllers (which is picking one plane from a stack of planes). This additional class SlicesRotator is needed, because one has to be aware of multiple "visible slices" (selected PlaneGeometries of some SliceNavigationControllers) in order to choose between rotation and slice selection. Such functionality could not be implemented by a single SliceNavigationController. Rotation is achieved by modifying (rotating) the generated TimeGeometry of the corresponding SliceNavigationControllers. \section mitkSlicesRotator_StandardCase The standard case: three orthogonal views (MPR) With SlicesRotator, the rule to choose between slice rotation and selection is simple: For a mouse down event, count the number of visible planes, which are "near" the cursor. If this number is 2 (one for the window, which currently holds the cursor, one for the intersection line of another visible slice), then initiate rotation, else select slices near the cursor. If the "LinkPlanes" flag is set, the rotation is applied to the planes of all registered SNCs, not only of the one associated with the directly selected plane. In contrast to the situation without the SlicesRotator, the SliceNavigationControllers are now NOT directly registered as listeners to GlobalInteraction. SlicesRotator is registered as a listener and decides whether something should be rotated or whether another slice should be selected. In the latter case, a PositionEvent is just forwarded to the SliceNavigationController. \section mitkSlicesRotator_GeneralizedCase The generalized case: any number of views Above section as well as the original implementation of this class assumes that we have exactly three 2D vies in our scene. This used to be the standard setup of the MITK associated application for a long time. With custom applications based on MITK it is easy to create different situations. One usual use case would be to have one extra render window display the contents of any of the other ones and behave exactly like it (could e.g. be used on a second screen). In this situation the above assumption "we rotate when there are exactly 2 slices close to the cursor" will not hold: since we always have two render windows displaying the exact same slice, the number of 2 is the minimum we get. Whenever the user clicks in one of those windows and the cursor is close to one of the orthogonal planes, we will get a count of 3 or more planes that are "close to the cursor". For the class to behave correctly, we actually need to distinguish three separate cases: 1. the cursor is not close to any orthogonal planes. This should result in slice selection. 2. the cursor is close to just one orthogonal plane OR multiple which are not distinguishable visually. This should result in rotation. 3. the cursor is close to multiple orthogonal planes which are rendered as distinguishable lines on the render window. This is the case when we hit the crosshair-center of the view. In this case, we need to also just select slices. \section mitkSlicesRotator_Solution Deciding between slice selection and rotation The "counting nearby lines in the renderwindow" can also work for the general case described above. Only one details needs to be accounted for: we must not count a line when it is identical to another line. I.e. we just count how many visible lines on the screen are very close to the cursor. When this number is 1, we rotate, otherwise we let the SliceNavigationControllers do their slice selection job. \sa SlicesSwiveller */ + +/** +* \deprecatedSince{2015_05} SlicesRotator is deprecated. Class will be removed and funtionality will move into mitk::DisplayInteractor. +*/ + + class MITKCORE_EXPORT SlicesRotator : public SlicesCoordinator { public: mitkClassMacro(SlicesRotator, SlicesCoordinator); static Pointer New(); /** \brief New Macro with one parameter for creating this object with static New(..) method. Needs to be the "slices-rotator" pattern of StateMachine.xml to work as expected. **/ mitkNewMacro1Param(Self, const char*); /** \brief Callback for modifications in observed SliceNavigationControllers -- forwards to UpdateRotatableSNCs(). This method is called when an observed SliceNavigationController changes its world geometry. The connection is established by calling the other SliceNavigationController's method ConnectGeometrySendEvent (or similar). */ virtual void SetGeometry(const itk::EventObject& EventObject); /** \brief NOT USED by anything open-source. Deprecated. Highly obfuscated code. Use SliceNavigationController::ReorientSlices() instead! #Deprecated */ virtual void RotateToPoint( SliceNavigationController *rotationPlaneSNC, SliceNavigationController *rotatedPlaneSNC, const Point3D &point, bool linked = false ); protected: SlicesRotator(const char* machine); virtual ~SlicesRotator(); /** \brief Called from SlicesCoordinator after a new controller is added (to internal list m_SliceNavigationControllers). */ virtual void OnSliceControllerAdded(SliceNavigationController* snc) override; /* \brief Called from SlicesCoordinator after a new controller is being removed (to internal list m_SliceNavigationControllers). */ virtual void OnSliceControllerRemoved(SliceNavigationController* snc) override; /** \brief Check all observed SliceNavigationControllers: remember those that are rotatable in m_RotatableSNCs. */ virtual void UpdateRotatableSNCs(); // following methods called from superclass ExecuteAction bool DoSelectSlice(Action*, const StateEvent*); bool DoDecideBetweenRotationAndSliceSelection(Action*, const StateEvent*); bool DoStartRotation(Action*, const StateEvent*); bool DoEndRotation(Action*, const StateEvent*); bool DoRotationStep(Action*, const StateEvent*); SNCVector m_RotatableSNCs; /// all SNCs that currently have CreatedWorldGeometries, that can be rotated. SNCVector m_SNCsToBeRotated; /// all SNCs that will be rotated (exceptions are the ones parallel to the one being clicked) Point3D m_LastCursorPosition; /// used for calculation of the rotation angle Point3D m_CenterOfRotation; /// used for calculation of the rotation angle }; } // namespace #endif diff --git a/Modules/Core/include/mitkSlicesSwiveller.h b/Modules/Core/include/mitkSlicesSwiveller.h index 99e34cc282..13acf13c9c 100644 --- a/Modules/Core/include/mitkSlicesSwiveller.h +++ b/Modules/Core/include/mitkSlicesSwiveller.h @@ -1,119 +1,124 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SLICESSWIVELLER_H_HEADER_INCLUDED #define SLICESSWIVELLER_H_HEADER_INCLUDED #include #include #pragma GCC visibility push(default) #include #pragma GCC visibility pop namespace mitk { /** * \brief Enables arbitrary rotation of visible slices around a swivel point * (for sliced geometries). * \ingroup NavigationControl * * This class takes care of several SliceNavigationControllers and handles * slice selection / slice rotation. It is added as listener to * GlobalInteraction by QmitkStdMultiWidget. * * The SlicesSwiveller class adds the possibility of slice rotation to the * "normal" behaviour of SliceNavigationControllers. This additional class * is needed, because one has to be aware of several "visible slices" * (selected PlaneGeometries of some SliceNavigationControllers) in order to * choose between rotation and slice selection. * * Rotation is achieved by modifying (rotating) the generated * TimeGeometry of the corresponding SliceNavigationController. * * With SlicesSwiveller, slice rotation works as follows: the user clicks onto * a 2D view (2D plane) and drags the mouse; the relative direction and angle * of the dragged mouse movement directly effects the rotation axis and * angle. If "LinkPlanes" is set to true, the rotation is applied to the * planes of all registered SNCs, not only of the one associated with the * plane clicked on. * * In contrast to the situation without the SlicesRotator, the * SliceNavigationControllers are now not directly registered as listeners to * GlobalInteraction. SlicesRotator is registered as a listener and decides * whether something should be rotated or whether another slice should be * selected. In the latter case, a PositionEvent is just forwarded to the * SliceNavigationController. * * \sa SlicesRotator */ + +/** +* \deprecatedSince{2015_05} SlicesSwiveller is deprecated. Class will be removed and funtionality will move into mitk::DisplayInteractor. +*/ + class MITKCORE_EXPORT SlicesSwiveller : public SlicesCoordinator { public: mitkClassMacro(SlicesSwiveller, SlicesCoordinator); static Pointer New(); /** * @brief New Macro with one parameter for creating this object with static New(..) method **/ mitkNewMacro1Param(Self, const char*); virtual void SetGeometry(const itk::EventObject& EventObject); protected: SlicesSwiveller(const char* machine); // clear list of controllers virtual ~SlicesSwiveller(); // check if the slices of this SliceNavigationController can be rotated (???) Possible virtual void OnSliceControllerAdded(SliceNavigationController* snc) override; virtual void OnSliceControllerRemoved(SliceNavigationController* snc) override; virtual void UpdateRelevantSNCs(); virtual bool ExecuteAction(Action * action, StateEvent const* stateEvent) override; /** All SNCs that currently have CreatedWorldGeometries, that can be rotated */ SNCVector m_RelevantSNCs; /** SNCs that will be rotated (clicked plane + all relevant others, if linked) */ SNCVector m_SNCsToBeRotated; Point3D m_LastCursorPosition; Point3D m_CenterOfRotation; Point2D m_ReferenceCursor; Vector3D m_RotationPlaneNormal; Vector3D m_RotationPlaneXVector; Vector3D m_RotationPlaneYVector; Vector3D m_PreviousRotationAxis; ScalarType m_PreviousRotationAngle; }; } // namespace #endif diff --git a/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorAddOn.h b/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorAddOn.h index 0603a6bca8..c1045424c4 100644 --- a/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorAddOn.h +++ b/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorAddOn.h @@ -1,78 +1,82 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKSPACENAVIGATORADDON_H_HEADER_INCLUDED #define MITKSPACENAVIGATORADDON_H_HEADER_INCLUDED #include #include #include #include namespace mitk { /** * Documentation in the interface. * * @brief EventMapper addon for a 3DConnexion Space Navigator * @ingroup Interaction */ + +/** + * \deprecatedSince{2015_05} SpaceNavigatorAddOn is deprecated. It will be removed in the next release. + */ class mitkSpaceNavigator_EXPORT SpaceNavigatorAddOn : public EventMapperAddOn { public: // Singleton static SpaceNavigatorAddOn* GetInstance(); /** * @noimplement not needed */ void DeviceChange (long device, long keys, long programmableKeys); /** * If a button is pressed down an event is fired. * * @param keyCode the id to the key, that is pressed */ void KeyDown (int keyCode); /** * @noimplement not needed */ void KeyUp (int keyCode); /** * Reacts on any movement of the mouse and fires events accordingly. * * @param translation * the translation of the mouse as an 3D vector * @param rotation * the rotation of the mouse as an 3D vector * @param angle * the angle from the mouse as an scalar unit */ void SensorInput(mitk::Vector3D translation, mitk::Vector3D rotation, mitk::ScalarType angle); protected: private: }; // end class SpaceNavigatorAddOn } // end namespace mitk #endif // MITKSPACENAVIGATORADDON_H_HEADER_INCLUDED diff --git a/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorEvent.h b/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorEvent.h index d32f68e025..defa98932d 100644 --- a/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorEvent.h +++ b/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorEvent.h @@ -1,94 +1,99 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SPACENAVIGATOREVENT_H_ #define SPACENAVIGATOREVENT_H_ #include #include #include #include namespace mitk { /** * Documentation * @brief Event on 3D Mouse input * * Seven coordinates exposed by the 3D Mouse: * 3-dimensional translation vector * 3-dimensional rotation achsis (length allways 1.0) * scalar rotation angle * * @ingroup Interaction */ + +/** + * \deprecatedSince{2015_05} SpaceNavigatorEvent is deprecated. It will be removed in the next release. + */ + class mitkSpaceNavigator_EXPORT SpaceNavigatorEvent : public Event { public: /** * @brief Constructor with all necessary arguments (for further information about the parameter:
* mitk::SpaceNavigatorAddOn. * * @param buttonState information from the Event * */ SpaceNavigatorEvent(int buttonState, const Vector3D& translation, const Vector3D& rotation, const ScalarType& angle); //Getter and Setter const Vector3D& GetTranslation() const { return m_Translation; } void SetTranslation(const Vector3D& translation) { m_Translation = translation; } const Vector3D& GetRotation() const { return m_Rotation; } void SetRotation(const Vector3D& rotation) { m_Rotation = rotation; } const ScalarType& GetAngle() const { return m_Angle; } void SetAngle(const ScalarType& angle) { m_Angle = angle; } protected: Vector3D m_Translation; Vector3D m_Rotation; ScalarType m_Angle; }; // end class SpaceNavigatorEvent } // end namespace mitk #endif /* SPACENAVIGATOREVENT_H_ */ diff --git a/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorVtkCameraController.h b/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorVtkCameraController.h index 9dc7ec461e..804ccd56a2 100644 --- a/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorVtkCameraController.h +++ b/Modules/InputDevices/SpaceNavigator/mitkSpaceNavigatorVtkCameraController.h @@ -1,65 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_SPACENAVIGATORVTKCAMERACONTROLLER_H_ #define MITK_SPACENAVIGATORVTKCAMERACONTROLLER_H_ #include #include class vtkRenderWindow; namespace mitk { /** * The Space Navigator camera controller listens to events from a Space Navigator.
* After receiving such events, it moves the camera of the 3D window accordingly. * * @brief vtk-based camera controller * @ingroup NavigationControl */ +/** + * \deprecatedSince{2015_05} SpaceNavigatorVtkCameraController is deprecated. It will be removed in the next release. + */ + class mitkSpaceNavigator_EXPORT SpaceNavigatorVtkCameraController : public CameraController { public: //SmartPointer Macros mitkClassMacro(SpaceNavigatorVtkCameraController, CameraController); itkFactorylessNewMacro(Self) itkCloneMacro(Self) virtual bool OnSpaceNavigatorEvent(mitk::Action* a, const mitk::StateEvent* e); virtual bool OnSpaceNavigatorKeyDown(mitk::Action* a, const mitk::StateEvent* e); protected: /** * Default Constructor */ SpaceNavigatorVtkCameraController(); /** * Default Destructor */ virtual ~SpaceNavigatorVtkCameraController(); bool m_ClippingRangeIsSet; }; // end class SpaceNavigatorVtkCameraController } // namespace mitk #endif /* MITK_SPACENAVIGATORVTKCAMERACONTROLLER_H_ */ diff --git a/Modules/InputDevices/WiiMote/mitkKalmanFilter.h b/Modules/InputDevices/WiiMote/mitkKalmanFilter.h index 1d422bb09e..47e8653982 100644 --- a/Modules/InputDevices/WiiMote/mitkKalmanFilter.h +++ b/Modules/InputDevices/WiiMote/mitkKalmanFilter.h @@ -1,64 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_KALMAN_FILTER_H #define MITK_KALMAN_FILTER_H // mitk #include // itk #include #include "itkObjectFactory.h" #include namespace mitk { /** * * DOES NOT YET WORK! * +*/ +/** +* \deprecatedSince{2015_05} KalmanFilter is deprecated. It will be removed in the next release. */ class KalmanFilter : public itk::Object { public: // only needed for smartpointer mitkClassMacroItkParent(KalmanFilter,itk::Object); itkFactorylessNewMacro(Self) itkCloneMacro(Self) KalmanFilter(); virtual ~KalmanFilter(); float ProcessValue( float input ); void SetMeasurementNoise( float measurementNoise ); void SetProcessNoise( float processNoise ); void ResetFilter(); protected: private: CvKalman* m_cvKalman; CvMat* m_StateVector; // x_k bool m_IsInitialized; }; // end class } // end namespace #endif // MITK_KALMAN_FILTER_H diff --git a/Modules/InputDevices/WiiMote/mitkWiiMoteAddOn.h b/Modules/InputDevices/WiiMote/mitkWiiMoteAddOn.h index f2b3f4dff0..52c0d7a78a 100644 --- a/Modules/InputDevices/WiiMote/mitkWiiMoteAddOn.h +++ b/Modules/InputDevices/WiiMote/mitkWiiMoteAddOn.h @@ -1,104 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_WIIMOTEADDON_H_ #define MITK_WIIMOTEADDON_H_ // export macro #include // mitk #include "mitkNumericTypes.h" // used for Point2D #include namespace mitk { class WiiMoteThread; /** * Documentation in the interface. Some code snippets used here are from the demo
* application from gl.tter and therefore are under the same license as wiimote.cpp . * * @brief EventMapper addon for a Wiimote * @ingroup Interaction */ + + /** + * \deprecatedSince{2015_05} WiiMoteAddOn is deprecated. It will be removed in the next release. + */ class mitkWiiMote_EXPORT WiiMoteAddOn : public EventMapperAddOn { public: WiiMoteAddOn(); ~WiiMoteAddOn(); // Singleton static WiiMoteAddOn* GetInstance(); /** * Starts all available Wiimotes. */ void ActivateWiiMotes(); /** * Disconnects all Wiimotes and stops the thread. */ void DeactivateWiiMotes(); /** * Creates suitable events, when the Wiimote sends IR data
* for movement and forwards it for further processing. */ void WiiMoteInput(const itk::EventObject& e); /** * Creates suitable events, when the Wiimote sends button events
* to trigger an action and forwards it for further processing. */ void WiiMoteButtonPressed(const itk::EventObject& e); /** * Creates suitable events, when the Wiimote sends button events
* to trigger an action and forwards it for further processing. */ void WiiMoteButtonReleased(const itk::EventObject& e); /** * Creates suitable events, when the Wiimote sends IR data
* to configure the sensitivity and forwards it for further processing. */ void WiiMoteCalibrationInput(const itk::EventObject& e); /** * @see mitk::WiiMoteThread::SetWiiMoteSurfaceIModus(bool activated) */ void SetWiiMoteSurfaceIModus(bool activated); /** * Creates suitable events, regardless what type of data the
* Wiimote sends for a surface interaction. Then forwards the
* transformed data for further processing. * */ void WiiMoteSurfaceInteractionInput(const itk::EventObject& e); protected: private: WiiMoteThread* m_WiiMoteThread; }; // end class WiiMoteAddOn } // end namespace mitk #endif // MITK_WIIMOTEADDON_H_ diff --git a/Modules/InputDevices/WiiMote/mitkWiiMoteAllDataEvent.h b/Modules/InputDevices/WiiMote/mitkWiiMoteAllDataEvent.h index 5aede29d2b..dca3c619f2 100644 --- a/Modules/InputDevices/WiiMote/mitkWiiMoteAllDataEvent.h +++ b/Modules/InputDevices/WiiMote/mitkWiiMoteAllDataEvent.h @@ -1,162 +1,165 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_WIIMOTE_ALLDATAEVENT_H #define MITK_WIIMOTE_ALLDATAEVENT_H // mitk #include // export macro #include namespace mitk { /** * This event type is used to store all data available from the
* Wiimote driver. This includes IR, button, orientation, and acceleration input. */ +/** +* \deprecatedSince{2015_05} WiiMoteAllDataEvent is deprecated. It will be removed in the next release. +*/ class mitkWiiMote_EXPORT WiiMoteAllDataEvent: public Event, itk::EventObject { public: // unnecessary number of parameter because // the method MakeObject() from itk::EventObject // defines the data, that is able to travel from // thread to thread; i.e. everything, which is not // in the constructor will not be usable in the // other thread WiiMoteAllDataEvent ( int eventType , float pitchSpeed , float rollSpeed , float yawSpeed , float orientationX , float orientationY , float orientationZ , float roll , float pitch , float xAcceleration , float yAcceleration , float zAcceleration , int surfaceInteractionMode); ~WiiMoteAllDataEvent(); void SetIRDotRawX(float xCoordinate); float GetIRDotRawX() const; void SetIRDotRawY(float yCoordinate); float GetIRDotRawY() const; void SetButton(int button); int GetButton() const; void SetPitchSpeed(float pitchSpeed); float GetPitchSpeed() const; void SetRollSpeed(float rollSpeed); float GetRollSpeed() const; void SetYawSpeed(float yawSpeed); float GetYawSpeed() const; void SetOrientationX(float orientationX); float GetOrientationX() const; void SetOrientationY(float orientationY); float GetOrientationY() const; void SetOrientationZ(float orientationZ); float GetOrientationZ() const; void SetRoll(float roll); float GetRoll() const; void SetPitch(float pitch); float GetPitch() const; void SetXAcceleration(float xAcceleration); float GetXAcceleration() const; void SetYAcceleration(float yAcceleration); float GetYAcceleration() const; void SetZAcceleration(float zAcceleration); float GetZAcceleration() const; void SetSurfaceInteractionMode(int mode); int GetSurfaceInteractionMode() const; //itk::EventObject implementation typedef WiiMoteAllDataEvent Self; typedef itk::EventObject Superclass; const char * GetEventName() const; bool CheckEvent(const ::itk::EventObject* e) const; ::itk::EventObject* MakeObject() const; protected: private: // IR data // there are in fact 4 registerable dots // but at the moment data from one is sufficient float m_IRDotRawX; float m_IRDotRawY; // button data int m_Button; // the name of the button // acceleration data // angle speed from motion plus // the unit is degree per second float m_PitchSpeed; float m_RollSpeed; float m_YawSpeed; // linear acceleration from wiimote // the unit is g // range: -3..0..+3 float m_XAcceleration; float m_YAcceleration; float m_ZAcceleration; // orientation data // the unit is g // range: -1..0..1 float m_OrientationX; float m_OrientationY; float m_OrientationZ; // range: -180..0..180 degree float m_Pitch; // range: -90..0..90 degree float m_Roll; // time between the last orientation estimate update // if update age is too high the acceleration // values are likely to be out of date unsigned m_UpdateAge; // surface interaction mode int m_SurfaceInteractionMode; }; // end class } // end namespace #endif // MITK_WIIMOTE_ALLDATAEVENT_H diff --git a/Modules/InputDevices/WiiMote/mitkWiiMoteButtonEvent.h b/Modules/InputDevices/WiiMote/mitkWiiMoteButtonEvent.h index 6cb2c16fd5..d8b0cc44d5 100644 --- a/Modules/InputDevices/WiiMote/mitkWiiMoteButtonEvent.h +++ b/Modules/InputDevices/WiiMote/mitkWiiMoteButtonEvent.h @@ -1,58 +1,62 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_WIIMOTEBUTTONEVENT_H #define MITK_WIIMOTEBUTTONEVENT_H #include "mitkEvent.h" #include "mitkNumericTypes.h" #include "mitkInteractionConst.h" #include namespace mitk { + +/** +* \deprecatedSince{2015_05} WiiMoteButtonEvent is deprecated. It will be removed in the next release. +*/ /** * This event type is used for button events triggered by the
* the Wiimote driver. */ class mitkWiiMote_EXPORT WiiMoteButtonEvent : public Event, itk::EventObject { public: typedef WiiMoteButtonEvent Self; typedef itk::EventObject Superclass; /** * Initializes a Wiimote Event, that stores additional information.
* * @see mitk::Event::Event(mitk::BaseRenderer* sender, int type, int button, int buttonState, int key); */ WiiMoteButtonEvent(int type, int button, int buttonState, int key); ~WiiMoteButtonEvent(); //itk::EventObject implementation const char * GetEventName() const; bool CheckEvent(const ::itk::EventObject* e) const; ::itk::EventObject* MakeObject() const; protected: private: }; // end class } // end namespace mitk #endif // MITK_WIIMOTEBUTTONEVENT_H diff --git a/Modules/InputDevices/WiiMote/mitkWiiMoteCalibrationEvent.h b/Modules/InputDevices/WiiMote/mitkWiiMoteCalibrationEvent.h index 4cf2b824cd..4ca887d8a0 100644 --- a/Modules/InputDevices/WiiMote/mitkWiiMoteCalibrationEvent.h +++ b/Modules/InputDevices/WiiMote/mitkWiiMoteCalibrationEvent.h @@ -1,66 +1,70 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_WIIMOTECALIBRATIONEVENT_H #define MITK_WIIMOTECALIBRATIONEVENT_H #include #include "mitkEvent.h" #include "mitkNumericTypes.h" #include "mitkInteractionConst.h" namespace mitk { +/** +* \deprecatedSince{2015_05} WiiMoteCalibrationEvent is deprecated. Needs to be updated to the new interaction-framework. +* Refer to \see DataInteractionPage for general information about the concept of the new implementation. +*/ class mitkWiiMote_EXPORT WiiMoteCalibrationEvent : public Event, itk::EventObject { public: typedef WiiMoteCalibrationEvent Self; typedef itk::EventObject Superclass; /** * Initializes a Wiimote Event, that stores additional information.
* Such as a the raw x and y coordinates of the IR input.
* * @param rawX * x coordinate of the IR sensor input * @param rawY * y coordinate of the IR sensor input */ WiiMoteCalibrationEvent(double rawX, double rawY); ~WiiMoteCalibrationEvent(); double GetXCoordinate() const; double GetYCoordinate() const; //itk::EventObject implementation const char * GetEventName() const; bool CheckEvent(const ::itk::EventObject* e) const; ::itk::EventObject* MakeObject() const; protected: private: double m_RawX; double m_RawY; }; } #endif // MITK_WIIMOTECALIBRATIONEVENT_H diff --git a/Modules/InputDevices/WiiMote/mitkWiiMoteIREvent.h b/Modules/InputDevices/WiiMote/mitkWiiMoteIREvent.h index b375a8a6db..ca77e1cd4d 100644 --- a/Modules/InputDevices/WiiMote/mitkWiiMoteIREvent.h +++ b/Modules/InputDevices/WiiMote/mitkWiiMoteIREvent.h @@ -1,75 +1,80 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_WIIMOTEIREVENT_H #define MITK_WIIMOTEIREVENT_H #include "mitkEvent.h" #include "mitkNumericTypes.h" #include "mitkInteractionConst.h" #include namespace mitk { /** * This event type is used for IR events triggered by the
* the Wiimote driver. */ + +/** + * \deprecatedSince{2015_05} WiiMoteIREvent is deprecated. It will be removed in the next release. + */ + class mitkWiiMote_EXPORT WiiMoteIREvent : public Event, itk::EventObject { public: typedef WiiMoteIREvent Self; typedef itk::EventObject Superclass; /** * Initializes a Wiimote Event, that stores additional information.
* Such as a vector and the time of the recording
* * @param inputData * the movement of the IR sensor computed in a vector * @param recordTime * the time at which the data was recorded */ WiiMoteIREvent( mitk::Vector2D inputData , double recordTime , int sliceNavigationValue); ~WiiMoteIREvent(); /** * Returns the current movement vector with the coordinates
* in the following order: x, y, z */ mitk::Vector2D GetMovementVector() const; double GetRecordTime() const; int GetSliceNavigationValue() const; //itk::EventObject implementation const char * GetEventName() const; bool CheckEvent(const ::itk::EventObject* e) const; ::itk::EventObject* MakeObject() const; private: mitk::Vector2D m_MovementVector; double m_RecordTime; int m_SliceNavigationValue; }; // end class } // end namespace mitk #endif // MITK_WIIMOTEIREVENT_H diff --git a/Modules/InputDevices/WiiMote/mitkWiiMoteMultiIREvent.h b/Modules/InputDevices/WiiMote/mitkWiiMoteMultiIREvent.h index 76210072a4..435990a977 100644 --- a/Modules/InputDevices/WiiMote/mitkWiiMoteMultiIREvent.h +++ b/Modules/InputDevices/WiiMote/mitkWiiMoteMultiIREvent.h @@ -1,53 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_WIIMOTEMULTIIREVENT_H #define MITK_WIIMOTEMULITIREVENT_H #include #include "mitkEvent.h" #include "mitkNumericTypes.h" #include "mitkInteractionConst.h" namespace mitk { +/** + * \deprecatedSince{2015_05} WiiMoteMultiIREvent is deprecated. It will be removed in the next release. + */ + class mitkInputDevices_EXPORT WiiMoteMultiIREvent : public Event, itk::EventObject { public: typedef WiiMoteMultiIREvent Self; typedef itk::EventObject Superclass; WiiMoteMultiIREvent(mitk::Point3D Coordinate3D); ~WiiMoteMultiIREvent(); mitk::Point3D Get3DCoordinate() const; //itk::EventObject implementation const char * GetEventName() const; bool CheckEvent(const ::itk::EventObject* e) const; ::itk::EventObject* MakeObject() const; protected: private: mitk::Point3D m_3DCoordinate; }; // end class } // end namspace #endif // MITK_WIIMOTEMULITIREVENT_H diff --git a/Modules/InputDevices/WiiMote/mitkWiiMoteThread.h b/Modules/InputDevices/WiiMote/mitkWiiMoteThread.h index 38ab192630..211f38d804 100644 --- a/Modules/InputDevices/WiiMote/mitkWiiMoteThread.h +++ b/Modules/InputDevices/WiiMote/mitkWiiMoteThread.h @@ -1,218 +1,222 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_WIIMOTEHTREAD_H #define MITK_WIIMOTEHTREAD_H #include "wiimote.h" // mitk #include "mitkCommon.h" #include "mitkCallbackFromGUIThread.h" #include "mitkNumericTypes.h" #include "mitkKalmanFilter.h" // itk #include "itkObject.h" #include "itkMultiThreader.h" #include "itkFastMutexLock.h" #include "itksys/SystemTools.hxx" // used for GetTime() and Delay(); +/** + * \deprecatedSince{2015_05} WiiMoteThread is deprecated. It will be removed in the next release. + */ + namespace mitk { // instead of include, enables this class to know the addon class WiiMoteAddOn; class WiiMoteThread : public itk::Object { public: // typedefs are used in context with CallbackFromGUIThread typedef itk::ReceptorMemberCommand ReceptorCommand; // eventually probs with Linux -> typename typedef ReceptorCommand::Pointer ReceptorCommandPointer; WiiMoteThread(); ~WiiMoteThread(); /** * Allows to set report types, detects extensions and responds to connect/disconnect
* events of extension, such as MotionPlus. * * NOTE: don't access the public state from the 'remote' object here, as it will * be out-of-date (it's only updated via RefreshState() calls, and these * are reserved for the main application so it can be sure the values * stay consistent between calls). Instead query 'new_state' only. * * @param remote * the old state of the connected Wii remote * @param changed * the state change of the Wii remote * @param newState * the new state, after the change is applied (i.e. new extension connected) * */ static void OnStateChange(wiimote &remote, state_change_flags changed, const wiimote_state &newState); /** * Starts the thread for the Wiimote. */ void Run(); /** * Helper function, because the itk::MultiThreader can only
* start a new thread with a static member function. */ static ITK_THREAD_RETURN_TYPE StartWiiMoteThread(void* data); /** * Connects the Wiimote and allows access to its functionality. */ void StartWiiMote(); /** * Stops the running thread. */ void StopWiiMote(); /** * Reconnects the Wiimote in case the connection is lost. */ void ReconnectWiiMote(); /** * Detects all available Wiimotes. * * TODO: more detailed regarding the mode and led lighting */ bool DetectWiiMotes(); /** * Disconnects all connected Wiimotes. */ void DisconnectWiiMotes(); /** * Reads incoming data from the IR camera. After processing the data
* (e.g. computations, assigning commands...) fires Wiimote events accordingly. * */ void WiiMoteIRInput(); /** * Reads incoming data from buttons. After processing the data
* (e.g. computations, assigning commands...) fires Wiimote events
* that indicate a button was pressed. * * @param buttonType * the type of button, that was used to trigger this event */ void WiiMoteButtonPressed(int buttonType); /** * Reads incoming data from buttons. After processing the data
* (e.g. computations, assigning commands...) fires Wiimote events
* that indicate a button release. * * @param buttonType * the type of button, that was used to trigger this event */ void WiiMoteButtonReleased(int buttonType); /** * Reads incoming data from the IR camera. Afterwards the raw x and y coordinates
* are stored in an event and fired as an event. * */ void WiiMoteCalibrationInput(); /** * Constantly refreshes the state of a single wiimote. Also changes between
* the calibration mode and the IR input mode through button push. * * TODO: more detailed explanation of calibration * */ void SingleWiiMoteUpdate(); /** * Constantly refreshes the state of multiple wiimotes. */ void MultiWiiMoteUpdate(); /** * Processes the different IR inputs from multiple wiimotes. */ void MultiWiiMoteIRInput(); /** * Sets the modus for the first connected Wiimote depending
* on the given parameter. * * @param activated * true, the Surface Interaction modus will be activated * false, the Surface Interaction modus will be deactivated */ void SetWiiMoteSurfaceIModus(bool activated); // TODO void SurfaceInteraction(); protected: private: // threading int m_ThreadID; itk::MultiThreader::Pointer m_MultiThreader; // mutex to control the flow of the method StartWiiMote() itk::FastMutexLock::Pointer m_WiiMoteThreadFinished; bool m_StopWiiMote; // access to the wiimote and parameter for callbackfromguithread ReceptorCommandPointer m_Command; // required for computation of movement Point2D m_LastReadData; double m_LastRecordTime; bool m_ReadDataOnce; // modes bool m_InCalibrationMode; bool m_SurfaceInteraction; bool m_ButtonBPressed; // Default: 1 = relative to object // 2 = relative to camera view int m_SurfaceInteractionMode; //store all connected Wiimotes wiimote m_WiiMotes[4]; int m_NumberDetectedWiiMotes; // used for measuring movement int m_TimeStep; // Kalman filter mitk::KalmanFilter::Pointer m_Kalman; }; } #endif // MITK_WIIMOTEHTREAD_H diff --git a/Modules/InputDevices/WiiMote/mitkWiiMoteVtkCameraController.h b/Modules/InputDevices/WiiMote/mitkWiiMoteVtkCameraController.h index 6ed0af8e72..bb7e8e1b25 100644 --- a/Modules/InputDevices/WiiMote/mitkWiiMoteVtkCameraController.h +++ b/Modules/InputDevices/WiiMote/mitkWiiMoteVtkCameraController.h @@ -1,77 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_WIIMOTEVTKCAMERACONTROLLER_H #define MITK_WIIMOTEVTKCAMERACONTROLLER_H // export #include // mitk #include "mitkCameraController.h" #include "mitkAction.h" #include "mitkEvent.h" #include "mitkBaseRenderer.h" #include "mitkWiiMoteIREvent.h" #include "mitkWiiMoteCalibrationEvent.h" namespace mitk { + +/** + * \deprecatedSince{2015_05} WiiMoteVtkCameraController is deprecated. It will be removed in the next release. + */ class mitkWiiMote_EXPORT WiiMoteVtkCameraController : public CameraController { public: //SmartPointer Macros mitkClassMacro(WiiMoteVtkCameraController, CameraController); itkFactorylessNewMacro(Self) itkCloneMacro(Self) protected: WiiMoteVtkCameraController(); ~WiiMoteVtkCameraController(); private: // head tracking bool OnWiiMoteInput(mitk::Action* a, const mitk::StateEvent* e); bool ResetView(mitk::Action* a, const mitk::StateEvent* e); bool m_ClippingRangeIsSet; double m_CurrentElevationAngle; double m_CurrentAzimuthAngle; // calibration bool m_Calibrated; double m_SensitivityXMAX; double m_SensitivityXMIN; double m_SensitivityYMAX; double m_SensitivityYMIN; double m_SensitivityX; double m_SensitivityY; bool InitCalibration(mitk::Action* a, const mitk::StateEvent* e); bool Calibration(mitk::Action* a, const mitk::StateEvent* e); bool FinishCalibration(mitk::Action* a, const mitk::StateEvent* e); // slice scrolling mitk::BaseRenderer::Pointer m_AxialBR; double m_InitialScrollValue; int m_UpdateFrequency; }; // end class } // end namespace mitk #endif // MITK_WIIMOTEVTKCAMERACONTROLLER_H diff --git a/Modules/QtWidgets/include/QmitkStdMultiWidget.h b/Modules/QtWidgets/include/QmitkStdMultiWidget.h index a3db1298b4..ba985aabb3 100644 --- a/Modules/QtWidgets/include/QmitkStdMultiWidget.h +++ b/Modules/QtWidgets/include/QmitkStdMultiWidget.h @@ -1,429 +1,433 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkStdMultiWidget_h #define QmitkStdMultiWidget_h #include "MitkQtWidgetsExports.h" #include #include #include #include #include #include #include #include #include #include #include #include #include class QHBoxLayout; class QVBoxLayout; class QGridLayout; class QSpacerItem; class QmitkLevelWindowWidget; class QmitkRenderWindow; class vtkCornerAnnotation; class vtkMitkRectangleProp; namespace mitk { class RenderingManager; } /// \ingroup QmitkModule class MITKQTWIDGETS_EXPORT QmitkStdMultiWidget : public QWidget { Q_OBJECT public: QmitkStdMultiWidget(QWidget* parent = 0, Qt::WindowFlags f = 0, mitk::RenderingManager* renderingManager = 0, mitk::BaseRenderer::RenderingMode::Type renderingMode = mitk::BaseRenderer::RenderingMode::Standard, const QString& name = "stdmulti"); virtual ~QmitkStdMultiWidget(); mitk::SliceNavigationController* GetTimeNavigationController(); void RequestUpdate(); void ForceImmediateUpdate(); mitk::MouseModeSwitcher* GetMouseModeSwitcher(); QmitkRenderWindow* GetRenderWindow1() const; QmitkRenderWindow* GetRenderWindow2() const; QmitkRenderWindow* GetRenderWindow3() const; QmitkRenderWindow* GetRenderWindow4() const; + /** + * \deprecatedSince{2015_05} GetLastLeftClickPosition is deprecated. Function will be removed and funtionality will move into mitk::DisplayInteractor. + */ + const mitk::Point3D & GetLastLeftClickPosition() const; const mitk::Point3D GetCrossPosition() const; void EnablePositionTracking(); void DisablePositionTracking(); int GetLayout() const; mitk::SlicesRotator * GetSlicesRotator() const; mitk::SlicesSwiveller * GetSlicesSwiveller() const; bool GetGradientBackgroundFlag() const; /*! \brief Access node of widget plane 1 \return DataNode holding widget plane 1 */ mitk::DataNode::Pointer GetWidgetPlane1(); /*! \brief Access node of widget plane 2 \return DataNode holding widget plane 2 */ mitk::DataNode::Pointer GetWidgetPlane2(); /*! \brief Access node of widget plane 3 \return DataNode holding widget plane 3 */ mitk::DataNode::Pointer GetWidgetPlane3(); /*! \brief Convenience method to access node of widget planes \param id number of widget plane to be returned \return DataNode holding widget plane 3 */ mitk::DataNode::Pointer GetWidgetPlane(int id); bool IsColoredRectanglesEnabled() const; bool IsDepartmentLogoEnabled() const; bool IsCrosshairNavigationEnabled() const; void InitializeWidget(); /// called when the StdMultiWidget is closed to remove the 3 widget planes and the helper node from the DataStorage void RemovePlanesFromDataStorage(); void AddPlanesToDataStorage(); void SetDataStorage( mitk::DataStorage* ds ); /** \brief Listener to the CrosshairPositionEvent Ensures the CrosshairPositionEvent is handled only once and at the end of the Qt-Event loop */ void HandleCrosshairPositionEvent(); /// activate Menu Widget. true: activated, false: deactivated void ActivateMenuWidget( bool state ); bool IsMenuWidgetEnabled() const; void SetCornerAnnotationVisibility(bool visibility); protected: void UpdateAllWidgets(); void HideAllWidgetToolbars(); mitk::DataNode::Pointer GetTopLayerNode(mitk::DataStorage::SetOfObjects::ConstPointer nodes); public slots: /// Receives the signal from HandleCrosshairPositionEvent, executes the StatusBar update void HandleCrosshairPositionEventDelayed(); void changeLayoutTo2DImagesUp(); void changeLayoutTo2DImagesLeft(); void changeLayoutToDefault(); void changeLayoutToBig3D(); void changeLayoutToWidget1(); void changeLayoutToWidget2(); void changeLayoutToWidget3(); void changeLayoutToRowWidget3And4(); void changeLayoutToColumnWidget3And4(); void changeLayoutToRowWidgetSmall3andBig4(); void changeLayoutToSmallUpperWidget2Big3and4(); void changeLayoutTo2x2Dand3DWidget(); void changeLayoutToLeft2Dand3DRight2D(); void changeLayoutTo2DUpAnd3DDown(); void Fit(); void InitPositionTracking(); void AddDisplayPlaneSubTree(); void EnableStandardLevelWindow(); void DisableStandardLevelWindow(); bool InitializeStandardViews( const mitk::Geometry3D * geometry ); void wheelEvent( QWheelEvent * e ) override; void mousePressEvent(QMouseEvent * e) override; void moveEvent( QMoveEvent* e ) override; void leaveEvent ( QEvent * e ) override; void EnsureDisplayContainsPoint( mitk::DisplayGeometry* displayGeometry, const mitk::Point3D& p); void MoveCrossToPosition(const mitk::Point3D& newPosition); void EnableNavigationControllerEventListening(); void DisableNavigationControllerEventListening(); void EnableGradientBackground(); void DisableGradientBackground(); void EnableDepartmentLogo(); void DisableDepartmentLogo(); void EnableColoredRectangles(); void DisableColoredRectangles(); void SetWidgetPlaneVisibility(const char* widgetName, bool visible, mitk::BaseRenderer *renderer=NULL); void SetWidgetPlanesVisibility(bool visible, mitk::BaseRenderer *renderer=NULL); void SetWidgetPlanesLocked(bool locked); void SetWidgetPlanesRotationLocked(bool locked); void SetWidgetPlanesRotationLinked( bool link ); void SetWidgetPlaneMode( int mode ); void SetGradientBackgroundColors( const mitk::Color & upper, const mitk::Color & lower ); void SetDepartmentLogoPath( const char * path ); void SetWidgetPlaneModeToSlicing( bool activate ); void SetWidgetPlaneModeToRotation( bool activate ); void SetWidgetPlaneModeToSwivel( bool activate ); void OnLayoutDesignChanged( int layoutDesignIndex ); void ResetCrosshair(); void MouseModeSelected( mitk::MouseModeSwitcher::MouseMode mouseMode ); signals: void LeftMouseClicked(mitk::Point3D pointValue); void WheelMoved(QWheelEvent*); void WidgetPlanesRotationLinked(bool); void WidgetPlanesRotationEnabled(bool); void ViewsInitialized(); void WidgetPlaneModeSlicing(bool); void WidgetPlaneModeRotation(bool); void WidgetPlaneModeSwivel(bool); void WidgetPlaneModeChange(int); void WidgetNotifyNewCrossHairMode(int); void Moved(); public: /** Define RenderWindow (public)*/ QmitkRenderWindow* mitkWidget1; QmitkRenderWindow* mitkWidget2; QmitkRenderWindow* mitkWidget3; QmitkRenderWindow* mitkWidget4; QmitkLevelWindowWidget* levelWindowWidget; /********************************/ enum { PLANE_MODE_SLICING = 0, PLANE_MODE_ROTATION, PLANE_MODE_SWIVEL }; enum { LAYOUT_DEFAULT = 0, LAYOUT_2D_IMAGES_UP, LAYOUT_2D_IMAGES_LEFT, LAYOUT_BIG_3D, LAYOUT_WIDGET1, LAYOUT_WIDGET2, LAYOUT_WIDGET3, LAYOUT_2X_2D_AND_3D_WIDGET, LAYOUT_ROW_WIDGET_3_AND_4, LAYOUT_COLUMN_WIDGET_3_AND_4, LAYOUT_ROW_WIDGET_SMALL3_AND_BIG4 , LAYOUT_SMALL_UPPER_WIDGET2_BIG3_AND4,LAYOUT_2D_AND_3D_LEFT_2D_RIGHT_WIDGET, LAYOUT_2D_UP_AND_3D_DOWN}; enum { AXIAL, SAGITTAL, CORONAL, THREE_D }; /** * @brief SetCornerAnnotation Create a corner annotation for a widget. * @param text The text of the annotation. * @param color The color. * @param widgetNumber The widget (0-3). */ void SetDecorationProperties(std::string text, mitk::Color color, int widgetNumber); /** * @brief GetRenderWindow convinience method to get a widget. * @param number of the widget (0-3) * @return The renderwindow widget. */ QmitkRenderWindow *GetRenderWindow(unsigned int number); /** * @brief SetGradientBackgroundColorForRenderWindow background for a widget. * * If two different input colors are, a gradient background is generated. * * @param upper Upper color of the gradient background. * @param lower Lower color of the gradient background. * @param widgetNumber The widget (0-3). */ void SetGradientBackgroundColorForRenderWindow(const mitk::Color &upper, const mitk::Color &lower, unsigned int widgetNumber); /** * @brief GetDecorationColorForWidget Get the color for annotation, crosshair and rectangle. * @param widgetNumber Number of the renderwindow (0-3). * @return Color in mitk format. */ mitk::Color GetDecorationColor(unsigned int widgetNumber); /** * @brief SetDecorationColor Set the color of the decoration of the 4 widgets. * * This is used to color the frame of the renderwindow and the corner annatation. * For the first 3 widgets, this color is a property of the helper object nodes * which contain the respective plane geometry. For widget 4, this is a member, * since there is no data node for this widget. */ void SetDecorationColor(unsigned int widgetNumber, mitk::Color color); /** * @brief GetCornerAnnotationText Getter for corner annotation text. * @param widgetNumber the widget number (0-3). * @return The text in the corner annotation. */ std::string GetCornerAnnotationText(unsigned int widgetNumber); /** * @brief GetGradientColors Getter for gradientbackground colors. * @param widgetNumber the widget number (0-3). * @return A pair of colors. First: upper, second: lower. */ std::pair GetGradientColors(unsigned int widgetNumber); protected: QHBoxLayout* QmitkStdMultiWidgetLayout; int m_Layout; int m_PlaneMode; mitk::RenderingManager* m_RenderingManager; mitk::LogoOverlay::Pointer m_LogoRendering; bool m_GradientBackgroundFlag; mitk::MouseModeSwitcher::Pointer m_MouseModeSwitcher; mitk::CoordinateSupplier::Pointer m_LastLeftClickPositionSupplier; mitk::PositionTracker::Pointer m_PositionTracker; mitk::SliceNavigationController* m_TimeNavigationController; mitk::SlicesRotator::Pointer m_SlicesRotator; mitk::SlicesSwiveller::Pointer m_SlicesSwiveller; mitk::DataNode::Pointer m_PositionTrackerNode; mitk::DataStorage::Pointer m_DataStorage; /** * @brief m_PlaneNode1 the 3 helper objects which contain the plane geometry. */ mitk::DataNode::Pointer m_PlaneNode1; mitk::DataNode::Pointer m_PlaneNode2; mitk::DataNode::Pointer m_PlaneNode3; /** * @brief m_ParentNodeForGeometryPlanes This helper object is added to the datastorage * and contains the 3 planes for displaying the image geometry (crosshair and 3D planes). */ mitk::DataNode::Pointer m_ParentNodeForGeometryPlanes; /** * @brief m_DecorationColorWidget4 color for annotation and rectangle of widget 4. * * For other widgets1-3, the color is a property of the respective data node. * There is no node for widget 4, hence, we need an extra member. */ mitk::Color m_DecorationColorWidget4; /** * @brief m_GradientBackgroundColors Contains the colors of the gradient background. * */ std::pair m_GradientBackgroundColors[4]; QSplitter *m_MainSplit; QSplitter *m_LayoutSplit; QSplitter *m_SubSplit1; QSplitter *m_SubSplit2; QWidget *mitkWidget1Container; QWidget *mitkWidget2Container; QWidget *mitkWidget3Container; QWidget *mitkWidget4Container; vtkSmartPointer m_CornerAnnotations[4]; vtkSmartPointer m_RectangleProps[4]; bool m_PendingCrosshairPositionEvent; bool m_CrosshairNavigationEnabled; /** * @brief CreateCornerAnnotation helper method to create a corner annotation. * @param text of the annotation. * @param color of the annotation. * @return the complete CornerAnnotation. */ vtkSmartPointer CreateCornerAnnotation(std::string text, mitk::Color color); /** * @brief FillGradientBackgroundWithBlack Internal helper method to initialize the * gradient background colors with black. */ void FillGradientBackgroundWithBlack(); }; #endif /*QmitkStdMultiWidget_h*/ diff --git a/Modules/Segmentation/DataManagement/mitkExtrudedContour.h b/Modules/Segmentation/DataManagement/mitkExtrudedContour.h index f9f8713ede..97107b56a8 100644 --- a/Modules/Segmentation/DataManagement/mitkExtrudedContour.h +++ b/Modules/Segmentation/DataManagement/mitkExtrudedContour.h @@ -1,128 +1,134 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED #define MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED #include "mitkBoundingObject.h" #include #include #include #include #include class vtkLinearExtrusionFilter; class vtkPlanes; class vtkClipPolyData; class vtkLinearSubdivisionFilter; class vtkTriangleFilter; class vtkDecimatePro; class vtkPolygon; namespace mitk { //##Documentation //## @brief Data class containing a bounding-object created by //## extruding a Contour along a vector //## //## The m_Contour is extruded in the direction m_Vector until //## reaching m_ClippingGeometry. //## @ingroup Data + +/** +* \deprecatedSince{2015_05} ExtrudedContour is deprecated. It will be removed in the next release. +* Becomes obsolete. Refer to http://docs.mitk.org/nightly/InteractionMigration.html . +*/ + class MITKSEGMENTATION_EXPORT ExtrudedContour : public BoundingObject { public: mitkClassMacro(ExtrudedContour, BoundingObject); itkFactorylessNewMacro(Self) itkCloneMacro(Self) virtual mitk::ScalarType GetVolume() override; virtual bool IsInside(const Point3D& p) const override; virtual void UpdateOutputInformation() override; //##Documentation //## @brief Contour to extrude itkGetConstObjectMacro(Contour, mitk::Contour); itkSetObjectMacro(Contour, mitk::Contour); //##Documentation //## @brief Vector to specify the direction of the extrusion mitkGetVectorMacro(Vector, mitk::Vector3D); mitkSetVectorMacro(Vector, mitk::Vector3D); itkGetConstMacro(AutomaticVectorGeneration, bool); itkSetMacro(AutomaticVectorGeneration, bool); itkBooleanMacro(AutomaticVectorGeneration); //##Documentation //## @brief Optional vector to specify the orientation of the bounding-box mitkGetVectorMacro(RightVector, mitk::Vector3D); mitkSetVectorMacro(RightVector, mitk::Vector3D); //##Documentation //## @brief Optional geometry for clipping the extruded contour itkGetConstObjectMacro(ClippingGeometry, mitk::BaseGeometry); itkSetObjectMacro(ClippingGeometry, mitk::BaseGeometry); virtual unsigned long GetMTime() const override; protected: ExtrudedContour(); virtual ~ExtrudedContour(); void BuildSurface(); void BuildGeometry(); mitk::Contour::Pointer m_Contour; mitk::Vector3D m_Vector; mitk::Vector3D m_RightVector; mitk::BaseGeometry::Pointer m_ClippingGeometry; bool m_AutomaticVectorGeneration; vtkPolygon* m_Polygon; #if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION==4) && (VTK_MINOR_VERSION>=4) )) double m_ProjectedContourBounds[6]; #else float m_ProjectedContourBounds[6]; #endif mitk::PlaneGeometry::Pointer m_ProjectionPlane; //##Documentation //## @brief For fast projection on plane float m_Right[3]; float m_Down[3]; #if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION==4) && (VTK_MINOR_VERSION>=4) )) double m_Normal[3]; #else float m_Normal[3]; #endif float m_Origin[3]; vtkLinearExtrusionFilter* m_ExtrusionFilter; vtkTriangleFilter *m_TriangleFilter; vtkDecimatePro* m_Decimate; vtkLinearSubdivisionFilter* m_SubdivisionFilter; vtkPlanes* m_ClippingBox; vtkClipPolyData* m_ClipPolyDataFilter; itk::TimeStamp m_LastCalculateExtrusionTime; }; } #endif /* MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED */ diff --git a/Modules/Segmentation/Interactions/mitkContourInteractor.h b/Modules/Segmentation/Interactions/mitkContourInteractor.h index 6f989d7024..5486a2e17f 100644 --- a/Modules/Segmentation/Interactions/mitkContourInteractor.h +++ b/Modules/Segmentation/Interactions/mitkContourInteractor.h @@ -1,65 +1,71 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __ContourInteractor_H #define __ContourInteractor_H #include "mitkCommon.h" #include #include #include namespace mitk { //##Documentation //## @brief Interactor for the creation of an mitk::Contour //## @ingroup Interaction + +/** +* \deprecatedSince{2015_05} ContourInteractor is deprecated. It will be removed in the next release. +* It will be integrated into an updated the mitk::ContourModelInteractor. +*/ + class MITKSEGMENTATION_EXPORT ContourInteractor : public mitk::Interactor { public: mitkClassMacro(ContourInteractor, Interactor); mitkNewMacro2Param(Self, const char*, DataNode*); protected: ContourInteractor(const char * type, DataNode* dataNode); virtual ~ContourInteractor(); virtual bool ExecuteAction(Action* action, mitk::StateEvent const* stateEvent) override; /** * entry method for any interaction. Method is called if user * presses the left mouse button down. */ virtual void Press (mitk::Point3D& op); /** * this method is finally called after user release the left mouse button */ virtual void Release (mitk::Point3D& op); /** * method is called when the user moves the mouse with left mouse button down */ virtual void Move (mitk::Point3D& op); protected: bool m_Positive; bool m_Started; }; } #endif //__ContourInteractor_H diff --git a/Modules/Segmentation/Interactions/mitkExtrudedContourInteractor.h b/Modules/Segmentation/Interactions/mitkExtrudedContourInteractor.h index d47c277a8e..892f1f41bf 100644 --- a/Modules/Segmentation/Interactions/mitkExtrudedContourInteractor.h +++ b/Modules/Segmentation/Interactions/mitkExtrudedContourInteractor.h @@ -1,72 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __ExtrudedContourInteractor_H #define __ExtrudedContourInteractor_H #include "mitkCommon.h" #include #include #include #include #include namespace mitk { //##Documentation //## @brief Interactor for the creation of an mitk::Contour //## @ingroup Interaction + +/** +* \deprecatedSince{2015_05} ExtrudedContourInteractor is deprecated. It will be removed in the next release. +* Becomes obsolete. Refer to http://docs.mitk.org/nightly/InteractionMigration.html . +*/ + class MITKSEGMENTATION_EXPORT ExtrudedContourInteractor : public mitk::Interactor { public: mitkClassMacro(ExtrudedContourInteractor, Interactor); mitkNewMacro2Param(Self, const char*, DataNode*); itkGetObjectMacro(Contour, mitk::Contour); itkGetObjectMacro(ContourNode, mitk::DataNode); protected: ExtrudedContourInteractor(const char * type, DataNode* dataNode); virtual ~ExtrudedContourInteractor(); virtual bool ExecuteAction(Action* action, mitk::StateEvent const* stateEvent) override; /** * entry method for any interaction. Method is called if user * presses the left mouse button down. */ virtual void Press (mitk::Point3D& op); /** * this method is finally called after user release the left mouse button */ virtual void Release (mitk::Point3D& op); /** * method is called when the user moves the mouse with left mouse button down */ virtual void Move (mitk::Point3D& op); protected: bool m_Positive; bool m_Started; mitk::Contour::Pointer m_Contour; mitk::DataNode::Pointer m_ContourNode; }; } #endif //__ExtrudedContourInteractor_H diff --git a/Modules/Segmentation/Interactions/mitkRegionGrow3DTool.h b/Modules/Segmentation/Interactions/mitkRegionGrow3DTool.h index 484b61bb46..44eb791fac 100644 --- a/Modules/Segmentation/Interactions/mitkRegionGrow3DTool.h +++ b/Modules/Segmentation/Interactions/mitkRegionGrow3DTool.h @@ -1,87 +1,91 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKREGIONGROW3DTOOL_H #define MITKREGIONGROW3DTOOL_H #include "mitkTool.h" #include "mitkPointSet.h" #include #include "mitkStateEvent.h" #include "itkImage.h" namespace mitk{ class StateMachineAction; class InteractionEvent; + /** + * \deprecatedSince{2015_05} RegionGrow3DTool is deprecated. Class will be removed, code is obsolete. + */ + class MITKSEGMENTATION_EXPORT RegionGrow3DTool : public Tool { public: mitkClassMacro(RegionGrow3DTool, Tool); itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitk::Message1 UpperThresholdValueChanged; mitk::Message1 LowerThresholdValueChanged; mitk::Message1 SliderValueChanged; mitk::Message1 SeedButtonToggled; virtual const char* GetName() const override; virtual const char** GetXPM() const override; virtual void Activated() override; virtual void Deactivated() override; void RunSegmentation(); void ConfirmSegmentation(std::string name, mitk::Color color); void CancelSegmentation(); void InitializeLevelWindow(); void ChangeLevelWindow(int); void SetSeedPoint(bool); void SetCurrentRGDirectionIsUpwards(bool); protected: RegionGrow3DTool(); virtual ~RegionGrow3DTool(); void SetupPreviewNodeFor(mitk::DataNode* nodeToProceed); void UpdatePreview(); template < typename TPixel, unsigned int VImageDimension > void StartRegionGrowing( itk::Image< TPixel, VImageDimension >* itkImage, mitk::BaseGeometry* imageGeometry, mitk::PointSet::PointType seedPoint ); bool OnMouseReleased( StateMachineAction*, InteractionEvent* ); int m_SeedpointValue; mitk::ScalarType m_RoiMax; mitk::ScalarType m_RoiMin; int m_LowerThreshold; int m_UpperThreshold; int m_DetectedLeakagePoint; bool m_CurrentRGDirectionIsUpwards; mitk::DataNode::Pointer m_PointSetNode; mitk::DataNode::Pointer m_FeedbackNode; mitk::DataNode::Pointer m_NodeToProceed; mitk::DataNode::Pointer m_OriginalImageNode; };//class }//namespace #endif diff --git a/Modules/SegmentationUI/Qmitk/QmitkRegionGrow3DToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkRegionGrow3DToolGUI.h index 0662ca6e16..70521c8309 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkRegionGrow3DToolGUI.h +++ b/Modules/SegmentationUI/Qmitk/QmitkRegionGrow3DToolGUI.h @@ -1,123 +1,127 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKREGIONGROW3DTOOLGUI_H #define QMITKREGIONGROW3DTOOLGUI_H #include "QmitkToolGUI.h" #include "mitkRegionGrow3DTool.h" #include "QmitkPointListWidget.h" #include #include #include #include +/** +* \deprecatedSince{2015_05} QmitkRegionGrow3DToolGUI is deprecated. Class will be removed, code is obsolete. +*/ + class QmitkRegionGrow3DToolGUI : public QmitkToolGUI { Q_OBJECT public: mitkClassMacro(QmitkRegionGrow3DToolGUI, QmitkToolGUI); itkFactorylessNewMacro(Self) itkCloneMacro(Self) protected slots: void OnNewToolAssociated(mitk::Tool*); void OnSeedButtonToggled(bool); void DecreaseSlider(); void IncreaseSlider(); void SliderValueChanged(int); void OnConfirmButtonClicked(); void OnGrowingDirectionChanged(bool); protected: virtual ~QmitkRegionGrow3DToolGUI(); QmitkRegionGrow3DToolGUI(); void OnLowerThresholdValueChanged(int); void OnUpperThresholdValueChanged(int); mitk::RegionGrow3DTool::Pointer m_RegionGrow3DTool; QPushButton* m_SetSeedButton; QPushButton* m_DecreaseTHButton; QPushButton* m_IncreaseTHButton; QPushButton* m_ConfirmButton; QRadioButton* m_brightRadio; QRadioButton* m_darkRadio; QSlider* m_ThSlider; QLabel* m_ThValue; };//class #endif #ifndef QMITKREGIONGROW3DTOOLGUI_H #define QMITKREGIONGROW3DTOOLGUI_H #include "QmitkToolGUI.h" #include "mitkRegionGrow3DTool.h" #include "QmitkPointListWidget.h" #include #include #include #include class QmitkRegionGrow3DToolGUI : public QmitkToolGUI { Q_OBJECT public: mitkClassMacro(QmitkRegionGrow3DToolGUI, QmitkToolGUI); itkFactorylessNewMacro(Self) itkCloneMacro(Self) protected slots: void OnNewToolAssociated(mitk::Tool*); void OnSeedButtonToggled(bool); void DecreaseSlider(); void IncreaseSlider(); void SliderValueChanged(int); void OnConfirmButtonClicked(); void OnGrowingDirectionChanged(bool); protected: virtual ~QmitkRegionGrow3DToolGUI(); QmitkRegionGrow3DToolGUI(); void OnLowerThresholdValueChanged(int); void OnUpperThresholdValueChanged(int); mitk::RegionGrow3DTool::Pointer m_RegionGrow3DTool; QPushButton* m_SetSeedButton; QPushButton* m_DecreaseTHButton; QPushButton* m_IncreaseTHButton; QPushButton* m_ConfirmButton; QRadioButton* m_brightRadio; QRadioButton* m_darkRadio; QSlider* m_ThSlider; QLabel* m_ThValue; };//class #endif