]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
EDF 2281 : Dump correction
authorrnc <rnc@opencascade.com>
Fri, 27 Jul 2012 09:50:59 +0000 (09:50 +0000)
committerrnc <rnc@opencascade.com>
Fri, 27 Jul 2012 09:50:59 +0000 (09:50 +0000)
src/GEOMImpl/GEOMImpl_DividedDiskDriver.cxx
src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx
src/GEOM_SWIG/geompyDC.py

index f477bdca2e9bcd4ed61a166acea459fc1437d30a..105fa28b55c792acbca4a8a2b3f27fcbbe821419 100644 (file)
@@ -216,6 +216,7 @@ TopoDS_Shell GEOMImpl_DividedDiskDriver::MakeDiskHexagon(double R, double Ratio)
   for (int i=1;i<=6;i++)
   { 
     // Edges
+    
     // for Face1
     E2 = BRepBuilderAPI_MakeEdge(aCircle, V2, TopoDS::Vertex(V3.Reversed())); 
     E3 = BRepBuilderAPI_MakeEdge(V3,TopoDS::Vertex(V4.Reversed()));
@@ -239,6 +240,7 @@ TopoDS_Shell GEOMImpl_DividedDiskDriver::MakeDiskHexagon(double R, double Ratio)
     
     
     // Wires
+    
     //Wire1
     aBuilder.MakeWire(W1);
     if (i==1)
index 1532c0bc3bdb0cc8faa3e08101f5377ad62edced..7fc3b43bc8244e34515e913dfc6f2b228c915cd7 100644 (file)
@@ -2285,9 +2285,21 @@ Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedDisk (double theR,
     SetErrorCode(aFail->GetMessageString());
     return NULL;
   }
-
+  
+  std::string aPatternStr;
+  
+  switch(thePattern)
+  {
+    case 0:
+      aPatternStr = "GEOM.SQUARE";
+      break;
+    case 1:
+      aPatternStr = "GEOM.HEXAGON";
+      break;
+  }
+  
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedDisk(" << theR << ", " << theOrientation << ")";
+  GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedDisk(" << theR << ", " << theOrientation << ", " << aPatternStr.c_str() << ")";
 
   SetErrorCode(OK);
 
@@ -2350,9 +2362,22 @@ Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedDiskPntVecR (Handle
     SetErrorCode(aFail->GetMessageString());
     return NULL;
   }
+  
+  std::string aPatternStr;
+  
+  switch(thePattern)
+  {
+    case 0:
+      aPatternStr = "GEOM.SQUARE";
+      break;
+    case 1:
+      aPatternStr = "GEOM.HEXAGON";
+      break;
+  }
+  
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedDiskPntVecR(" << thePnt << ", " << theVec << ", " << theR << ")";
+  GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedDiskPntVecR(" << thePnt << ", " << theVec << ", " << theR << ", " << aPatternStr.c_str() << ")";
 
   SetErrorCode(OK);
 
@@ -2385,8 +2410,20 @@ Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedCylinder (double th
   aFunction->SetDescription("");   // Erase dump of MakePrismDXDYDZ
   aShape->SetType(GEOM_DIVIDEDCYLINDER);
   
+  std::string aPatternStr;
+  
+  switch(thePattern)
+  {
+    case 0:
+      aPatternStr = "GEOM.SQUARE";
+      break;
+    case 1:
+      aPatternStr = "GEOM.HEXAGON";
+      break;
+  }
+  
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedCylinder(" << theR << ", " << theH << ")";
+  GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedCylinder(" << theR << ", " << theH << ", " << aPatternStr.c_str() << ")";
 
   SetErrorCode(OK);
 
index d178b45a7d1da8ff7cd6d4bf19dd14375fc85fba..f07490efb793309251a13265c727708b50604845 100644 (file)
@@ -8553,12 +8553,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @param theR Radius of the disk
         #  @param theOrientation Orientation of the plane on which the disk will be built
         #         1 = XOY, 2 = OYZ, 3 = OZX
+        #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
         #  @return New GEOM_Object, containing the created shape.
         #
         #  @ref tui_creation_divideddisk "Example"
-        def MakeDividedDisk(self, theR, theOrientation):
-            theR, theOrientation, Parameters = ParseParameters(theR, theOrientation)
-            anObj = self.AdvOp.MakeDividedDisk(theR, 50.0, theOrientation)
+        def MakeDividedDisk(self, theR, theOrientation, thePattern ):
+            theR, Parameters = ParseParameters(theR)
+            anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
             RaiseIfFailed("MakeDividedDisk", self.AdvOp)
             if Parameters: anObj.SetParameters(Parameters)
             return anObj
@@ -8568,12 +8569,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @param theCenter Center of the disk
         #  @param theVector Normal vector to the plane of the created disk
         #  @param theRadius Radius of the disk
+        #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
         #  @return New GEOM_Object, containing the created shape.
         #
         #  @ref tui_creation_divideddisk "Example"
-        def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius):
+        def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern):
             theRadius, Parameters = ParseParameters(theRadius)
-            anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 50.0)
+            anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
             RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
             if Parameters: anObj.SetParameters(Parameters)
             return anObj
@@ -8581,12 +8583,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         ## Builds a cylinder prepared for hexa meshes
         #  @param theR Radius of the cylinder
         #  @param theH Height of the cylinder
+        #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
         #  @return New GEOM_Object, containing the created shape.
         #
         #  @ref tui_creation_dividedcylinder "Example"
-        def MakeDividedCylinder(self, theR, theH):
+        def MakeDividedCylinder(self, theR, theH, thePattern):
             theR, theH, Parameters = ParseParameters(theR, theH)
-            anObj = self.AdvOp.MakeDividedCylinder(theR, theH)
+            anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
             RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
             if Parameters: anObj.SetParameters(Parameters)
             return anObj