Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MITKPointSet_H_HEADER_INCLUDED
00020 #define MITKPointSet_H_HEADER_INCLUDED
00021
00022 #include "mitkBaseData.h"
00023
00024 #include <itkMesh.h>
00025 #include <itkDefaultDynamicMeshTraits.h>
00026
00027
00028 namespace mitk {
00029
00082 class MITK_CORE_EXPORT PointSet : public BaseData
00083 {
00084 public:
00085 mitkClassMacro(PointSet, BaseData);
00086
00087 itkNewMacro(Self);
00088
00089
00090 typedef mitk::ScalarType CoordinateType;
00091 typedef mitk::ScalarType InterpolationWeightType;
00092
00093 static const unsigned int PointDimension = 3;
00094 static const unsigned int MaxTopologicalDimension = 3;
00095
00099 struct PointDataType
00100 {
00101 unsigned int id;
00102 bool selected;
00103 mitk::PointSpecificationType pointSpec;
00104 };
00105
00112 typedef std::vector<unsigned int> SelectedLinesType;
00113 typedef SelectedLinesType::iterator SelectedLinesIter;
00114 struct CellDataType
00115 {
00116
00117 bool selected;
00118
00119
00120 SelectedLinesType selectedLines;
00121
00122
00123 bool closed;
00124 };
00125
00126 typedef itk::DefaultDynamicMeshTraits<
00127 PointDataType, PointDimension, MaxTopologicalDimension,
00128 CoordinateType, InterpolationWeightType, CellDataType > MeshTraits;
00129 typedef itk::Mesh<PointDataType, PointDimension, MeshTraits> MeshType;
00130
00131 typedef MeshType DataType;
00132 typedef DataType::PointType PointType;
00133 typedef DataType::PointIdentifier PointIdentifier;
00134 typedef DataType::PointsContainer PointsContainer;
00135 typedef DataType::PointsContainerIterator PointsIterator;
00136 typedef DataType::PointsContainer::ConstIterator PointsConstIterator;
00137 typedef DataType::PointDataContainer PointDataContainer;
00138 typedef DataType::PointDataContainerIterator PointDataIterator;
00139
00140
00141 virtual void Expand( unsigned int timeSteps );
00142
00144 virtual void ExecuteOperation(Operation* operation);
00145
00147 virtual int GetSize( unsigned int t = 0 ) const;
00148
00149 virtual unsigned int GetPointSetSeriesSize() const;
00150
00152 virtual DataType::Pointer GetPointSet( int t = 0 ) const;
00153
00159 PointType GetPoint( PointIdentifier id, int t = 0 ) const;
00160
00167 bool GetPointIfExists( PointIdentifier id, PointType* point, int t = 0 ) const;
00168
00172 void SetPoint( PointIdentifier id, PointType point, int t = 0 );
00173
00177 void SetPoint( PointIdentifier id, PointType point, PointSpecificationType spec, int t = 0 );
00178
00182 void InsertPoint( PointIdentifier id, PointType point, int t = 0 );
00183
00187 void InsertPoint( PointIdentifier id, PointType point, PointSpecificationType spec, int t );
00188
00193 bool SwapPointPosition( PointIdentifier id, bool moveUpwards, int t = 0 );
00194
00195
00200 virtual int SearchSelectedPoint( int t = 0 ) const;
00201
00203 virtual bool IndexExists( int position, int t = 0 ) const;
00204
00208 virtual bool GetSelectInfo( int position, int t = 0 ) const;
00209
00210 virtual void SetSelectInfo( int position, bool selected, int t = 0 );
00211
00213 virtual PointSpecificationType GetSpecificationTypeInfo( int position, int t ) const;
00214
00216 virtual int GetNumberOfSelected( int t = 0 ) const;
00217
00226 int SearchPoint( Point3D point, float distance, int t = 0 ) const;
00227
00228 virtual bool IsEmpty(unsigned int t) const;
00229
00230
00231 virtual void UpdateOutputInformation();
00232 virtual void SetRequestedRegionToLargestPossibleRegion();
00233 virtual bool RequestedRegionIsOutsideOfTheBufferedRegion();
00234 virtual bool VerifyRequestedRegion();
00235 virtual void SetRequestedRegion(itk::DataObject *data);
00236
00237
00238 virtual void OnPointSetChange(){};
00239
00240 protected:
00241 PointSet();
00242 virtual ~PointSet();
00243
00244 virtual void PrintSelf(std::ostream& os, itk::Indent indent) const;
00245
00246 virtual void ClearData();
00247
00248 virtual void InitializeEmpty();
00249
00251 bool SwapPointContents(PointIdentifier id1, PointIdentifier id2, int t = 0 );
00252
00253 typedef std::vector< DataType::Pointer > PointSetSeries;
00254
00255 PointSetSeries m_PointSetSeries;
00256
00260 bool m_CalculateBoundingBox;
00261 };
00262
00263 itkEventMacro( PointSetEvent, itk::AnyEvent );
00264 itkEventMacro( PointSetMoveEvent, PointSetEvent );
00265 itkEventMacro( PointSetSizeChangeEvent, PointSetEvent );
00266 itkEventMacro( PointSetAddEvent, PointSetSizeChangeEvent );
00267 itkEventMacro( PointSetRemoveEvent, PointSetSizeChangeEvent );
00268 itkEventMacro( PointSetExtendTimeRangeEvent, PointSetEvent );
00269
00270
00271 }
00272
00273 #endif