]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/DataObjects/BoundingBox.h
3d112728801128bc3e1e3308353761417bc21185
[cpPlugins.git] / lib / cpPlugins / DataObjects / BoundingBox.h
1 #ifndef __cpPlugins__DataObjects__BoundingBox__h__
2 #define __cpPlugins__DataObjects__BoundingBox__h__
3
4 #include <vector>
5 #include <cpPlugins/BaseObjects/DataObject.h>
6 #include <vtkOutlineSource.h>
7 #include <vtkSmartPointer.h>
8
9 namespace cpPlugins
10 {
11   namespace DataObjects
12   {
13     /**
14      */
15     class cpPlugins_EXPORT BoundingBox
16       : public cpPlugins::BaseObjects::DataObject
17     {
18     public:
19       typedef BoundingBox                        Self;
20       typedef cpPlugins::BaseObjects::DataObject Superclass;
21       typedef itk::SmartPointer< Self >          Pointer;
22       typedef itk::SmartPointer< const Self >    ConstPointer;
23
24     public:
25       itkNewMacro( Self );
26       itkTypeMacro( BoundingBox, DataObject );
27       cpPlugins_Id_Macro( BoundingBox, Object );
28       cpPlugins_Compatibility_Macro;
29
30     public:
31       void SetDataObject( DataObject* o );
32       virtual void SetITK( itk::LightObject* o ) cpPlugins_OVERRIDE;
33       virtual void SetVTK( vtkObjectBase* o ) cpPlugins_OVERRIDE;
34
35       void Copy( Self* other );
36       void Blend( Self* other );
37
38       template< class _TPoint >
39         inline void SetMinimum( const _TPoint& p );
40
41       template< class _TPoint >
42         inline void SetMaximum( const _TPoint& p );
43
44       template< class _TPoint >
45         inline _TPoint GetMinimum( ) const;
46
47       template< class _TPoint >
48         inline _TPoint GetMaximum( ) const;
49
50     protected:
51       BoundingBox( );
52       virtual ~BoundingBox( );
53
54       void _UpdateVTK( );
55
56       template< class _TPoint >
57         inline void _SetPoint( unsigned int m, const _TPoint& p );
58
59       template< class _TPoint >
60         inline _TPoint _GetPoint( unsigned int m ) const;
61
62       template< unsigned int _NDim >
63         inline bool _ITKImage( itk::LightObject* o );
64
65       template< class _TScalar, unsigned int _NDim >
66         inline bool _ITKPointSet( itk::LightObject* o );
67
68     private:
69       // Purposely not implemented
70       BoundingBox( const Self& );
71       Self& operator=( const Self& );
72
73     protected:
74       std::vector< double > m_Points[ 2 ];
75       vtkSmartPointer< vtkOutlineSource > m_Outline;
76     };
77
78   } // ecapseman
79
80 } // ecapseman
81
82 #include <cpPlugins/DataObjects/BoundingBox.hxx>
83
84 #endif // __cpPlugins__DataObjects__BoundingBox__h__
85
86 // eof - $RCSfile$