From 377b28e6c437227495d8ef5b4e648ffb967746be Mon Sep 17 00:00:00 2001 From: rnc Date: Fri, 27 Jul 2012 09:50:59 +0000 Subject: [PATCH] EDF 2281 : Dump correction --- src/GEOMImpl/GEOMImpl_DividedDiskDriver.cxx | 2 + src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx | 45 +++++++++++++++++-- src/GEOM_SWIG/geompyDC.py | 17 ++++--- 3 files changed, 53 insertions(+), 11 deletions(-) diff --git a/src/GEOMImpl/GEOMImpl_DividedDiskDriver.cxx b/src/GEOMImpl/GEOMImpl_DividedDiskDriver.cxx index f477bdca2..105fa28b5 100644 --- a/src/GEOMImpl/GEOMImpl_DividedDiskDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_DividedDiskDriver.cxx @@ -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) diff --git a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx index 1532c0bc3..7fc3b43bc 100644 --- a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx @@ -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); diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index d178b45a7..f07490efb 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -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 -- 2.39.2