ITK  6.0.0
Insight Toolkit
itkPointSetBase.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 itkPointSetBase_h
29#define itkPointSetBase_h
30
31#include "itkDataObject.h"
32#include "itkVectorContainer.h"
33#include <vector>
34
35namespace itk
36{
37
55template <typename TPointsContainer>
56class ITK_TEMPLATE_EXPORT PointSetBase : public DataObject
57{
58public:
59 ITK_DISALLOW_COPY_AND_MOVE(PointSetBase);
60
66
68 itkOverrideGetNameOfClassMacro(PointSetBase);
69
71 using PointType = typename TPointsContainer::Element;
72 using CoordRepType = typename PointType::CoordRepType;
73 using PointIdentifier = typename TPointsContainer::ElementIdentifier;
74 using PointsContainer = TPointsContainer;
75
79
81 static constexpr unsigned int PointDimension = PointType::PointDimension;
82
86
88 using PointsContainerConstIterator = typename PointsContainer::ConstIterator;
89 using PointsContainerIterator = typename PointsContainer::Iterator;
90
92 using RegionType = long;
93
96 itkGetConstMacro(MaximumNumberOfRegions, RegionType);
97
98protected:
101 PointsContainerPointer m_PointsContainer{};
102
103public:
107 void
108 PassStructure(Self * inputPointSet);
109
113 void
114 Initialize() override;
115
119
121 void
123
126 void
128
130 void
131 SetPointsByCoordinates(const std::vector<CoordRepType> & coordinates);
132
136
138 const PointsContainer *
139 GetPoints() const;
140
145
152 bool
154
157
159 void
161
162 void
164
165 void
166 CopyInformation(const DataObject * data) override;
167
168 bool
170
171 bool
173
178 void
179 SetRequestedRegion(const DataObject * data) override;
180
182 virtual void
184
185 itkGetConstMacro(RequestedRegion, RegionType);
186
188 virtual void
190
191 itkGetConstMacro(BufferedRegion, RegionType);
192
193protected:
195 PointSetBase() = default;
196
198 ~PointSetBase() override = 0;
199
200 void
201 PrintSelf(std::ostream & os, Indent indent) const override;
202
203 // If the RegionType is ITK_UNSTRUCTURED_REGION, then the following
204 // variables represent the maximum number of region that the data
205 // object can be broken into, which region out of how many is
206 // currently in the buffered region, and the number of regions and
207 // the specific region requested for the update. Data objects that
208 // do not support any division of the data can simply leave the
209 // MaximumNumberOfRegions as 1. The RequestedNumberOfRegions and
210 // RequestedRegion are used to define the currently requested
211 // region. The LargestPossibleRegion is always requested region = 0
212 // and number of regions = 1;
213 RegionType m_MaximumNumberOfRegions{ 1 };
214 RegionType m_NumberOfRegions{ 1 };
215 RegionType m_RequestedNumberOfRegions{};
216 RegionType m_BufferedRegion{ -1 };
217 RegionType m_RequestedRegion{ -1 };
218};
219} // end namespace itk
220
221#ifndef ITK_MANUAL_INSTANTIATION
222# include "itkPointSetBase.hxx"
223#endif
224
225#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 PointSet supports point (geometric coordinate and attribute) definition.
virtual void SetBufferedRegion(const RegionType &region)
void SetRequestedRegionToLargestPossibleRegion() override
void Initialize() override
void SetPoints(PointsVectorContainer *)
void CopyInformation(const DataObject *data) override
void SetPointsByCoordinates(const std::vector< CoordRepType > &coordinates)
typename PointsVectorContainer::Pointer PointsVectorContainerPointer
typename PointsContainer::Iterator PointsContainerIterator
typename PointsContainer::ConstIterator PointsContainerConstIterator
void UpdateOutputInformation() override
typename itk::VectorContainer< PointIdentifier, CoordRepType > PointsVectorContainer
void SetRequestedRegion(const DataObject *data) override
typename TPointsContainer::ElementIdentifier PointIdentifier
typename PointsContainer::Pointer PointsContainerPointer
typename TPointsContainer::Element PointType
TPointsContainer PointsContainer
bool GetPoint(PointIdentifier, PointType *) const
virtual void SetRequestedRegion(const RegionType &region)
const PointsContainer * GetPoints() const
PointSetBase()=default
bool VerifyRequestedRegion() override
PointsContainer * GetPoints()
void PrintSelf(std::ostream &os, Indent indent) const override
PointIdentifier GetNumberOfPoints() const
void SetPoint(PointIdentifier, PointType)
void SetPoints(PointsContainer *)
~PointSetBase() override=0
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
void PassStructure(Self *inputPointSet)
typename PointType::CoordRepType CoordRepType
PointType GetPoint(PointIdentifier) const
typename PointsContainer::ConstPointer PointsContainerConstPointer
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