From a79bb581539a0e5da23cce26b57da8e322412f13 Mon Sep 17 00:00:00 2001 From: rnv Date: Tue, 13 Jun 2017 12:57:14 +0300 Subject: [PATCH] Merge multi-study removal branch. --- doc/salome/examples/3dsketcher.py | 2 +- doc/salome/examples/GEOM_Field.py | 2 +- doc/salome/examples/GEOM_box.py | 4 +- .../examples/advanced_geom_objs_ex01.py | 2 +- .../examples/advanced_geom_objs_ex02.py | 2 +- .../examples/advanced_geom_objs_ex03.py | 2 +- .../advanced_geom_objs_smoothingsurface.py | 2 +- doc/salome/examples/angle.py | 2 +- .../examples/arranging_study_objects.py | 4 +- doc/salome/examples/basic_geom_objs_ex01.py | 2 +- doc/salome/examples/basic_geom_objs_ex02.py | 2 +- doc/salome/examples/basic_geom_objs_ex03.py | 2 +- doc/salome/examples/basic_geom_objs_ex04.py | 2 +- doc/salome/examples/basic_geom_objs_ex05.py | 2 +- doc/salome/examples/basic_geom_objs_ex06.py | 2 +- doc/salome/examples/basic_geom_objs_ex07.py | 2 +- doc/salome/examples/basic_geom_objs_ex08.py | 2 +- doc/salome/examples/basic_geom_objs_ex09.py | 2 +- doc/salome/examples/basic_geom_objs_ex10.py | 2 +- doc/salome/examples/basic_operations_ex01.py | 2 +- doc/salome/examples/basic_operations_ex02.py | 2 +- doc/salome/examples/basic_operations_ex03.py | 2 +- doc/salome/examples/basic_operations_ex04.py | 2 +- doc/salome/examples/basic_properties.py | 2 +- doc/salome/examples/blocks_operations_ex01.py | 2 +- doc/salome/examples/blocks_operations_ex02.py | 2 +- doc/salome/examples/blocks_operations_ex03.py | 4 +- .../examples/boolean_operations_ex01.py | 2 +- .../examples/boolean_operations_ex02.py | 2 +- .../examples/boolean_operations_ex03.py | 2 +- .../examples/boolean_operations_ex04.py | 2 +- doc/salome/examples/bounding_box.py | 2 +- .../examples/building_by_blocks_ex01.py | 2 +- .../examples/building_by_blocks_ex02.py | 2 +- doc/salome/examples/center_of_mass.py | 2 +- .../examples/check_compound_of_blocks.py | 2 +- .../examples/check_self_intersections.py | 2 +- .../examples/check_self_intersections_fast.py | 2 +- doc/salome/examples/check_shape.py | 2 +- doc/salome/examples/complex_objs_ex01.py | 2 +- doc/salome/examples/complex_objs_ex02.py | 2 +- doc/salome/examples/complex_objs_ex03.py | 2 +- doc/salome/examples/complex_objs_ex04.py | 2 +- doc/salome/examples/complex_objs_ex05.py | 2 +- doc/salome/examples/complex_objs_ex06.py | 2 +- doc/salome/examples/complex_objs_ex07.py | 2 +- doc/salome/examples/complex_objs_ex08.py | 2 +- doc/salome/examples/complex_objs_ex09.py | 2 +- doc/salome/examples/complex_objs_ex10.py | 2 +- doc/salome/examples/complex_objs_ex11.py | 2 +- doc/salome/examples/fast_intersection.py | 2 +- doc/salome/examples/free_boundaries.py | 2 +- doc/salome/examples/free_faces.py | 2 +- doc/salome/examples/get_non_blocks.py | 2 +- doc/salome/examples/import_export.py | 2 +- doc/salome/examples/inertia.py | 2 +- doc/salome/examples/min_distance.py | 2 +- doc/salome/examples/normal_face.py | 2 +- doc/salome/examples/notebook_geom.py | 2 +- doc/salome/examples/point_coordinates.py | 2 +- doc/salome/examples/polyline.py | 2 +- doc/salome/examples/primitives_ex01.py | 2 +- doc/salome/examples/primitives_ex02.py | 2 +- doc/salome/examples/primitives_ex03.py | 2 +- doc/salome/examples/primitives_ex04.py | 2 +- doc/salome/examples/primitives_ex05.py | 2 +- doc/salome/examples/primitives_ex06.py | 2 +- doc/salome/examples/primitives_ex07.py | 2 +- .../examples/repairing_operations_ex01.py | 2 +- .../examples/repairing_operations_ex02.py | 2 +- .../examples/repairing_operations_ex03.py | 2 +- .../examples/repairing_operations_ex04.py | 2 +- .../examples/repairing_operations_ex05.py | 2 +- .../examples/repairing_operations_ex06.py | 2 +- .../examples/repairing_operations_ex07.py | 2 +- .../examples/repairing_operations_ex08.py | 4 +- .../examples/repairing_operations_ex09.py | 2 +- .../examples/repairing_operations_ex10.py | 4 +- .../examples/repairing_operations_ex11.py | 4 +- .../examples/repairing_operations_ex12.py | 4 +- doc/salome/examples/sketcher.py | 2 +- doc/salome/examples/tolerance.py | 2 +- .../examples/topological_geom_objs_ex01.py | 2 +- .../examples/topological_geom_objs_ex02.py | 2 +- .../examples/topological_geom_objs_ex03.py | 2 +- .../examples/topological_geom_objs_ex04.py | 2 +- .../examples/topological_geom_objs_ex05.py | 2 +- .../examples/topological_geom_objs_ex06.py | 2 +- .../examples/topological_geom_objs_ex07.py | 2 +- .../transformation_operations_ex01.py | 2 +- .../transformation_operations_ex02.py | 2 +- .../transformation_operations_ex03.py | 2 +- .../transformation_operations_ex04.py | 2 +- .../transformation_operations_ex05.py | 2 +- .../transformation_operations_ex06.py | 2 +- .../transformation_operations_ex07.py | 2 +- .../transformation_operations_ex08.py | 2 +- .../transformation_operations_ex09.py | 2 +- .../transformation_operations_ex10.py | 2 +- .../transformation_operations_ex11.py | 2 +- .../transformation_operations_ex12.py | 2 +- .../transformation_operations_ex13.py | 2 +- .../transformation_operations_ex14.py | 2 +- doc/salome/examples/viewing_geom_objs_ex01.py | 2 +- doc/salome/examples/viewing_geom_objs_ex02.py | 2 +- doc/salome/examples/viewing_geom_objs_ex03.py | 2 +- doc/salome/examples/viewing_geom_objs_ex04.py | 2 +- doc/salome/examples/whatis.py | 2 +- .../examples/working_with_groups_ex01.py | 4 +- .../examples/working_with_groups_ex02.py | 4 +- .../examples/working_with_groups_ex03.py | 4 +- .../examples/working_with_groups_ex04.py | 4 +- .../examples/working_with_groups_ex05.py | 4 +- .../examples/working_with_groups_ex06.py | 4 +- .../input/geometrical_object_properties.doc | 4 +- .../gui/GEOM/input/geompy_migration.doc | 4 +- .../GEOM/input/tui_execution_distribution.doc | 8 +- .../GEOM/input/tui_importexport_geom_objs.doc | 2 +- idl/GEOM_Gen.idl | 84 ++-- idl/GEOM_Superv.idl | 5 - resources/GEOMCatalog.xml.in | 179 +------- .../AdvancedEngine_IOperations.cxx | 44 +- .../AdvancedEngine_IOperations.hxx | 2 +- .../AdvancedEngine_OperationsCreator.cxx | 14 +- .../AdvancedEngine_OperationsCreator.hxx | 10 +- .../AdvancedGUI_DividedCylinderDlg.cxx | 2 +- .../AdvancedGUI_DividedDiskDlg.cxx | 2 +- src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx | 9 +- src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.h | 2 +- .../AdvancedGUI_SmoothingSurfaceDlg.cxx | 2 +- src/BREPPlugin/BREPPlugin_GUI.cxx | 53 +-- src/BREPPlugin/BREPPlugin_IECallBack.cxx | 16 +- src/BREPPlugin/BREPPlugin_IECallBack.hxx | 12 +- src/BREPPlugin/BREPPlugin_IOperations.cxx | 8 +- src/BREPPlugin/BREPPlugin_IOperations.hxx | 2 +- .../BREPPlugin_OperationsCreator.cxx | 14 +- .../BREPPlugin_OperationsCreator.hxx | 10 +- src/BasicGUI/BasicGUI_ArcDlg.cxx | 2 +- src/BasicGUI/BasicGUI_CircleDlg.cxx | 2 +- src/BasicGUI/BasicGUI_CurveDlg.cxx | 2 +- src/BasicGUI/BasicGUI_EllipseDlg.cxx | 2 +- src/BasicGUI/BasicGUI_LineDlg.cxx | 2 +- src/BasicGUI/BasicGUI_MarkerDlg.cxx | 2 +- src/BasicGUI/BasicGUI_PlaneDlg.cxx | 2 +- src/BasicGUI/BasicGUI_PointDlg.cxx | 2 +- src/BasicGUI/BasicGUI_VectorDlg.cxx | 2 +- src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx | 6 +- src/BlocksGUI/BlocksGUI_BlockDlg.cxx | 2 +- src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx | 2 +- src/BlocksGUI/BlocksGUI_PropagateDlg.cxx | 2 +- src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx | 2 +- src/BlocksGUI/BlocksGUI_TrsfDlg.cxx | 2 +- src/BooleanGUI/BooleanGUI_Dialog.cxx | 7 +- src/BooleanGUI/BooleanGUI_Dialog.h | 2 +- src/BuildGUI/BuildGUI_CompoundDlg.cxx | 7 +- src/BuildGUI/BuildGUI_CompoundDlg.h | 2 +- src/BuildGUI/BuildGUI_EdgeDlg.cxx | 2 +- src/BuildGUI/BuildGUI_FaceDlg.cxx | 2 +- src/BuildGUI/BuildGUI_ShellDlg.cxx | 2 +- src/BuildGUI/BuildGUI_SolidDlg.cxx | 6 +- src/BuildGUI/BuildGUI_WireDlg.cxx | 2 +- src/DependencyTree/DependencyTree_Object.cxx | 8 +- .../DependencyTree_Selector.cxx | 3 +- src/DependencyTree/DependencyTree_View.cxx | 14 +- src/DependencyTree/DependencyTree_View.h | 2 - .../DependencyTree_ViewModel.cxx | 6 +- src/DisplayGUI/DisplayGUI.cxx | 57 +-- src/EntityGUI/EntityGUI_3DSketcherDlg.cxx | 4 +- .../EntityGUI_FeatureDetectorDlg.cxx | 6 +- src/EntityGUI/EntityGUI_FieldDlg.cxx | 10 +- src/EntityGUI/EntityGUI_IsolineDlg.cxx | 2 +- src/EntityGUI/EntityGUI_PictureImportDlg.cxx | 4 +- src/EntityGUI/EntityGUI_PolylineDlg.cxx | 4 +- src/EntityGUI/EntityGUI_SketcherDlg.cxx | 6 +- src/EntityGUI/EntityGUI_SubShapeDlg.cxx | 2 +- src/EntityGUI/EntityGUI_SurfFromFaceDlg.cxx | 2 +- src/GEOM/GEOM_BaseDriver.cxx | 15 - src/GEOM/GEOM_BaseDriver.hxx | 2 - src/GEOM/GEOM_BaseObject.cxx | 35 +- src/GEOM/GEOM_BaseObject.hxx | 4 - src/GEOM/GEOM_Engine.cxx | 231 ++++------ src/GEOM/GEOM_Engine.hxx | 50 +-- src/GEOM/GEOM_Field.cxx | 2 +- src/GEOM/GEOM_IOperations.cxx | 11 +- src/GEOM/GEOM_IOperations.hxx | 6 +- src/GEOM/GEOM_Solver.cxx | 2 +- src/GEOM/GEOM_Solver.hxx | 4 +- src/GEOMBase/GEOMBase.cxx | 3 +- src/GEOMBase/GEOMBase_Helper.cxx | 29 +- src/GEOMBase/GEOMBase_Helper.h | 3 +- src/GEOMBase/GEOMBase_Skeleton.cxx | 2 +- src/GEOMGUI/GEOMGUI_DimensionProperty.cxx | 20 +- src/GEOMGUI/GEOMGUI_DimensionProperty.h | 8 +- src/GEOMGUI/GEOMGUI_Selection.cxx | 28 +- src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx | 27 +- src/GEOMGUI/GEOM_Displayer.cxx | 117 ++--- src/GEOMGUI/GEOM_Displayer.h | 4 +- src/GEOMGUI/GeometryGUI.cxx | 110 ++--- src/GEOMGUI/GeometryGUI.h | 27 +- src/GEOMImpl/GEOMImpl_ExportDriver.cxx | 2 +- src/GEOMImpl/GEOMImpl_Gen.cxx | 183 +++----- src/GEOMImpl/GEOMImpl_Gen.hxx | 52 +-- src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx | 80 ++-- src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_IBaseIEOperations.cxx | 10 +- src/GEOMImpl/GEOMImpl_IBaseIEOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_IBasicOperations.cxx | 42 +- src/GEOMImpl/GEOMImpl_IBasicOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx | 26 +- src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx | 18 +- src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx | 46 +- src/GEOMImpl/GEOMImpl_ICurvesOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_IECallBack.cxx | 9 +- src/GEOMImpl/GEOMImpl_IECallBack.hxx | 15 +- src/GEOMImpl/GEOMImpl_IFieldOperations.cxx | 12 +- src/GEOMImpl/GEOMImpl_IFieldOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_IGroupOperations.cxx | 4 +- src/GEOMImpl/GEOMImpl_IGroupOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_IHealingOperations.cxx | 32 +- src/GEOMImpl/GEOMImpl_IHealingOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_IInsertOperations.cxx | 30 +- src/GEOMImpl/GEOMImpl_IInsertOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_ILocalOperations.cxx | 36 +- src/GEOMImpl/GEOMImpl_ILocalOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx | 12 +- src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_IShapesOperations.cxx | 52 +-- src/GEOMImpl/GEOMImpl_IShapesOperations.hxx | 2 +- .../GEOMImpl_ITransformOperations.cxx | 52 +-- .../GEOMImpl_ITransformOperations.hxx | 2 +- src/GEOMImpl/GEOMImpl_ImportDriver.cxx | 2 +- src/GEOMToolsGUI/GEOMToolsGUI.cxx | 27 +- src/GEOMToolsGUI/GEOMToolsGUI.h | 1 - src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 25 +- src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx | 6 +- src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx | 58 ++- src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.h | 4 +- .../GEOMToolsGUI_ReduceStudyDlg.cxx | 47 +- .../GEOMToolsGUI_ReduceStudyDlg.h | 1 - src/GEOM_I/GEOM_BaseObject_i.cc | 16 +- src/GEOM_I/GEOM_BaseObject_i.hh | 2 - src/GEOM_I/GEOM_DumpPython.cc | 9 +- src/GEOM_I/GEOM_Field_i.cc | 12 +- src/GEOM_I/GEOM_Gen_i.cc | 418 +++++++++--------- src/GEOM_I/GEOM_Gen_i.hh | 90 ++-- src/GEOM_I/GEOM_IOperations_i.cc | 14 +- src/GEOM_I/GEOM_IOperations_i.hh | 2 - src/GEOM_I/GEOM_Object_i.cc | 6 +- src/GEOM_I_Superv/GEOM_Superv_i.cc | 176 ++------ src/GEOM_I_Superv/GEOM_Superv_i.hh | 13 +- src/GEOM_PY/geomtools.py | 37 +- src/GEOM_PY/sketcher.py | 4 +- src/GEOM_PY/structelem/__init__.py | 69 ++- src/GEOM_PY/structelem/parts.py | 76 ++-- src/GEOM_SWIG/AdvancedGEOMBuilder.py | 2 +- src/GEOM_SWIG/BREPPluginBuilder.py | 2 +- src/GEOM_SWIG/GEOM_Nut.py | 4 +- src/GEOM_SWIG/GEOM_ObjectInfo.py | 14 +- src/GEOM_SWIG/GEOM_Partition1.py | 4 +- src/GEOM_SWIG/GEOM_Partition2.py | 2 +- src/GEOM_SWIG/GEOM_Partition3.py | 2 +- src/GEOM_SWIG/GEOM_Partition4.py | 6 +- src/GEOM_SWIG/GEOM_Partition5.py | 12 +- src/GEOM_SWIG/GEOM_Sketcher.py | 2 +- src/GEOM_SWIG/GEOM_blocks.py | 4 +- src/GEOM_SWIG/GEOM_cyl2complementary.py | 4 +- src/GEOM_SWIG/GEOM_example.py | 2 +- src/GEOM_SWIG/GEOM_example2.py | 10 +- src/GEOM_SWIG/GEOM_example3.py | 10 +- src/GEOM_SWIG/GEOM_example4.py | 2 +- src/GEOM_SWIG/GEOM_example5.py | 4 +- src/GEOM_SWIG/GEOM_example6.py | 2 +- src/GEOM_SWIG/GEOM_example7.py | 2 +- src/GEOM_SWIG/GEOM_moteur.py | 4 +- src/GEOM_SWIG/GEOM_shellSolid.py | 4 +- src/GEOM_SWIG/GEOM_tube_geom.py | 4 +- src/GEOM_SWIG/GEOM_tube_geom_gg2.py | 2 +- src/GEOM_SWIG/GEOM_usinggeom.py | 2 +- src/GEOM_SWIG/IGESPluginBuilder.py | 2 +- src/GEOM_SWIG/PAL_MESH_019_020_geometry.py | 4 +- src/GEOM_SWIG/PAL_MESH_028_geometry.py | 8 +- src/GEOM_SWIG/PAL_MESH_030_geometry.py | 4 +- src/GEOM_SWIG/PAL_MESH_033_geometry.py | 4 +- src/GEOM_SWIG/PAL_MESH_035_geometry.py | 4 +- src/GEOM_SWIG/STEPPluginBuilder.py | 2 +- src/GEOM_SWIG/STLPluginBuilder.py | 2 +- src/GEOM_SWIG/VTKPluginBuilder.py | 2 +- src/GEOM_SWIG/XAOPluginBuilder.py | 2 +- src/GEOM_SWIG/geomBuilder.py | 74 ++-- src/GEOM_SWIG/geompy.py | 6 +- src/GEOM_SWIG/gsketcher.py | 4 +- src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx | 28 +- .../GenerationGUI_FillingDlg.cxx | 2 +- src/GenerationGUI/GenerationGUI_PipeDlg.cxx | 8 +- src/GenerationGUI/GenerationGUI_PipeDlg.h | 3 +- .../GenerationGUI_PipePathDlg.cxx | 2 +- src/GenerationGUI/GenerationGUI_PrismDlg.cxx | 2 +- src/GenerationGUI/GenerationGUI_RevolDlg.cxx | 2 +- .../GenerationGUI_ThicknessDlg.cxx | 2 +- src/GroupGUI/GroupGUI_BooleanDlg.cxx | 2 +- src/GroupGUI/GroupGUI_GroupDlg.cxx | 14 +- src/IGESPlugin/IGESPlugin_GUI.cxx | 15 +- src/IGESPlugin/IGESPlugin_IECallBack.cxx | 25 +- src/IGESPlugin/IGESPlugin_IECallBack.hxx | 13 +- src/IGESPlugin/IGESPlugin_IOperations.cxx | 8 +- src/IGESPlugin/IGESPlugin_IOperations.hxx | 2 +- .../IGESPlugin_OperationsCreator.cxx | 14 +- .../IGESPlugin_OperationsCreator.hxx | 10 +- src/MeasureGUI/MeasureGUI.cxx | 9 +- src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx | 2 +- src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx | 2 +- src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx | 2 +- .../MeasureGUI_CheckCompoundOfBlocksDlg.cxx | 2 +- .../MeasureGUI_CheckSelfIntersectionsDlg.cxx | 4 +- src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx | 4 +- src/MeasureGUI/MeasureGUI_DistanceDlg.cxx | 4 +- .../MeasureGUI_FastCheckIntersectionsDlg.cxx | 4 +- src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx | 2 +- .../MeasureGUI_ManageDimensionsDlg.cxx | 4 +- src/MeasureGUI/MeasureGUI_NormaleDlg.cxx | 6 +- .../MeasureGUI_ShapeStatisticsDlg.cxx | 6 +- src/MeasureGUI/MeasureGUI_Skeleton.cxx | 4 +- .../OperationGUI_ArchimedeDlg.cxx | 2 +- src/OperationGUI/OperationGUI_ChamferDlg.cxx | 2 +- .../OperationGUI_ExtractionDlg.cxx | 2 +- .../OperationGUI_ExtrudedFeatureDlg.cxx | 2 +- .../OperationGUI_Fillet1d2dDlg.cxx | 4 +- src/OperationGUI/OperationGUI_FilletDlg.cxx | 2 +- .../OperationGUI_GetShapesOnShapeDlg.cxx | 2 +- .../OperationGUI_GetSharedShapesDlg.cxx | 2 +- .../OperationGUI_PartitionDlg.cxx | 9 +- src/OperationGUI/OperationGUI_PartitionDlg.h | 2 +- .../OperationGUI_TransferDataDlg.cxx | 2 +- src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx | 2 +- src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx | 2 +- src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx | 2 +- src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx | 2 +- src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx | 2 +- src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx | 2 +- src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx | 2 +- .../RepairGUI_ChangeOrientationDlg.cxx | 2 +- src/RepairGUI/RepairGUI_CloseContourDlg.cxx | 2 +- src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx | 2 +- src/RepairGUI/RepairGUI_FreeBoundDlg.cxx | 2 +- src/RepairGUI/RepairGUI_FreeFacesDlg.cxx | 4 +- src/RepairGUI/RepairGUI_FuseEdgesDlg.cxx | 4 +- src/RepairGUI/RepairGUI_GlueDlg.cxx | 7 +- src/RepairGUI/RepairGUI_GlueDlg.h | 2 +- src/RepairGUI/RepairGUI_InspectObjectDlg.cxx | 6 +- src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx | 7 +- src/RepairGUI/RepairGUI_LimitToleranceDlg.h | 2 +- .../RepairGUI_RemoveExtraEdgesDlg.cxx | 7 +- src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.h | 2 +- src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx | 2 +- src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx | 2 +- src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx | 7 +- src/RepairGUI/RepairGUI_RemoveWebsDlg.h | 2 +- src/RepairGUI/RepairGUI_SewingDlg.cxx | 2 +- src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx | 4 +- src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx | 7 +- src/RepairGUI/RepairGUI_SuppressFacesDlg.h | 2 +- src/RepairGUI/RepairGUI_UnionFacesDlg.cxx | 7 +- src/RepairGUI/RepairGUI_UnionFacesDlg.h | 2 +- src/STEPPlugin/STEPPlugin_GUI.cxx | 21 +- src/STEPPlugin/STEPPlugin_IECallBack.cxx | 25 +- src/STEPPlugin/STEPPlugin_IECallBack.hxx | 11 +- src/STEPPlugin/STEPPlugin_IOperations.cxx | 8 +- src/STEPPlugin/STEPPlugin_IOperations.hxx | 2 +- .../STEPPlugin_OperationsCreator.cxx | 14 +- .../STEPPlugin_OperationsCreator.hxx | 11 +- src/STLPlugin/STLPlugin_GUI.cxx | 17 +- src/STLPlugin/STLPlugin_IECallBack.cxx | 16 +- src/STLPlugin/STLPlugin_IECallBack.hxx | 12 +- src/STLPlugin/STLPlugin_IOperations.cxx | 8 +- src/STLPlugin/STLPlugin_IOperations.hxx | 2 +- src/STLPlugin/STLPlugin_OperationsCreator.cxx | 14 +- src/STLPlugin/STLPlugin_OperationsCreator.hxx | 11 +- src/Tools/geom_plugins.py | 4 +- src/Tools/t_shape/t_shape_builder.py | 40 +- src/Tools/t_shape/t_shape_dialog.py | 9 +- src/Tools/t_shape/t_shape_progress.py | 4 +- src/TransformationGUI/TransformationGUI.cxx | 6 +- .../TransformationGUI_ExtensionDlg.cxx | 2 +- .../TransformationGUI_MirrorDlg.cxx | 7 +- .../TransformationGUI_MirrorDlg.h | 2 +- .../TransformationGUI_MultiRotationDlg.cxx | 9 +- .../TransformationGUI_MultiRotationDlg.h | 2 +- .../TransformationGUI_MultiTranslationDlg.cxx | 9 +- .../TransformationGUI_MultiTranslationDlg.h | 2 +- .../TransformationGUI_OffsetDlg.cxx | 7 +- .../TransformationGUI_OffsetDlg.h | 2 +- .../TransformationGUI_PositionDlg.cxx | 7 +- .../TransformationGUI_PositionDlg.h | 2 +- .../TransformationGUI_ProjectionDlg.cxx | 2 +- .../TransformationGUI_ProjectionOnCylDlg.cxx | 2 +- .../TransformationGUI_RotationDlg.cxx | 7 +- .../TransformationGUI_RotationDlg.h | 2 +- .../TransformationGUI_ScaleDlg.cxx | 7 +- .../TransformationGUI_ScaleDlg.h | 2 +- .../TransformationGUI_TranslationDlg.cxx | 7 +- .../TransformationGUI_TranslationDlg.h | 2 +- src/VTKPlugin/VTKPlugin_GUI.cxx | 6 +- src/VTKPlugin/VTKPlugin_IECallBack.cxx | 9 +- src/VTKPlugin/VTKPlugin_IECallBack.hxx | 7 +- src/VTKPlugin/VTKPlugin_IOperations.cxx | 6 +- src/VTKPlugin/VTKPlugin_IOperations.hxx | 2 +- src/VTKPlugin/VTKPlugin_OperationsCreator.cxx | 14 +- src/VTKPlugin/VTKPlugin_OperationsCreator.hxx | 10 +- src/XAOPlugin/XAOPlugin_ExportDlg.cxx | 6 +- src/XAOPlugin/XAOPlugin_IECallBack.cxx | 14 +- src/XAOPlugin/XAOPlugin_IECallBack.hxx | 8 +- src/XAOPlugin/XAOPlugin_IOperations.cxx | 10 +- src/XAOPlugin/XAOPlugin_IOperations.hxx | 2 +- src/XAOPlugin/XAOPlugin_ImportDlg.cxx | 10 +- src/XAOPlugin/XAOPlugin_OperationsCreator.cxx | 14 +- src/XAOPlugin/XAOPlugin_OperationsCreator.hxx | 12 +- 418 files changed, 1845 insertions(+), 2698 deletions(-) diff --git a/doc/salome/examples/3dsketcher.py b/doc/salome/examples/3dsketcher.py index 29f88e710..913c7d51d 100644 --- a/doc/salome/examples/3dsketcher.py +++ b/doc/salome/examples/3dsketcher.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # Create a 3D sketcher (wire) on the given points coordinates diff --git a/doc/salome/examples/GEOM_Field.py b/doc/salome/examples/GEOM_Field.py index 930ce1c31..537e21ef2 100644 --- a/doc/salome/examples/GEOM_Field.py +++ b/doc/salome/examples/GEOM_Field.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # a box diff --git a/doc/salome/examples/GEOM_box.py b/doc/salome/examples/GEOM_box.py index 7469790b3..b697e6f79 100644 --- a/doc/salome/examples/GEOM_box.py +++ b/doc/salome/examples/GEOM_box.py @@ -5,7 +5,7 @@ salome.salome_init() # --- geom Python interface import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # --- Create a box and publish it into the salome study Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) @@ -13,4 +13,4 @@ geompy.addToStudy( Box_1, 'Box_1' ) # --- update the study object browser if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/advanced_geom_objs_ex01.py b/doc/salome/examples/advanced_geom_objs_ex01.py index b2499e906..fea605c3d 100644 --- a/doc/salome/examples/advanced_geom_objs_ex01.py +++ b/doc/salome/examples/advanced_geom_objs_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create PipeTShape object diff --git a/doc/salome/examples/advanced_geom_objs_ex02.py b/doc/salome/examples/advanced_geom_objs_ex02.py index 442af631e..452728a5a 100644 --- a/doc/salome/examples/advanced_geom_objs_ex02.py +++ b/doc/salome/examples/advanced_geom_objs_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create DividedDisk object diff --git a/doc/salome/examples/advanced_geom_objs_ex03.py b/doc/salome/examples/advanced_geom_objs_ex03.py index 915ee1586..d49d5db37 100644 --- a/doc/salome/examples/advanced_geom_objs_ex03.py +++ b/doc/salome/examples/advanced_geom_objs_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create DividedCylinder object diff --git a/doc/salome/examples/advanced_geom_objs_smoothingsurface.py b/doc/salome/examples/advanced_geom_objs_smoothingsurface.py index 0ad32ced8..a29818294 100644 --- a/doc/salome/examples/advanced_geom_objs_smoothingsurface.py +++ b/doc/salome/examples/advanced_geom_objs_smoothingsurface.py @@ -1,6 +1,6 @@ import salome, GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a could of points points = [ diff --git a/doc/salome/examples/angle.py b/doc/salome/examples/angle.py index 1fd60440f..ac20c506c 100644 --- a/doc/salome/examples/angle.py +++ b/doc/salome/examples/angle.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math OX = geompy.MakeVectorDXDYDZ(10, 0,0) diff --git a/doc/salome/examples/arranging_study_objects.py b/doc/salome/examples/arranging_study_objects.py index 149cff480..f131d6b1c 100644 --- a/doc/salome/examples/arranging_study_objects.py +++ b/doc/salome/examples/arranging_study_objects.py @@ -5,7 +5,7 @@ salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() Circle_1 = geompy.MakeCircle(None, None, 100) Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) @@ -22,4 +22,4 @@ geompy.PutListToFolder([Box_1, Cylinder_1], Primitives) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/basic_geom_objs_ex01.py b/doc/salome/examples/basic_geom_objs_ex01.py index 1501633ca..22c5236cf 100644 --- a/doc/salome/examples/basic_geom_objs_ex01.py +++ b/doc/salome/examples/basic_geom_objs_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/basic_geom_objs_ex02.py b/doc/salome/examples/basic_geom_objs_ex02.py index 858548f23..3175f2ee0 100644 --- a/doc/salome/examples/basic_geom_objs_ex02.py +++ b/doc/salome/examples/basic_geom_objs_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/basic_geom_objs_ex03.py b/doc/salome/examples/basic_geom_objs_ex03.py index d7bdf2feb..0e01764db 100644 --- a/doc/salome/examples/basic_geom_objs_ex03.py +++ b/doc/salome/examples/basic_geom_objs_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/basic_geom_objs_ex04.py b/doc/salome/examples/basic_geom_objs_ex04.py index 51a1304d4..0cef7779f 100644 --- a/doc/salome/examples/basic_geom_objs_ex04.py +++ b/doc/salome/examples/basic_geom_objs_ex04.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/basic_geom_objs_ex05.py b/doc/salome/examples/basic_geom_objs_ex05.py index fe24424cc..ff0f80139 100644 --- a/doc/salome/examples/basic_geom_objs_ex05.py +++ b/doc/salome/examples/basic_geom_objs_ex05.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/basic_geom_objs_ex06.py b/doc/salome/examples/basic_geom_objs_ex06.py index ecaec0ed5..ad115fc13 100644 --- a/doc/salome/examples/basic_geom_objs_ex06.py +++ b/doc/salome/examples/basic_geom_objs_ex06.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices and vectors diff --git a/doc/salome/examples/basic_geom_objs_ex07.py b/doc/salome/examples/basic_geom_objs_ex07.py index 04673b1f4..1bceed568 100644 --- a/doc/salome/examples/basic_geom_objs_ex07.py +++ b/doc/salome/examples/basic_geom_objs_ex07.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/basic_geom_objs_ex08.py b/doc/salome/examples/basic_geom_objs_ex08.py index 707540a06..5826e52d0 100644 --- a/doc/salome/examples/basic_geom_objs_ex08.py +++ b/doc/salome/examples/basic_geom_objs_ex08.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/basic_geom_objs_ex09.py b/doc/salome/examples/basic_geom_objs_ex09.py index 91fa3ce6d..c1afcfc7f 100644 --- a/doc/salome/examples/basic_geom_objs_ex09.py +++ b/doc/salome/examples/basic_geom_objs_ex09.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math import SALOMEDS diff --git a/doc/salome/examples/basic_geom_objs_ex10.py b/doc/salome/examples/basic_geom_objs_ex10.py index f9f7f0165..2b994f8a7 100644 --- a/doc/salome/examples/basic_geom_objs_ex10.py +++ b/doc/salome/examples/basic_geom_objs_ex10.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math import SALOMEDS diff --git a/doc/salome/examples/basic_operations_ex01.py b/doc/salome/examples/basic_operations_ex01.py index 912c8eb03..b0c63593b 100644 --- a/doc/salome/examples/basic_operations_ex01.py +++ b/doc/salome/examples/basic_operations_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/basic_operations_ex02.py b/doc/salome/examples/basic_operations_ex02.py index ff102f0d5..a9a76e883 100644 --- a/doc/salome/examples/basic_operations_ex02.py +++ b/doc/salome/examples/basic_operations_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/basic_operations_ex03.py b/doc/salome/examples/basic_operations_ex03.py index 5fa0e9e0a..2f7c4e350 100644 --- a/doc/salome/examples/basic_operations_ex03.py +++ b/doc/salome/examples/basic_operations_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SALOMEDS # create a box and a cylinder diff --git a/doc/salome/examples/basic_operations_ex04.py b/doc/salome/examples/basic_operations_ex04.py index 287ce39ca..61d8e2454 100644 --- a/doc/salome/examples/basic_operations_ex04.py +++ b/doc/salome/examples/basic_operations_ex04.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SALOMEDS # create a box and partigion it by two planes diff --git a/doc/salome/examples/basic_properties.py b/doc/salome/examples/basic_properties.py index ce6e45a9c..f1a285ecf 100644 --- a/doc/salome/examples/basic_properties.py +++ b/doc/salome/examples/basic_properties.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math # create a box diff --git a/doc/salome/examples/blocks_operations_ex01.py b/doc/salome/examples/blocks_operations_ex01.py index d8040637c..46264a62f 100644 --- a/doc/salome/examples/blocks_operations_ex01.py +++ b/doc/salome/examples/blocks_operations_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/blocks_operations_ex02.py b/doc/salome/examples/blocks_operations_ex02.py index 03deab0a6..41f0c1f44 100644 --- a/doc/salome/examples/blocks_operations_ex02.py +++ b/doc/salome/examples/blocks_operations_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a box and a sphere diff --git a/doc/salome/examples/blocks_operations_ex03.py b/doc/salome/examples/blocks_operations_ex03.py index 384c4e1ae..3633a6c80 100644 --- a/doc/salome/examples/blocks_operations_ex03.py +++ b/doc/salome/examples/blocks_operations_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box check_box = geompy.MakeBoxDXDYDZ(200, 200, 200) @@ -20,4 +20,4 @@ for chain in listChains: ii = ii + 1 pass -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/boolean_operations_ex01.py b/doc/salome/examples/boolean_operations_ex01.py index 7c365d7eb..2557639e0 100644 --- a/doc/salome/examples/boolean_operations_ex01.py +++ b/doc/salome/examples/boolean_operations_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/boolean_operations_ex02.py b/doc/salome/examples/boolean_operations_ex02.py index 212e313d4..58d5bb6f2 100644 --- a/doc/salome/examples/boolean_operations_ex02.py +++ b/doc/salome/examples/boolean_operations_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/boolean_operations_ex03.py b/doc/salome/examples/boolean_operations_ex03.py index fdb7545f1..d0a80b388 100644 --- a/doc/salome/examples/boolean_operations_ex03.py +++ b/doc/salome/examples/boolean_operations_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/boolean_operations_ex04.py b/doc/salome/examples/boolean_operations_ex04.py index a7da6a9af..e5bbb1c50 100644 --- a/doc/salome/examples/boolean_operations_ex04.py +++ b/doc/salome/examples/boolean_operations_ex04.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/bounding_box.py b/doc/salome/examples/bounding_box.py index ed8736b98..e88a8e5be 100644 --- a/doc/salome/examples/bounding_box.py +++ b/doc/salome/examples/bounding_box.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(100,30,100) diff --git a/doc/salome/examples/building_by_blocks_ex01.py b/doc/salome/examples/building_by_blocks_ex01.py index fe93e7c4c..b7f32c323 100644 --- a/doc/salome/examples/building_by_blocks_ex01.py +++ b/doc/salome/examples/building_by_blocks_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/building_by_blocks_ex02.py b/doc/salome/examples/building_by_blocks_ex02.py index 8d40beec5..724381b72 100644 --- a/doc/salome/examples/building_by_blocks_ex02.py +++ b/doc/salome/examples/building_by_blocks_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/center_of_mass.py b/doc/salome/examples/center_of_mass.py index 9e570f318..a3a11ea4b 100644 --- a/doc/salome/examples/center_of_mass.py +++ b/doc/salome/examples/center_of_mass.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math # create a box diff --git a/doc/salome/examples/check_compound_of_blocks.py b/doc/salome/examples/check_compound_of_blocks.py index 26f7c3012..36c99474c 100644 --- a/doc/salome/examples/check_compound_of_blocks.py +++ b/doc/salome/examples/check_compound_of_blocks.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create boxes diff --git a/doc/salome/examples/check_self_intersections.py b/doc/salome/examples/check_self_intersections.py index f70a54540..49e83bcaa 100644 --- a/doc/salome/examples/check_self_intersections.py +++ b/doc/salome/examples/check_self_intersections.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(100,100,100) diff --git a/doc/salome/examples/check_self_intersections_fast.py b/doc/salome/examples/check_self_intersections_fast.py index 83c8a741e..2a01efa6e 100644 --- a/doc/salome/examples/check_self_intersections_fast.py +++ b/doc/salome/examples/check_self_intersections_fast.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(100,100,100) diff --git a/doc/salome/examples/check_shape.py b/doc/salome/examples/check_shape.py index f10f31c8a..e3b51f3ff 100644 --- a/doc/salome/examples/check_shape.py +++ b/doc/salome/examples/check_shape.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(100,30,100) diff --git a/doc/salome/examples/complex_objs_ex01.py b/doc/salome/examples/complex_objs_ex01.py index 5a04f3a76..1eb8c4f80 100644 --- a/doc/salome/examples/complex_objs_ex01.py +++ b/doc/salome/examples/complex_objs_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/complex_objs_ex02.py b/doc/salome/examples/complex_objs_ex02.py index ec9f85729..046ddbb18 100644 --- a/doc/salome/examples/complex_objs_ex02.py +++ b/doc/salome/examples/complex_objs_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/complex_objs_ex03.py b/doc/salome/examples/complex_objs_ex03.py index 0c56c81e8..5edd9725e 100644 --- a/doc/salome/examples/complex_objs_ex03.py +++ b/doc/salome/examples/complex_objs_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") mindeg = 2 diff --git a/doc/salome/examples/complex_objs_ex04.py b/doc/salome/examples/complex_objs_ex04.py index 4bff05d17..de7e29421 100644 --- a/doc/salome/examples/complex_objs_ex04.py +++ b/doc/salome/examples/complex_objs_ex04.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/complex_objs_ex05.py b/doc/salome/examples/complex_objs_ex05.py index f6681b587..c1017173e 100644 --- a/doc/salome/examples/complex_objs_ex05.py +++ b/doc/salome/examples/complex_objs_ex05.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") Wire_1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 100 0:R 0:C 100 90:T 0 200", [0, 0, 0, 0, 0, 1, 1, 0, -0]) diff --git a/doc/salome/examples/complex_objs_ex06.py b/doc/salome/examples/complex_objs_ex06.py index caa68c4c0..019b13a44 100644 --- a/doc/salome/examples/complex_objs_ex06.py +++ b/doc/salome/examples/complex_objs_ex06.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math gg = salome.ImportComponentGUI("GEOM") diff --git a/doc/salome/examples/complex_objs_ex07.py b/doc/salome/examples/complex_objs_ex07.py index d9e72ae96..02c4ab246 100644 --- a/doc/salome/examples/complex_objs_ex07.py +++ b/doc/salome/examples/complex_objs_ex07.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import salome gg = salome.ImportComponentGUI("GEOM") diff --git a/doc/salome/examples/complex_objs_ex08.py b/doc/salome/examples/complex_objs_ex08.py index bb4cac595..17536dbfa 100644 --- a/doc/salome/examples/complex_objs_ex08.py +++ b/doc/salome/examples/complex_objs_ex08.py @@ -3,7 +3,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() def MakeHelix(radius, height, rotation, direction): # - create a helix - diff --git a/doc/salome/examples/complex_objs_ex09.py b/doc/salome/examples/complex_objs_ex09.py index 9615ad1ef..6c6c3d868 100644 --- a/doc/salome/examples/complex_objs_ex09.py +++ b/doc/salome/examples/complex_objs_ex09.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # Create a box Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) diff --git a/doc/salome/examples/complex_objs_ex10.py b/doc/salome/examples/complex_objs_ex10.py index b51281505..ad5c8c8e9 100644 --- a/doc/salome/examples/complex_objs_ex10.py +++ b/doc/salome/examples/complex_objs_ex10.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # Create Vertexes for curve Vertex_1 = geompy.MakeVertex(0, 0, 0) diff --git a/doc/salome/examples/complex_objs_ex11.py b/doc/salome/examples/complex_objs_ex11.py index 63242331a..6f5295a18 100755 --- a/doc/salome/examples/complex_objs_ex11.py +++ b/doc/salome/examples/complex_objs_ex11.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create box diff --git a/doc/salome/examples/fast_intersection.py b/doc/salome/examples/fast_intersection.py index 4854a579f..a0559c846 100644 --- a/doc/salome/examples/fast_intersection.py +++ b/doc/salome/examples/fast_intersection.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(100,100,100) diff --git a/doc/salome/examples/free_boundaries.py b/doc/salome/examples/free_boundaries.py index 8fe0d475b..02271d585 100644 --- a/doc/salome/examples/free_boundaries.py +++ b/doc/salome/examples/free_boundaries.py @@ -3,7 +3,7 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a shape box1 = geompy.MakeBox(0, 0, 0, 100, 100, 100) diff --git a/doc/salome/examples/free_faces.py b/doc/salome/examples/free_faces.py index 2d1de5a00..c121c4bea 100644 --- a/doc/salome/examples/free_faces.py +++ b/doc/salome/examples/free_faces.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/get_non_blocks.py b/doc/salome/examples/get_non_blocks.py index 87bf934a6..6886506fe 100644 --- a/doc/salome/examples/get_non_blocks.py +++ b/doc/salome/examples/get_non_blocks.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create solids box = geompy.MakeBoxDXDYDZ(100, 100, 100) diff --git a/doc/salome/examples/import_export.py b/doc/salome/examples/import_export.py index e7ed69c37..18db87609 100644 --- a/doc/salome/examples/import_export.py +++ b/doc/salome/examples/import_export.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import tempfile, os diff --git a/doc/salome/examples/inertia.py b/doc/salome/examples/inertia.py index a63608c12..b96ea3dbb 100644 --- a/doc/salome/examples/inertia.py +++ b/doc/salome/examples/inertia.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(100,30,100) diff --git a/doc/salome/examples/min_distance.py b/doc/salome/examples/min_distance.py index e48804b30..3a389d609 100644 --- a/doc/salome/examples/min_distance.py +++ b/doc/salome/examples/min_distance.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # Create two curves with three closest points Vertex_1 = geompy.MakeVertex(0, 0, 0) diff --git a/doc/salome/examples/normal_face.py b/doc/salome/examples/normal_face.py index 91eac0b5a..0bc0b2c56 100644 --- a/doc/salome/examples/normal_face.py +++ b/doc/salome/examples/normal_face.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math # create a box diff --git a/doc/salome/examples/notebook_geom.py b/doc/salome/examples/notebook_geom.py index 5b52d9f2c..514357983 100644 --- a/doc/salome/examples/notebook_geom.py +++ b/doc/salome/examples/notebook_geom.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import salome_notebook gg = salome.ImportComponentGUI("GEOM") diff --git a/doc/salome/examples/point_coordinates.py b/doc/salome/examples/point_coordinates.py index e31569b69..a87cc887f 100644 --- a/doc/salome/examples/point_coordinates.py +++ b/doc/salome/examples/point_coordinates.py @@ -5,7 +5,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a point point = geompy.MakeVertex(15., 23., 80.) diff --git a/doc/salome/examples/polyline.py b/doc/salome/examples/polyline.py index 8b7925607..eae5272b5 100644 --- a/doc/salome/examples/polyline.py +++ b/doc/salome/examples/polyline.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/primitives_ex01.py b/doc/salome/examples/primitives_ex01.py index 41590a544..d13fa571f 100644 --- a/doc/salome/examples/primitives_ex01.py +++ b/doc/salome/examples/primitives_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/primitives_ex02.py b/doc/salome/examples/primitives_ex02.py index 82cf5e449..6136ddbdf 100644 --- a/doc/salome/examples/primitives_ex02.py +++ b/doc/salome/examples/primitives_ex02.py @@ -6,7 +6,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") diff --git a/doc/salome/examples/primitives_ex03.py b/doc/salome/examples/primitives_ex03.py index 4f07701ef..8f93750c5 100644 --- a/doc/salome/examples/primitives_ex03.py +++ b/doc/salome/examples/primitives_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex diff --git a/doc/salome/examples/primitives_ex04.py b/doc/salome/examples/primitives_ex04.py index 4e27ac41c..4f51dd6d4 100644 --- a/doc/salome/examples/primitives_ex04.py +++ b/doc/salome/examples/primitives_ex04.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/primitives_ex05.py b/doc/salome/examples/primitives_ex05.py index 61fcc3846..bb3b245f1 100644 --- a/doc/salome/examples/primitives_ex05.py +++ b/doc/salome/examples/primitives_ex05.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/primitives_ex06.py b/doc/salome/examples/primitives_ex06.py index b639ec0ca..977fe4fb9 100644 --- a/doc/salome/examples/primitives_ex06.py +++ b/doc/salome/examples/primitives_ex06.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/primitives_ex07.py b/doc/salome/examples/primitives_ex07.py index e5989dfe4..a4de96ea6 100644 --- a/doc/salome/examples/primitives_ex07.py +++ b/doc/salome/examples/primitives_ex07.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/repairing_operations_ex01.py b/doc/salome/examples/repairing_operations_ex01.py index dc937caf0..fcc3f6ae5 100644 --- a/doc/salome/examples/repairing_operations_ex01.py +++ b/doc/salome/examples/repairing_operations_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices, an edge, an arc, a wire, a face and a prism diff --git a/doc/salome/examples/repairing_operations_ex02.py b/doc/salome/examples/repairing_operations_ex02.py index 344ec4bff..6dc223afb 100644 --- a/doc/salome/examples/repairing_operations_ex02.py +++ b/doc/salome/examples/repairing_operations_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a box diff --git a/doc/salome/examples/repairing_operations_ex03.py b/doc/salome/examples/repairing_operations_ex03.py index 8b8baedbd..a0854226c 100644 --- a/doc/salome/examples/repairing_operations_ex03.py +++ b/doc/salome/examples/repairing_operations_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices and vectors diff --git a/doc/salome/examples/repairing_operations_ex04.py b/doc/salome/examples/repairing_operations_ex04.py index 242b17231..55971195d 100644 --- a/doc/salome/examples/repairing_operations_ex04.py +++ b/doc/salome/examples/repairing_operations_ex04.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/repairing_operations_ex05.py b/doc/salome/examples/repairing_operations_ex05.py index e5fef2bb5..c8da39d13 100644 --- a/doc/salome/examples/repairing_operations_ex05.py +++ b/doc/salome/examples/repairing_operations_ex05.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/repairing_operations_ex06.py b/doc/salome/examples/repairing_operations_ex06.py index 5f6014e74..95168fc4a 100644 --- a/doc/salome/examples/repairing_operations_ex06.py +++ b/doc/salome/examples/repairing_operations_ex06.py @@ -4,7 +4,7 @@ import salome, math salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create base points diff --git a/doc/salome/examples/repairing_operations_ex07.py b/doc/salome/examples/repairing_operations_ex07.py index 1a7ff79a4..66a0c0e94 100644 --- a/doc/salome/examples/repairing_operations_ex07.py +++ b/doc/salome/examples/repairing_operations_ex07.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create boxes diff --git a/doc/salome/examples/repairing_operations_ex08.py b/doc/salome/examples/repairing_operations_ex08.py index 5266bc3a6..046332af4 100644 --- a/doc/salome/examples/repairing_operations_ex08.py +++ b/doc/salome/examples/repairing_operations_ex08.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create boxes @@ -30,4 +30,4 @@ geompy.addToStudy(glue1, "Glue all edges") geompy.addToStudy(glue2, "Glue two edges") if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/repairing_operations_ex09.py b/doc/salome/examples/repairing_operations_ex09.py index 2875051d2..5d97eef92 100644 --- a/doc/salome/examples/repairing_operations_ex09.py +++ b/doc/salome/examples/repairing_operations_ex09.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # import initial topology with bad tolerances (more than 1e-07) diff --git a/doc/salome/examples/repairing_operations_ex10.py b/doc/salome/examples/repairing_operations_ex10.py index bf823db92..399a22f93 100644 --- a/doc/salome/examples/repairing_operations_ex10.py +++ b/doc/salome/examples/repairing_operations_ex10.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # Variant 1: using DivideEdge() @@ -40,4 +40,4 @@ edge = geompy.GetEdgeNearPoint( box, p1, theName="edge to split") div = geompy.DivideEdgeByPoint( box, edge, [p1, p2], theName="box (edge divided)") -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/repairing_operations_ex11.py b/doc/salome/examples/repairing_operations_ex11.py index c243e5118..6aae32a81 100644 --- a/doc/salome/examples/repairing_operations_ex11.py +++ b/doc/salome/examples/repairing_operations_ex11.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create vertices p1 = geompy.MakeVertex(0, 0, 0) @@ -49,4 +49,4 @@ for wire in wires: ii = ii + 1 pass -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/repairing_operations_ex12.py b/doc/salome/examples/repairing_operations_ex12.py index 4075e1bc1..4218d85d4 100644 --- a/doc/salome/examples/repairing_operations_ex12.py +++ b/doc/salome/examples/repairing_operations_ex12.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create solids with some coincident faces Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) @@ -23,4 +23,4 @@ geompy.addToStudy(Partition_1, 'Partition_1') Joined_1 = geompy.RemoveInternalFaces(Partition_1) geompy.addToStudy(Joined_1, 'Joined_1') -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/sketcher.py b/doc/salome/examples/sketcher.py index a4f20a1ce..197ecd01e 100644 --- a/doc/salome/examples/sketcher.py +++ b/doc/salome/examples/sketcher.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/tolerance.py b/doc/salome/examples/tolerance.py index ac72a3031..d82ae373a 100644 --- a/doc/salome/examples/tolerance.py +++ b/doc/salome/examples/tolerance.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(100,30,100) diff --git a/doc/salome/examples/topological_geom_objs_ex01.py b/doc/salome/examples/topological_geom_objs_ex01.py index 257819c3d..ead4e3a8e 100644 --- a/doc/salome/examples/topological_geom_objs_ex01.py +++ b/doc/salome/examples/topological_geom_objs_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # diff --git a/doc/salome/examples/topological_geom_objs_ex02.py b/doc/salome/examples/topological_geom_objs_ex02.py index eb12ea6a5..b3b1c8e70 100644 --- a/doc/salome/examples/topological_geom_objs_ex02.py +++ b/doc/salome/examples/topological_geom_objs_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/topological_geom_objs_ex03.py b/doc/salome/examples/topological_geom_objs_ex03.py index 6d9d5d43f..1f03e6251 100644 --- a/doc/salome/examples/topological_geom_objs_ex03.py +++ b/doc/salome/examples/topological_geom_objs_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/topological_geom_objs_ex04.py b/doc/salome/examples/topological_geom_objs_ex04.py index 31a938dda..727e428e4 100644 --- a/doc/salome/examples/topological_geom_objs_ex04.py +++ b/doc/salome/examples/topological_geom_objs_ex04.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") #create vertices diff --git a/doc/salome/examples/topological_geom_objs_ex05.py b/doc/salome/examples/topological_geom_objs_ex05.py index 67bf79084..891ffe7a4 100644 --- a/doc/salome/examples/topological_geom_objs_ex05.py +++ b/doc/salome/examples/topological_geom_objs_ex05.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") #create vertices diff --git a/doc/salome/examples/topological_geom_objs_ex06.py b/doc/salome/examples/topological_geom_objs_ex06.py index 7ae16d8e6..7c779612e 100644 --- a/doc/salome/examples/topological_geom_objs_ex06.py +++ b/doc/salome/examples/topological_geom_objs_ex06.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/topological_geom_objs_ex07.py b/doc/salome/examples/topological_geom_objs_ex07.py index f1e646a74..f3d6954b0 100644 --- a/doc/salome/examples/topological_geom_objs_ex07.py +++ b/doc/salome/examples/topological_geom_objs_ex07.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a box diff --git a/doc/salome/examples/transformation_operations_ex01.py b/doc/salome/examples/transformation_operations_ex01.py index 5a01039fd..1de25e6cc 100644 --- a/doc/salome/examples/transformation_operations_ex01.py +++ b/doc/salome/examples/transformation_operations_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector diff --git a/doc/salome/examples/transformation_operations_ex02.py b/doc/salome/examples/transformation_operations_ex02.py index 564e1409d..5be970784 100644 --- a/doc/salome/examples/transformation_operations_ex02.py +++ b/doc/salome/examples/transformation_operations_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math gg = salome.ImportComponentGUI("GEOM") diff --git a/doc/salome/examples/transformation_operations_ex03.py b/doc/salome/examples/transformation_operations_ex03.py index 6870a3529..56c742857 100644 --- a/doc/salome/examples/transformation_operations_ex03.py +++ b/doc/salome/examples/transformation_operations_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math gg = salome.ImportComponentGUI("GEOM") diff --git a/doc/salome/examples/transformation_operations_ex04.py b/doc/salome/examples/transformation_operations_ex04.py index ebcd1f48d..8748d11e2 100644 --- a/doc/salome/examples/transformation_operations_ex04.py +++ b/doc/salome/examples/transformation_operations_ex04.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a box diff --git a/doc/salome/examples/transformation_operations_ex05.py b/doc/salome/examples/transformation_operations_ex05.py index 948fa0087..dc4950433 100644 --- a/doc/salome/examples/transformation_operations_ex05.py +++ b/doc/salome/examples/transformation_operations_ex05.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a box and a sphere diff --git a/doc/salome/examples/transformation_operations_ex06.py b/doc/salome/examples/transformation_operations_ex06.py index 64f8b6615..7312cd7d7 100644 --- a/doc/salome/examples/transformation_operations_ex06.py +++ b/doc/salome/examples/transformation_operations_ex06.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a box and a sphere diff --git a/doc/salome/examples/transformation_operations_ex07.py b/doc/salome/examples/transformation_operations_ex07.py index d323cf0b7..d134c1dfa 100644 --- a/doc/salome/examples/transformation_operations_ex07.py +++ b/doc/salome/examples/transformation_operations_ex07.py @@ -3,7 +3,7 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a cylindric face and a curve(edge) cylinder = geompy.MakeCylinderRH(100, 300) diff --git a/doc/salome/examples/transformation_operations_ex08.py b/doc/salome/examples/transformation_operations_ex08.py index c26774d66..b4428a979 100644 --- a/doc/salome/examples/transformation_operations_ex08.py +++ b/doc/salome/examples/transformation_operations_ex08.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices and vectors diff --git a/doc/salome/examples/transformation_operations_ex09.py b/doc/salome/examples/transformation_operations_ex09.py index 3467b5be6..ee64361d3 100644 --- a/doc/salome/examples/transformation_operations_ex09.py +++ b/doc/salome/examples/transformation_operations_ex09.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") import math diff --git a/doc/salome/examples/transformation_operations_ex10.py b/doc/salome/examples/transformation_operations_ex10.py index 17747db1b..d05d7026c 100644 --- a/doc/salome/examples/transformation_operations_ex10.py +++ b/doc/salome/examples/transformation_operations_ex10.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a face in OXY plane diff --git a/doc/salome/examples/transformation_operations_ex11.py b/doc/salome/examples/transformation_operations_ex11.py index a5b6e5b3a..7d60f45e9 100644 --- a/doc/salome/examples/transformation_operations_ex11.py +++ b/doc/salome/examples/transformation_operations_ex11.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create box diff --git a/doc/salome/examples/transformation_operations_ex12.py b/doc/salome/examples/transformation_operations_ex12.py index a59eda05f..b7c864637 100644 --- a/doc/salome/examples/transformation_operations_ex12.py +++ b/doc/salome/examples/transformation_operations_ex12.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") radius = 10. ShapeTypeEdge = geompy.ShapeType["EDGE"] diff --git a/doc/salome/examples/transformation_operations_ex13.py b/doc/salome/examples/transformation_operations_ex13.py index ba857a05b..66d9ef421 100644 --- a/doc/salome/examples/transformation_operations_ex13.py +++ b/doc/salome/examples/transformation_operations_ex13.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") d1 = 10. d2 = 10. diff --git a/doc/salome/examples/transformation_operations_ex14.py b/doc/salome/examples/transformation_operations_ex14.py index e8bc167ed..4d3b4f24d 100644 --- a/doc/salome/examples/transformation_operations_ex14.py +++ b/doc/salome/examples/transformation_operations_ex14.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create vertices diff --git a/doc/salome/examples/viewing_geom_objs_ex01.py b/doc/salome/examples/viewing_geom_objs_ex01.py index 8a6d13e93..3a21aec0c 100644 --- a/doc/salome/examples/viewing_geom_objs_ex01.py +++ b/doc/salome/examples/viewing_geom_objs_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() box = geompy.MakeBox(0,0,0, 50,50,50) box2 = geompy.MakeBox(-50,-50,-50, 0,0,0) diff --git a/doc/salome/examples/viewing_geom_objs_ex02.py b/doc/salome/examples/viewing_geom_objs_ex02.py index b8629d61c..44859418e 100644 --- a/doc/salome/examples/viewing_geom_objs_ex02.py +++ b/doc/salome/examples/viewing_geom_objs_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() box = geompy.MakeBox(0,0,0, 50,50,50) sphere = geompy.MakeSphere(50,50,50, 30) diff --git a/doc/salome/examples/viewing_geom_objs_ex03.py b/doc/salome/examples/viewing_geom_objs_ex03.py index 9932eeec6..e7c5f4049 100644 --- a/doc/salome/examples/viewing_geom_objs_ex03.py +++ b/doc/salome/examples/viewing_geom_objs_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() box = geompy.MakeBox(0,0,0, 50,50,50) sphere = geompy.MakeSphere(50,50,50, 30) diff --git a/doc/salome/examples/viewing_geom_objs_ex04.py b/doc/salome/examples/viewing_geom_objs_ex04.py index 093fdfbe1..c0d4f5f1f 100644 --- a/doc/salome/examples/viewing_geom_objs_ex04.py +++ b/doc/salome/examples/viewing_geom_objs_ex04.py @@ -5,7 +5,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() texture_file = os.path.join(os.getenv("GEOM_ROOT_DIR"), "share", "salome", "resources", "geom", "textures", "texture1.dat") texture = geompy.LoadTexture(texture_file) diff --git a/doc/salome/examples/whatis.py b/doc/salome/examples/whatis.py index 632ab6226..241cbd754 100644 --- a/doc/salome/examples/whatis.py +++ b/doc/salome/examples/whatis.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(100,30,100) diff --git a/doc/salome/examples/working_with_groups_ex01.py b/doc/salome/examples/working_with_groups_ex01.py index 4133965f4..c9b7e9b40 100644 --- a/doc/salome/examples/working_with_groups_ex01.py +++ b/doc/salome/examples/working_with_groups_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create two vertices @@ -37,4 +37,4 @@ id_group1 = geompy.addToStudy(group, "Group1") # display the contents of the group gg.createAndDisplayGO(id_group1) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/working_with_groups_ex02.py b/doc/salome/examples/working_with_groups_ex02.py index 773043b88..1bf857fc9 100644 --- a/doc/salome/examples/working_with_groups_ex02.py +++ b/doc/salome/examples/working_with_groups_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create two vertices @@ -26,4 +26,4 @@ id_group1 = geompy.addToStudy(group, "Group1") # display the contents of the group gg.createAndDisplayGO(id_group1) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/working_with_groups_ex03.py b/doc/salome/examples/working_with_groups_ex03.py index a9637afc7..1d3cf53eb 100644 --- a/doc/salome/examples/working_with_groups_ex03.py +++ b/doc/salome/examples/working_with_groups_ex03.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create two vertices @@ -33,4 +33,4 @@ id_group1 = geompy.addToStudy(group, "Group1") # display the contents of the group gg.createAndDisplayGO(id_group1) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/working_with_groups_ex04.py b/doc/salome/examples/working_with_groups_ex04.py index f48fef725..cdf1ac045 100644 --- a/doc/salome/examples/working_with_groups_ex04.py +++ b/doc/salome/examples/working_with_groups_ex04.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box and some groups of faces on it Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) @@ -29,4 +29,4 @@ geompy.addToStudyInFather(Box_1, Group_3, 'Group_3') geompy.addToStudyInFather(Box_1, Group_4, 'Group_4') geompy.addToStudyInFather(Box_1, Group_U_1_2, 'Group_U_1_2') geompy.addToStudyInFather(Box_1, Group_UL_3_4, 'Group_UL_3_4') -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/working_with_groups_ex05.py b/doc/salome/examples/working_with_groups_ex05.py index 551f84755..477cb19a9 100644 --- a/doc/salome/examples/working_with_groups_ex05.py +++ b/doc/salome/examples/working_with_groups_ex05.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box and some groups of faces on it Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) @@ -29,4 +29,4 @@ geompy.addToStudyInFather(Box_1, Group_3, 'Group_3') geompy.addToStudyInFather(Box_1, Group_4, 'Group_4') geompy.addToStudyInFather(Box_1, Group_I_1_3, 'Group_I_1_3') geompy.addToStudyInFather(Box_1, Group_IL_1_3, 'Group_IL_1_3') -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/working_with_groups_ex06.py b/doc/salome/examples/working_with_groups_ex06.py index 155c4a115..0a3f13f57 100644 --- a/doc/salome/examples/working_with_groups_ex06.py +++ b/doc/salome/examples/working_with_groups_ex06.py @@ -4,7 +4,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # create a box and some groups of faces on it Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) @@ -29,4 +29,4 @@ geompy.addToStudyInFather(Box_1, Group_3, 'Group_3') geompy.addToStudyInFather(Box_1, Group_4, 'Group_4') geompy.addToStudyInFather(Box_1, Group_C_2_4, 'Group_C_2_4') geompy.addToStudyInFather(Box_1, Group_CL_2_4, 'Group_CL_2_4') -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/gui/GEOM/input/geometrical_object_properties.doc b/doc/salome/gui/GEOM/input/geometrical_object_properties.doc index 2d9653716..1f390cb1e 100644 --- a/doc/salome/gui/GEOM/input/geometrical_object_properties.doc +++ b/doc/salome/gui/GEOM/input/geometrical_object_properties.doc @@ -77,7 +77,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() box = geompy.MakeBoxDXDYDZ(10,10,10) type = geompy.ShapeIdToType(box.GetType()) @@ -103,7 +103,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() box = geompy.MakeBoxDXDYDZ(10,10,10) type = box.GetShapeType() diff --git a/doc/salome/gui/GEOM/input/geompy_migration.doc b/doc/salome/gui/GEOM/input/geompy_migration.doc index fcac5fb05..6d77dab99 100644 --- a/doc/salome/gui/GEOM/input/geompy_migration.doc +++ b/doc/salome/gui/GEOM/input/geompy_migration.doc @@ -23,13 +23,13 @@ salome.salome_init() \n the old mode: \code import geompy -geompy.init_geom(theStudy) +geompy.init_geom() \endcode \n the new mode: \code import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() \endcode diff --git a/doc/salome/gui/GEOM/input/tui_execution_distribution.doc b/doc/salome/gui/GEOM/input/tui_execution_distribution.doc index 4d36e4efb..8c2c37565 100644 --- a/doc/salome/gui/GEOM/input/tui_execution_distribution.doc +++ b/doc/salome/gui/GEOM/input/tui_execution_distribution.doc @@ -16,7 +16,7 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() \endcode With this initialization, the geometry engine runs in the default container, @@ -30,7 +30,7 @@ For instance: from salome.geom import geomBuilder lcc = salome.lcc engineGeom = lcc.FindOrLoadComponent("myServer", "GEOM") -geompy = geomBuilder.New(theStudy, engineGeom) +geompy = geomBuilder.New(engineGeom) \endcode Or, within a Distributed Python Node of a YACS Schema, where the container @@ -38,8 +38,8 @@ is already provided in the Python context of the node, with my_container@SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + @@ -209,13 +203,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + @@ -226,11 +214,6 @@ unknown 0 - - theStudy - Study - unknown - theObject GEOM/GEOM_BaseObject @@ -263,11 +246,6 @@ unknown 0 - - theStudy - Study - unknown - theObject GEOM/GEOM_Object @@ -310,11 +288,6 @@ unknown 0 - - theStudy - Study - unknown - theObject GEOM/GEOM_Object @@ -357,11 +330,6 @@ unknown 0 - - theStudy - Study - unknown - theSObject SObject @@ -403,13 +371,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -425,13 +387,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -447,13 +403,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -469,13 +419,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -491,13 +435,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -513,13 +451,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -535,13 +467,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -557,13 +483,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -579,13 +499,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -601,13 +515,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -623,13 +531,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -645,13 +547,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -667,13 +563,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyID - long - unknown - - + return @@ -690,11 +580,6 @@ unknown 0 - - theStudyID - long - unknown - theLibName string @@ -733,11 +618,6 @@ unknown 0 - - theStudyID - long - unknown - theEntry string @@ -830,13 +710,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyEntry - string - unknown - - + return @@ -869,11 +743,6 @@ unknown 0 - - theStudy - Study - unknown - theObject CORBA/Object @@ -1008,22 +877,6 @@ unknown - - SetStudyID - SALOME team - @SALOMEGEOM_VERSION@ - unknown - 0 - - - theStudyID - long - unknown - - - - - CreateListOfGO SALOME team diff --git a/src/AdvancedEngine/AdvancedEngine_IOperations.cxx b/src/AdvancedEngine/AdvancedEngine_IOperations.cxx index 88bd4a37f..2ae8db0ba 100644 --- a/src/AdvancedEngine/AdvancedEngine_IOperations.cxx +++ b/src/AdvancedEngine/AdvancedEngine_IOperations.cxx @@ -118,19 +118,19 @@ * Constructor */ //============================================================================= -AdvancedEngine_IOperations::AdvancedEngine_IOperations(GEOM_Engine* theEngine, int theDocID) : - GEOM_IOperations(theEngine, theDocID) +AdvancedEngine_IOperations::AdvancedEngine_IOperations(GEOM_Engine* theEngine) : + GEOM_IOperations(theEngine) { MESSAGE("AdvancedEngine_IOperations::AdvancedEngine_IOperations"); - myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID()); - myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine(), GetDocID()); - myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID()); - myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine(), GetDocID()); - myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine(), GetDocID()); - my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine(), GetDocID()); - myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine(), GetDocID()); - myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine(), GetDocID()); - myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID()); + myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine()); + myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine()); + myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine()); + myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine()); + myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine()); + my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine()); + myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine()); + myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine()); + myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine()); } //============================================================================= @@ -1076,7 +1076,7 @@ bool AdvancedEngine_IOperations::MakeInternalGroup // Get faces that are laying on conical faces. if (aConicalFaces.IsEmpty() == Standard_False) { Handle(GEOM_Object) aCone = - GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + GetEngine()->AddObject(GEOM_TSHAPE); Handle(GEOM_Function) aFunction = aCone->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC); TopTools_ListIteratorOfListOfShape aFIter(aConicalFaces); @@ -1915,7 +1915,7 @@ Handle(TColStd_HSequenceOfTransient) MESSAGE("AdvancedEngine_IOperations::MakePipeTShape"); SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC); @@ -2070,7 +2070,7 @@ AdvancedEngine_IOperations::MakePipeTShapeWithPosition { SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); ///////////////// // TSHAPE CODE ///////////////// @@ -2238,7 +2238,7 @@ AdvancedEngine_IOperations::MakePipeTShapeChamfer { SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_CHAMFER); if (aFunction.IsNull()) return NULL; @@ -2468,7 +2468,7 @@ AdvancedEngine_IOperations::MakePipeTShapeChamferWithPosition { SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_CHAMFER); if (aFunction.IsNull()) return NULL; @@ -2699,7 +2699,7 @@ AdvancedEngine_IOperations::MakePipeTShapeFillet { SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_FILLET); if (aFunction.IsNull()) return NULL; @@ -2951,7 +2951,7 @@ AdvancedEngine_IOperations::MakePipeTShapeFilletWithPosition { SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_FILLET); if (aFunction.IsNull()) return NULL; @@ -3202,7 +3202,7 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedDisk (double theR, do return NULL; } //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDDISK); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_DividedDiskDriver::GetID(), DIVIDEDDISK_R_RATIO); @@ -3270,7 +3270,7 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedDiskPntVecR (Handle(G SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDDISK); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_DividedDiskDriver::GetID(), DIVIDEDDISK_R_VECTOR_PNT); @@ -3343,7 +3343,7 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedCylinder (double theR SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDCYLINDER); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDCYLINDER); Handle(GEOM_Object) aBaseShape = MakeDividedDisk(theR, 67.0, 1, thePattern); aBaseShape->GetLastFunction()->SetDescription(""); // Erase dump of MakeDividedDisk @@ -3391,7 +3391,7 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeSmoothingSurface (std::list< SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_SMOOTHINGSURFACE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_SMOOTHINGSURFACE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_SmoothingSurfaceDriver::GetID(), SMOOTHINGSURFACE_LPOINTS); diff --git a/src/AdvancedEngine/AdvancedEngine_IOperations.hxx b/src/AdvancedEngine/AdvancedEngine_IOperations.hxx index 8a28dded3..58c3a269e 100644 --- a/src/AdvancedEngine/AdvancedEngine_IOperations.hxx +++ b/src/AdvancedEngine/AdvancedEngine_IOperations.hxx @@ -165,7 +165,7 @@ public: bool fuse); public: - AdvancedEngine_IOperations(GEOM_Engine* theEngine, int theDocID); + AdvancedEngine_IOperations(GEOM_Engine* theEngine); ~AdvancedEngine_IOperations(); Handle(TColStd_HSequenceOfTransient) diff --git a/src/AdvancedEngine/AdvancedEngine_OperationsCreator.cxx b/src/AdvancedEngine/AdvancedEngine_OperationsCreator.cxx index f7d3603fa..40c79e210 100644 --- a/src/AdvancedEngine/AdvancedEngine_OperationsCreator.cxx +++ b/src/AdvancedEngine/AdvancedEngine_OperationsCreator.cxx @@ -33,7 +33,7 @@ #include "Utils_ExceptHandlers.hxx" #include "utilities.h" -std::map AdvancedEngine_OperationsCreator::_mapOfOperations; +AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::_operation; AdvancedEngine_OperationsCreator::AdvancedEngine_OperationsCreator() { @@ -51,19 +51,17 @@ AdvancedEngine_OperationsCreator::~AdvancedEngine_OperationsCreator() } GEOM_IOperations_i* AdvancedEngine_OperationsCreator::Create (PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl) { Unexpect aCatch(SALOME_SalomeException); MESSAGE( "AdvancedEngine_OperationsCreator::Create" ); - return new AdvancedEngine_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) ); + return new AdvancedEngine_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ) +AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { - if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) - _mapOfOperations[theStudyId] = new AdvancedEngine_IOperations( theGenImpl, theStudyId ); - return _mapOfOperations[theStudyId]; + if( !_operation ) + _operation = new AdvancedEngine_IOperations( theGenImpl ); + return _operation; } diff --git a/src/AdvancedEngine/AdvancedEngine_OperationsCreator.hxx b/src/AdvancedEngine/AdvancedEngine_OperationsCreator.hxx index 9d5e6a9f0..b1b3b3c04 100755 --- a/src/AdvancedEngine/AdvancedEngine_OperationsCreator.hxx +++ b/src/AdvancedEngine/AdvancedEngine_OperationsCreator.hxx @@ -41,15 +41,13 @@ public: ~AdvancedEngine_OperationsCreator(); GEOM_IOperations_i* Create (PortableServer::POA_ptr thePOA, - int theStudyId, - GEOM::GEOM_Gen_ptr theEngine, - ::GEOMImpl_Gen* theGenImpl); + GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_Gen* theGenImpl); private: - static AdvancedEngine_IOperations* get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ); + static AdvancedEngine_IOperations* get(::GEOMImpl_Gen* theGenImpl); private: - static std::map _mapOfOperations; + static AdvancedEngine_IOperations* _operation; }; #endif diff --git a/src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx b/src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx index aef497ee0..353bb7b36 100644 --- a/src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx @@ -216,7 +216,7 @@ void AdvancedGUI_DividedCylinderDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr AdvancedGUI_DividedCylinderDlg::createOperation() { - return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine"); + return getGeomEngine()->GetPluginOperations("AdvancedEngine"); } //================================================================================= diff --git a/src/AdvancedGUI/AdvancedGUI_DividedDiskDlg.cxx b/src/AdvancedGUI/AdvancedGUI_DividedDiskDlg.cxx index 1a50ca613..557a0666b 100644 --- a/src/AdvancedGUI/AdvancedGUI_DividedDiskDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_DividedDiskDlg.cxx @@ -392,7 +392,7 @@ void AdvancedGUI_DividedDiskDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr AdvancedGUI_DividedDiskDlg::createOperation() { - return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine"); + return getGeomEngine()->GetPluginOperations("AdvancedEngine"); } //================================================================================= diff --git a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx index b8a3904b7..5216a5b1f 100644 --- a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx @@ -555,7 +555,7 @@ void AdvancedGUI_PipeTShapeDlg::SelectionIntoArgument() if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = - getGeomEngine()->GetIShapesOperations(getStudyId()); + getGeomEngine()->GetIShapesOperations(); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); } else { @@ -847,7 +847,7 @@ void AdvancedGUI_PipeTShapeDlg::DisplayPreview (const bool activate, const bool //================================================================================= GEOM::GEOM_IOperations_ptr AdvancedGUI_PipeTShapeDlg::createOperation() { - return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine"); + return getGeomEngine()->GetPluginOperations("AdvancedEngine"); } //================================================================================= @@ -1217,8 +1217,7 @@ bool AdvancedGUI_PipeTShapeDlg::executeNoCheck (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { SALOMEDS::GenericAttribute_var anAttr; if (!theSObject->FindAttribute(anAttr, "AttributeIOR")) @@ -1236,7 +1235,7 @@ void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, ObjectList::iterator it = pipeTShapeGroupObjects.begin(); for (int i = 0; it != pipeTShapeGroupObjects.end(); it++, i++) { - getGeomEngine()->AddInStudy(theStudy, (*it), tr((*it)->GetName()).toStdString().c_str(), theFather); + getGeomEngine()->AddInStudy((*it), tr((*it)->GetName()).toStdString().c_str(), theFather); } } diff --git a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.h b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.h index ad188a489..7518c36fd 100644 --- a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.h +++ b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.h @@ -78,7 +78,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid (QString&); virtual bool execute (ObjectList&); - virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + virtual void restoreSubShapes (SALOMEDS::SObject_ptr); virtual QList getSourceObjects(); private: diff --git a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx index 527cbcde2..602bad1ea 100644 --- a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx @@ -195,7 +195,7 @@ void AdvancedGUI_SmoothingSurfaceDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr AdvancedGUI_SmoothingSurfaceDlg::createOperation() { - return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine"); + return getGeomEngine()->GetPluginOperations("AdvancedEngine"); } //================================================================================= diff --git a/src/BREPPlugin/BREPPlugin_GUI.cxx b/src/BREPPlugin/BREPPlugin_GUI.cxx index 83cca591d..bb1a0699f 100644 --- a/src/BREPPlugin/BREPPlugin_GUI.cxx +++ b/src/BREPPlugin/BREPPlugin_GUI.cxx @@ -109,11 +109,8 @@ bool BREPPlugin_GUI::importBREP( SUIT_Desktop* parent ) { SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return false; - SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); - if ( !study ) return false; - SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); - GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "BREPPluginEngine" ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "BREPPluginEngine" ); BREPOpPtr brepOp = GEOM::IBREPOperations::_narrow( op ); if ( brepOp.isNull() ) return false; @@ -133,35 +130,34 @@ bool BREPPlugin_GUI::importBREP( SUIT_Desktop* parent ) try { - app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( fileName ) ); - transaction.start(); - GEOM::ListOfGO_var result = brepOp->ImportBREP( fileName.toUtf8().constData() ); - if ( result->length() > 0 && brepOp->IsDone() ) - { - GEOM::GEOM_Object_var main = result[0]; - QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) ); - SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy, - SALOMEDS::SObject::_nil(), - main.in(), - publishName.toUtf8().constData() ); + app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( fileName ) ); + transaction.start(); + GEOM::ListOfGO_var result = brepOp->ImportBREP( fileName.toUtf8().constData() ); + if ( result->length() > 0 && brepOp->IsDone() ) + { + GEOM::GEOM_Object_var main = result[0]; + QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) ); + SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), + main.in(), + publishName.toUtf8().constData() ); - entryList.append( so->GetID() ); - transaction.commit(); - GEOM_Displayer( study ).Display( main.in() ); + entryList.append( so->GetID() ); + transaction.commit(); + GEOM_Displayer().Display( main.in() ); main->UnRegister(); - } - else - { - transaction.abort(); - errors.append( QString( "%1 : %2" ).arg( fileName ).arg( brepOp->GetErrorCode() ) ); - } + } + else + { + transaction.abort(); + errors.append( QString( "%1 : %2" ).arg( fileName ).arg( brepOp->GetErrorCode() ) ); + } } catch( const SALOME::SALOME_Exception& e ) { - transaction.abort(); + transaction.abort(); } } - getGeometryGUI()->updateObjBrowser( true ); + getGeometryGUI()->updateObjBrowser(); app->browseObjects( entryList ); if ( errors.count() > 0 ) @@ -182,11 +178,8 @@ bool BREPPlugin_GUI::exportBREP( SUIT_Desktop* parent ) { SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return false; - SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); - if ( !study ) return false; - SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); - GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "BREPPluginEngine" ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "BREPPluginEngine" ); BREPOpPtr brepOp = GEOM::IBREPOperations::_narrow( op ); if ( brepOp.isNull() ) return false; diff --git a/src/BREPPlugin/BREPPlugin_IECallBack.cxx b/src/BREPPlugin/BREPPlugin_IECallBack.cxx index dd8c27197..0d5461955 100755 --- a/src/BREPPlugin/BREPPlugin_IECallBack.cxx +++ b/src/BREPPlugin/BREPPlugin_IECallBack.cxx @@ -46,12 +46,11 @@ BREPPlugin_IECallBack::~BREPPlugin_IECallBack() */ //============================================================================= bool -BREPPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +BREPPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine(), theDocId ); + BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine() ); aPluginOperations->ExportBREP( theOriginal, theFileName ); return true; } @@ -62,11 +61,10 @@ BREPPlugin_IECallBack::Export( int theDocId, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -BREPPlugin_IECallBack::Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +BREPPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine(), theDocId ); + BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine() ); return aPluginOperations->ImportBREP( theFileName ); } diff --git a/src/BREPPlugin/BREPPlugin_IECallBack.hxx b/src/BREPPlugin/BREPPlugin_IECallBack.hxx index a718d0f8b..9d59d79bc 100644 --- a/src/BREPPlugin/BREPPlugin_IECallBack.hxx +++ b/src/BREPPlugin/BREPPlugin_IECallBack.hxx @@ -36,14 +36,12 @@ public: BREPPlugin_IECallBack(); ~BREPPlugin_IECallBack(); - bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ); + bool Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ); - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); }; #endif diff --git a/src/BREPPlugin/BREPPlugin_IOperations.cxx b/src/BREPPlugin/BREPPlugin_IOperations.cxx index 43f72dac5..3ed5736f6 100644 --- a/src/BREPPlugin/BREPPlugin_IOperations.cxx +++ b/src/BREPPlugin/BREPPlugin_IOperations.cxx @@ -38,8 +38,8 @@ * Constructor */ //============================================================================= -BREPPlugin_IOperations::BREPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +BREPPlugin_IOperations::BREPPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "BREPPlugin_IOperations::BREPPlugin_IOperations" ); } @@ -74,7 +74,7 @@ void BREPPlugin_IOperations::ExportBREP( const Handle(GEOM_Object) theOrigi if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT); //Add an Export function Handle(GEOM_Function) aFunction = result->AddFunction( BREPPlugin_ExportDriver::GetID(), EXPORT_SHAPE ); @@ -124,7 +124,7 @@ BREPPlugin_IOperations::ImportBREP( const TCollection_AsciiString& theFileName ) if( theFileName.IsEmpty() ) return NULL; //Add a new result object - Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT ); + Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT ); //Add an Import function Handle(GEOM_Function) aFunction = diff --git a/src/BREPPlugin/BREPPlugin_IOperations.hxx b/src/BREPPlugin/BREPPlugin_IOperations.hxx index d2eaebd50..831b1c792 100644 --- a/src/BREPPlugin/BREPPlugin_IOperations.hxx +++ b/src/BREPPlugin/BREPPlugin_IOperations.hxx @@ -30,7 +30,7 @@ class BREPPLUGINENGINE_EXPORT BREPPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - BREPPlugin_IOperations( GEOM_Engine*, int ); + BREPPlugin_IOperations( GEOM_Engine* ); ~BREPPlugin_IOperations(); void ExportBREP( const Handle(GEOM_Object), diff --git a/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx b/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx index 7e55ee044..f1b96159b 100644 --- a/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx +++ b/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx @@ -32,7 +32,7 @@ // OCCT includes #include -std::map BREPPlugin_OperationsCreator::_mapOfOperations; +BREPPlugin_IOperations* BREPPlugin_OperationsCreator::_operation; BREPPlugin_OperationsCreator::BREPPlugin_OperationsCreator() { @@ -51,19 +51,17 @@ BREPPlugin_OperationsCreator::~BREPPlugin_OperationsCreator() } GEOM_IOperations_i* BREPPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ) { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "BREPPlugin_OperationsCreator::Create" ); - return new BREPPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) ); + return new BREPPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ) +BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { - if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) - _mapOfOperations[theStudyId] = new BREPPlugin_IOperations( theGenImpl, theStudyId ); - return _mapOfOperations[theStudyId]; + if( !_operation ) + _operation = new BREPPlugin_IOperations( theGenImpl ); + return _operation; } diff --git a/src/BREPPlugin/BREPPlugin_OperationsCreator.hxx b/src/BREPPlugin/BREPPlugin_OperationsCreator.hxx index f2deb8646..e49c6cb53 100755 --- a/src/BREPPlugin/BREPPlugin_OperationsCreator.hxx +++ b/src/BREPPlugin/BREPPlugin_OperationsCreator.hxx @@ -41,15 +41,13 @@ public: ~BREPPlugin_OperationsCreator(); GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, - int theStudyId, - GEOM::GEOM_Gen_ptr theEngine, - ::GEOMImpl_Gen* theGenImpl ); + GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_Gen* theGenImpl ); private: - static BREPPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ); + static BREPPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); private: - static std::map _mapOfOperations; + static BREPPlugin_IOperations* _operation; friend class BREPPlugin_IECallBack; }; diff --git a/src/BasicGUI/BasicGUI_ArcDlg.cxx b/src/BasicGUI/BasicGUI_ArcDlg.cxx index 506b48606..93da18e31 100644 --- a/src/BasicGUI/BasicGUI_ArcDlg.cxx +++ b/src/BasicGUI/BasicGUI_ArcDlg.cxx @@ -452,7 +452,7 @@ void BasicGUI_ArcDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_ArcDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetICurvesOperations(); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index 9b43abc0a..a94c7fcbe 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -543,7 +543,7 @@ double BasicGUI_CircleDlg::getRadius() const //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_CircleDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetICurvesOperations(); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_CurveDlg.cxx b/src/BasicGUI/BasicGUI_CurveDlg.cxx index 89866fc8f..2a363b49d 100644 --- a/src/BasicGUI/BasicGUI_CurveDlg.cxx +++ b/src/BasicGUI/BasicGUI_CurveDlg.cxx @@ -418,7 +418,7 @@ void BasicGUI_CurveDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_CurveDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetICurvesOperations(getStudyId()); + return myGeomGUI->GetGeomGen()->GetICurvesOperations(); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index 9ef110a64..4fdea1811 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -371,7 +371,7 @@ void BasicGUI_EllipseDlg::ValueChangedInSpinBox( double newValue ) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_EllipseDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetICurvesOperations(); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_LineDlg.cxx b/src/BasicGUI/BasicGUI_LineDlg.cxx index c520f9af6..288062c80 100644 --- a/src/BasicGUI/BasicGUI_LineDlg.cxx +++ b/src/BasicGUI/BasicGUI_LineDlg.cxx @@ -364,7 +364,7 @@ void BasicGUI_LineDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_LineDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBasicOperations(); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.cxx b/src/BasicGUI/BasicGUI_MarkerDlg.cxx index 56bb4eb6e..ee6448c35 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.cxx +++ b/src/BasicGUI/BasicGUI_MarkerDlg.cxx @@ -511,7 +511,7 @@ void BasicGUI_MarkerDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_MarkerDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBasicOperations(); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index 05ac56dc8..17d431515 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -675,7 +675,7 @@ QString BasicGUI_PlaneDlg::getSizeAsString() const //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_PlaneDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBasicOperations(); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index 66326b97d..4f4f89b46 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -733,7 +733,7 @@ void BasicGUI_PointDlg::OnPointSelected(const gp_Pnt& thePnt) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetIBasicOperations(getStudyId()); + return myGeomGUI->GetGeomGen()->GetIBasicOperations(); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index 7d4d41923..d0eaa03ae 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -395,7 +395,7 @@ void BasicGUI_VectorDlg::ReverseVector( int state ) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_VectorDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBasicOperations(); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx index a623ab2cf..bb337df3f 100644 --- a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx @@ -335,7 +335,7 @@ void BasicGUI_WorkingPlaneDlg::SelectionIntoArgument() aName = aName + ":edge_" + QString::number( anIndex ); GEOM::GEOM_IShapesOperations_var aShapesOp = - getGeomEngine()->GetIShapesOperations( getStudyId() ); + getGeomEngine()->GetIShapesOperations(); if ( myEditCurrentArgument == Group2->LineEdit1 ) myVectX = aShapesOp->GetSubShape( aSelectedObject, anIndex ); else @@ -489,7 +489,7 @@ bool BasicGUI_WorkingPlaneDlg::updateWPlane( const bool showPreview ) Zz = Xx = 1.; GEOM::GEOM_IMeasureOperations_ptr aMeasureOp = - myGeomGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() ); + myGeomGUI->GetGeomGen()->GetIMeasureOperations(); aMeasureOp->GetPosition( myFace, Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz); if ( aMeasureOp->IsDone() ) { @@ -582,7 +582,7 @@ bool BasicGUI_WorkingPlaneDlg::updateWPlane( const bool showPreview ) } if ( showPreview ) { - GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations( getStudyId() ); + GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations(); GEOM::GEOM_Object_var anObj = aBasicOp->MakeMarker ( myWPlane.Location().X(), myWPlane.Location().Y(), myWPlane.Location().Z(), myWPlane.XDirection().X(), myWPlane.XDirection().Y(), myWPlane.XDirection().Z(), diff --git a/src/BlocksGUI/BlocksGUI_BlockDlg.cxx b/src/BlocksGUI/BlocksGUI_BlockDlg.cxx index 6f8c2ac0b..178ed57f4 100644 --- a/src/BlocksGUI/BlocksGUI_BlockDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_BlockDlg.cxx @@ -422,7 +422,7 @@ void BlocksGUI_BlockDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr BlocksGUI_BlockDlg::createOperation() { - return getGeomEngine()->GetIBlocksOperations(getStudyId()); + return getGeomEngine()->GetIBlocksOperations(); } //================================================================================= diff --git a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx index 984bb22ec..f9f543b0f 100644 --- a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx @@ -360,7 +360,7 @@ bool BlocksGUI_ExplodeDlg::isAllSubShapes() const //================================================================================= GEOM::GEOM_IOperations_ptr BlocksGUI_ExplodeDlg::createOperation() { - return getGeomEngine()->GetIBlocksOperations( getStudyId() ); + return getGeomEngine()->GetIBlocksOperations(); } //================================================================================= diff --git a/src/BlocksGUI/BlocksGUI_PropagateDlg.cxx b/src/BlocksGUI/BlocksGUI_PropagateDlg.cxx index c585745f5..041e57f4e 100644 --- a/src/BlocksGUI/BlocksGUI_PropagateDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_PropagateDlg.cxx @@ -222,7 +222,7 @@ void BlocksGUI_PropagateDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr BlocksGUI_PropagateDlg::createOperation() { - return getGeomEngine()->GetIBlocksOperations( getStudyId() ); + return getGeomEngine()->GetIBlocksOperations(); } //================================================================================= diff --git a/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx b/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx index b1b01f88d..116327bfe 100644 --- a/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx @@ -482,7 +482,7 @@ void BlocksGUI_QuadFaceDlg::activateSelection() //================================================================================= GEOM::GEOM_IOperations_ptr BlocksGUI_QuadFaceDlg::createOperation() { - return getGeomEngine()->GetIBlocksOperations(getStudyId()); + return getGeomEngine()->GetIBlocksOperations(); } //================================================================================= diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx index d326adab0..d4e285aed 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx @@ -543,7 +543,7 @@ void BlocksGUI_TrsfDlg::enableWidgets() //================================================================================= GEOM::GEOM_IOperations_ptr BlocksGUI_TrsfDlg::createOperation() { - return getGeomEngine()->GetIBlocksOperations(getStudyId()); + return getGeomEngine()->GetIBlocksOperations(); } //================================================================================= diff --git a/src/BooleanGUI/BooleanGUI_Dialog.cxx b/src/BooleanGUI/BooleanGUI_Dialog.cxx index b766e214b..c2d1d97da 100644 --- a/src/BooleanGUI/BooleanGUI_Dialog.cxx +++ b/src/BooleanGUI/BooleanGUI_Dialog.cxx @@ -378,7 +378,7 @@ void BooleanGUI_Dialog::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr BooleanGUI_Dialog::createOperation() { - return getGeomEngine()->GetIBooleanOperations(getStudyId()); + return getGeomEngine()->GetIBooleanOperations(); } //================================================================================= @@ -457,12 +457,11 @@ bool BooleanGUI_Dialog::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void BooleanGUI_Dialog::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void BooleanGUI_Dialog::restoreSubShapes (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(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame /*theInheritFirstArg=*/myOperation == BooleanGUI::CUT, mainFrame()->CheckBoxAddPrefix->isChecked()); // ? false diff --git a/src/BooleanGUI/BooleanGUI_Dialog.h b/src/BooleanGUI/BooleanGUI_Dialog.h index e2f535595..a009ddecb 100644 --- a/src/BooleanGUI/BooleanGUI_Dialog.h +++ b/src/BooleanGUI/BooleanGUI_Dialog.h @@ -50,7 +50,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual void addSubshapesToStudy(); virtual QList getSourceObjects(); diff --git a/src/BuildGUI/BuildGUI_CompoundDlg.cxx b/src/BuildGUI/BuildGUI_CompoundDlg.cxx index 17d4a3bda..f64a92bf7 100644 --- a/src/BuildGUI/BuildGUI_CompoundDlg.cxx +++ b/src/BuildGUI/BuildGUI_CompoundDlg.cxx @@ -207,7 +207,7 @@ void BuildGUI_CompoundDlg::enterEvent(QEvent* e) //================================================================================= GEOM::GEOM_IOperations_ptr BuildGUI_CompoundDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations( getStudyId() ); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= @@ -244,12 +244,11 @@ bool BuildGUI_CompoundDlg::execute( ObjectList& objects ) // function : restoreSubShapes // purpose : //================================================================================= -void BuildGUI_CompoundDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject ) +void BuildGUI_CompoundDlg::restoreSubShapes( 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(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame /*theInheritFirstArg=*/false, mainFrame()->CheckBoxAddPrefix->isChecked() ); diff --git a/src/BuildGUI/BuildGUI_CompoundDlg.h b/src/BuildGUI/BuildGUI_CompoundDlg.h index 280737050..75737c1ad 100644 --- a/src/BuildGUI/BuildGUI_CompoundDlg.h +++ b/src/BuildGUI/BuildGUI_CompoundDlg.h @@ -49,7 +49,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/BuildGUI/BuildGUI_EdgeDlg.cxx b/src/BuildGUI/BuildGUI_EdgeDlg.cxx index 57e6169fb..ff807392b 100644 --- a/src/BuildGUI/BuildGUI_EdgeDlg.cxx +++ b/src/BuildGUI/BuildGUI_EdgeDlg.cxx @@ -416,7 +416,7 @@ void BuildGUI_EdgeDlg::ValueChangedInSpinBox(double newValue) //================================================================================= GEOM::GEOM_IOperations_ptr BuildGUI_EdgeDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations(getStudyId()); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= diff --git a/src/BuildGUI/BuildGUI_FaceDlg.cxx b/src/BuildGUI/BuildGUI_FaceDlg.cxx index 88ff45f0d..2a312415b 100644 --- a/src/BuildGUI/BuildGUI_FaceDlg.cxx +++ b/src/BuildGUI/BuildGUI_FaceDlg.cxx @@ -585,7 +585,7 @@ void BuildGUI_FaceDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr BuildGUI_FaceDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations( getStudyId() ); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= diff --git a/src/BuildGUI/BuildGUI_ShellDlg.cxx b/src/BuildGUI/BuildGUI_ShellDlg.cxx index e32a0ac0e..2cd4b281d 100644 --- a/src/BuildGUI/BuildGUI_ShellDlg.cxx +++ b/src/BuildGUI/BuildGUI_ShellDlg.cxx @@ -234,7 +234,7 @@ void BuildGUI_ShellDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr BuildGUI_ShellDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations( getStudyId() ); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= diff --git a/src/BuildGUI/BuildGUI_SolidDlg.cxx b/src/BuildGUI/BuildGUI_SolidDlg.cxx index d564e61ce..331f481be 100644 --- a/src/BuildGUI/BuildGUI_SolidDlg.cxx +++ b/src/BuildGUI/BuildGUI_SolidDlg.cxx @@ -296,7 +296,7 @@ void BuildGUI_SolidDlg::EnableNameField( bool toEnable ) //================================================================================= GEOM::GEOM_IOperations_ptr BuildGUI_SolidDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations( getStudyId() ); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= @@ -308,7 +308,7 @@ bool BuildGUI_SolidDlg::isValid (QString& msg) bool ok = !myShells.isEmpty(); GEOM::MeasureOpPtr anOp; - anOp.take(myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId())); + anOp.take(myGeomGUI->GetGeomGen()->GetIMeasureOperations()); if (getConstructorId() == 0 && (!GroupSolid->CheckButton1->isChecked() || myShells.count() == 1)) { for (int i = 0, n = myShells.count(); i < n && ok; i++) { CORBA::String_var aRes = anOp->IsGoodForSolid(myShells[i].get()); @@ -336,7 +336,7 @@ bool BuildGUI_SolidDlg::isClosed( GEOM::GEOM_Object_ptr shell ) if ( !CORBA::is_nil( shell ) ) { GEOM::MeasureOpPtr anOp; - anOp.take( myGeomGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() ) ); + anOp.take( myGeomGUI->GetGeomGen()->GetIMeasureOperations() ); // Detect kind of shape and parameters aKind = anOp->KindOfShape(shell, anInts, aDbls); diff --git a/src/BuildGUI/BuildGUI_WireDlg.cxx b/src/BuildGUI/BuildGUI_WireDlg.cxx index ee0c055da..3085a9fef 100644 --- a/src/BuildGUI/BuildGUI_WireDlg.cxx +++ b/src/BuildGUI/BuildGUI_WireDlg.cxx @@ -263,7 +263,7 @@ void BuildGUI_WireDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr BuildGUI_WireDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations( getStudyId() ); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= diff --git a/src/DependencyTree/DependencyTree_Object.cxx b/src/DependencyTree/DependencyTree_Object.cxx index 3f06d4611..91196cb63 100644 --- a/src/DependencyTree/DependencyTree_Object.cxx +++ b/src/DependencyTree/DependencyTree_Object.cxx @@ -59,13 +59,7 @@ myIsMainObject( false ) myTextItem->setFont( textFont ); myEntry = theEntry; - - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - if ( !app ) return; - SalomeApp_Study* study = dynamic_cast(app->activeStudy()); - SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy( study->studyDS() ); - int studyId = aStudyDS->StudyId(); - myGeomObject = GeometryGUI::GetGeomGen()->GetObject( studyId, myEntry.c_str() ); + myGeomObject = GeometryGUI::GetGeomGen()->GetObject( myEntry.c_str() ); updateName(); diff --git a/src/DependencyTree/DependencyTree_Selector.cxx b/src/DependencyTree/DependencyTree_Selector.cxx index 73a248402..1b94c1f93 100644 --- a/src/DependencyTree/DependencyTree_Selector.cxx +++ b/src/DependencyTree/DependencyTree_Selector.cxx @@ -50,8 +50,7 @@ void DependencyTree_Selector::getSelection( SUIT_DataOwnerPtrList& theList ) con if( DependencyTree_Object* treeObject = dynamic_cast( myView->selectedObject() ) ) { QString studyEntry; QString name; - GEOM::GEOM_BaseObject_var anObj = GeometryGUI::GetGeomGen()->GetObject( myView->getStudyId(), - treeObject->getEntry().c_str() ); + GEOM::GEOM_BaseObject_var anObj = GeometryGUI::GetGeomGen()->GetObject( treeObject->getEntry().c_str() ); if( anObj->_is_nil() ) continue; CORBA::String_var studyEntryVar = anObj->GetStudyEntry(); diff --git a/src/DependencyTree/DependencyTree_View.cxx b/src/DependencyTree/DependencyTree_View.cxx index 2164574db..f782cd16f 100644 --- a/src/DependencyTree/DependencyTree_View.cxx +++ b/src/DependencyTree/DependencyTree_View.cxx @@ -48,9 +48,6 @@ myIsUpdate( true ) SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( !app ) return; - SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); - myStudy = GeometryGUI::ClientStudyToStudy( study->studyDS()); - mySelectionMgr = app->selectionMgr(); if ( !mySelectionMgr ) return; @@ -183,15 +180,6 @@ QString DependencyTree_View::getViewName() const return tr( "DEPENDENCY_TREE" ); } -//================================================================================= -// function : getStudyId() -// purpose : return Id of current study -//================================================================================= -int DependencyTree_View::getStudyId() const -{ - return myStudy->StudyId(); -} - //================================================================================= // function : getObjectByEntry() // purpose : return DependencyTree_Object by entry @@ -799,7 +787,7 @@ void DependencyTree_View::getNewTreeModel( bool theUseSelectedObject, bool theUs // get string which describes dependency tree structure SALOMEDS::TMPFile_var SeqFile = - GeometryGUI::GetGeomGen()->GetDependencyTree( myStudy, myMainEntries ); + GeometryGUI::GetGeomGen()->GetDependencyTree( myMainEntries ); char* buf = (char*)&SeqFile[0]; clearView( true ); diff --git a/src/DependencyTree/DependencyTree_View.h b/src/DependencyTree/DependencyTree_View.h index a32526e44..66143bc8d 100644 --- a/src/DependencyTree/DependencyTree_View.h +++ b/src/DependencyTree/DependencyTree_View.h @@ -60,7 +60,6 @@ public: void wheelEvent( QWheelEvent* event ); QString getViewName() const; - int getStudyId() const; DependencyTree_Object* getObjectByEntry( const std::string& ); @@ -129,7 +128,6 @@ private: QCheckBox* myDisplayDescendants; QPushButton* updateButton; - SALOMEDS::Study_var myStudy; LightApp_SelectionMgr* mySelectionMgr; GEOM::string_array_var myMainEntries; diff --git a/src/DependencyTree/DependencyTree_ViewModel.cxx b/src/DependencyTree/DependencyTree_ViewModel.cxx index 1b3d58c3f..aae7fe5fb 100644 --- a/src/DependencyTree/DependencyTree_ViewModel.cxx +++ b/src/DependencyTree/DependencyTree_ViewModel.cxx @@ -66,8 +66,7 @@ void DependencyTree_ViewModel::onShowSelected() SALOME_ListIO aSelList; aSelMgr->selectedObjects(aSelList); - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - GEOM_Displayer disp( appStudy ); + GEOM_Displayer disp; OCCViewer_ViewManager* anOCCVM = ( OCCViewer_ViewManager* ) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true ); @@ -96,8 +95,7 @@ void DependencyTree_ViewModel::onShowOnlySelected() SALOME_ListIO aSelList; aSelMgr->selectedObjects( aSelList ); - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - GEOM_Displayer disp( appStudy ); + GEOM_Displayer disp; OCCViewer_ViewManager* anOCCVM = (OCCViewer_ViewManager*) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true ); diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx index f1c83f1fb..19339c6ea 100644 --- a/src/DisplayGUI/DisplayGUI.cxx +++ b/src/DisplayGUI/DisplayGUI.cxx @@ -87,9 +87,6 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) SalomeApp_Application* app = getGeometryGUI()->getApp(); if (!app) return false; - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - if ( !appStudy ) return false; - LightApp_SelectionMgr *Sel = app->selectionMgr(); SALOME_ListIO selected; Sel->selectedObjects( selected ); @@ -173,7 +170,7 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) break; } Sel->setSelectedObjects( selected ); - GEOM_Displayer( appStudy ).UpdateColorScale(); + GEOM_Displayer().UpdateColorScale(); return true; } @@ -183,12 +180,7 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) //===================================================================================== void DisplayGUI::DisplayAll() { - SalomeApp_Application* app = getGeometryGUI()->getApp(); - if ( !app ) return; - - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - if ( !appStudy ) return; - _PTR(Study) aStudy = appStudy->studyDS(); + _PTR(Study) aStudy = SalomeApp_Application::getStudy(); if ( !aStudy ) return; _PTR(SComponent) SC ( aStudy->FindComponent( "GEOM" ) ); if ( !SC ) @@ -210,7 +202,7 @@ void DisplayGUI::DisplayAll() } anIter->Next(); } - GEOM_Displayer( appStudy ).Display( listIO, true ); + GEOM_Displayer().Display( listIO, true ); } //===================================================================================== @@ -225,11 +217,10 @@ void DisplayGUI::EraseAll() if ( app ) { SUIT_ViewWindow* vw = app->desktop()->activeWindow(); if ( vw ) { - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); SUIT_ViewManager* vman = vw->getViewManager(); if ( vman->getType() == OCCViewer_Viewer::Type() || vman->getType() == SVTK_Viewer::Type() ) { - GEOM_Displayer( appStudy ).EraseAll(true); + GEOM_Displayer().EraseAll(true); } } } @@ -258,8 +249,8 @@ void DisplayGUI::DisplayOnlyChildren() SalomeApp_Application* app = getGeometryGUI()->getApp(); if (!app) return; - SalomeApp_Study* anActiveStudy = dynamic_cast(app->activeStudy()); - if (!anActiveStudy) return; + SalomeApp_Study* aStudy = dynamic_cast(app->activeStudy()); + if (!aStudy) return; LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if (!aSelMgr) return; @@ -275,14 +266,14 @@ void DisplayGUI::DisplayOnlyChildren() for (; It.More(); It.Next()) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); if (anIObject->hasEntry()) { - _PTR(SObject) SO (anActiveStudy->studyDS()->FindObjectID(anIObject->getEntry())); + _PTR(SObject) SO (aStudy->studyDS()->FindObjectID(anIObject->getEntry())); if (SO) { _PTR(SComponent) SC (SO->GetFatherComponent()); if (QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str())) { // if component is selected, pass it } else { - _PTR(ChildIterator) anIter (anActiveStudy->studyDS()->NewChildIterator(SO)); + _PTR(ChildIterator) anIter (aStudy->studyDS()->NewChildIterator(SO)); anIter->InitEx(true); while (anIter->More()) { _PTR(SObject) valSO (anIter->Value()); @@ -298,7 +289,7 @@ void DisplayGUI::DisplayOnlyChildren() } } } - GEOM_Displayer(anActiveStudy).Display(listIO, true); + GEOM_Displayer().Display(listIO, true); } //===================================================================================== @@ -312,8 +303,8 @@ void DisplayGUI::Display() SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; - SalomeApp_Study* anActiveStudy = dynamic_cast( app->activeStudy() ); - if ( !anActiveStudy ) return; + SalomeApp_Study* aStudy = dynamic_cast( app->activeStudy() ); + if ( !aStudy ) return; //get SalomeApp selection manager LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); @@ -328,12 +319,12 @@ void DisplayGUI::Display() for( ;It.More();It.Next() ) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); if ( anIObject->hasEntry() ) { - _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); + _PTR(SObject) SO ( aStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) { _PTR(SComponent) SC ( SO->GetFatherComponent() ); // if component is selected listIO.Clear(); - _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) ); + _PTR(ChildIterator) anIter ( aStudy->studyDS()->NewChildIterator( SO ) ); anIter->InitEx( true ); while( anIter->More() ) { _PTR(SObject) valSO ( anIter->Value() ); @@ -355,7 +346,7 @@ void DisplayGUI::Display() listIO.Append( anIObject ); } } - GEOM_Displayer( anActiveStudy ).Display( listIO, true ); + GEOM_Displayer().Display( listIO, true ); } @@ -370,8 +361,8 @@ void DisplayGUI::Erase() SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; - SalomeApp_Study* anActiveStudy = dynamic_cast( app->activeStudy() ); - if ( !anActiveStudy ) return; + SalomeApp_Study* aStudy = dynamic_cast( app->activeStudy() ); + if ( !aStudy ) return; //get SalomeApp selection manager LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); @@ -386,12 +377,12 @@ void DisplayGUI::Erase() for( ; It.More(); It.Next() ) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); if ( anIObject->hasEntry() ) { - _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); + _PTR(SObject) SO ( aStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) { _PTR(SComponent) SC ( SO->GetFatherComponent() ); // if component is selected listIO.Clear(); - _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) ); + _PTR(ChildIterator) anIter ( aStudy->studyDS()->NewChildIterator( SO ) ); anIter->InitEx( true ); while( anIter->More() ) { _PTR(SObject) valSO ( anIter->Value() ); @@ -419,7 +410,7 @@ void DisplayGUI::Erase() if(viewWindow->getViewManager()->getType() == SVTK_Viewer::Type()) aIsForced = false; - GEOM_Displayer(anActiveStudy).Erase( listIO, aIsForced); + GEOM_Displayer().Erase( listIO, aIsForced); getGeometryGUI()->getApp()->selectionMgr()->clearSelected(); } @@ -440,7 +431,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() ); if ( !aStudy ) return; - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; int mgrId = viewWindow->getViewManager()->getGlobalId(); @@ -476,7 +467,7 @@ void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow ) if ( !viewWindow ) viewWindow = app->desktop()->activeWindow(); - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; viewWindow->setProperty( "VectorsMode", mode ); @@ -525,7 +516,7 @@ void DisplayGUI::SetVerticesMode( const bool mode, SUIT_ViewWindow* viewWindow ) if ( !viewWindow ) viewWindow = app->desktop()->activeWindow(); - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; viewWindow->setProperty( "VerticesMode", mode ); @@ -576,7 +567,7 @@ void DisplayGUI::SetNameMode( const bool mode, SUIT_ViewWindow* viewWindow ) viewWindow->setProperty( "NameMode", mode ); - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; int aMgrId = viewWindow->getViewManager()->getGlobalId(); @@ -631,7 +622,7 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; int mgrId = viewWindow->getViewManager()->getGlobalId(); diff --git a/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx b/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx index fd7b86889..a37cd7d60 100755 --- a/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx @@ -756,7 +756,7 @@ void EntityGUI_3DSketcherDlg::SelectionIntoArgument() aSelMgr->GetIndexes(aSelList.First(), aMap); if (aMap.Extent() == 1) { int anIndex = aMap(1); - GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); + GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); } } @@ -943,7 +943,7 @@ void EntityGUI_3DSketcherDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr EntityGUI_3DSketcherDlg::createOperation() { - return getGeomEngine()->GetICurvesOperations(getStudyId()); + return getGeomEngine()->GetICurvesOperations(); } //================================================================================= diff --git a/src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx b/src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx index bd0a18fc3..98db95c3f 100644 --- a/src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx +++ b/src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx @@ -719,7 +719,7 @@ void EntityGUI_FeatureDetectorDlg::showImageSample() //================================================================================= GEOM::GEOM_IOperations_ptr EntityGUI_FeatureDetectorDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetIShapesOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIShapesOperations(); } //================================================================================= @@ -730,7 +730,7 @@ bool EntityGUI_FeatureDetectorDlg::execute( ObjectList& objects ) { bool res = false; - GEOM::GEOM_IBasicOperations_var aBasicOperations = myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + GEOM::GEOM_IBasicOperations_var aBasicOperations = myGeomGUI->GetGeomGen()->GetIBasicOperations(); GEOM::GEOM_IShapesOperations_var aShapesOperations = GEOM::GEOM_IShapesOperations::_narrow( getOperation() ); ShapeRec_Parameters* parameters = parametersChanged(); @@ -791,7 +791,7 @@ bool EntityGUI_FeatureDetectorDlg::execute( ObjectList& objects ) } else if (myConstructorId == CONTOURS) { - GEOM::GEOM_ICurvesOperations_var aCurveOperations = myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); + GEOM::GEOM_ICurvesOperations_var aCurveOperations = myGeomGUI->GetGeomGen()->GetICurvesOperations(); myDetector->ComputeContours( useROI, parameters ); std::vector< std::vector > contours = myDetector->GetContours(); diff --git a/src/EntityGUI/EntityGUI_FieldDlg.cxx b/src/EntityGUI/EntityGUI_FieldDlg.cxx index 38b891fdb..a510b08e3 100644 --- a/src/EntityGUI/EntityGUI_FieldDlg.cxx +++ b/src/EntityGUI/EntityGUI_FieldDlg.cxx @@ -1765,7 +1765,7 @@ void EntityGUI_FieldDlg::highlightSubShapes() SALOME_ListIO aSelList; // To highlight the selected sub-shape in Object Browser, if it's already published under the main shape - GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(getStudyId()); + GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(); QMap childsMap; SalomeApp_Study* appStudy = dynamic_cast(app->activeStudy()); if (appStudy) { @@ -1818,7 +1818,7 @@ void EntityGUI_FieldDlg::highlightSubShapes() //================================================================================= GEOM::GEOM_IOperations_ptr EntityGUI_FieldDlg::createOperation() { - return getGeomEngine()->GetIFieldOperations(getStudyId()); + return getGeomEngine()->GetIFieldOperations(); } #define RETURN_WITH_MSG(a, b) \ @@ -1857,7 +1857,7 @@ bool EntityGUI_FieldDlg::isValid(QString& theMessage) //================================================================================= bool EntityGUI_FieldDlg::execute() { - SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy( getStudy()->studyDS() ); + SALOMEDS::Study_var aStudyDS = GeometryGUI::getStudyServant(); SALOMEDS::StudyBuilder_var aBuilder = aStudyDS->NewBuilder(); QString aName = getNewObjectName().trimmed(); @@ -1882,7 +1882,7 @@ bool EntityGUI_FieldDlg::execute() return false; SALOMEDS::SObject_wrap aSO = - getGeomEngine()->AddInStudy( aStudyDS, myField, aName.toLatin1().constData(), myShape ); + getGeomEngine()->AddInStudy( myField, aName.toLatin1().constData(), myShape ); if ( !aSO->_is_nil() ) { myField->UnRegister(); CORBA::String_var entry = aSO->GetID(); @@ -1918,7 +1918,7 @@ bool EntityGUI_FieldDlg::execute() step = myField->AddStep( tbl->getStepID(), tbl->getStamp() ); SALOMEDS::SObject_wrap aSO = - getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), myField ); + getGeomEngine()->AddInStudy( step, stepName.toLatin1().constData(), myField ); if ( /*!myIsCreation &&*/ !aSO->_is_nil() ) { step->UnRegister(); CORBA::String_var entry = aSO->GetID(); diff --git a/src/EntityGUI/EntityGUI_IsolineDlg.cxx b/src/EntityGUI/EntityGUI_IsolineDlg.cxx index 8bd115db3..9d9ad5e81 100755 --- a/src/EntityGUI/EntityGUI_IsolineDlg.cxx +++ b/src/EntityGUI/EntityGUI_IsolineDlg.cxx @@ -190,7 +190,7 @@ void EntityGUI_IsolineDlg::TypeChanged(int) //================================================================================= GEOM::GEOM_IOperations_ptr EntityGUI_IsolineDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetICurvesOperations(); } //================================================================================= diff --git a/src/EntityGUI/EntityGUI_PictureImportDlg.cxx b/src/EntityGUI/EntityGUI_PictureImportDlg.cxx index ec39c0d14..e93a97dfa 100644 --- a/src/EntityGUI/EntityGUI_PictureImportDlg.cxx +++ b/src/EntityGUI/EntityGUI_PictureImportDlg.cxx @@ -163,7 +163,7 @@ bool EntityGUI_PictureImportDlg::ClickOnApply() //================================================================================= GEOM::GEOM_IOperations_ptr EntityGUI_PictureImportDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetIBlocksOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBlocksOperations(); } //================================================================================= @@ -175,7 +175,7 @@ bool EntityGUI_PictureImportDlg::execute( ObjectList& objects ) bool res = false; GEOM::GEOM_Object_var anObj; - GEOM::GEOM_IBasicOperations_var aBasicOperations = myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + GEOM::GEOM_IBasicOperations_var aBasicOperations = myGeomGUI->GetGeomGen()->GetIBasicOperations(); GEOM::GEOM_IBlocksOperations_var aBlocksOperations = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() ); QString theImgFileName = myLineEdit->text(); if ( theImgFileName.isEmpty() ) diff --git a/src/EntityGUI/EntityGUI_PolylineDlg.cxx b/src/EntityGUI/EntityGUI_PolylineDlg.cxx index 1c6c9bda5..98a73d3ec 100644 --- a/src/EntityGUI/EntityGUI_PolylineDlg.cxx +++ b/src/EntityGUI/EntityGUI_PolylineDlg.cxx @@ -286,7 +286,7 @@ void EntityGUI_PolylineDlg::GetCurveParams(GEOM::ListOfListOfDouble &theCoords, //================================================================================= GEOM::GEOM_IOperations_ptr EntityGUI_PolylineDlg::createOperation() { - return getGeomEngine()->GetICurvesOperations( getStudyId() ); + return getGeomEngine()->GetICurvesOperations(); } //================================================================================= @@ -678,7 +678,7 @@ gp_Ax3 EntityGUI_PolylineDlg::WPlaneToLCS(GEOM::GeomObjPtr theGeomObj) if (aShape.ShapeType() == TopAbs_FACE) { GEOM::GEOM_IMeasureOperations_ptr aMeasureOp = - myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId()); + myGeomGUI->GetGeomGen()->GetIMeasureOperations(); double Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz; aMeasureOp->GetPosition(theGeomObj.get(), Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz); diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index 45ecde755..2c7215002 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -462,7 +462,7 @@ void EntityGUI_SketcherDlg::Init() myHelpFileName = "create_sketcher_page.html"; - GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations( getStudyId() ); + GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations(); myGlobalCS = aBasicOp->MakeMarker( 0,0,0, 1,0,0, 0,1,0 ); @@ -2270,7 +2270,7 @@ QString EntityGUI_SketcherDlg::GetNewCommand( QString& theParameters ) //================================================================================= GEOM::GEOM_IOperations_ptr EntityGUI_SketcherDlg::createOperation() { - return getGeomEngine()->GetICurvesOperations( getStudyId() ); + return getGeomEngine()->GetICurvesOperations(); } //================================================================================= @@ -2794,7 +2794,7 @@ gp_Ax3 EntityGUI_SketcherDlg::WPlaneToLCS( GEOM::GEOM_Object_var geomObj ) if (aShape.ShapeType() == TopAbs_FACE) { GEOM::GEOM_IMeasureOperations_ptr aMeasureOp = - myGeometryGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() ); + myGeometryGUI->GetGeomGen()->GetIMeasureOperations(); double Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz; aMeasureOp->GetPosition( geomObj, Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz); if ( aMeasureOp->IsDone() ) diff --git a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx index 5afbdda18..5230c6ac5 100644 --- a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx +++ b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx @@ -810,7 +810,7 @@ void EntityGUI_SubShapeDlg::activateSelection() //================================================================================= GEOM::GEOM_IOperations_ptr EntityGUI_SubShapeDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations(getStudyId()); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= diff --git a/src/EntityGUI/EntityGUI_SurfFromFaceDlg.cxx b/src/EntityGUI/EntityGUI_SurfFromFaceDlg.cxx index 0929f1c10..fd723302a 100644 --- a/src/EntityGUI/EntityGUI_SurfFromFaceDlg.cxx +++ b/src/EntityGUI/EntityGUI_SurfFromFaceDlg.cxx @@ -169,7 +169,7 @@ void EntityGUI_SurfFromFaceDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr EntityGUI_SurfFromFaceDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetIShapesOperations(getStudyId()); + return myGeomGUI->GetGeomGen()->GetIShapesOperations(); } //================================================================================= diff --git a/src/GEOM/GEOM_BaseDriver.cxx b/src/GEOM/GEOM_BaseDriver.cxx index 314c65760..731acd999 100644 --- a/src/GEOM/GEOM_BaseDriver.cxx +++ b/src/GEOM/GEOM_BaseDriver.cxx @@ -35,21 +35,6 @@ OCCT_IMPLEMENT_STANDARD_RTTIEXT(GEOM_BaseDriver,TFunction_Driver); -//================================================================================ -/*! - * Returns document id - */ -//================================================================================ -int GEOM_BaseDriver::GetDocID() const -{ - int docId = 0; - if (!Label().IsNull()) { - Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(Label().Data()); - docId = GEOM_Engine::GetEngine()->GetDocID(aDoc); - } - return docId; -} - //================================================================================ /*! * \brief Returns a name of creation operation and names and values of creation parameters diff --git a/src/GEOM/GEOM_BaseDriver.hxx b/src/GEOM/GEOM_BaseDriver.hxx index 61aa70f6a..ea27b5635 100644 --- a/src/GEOM/GEOM_BaseDriver.hxx +++ b/src/GEOM/GEOM_BaseDriver.hxx @@ -76,8 +76,6 @@ struct GEOM_Param class GEOM_BaseDriver : public TFunction_Driver { public: - // Returns document id - Standard_EXPORT int GetDocID() const; // Returns a name of creation operation and names and values of creation parameters // (Use AddParam() methods declared below to fill params vector while implementing diff --git a/src/GEOM/GEOM_BaseObject.cxx b/src/GEOM/GEOM_BaseObject.cxx index a0ced3b4d..16bf38ce1 100644 --- a/src/GEOM/GEOM_BaseObject.cxx +++ b/src/GEOM/GEOM_BaseObject.cxx @@ -85,15 +85,9 @@ Handle(GEOM_BaseObject) GEOM_BaseObject::GetObject(const TDF_Label& theLabel) TCollection_AsciiString anEntry; TDF_Tool::Entry(theLabel, anEntry); - Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(theLabel.Data()); - if(aDoc.IsNull()) return NULL; - - Handle(TDataStd_Integer) anID; - if(!aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) return NULL; - GEOM_Engine* anEngine = GEOM_Engine::GetEngine(); if(anEngine == NULL) return NULL; - return anEngine->GetObject(anID->Get(), anEntry.ToCString()); + return anEngine->GetObject(anEntry.ToCString()); } //============================================================================= @@ -167,14 +161,8 @@ int GEOM_BaseObject::GetType(const TDF_Label& theLabel) */ //============================================================================= GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry) - : _label(theEntry), _ior(""), _docID(-1) + : _label(theEntry), _ior("") { - Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data()); - if(!aDoc.IsNull()) { - Handle(TDataStd_Integer) anID; - if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get(); - } - if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root)) _root = TDataStd_TreeNode::Set(theEntry); } @@ -185,14 +173,8 @@ GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry) */ //============================================================================= GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry, int theType) -: _label(theEntry), _ior(""), _docID(-1) +: _label(theEntry), _ior("") { - Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data()); - if(!aDoc.IsNull()) { - Handle(TDataStd_Integer) anID; - if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get(); - } - theEntry.ForgetAllAttributes(Standard_True); if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root)) @@ -288,17 +270,6 @@ void GEOM_BaseObject::IncrementTic() TDataStd_Integer::Set(aTicLabel, aTic + 1); } - -//============================================================================= -/*! - * GetDocID - */ -//============================================================================= -int GEOM_BaseObject::GetDocID() -{ - return _docID; -} - //============================================================================= /*! * SetName diff --git a/src/GEOM/GEOM_BaseObject.hxx b/src/GEOM/GEOM_BaseObject.hxx index 0c7a65dfc..4c9ed3cf8 100644 --- a/src/GEOM/GEOM_BaseObject.hxx +++ b/src/GEOM/GEOM_BaseObject.hxx @@ -92,9 +92,6 @@ public: Standard_EXPORT void SetTic(int theTic); Standard_EXPORT void IncrementTic(); - //Returns an ID of the OCAF document where this GEOM_BaseObject is stored - Standard_EXPORT int GetDocID(); - //Sets a name of this GEOM_BaseObject Standard_EXPORT void SetName(const char* theName); @@ -163,7 +160,6 @@ public: TDF_Label _label; TCollection_AsciiString _ior; TCollection_AsciiString _parameters; - int _docID; public: OCCT_DEFINE_STANDARD_RTTIEXT(GEOM_BaseObject,Standard_Transient) diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index bfd101415..1293fd8ed 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -100,24 +100,9 @@ static GEOM_Engine* TheEngine = NULL; static TCollection_AsciiString BuildIDFromObject(Handle(GEOM_BaseObject)& theObject) { - TCollection_AsciiString anID(theObject->GetDocID()), anEntry; + TCollection_AsciiString anEntry; TDF_Tool::Entry(theObject->GetEntry(), anEntry); - anID+=(TCollection_AsciiString("_")+anEntry); - return anID; -} - -static TCollection_AsciiString BuildID(Standard_Integer theDocID, const char* theEntry) -{ - TCollection_AsciiString anID(theDocID); - anID+=(TCollection_AsciiString("_")+theEntry); - return anID; -} - -static Standard_Integer ExtractDocID(TCollection_AsciiString& theID) -{ - TCollection_AsciiString aDocID = theID.Token("_"); - if(aDocID.Length() < 1) return -1; - return aDocID.IntegerValue(); + return anEntry; } bool ProcessFunction(Handle(GEOM_Function)& theFunction, @@ -146,11 +131,10 @@ void ReplaceEntriesByNames (TCollection_AsciiString& theScript, Standard_Integer& objectCounter, Resource_DataMapOfAsciiStringAsciiString& aNameToEntry); -void AddObjectColors (int theDocID, - TCollection_AsciiString& theScript, +void AddObjectColors (TCollection_AsciiString& theScript, const TSting2ObjDataMap& theEntry2ObjData); -void AddTextures (int theDocID, TCollection_AsciiString& theScript); +void AddTextures (TCollection_AsciiString& theScript); void PublishObject (TObjectData& theObjectData, TSting2ObjDataMap& theEntry2ObjData, @@ -252,14 +236,8 @@ GEOM_Engine::~GEOM_Engine() for(objit = objs.begin(); objit != objs.end(); ++objit) RemoveObject(*objit); - //Close all documents not closed - TColStd_DataMapIteratorOfDataMapOfIntegerTransient anItr (_mapIDDocument); - for (; anItr.More(); anItr.Next()) - { - Close(anItr.Key()); - anItr.Initialize( _mapIDDocument ); // anItr becomes invalid at _mapIDDocument.UnBind(docId) - } - _mapIDDocument.Clear(); + //Close document + Close(); _objects.Clear(); } @@ -268,11 +246,11 @@ GEOM_Engine::~GEOM_Engine() * GetDocument */ //============================================================================= -Handle(TDocStd_Document) GEOM_Engine::GetDocument(int theDocID, bool force) +Handle(TDocStd_Document) GEOM_Engine::GetDocument(bool force) { Handle(TDocStd_Document) aDoc; - if(_mapIDDocument.IsBound(theDocID)) { - aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID)); + if (_document) { + aDoc = _document; } else if (force) { #if OCC_VERSION_MAJOR > 6 @@ -281,44 +259,26 @@ Handle(TDocStd_Document) GEOM_Engine::GetDocument(int theDocID, bool force) _OCAFApp->NewDocument("SALOME_GEOM", aDoc); #endif aDoc->SetUndoLimit(_UndoLimit); - _mapIDDocument.Bind(theDocID, aDoc); - TDataStd_Integer::Set(aDoc->Main(), theDocID); + _document = aDoc; } return aDoc; } -//============================================================================= -/*! - * GetDocID - */ -//============================================================================= -int GEOM_Engine::GetDocID(Handle(TDocStd_Document) theDocument) -{ - if (theDocument.IsNull()) return -1; - TColStd_DataMapIteratorOfDataMapOfIntegerTransient anItr (_mapIDDocument); - for (; anItr.More(); anItr.Next()) - if (anItr.Value() == theDocument) return anItr.Key(); - - return -1; -} - //============================================================================= /*! * GetObject */ //============================================================================= -Handle(GEOM_BaseObject) GEOM_Engine::GetObject(int theDocID, const char* theEntry, bool force) +Handle(GEOM_BaseObject) GEOM_Engine::GetObject(const char* theEntry, bool force) { Handle(GEOM_BaseObject) anObject; - TCollection_AsciiString anID = BuildID(theDocID, theEntry); - - if (_objects.IsBound(anID)) { - anObject = Handle(GEOM_BaseObject)::DownCast(_objects(anID)); + if (_objects.IsBound(theEntry)) { + anObject = Handle(GEOM_BaseObject)::DownCast(_objects(theEntry)); } else if (force) { - Handle(TDocStd_Document) aDoc = GetDocument(theDocID, force); + Handle(TDocStd_Document) aDoc = GetDocument(force); if ( !aDoc.IsNull()) { TDF_Label aLabel; TDF_Tool::Label(aDoc->Main().Data(), theEntry, aLabel, Standard_True); @@ -329,7 +289,7 @@ Handle(GEOM_BaseObject) GEOM_Engine::GetObject(int theDocID, const char* theEntr case GEOM_FIELD_STEP_OBJTYPE: anObject = new GEOM_FieldStep(aLabel); break; default: anObject = new GEOM_Object (aLabel); } - _objects.Bind(anID, anObject); + _objects.Bind(theEntry, anObject); } } } @@ -343,22 +303,19 @@ Handle(GEOM_BaseObject) GEOM_Engine::GetObject(int theDocID, const char* theEntr */ //============================================================================= -Handle(GEOM_BaseObject) GEOM_Engine::AddBaseObject(int theDocID, int theType) +Handle(GEOM_BaseObject) GEOM_Engine::AddBaseObject(int theType) { - Handle(TDocStd_Document) aDoc = GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = GetDocument(); Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main()); // NPAL18604: use existing label to decrease memory usage, // if this label has been freed (object deleted) bool useExisting = false; TDF_Label aChild; - if (_freeLabels.find(theDocID) != _freeLabels.end()) { - std::list& aFreeLabels = _freeLabels[theDocID]; - if (!aFreeLabels.empty()) { - useExisting = true; - aChild = aFreeLabels.front(); - aFreeLabels.pop_front(); - } + if (!_freeLabels.empty()) { + useExisting = true; + aChild = _freeLabels.front(); + _freeLabels.pop_front(); } if (!useExisting) { // create new label @@ -386,9 +343,9 @@ Handle(GEOM_BaseObject) GEOM_Engine::AddBaseObject(int theDocID, int theType) */ //================================================================================ -Handle(GEOM_Object) GEOM_Engine::AddObject(int theDocID, int theType) +Handle(GEOM_Object) GEOM_Engine::AddObject(int theType) { - return Handle(GEOM_Object)::DownCast( AddBaseObject(theDocID, theType) ); + return Handle(GEOM_Object)::DownCast( AddBaseObject(theType) ); } //============================================================================= @@ -403,21 +360,17 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) th { if (theMainShape.IsNull() || theIndices.IsNull()) return NULL; - Handle(TDocStd_Document) aDoc = GetDocument(theMainShape->GetDocID()); + Handle(TDocStd_Document) aDoc = GetDocument(); Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main()); // NPAL18604: use existing label to decrease memory usage, // if this label has been freed (object deleted) bool useExisting = false; - TDF_Label aChild; - int aDocID = theMainShape->GetDocID(); - if (_freeLabels.find(aDocID) != _freeLabels.end()) { - std::list& aFreeLabels = _freeLabels[aDocID]; - if (!aFreeLabels.empty()) { - useExisting = true; - aChild = aFreeLabels.front(); - aFreeLabels.pop_front(); - } + TDF_Label aChild;; + if (!_freeLabels.empty()) { + useExisting = true; + aChild = _freeLabels.front(); + _freeLabels.pop_front(); } if (!useExisting) { // create new label @@ -479,8 +432,7 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_BaseObject)& theObject) { if (theObject.IsNull()) return false; - int aDocID = theObject->GetDocID(); - if(!_mapIDDocument.IsBound(aDocID)) + if(!_document) return false; // document is closed... //Remove an object from the map of available objects @@ -515,16 +467,14 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_BaseObject)& theObject) aLabel.ForgetAllAttributes(Standard_True); // Remember the label to reuse it then - std::list& aFreeLabels = _freeLabels[aDocID]; - if ( aFreeLabels.empty() || aFreeLabels.back() != aLabel ) - aFreeLabels.push_back(aLabel); + if ( _freeLabels.empty() || _freeLabels.back() != aLabel ) + _freeLabels.push_back(aLabel); // we can't explicitely delete theObject. At least prevent its functioning // as an alive object when aLabel is reused for a new object theObject->_label = aLabel.Root(); theObject->_ior.Clear(); - theObject->_parameters.Clear(); - theObject->_docID = -1; + theObject->_parameters.Clear();; theObject.Nullify(); @@ -536,9 +486,9 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_BaseObject)& theObject) * Undo */ //============================================================================= -void GEOM_Engine::Undo(int theDocID) +void GEOM_Engine::Undo() { - GetDocument(theDocID)->Undo(); + GetDocument()->Undo(); } //============================================================================= @@ -546,9 +496,9 @@ void GEOM_Engine::Undo(int theDocID) * Redo */ //============================================================================= -void GEOM_Engine::Redo(int theDocID) +void GEOM_Engine::Redo() { - GetDocument(theDocID)->Redo(); + GetDocument()->Redo(); } //============================================================================= @@ -556,12 +506,11 @@ void GEOM_Engine::Redo(int theDocID) * Save */ //============================================================================= -bool GEOM_Engine::Save(int theDocID, const char* theFileName) +bool GEOM_Engine::Save(const char* theFileName) { - if(!_mapIDDocument.IsBound(theDocID)) return false; - Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID)); + if(!_document) return false; - _OCAFApp->SaveAs(aDoc, theFileName); + _OCAFApp->SaveAs(_document, theFileName); return true; } @@ -571,7 +520,7 @@ bool GEOM_Engine::Save(int theDocID, const char* theFileName) * Load */ //============================================================================= -bool GEOM_Engine::Load(int theDocID, const char* theFileName) +bool GEOM_Engine::Load(const char* theFileName) { Handle(TDocStd_Document) aDoc; if (_OCAFApp->Open(theFileName, aDoc) != PCDM_RS_OK) { @@ -587,10 +536,7 @@ bool GEOM_Engine::Load(int theDocID, const char* theFileName) aDoc->SetUndoLimit(_UndoLimit); - if(_mapIDDocument.IsBound(theDocID)) _mapIDDocument.UnBind(theDocID); - _mapIDDocument.Bind(theDocID, aDoc); - - TDataStd_Integer::Set(aDoc->Main(), theDocID); + _document = aDoc; return true; } @@ -600,30 +546,24 @@ bool GEOM_Engine::Load(int theDocID, const char* theFileName) * Close */ //============================================================================= -void GEOM_Engine::Close(int theDocID) +void GEOM_Engine::Close() { - if (_mapIDDocument.IsBound(theDocID)) { - Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID)); - - //Remove all GEOM Objects associated to the given document + if (_document) { + //Remove all GEOM Objects associated to the document TColStd_SequenceOfAsciiString aSeq; GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It (_objects); for (; It.More(); It.Next()) { - TCollection_AsciiString anObjID (It.Key()); - Standard_Integer anID = ExtractDocID(anObjID); - if (theDocID == anID) aSeq.Append(It.Key()); + aSeq.Append(It.Key()); } - for (Standard_Integer i=1; i<=aSeq.Length(); i++) _objects.UnBind(aSeq.Value(i)); - - // Forget free labels for this document - TFreeLabelsList::iterator anIt = _freeLabels.find(theDocID); - if (anIt != _freeLabels.end()) { - _freeLabels.erase(anIt); + for (Standard_Integer i=1; i<=aSeq.Length(); i++) { + _objects.UnBind(aSeq.Value(i)); } - _mapIDDocument.UnBind(theDocID); - _OCAFApp->Close(aDoc); - aDoc.Nullify(); + // Forget free labels for document + _freeLabels.clear(); + + _OCAFApp->Close(_document); + _document.Nullify(); } } @@ -632,8 +572,7 @@ void GEOM_Engine::Close(int theDocID) * DumpPython */ //============================================================================= -TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, - std::vector& theObjectData, +TCollection_AsciiString GEOM_Engine::DumpPython(std::vector& theObjectData, TVariablesList theVariables, bool isPublished, bool isMultiFile, @@ -643,26 +582,29 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, Kernel_Utils::Localizer loc; TCollection_AsciiString aScript; - Handle(TDocStd_Document) aDoc = GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = GetDocument(); if (aDoc.IsNull()) { TCollection_AsciiString anEmptyScript; if( isMultiFile ) - anEmptyScript = "def RebuildData(theStudy): pass\n"; + anEmptyScript = "def RebuildData(): pass\n"; return anEmptyScript; } + + if( isMultiFile ) + aScript = "import salome\n"; - aScript = "import GEOM\n"; + aScript += "import GEOM\n"; aScript += "from salome.geom import geomBuilder\n"; aScript += "import math\n"; aScript += "import SALOMEDS\n\n"; if( isMultiFile ) - aScript += "def RebuildData(theStudy):"; + aScript += "def RebuildData():"; - aScript += "\n\tgeompy = geomBuilder.New(theStudy)\n"; + aScript += "\n\tgeompy = geomBuilder.New()\n"; - AddTextures(theDocID, aScript); + AddTextures(aScript); Standard_Integer posToInsertGlobalVars = aScript.Length() + 1; @@ -798,7 +740,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, aScript += aFuncScript; // ouv : NPAL12872 - AddObjectColors( theDocID, aScript, aEntry2ObjData ); + AddObjectColors(aScript, aEntry2ObjData ); // Make script to publish in study TSting2ObjDataPtrMap::iterator aStEntry2ObjDataPtrIt; @@ -908,24 +850,21 @@ Handle(TColStd_HSequenceOfAsciiString) GEOM_Engine::GetAllDumpNames() const #define TEXTURE_LABEL_HEIGHT 4 #define TEXTURE_LABEL_DATA 5 -int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight, +int GEOM_Engine::addTexture(int theWidth, int theHeight, const Handle(TColStd_HArray1OfByte)& theTexture, const TCollection_AsciiString& theFileName) { - Handle(TDocStd_Document) aDoc = GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = GetDocument(); Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main()); // NPAL18604: use existing label to decrease memory usage, // if this label has been freed (object deleted) bool useExisting = false; TDF_Label aChild; - if (_freeLabels.find(theDocID) != _freeLabels.end()) { - std::list& aFreeLabels = _freeLabels[theDocID]; - if (!aFreeLabels.empty()) { - useExisting = true; - aChild = aFreeLabels.front(); - aFreeLabels.pop_front(); - } + if (!_freeLabels.empty()) { + useExisting = true; + aChild = _freeLabels.front(); + _freeLabels.pop_front(); } if (!useExisting) { // create new label @@ -954,14 +893,14 @@ int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight, return aTextureID; } -Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theDocID, int theTextureID, +Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theTextureID, int& theWidth, int& theHeight, TCollection_AsciiString& theFileName) { Handle(TColStd_HArray1OfByte) anArray; theWidth = theHeight = 0; - Handle(TDocStd_Document) aDoc = GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = GetDocument(); TDF_ChildIterator anIterator(aDoc->Main(), Standard_True); bool found = false; @@ -995,11 +934,11 @@ Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theDocID, int theTextu return anArray; } -std::list GEOM_Engine::getAllTextures(int theDocID) +std::list GEOM_Engine::getAllTextures() { std::list id_list; - Handle(TDocStd_Document) aDoc = GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = GetDocument(); TDF_ChildIterator anIterator(aDoc->Main(), Standard_True); for (; anIterator.More(); anIterator.Next()) { @@ -1014,17 +953,6 @@ std::list GEOM_Engine::getAllTextures(int theDocID) return id_list; } -void GEOM_Engine::DocumentModified(const int theDocId, const bool isModified) -{ - if (isModified) _mapModifiedDocs.Add(theDocId); - else _mapModifiedDocs.Remove(theDocId); -} - -bool GEOM_Engine::DocumentModified(const int theDocId) -{ - return _mapModifiedDocs.Contains(theDocId); -} - //=========================================================================== // Internal functions //=========================================================================== @@ -1665,12 +1593,11 @@ void ReplaceEntriesByNames (TCollection_AsciiString& theScript, * AddObjectColors: Add color to objects */ //============================================================================= -void AddObjectColors (int theDocID, - TCollection_AsciiString& theScript, +void AddObjectColors (TCollection_AsciiString& theScript, const TSting2ObjDataMap& theEntry2ObjData) { GEOM_Engine* engine = GEOM_Engine::GetEngine(); - Handle(TDocStd_Document) aDoc = engine->GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = engine->GetDocument(); TSting2ObjDataMap::const_iterator anEntryToNameIt; for (anEntryToNameIt = theEntry2ObjData.begin(); @@ -1774,10 +1701,10 @@ static TCollection_AsciiString pack_data (const Handle(TColStd_HArray1OfByte)& a return stream; } -void AddTextures (int theDocID, TCollection_AsciiString& theScript) +void AddTextures (TCollection_AsciiString& theScript) { GEOM_Engine* engine = GEOM_Engine::GetEngine(); - std::list allTextures = engine->getAllTextures(theDocID); + std::list allTextures = engine->getAllTextures(); std::list::const_iterator it; if (allTextures.size() > 0) { @@ -1788,7 +1715,7 @@ void AddTextures (int theDocID, TCollection_AsciiString& theScript) Standard_Integer aWidth, aHeight; TCollection_AsciiString aFileName; Handle(TColStd_HArray1OfByte) aTexture = - engine->getTexture(theDocID, *it, aWidth, aHeight, aFileName); + engine->getTexture(*it, aWidth, aHeight, aFileName); if (aWidth > 0 && aHeight > 0 && !aTexture.IsNull() && aTexture->Length() > 0 ) { TCollection_AsciiString aCommand = "\n\t"; aCommand += "texture_map["; aCommand += *it; aCommand += "] = "; diff --git a/src/GEOM/GEOM_Engine.hxx b/src/GEOM/GEOM_Engine.hxx index 564774078..b9bef5fbf 100644 --- a/src/GEOM/GEOM_Engine.hxx +++ b/src/GEOM/GEOM_Engine.hxx @@ -99,53 +99,48 @@ class GEOM_Engine Standard_EXPORT static GEOM_Engine* GetEngine(); //Returns the OCAF document by its ID, if document doesn't exists it will be created - Standard_EXPORT Handle(TDocStd_Document) GetDocument(int theDocID, bool force=true); - - //Returns the ID of the given OCAF document - Standard_EXPORT int GetDocID(Handle(TDocStd_Document) theDocument); + Standard_EXPORT Handle(TDocStd_Document) GetDocument(bool force=true); //Returns the OCAF appliaction Standard_EXPORT Handle(TDocStd_Application) GetApplication() { return _OCAFApp; } //Returns a pointer to GEOM_BaseObject defined by a document and the entry - Standard_EXPORT Handle(GEOM_BaseObject) GetObject(int theDocID, - const char* theEntry, + Standard_EXPORT Handle(GEOM_BaseObject) GetObject(const char* theEntry, bool force=true); //Adds a new object of the type theType in the OCAF document - Standard_EXPORT Handle(GEOM_BaseObject) AddBaseObject(int theDocID, int theType); + Standard_EXPORT Handle(GEOM_BaseObject) AddBaseObject(int theType); //Adds a new object of the type theType in the OCAF document - Standard_EXPORT Handle(GEOM_Object) AddObject(int theDocID, int theType); + Standard_EXPORT Handle(GEOM_Object) AddObject(int theType); //Removes the object from the OCAF document Standard_EXPORT bool RemoveObject(Handle(GEOM_BaseObject)& theObject); - //Saves the OCAF document with ID = theDocID with file with name theFileName - Standard_EXPORT bool Save(int theDocID, const char* theFileName); + //Saves the OCAF document with file with name theFileName + Standard_EXPORT bool Save(const char* theFileName); - //Loads the OCAF document into the application and assigns to it an ID = theDocID - Standard_EXPORT bool Load(int theDocID, const char* theFileName); + //Loads the OCAF document into the application + Standard_EXPORT bool Load(const char* theFileName); - //Closes the document with ID = theDocID - Standard_EXPORT void Close(int theDocID); + //Closes the document + Standard_EXPORT void Close(); //Sets the number of Undos (default value = 10) Standard_EXPORT void SetUndoLimit(int theLimit) { _UndoLimit = theLimit; } - //Applies an Undo to document with ID = theDocID - Standard_EXPORT void Undo(int theDocID); + //Applies an Undo to document + Standard_EXPORT void Undo(); - //Applies an Redo to document with ID = theDocID - Standard_EXPORT void Redo(int theDocID); + //Applies an Redo to document + Standard_EXPORT void Redo(); //Adds a new sub-shape object of the MainShape object Standard_EXPORT Handle(GEOM_Object) AddSubShape(Handle(GEOM_Object) theMainShape, Handle(TColStd_HArray1OfInteger) theIndices, bool isStandaloneOperation = false); - Standard_EXPORT TCollection_AsciiString DumpPython(int theDocID, - std::vector& theObjectData, + Standard_EXPORT TCollection_AsciiString DumpPython(std::vector& theObjectData, TVariablesList theVariables, bool isPublished, bool isMultiFile, @@ -155,15 +150,15 @@ class GEOM_Engine Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllDumpNames() const; - Standard_EXPORT int addTexture(int theDocID, int theWidth, int theHeight, + Standard_EXPORT int addTexture(int theWidth, int theHeight, const Handle(TColStd_HArray1OfByte)& theTexture, const TCollection_AsciiString& theFileName = ""); - Standard_EXPORT Handle(TColStd_HArray1OfByte) getTexture(int theDocID, int theTextureID, + Standard_EXPORT Handle(TColStd_HArray1OfByte) getTexture(int theTextureID, int& theWidth, int& theHeight, TCollection_AsciiString& theFileName); - Standard_EXPORT std::list getAllTextures(int theDocID); + Standard_EXPORT std::list getAllTextures(); static const Standard_GUID& GetTextureGUID(); @@ -171,25 +166,20 @@ class GEOM_Engine const TCollection_AsciiString& anEntry, Resource_DataMapOfAsciiStringAsciiString& aNameToEntry); - Standard_EXPORT void DocumentModified(const int theDocId, const bool isModified); - - Standard_EXPORT bool DocumentModified(const int theDocId); - protected: Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine); private: Handle(GEOM_Application) _OCAFApp; - TColStd_DataMapOfIntegerTransient _mapIDDocument; - TColStd_MapOfInteger _mapModifiedDocs; // keeps the identifiers of the modified document ids + Handle(TDocStd_Document) _document; int _UndoLimit; GEOM_DataMapOfAsciiStringTransient _objects; Resource_DataMapOfAsciiStringAsciiString _studyEntry2NameMap; - TFreeLabelsList _freeLabels; + std::list _freeLabels; }; #endif diff --git a/src/GEOM/GEOM_Field.cxx b/src/GEOM/GEOM_Field.cxx index b975e5d08..7d77da1f3 100644 --- a/src/GEOM/GEOM_Field.cxx +++ b/src/GEOM/GEOM_Field.cxx @@ -364,7 +364,7 @@ Handle(GEOM_FieldStep) GEOM_Field::AddStep(const int stepID, const int stamp) if(anEngine == NULL) return NULL; step = Handle(GEOM_FieldStep)::DownCast - ( anEngine->AddBaseObject( GetDocID(),GEOM_FIELD_STEP_OBJTYPE )); + ( anEngine->AddBaseObject( GEOM_FIELD_STEP_OBJTYPE )); if ( step.IsNull()) return step; diff --git a/src/GEOM/GEOM_IOperations.cxx b/src/GEOM/GEOM_IOperations.cxx index 66fe4791b..0ca233d0a 100644 --- a/src/GEOM/GEOM_IOperations.cxx +++ b/src/GEOM/GEOM_IOperations.cxx @@ -38,8 +38,8 @@ */ //============================================================================= -GEOM_IOperations::GEOM_IOperations(GEOM_Engine* theEngine, int theDocID) -: _engine(theEngine), _docID(theDocID) +GEOM_IOperations::GEOM_IOperations(GEOM_Engine* theEngine) +: _engine(theEngine) { _solver = new GEOM_Solver(theEngine); } @@ -64,7 +64,7 @@ GEOM_IOperations::~GEOM_IOperations() //============================================================================= void GEOM_IOperations::StartOperation() { - Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID); + Handle(TDocStd_Document) aDoc = _engine->GetDocument(); if(aDoc->GetUndoLimit() > 0) aDoc->NewCommand(); } @@ -76,10 +76,9 @@ void GEOM_IOperations::StartOperation() //============================================================================= void GEOM_IOperations::FinishOperation() { - Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID); + Handle(TDocStd_Document) aDoc = _engine->GetDocument(); if(aDoc->GetUndoLimit() > 0) aDoc->CommitCommand(); - _engine->DocumentModified(_docID, true); } //============================================================================= @@ -89,7 +88,7 @@ void GEOM_IOperations::FinishOperation() //============================================================================= void GEOM_IOperations::AbortOperation() { - Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID); + Handle(TDocStd_Document) aDoc = _engine->GetDocument(); aDoc->AbortCommand(); } diff --git a/src/GEOM/GEOM_IOperations.hxx b/src/GEOM/GEOM_IOperations.hxx index 098587a85..a4e16776e 100644 --- a/src/GEOM/GEOM_IOperations.hxx +++ b/src/GEOM/GEOM_IOperations.hxx @@ -39,7 +39,7 @@ class GEOM_IOperations { public: - Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOM_IOperations(); //Starts a new operation (opens a tansaction) @@ -73,15 +73,11 @@ class GEOM_IOperations //Return a pointer to Solver associated with this operation interface Standard_EXPORT GEOM_Solver* GetSolver() { return _solver; } - //Returns an ID of the OCAF document where this operation stores the data - Standard_EXPORT int GetDocID() { return _docID; } - private: TCollection_AsciiString _errorCode; GEOM_Engine* _engine; GEOM_Solver* _solver; - int _docID; }; diff --git a/src/GEOM/GEOM_Solver.cxx b/src/GEOM/GEOM_Solver.cxx index 2e6475362..5d6d5b212 100644 --- a/src/GEOM/GEOM_Solver.cxx +++ b/src/GEOM/GEOM_Solver.cxx @@ -34,7 +34,7 @@ * Update */ //============================================================================= -bool GEOM_Solver::Update(int theDocID, TDF_LabelSequence& theSeq) +bool GEOM_Solver::Update(TDF_LabelSequence& theSeq) { return false; } diff --git a/src/GEOM/GEOM_Solver.hxx b/src/GEOM/GEOM_Solver.hxx index 8d6b84c15..c3518ca34 100644 --- a/src/GEOM/GEOM_Solver.hxx +++ b/src/GEOM/GEOM_Solver.hxx @@ -35,9 +35,9 @@ class GEOM_Solver Standard_EXPORT GEOM_Solver(GEOM_Engine* theEngine) :_engine(theEngine) {} Standard_EXPORT ~GEOM_Solver() {} - //Update the values of all GEOM_Object in the document theDocID, theSeq will contain a list of touched labels + //Update the values of all GEOM_Object in the document, theSeq will contain a list of touched labels //Note: not Implemented - Standard_EXPORT bool Update(int theDocID, TDF_LabelSequence& theSeq); + Standard_EXPORT bool Update(TDF_LabelSequence& theSeq); //Updates a value of theObject, theSeq will contain a list of touched labels //Note: not implemented diff --git a/src/GEOMBase/GEOMBase.cxx b/src/GEOMBase/GEOMBase.cxx index 847240088..d5862ced2 100644 --- a/src/GEOMBase/GEOMBase.cxx +++ b/src/GEOMBase/GEOMBase.cxx @@ -869,8 +869,7 @@ void GEOMBase::PublishSubObject( GEOM::GEOM_Object_ptr object, const QString& na QString fatherEntry = GetEntry( father ); if ( entry.isEmpty() && !CORBA::is_nil( father ) && !fatherEntry.isEmpty() ) { QString aName = !name.isEmpty() ? name : GetName( object ); - GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ), - object, aName.toLatin1().data(), father.in() ); + GeometryGUI::GetGeomGen()->AddInStudy( object, aName.toLatin1().data(), father.in() ); } } } diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index c183e3ec6..808c58f50 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -595,12 +595,10 @@ QString GEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* t if ( !aStudy || theObj->_is_nil() ) return QString(); - SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy(aStudy); - GEOM::GEOM_Object_ptr aFatherObj = getFather( theObj ); SALOMEDS::SObject_var aSO = - getGeomEngine()->AddInStudy(aStudyDS, theObj, theName, aFatherObj); + getGeomEngine()->AddInStudy(theObj, theName, aFatherObj); QString anEntry; if ( !aSO->_is_nil() ) { @@ -609,7 +607,7 @@ QString GEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* t } // Each dialog is responsible for this method implementation, // default implementation does nothing - restoreSubShapes(aStudyDS, aSO); + restoreSubShapes(aSO); aSO->UnRegister(); return anEntry; @@ -619,15 +617,14 @@ QString GEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* t // Function : restoreSubShapes // Purpose : restore tree of argument's sub-shapes under the resulting shape //================================================================ -void GEOMBase_Helper::restoreSubShapes (SALOMEDS::Study_ptr /*theStudy*/, - SALOMEDS::SObject_ptr /*theSObject*/) +void GEOMBase_Helper::restoreSubShapes (SALOMEDS::SObject_ptr /*theSObject*/) { // do nothing by default // example of implementation in particular dialog: // GEOM::ListOfGO anArgs; // anArgs.length(0); // empty list means that all arguments should be restored - // getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + // getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs, // /*theFindMethod=*/GEOM::FSM_GetInPlace, // /*theInheritFirstArg=*/false); } @@ -643,7 +640,7 @@ void GEOMBase_Helper::updateObjBrowser() const CAM_Module* module = app->module( "Geometry" ); SalomeApp_Module* appMod = dynamic_cast( module ); if ( appMod ) { - appMod->updateObjBrowser( true ); + appMod->updateObjBrowser(); } } } @@ -657,18 +654,6 @@ void GEOMBase_Helper::updateViewer() getDisplayer()->UpdateViewer(); } -//================================================================ -// Function : getStudyId -// Purpose : Get study Id -//================================================================ -int GEOMBase_Helper::getStudyId() const -{ - int anId = -1; - if ( getStudy() ) - anId = getStudy()->id(); - return anId; -} - //================================================================ // Function : getStudy // Purpose : Returns the active study. It is recommended to use @@ -719,7 +704,7 @@ QString GEOMBase_Helper::getEntry( GEOM::GEOM_Object_ptr object ) const GEOM_Displayer* GEOMBase_Helper::getDisplayer() { if ( !myDisplayer ) - myDisplayer = new GEOM_Displayer( getStudy() ); + myDisplayer = new GEOM_Displayer(); return myDisplayer; } @@ -1365,7 +1350,7 @@ QList GEOMBase_Helper::getSelected( const QListGetIShapesOperations( getStudyId() ); + GEOM::ShapesOpPtr shapesOp = getGeomEngine()->GetIShapesOperations(); subShape.take( shapesOp->GetSubShape( object.get(), idx ) ); // take ownership! } if ( typeInList( (TopAbs_ShapeEnum)(subShape->GetShapeType()), types ) ) { diff --git a/src/GEOMBase/GEOMBase_Helper.h b/src/GEOMBase/GEOMBase_Helper.h index a62b2f129..239e28d62 100755 --- a/src/GEOMBase/GEOMBase_Helper.h +++ b/src/GEOMBase/GEOMBase_Helper.h @@ -124,7 +124,6 @@ protected: bool hasCommand () const; void updateObjBrowser() const; - int getStudyId () const; SalomeApp_Study* getStudy () const; bool checkViewWindow (); @@ -166,7 +165,7 @@ protected: // It should perform the required operation and put all new or modified objects into // argument.Should return if some error occurs during its execution. - virtual void restoreSubShapes( SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr theSObject ); // This method is called by addInStudy(). virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr theObj ); diff --git a/src/GEOMBase/GEOMBase_Skeleton.cxx b/src/GEOMBase/GEOMBase_Skeleton.cxx index 637648cac..069fe46ae 100644 --- a/src/GEOMBase/GEOMBase_Skeleton.cxx +++ b/src/GEOMBase/GEOMBase_Skeleton.cxx @@ -187,7 +187,7 @@ void GEOMBase_Skeleton::initSpinBox( SalomeApp_DoubleSpinBox* spinBox, void GEOMBase_Skeleton::updateAttributes( GEOM::GEOM_Object_ptr theObj, const QStringList& theParameters) { - SALOMEDS::Study_var aStudy = GeometryGUI::ClientStudyToStudy(getStudy()->studyDS()); + SALOMEDS::Study_var aStudy = GeometryGUI::getStudyServant(); SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(theObj->GetStudyEntry()); SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString"); diff --git a/src/GEOMGUI/GEOMGUI_DimensionProperty.cxx b/src/GEOMGUI/GEOMGUI_DimensionProperty.cxx index 95d18097d..7c3ed03b1 100644 --- a/src/GEOMGUI/GEOMGUI_DimensionProperty.cxx +++ b/src/GEOMGUI/GEOMGUI_DimensionProperty.cxx @@ -30,7 +30,7 @@ #include #include -#include +#include // Static patterns for casting value-to-string & value-from-string. The patterns are: // ITEM: { name[string] : visibility : type : values[composite] }; @@ -590,9 +590,9 @@ GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty( const GEOMGUI_DimensionPro // function : Init constructor // purpose : //================================================================================= -GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty( SalomeApp_Study* theStudy, const std::string& theEntry ) +GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty( const std::string& theEntry ) { - LoadFromAttribute( theStudy, theEntry ); + LoadFromAttribute( theEntry ); } //================================================================================= @@ -1018,18 +1018,17 @@ int GEOMGUI_DimensionProperty::GetType( const int theIndex ) const // function : LoadFromAttribute // purpose : //================================================================================= -void GEOMGUI_DimensionProperty::LoadFromAttribute( SalomeApp_Study* theStudy, - const std::string& theEntry ) +void GEOMGUI_DimensionProperty::LoadFromAttribute( const std::string& theEntry ) { Clear(); - _PTR(SObject) aSObj = theStudy->studyDS()->FindObjectID( theEntry ); + _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID( theEntry ); if ( !aSObj ) { return; } - _PTR(StudyBuilder) aBuilder = theStudy->studyDS()->NewBuilder(); + _PTR(StudyBuilder) aBuilder = SalomeApp_Application::getStudy()->NewBuilder(); _PTR(GenericAttribute) aSeekAtt; _PTR(AttributeTableOfReal) aRecordsAtt; @@ -1076,16 +1075,15 @@ void GEOMGUI_DimensionProperty::LoadFromAttribute( SalomeApp_Study* theStudy, // function : SaveToAttribute // purpose : //================================================================================= -void GEOMGUI_DimensionProperty::SaveToAttribute( SalomeApp_Study *theStudy, - const std::string &theEntry ) +void GEOMGUI_DimensionProperty::SaveToAttribute( const std::string &theEntry ) { - _PTR(SObject) aSObj = theStudy->studyDS()->FindObjectID( theEntry ); + _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID( theEntry ); if ( !aSObj ) { return; } - _PTR(StudyBuilder) aBuilder = theStudy->studyDS()->NewBuilder(); + _PTR(StudyBuilder) aBuilder = SalomeApp_Application::getStudy()->NewBuilder(); _PTR(AttributeTableOfReal) aRecordsAtt; diff --git a/src/GEOMGUI/GEOMGUI_DimensionProperty.h b/src/GEOMGUI/GEOMGUI_DimensionProperty.h index a2397968c..7b8c23622 100644 --- a/src/GEOMGUI/GEOMGUI_DimensionProperty.h +++ b/src/GEOMGUI/GEOMGUI_DimensionProperty.h @@ -329,7 +329,7 @@ public: /*! * \brief Constructor. Inits property from attribute. */ - GEOMGUI_DimensionProperty( SalomeApp_Study* theStudy, const std::string& theEntry ); + GEOMGUI_DimensionProperty( const std::string& theEntry ); /*! * \brief Constructor. Inits property from formatted QString. @@ -459,17 +459,15 @@ public: /*! * \brief Loads properties data from attribute "AttributeTableOfReal". - * \param theStudy [in] the study. * \param theEntry [in] the entry of GEOM object to operate with. */ - void LoadFromAttribute( SalomeApp_Study* theStudy, const std::string& theEntry ); + void LoadFromAttribute( const std::string& theEntry ); /*! * \brief Saves properties data to attribute "AttributeTableOfReal". - * \param theStudy [in] the study. * \param theEntry [in] the entry of GEOM object to operate with. */ - void SaveToAttribute( SalomeApp_Study* theStudy, const std::string& theEntry ); + void SaveToAttribute( const std::string& theEntry ); private: diff --git a/src/GEOMGUI/GEOMGUI_Selection.cxx b/src/GEOMGUI/GEOMGUI_Selection.cxx index 0644ff317..351bb017e 100644 --- a/src/GEOMGUI/GEOMGUI_Selection.cxx +++ b/src/GEOMGUI/GEOMGUI_Selection.cxx @@ -539,7 +539,7 @@ bool GEOMGUI_Selection::isNameMode( const int index ) const bool GEOMGUI_Selection::hasChildren( const _PTR(SObject)& obj ) { // as soon as Use Case browser data tree was added - return obj ? obj->GetStudy()->GetUseCaseBuilder()->HasChildren( obj ) : false; + return obj ? SalomeApp_Application::getStudy()->GetUseCaseBuilder()->HasChildren( obj ) : false; } bool GEOMGUI_Selection::expandable( const _PTR(SObject)& obj ) @@ -601,8 +601,8 @@ int GEOMGUI_Selection::nbChildren( const int index ) const _PTR(Study) study = appStudy->studyDS(); if ( study && !anEntry.isEmpty() ) { _PTR(SObject) aSO( study->FindObjectID( anEntry.toStdString() ) ); - if ( aSO && aSO->GetStudy()->GetUseCaseBuilder()->IsUseCaseNode(aSO) ) { - _PTR(UseCaseIterator) it = aSO->GetStudy()->GetUseCaseBuilder()->GetUseCaseIterator( aSO ); + if ( aSO && study->GetUseCaseBuilder()->IsUseCaseNode(aSO) ) { + _PTR(UseCaseIterator) it = study->GetUseCaseBuilder()->GetUseCaseIterator( aSO ); for (it->Init(false); it->More(); it->Next()) nb++; } } @@ -808,21 +808,13 @@ bool GEOMGUI_Selection::isFolder( const int index ) const bool GEOMGUI_Selection::hasDimensions( const int theIndex, bool& theHidden, bool& theVisible ) const { - SalomeApp_Study* appStudy = dynamic_cast( study() ); - - if ( !appStudy ) - { - return false; - } - QString anEntry = entry( theIndex ); - _PTR(Study) aStudy = appStudy->studyDS(); - if ( !aStudy || anEntry.isNull() ) + if ( anEntry.isNull() ) { return false; } - GEOMGUI_DimensionProperty aDimensions( appStudy, anEntry.toStdString() ); + GEOMGUI_DimensionProperty aDimensions( anEntry.toStdString() ); theHidden = false; theVisible = false; @@ -878,13 +870,13 @@ bool GEOMGUI_Selection::hasAnnotations( const int theIndex, bool& theHidden, boo if ( !aStudy || anEntry.isNull() ) return false; - _PTR(SObject) aSObj = appStudy->studyDS()->FindObjectID( anEntry.toStdString() ); + _PTR(SObject) aSObj = appStudy->studyDS()->FindObjectID( anEntry.toStdString() ); - const Handle(GEOMGUI_AnnotationAttrs) - aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj ); + const Handle(GEOMGUI_AnnotationAttrs) + aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj ); - if ( aShapeAnnotations.IsNull() ) - return false; + if ( aShapeAnnotations.IsNull() ) + return false; theHidden = false; theVisible = false; diff --git a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx index 70d754765..93181d8f9 100755 --- a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx +++ b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx @@ -61,9 +61,9 @@ namespace { public: - DimensionsProperty( SalomeApp_Study* theStudy, const std::string& theEntry ) : - myStudy( theStudy ), myEntry( theEntry ) { - myAttr.LoadFromAttribute( theStudy, theEntry ); + DimensionsProperty( const std::string& theEntry ) : + myEntry( theEntry ) { + myAttr.LoadFromAttribute( theEntry ); } virtual int GetNumber() Standard_OVERRIDE { return myAttr.GetNumber(); @@ -78,13 +78,12 @@ namespace myAttr.SetVisible( theIndex, theIsVisible ); } virtual void Save() Standard_OVERRIDE { - myAttr.SaveToAttribute( myStudy, myEntry ); + myAttr.SaveToAttribute( myEntry ); } GEOMGUI_DimensionProperty& Attr() { return myAttr; } private: GEOMGUI_DimensionProperty myAttr; - SalomeApp_Study* myStudy; std::string myEntry; }; @@ -93,10 +92,9 @@ namespace { public: - AnnotationsProperty( SalomeApp_Study* theStudy, const std::string& theEntry ) { + AnnotationsProperty( const std::string& theEntry ) { myEntry = theEntry.c_str(); - myStudy = theStudy; - _PTR(SObject) aSObj = theStudy->studyDS()->FindObjectID( theEntry ); + _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID( theEntry ); if ( aSObj ) { myAttr = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj ); } @@ -132,7 +130,7 @@ namespace protected: GEOMGUI_AnnotationMgr* annotationMgr() const { - CAM_Application* anApp = dynamic_cast(myStudy->application()); + CAM_Application* anApp = dynamic_cast(SUIT_Session::session()->activeApplication()); GeometryGUI* aModule = dynamic_cast(anApp->activeModule()); if (!aModule) { return NULL; @@ -143,7 +141,6 @@ protected: private: QString myEntry; Handle(GEOMGUI_AnnotationAttrs) myAttr; - SalomeApp_Study* myStudy; }; } @@ -156,10 +153,9 @@ private: // purpose : //================================================================================= GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app ) - : myDisplayer(NULL) { myStudy = dynamic_cast( app->activeStudy() ); - myDisplayer = GEOM_Displayer( myStudy ); + myDisplayer = GEOM_Displayer(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); myVisibleIcon = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) ); @@ -407,8 +403,8 @@ QSharedPointer { switch ( theBranchType ) { - case DimensionShape : return QSharedPointer( new DimensionsProperty( theStudy, theEntry ) ); - case AnnotationShape : return QSharedPointer( new AnnotationsProperty( theStudy, theEntry ) ); + case DimensionShape : return QSharedPointer( new DimensionsProperty( theEntry ) ); + case AnnotationShape : return QSharedPointer( new AnnotationsProperty( theEntry ) ); default: break; } return QSharedPointer(); @@ -448,7 +444,8 @@ void GEOMGUI_TextTreeWdg::onItemClicked( QTreeWidgetItem* theItem, int theColumn QSharedPointer aProp = getVisualProperty( aBranchType, myStudy, anEntry ); - CAM_Application* anApp = dynamic_cast(myStudy->application()); + SalomeApp_Application* anApp = + dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); GeometryGUI* aModule = dynamic_cast(anApp->activeModule()); if ( aProp->GetIsVisible( aDimIndex ) ) { aModule->GetAnnotationMgr()->Erase(anEntry.c_str(), aDimIndex); diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 488b426f3..5dfc36699 100755 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -463,16 +463,13 @@ static std::string getName( GEOM::GEOM_BaseObject_ptr object ) * Constructor */ //================================================================= -GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st ) +GEOM_Displayer::GEOM_Displayer() : myUpdateColorScale(true), myIsRedisplayed( false ) { - if( st ) - myApp = dynamic_cast( st->application() ); - else - myApp = 0; + SUIT_Session* session = SUIT_Session::session(); + myApp = dynamic_cast( session->activeApplication() ); /* Shading Color */ - SUIT_Session* session = SUIT_Session::session(); SUIT_ResourceMgr* resMgr = session->resourceMgr(); QColor col = resMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) ); @@ -803,7 +800,7 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap int aMgrId = !anIO.IsNull() ? getViewManagerId( myViewFrame ) : -1; // get presentation properties - PropMap propMap = getObjectProperties( study, entry, myViewFrame ); + PropMap propMap = getObjectProperties( entry, myViewFrame ); // Temporary staff: vertex must be infinite for correct visualization AISShape->SetInfiniteState( myShape.Infinite() ); // || myShape.ShapeType() == TopAbs_VERTEX // VSR: 05/04/2010: Fix 20668 (Fit All for points & lines) @@ -945,14 +942,14 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap aImagePath = GetTexture().c_str(); if ( ! entry.isEmpty() ) { // check that study is active - SalomeApp_Study* study = getActiveStudy(); + SalomeApp_Study* study = getStudy(); if ( study ) { // Store the texture in object properties for next displays study->setObjectProperty( aMgrId, entry, GEOM::propertyName( GEOM::Texture ), QString( GetTexture().c_str() ) ); study->setObjectProperty( aMgrId, entry, GEOM::propertyName( GEOM::DisplayMode ), 3 ); // Update propeties map - propMap = getObjectProperties( study, entry, myViewFrame ); + propMap = getObjectProperties( entry, myViewFrame ); } } } @@ -1010,7 +1007,7 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap int textureId = aList[0].toInt(); Standard_Integer aWidth, aHeight; Handle(TColStd_HArray1OfByte) aTexture = - GeometryGUI::getTexture( study, textureId, aWidth, aHeight ); + GeometryGUI::getTexture( textureId, aWidth, aHeight ); if ( !aTexture.IsNull() ) { Handle(Prs3d_PointAspect) aTextureAspect = new Prs3d_PointAspect( HasColor() ? @@ -1073,7 +1070,7 @@ void GEOM_Displayer::updateActorProperties( GEOM_Actor* actor, bool create ) int aMgrId = !anIO.IsNull() ? getViewManagerId( myViewFrame ) : -1; // get presentation properties - PropMap propMap = getObjectProperties( study, entry, myViewFrame ); + PropMap propMap = getObjectProperties( entry, myViewFrame ); QColor c; ///////////////////////////////////////////////////////////////////////// @@ -1287,7 +1284,7 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t } else { - aRecords.LoadFromAttribute( getStudy(), theIO->getEntry() ); + aRecords.LoadFromAttribute( theIO->getEntry() ); } // create up-to-date dimension presentations @@ -1762,49 +1759,43 @@ SALOME_Prs* GEOM_Displayer::buildPresentation( const QString& entry, // set interactive object setIO( theIO ); // Find SOBject (because shape should be published previously) - SUIT_Session* session = SUIT_Session::session(); - SUIT_Application* app = session->activeApplication(); - if ( app ) + if ( getStudy() ) { - SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); - if ( study ) + _PTR(SObject) SO ( getStudy()->studyDS()->FindObjectID( theIO->getEntry() ) ); + if ( SO ) { - _PTR(SObject) SO ( study->studyDS()->FindObjectID( theIO->getEntry() ) ); - if ( SO ) + // get CORBA reference to data object + CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO); + if ( !CORBA::is_nil( object ) ) { - // get CORBA reference to data object - CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO); - if ( !CORBA::is_nil( object ) ) + // downcast to GEOM base object + GEOM::GEOM_BaseObject_var GeomBaseObject = GEOM::GEOM_BaseObject::_narrow( object ); + if ( !GeomBaseObject->_is_nil() ) { - // downcast to GEOM base object - GEOM::GEOM_BaseObject_var GeomBaseObject = GEOM::GEOM_BaseObject::_narrow( object ); - if ( !GeomBaseObject->_is_nil() ) - { - myType = GeomBaseObject->GetType(); + myType = GeomBaseObject->GetType(); - // downcast to GEOM object - GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject ); - if ( myType == GEOM_FIELD_STEP ) + // downcast to GEOM object + GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject ); + if ( myType == GEOM_FIELD_STEP ) + { + // get the GEOM object from the field's shape + GEOM::GEOM_FieldStep_var GeomFieldStep = GEOM::GEOM_FieldStep::_narrow( GeomBaseObject ); + if ( !GeomFieldStep->_is_nil() ) { - // get the GEOM object from the field's shape - GEOM::GEOM_FieldStep_var GeomFieldStep = GEOM::GEOM_FieldStep::_narrow( GeomBaseObject ); - if ( !GeomFieldStep->_is_nil() ) - { - GEOM::GEOM_Field_var GeomField = GeomFieldStep->GetField(); - if ( !GeomField->_is_nil() ) - GeomObject = GeomField->GetShape(); - } - - // read the field step information - readFieldStepInfo( GeomFieldStep ); + GEOM::GEOM_Field_var GeomField = GeomFieldStep->GetField(); + if ( !GeomField->_is_nil() ) + GeomObject = GeomField->GetShape(); } - if ( !GeomObject->_is_nil() ) - { - theIO->setName( GeomObject->GetName() ); - // finally set shape - setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) ); - } + // read the field step information + readFieldStepInfo( GeomFieldStep ); + } + + if ( !GeomObject->_is_nil() ) + { + theIO->setName( GeomObject->GetName() ); + // finally set shape + setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) ); } } } @@ -2504,21 +2495,20 @@ SALOMEDS::Color GEOM_Displayer::getUniqueColor( const QList& th return aSColor; } -PropMap GEOM_Displayer::getObjectProperties( SalomeApp_Study* study, - const QString& entry, +PropMap GEOM_Displayer::getObjectProperties( const QString& entry, SALOME_View* view ) { // get default properties for the explicitly specified default view type PropMap propMap = GEOM_Displayer::getDefaultPropertyMap(); - if ( study && view ) { + if ( getStudy() && view ) { SUIT_ViewModel* viewModel = dynamic_cast( view ); SUIT_ViewManager* viewMgr = ( viewModel != 0 ) ? viewModel->getViewManager() : 0; int viewId = ( viewMgr != 0 ) ? viewMgr->getGlobalId() : -1; if ( viewModel && viewId != -1 ) { // get properties from the study - PropMap storedMap = study->getObjectProperties( viewId, entry ); + PropMap storedMap = getStudy()->getObjectProperties( viewId, entry ); // overwrite default properties from stored ones (that are specified) for ( int prop = GEOM::Visibility; prop <= GEOM::LastProperty; prop++ ) { if ( storedMap.contains( GEOM::propertyName( (GEOM::Property)prop ) ) ) @@ -2538,7 +2528,7 @@ PropMap GEOM_Displayer::getObjectProperties( SalomeApp_Study* study, if ( !entry.isEmpty() ) { // get CORBA reference to geom object - _PTR(SObject) SO( study->studyDS()->FindObjectID( entry.toStdString() ) ); + _PTR(SObject) SO( getStudy()->studyDS()->FindObjectID( entry.toStdString() ) ); if ( SO ) { CORBA::Object_var object = GeometryGUI::ClientSObjectToObject( SO ); if ( !CORBA::is_nil( object ) ) { @@ -2736,16 +2726,9 @@ SALOMEDS::Color GEOM_Displayer::getColor(GEOM::GEOM_Object_var theGeomObject, bo void GEOM_Displayer::EraseWithChildren(const Handle(SALOME_InteractiveObject)& theIO, - const bool eraseOnlyChildren) { - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - if ( !app ) - return; - - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - if ( !appStudy ) - return; - - LightApp_DataObject* parent = appStudy->findObjectByEntry(theIO->getEntry()); + const bool eraseOnlyChildren) +{ + LightApp_DataObject* parent = getStudy()->findObjectByEntry(theIO->getEntry()); if( !parent) return; @@ -2753,7 +2736,7 @@ void GEOM_Displayer::EraseWithChildren(const Handle(SALOME_InteractiveObject)& t // Erase from all views QList views; SALOME_View* view; - ViewManagerList vmans = app->viewManagers(); + ViewManagerList vmans = myApp->viewManagers(); SUIT_ViewManager* vman; foreach ( vman, vmans ) { SUIT_ViewModel* vmod = vman->getViewModel(); @@ -3025,10 +3008,6 @@ Standard_Boolean GEOM_Displayer::FindColor( const Standard_Real aValue, void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, const bool updateViewer ) { - SalomeApp_Study* aStudy = dynamic_cast( myApp->activeStudy() ); - if( !aStudy ) - return; - SOCC_Viewer* aViewModel = dynamic_cast( GetActiveView() ); if( !aViewModel ) return; @@ -3146,14 +3125,14 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, cons if( theIsRedisplayFieldSteps ) { - _PTR(Study) aStudyDS = aStudy->studyDS(); + _PTR(Study) aStudyDS = getStudy()->studyDS(); QList vmList; myApp->viewManagers( vmList ); for( QList::Iterator vmIt = vmList.begin(); vmIt != vmList.end(); vmIt++ ) { if( SUIT_ViewManager* aViewManager = *vmIt ) { - const ObjMap& anObjects = aStudy->getObjectProperties( aViewManager->getGlobalId() ); + const ObjMap& anObjects = getStudy()->getObjectProperties( aViewManager->getGlobalId() ); for( ObjMap::ConstIterator objIt = anObjects.begin(); objIt != anObjects.end(); objIt++ ) { _PTR(SObject) aSObj( aStudyDS->FindObjectID( objIt.key().toLatin1().constData() ) ); diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index c7c6d879b..93f83cedb 100755 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -76,7 +76,7 @@ class GEOMGUI_EXPORT GEOM_Displayer : public LightApp_Displayer public: /* Constructor */ - GEOM_Displayer( SalomeApp_Study* app ); + GEOM_Displayer(); /* Destructor */ virtual ~GEOM_Displayer(); @@ -266,7 +266,7 @@ protected: void updateDimensions( const Handle(SALOME_InteractiveObject)&, SALOME_OCCPrs*, const gp_Ax3& ); void updateShapeAnnotations( const Handle(SALOME_InteractiveObject)&, SALOME_OCCPrs*, const gp_Ax3& ); - PropMap getObjectProperties( SalomeApp_Study*, const QString&, SALOME_View* = 0 ); + PropMap getObjectProperties( const QString&, SALOME_View* = 0 ); PropMap getDefaultPropertyMap(); /* Methods for reading the field step information */ diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index c15469dea..e233923f6 100755 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -139,7 +139,7 @@ extern "C" { } } -GeometryGUI::StudyTextureMap GeometryGUI::myTextureMap; +GeometryGUI::TextureMap GeometryGUI::myTextureMap; GEOM::GEOM_Gen_var GeometryGUI::myComponentGeom = GEOM::GEOM_Gen::_nil(); @@ -179,17 +179,15 @@ CORBA::Object_var GeometryGUI::ClientSObjectToObject (_PTR(SObject) theSObject) } //======================================================================= -// function : ClientStudyToStudy +// function : GetStudy // purpose : //======================================================================= -SALOMEDS::Study_var GeometryGUI::ClientStudyToStudy (_PTR(Study) theStudy) +SALOMEDS::Study_var GeometryGUI::getStudyServant() { SALOME_NamingService *aNamingService = SalomeApp_Application::namingService(); - CORBA::Object_var aSMObject = aNamingService->Resolve("/myStudyManager"); - SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject); - int aStudyID = theStudy->StudyId(); - SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID(aStudyID); - return aDSStudy._retn(); + CORBA::Object_var aStudyObject = aNamingService->Resolve("/Study"); + SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(aStudyObject); + return aStudy._retn(); } void GeometryGUI::Modified (bool theIsUpdateActions) @@ -927,9 +925,8 @@ void GeometryGUI::createOriginAndBaseVectors() return; } if ( appStudy ) { - _PTR(Study) studyDS = appStudy->studyDS(); - if ( studyDS && !CORBA::is_nil( GetGeomGen() ) ) { - GEOM::GEOM_IBasicOperations_var aBasicOperations = GetGeomGen()->GetIBasicOperations( studyDS->StudyId() ); + if ( !CORBA::is_nil( GetGeomGen() ) ) { + GEOM::GEOM_IBasicOperations_var aBasicOperations = GetGeomGen()->GetIBasicOperations(); if ( !aBasicOperations->_is_nil() ) { SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); double aLength = aResourceMgr->doubleValue( "Geometry", "base_vectors_length", 1.0 ); @@ -938,11 +935,10 @@ void GeometryGUI::createOriginAndBaseVectors() GEOM::GEOM_Object_var anOY = aBasicOperations->MakeVectorDXDYDZ( 0.0, aLength, 0.0 ); GEOM::GEOM_Object_var anOZ = aBasicOperations->MakeVectorDXDYDZ( 0.0, 0.0, aLength ); - SALOMEDS::Study_var aDSStudy = ClientStudyToStudy( studyDS ); - GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOrigin, "O" ); - GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOX, "OX" ); - GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOY, "OY" ); - GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOZ, "OZ" ); + GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), anOrigin, "O" ); + GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), anOX, "OX" ); + GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), anOY, "OY" ); + GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), anOZ, "OZ" ); anOrigin->UnRegister(); anOX->UnRegister(); anOY->UnRegister(); @@ -2168,7 +2164,7 @@ void GeometryGUI::onAutoBringToFront() SalomeApp_Study* appStudy = dynamic_cast< SalomeApp_Study* >( getApp()->activeStudy() ); if (!appStudy) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -2211,11 +2207,8 @@ void GeometryGUI::onAutoBringToFront() void GeometryGUI::updateFieldColorScale() { - if( SalomeApp_Study* aStudy = dynamic_cast( getApp()->activeStudy() ) ) - { - GEOM_Displayer aDisplayer( aStudy ); - aDisplayer.UpdateColorScale(); - } + GEOM_Displayer aDisplayer; + aDisplayer.UpdateColorScale(); } QString GeometryGUI::engineIOR() const @@ -2225,31 +2218,27 @@ QString GeometryGUI::engineIOR() const return ""; } -Handle(TColStd_HArray1OfByte) GeometryGUI::getTexture - (SalomeApp_Study* theStudy, int theId, int& theWidth, int& theHeight) +Handle(TColStd_HArray1OfByte) GeometryGUI::getTexture (int theId, int& theWidth, int& theHeight) { theWidth = theHeight = 0; Handle(TColStd_HArray1OfByte) aTexture; - if (theStudy) { - TextureMap aTextureMap = myTextureMap[ theStudy->studyDS()->StudyId() ]; - aTexture = aTextureMap[ theId ]; - if ( aTexture.IsNull() ) { - GEOM::GEOM_IInsertOperations_var aInsOp = GeometryGUI::GetGeomGen()->GetIInsertOperations( theStudy->studyDS()->StudyId() ); - if ( !aInsOp->_is_nil() ) { - CORBA::Long aWidth, aHeight; - SALOMEDS::TMPFile_var aStream = aInsOp->GetTexture( theId, aWidth, aHeight ); - if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) { - theWidth = aWidth; - theHeight = aHeight; - - aTexture = new TColStd_HArray1OfByte (1, aStream->length()); - - for ( CORBA::ULong i = 0; i < aStream->length(); i++) - aTexture->SetValue( i+1, (Standard_Byte)aStream[i] ); - aTextureMap[ theId ] = aTexture; - } + aTexture = myTextureMap[ theId ]; + if ( aTexture.IsNull() ) { + GEOM::GEOM_IInsertOperations_var aInsOp = GeometryGUI::GetGeomGen()->GetIInsertOperations(); + if ( !aInsOp->_is_nil() ) { + CORBA::Long aWidth, aHeight; + SALOMEDS::TMPFile_var aStream = aInsOp->GetTexture( theId, aWidth, aHeight ); + if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) { + theWidth = aWidth; + theHeight = aHeight; + + aTexture = new TColStd_HArray1OfByte (1, aStream->length()); + + for ( CORBA::ULong i = 0; i < aStream->length(); i++) + aTexture->SetValue( i+1, (Standard_Byte)aStream[i] ); + myTextureMap[ theId ] = aTexture; } } } @@ -2817,12 +2806,9 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par param == QString("scalar_bar_height") || param == QString("scalar_bar_text_height") || param == QString("scalar_bar_nb_intervals")) { - if( SalomeApp_Study* aStudy = dynamic_cast( getApp()->activeStudy() ) ) - { - GEOM_Displayer aDisplayer( aStudy ); - bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals"); - aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true ); - } + GEOM_Displayer aDisplayer; + bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals"); + aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true ); } else if ( param == QString("dimensions_color") || param == QString("dimensions_line_width") || @@ -2847,13 +2833,7 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par return; } - SalomeApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); - if ( !aStudy ) - { - return; - } - - GEOM_Displayer aDisplayer( aStudy ); + GEOM_Displayer aDisplayer; ViewManagerList aVMs; anApp->viewManagers( OCCViewer_Viewer::Type(), aVMs ); @@ -2910,7 +2890,7 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par LightApp_Displayer* GeometryGUI::displayer() { if ( !myDisplayer ) - myDisplayer = new GEOM_Displayer( dynamic_cast( getApp()->activeStudy() ) ); + myDisplayer = new GEOM_Displayer(); return myDisplayer; } @@ -3113,7 +3093,7 @@ void GeometryGUI::storeVisualParameters (int savePoint) std::string aStoreEntry = ip->encodeEntry( aStudyEntry, componentName ); // store dimension parameters - GEOMGUI_DimensionProperty aDimensions( appStudy, aStudyEntry ); + GEOMGUI_DimensionProperty aDimensions( aStudyEntry ); if ( aDimensions.GetNumber() != 0 ) { ip->setParameter( aStoreEntry, aDimensionParam.toStdString(), ((QString)aDimensions).toLatin1().data() ); } @@ -3203,7 +3183,7 @@ void GeometryGUI::restoreVisualParameters (int savePoint) if ( aParamNameStr == GEOM::propertyName( GEOM::Dimensions ) ) { GEOMGUI_DimensionProperty aDimensionProp( aValuesStr ); - aDimensionProp.SaveToAttribute( appStudy, entry.toLatin1().data() ); + aDimensionProp.SaveToAttribute( entry.toLatin1().data() ); } else if ( aParamNameStr == GEOM::propertyName( GEOM::ShapeAnnotations ) ) { @@ -3327,7 +3307,7 @@ void UpdateNameMode( SalomeApp_Application* app ) bool isMode = false; SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() ); SUIT_ViewWindow* viewWindow = app->desktop()->activeWindow(); - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; int aMgrId = viewWindow->getViewManager()->getGlobalId(); SALOME_View* window = displayer.GetActiveView(); @@ -3430,12 +3410,14 @@ void GeometryGUI::ClearShapeBuffer( GEOM::GEOM_Object_ptr theObj ) TCollection_AsciiString asciiIOR( (char *)IOR.in() ); GEOM_Client::get_client().RemoveShapeFromBuffer( asciiIOR ); - SALOMEDSClient_StudyManager *aManager = SalomeApp_Application::studyMgr(); + SalomeApp_Application* app = + dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication()); + SalomeApp_Study* appStudy = app ? dynamic_cast( app->activeStudy() ) : 0; - if (!aManager) + if (!appStudy) return; - _PTR(Study) aStudy = aManager->GetStudyByID(theObj->GetStudyID()); + _PTR(Study) aStudy = appStudy->studyDS(); if ( !aStudy ) return; @@ -3602,7 +3584,7 @@ bool GeometryGUI::isDraggable( const SUIT_DataObject* what ) const _PTR(SObject) aSO = dataObj->object(); if ( aSO ) { _PTR(GenericAttribute) anAttr; - _PTR(SObject) aFatherSO = aSO->GetStudy()->GetUseCaseBuilder()->GetFather( aSO ); + _PTR(SObject) aFatherSO = SalomeApp_Application::getStudy()->GetUseCaseBuilder()->GetFather( aSO ); if ( aFatherSO && aFatherSO->FindAttribute(anAttr, "AttributeLocalID") ) { _PTR(AttributeLocalID) aLocalID( anAttr ); anObjectInFolder = aLocalID->Value() == 999; @@ -3679,7 +3661,7 @@ void GeometryGUI::dropObjects( const DataObjectList& what, SUIT_DataObject* wher _PTR(SObject) parentObj = dataObj->object(); // Find the current Study and StudyBuilder - _PTR(Study) aStudy = parentObj->GetStudy(); + _PTR(Study) aStudy = SalomeApp_Application::getStudy(); _PTR(UseCaseBuilder) aUseCaseBuilder = aStudy->GetUseCaseBuilder(); // collect all parents of the target node QStringList parentIDs; diff --git a/src/GEOMGUI/GeometryGUI.h b/src/GEOMGUI/GeometryGUI.h index 78a067a67..b5a2a25ba 100644 --- a/src/GEOMGUI/GeometryGUI.h +++ b/src/GEOMGUI/GeometryGUI.h @@ -87,14 +87,14 @@ public: virtual void initialize( CAM_Application* ); virtual QString engineIOR() const; - static Handle(TColStd_HArray1OfByte) getTexture (SalomeApp_Study*, int, int&, int&); + static Handle(TColStd_HArray1OfByte) getTexture (int, int&, int&); static bool InitGeomGen(); static GEOM::GEOM_Gen_var GetGeomGen(); static CORBA::Object_var ClientSObjectToObject (_PTR(SObject) theSObject); - static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy); + static SALOMEDS::Study_var getStudyServant(); static void Modified( bool = true ); @@ -215,32 +215,31 @@ private: typedef QMap TextureMap; - typedef QMap StudyTextureMap; typedef QMap GUIMap; typedef QPair PluginAction; - GUIMap myGUIMap; // GUI libraries map - QDialog* myActiveDialogBox; // active dialog box - gp_Ax3 myWorkingPlane; - //QMap myRules; // popup rules - static StudyTextureMap myTextureMap; // texture map + GUIMap myGUIMap; // GUI libraries map + QDialog* myActiveDialogBox; // active dialog box + gp_Ax3 myWorkingPlane; + //QMap myRules; // popup rules + static TextureMap myTextureMap; // texture map - QMap myPluginActions; // plugin actions - QMap myPluginLibs; // plugin name to plugin client library + QMap myPluginActions; // plugin actions + QMap myPluginLibs; // plugin name to plugin client library QList myOCCSelectors; QList myVTKSelectors; - LightApp_Displayer* myDisplayer; - int myLocalSelectionMode; //Select Only + LightApp_Displayer* myDisplayer; + int myLocalSelectionMode; //Select Only - GEOMGUI_CreationInfoWdg* myCreationInfoWdg; + GEOMGUI_CreationInfoWdg* myCreationInfoWdg; GEOMGUI_TextTreeWdg* myTextTreeWdg; GEOMGUI_AnnotationMgr* myAnnotationMgr; - SALOME_ListIO myTopLevelIOList; + SALOME_ListIO myTopLevelIOList; friend class DisplayGUI; }; diff --git a/src/GEOMImpl/GEOMImpl_ExportDriver.cxx b/src/GEOMImpl/GEOMImpl_ExportDriver.cxx index 2ee22d9d9..5e089e578 100644 --- a/src/GEOMImpl/GEOMImpl_ExportDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ExportDriver.cxx @@ -85,7 +85,7 @@ Standard_Integer GEOMImpl_ExportDriver::Execute(LOGBOOK& log) const if (aFileName.IsEmpty() || aFormatName.IsEmpty() || aLibName.IsEmpty()) return 0; - if( !GEOMImpl_IECallBack::GetCallBack( aFormatName )->Export( GetDocID(), obj, aFileName, aFormatName ) ); + if( !GEOMImpl_IECallBack::GetCallBack( aFormatName )->Export( obj, aFileName, aFormatName ) ); return 0; #if OCC_VERSION_MAJOR < 7 diff --git a/src/GEOMImpl/GEOMImpl_Gen.cxx b/src/GEOMImpl/GEOMImpl_Gen.cxx index d3a54575d..eb91f194e 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.cxx +++ b/src/GEOMImpl/GEOMImpl_Gen.cxx @@ -93,7 +93,6 @@ GEOMImpl_Gen::GEOMImpl_Gen() { MESSAGE("GEOMImpl_Gen::GEOMImpl_Gen"); - _mapOfBasicOperations.clear(); // Basic elements TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PointDriver::GetID(), new GEOMImpl_PointDriver()); @@ -170,6 +169,20 @@ GEOMImpl_Gen::GEOMImpl_Gen() /*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/ SetEngine(this); + + _BasicOperations = new GEOMImpl_IBasicOperations( this ); + _TransformOperations = new GEOMImpl_ITransformOperations( this ); + _3DPrimOperations = new GEOMImpl_I3DPrimOperations( this ); + _ShapesOperations = new GEOMImpl_IShapesOperations( this ); + _BlocksOperations = new GEOMImpl_IBlocksOperations( this ); + _BooleanOperations = new GEOMImpl_IBooleanOperations( this ); + _HealingOperations = new GEOMImpl_IHealingOperations( this ); + _CurvesOperations = new GEOMImpl_ICurvesOperations( this ); + _LocalOperations = new GEOMImpl_ILocalOperations( this ); + _InsertOperations = new GEOMImpl_IInsertOperations( this ); + _MeasureOperations = new GEOMImpl_IMeasureOperations( this ); + _GroupOperations = new GEOMImpl_IGroupOperations( this ); + _FieldOperations = new GEOMImpl_IFieldOperations( this ); } //============================================================================= @@ -182,57 +195,19 @@ GEOMImpl_Gen::~GEOMImpl_Gen() { MESSAGE("GEOMImpl_Gen::~GEOMImpl_Gen"); - std::map::iterator aBasicIter = _mapOfBasicOperations.begin(); - for (; aBasicIter != _mapOfBasicOperations.end(); aBasicIter++) - delete (*aBasicIter).second; - - std::map::iterator aTransformIter = _mapOfTransformOperations.begin(); - for (; aTransformIter != _mapOfTransformOperations.end(); aTransformIter++) - delete (*aTransformIter).second; - - std::map::iterator a3DPrimIter = _mapOf3DPrimOperations.begin(); - for (; a3DPrimIter != _mapOf3DPrimOperations.end(); a3DPrimIter++) - delete (*a3DPrimIter).second; - - std::map::iterator aShapesIter = _mapOfShapesOperations.begin(); - for (; aShapesIter != _mapOfShapesOperations.end(); aShapesIter++) - delete (*aShapesIter).second; - - std::map::iterator aBlocksIter = _mapOfBlocksOperations.begin(); - for (; aBlocksIter != _mapOfBlocksOperations.end(); aBlocksIter++) - delete (*aBlocksIter).second; - - std::map::iterator aBooleanIter = _mapOfBooleanOperations.begin(); - for (; aBooleanIter != _mapOfBooleanOperations.end(); aBooleanIter++) - delete (*aBooleanIter).second; - - std::map::iterator aHealingIter = _mapOfHealingOperations.begin(); - for (; aHealingIter != _mapOfHealingOperations.end(); aHealingIter++) - delete (*aHealingIter).second; - - std::map::iterator aCurvesIter = _mapOfCurvesOperations.begin(); - for (; aCurvesIter != _mapOfCurvesOperations.end(); aCurvesIter++) - delete (*aCurvesIter).second; - - std::map::iterator aLocalIter = _mapOfLocalOperations.begin(); - for (; aLocalIter != _mapOfLocalOperations.end(); aLocalIter++) - delete (*aLocalIter).second; - - std::map::iterator aInsertIter = _mapOfInsertOperations.begin(); - for (; aInsertIter != _mapOfInsertOperations.end(); aInsertIter++) - delete (*aInsertIter).second; - - std::map::iterator aMeasureIter = _mapOfMeasureOperations.begin(); - for (; aMeasureIter != _mapOfMeasureOperations.end(); aMeasureIter++) - delete (*aMeasureIter).second; - - std::map::iterator aGroupIter = _mapOfGroupOperations.begin(); - for (; aGroupIter != _mapOfGroupOperations.end(); aGroupIter++) - delete (*aGroupIter).second; - - std::map::iterator aFieldIter = _mapOfFieldOperations.begin(); - for (; aFieldIter != _mapOfFieldOperations.end(); aFieldIter++) - delete (*aFieldIter).second; + delete _BasicOperations; + delete _TransformOperations; + delete _3DPrimOperations; + delete _ShapesOperations; + delete _BlocksOperations; + delete _BooleanOperations; + delete _HealingOperations; + delete _CurvesOperations; + delete _LocalOperations; + delete _InsertOperations; + delete _MeasureOperations; + delete _GroupOperations; + delete _FieldOperations; } //============================================================================= @@ -240,13 +215,9 @@ GEOMImpl_Gen::~GEOMImpl_Gen() * GetIBasicOperations */ //============================================================================= -GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations(int theDocID) +GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations() { - if(_mapOfBasicOperations.find(theDocID) == _mapOfBasicOperations.end()) { - _mapOfBasicOperations[theDocID] = new GEOMImpl_IBasicOperations(this, theDocID); - } - - return _mapOfBasicOperations[theDocID]; + return _BasicOperations; } //============================================================================= @@ -254,13 +225,9 @@ GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations(int theDocID) * GetITransformOperations */ //============================================================================= -GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations(int theDocID) +GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations() { - if(_mapOfTransformOperations.find(theDocID) == _mapOfTransformOperations.end()) { - _mapOfTransformOperations[theDocID] = new GEOMImpl_ITransformOperations(this, theDocID); - } - - return _mapOfTransformOperations[theDocID]; + return _TransformOperations; } //============================================================================= @@ -268,13 +235,9 @@ GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations(int theDocI * GetIBooleanOperations */ //============================================================================= -GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations(int theDocID) +GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations() { - if(_mapOfBooleanOperations.find(theDocID) == _mapOfBooleanOperations.end()) { - _mapOfBooleanOperations[theDocID] = new GEOMImpl_IBooleanOperations(this, theDocID); - } - - return _mapOfBooleanOperations[theDocID]; + return _BooleanOperations; } //============================================================================= @@ -282,13 +245,9 @@ GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations(int theDocID) * GetIHealingOperations */ //============================================================================= -GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations(int theDocID) +GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations() { - if(_mapOfHealingOperations.find(theDocID) == _mapOfHealingOperations.end()) { - _mapOfHealingOperations[theDocID] = new GEOMImpl_IHealingOperations(this, theDocID); - } - - return _mapOfHealingOperations[theDocID]; + return _HealingOperations; } //============================================================================= @@ -296,13 +255,9 @@ GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations(int theDocID) * GetI3DPrimOperations */ //============================================================================= -GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations(int theDocID) +GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations() { - if(_mapOf3DPrimOperations.find(theDocID) == _mapOf3DPrimOperations.end()) { - _mapOf3DPrimOperations[theDocID] = new GEOMImpl_I3DPrimOperations(this, theDocID); - } - - return _mapOf3DPrimOperations[theDocID]; + return _3DPrimOperations; } //============================================================================= @@ -310,13 +265,9 @@ GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations(int theDocID) * GetIShapesOperations */ //============================================================================= -GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations(int theDocID) +GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations() { - if(_mapOfShapesOperations.find(theDocID) == _mapOfShapesOperations.end()) { - _mapOfShapesOperations[theDocID] = new GEOMImpl_IShapesOperations(this, theDocID); - } - - return _mapOfShapesOperations[theDocID]; + return _ShapesOperations; } //============================================================================= @@ -324,13 +275,9 @@ GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations(int theDocID) * GetIBlocksOperations */ //============================================================================= -GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations(int theDocID) +GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations() { - if(_mapOfBlocksOperations.find(theDocID) == _mapOfBlocksOperations.end()) { - _mapOfBlocksOperations[theDocID] = new GEOMImpl_IBlocksOperations(this, theDocID); - } - - return _mapOfBlocksOperations[theDocID]; + return _BlocksOperations; } //============================================================================= @@ -338,13 +285,9 @@ GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations(int theDocID) * GetICurvesOperations */ //============================================================================= -GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations(int theDocID) +GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations() { - if(_mapOfCurvesOperations.find(theDocID) == _mapOfCurvesOperations.end()) { - _mapOfCurvesOperations[theDocID] = new GEOMImpl_ICurvesOperations(this, theDocID); - } - - return _mapOfCurvesOperations[theDocID]; + return _CurvesOperations; } //============================================================================= @@ -352,13 +295,9 @@ GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations(int theDocID) * GetILocalOperations */ //============================================================================= -GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations(int theDocID) +GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations() { - if(_mapOfLocalOperations.find(theDocID) == _mapOfLocalOperations.end()) { - _mapOfLocalOperations[theDocID] = new GEOMImpl_ILocalOperations(this, theDocID); - } - - return _mapOfLocalOperations[theDocID]; + return _LocalOperations; } //============================================================================= @@ -366,13 +305,9 @@ GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations(int theDocID) * GetIInsertOperations */ //============================================================================= -GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations(int theDocID) +GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations() { - if(_mapOfInsertOperations.find(theDocID) == _mapOfInsertOperations.end()) { - _mapOfInsertOperations[theDocID] = new GEOMImpl_IInsertOperations(this, theDocID); - } - - return _mapOfInsertOperations[theDocID]; + return _InsertOperations; } //============================================================================= @@ -380,13 +315,9 @@ GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations(int theDocID) * GetIMeasureOperations */ //============================================================================= -GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations(int theDocID) +GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations() { - if(_mapOfMeasureOperations.find(theDocID) == _mapOfMeasureOperations.end()) { - _mapOfMeasureOperations[theDocID] = new GEOMImpl_IMeasureOperations(this, theDocID); - } - - return _mapOfMeasureOperations[theDocID]; + return _MeasureOperations; } //============================================================================= @@ -394,13 +325,9 @@ GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations(int theDocID) * GetIGroupOperations */ //============================================================================= -GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations(int theDocID) +GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations() { - if(_mapOfGroupOperations.find(theDocID) == _mapOfGroupOperations.end()) { - _mapOfGroupOperations[theDocID] = new GEOMImpl_IGroupOperations(this, theDocID); - } - - return _mapOfGroupOperations[theDocID]; + return _GroupOperations; } //============================================================================= @@ -408,11 +335,7 @@ GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations(int theDocID) * GetIFieldOperations */ //============================================================================= -GEOMImpl_IFieldOperations* GEOMImpl_Gen::GetIFieldOperations(int theDocID) +GEOMImpl_IFieldOperations* GEOMImpl_Gen::GetIFieldOperations() { - if(_mapOfFieldOperations.find(theDocID) == _mapOfFieldOperations.end()) { - _mapOfFieldOperations[theDocID] = new GEOMImpl_IFieldOperations(this, theDocID); - } - - return _mapOfFieldOperations[theDocID]; + return _FieldOperations; } diff --git a/src/GEOMImpl/GEOMImpl_Gen.hxx b/src/GEOMImpl/GEOMImpl_Gen.hxx index a6ba04777..48b1463cc 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.hxx +++ b/src/GEOMImpl/GEOMImpl_Gen.hxx @@ -48,47 +48,47 @@ class GEOMIMPL_EXPORT GEOMImpl_Gen : public GEOM_Engine GEOMImpl_Gen(); ~GEOMImpl_Gen(); - GEOMImpl_IBasicOperations* GetIBasicOperations(int theDocID); + GEOMImpl_IBasicOperations* GetIBasicOperations(); - GEOMImpl_ITransformOperations* GetITransformOperations(int theDocID); + GEOMImpl_ITransformOperations* GetITransformOperations(); - GEOMImpl_I3DPrimOperations* GetI3DPrimOperations(int theDocID); + GEOMImpl_I3DPrimOperations* GetI3DPrimOperations(); - GEOMImpl_IShapesOperations* GetIShapesOperations(int theDocID); + GEOMImpl_IShapesOperations* GetIShapesOperations(); - GEOMImpl_IBlocksOperations* GetIBlocksOperations(int theDocID); + GEOMImpl_IBlocksOperations* GetIBlocksOperations(); - GEOMImpl_IMeasureOperations* GetIMeasureOperations(int theDocID); + GEOMImpl_IMeasureOperations* GetIMeasureOperations(); - GEOMImpl_IBooleanOperations* GetIBooleanOperations(int theDocID); + GEOMImpl_IBooleanOperations* GetIBooleanOperations(); - GEOMImpl_ICurvesOperations* GetICurvesOperations(int theDocID); + GEOMImpl_ICurvesOperations* GetICurvesOperations(); - GEOMImpl_ILocalOperations* GetILocalOperations(int theDocID); + GEOMImpl_ILocalOperations* GetILocalOperations(); - GEOMImpl_IInsertOperations* GetIInsertOperations(int theDocID); + GEOMImpl_IInsertOperations* GetIInsertOperations(); - GEOMImpl_IHealingOperations* GetIHealingOperations(int theDocID); + GEOMImpl_IHealingOperations* GetIHealingOperations(); - GEOMImpl_IGroupOperations* GetIGroupOperations(int theDocID); + GEOMImpl_IGroupOperations* GetIGroupOperations(); - GEOMImpl_IFieldOperations* GetIFieldOperations(int theDocID); + GEOMImpl_IFieldOperations* GetIFieldOperations(); private: - std::map _mapOfBasicOperations; - std::map _mapOfTransformOperations; - std::map _mapOf3DPrimOperations; - std::map _mapOfShapesOperations; - std::map _mapOfBlocksOperations; - std::map _mapOfBooleanOperations; - std::map _mapOfHealingOperations; - std::map _mapOfCurvesOperations; - std::map _mapOfLocalOperations; - std::map _mapOfInsertOperations; - std::map _mapOfMeasureOperations; - std::map _mapOfGroupOperations; - std::map _mapOfFieldOperations; + GEOMImpl_IBasicOperations* _BasicOperations; + GEOMImpl_ITransformOperations* _TransformOperations; + GEOMImpl_I3DPrimOperations* _3DPrimOperations; + GEOMImpl_IShapesOperations* _ShapesOperations; + GEOMImpl_IBlocksOperations* _BlocksOperations; + GEOMImpl_IBooleanOperations* _BooleanOperations; + GEOMImpl_IHealingOperations* _HealingOperations; + GEOMImpl_ICurvesOperations* _CurvesOperations; + GEOMImpl_ILocalOperations* _LocalOperations; + GEOMImpl_IInsertOperations* _InsertOperations; + GEOMImpl_IMeasureOperations* _MeasureOperations; + GEOMImpl_IGroupOperations* _GroupOperations; + GEOMImpl_IFieldOperations* _FieldOperations; }; #endif diff --git a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx index ba87e9c4f..c94446895 100644 --- a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx @@ -85,11 +85,11 @@ * constructor: */ //============================================================================= -GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations"); - myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID()); + myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine()); } //============================================================================= @@ -114,7 +114,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxDXDYDZ (double theDX, dou SetErrorCode(KO); //Add a new Box object - Handle(GEOM_Object) aBox = GetEngine()->AddObject(GetDocID(), GEOM_BOX); + Handle(GEOM_Object) aBox = GetEngine()->AddObject(GEOM_BOX); //Add a new Box function with DX_DY_DZ parameters Handle(GEOM_Function) aFunction = aBox->AddFunction(GEOMImpl_BoxDriver::GetID(), BOX_DX_DY_DZ); @@ -165,7 +165,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxTwoPnt (Handle(GEOM_Objec if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL; //Add a new Box object - Handle(GEOM_Object) aBox = GetEngine()->AddObject(GetDocID(), GEOM_BOX); + Handle(GEOM_Object) aBox = GetEngine()->AddObject(GEOM_BOX); //Add a new Box function for creation a box relatively to two points Handle(GEOM_Function) aFunction = aBox->AddFunction(GEOMImpl_BoxDriver::GetID(), BOX_TWO_PNT); @@ -218,7 +218,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceHW (double theH, double if (theH == 0 || theW == 0) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Box function for creation a box relatively to two points Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_H_W); @@ -268,7 +268,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceObjHW (Handle(GEOM_Objec if (theObj.IsNull()) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Box function for creation a box relatively to two points Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_OBJ_H_W); @@ -323,7 +323,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskPntVecR if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Disk object - Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE); //Add a new Disk function for creation a disk relatively to point and vector Handle(GEOM_Function) aFunction = @@ -380,7 +380,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskThreePnt (Handle(GEOM_Ob if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Disk object - Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE); //Add a new Disk function for creation a disk relatively to three points Handle(GEOM_Function) aFunction = @@ -436,7 +436,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskR (double theR, int theO if (theR == 0 ) return NULL; //Add a new Disk object - Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE); //Add a new Box function for creation a box relatively to two points Handle(GEOM_Function) aFunction = aDisk->AddFunction(GEOMImpl_DiskDriver::GetID(), DISK_R); @@ -482,7 +482,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, dou SetErrorCode(KO); //Add a new Cylinder object - Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER); + Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER); //Add a new Cylinder function with R and H parameters Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H); @@ -528,7 +528,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRHA (double theR, do SetErrorCode(KO); //Add a new Cylinder object - Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER); + Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER); //Add a new Cylinder function with R and H parameters Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H_A); @@ -579,7 +579,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEO if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Cylinder object - Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER); + Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER); //Add a new Cylinder function for creation a cylinder relatively to point and vector Handle(GEOM_Function) aFunction = @@ -637,7 +637,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRHA (Handle(GE if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Cylinder object - Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER); + Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER); //Add a new Cylinder function for creation a cylinder relatively to point and vector Handle(GEOM_Function) aFunction = @@ -694,7 +694,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConeR1R2H (double theR1, dou SetErrorCode(KO); //Add a new Cone object - Handle(GEOM_Object) aCone = GetEngine()->AddObject(GetDocID(), GEOM_CONE); + Handle(GEOM_Object) aCone = GetEngine()->AddObject(GEOM_CONE); //Add a new Cone function with R and H parameters Handle(GEOM_Function) aFunction = @@ -748,7 +748,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConePntVecR1R2H (Handle(GEOM if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Cone object - Handle(GEOM_Object) aCone = GetEngine()->AddObject(GetDocID(), GEOM_CONE); + Handle(GEOM_Object) aCone = GetEngine()->AddObject(GEOM_CONE); //Add a new Cone function for creation a cone relatively to point and vector Handle(GEOM_Function) aFunction = @@ -804,7 +804,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSphereR (double theR) SetErrorCode(KO); //Add a new Sphere object - Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GetDocID(), GEOM_SPHERE); + Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GEOM_SPHERE); //Add a new Sphere function with R parameter Handle(GEOM_Function) aFunction = aSphere->AddFunction(GEOMImpl_SphereDriver::GetID(), SPHERE_R); @@ -852,7 +852,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSpherePntR (Handle(GEOM_Obje if (thePnt.IsNull()) return NULL; //Add a new Point object - Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GetDocID(), GEOM_SPHERE); + Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GEOM_SPHERE); //Add a new Sphere function for creation a sphere relatively to point Handle(GEOM_Function) aFunction = aSphere->AddFunction(GEOMImpl_SphereDriver::GetID(), SPHERE_PNT_R); @@ -904,7 +904,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusRR SetErrorCode(KO); //Add a new Torus object - Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_TORUS); + Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_TORUS); //Add a new Torus function Handle(GEOM_Function) aFunction = @@ -955,7 +955,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusPntVecRR if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Torus object - Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_TORUS); + Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_TORUS); //Add a new Torus function Handle(GEOM_Function) aFunction = @@ -1014,7 +1014,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec if (theBase.IsNull() || theVec.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism relatively to vector Handle(GEOM_Function) aFunction = @@ -1077,7 +1077,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH2Ways (Handle(GEOM_ if (theBase.IsNull() || theVec.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism relatively to vector Handle(GEOM_Function) aFunction = @@ -1136,7 +1136,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism relatively to two points Handle(GEOM_Function) aFunction = @@ -1200,7 +1200,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt2Ways if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism relatively to two points Handle(GEOM_Function) aFunction = @@ -1259,7 +1259,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ if (theBase.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism by DXDYDZ Handle(GEOM_Function) aFunction = @@ -1321,7 +1321,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ2Ways if (theBase.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism by DXDYDZ Handle(GEOM_Function) aFunction = @@ -1381,12 +1381,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism if ( theFuse ) { //Add a new Extruded Boss object - aPrism = GetEngine()->AddObject(GetDocID(), GEOM_EXTRUDED_BOSS); + aPrism = GetEngine()->AddObject(GEOM_EXTRUDED_BOSS); } else { //Add a new Extruded Cut object - aPrism = GetEngine()->AddObject(GetDocID(), GEOM_EXTRUDED_CUT); + aPrism = GetEngine()->AddObject(GEOM_EXTRUDED_CUT); } //Add a new Prism function for the creation of a Draft Prism feature @@ -1464,7 +1464,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_I3DPrimOperations::MakePipe if (theBase.IsNull() || thePath.IsNull()) return NULL; //Add a new Pipe object - Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE); + Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GEOM_PIPE); //Add a new Pipe function Handle(GEOM_Function) aFunction = @@ -1541,7 +1541,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle( if (theBase.IsNull() || theAxis.IsNull()) return NULL; //Add a new Revolution object - Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION); + Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GEOM_REVOLUTION); //Add a new Revolution function for creation a revolution relatively to axis Handle(GEOM_Function) aFunction = @@ -1597,7 +1597,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle2Ways if (theBase.IsNull() || theAxis.IsNull()) return NULL; //Add a new Revolution object - Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION); + Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GEOM_REVOLUTION); //Add a new Revolution function for creation a revolution relatively to axis Handle(GEOM_Function) aFunction = @@ -1659,7 +1659,7 @@ GEOMImpl_I3DPrimOperations::MakeFilling (std::list< Handle(GEOM_Object)> & theCo return NULL; } //Add a new Filling object - Handle(GEOM_Object) aFilling = GetEngine()->AddObject(GetDocID(), GEOM_FILLING); + Handle(GEOM_Object) aFilling = GetEngine()->AddObject(GEOM_FILLING); //Add a new Filling function for creation a filling from a compound Handle(GEOM_Function) aFunction = aFilling->AddFunction(GEOMImpl_FillingDriver::GetID(), BASIC_FILLING); @@ -1735,7 +1735,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections( return anObj; //Add a new ThruSections object - Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GetDocID(), GEOM_THRUSECTIONS); + Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GEOM_THRUSECTIONS); //Add a new ThruSections function @@ -1840,7 +1840,7 @@ Handle(TColStd_HSequenceOfTransient) Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length()); //Add a new Pipe object - Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE); + Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE); //Add a new Pipe function @@ -2016,7 +2016,7 @@ Handle(TColStd_HSequenceOfTransient) Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length()); //Add a new Pipe object - Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE); + Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE); //Add a new Pipe function @@ -2205,7 +2205,7 @@ Handle(TColStd_HSequenceOfTransient) Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length()); //Add a new Pipe object - Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE); + Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE); //Add a new Pipe function @@ -2348,7 +2348,7 @@ Handle(TColStd_HSequenceOfTransient) if (theBase.IsNull() || thePath.IsNull() || theVec.IsNull()) return NULL; //Add a new Pipe object - Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE); + Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GEOM_PIPE); //Add a new Pipe function Handle(GEOM_Function) aFunction = @@ -2438,7 +2438,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening if (isCopy) { //Add a new Copy object - aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + aCopy = GetEngine()->AddObject(theObject->GetType()); aFunction = aCopy->AddFunction(GEOMImpl_OffsetDriver::GetID(), OFFSET_THICKENING_COPY); } else @@ -2521,7 +2521,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::RestorePath (Handle(GEOM_Object) if (theShape.IsNull() || theBase1.IsNull() || theBase2.IsNull()) return NULL; // Add a new Path object - Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH); + Handle(GEOM_Object) aPath = GetEngine()->AddObject(GEOM_PIPE_PATH); // Add a new Path function Handle(GEOM_Function) aFunction = @@ -2586,7 +2586,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::RestorePath return NULL; // Add a new Path object - Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH); + Handle(GEOM_Object) aPath = GetEngine()->AddObject(GEOM_PIPE_PATH); // Add a new Path function Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx index a65ac384a..7bf581c67 100644 --- a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx @@ -36,7 +36,7 @@ class GEOMImpl_IPipe; class GEOMImpl_I3DPrimOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_I3DPrimOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_I3DPrimOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_I3DPrimOperations(); Standard_EXPORT Handle(GEOM_Object) MakeBoxDXDYDZ (double theDX, double theDY, double theDZ); diff --git a/src/GEOMImpl/GEOMImpl_IBaseIEOperations.cxx b/src/GEOMImpl/GEOMImpl_IBaseIEOperations.cxx index ce1f61068..25ceb6d3f 100755 --- a/src/GEOMImpl/GEOMImpl_IBaseIEOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBaseIEOperations.cxx @@ -39,12 +39,12 @@ typedef NCollection_DataMap< TCollection_ExtendedString, NCollection_ListAddObject(GetDocID(), GEOM_POINT); + Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT); //Add a new Point function with XYZ parameters Handle(GEOM_Function) aFunction = @@ -138,7 +138,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointWithReference if (theReference.IsNull()) return NULL; //Add a new Point object - Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT); + Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT); //Add a new Point function for creation a point relativley another point Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_XYZ_REF); @@ -197,7 +197,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom if (theGeomObj.IsNull()) return NULL; //Add a new Point object - Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT); + Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT); //Add a new Point function for creation a point relativley another point int fType = POINT_CURVE_PAR; @@ -403,7 +403,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnLinesIntersection if (theLine1.IsNull() || theLine2.IsNull()) return NULL; //Add a new Point object - Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT); + Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT); //Add a new Point function for creation a point relativley another point Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_LINES_INTERSECTION); @@ -455,7 +455,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentOnCurve if (theCurve.IsNull()) return NULL; //Add a new Vector object - Handle(GEOM_Object) aVec = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR); + Handle(GEOM_Object) aVec = GetEngine()->AddObject(GEOM_VECTOR); //Add a new Point function for creation a point relativley another point Handle(GEOM_Function) aFunction = aVec->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_TANGENT_CURVE_PAR); @@ -504,7 +504,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorDXDYDZ SetErrorCode(KO); //Add a new Vector object - Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR); + Handle(GEOM_Object) aVector = GetEngine()->AddObject(GEOM_VECTOR); //Add a new Vector function with DXDYDZ parameters Handle(GEOM_Function) aFunction = @@ -555,7 +555,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorTwoPnt if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL; //Add a new Vector object - Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR); + Handle(GEOM_Object) aVector = GetEngine()->AddObject(GEOM_VECTOR); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -609,7 +609,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLine if (thePnt.IsNull() || theDir.IsNull()) return NULL; //Add a new Line object - Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE); + Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE); //Add a new Line function Handle(GEOM_Function) aFunction = @@ -662,7 +662,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoPnt if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL; //Add a new Line object - Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE); + Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE); //Add a new Line function Handle(GEOM_Function) aFunction = @@ -715,7 +715,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoFaces if (theFace1.IsNull() || theFace2.IsNull()) return NULL; //Add a new Line object - Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE); + Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE); //Add a new Line function Handle(GEOM_Function) aFunction = @@ -769,7 +769,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneThreePnt if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = @@ -826,7 +826,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlanePntVec if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = @@ -880,7 +880,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneFace if (theFace.IsNull()) return NULL; //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = @@ -933,7 +933,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlane2Vec if (theVec1.IsNull() || theVec2.IsNull()) return NULL; //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = @@ -985,7 +985,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneLCS SetErrorCode(KO); //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = @@ -1040,7 +1040,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarker SetErrorCode(KO); //Add a new Marker object - Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER); + Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER); //Add a new Marker function Handle(GEOM_Function) aFunction = @@ -1091,7 +1091,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarkerFromShape SetErrorCode(KO); //Add a new Marker object - Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER); + Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER); //Add a new Marker function Handle(GEOM_Function) aFunction = @@ -1142,7 +1142,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarkerPntTwoVec SetErrorCode(KO); //Add a new Marker object - Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER); + Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER); //Add a new Marker function Handle(GEOM_Function) aFunction = @@ -1201,7 +1201,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentPlaneOnFace(const Hand if (theFace.IsNull()) return NULL; //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_IBasicOperations.hxx b/src/GEOMImpl/GEOMImpl_IBasicOperations.hxx index d19f875ef..89329c61e 100644 --- a/src/GEOMImpl/GEOMImpl_IBasicOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IBasicOperations.hxx @@ -31,7 +31,7 @@ class GEOMImpl_IBasicOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IBasicOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IBasicOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IBasicOperations(); // Point diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx index db35fe4a4..7e0e24994 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx @@ -249,8 +249,8 @@ static Standard_Boolean IsQuadrangle(const TopoDS_Face &theFace, * constructor: */ //============================================================================= -GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations"); } @@ -281,7 +281,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad theEdge3.IsNull() || theEdge4.IsNull()) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Face function Handle(GEOM_Function) aFunction = @@ -342,7 +342,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad2Edges if (theEdge1.IsNull() || theEdge2.IsNull()) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Face function Handle(GEOM_Function) aFunction = @@ -400,7 +400,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad4Vertices thePnt3.IsNull() || thePnt4.IsNull()) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Face function Handle(GEOM_Function) aFunction = @@ -465,7 +465,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa theFace5.IsNull() || theFace6.IsNull()) return NULL; //Add a new Solid object - Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GetDocID(), GEOM_BLOCK); + Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GEOM_BLOCK); //Add a new Block function Handle(GEOM_Function) aFunction = @@ -532,7 +532,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa2Faces if (theFace1.IsNull() || theFace2.IsNull()) return NULL; //Add a new Solid object - Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GetDocID(), GEOM_BLOCK); + Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GEOM_BLOCK); //Add a new Block function Handle(GEOM_Function) aFunction = @@ -588,7 +588,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeBlockCompound if (theCompound.IsNull()) return NULL; //Add a new object - Handle(GEOM_Object) aBlockComp = GetEngine()->AddObject(GetDocID(), GEOM_COMPOUND); + Handle(GEOM_Object) aBlockComp = GetEngine()->AddObject(GEOM_COMPOUND); //Add a new BlocksComp function Handle(GEOM_Function) aFunction = @@ -2430,7 +2430,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::RemoveExtraEdges if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a function Handle(GEOM_Function) aFunction = @@ -2482,7 +2482,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::UnionFaces if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a function Handle(GEOM_Function) aFunction = @@ -2532,7 +2532,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::CheckAndImprove if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a function Handle(GEOM_Function) aFunction = @@ -3091,7 +3091,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation1D if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a translate function Handle(GEOM_Function) aFunction = @@ -3150,7 +3150,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation2D if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a translate function Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx index 37d69f74e..a11a4a311 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx @@ -36,7 +36,7 @@ class GEOM_Object; class GEOMImpl_IBlocksOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IBlocksOperations(); // Creation of blocks and block faces diff --git a/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx b/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx index 19812c257..3c86c5fb8 100644 --- a/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx @@ -49,8 +49,8 @@ * constructor: */ //============================================================================= -GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations"); } @@ -82,7 +82,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean if (theShape1.IsNull() || theShape2.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN); + Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN); //Add a new Boolean function Handle(GEOM_Function) aFunction; @@ -162,7 +162,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuse if (theShape1.IsNull() || theShape2.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN); + Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN); //Add a new Boolean function Handle(GEOM_Function) aFunction = @@ -225,7 +225,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuseList if (theShapes.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN); + Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN); //Add a new Boolean function Handle(GEOM_Function) aFunction = @@ -286,7 +286,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeCommonList if (theShapes.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN); + Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN); //Add a new Boolean function Handle(GEOM_Function) aFunction = @@ -353,7 +353,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeCutList if (theShapes.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN); + Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN); //Add a new Boolean function Handle(GEOM_Function) aFunction = @@ -429,7 +429,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition SetErrorCode(KO); //Add a new Partition object - Handle(GEOM_Object) aPartition = GetEngine()->AddObject(GetDocID(), GEOM_PARTITION); + Handle(GEOM_Object) aPartition = GetEngine()->AddObject(GEOM_PARTITION); //Add a new Partition function Handle(GEOM_Function) aFunction; @@ -565,7 +565,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeHalfPartition if (theShape.IsNull() || thePlane.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aPart = GetEngine()->AddObject(GetDocID(), GEOM_PARTITION); + Handle(GEOM_Object) aPart = GetEngine()->AddObject(GEOM_PARTITION); //Add a new Partition function Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx b/src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx index af3e46d3b..602f0132f 100644 --- a/src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx @@ -33,7 +33,7 @@ class GEOM_Object; class GEOMImpl_IBooleanOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IBooleanOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IBooleanOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IBooleanOperations(); Standard_EXPORT Handle(GEOM_Object) MakeBoolean diff --git a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx index 3d9bf31ad..1e7bc9f8e 100644 --- a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx @@ -183,8 +183,8 @@ namespace * constructor: */ //============================================================================= -GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations"); } @@ -214,7 +214,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCircleThreePnt (Handle(GEOM_ if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Circle object - Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE); + Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE); //Add a new Circle function for creation a circle relatively to three points Handle(GEOM_Function) aFunction = @@ -272,7 +272,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCircleCenter2Pnt (Handle(GEO if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Circle object - Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE); + Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE); //Add a new Circle function for creation a circle relatively to center and 2 points Handle(GEOM_Function) aFunction = @@ -331,7 +331,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCirclePntVecR //if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Circle object - Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE); + Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE); //Add a new Circle function for creation a circle relatively to point and vector Handle(GEOM_Function) aFunction = @@ -397,7 +397,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeEllipse //if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Ellipse object - Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_ELLIPSE); + Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_ELLIPSE); //Add a new Ellipse function Handle(GEOM_Function) aFunction = @@ -473,7 +473,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArc (Handle(GEOM_Object) the if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Circle Arc object - Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_CIRC_ARC); + Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_CIRC_ARC); //Add a new Circle Arc function Handle(GEOM_Function) aFunction = @@ -531,7 +531,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArcCenter (Handle(GEOM_Objec if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Circle Arc object - Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_CIRC_ARC); + Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_CIRC_ARC); //Add a new Circle Arc function Handle(GEOM_Function) aFunction = @@ -589,7 +589,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArcOfEllipse (Handle(GEOM_Ob if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Circle Arc object - Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_ELLIPSE_ARC); + Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_ELLIPSE_ARC); //Add a new Circle Arc function Handle(GEOM_Function) aFunction = @@ -644,7 +644,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline (std::listAddObject(GetDocID(), GEOM_POLYLINE); + Handle(GEOM_Object) aPolyline = GetEngine()->AddObject(GEOM_POLYLINE); //Add a new Polyline function for creation a polyline relatively to points set Handle(GEOM_Function) aFunction = @@ -714,7 +714,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier SetErrorCode(KO); //Add a new Spline object - Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE); + Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE); //Add a new Spline function for creation a bezier curve relatively to points set Handle(GEOM_Function) aFunction = @@ -784,7 +784,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation SetErrorCode(KO); //Add a new Spline object - Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE); + Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE); //Add a new Spline function for interpolation type Handle(GEOM_Function) aFunction = @@ -855,7 +855,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolWithTangents SetErrorCode(KO); //Add a new Spline object - Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE); + Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE); //Add a new Spline function for interpolation type Handle(GEOM_Function) aFunction = @@ -1069,7 +1069,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric switch(theCurveType) { case Polyline: { //Add a new Polyline object - aCurve = GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE); + aCurve = GetEngine()->AddObject(GEOM_POLYLINE); //Add a new Polyline function for creation a polyline relatively to points set aFunction = aCurve->AddFunction(GEOMImpl_PolylineDriver::GetID(), POLYLINE_POINTS); @@ -1089,7 +1089,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric } case Bezier: { //Add a new Spline object - aCurve = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE); + aCurve = GetEngine()->AddObject(GEOM_SPLINE); //Add a new Spline function for creation a bezier curve relatively to points set aFunction = aCurve->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_BEZIER); @@ -1108,7 +1108,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric } case Interpolation: { //Add a new Spline object - aCurve = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE); + aCurve = GetEngine()->AddObject(GEOM_SPLINE); //Add a new Spline function for creation a bezier curve relatively to points set aFunction = aCurve->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_INTERPOLATION); @@ -1185,7 +1185,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcher (const char* theCom if (!theCommand || strcmp(theCommand, "") == 0) return NULL; //Add a new Sketcher object - Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_SKETCHER); + Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_SKETCHER); //Add a new Sketcher function Handle(GEOM_Function) aFunction = @@ -1248,7 +1248,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcherOnPlane if (!theCommand || strcmp(theCommand, "") == 0) return NULL; //Add a new Sketcher object - Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_SKETCHER); + Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_SKETCHER); //Add a new Sketcher function Handle(GEOM_Function) aFunction = @@ -1301,7 +1301,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::Make3DSketcherCommand (const cha if (!theCommand || strcmp(theCommand, "") == 0) return NULL; //Add a new Sketcher object - Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_3DSKETCHER); + Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_3DSKETCHER); //Add a new Sketcher function Handle(GEOM_Function) aFunction = @@ -1348,7 +1348,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::Make3DSketcher (std::listAddObject(GetDocID(), GEOM_3DSKETCHER); + Handle(GEOM_Object) a3DSketcher = GetEngine()->AddObject(GEOM_3DSKETCHER); //Add a new Sketcher function Handle(GEOM_Function) aFunction = @@ -1421,7 +1421,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeIsoline //Add a new Spline object Handle(GEOM_Object) anIsoline = - GetEngine()->AddObject(GetDocID(), GEOM_ISOLINE); + GetEngine()->AddObject(GEOM_ISOLINE); //Add a new Spline function for interpolation type Handle(GEOM_Function) aFunction = @@ -1490,7 +1490,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline2D // Add a new Polyline object Handle(GEOM_Object) aResult = - GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE2D); + GetEngine()->AddObject(GEOM_POLYLINE2D); Handle(GEOM_Function) aFunction = aResult->AddFunction (GEOMImpl_PolylineDriver::GetID(), POLYLINE2D_PLN_COORDS); @@ -1563,7 +1563,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline2DOnPlane //Add a new Polyline object Handle(GEOM_Object) aResult = - GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE2D); + GetEngine()->AddObject(GEOM_POLYLINE2D); Handle(GEOM_Function) aFunction = aResult->AddFunction (GEOMImpl_PolylineDriver::GetID(), POLYLINE2D_PLN_OBJECT); diff --git a/src/GEOMImpl/GEOMImpl_ICurvesOperations.hxx b/src/GEOMImpl/GEOMImpl_ICurvesOperations.hxx index 2eb9459aa..2d7c58fe1 100644 --- a/src/GEOMImpl/GEOMImpl_ICurvesOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_ICurvesOperations.hxx @@ -38,7 +38,7 @@ class GEOMImpl_ICurvesOperations : public GEOM_IOperations { enum CurveType { Polyline, Bezier, Interpolation }; - Standard_EXPORT GEOMImpl_ICurvesOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_ICurvesOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_ICurvesOperations(); Standard_EXPORT Handle(GEOM_Object) MakeCircleThreePnt (Handle(GEOM_Object) thePnt1, diff --git a/src/GEOMImpl/GEOMImpl_IECallBack.cxx b/src/GEOMImpl/GEOMImpl_IECallBack.cxx index 77575f7e1..6fccfba52 100755 --- a/src/GEOMImpl/GEOMImpl_IECallBack.cxx +++ b/src/GEOMImpl/GEOMImpl_IECallBack.cxx @@ -56,8 +56,7 @@ GEOMImpl_Gen* GEOMImpl_IECallBack::GetEngine() * Export */ //============================================================================= -bool GEOMImpl_IECallBack::Export( int /*theDocId*/, - const Handle(GEOM_Object) /*theOriginal*/, +bool GEOMImpl_IECallBack::Export( const Handle(GEOM_Object) /*theOriginal*/, const TCollection_AsciiString& /*theFileName*/, const TCollection_AsciiString& /*theFormatName*/ ) { @@ -70,8 +69,7 @@ bool GEOMImpl_IECallBack::Export( int /*theDocId*/, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -GEOMImpl_IECallBack::Import( int /*theDocId*/, - const TCollection_AsciiString& /*theFormatName*/, +GEOMImpl_IECallBack::Import( const TCollection_AsciiString& /*theFormatName*/, const TCollection_AsciiString& /*theFileName*/ ) { return NULL; @@ -83,8 +81,7 @@ GEOMImpl_IECallBack::Import( int /*theDocId*/, */ //============================================================================= TCollection_AsciiString -GEOMImpl_IECallBack::ReadValue( int /*theDocId*/, - const TCollection_AsciiString& /*theFileName*/, +GEOMImpl_IECallBack::ReadValue( const TCollection_AsciiString& /*theFileName*/, const TCollection_AsciiString& /*theFormatName*/, const TCollection_AsciiString& /*theParameterName*/ ) { diff --git a/src/GEOMImpl/GEOMImpl_IECallBack.hxx b/src/GEOMImpl/GEOMImpl_IECallBack.hxx index ef7a7d06d..6373aa600 100644 --- a/src/GEOMImpl/GEOMImpl_IECallBack.hxx +++ b/src/GEOMImpl/GEOMImpl_IECallBack.hxx @@ -37,21 +37,18 @@ class GEOMImpl_IECallBack Standard_EXPORT GEOMImpl_IECallBack(); Standard_EXPORT ~GEOMImpl_IECallBack(); - Standard_EXPORT virtual bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, + Standard_EXPORT virtual bool Export( const Handle(GEOM_Object) theOriginal, const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName ); Standard_EXPORT virtual - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); Standard_EXPORT virtual - TCollection_AsciiString ReadValue( int theDocId, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theParameterName ); + TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theParameterName ); Standard_EXPORT static void Register( const TCollection_AsciiString& theFormatName, GEOMImpl_IECallBack* theCallBack ); diff --git a/src/GEOMImpl/GEOMImpl_IFieldOperations.cxx b/src/GEOMImpl/GEOMImpl_IFieldOperations.cxx index c0b219e29..f6ad9f493 100644 --- a/src/GEOMImpl/GEOMImpl_IFieldOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IFieldOperations.cxx @@ -39,8 +39,8 @@ * constructor: */ //============================================================================= -GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations"); } @@ -96,7 +96,7 @@ CreateField( const Handle(GEOM_Object)& theShape, // make a field Handle(GEOM_Field) aField = Handle(GEOM_Field)::DownCast - ( GetEngine()->AddBaseObject( GetDocID(), GEOM_FIELD )); + ( GetEngine()->AddBaseObject( GEOM_FIELD )); // set field data aField->Init( theShape, theName, theType, theDimension, theComponentNames ); @@ -142,7 +142,7 @@ int GEOMImpl_IFieldOperations::CountFields( const Handle(GEOM_Object)& theShape for (; anIt.More(); anIt.Next()) { TCollection_ExtendedString& anEntry = anIt.Value(); anEntry.ToUTF8CString( (Standard_PCharacter&) pentry ); - Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), entry, false); + Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(entry, false); nbFields += ( !anObj.IsNull() && anObj->IsKind(STANDARD_TYPE(GEOM_Field)) ); } @@ -178,7 +178,7 @@ GEOMImpl_IFieldOperations::GetFields( const Handle(GEOM_Object)& theShape ) for (; anIt.More(); anIt.Next()) { TCollection_ExtendedString& anEntry = anIt.Value(); anEntry.ToUTF8CString( (Standard_PCharacter&) pentry ); - Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), entry, false); + Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(entry, false); if ( !anObj.IsNull() && anObj->IsKind(STANDARD_TYPE(GEOM_Field)) ) { Handle(GEOM_Field) field = Handle(GEOM_Field)::DownCast( anObj ); @@ -222,7 +222,7 @@ GEOMImpl_IFieldOperations::GetField( const Handle(GEOM_Object)& theShape, for (; anIt.More(); anIt.Next()) { TCollection_ExtendedString& anEntry = anIt.Value(); anEntry.ToUTF8CString( (Standard_PCharacter&) pentry ); - field = Handle(GEOM_Field)::DownCast( GetEngine()->GetObject( GetDocID(), entry, false )); + field = Handle(GEOM_Field)::DownCast( GetEngine()->GetObject( entry, false )); if ( !field.IsNull() && field->GetName() == theName ) { SetErrorCode(OK); break; diff --git a/src/GEOMImpl/GEOMImpl_IFieldOperations.hxx b/src/GEOMImpl/GEOMImpl_IFieldOperations.hxx index 4a4cd3ae2..4358141eb 100644 --- a/src/GEOMImpl/GEOMImpl_IFieldOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IFieldOperations.hxx @@ -34,7 +34,7 @@ class GEOM_Object; class GEOMImpl_IFieldOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IFieldOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IFieldOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IFieldOperations(); Standard_EXPORT Handle(GEOM_Field) diff --git a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx index 4e6965c4f..46f57fac8 100644 --- a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx @@ -53,8 +53,8 @@ * constructor: */ //============================================================================= -GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations"); } diff --git a/src/GEOMImpl/GEOMImpl_IGroupOperations.hxx b/src/GEOMImpl/GEOMImpl_IGroupOperations.hxx index 68556eb13..3145e799c 100644 --- a/src/GEOMImpl/GEOMImpl_IGroupOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IGroupOperations.hxx @@ -34,7 +34,7 @@ class GEOMImpl_IGroupOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IGroupOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IGroupOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IGroupOperations(); Standard_EXPORT Handle(GEOM_Object) CreateGroup(Handle(GEOM_Object) theMainShape, TopAbs_ShapeEnum theShapeType); diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx index baf47d45d..f897d9573 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx @@ -60,8 +60,8 @@ * constructor: */ //============================================================================= -GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { myModifStats = new ShHealOper_ModifStats; MESSAGE("GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations"); @@ -117,7 +117,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ShapeProcess (Handle(GEOM_Objec 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 ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SHAPE_PROCESS); @@ -334,7 +334,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::SuppressFaces 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); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SUPPRESS_FACES); @@ -402,7 +402,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::CloseContour 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 ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CLOSE_CONTOUR); @@ -471,7 +471,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveIntWires 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 ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), REMOVE_INT_WIRES); @@ -538,7 +538,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::FillHoles (Handle(GEOM_Object) 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 ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), FILL_HOLES); @@ -611,7 +611,7 @@ GEOMImpl_IHealingOperations::Sew (std::list& theObjects, } // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function int aFunctionType = (isAllowNonManifold ? SEWING_NON_MANIFOLD : SEWING); @@ -680,7 +680,7 @@ GEOMImpl_IHealingOperations::RemoveInternalFaces (std::list< Handle(GEOM_Object) } // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY); //Add the function Handle(GEOM_Function) @@ -738,7 +738,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::DivideEdge (Handle(GEOM_Object) 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 ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE); @@ -805,7 +805,7 @@ GEOMImpl_IHealingOperations::DivideEdgeByPoint (Handle(GEOM_Object) } // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE_BY_POINT); @@ -860,7 +860,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::FuseCollinearEdgesWithinWire if (theWire.IsNull()) return NULL; // Add a new object - Handle(GEOM_Object) aRes = GetEngine()->AddObject(GetDocID(), theWire->GetType()); + Handle(GEOM_Object) aRes = GetEngine()->AddObject(theWire->GetType()); // Add a new function Handle(GEOM_Function) aFunction; @@ -973,7 +973,7 @@ bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(TColStd_HSequenceOfTra TopExp_Explorer anExp; for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) { - anObj = GetEngine()->AddObject( GetDocID(), GEOM_FREE_BOUNDS ); + anObj = GetEngine()->AddObject( GEOM_FREE_BOUNDS ); aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF ); TopoDS_Shape aValueShape = anExp.Current(); aFunction->SetValue( aValueShape ); @@ -981,7 +981,7 @@ bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(TColStd_HSequenceOfTra } for ( anExp.Init( anOpen, TopAbs_WIRE ); anExp.More(); anExp.Next() ) { - anObj = GetEngine()->AddObject( GetDocID(), GEOM_FREE_BOUNDS ); + anObj = GetEngine()->AddObject( GEOM_FREE_BOUNDS ); aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF ); TopoDS_Shape aValueShape = anExp.Current(); aFunction->SetValue( aValueShape ); @@ -1116,7 +1116,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G 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); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY); if (theObject->GetType() == GEOM_VECTOR) { // Mantis issue 21066 //Add the function @@ -1189,7 +1189,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Obj return NULL; // There is no function which creates an object to be processed // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(theObject->GetType()); // Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), LIMIT_TOLERANCE); diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx index 8412c79f8..d29456e89 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx @@ -37,7 +37,7 @@ class ShHealOper_ModifStats; class GEOMImpl_IHealingOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IHealingOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IHealingOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IHealingOperations(); // Apply Shape Processing to the selected Object diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx index 8da09ad37..b739edb5d 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx @@ -73,13 +73,13 @@ * constructor */ //============================================================================= -GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations"); - myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID()); - myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID()); - myFieldOperations = new GEOMImpl_IFieldOperations(GetEngine(), GetDocID()); + myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine()); + myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine()); + myFieldOperations = new GEOMImpl_IFieldOperations(GetEngine()); } //============================================================================= @@ -107,7 +107,7 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::MakeCopy (Handle(GEOM_Object) th if (theOriginal.IsNull()) return NULL; //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a Copy function for creation a copy object Handle(GEOM_Function) aFunction = aCopy->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITH_REF); @@ -157,7 +157,7 @@ void GEOMImpl_IInsertOperations::Export if (theOriginal.IsNull()) return; - if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( GetDocID(), theOriginal, theFileName, theFormatName ) ) + if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( theOriginal, theFileName, theFormatName ) ) return; SetErrorCode(OK); } @@ -176,7 +176,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IInsertOperations::Import if (theFileName.IsEmpty() || theFormatName.IsEmpty()) return NULL; Handle(TColStd_HSequenceOfTransient) aSeq = - GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( GetDocID(), theFormatName, theFileName ); + GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( theFormatName, theFileName ); SetErrorCode(OK); return aSeq; } @@ -195,7 +195,7 @@ TCollection_AsciiString GEOMImpl_IInsertOperations::ReadValue TCollection_AsciiString aValue; if (theFileName.IsEmpty() || theFormatName.IsEmpty() || theParameterName.IsEmpty()) return aValue; - aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( GetDocID(), theFileName, theFormatName, theParameterName ); + aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( theFileName, theFormatName, theParameterName ); SetErrorCode(OK); return aValue; @@ -211,7 +211,7 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::RestoreShape (std::istringstream SetErrorCode(KO); //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) result = GetEngine()->AddObject(GEOM_COPY); //Add a Copy function Handle(GEOM_Function) aFunction = result->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF); @@ -305,7 +305,7 @@ int GEOMImpl_IInsertOperations::LoadTexture(const TCollection_AsciiString& theTe for (i = 1, bdit = bytedata.begin(); bdit != bytedata.end(); ++bdit, ++i) aTexture->SetValue(i, (Standard_Byte)(*bdit)); - int aTextureId = GetEngine()->addTexture(GetDocID(), lenbytes*8, lines.size(), aTexture, theTextureFile); + int aTextureId = GetEngine()->addTexture(lenbytes*8, lines.size(), aTexture, theTextureFile); if (aTextureId > 0) SetErrorCode(OK); return aTextureId; } @@ -314,7 +314,7 @@ int GEOMImpl_IInsertOperations::AddTexture(int theWidth, int theHeight, const Handle(TColStd_HArray1OfByte)& theTexture) { SetErrorCode(KO); - int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture); + int aTextureId = GetEngine()->addTexture(theWidth, theHeight, theTexture); if (aTextureId > 0) SetErrorCode(OK); return aTextureId; } @@ -332,7 +332,7 @@ Handle(TColStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theText if (theTextureId <= 0) return aTexture; - aTexture = GetEngine()->getTexture(GetDocID(), theTextureId, theWidth, theHeight, aFileName); + aTexture = GetEngine()->getTexture(theTextureId, theWidth, theHeight, aFileName); if (theWidth > 0 && theHeight > 0 && aTexture->Length() > 0) SetErrorCode(OK); @@ -342,7 +342,7 @@ Handle(TColStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theText std::list GEOMImpl_IInsertOperations::GetAllTextures() { SetErrorCode(KO); - std::list id_list = GetEngine()->getAllTextures(GetDocID()); + std::list id_list = GetEngine()->getAllTextures(); SetErrorCode(OK); return id_list; } @@ -366,7 +366,7 @@ bool GEOMImpl_IInsertOperations::TransferData //Add a new Transfer Data object object Handle(GEOM_Object) aTDObj = - GetEngine()->AddObject(GetDocID(), GEOM_TRANSFER_DATA); + GetEngine()->AddObject(GEOM_TRANSFER_DATA); //Add a Transfer Data function for created object Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx index c4e41b09b..7552ba4a9 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx @@ -56,7 +56,7 @@ class GEOMImpl_IInsertOperations : public GEOM_IOperations { long myMaxNumber; }; - Standard_EXPORT GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IInsertOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IInsertOperations(); diff --git a/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx b/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx index fdd3c307b..726b82719 100644 --- a/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx @@ -67,8 +67,8 @@ * constructor: */ //============================================================================= -GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations"); } @@ -95,7 +95,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletAll SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -146,7 +146,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletEdges SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -213,7 +213,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletEdgesR1R2 SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -282,7 +282,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFaces SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -349,7 +349,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFacesR1R2 SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -417,7 +417,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFillet2D SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_2D); + Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GEOM_FILLET_2D); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -485,7 +485,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFillet1D SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_1D); + Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GEOM_FILLET_1D); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -553,7 +553,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferAll (Handle(GEOM_Objec SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -605,7 +605,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdge SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -661,7 +661,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdgeAD SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -716,7 +716,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferFaces SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -785,7 +785,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferFacesAD SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -854,7 +854,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdges SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -924,7 +924,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdgesAD SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -995,7 +995,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeArchimede (Handle(GEOM_Object SetErrorCode(KO); //Add a new Archimede object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_ARCHIMEDE); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_ARCHIMEDE); //Add a new Archimede function Handle(GEOM_Function) aFunction = aChamfer->AddFunction(GEOMImpl_ArchimedeDriver::GetID(), ARCHIMEDE_TYPE); @@ -1073,7 +1073,7 @@ Standard_Integer GEOMImpl_ILocalOperations::GetSubShapeIndex (Handle(GEOM_Object if (aGen) { GEOMImpl_IShapesOperations* anIShapesOperations = - aGen->GetIShapesOperations(GetDocID()); + aGen->GetIShapesOperations(); anInd = anIShapesOperations->GetSubShapeIndex(theShape, theSubShape); SetErrorCode(anIShapesOperations->GetErrorCode()); } diff --git a/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx b/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx index 672e7daf4..371671f40 100644 --- a/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx @@ -33,7 +33,7 @@ class GEOMImpl_ILocalOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_ILocalOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_ILocalOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_ILocalOperations(); Standard_EXPORT Handle(GEOM_Object) MakeFilletAll (Handle(GEOM_Object) theShape, double theR); diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx index dd3318aac..a7491fe49 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx @@ -90,8 +90,8 @@ * Constructor */ //============================================================================= -GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations"); } @@ -811,7 +811,7 @@ Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetCentreOfMass if (theShape.IsNull()) return NULL; //Add a new CentreOfMass object - Handle(GEOM_Object) aCDG = GetEngine()->AddObject(GetDocID(), GEOM_CDG); + Handle(GEOM_Object) aCDG = GetEngine()->AddObject(GEOM_CDG); //Add a new CentreOfMass function Handle(GEOM_Function) aFunction = @@ -866,7 +866,7 @@ Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetVertexByIndex if (aRefShape.IsNull()) return NULL; //Add a new Vertex object - Handle(GEOM_Object) aVertex = GetEngine()->AddObject(GetDocID(), GEOM_POINT); + Handle(GEOM_Object) aVertex = GetEngine()->AddObject(GEOM_POINT); //Add a function Handle(GEOM_Function) aFunction = @@ -915,7 +915,7 @@ Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetNormal if (theFace.IsNull()) return NULL; //Add a new Normale object - Handle(GEOM_Object) aNorm = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR); + Handle(GEOM_Object) aNorm = GetEngine()->AddObject(GEOM_VECTOR); //Add a new Normale function Handle(GEOM_Function) aFunction = @@ -1157,7 +1157,7 @@ Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetBoundingBox if (theShape.IsNull()) return NULL; //Add a new BoundingBox object - Handle(GEOM_Object) aBnd = GetEngine()->AddObject(GetDocID(), GEOM_BOX); + Handle(GEOM_Object) aBnd = GetEngine()->AddObject(GEOM_BOX); //Add a new BoundingBox function const int aType = (precise ? BND_BOX_MEASURE_PRECISE : BND_BOX_MEASURE); diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx index abc02def7..5bab33810 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx @@ -41,7 +41,7 @@ class GEOM_Object; class GEOMImpl_IMeasureOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IMeasureOperations(); enum ShapeKind { diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index fd5f459f9..d24cc9c8a 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -168,8 +168,8 @@ namespace * constructor: */ //============================================================================= -GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations"); } @@ -197,7 +197,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdge if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL; //Add a new Edge object - Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE); + Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -252,7 +252,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdgeOnCurveByLength if (theRefCurve.IsNull()) return NULL; //Add a new Edge object - Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE); + Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -311,7 +311,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdgeWire if (theWire.IsNull()) return NULL; //Add a new Edge object - Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE); + Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -377,7 +377,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeWire SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aWire = GetEngine()->AddObject(GetDocID(), GEOM_WIRE); + Handle(GEOM_Object) aWire = GetEngine()->AddObject(GEOM_WIRE); //Add a new function Handle(GEOM_Function) aFunction = @@ -449,7 +449,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFace (Handle(GEOM_Object) th if (theWire.IsNull()) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Shape function for creation of a face from a wire Handle(GEOM_Function) aFunction = @@ -509,7 +509,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWires SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FACE); //Add a new function Handle(GEOM_Function) aFunction = @@ -588,7 +588,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceFromSurface SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FACE); //Add a new function Handle(GEOM_Function) aFunction = @@ -658,7 +658,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWithConstraints SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FILLING); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FILLING); //Add a new function Handle(GEOM_Function) aFunction = @@ -799,7 +799,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeShape SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), theObjectType); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(theObjectType); //Add a new function Handle(GEOM_Function) aFunction = @@ -869,7 +869,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidFromConnectedFaces SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID); + Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GEOM_SOLID); //Add a new function Handle(GEOM_Function) aFunction = @@ -947,7 +947,7 @@ GEOMImpl_IShapesOperations::MakeGlueFaces (std::list< Handle(GEOM_Object) >& the } //Add a new Glued object - Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED); + Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED); //Add a new Glue function Handle(GEOM_Function) aFunction; @@ -1095,7 +1095,7 @@ GEOMImpl_IShapesOperations::MakeGlueFacesByList(std::list< Handle(GEOM_Object) > } //Add a new Glued object - Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED); + Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED); //Add a new Glue function Handle(GEOM_Function) aFunction; @@ -1163,7 +1163,7 @@ GEOMImpl_IShapesOperations::MakeGlueEdges (std::list< Handle(GEOM_Object) >& the } //Add a new Glued object - Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED); + Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED); //Add a new Glue function Handle(GEOM_Function) aFunction; @@ -1344,7 +1344,7 @@ GEOMImpl_IShapesOperations::MakeGlueEdgesByList (std::list< Handle(GEOM_Object) return NULL; } //Add a new Glued object - Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED); + Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED); //Add a new Glue function Handle(GEOM_Function) aFunction; @@ -1452,7 +1452,7 @@ GEOMImpl_IShapesOperations::GetExistingSubObjects(Handle(GEOM_Object) theShap Standard_Integer aStrLen = anEntry.LengthOfCString(); char* anEntryStr = new char[aStrLen+1]; anEntry.ToUTF8CString(anEntryStr); - Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), anEntryStr, false); + Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(anEntryStr, false); if (!anObj.IsNull() ) { bool isGroup = anObj->IsKind(STANDARD_TYPE(GEOM_Object)) && anObj->GetType() == GEOM_GROUP; bool isSubShape = anObj->IsKind(STANDARD_TYPE(GEOM_Object)) && anObj->GetType() != GEOM_GROUP; @@ -1553,7 +1553,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeExplode //anObj = GetEngine()->AddSubShape(theShape, anArray); { - anObj = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE); + anObj = GetEngine()->AddObject(GEOM_SUBSHAPE); Handle(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1); if (aFunction.IsNull()) return aSeq; @@ -1766,7 +1766,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeSubShapes anArray = new TColStd_HArray1OfInteger(1,1); anArray->SetValue(1, id); - anObj = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE); + anObj = GetEngine()->AddObject(GEOM_SUBSHAPE); if (!anObj.IsNull()) { Handle(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1); if (aFunction.IsNull()) return aSeq; @@ -2155,7 +2155,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ReverseShape(Handle(GEOM_Object) /* //Add a new reversed object - Handle(GEOM_Object) aReversed = GetEngine()->AddObject(GetDocID(), theShape->GetType()); + Handle(GEOM_Object) aReversed = GetEngine()->AddObject(theShape->GetType()); //Add a new Revese function Handle(GEOM_Function) aFunction; @@ -2201,7 +2201,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ReverseShape(Handle(GEOM_Object) if (aGen) { GEOMImpl_IHealingOperations* anIHealingOperations = - aGen->GetIHealingOperations(GetDocID()); + aGen->GetIHealingOperations(); aReversed = anIHealingOperations->ChangeOrientationCopy(theShape); SetErrorCode(anIHealingOperations->GetErrorCode()); } @@ -3000,7 +3000,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetShapesOnShapeAsCompound } //Add a new result object - Handle(GEOM_Object) aRes = GetEngine()->AddObject(GetDocID(), GEOM_SHAPES_ON_SHAPE); + Handle(GEOM_Object) aRes = GetEngine()->AddObject(GEOM_SHAPES_ON_SHAPE); Handle(GEOM_Function) aFunction = aRes->AddFunction(GEOMImpl_ShapeDriver::GetID(), SHAPES_ON_SHAPE); aFunction->SetValue(aCompound); @@ -3182,7 +3182,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeExtraction //Add a new Result object Handle(GEOM_Object) aResult = - GetEngine()->AddObject(GetDocID(), GEOM_EXTRACTION); + GetEngine()->AddObject(GEOM_EXTRACTION); //Add a new Extraction function Handle(GEOM_Function) aFunction = @@ -5140,7 +5140,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ExtendEdge } //Add a new Edge object - Handle(GEOM_Object) aResEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE); + Handle(GEOM_Object) aResEdge = GetEngine()->AddObject(GEOM_EDGE); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -5207,7 +5207,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ExtendFace } //Add a new Face object - Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -5273,7 +5273,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSurfaceFromFace } //Add a new Face object - Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Vector function Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx index 2b2631cd6..b6d11a822 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx @@ -78,7 +78,7 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations std::list indices; ///< Shape indices touched by this type of modification. }; - Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IShapesOperations(); Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1, diff --git a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx index 34af46dff..e2046fb0f 100644 --- a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx @@ -77,8 +77,8 @@ */ //============================================================================= -GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations"); } @@ -217,7 +217,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateTwoPointsCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a translate function Handle(GEOM_Function) aFunction = @@ -270,7 +270,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateDXDYDZCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a translate function Handle(GEOM_Function) aFunction = @@ -375,7 +375,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a translate function Handle(GEOM_Function) aFunction = @@ -431,7 +431,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorDistance //Add a translate function if (theCopy) { - aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + aCopy = GetEngine()->AddObject(theObject->GetType()); aFunction = aCopy->AddFunction(GEOMImpl_TranslateDriver::GetID(), TRANSLATE_VECTOR_DISTANCE); } else { @@ -493,7 +493,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate1D if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a translate function Handle(GEOM_Function) aFunction = @@ -552,7 +552,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate2D (Handle(GEOM_Obje if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a translate function Handle(GEOM_Function) aFunction = @@ -806,7 +806,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPlaneCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a mirror function Handle(GEOM_Function) aFunction = @@ -909,7 +909,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPointCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a mirror function Handle(GEOM_Function) aFunction = @@ -1012,7 +1012,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorAxisCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a mirror function Handle(GEOM_Function) aFunction = @@ -1113,7 +1113,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be offset //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a new Offset function Handle(GEOM_Function) aFunction = @@ -1184,7 +1184,7 @@ GEOMImpl_ITransformOperations::ProjectShapeCopy (Handle(GEOM_Object) theSource, else { //Add a new Projection object - aCopy = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION); + aCopy = GetEngine()->AddObject(GEOM_PROJECTION); //Add a Projection function Handle(GEOM_Function) aFunction = @@ -1248,7 +1248,7 @@ Standard_Real GEOMImpl_ITransformOperations::ProjectPointOnWire } //Add a new Projection object - thePointOnEdge = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION); + thePointOnEdge = GetEngine()->AddObject(GEOM_PROJECTION); //Add a Projection function Handle(GEOM_Function) aFunction = thePointOnEdge->AddFunction @@ -1363,7 +1363,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeCopy if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be scaled //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a scale function Handle(GEOM_Function) aFunction = @@ -1429,7 +1429,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeAlongAxes (Handle(G Handle(GEOM_Object) aCopy; //Add a new Copy object Handle(GEOM_Function) aFunction; if (doCopy) { - aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + aCopy = GetEngine()->AddObject(theObject->GetType()); aFunction = aCopy->AddFunction(GEOMImpl_ScaleDriver::GetID(), SCALE_SHAPE_AXES_COPY); } else { @@ -1554,7 +1554,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShapeCopy if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be set in position //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a position function Standard_Integer aType = POSITION_SHAPE_COPY; @@ -1616,7 +1616,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionAlongPath Handle(GEOM_Object) aCopy; if (theCopy) { - aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + aCopy = GetEngine()->AddObject(theObject->GetType()); aFunction = aCopy->AddFunction(GEOMImpl_PositionDriver::GetID(), POSITION_ALONG_PATH); } else @@ -1733,7 +1733,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Objec if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_COPY); @@ -1786,7 +1786,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate1D (Handle(GEOM_Object) if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D); @@ -1841,7 +1841,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate1D (Handle(GEOM_Object) if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D_STEP); @@ -1902,7 +1902,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate2D (Handle(GEOM_Object) if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D); @@ -1965,7 +1965,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate2D (Handle(GEOM_Object) if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D); @@ -2087,7 +2087,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePointsCopy (Handle if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_THREE_POINTS_COPY); @@ -2144,7 +2144,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TransformLikeOtherCopy if (aSampleFunc.IsNull()) return NULL; // There is no function which creates a sample object // Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); // Add a transform function (depends on theSample function) Handle(GEOM_Function) aFunction = @@ -2295,7 +2295,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MakeProjectionOnCylinder //Add a new Projection object Handle(GEOM_Object) aResult = - GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION); + GetEngine()->AddObject(GEOM_PROJECTION); //Add a Projection function Handle(GEOM_Function) aFunction = aResult->AddFunction diff --git a/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx b/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx index 46fb60dcb..c29d1c780 100644 --- a/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx @@ -37,7 +37,7 @@ class GEOMImpl_IRotate; class GEOMImpl_ITransformOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_ITransformOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_ITransformOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_ITransformOperations(); Standard_EXPORT Handle(GEOM_Object) TranslateTwoPoints (Handle(GEOM_Object) theObject, diff --git a/src/GEOMImpl/GEOMImpl_ImportDriver.cxx b/src/GEOMImpl/GEOMImpl_ImportDriver.cxx index 867845185..f512eabd5 100644 --- a/src/GEOMImpl/GEOMImpl_ImportDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ImportDriver.cxx @@ -69,7 +69,7 @@ Standard_Integer GEOMImpl_ImportDriver::Execute(LOGBOOK& log) const return 0; Handle(TColStd_HSequenceOfTransient) aSeq = - GEOMImpl_IECallBack::GetCallBack( aFormatName )->Import( GetDocID(), aFormatName, aFileName ); + GEOMImpl_IECallBack::GetCallBack( aFormatName )->Import( aFormatName, aFileName ); if( aSeq.IsNull() ) return 0; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index 002ae127e..647a1dbd8 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -80,8 +80,9 @@ static QString getParentComponent( _PTR( SObject ) obj ) // purpose : check if the object(s) passed as the the second arguments are used // by the other objects in the study //===================================================================================== -static bool inUse( _PTR(Study) study, const QString& component, const QMap& objects ) +static bool inUse( const QString& component, const QMap& objects ) { + _PTR(Study) study = SalomeApp_Application::getStudy(); _PTR(SObject) comp = study->FindObjectID( component.toLatin1().data() ); if ( !comp ) return false; @@ -161,7 +162,7 @@ static void getGeomChildrenAndFolders( _PTR(SObject) theSO, QMap& geomObjList, QMap& folderList ) { if ( !theSO ) return; - _PTR(Study) aStudy = theSO->GetStudy(); + _PTR(Study) aStudy = SalomeApp_Application::getStudy(); if ( !aStudy ) return; _PTR(UseCaseBuilder) aUseCaseBuilder = aStudy->GetUseCaseBuilder(); @@ -362,8 +363,7 @@ void GEOMToolsGUI::OnEditDelete() return; LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - if ( !aSelMgr || !appStudy ) + if ( !aSelMgr ) return; // get selection @@ -371,7 +371,7 @@ void GEOMToolsGUI::OnEditDelete() if ( selected.IsEmpty() ) return; - _PTR(Study) aStudy = appStudy->studyDS(); + _PTR(Study) aStudy = SalomeApp_Application::getStudy(); _PTR(UseCaseBuilder) aUseCaseBuilder = aStudy->GetUseCaseBuilder(); // check if study is locked @@ -466,7 +466,7 @@ void GEOMToolsGUI::OnEditDelete() } _PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder()); - GEOM_Displayer disp( appStudy ); + GEOM_Displayer disp; disp.SetUpdateColorScale( false ); // IPAL54049 if ( isComponentSelected ) { @@ -479,7 +479,7 @@ void GEOMToolsGUI::OnEditDelete() for ( it->InitEx( false ); it->More(); it->Next() ) { _PTR(SObject) child( it->Value() ); // remove object from GEOM engine - removeObjectWithChildren( child, aStudy, views, &disp ); + removeObjectWithChildren( child, views, &disp ); // remove object from study aStudyBuilder->RemoveObjectWithChildren( child ); // remove object from use case tree @@ -488,7 +488,7 @@ void GEOMToolsGUI::OnEditDelete() } else { // GEOM component is not selected: check if selected objects are in use - if ( inUse( aStudy, geomComp, allDeleted ) && + if ( inUse( geomComp, allDeleted ) && SUIT_MessageBox::question( app->desktop(), QObject::tr("WRN_WARNING"), QObject::tr("DEP_OBJECT"), @@ -501,7 +501,7 @@ void GEOMToolsGUI::OnEditDelete() for ( it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it ) { _PTR(SObject) obj ( aStudy->FindObjectID( it.key().toLatin1().data() ) ); // remove object from GEOM engine - removeObjectWithChildren( obj, aStudy, views, &disp ); + removeObjectWithChildren( obj, views, &disp ); // remove objects from study aStudyBuilder->RemoveObjectWithChildren( obj ); // remove object from use case tree @@ -511,7 +511,7 @@ void GEOMToolsGUI::OnEditDelete() for ( it = toBeDelFolders.begin(); it != toBeDelFolders.end(); ++it ) { _PTR(SObject) obj ( aStudy->FindObjectID( it.key().toLatin1().data() ) ); // remove object from GEOM engine - removeObjectWithChildren( obj, aStudy, views, &disp ); + removeObjectWithChildren( obj, views, &disp ); // remove objects from study aStudyBuilder->RemoveObjectWithChildren( obj ); // remove object from use case tree @@ -530,15 +530,15 @@ void GEOMToolsGUI::OnEditDelete() // purpose : used by OnEditDelete() method //===================================================================================== void GEOMToolsGUI::removeObjectWithChildren(_PTR(SObject) obj, - _PTR(Study) aStudy, QList views, GEOM_Displayer* disp) { + _PTR(Study) aStudy = SalomeApp_Application::getStudy(); // iterate through all children of obj for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) { // for (_PTR(UseCaseIterator) it (aStudy->GetUseCaseBuilder()->GetUseCaseIterator(obj)); it->More(); it->Next()) { _PTR(SObject) child (it->Value()); - removeObjectWithChildren(child, aStudy, views, disp); + removeObjectWithChildren(child, views, disp); } // erase object and remove it from engine @@ -582,8 +582,7 @@ void GEOMToolsGUI::deactivate() { SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( app ) { - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - GEOM_Displayer aDisp (appStudy); + GEOM_Displayer aDisp; aDisp.GlobalSelection(); getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS); } diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.h b/src/GEOMToolsGUI/GEOMToolsGUI.h index c01c580d6..23557233b 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI.h @@ -97,7 +97,6 @@ private: // Recursive deletion of object with children void removeObjectWithChildren( _PTR(SObject), - _PTR(Study), QList, GEOM_Displayer* ); }; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 67ed48db0..1d8917afd 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -168,7 +168,7 @@ void GEOMToolsGUI::OnAutoColor() QList aReservedColors; - GEOM_Displayer displayer ( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -256,7 +256,7 @@ void GEOMToolsGUI::OnColor() aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; // get active view SALOME_View* window = displayer.GetActiveView(); @@ -308,7 +308,7 @@ void GEOMToolsGUI::OnTexture() aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -351,7 +351,7 @@ void GEOMToolsGUI::OnChangeTransparency( bool increase ) aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -396,7 +396,7 @@ void GEOMToolsGUI::OnNbIsos( ActionType actionType ) aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -466,7 +466,7 @@ void GEOMToolsGUI::OnDeflection() aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -496,8 +496,7 @@ void GEOMToolsGUI::OnSelectOnly(int mode) { SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( app ) { - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - GEOM_Displayer aDisp (appStudy); + GEOM_Displayer aDisp; aDisp.GlobalSelection(mode); getGeometryGUI()->setLocalSelectionMode(mode); } @@ -671,7 +670,7 @@ void GEOMToolsGUI::OnEdgeWidth() aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -714,7 +713,7 @@ void GEOMToolsGUI::OnIsosWidth() { aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -756,7 +755,7 @@ void GEOMToolsGUI::OnBringToFront() { aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -782,7 +781,7 @@ void GEOMToolsGUI::OnClsBringToFront() { SalomeApp_Study* appStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() ); if ( !appStudy ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -821,7 +820,7 @@ void GEOMToolsGUI::OnSetMaterial( const QVariant& theParam ) if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( study ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx index 58a79a562..1773209c1 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx @@ -237,7 +237,7 @@ void GEOMToolsGUI_MarkerDlg::accept() } } } - GEOM_Displayer displayer( getStudy() ); + GEOM_Displayer displayer; displayer.Redisplay( selected, true ); selMgr->setSelectedObjects( selected ); } @@ -277,7 +277,7 @@ void GEOMToolsGUI_MarkerDlg::init() // --- GEOM::GEOM_Gen_var engine = GeometryGUI::GetGeomGen(); - myOperation = engine->GetIInsertOperations( getStudy()->id() ); + myOperation = engine->GetIInsertOperations(); GEOM::ListOfLong_var ids = myOperation->GetAllTextures(); for ( int i = 0; i < ids->length(); i++ ) addTexture( ids[i] ); @@ -339,7 +339,7 @@ void GEOMToolsGUI_MarkerDlg::addTexture( int id, bool select ) const if ( id > 0 && myCustomTypeCombo->index( id ) == -1 ) { int tWidth, tHeight; - Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(getStudy(), id, tWidth, tHeight); + Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(id, tWidth, tHeight); if ( !texture.IsNull() && texture->Length() == tWidth*tHeight/8 ) { QImage image( tWidth, tHeight, QImage::Format_Mono ); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx index ec83532bc..baedb6740 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx @@ -141,22 +141,22 @@ GEOMToolsGUI_PublishDlg::~GEOMToolsGUI_PublishDlg() if ( appStudy ) { _PTR(Study) aStudy = appStudy->studyDS(); if ( aStudy ) { - GEOM_Displayer displayer ( appStudy ); - QTreeWidgetItemIterator it( myTreeWidget ); - while ( *it ) { - QString entry = myEntryToItem.key( *it ); - _PTR(SObject) SO ( aStudy->FindObjectID( qPrintable( entry ) ) ); - if ( SO ) { - GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) ); - if ( CORBA::is_nil( aGeomObject ) ) continue; - if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) { - Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" ); - displayer.Erase( io ); - } - } - ++it; - } - displayer.UpdateViewer(); + GEOM_Displayer displayer; + QTreeWidgetItemIterator it( myTreeWidget ); + while ( *it ) { + QString entry = myEntryToItem.key( *it ); + _PTR(SObject) SO ( aStudy->FindObjectID( qPrintable( entry ) ) ); + if ( SO ) { + GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) ); + if ( CORBA::is_nil( aGeomObject ) ) continue; + if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) { + Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" ); + displayer.Erase( io ); + } + } + ++it; + } + displayer.UpdateViewer(); } } } @@ -185,15 +185,7 @@ void GEOMToolsGUI_PublishDlg::initData() { if(!myGeomRoot) return; - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - if(!appStudy ) - return; - - _PTR(Study) aStudy = appStudy->studyDS(); - if(!aStudy) - return; - - buildTree(aStudy, myGeomRoot); + buildTree(myGeomRoot); myTreeWidget->resizeColumnToContents(0); myTreeWidget->resizeColumnToContents(1); @@ -231,7 +223,7 @@ QTreeWidgetItem* GEOMToolsGUI_PublishDlg::createItem(QTreeWidgetItem* theParent, // function : findParentItem() // purpose : //================================================================================= -QTreeWidgetItem* GEOMToolsGUI_PublishDlg::findParentItem(_PTR(Study) theStudy, SalomeApp_DataObject* theObject, BufferedList& theList ) { +QTreeWidgetItem* GEOMToolsGUI_PublishDlg::findParentItem(SalomeApp_DataObject* theObject, BufferedList& theList ) { QTreeWidgetItem* aResult = NULL; SalomeApp_DataObject* aParrent = dynamic_cast(theObject->parent()); @@ -240,14 +232,14 @@ QTreeWidgetItem* GEOMToolsGUI_PublishDlg::findParentItem(_PTR(Study) theStudy, S if( !(aResult = myEntryToItem.value(targetEntry)) ) { if( aParrent != myGeomRoot ) { QString aName; - _PTR(SObject) aSO ( theStudy->FindObjectID(qPrintable(aParrent->entry()))); + _PTR(SObject) aSO ( SalomeApp_Application::getStudy()->FindObjectID(qPrintable(aParrent->entry()))); _PTR(GenericAttribute) anAttr; if ( aSO->FindAttribute(anAttr, "AttributeName") ) { _PTR(AttributeName) anAttrName (anAttr); aName = anAttrName->Value().c_str(); } theList.push_front(qMakePair(targetEntry, aName)); - aResult = findParentItem(theStudy,aParrent,theList); + aResult = findParentItem(aParrent,theList); } else { //Publish List for(int i = 0; i < theList.size(); i++ ) { @@ -270,7 +262,7 @@ QTreeWidgetItem* GEOMToolsGUI_PublishDlg::findParentItem(_PTR(Study) theStudy, S // function : buildTree() // purpose : //================================================================================= -void GEOMToolsGUI_PublishDlg::buildTree(_PTR(Study) theStudy, SalomeApp_DataObject* theItem) { +void GEOMToolsGUI_PublishDlg::buildTree(SalomeApp_DataObject* theItem) { if(!theItem || theItem->isReference()) return; @@ -278,7 +270,7 @@ void GEOMToolsGUI_PublishDlg::buildTree(_PTR(Study) theStudy, SalomeApp_DataObje //If object hasn't "AttributeDrawable" => it visible bool isDrawable = true; - _PTR(SObject) SO ( theStudy->FindObjectID(qPrintable(theItem->entry()))); + _PTR(SObject) SO ( SalomeApp_Application::getStudy()->FindObjectID(qPrintable(theItem->entry()))); _PTR(GenericAttribute) anAttr; if ( SO && SO->FindAttribute(anAttr, "AttributeDrawable") ) { _PTR(AttributeDrawable) aDrw (anAttr); @@ -292,7 +284,7 @@ void GEOMToolsGUI_PublishDlg::buildTree(_PTR(Study) theStudy, SalomeApp_DataObje aName = aAttrName->Value().c_str(); } BufferedList aList; - QTreeWidgetItem* parentItem = findParentItem(theStudy, theItem, aList); + QTreeWidgetItem* parentItem = findParentItem(theItem, aList); createItem(parentItem,qMakePair(theItem->entry(),aName),true); } } @@ -300,7 +292,7 @@ void GEOMToolsGUI_PublishDlg::buildTree(_PTR(Study) theStudy, SalomeApp_DataObje DataObjectList listObj = theItem->children( false ); DataObjectList::iterator itr = listObj.begin(); while( itr != listObj.end()) { - buildTree(theStudy, dynamic_cast(*itr)); + buildTree(dynamic_cast(*itr)); itr++; } } @@ -458,7 +450,7 @@ void GEOMToolsGUI_PublishDlg::onItemClicked(QTreeWidgetItem* theItem, int theCol if ( !SO ) return; GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) ); if ( CORBA::is_nil( aGeomObject ) ) return; - GEOM_Displayer displayer ( appStudy ); + GEOM_Displayer displayer; SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" ); if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) { diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.h b/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.h index e36392bbf..6b68eb01f 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.h @@ -59,8 +59,8 @@ public: protected: void initData(); - void buildTree(_PTR(Study) theStudy, SalomeApp_DataObject* theItem); - QTreeWidgetItem* findParentItem(_PTR(Study) theStudy, SalomeApp_DataObject* theItem, BufferedList& theList); + void buildTree(SalomeApp_DataObject* theItem); + QTreeWidgetItem* findParentItem(SalomeApp_DataObject* theItem, BufferedList& theList); QTreeWidgetItem* createItem(QTreeWidgetItem* theItem, Pair theAttributes, bool isCheckable); void getDrawableList(QTreeWidgetItem* theItem, QList& theList); void getTails(QTreeWidgetItem* theItem, QList& theList); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx index d5b11a3fc..9ef66592a 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx @@ -42,8 +42,7 @@ #include GEOMToolsGUI_ReduceStudyDlg::GEOMToolsGUI_ReduceStudyDlg( QWidget* parent ) -:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), -myDisplayer(NULL) +:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); myVisible = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) ); @@ -51,9 +50,8 @@ myDisplayer(NULL) myApp = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( !myApp ) return; - SalomeApp_Study* study = dynamic_cast( myApp->activeStudy() ); - myStudy = dynamic_cast( myApp->activeStudy() )->studyDS(); - myDisplayer = GEOM_Displayer( study ); + + myDisplayer = GEOM_Displayer(); setWindowTitle( tr( "GEOM_REDUCE_STUDY_TITLE" ) ); setAttribute(Qt::WA_DeleteOnClose); @@ -164,9 +162,8 @@ void GEOMToolsGUI_ReduceStudyDlg::init( const std::set& theObjectEn GEOM::string_array_var subObjects = new GEOM::string_array(); GEOM::string_array_var otherObjects = new GEOM::string_array(); - GeometryGUI::GetGeomGen()->GetEntriesToReduceStudy( GeometryGUI::ClientStudyToStudy( myStudy ), - keptObjects, parentsObjects, - subObjects, otherObjects ); + GeometryGUI::GetGeomGen()->GetEntriesToReduceStudy( keptObjects, parentsObjects, + subObjects, otherObjects ); for ( int i = 0; i < keptObjects->length(); i++ ) myKeptObjects.insert( keptObjects[i].in() ); @@ -269,7 +266,7 @@ void GEOMToolsGUI_ReduceStudyDlg::addObjectsToTree( QTreeWidget* theWidget, std: std::set::iterator it; for( it = theObjects.begin(); it != theObjects.end(); ++it ) { std::string objectEntry = *it; - GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( myStudy->StudyId(), objectEntry.c_str() ); + GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( objectEntry.c_str() ); GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject ); QString studyEntry = GeomBaseObject->GetStudyEntry(); if( GeomObject->_is_nil() || studyEntry.isEmpty() || !isObjectDrawable( studyEntry.toStdString() ) ) @@ -372,10 +369,11 @@ void GEOMToolsGUI_ReduceStudyDlg::checkVisibleIcon( QTreeWidget* theWidget ) //================================================================================= bool GEOMToolsGUI_ReduceStudyDlg::isObjectDrawable( std::string theStudyEntry ) { - _PTR(StudyBuilder) aStudyBuilder = myStudy->NewBuilder(); + _PTR(Study) aStudy = SalomeApp_Application::getStudy(); + _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder(); //If object hasn't "AttributeDrawable" => it visible bool isDrawable = true; - _PTR(SObject) SO ( myStudy->FindObjectID( theStudyEntry ) ); + _PTR(SObject) SO ( aStudy->FindObjectID( theStudyEntry ) ); _PTR(GenericAttribute) anAttr; if ( SO && SO->FindAttribute( anAttr, "AttributeDrawable" ) ) { _PTR(AttributeDrawable) aDrw (anAttr); @@ -390,23 +388,23 @@ bool GEOMToolsGUI_ReduceStudyDlg::isObjectDrawable( std::string theStudyEntry ) //================================================================================= void GEOMToolsGUI_ReduceStudyDlg::unpublishObjects( std::set& theObjects ) { - _PTR(StudyBuilder) aStudyBuilder = myStudy->NewBuilder(); + _PTR(Study) aStudy = SalomeApp_Application::getStudy(); + _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder(); std::set::iterator it; for( it = theObjects.begin(); it != theObjects.end(); ++it ) { std::string objectEntry = *it; - GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( myStudy->StudyId(), - objectEntry.c_str() ); + GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( objectEntry.c_str() ); std::string studyEntry = GeomBaseObject->GetStudyEntry(); if ( studyEntry == "" || !isObjectDrawable( studyEntry ) ) continue; - _PTR(SObject) obj ( myStudy->FindObjectID( studyEntry.c_str() ) ); + _PTR(SObject) obj ( aStudy->FindObjectID( studyEntry.c_str() ) ); _PTR(GenericAttribute) anAttr; if ( obj ) { _PTR(AttributeDrawable) aDrw = aStudyBuilder->FindOrCreateAttribute( obj, "AttributeDrawable" ); aDrw->SetDrawable( false ); myDisplayer.EraseWithChildren( new SALOME_InteractiveObject( studyEntry.c_str(), "GEOM", "TEMP_IO" ) ); // hide references if any - std::vector< _PTR(SObject) > vso = myStudy->FindDependances(obj); + std::vector< _PTR(SObject) > vso = aStudy->FindDependances(obj); for ( int i = 0; i < vso.size(); i++ ) { _PTR(SObject) refObj = vso[i]; aDrw = aStudyBuilder->FindOrCreateAttribute( refObj, "AttributeDrawable" ); @@ -427,8 +425,7 @@ void GEOMToolsGUI_ReduceStudyDlg::removeObjects( std::set& theObjec std::set::iterator it; for( it = theObjects.begin(); it != theObjects.end(); ++it ) { std::string objectEntry = *it; - GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( myStudy->StudyId(), - objectEntry.c_str() ); + GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( objectEntry.c_str() ); std::string studyEntry = GeomBaseObject->GetStudyEntry(); if ( studyEntry == "" ) GeometryGUI::GetGeomGen()->RemoveObject( GeomBaseObject ); @@ -449,10 +446,11 @@ void GEOMToolsGUI_ReduceStudyDlg::removeObjects( std::set& theObjec void GEOMToolsGUI_ReduceStudyDlg::removeObject( std::string& theStudyEntry ) { SalomeApp_Study* appStudy = dynamic_cast( myApp->activeStudy() ); - _PTR(StudyBuilder) aStudyBuilder = myStudy->NewBuilder(); - _PTR(UseCaseBuilder) aUseCaseBuilder = myStudy->GetUseCaseBuilder(); + _PTR(Study) aStudy = SalomeApp_Application::getStudy(); + _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder(); + _PTR(UseCaseBuilder) aUseCaseBuilder = aStudy->GetUseCaseBuilder(); - _PTR(SObject) obj ( myStudy->FindObjectID( theStudyEntry.c_str() ) ); + _PTR(SObject) obj ( aStudy->FindObjectID( theStudyEntry.c_str() ) ); if ( obj ) { // remove visual properties of the object appStudy->removeObjectProperties(obj->GetID().c_str()); @@ -474,10 +472,11 @@ void GEOMToolsGUI_ReduceStudyDlg::removeEmptyFolders() { std::set emptyFolders; - _PTR(SComponent) SC ( myStudy->FindComponent( "GEOM" ) ); + _PTR(Study) aStudy = SalomeApp_Application::getStudy(); + _PTR(SComponent) SC ( aStudy->FindComponent( "GEOM" ) ); if ( !SC ) return; - _PTR(ChildIterator) anIter ( myStudy->NewChildIterator( SC ) ); + _PTR(ChildIterator) anIter ( aStudy->NewChildIterator( SC ) ); anIter->InitEx( true ); while( anIter->More() ) { _PTR(SObject) valSO ( anIter->Value() ); @@ -502,7 +501,7 @@ void GEOMToolsGUI_ReduceStudyDlg::removeEmptyFolders() //================================================================================= void GEOMToolsGUI_ReduceStudyDlg::getEmptyFolders( _PTR(SObject) theSO, std::set& theFolders ) { - _PTR(UseCaseBuilder) aUseCaseBuilder = myStudy->GetUseCaseBuilder(); + _PTR(UseCaseBuilder) aUseCaseBuilder = SalomeApp_Application::getStudy()->GetUseCaseBuilder(); bool isFolder = false; _PTR(GenericAttribute) anAttr; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.h b/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.h index f27efa5a1..a5a17ae0c 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.h @@ -120,7 +120,6 @@ private: GEOM_Displayer myDisplayer; SalomeApp_Application* myApp; - _PTR(Study) myStudy; }; diff --git a/src/GEOM_I/GEOM_BaseObject_i.cc b/src/GEOM_I/GEOM_BaseObject_i.cc index abf15301f..3575672b4 100644 --- a/src/GEOM_I/GEOM_BaseObject_i.cc +++ b/src/GEOM_I/GEOM_BaseObject_i.cc @@ -83,17 +83,6 @@ char* GEOM_BaseObject_i::GetEntry() return CORBA::string_dup(anEntstr); } -//============================================================================= -/*! - * GetStudyID - */ -//============================================================================= - -CORBA::Long GEOM_BaseObject_i::GetStudyID() -{ - return _impl->GetDocID(); -} - //============================================================================= /*! * GetType @@ -184,7 +173,7 @@ GEOM::ListOfGBO* GEOM_BaseObject_i::GetDependency() HANDLE_NAMESPACE(GEOM_BaseObject) anObj = HANDLE_NAMESPACE(GEOM_BaseObject)::DownCast(aSeq->Value(i)); if (anObj.IsNull()) continue; TDF_Tool::Entry(anObj->GetEntry(), anEntry); - GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetDocID(), (char*) anEntry.ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject((char*) anEntry.ToCString()); aList[i-1] = obj; } @@ -213,8 +202,7 @@ GEOM::ListOfGBO* GEOM_BaseObject_i::GetLastDependency() for (int i = 1; i<=aLength; i++) { HANDLE_NAMESPACE(GEOM_BaseObject) anObj = HANDLE_NAMESPACE(GEOM_BaseObject)::DownCast(aSeq->Value(i)); if (anObj.IsNull()) continue; - GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetDocID(), - anObj->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetEntryString().ToCString()); aList[i-1] = GEOM::GEOM_BaseObject::_duplicate( obj ); } diff --git a/src/GEOM_I/GEOM_BaseObject_i.hh b/src/GEOM_I/GEOM_BaseObject_i.hh index a9966da60..fb103ddc3 100644 --- a/src/GEOM_I/GEOM_BaseObject_i.hh +++ b/src/GEOM_I/GEOM_BaseObject_i.hh @@ -42,8 +42,6 @@ class GEOM_I_EXPORT GEOM_BaseObject_i : public virtual POA_GEOM::GEOM_BaseObject virtual char* GetEntry(); - virtual CORBA::Long GetStudyID(); - virtual CORBA::Long GetType(); virtual CORBA::Long GetTick(); diff --git a/src/GEOM_I/GEOM_DumpPython.cc b/src/GEOM_I/GEOM_DumpPython.cc index eb79a3ff9..d948bc966 100644 --- a/src/GEOM_I/GEOM_DumpPython.cc +++ b/src/GEOM_I/GEOM_DumpPython.cc @@ -83,12 +83,11 @@ void ConvertV6toV7( TCollection_AsciiString& theScript ) //purpose : //======================================================================= -Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy, - CORBA::Boolean isPublished, - CORBA::Boolean isMultiFile, +Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Boolean isPublished, + CORBA::Boolean isMultiFile, CORBA::Boolean& isValidScript) { - SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy); + SALOMEDS::Study_var aStudy = getStudyServant(); if(CORBA::is_nil(aStudy)) return new Engines::TMPFile(0); @@ -151,7 +150,7 @@ Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy, } TCollection_AsciiString aScript; - aScript += _impl->DumpPython(aStudy->StudyId(), objectDataVec, aVariableMap, isPublished, isMultiFile, isValidScript); + aScript += _impl->DumpPython(objectDataVec, aVariableMap, isPublished, isMultiFile, isValidScript); if (isPublished) { diff --git a/src/GEOM_I/GEOM_Field_i.cc b/src/GEOM_I/GEOM_Field_i.cc index 6b0f6ca44..bd127842c 100644 --- a/src/GEOM_I/GEOM_Field_i.cc +++ b/src/GEOM_I/GEOM_Field_i.cc @@ -69,8 +69,7 @@ GEOM::GEOM_Object_ptr GEOM_Field_i::GetShape() HANDLE_NAMESPACE(GEOM_Object) shape = _impl->GetShape(); if ( !shape.IsNull() ) { - GEOM::GEOM_BaseObject_var obj = _engine->GetObject( shape->GetDocID(), - shape->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject( shape->GetEntryString().ToCString()); shapeVar = GEOM::GEOM_Object::_narrow( obj ); } return shapeVar._retn(); @@ -138,8 +137,7 @@ GEOM::GEOM_FieldStep_ptr GEOM_Field_i::AddStep(::CORBA::Long stepID, ::CORBA::Lo HANDLE_NAMESPACE(GEOM_FieldStep) step = _impl->AddStep( stepID, stamp ); if ( !step.IsNull() ) { - GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetDocID(), - step->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetEntryString().ToCString()); stepVar = GEOM::GEOM_FieldStep::_narrow( obj ); } return stepVar._retn(); @@ -201,8 +199,7 @@ GEOM::GEOM_FieldStep_ptr GEOM_Field_i::GetStep(CORBA::Long stepID) HANDLE_NAMESPACE(GEOM_FieldStep) step = _impl->GetStep(stepID); if ( !step.IsNull() ) { - GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetDocID(), - step->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetEntryString().ToCString()); stepVar = GEOM::GEOM_FieldStep::_narrow( obj ); } return stepVar._retn(); @@ -291,8 +288,7 @@ GEOM::GEOM_Field_ptr GEOM_FieldStep_i::GetField() HANDLE_NAMESPACE(GEOM_Field) field = _impl->GetField(); if ( !field.IsNull() ) { - GEOM::GEOM_BaseObject_var obj = _engine->GetObject( field->GetDocID(), - field->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject( field->GetEntryString().ToCString()); fieldVar = GEOM::GEOM_Field::_narrow( obj ); } return fieldVar._retn(); diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index 782124624..553a763e8 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -176,15 +176,13 @@ char* GEOM_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, CORBA::Boolean isMultiFile, CORBA::Boolean isASCII) { - SALOMEDS::Study_var aStudy = theSObject->GetStudy(); - HANDLE_NAMESPACE(GEOM_BaseObject) anObject = - _impl->GetObject(aStudy->StudyId(), aLocalPersistentID); + _impl->GetObject(aLocalPersistentID); if ( !anObject.IsNull() ) { TCollection_AsciiString anEntry; TDF_Tool::Entry(anObject->GetEntry(), anEntry); - GEOM::GEOM_BaseObject_var obj = GetObject(anObject->GetDocID(), anEntry.ToCString()); + GEOM::GEOM_BaseObject_var obj = GetObject(anEntry.ToCString()); CORBA::String_var aPersRefString = _orb->object_to_string(obj); return CORBA::string_dup(aPersRefString); @@ -210,24 +208,24 @@ bool GEOM_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) // function : PublishInStudy // purpose : //============================================================================ -SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, +SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject, const char* theName) throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); SALOMEDS::SObject_var aResultSO; - if(CORBA::is_nil(theObject) || theStudy->_is_nil()) return aResultSO; + SALOMEDS::Study_var aStudy = getStudyServant(); + if(CORBA::is_nil(theObject) || aStudy->_is_nil()) return aResultSO; GEOM::GEOM_BaseObject_var aBaseObj = GEOM::GEOM_BaseObject::_narrow(theObject); GEOM::GEOM_Object_var aShape = GEOM::GEOM_Object::_narrow(theObject); if(aBaseObj->_is_nil()) return aResultSO; SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); - SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder(); - SALOMEDS::SComponent_var aFather = theStudy->FindComponent("GEOM"); + SALOMEDS::SComponent_var aFather = aStudy->FindComponent("GEOM"); if (aFather->_is_nil()) { aFather = aStudyBuilder->NewComponent("GEOM"); anAttr = aStudyBuilder->FindOrCreateAttribute(aFather, "AttributeName"); @@ -265,7 +263,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, // recieve current TopoDS shape CORBA::String_var entry = aShape->GetEntry(); HANDLE_NAMESPACE(GEOM_Object) aGShape = HANDLE_NAMESPACE(GEOM_Object)::DownCast - ( _impl->GetObject( aShape->GetStudyID(), entry )); + ( _impl->GetObject( entry )); TopoDS_Shape TopoSh = aGShape->GetValue(); // find label of main shape GEOM::GEOM_Object_var aMainSh = aShape; @@ -273,7 +271,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, aMainSh = aMainSh->GetMainShape(); } entry = aMainSh->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anObj = _impl->GetObject( aMainSh->GetStudyID(), entry ); + HANDLE_NAMESPACE(GEOM_BaseObject) anObj = _impl->GetObject( entry ); TDF_Label aMainLbl = anObj->GetFunction(1)->GetNamingEntry(); // check all named shapes using iterator @@ -295,7 +293,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, // END: try to find existed name for current shape if ( mytype == GEOM_GROUP ) { - GEOM::GEOM_IGroupOperations_var anOp = GetIGroupOperations( theStudy->StudyId() ); + GEOM::GEOM_IGroupOperations_var anOp = GetIGroupOperations(); switch ( (TopAbs_ShapeEnum)anOp->GetType( aShape )) { case TopAbs_VERTEX: aResultSO->SetAttrString("AttributePixMap","ICON_OBJBROWSER_GROUP_PNT" ); @@ -403,7 +401,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_var obj; do { anObjectName = aNamePrefix + TCollection_AsciiString(++i); - obj = theStudy->FindObject( anObjectName.ToCString() ); + obj = aStudy->FindObject( anObjectName.ToCString() ); } while ( !obj->_is_nil() ); } @@ -422,11 +420,11 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, //Set NoteBook variables used in the object creation TCollection_AsciiString aVars; CORBA::String_var aString=aBaseObj->GetParameters(); - SALOMEDS::ListOfListOfStrings_var aSections = theStudy->ParseVariables(aString); + SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aString); for(int i = 0, n = aSections->length(); i < n; i++) { SALOMEDS::ListOfStrings aListOfVars = aSections[i]; for(int j = 0, m = aListOfVars.length(); j < m; j++) { - if(theStudy->IsVariable(aListOfVars[j].in())) + if(aStudy->IsVariable(aListOfVars[j].in())) aVars += aListOfVars[j].in(); if(j != m-1) aVars += ":"; @@ -452,8 +450,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, // function : CreateAndPublishGroup // purpose : auxilary for PublishNamedShapesInStudy //============================================================================ -void GEOM_Gen_i::CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_var theMainShape, +void GEOM_Gen_i::CreateAndPublishGroup(GEOM::GEOM_Object_var theMainShape, const TopTools_IndexedMapOfShape& anIndices, const TopTools_SequenceOfShape& SeqS, const TColStd_SequenceOfAsciiString& SeqN, @@ -461,15 +458,15 @@ void GEOM_Gen_i::CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy, GEOM::ListOfGO_var aResList) { CORBA::String_var entry = theMainShape->GetEntry(); - //HANDLE_NAMESPACE(GEOM_Object) aMainShape = _impl->GetObject(theMainShape->GetStudyID(), entry); + //HANDLE_NAMESPACE(GEOM_Object) aMainShape = _impl->GetObject(entry); Handle(TColStd_HArray1OfInteger) anArray; if(SeqS.Length()>0) { // create a group - GEOM::GEOM_IGroupOperations_var GOp = GetIGroupOperations(theStudy->StudyId()); + GEOM::GEOM_IGroupOperations_var GOp = GetIGroupOperations(); GEOM::GEOM_Object_wrap GrObj = GOp->CreateGroup( theMainShape, SeqS(1).ShapeType() ); - AddInStudy(theStudy, GrObj, GrName, theMainShape._retn()); + AddInStudy(GrObj, GrName, theMainShape._retn()); //CORBA::String_var GrEntry = GrObj->GetEntry(); - //HANDLE_NAMESPACE(GEOM_Object) HGrObj = _impl->GetObject(GrObj->GetStudyID(), GrEntry); + //HANDLE_NAMESPACE(GEOM_Object) HGrObj = _impl->GetObject(GrEntry); // add named objects //HANDLE_NAMESPACE(GEOM_Object) anObj; for(int i=1; i<=SeqS.Length(); i++) { @@ -478,7 +475,7 @@ void GEOM_Gen_i::CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy, Standard_Integer anIndex = anIndices.FindIndex(aValue); //anArray->SetValue(1, anIndex); GOp->AddObject(GrObj,anIndex); - //anObj = GEOM_Engine::GetEngine()->AddObject(aMainShape->GetDocID(), GEOM_SUBSHAPE); + //anObj = GEOM_Engine::GetEngine()->AddObject(GEOM_SUBSHAPE); //if (anObj.IsNull()) continue; //HANDLE_NAMESPACE(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1); //if (aFunction.IsNull()) continue; @@ -490,8 +487,8 @@ void GEOM_Gen_i::CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy, //SALOMEDS::SObject_var aResultSO; //TCollection_AsciiString anEntry; //TDF_Tool::Entry(anObj->GetEntry(),anEntry); - //GEOM::GEOM_Object_var aGObj = GetObject(anObj->GetDocID(), anEntry.ToCString()); - //AddInStudy(theStudy, aGObj._retn(), SeqN.Value(i).ToCString(), GrObj); + //GEOM::GEOM_Object_var aGObj = GetObject(anEntry.ToCString()); + //AddInStudy(aGObj._retn(), SeqN.Value(i).ToCString(), GrObj); } } } @@ -502,8 +499,7 @@ void GEOM_Gen_i::CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy, // purpose : //============================================================================ GEOM::ListOfGO* GEOM_Gen_i:: - PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy, - //SALOMEDS::SObject_ptr theSObject, + PublishNamedShapesInStudy(//SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject) { //Unexpect aCatch(SALOME_SalomeException); @@ -515,7 +511,7 @@ GEOM::ListOfGO* GEOM_Gen_i:: CORBA::String_var entry = theMainShape->GetEntry(); HANDLE_NAMESPACE(GEOM_Object) aMainShape = HANDLE_NAMESPACE(GEOM_Object)::DownCast - ( _impl->GetObject( theMainShape->GetStudyID(), entry )); + ( _impl->GetObject( entry )); if (aMainShape.IsNull()) return aResList._retn(); TopoDS_Shape MainSh = aMainShape->GetValue(); @@ -555,16 +551,16 @@ GEOM::ListOfGO* GEOM_Gen_i:: TopTools_IndexedMapOfShape anIndices; TopExp::MapShapes(MainSh, anIndices); - CreateAndPublishGroup(theStudy, theMainShape, anIndices, SolidSeqS, SolidSeqN, + CreateAndPublishGroup(theMainShape, anIndices, SolidSeqS, SolidSeqN, "Group_Of_Named_Solids", aResList); - CreateAndPublishGroup(theStudy, theMainShape, anIndices, FaceSeqS, FaceSeqN, + CreateAndPublishGroup(theMainShape, anIndices, FaceSeqS, FaceSeqN, "Group_Of_Named_Faces", aResList); - CreateAndPublishGroup(theStudy, theMainShape, anIndices, EdgeSeqS, EdgeSeqN, + CreateAndPublishGroup(theMainShape, anIndices, EdgeSeqS, EdgeSeqN, "Group_Of_Named_Edges", aResList); - CreateAndPublishGroup(theStudy, theMainShape, anIndices, VertSeqS, VertSeqN, + CreateAndPublishGroup(theMainShape, anIndices, VertSeqS, VertSeqN, "Group_Of_Named_Vertices", aResList); return aResList._retn(); @@ -593,27 +589,27 @@ SALOMEDS::TMPFile* GEOM_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, } // Create a list to store names of created files - SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames; - aSeq->length(1); + SALOMEDS_Tool::ListOfFiles aSeq; + aSeq.reserve(1); // Prepare a file name to open TCollection_AsciiString aNameWithExt(""); if (isMultiFile) aNameWithExt = TCollection_AsciiString((char*)(SALOMEDS_Tool::GetNameFromPath - (theComponent->GetStudy()->URL())).c_str()); + (getStudyServant()->URL())).c_str()); #if OCC_VERSION_MAJOR > 6 aNameWithExt += TCollection_AsciiString("_GEOM.cbf"); #else aNameWithExt += TCollection_AsciiString("_GEOM.sgd"); #endif - aSeq[0] = CORBA::string_dup(aNameWithExt.ToCString()); + aSeq.push_back(CORBA::string_dup(aNameWithExt.ToCString())); // Build a full file name of temporary file TCollection_AsciiString aFullName = TCollection_AsciiString((char*)aTmpDir.c_str()) + aNameWithExt; // Save GEOM component in this file - _impl->Save(theComponent->GetStudy()->StudyId(),(char*) aFullName.ToCString()); + _impl->Save((char*) aFullName.ToCString()); // Conver a file to the byte stream - aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq.in(), isMultiFile); + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq, isMultiFile); // Remove the created file and tmp directory - if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true); + if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq, true); // Return the created byte stream return aStreamFile._retn(); @@ -660,17 +656,17 @@ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, } // Conver the byte stream theStream to a file and place it in tmp directory - SALOMEDS::ListOfFileNames_var aSeq = + SALOMEDS_Tool::ListOfFiles aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.c_str(), isMultiFile); // Prepare a file name to open TCollection_AsciiString aNameWithExt(""); - SALOMEDS::Study_var study = theComponent->GetStudy(); + SALOMEDS::Study_var study = getStudyServant(); #if OCC_VERSION_MAJOR > 6 // Get the file name. int i; - int aLength = aSeq->length(); + int aLength = aSeq.size(); const char *aGeomSgd = "_GEOM.sgd"; const char *aGeomcbf = "_GEOM.cbf"; @@ -695,10 +691,10 @@ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, TCollection_AsciiString aFullName = (TCollection_AsciiString((char*)aTmpDir.c_str()) + aNameWithExt); // Open document - if (!_impl->Load(study->StudyId(),(char*) aFullName.ToCString())) return false; + if (!_impl->Load((char*) aFullName.ToCString())) return false; // Remove the created file and tmp directory - if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true); + if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq, true); // creation of tree nodes for all data objects in the study // to support tree representation customization and drag-n-drop: @@ -737,8 +733,7 @@ CORBA::Boolean GEOM_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent, //============================================================================ void GEOM_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent) { - SALOMEDS::Study_var aStudy= theComponent->GetStudy(); - _impl->Close(aStudy->StudyId()); + _impl->Close(); } //============================================================================ @@ -805,7 +800,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, CORBA::Long theObjectID, SALOMEDS::SObject_ptr theObject) { // Find the current Study and StudyBuilder - SALOMEDS::Study_var aStudy = theObject->GetStudy(); + SALOMEDS::Study_var aStudy = getStudyServant(); SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); SALOMEDS::UseCaseBuilder_var anUseCaseBuilder = aStudy->GetUseCaseBuilder(); SALOMEDS::SObject_var aNewSO; @@ -826,13 +821,13 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, //Create a new GEOM_Object - HANDLE_NAMESPACE(GEOM_Object) anObj = _impl->AddObject(aNewSO->GetStudy()->StudyId(), theObjectID); + HANDLE_NAMESPACE(GEOM_Object) anObj = _impl->AddObject(theObjectID); HANDLE_NAMESPACE(GEOM_Function) aFunction = anObj->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF); aFunction->SetValue(aTopology); TCollection_AsciiString anEntry; TDF_Tool::Entry(anObj->GetEntry(), anEntry); - GEOM::GEOM_BaseObject_var obj = GetObject(anObj->GetDocID(), anEntry.ToCString()); + GEOM::GEOM_BaseObject_var obj = GetObject(anEntry.ToCString()); //Set the study entry of the published GEOM_Object obj->SetStudyEntry(aNewSO->GetID()); @@ -865,26 +860,26 @@ char* GEOM_Gen_i::ComponentDataType() // function : AddInStudy // purpose : //============================================================================ -SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_BaseObject_ptr theObject, +SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (GEOM::GEOM_BaseObject_ptr theObject, const char* theName, GEOM::GEOM_BaseObject_ptr theFather) { SALOMEDS::SObject_var aResultSO; - if(theObject->_is_nil() || theStudy->_is_nil()) return aResultSO; + SALOMEDS::Study_var aStudy = getStudyServant(); + if(theObject->_is_nil() || aStudy->_is_nil()) return aResultSO; - SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); CORBA::String_var IOR; if(!theFather->_is_nil()) { IOR = _orb->object_to_string(theFather); - SALOMEDS::SObject_wrap aFatherSO = theStudy->FindObjectIOR(IOR.in()); + SALOMEDS::SObject_wrap aFatherSO = aStudy->FindObjectIOR(IOR.in()); if(aFatherSO->_is_nil()) return aResultSO._retn(); aResultSO = aStudyBuilder->NewObject(aFatherSO); //aStudyBuilder->Addreference(aResultSO, aResultSO); } - aResultSO = PublishInStudy(theStudy, aResultSO, theObject, theName); + aResultSO = PublishInStudy(aResultSO, theObject, theName); if(aResultSO->_is_nil()) return aResultSO._retn(); GEOM::ListOfGBO_var aList = theObject->GetDependency(); @@ -897,14 +892,14 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (SALOMEDS::Study_ptr theStudy GEOM::GEOM_BaseObject_var anObject = aList[i]; if(anObject->_is_nil()) continue; IOR = _orb->object_to_string(anObject); - SALOMEDS::SObject_wrap aSO = theStudy->FindObjectIOR(IOR.in()); + SALOMEDS::SObject_wrap aSO = aStudy->FindObjectIOR(IOR.in()); if(aSO->_is_nil()) continue; CORBA::String_var anID = aSO->GetID(); if ( aPrevID == anID.in() ) continue; aPrevID = anID.in(); SALOMEDS::SObject_wrap aSubSO = aStudyBuilder->NewObject(aResultSO); aStudyBuilder->Addreference(aSubSO, aSO); - theStudy->GetUseCaseBuilder()->AppendTo( aResultSO, aSubSO ); + aStudy->GetUseCaseBuilder()->AppendTo( aResultSO, aSubSO ); } return aResultSO._retn(); @@ -915,26 +910,26 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (SALOMEDS::Study_ptr theStudy // purpose : Publish sub-shapes, standing for arguments and sub-shapes of arguments. // To be used from python scripts out of geompy.addToStudy (non-default usage) //============================================================================ -GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesO (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, +GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesO (GEOM::GEOM_Object_ptr theObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, CORBA::Boolean theAddPrefix) { GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; - if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject)) + SALOMEDS::Study_var aStudy = getStudyServant(); + if (CORBA::is_nil(aStudy) || CORBA::is_nil(theObject)) return aParts._retn(); // find SObject in the study if it is already published CORBA::String_var anIORo = _orb->object_to_string(theObject); - SALOMEDS::SObject_var aSO = theStudy->FindObjectIOR(anIORo.in()); + SALOMEDS::SObject_var aSO = aStudy->FindObjectIOR(anIORo.in()); //PTv, IMP 0020001, The salome object // is not obligatory in case of invokation from script // if (CORBA::is_nil(aSO)) // return aParts._retn(); - aParts = RestoreSubShapes(theStudy, theObject, aSO, theArgs, + aParts = RestoreSubShapes(theObject, aSO, theArgs, theFindMethod, theInheritFirstArg, theAddPrefix); if (!CORBA::is_nil(aSO)) aSO->UnRegister(); return aParts._retn(); @@ -945,26 +940,25 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesO (SALOMEDS::Study_ptr theStudy, // purpose : Publish sub-shapes, standing for arguments and sub-shapes of arguments. // To be used from python scripts, generated by Dump Python. //============================================================================ -GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesO (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, +GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesO (GEOM::GEOM_Object_ptr theObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, CORBA::Boolean theAddPrefix) { GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; - if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject)) + if (CORBA::is_nil(getStudyServant()) || CORBA::is_nil(theObject)) return aParts._retn(); // find SObject in the study if it is already published CORBA::String_var anIORo = _orb->object_to_string(theObject); - SALOMEDS::SObject_var aSO = theStudy->FindObjectIOR(anIORo.in()); + SALOMEDS::SObject_var aSO = getStudyServant()->FindObjectIOR(anIORo.in()); //PTv, IMP 0020001, The salome object // is not obligatory in case of invokation from script // if (CORBA::is_nil(aSO)) // return aParts._retn(); - aParts = RestoreGivenSubShapes(theStudy, theObject, aSO, theArgs, + aParts = RestoreGivenSubShapes(theObject, aSO, theArgs, theFindMethod, theInheritFirstArg, theAddPrefix); if (!CORBA::is_nil(aSO)) aSO->UnRegister(); return aParts._retn(); @@ -975,15 +969,14 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesO (SALOMEDS::Study_ptr theS // purpose : Publish sub-shapes, standing for arguments and sub-shapes of arguments. // To be used from GUI and from geompy.addToStudy //============================================================================ -GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesSO (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, +GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesSO (SALOMEDS::SObject_ptr theSObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, CORBA::Boolean theAddPrefix) { GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; - if (CORBA::is_nil(theStudy) || CORBA::is_nil(theSObject)) + if (CORBA::is_nil(getStudyServant()) || CORBA::is_nil(theSObject)) return aParts._retn(); SALOMEDS::GenericAttribute_var anAttr; @@ -998,7 +991,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesSO (SALOMEDS::Study_ptr theStudy if (CORBA::is_nil(anO)) return aParts._retn(); - aParts = RestoreSubShapes(theStudy, anO, theSObject, theArgs, + aParts = RestoreSubShapes(anO, theSObject, theArgs, theFindMethod, theInheritFirstArg, theAddPrefix); return aParts._retn(); } @@ -1034,8 +1027,7 @@ static void addToListOfGO( const GEOM::ListOfGO& theSrcList, // purpose : Private method. Works only if both theObject and theSObject // are defined, and does not check, if they correspond to each other. //============================================================================ -GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, +GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(GEOM::GEOM_Object_ptr theObject, SALOMEDS::SObject_ptr theSObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, @@ -1043,9 +1035,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, CORBA::Boolean theAddPrefix) { GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; + SALOMEDS::Study_var aStudy = getStudyServant(); //PTv, IMP 0020001, The salome object // is not obligatory in case of invokation from script - if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/) + if (CORBA::is_nil(aStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/) return aParts._retn(); // For Dump Python (mantis issue 0020768) @@ -1084,12 +1077,12 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, // but only reconstruct its published sub-shapes CORBA::String_var anIOR = _orb->object_to_string(aList[0]); - SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in()); + SALOMEDS::SObject_var anArgSO = aStudy->FindObjectIOR(anIOR.in()); // remember restored objects for Python Dump addToListOfGO(aList[0], anOutArgs); - aParts = RestoreSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject, + aParts = RestoreSubShapesOneLevel(anArgSO, theSObject, theObject, anOutArgs, theFindMethod, theAddPrefix); // set the color of the transformed shape to the color of initial shape @@ -1100,27 +1093,27 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, if (aList[0]->GetMarkerType() == GEOM::MT_USER) theObject->SetMarkerTexture(aList[0]->GetMarkerTexture()); } - - anArgSO->UnRegister(); + if (!CORBA::is_nil(anArgSO)) + anArgSO->UnRegister(); } else { // Get interface, containing method, which we will use to reconstruct sub-shapes - GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId()); - GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId()); - GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId()); + GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(); + GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(); + GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(); PortableServer::Servant aServant = _poa->reference_to_servant(aTrsfOp.in()); GEOM_ITransformOperations_i* aTrsfOpSv = dynamic_cast(aServant); // Reconstruct arguments and tree of sub-shapes of the arguments CORBA::String_var anIOR; - SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); for (Standard_Integer i = 0; i < aLength; i++) { GEOM::GEOM_Object_var anArgO = aList[i]; if (!CORBA::is_nil(anArgO)) { anIOR = _orb->object_to_string(anArgO); - SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in()); + SALOMEDS::SObject_var anArgSO = aStudy->FindObjectIOR(anIOR.in()); TCollection_AsciiString anArgName; if (CORBA::is_nil(anArgSO)) { anArgName = "arg_"; @@ -1145,7 +1138,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anArgO, theObject); if (!CORBA::is_nil(anArgOTrsf)) { CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry); + HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); anArgOTrsfFun->SetDescription(""); aSubO = aShapesOp->GetInPlace(theObject, anArgOTrsf); @@ -1154,7 +1147,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, HANDLE_NAMESPACE(GEOM_Function) anOFun = theObject->GetLastFunction(); if (!anOFun.IsNull()) { CORBA::String_var entryArg = anArgO->GetEntry(); - HANDLE_NAMESPACE(GEOM_Object) anArgOImpl = _impl->GetObject(anArgO->GetStudyID(), entryArg); + HANDLE_NAMESPACE(GEOM_Object) anArgOImpl = _impl->GetObject(entryArg); if (!anArgOImpl.IsNull()) { TopoDS_Shape anArgOShape = anArgOImpl->GetValue(); TopoDS_Shape aMultiArgShape; @@ -1252,7 +1245,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, } aSubName += anArgName; aSubSO = aStudyBuilder->NewObject(theSObject); - aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString()); + aSubSO = PublishInStudy(aSubSO, aSubO, aSubName.ToCString()); // Restore color aSubO->SetColor(anArgO->GetColor()); // set the texture @@ -1268,10 +1261,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, GEOM::ListOfGO_var aSubParts; if (theFindMethod == GEOM::FSM_GetInPlaceByHistory) // pass theObject, because only it has the history - aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, + aSubParts = RestoreSubShapesOneLevel(anArgSO, aSubSO, theObject, anOutArgs, theFindMethod, theAddPrefix); else - aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, + aSubParts = RestoreSubShapesOneLevel(anArgSO, aSubSO, aSubO, anOutArgs, theFindMethod, theAddPrefix); // add to parts list addToListOfGO( aSubParts, aParts ); @@ -1285,7 +1278,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, // Restore published sub-shapes of the argument GEOM::ListOfGO_var aSubParts = - RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, + RestoreSubShapesOneLevel(anArgSO, aSubSO, theObject, anOutArgs, theFindMethod, theAddPrefix); // add to parts list @@ -1312,7 +1305,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, aSubName = "from_parts_of_"; } aSubName += anArgName; - aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString()); + aSubSO = PublishInStudy(aSubSO, aSubO, aSubName.ToCString()); // Restore color aSubO->SetColor(anArgO->GetColor()); // set the texture @@ -1329,7 +1322,8 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, } } } // try to build from published parts - anArgSO->UnRegister(); + if (!CORBA::is_nil(anArgSO)) + anArgSO->UnRegister(); } } // process arguments } @@ -1340,7 +1334,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, aResParts->length(nb); if (nb > 0) { - HANDLE_NAMESPACE(GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetStudyID(), theObject->GetEntry()); + HANDLE_NAMESPACE(GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetEntry()); HANDLE_NAMESPACE(GEOM_Function) aFunction = aMainObj->GetLastFunction(); GEOM::TPythonDump pd (aFunction, true); pd <<"["; @@ -1356,7 +1350,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, anObjEntryMap.insert(anEntry); aResParts[nbRes++] = anObj; // clear python dump of object - HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anEntry); + HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anEntry); HANDLE_NAMESPACE(GEOM_Function) anObjFun = aGeomObj->GetLastFunction(); if ( !anObjFun.IsNull() ) anObjFun->SetDescription( "" ); @@ -1374,7 +1368,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, GEOM::GEOM_Object_var anObj = anOutArgs[ i ]; if (CORBA::is_nil(anObj)) continue; - HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anObj->GetEntry()); + HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetEntry()); if ( j > 0 ) pd << ", "; pd << aGeomObj; @@ -1406,8 +1400,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, // function : RestoreSubShapesOneLevel // purpose : Private method //============================================================================ -GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theOldSO, +GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::SObject_ptr theOldSO, SALOMEDS::SObject_ptr theNewSO, GEOM::GEOM_Object_ptr theNewO, GEOM::ListOfGO& theOutArgs, @@ -1415,24 +1408,25 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th CORBA::Boolean theAddPrefix) { int i = 0; + SALOMEDS::Study_var aStudy = getStudyServant(); GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; GEOM::ListOfGO_var aNewParts = new GEOM::ListOfGO; - if (CORBA::is_nil(theStudy) || CORBA::is_nil(theOldSO) || + if (CORBA::is_nil(aStudy) || CORBA::is_nil(theOldSO) || CORBA::is_nil(theNewO) /*|| CORBA::is_nil(theNewSO)*/) return aParts._retn(); - SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); // Get interface, containing method, which we will use to reconstruct sub-shapes - GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId()); - GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId()); - GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId()); + GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(); + GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(); + GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(); PortableServer::Servant aServant = _poa->reference_to_servant(aTrsfOp.in()); GEOM_ITransformOperations_i* aTrsfOpSv = dynamic_cast(aServant); // Reconstruct published sub-shapes - SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO); + SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(theOldSO); int aLen = 0; for (it->Init(); it->More(); it->Next()) { @@ -1466,7 +1460,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anOldSubO, theNewO); if (!CORBA::is_nil(anArgOTrsf)) { CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry); + HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); anArgOTrsfFun->SetDescription(""); aNewSubO = aShapesOp->GetInPlace(theNewO, anArgOTrsf); @@ -1531,7 +1525,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th } aSubName += anArgName; aNewSubSO = aStudyBuilder->NewObject(theNewSO); - aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); + aNewSubSO = PublishInStudy(aNewSubSO, aNewSubO, aSubName.ToCString()); // Restore color aNewSubO->SetColor(anOldSubO->GetColor()); // set the texture @@ -1545,10 +1539,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th GEOM::ListOfGO_var aSubParts; if (theFindMethod == GEOM::FSM_GetInPlaceByHistory) // pass the main shape as Object, because only it has the history - aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + aSubParts = RestoreSubShapesOneLevel(anOldSubSO, aNewSubSO, theNewO, theOutArgs, theFindMethod, theAddPrefix); else - aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + aSubParts = RestoreSubShapesOneLevel(anOldSubSO, aNewSubSO, aNewSubO, theOutArgs, theFindMethod, theAddPrefix); // add to parts list addToListOfGO( aSubParts, aNewParts ); @@ -1560,7 +1554,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th // Restore published sub-shapes of the argument GEOM::ListOfGO_var aSubParts = - RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + RestoreSubShapesOneLevel(anOldSubSO, aNewSubSO, theNewO, theOutArgs, theFindMethod, theAddPrefix); // add to parts list addToListOfGO( aSubParts, aNewParts ); @@ -1592,7 +1586,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th aSubName = "from_parts_of_"; } aSubName += anArgName; - aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); + aNewSubSO = PublishInStudy(aNewSubSO, aNewSubO, aSubName.ToCString()); // Restore color aNewSubO->SetColor(anOldSubO->GetColor()); // set the texture @@ -1626,8 +1620,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th // List theArgs in this case contains not only operation arguments, // but also all subshapes, which must be published. //============================================================================ -GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, +GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(GEOM::GEOM_Object_ptr theObject, SALOMEDS::SObject_ptr theSObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, @@ -1635,9 +1628,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu CORBA::Boolean theAddPrefix) { GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; + SALOMEDS::Study_var aStudy = getStudyServant(); //PTv, IMP 0020001, The salome object // is not obligatory in case of invokation from script - if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/) + if (CORBA::is_nil(aStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/) return aParts._retn(); // If theArgs list is empty, nothing to do @@ -1684,9 +1678,9 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu // but only reconstruct its published sub-shapes CORBA::String_var anIOR = _orb->object_to_string(aList[0]); - SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in()); + SALOMEDS::SObject_var anArgSO = aStudy->FindObjectIOR(anIOR.in()); - aParts = RestoreGivenSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject, + aParts = RestoreGivenSubShapesOneLevel(anArgSO, theSObject, theObject, anArgs, theFindMethod, theAddPrefix); // set the color of the transformed shape to the color of initial shape @@ -1702,22 +1696,22 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu } else { // Get interface, containing method, which we will use to reconstruct sub-shapes - GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId()); - GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId()); - GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId()); + GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(); + GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(); + GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(); PortableServer::Servant aServant = _poa->reference_to_servant(aTrsfOp.in()); GEOM_ITransformOperations_i* aTrsfOpSv = dynamic_cast(aServant); // Reconstruct arguments and tree of sub-shapes of the arguments CORBA::String_var anIOR; - SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); for (Standard_Integer i = 0; i < nbArgsActual; i++) { GEOM::GEOM_Object_var anArgO = aList[i]; if (!CORBA::is_nil(anArgO)) { anIOR = _orb->object_to_string(anArgO); - SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in()); + SALOMEDS::SObject_var anArgSO = aStudy->FindObjectIOR(anIOR.in()); TCollection_AsciiString anArgName; if (CORBA::is_nil(anArgSO)) { anArgName = "arg_"; @@ -1742,7 +1736,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anArgO, theObject); if (!CORBA::is_nil(anArgOTrsf)) { CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry); + HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); anArgOTrsfFun->SetDescription(""); aSubO = aShapesOp->GetInPlace(theObject, anArgOTrsf); @@ -1801,7 +1795,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu } aSubName += anArgName; aSubSO = aStudyBuilder->NewObject(theSObject); - aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString()); + aSubSO = PublishInStudy(aSubSO, aSubO, aSubName.ToCString()); // Restore color aSubO->SetColor(anArgO->GetColor()); // set the texture @@ -1817,10 +1811,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu GEOM::ListOfGO_var aSubParts; if (theFindMethod == GEOM::FSM_GetInPlaceByHistory) // pass theObject, because only it has the history - aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO, + aSubParts = RestoreGivenSubShapesOneLevel(anArgSO, aSubSO, theObject, anArgs, theFindMethod, theAddPrefix); else - aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO, + aSubParts = RestoreGivenSubShapesOneLevel(anArgSO, aSubSO, aSubO, anArgs, theFindMethod, theAddPrefix); // add to parts list addToListOfGO( aSubParts, aParts ); @@ -1834,7 +1828,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu // Restore published sub-shapes of the argument GEOM::ListOfGO_var aSubParts = - RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO, + RestoreGivenSubShapesOneLevel(anArgSO, aSubSO, theObject, anArgs, theFindMethod, theAddPrefix); // add to parts list @@ -1858,7 +1852,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu aSubName = "from_parts_of_"; } aSubName += anArgName; - aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString()); + aSubSO = PublishInStudy(aSubSO, aSubO, aSubName.ToCString()); // Restore color aSubO->SetColor(anArgO->GetColor()); // set the texture @@ -1886,7 +1880,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu aResParts->length(nb); if (nb > 0) { - HANDLE_NAMESPACE(GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetStudyID(), theObject->GetEntry()); + HANDLE_NAMESPACE(GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetEntry()); HANDLE_NAMESPACE(GEOM_Function) aFunction = aMainObj->GetLastFunction(); GEOM::TPythonDump pd (aFunction, true); pd <<"["; @@ -1902,7 +1896,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu anObjEntryMap.insert(anEntry); aResParts[nbRes++] = anObj; // clear python dump of object - HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anEntry); + HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anEntry); HANDLE_NAMESPACE(GEOM_Function) anObjFun = aGeomObj->GetLastFunction(); if ( !anObjFun.IsNull() ) anObjFun->SetDescription( "" ); @@ -1918,7 +1912,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu GEOM::GEOM_Object_var anObj = theArgs[ i ]; if (CORBA::is_nil(anObj)) continue; - HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anObj->GetEntry()); + HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetEntry()); if ( j > 0 ) pd << ", "; pd << aGeomObj; @@ -1950,8 +1944,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu // function : RestoreGivenSubShapesOneLevel // purpose : Private method //============================================================================ -GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theOldSO, +GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::SObject_ptr theOldSO, SALOMEDS::SObject_ptr theNewSO, GEOM::GEOM_Object_ptr theNewO, std::set theArgs, @@ -1959,24 +1952,25 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr CORBA::Boolean theAddPrefix) { int i = 0; + SALOMEDS::Study_var aStudy = getStudyServant(); GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; GEOM::ListOfGO_var aNewParts = new GEOM::ListOfGO; - if (CORBA::is_nil(theStudy) || CORBA::is_nil(theOldSO) || + if (CORBA::is_nil(aStudy) || CORBA::is_nil(theOldSO) || CORBA::is_nil(theNewO) /*|| CORBA::is_nil(theNewSO)*/) return aParts._retn(); - SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); // Get interface, containing method, which we will use to reconstruct sub-shapes - GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId()); - GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId()); - GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId()); + GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(); + GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(); + GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(); PortableServer::Servant aServant = _poa->reference_to_servant(aTrsfOp.in()); GEOM_ITransformOperations_i* aTrsfOpSv = dynamic_cast(aServant); // Reconstruct published sub-shapes - SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO); + SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(theOldSO); int aLen = 0; for (it->Init(); it->More(); it->Next()) { @@ -2018,7 +2012,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anOldSubO, theNewO); if (!CORBA::is_nil(anArgOTrsf)) { CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry); + HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); anArgOTrsfFun->SetDescription(""); aNewSubO = aShapesOp->GetInPlace(theNewO, anArgOTrsf); @@ -2080,7 +2074,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr } aSubName += anArgName; aNewSubSO = aStudyBuilder->NewObject(theNewSO); - aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); + aNewSubSO = PublishInStudy(aNewSubSO, aNewSubO, aSubName.ToCString()); // Restore color aNewSubO->SetColor(anOldSubO->GetColor()); // set the texture @@ -2094,10 +2088,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr GEOM::ListOfGO_var aSubParts; if (theFindMethod == GEOM::FSM_GetInPlaceByHistory) // pass the main shape as Object, because only it has the history - aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + aSubParts = RestoreGivenSubShapesOneLevel(anOldSubSO, aNewSubSO, theNewO, theArgs, theFindMethod, theAddPrefix); else - aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + aSubParts = RestoreGivenSubShapesOneLevel(anOldSubSO, aNewSubSO, aNewSubO, theArgs, theFindMethod, theAddPrefix); // add to parts list addToListOfGO( aSubParts, aNewParts ); @@ -2109,7 +2103,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr // Restore published sub-shapes of the argument GEOM::ListOfGO_var aSubParts = - RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + RestoreGivenSubShapesOneLevel(anOldSubSO, aNewSubSO, theNewO, theArgs, theFindMethod, theAddPrefix); // add to parts list addToListOfGO( aSubParts, aNewParts ); @@ -2138,7 +2132,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr aSubName = "from_parts_of_"; } aSubName += anArgName; - aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); + aNewSubSO = PublishInStudy(aNewSubSO, aNewSubO, aSubName.ToCString()); // Restore color aNewSubO->SetColor(anOldSubO->GetColor()); // set the texture @@ -2175,29 +2169,43 @@ void GEOM_Gen_i::register_name(char * name) name_service->Register(g, name); } +//============================================================================ +// function : getStudyServant() +// purpose : Get Study +//============================================================================ +SALOMEDS::Study_var GEOM_Gen_i::getStudyServant() +{ + static SALOMEDS::Study_var aStudy; + if(CORBA::is_nil(aStudy)){ + CORBA::Object_ptr anObject = name_service->Resolve("/Study"); + aStudy = SALOMEDS::Study::_narrow(anObject); + } + return aStudy; +} + //============================================================================ // function : Undo // purpose : //============================================================================ -void GEOM_Gen_i::Undo(CORBA::Long theStudyID) +void GEOM_Gen_i::Undo() { - _impl->Undo(theStudyID); + _impl->Undo(); } //============================================================================ // function : Redo // purpose : //============================================================================ -void GEOM_Gen_i::Redo(CORBA::Long theStudyID) +void GEOM_Gen_i::Redo() { - _impl->Redo(theStudyID); + _impl->Redo(); } //============================================================================ // function : GetIBasicOperations // purpose : //============================================================================ -GEOM::GEOM_IBasicOperations_ptr GEOM_Gen_i::GetIBasicOperations(CORBA::Long theStudyID) +GEOM::GEOM_IBasicOperations_ptr GEOM_Gen_i::GetIBasicOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2207,7 +2215,7 @@ GEOM::GEOM_IBasicOperations_ptr GEOM_Gen_i::GetIBasicOperations(CORBA::Long theS //transfer reference on engine GEOM_IBasicOperations_i* aServant = - new GEOM_IBasicOperations_i(_poa, engine, _impl->GetIBasicOperations(theStudyID)); + new GEOM_IBasicOperations_i(_poa, engine, _impl->GetIBasicOperations()); PortableServer::ObjectId_var id = _poa->activate_object(aServant); // activate the CORBA servant @@ -2219,7 +2227,7 @@ GEOM::GEOM_IBasicOperations_ptr GEOM_Gen_i::GetIBasicOperations(CORBA::Long theS // function : GetITransformOperations // purpose : //============================================================================ -GEOM::GEOM_ITransformOperations_ptr GEOM_Gen_i::GetITransformOperations(CORBA::Long theStudyID) +GEOM::GEOM_ITransformOperations_ptr GEOM_Gen_i::GetITransformOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2228,7 +2236,7 @@ GEOM::GEOM_ITransformOperations_ptr GEOM_Gen_i::GetITransformOperations(CORBA::L GEOM::GEOM_Gen_ptr engine = _this(); GEOM_ITransformOperations_i* aServant = - new GEOM_ITransformOperations_i(_poa, engine, _impl->GetITransformOperations(theStudyID)); + new GEOM_ITransformOperations_i(_poa, engine, _impl->GetITransformOperations()); // activate the CORBA servant GEOM::GEOM_ITransformOperations_var operations = aServant->_this(); @@ -2239,7 +2247,7 @@ GEOM::GEOM_ITransformOperations_ptr GEOM_Gen_i::GetITransformOperations(CORBA::L // function : GetI3DPrimOperations // purpose : //============================================================================ -GEOM::GEOM_I3DPrimOperations_ptr GEOM_Gen_i::GetI3DPrimOperations(CORBA::Long theStudyID) +GEOM::GEOM_I3DPrimOperations_ptr GEOM_Gen_i::GetI3DPrimOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2248,7 +2256,7 @@ GEOM::GEOM_I3DPrimOperations_ptr GEOM_Gen_i::GetI3DPrimOperations(CORBA::Long th GEOM::GEOM_Gen_ptr engine = _this(); GEOM_I3DPrimOperations_i* aServant = - new GEOM_I3DPrimOperations_i(_poa, engine, _impl->GetI3DPrimOperations(theStudyID)); + new GEOM_I3DPrimOperations_i(_poa, engine, _impl->GetI3DPrimOperations()); PortableServer::ObjectId_var id = _poa->activate_object(aServant); // activate the CORBA servant @@ -2260,7 +2268,7 @@ GEOM::GEOM_I3DPrimOperations_ptr GEOM_Gen_i::GetI3DPrimOperations(CORBA::Long th // function : GetIShapesOperations // purpose : //============================================================================ -GEOM::GEOM_IShapesOperations_ptr GEOM_Gen_i::GetIShapesOperations(CORBA::Long theStudyID) +GEOM::GEOM_IShapesOperations_ptr GEOM_Gen_i::GetIShapesOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2269,7 +2277,7 @@ GEOM::GEOM_IShapesOperations_ptr GEOM_Gen_i::GetIShapesOperations(CORBA::Long th GEOM::GEOM_Gen_ptr engine = _this(); GEOM_IShapesOperations_i* aServant = - new GEOM_IShapesOperations_i(_poa, engine, _impl->GetIShapesOperations(theStudyID)); + new GEOM_IShapesOperations_i(_poa, engine, _impl->GetIShapesOperations()); // activate the CORBA servant GEOM::GEOM_IShapesOperations_var operations = aServant->_this(); @@ -2280,7 +2288,7 @@ GEOM::GEOM_IShapesOperations_ptr GEOM_Gen_i::GetIShapesOperations(CORBA::Long th // function : GetIBlocksOperations // purpose : //============================================================================ -GEOM::GEOM_IBlocksOperations_ptr GEOM_Gen_i::GetIBlocksOperations(CORBA::Long theStudyID) +GEOM::GEOM_IBlocksOperations_ptr GEOM_Gen_i::GetIBlocksOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2289,7 +2297,7 @@ GEOM::GEOM_IBlocksOperations_ptr GEOM_Gen_i::GetIBlocksOperations(CORBA::Long th GEOM::GEOM_Gen_ptr engine = _this(); GEOM_IBlocksOperations_i* aServant = - new GEOM_IBlocksOperations_i(_poa, engine, _impl->GetIBlocksOperations(theStudyID)); + new GEOM_IBlocksOperations_i(_poa, engine, _impl->GetIBlocksOperations()); // activate the CORBA servant GEOM::GEOM_IBlocksOperations_var operations = aServant->_this(); @@ -2300,7 +2308,7 @@ GEOM::GEOM_IBlocksOperations_ptr GEOM_Gen_i::GetIBlocksOperations(CORBA::Long th // function : GetIBooleanOperations // purpose : //============================================================================ -GEOM::GEOM_IBooleanOperations_ptr GEOM_Gen_i::GetIBooleanOperations(CORBA::Long theStudyID) +GEOM::GEOM_IBooleanOperations_ptr GEOM_Gen_i::GetIBooleanOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2309,7 +2317,7 @@ GEOM::GEOM_IBooleanOperations_ptr GEOM_Gen_i::GetIBooleanOperations(CORBA::Long GEOM::GEOM_Gen_ptr engine = _this(); GEOM_IBooleanOperations_i* aServant = - new GEOM_IBooleanOperations_i(_poa, engine, _impl->GetIBooleanOperations(theStudyID)); + new GEOM_IBooleanOperations_i(_poa, engine, _impl->GetIBooleanOperations()); // activate the CORBA servant GEOM::GEOM_IBooleanOperations_var operations = aServant->_this(); @@ -2320,7 +2328,7 @@ GEOM::GEOM_IBooleanOperations_ptr GEOM_Gen_i::GetIBooleanOperations(CORBA::Long // function : GetICurvesOperations // purpose : //============================================================================ -GEOM::GEOM_ICurvesOperations_ptr GEOM_Gen_i::GetICurvesOperations(CORBA::Long theStudyID) +GEOM::GEOM_ICurvesOperations_ptr GEOM_Gen_i::GetICurvesOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2329,7 +2337,7 @@ GEOM::GEOM_ICurvesOperations_ptr GEOM_Gen_i::GetICurvesOperations(CORBA::Long th GEOM::GEOM_Gen_ptr engine = _this(); GEOM_ICurvesOperations_i* aServant = - new GEOM_ICurvesOperations_i(_poa, engine, _impl->GetICurvesOperations(theStudyID)); + new GEOM_ICurvesOperations_i(_poa, engine, _impl->GetICurvesOperations()); // activate the CORBA servant GEOM::GEOM_ICurvesOperations_var operations = aServant->_this(); @@ -2340,7 +2348,7 @@ GEOM::GEOM_ICurvesOperations_ptr GEOM_Gen_i::GetICurvesOperations(CORBA::Long th // function : GetILocalOperations // purpose : //============================================================================ -GEOM::GEOM_ILocalOperations_ptr GEOM_Gen_i::GetILocalOperations(CORBA::Long theStudyID) +GEOM::GEOM_ILocalOperations_ptr GEOM_Gen_i::GetILocalOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2349,7 +2357,7 @@ GEOM::GEOM_ILocalOperations_ptr GEOM_Gen_i::GetILocalOperations(CORBA::Long theS GEOM::GEOM_Gen_ptr engine = _this(); GEOM_ILocalOperations_i* aServant = - new GEOM_ILocalOperations_i(_poa, engine, _impl->GetILocalOperations(theStudyID)); + new GEOM_ILocalOperations_i(_poa, engine, _impl->GetILocalOperations()); // activate the CORBA servant GEOM::GEOM_ILocalOperations_var operations = aServant->_this(); @@ -2360,7 +2368,7 @@ GEOM::GEOM_ILocalOperations_ptr GEOM_Gen_i::GetILocalOperations(CORBA::Long theS // function : GetIHealingOperations // purpose : //============================================================================ -GEOM::GEOM_IHealingOperations_ptr GEOM_Gen_i::GetIHealingOperations(CORBA::Long theStudyID) +GEOM::GEOM_IHealingOperations_ptr GEOM_Gen_i::GetIHealingOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2369,7 +2377,7 @@ GEOM::GEOM_IHealingOperations_ptr GEOM_Gen_i::GetIHealingOperations(CORBA::Long GEOM::GEOM_Gen_ptr engine = _this(); GEOM_IHealingOperations_i* aServant = - new GEOM_IHealingOperations_i(_poa, engine, _impl->GetIHealingOperations(theStudyID)); + new GEOM_IHealingOperations_i(_poa, engine, _impl->GetIHealingOperations()); // activate the CORBA servant GEOM::GEOM_IHealingOperations_var operations = aServant->_this(); @@ -2380,7 +2388,7 @@ GEOM::GEOM_IHealingOperations_ptr GEOM_Gen_i::GetIHealingOperations(CORBA::Long // function : GetIInsertOperations // purpose : //============================================================================ -GEOM::GEOM_IInsertOperations_ptr GEOM_Gen_i::GetIInsertOperations(CORBA::Long theStudyID) +GEOM::GEOM_IInsertOperations_ptr GEOM_Gen_i::GetIInsertOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2389,7 +2397,7 @@ GEOM::GEOM_IInsertOperations_ptr GEOM_Gen_i::GetIInsertOperations(CORBA::Long th GEOM::GEOM_Gen_ptr engine = _this(); GEOM_IInsertOperations_i* aServant = - new GEOM_IInsertOperations_i(_poa, engine, _impl->GetIInsertOperations(theStudyID)); + new GEOM_IInsertOperations_i(_poa, engine, _impl->GetIInsertOperations()); // activate the CORBA servant GEOM::GEOM_IInsertOperations_var operations = aServant->_this(); @@ -2400,7 +2408,7 @@ GEOM::GEOM_IInsertOperations_ptr GEOM_Gen_i::GetIInsertOperations(CORBA::Long th // function : GetIMeasureOperations // purpose : //============================================================================ -GEOM::GEOM_IMeasureOperations_ptr GEOM_Gen_i::GetIMeasureOperations(CORBA::Long theStudyID) +GEOM::GEOM_IMeasureOperations_ptr GEOM_Gen_i::GetIMeasureOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2409,7 +2417,7 @@ GEOM::GEOM_IMeasureOperations_ptr GEOM_Gen_i::GetIMeasureOperations(CORBA::Long GEOM::GEOM_Gen_ptr engine = _this(); GEOM_IMeasureOperations_i* aServant = - new GEOM_IMeasureOperations_i(_poa, engine, _impl->GetIMeasureOperations(theStudyID)); + new GEOM_IMeasureOperations_i(_poa, engine, _impl->GetIMeasureOperations()); // activate the CORBA servant GEOM::GEOM_IMeasureOperations_var operations = aServant->_this(); @@ -2420,7 +2428,7 @@ GEOM::GEOM_IMeasureOperations_ptr GEOM_Gen_i::GetIMeasureOperations(CORBA::Long // function : GetIGroupOperations // purpose : //============================================================================ -GEOM::GEOM_IGroupOperations_ptr GEOM_Gen_i::GetIGroupOperations(CORBA::Long theStudyID) +GEOM::GEOM_IGroupOperations_ptr GEOM_Gen_i::GetIGroupOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2429,7 +2437,7 @@ GEOM::GEOM_IGroupOperations_ptr GEOM_Gen_i::GetIGroupOperations(CORBA::Long theS GEOM::GEOM_Gen_ptr engine = _this(); GEOM_IGroupOperations_i* aServant = - new GEOM_IGroupOperations_i(_poa, engine, _impl->GetIGroupOperations(theStudyID)); + new GEOM_IGroupOperations_i(_poa, engine, _impl->GetIGroupOperations()); // activate the CORBA servant GEOM::GEOM_IGroupOperations_var operations = aServant->_this(); @@ -2440,7 +2448,7 @@ GEOM::GEOM_IGroupOperations_ptr GEOM_Gen_i::GetIGroupOperations(CORBA::Long theS // function : GetIFieldOperations // purpose : //============================================================================ -GEOM::GEOM_IFieldOperations_ptr GEOM_Gen_i::GetIFieldOperations(CORBA::Long theStudyID) +GEOM::GEOM_IFieldOperations_ptr GEOM_Gen_i::GetIFieldOperations() throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2449,7 +2457,7 @@ GEOM::GEOM_IFieldOperations_ptr GEOM_Gen_i::GetIFieldOperations(CORBA::Long theS GEOM::GEOM_Gen_ptr engine = _this(); GEOM_IFieldOperations_i* aServant = - new GEOM_IFieldOperations_i(_poa, engine, _impl->GetIFieldOperations(theStudyID)); + new GEOM_IFieldOperations_i(_poa, engine, _impl->GetIFieldOperations()); // activate the CORBA servant GEOM::GEOM_IFieldOperations_var operations = aServant->_this(); @@ -2460,8 +2468,7 @@ GEOM::GEOM_IFieldOperations_ptr GEOM_Gen_i::GetIFieldOperations(CORBA::Long theS // function : GetPluginOperations // purpose : //============================================================================ -GEOM::GEOM_IOperations_ptr GEOM_Gen_i::GetPluginOperations(CORBA::Long theStudyID, - const char* theLibName) +GEOM::GEOM_IOperations_ptr GEOM_Gen_i::GetPluginOperations(const char* theLibName) throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -2479,7 +2486,7 @@ GEOM::GEOM_IOperations_ptr GEOM_Gen_i::GetPluginOperations(CORBA::Long theStudyI // create a new operations object, store its ref. in engine if ( myOpCreatorMap.find(aLibName) != myOpCreatorMap.end() ) { GEOM_IOperations_i* aServant = 0; - aServant = myOpCreatorMap[aLibName]->Create(_poa, theStudyID, engine, _impl); + aServant = myOpCreatorMap[aLibName]->Create(_poa, engine, _impl); // activate the CORBA servant if (aServant) operations = aServant->_this(); @@ -2557,7 +2564,7 @@ GEOM::GEOM_Object_ptr GEOM_Gen_i::AddSubShape (GEOM::GEOM_Object_ptr theMainSh return GEOM::GEOM_Object::_nil(); CORBA::String_var entry = theMainShape->GetEntry(); HANDLE_NAMESPACE(GEOM_Object) aMainShape = HANDLE_NAMESPACE(GEOM_Object)::DownCast - ( _impl->GetObject( theMainShape->GetStudyID(), entry )); + ( _impl->GetObject( entry )); if (aMainShape.IsNull()) return GEOM::GEOM_Object::_nil(); Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1, theIndices.length()); @@ -2568,7 +2575,7 @@ GEOM::GEOM_Object_ptr GEOM_Gen_i::AddSubShape (GEOM::GEOM_Object_ptr theMainSh TCollection_AsciiString anEntry; TDF_Tool::Entry(anObject->GetEntry(), anEntry); - return GEOM::GEOM_Object::_narrow( GetObject(anObject->GetDocID(), anEntry.ToCString())); + return GEOM::GEOM_Object::_narrow( GetObject(anEntry.ToCString())); } //============================================================================= @@ -2579,7 +2586,7 @@ GEOM::GEOM_Object_ptr GEOM_Gen_i::AddSubShape (GEOM::GEOM_Object_ptr theMainSh void GEOM_Gen_i::RemoveObject(GEOM::GEOM_BaseObject_ptr theObject) { CORBA::String_var anEntry = theObject->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anObject = _impl->GetObject(theObject->GetStudyID(), anEntry, false); + HANDLE_NAMESPACE(GEOM_BaseObject) anObject = _impl->GetObject(anEntry, false); if (!anObject.IsNull()) _impl->RemoveObject(anObject); } @@ -2611,10 +2618,10 @@ GEOM::GEOM_Object_ptr GEOM_Gen_i::GetIORFromString(const char* stringIOR) { // function : GetObject() // purpose : //================================================================================= -GEOM::GEOM_BaseObject_ptr GEOM_Gen_i::GetObject (CORBA::Long theStudyID, const char* theEntry) +GEOM::GEOM_BaseObject_ptr GEOM_Gen_i::GetObject (const char* theEntry) { GEOM::GEOM_BaseObject_var obj; - HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject(theStudyID, (char*)theEntry); + HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject((char*)theEntry); if (handle_object.IsNull()) return obj._retn(); TCollection_AsciiString stringIOR = handle_object->GetIOR(); @@ -2676,14 +2683,11 @@ bool GEOM_Gen_i::hasObjectInfo() // function : getObjectInfo() // purpose : returns an information for a given object by its entry //================================================================================= -char* GEOM_Gen_i::getObjectInfo(CORBA::Long studyId, const char* entry) +char* GEOM_Gen_i::getObjectInfo(const char* entry) { GEOM::GEOM_Object_var aGeomObject; - CORBA::Object_var aSMObject = name_service->Resolve( "/myStudyManager" ); - SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow( aSMObject ); - SALOMEDS::Study_var aStudy = aStudyManager->GetStudyByID( studyId ); - SALOMEDS::SObject_var aSObj = aStudy->FindObjectID( entry ); + SALOMEDS::SObject_var aSObj = getStudyServant()->FindObjectID( entry ); SALOMEDS::SObject_var aResultSObj; if (aSObj->ReferencedObject(aResultSObj)) aSObj = aResultSObj; @@ -2693,7 +2697,7 @@ char* GEOM_Gen_i::getObjectInfo(CORBA::Long studyId, const char* entry) SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); CORBA::String_var aVal = anIOR->Value(); anIOR->UnRegister(); - CORBA::Object_var anObject = aStudy->ConvertIORToObject(aVal); + CORBA::Object_var anObject = getStudyServant()->ConvertIORToObject(aVal); aGeomObject = GEOM::GEOM_Object::_narrow(anObject); } if (!aSObj->_is_nil() ) @@ -2705,7 +2709,7 @@ char* GEOM_Gen_i::getObjectInfo(CORBA::Long studyId, const char* entry) GEOM::ListOfLong_var anInts; GEOM::ListOfDouble_var aDbls; - GEOM::GEOM_IMeasureOperations_var anOp = GetIMeasureOperations( studyId ); + GEOM::GEOM_IMeasureOperations_var anOp = GetIMeasureOperations(); aKind = anOp->KindOfShape( aGeomObject, anInts, aDbls ); if ( anOp->IsDone() ) { @@ -2857,7 +2861,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::CreateFolder(const char* theName, aLocalID->UnRegister(); } - SALOMEDS::Study_var aStudy = theFather->GetStudy(); + SALOMEDS::Study_var aStudy = getStudyServant(); SALOMEDS::StudyBuilder_var aStudyBuilder( aStudy->NewBuilder() ); aFolderSO = aStudyBuilder->NewObject( theFather ); @@ -2892,7 +2896,7 @@ void GEOM_Gen_i::MoveToFolder(GEOM::GEOM_Object_ptr theObject, SALOMEDS::SObject_ptr theFolder) { GEOM::object_list_var objects = new GEOM::object_list(); objects->length( 1 ); - SALOMEDS::SObject_var aSO = theFolder->GetStudy()->FindObjectID( theObject->GetStudyEntry() ); + SALOMEDS::SObject_var aSO = getStudyServant()->FindObjectID( theObject->GetStudyEntry() ); objects[0] = aSO; Move( objects, theFolder, -1 ); } @@ -2910,7 +2914,7 @@ void GEOM_Gen_i::MoveListToFolder (const GEOM::ListOfGO& theListOfGO, SALOMEDS::SObject_var aSO; for (int i = 0; i < aLen; i++) { aGO = GEOM::GEOM_Object::_duplicate( theListOfGO[i] ); - aSO = theFolder->GetStudy()->FindObjectID( aGO->GetStudyEntry() ); + aSO = getStudyServant()->FindObjectID( aGO->GetStudyEntry() ); objects[i] = aSO; } if ( objects->length() > 0 ) @@ -2928,7 +2932,7 @@ void GEOM_Gen_i::Move( const GEOM::object_list& what, { if ( CORBA::is_nil( where ) ) return; - SALOMEDS::Study_var study = where->GetStudy(); + SALOMEDS::Study_var study = getStudyServant(); SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder(); SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder(); SALOMEDS::SComponent_var father = where->GetFatherComponent(); @@ -2961,8 +2965,8 @@ void GEOM_Gen_i::Move( const GEOM::object_list& what, // function : GetDependencyTree // purpose : Collects dependencies of the given objects from other ones //======================================================================= -SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy, - const GEOM::string_array& theObjectEntries ) { +SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( const GEOM::string_array& theObjectEntries ) +{ // fill in the tree structure GEOMUtils::TreeModel tree; @@ -2970,7 +2974,7 @@ SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy, for ( int i = 0; i < theObjectEntries.length(); i++ ) { // process objects one-by-one entry = theObjectEntries[i].in(); - GEOM::GEOM_BaseObject_var anObj = GetObject( theStudy->StudyId(), entry.c_str() ); + GEOM::GEOM_BaseObject_var anObj = GetObject(entry.c_str() ); if ( anObj->_is_nil() ) continue; std::map< std::string, std::set > passedEntries; @@ -3055,7 +3059,7 @@ void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo, std::map< std::string, std::set > &passedEntries, int level ) { std::string aGboEntry = gbo->GetEntry(); - Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(gbo->GetStudyID()); + Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(); Handle(TDataStd_TreeNode) aNode, aRoot; HANDLE_NAMESPACE(GEOM_Function) aFunction; if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) { @@ -3071,7 +3075,7 @@ void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo, if(aLabel.IsNull()) continue; TCollection_AsciiString anEntry; TDF_Tool::Entry(aLabel, anEntry); - GEOM::GEOM_BaseObject_var geomObj = GetObject( gbo->GetStudyID(), anEntry.ToCString() ); + GEOM::GEOM_BaseObject_var geomObj = GetObject(anEntry.ToCString() ); if( CORBA::is_nil( geomObj ) ) continue; // get dependencies for current object in the tree @@ -3117,18 +3121,17 @@ void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo, // function : GetEntriesToReduceStudy // purpose : Fills 3 lists that is used to clean study of redundant objects //============================================================================== -void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy, - GEOM::string_array& theSelectedEntries, - GEOM::string_array& theParentEntries, - GEOM::string_array& theSubEntries, - GEOM::string_array& theOtherEntries) +void GEOM_Gen_i::GetEntriesToReduceStudy(GEOM::string_array& theSelectedEntries, + GEOM::string_array& theParentEntries, + GEOM::string_array& theSubEntries, + GEOM::string_array& theOtherEntries) { std::set aSelected, aParents, aChildren, anOthers; for ( int i = 0; i < theSelectedEntries.length(); i++ ) { aSelected.insert( CORBA::string_dup( theSelectedEntries[i] ) ); } - Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(theStudy->StudyId()); + Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(); Handle(TDataStd_TreeNode) aNode, aRoot; HANDLE_NAMESPACE(GEOM_Function) aFunction; if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) { @@ -3148,7 +3151,7 @@ void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy, continue; TDF_Tool::Entry(aLabel, anAsciiEntry); anEntry = anAsciiEntry.ToCString(); - GEOM::GEOM_BaseObject_var geomObj = GetObject( theStudy->StudyId(), anEntry.c_str() ); + GEOM::GEOM_BaseObject_var geomObj = GetObject(anEntry.c_str() ); if( CORBA::is_nil( geomObj ) ) continue; @@ -3168,7 +3171,7 @@ void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy, // filling list of sub-objects for ( it = aSelected.begin(); it != aSelected.end(); ++it ) { - includeSubObjects( theStudy, *it, aSelected, aParents, aChildren, anOthers ); + includeSubObjects( *it, aSelected, aParents, aChildren, anOthers ); } // if some selected object is not a main shape, @@ -3176,7 +3179,7 @@ void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy, // because they could not be modified anyhow. std::set aToBeInSelected; for ( it = aSelected.begin(); it != aSelected.end(); ++it ) { - HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject( theStudy->StudyId(), (*it).c_str(), false); + HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject((*it).c_str(), false); if ( handle_object.IsNull() ) continue; @@ -3266,15 +3269,14 @@ void GEOM_Gen_i::includeParentDependencies(GEOM::GEOM_BaseObject_ptr geomObj, // function : includeSubObjects // purpose : //============================================================================== -void GEOM_Gen_i::includeSubObjects(SALOMEDS::Study_ptr theStudy, - const std::string& aSelectedEntry, +void GEOM_Gen_i::includeSubObjects(const std::string& aSelectedEntry, std::set& aSelected, std::set& aParents, std::set& aChildren, std::set& anOthers) { std::set::iterator foundIt; - HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject( theStudy->StudyId(), aSelectedEntry.c_str(), false); + HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject(aSelectedEntry.c_str(), false); if ( handle_object.IsNull() ) return; @@ -3302,7 +3304,7 @@ void GEOM_Gen_i::includeSubObjects(SALOMEDS::Study_ptr theStudy, anOthers.erase( foundIt ); } } - includeSubObjects( theStudy, aSubEntryStr, aSelected, aParents, aChildren, anOthers ); + includeSubObjects( aSubEntryStr, aSelected, aParents, aChildren, anOthers ); } } //===================================================================================== diff --git a/src/GEOM_I/GEOM_Gen_i.hh b/src/GEOM_I/GEOM_Gen_i.hh index 34641ec7e..7e2aec814 100644 --- a/src/GEOM_I/GEOM_Gen_i.hh +++ b/src/GEOM_I/GEOM_Gen_i.hh @@ -71,7 +71,6 @@ class GEOM_I_EXPORT GEOM_GenericOperationsCreator public: // Create operations virtual GEOM_IOperations_i* Create (PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl) = 0; // return the name of IDL module @@ -109,6 +108,9 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi // Get Naming Service object SALOME_NamingService* GetNS() { return name_service; } + // Get Study + SALOMEDS::Study_var getStudyServant(); + //-----------------------------------------------------------------------// // Inherited methods from SALOMEDS::Driver // //-----------------------------------------------------------------------// @@ -145,13 +147,11 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi CORBA::Boolean isASCII); bool CanPublishInStudy(CORBA::Object_ptr theIOR); - SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, + SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject, const char* theName) throw (SALOME::SALOME_Exception) ; - GEOM::ListOfGO* PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy, - CORBA::Object_ptr theObject); + GEOM::ListOfGO* PublishNamedShapesInStudy(CORBA::Object_ptr theObject); CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject); SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID); @@ -163,16 +163,14 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi /*! \brief Adds theObject in the study with a name = theName, if * theFather is not null the object is placed under theFather */ - SALOMEDS::SObject_ptr AddInStudy (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_BaseObject_ptr theObject, + SALOMEDS::SObject_ptr AddInStudy (GEOM::GEOM_BaseObject_ptr theObject, const char* theName, GEOM::GEOM_BaseObject_ptr theFather); /*! \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments. * To be used from python scripts out of geompy.addToStudy (non-default usage) */ - GEOM::ListOfGO* RestoreSubShapesO (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, + GEOM::ListOfGO* RestoreSubShapesO (GEOM::GEOM_Object_ptr theObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, @@ -181,8 +179,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi /*! \brief Publish sub-shapes, standing for given in \a theArgs arguments and sub-shapes. * To be used from python scripts, generated by Dump Python. */ - GEOM::ListOfGO* RestoreGivenSubShapesO (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, + GEOM::ListOfGO* RestoreGivenSubShapesO (GEOM::GEOM_Object_ptr theObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, @@ -191,86 +188,83 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi /*! \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments. * To be used from GUI and from geompy.addToStudy */ - GEOM::ListOfGO* RestoreSubShapesSO (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, + GEOM::ListOfGO* RestoreSubShapesSO (SALOMEDS::SObject_ptr theSObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, CORBA::Boolean theAddPrefix); //Collects dependencies of the given objects from other ones - SALOMEDS::TMPFile* GetDependencyTree(SALOMEDS::Study_ptr theStudy, - const GEOM::string_array& theObjectEntries); + SALOMEDS::TMPFile* GetDependencyTree(const GEOM::string_array& theObjectEntries); //-----------------------------------------------------------------------// // Transaction methods // //-----------------------------------------------------------------------// - //Undos one transaction in the document associated with theStudyID - virtual void Undo(CORBA::Long theStudyID); + //Undos one transaction in the document + virtual void Undo(); - //Redos one transaction in the document associated with theStudyID - virtual void Redo(CORBA::Long theStudyID); + //Redos one transaction in the document + virtual void Redo(); //-----------------------------------------------------------------------// // Operations methods // //-----------------------------------------------------------------------// //Returns a pointer to BasicOperations interface - virtual GEOM::GEOM_IBasicOperations_ptr GetIBasicOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_IBasicOperations_ptr GetIBasicOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to TransformOperations interface - virtual GEOM::GEOM_ITransformOperations_ptr GetITransformOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_ITransformOperations_ptr GetITransformOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to 3DPrimOperations interface - virtual GEOM::GEOM_I3DPrimOperations_ptr GetI3DPrimOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_I3DPrimOperations_ptr GetI3DPrimOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to ShapesOperations interface - virtual GEOM::GEOM_IShapesOperations_ptr GetIShapesOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_IShapesOperations_ptr GetIShapesOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to BlocksOperations interface - virtual GEOM::GEOM_IBlocksOperations_ptr GetIBlocksOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_IBlocksOperations_ptr GetIBlocksOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to BooleanOperations interface - virtual GEOM::GEOM_IBooleanOperations_ptr GetIBooleanOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_IBooleanOperations_ptr GetIBooleanOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to CurvesOperations interface - virtual GEOM::GEOM_ICurvesOperations_ptr GetICurvesOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_ICurvesOperations_ptr GetICurvesOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to LocalOperations interface - virtual GEOM::GEOM_ILocalOperations_ptr GetILocalOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_ILocalOperations_ptr GetILocalOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to HealingOperations interface - virtual GEOM::GEOM_IHealingOperations_ptr GetIHealingOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_IHealingOperations_ptr GetIHealingOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to InsertOperations interface - virtual GEOM::GEOM_IInsertOperations_ptr GetIInsertOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_IInsertOperations_ptr GetIInsertOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to MeasureOperations interface - virtual GEOM::GEOM_IMeasureOperations_ptr GetIMeasureOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_IMeasureOperations_ptr GetIMeasureOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to GroupOperations interface - virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to FiedlOperations interface - virtual GEOM::GEOM_IFieldOperations_ptr GetIFieldOperations (CORBA::Long theStudyID) + virtual GEOM::GEOM_IFieldOperations_ptr GetIFieldOperations() throw (SALOME::SALOME_Exception); //Returns a pointer to corresponding plugin operations interface - virtual GEOM::GEOM_IOperations_ptr GetPluginOperations (CORBA::Long theStudyID, - const char* theLibName) + virtual GEOM::GEOM_IOperations_ptr GetPluginOperations (const char* theLibName) throw (SALOME::SALOME_Exception); //Adds a new sub-shape @@ -283,8 +277,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi virtual GEOM::GEOM_Object_ptr GetIORFromString(const char* stringIOR); - virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, - CORBA::Boolean isPublished, + virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished, CORBA::Boolean isMultiFile, CORBA::Boolean& isValidScript); @@ -294,7 +287,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi // Object information virtual bool hasObjectInfo(); - virtual char* getObjectInfo(CORBA::Long studyId, const char* entry); + virtual char* getObjectInfo(const char* entry); // Version information virtual char* getVersion(); @@ -319,8 +312,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi /*! \brief Fills 3 lists that is used to clean study of redundant objects. * To be used from GUI. */ - void GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy, - GEOM::string_array& theSelectedEntries, + void GetEntriesToReduceStudy(GEOM::string_array& theSelectedEntries, GEOM::string_array& theParentEntries, GEOM::string_array& theSubEntries, GEOM::string_array& theOtherEntries); @@ -329,35 +321,31 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi // Internal methods // //-----------------------------------------------------------------------// - virtual GEOM::GEOM_BaseObject_ptr GetObject(CORBA::Long theStudyID, const char* theEntry); + virtual GEOM::GEOM_BaseObject_ptr GetObject(const char* theEntry); private: - GEOM::ListOfGO* RestoreSubShapes (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, + GEOM::ListOfGO* RestoreSubShapes (GEOM::GEOM_Object_ptr theObject, SALOMEDS::SObject_ptr theSObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, CORBA::Boolean theAddPrefix); - GEOM::ListOfGO* RestoreSubShapesOneLevel (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theOldSO, + GEOM::ListOfGO* RestoreSubShapesOneLevel (SALOMEDS::SObject_ptr theOldSO, SALOMEDS::SObject_ptr theNewSO, GEOM::GEOM_Object_ptr theNewO, GEOM::ListOfGO& theOutArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theAddPrefix); - GEOM::ListOfGO* RestoreGivenSubShapes (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, + GEOM::ListOfGO* RestoreGivenSubShapes (GEOM::GEOM_Object_ptr theObject, SALOMEDS::SObject_ptr theSObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, CORBA::Boolean theAddPrefix); - GEOM::ListOfGO* RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theOldSO, + GEOM::ListOfGO* RestoreGivenSubShapesOneLevel (SALOMEDS::SObject_ptr theOldSO, SALOMEDS::SObject_ptr theNewSO, GEOM::GEOM_Object_ptr theNewO, std::set theArgs, @@ -365,8 +353,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi CORBA::Boolean theAddPrefix); // auxilary for PublishNamedShapesInStudy - void CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_var theMainShape, + void CreateAndPublishGroup(GEOM::GEOM_Object_var theMainShape, const TopTools_IndexedMapOfShape& anIndices, const TopTools_SequenceOfShape& SeqS, const TColStd_SequenceOfAsciiString& SeqN, @@ -389,8 +376,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi std::set& aChildren, std::set& anOthers); - void includeSubObjects(SALOMEDS::Study_ptr theStudy, - const std::string& aSelectedEntry, + void includeSubObjects(const std::string& aSelectedEntry, std::set& aSelected, std::set& aParents, std::set& aChildren, diff --git a/src/GEOM_I/GEOM_IOperations_i.cc b/src/GEOM_I/GEOM_IOperations_i.cc index b3d6c6125..b71199220 100644 --- a/src/GEOM_I/GEOM_IOperations_i.cc +++ b/src/GEOM_I/GEOM_IOperations_i.cc @@ -88,16 +88,6 @@ char* GEOM_IOperations_i::GetErrorCode() return CORBA::string_dup(_impl->GetErrorCode()); } -//============================================================================= -/*! - * GetStudyID - */ -//============================================================================= -CORBA::Long GEOM_IOperations_i::GetStudyID() -{ - return _impl->GetDocID(); -} - //============================================================================= /*! * StartOperation @@ -141,7 +131,7 @@ GEOM_IOperations_i::GetBaseObject(HANDLE_NAMESPACE(GEOM_BaseObject) theObject) if (theObject.IsNull()) return GO._retn(); TCollection_AsciiString anEntry; TDF_Tool::Entry(theObject->GetEntry(), anEntry); - GO = _engine->GetObject(theObject->GetDocID(), (char*) anEntry.ToCString()); + GO = _engine->GetObject((char*) anEntry.ToCString()); return GO._retn(); } @@ -156,7 +146,7 @@ GEOM_IOperations_i::GetBaseObjectImpl(GEOM::GEOM_BaseObject_ptr theObject) HANDLE_NAMESPACE(GEOM_BaseObject) anImpl; if (!CORBA::is_nil(theObject)) { CORBA::String_var anEntry = theObject->GetEntry(); - anImpl = GetImpl()->GetEngine()->GetObject( theObject->GetStudyID(), anEntry ); + anImpl = GetImpl()->GetEngine()->GetObject( anEntry ); } return anImpl; } diff --git a/src/GEOM_I/GEOM_IOperations_i.hh b/src/GEOM_I/GEOM_IOperations_i.hh index aa271fbf1..15c0bd269 100644 --- a/src/GEOM_I/GEOM_IOperations_i.hh +++ b/src/GEOM_I/GEOM_IOperations_i.hh @@ -45,8 +45,6 @@ class GEOM_I_EXPORT GEOM_IOperations_i : public virtual POA_GEOM::GEOM_IOperatio virtual char* GetErrorCode(); - virtual CORBA::Long GetStudyID(); - virtual GEOM::GEOM_BaseObject_ptr GetBaseObject(HANDLE_NAMESPACE(GEOM_BaseObject) theObject); virtual HANDLE_NAMESPACE(GEOM_BaseObject) GetBaseObjectImpl(GEOM::GEOM_BaseObject_ptr theObject); virtual GEOM::GEOM_Object_ptr GetObject(HANDLE_NAMESPACE(GEOM_Object) theObject); diff --git a/src/GEOM_I/GEOM_Object_i.cc b/src/GEOM_I/GEOM_Object_i.cc index 3894aff78..cf7e37b3b 100644 --- a/src/GEOM_I/GEOM_Object_i.cc +++ b/src/GEOM_I/GEOM_Object_i.cc @@ -178,7 +178,7 @@ char* GEOM_Object_i::GetSubShapeName(CORBA::Long subID) { TCollection_AsciiString anEntry = anIt.Value(); HANDLE_NAMESPACE(GEOM_BaseObject) anObj = - GEOM_Engine::GetEngine()->GetObject( _impl->GetDocID(), anEntry.ToCString(), false ); + GEOM_Engine::GetEngine()->GetObject( anEntry.ToCString(), false ); if ( anObj.IsNull() ) continue; TCollection_AsciiString aSubName = anObj->GetName(); @@ -395,7 +395,7 @@ GEOM::GEOM_Object_ptr GEOM_Object_i::GetMainShape() TCollection_AsciiString anEntry; TDF_Tool::Entry(aLabel, anEntry); return GEOM::GEOM_Object::_narrow - ( _engine->GetObject(_impl->GetDocID(), anEntry.ToCString()) ); + ( _engine->GetObject( anEntry.ToCString()) ); } return obj._retn(); @@ -414,7 +414,7 @@ bool GEOM_Object_i::IsSame(GEOM::GEOM_BaseObject_ptr other) if ( !CORBA::is_nil( shapePtr ) ) { CORBA::String_var entry = shapePtr->GetEntry(); HANDLE_NAMESPACE(GEOM_Object) otherObject = HANDLE_NAMESPACE(GEOM_Object)::DownCast - ( GEOM_Engine::GetEngine()->GetObject( shapePtr->GetStudyID(), entry, false )); + ( GEOM_Engine::GetEngine()->GetObject( entry, false )); if ( !otherObject.IsNull() ) { TopoDS_Shape thisShape = _impl->GetValue(); TopoDS_Shape otherShape = otherObject->GetValue(); diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.cc b/src/GEOM_I_Superv/GEOM_Superv_i.cc index 1ba007067..351fd623a 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.cc +++ b/src/GEOM_I_Superv/GEOM_Superv_i.cc @@ -51,9 +51,6 @@ GEOM_Superv_i::GEOM_Superv_i(CORBA::ORB_ptr orb, setGeomEngine(); - myStudyID = -1; - myLastStudyID = -1; - myBasicOp = GEOM::GEOM_IBasicOperations::_nil(); my3DPrimOp = GEOM::GEOM_I3DPrimOperations::_nil(); myBoolOp = GEOM::GEOM_IBooleanOperations::_nil(); @@ -111,50 +108,6 @@ void GEOM_Superv_i::setGeomEngine() myGeomEngine = GEOM::GEOM_Gen::_narrow(comp); } -//============================================================================= -// SetStudyID: -//============================================================================= -void GEOM_Superv_i::SetStudyID( CORBA::Long theId ) -{ - // mkr : PAL10770 --> - myLastStudyID = myStudyID; - - CORBA::Object_ptr anObject = name_service->Resolve("/Kernel/Session"); - if ( !CORBA::is_nil(anObject) ) { - SALOME::Session_var aSession = SALOME::Session::_narrow(anObject); - if ( !CORBA::is_nil(aSession) ) { - int aStudyID = aSession->GetActiveStudyId(); - if ( theId != aStudyID && aStudyID > 0) { // mkr : IPAL12128 - MESSAGE("Warning : given study ID theId="<object_to_string( myGeomEngine ); - - CORBA::Object_var anObj = name_service->Resolve("/myStudyManager"); - if ( !CORBA::is_nil(anObj) ) { - SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(anObj); - if ( !CORBA::is_nil(aStudyManager) ) { - _PTR(Study) aDSStudy = ClientFactory::Study(aStudyManager->GetStudyByID(myStudyID)); - if ( aDSStudy ) { - _PTR(SComponent) aSCO = aDSStudy->FindComponent(myGeomEngine->ComponentDataType()); - if ( aSCO ) { - _PTR(StudyBuilder) aBuilder = aDSStudy->NewBuilder(); - if ( aBuilder ) aBuilder->LoadWith( aSCO, anEngine ); - } - } - } - } - } - // mkr : PAL10770 <-- -} - //============================================================================= // CreateListOfGO: //============================================================================= @@ -236,11 +189,8 @@ void GEOM_Superv_i::getBasicOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM_IBasicOperations interface - if (CORBA::is_nil(myBasicOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myBasicOp = myGeomEngine->GetIBasicOperations(myStudyID); + if (CORBA::is_nil(myBasicOp)) { + myBasicOp = myGeomEngine->GetIBasicOperations(); } } @@ -252,11 +202,8 @@ void GEOM_Superv_i::get3DPrimOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM_I3DPrimOperations interface - if (CORBA::is_nil(my3DPrimOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - my3DPrimOp = myGeomEngine->GetI3DPrimOperations(myStudyID); + if (CORBA::is_nil(my3DPrimOp)) { + my3DPrimOp = myGeomEngine->GetI3DPrimOperations(); } } @@ -268,11 +215,8 @@ void GEOM_Superv_i::getBoolOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM_IBooleanOperations interface - if (CORBA::is_nil(myBoolOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myBoolOp = myGeomEngine->GetIBooleanOperations(myStudyID); + if (CORBA::is_nil(myBoolOp)) { + myBoolOp = myGeomEngine->GetIBooleanOperations(); } } @@ -284,11 +228,8 @@ void GEOM_Superv_i::getInsOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM_IInsertOperations interface - if (CORBA::is_nil(myInsOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myInsOp = myGeomEngine->GetIInsertOperations(myStudyID); + if (CORBA::is_nil(myInsOp)) { + myInsOp = myGeomEngine->GetIInsertOperations(); } } @@ -300,11 +241,8 @@ void GEOM_Superv_i::getTransfOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM_ITransformOperations interface - if (CORBA::is_nil(myTransfOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myTransfOp = myGeomEngine->GetITransformOperations(myStudyID); + if (CORBA::is_nil(myTransfOp)) { + myTransfOp = myGeomEngine->GetITransformOperations(); } } @@ -316,11 +254,8 @@ void GEOM_Superv_i::getShapesOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM_IShapesOperations interface - if (CORBA::is_nil(myShapesOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myShapesOp = myGeomEngine->GetIShapesOperations(myStudyID); + if (CORBA::is_nil(myShapesOp)) { + myShapesOp = myGeomEngine->GetIShapesOperations(); } } @@ -332,11 +267,8 @@ void GEOM_Superv_i::getBlocksOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM_IBlocksOperations interface - if (CORBA::is_nil(myBlocksOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myBlocksOp = myGeomEngine->GetIBlocksOperations(myStudyID); + if (CORBA::is_nil(myBlocksOp)) { + myBlocksOp = myGeomEngine->GetIBlocksOperations(); } } @@ -348,11 +280,8 @@ void GEOM_Superv_i::getCurvesOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM_ICurvesOperations interface - if (CORBA::is_nil(myCurvesOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myCurvesOp = myGeomEngine->GetICurvesOperations(myStudyID); + if (CORBA::is_nil(myCurvesOp)) { + myCurvesOp = myGeomEngine->GetICurvesOperations(); } } @@ -364,11 +293,8 @@ void GEOM_Superv_i::getLocalOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM_ILocalOperations interface - if (CORBA::is_nil(myLocalOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myLocalOp = myGeomEngine->GetILocalOperations(myStudyID); + if (CORBA::is_nil(myLocalOp)) { + myLocalOp = myGeomEngine->GetILocalOperations(); } } @@ -380,11 +306,8 @@ void GEOM_Superv_i::getGroupOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM_IGroupOperations interface - if (CORBA::is_nil(myGroupOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myGroupOp = myGeomEngine->GetIGroupOperations(myStudyID); + if (CORBA::is_nil(myGroupOp)) { + myGroupOp = myGeomEngine->GetIGroupOperations(); } } @@ -396,11 +319,8 @@ void GEOM_Superv_i::getAdvancedOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM::IAdvancedOperations interface - if (CORBA::is_nil(myAdvancedOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myAdvancedOp = GEOM::IAdvancedOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "AdvancedEngine")); + if (CORBA::is_nil(myAdvancedOp)) { + myAdvancedOp = GEOM::IAdvancedOperations::_narrow(myGeomEngine->GetPluginOperations("AdvancedEngine")); } } @@ -412,11 +332,8 @@ void GEOM_Superv_i::getSTLPluginOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM::ISTLOperations interface - if (CORBA::is_nil(mySTLOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - mySTLOp = GEOM::ISTLOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "STLPluginEngine")); + if (CORBA::is_nil(mySTLOp)) { + mySTLOp = GEOM::ISTLOperations::_narrow(myGeomEngine->GetPluginOperations("STLPluginEngine")); } } @@ -428,11 +345,8 @@ void GEOM_Superv_i::getBREPPluginOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM:IBREPOperations interface - if (CORBA::is_nil(myBREPOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myBREPOp = GEOM::IBREPOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "BREPPluginEngine")); + if (CORBA::is_nil(myBREPOp)) { + myBREPOp = GEOM::IBREPOperations::_narrow(myGeomEngine->GetPluginOperations("BREPPluginEngine")); } } @@ -444,11 +358,8 @@ void GEOM_Superv_i::getSTEPPluginOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM::ISTEPOperations interface - if (CORBA::is_nil(mySTEPOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - mySTEPOp = GEOM::ISTEPOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "STEPPluginEngine")); + if (CORBA::is_nil(mySTEPOp)) { + mySTEPOp = GEOM::ISTEPOperations::_narrow(myGeomEngine->GetPluginOperations("STEPPluginEngine")); } } @@ -460,11 +371,8 @@ void GEOM_Superv_i::getIGESPluginOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM::IIGESOperations interface - if (CORBA::is_nil(myIGESOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myIGESOp = GEOM::IIGESOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "IGESPluginEngine")); + if (CORBA::is_nil(myIGESOp)) { + myIGESOp = GEOM::IIGESOperations::_narrow(myGeomEngine->GetPluginOperations("IGESPluginEngine")); } } @@ -476,11 +384,8 @@ void GEOM_Superv_i::getXAOPluginOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM::IXAOOperations interface - if (CORBA::is_nil(myXAOOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myXAOOp = GEOM::IXAOOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "XAOPluginEngine")); + if (CORBA::is_nil(myXAOOp)) { + myXAOOp = GEOM::IXAOOperations::_narrow(myGeomEngine->GetPluginOperations("XAOPluginEngine")); } } @@ -493,11 +398,8 @@ void GEOM_Superv_i::getVTKPluginOp() if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); // get GEOM::IVTKOperations interface - if (CORBA::is_nil(myVTKOp) || isNewStudy(myLastStudyID,myStudyID)) { - //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS" - // Try to get id of the study from the SALOME Session - if(myStudyID < 0 ) SetStudyID(-1); - myVTKOp = GEOM::IVTKOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "VTKPluginEngine")); + if (CORBA::is_nil(myVTKOp)) { + myVTKOp = GEOM::IVTKOperations::_narrow(myGeomEngine->GetPluginOperations("VTKPluginEngine")); } } #endif @@ -619,14 +521,13 @@ CORBA::Boolean GEOM_Superv_i::CanPublishInStudy(CORBA::Object_ptr theIOR) // function : PublishInStudy // purpose : //============================================================================ -SALOMEDS::SObject_ptr GEOM_Superv_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, +SALOMEDS::SObject_ptr GEOM_Superv_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject, const char* theName) throw (SALOME::SALOME_Exception) { if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); - return myGeomEngine->PublishInStudy(theStudy, theSObject, theObject, theName); + return myGeomEngine->PublishInStudy(theSObject, theObject, theName); } //============================================================================ @@ -634,13 +535,12 @@ SALOMEDS::SObject_ptr GEOM_Superv_i::PublishInStudy(SALOMEDS::Study_ptr theStudy // purpose : //============================================================================ GEOM::ListOfGO* -GEOM_Superv_i::PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy, - //SALOMEDS::SObject_ptr theSObject, +GEOM_Superv_i::PublishNamedShapesInStudy(//SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject) { if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); - return myGeomEngine->PublishNamedShapesInStudy(theStudy, theObject); + return myGeomEngine->PublishNamedShapesInStudy(theObject); } //============================================================================ diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.hh b/src/GEOM_I_Superv/GEOM_Superv_i.hh index 8d712acde..06885535d 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.hh +++ b/src/GEOM_I_Superv/GEOM_Superv_i.hh @@ -81,11 +81,6 @@ public: PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject, PortableServer::POA_ptr thePOA); - //-----------------------------------------------------------------------// - // Set current stydy ID // - //-----------------------------------------------------------------------// - void SetStudyID( CORBA::Long theId ); - //-----------------------------------------------------------// // Create ListOfGO and add items to it // //-----------------------------------------------------------// @@ -143,13 +138,11 @@ public: CORBA::Boolean isASCII); CORBA::Boolean CanPublishInStudy(CORBA::Object_ptr theIOR); - SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, + SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject, const char* theName) throw (SALOME::SALOME_Exception) ; - GEOM::ListOfGO* PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy, - //SALOMEDS::SObject_ptr theSObject, + GEOM::ListOfGO* PublishNamedShapesInStudy(//SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject); CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject); @@ -791,8 +784,6 @@ public: private: SALOME_NamingService * name_service; GEOM::GEOM_Gen_var myGeomEngine; - CORBA::Long myStudyID; - CORBA::Long myLastStudyID; // mkr : PAL10770 PortableServer::POA_var myPOA; GEOM::GEOM_IBasicOperations_var myBasicOp; diff --git a/src/GEOM_PY/geomtools.py b/src/GEOM_PY/geomtools.py index a6e18abac..3123bb44b 100644 --- a/src/GEOM_PY/geomtools.py +++ b/src/GEOM_PY/geomtools.py @@ -38,9 +38,10 @@ from salome.kernel.logger import Logger from salome.kernel import termcolor logger = Logger("salome.geom.geomtools", color = termcolor.RED) -from salome.kernel.studyedit import getActiveStudyId, getStudyEditor +from salome.kernel.studyedit import getStudyEditor from salome.kernel.services import IDToObject, IDToSObject from salome.kernel.deprecation import is_called_by_sphinx +from salome.geom import geomBuilder try: if not is_called_by_sphinx(): @@ -50,29 +51,16 @@ try: except: pass -_geompys = {} +_geompy = geomBuilder.New() -## Return an object behaving exactly like geompy module, except that it is -# associated with the study \em studyId. If \em studyId is \b None, return -# a pseudo geompy object for the current study. +## Return an object behaving exactly like geompy module. # \ingroup geomtools -def getGeompy(studyId = None): +def getGeompy(): """ - Return an object behaving exactly like geompy module, except that it is - associated with the study `studyId`. If `studyId` is :const:`None`, return - a pseudo geompy object for the current study. + Return an object behaving exactly like geompy module. """ - # We can't use geompy module because it initializes GEOM with - # salome.myStudy, which may not exist. So we use this trick to create - # a pseudo geompy module. salome.salome_init() - if studyId is None: - studyId = getActiveStudyId() - if not _geompys.has_key(studyId): - from salome.geom import geomBuilder - study = salome.myStudyManager.GetStudyByID(studyId) - _geompys[studyId] = geomBuilder.New(study) - return _geompys[studyId] + return _geompy ModeWireFrame = 0 @@ -146,8 +134,7 @@ class GeomStudyTools: :param folderName: the name of a folder in the GEOM part of the study """ study = self.editor.study - studyId = study._get_StudyId() - geompy = getGeompy(studyId) + geompy = getGeompy() if folderName is None: # Insert the shape in the study by the standard way @@ -183,7 +170,6 @@ class GeomStudyTools: The underlying GEOM object is returned (so that it can be destroyed) """ study = self.editor.study - studyId = study._get_StudyId() shape = self.getGeomObjectFromEntry(shapeStudyEntry) studyObject = IDToSObject(shapeStudyEntry) self.editor.removeItem(studyObject,True) @@ -337,7 +323,7 @@ def TEST_createBox(): box = geompy.MakeBoxDXDYDZ(200, 200, 200) geompy.addToStudy( box, 'box' ) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() def TEST_getGeomObjectSelected(): @@ -364,13 +350,12 @@ def TEST_createAndDeleteShape(): import salome salome.salome_init() study = salome.myStudy - studyId = salome.myStudyId from salome.geom import geomtools - geompy = geomtools.getGeompy(studyId) + geompy = geomtools.getGeompy() from salome.kernel.studyedit import getStudyEditor - studyEditor = getStudyEditor(studyId) + studyEditor = getStudyEditor() gst = geomtools.GeomStudyTools(studyEditor) diff --git a/src/GEOM_PY/sketcher.py b/src/GEOM_PY/sketcher.py index 84bca3961..ce31c31c7 100644 --- a/src/GEOM_PY/sketcher.py +++ b/src/GEOM_PY/sketcher.py @@ -48,7 +48,7 @@ Example:: # Put it in the study from salome.geom import geomBuilder - geompy = geomBuilder.New(salome.myStudy) + geompy = geomBuilder.New() geompy.addToStudy( wire, 'mysketch' ) Additionnal examples can be found as unit tests in the source code. @@ -62,7 +62,7 @@ try: salome.salome_init() import GEOM from salome.geom import geomBuilder - geompy = geomBuilder.New(salome.myStudy) + geompy = geomBuilder.New() pass pass except: diff --git a/src/GEOM_PY/structelem/__init__.py b/src/GEOM_PY/structelem/__init__.py index 80fa0612e..cf5ef97aa 100644 --- a/src/GEOM_PY/structelem/__init__.py +++ b/src/GEOM_PY/structelem/__init__.py @@ -50,7 +50,7 @@ # structElemManager = StructuralElementManager() # elem = structElemManager.createElement(commandList) # elem.display() -# salome.sg.updateObjBrowser(True) +# salome.sg.updateObjBrowser() # \endcode # # \defgroup orientation @@ -90,7 +90,7 @@ Example:: structElemManager = StructuralElementManager() elem = structElemManager.createElement(commandList) elem.display() - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() """ @@ -112,23 +112,15 @@ from salome.geom.structelem.parts import InvalidParameterError import GEOM ## This class manages the structural elements in the study. It is used to -# create a new structural element from a list of commands. The parameter -# \em studyId defines the ID of the study in which the manager will create -# structural elements. If it is \b None or not specified, it will use -# the ID of the current study as defined by -# \b salome.kernel.studyedit.getActiveStudyId() function. +# create a new structural element from a list of commands. # \ingroup structelem class StructuralElementManager: """ This class manages the structural elements in the study. It is used to - create a new structural element from a list of commands. The parameter - `studyId` defines the ID of the study in which the manager will create - structural elements. If it is :const:`None` or not specified, it will use - the ID of the current study as defined by - :func:`salome.kernel.studyedit.getActiveStudyId` function. + create a new structural element from a list of commands. """ - def __init__(self, studyId = None): - self._studyEditor = getStudyEditor(studyId) + def __init__(self): + self._studyEditor = getStudyEditor() ## Create a structural element from the list of commands \em commandList. # Each command in this list represent a part of the structural element, @@ -218,7 +210,7 @@ class StructuralElementManager: logger.debug("StructuralElementManager.createElement: START") logger.debug("Command list: %s" % commandList) - element = StructuralElement(self._studyEditor.studyId) + element = StructuralElement() orientationCmdList = [] for command in commandList: (parttype, parameters) = command @@ -252,9 +244,8 @@ class StructuralElementManager: # Create the part try: - part = parts.__dict__[parttype]( - self._studyEditor.studyId, meshGroup, - groupGeomObj, newparams) + part = parts.__dict__[parttype](meshGroup, + groupGeomObj, newparams) element.addPart(part) except InvalidParameterError, e: logger.error("Invalid parameter error: %s" % e) @@ -317,30 +308,22 @@ class StructuralElementManager: ## This class represents a structural element, i.e. a set of geometrical -# objects built along geometrical primitives. The parameter \em studyId -# defines the ID of the study that will contain the structural element. If -# it is \b None or not specified, the constructor will use the ID of -# the active study as defined by \b salome.kernel.studyedit.getActiveStudyId -# function. Structural elements are normally created by the class -# StructuralElementManager, so this class should not be -# instantiated directly in the general case. +# objects built along geometrical primitives. Structural elements are +# normally created by the class StructuralElementManager, so this class +# should not be instantiated directly in the general case. # \ingroup structelem class StructuralElement: """ This class represents a structural element, i.e. a set of geometrical - objects built along geometrical primitives. The parameter `studyId` - defines the ID of the study that will contain the structural element. If - it is :const:`None` or not specified, the constructor will use the ID of - the active study as defined by :func:`salome.kernel.studyedit.getActiveStudyId` - function. Structural elements are normally created by the class - :class:`StructuralElementManager`, so this class should not be - instantiated directly in the general case. + objects built along geometrical primitives. Structural elements + are normally created by the class :class:`StructuralElementManager`, + so this class should not be instantiated directly in the general case. """ _counter = 1 MAIN_FOLDER_NAME = "Structural Elements" - def __init__(self, studyId = None): + def __init__(self): # _parts is the dictionary mapping group name to structural element # part. _shapeDict is the dictionary mapping SubShapeID objects to # structural element parts. Both are used to avoid duplicate shapes @@ -349,9 +332,8 @@ class StructuralElement: self._shapeDict = {} self._id = StructuralElement._counter StructuralElement._counter += 1 - self._studyEditor = getStudyEditor(studyId) - logger.debug("Creating structural element in study %s" % - self._studyEditor.studyId) + self._studyEditor = getStudyEditor() + logger.debug("Creating structural element in study") self._SObject = None ## Find or create the study object corresponding to the structural @@ -364,7 +346,7 @@ class StructuralElement: numerical ID. """ if self._SObject is None: - geompy = getGeompy(self._studyEditor.studyId) + geompy = getGeompy() geomComponent = self._studyEditor.study.FindComponent("GEOM") mainFolder = self._studyEditor.findItem(geomComponent, name = StructuralElement.MAIN_FOLDER_NAME, @@ -452,7 +434,7 @@ class StructuralElement: different parts of the structural element, and add them to the study. """ gg = salome.ImportComponentGUI("GEOM") - geompy = getGeompy(self._studyEditor.studyId) + geompy = getGeompy() for part in self._parts.itervalues(): # Build the structural element part logger.debug("Building %s" % part) @@ -494,9 +476,8 @@ class StructuralElement: """ if theSObject is not None: gg = salome.ImportComponentGUI("GEOM") - aStudy = theSObject.GetStudy() - useCaseBuilder = aStudy.GetUseCaseBuilder() - editor = getStudyEditor(aStudy._get_StudyId()) + useCaseBuilder = salome.myStudy.GetUseCaseBuilder() + editor = getStudyEditor() aIterator = useCaseBuilder.GetUseCaseIterator(theSObject) aIterator.Init(False) while aIterator.More(): @@ -514,9 +495,9 @@ def TEST_CreateGeometry(): salome.salome_init() import GEOM from salome.geom import geomBuilder - geompy = geomBuilder.New(salome.myStudy) + geompy = geomBuilder.New() import SALOMEDS - geompy.init_geom(salome.myStudy) + geompy.init_geom() Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) edges = geompy.SubShapeAllSorted(Box_1, geompy.ShapeType["EDGE"]) geompy.addToStudy(Box_1, "Box_1") @@ -578,7 +559,7 @@ def TEST_StructuralElement(): elem = structElemManager.createElement(liste_commandes) if salome.hasDesktop(): elem.display() - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() # Main function only used to test the module diff --git a/src/GEOM_PY/structelem/parts.py b/src/GEOM_PY/structelem/parts.py index 9b949fab6..01b665042 100644 --- a/src/GEOM_PY/structelem/parts.py +++ b/src/GEOM_PY/structelem/parts.py @@ -119,7 +119,6 @@ class SubShapeID: ## This class is the base class for all structural element parts. It should # not be instantiated directly (consider it as an "abstract" class). -# \param studyId (integer) the ID of the study in which the part is created. # \param groupName (string) the name of the underlying geometrical primitive # in the study. # \param groupGeomObj (GEOM object) the underlying geometrical primitive. @@ -132,9 +131,6 @@ class StructuralElementPart: This class is the base class for all structural element parts. It should not be instantiated directly (consider it as an "abstract" class). - :type studyId: integer - :param studyId: the ID of the study in which the part is created. - :type groupName: string :param groupName: the name of the underlying geometrical primitive in the study. @@ -153,7 +149,7 @@ class StructuralElementPart: DEFAULT_NAME = "StructElemPart" - def __init__(self, studyId, groupName, groupGeomObj, parameters, + def __init__(self, groupName, groupGeomObj, parameters, name = DEFAULT_NAME, color = None): self._parameters = parameters self.groupName = groupName @@ -161,7 +157,7 @@ class StructuralElementPart: self._orientation = None self._paramUserName = {} self.name = name - self.geom = getGeompy(studyId) + self.geom = getGeompy() self.baseShapesSet = set() self.isMainShape = (groupGeomObj.GetType() != 37) # See geompyDC.ShapeIdToType for type codes if not self.isMainShape: @@ -236,11 +232,11 @@ class StructuralElementPart: mindim, value) ## Build the geometric shapes and the markers corresponding to the - # structural element part in the study \em studyId. + # structural element part in the study. def build(self): """ Build the geometric shapes and the markers corresponding to the - structural element part in the study `studyId`. + structural element part in the study. """ shape = self._buildPart() markers = self._buildMarkers() @@ -308,9 +304,9 @@ class Beam(StructuralElementPart): DEFAULT_NAME = "Beam" - def __init__(self, studyId, groupName, groupGeomObj, parameters, + def __init__(self, groupName, groupGeomObj, parameters, name = DEFAULT_NAME, color = None): - StructuralElementPart.__init__(self, studyId, groupName, groupGeomObj, + StructuralElementPart.__init__(self, groupName, groupGeomObj, parameters, name, color) self._orientation = orientation.Orientation1D() @@ -454,7 +450,7 @@ class CircularBeam(Beam): """ - def __init__(self, studyId, groupName, groupGeomObj, parameters, + def __init__(self, groupName, groupGeomObj, parameters, name = Beam.DEFAULT_NAME, color = None): if color is None: if parameters.has_key("R1"): # variable section @@ -462,7 +458,7 @@ class CircularBeam(Beam): else: # constant section color = RED - Beam.__init__(self, studyId, groupName, groupGeomObj, parameters, + Beam.__init__(self, groupName, groupGeomObj, parameters, name, color) self.R1 = self._getParameter(["R1", "R"]) @@ -566,7 +562,7 @@ class RectangularBeam(Beam): """ - def __init__(self, studyId, groupName, groupGeomObj, parameters, + def __init__(self, groupName, groupGeomObj, parameters, name = Beam.DEFAULT_NAME, color = None): if color is None: if parameters.has_key("HY1") or parameters.has_key("H1"): @@ -574,7 +570,7 @@ class RectangularBeam(Beam): else: # constant section color = BLUE - Beam.__init__(self, studyId, groupName, groupGeomObj, parameters, + Beam.__init__(self, groupName, groupGeomObj, parameters, name, color) self.HY1 = self._getParameter(["HY1", "HY", "H1", "H"]) @@ -714,7 +710,7 @@ class GeneralBeam(RectangularBeam): parameters. """ - def __init__(self, studyId, groupName, groupGeomObj, parameters, + def __init__(self, groupName, groupGeomObj, parameters, name = Beam.DEFAULT_NAME, color = None): self.IY1 = getParameterInDict(["IY1", "IY"], parameters) self.IZ1 = getParameterInDict(["IZ1", "IZ"], parameters) @@ -733,7 +729,7 @@ class GeneralBeam(RectangularBeam): else: # constant section color = GREEN - RectangularBeam.__init__(self, studyId, groupName, groupGeomObj, parameters, + RectangularBeam.__init__(self, groupName, groupGeomObj, parameters, name, color) ## This class is an "abstract" class for all 2D structural element parts. It @@ -749,9 +745,9 @@ class StructuralElementPart2D(StructuralElementPart): DEFAULT_NAME = "StructuralElementPart2D" - def __init__(self, studyId, groupName, groupGeomObj, parameters, + def __init__(self, groupName, groupGeomObj, parameters, name = DEFAULT_NAME): - StructuralElementPart.__init__(self, studyId, groupName, groupGeomObj, + StructuralElementPart.__init__(self, groupName, groupGeomObj, parameters, name) self._orientation = orientation.Orientation2D( self._getParameter(["angleAlpha"]), @@ -834,9 +830,9 @@ class ThickShell(StructuralElementPart2D): DEFAULT_NAME = "ThickShell" - def __init__(self, studyId, groupName, groupGeomObj, parameters, + def __init__(self, groupName, groupGeomObj, parameters, name = DEFAULT_NAME): - StructuralElementPart2D.__init__(self, studyId, groupName, + StructuralElementPart2D.__init__(self, groupName, groupGeomObj, parameters, name) self.thickness = self._getParameter(["Epais"]) logger.debug(repr(self)) @@ -978,9 +974,9 @@ class Grid(StructuralElementPart2D): DEFAULT_NAME = "Grid" - def __init__(self, studyId, groupName, groupGeomObj, parameters, + def __init__(self, groupName, groupGeomObj, parameters, name = DEFAULT_NAME): - StructuralElementPart2D.__init__(self, studyId, groupName, + StructuralElementPart2D.__init__(self, groupName, groupGeomObj, parameters, name) self.xr = self._getParameter(["origAxeX"]) self.yr = self._getParameter(["origAxeY"]) @@ -1106,82 +1102,82 @@ class Grid(StructuralElementPart2D): ## Alias for class GeneralBeam. # \ingroup parts -def VisuPoutreGenerale(studyId, groupName, groupGeomObj, parameters, +def VisuPoutreGenerale(groupName, groupGeomObj, parameters, name = "POUTRE"): """ Alias for class :class:`GeneralBeam`. """ - return GeneralBeam(studyId, groupName, groupGeomObj, parameters, name) + return GeneralBeam(groupName, groupGeomObj, parameters, name) ## Alias for class CircularBeam. # \ingroup parts -def VisuPoutreCercle(studyId, groupName, groupGeomObj, parameters, +def VisuPoutreCercle(groupName, groupGeomObj, parameters, name = "POUTRE"): """ Alias for class :class:`CircularBeam`. """ - return CircularBeam(studyId, groupName, groupGeomObj, parameters, name) + return CircularBeam(groupName, groupGeomObj, parameters, name) ## Alias for class RectangularBeam. # \ingroup parts -def VisuPoutreRectangle(studyId, groupName, groupGeomObj, parameters, +def VisuPoutreRectangle(groupName, groupGeomObj, parameters, name = "POUTRE"): """ Alias for class :class:`RectangularBeam`. """ - return RectangularBeam(studyId, groupName, groupGeomObj, parameters, name) + return RectangularBeam(groupName, groupGeomObj, parameters, name) ## Alias for class GeneralBeam. # \ingroup parts -def VisuBarreGenerale(studyId, groupName, groupGeomObj, parameters, +def VisuBarreGenerale(groupName, groupGeomObj, parameters, name = "BARRE"): """ Alias for class :class:`GeneralBeam`. """ - return GeneralBeam(studyId, groupName, groupGeomObj, parameters, name, + return GeneralBeam(groupName, groupGeomObj, parameters, name, color = ORANGE) ## Alias for class RectangularBeam. # \ingroup parts -def VisuBarreRectangle(studyId, groupName, groupGeomObj, parameters, +def VisuBarreRectangle(groupName, groupGeomObj, parameters, name = "BARRE"): """ Alias for class :class:`RectangularBeam`. """ - return RectangularBeam(studyId, groupName, groupGeomObj, parameters, name, + return RectangularBeam(groupName, groupGeomObj, parameters, name, color = ORANGE) ## Alias for class CircularBeam. # \ingroup parts -def VisuBarreCercle(studyId, groupName, groupGeomObj, parameters, +def VisuBarreCercle(groupName, groupGeomObj, parameters, name = "BARRE"): """ Alias for class :class:`CircularBeam`. """ - return CircularBeam(studyId, groupName, groupGeomObj, parameters, name, + return CircularBeam(groupName, groupGeomObj, parameters, name, color = ORANGE) ## Alias for class CircularBeam. # \ingroup parts -def VisuCable(studyId, groupName, groupGeomObj, parameters, name = "CABLE"): +def VisuCable(groupName, groupGeomObj, parameters, name = "CABLE"): """ Alias for class :class:`CircularBeam`. """ - return CircularBeam(studyId, groupName, groupGeomObj, parameters, name, + return CircularBeam(groupName, groupGeomObj, parameters, name, color = PURPLE) ## Alias for class ThickShell. # \ingroup parts -def VisuCoque(studyId, groupName, groupGeomObj, parameters, name = "COQUE"): +def VisuCoque(groupName, groupGeomObj, parameters, name = "COQUE"): """ Alias for class :class:`ThickShell`. """ - return ThickShell(studyId, groupName, groupGeomObj, parameters, name) + return ThickShell(groupName, groupGeomObj, parameters, name) ## Alias for class Grid. # \ingroup parts -def VisuGrille(studyId, groupName, groupGeomObj, parameters, name = "GRILLE"): +def VisuGrille(groupName, groupGeomObj, parameters, name = "GRILLE"): """ Alias for class :class:`Grid`. """ - return Grid(studyId, groupName, groupGeomObj, parameters, name) + return Grid(groupName, groupGeomObj, parameters, name) diff --git a/src/GEOM_SWIG/AdvancedGEOMBuilder.py b/src/GEOM_SWIG/AdvancedGEOMBuilder.py index 709de6c10..4309815fd 100644 --- a/src/GEOM_SWIG/AdvancedGEOMBuilder.py +++ b/src/GEOM_SWIG/AdvancedGEOMBuilder.py @@ -23,7 +23,7 @@ from GEOM import IAdvancedOperations __libraryName__ = "AdvancedEngine" def GetAdvancedOperations(self): - anOp = self.GetPluginOperations(self.myStudyId, __libraryName__) + anOp = self.GetPluginOperations(__libraryName__) return anOp._narrow(IAdvancedOperations) ## Create a T-shape object with specified caracteristics for the main diff --git a/src/GEOM_SWIG/BREPPluginBuilder.py b/src/GEOM_SWIG/BREPPluginBuilder.py index 11a25726d..0ffa6cb7b 100644 --- a/src/GEOM_SWIG/BREPPluginBuilder.py +++ b/src/GEOM_SWIG/BREPPluginBuilder.py @@ -24,7 +24,7 @@ from GEOM import IBREPOperations __libraryName__ = "BREPPluginEngine" def GetBREPPluginOperations(self): - anOp = self.GetPluginOperations(self.myStudyId, __libraryName__) + anOp = self.GetPluginOperations(__libraryName__) return anOp._narrow(IBREPOperations) ## Export the given shape into a file with given name in BREP format. diff --git a/src/GEOM_SWIG/GEOM_Nut.py b/src/GEOM_SWIG/GEOM_Nut.py index 23343c3f7..ef9530012 100755 --- a/src/GEOM_SWIG/GEOM_Nut.py +++ b/src/GEOM_SWIG/GEOM_Nut.py @@ -33,7 +33,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() #Sketcher_1 creation Sketcher_1 = geompy.MakeSketcher("Sketcher:F 100 -57.7:TT 100 57.7:TT 0 115.47:TT -100 57.7:TT -100 -57.7:TT 0 -115.47:WW") @@ -91,5 +91,5 @@ geompy.addToStudy(theShapeForCut, "slot.brep_1") Cut_1 = geompy.MakeBoolean(Chamfer_2, theShapeForCut, 2) geompy.addToStudy(Cut_1, "Cut_1") -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/src/GEOM_SWIG/GEOM_ObjectInfo.py b/src/GEOM_SWIG/GEOM_ObjectInfo.py index 95705536f..84c40fdd2 100644 --- a/src/GEOM_SWIG/GEOM_ObjectInfo.py +++ b/src/GEOM_SWIG/GEOM_ObjectInfo.py @@ -27,7 +27,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # Create several objects obj1 = geompy.MakeVertex(0.,0.,0.) @@ -49,10 +49,10 @@ obj5_entry = geompy.addToStudy(obj5, "Object5") hasInfo = geompy.hasObjectInfo() print "Check if GEOM module provides information about its objects: ", hasInfo if hasInfo == True: - print "Information about first object: ", geompy.getObjectInfo(salome.myStudyId, obj1_entry) - print "Information about second object: ", geompy.getObjectInfo(salome.myStudyId, obj2_entry) - print "Information about third object: ", geompy.getObjectInfo(salome.myStudyId, obj3_entry) - print "Information about fourth object: ", geompy.getObjectInfo(salome.myStudyId, obj4_entry) - print "Information about fifth object: ", geompy.getObjectInfo(salome.myStudyId, obj5_entry) + print "Information about first object: ", geompy.getObjectInfo(obj1_entry) + print "Information about second object: ", geompy.getObjectInfo(obj2_entry) + print "Information about third object: ", geompy.getObjectInfo(obj3_entry) + print "Information about fourth object: ", geompy.getObjectInfo(obj4_entry) + print "Information about fifth object: ", geompy.getObjectInfo(obj5_entry) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/src/GEOM_SWIG/GEOM_Partition1.py b/src/GEOM_SWIG/GEOM_Partition1.py index d95582e02..e81fe00a6 100755 --- a/src/GEOM_SWIG/GEOM_Partition1.py +++ b/src/GEOM_SWIG/GEOM_Partition1.py @@ -32,7 +32,7 @@ barier_height = 7.0 barier_radius = 5.6 / 2 # Rayon de la bariere colis_radius = 1.0 / 2 # Rayon du colis -colis_step = 2.0 # Distance s‰parant deux colis +colis_step = 2.0 # Distance s�parant deux colis cc_width = 0.11 # Epaisseur du complement de colisage # -- @@ -47,7 +47,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() boolean_common = 1 boolean_cut = 2 diff --git a/src/GEOM_SWIG/GEOM_Partition2.py b/src/GEOM_SWIG/GEOM_Partition2.py index c614ca92f..9de64fba5 100755 --- a/src/GEOM_SWIG/GEOM_Partition2.py +++ b/src/GEOM_SWIG/GEOM_Partition2.py @@ -35,7 +35,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.) vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.) diff --git a/src/GEOM_SWIG/GEOM_Partition3.py b/src/GEOM_SWIG/GEOM_Partition3.py index 1016df419..942e4a2d9 100755 --- a/src/GEOM_SWIG/GEOM_Partition3.py +++ b/src/GEOM_SWIG/GEOM_Partition3.py @@ -31,7 +31,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.) diff --git a/src/GEOM_SWIG/GEOM_Partition4.py b/src/GEOM_SWIG/GEOM_Partition4.py index 39384041d..0e2600f17 100755 --- a/src/GEOM_SWIG/GEOM_Partition4.py +++ b/src/GEOM_SWIG/GEOM_Partition4.py @@ -27,7 +27,7 @@ # import couplex2_01_GEOM # reload(couplex2_01_GEOM) # Dimensions de alveolus -# Parall‰pipˆde rectangle de taille alDx, alDy, alDz +# Parall�pip�de rectangle de taille alDx, alDy, alDz # alDx = 2.5 alDy = 20.0 @@ -35,7 +35,7 @@ alDz = 2.5 alSepx = 18.0 # Dimensions de backfill -# Parall‰pipˆde rectangle de taille baDx, baDy, baDz +# Parall�pip�de rectangle de taille baDx, baDy, baDz baDx = 27.0 baDy = 4.8 @@ -53,7 +53,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # -- Construction de backfill diff --git a/src/GEOM_SWIG/GEOM_Partition5.py b/src/GEOM_SWIG/GEOM_Partition5.py index 48dfc440f..4004c0b20 100755 --- a/src/GEOM_SWIG/GEOM_Partition5.py +++ b/src/GEOM_SWIG/GEOM_Partition5.py @@ -32,15 +32,15 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() -# -- Dimensions de la boite entiˆre +# -- Dimensions de la boite enti�re LX, LY, LZ = 300.0, 150.0, 150.0 p0 = geompy.MakeVertex(0.,0.,0.) vy = geompy.MakeVectorDXDYDZ(0.,1.,0.) -# -- D‰finition du plan de sym‰trie (O,Ox,Oz) +# -- D�finition du plan de sym�trie (O,Ox,Oz) symPlane = geompy.MakePlane(p0, vy, 10.0) @@ -60,7 +60,7 @@ gal = geompy.MakeTranslation(gal, gal_x, -gal_lony/2, 0.0) # -- Galerie perpendiculaire # -- Dimensions de la galerie perpendiculaire -# -- La longueur est compt‰e € partir du centre +# -- La longueur est compt�e � partir du centre # -- de la galerie principale gpe_long, gpe_diam = 200.0, 60.0 @@ -72,14 +72,14 @@ gpe = geompy.MakeCylinder( gpe = geompy.MakeTranslation(gpe, gpe_x, 0, 0) # -- Dimensions d'une alveole -# -- Construction d'une alv‰ole +# -- Construction d'une alv�ole alv_long, alv_diam = 60.0, 18.0 alv01 = geompy.MakeCylinder(p0, vy, alv_diam/2, alv_long) alv02 = geompy.MakeMirrorByPlane(alv01, symPlane) alv0 = geompy.MakeCompound([alv01, alv02]) -# -- Construction des alv‰oles +# -- Construction des alv�oles alv_del, alv_sep = 40.0, 35.0 alv1 = geompy.MakeTranslation(alv0, gal_x-gal_diam/2-alv_sep, 0.0, 0.0) diff --git a/src/GEOM_SWIG/GEOM_Sketcher.py b/src/GEOM_SWIG/GEOM_Sketcher.py index eb76c7587..75ba16ef1 100644 --- a/src/GEOM_SWIG/GEOM_Sketcher.py +++ b/src/GEOM_SWIG/GEOM_Sketcher.py @@ -30,7 +30,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() #SKETCHER INFOS #Init Sketcher diff --git a/src/GEOM_SWIG/GEOM_blocks.py b/src/GEOM_SWIG/GEOM_blocks.py index c33b2c446..a3f7f6f33 100644 --- a/src/GEOM_SWIG/GEOM_blocks.py +++ b/src/GEOM_SWIG/GEOM_blocks.py @@ -30,7 +30,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math import GEOM_Spanner @@ -42,4 +42,4 @@ smesh = None GEOM_Spanner.MakeSpanner(geompy, math, isBlocksTest, isMeshTest, smesh) -salome.sg.updateObjBrowser(True); +salome.sg.updateObjBrowser(); diff --git a/src/GEOM_SWIG/GEOM_cyl2complementary.py b/src/GEOM_SWIG/GEOM_cyl2complementary.py index 8f2fd6f84..c7628b179 100755 --- a/src/GEOM_SWIG/GEOM_cyl2complementary.py +++ b/src/GEOM_SWIG/GEOM_cyl2complementary.py @@ -35,13 +35,13 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() geomgui = salome.ImportComponentGUI("GEOM") import salome_ComponentGUI def addToStudy(shape, name): i = geompy.addToStudy(shape, name) - salome.sg.updateObjBrowser(False) + salome.sg.updateObjBrowser() if not isinstance(geomgui, type(salome_ComponentGUI)): geomgui.createAndDisplayGO(i) return i diff --git a/src/GEOM_SWIG/GEOM_example.py b/src/GEOM_SWIG/GEOM_example.py index 64946227e..f88d003b9 100644 --- a/src/GEOM_SWIG/GEOM_example.py +++ b/src/GEOM_SWIG/GEOM_example.py @@ -30,7 +30,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() ind = 0 boxlist = [] diff --git a/src/GEOM_SWIG/GEOM_example2.py b/src/GEOM_SWIG/GEOM_example2.py index 6c0fdf11c..8eb62bd13 100644 --- a/src/GEOM_SWIG/GEOM_example2.py +++ b/src/GEOM_SWIG/GEOM_example2.py @@ -30,16 +30,16 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM") myBuilder = salome.myStudy.NewBuilder() -BasicOp = geom.GetIBasicOperations(salome.myStudyId) -PrimOp = geom.GetI3DPrimOperations(salome.myStudyId) -InsertOp = geom.GetIInsertOperations(salome.myStudyId) -TrsfOp = geom.GetITransformOperations(salome.myStudyId) +BasicOp = geom.GetIBasicOperations() +PrimOp = geom.GetI3DPrimOperations() +InsertOp = geom.GetIInsertOperations() +TrsfOp = geom.GetITransformOperations() point0 = BasicOp.MakePointXYZ(0.,0.,0.) pointz1 = BasicOp.MakePointXYZ(0.,0.,1.) diff --git a/src/GEOM_SWIG/GEOM_example3.py b/src/GEOM_SWIG/GEOM_example3.py index a44cb7d37..fef518239 100644 --- a/src/GEOM_SWIG/GEOM_example3.py +++ b/src/GEOM_SWIG/GEOM_example3.py @@ -30,17 +30,17 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math from time import sleep import salome_ComponentGUI gg = salome.ImportComponentGUI("GEOM") -BasicOp = geompy.GetIBasicOperations(salome.myStudyId) -PrimOp = geompy.GetI3DPrimOperations(salome.myStudyId) -InsertOp = geompy.GetIInsertOperations(salome.myStudyId) -TrsfOp = geompy.GetITransformOperations(salome.myStudyId) +BasicOp = geompy.GetIBasicOperations() +PrimOp = geompy.GetI3DPrimOperations() +InsertOp = geompy.GetIInsertOperations() +TrsfOp = geompy.GetITransformOperations() point0 = BasicOp.MakePointXYZ(0.,0.,0.) pointz1 = BasicOp.MakePointXYZ(0.,0.,1.) diff --git a/src/GEOM_SWIG/GEOM_example4.py b/src/GEOM_SWIG/GEOM_example4.py index 312e47dda..c4b65ff74 100755 --- a/src/GEOM_SWIG/GEOM_example4.py +++ b/src/GEOM_SWIG/GEOM_example4.py @@ -29,7 +29,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math diff --git a/src/GEOM_SWIG/GEOM_example5.py b/src/GEOM_SWIG/GEOM_example5.py index 029e548fc..da3ad2f5e 100644 --- a/src/GEOM_SWIG/GEOM_example5.py +++ b/src/GEOM_SWIG/GEOM_example5.py @@ -30,10 +30,10 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() #Create Points -BasicOp = geompy.GetIBasicOperations(salome.myStudyId) +BasicOp = geompy.GetIBasicOperations() Vertex1 = BasicOp.MakePointXYZ(0., 0., 0.) Vertex2 = BasicOp.MakePointXYZ(100., 20., 30.) Vertex3 = BasicOp.MakePointXYZ(150., 100., -25.) diff --git a/src/GEOM_SWIG/GEOM_example6.py b/src/GEOM_SWIG/GEOM_example6.py index 6e40f5199..1e4e5f1a2 100755 --- a/src/GEOM_SWIG/GEOM_example6.py +++ b/src/GEOM_SWIG/GEOM_example6.py @@ -27,7 +27,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() ind = 1 circlelist = [] diff --git a/src/GEOM_SWIG/GEOM_example7.py b/src/GEOM_SWIG/GEOM_example7.py index 22db148d3..23650e622 100644 --- a/src/GEOM_SWIG/GEOM_example7.py +++ b/src/GEOM_SWIG/GEOM_example7.py @@ -27,7 +27,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() data_dir = os.getenv('DATA_DIR') if data_dir: diff --git a/src/GEOM_SWIG/GEOM_moteur.py b/src/GEOM_SWIG/GEOM_moteur.py index f2e606a16..57ae8ada6 100644 --- a/src/GEOM_SWIG/GEOM_moteur.py +++ b/src/GEOM_SWIG/GEOM_moteur.py @@ -30,7 +30,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math #Variables modifiables @@ -56,7 +56,7 @@ PosCour = PosZ + HauteurT * 4 / 7 PosRot = PosZ + 0.9 * HauteurT #Points -BasicOp = geompy.GetIBasicOperations(salome.myStudyId) +BasicOp = geompy.GetIBasicOperations() OO = BasicOp.MakePointXYZ(0, 0, 0) P0 = BasicOp.MakePointXYZ(0, 0, 1) P1 = BasicOp.MakePointXYZ(PosX, PosY, PosZ) diff --git a/src/GEOM_SWIG/GEOM_shellSolid.py b/src/GEOM_SWIG/GEOM_shellSolid.py index c776a0366..8e797ee85 100755 --- a/src/GEOM_SWIG/GEOM_shellSolid.py +++ b/src/GEOM_SWIG/GEOM_shellSolid.py @@ -35,7 +35,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # Interface with geometry # ----------------------- @@ -48,7 +48,7 @@ geomgui = salome.ImportComponentGUI("GEOM") def addToStudy(shape, name): i = geompy.addToStudy(shape, name) - salome.sg.updateObjBrowser(False) + salome.sg.updateObjBrowser() # geomgui.createAndDisplayGO(i) return i diff --git a/src/GEOM_SWIG/GEOM_tube_geom.py b/src/GEOM_SWIG/GEOM_tube_geom.py index 1a496174d..b169b6c6b 100755 --- a/src/GEOM_SWIG/GEOM_tube_geom.py +++ b/src/GEOM_SWIG/GEOM_tube_geom.py @@ -34,7 +34,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # # base de l'assemblage @@ -159,7 +159,7 @@ weldId = geompy.addToStudy(weld,"weld") # assemblage = geompy.Partition([base ,weld ,trav]) assemblageId = geompy.addToStudy(assemblage, "assemblage") -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() # # Display # diff --git a/src/GEOM_SWIG/GEOM_tube_geom_gg2.py b/src/GEOM_SWIG/GEOM_tube_geom_gg2.py index aa4e782dc..f58eb8368 100755 --- a/src/GEOM_SWIG/GEOM_tube_geom_gg2.py +++ b/src/GEOM_SWIG/GEOM_tube_geom_gg2.py @@ -34,7 +34,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # # base de l'assemblage # diff --git a/src/GEOM_SWIG/GEOM_usinggeom.py b/src/GEOM_SWIG/GEOM_usinggeom.py index ce546d467..cc78f4ca0 100644 --- a/src/GEOM_SWIG/GEOM_usinggeom.py +++ b/src/GEOM_SWIG/GEOM_usinggeom.py @@ -28,7 +28,7 @@ # import salome from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import math diff --git a/src/GEOM_SWIG/IGESPluginBuilder.py b/src/GEOM_SWIG/IGESPluginBuilder.py index 65fad3f19..0e686ee9f 100644 --- a/src/GEOM_SWIG/IGESPluginBuilder.py +++ b/src/GEOM_SWIG/IGESPluginBuilder.py @@ -24,7 +24,7 @@ from GEOM import IIGESOperations __libraryName__ = "IGESPluginEngine" def GetIGESPluginOperations(self): - anOp = self.GetPluginOperations(self.myStudyId, __libraryName__) + anOp = self.GetPluginOperations(__libraryName__) return anOp._narrow(IIGESOperations) ## Export the given shape into a file with given name in IGES format. diff --git a/src/GEOM_SWIG/PAL_MESH_019_020_geometry.py b/src/GEOM_SWIG/PAL_MESH_019_020_geometry.py index 0278053e4..2bc092087 100755 --- a/src/GEOM_SWIG/PAL_MESH_019_020_geometry.py +++ b/src/GEOM_SWIG/PAL_MESH_019_020_geometry.py @@ -31,7 +31,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() #Points creation (2.2) Vertex_1 = geompy.MakeVertex(0, 0, 0) @@ -57,4 +57,4 @@ geompy.addToStudy(Curve_1, "Curve_1") Line_1 = geompy.MakeLineTwoPnt(Vertex_4, Vertex_5) geompy.addToStudy(Line_1, "Line_1") -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/src/GEOM_SWIG/PAL_MESH_028_geometry.py b/src/GEOM_SWIG/PAL_MESH_028_geometry.py index 7f1633502..45dbbd78e 100755 --- a/src/GEOM_SWIG/PAL_MESH_028_geometry.py +++ b/src/GEOM_SWIG/PAL_MESH_028_geometry.py @@ -31,7 +31,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import os @@ -80,11 +80,11 @@ theFilenameToSave = theHomePath + "/Pyramid.hdf" if os.access(theFilenameToSave, os.F_OK): if os.access(theFilenameToSave, os.W_OK): os.remove(theFilenameToSave) - salome.myStudyManager.SaveAs(theFilenameToSave, salome.myStudy, 0) + salome.myStudy.SaveAs(theFilenameToSave, 0, 0) else: print "You have no enough permissions to overwrite HDF file: ",theFilenameToSave else: - salome.myStudyManager.SaveAs(theFilenameToSave, salome.myStudy, 0) + salome.myStudy.SaveAs(theFilenameToSave, 0, 0) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/src/GEOM_SWIG/PAL_MESH_030_geometry.py b/src/GEOM_SWIG/PAL_MESH_030_geometry.py index e33690b3f..a4b23893c 100755 --- a/src/GEOM_SWIG/PAL_MESH_030_geometry.py +++ b/src/GEOM_SWIG/PAL_MESH_030_geometry.py @@ -31,7 +31,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # Stage 2: "Creation of geometry" @@ -80,4 +80,4 @@ id_Face_4 = geompy.addToStudyInFather(Compound_1,Compound_1_faces[3], "Face_4") id_Compound_2 = geompy.addToStudy(Compound_2, "Compound_2") id_Solid_2 = geompy.addToStudyInFather(Compound_2,Compound_2_solids[1], "Solid_2") -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/src/GEOM_SWIG/PAL_MESH_033_geometry.py b/src/GEOM_SWIG/PAL_MESH_033_geometry.py index 65111eb68..2e769173f 100755 --- a/src/GEOM_SWIG/PAL_MESH_033_geometry.py +++ b/src/GEOM_SWIG/PAL_MESH_033_geometry.py @@ -31,7 +31,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() #Points creation (2.2) Vertex_1 = geompy.MakeVertex(0, 0, 0) @@ -63,4 +63,4 @@ geompy.addToStudy(Edge_4, "Edge_4") Wire_1 = geompy.MakeWire([Edge_1, Edge_2, Edge_3, Edge_4]) geompy.addToStudy(Wire_1, "Wire_1") -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/src/GEOM_SWIG/PAL_MESH_035_geometry.py b/src/GEOM_SWIG/PAL_MESH_035_geometry.py index 253951b29..2b93280fa 100755 --- a/src/GEOM_SWIG/PAL_MESH_035_geometry.py +++ b/src/GEOM_SWIG/PAL_MESH_035_geometry.py @@ -31,7 +31,7 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() #Box creation (2.2) Box_1 = geompy.MakeBoxDXDYDZ(200, 400, 300) @@ -111,4 +111,4 @@ for i in range (0, NbExplodedVertices_Face_18): name = "Vertex_" + str(NbExplodedVertices_Box_1+NbExplodedVertices_Face_7+NbExplodedVertices_Face_10+NbExplodedVertices_Face_15+i+1) geompy.addToStudyInFather(ListOfFaces_Partition_1[NbExplodedFaces_Partition_1-1], ListOfVertices_Face_18[i], name) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/src/GEOM_SWIG/STEPPluginBuilder.py b/src/GEOM_SWIG/STEPPluginBuilder.py index 84ac4cf0c..4f38b2f8f 100644 --- a/src/GEOM_SWIG/STEPPluginBuilder.py +++ b/src/GEOM_SWIG/STEPPluginBuilder.py @@ -25,7 +25,7 @@ import GEOM __libraryName__ = "STEPPluginEngine" def GetSTEPPluginOperations(self): - anOp = self.GetPluginOperations(self.myStudyId, __libraryName__) + anOp = self.GetPluginOperations(__libraryName__) return anOp._narrow(ISTEPOperations) ## Export the given shape into a file with given name in STEP format. diff --git a/src/GEOM_SWIG/STLPluginBuilder.py b/src/GEOM_SWIG/STLPluginBuilder.py index 1ee593c13..01a3791fc 100644 --- a/src/GEOM_SWIG/STLPluginBuilder.py +++ b/src/GEOM_SWIG/STLPluginBuilder.py @@ -24,7 +24,7 @@ from GEOM import ISTLOperations __libraryName__ = "STLPluginEngine" def GetSTLPluginOperations(self): - anOp = self.GetPluginOperations(self.myStudyId, __libraryName__) + anOp = self.GetPluginOperations(__libraryName__) return anOp._narrow(ISTLOperations) ## Export the given shape into a file with given name in STL format. diff --git a/src/GEOM_SWIG/VTKPluginBuilder.py b/src/GEOM_SWIG/VTKPluginBuilder.py index c97048650..044720f10 100644 --- a/src/GEOM_SWIG/VTKPluginBuilder.py +++ b/src/GEOM_SWIG/VTKPluginBuilder.py @@ -24,7 +24,7 @@ from GEOM import IVTKOperations __libraryName__ = "VTKPluginEngine" def GetVTKPluginOperations(self): - anOp = self.GetPluginOperations(self.myStudyId, __libraryName__) + anOp = self.GetPluginOperations(__libraryName__) return anOp._narrow(IVTKOperations) ## Export the given shape into a file with given name in VTK format. diff --git a/src/GEOM_SWIG/XAOPluginBuilder.py b/src/GEOM_SWIG/XAOPluginBuilder.py index 84a0945d6..bab02fd36 100644 --- a/src/GEOM_SWIG/XAOPluginBuilder.py +++ b/src/GEOM_SWIG/XAOPluginBuilder.py @@ -24,7 +24,7 @@ from GEOM import IXAOOperations __libraryName__ = "XAOPluginEngine" def GetXAOPluginOperations(self): - anOp = self.GetPluginOperations(self.myStudyId, __libraryName__) + anOp = self.GetPluginOperations(__libraryName__) return anOp._narrow(IXAOOperations) ## Export a shape to XAO format diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py index 5de7403b3..934a62219 100644 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -52,7 +52,7 @@ ## @code ## import salome ## from salome.geom import geomBuilder -## geompy = geomBuilder.New(salome.myStudy) +## geompy = geomBuilder.New() ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet ## geompy.addToStudy(box, "box") # explicit publishing ## @endcode @@ -115,7 +115,7 @@ ## @code ## import salome ## from salome.geom import geomBuilder -## geompy = geomBuilder.New(salome.myStudy) +## geompy = geomBuilder.New() ## geompy.addToStudyAuto() # enable automatic publication ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) ## # the box is created and published in the study with default name @@ -157,7 +157,7 @@ ## @code ## import salome ## from salome.geom import geomBuilder -## geompy = geomBuilder.New(salome.myStudy) +## geompy = geomBuilder.New() ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box") ## # the box was created and published in the study ## folder = geompy.NewFolder("Primitives") @@ -438,7 +438,7 @@ def PackData(data): ## For example, ## \code ## from salome.geom import geomBuilder -## geompy = geomBuilder.New(salome.myStudy) +## geompy = geomBuilder.New() ## texture = geompy.readtexture('mytexture.dat') ## texture = geompy.AddTexture(*texture) ## obj.SetMarkerTexture(texture) @@ -464,7 +464,7 @@ def ReadTexture(fname): Example of usage: from salome.geom import geomBuilder - geompy = geomBuilder.New(salome.myStudy) + geompy = geomBuilder.New() texture = geompy.readtexture('mytexture.dat') texture = geompy.AddTexture(*texture) obj.SetMarkerTexture(texture) @@ -652,7 +652,6 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): GEOM._objref_GEOM_Gen.__init__(self) self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default self.myBuilder = None - self.myStudyId = 0 self.father = None self.BasicOp = None @@ -753,12 +752,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): ## @addtogroup l1_geomBuilder_auxiliary ## @{ - def init_geom(self,theStudy): - self.myStudy = theStudy - self.myStudyId = self.myStudy._get_StudyId() + def init_geom(self): + self.myStudy = salome.myStudy self.myBuilder = self.myStudy.NewBuilder() self.father = self.myStudy.FindComponent("GEOM") - notebook.myStudy = theStudy + notebook.myStudy = salome.myStudy if self.father is None: self.father = self.myBuilder.NewComponent("GEOM") A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName") @@ -769,19 +767,19 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry") self.myBuilder.DefineComponentInstance(self.father,self) pass - self.BasicOp = self.GetIBasicOperations (self.myStudyId) - self.CurvesOp = self.GetICurvesOperations (self.myStudyId) - self.PrimOp = self.GetI3DPrimOperations (self.myStudyId) - self.ShapesOp = self.GetIShapesOperations (self.myStudyId) - self.HealOp = self.GetIHealingOperations (self.myStudyId) - self.InsertOp = self.GetIInsertOperations (self.myStudyId) - self.BoolOp = self.GetIBooleanOperations (self.myStudyId) - self.TrsfOp = self.GetITransformOperations(self.myStudyId) - self.LocalOp = self.GetILocalOperations (self.myStudyId) - self.MeasuOp = self.GetIMeasureOperations (self.myStudyId) - self.BlocksOp = self.GetIBlocksOperations (self.myStudyId) - self.GroupOp = self.GetIGroupOperations (self.myStudyId) - self.FieldOp = self.GetIFieldOperations (self.myStudyId) + self.BasicOp = self.GetIBasicOperations () + self.CurvesOp = self.GetICurvesOperations () + self.PrimOp = self.GetI3DPrimOperations () + self.ShapesOp = self.GetIShapesOperations () + self.HealOp = self.GetIHealingOperations () + self.InsertOp = self.GetIInsertOperations () + self.BoolOp = self.GetIBooleanOperations () + self.TrsfOp = self.GetITransformOperations() + self.LocalOp = self.GetILocalOperations () + self.MeasuOp = self.GetIMeasureOperations () + self.BlocksOp = self.GetIBlocksOperations () + self.GroupOp = self.GetIGroupOperations () + self.FieldOp = self.GetIFieldOperations () # set GEOM as root in the use case tree self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder() @@ -792,8 +790,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): self.myBuilder.LoadWith(self.father, self) pass - def GetPluginOperations(self, studyID, libraryName): - op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName) + def GetPluginOperations(self, libraryName): + op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName) return op ## Enable / disable results auto-publishing @@ -833,12 +831,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): ## Dump component to the Python script # This method overrides IDL function to allow default values for the parameters. - def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True): + def DumpPython(self, theIsPublished=True, theIsMultiFile=True): """ Dump component to the Python script This method overrides IDL function to allow default values for the parameters. """ - return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile) + return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile) ## Get name for sub-shape aSubObj of shape aMainObj # @@ -893,10 +891,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): """ # Example: see GEOM_TestAll.py try: - aSObject = self.AddInStudy(self.myStudy, aShape, aName, None) + aSObject = self.AddInStudy(aShape, aName, None) if aSObject and aName: aSObject.SetAttrString("AttributeName", aName) if doRestoreSubShapes: - self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs, + self.RestoreSubShapesSO(aSObject, theArgs, theFindMethod, theInheritFirstArg, True ) except: print "addToStudy() failed" @@ -926,7 +924,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): """ # Example: see GEOM_TestAll.py try: - aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather) + aSObject = self.AddInStudy(aShape, aName, aFather) if aSObject and aName: aSObject.SetAttrString("AttributeName", aName) except: print "addToStudyInFather() failed" @@ -1012,7 +1010,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): list of published sub-shapes """ # Example: see GEOM_TestAll.py - return self.RestoreSubShapesO(self.myStudy, theObject, theArgs, + return self.RestoreSubShapesO(theObject, theArgs, theFindMethod, theInheritFirstArg, theAddPrefix) ## Publish sub-shapes, standing for arguments and sub-shapes of arguments @@ -1064,7 +1062,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): list of published sub-shapes """ # Example: see GEOM_TestAll.py - return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs, + return self.RestoreGivenSubShapesO(theObject, theArgs, theFindMethod, theInheritFirstArg, theAddPrefix) # end of l3_restore_ss @@ -13441,7 +13439,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length` + left_str + "length" + right_str + `max_length`) - sg.updateObjBrowser(True) + sg.updateObjBrowser() return group_edges @@ -13904,12 +13902,11 @@ omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField) # import salome # salome.salome_init() # from salome.geom import geomBuilder -# geompy = geomBuilder.New(salome.myStudy) +# geompy = geomBuilder.New() # \endcode -# @param study SALOME study, generally obtained by salome.myStudy. # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used. # @return geomBuilder instance -def New( study, instance=None): +def New( instance=None): """ Create a new geomBuilder instance.The geomBuilder class provides the Python interface to GEOM operations. @@ -13918,10 +13915,9 @@ def New( study, instance=None): import salome salome.salome_init() from salome.geom import geomBuilder - geompy = geomBuilder.New(salome.myStudy) + geompy = geomBuilder.New() Parameters: - study SALOME study, generally obtained by salome.myStudy. instance CORBA proxy of GEOM Engine. If None, the default Engine is used. Returns: geomBuilder instance @@ -13935,7 +13931,7 @@ def New( study, instance=None): doLcc = True geom = geomBuilder() assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__ - geom.init_geom(study) + geom.init_geom() return geom diff --git a/src/GEOM_SWIG/geompy.py b/src/GEOM_SWIG/geompy.py index 99935ece9..fa4ae2c5e 100644 --- a/src/GEOM_SWIG/geompy.py +++ b/src/GEOM_SWIG/geompy.py @@ -37,7 +37,7 @@ from salome.geom.geomBuilder import info, PackData, ReadTexture, EnumToLong try: # get GEOM engine and initialize GEOM with current study engineGeom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" ) - geom = geomBuilder.New(salome.myStudy, engineGeom) + geom = geomBuilder.New(engineGeom) # export the methods of geomBuilder for k in dir( geom ): @@ -65,13 +65,13 @@ replace ------- import geompy -geompy.init_geom(theStudy) +geompy.init_geom() with ---- from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() See also GEOM User's Guide for more details diff --git a/src/GEOM_SWIG/gsketcher.py b/src/GEOM_SWIG/gsketcher.py index 965f17c96..27ff6abbf 100644 --- a/src/GEOM_SWIG/gsketcher.py +++ b/src/GEOM_SWIG/gsketcher.py @@ -30,7 +30,7 @@ # @code # import GEOM # from salome.geom import geomBuilder -# geompy = geomBuilder.New(salome.myStudy) +# geompy = geomBuilder.New() # # # create a wire for sketcher # geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0) @@ -48,7 +48,7 @@ # geompy.addToStudy( Sketch_1, 'Sketch_1' ) # # # update object browser -# salome.sg.updateObjBrowser(True) +# salome.sg.updateObjBrowser() # @endcode # @n Additionnal examples can be found as unit tests in the source code. # @} diff --git a/src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx b/src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx index 9a810d39c..9ecc7722e 100644 --- a/src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx +++ b/src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx @@ -124,14 +124,9 @@ void GEOM_Swig::createAndDisplayGO( const char* theEntry, bool theUpdateViewer ) {} virtual void Execute() { - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if ( !app ) return; - SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); - if ( !study ) return; - Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.c_str(), "GEOM", "" ); - GEOM_Displayer( study ).Display( io, myUpdateViewer ); + GEOM_Displayer().Display( io, myUpdateViewer ); } }; @@ -186,14 +181,9 @@ void GEOM_Swig::eraseGO( const char* theEntry, bool theUpdateViewer ) {} virtual void Execute() { - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if ( !app ) return; - SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); - if ( !study ) return; - Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.c_str(), "GEOM", "" ); - GEOM_Displayer( study ).Erase( io, true, myUpdateViewer ); + GEOM_Displayer().Erase( io, true, myUpdateViewer ); } }; @@ -212,13 +202,7 @@ void GEOM_Swig::UpdateViewer() {} virtual void Execute() { - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if ( !app ) return; - - SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); - if ( !study ) return; - - GEOM_Displayer( study ).UpdateViewer(); + GEOM_Displayer().UpdateViewer(); } }; @@ -248,7 +232,7 @@ int GEOM_Swig::getIndexTopology( const char* theSubIOR, const char* theMainIOR ) if ( !CORBA::is_nil( aGeomGen ) && !CORBA::is_nil( aMainShape ) && !CORBA::is_nil( aSubShape ) ) { // get shapes operations interface GEOM::GEOM_IShapesOperations_var anIShapesOperations = - aGeomGen->GetIShapesOperations( aMainShape->GetStudyID() ); + aGeomGen->GetIShapesOperations(); if ( !CORBA::is_nil( anIShapesOperations ) ) index = anIShapesOperations->GetTopologyIndex( aMainShape, aSubShape ); } @@ -275,7 +259,7 @@ const char* GEOM_Swig::getShapeTypeString( const char* theIOR ) if ( !CORBA::is_nil( aGeomGen ) && !CORBA::is_nil( aShape ) ) { // get shapes operations interface GEOM::GEOM_IShapesOperations_var anIShapesOperations = - aGeomGen->GetIShapesOperations( aShape->GetStudyID() ); + aGeomGen->GetIShapesOperations(); if ( !CORBA::is_nil( anIShapesOperations ) ) aTypeName = anIShapesOperations->GetShapeTypeString( aShape ); } @@ -354,7 +338,7 @@ void TSetPropertyEvent::Execute() SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); if ( !study ) return; - GEOM_Displayer displayer( study ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx index 62020f0a3..da51a7bee 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx @@ -327,7 +327,7 @@ void GenerationGUI_FillingDlg::ApproxChanged() //================================================================================= GEOM::GEOM_IOperations_ptr GenerationGUI_FillingDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //================================================================================= diff --git a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx index d4e23678e..e02b2c498 100644 --- a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx @@ -502,7 +502,7 @@ void GenerationGUI_PipeDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr GenerationGUI_PipeDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //================================================================================= @@ -642,8 +642,7 @@ bool GenerationGUI_PipeDlg::extractPrefix() const // purpose : virtual method to restore tree of argument's sub-shapes under // the resulting shape. Redefined from GEOMBase_Helper class. //================================================================================= -void GenerationGUI_PipeDlg::restoreSubShapes - (SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject) +void GenerationGUI_PipeDlg::restoreSubShapes(SALOMEDS::SObject_ptr theSObject) { QCheckBox *aGenGroupCheck = NULL; QLineEdit *aPrefixEdit = NULL; @@ -691,8 +690,7 @@ void GenerationGUI_PipeDlg::restoreSubShapes } aName += tr((*it)->GetName()); - getGeomEngine()->AddInStudy(theStudy, (*it).get(), - aName.toStdString().c_str(), aFather); + getGeomEngine()->AddInStudy((*it).get(), aName.toStdString().c_str(), aFather); } } } diff --git a/src/GenerationGUI/GenerationGUI_PipeDlg.h b/src/GenerationGUI/GenerationGUI_PipeDlg.h index c9b2f0833..1e7f53e6e 100644 --- a/src/GenerationGUI/GenerationGUI_PipeDlg.h +++ b/src/GenerationGUI/GenerationGUI_PipeDlg.h @@ -55,8 +55,7 @@ protected: virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); virtual bool extractPrefix() const; - virtual void restoreSubShapes - (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + virtual void restoreSubShapes(SALOMEDS::SObject_ptr); virtual QList getSourceObjects(); private: diff --git a/src/GenerationGUI/GenerationGUI_PipePathDlg.cxx b/src/GenerationGUI/GenerationGUI_PipePathDlg.cxx index 25deeaee0..5b09040cf 100644 --- a/src/GenerationGUI/GenerationGUI_PipePathDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PipePathDlg.cxx @@ -339,7 +339,7 @@ void GenerationGUI_PipePathDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr GenerationGUI_PipePathDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //================================================================================= diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index 8403c41e4..379b1fd49 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -526,7 +526,7 @@ void GenerationGUI_PrismDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr GenerationGUI_PrismDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //================================================================================= diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx index 59b901286..5019de545 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx @@ -296,7 +296,7 @@ double GenerationGUI_RevolDlg::getAngle() const //================================================================================= GEOM::GEOM_IOperations_ptr GenerationGUI_RevolDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //================================================================================= diff --git a/src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx b/src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx index fb866c165..0d8a2cf1b 100644 --- a/src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx @@ -376,7 +376,7 @@ void GenerationGUI_ThicknessDlg::ValueChangedInSpinBox() //============================================================================== GEOM::GEOM_IOperations_ptr GenerationGUI_ThicknessDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //============================================================================== diff --git a/src/GroupGUI/GroupGUI_BooleanDlg.cxx b/src/GroupGUI/GroupGUI_BooleanDlg.cxx index 994868603..b309e74cb 100644 --- a/src/GroupGUI/GroupGUI_BooleanDlg.cxx +++ b/src/GroupGUI/GroupGUI_BooleanDlg.cxx @@ -265,7 +265,7 @@ void GroupGUI_BooleanDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr GroupGUI_BooleanDlg::createOperation() { - return getGeomEngine()->GetIGroupOperations(getStudyId()); + return getGeomEngine()->GetIGroupOperations(); } //================================================================================= diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index a7ce624ec..f83147551 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -509,7 +509,7 @@ void GroupGUI_GroupDlg::onGetInPlace() SUIT_OverrideCursor wc; myEditCurrentArgument->setText(GEOMBase::GetName(anObj)); GEOM::GEOM_IShapesOperations_var aShapesOp = - getGeomEngine()->GetIShapesOperations(getStudyId()); + getGeomEngine()->GetIShapesOperations(); if (subSelectionWay() == GET_IN_PLACE) { GEOM::GEOM_Object_var aGetInPlaceObj = aShapesOp->GetInPlace(myMainObj, anObj); setInPlaceObj(aGetInPlaceObj); @@ -542,8 +542,8 @@ void GroupGUI_GroupDlg::setInPlaceObj(GEOM::GEOM_Object_var theObj, const bool i // build map of indices myMain2InPlaceIndices.Clear(); if (!myInPlaceObj->_is_nil()) { - GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); - GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(getStudyId()); + GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(); + GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(); GEOM::ListOfGO_var aSubObjects = aShapesOp->MakeExplode(myInPlaceObj, getShapeType(), false); for ( int i = 0; i < aSubObjects->length(); i++ ) @@ -696,7 +696,7 @@ void GroupGUI_GroupDlg::selectAllSubShapes() return; GEOM::ListOfLong_var aSubShapes; - GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations(getStudyId()); + GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations(); aSubShapes = aShOp->SubShapeAllIDs(myMainObj, getShapeType(), false); if (aSubShapes->length() > 0) { if (subSelectionWay() == ALL_SUBSHAPES) @@ -1171,7 +1171,7 @@ void GroupGUI_GroupDlg::updateState (bool isAdd) myIsShapeType && getShapeType() != TopAbs_VERTEX); // manage of 'Plot' button access - GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); + GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations(); GEOM::ListOfLong_var aSubShapes = aShOp->SubShapeAllIDs( myMainObj, getShapeType(), false ); bool hasCurrentEntities = aSubShapes->length() > 0; #ifndef DISABLE_PLOT2DVIEWER @@ -1252,7 +1252,7 @@ void GroupGUI_GroupDlg::highlightSubShapes() SALOME_ListIO aSelList; // To highlight the selected sub-shape in Object Browser, if it's already published under the main shape - GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(getStudyId()); + GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(); QMap childsMap; SalomeApp_Study* appStudy = dynamic_cast(app->activeStudy()); if (appStudy) { @@ -1311,7 +1311,7 @@ void GroupGUI_GroupDlg::highlightSubShapes() //================================================================================= GEOM::GEOM_IOperations_ptr GroupGUI_GroupDlg::createOperation() { - return getGeomEngine()->GetIGroupOperations(getStudyId()); + return getGeomEngine()->GetIGroupOperations(); } #define RETURN_WITH_MSG(a, b) \ diff --git a/src/IGESPlugin/IGESPlugin_GUI.cxx b/src/IGESPlugin/IGESPlugin_GUI.cxx index 1e9f9ac63..be44363a2 100644 --- a/src/IGESPlugin/IGESPlugin_GUI.cxx +++ b/src/IGESPlugin/IGESPlugin_GUI.cxx @@ -107,11 +107,8 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent ) { SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return false; - SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); - if ( !study ) return false; - SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); - GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "IGESPluginEngine" ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "IGESPluginEngine" ); IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op ); if ( igesOp.isNull() ) return false; @@ -177,14 +174,13 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent ) { GEOM::GEOM_Object_var main = result[0]; QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) ); - SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy, - SALOMEDS::SObject::_nil(), + SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), main.in(), publishName.toUtf8().constData() ); entryList.append( so->GetID() ); transaction.commit(); - GEOM_Displayer( study ).Display( main.in() ); + GEOM_Displayer().Display( main.in() ); main->UnRegister(); } else @@ -199,7 +195,7 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent ) } } - getGeometryGUI()->updateObjBrowser( true ); + getGeometryGUI()->updateObjBrowser(); app->browseObjects( entryList ); if ( errors.count() > 0 ) @@ -223,8 +219,7 @@ bool IGESPlugin_GUI::exportIGES( SUIT_Desktop* parent ) SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); if ( !study ) return false; - SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); - GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "IGESPluginEngine" ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "IGESPluginEngine" ); IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op ); if ( igesOp.isNull() ) return false; diff --git a/src/IGESPlugin/IGESPlugin_IECallBack.cxx b/src/IGESPlugin/IGESPlugin_IECallBack.cxx index 0bca95a5d..9fda7a6b6 100755 --- a/src/IGESPlugin/IGESPlugin_IECallBack.cxx +++ b/src/IGESPlugin/IGESPlugin_IECallBack.cxx @@ -45,12 +45,11 @@ IGESPlugin_IECallBack::~IGESPlugin_IECallBack() * Export */ //============================================================================= -bool IGESPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +bool IGESPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId ); + IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() ); TCollection_AsciiString aVersion = ( theFormatName == "IGES_5_3" ) ? "5.3" : "5.1"; aPluginOperations->ExportIGES( theOriginal, theFileName, aVersion ); return true; @@ -62,11 +61,10 @@ bool IGESPlugin_IECallBack::Export( int theDocId, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -IGESPlugin_IECallBack::Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +IGESPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId ); + IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() ); bool anIsIgnoreUnits = ( theFormatName == "IGES_SCALE" ) ? true : false; return aPluginOperations->ImportIGES( theFileName, anIsIgnoreUnits ); } @@ -77,11 +75,10 @@ IGESPlugin_IECallBack::Import( int theDocId, */ //============================================================================= TCollection_AsciiString -IGESPlugin_IECallBack::ReadValue( int theDocId, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theParameterName ) +IGESPlugin_IECallBack::ReadValue( const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theParameterName ) { - IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId ); + IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() ); return aPluginOperations->ReadValue( theFileName, theParameterName ); } diff --git a/src/IGESPlugin/IGESPlugin_IECallBack.hxx b/src/IGESPlugin/IGESPlugin_IECallBack.hxx index 716d55a1b..dde69bdcf 100644 --- a/src/IGESPlugin/IGESPlugin_IECallBack.hxx +++ b/src/IGESPlugin/IGESPlugin_IECallBack.hxx @@ -36,17 +36,14 @@ public: IGESPlugin_IECallBack(); ~IGESPlugin_IECallBack(); - bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, + bool Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName ); - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); - TCollection_AsciiString ReadValue( int theDocId, - const TCollection_AsciiString& theFileName, + TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName, const TCollection_AsciiString& theParameterName ); }; diff --git a/src/IGESPlugin/IGESPlugin_IOperations.cxx b/src/IGESPlugin/IGESPlugin_IOperations.cxx index c53752cf4..1857d6a6b 100644 --- a/src/IGESPlugin/IGESPlugin_IOperations.cxx +++ b/src/IGESPlugin/IGESPlugin_IOperations.cxx @@ -38,8 +38,8 @@ * Constructor */ //============================================================================= -IGESPlugin_IOperations::IGESPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +IGESPlugin_IOperations::IGESPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "IGESPlugin_IOperations::IGESPlugin_IOperations" ); } @@ -77,7 +77,7 @@ void IGESPlugin_IOperations::ExportIGES( const Handle(GEOM_Object) theOrigi if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT); //Add an Export function Handle(GEOM_Function) aFunction = result->AddFunction( IGESPlugin_ExportDriver::GetID(), EXPORT_SHAPE ); @@ -129,7 +129,7 @@ IGESPlugin_IOperations::ImportIGES( const TCollection_AsciiString& theFileName, if( theFileName.IsEmpty() ) return NULL; //Add a new result object - Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT ); + Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT ); //Add an Import function Handle(GEOM_Function) aFunction = diff --git a/src/IGESPlugin/IGESPlugin_IOperations.hxx b/src/IGESPlugin/IGESPlugin_IOperations.hxx index 0fea3f36b..5573a210b 100644 --- a/src/IGESPlugin/IGESPlugin_IOperations.hxx +++ b/src/IGESPlugin/IGESPlugin_IOperations.hxx @@ -30,7 +30,7 @@ class IGESPLUGINENGINE_EXPORT IGESPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - IGESPlugin_IOperations( GEOM_Engine*, int ); + IGESPlugin_IOperations( GEOM_Engine* ); ~IGESPlugin_IOperations(); void ExportIGES( const Handle(GEOM_Object), diff --git a/src/IGESPlugin/IGESPlugin_OperationsCreator.cxx b/src/IGESPlugin/IGESPlugin_OperationsCreator.cxx index 209ce65c1..9f33d8323 100644 --- a/src/IGESPlugin/IGESPlugin_OperationsCreator.cxx +++ b/src/IGESPlugin/IGESPlugin_OperationsCreator.cxx @@ -32,7 +32,7 @@ // OCCT includes #include -std::map IGESPlugin_OperationsCreator::_mapOfOperations; +IGESPlugin_IOperations* IGESPlugin_OperationsCreator::_operation; IGESPlugin_OperationsCreator::IGESPlugin_OperationsCreator() { @@ -54,19 +54,17 @@ IGESPlugin_OperationsCreator::~IGESPlugin_OperationsCreator() } GEOM_IOperations_i* IGESPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ) { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "IGESPlugin_OperationsCreator::Create" ); - return new IGESPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) ); + return new IGESPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -IGESPlugin_IOperations* IGESPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ) +IGESPlugin_IOperations* IGESPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { - if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) - _mapOfOperations[theStudyId] = new IGESPlugin_IOperations( theGenImpl, theStudyId ); - return _mapOfOperations[theStudyId]; + if( !_operation ) + _operation = new IGESPlugin_IOperations( theGenImpl ); + return _operation; } diff --git a/src/IGESPlugin/IGESPlugin_OperationsCreator.hxx b/src/IGESPlugin/IGESPlugin_OperationsCreator.hxx index cd507e7c1..ea3270481 100755 --- a/src/IGESPlugin/IGESPlugin_OperationsCreator.hxx +++ b/src/IGESPlugin/IGESPlugin_OperationsCreator.hxx @@ -41,15 +41,13 @@ public: ~IGESPlugin_OperationsCreator(); GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, - int theStudyId, - GEOM::GEOM_Gen_ptr theEngine, - ::GEOMImpl_Gen* theGenImpl ); + GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_Gen* theGenImpl ); private: - static IGESPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ); + static IGESPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); private: - static std::map _mapOfOperations; + static IGESPlugin_IOperations* _operation; friend class IGESPlugin_IECallBack; }; diff --git a/src/MeasureGUI/MeasureGUI.cxx b/src/MeasureGUI/MeasureGUI.cxx index d50c62cf1..bb1f08893 100755 --- a/src/MeasureGUI/MeasureGUI.cxx +++ b/src/MeasureGUI/MeasureGUI.cxx @@ -195,9 +195,6 @@ void MeasureGUI::ChangeDimensionsVisibility( const bool theIsVisible ) if ( !anApp ) return; - SalomeApp_Study* anActiveStudy = dynamic_cast( anApp->activeStudy() ); - if ( !anActiveStudy ) - return; Handle(SALOME_InteractiveObject) anIObject = getSingleSelectedIO(); if ( anIObject.IsNull() @@ -206,15 +203,15 @@ void MeasureGUI::ChangeDimensionsVisibility( const bool theIsVisible ) SUIT_OverrideCursor wc; - GEOMGUI_DimensionProperty aDimensions( anActiveStudy, anIObject->getEntry() ); + GEOMGUI_DimensionProperty aDimensions( QString(anIObject->getEntry()) ); for ( int anIt = 0; anIt < aDimensions.GetNumber(); ++anIt ) { aDimensions.SetVisible( anIt, theIsVisible ); } - aDimensions.SaveToAttribute( anActiveStudy, anIObject->getEntry() ); + aDimensions.SaveToAttribute( anIObject->getEntry() ); - GEOM_Displayer( anActiveStudy ).Redisplay( anIObject, true ); + GEOM_Displayer().Redisplay( anIObject, true ); } //======================================================================= diff --git a/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx b/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx index d7b06070f..edbb88efa 100755 --- a/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx @@ -724,7 +724,7 @@ void MeasureGUI_AnnotationDlg::onDragged( Handle_GEOM_Annotation theAnnotation ) //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_AnnotationDlg::createOperation() { - return getGeomEngine()->GetILocalOperations( getStudyId() ); + return getGeomEngine()->GetILocalOperations( ); } //================================================================================= diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx index 574e7a315..4f87282d3 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx @@ -273,7 +273,7 @@ void MeasureGUI_BndBoxDlg::SelectionIntoArgument() //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_BndBoxDlg::createOperation() { - return getGeomEngine()->GetIMeasureOperations(getStudyId()); + return getGeomEngine()->GetIMeasureOperations(); } //================================================================================= diff --git a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx index 301ba442b..8450ba064 100644 --- a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx @@ -272,7 +272,7 @@ void MeasureGUI_CenterMassDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_CenterMassDlg::createOperation() { - return getGeomEngine()->GetIMeasureOperations( getStudyId() ); + return getGeomEngine()->GetIMeasureOperations(); } //================================================================================= diff --git a/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx index 177128f27..8984624ce 100644 --- a/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx @@ -394,7 +394,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::processObject() //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_CheckCompoundOfBlocksDlg::createOperation() { - return getGeomEngine()->GetIBlocksOperations( getStudyId() ); + return getGeomEngine()->GetIBlocksOperations(); } //================================================================================= diff --git a/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx index 41c0d94ff..cdcf96403 100644 --- a/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx @@ -486,7 +486,7 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::extractPrefix() const //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_CheckSelfIntersectionsDlg::createOperation() { - return getGeomEngine()->GetIMeasureOperations( getStudyId() ); + return getGeomEngine()->GetIMeasureOperations(); } //================================================================================= @@ -710,7 +710,7 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::execute(ObjectList& objects) } } - GEOM::ShapesOpPtr shapesOper = getGeomEngine()->GetIShapesOperations(getStudyId()); + GEOM::ShapesOpPtr shapesOper = getGeomEngine()->GetIShapesOperations(); // Explode sub-shapes GEOM::ListOfLong_var anArray = new GEOM::ListOfLong; diff --git a/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx index 25907ba45..263bb27a5 100644 --- a/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx @@ -445,7 +445,7 @@ void MeasureGUI_CheckShapeDlg::processObject() //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_CheckShapeDlg::createOperation() { - return getGeomEngine()->GetIMeasureOperations( getStudyId() ); + return getGeomEngine()->GetIMeasureOperations(); } //================================================================================= @@ -625,7 +625,7 @@ bool MeasureGUI_CheckShapeDlg::execute( ObjectList& objects ) } if (myShapesOper->_is_nil()) { - myShapesOper = getGeomEngine()->GetIShapesOperations(getStudyId()); + myShapesOper = getGeomEngine()->GetIShapesOperations(); } GEOM::ListOfGO_var aList = myShapesOper->MakeSubShapes(myObj, anArray); diff --git a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx index 7dd84b34f..9934c3230 100644 --- a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx @@ -415,7 +415,7 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs() //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_DistanceDlg::createOperation() { - return getGeomEngine()->GetIMeasureOperations(getStudyId()); + return getGeomEngine()->GetIMeasureOperations(); } //================================================================================= @@ -434,7 +434,7 @@ bool MeasureGUI_DistanceDlg::isValid (QString& msg) bool MeasureGUI_DistanceDlg::execute (ObjectList& objects) { GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation()); - GEOM::GEOM_IBasicOperations_var aBasicOper = getGeomEngine()->GetIBasicOperations(getStudyId()); + GEOM::GEOM_IBasicOperations_var aBasicOper = getGeomEngine()->GetIBasicOperations(); GEOM::ListOfDouble_var aDbls; int nbSols = anOper->ClosestPoints(myObj1.get(), myObj2.get(), aDbls); diff --git a/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx b/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx index bce0e8829..696e5ac1b 100644 --- a/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx @@ -360,7 +360,7 @@ bool MeasureGUI_FastCheckIntersectionsDlg::extractPrefix() const //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_FastCheckIntersectionsDlg::createOperation() { - return getGeomEngine()->GetIMeasureOperations( getStudyId() ); + return getGeomEngine()->GetIMeasureOperations(); } //================================================================================= @@ -611,7 +611,7 @@ GEOM::ListOfGO_var MeasureGUI_FastCheckIntersectionsDlg::getLstObjFromListSelect } if (myShapesOper->_is_nil()) - myShapesOper = getGeomEngine()->GetIShapesOperations(getStudyId()); + myShapesOper = getGeomEngine()->GetIShapesOperations(); GEOM::ListOfGO_var aObjLstCreate = myShapesOper->MakeSubShapes(anObj.get(), anArray); diff --git a/src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx b/src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx index a41c5ee77..ff946e666 100644 --- a/src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx @@ -287,7 +287,7 @@ void MeasureGUI_GetNonBlocksDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_GetNonBlocksDlg::createOperation() { - return getGeomEngine()->GetIBlocksOperations(getStudyId()); + return getGeomEngine()->GetIBlocksOperations(); } //================================================================================= diff --git a/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx b/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx index fa53c1aa0..9ab9a7450 100644 --- a/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx @@ -770,7 +770,7 @@ bool MeasureGUI_ManageDimensionsDlg::ClickOnApply() QVariant() ) .value(); - mySavedPropertyState.SaveToAttribute( aStudy, myEditObject->GetStudyEntry() ); + mySavedPropertyState.SaveToAttribute( myEditObject->GetStudyEntry() ); myGeomGUI->emitDimensionsUpdated( QString( myEditObject->GetStudyEntry() ) ); @@ -919,7 +919,7 @@ void MeasureGUI_ManageDimensionsDlg::SetEditObject( const GEOM::GeomObjPtr& theO return; } - mySavedPropertyState.LoadFromAttribute( getStudy(), myEditObject->GetStudyEntry() ); + mySavedPropertyState.LoadFromAttribute( myEditObject->GetStudyEntry() ); // set property state for preview aStudy->setObjectProperty( GEOM::sharedPropertiesId(), diff --git a/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx b/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx index 70dd07960..12d45b46c 100644 --- a/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx @@ -188,7 +188,7 @@ void MeasureGUI_NormaleDlg::SelectionIntoArgument() aSelMgr->GetIndexes(aSelList.First(), aMap); if (aMap.Extent() == 1) // Local Selection { - GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); + GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(); int anIndex = aMap(1); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); aName += QString(":face_%1").arg(anIndex); @@ -221,7 +221,7 @@ void MeasureGUI_NormaleDlg::SelectionIntoArgument() aSelMgr->GetIndexes(aSelList.First(), aMap); if (aMap.Extent() == 1) // Local Selection { - GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); + GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(); int anIndex = aMap(1); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); aName += QString(":vertex_%1").arg(anIndex); @@ -333,7 +333,7 @@ void MeasureGUI_NormaleDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_NormaleDlg::createOperation() { - return getGeomEngine()->GetIMeasureOperations(getStudyId()); + return getGeomEngine()->GetIMeasureOperations(); } //================================================================================= diff --git a/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.cxx b/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.cxx index 78afc2eb5..d8f8dfaef 100644 --- a/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.cxx @@ -40,7 +40,6 @@ #include #include -#include #include #include @@ -206,7 +205,7 @@ MeasureGUI_ShapeStatisticsDlg::~MeasureGUI_ShapeStatisticsDlg() //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_ShapeStatisticsDlg::createOperation() { - return getGeomEngine()->GetIGroupOperations(getStudyId()); + return getGeomEngine()->GetIGroupOperations(); } #define RETURN_WITH_MSG(a, b) \ @@ -307,7 +306,7 @@ void MeasureGUI_ShapeStatisticsDlg::updateTypes( QList theShap myShapes.push_back( aShape ); GEOM::ListOfLong_var aSubShapes; - GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); + GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations(); if ( hasEdges != 0 ) hasEdges = aShOp->NumberOfSubShapes( aShapePtr.get(), TopAbs_EDGE ) > 0; if ( hasFaces != 0 ) @@ -472,7 +471,6 @@ bool MeasureGUI_ShapeStatisticsDlg::execute(ObjectList& objects) int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); QString aTypePrefix = myCBTypes->currentText().replace(' ', '_'); QString objIOR, aMin, aMax, aGroupName; - SalomeApp_Study* study = getStudy(); GEOMUtils::Distribution aShapesDistr = GEOMUtils::ComputeDistribution( myShapes, currentType(), myNbIntervals->value(), aRange ); diff --git a/src/MeasureGUI/MeasureGUI_Skeleton.cxx b/src/MeasureGUI/MeasureGUI_Skeleton.cxx index dcab485c9..387648140 100644 --- a/src/MeasureGUI/MeasureGUI_Skeleton.cxx +++ b/src/MeasureGUI/MeasureGUI_Skeleton.cxx @@ -363,7 +363,7 @@ bool MeasureGUI_Skeleton::isValid( QString& ) GEOM_Displayer* MeasureGUI_Skeleton::getDisplayer() { if ( !myDisplayer ) - myDisplayer = new GEOM_Displayer( getStudy() ); + myDisplayer = new GEOM_Displayer(); return myDisplayer; } @@ -373,7 +373,7 @@ GEOM_Displayer* MeasureGUI_Skeleton::getDisplayer() //================================================================================= GEOM::GEOM_IOperations_ptr MeasureGUI_Skeleton::createOperation() { - return getGeomEngine()->GetIMeasureOperations( getStudyId() ); + return getGeomEngine()->GetIMeasureOperations(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx index 238971ee9..1aace4f88 100644 --- a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx +++ b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx @@ -253,7 +253,7 @@ void OperationGUI_ArchimedeDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_ArchimedeDlg::createOperation() { - return getGeomEngine()->GetILocalOperations( getStudyId() ); + return getGeomEngine()->GetILocalOperations(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index 20d0bf617..a3e3d7b00 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -748,7 +748,7 @@ void OperationGUI_ChamferDlg::enableWidgets() //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_ChamferDlg::createOperation() { - return getGeomEngine()->GetILocalOperations(getStudyId()); + return getGeomEngine()->GetILocalOperations(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_ExtractionDlg.cxx b/src/OperationGUI/OperationGUI_ExtractionDlg.cxx index 9c9557a5f..7837cc027 100644 --- a/src/OperationGUI/OperationGUI_ExtractionDlg.cxx +++ b/src/OperationGUI/OperationGUI_ExtractionDlg.cxx @@ -1200,7 +1200,7 @@ bool OperationGUI_ExtractionDlg::isValid(QString &) //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_ExtractionDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations(getStudyId()); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx b/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx index 17c9f088f..eed2eab83 100644 --- a/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx +++ b/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx @@ -340,7 +340,7 @@ void OperationGUI_ExtrudedFeatureDlg::ButtonClicked(bool checked) //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_ExtrudedFeatureDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx b/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx index 6f6867f4a..a65912c06 100644 --- a/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx +++ b/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx @@ -215,7 +215,7 @@ void OperationGUI_Fillet1d2dDlg::SelectionIntoArgument() GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( anObj, aName ); if ( aFindedObject->_is_nil()) { // Object not found in study - GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); + GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(); anObj = aShapesOp->GetSubShape( anObj, anIndex ); } else @@ -379,7 +379,7 @@ void OperationGUI_Fillet1d2dDlg::activateSelection() //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_Fillet1d2dDlg::createOperation() { - return getGeomEngine()->GetILocalOperations(getStudyId()); + return getGeomEngine()->GetILocalOperations(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index fdde37777..148546a23 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -594,7 +594,7 @@ void OperationGUI_FilletDlg::enableWidgets() //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_FilletDlg::createOperation() { - return getGeomEngine()->GetILocalOperations(getStudyId()); + return getGeomEngine()->GetILocalOperations(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx b/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx index be4a4aec1..8c8f40ddc 100644 --- a/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx +++ b/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx @@ -288,7 +288,7 @@ void OperationGUI_GetShapesOnShapeDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_GetShapesOnShapeDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations(getStudyId()); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_GetSharedShapesDlg.cxx b/src/OperationGUI/OperationGUI_GetSharedShapesDlg.cxx index 5b24f665e..d27a65219 100644 --- a/src/OperationGUI/OperationGUI_GetSharedShapesDlg.cxx +++ b/src/OperationGUI/OperationGUI_GetSharedShapesDlg.cxx @@ -331,7 +331,7 @@ int OperationGUI_GetSharedShapesDlg::GetType() const //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_GetSharedShapesDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations(getStudyId()); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.cxx b/src/OperationGUI/OperationGUI_PartitionDlg.cxx index 19f0d2d49..fa5bdbfdf 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.cxx +++ b/src/OperationGUI/OperationGUI_PartitionDlg.cxx @@ -330,7 +330,7 @@ void OperationGUI_PartitionDlg::SelectionIntoArgument() if ( !myListTools.length() ) return; else if ( myListTools.length() == 1 && getConstructorId() == 1 ) { - GEOM::GEOM_IMeasureOperations_var mOp = getGeomEngine()->GetIMeasureOperations( getStudyId() ); + GEOM::GEOM_IMeasureOperations_var mOp = getGeomEngine()->GetIMeasureOperations(); GEOM::ListOfLong_var intList; GEOM::ListOfDouble_var dblList; GEOM::GEOM_IKindOfShape::shape_kind kind = mOp->KindOfShape( myListTools[0].in(), intList.out(), dblList.out() ); @@ -428,7 +428,7 @@ void OperationGUI_PartitionDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_PartitionDlg::createOperation() { - return getGeomEngine()->GetIBooleanOperations( getStudyId() ); + return getGeomEngine()->GetIBooleanOperations(); } @@ -505,12 +505,11 @@ bool OperationGUI_PartitionDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject ) +void OperationGUI_PartitionDlg::restoreSubShapes( 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(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory, /*theInheritFirstArg=*/myListShapes.length() == 1 && myListTools.length() == 0, mainFrame()->CheckBoxAddPrefix->isChecked() ); // ? false diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.h b/src/OperationGUI/OperationGUI_PartitionDlg.h index 294a8d554..11065a223 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.h +++ b/src/OperationGUI/OperationGUI_PartitionDlg.h @@ -50,7 +50,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/OperationGUI/OperationGUI_TransferDataDlg.cxx b/src/OperationGUI/OperationGUI_TransferDataDlg.cxx index d2ee50509..9dfa239c0 100755 --- a/src/OperationGUI/OperationGUI_TransferDataDlg.cxx +++ b/src/OperationGUI/OperationGUI_TransferDataDlg.cxx @@ -255,7 +255,7 @@ void OperationGUI_TransferDataDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_TransferDataDlg::createOperation() { - return getGeomEngine()->GetIInsertOperations(getStudyId()); + return getGeomEngine()->GetIInsertOperations(); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index 4ee511f06..799b0dba1 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -355,7 +355,7 @@ void PrimitiveGUI_BoxDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr PrimitiveGUI_BoxDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index 35026d0dc..f0ac02fab 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -371,7 +371,7 @@ void PrimitiveGUI_ConeDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr PrimitiveGUI_ConeDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 63baa9a6b..580335979 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -385,7 +385,7 @@ void PrimitiveGUI_CylinderDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr PrimitiveGUI_CylinderDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx index c65ce0732..720ca7605 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx @@ -454,7 +454,7 @@ void PrimitiveGUI_DiskDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr PrimitiveGUI_DiskDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } // //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx index d40424386..004692a3e 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx @@ -409,7 +409,7 @@ void PrimitiveGUI_FaceDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr PrimitiveGUI_FaceDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetI3DPrimOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetI3DPrimOperations(); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index 610f5b9b4..83173ce3f 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -325,7 +325,7 @@ void PrimitiveGUI_SphereDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr PrimitiveGUI_SphereDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations( getStudyId() ); + return getGeomEngine()->GetI3DPrimOperations(); } diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index a89d5bb4a..f7c4373f1 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -359,7 +359,7 @@ void PrimitiveGUI_TorusDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr PrimitiveGUI_TorusDlg::createOperation() { - return getGeomEngine()->GetI3DPrimOperations(getStudyId()); + return getGeomEngine()->GetI3DPrimOperations(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx index 51ad304cd..f3e8f16d8 100644 --- a/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx +++ b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx @@ -249,7 +249,7 @@ void RepairGUI_ChangeOrientationDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_ChangeOrientationDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations( getStudyId() ); + return getGeomEngine()->GetIHealingOperations(); } diff --git a/src/RepairGUI/RepairGUI_CloseContourDlg.cxx b/src/RepairGUI/RepairGUI_CloseContourDlg.cxx index bee3b32f0..957cb087b 100644 --- a/src/RepairGUI/RepairGUI_CloseContourDlg.cxx +++ b/src/RepairGUI/RepairGUI_CloseContourDlg.cxx @@ -301,7 +301,7 @@ void RepairGUI_CloseContourDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_CloseContourDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations(getStudyId()); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx index 9a0605781..ba22d601f 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx @@ -474,7 +474,7 @@ void RepairGUI_DivideEdgeDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_DivideEdgeDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations( getStudyId() ); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx b/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx index c875a27bc..bee3282a2 100644 --- a/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx +++ b/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx @@ -241,7 +241,7 @@ void RepairGUI_FreeBoundDlg::activateSelection() //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_FreeBoundDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations(getStudyId()); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx index 8b5c71b6d..73c99830e 100644 --- a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx @@ -250,7 +250,7 @@ void RepairGUI_FreeFacesDlg::activateSelection() //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_FreeFacesDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations( getStudyId() ); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= @@ -364,7 +364,7 @@ bool RepairGUI_FreeFacesDlg::execute( ObjectList& objects ) GEOM_Displayer* RepairGUI_FreeFacesDlg::getDisplayer() { if ( !myDisplayer ) - myDisplayer = new GEOM_Displayer( getStudy() ); + myDisplayer = new GEOM_Displayer(); return myDisplayer; } diff --git a/src/RepairGUI/RepairGUI_FuseEdgesDlg.cxx b/src/RepairGUI/RepairGUI_FuseEdgesDlg.cxx index 591a1b528..4e24d3634 100644 --- a/src/RepairGUI/RepairGUI_FuseEdgesDlg.cxx +++ b/src/RepairGUI/RepairGUI_FuseEdgesDlg.cxx @@ -186,7 +186,7 @@ void RepairGUI_FuseEdgesDlg::SelectionIntoArgument() GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(anObj, aName); if (aFindedObject->_is_nil()) { // Object not found in study - GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); + GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(); anObj = aShapesOp->GetSubShape(anObj, anIndex); } else @@ -304,7 +304,7 @@ void RepairGUI_FuseEdgesDlg::activateSelection() //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_FuseEdgesDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations(getStudyId()); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_GlueDlg.cxx b/src/RepairGUI/RepairGUI_GlueDlg.cxx index cf4d33ba9..9e789f72c 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.cxx +++ b/src/RepairGUI/RepairGUI_GlueDlg.cxx @@ -408,7 +408,7 @@ void RepairGUI_GlueDlg::enterEvent(QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_GlueDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations(getStudyId()); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= @@ -542,8 +542,7 @@ bool RepairGUI_GlueDlg::execute(ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_GlueDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void RepairGUI_GlueDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { GEOM::find_shape_method aFindMethod = GEOM::FSM_GetInPlace; @@ -551,7 +550,7 @@ void RepairGUI_GlueDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy, aFindMethod = GEOM::FSM_GetInPlaceByHistory; // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), aFindMethod, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); } diff --git a/src/RepairGUI/RepairGUI_GlueDlg.h b/src/RepairGUI/RepairGUI_GlueDlg.h index bf8ff96b5..92321bdc7 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.h +++ b/src/RepairGUI/RepairGUI_GlueDlg.h @@ -55,7 +55,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid (QString&); virtual bool execute (ObjectList&); - virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + virtual void restoreSubShapes (SALOMEDS::SObject_ptr); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_InspectObjectDlg.cxx b/src/RepairGUI/RepairGUI_InspectObjectDlg.cxx index 1888113da..8b61bcf19 100644 --- a/src/RepairGUI/RepairGUI_InspectObjectDlg.cxx +++ b/src/RepairGUI/RepairGUI_InspectObjectDlg.cxx @@ -1188,8 +1188,6 @@ void RepairGUI_InspectObjectDlg::clickOnHide() //================================================================================= void RepairGUI_InspectObjectDlg::clickOnPublish() { - _PTR(Study) studyDS = dynamic_cast( myGeomGUI->getApp()->activeStudy() )->studyDS(); - // find main object TreeWidgetItem* aMainItem = dynamic_cast( myCurrentTreeObjects->topLevelItem(0) ); @@ -1217,12 +1215,12 @@ void RepairGUI_InspectObjectDlg::clickOnPublish() anArray->length(j); // get selected sub-shapes - GEOM::GEOM_IShapesOperations_var anOper = getGeomEngine()->GetIShapesOperations( getStudyId() ); + GEOM::GEOM_IShapesOperations_var anOper = getGeomEngine()->GetIShapesOperations(); GEOM::ListOfGO_var aList = anOper->MakeSubShapes( aMainObject, anArray ); // publish sub-shapes for ( int i = 0; i < aList->length(); i++ ) - GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ), aList[i], + GeometryGUI::GetGeomGen()->AddInStudy( aList[i], anIndices.values().at(i).toStdString().c_str(), aMainObject ); updateObjBrowser(); diff --git a/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx b/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx index 11ae185f2..554c68c9e 100644 --- a/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx +++ b/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx @@ -275,7 +275,7 @@ void RepairGUI_LimitToleranceDlg::enterEvent(QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_LimitToleranceDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations(getStudyId()); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= @@ -433,12 +433,11 @@ void RepairGUI_LimitToleranceDlg::updateButtonState() // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_LimitToleranceDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void RepairGUI_LimitToleranceDlg::restoreSubShapes(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(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), GEOM::FSM_GetInPlace, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); } diff --git a/src/RepairGUI/RepairGUI_LimitToleranceDlg.h b/src/RepairGUI/RepairGUI_LimitToleranceDlg.h index 5ec1ab29f..53ef961e8 100644 --- a/src/RepairGUI/RepairGUI_LimitToleranceDlg.h +++ b/src/RepairGUI/RepairGUI_LimitToleranceDlg.h @@ -48,7 +48,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid (QString&); virtual bool execute (ObjectList&); - virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + virtual void restoreSubShapes (SALOMEDS::SObject_ptr); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx index 9341fe543..09a2975d8 100644 --- a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx @@ -267,7 +267,7 @@ void RepairGUI_RemoveExtraEdgesDlg::activateSelection() //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_RemoveExtraEdgesDlg::createOperation() { - return getGeomEngine()->GetIBlocksOperations( getStudyId() ); + return getGeomEngine()->GetIBlocksOperations(); } //================================================================================= @@ -303,12 +303,11 @@ bool RepairGUI_RemoveExtraEdgesDlg::execute( ObjectList& objects ) // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_RemoveExtraEdgesDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject ) +void RepairGUI_RemoveExtraEdgesDlg::restoreSubShapes( 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(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked() ); diff --git a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.h b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.h index c14ed88c2..83e3eb74a 100644 --- a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.h +++ b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.h @@ -45,7 +45,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx b/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx index 69c219628..6ad6053ea 100644 --- a/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx @@ -305,7 +305,7 @@ void RepairGUI_RemoveHolesDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_RemoveHolesDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations(getStudyId()); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx b/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx index 12d44bf1d..2626f6d3b 100644 --- a/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx @@ -290,7 +290,7 @@ void RepairGUI_RemoveIntWiresDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_RemoveIntWiresDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations(getStudyId()); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx b/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx index c5f56a2b5..e679ba1bb 100755 --- a/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx @@ -236,7 +236,7 @@ void RepairGUI_RemoveWebsDlg::activateSelection() //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_RemoveWebsDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations(getStudyId()); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= @@ -272,12 +272,11 @@ bool RepairGUI_RemoveWebsDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_RemoveWebsDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void RepairGUI_RemoveWebsDlg::restoreSubShapes (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(), + getGeomEngine()->RestoreSubShapesSO(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 index a5ce390be..71e55acf6 100755 --- a/src/RepairGUI/RepairGUI_RemoveWebsDlg.h +++ b/src/RepairGUI/RepairGUI_RemoveWebsDlg.h @@ -44,7 +44,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid (QString&); virtual bool execute (ObjectList&); - virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + virtual void restoreSubShapes (SALOMEDS::SObject_ptr); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_SewingDlg.cxx b/src/RepairGUI/RepairGUI_SewingDlg.cxx index bd1e03edc..0050245b9 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.cxx +++ b/src/RepairGUI/RepairGUI_SewingDlg.cxx @@ -258,7 +258,7 @@ void RepairGUI_SewingDlg::enterEvent( QEvent* ) //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_SewingDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations( getStudyId() ); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx index 37880e93e..8c925a132 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx @@ -519,7 +519,7 @@ QString set_convert( const char* theParam, const char* theValue ) //================================================================================= void RepairGUI_ShapeProcessDlg::loadDefaults() { - GEOM::GEOM_IHealingOperations_var anOp = myGeomGUI->GetGeomGen()->GetIHealingOperations( getStudyId() ); + GEOM::GEOM_IHealingOperations_var anOp = myGeomGUI->GetGeomGen()->GetIHealingOperations(); GEOM::string_array_var anOperators, aParams, aValues; anOp->GetShapeProcessParameters( anOperators, aParams, aValues ); @@ -615,7 +615,7 @@ QString RepairGUI_ShapeProcessDlg::getText( QWidget* theControl ) const //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_ShapeProcessDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations( getStudyId() ); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx index e2f5e94da..b34504186 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx @@ -352,7 +352,7 @@ void RepairGUI_SuppressFacesDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_SuppressFacesDlg::createOperation() { - return getGeomEngine()->GetIHealingOperations(getStudyId()); + return getGeomEngine()->GetIHealingOperations(); } //================================================================================= @@ -414,12 +414,11 @@ void RepairGUI_SuppressFacesDlg::initSelection() // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_SuppressFacesDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void RepairGUI_SuppressFacesDlg::restoreSubShapes (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(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.h b/src/RepairGUI/RepairGUI_SuppressFacesDlg.h index 215963785..09f5506d8 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.h +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.h @@ -48,7 +48,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_UnionFacesDlg.cxx b/src/RepairGUI/RepairGUI_UnionFacesDlg.cxx index 0e63edee7..b03a105a1 100755 --- a/src/RepairGUI/RepairGUI_UnionFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_UnionFacesDlg.cxx @@ -263,7 +263,7 @@ void RepairGUI_UnionFacesDlg::activateSelection() //================================================================================= GEOM::GEOM_IOperations_ptr RepairGUI_UnionFacesDlg::createOperation() { - return getGeomEngine()->GetIBlocksOperations( getStudyId() ); + return getGeomEngine()->GetIBlocksOperations(); } //================================================================================= @@ -294,12 +294,11 @@ bool RepairGUI_UnionFacesDlg::execute( ObjectList& objects ) // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_UnionFacesDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject ) +void RepairGUI_UnionFacesDlg::restoreSubShapes( 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(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked() ); diff --git a/src/RepairGUI/RepairGUI_UnionFacesDlg.h b/src/RepairGUI/RepairGUI_UnionFacesDlg.h index 0d74105a1..1e8c68d25 100755 --- a/src/RepairGUI/RepairGUI_UnionFacesDlg.h +++ b/src/RepairGUI/RepairGUI_UnionFacesDlg.h @@ -45,7 +45,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/STEPPlugin/STEPPlugin_GUI.cxx b/src/STEPPlugin/STEPPlugin_GUI.cxx index f9dad8df3..6fd9cfcb9 100644 --- a/src/STEPPlugin/STEPPlugin_GUI.cxx +++ b/src/STEPPlugin/STEPPlugin_GUI.cxx @@ -111,11 +111,8 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent ) { SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return false; - SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); - if ( !study ) return false; - SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); - GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STEPPluginEngine" ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STEPPluginEngine" ); STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op ); if ( stepOp.isNull() ) return false; @@ -183,19 +180,18 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent ) { GEOM::GEOM_Object_var main = result[0]; QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) ); - SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy, - SALOMEDS::SObject::_nil(), - main.in(), - publishName.toUtf8().constData() ); + SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), + main.in(), + publishName.toUtf8().constData() ); entryList.append( so->GetID() ); for ( int i = 1, n = result->length(); i < n; i++ ) { GEOM::GEOM_Object_ptr group = result[i]; CORBA::String_var grpName = group->GetName(); - GeometryGUI::GetGeomGen()->AddInStudy( dsStudy, group, grpName.in(), main ); + GeometryGUI::GetGeomGen()->AddInStudy( group, grpName.in(), main ); } transaction.commit(); - GEOM_Displayer( study ).Display( main.in() ); + GEOM_Displayer().Display( main.in() ); main->UnRegister(); } else @@ -210,7 +206,7 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent ) } } - getGeometryGUI()->updateObjBrowser( true ); + getGeometryGUI()->updateObjBrowser(); app->browseObjects( entryList ); if ( errors.count() > 0 ) @@ -234,8 +230,7 @@ bool STEPPlugin_GUI::exportSTEP( SUIT_Desktop* parent ) SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); if ( !study ) return false; - SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); - GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STEPPluginEngine" ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STEPPluginEngine" ); STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op ); if ( stepOp.isNull() ) return false; diff --git a/src/STEPPlugin/STEPPlugin_IECallBack.cxx b/src/STEPPlugin/STEPPlugin_IECallBack.cxx index 86f00981f..cae343405 100644 --- a/src/STEPPlugin/STEPPlugin_IECallBack.cxx +++ b/src/STEPPlugin/STEPPlugin_IECallBack.cxx @@ -46,12 +46,11 @@ STEPPlugin_IECallBack::~STEPPlugin_IECallBack() */ //============================================================================= bool -STEPPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +STEPPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId ); + STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() ); const STEPPlugin_IOperations::LengthUnit aUnit = STEPPlugin_IOperations::LengthUnit_Meter; aPluginOperations->ExportSTEP( theOriginal, theFileName, aUnit ); @@ -64,11 +63,10 @@ STEPPlugin_IECallBack::Export( int theDocId, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -STEPPlugin_IECallBack::Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +STEPPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId ); + STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() ); bool anIsIgnoreUnits = ( theFormatName == "STEP_SCALE" ) ? true : false; return aPluginOperations->ImportSTEP( theFileName, anIsIgnoreUnits, false ); } @@ -79,11 +77,10 @@ STEPPlugin_IECallBack::Import( int theDocId, */ //============================================================================= TCollection_AsciiString -STEPPlugin_IECallBack::ReadValue( int theDocId, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theParameterName ) +STEPPlugin_IECallBack::ReadValue( const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theParameterName ) { - STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId ); + STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() ); return aPluginOperations->ReadValue( theFileName, theParameterName ); } diff --git a/src/STEPPlugin/STEPPlugin_IECallBack.hxx b/src/STEPPlugin/STEPPlugin_IECallBack.hxx index 3f961d8bc..71c55f456 100644 --- a/src/STEPPlugin/STEPPlugin_IECallBack.hxx +++ b/src/STEPPlugin/STEPPlugin_IECallBack.hxx @@ -36,17 +36,14 @@ public: STEPPlugin_IECallBack(); ~STEPPlugin_IECallBack(); - bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, + bool Export( const Handle(GEOM_Object) theOriginal, const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName ); - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); - TCollection_AsciiString ReadValue( int theDocId, - const TCollection_AsciiString& theFileName, + TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName, const TCollection_AsciiString& theParameterName ); }; diff --git a/src/STEPPlugin/STEPPlugin_IOperations.cxx b/src/STEPPlugin/STEPPlugin_IOperations.cxx index ec5943759..46a4594a1 100644 --- a/src/STEPPlugin/STEPPlugin_IOperations.cxx +++ b/src/STEPPlugin/STEPPlugin_IOperations.cxx @@ -38,8 +38,8 @@ * Constructor */ //============================================================================= -STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "STEPPlugin_IOperations::STEPPlugin_IOperations" ); } @@ -122,7 +122,7 @@ void STEPPlugin_IOperations::ExportSTEP if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT); //Add an Export function Handle(GEOM_Function) aFunction = result->AddFunction( STEPPlugin_ExportDriver::GetID(), EXPORT_SHAPE ); @@ -175,7 +175,7 @@ STEPPlugin_IOperations::ImportSTEP(const TCollection_AsciiString& theFileName, if( theFileName.IsEmpty() ) return NULL; //Add a new result object - Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT ); + Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT ); //Add an Import function Handle(GEOM_Function) aFunction = diff --git a/src/STEPPlugin/STEPPlugin_IOperations.hxx b/src/STEPPlugin/STEPPlugin_IOperations.hxx index 4a29e5a1e..a99c57d22 100644 --- a/src/STEPPlugin/STEPPlugin_IOperations.hxx +++ b/src/STEPPlugin/STEPPlugin_IOperations.hxx @@ -51,7 +51,7 @@ public: public: - STEPPlugin_IOperations( GEOM_Engine*, int ); + STEPPlugin_IOperations( GEOM_Engine* ); ~STEPPlugin_IOperations(); void ExportSTEP( const Handle(GEOM_Object), diff --git a/src/STEPPlugin/STEPPlugin_OperationsCreator.cxx b/src/STEPPlugin/STEPPlugin_OperationsCreator.cxx index bf52a1f1a..c81392c7e 100644 --- a/src/STEPPlugin/STEPPlugin_OperationsCreator.cxx +++ b/src/STEPPlugin/STEPPlugin_OperationsCreator.cxx @@ -35,7 +35,7 @@ // OCCT includes #include -std::map STEPPlugin_OperationsCreator::_mapOfOperations; +STEPPlugin_IOperations* STEPPlugin_OperationsCreator::_operation; STEPPlugin_OperationsCreator::STEPPlugin_OperationsCreator() { @@ -56,19 +56,17 @@ STEPPlugin_OperationsCreator::~STEPPlugin_OperationsCreator() } GEOM_IOperations_i* STEPPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ) { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "STEPPlugin_OperationsCreator::Create" ); - return new STEPPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) ); + return new STEPPlugin_IOperations_i( thePOA, theEngine, get(theGenImpl) ); } -STEPPlugin_IOperations* STEPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ) +STEPPlugin_IOperations* STEPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { - if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) - _mapOfOperations[theStudyId] = new STEPPlugin_IOperations( theGenImpl, theStudyId ); - return _mapOfOperations[theStudyId]; + if( !_operation ) + _operation = new STEPPlugin_IOperations( theGenImpl ); + return _operation; } diff --git a/src/STEPPlugin/STEPPlugin_OperationsCreator.hxx b/src/STEPPlugin/STEPPlugin_OperationsCreator.hxx index efb210206..2caf56dfc 100755 --- a/src/STEPPlugin/STEPPlugin_OperationsCreator.hxx +++ b/src/STEPPlugin/STEPPlugin_OperationsCreator.hxx @@ -41,16 +41,13 @@ public: ~STEPPlugin_OperationsCreator(); GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, - int theStudyId, - GEOM::GEOM_Gen_ptr theEngine, - ::GEOMImpl_Gen* theGenImpl ); - + GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_Gen* theGenImpl ); private: - static STEPPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ); + static STEPPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); private: - static std::map _mapOfOperations; + static STEPPlugin_IOperations* _operation; friend class STEPPlugin_IECallBack; }; diff --git a/src/STLPlugin/STLPlugin_GUI.cxx b/src/STLPlugin/STLPlugin_GUI.cxx index 7d0ced2eb..d50045321 100644 --- a/src/STLPlugin/STLPlugin_GUI.cxx +++ b/src/STLPlugin/STLPlugin_GUI.cxx @@ -107,11 +107,8 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent ) { SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return false; - SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); - if ( !study ) return false; - SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); - GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STLPluginEngine" ); STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op ); if ( stlOp.isNull() ) return false; @@ -138,14 +135,13 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent ) { GEOM::GEOM_Object_var main = result[0]; QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) ); - SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy, - SALOMEDS::SObject::_nil(), + SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), main.in(), publishName.toUtf8().constData() ); entryList.append( so->GetID() ); transaction.commit(); - GEOM_Displayer( study ).Display( main.in() ); + GEOM_Displayer().Display( main.in() ); main->UnRegister(); } else @@ -159,7 +155,7 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent ) transaction.abort(); } } - getGeometryGUI()->updateObjBrowser( true ); + getGeometryGUI()->updateObjBrowser(); app->browseObjects( entryList ); if ( errors.count() > 0 ) @@ -180,11 +176,8 @@ bool STLPlugin_GUI::exportSTL( SUIT_Desktop* parent ) { SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return false; - SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); - if ( !study ) return false; - SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); - GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STLPluginEngine" ); STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op ); if ( stlOp.isNull() ) return false; diff --git a/src/STLPlugin/STLPlugin_IECallBack.cxx b/src/STLPlugin/STLPlugin_IECallBack.cxx index be4d0ce6d..e4f35377f 100755 --- a/src/STLPlugin/STLPlugin_IECallBack.cxx +++ b/src/STLPlugin/STLPlugin_IECallBack.cxx @@ -46,12 +46,11 @@ STLPlugin_IECallBack::~STLPlugin_IECallBack() */ //============================================================================= bool -STLPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +STLPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine(), theDocId ); + STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine() ); bool anIsASCII = ( theFormatName == "STL_Bin") ? false : true; const double aDeflection = 0.001; const bool anIsRelative = true; @@ -65,11 +64,10 @@ STLPlugin_IECallBack::Export( int theDocId, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -STLPlugin_IECallBack::Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +STLPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine(), theDocId ); + STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine() ); return aPluginOperations->ImportSTL( theFileName ); } diff --git a/src/STLPlugin/STLPlugin_IECallBack.hxx b/src/STLPlugin/STLPlugin_IECallBack.hxx index fb8979403..a2bf421c9 100644 --- a/src/STLPlugin/STLPlugin_IECallBack.hxx +++ b/src/STLPlugin/STLPlugin_IECallBack.hxx @@ -36,15 +36,13 @@ public: STLPlugin_IECallBack(); ~STLPlugin_IECallBack(); - virtual bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ); + virtual bool Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ); virtual - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); }; #endif diff --git a/src/STLPlugin/STLPlugin_IOperations.cxx b/src/STLPlugin/STLPlugin_IOperations.cxx index 0008bf779..f3d2928b5 100644 --- a/src/STLPlugin/STLPlugin_IOperations.cxx +++ b/src/STLPlugin/STLPlugin_IOperations.cxx @@ -38,8 +38,8 @@ * Constructor */ //============================================================================= -STLPlugin_IOperations::STLPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +STLPlugin_IOperations::STLPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "STLPlugin_IOperations::STLPlugin_IOperations" ); } @@ -80,7 +80,7 @@ void STLPlugin_IOperations::ExportSTL( const Handle(GEOM_Object) theOrigina if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT); //Add an Export function Handle(GEOM_Function) aFunction = result->AddFunction( STLPlugin_ExportDriver::GetID(), EXPORT_SHAPE ); @@ -134,7 +134,7 @@ STLPlugin_IOperations::ImportSTL( const TCollection_AsciiString& theFileName ) if( theFileName.IsEmpty() ) return NULL; //Add a new result object - Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT ); + Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT ); //Add an Import function Handle(GEOM_Function) aFunction = diff --git a/src/STLPlugin/STLPlugin_IOperations.hxx b/src/STLPlugin/STLPlugin_IOperations.hxx index 776cc4aba..2ecca4b5d 100644 --- a/src/STLPlugin/STLPlugin_IOperations.hxx +++ b/src/STLPlugin/STLPlugin_IOperations.hxx @@ -30,7 +30,7 @@ class STLPLUGINENGINE_EXPORT STLPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - STLPlugin_IOperations( GEOM_Engine*, int ); + STLPlugin_IOperations( GEOM_Engine* ); ~STLPlugin_IOperations(); void ExportSTL( const Handle(GEOM_Object), diff --git a/src/STLPlugin/STLPlugin_OperationsCreator.cxx b/src/STLPlugin/STLPlugin_OperationsCreator.cxx index fcfa4abf5..401dbff86 100644 --- a/src/STLPlugin/STLPlugin_OperationsCreator.cxx +++ b/src/STLPlugin/STLPlugin_OperationsCreator.cxx @@ -32,7 +32,7 @@ // OCCT includes #include -std::map STLPlugin_OperationsCreator::_mapOfOperations; +STLPlugin_IOperations* STLPlugin_OperationsCreator::_operation; STLPlugin_OperationsCreator::STLPlugin_OperationsCreator() { @@ -53,19 +53,17 @@ STLPlugin_OperationsCreator::~STLPlugin_OperationsCreator() } GEOM_IOperations_i* STLPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ) { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "STLPlugin_OperationsCreator::Create" ); - return new STLPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) ); + return new STLPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -STLPlugin_IOperations* STLPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ) +STLPlugin_IOperations* STLPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { - if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) - _mapOfOperations[theStudyId] = new STLPlugin_IOperations( theGenImpl, theStudyId ); - return _mapOfOperations[theStudyId]; + if( !_operation ) + _operation = new STLPlugin_IOperations( theGenImpl ); + return _operation; } diff --git a/src/STLPlugin/STLPlugin_OperationsCreator.hxx b/src/STLPlugin/STLPlugin_OperationsCreator.hxx index 6feff34ea..1c2177c2e 100755 --- a/src/STLPlugin/STLPlugin_OperationsCreator.hxx +++ b/src/STLPlugin/STLPlugin_OperationsCreator.hxx @@ -41,15 +41,14 @@ public: ~STLPlugin_OperationsCreator(); GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, - int theStudyId, - GEOM::GEOM_Gen_ptr theEngine, - ::GEOMImpl_Gen* theGenImpl ); + GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_Gen* theGenImpl ); + private: - static STLPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ); + static STLPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); private: - static std::map _mapOfOperations; + static STLPlugin_IOperations* _operation; friend class STLPlugin_IECallBack; }; diff --git a/src/Tools/geom_plugins.py b/src/Tools/geom_plugins.py index 07baf9ce1..f1aa482e2 100644 --- a/src/Tools/geom_plugins.py +++ b/src/Tools/geom_plugins.py @@ -21,13 +21,11 @@ import salome_pluginsmanager -def t_shape_fluid(context): - activeStudy = context.study +def t_shape_fluid(): #from salome.geom.t_shape import t_shape_builder from salome.geom.t_shape import t_shape_dialog dialog = t_shape_dialog.getDialog() - dialog.setContext(context) dialog.show() salome_pluginsmanager.AddFunction('T shape fluid', diff --git a/src/Tools/t_shape/t_shape_builder.py b/src/Tools/t_shape/t_shape_builder.py index 1f3af53aa..a62795814 100644 --- a/src/Tools/t_shape/t_shape_builder.py +++ b/src/Tools/t_shape/t_shape_builder.py @@ -29,13 +29,11 @@ import time geompy = None -def demidisk(study, r1, a1, roty=0, solid_thickness=0): +def demidisk(r1, a1, roty=0, solid_thickness=0): if solid_thickness < 1e-7: with_solid = False else: with_solid = True - - #geompy = geomBuilder.New(study) O = geompy.MakeVertex(0, 0, 0) OX = geompy.MakeVectorDXDYDZ(1, 0, 0) @@ -101,8 +99,7 @@ def demidisk(study, r1, a1, roty=0, solid_thickness=0): else: return v, l, arc1, part1 -def pointsProjetes(study, vref, face): - #geompy = geomBuilder.New(study) +def pointsProjetes(vref, face): vface = geompy.ExtractShapes(face, geompy.ShapeType["VERTEX"], True) vord = range(len(vref)) plan = geompy.MakePlaneThreePnt(vref[0], vref[1], vref[-1], 10000) @@ -114,8 +111,7 @@ def pointsProjetes(study, vref, face): vord[dist[0][1]] = vface[i] return vord -def arcsProjetes(study, vf, face): - #geompy = geomBuilder.New(study) +def arcsProjetes(vf, face): lface = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True) lord = range(3) ends = [vf[1], vf[6], vf[7], vf[3]] @@ -130,7 +126,7 @@ def arcsProjetes(study, vf, face): pass return lord -def build_shape(study, r1, r2, h1, h2, solid_thickness=0, progressBar=None ): +def build_shape(r1, r2, h1, h2, solid_thickness=0, progressBar=None ): """ Builds the final shape """ if progressBar is not None: @@ -143,7 +139,7 @@ def build_shape(study, r1, r2, h1, h2, solid_thickness=0, progressBar=None ): with_solid = True global geompy - geompy = geomBuilder.New(study) + geompy = geomBuilder.New() O = geompy.MakeVertex(0, 0, 0) OX = geompy.MakeVectorDXDYDZ(1, 0, 0) @@ -157,7 +153,7 @@ def build_shape(study, r1, r2, h1, h2, solid_thickness=0, progressBar=None ): a1 = 45.0*(1.0 -ratio)/seuilmax # --- Creation of the jonction faces - [faci, sect45, arc1, l1, lord90, lord45, edges, arcextru] = jonction(study, r1, r2,\ + [faci, sect45, arc1, l1, lord90, lord45, edges, arcextru] = jonction(r1, r2,\ h1, h2, a1) if progressBar is not None: progressBar.addSteps(2) @@ -167,7 +163,7 @@ def build_shape(study, r1, r2, h1, h2, solid_thickness=0, progressBar=None ): # The same code is executed again with different external radiuses in order # to get the needed faces and edges to build the solid layer of the pipe [faci_ext, sect45_ext, arc1_ext, l1_ext, \ - lord90_ext, lord45_ext, edges_ext, arcextru_ext] = jonction(study, r1 + solid_thickness, r2 + solid_thickness,\ + lord90_ext, lord45_ext, edges_ext, arcextru_ext] = jonction(r1 + solid_thickness, r2 + solid_thickness,\ h1, h2, a1) faces_jonction_ext = [] for i,l in enumerate(lord90): @@ -246,7 +242,7 @@ def build_shape(study, r1, r2, h1, h2, solid_thickness=0, progressBar=None ): # --- Partie inférieure - v3, l3, arc3, part3 = demidisk(study, r1, a1, 180.0, solid_thickness) + v3, l3, arc3, part3 = demidisk(r1, a1, 180.0, solid_thickness) extru3 = geompy.MakePrismVecH(part3, OX, h1) # --- Symétrie @@ -264,11 +260,10 @@ def build_shape(study, r1, r2, h1, h2, solid_thickness=0, progressBar=None ): return final -def jonction(study, r1, r2, h1, h2, a1): +def jonction(r1, r2, h1, h2, a1): """ Builds the jonction faces and returns what is needed to build the whole pipe """ - #geompy = geomBuilder.New(study) O = geompy.MakeVertex(0, 0, 0) OX = geompy.MakeVectorDXDYDZ(1, 0, 0) @@ -276,8 +271,8 @@ def jonction(study, r1, r2, h1, h2, a1): OZ = geompy.MakeVectorDXDYDZ(0, 0, 1) # --- sections droites des deux demi cylindres avec le partionnement - v1, l1, arc1, part1 = demidisk(study, r1, a1, 0.) - v2, l2, arc2, part2 = demidisk(study, r2, a1, 90.0) + v1, l1, arc1, part1 = demidisk(r1, a1, 0.) + v2, l2, arc2, part2 = demidisk(r2, a1, 90.0) # --- extrusion des sections --> demi cylindres de travail, pour en extraire les sections utilisées au niveau du Té # et enveloppe cylindrique du cylindre principal @@ -299,13 +294,13 @@ def jonction(study, r1, r2, h1, h2, a1): # --- liste ordonnée des points projetés sur les deux sections - vord45 = pointsProjetes(study, v1, sect45) - vord90 = pointsProjetes(study, v2, sect90) + vord45 = pointsProjetes(v1, sect45) + vord90 = pointsProjetes(v2, sect90) # --- identification des projections des trois arcs de cercle, sur les deux sections. - lord45 = arcsProjetes(study, vord45, sect45) - lord90 = arcsProjetes(study, vord90, sect90) + lord45 = arcsProjetes(vord45, sect45) + lord90 = arcsProjetes(vord90, sect90) # --- abaissement des quatre points centraux de la section du cylindre secondaire @@ -390,8 +385,7 @@ def jonction(study, r1, r2, h1, h2, a1): def test_t_shape_builder(): """For testing purpose""" salome.salome_init() - theStudy = salome.myStudy - geompy = geomBuilder.New(theStudy) + geompy = geomBuilder.New() for r1 in [1., 100.]: for r2 in [0.9*r1, 0.5*r1, 0.1*r1, 0.05*r1]: for thickness in [r1/100., r1/10., r1/2.]: @@ -399,7 +393,7 @@ def test_t_shape_builder(): h1 = r1 * 2.0 h2 = h1 try: - res = build_shape(theStudy, r1, r2, h1, h2, thickness) + res = build_shape(r1, r2, h1, h2, thickness) geompy.addToStudy(res, "res_%f_%f_%f"%(r1,r2, thickness)) except: print "problem with res_%f_%f_%f"%(r1,r2, thickness) diff --git a/src/Tools/t_shape/t_shape_dialog.py b/src/Tools/t_shape/t_shape_dialog.py index 1f458e194..34b081976 100644 --- a/src/Tools/t_shape/t_shape_dialog.py +++ b/src/Tools/t_shape/t_shape_dialog.py @@ -39,9 +39,6 @@ class TShapeDialog(Ui_Dialog,QWidget): self.dsb_smallRadius.setValue(40.0) self.dsb_bigHeight.setValue(80.0) self.dsb_smallHeight.setValue(80.0) - - def setContext(self, context): - self._activeStudy = context.study def accept(self): from salome.geom.t_shape import t_shape_progress @@ -50,10 +47,10 @@ class TShapeDialog(Ui_Dialog,QWidget): self.close() r1, r2, h1, h2, thickness = self.getData() #QMessageBox.about(None, "Building in progress", "building shape, please be patient") - #shape = t_shape_builder.build_shape(activeStudy, r1, r2, h1, h2, thickness) + #shape = t_shape_builder.build_shape(r1, r2, h1, h2, thickness) shapeBuilder = t_shape_progress.t_shape_progress() - shape = shapeBuilder.run(self._activeStudy, r1, r2, h1, h2, thickness) - entry = xalome.addToStudy(self._activeStudy, shape, "T_shape_fluid" ) + shape = shapeBuilder.run(r1, r2, h1, h2, thickness) + entry = xalome.addToStudy(shape, "T_shape_fluid" ) xalome.displayShape(entry) def getData(self): diff --git a/src/Tools/t_shape/t_shape_progress.py b/src/Tools/t_shape/t_shape_progress.py index da396900d..c843003ef 100644 --- a/src/Tools/t_shape/t_shape_progress.py +++ b/src/Tools/t_shape/t_shape_progress.py @@ -30,8 +30,8 @@ class t_shape_progress(QProgressDialog): QProgressDialog.__init__(self, "t_shape fluid build", "stop", 0, self._nmaxSteps, parent, Qt.Tool) self.show() - def run(self, activeStudy, r1, r2, h1, h2, thickness): - shape = t_shape_builder.build_shape(activeStudy, r1, r2, h1, h2, thickness, self) + def run(self, r1, r2, h1, h2, thickness): + shape = t_shape_builder.build_shape(r1, r2, h1, h2, thickness, self) self.setValue(self._nmaxSteps) return shape diff --git a/src/TransformationGUI/TransformationGUI.cxx b/src/TransformationGUI/TransformationGUI.cxx index 1cb0bc892..f1605786e 100644 --- a/src/TransformationGUI/TransformationGUI.cxx +++ b/src/TransformationGUI/TransformationGUI.cxx @@ -114,13 +114,11 @@ bool TransformationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) break; case GEOMOp::OpReimport: // RELOAD IMPORTED SHAPE { - SalomeApp_Study* anAppStudy = dynamic_cast(app->activeStudy()); - GEOM::GEOM_ITransformOperations_var anOp = - GeometryGUI::GetGeomGen()->GetITransformOperations(anAppStudy->id()); + GeometryGUI::GetGeomGen()->GetITransformOperations(); if (anOp->_is_nil()) return false; - GEOM_Displayer aDisp (anAppStudy); + GEOM_Displayer aDisp; SUIT_Desktop* desk = app->desktop(); QList wnds = desk->windows(); diff --git a/src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx b/src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx index 8af7fda97..6a45393af 100644 --- a/src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx @@ -358,7 +358,7 @@ void TransformationGUI_ExtensionDlg::ValueChangedInSpinBox(double newValue) //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_ExtensionDlg::createOperation() { - return getGeomEngine()->GetIShapesOperations(getStudyId()); + return getGeomEngine()->GetIShapesOperations(); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx index 53027e0b5..8cd153433 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx @@ -322,7 +322,7 @@ void TransformationGUI_MirrorDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_MirrorDlg::createOperation() { - return getGeomEngine()->GetITransformOperations(getStudyId()); + return getGeomEngine()->GetITransformOperations(); } //================================================================================= @@ -414,12 +414,11 @@ bool TransformationGUI_MirrorDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_MirrorDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_MirrorDlg::restoreSubShapes (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(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.h b/src/TransformationGUI/TransformationGUI_MirrorDlg.h index eb9cb4405..8147b3e85 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.h +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.h @@ -51,7 +51,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index 052397740..ecf1f3cd1 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -268,7 +268,7 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument() myBase = aSelectedObject; // recompute myAng and myStep (Mantis issue 0021718) - GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations(getStudyId()); + GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations(); double Xmin, Xmax, Ymin, Ymax, Zmin, Zmax; anOper->GetBoundingBox(myBase.get(), true, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax); if (anOper->IsDone()) { @@ -449,7 +449,7 @@ void TransformationGUI_MultiRotationDlg::CheckAngleStep (bool isOn) //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_MultiRotationDlg::createOperation() { - return getGeomEngine()->GetITransformOperations(getStudyId()); + return getGeomEngine()->GetITransformOperations(); } //================================================================================= @@ -565,8 +565,7 @@ QList TransformationGUI_MultiRotationDlg::getSourceObjects() // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // we pass here the first operation argument (object) through the list of arguments @@ -575,7 +574,7 @@ void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; anArgs->length(1); anArgs[0] = myBase.copy(); - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs, /*theFindMethod=*/GEOM::FSM_MultiTransformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h index 9e9a9ea68..bb0b0e156 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h @@ -97,7 +97,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index c909cb3e4..c867be1d7 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -348,7 +348,7 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument() myBase = aSelectedObject; // recompute myStepU (Mantis issue 0021718) - GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations(getStudyId()); + GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations(); double Xmin, Xmax, Ymin, Ymax, Zmin, Zmax; anOper->GetBoundingBox(myBase.get(), true, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax); if (anOper->IsDone()) { @@ -615,7 +615,7 @@ void TransformationGUI_MultiTranslationDlg::ReverseStepV() //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_MultiTranslationDlg::createOperation() { - return getGeomEngine()->GetITransformOperations(getStudyId()); + return getGeomEngine()->GetITransformOperations(); } //================================================================================= @@ -728,8 +728,7 @@ QList TransformationGUI_MultiTranslationDlg::getSourceObjects( // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // we pass here the first operation argument (object) through the list of arguments @@ -738,7 +737,7 @@ void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::Study_pt GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; anArgs->length(1); anArgs[0] = myBase.copy(); - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs, /*theFindMethod=*/GEOM::FSM_MultiTransformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h index 43f618c93..94c95f7b2 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h @@ -52,7 +52,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx index f4157b6bd..083428f9b 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx @@ -240,7 +240,7 @@ void TransformationGUI_OffsetDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_OffsetDlg::createOperation() { - return getGeomEngine()->GetITransformOperations( getStudyId() ); + return getGeomEngine()->GetITransformOperations(); } //================================================================================= @@ -299,12 +299,11 @@ bool TransformationGUI_OffsetDlg::execute( ObjectList& objects ) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_OffsetDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject ) +void TransformationGUI_OffsetDlg::restoreSubShapes( 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(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked() ); diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.h b/src/TransformationGUI/TransformationGUI_OffsetDlg.h index c2ec78c41..413ac4211 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.h +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.h @@ -50,7 +50,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx index 44c163c62..878c33dfc 100644 --- a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx @@ -493,7 +493,7 @@ void TransformationGUI_PositionDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_PositionDlg::createOperation() { - return getGeomEngine()->GetITransformOperations(getStudyId()); + return getGeomEngine()->GetITransformOperations(); } //================================================================================= @@ -578,12 +578,11 @@ bool TransformationGUI_PositionDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_PositionDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_PositionDlg::restoreSubShapes (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(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_PositionDlg.h b/src/TransformationGUI/TransformationGUI_PositionDlg.h index 9457ab4a1..11257fdde 100644 --- a/src/TransformationGUI/TransformationGUI_PositionDlg.h +++ b/src/TransformationGUI/TransformationGUI_PositionDlg.h @@ -50,7 +50,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual void addSubshapesToStudy(); virtual QList getSourceObjects(); diff --git a/src/TransformationGUI/TransformationGUI_ProjectionDlg.cxx b/src/TransformationGUI/TransformationGUI_ProjectionDlg.cxx index b82389f0c..e3ad415ec 100644 --- a/src/TransformationGUI/TransformationGUI_ProjectionDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ProjectionDlg.cxx @@ -303,7 +303,7 @@ void TransformationGUI_ProjectionDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_ProjectionDlg::createOperation() { - return getGeomEngine()->GetITransformOperations(getStudyId()); + return getGeomEngine()->GetITransformOperations(); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx b/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx index 3bed7d523..b6767b350 100644 --- a/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx @@ -316,7 +316,7 @@ void TransformationGUI_ProjectionOnCylDlg::enterEvent (QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_ProjectionOnCylDlg::createOperation() { - return getGeomEngine()->GetITransformOperations(getStudyId()); + return getGeomEngine()->GetITransformOperations(); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index 2b75947d4..d7cf7b6b2 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -450,7 +450,7 @@ void TransformationGUI_RotationDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_RotationDlg::createOperation() { - return getGeomEngine()->GetITransformOperations(getStudyId()); + return getGeomEngine()->GetITransformOperations(); } //================================================================================= @@ -549,8 +549,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // we pass here the first operation argument (object) through the list of arguments @@ -559,7 +558,7 @@ void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theS GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; anArgs->length(1); anArgs[0] = myCurrObject.copy(); - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs, /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.h b/src/TransformationGUI/TransformationGUI_RotationDlg.h index d5b1c4d17..c30cb9347 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.h @@ -51,7 +51,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index bf1576bdb..5a8930bd7 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -392,7 +392,7 @@ void TransformationGUI_ScaleDlg::SetDoubleSpinBoxStep(double step) //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_ScaleDlg::createOperation() { - return getGeomEngine()->GetITransformOperations(getStudyId()); + return getGeomEngine()->GetITransformOperations(); } //================================================================================= @@ -500,12 +500,11 @@ bool TransformationGUI_ScaleDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_ScaleDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_ScaleDlg::restoreSubShapes (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(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.h b/src/TransformationGUI/TransformationGUI_ScaleDlg.h index 219950dd0..f1ca3567f 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.h +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.h @@ -56,7 +56,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index c1443ac73..6057a591f 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -450,7 +450,7 @@ void TransformationGUI_TranslationDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_TranslationDlg::createOperation() { - return getGeomEngine()->GetITransformOperations(getStudyId()); + return getGeomEngine()->GetITransformOperations(); } //================================================================================= @@ -604,8 +604,7 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // we pass here the first operation argument (object) through the list of arguments @@ -614,7 +613,7 @@ void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr t GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; anArgs->length(1); anArgs[0] = myCurrObject.copy(); - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs, /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.h b/src/TransformationGUI/TransformationGUI_TranslationDlg.h index 8aab1b6fd..fd2eb99a2 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.h @@ -51,7 +51,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/VTKPlugin/VTKPlugin_GUI.cxx b/src/VTKPlugin/VTKPlugin_GUI.cxx index e8124fa20..48ccea52d 100644 --- a/src/VTKPlugin/VTKPlugin_GUI.cxx +++ b/src/VTKPlugin/VTKPlugin_GUI.cxx @@ -34,7 +34,6 @@ #include "GeometryGUI.h" #include "GEOM_Operation.h" #include "GEOMBase.h" -#include "GEOM_Displayer.h" #include "GEOM_GenericObjPtr.h" #include @@ -100,11 +99,8 @@ bool VTKPlugin_GUI::exportVTK( SUIT_Desktop* parent ) { SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return false; - SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); - if ( !study ) return false; - SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); - GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "VTKPluginEngine" ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "VTKPluginEngine" ); VTKOpPtr vtkOp = GEOM::IVTKOperations::_narrow( op ); if ( vtkOp.isNull() ) return false; diff --git a/src/VTKPlugin/VTKPlugin_IECallBack.cxx b/src/VTKPlugin/VTKPlugin_IECallBack.cxx index 12e6c7f76..389e6adb7 100755 --- a/src/VTKPlugin/VTKPlugin_IECallBack.cxx +++ b/src/VTKPlugin/VTKPlugin_IECallBack.cxx @@ -45,12 +45,11 @@ VTKPlugin_IECallBack::~VTKPlugin_IECallBack() * Export */ //============================================================================= -bool VTKPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +bool VTKPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - VTKPlugin_IOperations* aPluginOperations = VTKPlugin_OperationsCreator::get( GetEngine(), theDocId ); + VTKPlugin_IOperations* aPluginOperations = VTKPlugin_OperationsCreator::get( GetEngine() ); const double aDeflection = 0.001; aPluginOperations->ExportVTK( theOriginal, theFileName, aDeflection ); return true; diff --git a/src/VTKPlugin/VTKPlugin_IECallBack.hxx b/src/VTKPlugin/VTKPlugin_IECallBack.hxx index 71ba137e5..3140898e0 100644 --- a/src/VTKPlugin/VTKPlugin_IECallBack.hxx +++ b/src/VTKPlugin/VTKPlugin_IECallBack.hxx @@ -36,10 +36,9 @@ public: VTKPlugin_IECallBack(); ~VTKPlugin_IECallBack(); - bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ); + bool Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ); }; #endif diff --git a/src/VTKPlugin/VTKPlugin_IOperations.cxx b/src/VTKPlugin/VTKPlugin_IOperations.cxx index ab8f79fb2..78b565477 100644 --- a/src/VTKPlugin/VTKPlugin_IOperations.cxx +++ b/src/VTKPlugin/VTKPlugin_IOperations.cxx @@ -36,8 +36,8 @@ * Constructor */ //============================================================================= -VTKPlugin_IOperations::VTKPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +VTKPlugin_IOperations::VTKPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "VTKPlugin_IOperations::VTKPlugin_IOperations" ); } @@ -72,7 +72,7 @@ void VTKPlugin_IOperations::ExportVTK( const Handle(GEOM_Object) theOrigina if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT); //Add an Export function Handle(GEOM_Function) aFunction = result->AddFunction( VTKPlugin_ExportDriver::GetID(), EXPORT_SHAPE ); diff --git a/src/VTKPlugin/VTKPlugin_IOperations.hxx b/src/VTKPlugin/VTKPlugin_IOperations.hxx index a75d60833..d97fd1315 100644 --- a/src/VTKPlugin/VTKPlugin_IOperations.hxx +++ b/src/VTKPlugin/VTKPlugin_IOperations.hxx @@ -30,7 +30,7 @@ class VTKPLUGINENGINE_EXPORT VTKPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - VTKPlugin_IOperations( GEOM_Engine*, int ); + VTKPlugin_IOperations( GEOM_Engine* ); ~VTKPlugin_IOperations(); void ExportVTK( const Handle(GEOM_Object), diff --git a/src/VTKPlugin/VTKPlugin_OperationsCreator.cxx b/src/VTKPlugin/VTKPlugin_OperationsCreator.cxx index b5e2407e9..6ddef22df 100644 --- a/src/VTKPlugin/VTKPlugin_OperationsCreator.cxx +++ b/src/VTKPlugin/VTKPlugin_OperationsCreator.cxx @@ -31,7 +31,7 @@ // OCCT includes #include -std::map VTKPlugin_OperationsCreator::_mapOfOperations; +VTKPlugin_IOperations* VTKPlugin_OperationsCreator::_operation; VTKPlugin_OperationsCreator::VTKPlugin_OperationsCreator() { @@ -49,19 +49,17 @@ VTKPlugin_OperationsCreator::~VTKPlugin_OperationsCreator() } GEOM_IOperations_i* VTKPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ) { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "VTKPlugin_OperationsCreator::Create" ); - return new VTKPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) ); + return new VTKPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -VTKPlugin_IOperations* VTKPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ) +VTKPlugin_IOperations* VTKPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { - if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) - _mapOfOperations[theStudyId] = new VTKPlugin_IOperations( theGenImpl, theStudyId ); - return _mapOfOperations[theStudyId]; + if( !_operation ) + _operation = new VTKPlugin_IOperations( theGenImpl ); + return _operation; } diff --git a/src/VTKPlugin/VTKPlugin_OperationsCreator.hxx b/src/VTKPlugin/VTKPlugin_OperationsCreator.hxx index 760c8fe3e..dfefb2954 100755 --- a/src/VTKPlugin/VTKPlugin_OperationsCreator.hxx +++ b/src/VTKPlugin/VTKPlugin_OperationsCreator.hxx @@ -41,15 +41,13 @@ public: ~VTKPlugin_OperationsCreator(); GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, - int theStudyId, - GEOM::GEOM_Gen_ptr theEngine, - ::GEOMImpl_Gen* theGenImpl ); + GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_Gen* theGenImpl ); private: - static VTKPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ); + static VTKPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); private: - static std::map _mapOfOperations; + static VTKPlugin_IOperations* _operation; friend class VTKPlugin_IECallBack; }; diff --git a/src/XAOPlugin/XAOPlugin_ExportDlg.cxx b/src/XAOPlugin/XAOPlugin_ExportDlg.cxx index c1a5e91da..7b64221db 100644 --- a/src/XAOPlugin/XAOPlugin_ExportDlg.cxx +++ b/src/XAOPlugin/XAOPlugin_ExportDlg.cxx @@ -226,7 +226,7 @@ void XAOPlugin_ExportDlg::processObject() else { ledShape->setText(GEOMBase::GetName(m_mainObj)); - GEOM::GEOM_IShapesOperations_var shapeOp = getGeomEngine()->GetIShapesOperations(getStudyId()); + GEOM::GEOM_IShapesOperations_var shapeOp = getGeomEngine()->GetIShapesOperations(); // add groups names GEOM::ListOfGO_var groups = shapeOp->GetExistingSubObjects(m_mainObj, true); @@ -243,7 +243,7 @@ void XAOPlugin_ExportDlg::processObject() lstGroups->sortItems(Qt::AscendingOrder); // add fields - GEOM::GEOM_IFieldOperations_var fieldOp = getGeomEngine()->GetIFieldOperations(getStudyId()); + GEOM::GEOM_IFieldOperations_var fieldOp = getGeomEngine()->GetIFieldOperations(); GEOM::ListOfFields_var fields = fieldOp->GetFields(m_mainObj); for (int i = 0, n = fields->length(); i < n; i++) @@ -389,7 +389,7 @@ void XAOPlugin_ExportDlg::enterEvent(QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr XAOPlugin_ExportDlg::createOperation() { - return getGeomEngine()->GetPluginOperations( getStudyId(), "XAOPluginEngine" ); + return getGeomEngine()->GetPluginOperations( "XAOPluginEngine" ); } //================================================================================= diff --git a/src/XAOPlugin/XAOPlugin_IECallBack.cxx b/src/XAOPlugin/XAOPlugin_IECallBack.cxx index 4e4e6ed11..65565f1eb 100644 --- a/src/XAOPlugin/XAOPlugin_IECallBack.cxx +++ b/src/XAOPlugin/XAOPlugin_IECallBack.cxx @@ -47,14 +47,13 @@ XAOPlugin_IECallBack::~XAOPlugin_IECallBack() */ //============================================================================= bool -XAOPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, +XAOPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName, const TCollection_AsciiString& theShapeFileName ) { - XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine(), theDocId ); - GEOMImpl_IShapesOperations* aShapesOperations = GetEngine()->GetIShapesOperations( theDocId ); + XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine() ); + GEOMImpl_IShapesOperations* aShapesOperations = GetEngine()->GetIShapesOperations(); Handle(TColStd_HSequenceOfTransient) groups = aShapesOperations->GetExistingSubObjects( theOriginal, GEOMImpl_IShapesOperations::Groups ); Handle(TColStd_HSequenceOfTransient) fields = aShapesOperations->GetExistingSubObjects( theOriginal, GEOMImpl_IShapesOperations::Fields ); @@ -74,11 +73,10 @@ XAOPlugin_IECallBack::Export( int theDocId, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -XAOPlugin_IECallBack::Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +XAOPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine(), theDocId ); + XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine() ); Handle(TColStd_HSequenceOfTransient) result = new TColStd_HSequenceOfTransient(); Handle(TColStd_HSequenceOfTransient) subshapes = new TColStd_HSequenceOfTransient(); diff --git a/src/XAOPlugin/XAOPlugin_IECallBack.hxx b/src/XAOPlugin/XAOPlugin_IECallBack.hxx index 8bd1b688b..6e7a6a2c4 100644 --- a/src/XAOPlugin/XAOPlugin_IECallBack.hxx +++ b/src/XAOPlugin/XAOPlugin_IECallBack.hxx @@ -36,16 +36,14 @@ public: XAOPlugin_IECallBack(); ~XAOPlugin_IECallBack(); - virtual bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, + virtual bool Export( const Handle(GEOM_Object) theOriginal, const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName, const TCollection_AsciiString& theshapeFileName ); virtual - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); }; #endif diff --git a/src/XAOPlugin/XAOPlugin_IOperations.cxx b/src/XAOPlugin/XAOPlugin_IOperations.cxx index 33e74ae6d..f77a29aae 100644 --- a/src/XAOPlugin/XAOPlugin_IOperations.cxx +++ b/src/XAOPlugin/XAOPlugin_IOperations.cxx @@ -99,8 +99,8 @@ TopAbs_ShapeEnum getGroupDimension(XAO::Group* group) * Constructor */ //============================================================================= -XAOPlugin_IOperations::XAOPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +XAOPlugin_IOperations::XAOPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "XAOPlugin_IOperations::XAOPlugin_IOperations" ); } @@ -323,7 +323,7 @@ bool XAOPlugin_IOperations::ExportXAO( Handle(GEOM_Object) shape, if (lastFunction.IsNull()) return false; // add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject(GEOM_IMPORT); // add an Export function Handle(GEOM_Function) exportFunction = result->AddFunction(XAOPlugin_Driver::GetID(), EXPORT_SHAPE); @@ -409,7 +409,7 @@ void XAOPlugin_IOperations::importSubShapes( XAO::Geometry* xaoGeometry, anArray = new TColStd_HArray1OfInteger(1, 1); anArray->SetValue(1, iref); - subShape = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE); + subShape = GetEngine()->AddObject(GEOM_SUBSHAPE); Handle(GEOM_Function) aFunction = subShape->AddFunction(GEOM_Object::GetSubShapeID(), 1); if (aFunction.IsNull()) return; @@ -473,7 +473,7 @@ bool XAOPlugin_IOperations::ImportXAO( const char* fileName, } // create the shape - shape = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT); + shape = GetEngine()->AddObject(GEOM_IMPORT); Handle(GEOM_Function) function = shape->AddFunction(XAOPlugin_Driver::GetID(), IMPORT_SHAPE); if (function.IsNull()) return false; if (function->GetDriverGUID() != XAOPlugin_Driver::GetID()) return false; diff --git a/src/XAOPlugin/XAOPlugin_IOperations.hxx b/src/XAOPlugin/XAOPlugin_IOperations.hxx index 7bf885f7c..214b371ab 100644 --- a/src/XAOPlugin/XAOPlugin_IOperations.hxx +++ b/src/XAOPlugin/XAOPlugin_IOperations.hxx @@ -40,7 +40,7 @@ namespace XAO { class XAOPLUGINENGINE_EXPORT XAOPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - XAOPlugin_IOperations( GEOM_Engine*, int ); + XAOPlugin_IOperations( GEOM_Engine* ); ~XAOPlugin_IOperations(); bool ExportXAO( Handle(GEOM_Object) shape, diff --git a/src/XAOPlugin/XAOPlugin_ImportDlg.cxx b/src/XAOPlugin/XAOPlugin_ImportDlg.cxx index 9351d4a66..398c670b6 100644 --- a/src/XAOPlugin/XAOPlugin_ImportDlg.cxx +++ b/src/XAOPlugin/XAOPlugin_ImportDlg.cxx @@ -235,7 +235,7 @@ void XAOPlugin_ImportDlg::enterEvent(QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr XAOPlugin_ImportDlg::createOperation() { - return getGeomEngine()->GetPluginOperations( getStudyId(), "XAOPluginEngine" ); + return getGeomEngine()->GetPluginOperations( "XAOPluginEngine" ); } //================================================================================= @@ -315,10 +315,8 @@ QString XAOPlugin_ImportDlg::addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEO if ( !aStudy || theField->_is_nil() ) return QString(); - SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy(aStudy); - SALOMEDS::SObject_var aSO = - getGeomEngine()->AddInStudy(aStudyDS, theField, theField->GetName(), theFather); + getGeomEngine()->AddInStudy(theField, theField->GetName(), theFather); theField->UnRegister(); QString anEntry; @@ -334,7 +332,7 @@ QString XAOPlugin_ImportDlg::addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEO GEOM::GEOM_FieldStep_ptr step = theField->GetStep(steps[i]); QString stepName = (tr("XAOPLUGIN_STEP") + " %1 %2").arg( step->GetID() ).arg( step->GetStamp() ); SALOMEDS::SObject_wrap aSOField = - getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), theField ); + getGeomEngine()->AddInStudy( step, stepName.toLatin1().constData(), theField ); step->UnRegister(); } @@ -348,7 +346,7 @@ GEOM::GEOM_Object_ptr XAOPlugin_ImportDlg::getFather(GEOM::GEOM_Object_ptr objec GEOM::GEOM_Object_var fatherObj; if (object->GetType() != GEOM_IMPORT && m_mainShape != NULL) { - //GEOM::GEOM_IGroupOperations_var groupOper = getGeomEngine()->GetIGroupOperations(getStudyId()); + //GEOM::GEOM_IGroupOperations_var groupOper = getGeomEngine()->GetIGroupOperations(); //fatherObj = groupOper->GetMainShape(object); fatherObj = m_mainShape; } diff --git a/src/XAOPlugin/XAOPlugin_OperationsCreator.cxx b/src/XAOPlugin/XAOPlugin_OperationsCreator.cxx index 4b6f54cd8..4240ec953 100644 --- a/src/XAOPlugin/XAOPlugin_OperationsCreator.cxx +++ b/src/XAOPlugin/XAOPlugin_OperationsCreator.cxx @@ -31,7 +31,7 @@ // OCCT includes #include -std::map XAOPlugin_OperationsCreator::_mapOfOperations; +XAOPlugin_IOperations* XAOPlugin_OperationsCreator::_operation; XAOPlugin_OperationsCreator::XAOPlugin_OperationsCreator() { @@ -48,19 +48,17 @@ XAOPlugin_OperationsCreator::~XAOPlugin_OperationsCreator() } GEOM_IOperations_i* XAOPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ) { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "XAOPlugin_OperationsCreator::Create" ); - return new XAOPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) ); + return new XAOPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -XAOPlugin_IOperations* XAOPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ) +XAOPlugin_IOperations* XAOPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { - if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) - _mapOfOperations[theStudyId] = new XAOPlugin_IOperations( theGenImpl, theStudyId ); - return _mapOfOperations[theStudyId]; + if( !_operation ) + _operation = new XAOPlugin_IOperations( theGenImpl ); + return _operation; } diff --git a/src/XAOPlugin/XAOPlugin_OperationsCreator.hxx b/src/XAOPlugin/XAOPlugin_OperationsCreator.hxx index 5568de75d..26d645d83 100755 --- a/src/XAOPlugin/XAOPlugin_OperationsCreator.hxx +++ b/src/XAOPlugin/XAOPlugin_OperationsCreator.hxx @@ -41,15 +41,13 @@ public: ~XAOPlugin_OperationsCreator(); GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, - int theStudyId, - GEOM::GEOM_Gen_ptr theEngine, - ::GEOMImpl_Gen* theGenImpl ); + GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_Gen* theGenImpl ); private: - static XAOPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ); - + static XAOPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); + private: - static std::map _mapOfOperations; + static XAOPlugin_IOperations* _operation; friend class XAOPlugin_IECallBack; }; -- 2.39.2