ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkPointSet.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef __itkPointSet_h
29 #define __itkPointSet_h
30 
31 #include "itkDataObject.h"
33 #include <vector>
34 #include <set>
35 
36 namespace itk
37 {
44 template< typename TPointSet >
46  itkStaticConstMacro(PointDimension, unsigned int, TPointSet::PointDimension);
47 };
48 
96 template<
97  typename TPixelType,
98  unsigned int VDimension = 3,
100  >
101 class ITK_EXPORT PointSet:public DataObject
102 {
103 public:
105  typedef PointSet Self;
109 
111  itkNewMacro(Self);
112 
114  itkTypeMacro(PointSet, Object);
115 
117  typedef TMeshTraits MeshTraits;
119 
126 
128  itkStaticConstMacro(PointDimension, unsigned int,
129  TMeshTraits::PointDimension);
130 
136 
141 
143  typedef long RegionType;
144 
147  itkGetConstMacro(MaximumNumberOfRegions, RegionType);
148 protected:
149 
153 
159 
160 public:
162  void PassStructure(Self *inputPointSet);
163 
164  virtual void Initialize(void);
165 
166  PointIdentifier GetNumberOfPoints(void) const;
167 
171  void SetPoints(PointsContainer *);
172 
173  PointsContainer * GetPoints(void);
174 
175  const PointsContainer * GetPoints(void) const;
176 
177  void SetPointData(PointDataContainer *);
178 
179  PointDataContainer * GetPointData(void);
180 
181  const PointDataContainer * GetPointData(void) const;
182 
185  void SetPoint(PointIdentifier, PointType);
186  bool GetPoint(PointIdentifier, PointType *) const;
187  PointType GetPoint(PointIdentifier) const;
189 
192  void SetPointData(PointIdentifier, PixelType);
193  bool GetPointData(PointIdentifier, PixelType *) const;
195 
197  virtual void UpdateOutputInformation();
198 
199  virtual void SetRequestedRegionToLargestPossibleRegion();
200 
201  virtual void CopyInformation(const DataObject *data);
202 
203  virtual void Graft(const DataObject *data);
204 
205  virtual bool RequestedRegionIsOutsideOfTheBufferedRegion();
206 
207  virtual bool VerifyRequestedRegion();
208 
213  virtual void SetRequestedRegion(const DataObject *data);
214 
216  virtual void SetRequestedRegion(const RegionType & region);
217 
218  itkGetConstMacro(RequestedRegion, RegionType);
219 
221  virtual void SetBufferedRegion(const RegionType & region);
222 
223  itkGetConstMacro(BufferedRegion, RegionType);
224 protected:
226  PointSet();
228  virtual void PrintSelf(std::ostream & os, Indent indent) const;
230 
231  // If the RegionType is ITK_UNSTRUCTURED_REGION, then the following
232  // variables represent the maximum number of region that the data
233  // object can be broken into, which region out of how many is
234  // currently in the buffered region, and the number of regions and
235  // the specific region requested for the update. Data objects that
236  // do not support any division of the data can simply leave the
237  // MaximumNumberOfRegions as 1. The RequestedNumberOfRegions and
238  // RequestedRegion are used to define the currently requested
239  // region. The LargestPossibleRegion is always requested region = 0
240  // and number of regions = 1;
246 private:
247  PointSet(const Self &); //purposely not implemented
248  void operator=(const Self &); //purposely not implemented
249 }; // End Class: PointSet
250 } // end namespace itk
251 
252 // Define instantiation macro for this template.
253 #define ITK_TEMPLATE_PointSet(_, EXPORT, TypeX, TypeY) \
254  namespace itk \
255  { \
256  _( 2 ( class EXPORT PointSet< ITK_TEMPLATE_2 TypeX > ) ) \
257  namespace Templates \
258  { \
259  typedef PointSet< ITK_TEMPLATE_2 TypeX > \
260  PointSet##TypeY; \
261  } \
262  }
263 
264 #if ITK_TEMPLATE_EXPLICIT
265 #include "Templates/itkPointSet+-.h"
266 #endif
267 
268 #if ITK_TEMPLATE_TXX
269 #include "itkPointSet.hxx"
270 #endif
271 
272 /*
273 #ifndef ITK_MANUAL_INSTANTIATION
274 #include "itkPointSet.hxx"
275 #endif
276 */
277 
278 #endif
279