ITK  6.0.0
Insight Toolkit
itkPointSet.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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
36namespace itk
37{
38
79template <typename TPixelType,
80 unsigned int VDimension = 3,
81 typename TMeshTraits = DefaultStaticMeshTraits<TPixelType, VDimension, VDimension>>
82class ITK_TEMPLATE_EXPORT PointSet : public DataObject
83{
84public:
85 ITK_DISALLOW_COPY_AND_MOVE(PointSet);
86
88 using Self = PointSet;
92
94 itkNewMacro(Self);
95
97 itkOverrideGetNameOfClassMacro(PointSet);
98
100 using MeshTraits = TMeshTraits;
101 using PixelType = typename MeshTraits::PixelType;
102
104 using CoordRepType = typename MeshTraits::CoordRepType;
105 using PointIdentifier = typename MeshTraits::PointIdentifier;
107 using PointsContainer = typename MeshTraits::PointsContainer;
108 using PointDataContainer = typename MeshTraits::PointDataContainer;
109
113
115 static constexpr unsigned int PointDimension = TMeshTraits::PointDimension;
116
122
124 using PointsContainerConstIterator = typename PointsContainer::ConstIterator;
125 using PointsContainerIterator = typename PointsContainer::Iterator;
126 using PointDataContainerIterator = typename PointDataContainer::ConstIterator;
127
129 using RegionType = long;
130
133 itkGetConstMacro(MaximumNumberOfRegions, RegionType);
134
135protected:
138 PointsContainerPointer m_PointsContainer{};
139
144 PointDataContainerPointer m_PointDataContainer{};
145
146public:
150 void
151 PassStructure(Self * inputPointSet);
152
156 void
157 Initialize() override;
158
162
164 void
166
168 void
170
174
176 const PointsContainer *
177 GetPoints() const;
178
180 void
182
186
188 const PointDataContainer *
190
195
202 bool
204
207
213
220 bool
222
224 void
226
227 void
229
230 void
231 CopyInformation(const DataObject * data) override;
232
233 void
234 Graft(const DataObject * data) override;
235
236 bool
238
239 bool
241
246 void
247 SetRequestedRegion(const DataObject * data) override;
248
250 virtual void
252
253 itkGetConstMacro(RequestedRegion, RegionType);
254
256 virtual void
258
259 itkGetConstMacro(BufferedRegion, RegionType);
260
261protected:
263 PointSet() = default;
264 ~PointSet() override = default;
265 void
266 PrintSelf(std::ostream & os, Indent indent) const override;
269 // If the RegionType is ITK_UNSTRUCTURED_REGION, then the following
270 // variables represent the maximum number of region that the data
271 // object can be broken into, which region out of how many is
272 // currently in the buffered region, and the number of regions and
273 // the specific region requested for the update. Data objects that
274 // do not support any division of the data can simply leave the
275 // MaximumNumberOfRegions as 1. The RequestedNumberOfRegions and
276 // RequestedRegion are used to define the currently requested
277 // region. The LargestPossibleRegion is always requested region = 0
278 // and number of regions = 1;
279 RegionType m_MaximumNumberOfRegions{ 1 };
280 RegionType m_NumberOfRegions{ 1 };
281 RegionType m_RequestedNumberOfRegions{};
282 RegionType m_BufferedRegion{ -1 };
283 RegionType m_RequestedRegion{ -1 };
284}; // End Class: PointSet
285} // end namespace itk
286
287#ifndef ITK_MANUAL_INSTANTIATION
288# include "itkPointSet.hxx"
289#endif
290
291#endif
Base class for all data objects in ITK.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Base class for most ITK classes.
Definition: itkObject.h:62
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Definition: itkPointSet.h:83
PointType GetPoint(PointIdentifier) const
typename PointDataContainer::ConstIterator PointDataContainerIterator
Definition: itkPointSet.h:126
bool GetPointData(PointIdentifier, PixelType *) const
PointIdentifier GetNumberOfPoints() const
PointsContainer * GetPoints()
PointSet()=default
typename PointsContainer::Iterator PointsContainerIterator
Definition: itkPointSet.h:125
void CopyInformation(const DataObject *data) override
void Graft(const DataObject *data) override
void SetRequestedRegion(const DataObject *data) override
void Initialize() override
TMeshTraits MeshTraits
Definition: itkPointSet.h:100
void PassStructure(Self *inputPointSet)
typename PointsVectorContainer::Pointer PointsVectorContainerPointer
Definition: itkPointSet.h:112
const PointsContainer * GetPoints() const
typename PointsContainer::ConstPointer PointsContainerConstPointer
Definition: itkPointSet.h:119
typename PointsContainer::Pointer PointsContainerPointer
Definition: itkPointSet.h:118
typename PointDataContainer::ConstPointer PointDataContainerConstPointer
Definition: itkPointSet.h:121
~PointSet() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
bool GetPoint(PointIdentifier, PointType *) const
void SetPoints(PointsContainer *)
void UpdateOutputInformation() override
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
typename PointsContainer::ConstIterator PointsContainerConstIterator
Definition: itkPointSet.h:124
void SetPointData(PointDataContainer *)
virtual void SetBufferedRegion(const RegionType &region)
typename MeshTraits::PointsContainer PointsContainer
Definition: itkPointSet.h:107
const PointDataContainer * GetPointData() const
typename MeshTraits::PointIdentifier PointIdentifier
Definition: itkPointSet.h:105
typename MeshTraits::CoordRepType CoordRepType
Definition: itkPointSet.h:104
typename MeshTraits::PixelType PixelType
Definition: itkPointSet.h:101
virtual void SetRequestedRegion(const RegionType &region)
bool VerifyRequestedRegion() override
typename MeshTraits::PointType PointType
Definition: itkPointSet.h:106
void SetPoint(PointIdentifier, PointType)
PointDataContainer * GetPointData()
typename MeshTraits::PointDataContainer PointDataContainer
Definition: itkPointSet.h:108
void SetPointData(PointIdentifier, PixelType)
void SetRequestedRegionToLargestPossibleRegion() override
typename PointDataContainer::Pointer PointDataContainerPointer
Definition: itkPointSet.h:120
void SetPoints(PointsVectorContainer *)
typename itk::VectorContainer< PointIdentifier, CoordRepType > PointsVectorContainer
Definition: itkPointSet.h:111
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT DataObject
Definition: itkDataObject.h:42