]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/SeedsInterface.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / SeedsInterface.hxx
index 5c272167310267cf9c12882674d2ae03ec7daaad..5dd666ee53fbf5a719373ea0f27088f22ce569b2 100644 (file)
@@ -7,84 +7,48 @@
 #define __fpa__Base__SeedsInterface__hxx__
 
 // -------------------------------------------------------------------------
-template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
-unsigned int
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
-GetNumberOfSeeds( ) const
-{
-  return( this->m_Seeds.size( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
+template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
 const typename
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
+fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
 TSeeds&
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
+fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
 GetSeeds( ) const
 {
   return( this->m_Seeds );
 }
 
 // -------------------------------------------------------------------------
-template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
-typename
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
-TSeeds::const_iterator
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
-BeginSeeds( ) const
-{
-  return( this->m_Seeds.begin( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
-typename
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
-TSeeds::const_iterator
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
-EndSeeds( ) const
-{
-  return( this->m_Seeds.end( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
+template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
 void
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
+fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
 AddSeed( const TVertex& seed )
 {
-  TNode node;
-  node.Vertex = seed;
-  node.Parent = seed;
-  node.FrontId = TFrontId( this->m_Seeds.size( ) + 1 );
-  if( this->m_Seeds.insert( node ).second && this->m_Filter != NULL )
+  TSeed s;
+  s.Vertex = seed;
+  s.IsPoint = false;
+  this->m_Seeds.push_back( s );
+  if( this->m_Filter != NULL )
     this->m_Filter->Modified( );
 }
 
 // -------------------------------------------------------------------------
-template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
+template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
 void
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
-RemoveSeed( const TVertex& seed )
+fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
+AddSeed( const TPoint& seed )
 {
-  TNode node;
-  node.Vertex = seed;
-  node.Parent = seed;
-  typename TSeeds::const_iterator i = this->m_Seeds.find( node );
-  if( i != this->m_Seeds.end( ) )
-  {
-    this->m_Seeds.erase( i );
-    if( this->m_Filter != NULL )
-      this->m_Filter->Modified( );
-
-  } // fi
+  TSeed s;
+  s.Point = seed;
+  s.IsPoint = true;
+  this->m_Seeds.push_back( s );
+  if( this->m_Filter != NULL )
+    this->m_Filter->Modified( );
 }
 
 // -------------------------------------------------------------------------
-template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
+template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
 void
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
+fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
 ClearSeeds( )
 {
   if( this->m_Seeds.size( ) > 0 )
@@ -97,16 +61,16 @@ ClearSeeds( )
 }
 
 // -------------------------------------------------------------------------
-template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
+template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
+fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
 SeedsInterface( itk::ProcessObject* filter )
   : m_Filter( filter )
 {
 }
 
 // -------------------------------------------------------------------------
-template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
-fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
+template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
+fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
 ~SeedsInterface( )
 {
   this->m_Seeds.clear( );