1 #ifndef __CPPLUGINS__INTERFACE__POINTLIST__HXX__
2 #define __CPPLUGINS__INTERFACE__POINTLIST__HXX__
4 #include <itkSimpleDataObjectDecorator.h>
8 // -------------------------------------------------------------------------
10 void cpPlugins::Interface::PointList::
11 AddPoint( const P& p )
13 typedef itk::SimpleDataObjectDecorator< std::vector< P > > _T;
16 if( this->m_NumberOfPoints == 0 )
18 typename _T::Pointer obj = _T::New( );
19 container = obj.GetPointer( );
20 this->m_ITKObject = container;
23 container = dynamic_cast< _T* >( this->m_ITKObject.GetPointer( ) );
25 if( container != NULL )
27 container->Get( ).push_back( p );
28 this->m_NumberOfPoints += 1;
33 // -------------------------------------------------------------------------
35 P cpPlugins::Interface::PointList::
36 GetPoint( const unsigned long& i ) const
38 typedef itk::SimpleDataObjectDecorator< std::vector< P > > _T;
41 if( i < this->m_NumberOfPoints )
43 _T* container = dynamic_cast< _T* >( this->m_ITKObject.GetPointer( ) );
44 if( container != NULL )
45 ret = container->Get( )[ i ];
51 #endif // __CPPLUGINS__INTERFACE__POINTLIST__HXX__