From: vsr Date: Wed, 10 Mar 2010 08:08:20 +0000 (+0000) Subject: 0020695: EDF 1076 GEOM: Add a new shape in GEOM: T-shape X-Git-Tag: V5_1_4a1~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ece47f8e463bab875187bc77b95cb161aee2dcbb;p=modules%2Fgeom.git 0020695: EDF 1076 GEOM: Add a new shape in GEOM: T-shape --- diff --git a/configure.ac b/configure.ac index 690577675..8959c38df 100644 --- a/configure.ac +++ b/configure.ac @@ -392,6 +392,7 @@ AC_OUTPUT([ \ doc/salome/tui/Makefile \ doc/salome/tui/doxyfile \ src/Makefile \ + src/AdvancedGUI/Makefile \ src/ARCHIMEDE/Makefile \ src/BREPExport/Makefile \ src/BREPImport/Makefile \ diff --git a/doc/salome/gui/GEOM/input/creating_adv_obj.doc b/doc/salome/gui/GEOM/input/creating_adv_obj.doc index 26b0b4601..93dcc5dfa 100644 --- a/doc/salome/gui/GEOM/input/creating_adv_obj.doc +++ b/doc/salome/gui/GEOM/input/creating_adv_obj.doc @@ -14,4 +14,10 @@ entities:
  • \subpage create_compound_page
  • -*/ \ No newline at end of file +New Entity -> Advanced submenu allows to create additional complex topological objects. + + + +*/ diff --git a/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc b/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc index 21efff941..818742073 100644 --- a/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc +++ b/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc @@ -218,4 +218,5 @@ id_compound = geompy.addToStudy(compound,"Compound") gg.createAndDisplayGO(id_compound) \endcode -*/ \ No newline at end of file + +*/ diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 7c3574ec8..8ff5ac589 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -3127,6 +3127,14 @@ module GEOM }; + /*! + * GEOM_IAdvancedOperations: Interface for advanced modeling functions. + */ + interface GEOM_IAdvancedOperations : GEOM_IOperations + { + /*@@ insert new functions before this line @@*/ + }; + /*! * GEOM_Gen: Interface to access other GEOM interfaces. * Also contains some methods to access and manage GEOM objects. @@ -3206,6 +3214,7 @@ module GEOM GEOM_IMeasureOperations GetIMeasureOperations (in long theStudyID) raises (SALOME::SALOME_Exception); GEOM_IBlocksOperations GetIBlocksOperations (in long theStudyID) raises (SALOME::SALOME_Exception); GEOM_IGroupOperations GetIGroupOperations (in long theStudyID) raises (SALOME::SALOME_Exception); + GEOM_IAdvancedOperations GetIAdvancedOperations (in long theStudyID) raises (SALOME::SALOME_Exception); /*! * Objects Management diff --git a/resources/Makefile.am b/resources/Makefile.am index 30478317f..c980b1e26 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -228,5 +228,10 @@ remove_extra_edges.png \ coordsys.png \ translation.png +ADVANCED_RESOURCES = +##@@ insert new functions before this line @@## + +dist_salomeres_DATA += $(ADVANCED_RESOURCES) + # VSR: little trick to avoid putting if GEOMCatalog.xml to the distribution archive nodist_salomeres_SCRIPTS = GEOMCatalog.xml diff --git a/src/AdvancedGUI/AdvancedGUI.cxx b/src/AdvancedGUI/AdvancedGUI.cxx new file mode 100644 index 000000000..d43aecba0 --- /dev/null +++ b/src/AdvancedGUI/AdvancedGUI.cxx @@ -0,0 +1,92 @@ +// Copyright (C) 2007-2008 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 +// +// File : AdvancedGUI.cxx +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// + +#include "AdvancedGUI.h" + +#include "GeometryGUI.h" +#include "GeometryGUI_Operations.h" + +#include +#include + +//@@ insert new functions before this line @@// + +#include + +//======================================================================= +// function : AdvancedGUI() +// purpose : Constructor +//======================================================================= +AdvancedGUI::AdvancedGUI( GeometryGUI* parent ) : GEOMGUI( parent ) +{ +} + +//======================================================================= +// function : ~AdvancedGUI +// purpose : Destructor +//======================================================================= +AdvancedGUI::~AdvancedGUI() +{ +} + +//======================================================================= +// function : OnGUIEvent() +// purpose : +//======================================================================= +bool AdvancedGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) +{ + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return false; + + getGeometryGUI()->EmitSignalDeactivateDialog(); + + QDialog* aDlg = NULL; + + switch ( theCommandID ) { + //@@ insert new functions before this line @@// + default: + app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); + break; + } + + if ( aDlg != NULL ) + aDlg->show(); + + return true; +} + +//===================================================================================== +// EXPORTED METHODS +//===================================================================================== +extern "C" +{ +#ifdef WIN32 + __declspec( dllexport ) +#endif + GEOMGUI* GetLibGUI( GeometryGUI* parent ) + { + return new AdvancedGUI( parent ); + } +} diff --git a/src/AdvancedGUI/AdvancedGUI.h b/src/AdvancedGUI/AdvancedGUI.h new file mode 100644 index 000000000..de6c50404 --- /dev/null +++ b/src/AdvancedGUI/AdvancedGUI.h @@ -0,0 +1,44 @@ +// Copyright (C) 2007-2008 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 +// +// File : AdvancedGUI.h +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// + +#ifndef ADVANCEDGUI_H +#define ADVANCEDGUI_H + +#include "GEOMGUI.h" + +//================================================================================= +// class : AdvancedGUI +// purpose : +//================================================================================= +class AdvancedGUI : public GEOMGUI +{ +public: + AdvancedGUI( GeometryGUI* ); + ~AdvancedGUI(); + + bool OnGUIEvent( int, SUIT_Desktop* ); +}; + +#endif // ADVANCEDGUI_H diff --git a/src/AdvancedGUI/Makefile.am b/src/AdvancedGUI/Makefile.am new file mode 100644 index 000000000..7952de7ba --- /dev/null +++ b/src/AdvancedGUI/Makefile.am @@ -0,0 +1,83 @@ +# Copyright (C) 2007-2008 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 +# +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +# + +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +# header files +salomeinclude_HEADERS = \ + AdvancedGUI.h + +ADVANCED_INCLUDES = +##@@ insert new functions before this line @@## + +salomeinclude_HEADERS += $(ADVANCED_INCLUDES) + +# Libraries targets +lib_LTLIBRARIES = libAdvancedGUI.la + +dist_libAdvancedGUI_la_SOURCES = \ + AdvancedGUI.h \ + AdvancedGUI.cxx + +ADVANCED_SOURCES = +##@@ insert new functions before this line @@## + +dist_libAdvancedGUI_la_SOURCES += $(ADVANCED_SOURCES) + +MOC_FILES = + +ADVANCED_MOC_FILES = +##@@ insert new functions before this line @@## + +MOC_FILES += $(ADVANCED_MOC_FILES) + +nodist_libAdvancedGUI_la_SOURCES = \ + $(MOC_FILES) + +# additional information to compile and link file + +libAdvancedGUI_la_CPPFLAGS = \ + $(QT_INCLUDES) \ + $(VTK_INCLUDES) \ + $(CAS_CPPFLAGS) \ + $(PYTHON_INCLUDES) \ + $(BOOST_CPPFLAGS) \ + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(CORBA_CXXFLAGS) \ + $(CORBA_INCLUDES) \ + -I$(srcdir)/../GEOMGUI \ + -I$(srcdir)/../DlgRef \ + -I$(srcdir)/../GEOMBase \ + -I$(srcdir)/../OBJECT \ + -I$(srcdir)/../GEOMClient \ + -I$(srcdir)/../GEOMImpl \ + -I$(srcdir)/../GEOMFiltersSelection \ + -I$(top_builddir)/src/DlgRef \ + -I$(top_builddir)/idl + +libAdvancedGUI_la_LDFLAGS = \ + ../GEOMFiltersSelection/libGEOMFiltersSelection.la \ + ../GEOMBase/libGEOMBase.la diff --git a/src/GEOMGUI/GEOM_images.ts b/src/GEOMGUI/GEOM_images.ts index 89f126b3f..f2e4ad77a 100644 --- a/src/GEOMGUI/GEOM_images.ts +++ b/src/GEOMGUI/GEOM_images.ts @@ -1077,5 +1077,6 @@ ICON_DLG_SCALE_ALONG_AXES scale_along_axes.png + diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 8ee02cf93..c084bb52d 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -2423,6 +2423,10 @@ Please, select face, shell or solid and try again MEN_PRIMITIVES Primitives + + MEN_ADVANCED + Advanced + MEN_PROPAGATE Propagate @@ -4419,4 +4423,5 @@ Would you like to continue? Load Texture + diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 2de1b4dcc..0d45fcc87 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -499,6 +499,10 @@ void GeometryGUI::OnGUIEvent( int id ) case GEOMOp::OpExplodeBlock: // MENU BLOCKS - EXPLODE ON BLOCKS libName = "BlocksGUI"; break; + case GEOMOp::OpAdvancedNoOp: // NO OPERATION (advanced operations base) + //@@ insert new functions before this line @@// + libName = "AdvancedGUI"; + break; default: break; } @@ -723,6 +727,8 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::OpShowChildren, "POP_SHOW_CHILDREN" ); createGeomAction( GEOMOp::OpHideChildren, "POP_HIDE_CHILDREN" ); createGeomAction( GEOMOp::OpPointMarker, "POP_POINT_MARKER" ); + + //@@ insert new functions before this line @@// // ---- create menus -------------------------- @@ -764,6 +770,9 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( GEOMOp::OpFilling, genId, -1 ); createMenu( GEOMOp::OpPipe, genId, -1 ); + int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 ); + //@@ insert new functions before this line @@// + createMenu( separator(), newEntId, -1 ); int groupId = createMenu( tr( "MEN_GROUP" ), newEntId, -1 ); diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h index 33b5e1830..c58980b4c 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -28,7 +28,7 @@ namespace GEOMOp { enum { - // ToolsGUI + // ToolsGUI ------------------//-------------------------------- OpImport = 1000, // MENU FILE - IMPORT OpExport = 1001, // MENU FILE - EXPORT OpDelete = 1020, // MENU EDIT - DELETE @@ -51,7 +51,7 @@ namespace GEOMOp { OpShowChildren = 1250, // POPUP MENU - SHOW CHILDREN OpHideChildren = 1251, // POPUP MENU - HIDE CHILDREN OpRename = 1252, // POPUP MENU - RENAME - // DisplayGUI + // DisplayGUI ----------------//-------------------------------- OpDisplayMode = 2000, // MENU VIEW - DISPLAY MODE - WIREFRAME/SHADING OpSwitchVectors = 2001, // MENU VIEW - DISPLAY MODE - SHOW/HIDE EDGE DIRECTION OpShowAll = 2002, // MENU VIEW - SHOW ALL @@ -62,7 +62,7 @@ namespace GEOMOp { OpWireframe = 2200, // POPUP MENU - DISPLAY MODE - WIREFRAME OpShading = 2201, // POPUP MENU - DISPLAY MODE - SHADING OpVectors = 2202, // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION - // BasicGUI + // BasicGUI ------------------//-------------------------------- OpPoint = 3000, // MENU NEW ENTITY - BASIC - POINT OpLine = 3001, // MENU NEW ENTITY - BASIC - LINE OpCircle = 3002, // MENU NEW ENTITY - BASIC - CIRCLE @@ -72,7 +72,7 @@ namespace GEOMOp { OpPlane = 3006, // MENU NEW ENTITY - BASIC - PLANE OpCurve = 3007, // MENU NEW ENTITY - BASIC - CURVE OpLCS = 3008, // MENU NEW ENTITY - BASIC - LOCAL COORDINATE SYSTEM - // PrimitiveGUI + // PrimitiveGUI --------------//-------------------------------- OpBox = 3100, // MENU NEW ENTITY - PRIMITIVES - BOX OpCylinder = 3101, // MENU NEW ENTITY - PRIMITIVES - CYLINDER OpSphere = 3102, // MENU NEW ENTITY - PRIMITIVES - SPHERE @@ -80,28 +80,28 @@ 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 - // 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 @@ -120,7 +120,7 @@ namespace GEOMOp { OpFillet2d = 3705, // MENU OPERATION - FILLET 2D OpFillet1d = 3706, // MENU OPERATION - FILLET 1D OpClipping = 3707, // MENU OPERATION - CLIPPING RANGE - // RepairGUI + // RepairGUI -----------------//-------------------------------- OpSewing = 4000, // MENU REPAIR - SEWING OpSuppressFaces = 4001, // MENU REPAIR - SUPPRESS FACES OpSuppressHoles = 4002, // MENU REPAIR - SUPPRESS HOLES @@ -133,7 +133,7 @@ namespace GEOMOp { OpOrientation = 4009, // MENU REPAIR - CHANGE ORIENTATION OpGlueFaces = 4010, // MENU REPAIR - GLUE FACES OpRemoveExtraEdges = 4011, // MENU REPAIR - REMOVE EXTRA EDGES - // MeasureGUI + // MeasureGUI ----------------//-------------------------------- OpProperties = 5000, // MENU MEASURES - PROPERTIES OpCenterMass = 5001, // MENU MEASURES - CENTRE OF MASS OpInertia = 5002, // MENU MEASURES - INERTIA @@ -146,16 +146,19 @@ namespace GEOMOp { OpCheckShape = 5009, // MENU MEASURES - CHECK OpCheckCompound = 5010, // MENU MEASURES - CHECK COMPOUND OF BLOCKS OpPointCoordinates = 5011, // MENU MEASURES - POINT COORDINATES - // GroupGUI + // 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 ---------------//-------------------------------- + OpAdvancedNoOp = 10000, // NO OPERATION (advanced operations base) + //@@ insert new functions before this line @@// }; } diff --git a/src/GEOMImpl/GEOMImpl_Gen.cxx b/src/GEOMImpl/GEOMImpl_Gen.cxx index a920fe3cf..1974fcb66 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.cxx +++ b/src/GEOMImpl/GEOMImpl_Gen.cxx @@ -79,6 +79,8 @@ #include #include #include +// Advanced operations +/*@@ insert new functions before this line @@*/ //============================================================================= /*! @@ -158,6 +160,9 @@ GEOMImpl_Gen::GEOMImpl_Gen() // Measurements TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MeasureDriver::GetID(), new GEOMImpl_MeasureDriver()); + // Advanced operations + /*@@ insert new functions before this line @@*/ + SetEngine(this); } @@ -387,3 +392,18 @@ GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations(int theDocID) return _mapOfGroupOperations[theDocID]; } + +//============================================================================= +/*! + * GetIAdvancedOperations + */ +//============================================================================= +GEOMImpl_IAdvancedOperations* GEOMImpl_Gen::GetIAdvancedOperations(int theDocID) +{ + if(_mapOfAdvancedOperations.find(theDocID) == _mapOfAdvancedOperations.end()) { + _mapOfAdvancedOperations[theDocID] = new GEOMImpl_IAdvancedOperations(this, theDocID); + } + + return _mapOfAdvancedOperations[theDocID]; +} + diff --git a/src/GEOMImpl/GEOMImpl_Gen.hxx b/src/GEOMImpl/GEOMImpl_Gen.hxx index c777a3a6b..8bfcbbcd5 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.hxx +++ b/src/GEOMImpl/GEOMImpl_Gen.hxx @@ -38,6 +38,7 @@ #include "GEOMImpl_IInsertOperations.hxx" #include "GEOMImpl_IMeasureOperations.hxx" #include "GEOMImpl_IGroupOperations.hxx" +#include "GEOMImpl_IAdvancedOperations.hxx" #include "GEOM_Engine.hxx" class GEOMIMPL_EXPORT GEOMImpl_Gen : public GEOM_Engine @@ -70,6 +71,8 @@ class GEOMIMPL_EXPORT GEOMImpl_Gen : public GEOM_Engine GEOMImpl_IGroupOperations* GetIGroupOperations(int theDocID); + GEOMImpl_IAdvancedOperations* GetIAdvancedOperations(int theDocID); + private: std::map _mapOfBasicOperations; @@ -83,7 +86,8 @@ class GEOMIMPL_EXPORT GEOMImpl_Gen : public GEOM_Engine std::map _mapOfLocalOperations; std::map _mapOfInsertOperations; std::map _mapOfMeasureOperations; - std::map _mapOfGroupOperations; + std::map _mapOfGroupOperations; + std::map _mapOfAdvancedOperations; }; #endif diff --git a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx new file mode 100644 index 000000000..4fff5eee0 --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx @@ -0,0 +1,68 @@ +// Copyright (C) 2007-2008 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 +// +// File : GEOMImpl_IAdvancedOperations.cxx +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// + +#include + +#include "GEOMImpl_IAdvancedOperations.hxx" +#include "GEOMImpl_Types.hxx" + +#include +#include +#include + +#include "GEOM_Function.hxx" +#include "GEOM_PythonDump.hxx" + +/*@@ insert new functions before this line @@*/ + +#include +#include +#include +#include +#include +#include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC + +//============================================================================= +/*! + * Constructor + */ +//============================================================================= +GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations (GEOM_Engine* theEngine, int theDocID) +: GEOM_IOperations(theEngine, theDocID) +{ + MESSAGE("GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations"); +} + +//============================================================================= +/*! + * Destructor + */ +//============================================================================= +GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations() +{ + MESSAGE("GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations"); +} + +/*@@ insert new functions before this line @@*/ diff --git a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx new file mode 100644 index 000000000..997023edc --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx @@ -0,0 +1,43 @@ +// Copyright (C) 2007-2008 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 +// +// File : GEOMImpl_IAdvancedOperations.hxx +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// + +#ifndef _GEOMImpl_IAdvancedOperations_HXX_ +#define _GEOMImpl_IAdvancedOperations_HXX_ + +#include +#include "GEOM_IOperations.hxx" +#include "GEOM_Engine.hxx" +#include "GEOM_Object.hxx" + +class GEOMImpl_IAdvancedOperations : public GEOM_IOperations +{ +public: + Standard_EXPORT GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT ~GEOMImpl_IAdvancedOperations(); + + /*@@ insert new functions before this line @@*/ +}; + +#endif diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index bab5e2de2..734e5dd3b 100755 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -299,3 +299,10 @@ #define MARKER_CS 1 #define MARKER_SHAPE 2 #define MARKER_PNT2VEC 3 + +// Advanced functions (base = 200) +#define ADVANCED_BASE 200 // NO OPERATION (advanced operations base) +/*@@ insert new functions before this line @@*/ + +// Advanced functions sub-operations codes +/*@@ insert new functions before this line @@*/ diff --git a/src/GEOMImpl/Makefile.am b/src/GEOMImpl/Makefile.am index 948b0c0b1..2774521b1 100644 --- a/src/GEOMImpl/Makefile.am +++ b/src/GEOMImpl/Makefile.am @@ -47,6 +47,7 @@ salomeinclude_HEADERS = \ GEOMImpl_IInsertOperations.hxx \ GEOMImpl_IMeasureOperations.hxx \ GEOMImpl_IGroupOperations.hxx \ + GEOMImpl_IAdvancedOperations.hxx \ GEOMImpl_IGlue.hxx \ GEOMImpl_PointDriver.hxx \ GEOMImpl_IPoint.hxx \ @@ -145,6 +146,11 @@ salomeinclude_HEADERS = \ GEOMImpl_Types.hxx \ GEOM_GEOMImpl.hxx +ADVANCED_INCLUDES = +##@@ insert new functions before this line @@## + +salomeinclude_HEADERS += $(ADVANCED_INCLUDES) + dist_libGEOMimpl_la_SOURCES = \ GEOMImpl_IBasicOperations.cxx \ GEOMImpl_ITransformOperations.cxx \ @@ -158,6 +164,7 @@ dist_libGEOMimpl_la_SOURCES = \ GEOMImpl_IInsertOperations.cxx \ GEOMImpl_IMeasureOperations.cxx \ GEOMImpl_IGroupOperations.cxx \ + GEOMImpl_IAdvancedOperations.cxx \ GEOMImpl_Gen.cxx \ GEOMImpl_PointDriver.cxx \ GEOMImpl_VectorDriver.cxx \ @@ -207,6 +214,11 @@ dist_libGEOMimpl_la_SOURCES = \ GEOMImpl_FillingDriver.cxx \ GEOMImpl_GlueDriver.cxx +ADVANCED_SOURCES = +##@@ insert new functions before this line @@## + +dist_libGEOMimpl_la_SOURCES += $(ADVANCED_SOURCES) + # additional information to compile and link file libGEOMimpl_la_CPPFLAGS = \ diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index 58471eebb..ab55467b0 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -1554,6 +1554,26 @@ GEOM::GEOM_IGroupOperations_ptr GEOM_Gen_i::GetIGroupOperations(CORBA::Long theS return operations._retn(); } +//============================================================================ +// function : GetIAdvancedOperations +// purpose : +//============================================================================ +GEOM::GEOM_IAdvancedOperations_ptr GEOM_Gen_i::GetIAdvancedOperations(CORBA::Long theStudyID) + throw ( SALOME::SALOME_Exception ) +{ + Unexpect aCatch(SALOME_SalomeException); + MESSAGE( "GEOM_Gen_i::GetIAdvancedOperations" ); + + GEOM::GEOM_Gen_ptr engine = _this(); + + GEOM_IAdvancedOperations_i* aServant = + new GEOM_IAdvancedOperations_i(_poa, engine, _impl->GetIAdvancedOperations(theStudyID)); + + // activate the CORBA servant + GEOM::GEOM_IAdvancedOperations_var operations = aServant->_this(); + return operations._retn(); +} + //============================================================================= /*! * AddSubShape diff --git a/src/GEOM_I/GEOM_Gen_i.hh b/src/GEOM_I/GEOM_Gen_i.hh index 4bd530fa1..d8862fce6 100644 --- a/src/GEOM_I/GEOM_Gen_i.hh +++ b/src/GEOM_I/GEOM_Gen_i.hh @@ -49,6 +49,7 @@ #include "GEOM_IInsertOperations_i.hh" #include "GEOM_IMeasureOperations_i.hh" #include "GEOM_IGroupOperations_i.hh" +#include "GEOM_IAdvancedOperations_i.hh" #include @@ -220,6 +221,10 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations (CORBA::Long theStudyID) throw (SALOME::SALOME_Exception); + //Returns a pointer to AdvancedOperations interface + virtual GEOM::GEOM_IAdvancedOperations_ptr GetIAdvancedOperations (CORBA::Long theStudyID) + throw (SALOME::SALOME_Exception); + //Adds a new sub shape virtual GEOM::GEOM_Object_ptr AddSubShape (GEOM::GEOM_Object_ptr theMainShape, const GEOM::ListOfLong& theIndices); diff --git a/src/GEOM_I/GEOM_IAdvancedOperations_i.cc b/src/GEOM_I/GEOM_IAdvancedOperations_i.cc new file mode 100644 index 000000000..fa6fe5b79 --- /dev/null +++ b/src/GEOM_I/GEOM_IAdvancedOperations_i.cc @@ -0,0 +1,58 @@ +// Copyright (C) 2007-2008 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 +// +// File : GEOM_IAdvancedOperations.cc +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// + +#include + +#include "GEOM_IAdvancedOperations_i.hh" + +#include +#include +#include + +#include "GEOM_Engine.hxx" +#include "GEOM_Object.hxx" + +//============================================================================= +/*! + * constructor: + */ +//============================================================================= +GEOM_IAdvancedOperations_i::GEOM_IAdvancedOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_IAdvancedOperations* theImpl) +:GEOM_IOperations_i(thePOA, theEngine, theImpl) +{ + MESSAGE("GEOM_IAdvancedOperations_i::GEOM_IAdvancedOperations_i"); +} + +//============================================================================= +/*! + * destructor + */ +//============================================================================= +GEOM_IAdvancedOperations_i::~GEOM_IAdvancedOperations_i() +{ + MESSAGE("GEOM_IAdvancedOperations_i::~GEOM_IAdvancedOperations_i"); +} + +/*@@ insert new functions before this line @@*/ diff --git a/src/GEOM_I/GEOM_IAdvancedOperations_i.hh b/src/GEOM_I/GEOM_IAdvancedOperations_i.hh new file mode 100644 index 000000000..a40f62e8a --- /dev/null +++ b/src/GEOM_I/GEOM_IAdvancedOperations_i.hh @@ -0,0 +1,54 @@ +// Copyright (C) 2007-2008 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 +// +// File : GEOM_IAdvancedOperations.hh +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// + +#ifndef _GEOM_IAdvancedOperations_i_HeaderFile +#define _GEOM_IAdvancedOperations_i_HeaderFile + +#include "GEOMImpl_Gen.hxx" + +#include + +#include CORBA_SERVER_HEADER(GEOM_Gen) +#include "GEOM_IOperations_i.hh" +#include "GEOM_Object_i.hh" + +#include "GEOMImpl_IAdvancedOperations.hxx" + +class GEOM_I_EXPORT GEOM_IAdvancedOperations_i : + public virtual POA_GEOM::GEOM_IAdvancedOperations, + public virtual GEOM_IOperations_i +{ + public: + GEOM_IAdvancedOperations_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_IAdvancedOperations* theImpl); + ~GEOM_IAdvancedOperations_i(); + + /*@@ insert new functions before this line @@*/ + + ::GEOMImpl_IAdvancedOperations* GetOperations() + { return (::GEOMImpl_IAdvancedOperations*)GetImpl(); } +}; + +#endif diff --git a/src/GEOM_I/Makefile.am b/src/GEOM_I/Makefile.am index 6ab126dd7..f6eb5e069 100644 --- a/src/GEOM_I/Makefile.am +++ b/src/GEOM_I/Makefile.am @@ -47,6 +47,7 @@ salomeinclude_HEADERS = \ GEOM_ITransformOperations_i.hh \ GEOM_IMeasureOperations_i.hh \ GEOM_IGroupOperations_i.hh \ + GEOM_IAdvancedOperations_i.hh \ GEOM_Gen_i.hh \ GEOM_GEOM_I.hxx @@ -65,6 +66,7 @@ dist_libGEOMEngine_la_SOURCES = \ GEOM_ITransformOperations_i.cc \ GEOM_IMeasureOperations_i.cc \ GEOM_IGroupOperations_i.cc \ + GEOM_IAdvancedOperations_i.cc \ GEOM_Gen_i.cc \ GEOM_DumpPython.cc diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 443c90e91..4f7eb2033 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -56,6 +56,7 @@ ## @defgroup l4_decompose Decompose objects ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape ## @defgroup l4_obtain Access to subshapes by a criteria +## @defgroup l4_advanced Advanced objects creation functions ## @} @@ -98,7 +99,7 @@ def RaiseIfFailed (Method_name, Operation): ## @ingroup l1_geompy_auxiliary def ParseParameters(*parameters): Result = [] - StringResult = "" + StringResult = [] for parameter in parameters: if isinstance(parameter,str): if notebook.isVariable(parameter): @@ -109,11 +110,12 @@ def ParseParameters(*parameters): Result.append(parameter) pass - StringResult = StringResult + str(parameter) - StringResult = StringResult + ":" + StringResult.append(str(parameter)) pass - StringResult = StringResult[:len(StringResult)-1] - Result.append(StringResult) + if Result: + Result.append(":".join(StringResult)) + else: + Result = ":".join(StringResult) return Result ## Return list of variables value from salome notebook @@ -281,6 +283,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): self.MeasuOp = None self.BlocksOp = None self.GroupOp = None + self.AdvOp = None pass ## @addtogroup l1_geompy_auxiliary @@ -312,6 +315,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): self.MeasuOp = self.GetIMeasureOperations (self.myStudyId) self.BlocksOp = self.GetIBlocksOperations (self.myStudyId) self.GroupOp = self.GetIGroupOperations (self.myStudyId) + self.AdvOp = self.GetIAdvancedOperations (self.myStudyId) pass ## Get name for sub-shape aSubObj of shape aMainObj @@ -4108,6 +4112,14 @@ class geompyDC(GEOM._objref_GEOM_Gen): # end of l3_groups ## @} + ## @addtogroup l4_advanced + ## @{ + + #@@ insert new functions before this line @@# + + # end of l4_advanced + ## @} + ## Create a copy of the given object # @ingroup l1_geompy_auxiliary # diff --git a/src/Makefile.am b/src/Makefile.am index 35b1a7deb..7f953973f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,7 +32,7 @@ if GEOM_ENABLE_GUI SUBDIRS += OBJECT DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI \ DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI \ BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI \ - GroupGUI BlocksGUI GEOM_SWIG_WITHIHM + GroupGUI BlocksGUI AdvancedGUI GEOM_SWIG_WITHIHM endif DIST_SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER GEOM BREPExport \ @@ -41,4 +41,4 @@ DIST_SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER GEOM BREPExport \ OBJECT DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI \ DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI \ BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI \ - MeasureGUI GroupGUI BlocksGUI GEOM_SWIG_WITHIHM + MeasureGUI GroupGUI BlocksGUI AdvancedGUI GEOM_SWIG_WITHIHM