+// =========================================================================
+// @author Leonardo Florez Valencia
+// @email florez-l@javeriana.edu.co
+// =========================================================================
+
#ifndef __fpa__Image__MinimumSpanningTree__hxx__
#define __fpa__Image__MinimumSpanningTree__hxx__
TVertex fpa::Image::MinimumSpanningTree< _VDim >::
GetParent( const TVertex& v ) const
{
- TVertex p = v + this->GetPixel( v );
- return( p );
+ return( v + this->GetPixel( v ) );
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
template< unsigned int _VDim >
void fpa::Image::MinimumSpanningTree< _VDim >::
-GetPath( typename TPath::Pointer& path, const TVertex& a ) const
+GetPolyLineParametricPath(
+ typename TPolyLineParametricPath::Pointer& path,
+ const TVertex& a
+ ) const
{
- if( path.GetPointer( ) == NULL )
- path = TPath::New( );
+ TVertices v = this->GetPath( a );
+ if( path.IsNull( ) )
+ path = TPolyLineParametricPath::New( );
path->SetReferenceImage( this );
- this->Superclass::GetPath( path, a );
+ typename TVertices::const_iterator vIt = v.begin( );
+ for( ; vIt != v.end( ); ++vIt )
+ path->AddVertex( *vIt );
}
// -------------------------------------------------------------------------
template< unsigned int _VDim >
void fpa::Image::MinimumSpanningTree< _VDim >::
-GetPath(
- typename TPath::Pointer& path, const TVertex& a, const TVertex& b
+GetPolyLineParametricPath(
+ typename TPolyLineParametricPath::Pointer& path,
+ const TVertex& a, const TVertex& b
) const
{
- if( path.GetPointer( ) == NULL )
- path = TPath::New( );
+ TVertices v = this->GetPath( a, b );
+ if( path.IsNull( ) )
+ path = TPolyLineParametricPath::New( );
path->SetReferenceImage( this );
- this->Superclass::GetPath( path, a, b );
+ typename TVertices::const_iterator vIt = v.begin( );
+ for( ; vIt != v.end( ); ++vIt )
+ path->AddVertex( *vIt );
}
// -------------------------------------------------------------------------