00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifndef __itkPointSet_h
00021
#define __itkPointSet_h
00022
00023
#include "itkDataObject.h"
00024
#include "itkPoint.h"
00025
#include "itkDefaultStaticMeshTraits.h"
00026
#include "itkPointLocator.h"
00027
#include "itkBoundingBox.h"
00028
#include <vector>
00029
#include <set>
00030
00031
00032
namespace itk
00033 {
00034
00074
template <
00075
typename TPixelType,
00076
unsigned int VDimension = 3,
00077
typename TMeshTraits = DefaultStaticMeshTraits< TPixelType, VDimension, VDimension >
00078 >
00079 class ITK_EXPORT PointSet:
public DataObject
00080 {
00081
public:
00083 typedef PointSet
Self;
00084 typedef DataObject Superclass;
00085 typedef SmartPointer<Self> Pointer;
00086 typedef SmartPointer<const Self> ConstPointer;
00087
00089
itkNewMacro(
Self);
00090
00092
itkTypeMacro(PointSet,
Object);
00093
00095 typedef TMeshTraits
MeshTraits;
00096 typedef typename MeshTraits::PixelType
PixelType;
00097
00099 typedef typename MeshTraits::CoordRepType
CoordRepType;
00100 typedef typename MeshTraits::PointIdentifier
PointIdentifier;
00101 typedef typename MeshTraits::PointType
PointType;
00102 typedef typename MeshTraits::PointsContainer
PointsContainer;
00103 typedef typename MeshTraits::PointDataContainer
PointDataContainer;
00104
00106
itkStaticConstMacro(PointDimension,
unsigned int,
00107 TMeshTraits::PointDimension);
00108
00111
typedef PointLocator<
PointIdentifier,
itkGetStaticConstMacro(PointDimension),
00112 CoordRepType,
PointsContainer>
PointLocatorType;
00113
typedef BoundingBox<
PointIdentifier,
itkGetStaticConstMacro(PointDimension),
00114 CoordRepType,
PointsContainer>
BoundingBoxType;
00115
00117
typedef typename PointsContainer::Pointer
PointsContainerPointer;
00118 typedef typename PointsContainer::ConstPointer
PointsContainerConstPointer;
00119 typedef typename PointDataContainer::Pointer
PointDataContainerPointer;
00120 typedef typename PointDataContainer::ConstPointer
PointDataContainerConstPointer;
00121 typedef typename PointLocatorType::Pointer
PointLocatorPointer;
00122 typedef typename BoundingBoxType::Pointer
BoundingBoxPointer;
00123
00125
typedef typename
00126 PointsContainer::ConstIterator
PointsContainerConstIterator;
00127 typedef typename
00128 PointsContainer::Iterator
PointsContainerIterator;
00129 typedef typename
00130 PointDataContainer::ConstIterator
PointDataContainerIterator;
00131
00133
typedef int RegionType;
00134
00137
int GetMaximumNumberOfRegions()
const
00138 {
return m_MaximumNumberOfRegions;}
00139
00140
protected:
00143 PointsContainerPointer m_PointsContainer;
00144
00149
PointDataContainerPointer m_PointDataContainer;
00150
00153
PointLocatorPointer m_PointLocator;
00154
00157
BoundingBoxPointer m_BoundingBox;
00158
00159
public:
00161
void PassStructure(
Self* inputPointSet);
00162
virtual void Initialize(
void);
00163
unsigned long GetNumberOfPoints(
void) const;
00164
00168
void SetPoints(
PointsContainer*);
00169 PointsContainer * GetPoints(
void);
00170 const PointsContainer * GetPoints(
void) const;
00171
void SetPointData(
PointDataContainer*);
00172 PointDataContainer * GetPointData(
void);
00173 const PointDataContainer * GetPointData(
void) const;
00174
00177
void SetPoint(
PointIdentifier,
PointType);
00178
bool GetPoint(PointIdentifier, PointType*) const;
00179
00182
void SetPointData(PointIdentifier,
PixelType);
00183
bool GetPointData(PointIdentifier, PixelType*) const;
00184
00187 const
BoundingBoxType * GetBoundingBox(
void) const;
00188
00191
bool FindClosestPoint(
CoordRepType coords[PointDimension],
00192 PointIdentifier* pointId);
00193
00195 virtual
void UpdateOutputInformation();
00196 virtual
void SetRequestedRegionToLargestPossibleRegion();
00197 virtual
void CopyInformation(const
DataObject *data);
00198 virtual
bool RequestedRegionIsOutsideOfTheBufferedRegion();
00199 virtual
bool VerifyRequestedRegion();
00200
00205 virtual
void SetRequestedRegion(
DataObject *data);
00206
00208 virtual
void SetRequestedRegion( const
RegionType & region );
00209 itkGetMacro( RequestedRegion,
RegionType );
00210
00212 virtual
void SetBufferedRegion( const RegionType & region );
00213 itkGetMacro( BufferedRegion, RegionType );
00214
00215
00216 protected:
00218 PointSet();
00219 ~PointSet() {}
00220
virtual void PrintSelf(std::ostream& os,
Indent indent)
const;
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
int m_MaximumNumberOfRegions;
00233
int m_NumberOfRegions;
00234
int m_RequestedNumberOfRegions;
00235
RegionType m_BufferedRegion;
00236
RegionType m_RequestedRegion;
00237
00238
private:
00239 PointSet(
const Self&);
00240
void operator=(
const Self&);
00241
00242 };
00243
00244 }
00245
00246
#ifndef ITK_MANUAL_INSTANTIATION
00247
#include "itkPointSet.txx"
00248
#endif
00249
00250
#endif