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

itkArrowSpatialObject.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkArrowSpatialObject.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/01/21 17:59:18 $
00007   Version:   $Revision: 1.2 $
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 #ifndef __itkArrowSpatialObject_h
00018 #define __itkArrowSpatialObject_h
00019 
00020 #if defined(_MSC_VER)
00021 #pragma warning ( disable : 4786 )
00022 #endif
00023 
00024 #include "itkSpatialObject.h"
00025 
00026 namespace itk 
00027 {
00028 
00039 template < unsigned int TDimension = 3 >
00040 class ArrowSpatialObject 
00041   :public SpatialObject< TDimension >
00042 {
00043 
00044 public:
00045 
00046   typedef ArrowSpatialObject                     Self;
00047   typedef SpatialObject< TDimension >            Superclass;
00048   typedef SmartPointer < Self >                  Pointer;
00049   typedef SmartPointer < const Self >            ConstPointer;
00050   typedef double                                 ScalarType;
00051   typedef Vector<double,TDimension>              VectorType;
00052   typedef Point<double,TDimension>               PointType;
00053   typedef typename Superclass::TransformType     TransformType;
00054   typedef typename TransformType::MatrixType     MatrixType;
00055 
00056 
00058   itkNewMacro( Self );
00059 
00061   itkTypeMacro( ArrowSpatialObject, SpatialObject );
00062 
00063 
00065   void SetPosition(const PointType & p)
00066     {
00067     m_Position = p;
00068     this->UpdateTransform();
00069     }
00070 
00071   itkGetConstMacro(Position,PointType);
00072 
00073   void SetPosition(float x, float y)
00074     {
00075     m_Position[0] = x;
00076     m_Position[1] = y;
00077     this->UpdateTransform();
00078     }
00079 
00080   void SetPosition(float x, float y,float z)
00081     {
00082     m_Position[0] = x;
00083     m_Position[1] = y;
00084     m_Position[2] = z;
00085     this->UpdateTransform();
00086     }
00087 
00089   void SetDirection(const VectorType & d)
00090     {
00091     m_Direction = d;
00092     this->UpdateTransform();
00093     }
00094   
00095   itkGetConstMacro(Direction,VectorType);
00096   
00097   void SetDirection(float x, float y)
00098     {
00099     m_Direction[0] = x;
00100     m_Direction[1] = y;
00101     this->UpdateTransform();
00102     }
00103 
00104   void SetDirection(float x, float y,float z)
00105     {
00106     m_Direction[0] = x;
00107     m_Direction[1] = y;
00108     m_Direction[2] = z;
00109     this->UpdateTransform();
00110     }
00111 
00113   void SetLenght(double lenght);
00114 
00116   itkGetMacro(Lenght,double);
00117 
00119   bool ComputeLocalBoundingBox() const;
00120 
00122   bool IsInside( const PointType & point, 
00123                  unsigned int depth, char * name) const;
00124 
00128   virtual bool IsInside( const PointType & point) const;
00129 
00130 
00131 protected:
00132 
00133   ArrowSpatialObject();
00134   virtual ~ArrowSpatialObject();
00135 
00137   void UpdateTransform();
00138 
00140   virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00141 
00142 private:
00143 
00144   VectorType   m_Direction;
00145   PointType    m_Position;
00146   double       m_Lenght;
00147 
00148 };
00149 
00150 } // end namespace itk
00151 
00152 #ifndef ITK_MANUAL_INSTANTIATION 
00153 #include "itkArrowSpatialObject.txx" 
00154 #endif 
00155 
00156 #endif // __itkArrowSpatialObject_h

Generated at Tue Mar 29 23:46:30 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000