13 #ifndef mitkPointSet_h
14 #define mitkPointSet_h
18 #include <itkDefaultDynamicMeshTraits.h>
75 itkFactorylessNewMacro(Self);
86 static const unsigned int PointDimension = 3;
89 static const unsigned int MaxTopologicalDimension = 3;
134 MaxTopologicalDimension,
139 typedef itk::Mesh<PointDataType, PointDimension, MeshTraits>
MeshType;
158 void Expand(
unsigned int timeSteps)
override;
177 virtual int GetSize(
unsigned int t = 0)
const;
460 void PrintSelf(std::ostream &os, itk::Indent indent)
const override;
501 bool checkGeometry =
true);
Base class of all data objects.
Base class for all operations in the undo/redo framework.
Data structure which stores a set of points.
void UpdateOutputInformation() override
Update the output information (bounding box, geometry).
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Check whether the requested region is outside the buffered region.
bool SwapPointPosition(PointIdentifier id, bool moveUpwards, int t=0)
Swap a point with its neighbor in the ordered container.
itk::Mesh< PointDataType, PointDimension, MeshTraits > MeshType
PointType GetPoint(PointIdentifier id, int t=0) const
Get the point with the given ID in world coordinates.
bool m_CalculateBoundingBox
flag to indicate the right time to call SetBounds
virtual void SetSelectInfo(int position, bool selected, int t=0)
Set the selection state of the point at the given position.
virtual int SearchSelectedPoint(int t=0) const
Search for a selected point and return its ID.
PointsConstIterator Begin(int t=0) const
Get an iterator pointing to the first point at time step t.
PointsConstIterator End(int t=0) const
Get an iterator pointing past the last point at time step t.
DataType::PointDataContainer PointDataContainer
PointSetSeries m_PointSetSeries
DataType::PointsContainer::Pointer m_EmptyPointsContainer
void PrintSelf(std::ostream &os, itk::Indent indent) const override
print content of the object to os
DataType::PointsContainer::ConstIterator PointsConstIterator
void Expand(unsigned int timeSteps) override
Expand the PointSet to the given number of time steps.
PointSet(const PointSet &other)
DataType::PointDataContainerIterator PointDataIterator
itk::DefaultDynamicMeshTraits< PointDataType, PointDimension, MaxTopologicalDimension, CoordinateType, InterpolationWeightType, CellDataType > MeshTraits
void InitializeEmpty() override
Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least creat...
virtual void OnPointSetChange()
Hook method called when the point set content changes.
void SetRequestedRegion(const itk::DataObject *data) override
Set the requested region from another data object (no-op for PointSet).
DataType::PointIdentifier PointIdentifier
mitk::ScalarType InterpolationWeightType
Scalar type for interpolation weights.
std::vector< unsigned int > SelectedLinesType
Type for storing indices of selected lines between points.
virtual bool IndexExists(int position, int t=0) const
Check whether a point exists at the given position (index).
virtual int GetNumberOfSelected(int t=0) const
Get the number of selected points at time step t.
std::vector< DataType::Pointer > PointSetSeries
bool IsEmptyTimeStep(unsigned int t) const override
Check whether the point set is empty at time step t.
virtual void ClearSelection()
Deselect all points in all time steps.
PointsIterator RemovePointAtEnd(int t=0)
Remove the point with the maximum ID at time step t.
DataType::PointDataContainerIterator PointDataConstIterator
virtual int GetSize(unsigned int t=0) const
Get the number of points at time step t.
PointsIterator End(int t=0)
Get an iterator pointing past the last point at time step t.
void ClearData() override
reset to non-initialized state, release memory
bool RemovePointIfExists(PointIdentifier id, int t=0)
Remove the point with the given ID at time step t, if it exists.
void SetRequestedRegionToLargestPossibleRegion() override
Set the requested region to the largest possible region (no-op for PointSet).
DataType::PointsContainerIterator PointsIterator
bool VerifyRequestedRegion() override
Verify that the requested region is valid.
void SetPoint(PointIdentifier id, PointType point, PointSpecificationType spec, int t=0)
Set (overwrite) the point with the given ID and PointSpecificationType.
PointIdentifier InsertPoint(PointType point, int t=0)
Insert a point with an automatically assigned ID (max ID + 1).
bool SwapPointContents(PointIdentifier id1, PointIdentifier id2, int t=0)
swaps point coordinates and point data of the points with identifiers id1 and id2
int SearchPoint(Point3D point, ScalarType distance, int t=0) const
Search for the closest point within a given distance.
virtual unsigned int GetPointSetSeriesSize() const
Get the number of time steps in the point set series.
virtual PointSpecificationType GetSpecificationTypeInfo(int position, int t) const
Get the PointSpecificationType of the point at the given position.
void SetPoint(PointIdentifier id, PointType point, int t=0)
Set (overwrite) the point with the given ID in world coordinates.
void InsertPoint(PointIdentifier id, PointType point, PointSpecificationType spec, int t)
Insert a point with the given ID, world coordinates, and PointSpecificationType.
PointsIterator GetMaxId(int t=0)
Get an iterator to the element with the maximum ID at time step t.
mitk::ScalarType CoordinateType
Scalar type for point coordinates.
virtual DataType::Pointer GetPointSet(int t=0) const
Get the underlying itk::Mesh at time step t.
DataType::PointsContainer PointsContainer
void InsertPoint(PointIdentifier id, PointType point, int t=0)
Insert a point with the given ID in world coordinates.
bool GetPointIfExists(PointIdentifier id, PointType *point, int t=0) const
Get the point with the given ID if it exists.
mitkClassMacro(PointSet, BaseData)
PointsIterator Begin(int t=0)
Get an iterator pointing to the first point at time step t.
void ExecuteOperation(Operation *operation) override
Execute an operation on this PointSet.
SelectedLinesType::iterator SelectedLinesIter
Iterator for SelectedLinesType.
virtual bool GetSelectInfo(int position, int t=0) const
Get the selection state of the point at the given position.
Find image slices visible on a given plane.
MITKCORE_EXPORT const ScalarType eps
Epsilon value for floating point comparison (vnl_math::eps * 100).
PointSpecificationType
Enumeration of point specification types.
double ScalarType
Scalar type used throughout MITK for geometric computations.
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)
Data associated with a cell in the mesh.
SelectedLinesType selectedLines
Indices of selected lines within the cell.
bool selected
Whether the entire cell is selected.
bool closed
Whether the polygon is finished and closed.
Data associated with each point in the PointSet.
unsigned int id
Unique identifier for this point.
mitk::PointSpecificationType pointSpec
Type specification of the point.
bool selected
Whether the point is selected.
bool operator==(const PointDataType &other) const
Equality comparison operator.