From 8fe997ae8897c5945c15e276f82f143dbdfb9321 Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 14 Jun 2013 12:20:21 +0000 Subject: [PATCH] Mantis issue 0021934: Delete the internal faces of an object --- doc/salome/examples/Makefile.am | 1 + .../examples/repairing_operations_ex12.py | 26 ++ doc/salome/gui/GEOM/images/remove_webs.png | Bin 0 -> 22004 bytes .../gui/GEOM/input/remove_webs_operation.doc | 27 ++ .../gui/GEOM/input/repairing_operations.doc | 3 + .../GEOM/input/tui_repairing_operations.doc | 4 + idl/GEOM_Gen.idl | 8 + resources/Makefile.am | 3 +- resources/remove_webs.png | Bin 0 -> 859 bytes src/GEOMGUI/GEOM_images.ts | 8 + src/GEOMGUI/GEOM_msg_en.ts | 28 +- src/GEOMGUI/GEOM_msg_fr.ts | 28 +- src/GEOMGUI/GeometryGUI.cxx | 3 + src/GEOMGUI/GeometryGUI_Operations.h | 1 + src/GEOMImpl/GEOMImpl_HealingDriver.cxx | 33 ++ src/GEOMImpl/GEOMImpl_HealingDriver.hxx | 1 + src/GEOMImpl/GEOMImpl_IHealingOperations.cxx | 61 +++- src/GEOMImpl/GEOMImpl_IHealingOperations.hxx | 2 + src/GEOMImpl/GEOMImpl_Types.hxx | 5 +- src/GEOM_I/GEOM_IHealingOperations_i.cc | 25 ++ src/GEOM_I/GEOM_IHealingOperations_i.hh | 2 + src/GEOM_SWIG/GEOM_TestHealing.py | 20 ++ src/GEOM_SWIG/geomBuilder.py | 30 ++ src/RepairGUI/Makefile.am | 6 +- src/RepairGUI/RepairGUI.cxx | 2 + src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx | 296 ++++++++++++++++++ src/RepairGUI/RepairGUI_RemoveWebsDlg.h | 70 +++++ 27 files changed, 677 insertions(+), 16 deletions(-) create mode 100644 doc/salome/examples/repairing_operations_ex12.py create mode 100644 doc/salome/gui/GEOM/images/remove_webs.png create mode 100644 doc/salome/gui/GEOM/input/remove_webs_operation.doc create mode 100644 resources/remove_webs.png create mode 100755 src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx create mode 100755 src/RepairGUI/RepairGUI_RemoveWebsDlg.h diff --git a/doc/salome/examples/Makefile.am b/doc/salome/examples/Makefile.am index 171c03674..211c7932e 100644 --- a/doc/salome/examples/Makefile.am +++ b/doc/salome/examples/Makefile.am @@ -99,6 +99,7 @@ GOOD_TESTS = \ repairing_operations_ex08.py \ repairing_operations_ex10.py \ repairing_operations_ex11.py \ + repairing_operations_ex12.py \ sketcher.py \ tolerance.py \ topological_geom_objs_ex01.py \ diff --git a/doc/salome/examples/repairing_operations_ex12.py b/doc/salome/examples/repairing_operations_ex12.py new file mode 100644 index 000000000..80a814a30 --- /dev/null +++ b/doc/salome/examples/repairing_operations_ex12.py @@ -0,0 +1,26 @@ +# Remove internal(shared) faces from a compound + +import salome +salome.salome_init() +import GEOM +from salome.geom import geomBuilder +geompy = geomBuilder.New(salome.myStudy) + +# create solids with some coincident faces +Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) +Translation_1 = geompy.MakeTranslation(Box_1, 200, 0, 0) +Translation_2 = geompy.MakeTranslation(Box_1, 200, 200, 0) + +geompy.addToStudy(Box_1, 'Box_1') +geompy.addToStudy(Translation_1, 'Translation_1') +geompy.addToStudy(Translation_2, 'Translation_2') + +# partition three solids to obtain shared faces +Partition_1 = geompy.MakePartition([Box_1, Translation_1, Translation_2]) +geompy.addToStudy(Partition_1, 'Partition_1') + +# remove shared faces to obtain one solid instead of three +Joined_1 = geompy.RemoveInternalFaces(Partition_1) +geompy.addToStudy(Joined_1, 'Joined_1') + +salome.sg.updateObjBrowser(1) diff --git a/doc/salome/gui/GEOM/images/remove_webs.png b/doc/salome/gui/GEOM/images/remove_webs.png new file mode 100644 index 0000000000000000000000000000000000000000..951f5a5c5cf15596f3b527cc6100f8f590e0fb0d GIT binary patch literal 22004 zcmcG$1y~i|{x`Y}1VN-hKtMpGL%NafZjdf%q#J1g>5`VNO_#K^ba!`m*XAyNzjMz0 zzvuk#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u z(uw?_T0reuO5WvmF&F&h#!rH6f4R?F8vn^4r!`Q?f$i_@&y$pU9e#7b0TM)F7F~AB y7Xca%0-EMIrekKFa$$~^3G|GJd)@VRZ-0HxX?vDZnHRemove internal faces in the Main Menu select +Repair - > Remove internal faces. + +\n This operation removes all shared faces from a compound to obtain +one or more bigger solids from the set of smaller solids. + +\image html remove_webs.png + +\n Arguments: Name + one shape. +\n Advanced option: + \ref restore_presentation_parameters_page "Set presentation parameters and sub-shapes from arguments". + +\note Only shared faces will be removed. Coincident but not shared +faces will stay as is, use GlueFaces or MakePartition before +RemoveInternalFaces if you need to remove them. + +\n TUI Command: geompy.RemoveInternalFaces(theCompound), +where theCompound is a compound of solids. + +\n Our TUI Scripts provide you with useful examples of the +\ref tui_remove_webs "Remove Internal Faces" functionality usage. + +*/ diff --git a/doc/salome/gui/GEOM/input/repairing_operations.doc b/doc/salome/gui/GEOM/input/repairing_operations.doc index cf0239a6f..4cbb1ed1b 100644 --- a/doc/salome/gui/GEOM/input/repairing_operations.doc +++ b/doc/salome/gui/GEOM/input/repairing_operations.doc @@ -25,6 +25,9 @@ to set new tolerance value for the given shape. splits an edge in two.
  • \subpage change_orientation_operation_page "Change orientation" - reverses the normals of the selected faces.
  • +
  • \subpage remove_webs_operation_page "Remove internal faces" - +rebuilds the topology of a compound of solids by removing of the faces +that are shared by several solids.
  • \subpage remove_extra_edges_operation_page "Remove extra edges" - removes seam and degenerated edges from the given shape.
  • \subpage fuse_edges_operation_page "Fuse Collinear Edges within a Wire" - diff --git a/doc/salome/gui/GEOM/input/tui_repairing_operations.doc b/doc/salome/gui/GEOM/input/tui_repairing_operations.doc index 711800caa..b883afe8a 100644 --- a/doc/salome/gui/GEOM/input/tui_repairing_operations.doc +++ b/doc/salome/gui/GEOM/input/tui_repairing_operations.doc @@ -46,4 +46,8 @@

    Fuse Collinear Edges within a Wire

    \tui_script{repairing_operations_ex11.py} +\anchor tui_remove_webs +

    Remove internal(shared) faces

    +\tui_script{repairing_operations_ex12.py} + */ diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index edfbc0d77..2ed2f671c 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -3331,6 +3331,14 @@ module GEOM */ GEOM_Object SewAllowNonManifold(in GEOM_Object theObject, in double theTolerance); + /*! + * Rebuild the topology of theCompound of solids by removing + * of the faces that are shared by several solids. + * \param theCompound Shape to be processed. + * \return New GEOM_Object, containing processed shape. + */ + GEOM_Object RemoveInternalFaces (in GEOM_Object theCompound); + /*! * \brief Addition of a point to a given edge object. * \param theObject Shape to be processed. diff --git a/resources/Makefile.am b/resources/Makefile.am index ee3fe1bff..b36757b3b 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -239,8 +239,9 @@ propagate.png \ redo.png \ undo.png \ glue2.png \ +remove_webs.png \ remove_extra_edges.png \ -union_faces.png \ +union_faces.png \ coordsys.png \ translation.png diff --git a/resources/remove_webs.png b/resources/remove_webs.png new file mode 100644 index 0000000000000000000000000000000000000000..80b4b4758f7e1f74a85266685128026b0ea97882 GIT binary patch literal 859 zcmV-h1ElPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FZT01FZU(%pXi00007bV*G`2i*n^ z3JNsaC%!8H00P@dL_t(I%dM14Xq{CM$A4cFZy#2YZZt%6p)JN$A5^L$#f7CJBDXen z5wJFJg_hDlT?k6)!a@j^v|Wkq!UqU~P*JfeTCku9<*Kw8a8sxVh6IBBa=+Jk%^VlG zx#T8USjfO|4h-|-|L4q^B*w^E#yZwG)*RTocuA6^tI%jPB7lf=QdJ2dP*oLWS<-5? zNYj+LxjE7_O}c=~VGr*arq(xrmxzcW8arv6P`N;10$0WlkftfXqrl7x%cG;CaoheA zI3E@oZJ@A$+yqJ+D2yjJo~-m-89%_Tqn|9cJ`W6ZDI6IYiCg!N;et{cPtW>*b%GZ~ zB%(1ABvQG+H{*4lIQ}WV$`{+W0-KY?v8mVVv8Sg8RmC|+S(ap3Mo|T1q2695f4vCS(t7DZzW(ZM z0Op^)kI#4)uS%uLBS5Ljn?tXlu3~U-km>2^ZeUrKL}S2OVmmuE5d?6m#eIF`<1_NAY{+~aQ;D{mJoZhr9t>o;$qcJCGd?%C8wZBsvgU%$-k?CiA_ z3R|rf-sIf*>n2aX-ay>^f*lDEl^q9PK&6Fx1Aw@STR(mPa1F?T86fWfV~qTJ`*$|> z58{e>#8-&7LICON_DLG_CHANGE_DIRECTION change_direction.png + + ICON_DLG_REMOVE_WEBS + remove_webs.png + ICON_DLG_REMOVE_EXTRA_EDGES remove_extra_edges.png @@ -1015,6 +1019,10 @@ ICO_PLANE plane.png + + ICO_REMOVE_WEBS + remove_webs.png + ICO_REMOVE_EXTRA_EDGES remove_extra_edges.png diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 0c5eef603..a9fd206ed 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -1576,10 +1576,6 @@ Please, select face, shell or solid and try again GEOM_REMOVE_INTERNAL_WIRES_TITLE Suppress internal wires - - GEOM_REMOVE_WEBS - Remove webs - GEOM_REQUIRED_DEGREE Required degree @@ -4508,6 +4504,30 @@ Please, select face, shell or solid and try again GEOM_CENTER_2POINTS Center and two points + + GEOM_REMOVE_WEBS_TITLE + Remove internal faces + + + GEOM_REMOVE_WEBS + Compound of solids + + + REMOVE_WEBS_NEW_OBJ_NAME + NoInternalFaces + + + TOP_REMOVE_WEBS + Remove internal faces + + + MEN_REMOVE_WEBS + Remove Internal Faces + + + STB_REMOVE_WEBS + Remove internal faces + GEOM_REMOVE_EXTRA_EDGES_TITLE Remove extra edges diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts index 677b77742..2a5a9ce62 100644 --- a/src/GEOMGUI/GEOM_msg_fr.ts +++ b/src/GEOMGUI/GEOM_msg_fr.ts @@ -1574,10 +1574,6 @@ Choisissez une face, une coque ou un solide et essayez de nouveau GEOM_REMOVE_INTERNAL_WIRES_TITLE Supprimer les contours internes - - GEOM_REMOVE_WEBS - Supprimer les toiles - GEOM_REQUIRED_DEGREE Degré nécessaire @@ -4506,6 +4502,30 @@ Choisissez une face, une coque ou un solide et essayez de nouveau GEOM_CENTER_2POINTS Centre et deux points + + GEOM_REMOVE_WEBS_TITLE + Remove internal faces + + + GEOM_REMOVE_WEBS + Compound of solids + + + REMOVE_WEBS_NEW_OBJ_NAME + NoInternalFaces + + + TOP_REMOVE_WEBS + Remove internal faces + + + MEN_REMOVE_WEBS + Remove Internal Faces + + + STB_REMOVE_WEBS + Remove internal faces + GEOM_REMOVE_EXTRA_EDGES_TITLE Supprimer les arêtes inutiles diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 19f277735..4404927c4 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -542,6 +542,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam ) case GEOMOp::OpGlueFaces: // MENU REPAIR - GLUE FACES case GEOMOp::OpGlueEdges: // MENU REPAIR - GLUE EDGES case GEOMOp::OpLimitTolerance: // MENU REPAIR - LIMIT TOLERANCE + case GEOMOp::OpRemoveWebs: // MENU REPAIR - REMOVE INTERNAL FACES case GEOMOp::OpRemoveExtraEdges: // MENU REPAIR - REMOVE EXTRA EDGES case GEOMOp::OpFuseEdges: // MENU REPAIR - FUSE COLLINEAR EDGES case GEOMOp::OpUnionFaces: // MENU REPAIR - UNION FACES @@ -823,6 +824,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::OpFreeBoundaries, "CHECK_FREE_BNDS" ); createGeomAction( GEOMOp::OpFreeFaces, "CHECK_FREE_FACES" ); createGeomAction( GEOMOp::OpOrientation, "CHANGE_ORIENTATION" ); + createGeomAction( GEOMOp::OpRemoveWebs, "REMOVE_WEBS" ); createGeomAction( GEOMOp::OpRemoveExtraEdges, "REMOVE_EXTRA_EDGES" ); createGeomAction( GEOMOp::OpFuseEdges, "FUSE_EDGES" ); createGeomAction( GEOMOp::OpUnionFaces, "UNION_FACES" ); @@ -1055,6 +1057,7 @@ void GeometryGUI::initialize( CAM_Application* app ) //createMenu( GEOMOp::OpFreeBoundaries, repairId, -1 ); //createMenu( GEOMOp::OpFreeFaces, repairId, -1 ); createMenu( GEOMOp::OpOrientation, repairId, -1 ); + createMenu( GEOMOp::OpRemoveWebs, repairId, -1 ); createMenu( GEOMOp::OpRemoveExtraEdges, repairId, -1 ); createMenu( GEOMOp::OpFuseEdges, repairId, -1 ); createMenu( GEOMOp::OpUnionFaces, repairId, -1 ); diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h index bdfed0980..04b339917 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -162,6 +162,7 @@ namespace GEOMOp { OpGlueEdges = 4013, // MENU REPAIR - GLUE EDGES OpFuseEdges = 4014, // MENU REPAIR - FUSE COLLINEAR EDGES OpUnionFaces = 4015, // MENU REPAIR - UNION FACES + OpRemoveWebs = 4016, // MENU REPAIR - REMOVE INTERNAL FACES // MeasureGUI ------------------//-------------------------------- OpProperties = 5000, // MENU MEASURES - PROPERTIES OpCenterMass = 5001, // MENU MEASURES - CENTRE OF MASS diff --git a/src/GEOMImpl/GEOMImpl_HealingDriver.cxx b/src/GEOMImpl/GEOMImpl_HealingDriver.cxx index d77e25f20..7010b0e33 100644 --- a/src/GEOMImpl/GEOMImpl_HealingDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_HealingDriver.cxx @@ -30,6 +30,9 @@ #include #include +#include +#include + #include #include #include @@ -138,6 +141,9 @@ Standard_Integer GEOMImpl_HealingDriver::Execute(TFunction_Logbook& log) const case SEWING_NON_MANIFOLD: Sew(&HI, anOriginalShape, aShape, true); break; + case REMOVE_INTERNAL_FACES: + RemoveInternalFaces(anOriginalShape, aShape); + break; case DIVIDE_EDGE: AddPointOnEdge(&HI, anOriginalShape, aShape); break; @@ -441,6 +447,33 @@ Standard_Boolean GEOMImpl_HealingDriver::Sew (GEOMImpl_IHealing* theHI, return aResult; } +//======================================================================= +//function : RemoveInternalFaces +//purpose : +//======================================================================= +Standard_Boolean GEOMImpl_HealingDriver::RemoveInternalFaces (const TopoDS_Shape& theOriginalShape, + TopoDS_Shape& theOutShape) const +{ + GEOMAlgo_RemoverWebs aTool; + aTool.SetShape(theOriginalShape); + aTool.Perform(); + + if (aTool.ErrorStatus() != 0) + StdFail_NotDone::Raise("GEOMAlgo_RemoverWebs failed!"); + + theOutShape = aTool.Result(); + + // as GEOMAlgo_RemoverWebs always produces compound, lets simplify it + // for the case, if it contains only one sub-shape + TopTools_ListOfShape listShapeRes; + GEOMUtils::AddSimpleShapes(theOutShape, listShapeRes); + if (listShapeRes.Extent() == 1) { + theOutShape = listShapeRes.First(); + } + + return Standard_True; +} + //======================================================================= //function : AddPointOnEdge //purpose : diff --git a/src/GEOMImpl/GEOMImpl_HealingDriver.hxx b/src/GEOMImpl/GEOMImpl_HealingDriver.hxx index d75796612..83dacd6fa 100644 --- a/src/GEOMImpl/GEOMImpl_HealingDriver.hxx +++ b/src/GEOMImpl/GEOMImpl_HealingDriver.hxx @@ -172,6 +172,7 @@ private: Standard_Boolean RemoveIntWires( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean RemoveHoles ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean Sew ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape&, Standard_Boolean ) const; + Standard_Boolean RemoveInternalFaces ( const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean AddPointOnEdge( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean ChangeOrientation( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; void LimitTolerance( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx index 98f56bf19..e0dd6ba6e 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx @@ -626,7 +626,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::Sew (Handle(GEOM_Object) theObj HI.SetTolerance( theTolerance ); HI.SetOriginal( aLastFunction ); - //Compute the translation + //Compute the result try { #if OCC_VERSION_LARGE > 0x06010000 OCC_CATCH_SIGNALS; @@ -637,9 +637,8 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::Sew (Handle(GEOM_Object) theObj return NULL; } } - catch (Standard_Failure) - { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); SetErrorCode(aFail->GetMessageString()); return NULL; } @@ -659,6 +658,60 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::Sew (Handle(GEOM_Object) theObj return aNewObject; } +//============================================================================= +/*! + * RemoveInternalFaces + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveInternalFaces (Handle(GEOM_Object) theObject) +{ + // set error code, check parameters + SetErrorCode(KO); + + if (theObject.IsNull()) + return NULL; + + Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction(); + if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed + + // Add a new object + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + + //Add the function + aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), REMOVE_INTERNAL_FACES); + if (aFunction.IsNull()) return NULL; + + //Check if the function is set correctly + if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL; + + // prepare "data container" class IHealing + GEOMImpl_IHealing HI (aFunction); + HI.SetOriginal(aLastFunction); + + //Compute the result + try { +#if OCC_VERSION_LARGE > 0x06010000 + OCC_CATCH_SIGNALS; +#endif + if (!GetSolver()->ComputeFunction(aFunction)) + { + SetErrorCode("Healing 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(aFunction) << aNewObject << " = geompy.RemoveInternalFaces(" << theObject << ")"; + + SetErrorCode(OK); + return aNewObject; +} + //============================================================================= /*! * DivideEdge diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx index 37f1b90f4..b194c61e4 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx @@ -74,6 +74,8 @@ class GEOMImpl_IHealingOperations : public GEOM_IOperations { double theTolerance, bool isAllowNonManifold); + Standard_EXPORT Handle(GEOM_Object) RemoveInternalFaces (Handle(GEOM_Object) theObject); + Standard_EXPORT Handle(GEOM_Object) DivideEdge( Handle(GEOM_Object) theObject, int theIndex, double theValue, diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index 2a4a2e91f..77b8a880e 100755 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -301,8 +301,9 @@ #define DIVIDE_EDGE 7 #define CHANGE_ORIENTATION 8 #define LIMIT_TOLERANCE 9 -#define FUSE_COLLINEAR_EDGES 10 -#define SEWING_NON_MANIFOLD 11 +#define FUSE_COLLINEAR_EDGES 10 +#define SEWING_NON_MANIFOLD 11 +#define REMOVE_INTERNAL_FACES 12 #define BASIC_FILLING 1 diff --git a/src/GEOM_I/GEOM_IHealingOperations_i.cc b/src/GEOM_I/GEOM_IHealingOperations_i.cc index 195b4a3a0..c7363fe9e 100644 --- a/src/GEOM_I/GEOM_IHealingOperations_i.cc +++ b/src/GEOM_I/GEOM_IHealingOperations_i.cc @@ -394,6 +394,31 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::SewAllowNonManifold (GEOM::GEOM return GetObject(aNewObject); } +//============================================================================= +/*! + * RemoveInternalFaces + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::RemoveInternalFaces (GEOM::GEOM_Object_ptr theCompound) +{ + GEOM::GEOM_Object_var aGEOMObject; + + // Set a not done flag + GetOperations()->SetNotDone(); + + // Get the object + Handle(GEOM_Object) anObject = GetObjectImpl(theCompound); + if (anObject.IsNull()) + return aGEOMObject._retn(); + + // Perform + Handle(GEOM_Object) aNewObject = GetOperations()->RemoveInternalFaces(anObject); + if (!GetOperations()->IsDone() || aNewObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(aNewObject); +} + //============================================================================= /*! * DivideEdge diff --git a/src/GEOM_I/GEOM_IHealingOperations_i.hh b/src/GEOM_I/GEOM_IHealingOperations_i.hh index 45a85df62..929028005 100644 --- a/src/GEOM_I/GEOM_IHealingOperations_i.hh +++ b/src/GEOM_I/GEOM_IHealingOperations_i.hh @@ -78,6 +78,8 @@ class GEOM_I_EXPORT GEOM_IHealingOperations_i : GEOM::GEOM_Object_ptr SewAllowNonManifold (GEOM::GEOM_Object_ptr theObject, CORBA::Double theTolerance); + GEOM::GEOM_Object_ptr RemoveInternalFaces (GEOM::GEOM_Object_ptr theCompound); + GEOM::GEOM_Object_ptr DivideEdge (GEOM::GEOM_Object_ptr theObject, CORBA::Short theIndex, CORBA::Double theValue, diff --git a/src/GEOM_SWIG/GEOM_TestHealing.py b/src/GEOM_SWIG/GEOM_TestHealing.py index e503ab297..9d711ed68 100644 --- a/src/GEOM_SWIG/GEOM_TestHealing.py +++ b/src/GEOM_SWIG/GEOM_TestHealing.py @@ -368,6 +368,25 @@ def TestFuseEdges (geompy): ii = ii + 1 pass +def TestRemoveWebs (geompy): + + # create solids with some coincident faces + Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) + Translation_1 = geompy.MakeTranslation(Box_1, 200, 0, 0) + Translation_2 = geompy.MakeTranslation(Box_1, 200, 200, 0) + + geompy.addToStudy(Box_1, 'Box_1') + geompy.addToStudy(Translation_1, 'Translation_1') + geompy.addToStudy(Translation_2, 'Translation_2') + + # partition three solids to obtain shared faces + Partition_1 = geompy.MakePartition([Box_1, Translation_1, Translation_2]) + geompy.addToStudy(Partition_1, 'Partition_1') + + # remove shared faces to obtain one solid instead of three + Joined_1 = geompy.RemoveInternalFaces(Partition_1) + geompy.addToStudy(Joined_1, 'Joined_1') + def TestHealingOperations (geompy, math): TestMakeSewing(geompy, math) @@ -378,3 +397,4 @@ def TestHealingOperations (geompy, math): TestSuppressFaces(geompy) TestProcessShape(geompy) TestFuseEdges(geompy) + TestRemoveWebs(geompy) diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py index b60b70532..7f309b0f2 100644 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -5996,6 +5996,36 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): self._autoPublish(anObj, theName, "sewed") return anObj + ## Rebuild the topology of theCompound of solids by removing + # of the faces that are shared by several solids. + # @param theCompound Shape to be processed. + # @param theName Object name; when specified, this parameter is used + # for result publication in the study. Otherwise, if automatic + # publication is switched on, default value is used for result name. + # + # @return New GEOM.GEOM_Object, containing processed shape. + # + # @ref tui_remove_webs "Example" + def RemoveInternalFaces (self, theCompound, theName=None): + """ + Rebuild the topology of theCompound of solids by removing + of the faces that are shared by several solids. + + Parameters: + theCompound Shape to be processed. + theName Object name; when specified, this parameter is used + for result publication in the study. Otherwise, if automatic + publication is switched on, default value is used for result name. + + Returns: + New GEOM.GEOM_Object, containing processed shape. + """ + # Example: see GEOM_TestHealing.py + anObj = self.HealOp.RemoveInternalFaces(theCompound) + RaiseIfFailed("RemoveInternalFaces", self.HealOp) + self._autoPublish(anObj, theName, "removeWebs") + return anObj + ## Remove internal wires and edges from the given object (face). # @param theObject Shape to be processed. # @param theWires Indices of wires to be removed, if EMPTY then the method diff --git a/src/RepairGUI/Makefile.am b/src/RepairGUI/Makefile.am index 6b267669a..adec8540e 100644 --- a/src/RepairGUI/Makefile.am +++ b/src/RepairGUI/Makefile.am @@ -38,6 +38,7 @@ salomeinclude_HEADERS = \ RepairGUI_ChangeOrientationDlg.h \ RepairGUI_GlueDlg.h \ RepairGUI_LimitToleranceDlg.h \ + RepairGUI_RemoveWebsDlg.h \ RepairGUI_RemoveExtraEdgesDlg.h \ RepairGUI_UnionFacesDlg.h \ RepairGUI_FuseEdgesDlg.h @@ -59,6 +60,7 @@ dist_libRepairGUI_la_SOURCES = \ RepairGUI_ChangeOrientationDlg.h \ RepairGUI_GlueDlg.h \ RepairGUI_LimitToleranceDlg.h \ + RepairGUI_RemoveWebsDlg.h \ RepairGUI_RemoveExtraEdgesDlg.h \ RepairGUI_UnionFacesDlg.h \ RepairGUI_FuseEdgesDlg.h \ @@ -76,6 +78,7 @@ dist_libRepairGUI_la_SOURCES = \ RepairGUI_ChangeOrientationDlg.cxx \ RepairGUI_GlueDlg.cxx \ RepairGUI_LimitToleranceDlg.cxx \ + RepairGUI_RemoveWebsDlg.cxx \ RepairGUI_RemoveExtraEdgesDlg.cxx \ RepairGUI_UnionFacesDlg.cxx \ RepairGUI_FuseEdgesDlg.cxx @@ -93,8 +96,9 @@ MOC_FILES = \ RepairGUI_ChangeOrientationDlg_moc.cxx \ RepairGUI_GlueDlg_moc.cxx \ RepairGUI_LimitToleranceDlg_moc.cxx \ + RepairGUI_RemoveWebsDlg_moc.cxx \ RepairGUI_RemoveExtraEdgesDlg_moc.cxx \ - RepairGUI_UnionFacesDlg_moc.cxx \ + RepairGUI_UnionFacesDlg_moc.cxx \ RepairGUI_FuseEdgesDlg_moc.cxx nodist_libRepairGUI_la_SOURCES = \ diff --git a/src/RepairGUI/RepairGUI.cxx b/src/RepairGUI/RepairGUI.cxx index e2a8dc187..860459574 100644 --- a/src/RepairGUI/RepairGUI.cxx +++ b/src/RepairGUI/RepairGUI.cxx @@ -43,6 +43,7 @@ #include "RepairGUI_GlueDlg.h" // Method GLUE FACES #include "RepairGUI_LimitToleranceDlg.h" // Method LIMIT TOLERANCE #include "RepairGUI_ChangeOrientationDlg.h" // Method CHANGE ORIENTATION +#include "RepairGUI_RemoveWebsDlg.h" // Method REMOVE INTERNAL FACES #include "RepairGUI_RemoveExtraEdgesDlg.h" // Method REMOVE EXTRA EDGES #include "RepairGUI_FuseEdgesDlg.h" // Method FUSE COLLINEAR EDGES #include "RepairGUI_UnionFacesDlg.h" // Method UNION FACES @@ -91,6 +92,7 @@ bool RepairGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) case GEOMOp::OpFreeBoundaries: aDlg = new RepairGUI_FreeBoundDlg (getGeometryGUI(), parent); break; case GEOMOp::OpFreeFaces: aDlg = new RepairGUI_FreeFacesDlg (getGeometryGUI(), parent); break; case GEOMOp::OpOrientation: aDlg = new RepairGUI_ChangeOrientationDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpRemoveWebs: aDlg = new RepairGUI_RemoveWebsDlg (getGeometryGUI(), parent); break; case GEOMOp::OpRemoveExtraEdges: aDlg = new RepairGUI_RemoveExtraEdgesDlg (getGeometryGUI(), parent); break; case GEOMOp::OpFuseEdges: aDlg = new RepairGUI_FuseEdgesDlg (getGeometryGUI(), parent); break; case GEOMOp::OpUnionFaces: aDlg = new RepairGUI_UnionFacesDlg (getGeometryGUI(), parent); break; diff --git a/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx b/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx new file mode 100755 index 000000000..56fcf6d50 --- /dev/null +++ b/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx @@ -0,0 +1,296 @@ +// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 RepairGUI : GUI for Geometry component +// File : RepairGUI_RemoveWebsDlg.cxx + +#include "RepairGUI_RemoveWebsDlg.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +//================================================================================= +// class : RepairGUI_RemoveWebsDlg() +// purpose : Constructs a RepairGUI_RemoveWebsDlg 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. +//================================================================================= +RepairGUI_RemoveWebsDlg::RepairGUI_RemoveWebsDlg (GeometryGUI* theGeometryGUI, QWidget* parent, + bool modal) + : GEOMBase_Skeleton(theGeometryGUI, parent, modal) +{ + SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); + QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_REMOVE_WEBS"))); + QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); + + setWindowTitle(tr("GEOM_REMOVE_WEBS_TITLE")); + + /***************************************************************/ + mainFrame()->GroupConstructors->setTitle(tr("GEOM_REMOVE_WEBS_TITLE")); + mainFrame()->RadioButton1->setIcon( image0 ); + mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose ); + mainFrame()->RadioButton2->close(); + mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + mainFrame()->RadioButton3->close(); + + GroupPoints = new DlgRef_1Sel( centralWidget() ); + + GroupPoints->GroupBox1->setTitle( tr( "GEOM_REMOVE_WEBS" ) ); + GroupPoints->TextLabel1->setText( tr( "GEOM_SELECTED_SHAPE" ) ); + GroupPoints->PushButton1->setIcon( image1 ); + GroupPoints->LineEdit1->setReadOnly( true ); + + QVBoxLayout* layout = new QVBoxLayout( centralWidget() ); + layout->setMargin( 0 ); layout->setSpacing( 6 ); + layout->addWidget( GroupPoints ); + + /***************************************************************/ + + setHelpFileName( "remove_webs_operation_page.html" ); + + Init(); +} + +//================================================================================= +// function : ~RepairGUI_RemoveWebsDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +RepairGUI_RemoveWebsDlg::~RepairGUI_RemoveWebsDlg() +{ +} + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void RepairGUI_RemoveWebsDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupPoints->LineEdit1; + + myOkObject = false; + + activateSelection(); + + mainFrame()->GroupBoxPublish->show(); + //Hide preview checkbox + mainFrame()->CheckBoxPreview->hide(); + + /* signals and slots connections */ + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); + + connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + + initName(tr("REMOVE_WEBS_NEW_OBJ_NAME")); + resize(100,100); + SelectionIntoArgument(); +} + +//================================================================================= +// function : ClickOnOk() +// purpose : Same than click on apply but close this dialog. +//================================================================================= +void RepairGUI_RemoveWebsDlg::ClickOnOk() +{ + setIsApplyAndClose(true); + if (ClickOnApply()) + ClickOnCancel(); +} + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +bool RepairGUI_RemoveWebsDlg::ClickOnApply() +{ + if (!onAccept()) + return false; + + initName(); + + myEditCurrentArgument->setText(""); + myObject = GEOM::GEOM_Object::_nil(); + + myOkObject = false; + + activateSelection(); + + return true; +} + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +// : used only by SelectButtonC1A1 (LineEditC1A1) +//================================================================================= +void RepairGUI_RemoveWebsDlg::SelectionIntoArgument() +{ + myEditCurrentArgument->setText( "" ); + QString aName; + + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + SALOME_ListIO aSelList; + aSelMgr->selectedObjects(aSelList); + + if (myEditCurrentArgument == GroupPoints->LineEdit1) { + if (aSelList.Extent() != 1) { + if (myEditCurrentArgument == GroupPoints->LineEdit1) + myOkObject = false; + return; + } + } + + // nbSel == 1 + GEOM::GEOM_Object_ptr aSelectedObject = + GEOMBase::ConvertIOinGEOMObject(aSelList.First()); + + if (CORBA::is_nil(aSelectedObject)) + return; + + if (myEditCurrentArgument == GroupPoints->LineEdit1) { + myObject = aSelectedObject; + myOkObject = true; + } + + myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject)); +} + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void RepairGUI_RemoveWebsDlg::SetEditCurrentArgument() +{ + if (sender() == GroupPoints->PushButton1) { + GroupPoints->LineEdit1->setFocus(); + myEditCurrentArgument = GroupPoints->LineEdit1; + } + SelectionIntoArgument(); +} + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void RepairGUI_RemoveWebsDlg::LineEditReturnPressed() +{ + if (sender() == GroupPoints->LineEdit1) { + myEditCurrentArgument = GroupPoints->LineEdit1; + GEOMBase_Skeleton::LineEditReturnPressed(); + } +} + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void RepairGUI_RemoveWebsDlg::ActivateThisDialog() +{ + GEOMBase_Skeleton::ActivateThisDialog(); + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + + activateSelection(); +} + +//================================================================================= +// function : enterEvent() +// purpose : Mouse enter onto the dialog to activate it +//================================================================================= +void RepairGUI_RemoveWebsDlg::enterEvent (QEvent* e) +{ + if (!mainFrame()->GroupConstructors->isEnabled()) + ActivateThisDialog(); +} + +//================================================================================= +// function : activateSelection +// purpose : activate selection of solids and compounds +//================================================================================= +void RepairGUI_RemoveWebsDlg::activateSelection() +{ + TColStd_MapOfInteger aTypes; + //aTypes.Add( GEOM_SOLID ); + aTypes.Add( GEOM_COMPOUND ); + globalSelection( aTypes ); +} + +//================================================================================= +// function : createOperation +// purpose : +//================================================================================= +GEOM::GEOM_IOperations_ptr RepairGUI_RemoveWebsDlg::createOperation() +{ + return getGeomEngine()->GetIHealingOperations(getStudyId()); +} + +//================================================================================= +// function : isValid +// purpose : +//================================================================================= +bool RepairGUI_RemoveWebsDlg::isValid (QString& msg) +{ + return myOkObject; +} + +//================================================================================= +// function : execute +// purpose : +//================================================================================= +bool RepairGUI_RemoveWebsDlg::execute (ObjectList& objects) +{ + GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow(getOperation()); + GEOM::GEOM_Object_var anObj = anOper->RemoveInternalFaces(myObject); + + if (!anObj->_is_nil()) + objects.push_back(anObj._retn()); + + return true; +} + +//================================================================================= +// function : restoreSubShapes +// purpose : +//================================================================================= +void RepairGUI_RemoveWebsDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theSObject) +{ + if (mainFrame()->CheckBoxRestoreSS->isChecked()) { + // empty list of arguments means that all arguments should be restored + getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory + /*theInheritFirstArg=*/true, + mainFrame()->CheckBoxAddPrefix->isChecked()); + } +} diff --git a/src/RepairGUI/RepairGUI_RemoveWebsDlg.h b/src/RepairGUI/RepairGUI_RemoveWebsDlg.h new file mode 100755 index 000000000..9aee4d9ae --- /dev/null +++ b/src/RepairGUI/RepairGUI_RemoveWebsDlg.h @@ -0,0 +1,70 @@ +// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 : RepairGUI_RemoveWebsDlg.h + +#ifndef REPAIRGUI_REMOVEWEBSDLG_H +#define REPAIRGUI_REMOVEWEBSDLG_H + +#include + +class DlgRef_1Sel; + +//================================================================================= +// class : RepairGUI_RemoveWebsDlg +// purpose : Unites faces of a given shape. +//================================================================================= +class RepairGUI_RemoveWebsDlg : public GEOMBase_Skeleton +{ + Q_OBJECT + +public: + RepairGUI_RemoveWebsDlg (GeometryGUI*, QWidget* = 0, bool = false); + ~RepairGUI_RemoveWebsDlg(); + +protected: + // redefined from GEOMBase_Helper + virtual GEOM::GEOM_IOperations_ptr createOperation(); + virtual bool isValid (QString&); + virtual bool execute (ObjectList&); + virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + +private: + void Init(); + void enterEvent (QEvent*); + void activateSelection(); + +private: + GEOM::GEOM_Object_var myObject; + bool myOkObject; + + DlgRef_1Sel* GroupPoints; + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + + void ActivateThisDialog(); + + void LineEditReturnPressed(); + void SelectionIntoArgument(); + void SetEditCurrentArgument(); +}; + +#endif // REPAIRGUI_REMOVEWEBSDLG_H -- 2.39.2