From: Leonardo Flórez-Valencia Date: Mon, 10 Oct 2016 19:46:46 +0000 (-0500) Subject: ... X-Git-Tag: v0.1~90 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=cpPlugins.git;a=commitdiff_plain;h=357b159c7f06bdb1bb65a9ebecf8b2345b3f2900 ... --- diff --git a/lib/cpExtensions/DataStructures/PolyLineParametricPath.h b/lib/cpExtensions/DataStructures/PolyLineParametricPath.h index 3358d0f..7f12200 100644 --- a/lib/cpExtensions/DataStructures/PolyLineParametricPath.h +++ b/lib/cpExtensions/DataStructures/PolyLineParametricPath.h @@ -26,6 +26,7 @@ namespace cpExtensions typedef typename TImageBase::PointType TPoint; typedef typename TImageBase::DirectionType TDirection; typedef typename Superclass::ContinuousIndexType TContinuousIndex; + typedef typename TContinuousIndex::IndexType TIndex; typedef typename TPoint::VectorType TVector; typedef cpExtensions::Algorithms::BezierCurveFunction< TVector > TBezier; @@ -44,7 +45,8 @@ namespace cpExtensions public: void AddVertex( const TContinuousIndex& vertex ); unsigned long GetSize( ) const; - TContinuousIndex GetVertex( unsigned long i ) const; + TContinuousIndex GetContinuousVertex( unsigned long i ) const; + TIndex GetVertex( unsigned long i ) const; TPoint GetPoint( unsigned long i ) const; TPoint GetSmoothPoint( double u ) const; diff --git a/lib/cpExtensions/DataStructures/PolyLineParametricPath.hxx b/lib/cpExtensions/DataStructures/PolyLineParametricPath.hxx index 5e26816..635c8b7 100644 --- a/lib/cpExtensions/DataStructures/PolyLineParametricPath.hxx +++ b/lib/cpExtensions/DataStructures/PolyLineParametricPath.hxx @@ -29,11 +29,24 @@ template< unsigned int _VDim > typename cpExtensions::DataStructures::PolyLineParametricPath< _VDim >:: TContinuousIndex cpExtensions::DataStructures::PolyLineParametricPath< _VDim >:: -GetVertex( unsigned long i ) const +GetContinuousVertex( unsigned long i ) const { return( this->GetVertexList( )->GetElement( i ) ); } +// ------------------------------------------------------------------------- +template< unsigned int _VDim > +typename cpExtensions::DataStructures::PolyLineParametricPath< _VDim >:: +TIndex cpExtensions::DataStructures::PolyLineParametricPath< _VDim >:: +GetVertex( unsigned long i ) const +{ + TContinuousIndex cidx = this->GetContinuousVertex( i ); + TIndex idx; + for( unsigned int d = 0; d < _VDim; ++d ) + idx[ d ] = cidx[ d ]; + return( idx ); +} + // ------------------------------------------------------------------------- template< unsigned int _VDim > typename cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::