]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Mon, 10 Oct 2016 19:46:46 +0000 (14:46 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Mon, 10 Oct 2016 19:46:46 +0000 (14:46 -0500)
lib/cpExtensions/DataStructures/PolyLineParametricPath.h
lib/cpExtensions/DataStructures/PolyLineParametricPath.hxx

index 3358d0fc4c13d130b6bb34b6ce23068c9eb8c2d3..7f122000948b60793d6f995152980e75939efd55 100644 (file)
@@ -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;
 
index 5e26816e47876a55d8501f8aad605a0b6381bdeb..635c8b7829b494f029315473df3c67f808da14b6 100644 (file)
@@ -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 >::