1 #ifndef __cpPlugins__DataObjects__BoundingBox__h__
2 #define __cpPlugins__DataObjects__BoundingBox__h__
5 #include <cpPlugins/BaseObjects/DataObject.h>
6 #include <vtkOutlineSource.h>
7 #include <vtkSmartPointer.h>
15 class cpPlugins_EXPORT BoundingBox
16 : public cpPlugins::BaseObjects::DataObject
19 typedef BoundingBox Self;
20 typedef cpPlugins::BaseObjects::DataObject Superclass;
21 typedef itk::SmartPointer< Self > Pointer;
22 typedef itk::SmartPointer< const Self > ConstPointer;
26 itkTypeMacro( BoundingBox, DataObject );
27 cpPlugins_Id_Macro( BoundingBox, Object );
28 cpPlugins_Compatibility_Macro;
31 void SetDataObject( DataObject* o );
32 virtual void SetITK( itk::LightObject* o ) cpPlugins_OVERRIDE;
33 virtual void SetVTK( vtkObjectBase* o ) cpPlugins_OVERRIDE;
35 void Copy( Self* other );
36 void Blend( Self* other );
38 template< class _TPoint >
39 inline void SetMinimum( const _TPoint& p )
41 this->_SetPoint( 0, p );
44 template< class _TPoint >
45 inline void SetMaximum( const _TPoint& p )
47 this->_SetPoint( 1, p );
50 template< class _TPoint >
51 inline _TPoint GetMinimum( ) const
53 return( this->_GetPoint< _TPoint >( 0 ) );
56 template< class _TPoint >
57 inline _TPoint GetMaximum( ) const
59 return( this->_GetPoint< _TPoint >( 1 ) );
64 virtual ~BoundingBox( );
68 template< class _TPoint >
69 inline void _SetPoint( unsigned int m, const _TPoint& p )
71 this->m_Points[ m ].clear( );
72 for( unsigned int d = 0; d < _TPoint::PointDimension; ++d )
73 this->m_Points[ m ].push_back( double( p[ d ] ) );
78 template< class _TPoint >
79 inline _TPoint _GetPoint( unsigned int m ) const
81 unsigned int dim = this->m_Points[ m ].size( );
83 ( _TPoint::PointDimension < dim )? _TPoint::PointDimension: dim;
86 for( unsigned int d = 0; d < dim; ++d )
87 p[ d ] = this->m_Points[ m ][ d ];
91 template< unsigned int _NDim >
92 inline bool _ITKImage( itk::LightObject* o );
94 template< class _TScalar, unsigned int _NDim >
95 inline bool _ITKPointSet( itk::LightObject* o );
98 // Purposely not implemented
99 BoundingBox( const Self& );
100 Self& operator=( const Self& );
103 std::vector< double > m_Points[ 2 ];
104 vtkSmartPointer< vtkOutlineSource > m_Outline;
111 // #include <cpPlugins/DataObjects/BoundingBox.hxx>
113 #endif // __cpPlugins__DataObjects__BoundingBox__h__