diff --git a/Modules/ClippingTools/mitkClippingPlaneRotationTool.cpp b/Modules/ClippingTools/mitkClippingPlaneRotationTool.cpp index ff5361fcf3..f6b21bbf5f 100644 --- a/Modules/ClippingTools/mitkClippingPlaneRotationTool.cpp +++ b/Modules/ClippingTools/mitkClippingPlaneRotationTool.cpp @@ -1,84 +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. ===================================================================*/ #include "mitkClippingPlaneRotationTool.h" #include "mitkClippingPlaneRotationTool.xpm" #include "mitkBaseRenderer.h" -#include "mitkGlobalInteraction.h" +#include "usModule.h" +#include "usModuleContext.h" +#include "usGetModuleContext.h" +#include "usModuleRegistry.h" #include "mitkRenderingManager.h" #include "mitkToolManager.h" namespace mitk { MITK_TOOL_MACRO(ClippingTools_EXPORT, ClippingPlaneRotationTool, "Clipping Tool Rotation"); } mitk::ClippingPlaneRotationTool::ClippingPlaneRotationTool() : Tool( "global" ) { + m_AffineDataInteractor = mitk::AffineDataInteractor3D::New(); } mitk::ClippingPlaneRotationTool::~ClippingPlaneRotationTool() { } const char** mitk::ClippingPlaneRotationTool::GetXPM() const { return mitkClippingPlaneRotationTool_xpm; } const char* mitk::ClippingPlaneRotationTool::GetName() const { return "Rotation"; } const char* mitk::ClippingPlaneRotationTool::GetGroup() const { return "ClippingTool"; } void mitk::ClippingPlaneRotationTool::Activated() { Superclass::Activated(); //check if the Clipping plane is changed. if(m_ClippingPlaneNode != m_ToolManager->GetWorkingData(0)) { - mitk::GlobalInteraction::GetInstance()->RemoveInteractor(m_AffineInteractor); - this->ClippingPlaneChanged(); + m_ClippingPlaneNode = m_ToolManager->GetWorkingData(0); + m_ClippingPlaneNode->SetDataInteractor(NULL); } - m_AffineInteractor->SetInteractionModeToRotation(); - mitk::GlobalInteraction::GetInstance()->AddInteractor(m_AffineInteractor); + m_AffineDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkExt")); + m_AffineDataInteractor->SetEventConfig("AffineRotationConfig.xml", us::ModuleRegistry::GetModule("MitkExt")); + m_AffineDataInteractor->SetDataNode(m_ClippingPlaneNode); } void mitk::ClippingPlaneRotationTool::Deactivated() { Superclass::Deactivated(); - - mitk::GlobalInteraction::GetInstance()->RemoveInteractor(m_AffineInteractor); -} - -//Checks the working data node, if it has an interactor. Otherwise initial a new one. -void mitk::ClippingPlaneRotationTool::ClippingPlaneChanged() -{ - m_ClippingPlaneNode = m_ToolManager->GetWorkingData(0); - m_AffineInteractor = dynamic_cast(m_ClippingPlaneNode->GetInteractor()); - - if (m_AffineInteractor.IsNull()) - m_AffineInteractor = mitk::AffineInteractor3D::New("AffineInteractor3D", m_ClippingPlaneNode); + m_AffineDataInteractor->SetDataNode(NULL); } diff --git a/Modules/ClippingTools/mitkClippingPlaneRotationTool.h b/Modules/ClippingTools/mitkClippingPlaneRotationTool.h index 1cd152513c..74a5d75a50 100644 --- a/Modules/ClippingTools/mitkClippingPlaneRotationTool.h +++ b/Modules/ClippingTools/mitkClippingPlaneRotationTool.h @@ -1,66 +1,65 @@ /*=================================================================== 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 mitkClippingPlaneRotationTool_h_Included #define mitkClippingPlaneRotationTool_h_Included #include "ClippingToolsExports.h" -#include "mitkAffineInteractor3D.h" +#include "mitkAffineDataInteractor3D.h" #include "mitkCommon.h" #include "mitkDataNode.h" #include "mitkTool.h" -#include "mitkVector.h" namespace mitk { /** \brief A tool which allows you to rotate planes. */ class ClippingTools_EXPORT ClippingPlaneRotationTool : public Tool { public: mitkClassMacro(ClippingPlaneRotationTool, Tool); itkNewMacro(ClippingPlaneRotationTool); virtual const char** GetXPM() const; virtual const char* GetName() const; virtual const char* GetGroup() const; protected: ClippingPlaneRotationTool(); // purposely hidden virtual ~ClippingPlaneRotationTool(); virtual void Activated(); virtual void Deactivated(); - mitk::DataNode::Pointer m_ClippingPlaneNode; - mitk::AffineInteractor3D::Pointer m_AffineInteractor; + mitk::DataNode::Pointer m_ClippingPlaneNode; + mitk::AffineDataInteractor3D::Pointer m_AffineDataInteractor; private: void ClippingPlaneChanged(); }; } //end namespace mitk #endif diff --git a/Modules/ClippingTools/mitkClippingPlaneTranslationTool.cpp b/Modules/ClippingTools/mitkClippingPlaneTranslationTool.cpp index 89e83f4866..c7a33026e5 100644 --- a/Modules/ClippingTools/mitkClippingPlaneTranslationTool.cpp +++ b/Modules/ClippingTools/mitkClippingPlaneTranslationTool.cpp @@ -1,83 +1,79 @@ /*=================================================================== 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. ===================================================================*/ #include "mitkClippingPlaneTranslationTool.h" #include "mitkClippingPlaneTranslationTool.xpm" #include "mitkBaseRenderer.h" -#include "mitkGlobalInteraction.h" #include "mitkRenderingManager.h" #include "mitkToolManager.h" +// us +#include "usModule.h" +#include "usModuleContext.h" +#include "usGetModuleContext.h" +#include "usModuleRegistry.h" + namespace mitk { MITK_TOOL_MACRO(ClippingTools_EXPORT, ClippingPlaneTranslationTool, "Clipping Tool Translation"); } mitk::ClippingPlaneTranslationTool::ClippingPlaneTranslationTool() : Tool( "global" ) { + m_AffineDataInteractor = mitk::AffineDataInteractor3D::New(); } mitk::ClippingPlaneTranslationTool::~ClippingPlaneTranslationTool() { } const char** mitk::ClippingPlaneTranslationTool::GetXPM() const { return mitkClippingPlaneTranslationTool_xpm; } const char* mitk::ClippingPlaneTranslationTool::GetName() const { return "Translation"; } const char* mitk::ClippingPlaneTranslationTool::GetGroup() const { return "ClippingTool"; } void mitk::ClippingPlaneTranslationTool::Activated() { - Superclass::Activated(); - - //check if the Clipping plane is changed. - if(m_ClippingPlaneNode != m_ToolManager->GetWorkingData(0)) - { - mitk::GlobalInteraction::GetInstance()->RemoveInteractor(m_AffineInteractor); - this->ClippingPlaneChanged(); - } - - m_AffineInteractor->SetInteractionModeToTranslation(); - mitk::GlobalInteraction::GetInstance()->AddInteractor(m_AffineInteractor); + Superclass::Activated(); + + //check if the Clipping plane is changed. + if(m_ClippingPlaneNode != m_ToolManager->GetWorkingData(0)) + { + m_ClippingPlaneNode = m_ToolManager->GetWorkingData(0); + m_ClippingPlaneNode->SetDataInteractor(NULL); + } + + m_AffineDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkExt")); + m_AffineDataInteractor->SetEventConfig("AffineTranslationConfig.xml", us::ModuleRegistry::GetModule("MitkExt")); + m_AffineDataInteractor->SetDataNode(m_ClippingPlaneNode); } void mitk::ClippingPlaneTranslationTool::Deactivated() { Superclass::Deactivated(); - - mitk::GlobalInteraction::GetInstance()->RemoveInteractor(m_AffineInteractor); -} - -//Checks the working data node, if it has an interactor. Otherwise initial a new one. -void mitk::ClippingPlaneTranslationTool::ClippingPlaneChanged() -{ - m_ClippingPlaneNode = m_ToolManager->GetWorkingData(0); - m_AffineInteractor = dynamic_cast(m_ClippingPlaneNode->GetInteractor()); - - if (m_AffineInteractor.IsNull()) - m_AffineInteractor = mitk::AffineInteractor3D::New("AffineInteractor3D", m_ClippingPlaneNode); + m_AffineDataInteractor->SetDataNode(NULL); } diff --git a/Modules/ClippingTools/mitkClippingPlaneTranslationTool.h b/Modules/ClippingTools/mitkClippingPlaneTranslationTool.h index 228dd88a29..746f896303 100644 --- a/Modules/ClippingTools/mitkClippingPlaneTranslationTool.h +++ b/Modules/ClippingTools/mitkClippingPlaneTranslationTool.h @@ -1,66 +1,68 @@ /*=================================================================== 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 mitkClippingPlaneTranslationTool_h_Included #define mitkClippingPlaneTranslationTool_h_Included #include "ClippingToolsExports.h" -#include "mitkAffineInteractor3D.h" +#include "mitkAffineDataInteractor3D.h" #include "mitkCommon.h" #include "mitkDataNode.h" #include "mitkTool.h" -#include "mitkVector.h" + + +namespace us { + class Module; +} + namespace mitk { /** \brief A tool which allows you to move planes. */ class ClippingTools_EXPORT ClippingPlaneTranslationTool : public Tool { public: mitkClassMacro(ClippingPlaneTranslationTool, Tool); itkNewMacro(ClippingPlaneTranslationTool); virtual const char** GetXPM() const; virtual const char* GetName() const; virtual const char* GetGroup() const; protected: ClippingPlaneTranslationTool(); // purposely hidden virtual ~ClippingPlaneTranslationTool(); virtual void Activated(); virtual void Deactivated(); - mitk::DataNode::Pointer m_ClippingPlaneNode; - mitk::AffineInteractor3D::Pointer m_AffineInteractor; - - private: + mitk::DataNode::Pointer m_ClippingPlaneNode; + mitk::AffineDataInteractor3D::Pointer m_AffineDataInteractor; - void ClippingPlaneChanged(); }; } //end namespace mitk #endif diff --git a/Modules/MitkExt/Interactions/mitkAffineDataInteractor3D.cpp b/Modules/MitkExt/Interactions/mitkAffineDataInteractor3D.cpp new file mode 100644 index 0000000000..10a8def66b --- /dev/null +++ b/Modules/MitkExt/Interactions/mitkAffineDataInteractor3D.cpp @@ -0,0 +1,364 @@ +/*=================================================================== + +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. + +===================================================================*/ + +#include "mitkAffineDataInteractor3D.h" + +#include "mitkDispatcher.h" +#include "mitkInteractionConst.h" // TODO: refactor file +#include "mitkInteractionPositionEvent.h" +#include "mitkInternalEvent.h" +#include "mitkMouseMoveEvent.h" +#include "mitkRenderingManager.h" +#include "mitkRotationOperation.h" +#include "mitkSurface.h" + +#include + +#include +#include +#include +#include +#include +#include + +mitk::AffineDataInteractor3D::AffineDataInteractor3D() +{ + m_OriginalGeometry = Geometry3D::New(); + + // Initialize vector arithmetic + m_ObjectNormal[0] = 0.0; + m_ObjectNormal[1] = 0.0; + m_ObjectNormal[2] = 1.0; +} + +mitk::AffineDataInteractor3D::~AffineDataInteractor3D() +{ +} + +void mitk::AffineDataInteractor3D::ConnectActionsAndFunctions() +{ + // **Conditions** that can be used in the state machine, + // to ensure that certain conditions are met, before + // actually executing an action + CONNECT_CONDITION("isOverObject", CheckOverObject); + + // **Function** in the statmachine patterns also referred to as **Actions** + CONNECT_FUNCTION("selectObject",SelectObject); + CONNECT_FUNCTION("deselectObject",DeselectObject); + CONNECT_FUNCTION("initTranslate",InitTranslate); + CONNECT_FUNCTION("initRotate",InitRotate); + CONNECT_FUNCTION("translateObject",TranslateObject); + CONNECT_FUNCTION("rotateObject",RotateObject); +} + +void mitk::AffineDataInteractor3D::DataNodeChanged() +{ +} + +bool mitk::AffineDataInteractor3D::CheckOverObject(const InteractionEvent* interactionEvent) +{ + ////Is only a copy of the old AffineInteractor3D. Not sure if is still needed. + ////Re-enable VTK interactor (may have been disabled previously) + const InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); + if(positionEvent == NULL) + return false; + + m_CurrentPickedPoint = positionEvent->GetPositionInWorld(); + m_CurrentPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen(); + + if(interactionEvent->GetSender()->PickObject( m_CurrentPickedDisplayPoint, m_CurrentPickedPoint ) == this->GetDataNode().GetPointer()) + { + return true; + } + return false; +} + +bool mitk::AffineDataInteractor3D::SelectObject(StateMachineAction*, InteractionEvent* interactionEvent) +{ + DataNode::Pointer node = this->GetDataNode(); + + if (node.IsNull()) + return false; + + node->SetColor( 1.0, 0.0, 0.0 ); + //TODO: Only 3D reinit + RenderingManager::GetInstance()->RequestUpdateAll(); + + // Colorize surface / wireframe dependend on distance from picked point + //TODO Check the return value + this->ColorizeSurface( interactionEvent->GetSender(), 0.0 ); + + return true; +} + +bool mitk::AffineDataInteractor3D::DeselectObject(StateMachineAction*, InteractionEvent* interactionEvent) +{ + DataNode::Pointer node = this->GetDataNode(); + + if (node.IsNull()) + return false; + + node->SetColor( 1.0, 1.0, 1.0 ); + //TODO: Only 3D reinit + RenderingManager::GetInstance()->RequestUpdateAll(); + + // Colorize surface / wireframe as inactive + //TODO Check the return value + this->ColorizeSurface( interactionEvent->GetSender(), -1.0 ); + + return true; +} + +bool mitk::AffineDataInteractor3D::InitTranslate(StateMachineAction*, InteractionEvent* interactionEvent) +{ + InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); + if(positionEvent == NULL) + return false; + + m_CurrentPickedPoint = positionEvent->GetPositionInWorld(); + m_CurrentPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen(); + + m_InitialPickedPoint = m_CurrentPickedPoint; + m_InitialPickedDisplayPoint = m_CurrentPickedDisplayPoint; + + // Get the timestep to also support 3D+t + int timeStep = 0; + if ((interactionEvent->GetSender()) != NULL) + timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData()); + + // Make deep copy of current Geometry3D of the plane + this->GetDataNode()->GetData()->UpdateOutputInformation(); // make sure that the Geometry is up-to-date + m_OriginalGeometry = static_cast< Geometry3D * >(this->GetDataNode()->GetData()->GetGeometry( timeStep )->Clone().GetPointer() ); + + return true; +} + +bool mitk::AffineDataInteractor3D::InitRotate(StateMachineAction*, InteractionEvent* interactionEvent) +{ + InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); + if(positionEvent == NULL) + return false; + + m_CurrentPickedPoint = positionEvent->GetPositionInWorld(); + m_CurrentPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen(); + + m_InitialPickedPoint = m_CurrentPickedPoint; + m_InitialPickedDisplayPoint = m_CurrentPickedDisplayPoint; + + // Get the timestep to also support 3D+t + int timeStep = 0; + if ((interactionEvent->GetSender()) != NULL) + timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData()); + + // Make deep copy of current Geometry3D of the plane + this->GetDataNode()->GetData()->UpdateOutputInformation(); // make sure that the Geometry is up-to-date + m_OriginalGeometry = static_cast< Geometry3D * >(this->GetDataNode()->GetData()->GetGeometry( timeStep )->Clone().GetPointer() ); + return true; +} + +bool mitk::AffineDataInteractor3D::TranslateObject (StateMachineAction*, InteractionEvent* interactionEvent) +{ + InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); + if(positionEvent == NULL) + return false; + + m_CurrentPickedPoint = positionEvent->GetPositionInWorld(); + m_CurrentPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen(); + + Vector3D interactionMove; + interactionMove[0] = m_CurrentPickedPoint[0] - m_InitialPickedPoint[0]; + interactionMove[1] = m_CurrentPickedPoint[1] - m_InitialPickedPoint[1]; + interactionMove[2] = m_CurrentPickedPoint[2] - m_InitialPickedPoint[2]; + + Point3D origin = m_OriginalGeometry->GetOrigin(); + + // Get the timestep to also support 3D+t + int timeStep = 0; + if ((interactionEvent->GetSender()) != NULL) + timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData()); + + // If data is an mitk::Surface, extract it + Surface::Pointer surface = dynamic_cast< Surface* >(this->GetDataNode()->GetData()); + vtkPolyData* polyData = NULL; + if (surface.IsNotNull()) + { + polyData = surface->GetVtkPolyData( timeStep ); + + // Extract surface normal from surface (if existent, otherwise use default) + vtkPointData* pointData = polyData->GetPointData(); + if (pointData != NULL) + { + vtkDataArray* normal = polyData->GetPointData()->GetVectors( "planeNormal" ); + if (normal != NULL) + { + m_ObjectNormal[0] = normal->GetComponent( 0, 0 ); + m_ObjectNormal[1] = normal->GetComponent( 0, 1 ); + m_ObjectNormal[2] = normal->GetComponent( 0, 2 ); + } + } + } + + Vector3D transformedObjectNormal; + this->GetDataNode()->GetData()->GetGeometry( timeStep )->IndexToWorld( + m_ObjectNormal, transformedObjectNormal ); + + this->GetDataNode()->GetData()->GetGeometry( timeStep )->SetOrigin( + origin + transformedObjectNormal * (interactionMove * transformedObjectNormal) ); + + //TODO: Only 3D reinit + RenderingManager::GetInstance()->RequestUpdateAll(); + + return true; +} + +bool mitk::AffineDataInteractor3D::RotateObject (StateMachineAction*, InteractionEvent* interactionEvent) +{ + InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); + if(positionEvent == NULL) + return false; + + m_CurrentPickedPoint = positionEvent->GetPositionInWorld(); + m_CurrentPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen(); + + vtkCamera* camera = NULL; + vtkRenderer *currentVtkRenderer = NULL; + + if ((interactionEvent->GetSender()) != NULL) + { + vtkRenderWindow* renderWindow = interactionEvent->GetSender()->GetRenderWindow(); + if ( renderWindow != NULL ) + { + vtkRenderWindowInteractor* renderWindowInteractor = renderWindow->GetInteractor(); + if ( renderWindowInteractor != NULL ) + { + currentVtkRenderer = renderWindowInteractor->GetInteractorStyle()->GetCurrentRenderer(); + if ( currentVtkRenderer != NULL ) + camera = currentVtkRenderer->GetActiveCamera(); + } + } + } + if ( camera ) + { + vtkFloatingPointType vpn[3]; + camera->GetViewPlaneNormal( vpn ); + + Vector3D viewPlaneNormal; + viewPlaneNormal[0] = vpn[0]; + viewPlaneNormal[1] = vpn[1]; + viewPlaneNormal[2] = vpn[2]; + + Vector3D interactionMove; + interactionMove[0] = m_CurrentPickedPoint[0] - m_InitialPickedPoint[0]; + interactionMove[1] = m_CurrentPickedPoint[1] - m_InitialPickedPoint[1]; + interactionMove[2] = m_CurrentPickedPoint[2] - m_InitialPickedPoint[2]; + + if (interactionMove[0]==0 && interactionMove[1]==0 && interactionMove[2]==0) + return true; + + Vector3D rotationAxis = itk::CrossProduct( viewPlaneNormal, interactionMove ); + rotationAxis.Normalize(); + + m_CurrentPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen(); + + int *size = currentVtkRenderer->GetSize(); + double l2 = + (m_CurrentPickedDisplayPoint[0] - m_InitialPickedDisplayPoint[0]) * + (m_CurrentPickedDisplayPoint[0] - m_InitialPickedDisplayPoint[0]) + + (m_CurrentPickedDisplayPoint[1] - m_InitialPickedDisplayPoint[1]) * + (m_CurrentPickedDisplayPoint[1] - m_InitialPickedDisplayPoint[1]); + + double rotationAngle = 360.0 * sqrt(l2/(size[0]*size[0]+size[1]*size[1])); + + // Use center of data bounding box as center of rotation + Point3D rotationCenter = m_OriginalGeometry->GetCenter(); + + int timeStep = 0; + if ((interactionEvent->GetSender()) != NULL) + timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData()); + + // Reset current Geometry3D to original state (pre-interaction) and + // apply rotation + RotationOperation op( OpROTATE, rotationCenter, rotationAxis, rotationAngle ); + Geometry3D::Pointer newGeometry = static_cast< Geometry3D * >( + m_OriginalGeometry->Clone().GetPointer() ); + newGeometry->ExecuteOperation( &op ); + mitk::TimeSlicedGeometry::Pointer timeSlicedGeometry = this->GetDataNode()->GetData()->GetTimeSlicedGeometry(); + if (timeSlicedGeometry.IsNotNull()) + { + timeSlicedGeometry->SetGeometry3D( newGeometry, timeStep ); + } + + //TODO: Only 3D reinit + RenderingManager::GetInstance()->RequestUpdateAll(); + + return true; + } + else + return false; +} + + +bool mitk::AffineDataInteractor3D::ColorizeSurface(BaseRenderer::Pointer renderer, double scalar) +{ + BaseData::Pointer data = this->GetDataNode()->GetData(); + if(data.IsNull()) + { + MITK_ERROR << "AffineInteractor3D: No data object present!"; + return false; + } + + // Get the timestep to also support 3D+t + int timeStep = 0; + if (renderer.IsNotNull()) + timeStep = renderer->GetTimeStep(data); + + + // If data is an mitk::Surface, extract it + Surface::Pointer surface = dynamic_cast< Surface* >(data.GetPointer()); + vtkPolyData* polyData = NULL; + if (surface.IsNotNull()) + polyData = surface->GetVtkPolyData(timeStep); + + if (polyData == NULL) + { + MITK_ERROR << "AffineInteractor3D: No poly data present!"; + return false; + } + + vtkPointData *pointData = polyData->GetPointData(); + if (pointData == NULL) + { + MITK_ERROR << "AffineInteractor3D: No point data present!"; + return false; + } + + vtkDataArray *scalars = pointData->GetScalars(); + if (scalars == NULL) + { + MITK_ERROR << "AffineInteractor3D: No scalars for point data present!"; + return false; + } + + for (unsigned int i = 0; i < pointData->GetNumberOfTuples(); ++i) + { + scalars->SetComponent(i, 0, scalar); + } + + polyData->Modified(); + pointData->Update(); + + return true; +} diff --git a/Modules/MitkExt/Interactions/mitkAffineDataInteractor3D.h b/Modules/MitkExt/Interactions/mitkAffineDataInteractor3D.h new file mode 100644 index 0000000000..fa4621438d --- /dev/null +++ b/Modules/MitkExt/Interactions/mitkAffineDataInteractor3D.h @@ -0,0 +1,88 @@ +/*=================================================================== + +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 mitkAffineDataInteractor3D_h_ +#define mitkAffineDataInteractor3D_h_ + +//#include "itkObject.h" +//#include "itkSmartPointer.h" +//#include "itkObjectFactory.h" +#include "mitkBaseRenderer.h" +#include "mitkCommon.h" +#include "mitkDataInteractor.h" +#include "MitkExtExports.h" +#include "mitkGeometry3D.h" + +namespace mitk +{ + /** + * \brief Affine interaction with objects in 3D windows. + * + * \ingroup Interaction + */ + + // Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs. + class MitkExt_EXPORT AffineDataInteractor3D: public DataInteractor + { + + public: + mitkClassMacro(AffineDataInteractor3D, DataInteractor); + itkNewMacro(Self); + + protected: + AffineDataInteractor3D(); + virtual ~AffineDataInteractor3D(); + /** + * Here actions strings from the loaded state machine pattern are mapped to functions of + * the DataInteractor. These functions are called when an action from the state machine pattern is executed. + */ + virtual void ConnectActionsAndFunctions(); + /** + * This function is called when a DataNode has been set/changed. + */ + virtual void DataNodeChanged(); + + /** + * Initializes the movement, stores starting position. + */ + virtual bool CheckOverObject (const InteractionEvent *); + virtual bool SelectObject (StateMachineAction*, InteractionEvent*); + virtual bool DeselectObject (StateMachineAction*, InteractionEvent*); + virtual bool InitTranslate (StateMachineAction*, InteractionEvent*); + virtual bool InitRotate (StateMachineAction*, InteractionEvent*); + virtual bool TranslateObject (StateMachineAction*, InteractionEvent*); + virtual bool RotateObject (StateMachineAction*, InteractionEvent*); + + bool ColorizeSurface(BaseRenderer::Pointer renderer, double scalar = 0.0); + + private: + + Point3D m_InitialPickedPoint; + Point2D m_InitialPickedDisplayPoint; + + Point3D m_CurrentPickedPoint; + Point2D m_CurrentPickedDisplayPoint; + + Geometry3D::Pointer m_Geometry; + + Geometry3D::Pointer m_OriginalGeometry; + + Vector3D m_ObjectNormal; + + }; + +} +#endif diff --git a/Modules/MitkExt/Interactions/mitkAffineInteractor3D.h b/Modules/MitkExt/Interactions/mitkAffineInteractor3D.h index 9bc2bd6690..761d480f6f 100644 --- a/Modules/MitkExt/Interactions/mitkAffineInteractor3D.h +++ b/Modules/MitkExt/Interactions/mitkAffineInteractor3D.h @@ -1,114 +1,117 @@ /*=================================================================== 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 MITKAFFINEINTERACTOR3D_H_HEADER_INCLUDED #define MITKAFFINEINTERACTOR3D_H_HEADER_INCLUDED #include "mitkInteractor.h" #include "MitkExtExports.h" #include "mitkCommon.h" #include "mitkSurface.h" #include #include namespace mitk { class DataNode; /** * \brief Affine interaction with objects in 3D windows. * * NOTE: The interaction mechanism is similar to that of vtkPlaneWidget * * \ingroup Interaction + * \deprecatedSince{2013_12} mitk::AffineInteractor is deprecated. Use mitk::AffineDataInteractor instead. + */ class MitkExt_EXPORT AffineInteractor3D : public Interactor { public: enum { INTERACTION_MODE_TRANSLATION, INTERACTION_MODE_ROTATION }; mitkClassMacro(AffineInteractor3D, Interactor); mitkNewMacro3Param(Self, const char *, DataNode *, int); mitkNewMacro2Param(Self, const char *, DataNode *); void SetInteractionMode( unsigned int interactionMode ); void SetInteractionModeToTranslation(); void SetInteractionModeToRotation(); unsigned int GetInteractionMode() const; /** \brief Sets the amount of precision */ void SetPrecision( ScalarType precision ); /** * \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; protected: /** * \brief Constructor with Param n for limited Set of Points * * if no n is set, then the number of points is unlimited* */ - AffineInteractor3D(const char *type, - DataNode *dataNode, int n = -1); + DEPRECATED(AffineInteractor3D(const char *type, + DataNode *dataNode, int n = -1)); /** * \brief Default Destructor **/ virtual ~AffineInteractor3D(); virtual bool ExecuteAction( Action* action, mitk::StateEvent const* stateEvent ); bool ColorizeSurface( vtkPolyData *polyData, const Point3D &pickedPoint, double scalar = 0.0 ); private: /** \brief to store the value of precision to pick a point */ ScalarType m_Precision; bool m_InteractionMode; Point3D m_InitialPickedPoint; Point2D m_InitialPickedDisplayPoint; double m_InitialPickedPointWorld[4]; Point3D m_CurrentPickedPoint; Point2D m_CurrentPickedDisplayPoint; double m_CurrentPickedPointWorld[4]; Geometry3D::Pointer m_Geometry; Geometry3D::Pointer m_OriginalGeometry; Vector3D m_ObjectNormal; }; + } #endif /* MITKAFFINEINTERACTOR3D_H_HEADER_INCLUDED */ diff --git a/Modules/MitkExt/Interactions/mitkSurfaceDeformationDataInteractor3D.cpp b/Modules/MitkExt/Interactions/mitkSurfaceDeformationDataInteractor3D.cpp new file mode 100644 index 0000000000..966f9628f0 --- /dev/null +++ b/Modules/MitkExt/Interactions/mitkSurfaceDeformationDataInteractor3D.cpp @@ -0,0 +1,283 @@ +/*=================================================================== + +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. + +===================================================================*/ + +#include "mitkSurfaceDeformationDataInteractor3D.h" + +#include "mitkDispatcher.h" +#include "mitkInteractionConst.h" // TODO: refactor file +#include "mitkInteractionPositionEvent.h" +#include "mitkInternalEvent.h" +#include "mitkMouseMoveEvent.h" +#include "mitkRenderingManager.h" +#include "mitkRotationOperation.h" +#include "mitkSurface.h" + +#include + +#include +#include +#include +#include +#include +#include + +mitk::SurfaceDeformationDataInteractor3D::SurfaceDeformationDataInteractor3D() + :m_Precision( 6.5 ), + m_GaussSigma( 30.0 ) +{ + m_OriginalPolyData = vtkPolyData::New(); + + // Initialize vector arithmetic + m_ObjectNormal[0] = 0.0; + m_ObjectNormal[1] = 0.0; + m_ObjectNormal[2] = 1.0; +} + +mitk::SurfaceDeformationDataInteractor3D::~SurfaceDeformationDataInteractor3D() +{ + m_OriginalPolyData->Delete(); +} + +void mitk::SurfaceDeformationDataInteractor3D::SetPrecision( mitk::ScalarType precision ) +{ + m_Precision = precision; +} + +void mitk::SurfaceDeformationDataInteractor3D::ConnectActionsAndFunctions() +{ + // **Conditions** that can be used in the state machine, + // to ensure that certain conditions are met, before + // actually executing an action + CONNECT_CONDITION("isOverObject", CheckOverObject); + + // **Function** in the statmachine patterns also referred to as **Actions** + CONNECT_FUNCTION("selectObject",SelectObject); + CONNECT_FUNCTION("deselectObject",DeselectObject); + CONNECT_FUNCTION("initDeformation",InitDeformation); + CONNECT_FUNCTION("deformObject",DeformObject); + +} + +void mitk::SurfaceDeformationDataInteractor3D::DataNodeChanged() +{ + if(this->GetDataNode() != NULL) + { + m_Surface = dynamic_cast< Surface * >(this->GetDataNode()->GetData()); + + if ( m_Surface == NULL ) + { + MITK_ERROR << "SurfaceDeformationDataInteractor3D::DataNodeChanged(): DataNode has to contain a surface."; + } + } + else + { + m_Surface = NULL; + } +} + +bool mitk::SurfaceDeformationDataInteractor3D::CheckOverObject(const InteractionEvent* interactionEvent) +{ + ////Is only a copy of the old SurfaceDeformationInteractor3D. Not sure if is still needed. + ////Re-enable VTK interactor (may have been disabled previously) + const InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); + if(positionEvent == NULL) + return false; + + m_CurrentPickedPoint = positionEvent->GetPositionInWorld(); + m_CurrentPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen(); + + if(interactionEvent->GetSender()->PickObject( m_CurrentPickedDisplayPoint, m_CurrentPickedPoint ) == this->GetDataNode().GetPointer()) + { + return true; + } + return false; +} + +bool mitk::SurfaceDeformationDataInteractor3D::SelectObject(StateMachineAction*, InteractionEvent* interactionEvent) +{ + const InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); + if(positionEvent == NULL) + return false; + + int timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData()); + + mitk::Point3D surfaceColorizationCenter = positionEvent->GetPositionInWorld(); + + this->GetDataNode()->SetColor( 1.0, 0.0, 0.0 ); + //TODO: Only 3D reinit + RenderingManager::GetInstance()->RequestUpdateAll(); + + // Colorize surface / wireframe dependend on distance from picked point + //TODO Check the return value + this->ColorizeSurface( interactionEvent->GetSender(), m_Surface->GetVtkPolyData(timeStep), + surfaceColorizationCenter, COLORIZATION_GAUSS ); + + return true; +} + +bool mitk::SurfaceDeformationDataInteractor3D::DeselectObject(StateMachineAction*, InteractionEvent* interactionEvent) +{ + const InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); + if(positionEvent == NULL) + return false; + + int timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData()); + + mitk::Point3D surfaceColorizationCenter = positionEvent->GetPositionInWorld(); + + this->GetDataNode()->SetColor( 1.0, 1.0, 1.0 ); + //TODO: Only 3D reinit + RenderingManager::GetInstance()->RequestUpdateAll(); + + // Colorize surface / wireframe as inactive + //TODO Check the return value + this->ColorizeSurface( interactionEvent->GetSender(), m_Surface->GetVtkPolyData(timeStep), + surfaceColorizationCenter, COLORIZATION_CONSTANT, -1.0 ); + + return true; +} + +bool mitk::SurfaceDeformationDataInteractor3D::InitDeformation(StateMachineAction*, InteractionEvent* interactionEvent) +{ + const InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); + if(positionEvent == NULL) + return false; + + // Store current picked point + m_InitialPickedPoint = positionEvent->GetPositionInWorld(); + + int timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode->GetData()); + + // Make deep copy of vtkPolyData interacted on + m_OriginalPolyData->DeepCopy(m_Surface->GetVtkPolyData(timeStep)); +} + +bool mitk::SurfaceDeformationDataInteractor3D::DeformObject (StateMachineAction*, InteractionEvent* interactionEvent) +{ + + const InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); + if(positionEvent == NULL) + return false; + + // Calculate mouse move in 3D space + mitk::Vector3D interactionMove; + interactionMove[0] = m_CurrentPickedPoint[0] - m_InitialPickedPoint[0]; + interactionMove[1] = m_CurrentPickedPoint[1] - m_InitialPickedPoint[1]; + interactionMove[2] = m_CurrentPickedPoint[2] - m_InitialPickedPoint[2]; + + this->GetDataNode()->GetData()->UpdateOutputInformation(); + + mitk::Point3D origin; origin.Fill( 0.0 ); + mitk::Vector3D interactionMoveIndex; + + int timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode->GetData()); + + mitk::Geometry3D::Pointer geometry = this->GetDataNode()->GetData()->GetGeometry(timeStep); + geometry->WorldToIndex(interactionMove, interactionMoveIndex); + + // Get picked point and transform into local coordinates + mitk::Point3D pickedPoint; + geometry->WorldToIndex(m_InitialPickedPoint, pickedPoint); + mitk::Vector3D v1 = pickedPoint.GetVectorFromOrigin(); + + mitk::Vector3D v2 = m_ObjectNormal * (interactionMoveIndex * m_ObjectNormal); + + vtkPoints* originalPoints = m_OriginalPolyData->GetPoints(); + vtkPoints* deformedPoints = m_Surface->GetVtkPolyData(timeStep)->GetPoints(); + double denom = m_GaussSigma * m_GaussSigma * 2; + double point[3]; + for ( unsigned int i = 0; i < deformedPoints->GetNumberOfPoints(); ++i ) + { + // Get original point + vtkFloatingPointType *originalPoint = originalPoints->GetPoint( i ); + mitk::Vector3D v0; + v0[0] = originalPoint[0]; + v0[1] = originalPoint[1]; + v0[2] = originalPoint[2]; + + + // Calculate distance of this point from line through picked point + double d = itk::CrossProduct( m_ObjectNormal, (v1 - v0) ).GetNorm(); + + mitk::Vector3D t = v2 * exp( - d * d / denom ); + + point[0] = originalPoint[0] + t[0]; + point[1] = originalPoint[1] + t[1]; + point[2] = originalPoint[2] + t[2]; + deformedPoints->SetPoint( i, point ); + } + + // TOODODOODODODODODODOODODOODODODODODOODODODODODO + + m_PolyData->Modified(); + m_Surface->Modified(); + + mitk::RenderingManager::GetInstance()->RequestUpdateAll(); + +} + + +bool mitk::SurfaceDeformationDataInteractor3D::ColorizeSurface(BaseRenderer::Pointer renderer, double scalar) +{ + BaseData::Pointer data = this->GetDataNode()->GetData(); + if(data.IsNull()) + { + MITK_ERROR << "SurfaceDeformationInteractor3D: No data object present!"; + return false; + } + + // Get the timestep to also support 3D+t + int timeStep = 0; + if (renderer.IsNotNull()) + timeStep = renderer->GetTimeStep(data); + + + // If data is an mitk::Surface, extract it + Surface::Pointer surface = dynamic_cast< Surface* >(data.GetPointer()); + vtkPolyData* polyData = NULL; + if (surface.IsNotNull()) + polyData = surface->GetVtkPolyData(timeStep); + + if (polyData == NULL) + { + MITK_ERROR << "SurfaceDeformationInteractor3D: No poly data present!"; + return false; + } + + vtkPointData *pointData = polyData->GetPointData(); + if (pointData == NULL) + { + MITK_ERROR << "SurfaceDeformationInteractor3D: No point data present!"; + return false; + } + + vtkDataArray *scalars = pointData->GetScalars(); + if (scalars == NULL) + { + MITK_ERROR << "SurfaceDeformationInteractor3D: No scalars for point data present!"; + return false; + } + + for (unsigned int i = 0; i < pointData->GetNumberOfTuples(); ++i) + { + scalars->SetComponent(i, 0, scalar); + } + + polyData->Modified(); + pointData->Update(); + + return true; +} diff --git a/Modules/MitkExt/Interactions/mitkSurfaceDeformationDataInteractor3D.h b/Modules/MitkExt/Interactions/mitkSurfaceDeformationDataInteractor3D.h new file mode 100644 index 0000000000..2adb91717c --- /dev/null +++ b/Modules/MitkExt/Interactions/mitkSurfaceDeformationDataInteractor3D.h @@ -0,0 +1,110 @@ +/*=================================================================== + +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 mitkSurfaceDeformationDataInteractor3D_h_ +#define mitkSurfaceDeformationDataInteractor3D_h_ + +//#include "itkObject.h" +//#include "itkSmartPointer.h" +//#include "itkObjectFactory.h" +#include "mitkBaseRenderer.h" +#include "mitkCommon.h" +#include "mitkDataInteractor.h" +#include "MitkExtExports.h" +#include "mitkGeometry3D.h" +#include "mitkSurface.h" + +namespace mitk +{ +/** + * \brief SurfaceDeformation interaction with objects in 3D windows. + * + * \ingroup Interaction + */ + +// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs. +class MitkExt_EXPORT SurfaceDeformationDataInteractor3D: public DataInteractor +{ + +public: + mitkClassMacro(SurfaceDeformationDataInteractor3D, DataInteractor); + itkNewMacro(Self); + + /** \brief Sets the amount of precision */ + void SetPrecision( ScalarType precision ); + +protected: + SurfaceDeformationDataInteractor3D(); + virtual ~SurfaceDeformationDataInteractor3D(); + /** + * Here actions strings from the loaded state machine pattern are mapped to functions of + * the DataInteractor. These functions are called when an action from the state machine pattern is executed. + */ + virtual void ConnectActionsAndFunctions(); + /** + * This function is called when a DataNode has been set/changed. + */ + virtual void DataNodeChanged(); + + /** + * Initializes the movement, stores starting position. + */ + virtual bool CheckOverObject (const InteractionEvent *); + virtual bool SelectObject (StateMachineAction*, InteractionEvent*); + virtual bool DeselectObject (StateMachineAction*, InteractionEvent*); + virtual bool InitDeformation (StateMachineAction*, InteractionEvent*); + virtual bool DeformObject (StateMachineAction*, InteractionEvent*); + + enum + { + COLORIZATION_GAUSS, + COLORIZATION_CONSTANT + }; + + bool ColorizeSurface(BaseRenderer::Pointer renderer, vtkPolyData* polyData, const Point3D &pickedPoint, + int mode, double scalar = 0.0 ); + +private: + + /** \brief to store the value of precision to pick a point */ + ScalarType m_Precision; + + Point3D m_InitialPickedPoint; + Point2D m_InitialPickedDisplayPoint; + + Point3D m_CurrentPickedPoint; + Point2D m_CurrentPickedDisplayPoint; + + Point3D m_SurfaceColorizationCenter; + + Geometry3D::Pointer m_Geometry; + + Surface* m_Surface; + vtkPolyData* m_PolyData; + + DataNode* m_PickedSurfaceNode; + Surface * m_PickedSurface; + + vtkPolyData* m_PickedPolyData; + vtkPolyData *m_OriginalPolyData; + + double m_GaussSigma; + + Vector3D m_ObjectNormal; +}; + +} +#endif diff --git a/Modules/MitkExt/Resources/Interactions/AffineDeformationConfig.xml b/Modules/MitkExt/Resources/Interactions/AffineDeformationConfig.xml new file mode 100644 index 0000000000..d16afb690a --- /dev/null +++ b/Modules/MitkExt/Resources/Interactions/AffineDeformationConfig.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/Modules/MitkExt/Resources/Interactions/AffineInteraction3D.xml b/Modules/MitkExt/Resources/Interactions/AffineInteraction3D.xml new file mode 100644 index 0000000000..6b6063321a --- /dev/null +++ b/Modules/MitkExt/Resources/Interactions/AffineInteraction3D.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Modules/MitkExt/Resources/Interactions/AffineRotationConfig.xml b/Modules/MitkExt/Resources/Interactions/AffineRotationConfig.xml new file mode 100644 index 0000000000..fb9c6fe6d1 --- /dev/null +++ b/Modules/MitkExt/Resources/Interactions/AffineRotationConfig.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/Modules/MitkExt/Resources/Interactions/AffineTranslationConfig.xml b/Modules/MitkExt/Resources/Interactions/AffineTranslationConfig.xml new file mode 100644 index 0000000000..7f5fca8574 --- /dev/null +++ b/Modules/MitkExt/Resources/Interactions/AffineTranslationConfig.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/Modules/MitkExt/files.cmake b/Modules/MitkExt/files.cmake index d72a6de823..8efa0cdbd6 100644 --- a/Modules/MitkExt/files.cmake +++ b/Modules/MitkExt/files.cmake @@ -1,142 +1,149 @@ set(CPP_FILES Algorithms/mitkMaskAndCutRoiImageFilter.cpp Algorithms/mitkBoundingObjectToSegmentationFilter.cpp Algorithms/vtkPointSetSlicer.cxx Algorithms/mitkCoreExtObjectFactory.cpp Algorithms/mitkAngleCorrectByPointFilter.cpp Algorithms/mitkBoundingObjectCutter.cpp Algorithms/mitkCylindricToCartesianFilter.cpp Algorithms/mitkDopplerToStrainRateFilter.cpp Algorithms/mitkGeometryClipImageFilter.cpp Algorithms/mitkGeometryDataSource.cpp Algorithms/mitkHeightFieldSurfaceClipImageFilter.cpp Algorithms/mitkImageToLookupTableFilter.cpp Algorithms/mitkInterpolateLinesFilter.cpp Algorithms/mitkLabeledImageToSurfaceFilter.cpp Algorithms/mitkLabeledImageVolumeCalculator.cpp Algorithms/mitkLookupTableSource.cpp Algorithms/mitkMaskImageFilter.cpp Algorithms/mitkMeshSource.cpp Algorithms/mitkNonBlockingAlgorithm.cpp Algorithms/mitkPadImageFilter.cpp Algorithms/mitkPlaneCutFilter.cpp Algorithms/mitkPlaneFit.cpp Algorithms/mitkPlanesPerpendicularToLinesFilter.cpp Algorithms/mitkPointLocator.cpp Algorithms/mitkPointSetToCurvedGeometryFilter.cpp Algorithms/mitkPointSetToGeometryDataFilter.cpp Algorithms/mitkPointSetIndexToWorldTransformFilter.cpp Algorithms/mitkSurfaceIndexToWorldTransformFilter.cpp Algorithms/mitkPolygonToRingFilter.cpp Algorithms/mitkProbeFilter.cpp Algorithms/mitkSimpleHistogram.cpp Algorithms/mitkSimpleUnstructuredGridHistogram.cpp Algorithms/mitkUnstructuredGridHistogram.cpp Algorithms/mitkUnstructuredGridSource.cpp Algorithms/mitkVolumeVisualizationImagePreprocessor.cpp Controllers/mitkIPythonService.cpp Controllers/mitkMovieGenerator.cpp Controllers/mitkMultiStepper.cpp DataManagement/mitkAffineTransformationOperation.cpp DataManagement/mitkApplyDiffImageOperation.cpp DataManagement/mitkBoundingObject.cpp DataManagement/mitkBoundingObjectGroup.cpp DataManagement/mitkCellOperation.cpp DataManagement/mitkColorConversions.cpp DataManagement/mitkColorSequence.cpp DataManagement/mitkColorSequenceCycleH.cpp DataManagement/mitkColorSequenceHalfTones.cpp DataManagement/mitkColorSequenceRainbow.cpp DataManagement/mitkCompressedImageContainer.cpp DataManagement/mitkCone.cpp DataManagement/mitkCuboid.cpp DataManagement/mitkCylinder.cpp DataManagement/mitkDataStorageSelection.cpp DataManagement/mitkDelegateManager.cpp DataManagement/mitkDrawOperation.cpp DataManagement/mitkEllipsoid.cpp DataManagement/mitkExternAbstractTransformGeometry.cpp DataManagement/mitkFrameOfReferenceUIDManager.cpp DataManagement/mitkGridRepresentationProperty.cpp DataManagement/mitkGridVolumeMapperProperty.cpp DataManagement/mitkItkBaseDataAdapter.cpp DataManagement/mitkLabeledImageLookupTable.cpp DataManagement/mitkLineOperation.cpp DataManagement/mitkMesh.cpp DataManagement/mitkObjectSet.cpp DataManagement/mitkOrganTypeProperty.cpp DataManagement/mitkPlaneLandmarkProjector.cpp DataManagement/mitkPlane.cpp DataManagement/mitkPropertyManager.cpp DataManagement/mitkPropertyObserver.cpp DataManagement/mitkSeedsImage.cpp DataManagement/mitkSeedsImageLookupTableSource.cpp DataManagement/mitkSphereLandmarkProjector.cpp # DataManagement/mitkUSLookupTableSource.cpp DataManagement/mitkUnstructuredGrid.cpp DataManagement/mitkVideoSource.cpp DataManagement/vtkObjectSet.cpp IO/mitkObjFileIOFactory.cpp IO/mitkObjFileReader.cpp IO/mitkPACSPlugin.cpp IO/mitkParRecFileIOFactory.cpp IO/mitkParRecFileReader.cpp IO/mitkPropertyListExportToXmlFile.cpp IO/mitkPropertyListImportFromXmlFile.cpp IO/mitkStlVolumeTimeSeriesIOFactory.cpp IO/mitkStlVolumeTimeSeriesReader.cpp IO/mitkUnstructuredGridVtkWriter.cpp IO/mitkUnstructuredGridVtkWriterFactory.cpp IO/mitkVtkUnstructuredGridIOFactory.cpp IO/mitkVtkUnstructuredGridReader.cpp IO/mitkVtkVolumeTimeSeriesIOFactory.cpp IO/mitkVtkVolumeTimeSeriesReader.cpp Interactions/mitkConferenceEventMapper.cpp Interactions/mitkConnectPointsInteractor.cpp #Interactions/mitkCoordinateSupplier.cpp #Interactions/mitkDisplayCoordinateOperation.cpp #Interactions/mitkDisplayInteractor.cpp Interactions/mitkAffineInteractor3D.cpp + Interactions/mitkAffineDataInteractor3D.cpp Interactions/mitkDisplayPointSetInteractor.cpp #Interactions/mitkDisplayVectorInteractor.cpp Interactions/mitkInteractionDebug.cpp Interactions/mitkInteractionDebugger.cpp Interactions/mitkPointInteractor.cpp Interactions/mitkPointSelectorInteractor.cpp #Interactions/mitkPositionTracker.cpp Interactions/mitkSeedsInteractor.cpp + Interactions/mitkSurfaceDeformationDataInteractor3D.cpp Interactions/mitkSocketClient.cpp Interactions/mitkSurfaceDeformationInteractor3D.cpp Interactions/mitkSurfaceInteractor.cpp # Interactions/mitkCreateSurfaceTool.cpp Rendering/mitkEnhancedPointSetVtkMapper3D.cpp Rendering/mitkImageBackground2D.cpp Rendering/mitkLineMapper2D.cpp # Rendering/mitkLineVtkMapper3D.cpp Rendering/mitkMeshMapper2D.cpp Rendering/mitkMeshVtkMapper3D.cpp Rendering/mitkNativeRenderWindowInteractor.cpp Rendering/mitkSplineMapper2D.cpp Rendering/mitkSplineVtkMapper3D.cpp Rendering/mitkUnstructuredGridMapper2D.cpp Rendering/mitkUnstructuredGridVtkMapper3D.cpp Rendering/mitkVectorImageMapper2D.cpp Rendering/vtkUnstructuredGridMapper.cpp Rendering/vtkMaskedGlyph2D.cpp Rendering/vtkMaskedGlyph3D.cpp Rendering/vtkMitkVolumeTextureMapper3D.cpp Rendering/vtkMitkOpenGLVolumeTextureMapper3D.cpp Rendering/mitkGPUVolumeMapper3D.cpp Rendering/vtkMitkGPUVolumeRayCastMapper.cpp ) if(WIN32 AND NOT MINGW) set(CPP_FILES Controllers/mitkMovieGeneratorWin32.cpp ${CPP_FILES} ) endif(WIN32 AND NOT MINGW) - +set(RESOURCE_FILES +Interactions/AffineInteraction3D.xml +Interactions/AffineTranslationConfig.xml +Interactions/AffineRotationConfig.xml +Interactions/AffineDeformationConfig.xml +)