ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkBoxSpatialObject.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkBoxSpatialObject_h
00019 #define __itkBoxSpatialObject_h
00020 
00021 #include "itkSpatialObject.h"
00022 #include "itkAffineTransform.h"
00023 #include "itkFixedArray.h"
00024 
00025 namespace itk
00026 {
00035 template< unsigned int TDimension = 3 >
00036 class ITK_EXPORT BoxSpatialObject:
00037   public SpatialObject< TDimension >
00038 {
00039 public:
00040 
00041   typedef BoxSpatialObject                             Self;
00042   typedef double                                       ScalarType;
00043   typedef SmartPointer< Self >                         Pointer;
00044   typedef SmartPointer< const Self >                   ConstPointer;
00045   typedef SpatialObject< TDimension >                  Superclass;
00046   typedef SmartPointer< Superclass >                   SuperclassPointer;
00047   typedef typename Superclass::PointType               PointType;
00048   typedef typename Superclass::TransformType           TransformType;
00049   typedef typename Superclass::BoundingBoxType         BoundingBoxType;
00050   typedef FixedArray< double, TDimension >             SizeType;
00051   typedef VectorContainer< IdentifierType, PointType > PointContainerType;
00052 
00053   itkNewMacro(Self);
00054   itkTypeMacro(BoxSpatialObject, SpatialObject);
00055 
00057   itkSetMacro(Size, SizeType);
00058   itkGetConstReferenceMacro(Size, SizeType);
00060 
00063   virtual bool ValueAt(const PointType & point, double & value,
00064                        unsigned int depth = 0,
00065                        char *name = NULL) const;
00066 
00069   virtual bool IsEvaluableAt(const PointType & point,
00070                              unsigned int depth = 0,
00071                              char *name = NULL) const;
00072 
00074   virtual bool IsInside(const PointType & point,
00075                         unsigned int depth,
00076                         char *) const;
00077 
00081   virtual bool IsInside(const PointType & point) const;
00082 
00086   virtual bool ComputeLocalBoundingBox() const;
00087 
00088 protected:
00089   BoxSpatialObject(const Self &); //purposely not implemented
00090   void operator=(const Self &);   //purposely not implemented
00091 
00092   BoxSpatialObject(void);
00093   ~BoxSpatialObject(void);
00094 
00095   SizeType m_Size;
00096 
00098   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00099 };
00100 } // end namespace itk
00101 
00102 #ifndef ITK_MANUAL_INSTANTIATION
00103 #include "itkBoxSpatialObject.hxx"
00104 #endif
00105 
00106 #endif // __itkBoxSpatialObject_h
00107