]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.h
...
[cpPlugins.git] / lib / cpExtensions / DataStructures / InfinitePlaneSpatialObject.h
1 #ifndef __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__H__
2 #define __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__H__
3
4 #include <itkSpatialObject.h>
5
6 namespace cpExtensions
7 {
8   namespace DataStructures
9   {
10     /**
11      */
12     template< unsigned int D >
13     class InfinitePlaneSpatialObject
14       : public itk::SpatialObject< D >
15     {
16     public:
17       typedef InfinitePlaneSpatialObject      Self;
18       typedef itk::SpatialObject< D >         Superclass;
19       typedef itk::SmartPointer< Self >       Pointer;
20       typedef itk::SmartPointer< const Self > ConstPointer;
21
22       typedef double                               ScalarType;
23       typedef typename Superclass::PointType       PointType;
24       typedef typename Superclass::TransformType   TransformType;
25       typedef typename Superclass::BoundingBoxType BoundingBoxType;
26       typedef typename PointType::VectorType       VectorType;
27
28       itkStaticConstMacro( NumberOfDimension, unsigned int, D );
29
30     public:
31       itkNewMacro( Self );
32       itkTypeMacro( InfinitePlaneSpatialObject, itk::SpatialObject );
33
34       itkGetConstMacro( Center, PointType );
35       itkGetConstMacro( Normal, VectorType );
36
37     public:
38       template< class P >
39       void SetCenter( const P& p );
40
41       template< class N >
42       void SetNormal( const N& n );
43
44       virtual bool ValueAt(
45         const PointType& point, double& value,
46         unsigned int depth = 0, char* name = NULL
47         ) const;
48
49       virtual bool IsEvaluableAt(
50         const PointType& point,
51         unsigned int depth = 0, char* name = NULL
52         ) const;
53
54       virtual bool IsInside(
55         const PointType& point,
56         unsigned int depth, char* name
57         ) const;
58
59       virtual bool IsInside( const PointType& point ) const;
60
61       virtual bool ComputeLocalBoundingBox( ) const;
62
63     protected:
64       InfinitePlaneSpatialObject( );
65       virtual ~InfinitePlaneSpatialObject( );
66       virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
67
68     private:
69       // Purposely not implemented.
70       InfinitePlaneSpatialObject( const Self& other );
71       Self& operator=( const Self& other );
72
73     protected:
74       PointType  m_Center;
75       VectorType m_Normal;
76     };
77
78   } // ecapseman
79
80 } // ecapseman
81
82 #ifndef ITK_MANUAL_INSTANTIATION
83 #include <cpExtensions/DataStructures/InfinitePlaneSpatialObject.hxx>
84 #endif // ITK_MANUAL_INSTANTIATION
85
86 #endif // __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__H__
87
88 // eof - $RCSfile$