Salome HOME
Variables naming.
[modules/hydro.git] / src / HYDROData / HYDROData_Channel.cxx
index b2e9d1ccaf333e7b83f27ddb7d3063cfec7c894d..bd757fbd7b4bc1ba8c1f34edcdf8344f4b641aef 100644 (file)
@@ -13,7 +13,6 @@
 #include <BRepOffsetAPI_MakePipeShell.hxx>
 #include <BRepOffsetAPI_MakePipe.hxx>
 #include <BRepCheck_Analyzer.hxx>
-#include <BRepTools.hxx>
 
 #include <TopExp.hxx>
 
@@ -46,8 +45,17 @@ HYDROData_Channel::~HYDROData_Channel()
 QStringList HYDROData_Channel::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
 {
   QStringList aResList = dumpObjectCreation( theTreatedObjects );
+  QString aName = GetObjPyName();
+
+  Handle(HYDROData_Polyline3D) aRefGideLine = GetGuideLine();
+  setPythonReferenceObject( theTreatedObjects, aResList, aRefGideLine, "SetGuideLine" );
+
+  Handle(HYDROData_Profile) aRefProfile = GetProfile();
+  setPythonReferenceObject( theTreatedObjects, aResList, aRefProfile, "SetProfile" );
 
-  // TODO
+  aResList << QString( "" );
+  aResList << QString( "%1.Update();" ).arg( aName );
+  aResList << QString( "" );
 
   return aResList;
 }
@@ -94,17 +102,24 @@ void HYDROData_Channel::Update()
   if(aProfileWire.IsNull())
     return;
 
+#ifdef DEB_CHANNEL
   BRepTools::Write( aPathWire, "guideline.brep" );
   BRepTools::Write( aProfileWire, "profile.brep" );
+#endif
 
   HYDROData_Canal3dAnd2d aChannelConstructor( aProfileWire, aPathWire );
+  if( aChannelConstructor.GetStatus() != 0 )
+    return;
+
   aChannelConstructor.Create3dPresentation();
   aChannelConstructor.Create2dPresentation();
   SetShape3D( aChannelConstructor.Get3dPresentation() );
   SetTopShape( aChannelConstructor.Get2dPresentation() );
 
+#ifdef DEB_CHANNEL
   BRepTools::Write( aChannelConstructor.Get2dPresentation(), "channel2d.brep" );
   BRepTools::Write( aChannelConstructor.Get3dPresentation(), "channel3d.brep" );
+#endif
 
   TopAbs_ShapeEnum aType = GetTopShape().ShapeType();
 
@@ -114,6 +129,14 @@ void HYDROData_Channel::Update()
   TopoDS_Wire anInlet = aChannelConstructor.GetInlet();
   TopoDS_Wire anOutlet = aChannelConstructor.GetOutlet();
 
+#ifdef DEB_CHANNEL
+  HYDROData_ShapesTool::DumpShapeSubShapes( std::cout, "Top shape edges:", GetTopShape(), TopAbs_EDGE );
+  HYDROData_ShapesTool::DumpShapeSubShapes( std::cout, "Left bank edges:", aLeftBank, TopAbs_EDGE );
+  HYDROData_ShapesTool::DumpShapeSubShapes( std::cout, "Right bank edges:", aRightBank, TopAbs_EDGE );
+  HYDROData_ShapesTool::DumpShapeSubShapes( std::cout, "Inlet edges:", anInlet, TopAbs_EDGE );
+  HYDROData_ShapesTool::DumpShapeSubShapes( std::cout, "Outlet edges:", anOutlet, TopAbs_EDGE );
+#endif
+
   TopTools_SequenceOfShape aLeftBankEdges;
   HYDROData_ShapesTool::ExploreShapeToShapes( aLeftBank, TopAbs_EDGE, aLeftBankEdges );