}
QStringList HYDROData_Channel::DumpToPython( const QString& thePyScriptPath,
- MapOfTreatedObjects& theTreatedObjects ) const
+ MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
QString aName = GetObjPyName();
Handle(HYDROData_Polyline3D) aRefGideLine = GetGuideLine();
setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRefGideLine, "SetGuideLine" );
- Handle(HYDROData_Profile) aRefProfile = GetProfile();
- setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRefProfile, "SetProfile" );
+ bool mode = GetProfileMode();
+ QString aMode = mode ? "True" : "False" ;
+ aResList << QString( "%1.SetProfileMode( %2 )" ).arg( aName ).arg( aMode );
+
+ if (mode)
+ {
+ Handle(HYDROData_Profile) aRefProfile = GetProfile();
+ setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRefProfile, "SetProfile" );
+ }
+ else
+ {
+ QString aLC = QString::number( GetLCValue(), 'f', 3 );
+ QString aDeltaZ = QString::number( GetDeltaZValue(), 'f', 3 );
+ QString aCoteZ = QString::number( GetCoteZValue(), 'f', 3 );
+
+ aResList << QString( "%1.SetLCValue( %2 )" ).arg( aName ).arg( aLC );
+ aResList << QString( "%1.SetDeltaZValue( %2 )" ).arg( aName ).arg( aDeltaZ );
+ aResList << QString( "%1.SetCoteZValue( %2 )" ).arg( aName ).arg( aCoteZ );
+ }
aResList << QString( "%1.SetEquiDistance( %2 )" ).arg( aName ).arg( GetEquiDistance() );
aResList << QString( "" );
return aResList;
+
}
HYDROData_SequenceOfObjects HYDROData_Channel::GetAllReferenceObjects() const
if (mode)
{
if (!ReverseXCoord)
- aProfileWire = TopoDS::Wire( theProfile->GetShape3D(true, false) ); //temp force rebuild
+ aProfileWire = TopoDS::Wire( theProfile->GetShape3D(false, false) ); //temp force rebuild
else
aProfileWire = TopoDS::Wire( theProfile->GetShape3D(true, true));
}
}
double xmin, ymin, xmax, ymax;
intersect_bndbox.Get(xmin, ymin, xmax, ymax);
- if (Abs(xmax-xmin)>PREC)
+ //if (Abs(xmax-xmin)>PREC)
+ if (intersection_nb >= 1)
{
double u_mid, u_wid;
if( !CalcMidWidth( intersect_bndbox, u_mid, u_wid ) )
Handle(TDataStd_Integer) anAttr;
TDF_Label aLabel = myLab.FindChild( theTag );
if( !aLabel.FindAttribute( TDataStd_Integer::GetID(), anAttr ) )
- return 0;
+ return theDefValue;
return anAttr->Get();
}
gp_Lin aMidLin( aMiddlePoint2d, gp::DZ() );
TopoDS_Edge aMidEdge = BRepLib_MakeEdge( aMidLin );
- const TopoDS_Wire& aProf = TopoDS::Wire( GetShape3D() );
+ TopoDS_Shape aProf = TopoDS::Wire( GetShape3D() );
if (aProf.IsNull())
return aMiddlePoint;
TopoDS_Iterator anIt( aProf );
QStringList aResList = dumpObjectCreation( theTreatedObjects );
QString aName = GetObjPyName();
+ int interpMethod = GetInterpolationMethod();
+ QString anInterpMethod = QString::number( interpMethod );
+ aResList << QString( "%1.SetInterpolationMethod( %2 )" ).arg( aName ).arg( anInterpMethod );
+
Handle(HYDROData_PolylineXY) aHydAxis = GetHydraulicAxis();
setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aHydAxis, "SetHydraulicAxis" );
setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aBottomPolyline, "SetBottomPolyline" );
}
- QString aDDZs = QString::number( GetDDZ(), 'f', 3 );
- QString aSSteps = QString::number( GetSpatialStep(), 'f', 3 );
- aResList << QString( "%1.SetDDZ( %2 )" ).arg( aName ).arg( aDDZs );
- aResList << QString( "%1.SetSpatialStep( %2 )" ).arg( aName ).arg( aSSteps );
+ if (interpMethod==0)
+ {
+ QString aDDZs = QString::number( GetDDZ(), 'f', 3 );
+ QString aSSteps = QString::number( GetSpatialStep(), 'f', 3 );
+ aResList << QString( "%1.SetDDZ( %2 )" ).arg( aName ).arg( aDDZs );
+ aResList << QString( "%1.SetSpatialStep( %2 )" ).arg( aName ).arg( aSSteps );
+ }
+ else if (interpMethod==1)
+ {
+ Handle(HYDROData_PolylineXY) aLeftBank = GetLeftBank();
+ setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aLeftBank, "SetLeftBank" );
+ Handle(HYDROData_PolylineXY) aRightBank = GetRightBank();
+ setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRightBank, "SetRightBank" );
+
+ QString aHaxStep = QString::number( GetHaxStep(), 'f', 3 );
+ QString aNbProfilePoints = QString::number( GetNbProfilePoints() );
+ aResList << QString( "%1.SetHaxStep( %2 )" ).arg( aName ).arg( aHaxStep );
+ aResList << QString( "%1.SetNbProfilePoints( %2 )" ).arg( aName ).arg( aNbProfilePoints );
+ }
aResList << QString( "" );
aResList << QString( "%1.Update()" ).arg( aName );
*/
HYDRODATA_EXPORT virtual void RemoveHydraulicAxis();
- HYDRODATA_EXPORT Handle(HYDROData_PolylineXY) GetLeftBank() const;
+ HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetLeftBank() const;
- HYDRODATA_EXPORT void SetLeftBank( const Handle(HYDROData_PolylineXY)& theBank );
+ HYDRODATA_EXPORT virtual void SetLeftBank( const Handle(HYDROData_PolylineXY)& theBank );
- HYDRODATA_EXPORT Handle(HYDROData_PolylineXY) GetRightBank() const;
+ HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetRightBank() const;
- HYDRODATA_EXPORT void SetRightBank( const Handle(HYDROData_PolylineXY)& theBank );
+ HYDRODATA_EXPORT virtual void SetRightBank( const Handle(HYDROData_PolylineXY)& theBank );
/**
* Returns true if profile has the intersection with the given hydraulic axis.
* Returns the parameter of inresection point on axis if axis is presented by one curve,
HYDRODATA_EXPORT void SetDDZ( double theDDZ );
HYDRODATA_EXPORT int GetInterpolationMethod() const;
- HYDRODATA_EXPORT void SetInterpolationMethod( int theDDZ );
+ HYDRODATA_EXPORT void SetInterpolationMethod( int theMode );
HYDRODATA_EXPORT double GetSpatialStep() const;
HYDRODATA_EXPORT void SetSpatialStep( double theSpatialStep );
void SetEquiDistance( double );
double GetEquiDistance() const;
+
+ void SetLCValue( double );
+ double GetLCValue() const;
+
+ void SetDeltaZValue( double );
+ double GetDeltaZValue() const;
+
+ void SetCoteZValue( double );
+ double GetCoteZValue() const;
+
+ void SetProfileMode( bool );
+ bool GetProfileMode() const;
protected:
}
%End
+ /**
+ * Sets the left bank object for stream. (LISM method only)
+ */
+ void SetLeftBank( HYDROData_PolylineXY theBank )
+ [void ( const opencascade::handle<HYDROData_PolylineXY>& )];
+ %MethodCode
+ Handle(HYDROData_PolylineXY) aRef =
+ Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
+ if ( !aRef.IsNull() )
+ {
+ Py_BEGIN_ALLOW_THREADS
+ sipSelfWasArg ? sipCpp->HYDROData_Stream::SetLeftBank( aRef ):
+ sipCpp->SetLeftBank( aRef );
+ Py_END_ALLOW_THREADS
+ }
+ %End
+
+ /**
+ * Returns the left bank object of stream. (LISM method only)
+ */
+ HYDROData_PolylineXY GetLeftBank() const
+ [opencascade::handle<HYDROData_PolylineXY> ()];
+ %MethodCode
+ Handle(HYDROData_PolylineXY) aRef;
+
+ Py_BEGIN_ALLOW_THREADS
+ aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetLeftBank() :
+ sipCpp->GetLeftBank();
+ Py_END_ALLOW_THREADS
+
+ sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
+ %End
+
+ /**
+ * Sets the right bank object for stream. (LISM method only)
+ */
+ void SetRightBank( HYDROData_PolylineXY theBank )
+ [void ( const opencascade::handle<HYDROData_PolylineXY>& )];
+ %MethodCode
+ Handle(HYDROData_PolylineXY) aRef =
+ Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
+ if ( !aRef.IsNull() )
+ {
+ Py_BEGIN_ALLOW_THREADS
+ sipSelfWasArg ? sipCpp->HYDROData_Stream::SetRightBank( aRef ):
+ sipCpp->SetRightBank( aRef );
+ Py_END_ALLOW_THREADS
+ }
+ %End
+
+ /**
+ * Returns the right bank object of stream. (LISM method only)
+ */
+ HYDROData_PolylineXY GetRightBank() const
+ [opencascade::handle<HYDROData_PolylineXY> ()];
+ %MethodCode
+ Handle(HYDROData_PolylineXY) aRef;
+
+ Py_BEGIN_ALLOW_THREADS
+ aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetRightBank() :
+ sipCpp->GetRightBank();
+ Py_END_ALLOW_THREADS
+
+ sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
+ %End
+
/**
* Add interpolated profiles into the stream.
* \param theInterpolator the interpolator
virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
/**
- * Set vertical slicing step for profiles interpolation.
+ * Set vertical slicing step for profiles interpolation. (DTM method only)
*/
void SetDDZ( double theDDZ );
/**
- * Set horizontal step for profiles interpolation.
+ * Set horizontal step for profiles interpolation. (DTM method only)
*/
void SetSpatialStep( double theSpatialStep );
+ /**
+ * Set interpolation method (DTM or LISM).
+ */
+ void SetInterpolationMethod( int theMode );
+
+ /**
+ * Set horizontal step on hydr. axis for profiles interpolation. (LISM method)
+ */
+ void SetHaxStep( double theHaxStep );
+
+ /**
+ * Set number of points on profiles to insert (LISM method)
+ */
+ void SetNbProfilePoints( int theNbPoints );
+
protected:
/**
* Creates new object in the internal data structure. Use higher level objects