ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkLineSpatialObject.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 itkLineSpatialObject_h
19 #define itkLineSpatialObject_h
20 
21 #include <list>
22 
25 
26 namespace itk
27 {
42 template< unsigned int TDimension = 3 >
44  public PointBasedSpatialObject< TDimension >
45 {
46 public:
47 
52  typedef double ScalarType;
54  typedef std::vector< LinePointType > PointListType;
57  typedef typename Superclass::PointType PointType;
62 
64  itkNewMacro(Self);
65 
68 
70  PointListType & GetPoints(void) { return m_Points; }
71  ConstPointListType & GetPoints(void) const { return m_Points; }
73 
75  void SetPoints(PointListType & newPoints);
76 
78  const SpatialObjectPointType * GetPoint(IdentifierType id) const ITK_OVERRIDE
79  {
80  return &( m_Points[id] );
81  }
82 
84  SpatialObjectPointType * GetPoint(IdentifierType id) ITK_OVERRIDE { return &( m_Points[id] ); }
85 
87  SizeValueType GetNumberOfPoints(void) const ITK_OVERRIDE { return m_Points.size(); }
88 
91  bool IsEvaluableAt(const PointType & point,
92  unsigned int depth = 0, char *name = ITK_NULLPTR) const ITK_OVERRIDE;
93 
98  bool ValueAt(const PointType & point, double & value,
99  unsigned int depth = 0, char *name = ITK_NULLPTR) const ITK_OVERRIDE;
100 
102  bool IsInside(const PointType & point,
103  unsigned int depth, char *name) const ITK_OVERRIDE;
104 
108  virtual bool IsInside(const PointType & point) const;
109 
111  bool ComputeLocalBoundingBox() const ITK_OVERRIDE;
112 
113 protected:
114  LineSpatialObject(const Self &); //purposely not implemented
115  void operator=(const Self &); //purposely not implemented
116 
118 
120  virtual ~LineSpatialObject();
121 
123  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
124 };
125 } // end namespace itk
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "itkLineSpatialObject.hxx"
129 #endif
130 
131 #endif // itkLineSpatialObject_h
void SetPoints(PointListType &newPoints)
bool ValueAt(const PointType &point, double &value, unsigned int depth=0, char *name=nullptr) const override
SizeValueType GetNumberOfPoints(void) const override
BoundingBox< IdentifierType, VDimension, ScalarType, VectorContainerType > BoundingBoxType
bool IsInside(const PointType &point, unsigned int depth, char *name) const override
PointBasedSpatialObject< TDimension > Superclass
bool ComputeLocalBoundingBox() const override
Superclass::TransformType TransformType
SpatialObjectPointType * GetPoint(IdentifierType id) override
This class serves as the base class for point-based spatial objects.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
Superclass::SpatialObjectPointType SpatialObjectPointType
SmartPointer< const Self > ConstPointer
Superclass::BoundingBoxType BoundingBoxType
const SpatialObjectPointType * GetPoint(IdentifierType id) const override
SmartPointer< Self > Pointer
Point used for a line definition.
PointListType & GetPoints(void)
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
Superclass::PointType PointType
bool IsEvaluableAt(const PointType &point, unsigned int depth=0, char *name=nullptr) const override
ConstPointListType & GetPoints(void) const
Representation of a Line based on the spatial object classes.
VectorContainer< IdentifierType, PointType > PointContainerType
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
std::vector< LinePointType > PointListType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SmartPointer< PointContainerType > PointContainerPointer
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Base class for all data objects in ITK.
SpatialObjectPoint< TDimension > SpatialObjectPointType
const PointListType ConstPointListType
Superclass::TransformType TransformType
LineSpatialObjectPoint< TDimension > LinePointType