From 32059ef998ff2c9f025d8a480bffa9355d6758b9 Mon Sep 17 00:00:00 2001 From: dmv Date: Tue, 23 Dec 2008 11:21:26 +0000 Subject: [PATCH] 0016819: EDF PAL 564: Make fillet on 2D surface --- doc/salome/gui/GEOM/images/fillet2d_1.png | Bin 0 -> 1593 bytes doc/salome/gui/GEOM/images/fillet2d_2.png | Bin 0 -> 16745 bytes .../gui/GEOM/input/fillet2d_operation.doc | 25 ++ doc/salome/gui/GEOM/input/index.doc | 1 + .../GEOM/input/transformation_operations.doc | 1 + .../gui/GEOM/input/transforming_geom_objs.doc | 1 + .../input/tui_transformation_operations.doc | 21 + idl/GEOM_Gen.idl | 14 + idl/GEOM_Superv.idl | 3 + resources/Makefile.am | 1 + resources/fillet2d.png | Bin 0 -> 980 bytes src/GEOMGUI/GEOM_images.ts | 8 + src/GEOMGUI/GEOM_msg_en.ts | 20 + src/GEOMGUI/GeometryGUI.cxx | 5 +- src/GEOMImpl/GEOMImpl.pro | 1 + src/GEOMImpl/GEOMImpl_Fillet2dDriver.cxx | 152 +++++++ src/GEOMImpl/GEOMImpl_Fillet2dDriver.hxx | 158 +++++++ src/GEOMImpl/GEOMImpl_Gen.cxx | 2 + src/GEOMImpl/GEOMImpl_IFillet2d.hxx | 51 +++ src/GEOMImpl/GEOMImpl_ILocalOperations.cxx | 71 ++++ src/GEOMImpl/GEOMImpl_ILocalOperations.hxx | 2 + src/GEOMImpl/GEOMImpl_Types.hxx | 7 +- src/GEOMImpl/Makefile.am | 3 + src/GEOM_I/GEOM_ILocalOperations_i.cc | 35 ++ src/GEOM_I/GEOM_ILocalOperations_i.hh | 3 + src/GEOM_I_Superv/GEOM_Superv_i.cc | 20 + src/GEOM_I_Superv/GEOM_Superv_i.hh | 2 + src/GEOM_SWIG/GEOM_TestAll.py | 2 + src/GEOM_SWIG/geompyDC.py | 14 + src/OperationGUI/Makefile.am | 3 + src/OperationGUI/OperationGUI.cxx | 2 + src/OperationGUI/OperationGUI_Fillet2dDlg.cxx | 400 ++++++++++++++++++ src/OperationGUI/OperationGUI_Fillet2dDlg.h | 75 ++++ 33 files changed, 1100 insertions(+), 3 deletions(-) create mode 100755 doc/salome/gui/GEOM/images/fillet2d_1.png create mode 100755 doc/salome/gui/GEOM/images/fillet2d_2.png create mode 100755 doc/salome/gui/GEOM/input/fillet2d_operation.doc create mode 100755 resources/fillet2d.png create mode 100755 src/GEOMImpl/GEOMImpl_Fillet2dDriver.cxx create mode 100755 src/GEOMImpl/GEOMImpl_Fillet2dDriver.hxx create mode 100755 src/GEOMImpl/GEOMImpl_IFillet2d.hxx create mode 100755 src/OperationGUI/OperationGUI_Fillet2dDlg.cxx create mode 100755 src/OperationGUI/OperationGUI_Fillet2dDlg.h diff --git a/doc/salome/gui/GEOM/images/fillet2d_1.png b/doc/salome/gui/GEOM/images/fillet2d_1.png new file mode 100755 index 0000000000000000000000000000000000000000..859796aae5a7af0e0e320c6799aae618b9fe308e GIT binary patch literal 1593 zcmeAS@N?(olHy`uVBq!ia0y~yU^D|_O%5iY$h5eb8yFba7(87ZLn`LHy?ZuS+FhdI zVd(>|J58Yu514Wk9Hcy%tzKn35tF^!AkCR@V4u1NqZju|#dcqbwom;&-nYur=Cj*P zXwl&@sQG$!oyv=opX2Z8I9x4{)@S%3)9EzJMbUTB1hqhq$r?*MMJ~rzqrP!F2eWz|EqhgD)4mr#cf|MudiRj|8LK( zns?VP{E!G1xdb%^-AjW~`0dMU+!E){UXADf5E-w}|0%OrZ{7Udy)6elz7)$XbNj(1 zWUJ~Or1FbD^^!_p;iPS^U53TK!qOY~<(UUUI<}CV^A|~KmXbu!Mb-LN9D124@w_(bn4f2mwvsyN3KUU@1Z4|M{ zO{3a4V$lY3Wssn=vMQIgi4RclH;~-mFVwolP^k1&>h@zEB4ys-lpw7TD8A^;O@_`x z^MEM~7#&|-Vmme!e|1TGPD$K+D|yYj;nz>$_516tgcj5TlPrI~{<`~f_Ec0n?e@7i z<@*1B$rbXw1+^dF)#?f9?u=a)cD$^*;$BQ_UFiI7m&w?PoveVz}{`@<0^Pt>%dg66N^ z_TQJc|NHW~{ku>5`D%gLCGz*5TiQXug#5o&&e-X)UstT1*jvxu=b^uz{M3IQbI5Mi z&j0&f+r-Gk9(=^TKd?9KW<;e_aEAoHvVq5 zvNb>6{td7FBkO-C{>g&fOQ-AKn;T+PIsbIgMLEv-AHR9a7sUI{oABaTpZ45+=V#gk zOxW&OQhiG1&|=fdL*HFdGB+imjgl#WnU!j}Z0)=kN55`fJN>}kjkD8NsB>AX2YLWg z%<{#SH;#YinV|9JrbOp2CL1g3ifx8Mt#_r=0^{3`r@r5J)Sy$ZtjeeCt#t2{7fJiw zllSktn*bE5l_`4_*E9V^(tG!W{&%M*bn4w>%q@E^XM4Ab@p<%pcJuK1+`R(-l+RV0 z7cA0V=+^PMk!Su3uNBfl&zondT)g^l@1m>j3(g!j3|+*2&(^Aq*Prn9M2@IaDelF{r5}E*0Lb442 literal 0 HcmV?d00001 diff --git a/doc/salome/gui/GEOM/images/fillet2d_2.png b/doc/salome/gui/GEOM/images/fillet2d_2.png new file mode 100755 index 0000000000000000000000000000000000000000..39a337845607feaae6ec1af2543d22103526cafe GIT binary patch literal 16745 zcmb8XbzGERyDvPF0s;ckDIh7`jRJ~N3R2Q7-QCh4B_*v=BHhi<9n#&ML)Q>z;cvfZ zKcDwGd!K#&-~)5BX5F>!>-yGA$UFJhnCK+v5C{bGjkKg91o9vX{FpsN0b95$AC*BM zRFF54FFv@W?9DlQJQ$8-^RE}y* zR%6=bmy(igGS;ka{kkp!&1<37Y9q=xIMLIzPtm^cXrbZYh3K*r%N<~ zGq0)cG5upOc`&rHX!^a`G@8icm>q^{&1y(OFNBr;#j0-0i?-XrE_9fbwzS4BD;}2W zCa0FZ9ZTe7Dy}6>rXareNP2gG|>sjbAIi{g`YRy1o1>fTG#pvXRxxxz=4^u)HA7F3NIN}L+A!Ox5Yww|I>`O;2c z=~#c3n0jmxi1D#Cz;c!z{@I|@vjhDctw-1A>gk_64oyl#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FtH|qjdGK|Z+SK5M|1hoviCS7t-%B#@KUc*hX`wkY_&wPDX*W$!j>j{>u7`=C1G)33$l#U&USrTfDXURMQdBV0f zq$D15dB6~vadCmpqgt%?y#8`rD9!r)8Vj@f`mdo3*UPM}6H4~)eZiE#{@=r+x7}(d z9QyU1<_en#QvJ4na=@(C>X)tG~(s^g948Y0eOYoZKIn z@LKgrV2jzk6kwC}4tY)C=A)|Z6#}&O!(kaN8^Kf%p<+L*)Bpvh17!JmlU(hutf6Rfp9_<1U-X6mMCF1znR z@&P0#<}|n5Qnvqc5@;ciP>KP1G z99~%^lR{8Qe+Db_9mqnl_2tNDi>3FP~>?oYGY+YzXzVdbD!UzqVK#XOL z*NQPTR!iykikga1of|x{ApG}IkbfMM&~@($svx-F=D2fo%D0gAK}6p9){M(K!diW8 zqDUuw4UO4s?y#u4GJngn$ZV`cOnIts-pkmWMnv{~Po{yY<7m9{YfEB&1iOba2!0V- ze=$Ub(c(J@(!0A8@Ff96_umT;{onL>ZBu5W|1ls~Ki1yOZ3_PaG;}D9fV*Ge z#}>(X2p@5g0-4IpzaO6aA7i5Bkqp^;G_~ypkRglG7UXMu+|KFX-2GHpPwx{$|8qy3 zX7LpM2gFp-6Ps^#?101D!w$Z<0CxiBFy;U@XPyP`Otu`{U5^+NR2D Planar Face. + +\image html fillet2d_2.png + +To produce a \b Fillet 2D in the Main Menu select +Operations - > Transformation - > Fillet 2D + +Define the Main Object to create a fillet on, select the necessary +vertexes on this face in the OCC Viewer and define the \b Radius of the Fillet. + +TUI Command: geompy.MakeFillet(Shape, R, ListVertexes) +\n Arguments: Name + 1 shape + one or several vertexes + 1 value (Fillet radius). + +Examples: + +\image html fillet2d_1.png + +Our TUI Scripts provide you with useful examples of the use of +\ref tui_fillet2d "Transformation Operations". + +*/ diff --git a/doc/salome/gui/GEOM/input/index.doc b/doc/salome/gui/GEOM/input/index.doc index 12941c823..919dee491 100644 --- a/doc/salome/gui/GEOM/input/index.doc +++ b/doc/salome/gui/GEOM/input/index.doc @@ -86,6 +86,7 @@
  • \ref offset_operation_page
  • \ref multi_translation_operation_page
  • \ref multi_rotation_operation_page
  • +
  • \ref fillet2d_operation_page
  • \ref fillet_operation_page
  • \ref chamfer_operation_page
  • diff --git a/doc/salome/gui/GEOM/input/transformation_operations.doc b/doc/salome/gui/GEOM/input/transformation_operations.doc index efb331f1c..cb8246a80 100644 --- a/doc/salome/gui/GEOM/input/transformation_operations.doc +++ b/doc/salome/gui/GEOM/input/transformation_operations.doc @@ -11,6 +11,7 @@
  • \subpage offset_operation_page
  • \subpage multi_translation_operation_page
  • \subpage multi_rotation_operation_page
  • +
  • \subpage fillet2d_operation_page
  • \subpage fillet_operation_page
  • \subpage chamfer_operation_page
  • diff --git a/doc/salome/gui/GEOM/input/transforming_geom_objs.doc b/doc/salome/gui/GEOM/input/transforming_geom_objs.doc index 3daec5a37..ab22d3c10 100644 --- a/doc/salome/gui/GEOM/input/transforming_geom_objs.doc +++ b/doc/salome/gui/GEOM/input/transforming_geom_objs.doc @@ -26,6 +26,7 @@
  • \ref offset_operation_page
  • \ref multi_translation_operation_page
  • \ref multi_rotation_operation_page
  • +
  • \ref fillet2d_operation_page
  • \ref fillet_operation_page
  • \ref chamfer_operation_page
  • diff --git a/doc/salome/gui/GEOM/input/tui_transformation_operations.doc b/doc/salome/gui/GEOM/input/tui_transformation_operations.doc index 73985a581..8301afa6f 100644 --- a/doc/salome/gui/GEOM/input/tui_transformation_operations.doc +++ b/doc/salome/gui/GEOM/input/tui_transformation_operations.doc @@ -349,6 +349,27 @@ gg.createAndDisplayGO(id_rot2d) gg.setDisplayMode(id_rot2d,1) \endcode +\anchor tui_fillet2d +

    Fillet 2D

    + +\code +import geompy +import salome +gg = salome.ImportComponentGUI("GEOM") + +# create a face in OXY plane +face = geompy.MakeFaceHW(100, 100, 1) +fillet2d = geompy.MakeFillet2D(face, 30, [7, 9]) + +# add objects in the study +id_face = geompy.addToStudy(face,"Face_1") +id_fillet2d = geompy.addToStudy(fillet2d,"Fillet 2D_1") + +# display disks +gg.createAndDisplayGO(id_face) +gg.createAndDisplayGO(id_fillet2d) +\endcode + \anchor tui_fillet

    Fillet

    diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index bffefb664..397012d34 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -2244,10 +2244,24 @@ module GEOM GEOM_Object MakeFilletFaces (in GEOM_Object theShape, in double theR, in ListOfLong theFaces); + GEOM_Object MakeFilletFacesR1R2 (in GEOM_Object theShape, in double theR1, in double theR2, in ListOfLong theFaces); + + /*! + * Perform a fillet on face of the specified vertexes of the given shape. + * \param theShape Shape, to perform fillet on. + * \param theR Fillet radius. + * \param theVertexes Global indices of vertexes to perform fillet on. + * \note Global index of sub-shape can be obtained, using method + * GEOM_IShapesOperations.GetSubShapeIndex(). + * \return New GEOM_Object, containing the result shape. + */ + GEOM_Object MakeFillet2D (in GEOM_Object theShape, + in double theR, + in ListOfLong theVertexes); /*! * Perform a symmetric chamfer on all edges of the given shape. diff --git a/idl/GEOM_Superv.idl b/idl/GEOM_Superv.idl index 50c350166..5b5605b61 100644 --- a/idl/GEOM_Superv.idl +++ b/idl/GEOM_Superv.idl @@ -512,6 +512,9 @@ module GEOM in double theR1, in double theR2, in GEOM_List theFaces) ; + GEOM_Object MakeFillet2D (in GEOM_Object theShape, + in double theR, + in GEOM_List theVertexes) ; GEOM_Object MakeChamferAll (in GEOM_Object theShape, in double theD) ; GEOM_Object MakeChamferEdge (in GEOM_Object theShape, diff --git a/resources/Makefile.am b/resources/Makefile.am index f37e8e9e8..15d23bbac 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -87,6 +87,7 @@ eraseall.png \ face_hw.png \ face_vechw.png \ fillet.png \ +fillet2d.png \ filletall.png \ filletedge.png \ filletface.png \ diff --git a/resources/fillet2d.png b/resources/fillet2d.png new file mode 100755 index 0000000000000000000000000000000000000000..a17cef65b6d0f236f816b0d74582dd8d6698f2f1 GIT binary patch literal 980 zcmV;_11tQAP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ|{`&mV>YW@Z!v7=ir%|Nb%j|Nfof z&)c^Qzn?y3;Mw+q;g;Zi2K(>dRe(xf00a;VNTH-n3Iit_GXpCN6WF!C|Ndk63&iz1 zCc_O2%d7<%$pCV|&tHETzWn&j;Aj=Va8>XD!}lHB3_ue-fC_d11Q6JT#j{WT=KvbW z1~ia~i4kbne}+FGmmmf2wGFLcI<~ln;rq`&44=OJVtD)Z4TE&17emsI9|wR^7l3#H zKmdWmurJNR;N9n+3~xSx@DGM}Uw$$`_&*rle1u>z$6_$9N%Lj+@D(Wk?j6J1mrod8 z04)ZBFCg!NXn+7>fjZ#Jd!Qjq(8&1*bQ;*(|NaBR3^gKTgL)YXLrfU*+ZQu@{_u{0 z3nKgi>cSTQ0mKAV_u}i1KMbG0{|4hPKn&u8Xi!)o#k|DT~CrI2N zs*_=1Zy5sHpA#Ph8>$2q3rxAaDQp^_$@bFwy?_ z_J!dW5dZn{mErHt?+kx`|77_0_cu@tD2Dzs;LEK50fge>{hhuBe|~@r`@rz?>pO;@ zU*3Z8udnYJet-MK0FwLr^Bd6cUqJkqLCdd#p%s{;kO4pdp@-?0KR@`^a_xDd21_A^SiVH#E2#kO`m)15_0J%0QPRTz1{``W(EYOvV zOw5ol1Vt7wO#l7+%Ya_|0R#{WmT(27`XeC5oqcmbYzZLdk+%qO09y)ICON_DLG_FILLET fillet.png + + ICON_DLG_FILLET_2D + fillet2d.png + ICON_DLG_FILLET_ALL filletall.png @@ -738,6 +742,10 @@ ICO_FILLET fillet.png + + ICO_FILLET_2D + fillet2d.png + ICO_FILLING filling.png diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 9d466b0aa..af217b165 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -580,6 +580,10 @@ Please, select face, shell or solid and try again GEOM_FILLET Fillet + + GEOM_FILLET_2D + Fillet 2D + GEOM_FILLET_ABORT Fillet can't be computed with radius %1 @@ -596,10 +600,18 @@ Please, select face, shell or solid and try again GEOM_FILLET_FACES Fillet On Faces From Shape + + GEOM_FILLET_VERTEXES + Fillet On Vertexes From Face + GEOM_FILLET_TITLE Fillet Construction + + GEOM_FILLET_2D_TITLE + 2D Fillet Construction + GEOM_FILLING Filling @@ -1812,6 +1824,10 @@ Please, select face, shell or solid and try again GEOM_VERTEX Vertex + + GEOM_VERTEXES + Vertexes + GEOM_WATER_DENSITY Water Density : @@ -2120,6 +2136,10 @@ Please, select face, shell or solid and try again MEN_FILLET Fillet + + MEN_FILLET_2D + Fillet 2D + MEN_FILLING Filling diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 3b514664a..a3f8e4e11 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -491,7 +491,8 @@ void GeometryGUI::OnGUIEvent( int id ) id == 505 || // MENU OPERATION - FILLET id == 506 || // MENU OPERATION - CHAMFER id == 507 || // MENU OPERATION - CLIPPING RANGE - id == 508 ) { // MENU OPERATION - GET SHAPES ON SHAPE + id == 508 || // MENU OPERATION - GET SHAPES ON SHAPE + id == 509 ) { // MENU OPERATION - FILLET 2D #ifndef WNT library = getLibrary( "libOperationGUI.so" ); #else @@ -828,6 +829,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( 506, "CHAMFER" ); //createGeomAction( 507, "CLIPPING" ); createGeomAction( 508, "GET_SHAPES_ON_SHAPES" ); + createGeomAction( 509, "FILLET_2D" ); createGeomAction( 9998, "MUL_TRANSFORM" ); createGeomAction( 9995, "EXPLODE_BLOCKS" ); @@ -982,6 +984,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( 504, operId, -1 ); createMenu( 508, operId, -1 ); createMenu( separator(), operId, -1 ); + createMenu( 509, transId, -1 ); createMenu( 505, transId, -1 ); createMenu( 506, transId, -1 ); //createMenu( 507, transId, -1 ); diff --git a/src/GEOMImpl/GEOMImpl.pro b/src/GEOMImpl/GEOMImpl.pro index 618fc4abc..e6ee52aab 100644 --- a/src/GEOMImpl/GEOMImpl.pro +++ b/src/GEOMImpl/GEOMImpl.pro @@ -87,6 +87,7 @@ SOURCES += GEOMImpl_ArcDriver.cxx SOURCES += GEOMImpl_SplineDriver.cxx SOURCES += GEOMImpl_SketcherDriver.cxx SOURCES += GEOMImpl_FilletDriver.cxx +SOURCES += GEOMImpl_Fillet2dDriver.cxx SOURCES += GEOMImpl_ChamferDriver.cxx SOURCES += GEOMImpl_BooleanDriver.cxx SOURCES += GEOMImpl_PartitionDriver.cxx diff --git a/src/GEOMImpl/GEOMImpl_Fillet2dDriver.cxx b/src/GEOMImpl/GEOMImpl_Fillet2dDriver.cxx new file mode 100755 index 000000000..f7f2050ae --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_Fillet2dDriver.cxx @@ -0,0 +1,152 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +//======================================================================= +//function : GetID +//purpose : +//======================================================================= +const Standard_GUID& GEOMImpl_Fillet2dDriver::GetID() +{ + static Standard_GUID aFillet2dDriver("FF1AAB41-2A14-4df2-581B-3A568163BA46"); + return aFillet2dDriver; +} + + +//======================================================================= +//function : GEOMImpl_Fillet2dDriver +//purpose : +//======================================================================= +GEOMImpl_Fillet2dDriver::GEOMImpl_Fillet2dDriver() +{ +} + +//======================================================================= +//function : Execute +//purpose : +//======================================================================= +Standard_Integer GEOMImpl_Fillet2dDriver::Execute(TFunction_Logbook& log) const +{ + if (Label().IsNull()) return 0; + Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label()); + + GEOMImpl_IFillet2d aCI (aFunction); + + TopoDS_Shape aShape; + + Handle(GEOM_Function) aRefShape = aCI.GetShape(); + TopoDS_Face aFaceShape = TopoDS::Face(aRefShape->GetValue()); + + if (aFaceShape.ShapeType() != TopAbs_FACE) + Standard_ConstructionError::Raise("Wrong arguments: two faces must be given"); + + BRepFilletAPI_MakeFillet2d fillet2d (aFaceShape); + + int aLen = aCI.GetLength(); + int ind = 1; + double rad = aCI.GetR(); + for (; ind <= aLen; ind++) { + TopoDS_Shape aShapeVertex; + if (GEOMImpl_ILocalOperations::GetSubShape + (aFaceShape, aCI.GetVertex(ind), aShapeVertex)) { + fillet2d.AddFillet(TopoDS::Vertex(aShapeVertex), rad); + } + } + + fillet2d.Build(); + if (!fillet2d.IsDone()) { + StdFail_NotDone::Raise("2D Fillet can't be computed on the given shape with the given radius"); + } + aShape = fillet2d.Shape(); + + if (aShape.IsNull()) return 0; + + aFunction->SetValue(aShape); + log.SetTouched(Label()); + + return 1; +} + + +//======================================================================= +//function : GEOMImpl_Fillet2dDriver_Type_ +//purpose : +//======================================================================= +Standard_EXPORT Handle_Standard_Type& GEOMImpl_Fillet2dDriver_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); + if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_Fillet2dDriver", + sizeof(GEOMImpl_Fillet2dDriver), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + +//======================================================================= +//function : DownCast +//purpose : +//======================================================================= +const Handle(GEOMImpl_Fillet2dDriver) Handle(GEOMImpl_Fillet2dDriver)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(GEOMImpl_Fillet2dDriver) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_Fillet2dDriver))) { + _anOtherObject = Handle(GEOMImpl_Fillet2dDriver)((Handle(GEOMImpl_Fillet2dDriver)&)AnObject); + } + } + + return _anOtherObject ; +} diff --git a/src/GEOMImpl/GEOMImpl_Fillet2dDriver.hxx b/src/GEOMImpl/GEOMImpl_Fillet2dDriver.hxx new file mode 100755 index 000000000..a5448db66 --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_Fillet2dDriver.hxx @@ -0,0 +1,158 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : GEOMImpl_Fillet2dDriver.ixx +// Module : GEOMImpl + +#ifndef _GEOMImpl_Fillet2dDriver_HeaderFile +#define _GEOMImpl_Fillet2dDriver_HeaderFile + +#ifndef _TColStd_SequenceOfExtendedString_HeaderFile +#include +#endif +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_GUID_HeaderFile +#include +#endif + +#ifndef _Handle_TFunction_Driver_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TFunction_Driver); +class GEOMImpl_Fillet2dDriver; + +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMImpl_Fillet2dDriver); + +class Handle(GEOMImpl_Fillet2dDriver) : public Handle(TFunction_Driver) { + public: + inline void* operator new(size_t,void* anAddress) + { + return anAddress; + } + inline void* operator new(size_t size) + { + return Standard::Allocate(size); + } + inline void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + Handle(GEOMImpl_Fillet2dDriver)():Handle(TFunction_Driver)() {} + Handle(GEOMImpl_Fillet2dDriver)(const Handle(GEOMImpl_Fillet2dDriver)& aHandle) : Handle(TFunction_Driver)(aHandle) + { + } + + Handle(GEOMImpl_Fillet2dDriver)(const GEOMImpl_Fillet2dDriver* anItem) : Handle(TFunction_Driver)((TFunction_Driver *)anItem) + { + } + + Handle(GEOMImpl_Fillet2dDriver)& operator=(const Handle(GEOMImpl_Fillet2dDriver)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(GEOMImpl_Fillet2dDriver)& operator=(const GEOMImpl_Fillet2dDriver* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + GEOMImpl_Fillet2dDriver* operator->() + { + return (GEOMImpl_Fillet2dDriver *)ControlAccess(); + } + + GEOMImpl_Fillet2dDriver* operator->() const + { + return (GEOMImpl_Fillet2dDriver *)ControlAccess(); + } + + Standard_EXPORT ~Handle(GEOMImpl_Fillet2dDriver)() {}; + + Standard_EXPORT static const Handle(GEOMImpl_Fillet2dDriver) DownCast(const Handle(Standard_Transient)& AnObject); +}; + +#ifndef _TFunction_Driver_HeaderFile +#include +#endif +#ifndef _TFunction_Logbook_HeaderFile +#include +#endif +#ifndef _Standard_CString_HeaderFile +#include +#endif + +class TColStd_SequenceOfExtendedString; + + +class GEOMImpl_Fillet2dDriver : public TFunction_Driver { + +public: + + inline void* operator new(size_t,void* anAddress) + { + return anAddress; + } + inline void* operator new(size_t size) + { + return Standard::Allocate(size); + } + inline void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + // Methods PUBLIC + // +Standard_EXPORT GEOMImpl_Fillet2dDriver(); +Standard_EXPORT virtual Standard_Integer Execute(TFunction_Logbook& log) const; +Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {} +Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const { return Standard_True; } +Standard_EXPORT static const Standard_GUID& GetID(); +Standard_EXPORT ~GEOMImpl_Fillet2dDriver() {}; + + + // Type management + // +Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_Fillet2dDriver_Type_(); +Standard_EXPORT const Handle(Standard_Type)& DynamicType() const { return STANDARD_TYPE(GEOMImpl_Fillet2dDriver) ; } +Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const { return (STANDARD_TYPE(GEOMImpl_Fillet2dDriver) == AType || TFunction_Driver::IsKind(AType)); } + + +}; + +#endif diff --git a/src/GEOMImpl/GEOMImpl_Gen.cxx b/src/GEOMImpl/GEOMImpl_Gen.cxx index ad458c33c..e0cd62fd4 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.cxx +++ b/src/GEOMImpl/GEOMImpl_Gen.cxx @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -131,6 +132,7 @@ GEOMImpl_Gen::GEOMImpl_Gen() // Local Operations TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ChamferDriver::GetID(), new GEOMImpl_ChamferDriver()); TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FilletDriver::GetID(), new GEOMImpl_FilletDriver()); + TFunction_DriverTable::Get()->AddDriver(GEOMImpl_Fillet2dDriver::GetID(), new GEOMImpl_Fillet2dDriver()); TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ArchimedeDriver::GetID(), new GEOMImpl_ArchimedeDriver()); // Geometrical Transformations, Offset, Scale diff --git a/src/GEOMImpl/GEOMImpl_IFillet2d.hxx b/src/GEOMImpl/GEOMImpl_IFillet2d.hxx new file mode 100755 index 000000000..ba67a6a18 --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_IFillet2d.hxx @@ -0,0 +1,51 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +//NOTE: This is an interface to a function for the Fillet2d and creation. + + +#include "GEOM_Function.hxx" + +#define FILLET2D_ARG_SH 1 +#define FILLET2D_ARG_R 2 +#define FILLET2D_ARG_LENG 3 +#define FILLET2D_ARG_LAST 4 + +class GEOMImpl_IFillet2d +{ + public: + + GEOMImpl_IFillet2d(Handle(GEOM_Function) theFunction): _func(theFunction) {} + + void SetShape(Handle(GEOM_Function) theRef) { _func->SetReference(FILLET2D_ARG_SH, theRef); } + Handle(GEOM_Function) GetShape() { return _func->GetReference(FILLET2D_ARG_SH); } + + void SetR(double theR) { _func->SetReal(FILLET2D_ARG_R, theR); } + void SetLength(int theLen) { _func->SetInteger(FILLET2D_ARG_LENG, theLen); } + void SetVertex(int theInd, int theVertex) + { _func->SetInteger(FILLET2D_ARG_LAST + theInd, theVertex); } + + double GetR() { return _func->GetReal(FILLET2D_ARG_R); } + int GetLength() { return _func->GetInteger(FILLET2D_ARG_LENG); } + int GetVertex(int theInd) { return _func->GetInteger(FILLET2D_ARG_LAST + theInd); } + + private: + + Handle(GEOM_Function) _func; +}; diff --git a/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx b/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx index c5f402992..33842e24a 100644 --- a/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx @@ -27,9 +27,11 @@ #include #include +#include #include #include +#include #include #include @@ -408,6 +410,75 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFacesR1R2 return aFillet; } +//============================================================================= +/*! + * MakeFillet2D + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFillet2D + (Handle(GEOM_Object) theShape, double theR, std::list theVertexes) +{ + SetErrorCode(KO); + + //Add a new Fillet object + Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_2D); + + //Add a new Fillet function + Handle(GEOM_Function) aFunction = + aFillet2D->AddFunction(GEOMImpl_Fillet2dDriver::GetID(), FILLET_2D_SHAPE_VERTEXES); + if (aFunction.IsNull()) return NULL; + + //Check if the function is set correctly + if (aFunction->GetDriverGUID() != GEOMImpl_Fillet2dDriver::GetID()) return NULL; + + GEOMImpl_IFillet2d aCI (aFunction); + + Handle(GEOM_Function) aRefShape = theShape->GetLastFunction(); + if (aRefShape.IsNull()) return NULL; + + aCI.SetShape(aRefShape); + aCI.SetR(theR); + int aLen = theVertexes.size(); + aCI.SetLength(aLen); + + int ind = 1; + std::list::iterator it = theVertexes.begin(); + for (; it != theVertexes.end(); it++, ind++) { + aCI.SetVertex(ind, (*it)); + } + + //Compute the Fillet value + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + if (!GetSolver()->ComputeFunction(aFunction)) { + SetErrorCode("2D Fillet driver failed"); + return NULL; + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return NULL; + } + + //Make a Python command + GEOM::TPythonDump pd (aFunction); + pd << aFillet2D << " = geompy.MakeFillet2D(" << theShape + << ", " << theR << ", ["; + + it = theVertexes.begin(); + pd << (*it++); + while (it != theVertexes.end()) { + pd << ", " << (*it++); + } + pd << "])"; + + SetErrorCode(OK); + return aFillet2D; +} + //============================================================================= /*! * MakeChamferAll diff --git a/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx b/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx index 4f65acc43..cffebf519 100644 --- a/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx @@ -45,6 +45,8 @@ class GEOMImpl_ILocalOperations : public GEOM_IOperations { Standard_EXPORT Handle(GEOM_Object) MakeFilletFacesR1R2 (Handle(GEOM_Object) theShape, double theR1, double theR2, std::list theFaces); + Standard_EXPORT Handle(GEOM_Object) MakeFillet2D (Handle(GEOM_Object) theShape, double theR, + std::list theVertexes); Standard_EXPORT Handle(GEOM_Object) MakeChamferAll (Handle(GEOM_Object) theShape, double theD); Standard_EXPORT Handle(GEOM_Object) MakeChamferEdge (Handle(GEOM_Object) theShape, diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index ec7b469d0..c12650765 100755 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -45,8 +45,9 @@ #define GEOM_ELLIPSE 18 #define GEOM_CIRC_ARC 19 -#define GEOM_FILLET 20 -#define GEOM_CHAMFER 21 +#define GEOM_FILLET 20 +#define GEOM_FILLET_2D 45 +#define GEOM_CHAMFER 21 #define GEOM_EDGE 22 #define GEOM_WIRE 23 @@ -227,6 +228,8 @@ #define FILLET_SHAPE_EDGES_2R 4 #define FILLET_SHAPE_FACES_2R 5 +#define FILLET_2D_SHAPE_VERTEXES 1 + #define CHAMFER_SHAPE_ALL 1 #define CHAMFER_SHAPE_EDGE 2 #define CHAMFER_SHAPE_FACES 3 diff --git a/src/GEOMImpl/Makefile.am b/src/GEOMImpl/Makefile.am index c68c850a2..236d4e3f6 100644 --- a/src/GEOMImpl/Makefile.am +++ b/src/GEOMImpl/Makefile.am @@ -55,6 +55,7 @@ salomeinclude_HEADERS = \ GEOMImpl_ISpline.hxx \ GEOMImpl_IEllipse.hxx \ GEOMImpl_IFillet.hxx \ + GEOMImpl_IFillet2d.hxx \ GEOMImpl_IChamfer.hxx \ GEOMImpl_ICopy.hxx \ GEOMImpl_IArchimede.hxx \ @@ -126,6 +127,7 @@ salomeinclude_HEADERS = \ GEOMImpl_SketcherDriver.hxx \ GEOMImpl_3DSketcherDriver.hxx \ GEOMImpl_FilletDriver.hxx \ + GEOMImpl_Fillet2dDriver.hxx \ GEOMImpl_ChamferDriver.hxx \ GEOMImpl_BooleanDriver.hxx \ GEOMImpl_PartitionDriver.hxx \ @@ -188,6 +190,7 @@ dist_libGEOMimpl_la_SOURCES = \ GEOMImpl_SketcherDriver.cxx \ GEOMImpl_3DSketcherDriver.cxx \ GEOMImpl_FilletDriver.cxx \ + GEOMImpl_Fillet2dDriver.cxx \ GEOMImpl_ChamferDriver.cxx \ GEOMImpl_BooleanDriver.cxx \ GEOMImpl_PartitionDriver.cxx \ diff --git a/src/GEOM_I/GEOM_ILocalOperations_i.cc b/src/GEOM_I/GEOM_ILocalOperations_i.cc index a9ec1fc6d..08423c6aa 100644 --- a/src/GEOM_I/GEOM_ILocalOperations_i.cc +++ b/src/GEOM_I/GEOM_ILocalOperations_i.cc @@ -219,6 +219,41 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFilletFacesR1R2 return GetObject(anObject); } +//============================================================================= +/*! + * MakeFillet2D + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFillet2D + (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR, + const GEOM::ListOfLong& theVertexes) +{ + GEOM::GEOM_Object_var aGEOMObject; + + if (theShape == NULL) return aGEOMObject._retn(); + + //Get the reference shape + Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject + (theShape->GetStudyID(), theShape->GetEntry()); + if (aShapeRef.IsNull()) return aGEOMObject._retn(); + + //Get the reference vertex + int ind = 0; + int aLen = theVertexes.length(); + list aVertexes; + for (; ind < aLen; ind++) { + aVertexes.push_back(theVertexes[ind]); + } + + //Create the Fillet + Handle(GEOM_Object) anObject = + GetOperations()->MakeFillet2D(aShapeRef, theR, aVertexes); + if (!GetOperations()->IsDone() || anObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(anObject); +} + //============================================================================= /*! * MakeChamferAll diff --git a/src/GEOM_I/GEOM_ILocalOperations_i.hh b/src/GEOM_I/GEOM_ILocalOperations_i.hh index 79a80acfc..d7a508f65 100644 --- a/src/GEOM_I/GEOM_ILocalOperations_i.hh +++ b/src/GEOM_I/GEOM_ILocalOperations_i.hh @@ -58,6 +58,9 @@ class GEOM_I_EXPORT GEOM_ILocalOperations_i : CORBA::Double theR1, CORBA::Double theR2, const GEOM::ListOfLong& theFaces); + + GEOM::GEOM_Object_ptr MakeFillet2D (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR, + const GEOM::ListOfLong& theVertexes); GEOM::GEOM_Object_ptr MakeChamferAll (GEOM::GEOM_Object_ptr theShape, CORBA::Double theD); diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.cc b/src/GEOM_I_Superv/GEOM_Superv_i.cc index 2ee744c7f..283910acf 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.cc +++ b/src/GEOM_I_Superv/GEOM_Superv_i.cc @@ -2766,6 +2766,26 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilletFacesR1R2 (GEOM::GEOM_Object_ptr return NULL; } +//============================================================================= +// MakeFillet2D: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFillet2D (GEOM::GEOM_Object_ptr theShape, + CORBA::Double theR, + GEOM::GEOM_List_ptr theVertexes) +{ + beginService( " GEOM_Superv_i::MakeFillet2D" ); + MESSAGE("GEOM_Superv_i::MakeFillet2D"); + if (GEOM_List_i* aListImplV = + dynamic_cast*>(GetServant(theVertexes, myPOA).in())) { + getLocalOp(); + GEOM::GEOM_Object_ptr anObj = myLocalOp->MakeFillet2D(theShape, theR, aListImplV->GetList()); + endService( " GEOM_Superv_i::MakeFillet2D" ); + return anObj; + } + endService( " GEOM_Superv_i::MakeFillet2D" ); + return NULL; +} + //============================================================================= // MakeChamferAll: //============================================================================= diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.hh b/src/GEOM_I_Superv/GEOM_Superv_i.hh index d667c1222..ca3781a07 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.hh +++ b/src/GEOM_I_Superv/GEOM_Superv_i.hh @@ -584,6 +584,8 @@ public: GEOM::GEOM_List_ptr theFaces); GEOM::GEOM_Object_ptr MakeFilletFacesR1R2 (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR1, CORBA::Double theR2, GEOM::GEOM_List_ptr theFaces); + GEOM::GEOM_Object_ptr MakeFillet2D (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR, + GEOM::GEOM_List_ptr theVertexes); GEOM::GEOM_Object_ptr MakeChamferAll (GEOM::GEOM_Object_ptr theShape, CORBA::Double theD); GEOM::GEOM_Object_ptr MakeChamferEdge (GEOM::GEOM_Object_ptr theShape, CORBA::Double theD1, CORBA::Double theD2, diff --git a/src/GEOM_SWIG/GEOM_TestAll.py b/src/GEOM_SWIG/GEOM_TestAll.py index f8d842be9..b852c52f5 100644 --- a/src/GEOM_SWIG/GEOM_TestAll.py +++ b/src/GEOM_SWIG/GEOM_TestAll.py @@ -235,6 +235,7 @@ def TestAll (geompy, math): IDlist_f = [f_ind_1, f_ind_2] #Local operations + Fillet2d = geompy.MakeFillet2D(Face3, radius, [4, 7, 9]) #(GEOM_Object_ptr, Double, ListOfLong)->GEOM_Object_ptr Fillet = geompy.MakeFillet (Prism, radius, ShapeTypeEdge, IDlist_e) #(GEOM_Object_ptr, Double, Short, ListOfLong)->GEOM_Object_ptr Fillet2 = geompy.MakeFilletR1R2 (Prism, 7., 13., ShapeTypeEdge, @@ -381,6 +382,7 @@ def TestAll (geompy, math): id_Fillet = geompy.addToStudy(Fillet, "Fillet") id_Fillet2 = geompy.addToStudy(Fillet2, "Fillet2") + id_Fillet2d = geompy.addToStudy(Fillet2d, "Fillet2D") id_Chamfer = geompy.addToStudy(Chamfer, "Chamfer on Edge") id_Chamfer2 = geompy.addToStudy(Chamfer2, "Chamfer on Faces") diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 072fd41f7..341506dd1 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -2408,6 +2408,20 @@ class geompyDC(GEOM._objref_GEOM_Gen): anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes) RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp) return anObj + + ## Perform a fillet on the specified edges/faces of the given shape + # @param theShape - Face Shape to perform fillet on. + # @param theR - Fillet radius. + # @param theListOfVertexes Global indices of vertexes to perform fillet on. + # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID(). + # @return New GEOM_Object, containing the result shape. + # + # @ref tui_fillet2d "Example" + def MakeFillet2D(self,theShape, theR, theListOfVertexes): + # Example: see GEOM_TestAll.py + anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes) + RaiseIfFailed("MakeFillet2D", self.LocalOp) + return anObj ## Perform a symmetric chamfer on all edges of the given shape. # @param theShape Shape, to perform chamfer on. diff --git a/src/OperationGUI/Makefile.am b/src/OperationGUI/Makefile.am index d92ee6493..79f12e7a0 100644 --- a/src/OperationGUI/Makefile.am +++ b/src/OperationGUI/Makefile.am @@ -32,6 +32,7 @@ salomeinclude_HEADERS = \ OperationGUI_ArchimedeDlg.h \ OperationGUI_PartitionDlg.h \ OperationGUI_FilletDlg.h \ + OperationGUI_Fillet2dDlg.h \ OperationGUI_ChamferDlg.h \ OperationGUI_GetShapesOnShapeDlg.h \ OperationGUI_ClippingDlg.h @@ -45,6 +46,7 @@ dist_libOperationGUI_la_SOURCES = \ OperationGUI_PartitionDlg.cxx \ OperationGUI_GetShapesOnShapeDlg.cxx \ OperationGUI_FilletDlg.cxx \ + OperationGUI_Fillet2dDlg.cxx \ OperationGUI_ChamferDlg.cxx \ OperationGUI_ClippingDlg.cxx @@ -53,6 +55,7 @@ MOC_FILES = \ OperationGUI_PartitionDlg_moc.cxx \ OperationGUI_GetShapesOnShapeDlg_moc.cxx\ OperationGUI_FilletDlg_moc.cxx \ + OperationGUI_Fillet2dDlg_moc.cxx \ OperationGUI_ChamferDlg_moc.cxx \ OperationGUI_ClippingDlg_moc.cxx diff --git a/src/OperationGUI/OperationGUI.cxx b/src/OperationGUI/OperationGUI.cxx index a220f99b2..a1099a7b2 100644 --- a/src/OperationGUI/OperationGUI.cxx +++ b/src/OperationGUI/OperationGUI.cxx @@ -38,6 +38,7 @@ #include "OperationGUI_PartitionDlg.h" // Method PARTITION #include "OperationGUI_ArchimedeDlg.h" // Method ARCHIMEDE #include "OperationGUI_FilletDlg.h" // Method FILLET +#include "OperationGUI_Fillet2dDlg.h" // Method FILLET 2D #include "OperationGUI_ChamferDlg.h" // Method CHAMFER #include "OperationGUI_ClippingDlg.h" // Clipping dialog box #include "OperationGUI_GetShapesOnShapeDlg.h" @@ -78,6 +79,7 @@ bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) case 506: ( new OperationGUI_ChamferDlg ( getGeometryGUI(), parent ) )->show(); break; case 507: ( new OperationGUI_ClippingDlg ( getGeometryGUI(), parent ) )->show(); break; case 508: ( new OperationGUI_GetShapesOnShapeDlg( getGeometryGUI(), parent ) )->show(); break; + case 509: ( new OperationGUI_Fillet2dDlg ( getGeometryGUI(), parent ) )->show(); break; default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); } diff --git a/src/OperationGUI/OperationGUI_Fillet2dDlg.cxx b/src/OperationGUI/OperationGUI_Fillet2dDlg.cxx new file mode 100755 index 000000000..055b513dd --- /dev/null +++ b/src/OperationGUI/OperationGUI_Fillet2dDlg.cxx @@ -0,0 +1,400 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : OperationGUI_Fillet2dDlg.cxx +// Author : DMV, OCN. +// + +#include "OperationGUI_Fillet2dDlg.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +// OCCT Includes +#include +#include + +#include + +//================================================================================= +// class : OperationGUI_Fillet2dDlg() +// purpose : Constructs a OperationGUI_Fillet2dDlg which is a child of 'parent', with the +// name 'name' and widget flags set to 'f'. +// The dialog will by default be modeless, unless you set 'modal' to +// TRUE to construct a modal dialog. +//================================================================================= +OperationGUI_Fillet2dDlg::OperationGUI_Fillet2dDlg (GeometryGUI* theGeometryGUI, QWidget* parent) + : GEOMBase_Skeleton(theGeometryGUI, parent, false) +{ + SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); + QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FILLET_2D"))); + QPixmap iconSelect (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); + + setWindowTitle(tr("GEOM_FILLET_2D_TITLE")); + + /***************************************************************/ + mainFrame()->GroupConstructors->setTitle(tr("GEOM_FILLET_2D")); + mainFrame()->RadioButton1->setIcon(image0); + mainFrame()->RadioButton2->close(); + mainFrame()->RadioButton3->close(); + + GroupVertexes = new DlgRef_2Sel1Spin(centralWidget()); + GroupVertexes->GroupBox1->setTitle(tr("GEOM_FILLET_2D")); + GroupVertexes->TextLabel1->setText(tr("GEOM_MAIN_OBJECT")); + GroupVertexes->TextLabel2->setText(tr("GEOM_VERTEXES")); + GroupVertexes->TextLabel3->setText(tr("GEOM_RADIUS")); + GroupVertexes->PushButton1->setIcon(iconSelect); + GroupVertexes->PushButton2->setIcon(iconSelect); + GroupVertexes->LineEdit1->setReadOnly(true); + GroupVertexes->LineEdit2->setReadOnly(true); + + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); + layout->setMargin(0); layout->setSpacing(6); + layout->addWidget(GroupVertexes); + + /***************************************************************/ + + // Set range of spinboxes + double SpecificStep = 10.0; + initSpinBox(GroupVertexes->SpinBox_DX, 0.00001, COORD_MAX, SpecificStep, 5); // VSR: TODO: DBL_DIGITS_DISPLAY + + setHelpFileName("fillet2d_operation_page.html"); + + // Initialisation + Init(); + resize(0,0); +} + +//================================================================================= +// function : ~OperationGUI_Fillet2dDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +OperationGUI_Fillet2dDlg::~OperationGUI_Fillet2dDlg() +{ +} + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void OperationGUI_Fillet2dDlg::Init() +{ + // Set Initial values of spinboxes + GroupVertexes->SpinBox_DX->setValue(5); + + // Clear line edits + GroupVertexes->LineEdit1->setText(""); + GroupVertexes->LineEdit2->setText(""); + + myShape = GEOM::GEOM_Object::_nil(); + + myVertexes.Clear(); + + // signals and slots connections + + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk() )); + connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); + + // connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int))); + + connect(GroupVertexes->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(GroupVertexes->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(GroupVertexes->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupVertexes->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + + connect(GroupVertexes->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + + initName(tr("GEOM_FILLET_2D")); + GroupVertexes->PushButton1->click(); +} + +//================================================================================= +// function : ClickOnOk() +// purpose : +//================================================================================= +void OperationGUI_Fillet2dDlg::ClickOnOk() +{ + if (ClickOnApply()) + ClickOnCancel(); +} + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +bool OperationGUI_Fillet2dDlg::ClickOnApply() +{ + if (!onAccept()) + return false; + + initName(); + // Reset dialog state + GroupVertexes->LineEdit1->setText(""); + GroupVertexes->LineEdit2->setText(""); + myShape = GEOM::GEOM_Object::_nil(); + myVertexes.Clear(); + GroupVertexes->PushButton1->click(); + + return true; +} + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection is changed or on dialog initialization or activation +//================================================================================= +void OperationGUI_Fillet2dDlg::SelectionIntoArgument() +{ + erasePreview(); + myEditCurrentArgument->setText(""); + + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + SALOME_ListIO aSelList; + aSelMgr->selectedObjects(aSelList); + + // If selection of main object is activated + if (myEditCurrentArgument == GroupVertexes->LineEdit1) { + myShape = GEOM::GEOM_Object::_nil(); + if (aSelList.Extent() == 1) { + Standard_Boolean aResult = Standard_False; + GEOM::GEOM_Object_var anObj = + GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + + if (aResult && !anObj->_is_nil()) { + QString aName = GEOMBase::GetName( anObj ); + TopoDS_Shape aShape; + if ( GEOMBase::GetShape( anObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) { + TColStd_IndexedMapOfInteger aMap; + aSelMgr->GetIndexes(aSelList.First(), aMap); + if ( aMap.Extent() == 1 ) { // Local Selection + int anIndex = aMap( 1 ); + aName += QString( ":face_%1" ).arg( anIndex ); + + //Find SubShape Object in Father + GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( anObj, aName ); + + if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); + anObj = aShapesOp->GetSubShape( anObj, anIndex ); + } + else + anObj = aFindedObject; // get Object from study + } + else { // Global Selection + if ( aShape.ShapeType() != TopAbs_FACE ) { + anObj = GEOM::GEOM_Object::_nil(); + aName = ""; + } + } + } + myShape = anObj; + myEditCurrentArgument->setText(aName +); + displayPreview(); + } + } + } else if (myEditCurrentArgument == GroupVertexes->LineEdit2) { + myVertexes.Clear(); + if (aSelList.Extent() == 1) { + Standard_Boolean aResult = Standard_False; + GEOM::GEOM_Object_var anObj = + GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + + if (aResult && !anObj->_is_nil()) { + TColStd_IndexedMapOfInteger anIndexes; + aSelMgr->GetIndexes(aSelList.First(), anIndexes); + + if (anIndexes.Extent() > 0) { + QString aName; + if (anIndexes.Extent() == 1) { + int anIndex = anIndexes(1); + aName = QString(GEOMBase::GetName(anObj)) + QString(":vertex_%1").arg(anIndex); + } + else + aName = tr("GEOM_MEN_POPUP_NAME").arg(anIndexes.Extent()); + + myEditCurrentArgument->setText(aName); + myVertexes = anIndexes; + displayPreview(); + } + } + } + } + + if (myEditCurrentArgument == GroupVertexes->LineEdit1) { + if (!myShape->_is_nil() && myVertexes.Extent() == 0) + GroupVertexes->PushButton2->click(); + } +} + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void OperationGUI_Fillet2dDlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + if (send == GroupVertexes->PushButton1) { + myEditCurrentArgument = GroupVertexes->LineEdit1; + GroupVertexes->PushButton2->setDown(false); + GroupVertexes->LineEdit2->setEnabled(false); + } + else if (send == GroupVertexes->PushButton2) { + myEditCurrentArgument = GroupVertexes->LineEdit2; + GroupVertexes->PushButton1->setDown(false); + GroupVertexes->LineEdit1->setEnabled(false); + } + + // enable line edit + myEditCurrentArgument->setEnabled(true); + myEditCurrentArgument->setFocus(); + // after setFocus(), because it will be setDown(false) when loses focus + send->setDown(true); + + activateSelection(); + + // seems we need it only to avoid preview disappearing, caused by selection mode change + displayPreview(); +} + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void OperationGUI_Fillet2dDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + + if (send == GroupVertexes->LineEdit1) + myEditCurrentArgument = GroupVertexes->LineEdit1; + else if (send == GroupVertexes->LineEdit2) + myEditCurrentArgument = GroupVertexes->LineEdit2; + else + return; + + GEOMBase_Skeleton::LineEditReturnPressed(); +} + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void OperationGUI_Fillet2dDlg::ActivateThisDialog() +{ + GEOMBase_Skeleton::ActivateThisDialog(); +} + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void OperationGUI_Fillet2dDlg::enterEvent (QEvent*) +{ + if (!mainFrame()->GroupConstructors->isEnabled()) + this->ActivateThisDialog(); +} + +//================================================================================= +// function : ValueChangedInSpinBox() +// purpose : +//================================================================================= +void OperationGUI_Fillet2dDlg::ValueChangedInSpinBox (double) +{ + displayPreview(); +} + +//================================================================================= +// function : activateSelection +// purpose : Activate selection in accordance with myEditCurrentArgument +//================================================================================= +void OperationGUI_Fillet2dDlg::activateSelection() +{ + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + globalSelection(); + if (myEditCurrentArgument == GroupVertexes->LineEdit1) + globalSelection( GEOM_FACE ); // localSelection(myShape, TopAbs_FACE); + else if (!myShape->_is_nil() && myEditCurrentArgument == GroupVertexes->LineEdit2) + localSelection(myShape, TopAbs_VERTEX); + + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); +} + +//================================================================================= +// function : createOperation +// purpose : +//================================================================================= +GEOM::GEOM_IOperations_ptr OperationGUI_Fillet2dDlg::createOperation() +{ + return getGeomEngine()->GetILocalOperations(getStudyId()); +} + +//================================================================================= +// function : isValid() +// purpose : Verify validity of input data +//================================================================================= +bool OperationGUI_Fillet2dDlg::isValid (QString&) +{ + return !myShape->_is_nil() && myVertexes.Extent() > 0; +} + +//================================================================================= +// function : execute +// purpose : +//================================================================================= +bool OperationGUI_Fillet2dDlg::execute (ObjectList& objects) +{ + GEOM::GEOM_Object_var anObj; + + GEOM::ListOfLong_var aListOfIndexes = new GEOM::ListOfLong; + aListOfIndexes->length(myVertexes.Extent()); + + for (int i = 1, n = myVertexes.Extent(); i <= n; i++) + aListOfIndexes[ i - 1 ] = myVertexes(i); + + anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())-> + MakeFillet2D(myShape, getRadius(), aListOfIndexes); + + if (!anObj->_is_nil()) + objects.push_back(anObj._retn()); + + return true; +} + +//================================================================================= +// function : getRadius +// purpose : Get radius +//================================================================================= +double OperationGUI_Fillet2dDlg::getRadius() const +{ + return GroupVertexes ->SpinBox_DX->value(); +} diff --git a/src/OperationGUI/OperationGUI_Fillet2dDlg.h b/src/OperationGUI/OperationGUI_Fillet2dDlg.h new file mode 100755 index 000000000..523dbad04 --- /dev/null +++ b/src/OperationGUI/OperationGUI_Fillet2dDlg.h @@ -0,0 +1,75 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : OperationGUI_Fillet2dDlg.h +// Author : DMV, OCN +// + +#ifndef OPERATIONGUI_FILLET2DDLG_H +#define OPERATIONGUI_FILLET2DDLG_H + +#include + +#include + +class DlgRef_2Sel1Spin; + +//================================================================================= +// class : OperationGUI_Fillet2dDlg +// purpose : +//================================================================================= +class OperationGUI_Fillet2dDlg : public GEOMBase_Skeleton +{ + Q_OBJECT + +public: + OperationGUI_Fillet2dDlg( GeometryGUI*, QWidget* ); + ~OperationGUI_Fillet2dDlg(); + +protected: + // redefined from GEOMBase_Helper + virtual GEOM::GEOM_IOperations_ptr createOperation(); + virtual bool isValid( QString& ); + virtual bool execute( ObjectList& ); + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + void ActivateThisDialog(); + void LineEditReturnPressed(); + void SelectionIntoArgument(); + void SetEditCurrentArgument(); + void ValueChangedInSpinBox( double ); + +private: + void Init(); + void enterEvent( QEvent* ); + void activateSelection(); + double getRadius() const; + +private: + GEOM::GEOM_Object_var myShape; + TColStd_IndexedMapOfInteger myVertexes; + + DlgRef_2Sel1Spin* GroupVertexes; +}; + +#endif // OPERATIONGUI_FILLET2DDLG_H