X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_PolylineOperator.cxx;h=7e44abefa551166741ff52efc984e12951d4047a;hb=e744ba34fd38d6744d11b54cd15b6f86350695b2;hp=c8bc099f76d36f74f36574a11ef2743d82072f3b;hpb=e3000ba337d23a437393722a865e2074609ef51a;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_PolylineOperator.cxx b/src/HYDROData/HYDROData_PolylineOperator.cxx index c8bc099f..7e44abef 100644 --- a/src/HYDROData/HYDROData_PolylineOperator.cxx +++ b/src/HYDROData/HYDROData_PolylineOperator.cxx @@ -20,7 +20,9 @@ #include #include +#ifndef LIGHT_MODE #include +#endif #include #include @@ -45,6 +47,7 @@ #include #include #include +#include template void append( std::vector& theList, const std::vector& theList2 ) { @@ -87,7 +90,8 @@ bool HYDROData_PolylineOperator::Split( const Handle( HYDROData_Document )& theD bool HYDROData_PolylineOperator::Split( const Handle( HYDROData_Document )& theDoc, const Handle( HYDROData_PolylineXY )& thePolyline, const Handle( HYDROData_PolylineXY )& theTool, - double theTolerance ) const + double theTolerance, + bool& theIsIntersected) const { if (thePolyline.IsNull() || theTool.IsNull()) { @@ -96,7 +100,7 @@ bool HYDROData_PolylineOperator::Split( const Handle( HYDROData_Document )& theD HYDROData_SequenceOfObjects aSeq; aSeq.Append( theTool ); - return split( theDoc, thePolyline, aSeq, theTolerance, -1 ); + return split( theDoc, thePolyline, aSeq, theTolerance, -1, theIsIntersected); } bool HYDROData_PolylineOperator::Split( const Handle( HYDROData_Document )& theDoc, @@ -107,7 +111,8 @@ bool HYDROData_PolylineOperator::Split( const Handle( HYDROData_Document )& theD for( int i=f; i<=l; i++ ) { Handle( HYDROData_PolylineXY ) aPolyline = Handle( HYDROData_PolylineXY )::DownCast( thePolylines.Value( i ) ); - if( !split( theDoc, aPolyline, thePolylines, theTolerance, i ) ) + bool isIntersected; + if( !split( theDoc, aPolyline, thePolylines, theTolerance, i, isIntersected) ) return false; } return true; @@ -163,8 +168,11 @@ bool HYDROData_PolylineOperator::split( const Handle( HYDROData_Document )& theD const Handle( HYDROData_PolylineXY )& thePolyline, const HYDROData_SequenceOfObjects& theTools, double theTolerance, - int theIgnoreIndex ) const + int theIgnoreIndex, + bool& theIsIntersected) const { + theIsIntersected = false; + if (thePolyline.IsNull()) { return false; @@ -209,7 +217,7 @@ bool HYDROData_PolylineOperator::split( const Handle( HYDROData_Document )& theD } std::deque aSplittedCurves; - aCurve.Cut(aParams, aSplittedCurves); + theIsIntersected |= aCurve.Cut(aParams, aSplittedCurves); std::deque::const_iterator aCIt = aSplittedCurves.begin(); std::deque::const_iterator aLastCIt = @@ -326,7 +334,9 @@ double HYDROData_PolylineOperator::ReduceDeflection( } Handle(Geom_BSplineCurve) aBSpline2; const bool isClosed = theCurve.IsClosed(); +#ifndef LIGHT_MODE if (!CurveCreator_Utils::constructBSpline(aPs2, isClosed, aBSpline2)) +#endif { return -1; }