]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Dump of 3D polyline defined on bathymetry corrected.
authoradv <adv@opencascade.com>
Fri, 17 Jan 2014 07:44:23 +0000 (07:44 +0000)
committeradv <adv@opencascade.com>
Fri, 17 Jan 2014 07:44:23 +0000 (07:44 +0000)
src/HYDROData/HYDROData_Polyline3D.cxx
src/HYDROData/HYDROData_Polyline3D.h
src/HYDROPy/HYDROData_Polyline3D.sip

index c8549930cf3ea682cb7b7e9ca7d898210d78911a..c55cbe07fdce1370503544d9c5eb211e8e858b61 100644 (file)
@@ -57,7 +57,26 @@ QStringList HYDROData_Polyline3D::DumpToPython( MapOfTreatedObjects& theTreatedO
   else
   {
     Handle(HYDROData_IAltitudeObject) aRefBathymetry = GetAltitudeObject();
-    setPythonReferenceObject( theTreatedObjects, aResList, aRefBathymetry, "SetAltitudeObject" );
+    if ( !aRefBathymetry.IsNull() )
+    {
+      Handle(HYDROData_ProfileUZ) aChildProfileUZ = GetChildProfileUZ();
+      if ( !aChildProfileUZ.IsNull() )
+      {
+        Handle(HYDROData_Profile) aProfile = 
+          Handle(HYDROData_Profile)::DownCast( aChildProfileUZ->GetFatherObject() );
+        if ( !aProfile.IsNull() )
+        {
+          QString aProfileName = aProfile->GetObjPyName();
+          if ( !aProfileName.isEmpty() )
+          {
+            aResList << QString( "%1.SetChildProfileUZ( %2.GetProfileUZ() );" )
+                         .arg( aPolylineName ).arg( aProfileName );
+          }
+        }
+      }
+
+      setPythonReferenceObject( theTreatedObjects, aResList, aRefBathymetry, "SetAltitudeObject" );
+    }
   }
 
   aResList << QString( "" );
@@ -307,11 +326,16 @@ Handle(HYDROData_ProfileUZ) HYDROData_Polyline3D::GetChildProfileUZ( const bool
   aProfileUZ = aProfile->GetProfileUZ();
 
   HYDROData_Polyline3D* me = const_cast<HYDROData_Polyline3D*>( this ); // Temporary to be revised
-  me->SetReferenceObject( aProfileUZ, DataTag_ChildProfileUZ );
+  me->SetChildProfileUZ( aProfileUZ );
 
   return aProfileUZ;
 }
 
+void HYDROData_Polyline3D::SetChildProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile )
+{
+  SetReferenceObject( theProfile, DataTag_ChildProfileUZ );
+}
+
 HYDROData_IPolyline::PointsList generateProfileUZPoints(
   const Handle(HYDROData_PolylineXY)&      thePolyline,
   const Handle(HYDROData_IAltitudeObject)& theAltitude )
index ad7a6e1ae895540e1b9b82998658048f36d40f23..ea550ca9a4acf8aa107fcebc5c06f4b30c80f777 100644 (file)
@@ -132,6 +132,11 @@ public:
    */
   HYDRODATA_EXPORT Handle(HYDROData_ProfileUZ) GetChildProfileUZ( const bool theIsCreate = true ) const;
 
+  /**
+   * Sets the child u,z profile for polyline.
+   */
+  HYDRODATA_EXPORT void SetChildProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
+
 
 protected:
 
index a9e2e63d2f052836e07da300ad8fc9079185423a..299d3df49b57fb4d414c993af3d46a96d63a7092 100644 (file)
@@ -167,6 +167,22 @@ public:
   %End
 
 
+  /**
+   * Sets the child u,z profile for polyline.
+   */
+  void SetChildProfileUZ( HYDROData_ProfileUZ theProfile ) [void ( const Handle_HYDROData_ProfileUZ& )];
+  %MethodCode
+    Handle(HYDROData_ProfileUZ) aRef =
+      Handle(HYDROData_ProfileUZ)::DownCast( createHandle( a0 ) );
+    if ( !aRef.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Polyline3D::SetChildProfileUZ( aRef ):
+                      sipCpp->SetChildProfileUZ( aRef );
+      Py_END_ALLOW_THREADS
+    }
+  %End
+
 protected:
 
   /**