ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkPointBasedSpatialObject.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 #ifndef itkPointBasedSpatialObject_h
19 #define itkPointBasedSpatialObject_h
20 
21 #include "itkSpatialObject.h"
22 #include "itkSpatialObjectPoint.h"
23 
24 namespace itk
25 {
36 template< unsigned int TDimension = 3 >
37 class ITK_TEMPLATE_EXPORT PointBasedSpatialObject:
38  public SpatialObject< TDimension >
39 {
40 public:
41 
46  typedef double ScalarType;
48  typedef typename Superclass::PointType PointType;
49  typedef typename Superclass::TransformType TransformType;
51  typedef typename Superclass::CovariantVectorType CovariantVectorType;
52 
54  itkNewMacro(Self);
55 
58 
60  virtual const SpatialObjectPointType *
61  GetPoint( IdentifierType itkNotUsed(id) ) const
62  {
63  itkWarningMacro(<< "PointBasedSpatialObject::GetPoint() is not implemented"
64  << " in the base class" << std::endl);
65  return ITK_NULLPTR;
66  }
68 
69  virtual SpatialObjectPointType *
70  GetPoint( IdentifierType itkNotUsed(id) )
71  {
72  itkWarningMacro(<< "PointBasedSpatialObject::GetPoint() is not implemented"
73  << " in the base class" << std::endl);
74  return ITK_NULLPTR;
75  }
76 
78  virtual SizeValueType GetNumberOfPoints(void) const
79  {
80  itkWarningMacro(<< "PointBasedSpatialObject::GetNumberOfPoints() is not"
81  << " implemented in the base class" << std::endl);
82  return 0;
83  }
85 
87  bool ComputeLocalBoundingBox() const ITK_OVERRIDE
88  {
89  itkWarningMacro(<< "PointBasedSpatialObject::ComputeLocalBoundingBox() is"
90  << " not implemented in the base class" << std::endl);
91  return false;
92  }
94 
95 protected:
96  ITK_DISALLOW_COPY_AND_ASSIGN(PointBasedSpatialObject);
97 
99  virtual ~PointBasedSpatialObject() ITK_OVERRIDE;
100 
102  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
103 };
104 } // end namespace itk
105 
106 #ifndef ITK_MANUAL_INSTANTIATION
107 #include "itkPointBasedSpatialObject.hxx"
108 #endif
109 
110 #endif // itkPointBasedSpatialObject_h
Superclass::CovariantVectorType CovariantVectorType
virtual const SpatialObjectPointType * GetPoint(IdentifierType) const
SmartPointer< const Self > ConstPointer
Superclass::TransformType TransformType
This class serves as the base class for point-based spatial objects.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
Implementation of the composite pattern.
virtual SizeValueType GetNumberOfPoints(void) const
Point used for spatial objets.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SpatialObject< TDimension > Superclass
bool ComputeLocalBoundingBox() const override
Base class for all data objects in ITK.
SpatialObjectPoint< TDimension > SpatialObjectPointType