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