54 if (positionEvent !=
nullptr)
66 if (!
m_PointSet->IndexExists(lastPosition, timeStep))
74 if (
m_PointSet->IsEmpty()) { lastPosition = 0; }
107 positionEvent->GetSender()->GetDispatcher()->QueueEvent(event.GetPointer());
118 if (positionEvent !=
nullptr)
120 Point3D point = positionEvent->GetPositionInWorld();
164 if (positionEvent !=
nullptr)
166 mitk::Point3D itkPoint = positionEvent->GetPositionInWorld();
209 if (positionEvent !=
nullptr)
211 Point3D point = positionEvent->GetPositionInWorld();
216 positionEvent->GetSender()->GetDispatcher()->QueueEvent(event.GetPointer());
226 if (positionEvent !=
nullptr)
230 newPoint = positionEvent->GetPositionInWorld();
249 int position = it->Index();
250 if (
m_PointSet->GetSelectInfo(position, timeStep))
257 resultPoint = sumVec + dirVector;
267 m_LastPoint = newPoint;
280 if (positionEvent !=
nullptr)
282 Point3D point = positionEvent->GetPositionInWorld();
315 if (positionEvent !=
nullptr)
317 Point3D positioninWorld = positionEvent->GetPositionInWorld();
318 PointSet::PointsContainer::Iterator it, end;
322 end = itkPointSet->GetPoints()->End();
324 for (it = itkPointSet->GetPoints()->Begin(); it != end; it++)
326 int position = it->Index();
329 if (
m_PointSet->GetSelectInfo(position, timeStep))
331 float distance = sqrt(positioninWorld.SquaredEuclideanDistanceTo(
m_PointSet->GetPoint(position, timeStep)));
365 if (pointSet ==
nullptr)
367 MITK_ERROR <<
"PointSetDataInteractor:: No valid point set .";
388 if (points ==
nullptr)
399 std::string strNumber;
400 if (properties->GetStringProperty(
"MaxPoints", strNumber))
411 if (positionEvent ==
nullptr)
432 if (positionEvent !=
nullptr)
449 int position = it->Index();
450 if (
m_PointSet->GetSelectInfo(position, timeStep))
503 if (points ==
nullptr)
508 if (points->GetPointSet(time) ==
nullptr)
515 minDistance = accuracy;
519 float distance = sqrt(position.SquaredEuclideanDistanceTo(points->GetPoint(it->Index(), time)));
532 if (positionEvent !=
nullptr)
535 Point3D point = positionEvent->GetPositionInWorld();
547 if (pointSet ==
nullptr)
553 if (itkPointSet ==
nullptr)
558 mitk::PointSet::PointsContainer::Iterator it, end;
559 end = itkPointSet->GetPoints()->End();
561 for (it = itkPointSet->GetPoints()->Begin(); it != end; it++)
563 int position = it->Index();
565 itkPointSet->GetPointData(position, &pointData);
584 pointSet->ExecuteOperation(doOp);
597 if ((pointSet ==
nullptr) || (pointSet->GetSize(timeStep) <= 0))
617 pointSet->ExecuteOperation(doOp);
void UnselectAll(unsigned int timeStep, ScalarType timeInMs)
ScalarType GetTime() const
Get the time in ms of the currently displayed content.
DataType::PointsContainerIterator PointsIterator
Super class for all position events.
virtual void InitMove(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void RemovePoint(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void SetData(mitk::BaseData *baseData)
Set the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
virtual void MovePoint(StateMachineAction *, InteractionEvent *)
virtual void UpdatePointSet(StateMachineAction *stateMachineAction, InteractionEvent *)
UpdatePointSet Updates the member variable that holds the point set, evaluating the time step of the ...
struct for data of a point
void SetMaxPoints(unsigned int maxNumber=0)
SetMaxPoints Sets the maximal number of points for the pointset Default ist zero, which result in inf...
virtual void AddPoint(StateMachineAction *, InteractionEvent *event)
Constants for most interaction classes, due to the generic StateMachines.
bool SetOperationEvent(UndoStackItem *operationEvent)
Point3D m_LastPoint
to calculate a direction vector from last point and actual point
virtual bool CheckSelection(const InteractionEvent *interactionEvent)
DataNode * GetDataNode() const
Vector3D m_SumVec
summ-vector for Movement
virtual void Abort(StateMachineAction *, InteractionEvent *)
BaseRenderer * GetSender() const
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
Add new or change existent property.
void DataNodeChanged() override
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
Data structure which stores a set of points. Superclass of mitk::Mesh.
static RenderingManager * GetInstance()
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
virtual unsigned int GetTimeStep() const
virtual DataType::Pointer GetPointSet(int t=0) const
returns the pointset
virtual int GetPointIndexByPosition(Point3D position, unsigned int time=0, float accuracy=-1)
Return index in PointSet of the point that is within given accuracy to the provided position...
virtual void UnSelectAll(StateMachineAction *, InteractionEvent *)
virtual void SelectPoint(StateMachineAction *, InteractionEvent *)
Operation that handles all actions on one Point.
static const std::string IntDeactivateMe
virtual void IsClosedContour(StateMachineAction *, InteractionEvent *)
UndoController * m_UndoController
~PointSetDataInteractor() override
DataType::PointsContainer PointsContainer
#define CONNECT_CONDITION(a, f)
virtual void NotifyResultReady()
NotifyResultReady Sends ResultReady event via the mitk::DataNode.
virtual void UnSelectPointAtPosition(StateMachineAction *, InteractionEvent *)
Dispatcher::Pointer GetDispatcher() const
Returns the Dispatcher which handles Events for this BaseRenderer.
float m_SelectionAccuracy
virtual void FinishMove(StateMachineAction *, InteractionEvent *)
PropertyList::Pointer GetAttributes() const
static Pointer New(BaseRenderer *_arga, DataInteractor *_argb, const std::string &_argc)
PointSet::Pointer m_PointSet
static void IncCurrObjectEventId()
Increases the current ObjectEventId For example if a button click generates operations the ObjectEven...
#define CONNECT_FUNCTION(a, f)
void ConnectActionsAndFunctions() override
void SetAccuracy(float accuracy)
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Represents a pair of operations: undo and the according redo.