From 8a7faf3ee59656292ab87845df7bf01032f30d26 Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 15 Aug 2012 10:34:21 +0000 Subject: [PATCH] Mantis issue 0021483: EDF 1638 GEOM: Retrieve non blocks solids and faces from a shape. --- doc/salome/gui/GEOM/images/measures2.png | Bin 0 -> 21135 bytes doc/salome/gui/GEOM/input/get_non_blocks.doc | 23 ++ .../gui/GEOM/input/tui_get_non_blocks.doc | 32 ++ .../gui/GEOM/input/tui_measurement_tools.doc | 1 + .../gui/GEOM/input/tui_test_spanner.doc | 5 + .../GEOM/input/using_measurement_tools.doc | 3 +- idl/GEOM_Gen.idl | 11 + resources/Makefile.am | 1 + resources/get_non_blocks.png | Bin 0 -> 1004 bytes src/GEOMGUI/GEOM_images.ts | 8 + src/GEOMGUI/GEOM_msg_en.ts | 24 ++ src/GEOMGUI/GeometryGUI.cxx | 4 + src/GEOMGUI/GeometryGUI_Operations.h | 38 +-- src/GEOMImpl/GEOMImpl_BlockDriver.cxx | 3 +- src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx | 155 +++++++++- src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx | 13 +- src/GEOM_I/GEOM_IBlocksOperations_i.cc | 34 ++- src/GEOM_I/GEOM_IBlocksOperations_i.hh | 4 +- src/GEOM_SWIG/GEOM_Spanner.py | 10 +- src/GEOM_SWIG/GEOM_TestOthers.py | 5 + src/GEOM_SWIG/geompyDC.py | 30 ++ src/MeasureGUI/Makefile.am | 4 +- src/MeasureGUI/MeasureGUI.cxx | 5 +- src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx | 2 +- src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx | 277 ++++++++++++++++++ src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.h | 69 +++++ 26 files changed, 720 insertions(+), 41 deletions(-) create mode 100644 doc/salome/gui/GEOM/images/measures2.png create mode 100644 doc/salome/gui/GEOM/input/get_non_blocks.doc create mode 100644 doc/salome/gui/GEOM/input/tui_get_non_blocks.doc create mode 100644 resources/get_non_blocks.png create mode 100644 src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx create mode 100644 src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.h diff --git a/doc/salome/gui/GEOM/images/measures2.png b/doc/salome/gui/GEOM/images/measures2.png new file mode 100644 index 0000000000000000000000000000000000000000..21e5218a40ea5f27255b8b25ccf88bde62af74ef GIT binary patch literal 21135 zcmeFZbzD?`yZ1XP;7B79(g=bAQqm~{(jna-AT@M%C__jp2uO=acQ;6jbPV0y-T8d| z{q}u7d*6GX=j?s{IRBh8FMKf~vu4d&>w8_F&-?l;KfaNdz(OZMhd>}$Qj%gy5XhZq z@W%*x7yQKi;Eoyi_P|zB(*Xj(ZvFG;PBbGnDfl6y<7*8^F=GcKdvjYya~o@jy1Df` z8y6~3O9KZ7J}O1W7Y_xs*?vIwbsT%oTTww}A#KB>bRH+Izo_mb?i{n(#zCd)ByOf)qwtzX}Ryu$zN z6`&giflxuD#6(nF6St<_H1O3Y@6WxA>%9Abnu>}l#25Ok1RC`1Rhd(ZZmyb_wuOcE z@p0)$IRVPBbh%dfNx3ScvtpUkYpYztT&H_?2z2gXL7!a`!l2`H=QqS*k0dc4BGw#Y zb4OWuS9whz9yqYa$+A`+&(^)h7K1?Es$egwf2{oV-s|FMeJc(Ec{N$*go6jAuGSeD ze|ZPu%SD3=V~;B<&AbDFScy|1me|K`@BVZhm>ASRKCX|4`}mte5uaqSFZIz5$FGE- zsgyV?vFc7+^%FPmYqX0^6r5f|^KW;OsZB>X13Z}T2`LGZkJB`7yXv3?q$2bW87%Y; zu$wlM^mT1-yM_@^jEe2;=H+-c6$U5O{3GiE)@7}82mW@?jR@R{a+b`zlH$e8Y}Mup zoGY~J(e{yiMw}m?gwJJyZv_m^bxK55k>@Szom3ISL9E;u4&oa~3r)?q1a2F0&T|aL zgk-e%Z$f&zR~zt-#_q8r-l5CA?zm+F71s?6XJ5H@@$qjhgg zgi3aH1_zX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ZP{X#@Y=I zdY})HV<~>Nbv%{BQ$&Ds@B>|3Oa8UGczSkr=Jz6ZDH(}C1ZYb25GghHA@2WW%imqzlFZ$BfGaDq*Mj2>Gri>c zLs|Cmc~}G@Ph}i}Uw_}g|K1>Wb{n9 literal 0 HcmV?d00001 diff --git a/doc/salome/gui/GEOM/input/get_non_blocks.doc b/doc/salome/gui/GEOM/input/get_non_blocks.doc new file mode 100644 index 000000000..8df0e324c --- /dev/null +++ b/doc/salome/gui/GEOM/input/get_non_blocks.doc @@ -0,0 +1,23 @@ +/*! + +\page get_non_blocks_page Get Non Blocks + +\image html measures2.png + +Retrieve all non blocks solids and faces from the given shape. +Collect them in two groups: solids and faces separately. + +\n Result: Two or less groups are published in the Object + Browser under the processed object. Reports error if + no bad sub-shapes (solids and faces) have been found. + +\n TUI Command: +geompy.GetNonBlocks(Compound). Returns a tuple of two + GEOM_Objects. The first object is a group of all non block solids + (= not 6 faces, or with 6 faces, but with the presence of + non-quadrangular faces). The second object is a group of all non + quadrangular faces. + +See also a \ref tui_get_non_blocks_page "TUI example". + +*/ diff --git a/doc/salome/gui/GEOM/input/tui_get_non_blocks.doc b/doc/salome/gui/GEOM/input/tui_get_non_blocks.doc new file mode 100644 index 000000000..6f648f9a0 --- /dev/null +++ b/doc/salome/gui/GEOM/input/tui_get_non_blocks.doc @@ -0,0 +1,32 @@ +/*! + +\page tui_get_non_blocks_page Get Non Blocks + +\code +import geompy +import salome + +# create solids +box = geompy.MakeBoxDXDYDZ(100, 100, 100) +cyl = geompy.MakeCylinderRH(100, 200) + +geompy.addToStudy(box, 'box') +geompy.addToStudy(cyl, 'cyl') + +# make a compound +compound = geompy.MakeCompound([box1, box2]) +geompy.addToStudy(compound, 'compound') + +# explore the compound +pair = geompy.GetNonBlocks(compound) + +if pair[0] is not None: + geompy.addToStudyInFather(compound, pair[0], "GrNonBlocks") + pass + +if pair[1] is not None: + geompy.addToStudyInFather(compound, pair[1], "GrNonQuads") + pass +\endcode + +*/ diff --git a/doc/salome/gui/GEOM/input/tui_measurement_tools.doc b/doc/salome/gui/GEOM/input/tui_measurement_tools.doc index 4ce9b4239..583f3de0f 100644 --- a/doc/salome/gui/GEOM/input/tui_measurement_tools.doc +++ b/doc/salome/gui/GEOM/input/tui_measurement_tools.doc @@ -17,6 +17,7 @@

  • \subpage tui_free_faces_page
  • \subpage tui_check_shape_page
  • \subpage tui_check_compound_of_blocks_page
  • +
  • \subpage tui_get_non_blocks_page
  • \subpage tui_check_self_intersections_page
  • diff --git a/doc/salome/gui/GEOM/input/tui_test_spanner.doc b/doc/salome/gui/GEOM/input/tui_test_spanner.doc index 5c9df4651..81b212de6 100644 --- a/doc/salome/gui/GEOM/input/tui_test_spanner.doc +++ b/doc/salome/gui/GEOM/input/tui_test_spanner.doc @@ -35,6 +35,11 @@ \anchor swig_GetOppositeFace \until id_face41 +\until id_glueALL + +\anchor swig_GetNonBlocks +\until Spanner is a + \anchor spanner_continue \until return Spanner diff --git a/doc/salome/gui/GEOM/input/using_measurement_tools.doc b/doc/salome/gui/GEOM/input/using_measurement_tools.doc index 7e18a1ddf..513f6077f 100644 --- a/doc/salome/gui/GEOM/input/using_measurement_tools.doc +++ b/doc/salome/gui/GEOM/input/using_measurement_tools.doc @@ -25,6 +25,7 @@ concerning created or imported geometrical objects :
  • \subpage free_faces_page "Check Free Faces"
  • \subpage check_shape_page "Check Shape"
  • \subpage check_compound_of_blocks_page "Check compound of blocks"
  • +
  • \subpage get_non_blocks_page "Get non blocks"
  • \subpage check_self_intersections_page "Detect Self-intersections"
  • @@ -32,4 +33,4 @@ concerning created or imported geometrical objects : \ref tui_measurement_tools_page "Measurement Tools" with TUI commands. -*/ \ No newline at end of file +*/ diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index f3a41ad16..209ac2bd3 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -2403,6 +2403,17 @@ module GEOM string PrintBCErrors (in GEOM_Object theCompound, in BCErrors theErrors); + /*! + * \brief Retrieve all non blocks solids and faces from a shape. + * + * \param theShape The shape to explore. + * \param theNonQuads Output parameter. Group of all non quadrangular faces. + * + * \return Group of all non block solids (= not 6 faces, or with 6 + * faces, but with the presence of non-quadrangular faces). + */ + GEOM_Object GetNonBlocks (in GEOM_Object theShape, out GEOM_Object theNonQuads); + /*! * \brief Remove all seam and degenerated edges from \a theShape. * diff --git a/resources/Makefile.am b/resources/Makefile.am index d5aab779c..57c92dd2d 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -232,6 +232,7 @@ group_new.png \ group_edit.png \ glue.png \ check_blocks_compound.png \ +get_non_blocks.png \ check_self_intersections.png \ free_faces.png \ propagate.png \ diff --git a/resources/get_non_blocks.png b/resources/get_non_blocks.png new file mode 100644 index 0000000000000000000000000000000000000000..b13b294f21933b19b982b85add00ee6b12bc2d7f GIT binary patch literal 1004 zcmVz@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZGPUI82S=kI^8fxmwL zW2jwp1}vA8lf%Hu%F4jZ%naA~>(?)aFJHbeeE9Hz;mw;j3@={1V7PhnCL=%qfo%WZ zy!<=^D>Ea5#J39!fByVo`1$iE!|&g}86I+3FtD*OF&vp&$l#heiGhiU5o7@KWw&Ga|Mw5b84QfT@KXADh~bp5KZBOmYlfH7p$v@BMD`!3m+SW*hDS5w z7=8i``~B@B11voQ1P}`-7C{03HGMXN!mG_-n^;&_!1%h5Hv2C z_lpByahMAM0*D1I?|ubRcR_41F)@ZeKfW+XK3~UhliP;j&%bX#1AYL*@ejja#vcrS z7{3Df#~5BR$uYdXu?>`r4uJFl1P}|ZJPER0^zkZ&+Z<*Le?Gim`1A8C!(UL~1HJqg z=;eREATE4$aVx|3@83a&eF5nM2p~pW<)M&}(0`By7>21sSC3@a1)y9lKmg%%Autyh z0I38ZHXu;IfDHrU9Uu-s0I?8Ic!!7*3lxb*poTI41Q1Ry17n;Ulzc!jPJ|0zKqHg^ aAiw|{nb#QiH{cck0000ICON_DLG_CHECK_COMPOUND_OF_BLOCKS check_blocks_compound.png + + ICON_DLG_GETNONBLOCKS + get_non_blocks.png + ICON_DLG_CHECK_SELF_INTERSECTIONS check_self_intersections.png @@ -739,6 +743,10 @@ ICO_CHECK_COMPOUND check_blocks_compound.png + + ICO_GET_NON_BLOCKS + get_non_blocks.png + ICO_CHECK_SELF_INTERSECTIONS check_self_intersections.png diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index cf4c13db2..4f503aae2 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -357,6 +357,18 @@ Please, select face, shell or solid and try again GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES Incriminated Sub-shapes + + GEOM_GETNONBLOCKS_TITLE + Get non-hexahedral solids and non-quadrangular faces + + + GEOM_GETNONBLOCKS + Get non blocks + + + GEOM_NONBLOCKS + NonBlocksGroup + GEOM_CHECK_INFOS Object And Its Topological Information @@ -2310,6 +2322,10 @@ Please, select face, shell or solid and try again MEN_CHECK_COMPOUND Check Compound of Blocks + + MEN_GET_NON_BLOCKS + Get Non Blocks + MEN_CHECK_SELF_INTERSECTIONS Detect Self-intersections @@ -3154,6 +3170,10 @@ Please, select face, shell or solid and try again STB_CHECK_COMPOUND Check compound of blocks + + STB_GET_NON_BLOCKS + Get non blocks + STB_CHECK_SELF_INTERSECTIONS Detect Self-intersections @@ -3762,6 +3782,10 @@ Please, select face, shell or solid and try again TOP_CHECK_COMPOUND Check compound of blocks + + TOP_GET_NON_BLOCKS + Get non blocks + TOP_CHECK_SELF_INTERSECTIONS Detect Self-intersections diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 23694246d..6ae6b95e6 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -549,6 +549,7 @@ void GeometryGUI::OnGUIEvent( int id ) case GEOMOp::OpWhatIs: // MENU MEASURE - WHATIS case GEOMOp::OpCheckShape: // MENU MEASURE - CHECK case GEOMOp::OpCheckCompound: // MENU MEASURE - CHECK COMPOUND OF BLOCKS + case GEOMOp::OpGetNonBlocks: // MENU MEASURE - Get NON BLOCKS case GEOMOp::OpPointCoordinates: // MENU MEASURE - POINT COORDINATES case GEOMOp::OpCheckSelfInters: // MENU MEASURE - CHECK SELF INTERSECTIONS libName = "MeasureGUI"; @@ -829,6 +830,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::OpWhatIs, "WHAT_IS" ); createGeomAction( GEOMOp::OpCheckShape, "CHECK" ); createGeomAction( GEOMOp::OpCheckCompound, "CHECK_COMPOUND" ); + createGeomAction( GEOMOp::OpGetNonBlocks, "GET_NON_BLOCKS" ); createGeomAction( GEOMOp::OpCheckSelfInters, "CHECK_SELF_INTERSECTIONS" ); #ifdef _DEBUG_ // PAL16821 @@ -1059,6 +1061,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( GEOMOp::OpWhatIs, measurId, -1 ); createMenu( GEOMOp::OpCheckShape, measurId, -1 ); createMenu( GEOMOp::OpCheckCompound, measurId, -1 ); + createMenu( GEOMOp::OpGetNonBlocks, measurId, -1 ); createMenu( GEOMOp::OpCheckSelfInters, measurId, -1 ); #ifdef _DEBUG_ // PAL16821 @@ -1196,6 +1199,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( GEOMOp::OpWhatIs, measureTbId ); createTool( GEOMOp::OpCheckShape, measureTbId ); createTool( GEOMOp::OpCheckCompound, measureTbId ); + createTool( GEOMOp::OpGetNonBlocks, measureTbId ); createTool( GEOMOp::OpCheckSelfInters, measureTbId ); int picturesTbId = createTool( tr( "TOOL_PICTURES" ) ); diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h index 3d8a41d4e..9cb259b5d 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -24,7 +24,7 @@ namespace GEOMOp { enum { - // ToolsGUI ------------------//-------------------------------- + // ToolsGUI --------------------//-------------------------------- OpImport = 1000, // MENU FILE - IMPORT OpExport = 1001, // MENU FILE - EXPORT OpDelete = 1020, // MENU EDIT - DELETE @@ -57,7 +57,7 @@ namespace GEOMOp { OpEdgeWidth = 1260, // POPUP MENU - LINE WIDTH - EDGE WIDTH OpIsosWidth = 1261, // POPUP MENU - LINE WIDTH - ISOS WIDTH - // DisplayGUI ----------------//-------------------------------- + // DisplayGUI ------------------//-------------------------------- OpSwitchVectors = 2001, // MENU VIEW - DISPLAY MODE - SHOW/HIDE EDGE DIRECTION OpShowAll = 2002, // MENU VIEW - SHOW ALL OpHideAll = 2003, // MENU VIEW - HIDE ALL @@ -74,7 +74,7 @@ namespace GEOMOp { OpTexture = 2204, // POPUP MENU - DISPLAY MODE - TEXTURE OpBringToFront = 2205, // POPUP MENU - BRING TO FRONT OpClsBringToFront = 2206, - // BasicGUI ------------------//-------------------------------- + // BasicGUI --------------------//-------------------------------- OpPoint = 3000, // MENU NEW ENTITY - BASIC - POINT OpLine = 3001, // MENU NEW ENTITY - BASIC - LINE OpCircle = 3002, // MENU NEW ENTITY - BASIC - CIRCLE @@ -85,7 +85,7 @@ namespace GEOMOp { OpCurve = 3007, // MENU NEW ENTITY - BASIC - CURVE OpLCS = 3008, // MENU NEW ENTITY - BASIC - LOCAL COORDINATE SYSTEM OpOriginAndVectors = 3009, // MENU NEW ENTITY - BASIC - ORIGIN AND BASE VECTORS - // PrimitiveGUI --------------//-------------------------------- + // PrimitiveGUI ----------------//-------------------------------- OpBox = 3100, // MENU NEW ENTITY - PRIMITIVES - BOX OpCylinder = 3101, // MENU NEW ENTITY - PRIMITIVES - CYLINDER OpSphere = 3102, // MENU NEW ENTITY - PRIMITIVES - SPHERE @@ -93,12 +93,12 @@ namespace GEOMOp { OpCone = 3104, // MENU NEW ENTITY - PRIMITIVES - CONE OpRectangle = 3105, // MENU NEW ENTITY - PRIMITIVES - FACE OpDisk = 3106, // MENU NEW ENTITY - PRIMITIVES - DISK - // GenerationGUI -------------//-------------------------------- + // GenerationGUI ---------------//-------------------------------- OpPrism = 3200, // MENU NEW ENTITY - GENERATION - EXTRUSION OpRevolution = 3201, // MENU NEW ENTITY - GENERATION - REVOLUTION OpFilling = 3202, // MENU NEW ENTITY - GENERATION - FILLING OpPipe = 3203, // MENU NEW ENTITY - GENERATION - EXTRUSION ALONG PATH - // EntityGUI -----------------//-------------------------------- + // EntityGUI -------------------//-------------------------------- Op2dSketcher = 3300, // MENU NEW ENTITY - SKETCHER Op3dSketcher = 3301, // MENU NEW ENTITY - 3D SKETCHER OpExplode = 3302, // MENU NEW ENTITY - EXPLODE @@ -106,20 +106,19 @@ namespace GEOMOp { OpFeatureDetect = 3303, // MENU NEW ENTITY - FEATURE DETECTION #endif OpPictureImport = 3304, // MENU NEW ENTITY - IMPORT PICTURE IN VIEWER - - // BuildGUI ------------------//-------------------------------- + // BuildGUI --------------------//-------------------------------- OpEdge = 3400, // MENU NEW ENTITY - BUILD - EDGE OpWire = 3401, // MENU NEW ENTITY - BUILD - WIRE OpFace = 3402, // MENU NEW ENTITY - BUILD - FACE OpShell = 3403, // MENU NEW ENTITY - BUILD - SHELL OpSolid = 3404, // MENU NEW ENTITY - BUILD - SOLID OpCompound = 3405, // MENU NEW ENTITY - BUILD - COMPOUND - // BooleanGUI ----------------//-------------------------------- + // BooleanGUI ------------------//-------------------------------- OpFuse = 3500, // MENU OPERATIONS - BOOLEAN - FUSE OpCommon = 3501, // MENU OPERATIONS - BOOLEAN - COMMON OpCut = 3502, // MENU OPERATIONS - BOOLEAN - CUT OpSection = 3503, // MENU OPERATIONS - BOOLEAN - SECTION - // TransformationGUI ---------//-------------------------------- + // TransformationGUI -----------//-------------------------------- OpTranslate = 3600, // MENU OPERATIONS - TRANSFORMATION - TRANSLATION OpRotate = 3601, // MENU OPERATIONS - TRANSFORMATION - ROTATION OpChangeLoc = 3602, // MENU OPERATIONS - TRANSFORMATION - LOCATION @@ -130,7 +129,7 @@ namespace GEOMOp { OpMultiRotate = 3607, // MENU OPERATIONS - TRANSFORMATION - MULTI-ROTATION OpReimport = 3608, // POPUP MENU - RELOAD IMPORTED OpProjection = 3609, // MENU OPERATIONS - TRANSFORMATION - PROJECTION - // OperationGUI + // OperationGUI ----------------//-------------------------------- OpPartition = 3700, // MENU OPERATION - PARTITION OpArchimede = 3701, // MENU OPERATION - ARCHIMEDE OpFillet3d = 3702, // MENU OPERATION - FILLET @@ -142,7 +141,7 @@ namespace GEOMOp { OpSharedShapes = 3708, // MENU OPERATION - GET SHARED SHAPES OpExtrudedBoss = 3709, // MENU OPERATION - ETRUDED BOSS OpExtrudedCut = 3710, // MENU OPERATION - ETRUDED CUT - // RepairGUI -----------------//-------------------------------- + // RepairGUI -------------------//-------------------------------- OpSewing = 4000, // MENU REPAIR - SEWING OpSuppressFaces = 4001, // MENU REPAIR - SUPPRESS FACES OpSuppressHoles = 4002, // MENU REPAIR - SUPPRESS HOLES @@ -158,7 +157,7 @@ namespace GEOMOp { OpLimitTolerance = 4012, // MENU REPAIR - LIMIT TOLERANCE OpGlueEdges = 4013, // MENU REPAIR - GLUE EDGES OpFuseEdges = 4014, // MENU REPAIR - FUSE COLLINEAR EDGES - // MeasureGUI ----------------//-------------------------------- + // MeasureGUI ------------------//-------------------------------- OpProperties = 5000, // MENU MEASURES - PROPERTIES OpCenterMass = 5001, // MENU MEASURES - CENTRE OF MASS OpInertia = 5002, // MENU MEASURES - INERTIA @@ -172,22 +171,23 @@ namespace GEOMOp { OpCheckCompound = 5010, // MENU MEASURES - CHECK COMPOUND OF BLOCKS OpPointCoordinates = 5011, // MENU MEASURES - POINT COORDINATES OpCheckSelfInters = 5012, // MENU MEASURES - CHECK SELF INTERSECTIONS - // GroupGUI ------------------//-------------------------------- + OpGetNonBlocks = 5013, // MENU MEASURES - GET NON BLOCKS + // GroupGUI --------------------//-------------------------------- OpGroupCreate = 6000, // MENU GROUP - CREATE OpGroupEdit = 6001, // MENU GROUP - EDIT OpGroupCreatePopup = 6002, // POPUP MENU - CREATE GROUP - // BlocksGUI -----------------//-------------------------------- + // BlocksGUI -------------------//-------------------------------- OpHexaSolid = 6100, // MENU BLOCKS - HEXAHEDRAL SOLID OpMultiTransform = 6101, // MENU BLOCKS - MULTI-TRANSFORMATION OpQuadFace = 6102, // MENU BLOCKS - QUADRANGLE FACE OpPropagate = 6103, // MENU BLOCKS - PROPAGATE OpExplodeBlock = 6104, // MENU BLOCKS - EXPLODE ON BLOCKS - // AdvancedGUI ---------------//-------------------------------- + // AdvancedGUI -----------------//-------------------------------- OpAdvancedNoOp = 10000, // NO OPERATION (advanced operations base) OpPipeTShape = 10001, // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE -// OpPipeTShapeGroups = 10002, // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE GROUPS - OpDividedDisk = 10003, // MENU NEW ENTITY - ADVANCED - DIVIDEDDISK - OpDividedCylinder = 10004, // MENU NEW ENTITY - ADVANCED - DIVIDEDCYLINDER + //OpPipeTShapeGroups = 10002, // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE GROUPS + OpDividedDisk = 10003, // MENU NEW ENTITY - ADVANCED - DIVIDEDDISK + OpDividedCylinder = 10004, // MENU NEW ENTITY - ADVANCED - DIVIDEDCYLINDER //@@ insert new functions before this line @@ do not remove this line @@// }; } diff --git a/src/GEOMImpl/GEOMImpl_BlockDriver.cxx b/src/GEOMImpl/GEOMImpl_BlockDriver.cxx index 95c2dbf08..d50d24858 100644 --- a/src/GEOMImpl/GEOMImpl_BlockDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_BlockDriver.cxx @@ -600,7 +600,8 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(TFunction_Logbook& log) const TopTools_ListOfShape BLO; // All blocks from the given compound TopTools_ListOfShape NOT; // Not blocks TopTools_ListOfShape EXT; // Hexahedral solids, having degenerated and/or seam edges - GEOMImpl_IBlocksOperations::AddBlocksFrom(aFixedExtra, BLO, NOT, EXT); + TopTools_ListOfShape NOQ; // All non-quadrangular faces + GEOMImpl_IBlocksOperations::AddBlocksFrom(aFixedExtra, BLO, NOT, EXT, NOQ); if (NOT.Extent() > 0) { MESSAGE("Some non-blocks have been removed"); diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx index 42aaa4260..efb69f42c 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifdef WNT #pragma warning( disable:4786 ) @@ -1735,7 +1734,8 @@ Standard_Boolean GEOMImpl_IBlocksOperations::IsCompoundOfBlocks void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape& theShape, TopTools_ListOfShape& BLO, TopTools_ListOfShape& NOT, - TopTools_ListOfShape& EXT) + TopTools_ListOfShape& EXT, + TopTools_ListOfShape& NOQ) { TopAbs_ShapeEnum aType = theShape.ShapeType(); switch (aType) { @@ -1744,7 +1744,7 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape& theShape, { TopoDS_Iterator It (theShape); for (; It.More(); It.Next()) { - AddBlocksFrom(It.Value(), BLO, NOT, EXT); + AddBlocksFrom(It.Value(), BLO, NOT, EXT, NOQ); } } break; @@ -1766,7 +1766,7 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape& theShape, for (; expF.More(); expF.Next()) { if (mapFaces.Add(expF.Current())) { nbFaces++; - if (nbFaces > 6) break; + //0021483//if (nbFaces > 6) break; // get wire TopoDS_Shape aF = expF.Current(); @@ -1774,14 +1774,18 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape& theShape, if (!wires.More()) { // no wire in the face hasNonQuadr = Standard_True; - break; + NOQ.Append(aF);//0021483 + //0021483//break; + continue; } TopoDS_Shape aWire = wires.Current(); wires.Next(); if (wires.More()) { // multiple wires in the face hasNonQuadr = Standard_True; - break; + NOQ.Append(aF);//0021483 + //0021483//break; + continue; } // Check number of edges in the face @@ -1796,6 +1800,7 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape& theShape, } if (nbEdges != 4) { hasNonQuadr = Standard_True; + NOQ.Append(aF);//0021483 } } } @@ -1808,6 +1813,47 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape& theShape, } } break; + case TopAbs_SHELL: //0021483 + case TopAbs_FACE: //0021483 + { + // Count edges in each face + TopTools_MapOfShape mapFaces; + TopExp_Explorer expF (theShape, TopAbs_FACE); + for (; expF.More(); expF.Next()) { + if (mapFaces.Add(expF.Current())) { + // get wire + TopoDS_Shape aF = expF.Current(); + TopExp_Explorer wires (aF, TopAbs_WIRE); + if (!wires.More()) { + // no wire in the face + NOQ.Append(aF);//0021483 + continue; + } + TopoDS_Shape aWire = wires.Current(); + wires.Next(); + if (wires.More()) { + // multiple wires in the face + NOQ.Append(aF);//0021483 + continue; + } + + // Check number of edges in the face + Standard_Integer nbEdges = 0; + TopTools_MapOfShape mapEdges; + TopExp_Explorer expW (aWire, TopAbs_EDGE); + for (; expW.More(); expW.Next()) { + if (mapEdges.Add(expW.Current())) { + nbEdges++; + if (nbEdges > 4) break; + } + } + if (nbEdges != 4) { + NOQ.Append(aF);//0021483 + } + } + } + } + break; default: NOT.Append(theShape); } @@ -2353,7 +2399,8 @@ Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks TopTools_ListOfShape NOT; // Not blocks TopTools_ListOfShape EXT; // Hexahedral solids, having degenerated and/or seam edges TopTools_ListOfShape BLO; // All blocks from the given compound - AddBlocksFrom(aBlockOrComp, BLO, NOT, EXT); + TopTools_ListOfShape NOQ; // All non-quadrangular faces + AddBlocksFrom(aBlockOrComp, BLO, NOT, EXT, NOQ); // Report non-blocks if (NOT.Extent() > 0) { @@ -2513,6 +2560,100 @@ Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks return isCompOfBlocks; } +//============================================================================= +/*! + * GetNonBlocks + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetNonBlocks + (Handle(GEOM_Object) theShape, + Handle(GEOM_Object)& theNonQuads) +{ + SetErrorCode(KO); + + if (theShape.IsNull()) return NULL; + TopoDS_Shape aShape = theShape->GetValue(); + + // Separate blocks from non-blocks + TopTools_ListOfShape BLO; // All blocks from the given compound + TopTools_ListOfShape NOT; // Not blocks + TopTools_ListOfShape EXT; // Hexahedral solids, having degenerated and/or seam edges + TopTools_ListOfShape NOQ; // All non-quadrangular faces + AddBlocksFrom(aShape, BLO, NOT, EXT, NOQ); + + if (NOT.IsEmpty() && EXT.IsEmpty() && NOQ.IsEmpty()) { + SetErrorCode("NOT_FOUND_ANY"); + return NULL; + } + + // Map sub-shapes and their indices + TopTools_IndexedMapOfShape anIndices; + TopExp::MapShapes(aShape, anIndices); + + // Non-blocks + Handle(GEOM_Object) aNonBlocks; + if (NOT.Extent() > 0 || EXT.Extent() > 0) { + Handle(TColStd_HArray1OfInteger) anArray = + new TColStd_HArray1OfInteger (1, NOT.Extent() + EXT.Extent()); + Standard_Integer ii = 1; + TopTools_ListIteratorOfListOfShape it1 (NOT); + for (; it1.More(); it1.Next(), ii++) { + anArray->SetValue(ii, anIndices.FindIndex(it1.Value())); + } + TopTools_ListIteratorOfListOfShape it2 (EXT); + for (; it2.More(); it2.Next(), ii++) { + anArray->SetValue(ii, anIndices.FindIndex(it2.Value())); + } + + aNonBlocks = GetEngine()->AddSubShape(theShape, anArray); + if (aNonBlocks.IsNull()) { + SetErrorCode("Error in algorithm: result found, but cannot be returned."); + return NULL; + } + aNonBlocks->SetType(GEOM_GROUP); + TDF_Label aFreeLabel = aNonBlocks->GetFreeLabel(); + TDataStd_Integer::Set(aFreeLabel, (Standard_Integer)TopAbs_SOLID); + } + + // Non-quadrangles + if (NOQ.Extent() > 0) { + Handle(TColStd_HArray1OfInteger) anArray = + new TColStd_HArray1OfInteger (1, NOQ.Extent()); + Standard_Integer ii = 1; + TopTools_ListIteratorOfListOfShape it1 (NOQ); + for (; it1.More(); it1.Next(), ii++) { + anArray->SetValue(ii, anIndices.FindIndex(it1.Value())); + } + + theNonQuads = GetEngine()->AddSubShape(theShape, anArray); + if (theNonQuads.IsNull()) { + SetErrorCode("Error in algorithm: result found, but cannot be returned."); + return NULL; + } + theNonQuads->SetType(GEOM_GROUP); + TDF_Label aFreeLabel = theNonQuads->GetFreeLabel(); + TDataStd_Integer::Set(aFreeLabel, (Standard_Integer)TopAbs_FACE); + } + + //Make a Python command + Handle(GEOM_Function) aMainShape = theShape->GetLastFunction(); + GEOM::TPythonDump pd (aMainShape, /*append=*/true); + pd << "("; + if (aNonBlocks.IsNull()) + pd << "no_bad_solids"; + else + pd << aNonBlocks; + pd << ", "; + if (theNonQuads.IsNull()) + pd << "no_bad_faces"; + else + pd << theNonQuads; + pd << ") = geompy.GetNonBlocks(" << theShape << ")"; + + SetErrorCode(OK); + return aNonBlocks; +} + //============================================================================= /*! * RemoveExtraEdges diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx index f702da402..8a34d5510 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMImpl_IBlocksOperations_HXX_ #define _GEOMImpl_IBlocksOperations_HXX_ @@ -126,14 +125,17 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations { }; Standard_EXPORT Standard_Boolean CheckCompoundOfBlocksOld (Handle(GEOM_Object) theCompound, - std::list& theErrors); + std::list& theErrors); Standard_EXPORT Standard_Boolean CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound, - std::list& theErrors); + std::list& theErrors); - Standard_EXPORT TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object) theCompound, + Standard_EXPORT TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object) theCompound, const std::list& theErrors); + Standard_EXPORT Handle(GEOM_Object) GetNonBlocks (Handle(GEOM_Object) theShape, + Handle(GEOM_Object)& theNonQuads); + Standard_EXPORT Handle(GEOM_Object) RemoveExtraEdges (Handle(GEOM_Object) theShape, const Standard_Integer theOptimumNbFaces = 6); @@ -142,7 +144,8 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations { Standard_EXPORT static void AddBlocksFrom (const TopoDS_Shape& theShape, TopTools_ListOfShape& BLO, TopTools_ListOfShape& NOT, - TopTools_ListOfShape& EXT); + TopTools_ListOfShape& EXT, + TopTools_ListOfShape& NOQ); // Extract blocks from blocks compounds Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ExplodeCompoundOfBlocks diff --git a/src/GEOM_I/GEOM_IBlocksOperations_i.cc b/src/GEOM_I/GEOM_IBlocksOperations_i.cc index 0c1917d46..c71432528 100644 --- a/src/GEOM_I/GEOM_IBlocksOperations_i.cc +++ b/src/GEOM_I/GEOM_IBlocksOperations_i.cc @@ -18,7 +18,6 @@ // 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 @@ -742,6 +741,39 @@ char* GEOM_IBlocksOperations_i::PrintBCErrors return CORBA::string_dup(aDescr.ToCString()); } +//============================================================================= +/*! + * GetNonBlocks + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetNonBlocks + (GEOM::GEOM_Object_ptr theShape, + GEOM::GEOM_Object_out theNonQuads) +{ + GEOM::GEOM_Object_var aGEOMObject; + GEOM::GEOM_Object_var aNonQuads; + + theNonQuads = aNonQuads._retn(); + + //Set a not done flag + GetOperations()->SetNotDone(); + + //Get the reference Objects + Handle(GEOM_Object) aShape = GetObjectImpl(theShape); + if (aShape.IsNull()) return aGEOMObject._retn(); + + //Get the result + Handle(GEOM_Object) aFaces; + Handle(GEOM_Object) anObject = GetOperations()->GetNonBlocks(aShape, aFaces); + if (!GetOperations()->IsDone() || anObject.IsNull()) + return aGEOMObject._retn(); + + if (!aFaces.IsNull()) + theNonQuads = GetObject(aFaces); + + return GetObject(anObject); +} + //============================================================================= /*! * RemoveExtraEdges diff --git a/src/GEOM_I/GEOM_IBlocksOperations_i.hh b/src/GEOM_I/GEOM_IBlocksOperations_i.hh index a801a1e7e..6f5765092 100644 --- a/src/GEOM_I/GEOM_IBlocksOperations_i.hh +++ b/src/GEOM_I/GEOM_IBlocksOperations_i.hh @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOM_IBlocksOperations_i_HeaderFile #define _GEOM_IBlocksOperations_i_HeaderFile @@ -121,6 +120,9 @@ class GEOM_I_EXPORT GEOM_IBlocksOperations_i : char* PrintBCErrors (GEOM::GEOM_Object_ptr theCompound, const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors); + GEOM::GEOM_Object_ptr GetNonBlocks (GEOM::GEOM_Object_ptr theShape, + GEOM::GEOM_Object_out theNonQuads); + GEOM::GEOM_Object_ptr RemoveExtraEdges (GEOM::GEOM_Object_ptr theShape, CORBA::Long theOptimumNbFaces); diff --git a/src/GEOM_SWIG/GEOM_Spanner.py b/src/GEOM_SWIG/GEOM_Spanner.py index 05c23aed6..7c17db76a 100644 --- a/src/GEOM_SWIG/GEOM_Spanner.py +++ b/src/GEOM_SWIG/GEOM_Spanner.py @@ -20,18 +20,17 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # - # GEOM GEOM_SWIG : binding of C++ implementaion with Python # File : GEOM_Spanner.py # Author : Julia DOROVSKIKH # Module : GEOM -# $Header$ +# # ! Please, if you edit this example file, update also # ! GEOM_SRC/doc/salome/gui/GEOM/input/tui_test_spanner.doc # ! as some sequences of symbols from this example are used during # ! documentation generation to identify certain places of this file -############# MakeSpanner ############# # +############# MakeSpanner ############# def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None): ### Variables ### @@ -304,6 +303,11 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None): isCompOfBlocks6 = BlocksOp.CheckCompoundOfBlocks(Spanner) if isCompOfBlocks6 == 0: print "Spanner is not a compound of hexahedral solids" + (NonBlocks, NonQuads) = geompy.GetNonBlocks(Spanner) + if NonBlocks is not None: + geompy.addToStudyInFather(Spanner, NonBlocks, "Group of non-hexahedral solids") + if NonQuads is not None: + geompy.addToStudyInFather(Spanner, NonQuads, "Group of non-quadrangular faces") else: print "Spanner is a compound of hexahedral solids" diff --git a/src/GEOM_SWIG/GEOM_TestOthers.py b/src/GEOM_SWIG/GEOM_TestOthers.py index 8e65788e2..73d91287d 100644 --- a/src/GEOM_SWIG/GEOM_TestOthers.py +++ b/src/GEOM_SWIG/GEOM_TestOthers.py @@ -243,6 +243,11 @@ def TestOtherOperations (geompy, math): IsValid = geompy.CheckCompoundOfBlocks(Compound1) if IsValid == 0: print "The Blocks Compound is NOT VALID" + (NonBlocks, NonQuads) = geompy.GetNonBlocks(Compound1) + if NonBlocks is not None: + geompy.addToStudyInFather(Compound1, NonBlocks, "Group of non-hexahedral solids") + if NonQuads is not None: + geompy.addToStudyInFather(Compound1, NonQuads, "Group of non-quadrangular faces") else: print "The Blocks Compound is VALID" diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index ca34d8893..b7e5a4a92 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -7774,6 +7774,36 @@ class geompyDC(GEOM._objref_GEOM_Gen): print Descr return IsValid + ## Retrieve all non blocks solids and faces from \a theShape. + # @param theShape The shape to explore. + # @return A tuple of two GEOM_Objects. The first object is a group of all + # non block solids (= not 6 faces, or with 6 faces, but with the + # presence of non-quadrangular faces). The second object is a + # group of all non quadrangular faces. + # + # @ref tui_measurement_tools_page "Example 1" + # \n @ref swig_GetNonBlocks "Example 2" + def GetNonBlocks (self, theShape): + """ + Retrieve all non blocks solids and faces from theShape. + + Parameters: + theShape The shape to explore. + + Returns: + A tuple of two GEOM_Objects. The first object is a group of all + non block solids (= not 6 faces, or with 6 faces, but with the + presence of non-quadrangular faces). The second object is a + group of all non quadrangular faces. + + Usage: + (res_sols, res_faces) = geompy.GetNonBlocks(myShape1) + """ + # Example: see GEOM_Spanner.py + aTuple = self.BlocksOp.GetNonBlocks(theShape) + RaiseIfFailed("GetNonBlocks", self.BlocksOp) + return aTuple + ## Remove all seam and degenerated edges from \a theShape. # Unite faces and edges, sharing one surface. It means that # this faces must have references to one C++ surface object (handle). diff --git a/src/MeasureGUI/Makefile.am b/src/MeasureGUI/Makefile.am index 8b0541a9a..55cfcf7a5 100644 --- a/src/MeasureGUI/Makefile.am +++ b/src/MeasureGUI/Makefile.am @@ -40,6 +40,7 @@ salomeinclude_HEADERS = \ MeasureGUI_WhatisDlg.h \ MeasureGUI_CheckShapeDlg.h \ MeasureGUI_CheckCompoundOfBlocksDlg.h \ + MeasureGUI_GetNonBlocksDlg.h \ MeasureGUI_CheckSelfIntersectionsDlg.h \ MeasureGUI_PointDlg.h @@ -61,6 +62,7 @@ dist_libMeasureGUI_la_SOURCES = \ MeasureGUI_WhatisDlg.cxx \ MeasureGUI_CheckShapeDlg.cxx \ MeasureGUI_CheckCompoundOfBlocksDlg.cxx \ + MeasureGUI_GetNonBlocksDlg.cxx \ MeasureGUI_CheckSelfIntersectionsDlg.cxx \ MeasureGUI_PointDlg.cxx @@ -78,6 +80,7 @@ MOC_FILES = \ MeasureGUI_WhatisDlg_moc.cxx \ MeasureGUI_CheckShapeDlg_moc.cxx \ MeasureGUI_CheckCompoundOfBlocksDlg_moc.cxx \ + MeasureGUI_GetNonBlocksDlg_moc.cxx \ MeasureGUI_CheckSelfIntersectionsDlg_moc.cxx \ MeasureGUI_PointDlg_moc.cxx @@ -122,4 +125,3 @@ libMeasureGUI_la_CPPFLAGS = \ libMeasureGUI_la_LDFLAGS = \ $(CAS_LDFLAGS) -lTKGeomBase \ ../GEOMBase/libGEOMBase.la ../DlgRef/libDlgRef.la - diff --git a/src/MeasureGUI/MeasureGUI.cxx b/src/MeasureGUI/MeasureGUI.cxx index e1ddbfcff..f31cf7161 100644 --- a/src/MeasureGUI/MeasureGUI.cxx +++ b/src/MeasureGUI/MeasureGUI.cxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // GEOM GEOMGUI : GUI for Geometry component // File : MeasureGUI.cxx @@ -42,6 +41,7 @@ #include "MeasureGUI_WhatisDlg.h" // Method WHATIS #include "MeasureGUI_CheckShapeDlg.h" // Method CHECKSHAPE #include "MeasureGUI_CheckCompoundOfBlocksDlg.h" // Method CHECKCOMPOUND +#include "MeasureGUI_GetNonBlocksDlg.h" // Method GET NON BLOCKS #include "MeasureGUI_CheckSelfIntersectionsDlg.h" // Method CHECK SELF INTERSCTIONS #include "MeasureGUI_PointDlg.h" // Method POINTCOORDINATES @@ -110,6 +110,9 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) case GEOMOp::OpCheckCompound: dlg = new MeasureGUI_CheckCompoundOfBlocksDlg( getGeometryGUI(), parent ); break; // CHECKCOMPOUND + case GEOMOp::OpGetNonBlocks: + dlg = new MeasureGUI_GetNonBlocksDlg(getGeometryGUI(), parent); + break; // GET NON BLOCKS case GEOMOp::OpCheckSelfInters: dlg = new MeasureGUI_CheckSelfIntersectionsDlg( getGeometryGUI(), parent ); break; // CHECK SELF INTERSCTIONS diff --git a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx index 84676e669..df20f449c 100644 --- a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx @@ -84,7 +84,7 @@ MeasureGUI_CenterMassDlg::MeasureGUI_CenterMassDlg( GeometryGUI* theGeometryGUI, /***************************************************************/ - myHelpFileName = "using_measurement_tools_page.html#center_mass_anchor"; + myHelpFileName = "center_mass_page.html"; /* Initialisation */ Init(); diff --git a/src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx b/src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx new file mode 100644 index 000000000..517f5974f --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx @@ -0,0 +1,277 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 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 + +// GEOM GEOMGUI : GUI for Geometry component +// File : MeasureGUI_GetNonBlocksDlg.cxx + +#include "MeasureGUI_GetNonBlocksDlg.h" + +#include +#include + +#include + +#include +#include +#include +#include +#include + +//================================================================================= +// class : MeasureGUI_GetNonBlocksDlg() +// purpose : Constructs a MeasureGUI_GetNonBlocksDlg 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. +//================================================================================= +MeasureGUI_GetNonBlocksDlg::MeasureGUI_GetNonBlocksDlg (GeometryGUI* theGeometryGUI, QWidget* parent) + : GEOMBase_Skeleton(theGeometryGUI, parent, false) +{ + QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_GETNONBLOCKS"))); + QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); + + setWindowTitle(tr("GEOM_GETNONBLOCKS_TITLE")); + + /***************************************************************/ + mainFrame()->GroupConstructors->setTitle(tr("GEOM_GETNONBLOCKS")); + mainFrame()->RadioButton1->setIcon(image0); + mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton2->close(); + mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton3->close(); + + myGrp = new DlgRef_1Sel (centralWidget()); + myGrp->GroupBox1->setTitle(tr("GEOM_GETNONBLOCKS")); + myGrp->TextLabel1->setText(tr("GEOM_OBJECT")); + myGrp->PushButton1->setIcon(image1); + myGrp->LineEdit1->setReadOnly(true); + + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); + layout->setMargin(0); layout->setSpacing(6); + layout->addWidget(myGrp); + + /***************************************************************/ + + myHelpFileName = "get_non_blocks_page.html"; + + /* Initialisation */ + Init(); +} + +//================================================================================= +// function : ~MeasureGUI_GetNonBlocksDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +MeasureGUI_GetNonBlocksDlg::~MeasureGUI_GetNonBlocksDlg() +{ +} + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void MeasureGUI_GetNonBlocksDlg::Init() +{ + showOnlyPreviewControl(); + + /* init variables */ + myEditCurrentArgument = myGrp->LineEdit1; + + /* signals and slots connections */ + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); + + connect(myGrp->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(myGrp->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + //initName(tr("GEOM_NONBLOCKS")); + mainFrame()->ResultName->setText(tr("GEOM_NONBLOCKS")); + globalSelection(); + SelectionIntoArgument(); +} + +//================================================================================= +// function : ClickOnOk() +// purpose : +//================================================================================= +void MeasureGUI_GetNonBlocksDlg::ClickOnOk() +{ + if (ClickOnApply()) + ClickOnCancel(); +} + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +bool MeasureGUI_GetNonBlocksDlg::ClickOnApply() +{ + if (!onAccept()) + return false; + + //initName(); + return true; +} + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void MeasureGUI_GetNonBlocksDlg::SelectionIntoArgument() +{ + erasePreview(); + myObj = GEOM::GEOM_Object::_nil(); + + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + SALOME_ListIO aSelList; + aSelMgr->selectedObjects(aSelList); + + if (aSelList.Extent() != 1) { + processObject(); + return; + } + + GEOM::GEOM_Object_var aSelectedObject = + GEOMBase::ConvertIOinGEOMObject(aSelList.First()); + + if (aSelectedObject->_is_nil()) { + processObject(); + return; + } + + myObj = aSelectedObject; + processObject(); +} + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void MeasureGUI_GetNonBlocksDlg::SetEditCurrentArgument() +{ + myGrp->LineEdit1->setFocus(); + myEditCurrentArgument = myGrp->LineEdit1; + SelectionIntoArgument(); +} + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void MeasureGUI_GetNonBlocksDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + if (send == myGrp->LineEdit1) { + myEditCurrentArgument = myGrp->LineEdit1; + GEOMBase_Skeleton::LineEditReturnPressed(); + } +} + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void MeasureGUI_GetNonBlocksDlg::ActivateThisDialog() +{ + GEOMBase_Skeleton::ActivateThisDialog(); + + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + globalSelection(); + processPreview(); +} + +//================================================================================= +// function : processObject() +// purpose : Fill dialog fields in accordance with myObj +//================================================================================= +void MeasureGUI_GetNonBlocksDlg::processObject() +{ + if (myObj->_is_nil()) { + erasePreview(); + } + else { + myGrp->LineEdit1->setText(GEOMBase::GetName(myObj)); + + processPreview(); + } +} + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void MeasureGUI_GetNonBlocksDlg::enterEvent (QEvent*) +{ + if (!mainFrame()->GroupConstructors->isEnabled()) + ActivateThisDialog(); +} + +//================================================================================= +// function : createOperation +// purpose : +//================================================================================= +GEOM::GEOM_IOperations_ptr MeasureGUI_GetNonBlocksDlg::createOperation() +{ + return getGeomEngine()->GetIBlocksOperations(getStudyId()); +} + +//================================================================================= +// function : isValid +// purpose : +//================================================================================= +bool MeasureGUI_GetNonBlocksDlg::isValid (QString&) +{ + return !myObj->_is_nil(); +} + +//================================================================================= +// function : execute +// purpose : +//================================================================================= +bool MeasureGUI_GetNonBlocksDlg::execute (ObjectList& objects) +{ + GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation()); + GEOM::GEOM_Object_var aNonQuads; + GEOM::GEOM_Object_var anObj = anOper->GetNonBlocks(myObj, aNonQuads); + //mainFrame()->ResultName->setText(tr("GEOM_NONBLOCKS")); + + if (!anObj->_is_nil()) + objects.push_back(anObj._retn()); + if (!aNonQuads->_is_nil()) + objects.push_back(aNonQuads._retn()); + + return true; +} + +//================================================================ +// Function : getFather +// Purpose : Get father object for object to be added in study +// ( called with addInStudy method ) +//================================================================ +GEOM::GEOM_Object_ptr MeasureGUI_GetNonBlocksDlg::getFather (GEOM::GEOM_Object_ptr) +{ + return myObj; +} diff --git a/src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.h b/src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.h new file mode 100644 index 000000000..438a4ec45 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.h @@ -0,0 +1,69 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 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 + +// GEOM GEOMGUI : GUI for Geometry component +// File : MeasureGUI_GetNonBlocksDlg.h + +#ifndef MEASUREGUI_GETNONBLOCKSDLG_H +#define MEASUREGUI_GETNONBLOCKSDLG_H + +#include + +class DlgRef_1Sel; + +//================================================================================= +// class : MeasureGUI_GetNonBlocksDlg +// purpose : +//================================================================================= +class MeasureGUI_GetNonBlocksDlg : public GEOMBase_Skeleton +{ + Q_OBJECT + +public: + MeasureGUI_GetNonBlocksDlg (GeometryGUI*, QWidget*); + ~MeasureGUI_GetNonBlocksDlg(); + +protected: + // redefined from GEOMBase_Helper + virtual GEOM::GEOM_IOperations_ptr createOperation(); + virtual bool isValid (QString&); + virtual bool execute (ObjectList&); + virtual GEOM::GEOM_Object_ptr getFather (GEOM::GEOM_Object_ptr); + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + void ActivateThisDialog(); + void LineEditReturnPressed(); + void SelectionIntoArgument(); + void SetEditCurrentArgument(); + +private: + void Init(); + void enterEvent (QEvent*); + void processObject(); + +private: + GEOM::GEOM_Object_var myObj; + DlgRef_1Sel* myGrp; +}; + +#endif // MEASUREGUI_GETNONBLOCKSDLG_H -- 2.39.2