Salome HOME
0052436: MakePipeWithDifferentsSections does not work correctly
authorskv <skv@opencascade.com>
Thu, 3 Jul 2014 09:47:17 +0000 (13:47 +0400)
committerskv <skv@opencascade.com>
Thu, 3 Jul 2014 09:47:17 +0000 (13:47 +0400)
src/GEOMImpl/GEOMImpl_PipeDriver.cxx
src/GenerationGUI/GenerationGUI_PipeDlg.cxx

index af4f40df9223be31a5601ae605379fb65d16f9fa..3f0f0c986af127b8973e557244905f380c18849c 100644 (file)
@@ -681,6 +681,7 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
   TopTools_SequenceOfShape aSeqBases;
   TopTools_SequenceOfShape aSeqLocs;
   TopTools_SequenceOfShape aSeqFaces;
+  Standard_Boolean NeedCreateSolid = Standard_False;
 
   Standard_Integer i = 1;
   for (i = 1; i <= nbBases; i++) {
@@ -697,7 +698,6 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
 
     //if for section was specified face with a few wires then a few
     //    pipes were build and make solid
-    Standard_Boolean NeedCreateSolid = Standard_False;
     if (aTypeBase == TopAbs_SHELL) {
       // create wire as boundary contour if shell is no closed
       // get free boundary shapes
@@ -1015,21 +1015,21 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
         aBuilder.SetTolerance(aTolConf, aTolConf, aTolAng);
 
         aBuilder.Build();
+
+        Standard_Boolean isDone = aBuilder.IsDone();
+
+        if (isDone && NeedCreateSolid) {
+          isDone = aBuilder.MakeSolid();
+        }
+
+        if (!isDone) {
+          Standard_ConstructionError::Raise("Pipe construction failure");
+        }
         aShape = aBuilder.Shape();
         aSeqFaces.Append(aShape);
         for (j = 1; j <=usedBases.Length(); j++)
           aBuilder.Delete(usedBases.Value(j));
       }
-
-      //for case if section is face
-      if (aSeqFaces.Length() >1) {
-        BRep_Builder aB;
-        TopoDS_Compound aComp;
-        aB.MakeCompound(aComp);
-        for (i = 1; i <= aSeqFaces.Length(); i++)
-          aB.Add(aComp,aSeqFaces.Value(i));
-        aShape = aComp;
-      }
   }
 
   return aShape;
index e9ead7a401794c4996ddec9e5843a36e77ccbfd8..edcbec331bdabc0c7ba8e7ed7ba295a3b5d98fb0 100644 (file)
@@ -165,6 +165,8 @@ void GenerationGUI_PipeDlg::Init()
   connect(GroupMakePoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupMakePoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupMakePoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+  connect(GroupMakePoints->CheckBox1, SIGNAL(clicked()), this, SLOT(processPreview()));
+  connect(GroupMakePoints->CheckBox2, SIGNAL(clicked()), this, SLOT(processPreview()));
 
   initName(tr("GEOM_PIPE"));
   resize(100,100);
@@ -264,10 +266,7 @@ bool GenerationGUI_PipeDlg::ClickOnApply()
     return false;
 
   initName();
-  if ( getConstructorId() != 1 )
-    ConstructorsClicked( getConstructorId() );
-  // activate selection and connect selection manager
-  //   GroupPoints->PushButton1->click();
+
   return true;
 }