X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FBoundingBox.cxx;fp=lib%2FcpPlugins%2FBoundingBox.cxx;h=0000000000000000000000000000000000000000;hb=aa77db36cc1d87ba014c982a235239c3c87224f3;hp=14f48f4c4309d9e2a08a5d9cec2a3786873d16fa;hpb=733108d258a27799df875ceda2d84c3cafea64d3;p=cpPlugins.git diff --git a/lib/cpPlugins/BoundingBox.cxx b/lib/cpPlugins/BoundingBox.cxx deleted file mode 100644 index 14f48f4..0000000 --- a/lib/cpPlugins/BoundingBox.cxx +++ /dev/null @@ -1,97 +0,0 @@ -#include -#include -#include - -// ------------------------------------------------------------------------- -void cpPlugins::BoundingBox:: -SetDataObject( DataObject* o ) -{ - auto i = o->GetITK< itk::LightObject >( ); - auto v = o->GetVTK< vtkObjectBase >( ); - if( v != NULL ) this->SetVTK( v ); - else if( i != NULL ) this->SetITK( i ); -} - -// ------------------------------------------------------------------------- -void cpPlugins::BoundingBox:: -SetITK( itk::LightObject* o ) -{ - bool r = this->_ITKImage< 1 >( o ); - if( !r ) r = this->_ITKImage< 2 >( o ); - if( !r ) r = this->_ITKImage< 3 >( o ); - if( !r ) r = this->_ITKImage< 4 >( o ); - if( !r ) r = this->_ITKPointSet< float, 2 >( o ); - if( !r ) r = this->_ITKPointSet< double, 2 >( o ); - if( !r ) r = this->_ITKPointSet< float, 3 >( o ); - if( !r ) r = this->_ITKPointSet< double, 3 >( o ); -} - -// ------------------------------------------------------------------------- -void cpPlugins::BoundingBox:: -SetVTK( vtkObjectBase* o ) -{ - auto ds = dynamic_cast< vtkDataSet* >( o ); - if( ds != NULL ) - { - double bounds[ 6 ]; - ds->GetBounds( bounds ); - this->m_Points[ 0 ].clear( ); - this->m_Points[ 1 ].clear( ); - this->m_Points[ 0 ].push_back( bounds[ 0 ] ); - this->m_Points[ 1 ].push_back( bounds[ 1 ] ); - this->m_Points[ 0 ].push_back( bounds[ 2 ] ); - this->m_Points[ 1 ].push_back( bounds[ 3 ] ); - this->m_Points[ 0 ].push_back( bounds[ 4 ] ); - this->m_Points[ 1 ].push_back( bounds[ 5 ] ); - - } // fi -} - -// ------------------------------------------------------------------------- -void cpPlugins::BoundingBox:: -Copy( Self* other ) -{ - this->m_Points[ 0 ] = other->m_Points[ 0 ]; - this->m_Points[ 1 ] = other->m_Points[ 1 ]; - this->Modified( ); -} - -// ------------------------------------------------------------------------- -void cpPlugins::BoundingBox:: -Blend( Self* other ) -{ - if( this->m_Points[ 0 ].size( ) < other->m_Points[ 0 ].size( ) ) - this->m_Points[ 0 ].resize( - other->m_Points[ 0 ].size( ), - std::numeric_limits< double >::max( ) - ); - if( this->m_Points[ 1 ].size( ) < other->m_Points[ 1 ].size( ) ) - this->m_Points[ 1 ].resize( - other->m_Points[ 1 ].size( ), - -std::numeric_limits< double >::max( ) - ); - for( unsigned int d = 0; d < this->m_Points[ 0 ].size( ); ++d ) - if( other->m_Points[ 0 ][ d ] < this->m_Points[ 0 ][ d ] ) - this->m_Points[ 0 ][ d ] = other->m_Points[ 0 ][ d ]; - for( unsigned int d = 0; d < this->m_Points[ 1 ].size( ); ++d ) - if( other->m_Points[ 1 ][ d ] > this->m_Points[ 1 ][ d ] ) - this->m_Points[ 1 ][ d ] = other->m_Points[ 1 ][ d ]; - this->Modified( ); -} - -// ------------------------------------------------------------------------- -cpPlugins::BoundingBox:: -BoundingBox( ) - : Superclass( ) -{ - this->m_Points[ 0 ].push_back( double( 0 ) ); - this->m_Points[ 1 ].push_back( double( 0 ) ); -} - -// ------------------------------------------------------------------------- -cpPlugins::BoundingBox:: -~BoundingBox( ) -{ -} - -// eof - $RCSfile$