From 357b159c7f06bdb1bb65a9ebecf8b2345b3f2900 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Mon, 10 Oct 2016 14:46:46 -0500 Subject: [PATCH] ... --- .../DataStructures/PolyLineParametricPath.h | 4 +++- .../DataStructures/PolyLineParametricPath.hxx | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) 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 >:: -- 2.45.0