Handle(HYDROData_Profile) aRefProfile = GetProfile();
setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRefProfile, "SetProfile" );
+ aResList << QString( "%1.SetEquiDistance( %2 )" ).arg( aName ).arg( GetEquiDistance() );
+
aResList << QString( "" );
- aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "%1.Update()" ).arg( aName );
aResList << QString( "" );
return aResList;
bool HYDROData_Channel::CreatePresentations( const Handle(HYDROData_Polyline3D)& theGuideLine,
const Handle(HYDROData_Profile)& theProfile,
- PrsDefinition& thePrs )
+ PrsDefinition& thePrs,
+ double theEquiDistance )
{
// Check input parameters
if ( theGuideLine.IsNull() || theProfile.IsNull() ) {
int aNbPoints = aPolylinePoints.Length();
*/
- double aEqDistance = 1; // TODO: to pass via properties and OCAF
- HYDROData_Polyline3D::Polyline3DPoints aPolylinePoints3D = theGuideLine->GetPoints( aEqDistance );
+ HYDROData_Polyline3D::Polyline3DPoints aPolylinePoints3D = theGuideLine->GetPoints( theEquiDistance );
int aNbPoints = aPolylinePoints3D.Length();
if ( aNbPoints < 2 )
return false;
Handle(HYDROData_Profile) aProfile = GetProfile();
PrsDefinition aResultPrs;
- if ( !CreatePresentations( aGuideLine, aProfile, aResultPrs ) )
+ double anEquiDistance = GetEquiDistance();
+ if ( !CreatePresentations( aGuideLine, aProfile, aResultPrs, anEquiDistance ) )
return;
SetShape3D( aResultPrs.myPrs3D );
HYDROData_SequenceOfObjects aGroups = GetGroups();
return HYDROData_Tool::getFirstShapeFromGroup( aGroups, 2);
}
+
+void HYDROData_Channel::SetEquiDistance( double theEquiDistance )
+{
+ double anEquiDistance = theEquiDistance > 0 ? theEquiDistance : 1E-3;
+ SetDouble( DataTag_EquiDistance, theEquiDistance );
+}
+
+double HYDROData_Channel::GetEquiDistance() const
+{
+ return GetDouble( DataTag_EquiDistance, 1.0 );
+}