From: ouv Date: Fri, 4 Oct 2013 07:54:46 +0000 (+0000) Subject: Debug. X-Git-Tag: BR_hydro_v_0_3~97 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=30e558c9952b2463e7d645403598fec48a9331f7;p=modules%2Fhydro.git Debug. 1) Fixed crash on the creation of the second polyline. 2) Canceled creation of preview OCC view for Create/edit zone operation. 3) Temporary fix to avoid blinking of coincident zones in OCC view. --- diff --git a/src/HYDROData/HYDROData_Polyline.cxx b/src/HYDROData/HYDROData_Polyline.cxx index ae0330ed..e133ee3e 100755 --- a/src/HYDROData/HYDROData_Polyline.cxx +++ b/src/HYDROData/HYDROData_Polyline.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -355,12 +356,25 @@ QPainterPath HYDROData_Polyline::painterPath() const int anIndex = i * aDim; aPoints << aSection.myCoords[ anIndex ] << aSection.myCoords[ anIndex + 1 ]; } - HYDROOperations_BSpline aBSpline( aPoints, anIsSectionClosed ); + HYDROOperations_BSpline aBSpline( aPoints, 0, anIsSectionClosed ); aPath = aBSpline.ComputePath(); } return aPath; } +void HYDROData_Polyline::SetZValue( const double theZValue ) +{ + TDataStd_Real::Set(myLab.FindChild(DataTag_ZValue), theZValue); +} + +double HYDROData_Polyline::ZValue() const +{ + Handle(TDataStd_Real) aZValue; + if(myLab.FindChild(DataTag_ZValue).FindAttribute(TDataStd_Real::GetID(), aZValue)) + return aZValue->Get(); + return 0; +} + void HYDROData_Polyline::SetWire( const TopoDS_Wire& theWire ) { TNaming_Builder aBuilder( myLab ); @@ -381,6 +395,8 @@ void HYDROData_Polyline::UpdateWire( const PolylineData& theSections ) int aDim = getDimension(); + double aZValue = ZValue(); + int aSectionCount = theSections.size(); for( int aSectionId = 0; aSectionId < aSectionCount; aSectionId++ ) { @@ -405,8 +421,8 @@ void HYDROData_Polyline::UpdateWire( const PolylineData& theSections ) break; } - gp_Pnt aPnt1( aSection.myCoords[ anId1 ], aSection.myCoords[ anId1 + 1 ], 0 ); - gp_Pnt aPnt2( aSection.myCoords[ anId2 ], aSection.myCoords[ anId2 + 1 ], 0 ); + gp_Pnt aPnt1( aSection.myCoords[ anId1 ], aSection.myCoords[ anId1 + 1 ], aZValue ); + gp_Pnt aPnt2( aSection.myCoords[ anId2 ], aSection.myCoords[ anId2 + 1 ], aZValue ); TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aPnt1, aPnt2 ).Edge(); aMakeSectionWire.Add( anEdge ); @@ -423,7 +439,7 @@ void HYDROData_Polyline::UpdateWire( const PolylineData& theSections ) aPoints << x << y; } - HYDROOperations_BSpline aBSpline( aPoints, anIsSectionClosed ); + HYDROOperations_BSpline aBSpline( aPoints, aZValue, anIsSectionClosed ); TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aBSpline.Curve() ).Edge(); aMakeSectionWire.Add( anEdge ); } diff --git a/src/HYDROData/HYDROData_Polyline.h b/src/HYDROData/HYDROData_Polyline.h index 4f9e4008..b5ce157e 100755 --- a/src/HYDROData/HYDROData_Polyline.h +++ b/src/HYDROData/HYDROData_Polyline.h @@ -48,7 +48,8 @@ protected: DataTag_SectionsClosed, DataTag_SectionsSize, DataTag_SectionsType, - DataTag_Wire + DataTag_Wire, + DataTag_ZValue }; public: @@ -110,6 +111,9 @@ public: */ HYDRODATA_EXPORT QPainterPath painterPath() const; + HYDRODATA_EXPORT void SetZValue( const double theZValue ); + HYDRODATA_EXPORT double ZValue() const; + /** * Sets the wire contour of the object. */ diff --git a/src/HYDROData/HYDROOperations_BSpline.cxx b/src/HYDROData/HYDROOperations_BSpline.cxx index d2dd0176..419788ef 100644 --- a/src/HYDROData/HYDROOperations_BSpline.cxx +++ b/src/HYDROData/HYDROOperations_BSpline.cxx @@ -7,6 +7,7 @@ HYDROOperations_BSpline::HYDROOperations_BSpline( const QList& thePoints, + const double theZValue, const bool theIsClosed) { // fill array for algorithm by the received coordinates @@ -19,6 +20,7 @@ HYDROOperations_BSpline::HYDROOperations_BSpline( aListIter++; aPnt.SetY(*aListIter); aListIter++; + aPnt.SetZ(theZValue); aHCurvePoints->SetValue(ind, aPnt); } // compute BSpline diff --git a/src/HYDROData/HYDROOperations_BSpline.h b/src/HYDROData/HYDROOperations_BSpline.h index 0021af19..01df6026 100644 --- a/src/HYDROData/HYDROOperations_BSpline.h +++ b/src/HYDROData/HYDROOperations_BSpline.h @@ -20,8 +20,10 @@ public: //! Creates a spline by list of coordinates: pairs X and Y //! \param thePoints coordinates in format X1, Y1, X2, Y2, etc. must be even number of elements + //! \param theZValue constant value of the spline Z coordinate //! \param theIsClosed flag indicating that the result spline should be closed HYDROOperations_BSpline(const QList& thePoints, + const double theZValue, const bool theIsClosed); //! Returns the BSpline curve passing through the points