1 #ifndef __cpInstances__BoundingBox__h__
2 #define __cpInstances__BoundingBox__h__
4 #define ITK_MANUAL_INSTANTIATION
5 #include <cpInstances/cpPluginsDataObjects_Export.h>
7 #include <cpPlugins/Pipeline/DataObject.h>
8 #include <vtkOutlineSource.h>
9 #include <vtkSmartPointer.h>
17 class cpPluginsDataObjects_EXPORT BoundingBox
18 : public cpPlugins::Pipeline::DataObject
21 typedef BoundingBox Self;
22 typedef cpPlugins::Pipeline::DataObject Superclass;
23 typedef itk::SmartPointer< Self > Pointer;
24 typedef itk::SmartPointer< const Self > ConstPointer;
28 itkTypeMacro( BoundingBox, DataObject );
29 cpPlugins_Id_Macro( BoundingBox, Object );
30 cpPlugins_Compatibility_Macro;
33 void SetDataObject( DataObject* o );
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 ];
92 // Purposely not implemented
93 BoundingBox( const Self& );
94 Self& operator=( const Self& );
97 std::vector< double > m_Points[ 2 ];
98 vtkSmartPointer< vtkOutlineSource > m_Outline;
105 #endif // __cpInstances__BoundingBox__h__