X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FWidgets%2FSplineWidget.cxx;h=2c4a0bcff8db1dca135d68d14d3a9bd323ebd26e;hb=3c542bf84e8802c1332cd1c348511e5e049a596f;hp=527138c1df381ec37df3b0eb573bfdf3ba00bf7d;hpb=eb7e1229343f1d74c24a4008aae1425180bb95c8;p=cpPlugins.git diff --git a/plugins/Widgets/SplineWidget.cxx b/plugins/Widgets/SplineWidget.cxx index 527138c..2c4a0bc 100644 --- a/plugins/Widgets/SplineWidget.cxx +++ b/plugins/Widgets/SplineWidget.cxx @@ -94,6 +94,18 @@ _GenerateData( ) typedef std::vector< _TVector > _TVectors; unsigned long nPoints = this->m_Contour->GetNumberOfPoints( ); + double area = 0.0; + for( unsigned long i = 0; i < nPoints; ++i ) + { + double p[ 3 ], q[ 3 ]; + this->m_Contour->GetPoint( i, p ); + this->m_Contour->GetPoint( ( i + 1 ) % nPoints, q ); + + area += ( q[ 0 ] + p[ 0 ] ) * ( q[ 1 ] - p[ 1 ] ); + + } // rof + std::cout << "Area: " << area << std::endl; + unsigned long support = nPoints / 10; _TVectors pp, qp; for( unsigned long i = 0; i < support; ++i )