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 );
33 void Copy( Self* other );
34 void Blend( Self* other );
36 template< class _TPoint >
37 inline void SetMinimum( const _TPoint& p )
39 this->_SetPoint( 0, p );
42 template< class _TPoint >
43 inline void SetMaximum( const _TPoint& p )
45 this->_SetPoint( 1, p );
48 template< class _TPoint >
49 inline _TPoint GetMinimum( ) const
51 return( this->_GetPoint< _TPoint >( 0 ) );
54 template< class _TPoint >
55 inline _TPoint GetMaximum( ) const
57 return( this->_GetPoint< _TPoint >( 1 ) );
62 virtual ~BoundingBox( );
66 template< class _TPoint >
67 inline void _SetPoint( unsigned int m, const _TPoint& p )
69 this->m_Points[ m ].clear( );
70 for( unsigned int d = 0; d < _TPoint::PointDimension; ++d )
71 this->m_Points[ m ].push_back( double( p[ d ] ) );
76 template< class _TPoint >
77 inline _TPoint _GetPoint( unsigned int m ) const
79 unsigned int dim = this->m_Points[ m ].size( );
81 ( _TPoint::PointDimension < dim )? _TPoint::PointDimension: dim;
84 for( unsigned int d = 0; d < dim; ++d )
85 p[ d ] = this->m_Points[ m ][ d ];
90 // Purposely not implemented
91 BoundingBox( const Self& );
92 Self& operator=( const Self& );
95 std::vector< double > m_Points[ 2 ];
96 vtkSmartPointer< vtkOutlineSource > m_Outline;
103 // #include <cpPlugins/DataObjects/BoundingBox.hxx>
105 #endif // __cpPlugins__DataObjects__BoundingBox__h__