ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkBoxSpatialObject.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 itkBoxSpatialObject_h
19 #define itkBoxSpatialObject_h
20 
21 #include "itkSpatialObject.h"
22 #include "itkAffineTransform.h"
23 #include "itkFixedArray.h"
24 
25 namespace itk
26 {
35 template< unsigned int TDimension = 3 >
36 class ITK_TEMPLATE_EXPORT BoxSpatialObject:
37  public SpatialObject< TDimension >
38 {
39 public:
40 
42  typedef double ScalarType;
47  typedef typename Superclass::PointType PointType;
48  typedef typename Superclass::TransformType TransformType;
49  typedef typename Superclass::BoundingBoxType BoundingBoxType;
52 
53  itkNewMacro(Self);
54  itkTypeMacro(BoxSpatialObject, SpatialObject);
55 
57  itkSetMacro(Size, SizeType);
58  itkGetConstReferenceMacro(Size, SizeType);
60 
63  virtual bool ValueAt(const PointType & point, double & value,
64  unsigned int depth = 0,
65  char *name = ITK_NULLPTR) const ITK_OVERRIDE;
66 
69  virtual bool IsEvaluableAt(const PointType & point,
70  unsigned int depth = 0,
71  char *name = ITK_NULLPTR) const ITK_OVERRIDE;
72 
74  virtual bool IsInside(const PointType & point,
75  unsigned int depth,
76  char *) const ITK_OVERRIDE;
77 
81  virtual bool IsInside(const PointType & point) const;
82 
86  virtual bool ComputeLocalBoundingBox() const ITK_OVERRIDE;
87 
88 protected:
89  ITK_DISALLOW_COPY_AND_ASSIGN(BoxSpatialObject);
90 
91  BoxSpatialObject();
92  ~BoxSpatialObject() ITK_OVERRIDE;
93 
94  SizeType m_Size;
95 
97  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
98 };
99 } // end namespace itk
100 
101 #ifndef ITK_MANUAL_INSTANTIATION
102 #include "itkBoxSpatialObject.hxx"
103 #endif
104 
105 #endif // itkBoxSpatialObject_h
VectorContainer< IdentifierType, PointType > PointContainerType
The class may be used to represent N-dimensional boxes. In two dimensions it is a rectangle...
Represent the size (bounds) of a n-dimensional image.
Definition: itkSize.h:52
FixedArray< double, TDimension > SizeType
SmartPointer< const Self > ConstPointer
Implementation of the composite pattern.
Superclass::TransformType TransformType
Superclass::BoundingBoxType BoundingBoxType
SpatialObject< TDimension > Superclass
SmartPointer< Self > Pointer
Superclass::PointType PointType
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for all data objects in ITK.
SmartPointer< Superclass > SuperclassPointer