#include <TDataStd_ByteArray.hxx>
#include <TDataStd_BooleanArray.hxx>
#include <TDataStd_IntegerArray.hxx>
+#include <TDataStd_Real.hxx>
#include <TDataStd_RealArray.hxx>
#include <TDataStd_ExtStringArray.hxx>
#include <TDataStd_UAttribute.hxx>
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 );
int aDim = getDimension();
+ double aZValue = ZValue();
+
int aSectionCount = theSections.size();
for( int aSectionId = 0; aSectionId < aSectionCount; aSectionId++ )
{
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 );
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 );
}
//! 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<double>& thePoints,
+ const double theZValue,
const bool theIsClosed);
//! Returns the BSpline curve passing through the points