ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkBoundingBox.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 /*=========================================================================
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 __itkBoundingBox_h
29 #define __itkBoundingBox_h
30 
31 #include "itkPoint.h"
32 #include "itkVectorContainer.h"
33 #include "itkIntTypes.h"
34 
35 namespace itk
36 {
70 template<
71  typename TPointIdentifier = IdentifierType,
72  int VPointDimension = 3,
73  typename TCoordRep = float,
74  typename TPointsContainer =
75  VectorContainer< TPointIdentifier, Point< TCoordRep, VPointDimension > >
76  >
77 class BoundingBox:public Object
78 {
79 public:
81  typedef BoundingBox Self;
82  typedef Object Superclass;
85 
87  itkTypeMacro(BoundingBox, Object);
88 
90  itkNewMacro(Self);
91 
93  typedef TPointIdentifier PointIdentifier;
94  typedef TCoordRep CoordRepType;
95  typedef TPointsContainer PointsContainer;
96  typedef typename PointsContainer::Pointer PointsContainerPointer;
97  typedef typename PointsContainer::ConstPointer PointsContainerConstPointer;
98 
101 
103  itkStaticConstMacro(PointDimension, unsigned int, VPointDimension);
104 
106  typedef typename PointsContainer::ConstIterator PointsContainerConstIterator;
107  typedef typename PointsContainer::Iterator PointsContainerIterator;
108 
112  void SetPoints(const PointsContainer *);
113 
114  const PointsContainer * GetPoints(void) const;
115 
117  const PointsContainer * GetCorners(void);
118 
120  bool ComputeBoundingBox(void) const;
121 
127  itkGetConstReferenceMacro(Bounds, BoundsArrayType);
128 
131  PointType GetCenter(void) const;
132 
135  PointType GetMinimum(void) const;
136 
140  void SetMinimum(const PointType &);
141 
144  PointType GetMaximum(void) const;
145 
149  void SetMaximum(const PointType &);
150 
155  void ConsiderPoint(const PointType &);
156 
162 
164  bool IsInside(const PointType &) const;
165 
167  virtual ModifiedTimeType GetMTime(void) const ITK_OVERRIDE;
168 
170  Pointer DeepCopy() const;
171 
172 protected:
173  BoundingBox();
174  virtual ~BoundingBox();
175  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
176 
178 
179 private:
180  BoundingBox(const Self &); //purposely not implemented
181  void operator=(const Self &); //purposely not implemented
182 
186  mutable TimeStamp m_BoundsMTime; // The last time the bounds
187  // were computed.
188 };
189 } // end namespace itk
190 
191 #ifndef ITK_MANUAL_INSTANTIATION
192 #include "itkBoundingBox.hxx"
193 #endif
194 
195 #endif
Pointer DeepCopy() const
Point< CoordRepType, VPointDimension > PointType
BoundsArrayType m_Bounds
TPointsContainer PointsContainer
PointsContainerPointer m_CornersContainer
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
PointType GetMaximum(void) const
AccumulateType GetDiagonalLength2(void) const
bool ComputeBoundingBox(void) const
PointsContainer::ConstPointer PointsContainerConstPointer
FixedArray< CoordRepType, VPointDimension *2 > BoundsArrayType
TPointIdentifier PointIdentifier
PointsContainer::ConstIterator PointsContainerConstIterator
PointsContainer::ConstIterator ConstIterator
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
const PointsContainer * GetPoints(void) const
virtual ModifiedTimeType GetMTime(void) const ITK_OVERRIDE
void SetPoints(const PointsContainer *)
PointType GetMinimum(void) const
PointsContainer::Iterator PointsContainerIterator
PointType GetCenter(void) const
PointsContainerConstPointer m_PointsContainer
BoundingBox Self
Generate a unique, increasing time value.
Definition: itkTimeStamp.h:58
void SetMaximum(const PointType &)
void SetMinimum(const PointType &)
SmartPointer< const Self > ConstPointer
TimeStamp m_BoundsMTime
TCoordRep CoordRepType
SmartPointer< Self > Pointer
NumericTraits< CoordRepType >::AccumulateType AccumulateType
const PointsContainer * GetCorners(void)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
static const unsigned int PointDimension
PointsContainer::Pointer PointsContainerPointer
Base class for most ITK classes.
Definition: itkObject.h:57
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:51
bool IsInside(const PointType &) const
Represent and compute information about bounding boxes.
void ConsiderPoint(const PointType &)