Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkTubeSpatialObject.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkTubeSpatialObject.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/01/21 17:59:18 $
00007   Version:   $Revision: 1.38 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkTubeSpatialObject_h
00019 #define __itkTubeSpatialObject_h
00020 
00021 #include <list>
00022 
00023 #include "itkPointBasedSpatialObject.h"
00024 #include "itkTubeSpatialObjectPoint.h"
00025 
00026 namespace itk 
00027 {
00028 
00041 template < unsigned int TDimension = 3, 
00042 typename TTubePointType = TubeSpatialObjectPoint<TDimension>
00043 >
00044 class TubeSpatialObject 
00045   :public PointBasedSpatialObject< TDimension >
00046 {
00047 
00048 public:
00049 
00050   typedef TubeSpatialObject                            Self;
00051   typedef PointBasedSpatialObject< TDimension >        Superclass;
00052   typedef SmartPointer < Self >                        Pointer;
00053   typedef SmartPointer < const Self >                  ConstPointer;
00054   typedef double                                       ScalarType;
00055   typedef TTubePointType                               TubePointType;
00056   typedef std::vector< TubePointType >                 PointListType;
00057   typedef PointListType *                              PointListPointer;
00058   typedef typename Superclass::PointType               PointType;
00059   typedef typename Superclass::TransformType           TransformType;
00060   typedef typename Superclass::SpatialObjectPointType  SpatialObjectPointType;
00061   typedef VectorContainer<unsigned long,PointType>     PointContainerType;
00062   typedef SmartPointer<PointContainerType>             PointContainerPointer;
00063   typedef typename Superclass::VectorType              VectorType;
00064   typedef typename Superclass::CovariantVectorType     CovariantVectorType;
00065   typedef typename Superclass::BoundingBoxType         BoundingBoxType;
00066 
00068   itkNewMacro( Self );
00069 
00071   itkTypeMacro( TubeSpatialObject, PointBasedSpatialObject );
00072     
00074   virtual PointListType & GetPoints( void );
00075 
00077   virtual const PointListType & GetPoints( void ) const;
00078 
00080   virtual void SetPoints( PointListType & newPoints );
00081 
00083   virtual const SpatialObjectPointType* GetPoint(unsigned long id) const {return &(m_Points[id]);}
00084   
00086   virtual unsigned long GetNumberOfPoints(void) const {return m_Points.size();}
00087 
00089   itkSetMacro(EndType,unsigned int);
00090   itkGetMacro(EndType,unsigned int);
00091 
00093   void Clear( void );
00094 
00096   bool ComputeTangentAndNormals( void );
00097 
00099   unsigned int RemoveDuplicatePoints(unsigned int step=1);
00100 
00103   bool IsEvaluableAt( const PointType & point,
00104                       unsigned int depth=0, char * name=NULL ) const;
00105 
00110   bool ValueAt( const PointType & point, double & value,
00111                 unsigned int depth=0, char * name=NULL ) const;
00112 
00114   bool IsInside( const PointType & point, 
00115                  unsigned int depth, char * name) const;
00116 
00120   virtual bool IsInside( const PointType & point) const;
00121 
00123   bool ComputeLocalBoundingBox( ) const;
00124 
00127   itkSetMacro(ParentPoint,int);
00128   itkGetMacro(ParentPoint,int);
00129 
00130 protected:
00131 
00132   PointListType     m_Points;
00133   int               m_ParentPoint;
00134   unsigned int      m_EndType;
00135 
00136   TubeSpatialObject();
00137   virtual ~TubeSpatialObject();
00138 
00140   virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00141   
00143   mutable unsigned long m_OldMTime;
00144   mutable unsigned long m_IndexToWorldTransformMTime;
00145   
00146 };
00147 
00148 } // end namespace itk
00149 
00150 #ifndef ITK_MANUAL_INSTANTIATION 
00151 #include "itkTubeSpatialObject.txx" 
00152 #endif 
00153 
00154 #endif // __itkTubeSpatialObject_h

Generated at Wed Mar 30 00:13:16 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000