]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Add methods for creatin thrusections and pipe with different sections
authorgka <gka@opencascade.com>
Mon, 24 Apr 2006 07:57:02 +0000 (07:57 +0000)
committergka <gka@opencascade.com>
Mon, 24 Apr 2006 07:57:02 +0000 (07:57 +0000)
src/GEOM_I/GEOM_I3DPrimOperations_i.cc
src/GEOM_I/GEOM_I3DPrimOperations_i.hh

index ac8d8fb6b21183eedee957ac6b78172f94c7b6fb..e8357a8204e7fdadaecc4fae16fb09777144f08d 100644 (file)
@@ -484,3 +484,101 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFilling(GEOM::GEOM_Object_pt
 
   return GetObject(anObject);
 }
+
+//=============================================================================
+/*!
+ *  MakeThruSections
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThruSections(const GEOM::ListOfGO& theSeqSections,
+                                                                CORBA::Boolean theModeSolid,
+                                                                CORBA::Double thePreci,
+                                                                CORBA::Boolean theRuled)
+{
+   GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+  Handle(TColStd_HSequenceOfTransient) aSeqSections = new TColStd_HSequenceOfTransient;
+  int ind, aLen;
+
+  //Get the shapes
+  aLen = theSeqSections.length();
+  for (ind = 0; ind < aLen; ind++) {
+    if (theSeqSections[ind] == NULL) continue;
+    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
+      (theSeqSections[ind]->GetStudyID(), theSeqSections[ind]->GetEntry());
+    if (!aSh.IsNull())
+      aSeqSections->Append(aSh);
+  }
+  if(!aSeqSections->Length())
+    return aGEOMObject._retn();
+
+  // Make shell or solid
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakeThruSections(aSeqSections,theModeSolid,thePreci,theRuled);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ *  MakePipeWithDifferentSections
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections(const GEOM::ListOfGO& theBases,
+                                                                             const GEOM::ListOfGO& theLocations,
+                                                                             GEOM::GEOM_Object_ptr thePath,
+                                                                             CORBA::Boolean theWithContact,
+                                                                             CORBA::Boolean theWithCorrections)
+{
+   GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+  Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
+  Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
+  int ind=0, aNbBases =0,aNbLocs=0;
+  
+  //Get the shapes
+  aNbBases = theBases.length();
+  aNbLocs = theLocations.length();
+
+  if( aNbLocs &&  aNbBases != aNbLocs)
+    return aGEOMObject._retn();
+  
+   Handle(GEOM_Object) aPath = GetOperations()->GetEngine()->GetObject
+      (thePath->GetStudyID(), thePath->GetEntry());
+   if(aPath.IsNull())
+     return aGEOMObject._retn();
+
+  for (ind = 0; ind < aNbBases; ind++) {
+    if (theBases[ind] == NULL) continue;
+    Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
+      (theBases[ind]->GetStudyID(), theBases[ind]->GetEntry());
+    if(aBase.IsNull())
+      continue;
+    if(aNbLocs)
+    {
+      Handle(GEOM_Object) aLoc = GetOperations()->GetEngine()->GetObject
+       (theLocations[ind]->GetStudyID(), theLocations[ind]->GetEntry());
+      if(aLoc.IsNull())
+       continue;
+      aSeqLocations->Append(aLoc);
+    }
+    aSeqBases->Append(aBase);
+  }
+  if(!aSeqBases->Length())
+    return aGEOMObject._retn();
+
+  // Make pipe
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakePipeWithDifferentSections(aSeqBases,aSeqLocations ,aPath,
+                                                  theWithContact,theWithCorrections);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
index acee1fdfc12a91904b0de662c2c8bf15f9291e60..bd44463d481eb0ec1c34fe25afd1e35baa21afb3 100644 (file)
@@ -94,6 +94,17 @@ class GEOM_I3DPrimOperations_i :
 
   GEOM::GEOM_Object_ptr MakeFilling(GEOM::GEOM_Object_ptr theShape, CORBA::Long theMinDeg, CORBA::Long theMaxDeg, CORBA::Double theTol2D, CORBA::Double theTol3D, CORBA::Long theNbIter);
 
+  GEOM::GEOM_Object_ptr MakeThruSections(const GEOM::ListOfGO& theSeqSections,
+                                        CORBA::Boolean theModeSolid,
+                                        CORBA::Double thePreci,
+                                        CORBA::Boolean theRuled);
+  
+  GEOM::GEOM_Object_ptr MakePipeWithDifferentSections(const GEOM::ListOfGO& theBases,
+                                                     const GEOM::ListOfGO& theLocations,
+                                                     GEOM::GEOM_Object_ptr thePath,
+                                                     CORBA::Boolean theWithContact,
+                                                     CORBA::Boolean theWithCorrections);
+
   ::GEOMImpl_I3DPrimOperations* GetOperations()
   { return (::GEOMImpl_I3DPrimOperations*)GetImpl(); }
 };