From 98ce5736d11e0e8654c1b8ed867ae4ae24cb9eef Mon Sep 17 00:00:00 2001 From: abd Date: Thu, 19 Oct 2006 06:49:48 +0000 Subject: [PATCH] First stable version after merging with V3_2_2 --- Makefile.in | 2 + adm_local/unix/make_commence.in | 2 + configure.in.base | 10 +- doc/salome/gui/GEOM/blocks_operations.htm | 105 +- doc/salome/gui/GEOM/box.htm | 5 +- doc/salome/gui/GEOM/building_by_blocks.htm | 158 +- doc/salome/gui/GEOM/change_orientation.htm | 155 ++ doc/salome/gui/GEOM/extrusion.htm | 43 +- .../salome2_sp3_booleangui_functions.htm | 4 +- .../salome2_sp3_geomtoolsgui_functions.htm | 2 +- .../salome2_sp3_measuregui_functions.htm | 82 +- doc/salome/gui/GEOM/filling.htm | 12 +- doc/salome/gui/GEOM/geom.log | 13 +- doc/salome/gui/GEOM/geometrical_objects.htm | 83 +- doc/salome/gui/GEOM/image38.gif | Bin 0 -> 3564 bytes doc/salome/gui/GEOM/image40.gif | Bin 0 -> 3868 bytes doc/salome/gui/GEOM/image43.gif | Bin 0 -> 1025 bytes .../gui/GEOM/local_coordinate_system.htm | 13 +- doc/salome/gui/GEOM/measurement_tools.htm | 44 +- .../gui/GEOM/pics/changeorientation.png | Bin 0 -> 15333 bytes doc/salome/gui/GEOM/pics/filling.png | Bin 17610 -> 17649 bytes doc/salome/gui/GEOM/pics/plane3.png | Bin 12545 -> 14227 bytes doc/salome/gui/GEOM/pics/workplane4.png | Bin 11002 -> 11943 bytes doc/salome/gui/GEOM/pipe_creation.htm | 2 +- doc/salome/gui/GEOM/plane.htm | 19 +- doc/salome/gui/GEOM/primitives.htm | 46 +- doc/salome/gui/GEOM/revolution.htm | 12 +- .../gui/GEOM/transformation_operations.htm | 30 +- doc/salome/gui/GEOM/whcsh_home.htm | 2 +- doc/salome/gui/GEOM/whdata/whftdata0.htm | 7 +- doc/salome/gui/GEOM/whdata/whfts.htm | 2 +- doc/salome/gui/GEOM/whdata/whfwdata0.htm | 2428 +++++++++-------- doc/salome/gui/GEOM/whdata/whtdata0.htm | 11 +- doc/salome/gui/GEOM/whfform.htm | 2 +- doc/salome/gui/GEOM/whgdata/whlstt14.htm | 2 +- doc/salome/gui/GEOM/whiform.htm | 2 +- doc/salome/gui/GEOM/whnjs.htm | 2 +- doc/salome/gui/GEOM/whres.xml | 2 +- doc/salome/gui/GEOM/whskin_info.htm | 2 +- doc/salome/gui/GEOM/whskin_pickup.htm | 2 +- doc/salome/gui/GEOM/whstart.js | 2 +- doc/salome/gui/GEOM/whtdhtml.htm | 2 +- doc/salome/gui/GEOM/whtopic.js | 2 +- doc/salome/gui/GEOM/whxdata/whftdata0.xml | 7 +- doc/salome/gui/GEOM/whxdata/whfwdata0.xml | 2428 +++++++++-------- doc/salome/gui/GEOM/whxdata/whtdata0.xml | 6 +- doc/salome/gui/GEOM/working_plane.htm | 17 +- idl/GEOM_Gen.idl | 99 +- resources/SalomeApp.xml | 13 +- resources/change_orientation.png | Bin 0 -> 509 bytes resources/prism2.png | Bin 0 -> 315 bytes src/BasicGUI/BasicGUI.cxx | 70 +- src/BasicGUI/BasicGUI.h | 7 +- src/BasicGUI/BasicGUI_CircleDlg.cxx | 2 +- src/BasicGUI/BasicGUI_CircleDlg.h | 2 +- src/BasicGUI/BasicGUI_EllipseDlg.cxx | 4 +- src/BasicGUI/BasicGUI_MarkerDlg.cxx | 245 +- src/BasicGUI/BasicGUI_PlaneDlg.cxx | 91 +- src/BasicGUI/BasicGUI_PointDlg.cxx | 12 +- src/BasicGUI/BasicGUI_VectorDlg.cxx | 6 +- src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx | 174 +- src/BlocksGUI/BlocksGUI.cxx | 16 +- src/BlocksGUI/BlocksGUI.h | 11 +- src/BlocksGUI/BlocksGUI_TrsfDlg.cxx | 3 +- src/BooleanGUI/BooleanGUI.cxx | 22 +- src/BooleanGUI/BooleanGUI.h | 13 +- src/BuildGUI/BuildGUI.cxx | 31 +- src/BuildGUI/BuildGUI.h | 13 +- src/BuildGUI/BuildGUI_FaceDlg.cxx | 21 +- src/DisplayGUI/DisplayGUI.cxx | 121 +- src/DisplayGUI/DisplayGUI.h | 36 +- src/DlgRef/DlgRef_SpinBox.cxx | 2 + src/DlgRef/DlgRef_SpinBox.h | 4 + src/EntityGUI/EntityGUI.cxx | 42 +- src/EntityGUI/EntityGUI.h | 9 +- src/EntityGUI/EntityGUI_SketcherDlg.cxx | 261 +- src/EntityGUI/EntityGUI_SketcherDlg.h | 37 +- src/GEOM/GEOM_Engine.cxx | 4 + src/GEOM/GEOM_Function.cxx | 6 +- src/GEOM/GEOM_PythonDump.cxx | 10 +- src/GEOMBase/GEOMBase_Skeleton.cxx | 17 + src/GEOMBase/GEOMBase_Skeleton.h | 1 + src/GEOMBase/Makefile.in | 1 + src/GEOMContext/GEOM_icons.po | 4 + src/GEOMContext/GEOM_msg_en.po | 4 + src/GEOMContext/GEOM_msg_fr.po | 4 + src/GEOMGUI/GEOMGUI_OCCSelector.cxx | 8 +- src/GEOMGUI/GEOM_Displayer.cxx | 57 + src/GEOMGUI/GEOM_images.po | 10 + src/GEOMGUI/GEOM_msg_en.po | 73 +- src/GEOMGUI/GEOM_msg_fr.po | 15 +- src/GEOMGUI/GeometryGUI.cxx | 325 ++- src/GEOMGUI/GeometryGUI_Swig.cxx | 79 +- src/GEOMGUI/GeometryGUI_Swig.hxx | 9 +- src/GEOMGUI/GeometryGUI_Swig.i | 65 +- src/GEOMImpl/GEOMImpl_BooleanDriver.cxx | 250 +- src/GEOMImpl/GEOMImpl_ExportDriver.cxx | 33 +- src/GEOMImpl/GEOMImpl_HealingDriver.cxx | 25 + src/GEOMImpl/GEOMImpl_HealingDriver.hxx | 2 +- src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx | 61 +- src/GEOMImpl/GEOMImpl_IBasicOperations.cxx | 40 + src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx | 85 +- src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx | 11 + src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx | 28 + src/GEOMImpl/GEOMImpl_IGroupOperations.cxx | 231 +- src/GEOMImpl/GEOMImpl_IHealingOperations.cxx | 162 +- src/GEOMImpl/GEOMImpl_IHealingOperations.hxx | 4 + src/GEOMImpl/GEOMImpl_IInsertOperations.cxx | 14 +- src/GEOMImpl/GEOMImpl_ILocalOperations.cxx | 22 + src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx | 155 +- src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx | 52 +- src/GEOMImpl/GEOMImpl_IShapesOperations.cxx | 163 ++ src/GEOMImpl/GEOMImpl_IShapesOperations.hxx | 13 + .../GEOMImpl_ITransformOperations.cxx | 116 +- src/GEOMImpl/GEOMImpl_ImportDriver.cxx | 33 +- src/GEOMImpl/GEOMImpl_LineDriver.cxx | 12 +- src/GEOMImpl/GEOMImpl_PlaneDriver.cxx | 63 +- src/GEOMImpl/GEOMImpl_PositionDriver.cxx | 127 +- src/GEOMImpl/GEOMImpl_ShapeDriver.cxx | 145 +- src/GEOMImpl/GEOMImpl_SketcherDriver.cxx | 18 +- src/GEOMImpl/GEOMImpl_Types.hxx | 17 +- src/GEOMToolsGUI/GEOMToolsGUI.cxx | 113 +- src/GEOMToolsGUI/GEOMToolsGUI.h | 13 +- src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 14 + src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx | 17 + src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h | 5 +- .../GEOMToolsGUI_TransparencyDlg.cxx | 17 + .../GEOMToolsGUI_TransparencyDlg.h | 3 + src/GEOM_I/GEOM_Gen_i.cc | 62 +- src/GEOM_I/GEOM_IBooleanOperations_i.cc | 7 +- src/GEOM_I/GEOM_IHealingOperations_i.cc | 68 + src/GEOM_I/GEOM_IHealingOperations_i.hh | 3 + src/GEOM_I/GEOM_IMeasureOperations_i.cc | 83 +- src/GEOM_I/GEOM_IMeasureOperations_i.hh | 8 + src/GEOM_I/GEOM_IShapesOperations_i.cc | 86 + src/GEOM_I/GEOM_IShapesOperations_i.hh | 12 + src/GEOM_I/GEOM_ITransformOperations_i.cc | 218 +- src/GEOM_I/Makefile.in | 2 +- src/GEOM_I_Superv/GEOM_Superv_i.cc | 611 ++++- src/GEOM_SWIG/GEOM_TestMeasures.py | 10 + src/GEOM_SWIG/GEOM_TestOthers.py | 15 + src/GEOM_SWIG/batchmode_geompy.py | 18 +- src/GEOM_SWIG/geompy.py | 109 +- src/GenerationGUI/GenerationGUI.cxx | 34 +- src/GenerationGUI/GenerationGUI.h | 35 +- .../GenerationGUI_FillingDlg.cxx | 7 +- src/GenerationGUI/GenerationGUI_PrismDlg.cxx | 238 +- src/GenerationGUI/GenerationGUI_PrismDlg.h | 8 +- src/GenerationGUI/GenerationGUI_RevolDlg.cxx | 3 +- src/GroupGUI/GroupGUI.cxx | 35 +- src/GroupGUI/GroupGUI.h | 15 +- src/GroupGUI/GroupGUI_GroupDlg.cxx | 2 + src/MeasureGUI/MeasureGUI.cxx | 27 +- src/MeasureGUI/MeasureGUI.h | 16 +- src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx | 36 +- src/MeasureGUI/MeasureGUI_CheckShapeDlg.h | 40 +- src/MeasureGUI/MeasureGUI_Skeleton.cxx | 16 + src/MeasureGUI/MeasureGUI_Skeleton.h | 1 + src/NMTAlgo/NMTAlgo_Splitter.cxx | 9 +- src/NMTTools/NMTTools_DEProcessor.cxx | 14 +- src/NMTTools/NMTTools_PaveFiller.cxx | 2 + src/NMTTools/NMTTools_PaveFiller_1.cxx | 6 +- src/NMTTools/NMTTools_PaveFiller_4.cxx | 14 +- src/NMTTools/NMTTools_PaveFiller_5.cxx | 8 +- src/NMTTools/NMTTools_PaveFiller_6.cxx | 49 +- src/NMTTools/NMTTools_PaveFiller_7.cxx | 2 +- src/OBJECT/GEOM_AISTrihedron.cxx | 2 +- src/OBJECT/GEOM_AssemblyBuilder.cxx | 64 +- .../OperationGUI_ArchimedeDlg.cxx | 6 +- src/OperationGUI/OperationGUI_ChamferDlg.cxx | 4 +- src/OperationGUI/OperationGUI_ClippingDlg.cxx | 4 +- src/OperationGUI/OperationGUI_FilletDlg.cxx | 8 +- src/OperationGUI/OperationGUI_MaterialDlg.cxx | 2 +- src/PrimitiveGUI/PrimitiveGUI.cxx | 47 +- src/PrimitiveGUI/PrimitiveGUI.h | 15 +- src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx | 6 +- src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx | 12 +- src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx | 8 +- src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx | 4 +- src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx | 8 +- src/RepairGUI/Makefile.in | 2 + src/RepairGUI/RepairGUI.cxx | 33 +- src/RepairGUI/RepairGUI.h | 16 +- .../RepairGUI_ChangeOrientationDlg.cxx | 301 ++ .../RepairGUI_ChangeOrientationDlg.h | 77 + src/RepairGUI/RepairGUI_FreeBoundDlg.cxx | 17 + src/RepairGUI/RepairGUI_FreeBoundDlg.h | 1 + src/RepairGUI/RepairGUI_FreeFacesDlg.cxx | 16 + src/RepairGUI/RepairGUI_FreeFacesDlg.h | 1 + src/STEPImport/STEPImport.cxx | 4 + src/ShHealOper/Makefile.in | 2 + .../ShHealOper_ChangeOrientation.cxx | 88 + .../ShHealOper_ChangeOrientation.hxx | 66 + src/TransformationGUI/TransformationGUI.cxx | 29 +- src/TransformationGUI/TransformationGUI.h | 15 +- .../TransformationGUI_MultiRotationDlg.cxx | 10 +- .../TransformationGUI_MultiTranslationDlg.cxx | 12 +- .../TransformationGUI_OffsetDlg.cxx | 16 +- .../TransformationGUI_RotationDlg.cxx | 2 +- .../TransformationGUI_ScaleDlg.cxx | 2 +- .../TransformationGUI_TranslationDlg.cxx | 6 +- 201 files changed, 7916 insertions(+), 4812 deletions(-) create mode 100755 doc/salome/gui/GEOM/change_orientation.htm create mode 100755 doc/salome/gui/GEOM/image38.gif create mode 100755 doc/salome/gui/GEOM/image40.gif create mode 100755 doc/salome/gui/GEOM/image43.gif create mode 100755 doc/salome/gui/GEOM/pics/changeorientation.png create mode 100755 resources/change_orientation.png create mode 100644 resources/prism2.png create mode 100644 src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx create mode 100644 src/RepairGUI/RepairGUI_ChangeOrientationDlg.h create mode 100644 src/ShHealOper/ShHealOper_ChangeOrientation.cxx create mode 100644 src/ShHealOper/ShHealOper_ChangeOrientation.hxx diff --git a/Makefile.in b/Makefile.in index 8c29352c3..532915591 100644 --- a/Makefile.in +++ b/Makefile.in @@ -63,6 +63,7 @@ chamfer.png \ chamferall.png \ chamferedge.png \ chamferface.png \ +change_orientation.png \ check.png \ circle.png \ circlepointvector.png \ @@ -122,6 +123,7 @@ point2.png \ pointonedge.png \ polyline.png \ prism.png \ +prism2.png \ revol.png \ rotate.png \ scale.png \ diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in index 8805b6d6d..8a907ac9e 100644 --- a/adm_local/unix/make_commence.in +++ b/adm_local/unix/make_commence.in @@ -1,6 +1,8 @@ # common directories to put headerfiles inc_builddir=$(top_builddir)/include/salome +MODULE_NAME=@MODULE_NAME@ + @SET_MAKE@ SHELL=/bin/sh diff --git a/configure.in.base b/configure.in.base index 1a444a104..b24a929ce 100644 --- a/configure.in.base +++ b/configure.in.base @@ -23,11 +23,15 @@ AC_CANONICAL_HOST PACKAGE=salome AC_SUBST(PACKAGE) -VERSION=3.2.0 -XVERSION=0x030200 +VERSION=3.2.2 +XVERSION=0x030202 AC_SUBST(VERSION) AC_SUBST(XVERSION) +# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.) +MODULE_NAME=geom +AC_SUBST(MODULE_NAME) + dnl dnl Initialize source and build root directories dnl @@ -325,7 +329,7 @@ else fi # make other build directories -for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl +for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources/${MODULE_NAME} idl do # if test ! -d $rep ; then # eval mkdir $rep diff --git a/doc/salome/gui/GEOM/blocks_operations.htm b/doc/salome/gui/GEOM/blocks_operations.htm index 4b606d3af..f3068888d 100755 --- a/doc/salome/gui/GEOM/blocks_operations.htm +++ b/doc/salome/gui/GEOM/blocks_operations.htm @@ -15,6 +15,7 @@ if (navigator.appName !="Netscape") + + + + + + + + + +

Change Orientation

+ +

To Change Orientation in the Main Menu + select Repair - > Change Orientation.

+ +

This operation reverses the normals of faces + composing the selected shell.

+ +

 

+ +

TUI Command : geompy.ChangeOrientation(shape)

+ +

Arguments: Name + 1 shape (shell)

+ +

Uncheck + Create a copy checkbox if you don't + wish to leave the initial object in the project (Result name field will be locked).

+ +

 

+ +

+ +

 

+ +

Example: +

+ +

 

+ + +++ + + + + + + + +
+

+

+

Inward orientation.

+

Outward orientation

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/GEOM/extrusion.htm b/doc/salome/gui/GEOM/extrusion.htm index 5c0812908..70a8fbca2 100755 --- a/doc/salome/gui/GEOM/extrusion.htm +++ b/doc/salome/gui/GEOM/extrusion.htm @@ -17,11 +17,13 @@ if (navigator.appName !="Netscape") img_whs1 { width:20px; height:20px; border-style:none; } p.whs2 { font-size:12pt; } p.whs3 { font-size:12pt; margin-left:40px; } -img_whs4 { border:none; width:312px; height:350px; float:none; border-style:none; } +img_whs4 { border:none; width:400px; height:350px; float:none; border-style:none; } p.whs5 { font-size:12pt; font-weight:bold; } -p.whs6 { font-size:12pt; font-style:italic; margin-left:40px; } -img_whs7 { border:none; float:none; width:300px; height:175px; border-style:none; } -img_whs8 { border:none; width:350px; height:175px; float:none; border-style:none; } +p.whs6 { font-size:12pt; margin-left:40px; font-weight:normal; font-style:italic; } +img_whs7 { border:none; width:400px; height:359px; float:none; border-style:none; } +p.whs8 { font-size:12pt; font-style:italic; margin-left:40px; } +img_whs9 { border:none; float:none; width:300px; height:175px; border-style:none; } +img_whs10 { border:none; width:350px; height:175px; float:none; border-style:none; } --> -

Using boolean operations

+

Using Boolean Operations

 

diff --git a/doc/salome/gui/GEOM/files/salome2_sp3_geomtoolsgui_functions.htm b/doc/salome/gui/GEOM/files/salome2_sp3_geomtoolsgui_functions.htm index 0f044a2a9..de5df125d 100755 --- a/doc/salome/gui/GEOM/files/salome2_sp3_geomtoolsgui_functions.htm +++ b/doc/salome/gui/GEOM/files/salome2_sp3_geomtoolsgui_functions.htm @@ -3,7 +3,7 @@ -Titre +Importing and exporting geometrical objects

 Filling - Surface with Curves

+ Surface with Edges

To generate a Filling 

-

To create a curving face using several curves - you need to define the Curves, - which will be the components of your face, Minimum +

To create a curving face using several edges + you need to define the Edges Compound, +  Minimum and Maximum Degree, Tolerance for 2D and for 3D  and @@ -115,7 +115,7 @@ if (window.writeIntopicBar)

 

-

+

 

diff --git a/doc/salome/gui/GEOM/geom.log b/doc/salome/gui/GEOM/geom.log index c5689070b..d47ee1faa 100755 --- a/doc/salome/gui/GEOM/geom.log +++ b/doc/salome/gui/GEOM/geom.log @@ -125,6 +125,7 @@ boolean_operations.htm box.htm building_by_blocks.htm chamfer.htm +change_orientation.htm changing_display_parameters.htm check_free_boundaries.htm check_free_faces.htm @@ -267,6 +268,7 @@ image37.gif files\salome2_sp3_operationgui_functions_salome2_sp3_operationgui_functions_image87.gif files\salome2_sp3_measuregui_functions_salome2_sp3_measuregui_functions_image76.gif files\salome2_sp3_basicgui_functions_salome2_sp3_basicgui_functions_image31.gif +image38.gif pics\multi_transformationsn1d.png pics\fillingsn.png pics\spheres.png @@ -330,13 +332,14 @@ image29.gif image160.jpg files\salome2_sp3_transformationgui_functions_salome2_sp3_transformationgui_functions_image133.gif files\salome2_sp3_basicgui_functions_salome2_sp3_basicgui_functions_image34.gif +pics\changeorientation.png +pics\pipesn.png +pics\pipe_wire_edgesn.png image2.gif pics\chamfer_faces.png pics\fillet_prism.png pics\rotationsn1.png pics\disp_mode1sn.png -pics\pipesn.png -pics\pipe_wire_edgesn.png pics\cones.png pics\planes1.png pics\lines.png @@ -364,6 +367,7 @@ pics\ellipse.png pics\circle1.png image3.gif files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image56.gif +pics\extrusion1.png image4.gif pics\isos_u12_v12sn.png pics\free_boudaries1.png @@ -383,6 +387,7 @@ pics\circle2.png pics\point3.png image185.jpg files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image57.gif +pics\extrusion2.png image5.gif pics\free_boudaries2.png pics\multi_rotation2d1.png @@ -415,6 +420,7 @@ image61.gif image154.jpg image110.jpg files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image59.gif +image40.gif pics\scale_transformsn2.png pics\translationsn1.png pics\facesn1.png @@ -473,6 +479,7 @@ image113.jpg files\salome2_sp3_primitivegui_functions_salome2_sp3_primitivegui_functions_image101.gif files\salome2_sp3_booleangui_functions_salome2_sp3_booleangui_functions_image1.gif salome2_sp3_buildgui_functions_salome2_sp3_buildgui_functions_image14.gif +image43.gif pics\image95.gif pics\mirror_planesn2.png pics\neo-scetcher2.png @@ -499,7 +506,6 @@ pics\repair10.png pics\transformation2.png pics\mtransf1.png pics\editgroup.png -pics\extrusion.png pics\box2.png image44.gif files\salome2_sp3_primitivegui_functions_salome2_sp3_primitivegui_functions_image103.gif @@ -576,6 +582,7 @@ whgdata\whlstf10.htm whgdata\whlstf11.htm whgdata\whlstf12.htm whgdata\whlstf13.htm +whgdata\whlstf14.htm whgdata\whlstg0.htm index.htm index_csh.htm diff --git a/doc/salome/gui/GEOM/geometrical_objects.htm b/doc/salome/gui/GEOM/geometrical_objects.htm index 68c303314..2ef298ee7 100755 --- a/doc/salome/gui/GEOM/geometrical_objects.htm +++ b/doc/salome/gui/GEOM/geometrical_objects.htm @@ -491,88 +491,73 @@ if (window.writeIntopicBar)

Creation of a Compound

-

import geompy

+

import + geompy

import salome

-

gg = salome.ImportComponentGUI("GEOM")

-

 

-

#create vertices

- -

p0 = geompy.MakeVertex( - 0.,  0., -  0.)

- -

pz = geompy.MakeVertex( - 0.,  0., - 40.)

+

gg = salome.ImportComponentGUI("GEOM")

 

-

# create sketchers

+

# create a vertex and + a vector

-

sketcher = geompy.MakeSketcher("Sketcher:F - -50 -50:TT 100 -50:R 0:C 50 70:R 0:L 100:WW")

+

p1 = geompy.MakeVertex( +  -30.,  -30., +  50.)

-

 

+

p2 = geompy.MakeVertex( +  -60.,  -60., +  30.)

-

# create faces from two - wires

- -

face = geompy.MakeFace(sketcher,1)

+

p3 = geompy.MakeVertex( +  -30.,  -30., +  10.)

 

-

# create a prism

- -

prism = geompy.MakePrism(face, - p0, pz)

- -

 

+

# create an arc from + three points

-

# explode the prism into - faces

+

arc = geompy.MakeArc(p1, + p2, p3)

-

prism_faces = geompy.SubShapeAllSorted(prism, - geompy.ShapeType["FACE"])

+

ShapeListCompound + = []

-

 

+

i = 0

-

# create a shell from - a set of faces

+

while i <= 3 :

-

shell = geompy.MakeShell([prism_faces[0], - prism_faces[1],

+

    S + = geompy.MakeTranslation(arc, i * 50., 0., 0.)

-

                          prism_faces[3], - prism_faces[4],

+

    ShapeListCompound.append(S)

-

                          prism_faces[5], - prism_faces[2]])

+

    i + = i + 1

 

-

# create a solid, bounded - by the given shells

+

# create a compund of + the given shapes

-

solid = geompy.MakeSolid([shell])

+

compound = geompy.MakeCompound(ShapeListCompound)

 

-

# add objects in the - study

+

# add object in the study

-

id_solid = geompy.addToStudy(solid,"Solid")

+

id_compound = geompy.addToStudy(compound,"Compound")

 

-

# display the solid

- -

gg.createAndDisplayGO(id_solid)

+

# display the compound

-

gg.setDisplayMode(id_solid,1) +

gg.createAndDisplayGO(id_compound)

Revolution

-

To create - an extruded shape by Revolution - in the Main Menu select New Entity - > Generation  - - > Revolution

+

To + create an extruded + shape by Revolution in the Main + Menu select New + Entity - > Generation  - + > Revolution

 

diff --git a/doc/salome/gui/GEOM/transformation_operations.htm b/doc/salome/gui/GEOM/transformation_operations.htm index dd15a9910..a6db12164 100755 --- a/doc/salome/gui/GEOM/transformation_operations.htm +++ b/doc/salome/gui/GEOM/transformation_operations.htm @@ -15,6 +15,7 @@ if (navigator.appName !="Netscape") - \ No newline at end of file + diff --git a/doc/salome/gui/GEOM/whdata/whftdata0.htm b/doc/salome/gui/GEOM/whdata/whftdata0.htm index 08edd6a41..acfb3af6b 100755 --- a/doc/salome/gui/GEOM/whdata/whftdata0.htm +++ b/doc/salome/gui/GEOM/whdata/whftdata0.htm @@ -22,6 +22,7 @@ aTE("Boolean Operations","boolean_operations.htm"); aTE("Box","box.htm"); aTE("Building by Blocks","building_by_blocks.htm"); aTE("Chamfer","chamfer.htm"); +aTE("Change Orientation","change_orientation.htm"); aTE("Changing Display Parameters","changing_display_parameters.htm"); aTE("Check Free Boundaries","check_free_boundaries.htm"); aTE("Check Free Faces","check_free_faces.htm"); @@ -42,9 +43,9 @@ aTE("Explode on Blocks","explode_on_blocks.htm"); aTE("Extrusion","extrusion.htm"); aTE("Face","face.htm"); aTE("Introduction to GEOM","files/introduction_to_geom.htm"); -aTE("Titre","files/salome2_sp3_booleangui_functions.htm"); -aTE("Titre","files/salome2_sp3_geomtoolsgui_functions.htm"); -aTE("Titre","files/salome2_sp3_measuregui_functions.htm"); +aTE("Using Boolean Operations","files/salome2_sp3_booleangui_functions.htm"); +aTE("Importing and exporting geometrical objects","files/salome2_sp3_geomtoolsgui_functions.htm"); +aTE("Using Measurement Tools","files/salome2_sp3_measuregui_functions.htm"); aTE("Fillet","fillet.htm"); aTE("Filling","filling.htm"); aTE("Fuse","fuse.htm"); diff --git a/doc/salome/gui/GEOM/whdata/whfts.htm b/doc/salome/gui/GEOM/whdata/whfts.htm index 47b9c2613..292e30479 100755 --- a/doc/salome/gui/GEOM/whdata/whfts.htm +++ b/doc/salome/gui/GEOM/whdata/whfts.htm @@ -15,4 +15,4 @@ iTM(0,82,"whftdata0.htm"); //--> - \ No newline at end of file + diff --git a/doc/salome/gui/GEOM/whdata/whfwdata0.htm b/doc/salome/gui/GEOM/whdata/whfwdata0.htm index 78d7054e2..f6c89c1ac 100755 --- a/doc/salome/gui/GEOM/whdata/whfwdata0.htm +++ b/doc/salome/gui/GEOM/whdata/whfwdata0.htm @@ -12,987 +12,1000 @@ diff --git a/doc/salome/gui/GEOM/whdata/whtdata0.htm b/doc/salome/gui/GEOM/whdata/whtdata0.htm index 58b23cebb..e4ae2b324 100755 --- a/doc/salome/gui/GEOM/whdata/whtdata0.htm +++ b/doc/salome/gui/GEOM/whdata/whtdata0.htm @@ -8,7 +8,7 @@ - \ No newline at end of file + diff --git a/doc/salome/gui/GEOM/whgdata/whlstt14.htm b/doc/salome/gui/GEOM/whgdata/whlstt14.htm index af1ba14e7..90141801a 100755 --- a/doc/salome/gui/GEOM/whgdata/whlstt14.htm +++ b/doc/salome/gui/GEOM/whgdata/whlstt14.htm @@ -49,7 +49,7 @@ img {vertial-align:middle;}        Creating Geometric Objects
       Transformation
       Measurement Tools
-       Access to Geometry module functionality from Python (using geompy.py)
+       Python interface geompy.py

diff --git a/doc/salome/gui/GEOM/whiform.htm b/doc/salome/gui/GEOM/whiform.htm index ad8862182..d412744b0 100755 --- a/doc/salome/gui/GEOM/whiform.htm +++ b/doc/salome/gui/GEOM/whiform.htm @@ -88,4 +88,4 @@ else //--> - \ No newline at end of file + diff --git a/doc/salome/gui/GEOM/whnjs.htm b/doc/salome/gui/GEOM/whnjs.htm index 59a0a4b09..03659d0ba 100755 --- a/doc/salome/gui/GEOM/whnjs.htm +++ b/doc/salome/gui/GEOM/whnjs.htm @@ -22,4 +22,4 @@ window.onload=window_Onload; <p>Your browser does not support frames. We recommend that you update your browser to a version that supports frames.</p><p>To view the Help system without frames click on this<a href="whgdata/whnvp30.htm">hyperlink.</a></p> - \ No newline at end of file + diff --git a/doc/salome/gui/GEOM/whres.xml b/doc/salome/gui/GEOM/whres.xml index b79fae014..1d279bbc3 100755 --- a/doc/salome/gui/GEOM/whres.xml +++ b/doc/salome/gui/GEOM/whres.xml @@ -253,4 +253,4 @@ - \ No newline at end of file + diff --git a/doc/salome/gui/GEOM/whskin_info.htm b/doc/salome/gui/GEOM/whskin_info.htm index 66213ff18..6a2b9e489 100755 --- a/doc/salome/gui/GEOM/whskin_info.htm +++ b/doc/salome/gui/GEOM/whskin_info.htm @@ -17,4 +17,4 @@ Authoring Tool Name RoboHelp X5 - \ No newline at end of file + diff --git a/doc/salome/gui/GEOM/whskin_pickup.htm b/doc/salome/gui/GEOM/whskin_pickup.htm index d06481fca..c3469d79f 100755 --- a/doc/salome/gui/GEOM/whskin_pickup.htm +++ b/doc/salome/gui/GEOM/whskin_pickup.htm @@ -226,4 +226,4 @@ writeStyle(); - \ No newline at end of file + diff --git a/doc/salome/gui/GEOM/whstart.js b/doc/salome/gui/GEOM/whstart.js index 3858ab2fc..88b813c13 100755 --- a/doc/salome/gui/GEOM/whstart.js +++ b/doc/salome/gui/GEOM/whstart.js @@ -429,4 +429,4 @@ function isAPane(sPaneName) return true; else return false; -} \ No newline at end of file +} diff --git a/doc/salome/gui/GEOM/whtdhtml.htm b/doc/salome/gui/GEOM/whtdhtml.htm index 5c1b6d723..e94f97f25 100755 --- a/doc/salome/gui/GEOM/whtdhtml.htm +++ b/doc/salome/gui/GEOM/whtdhtml.htm @@ -46,4 +46,4 @@ TocInitPage(); //--> - \ No newline at end of file + diff --git a/doc/salome/gui/GEOM/whtopic.js b/doc/salome/gui/GEOM/whtopic.js index e9d9cd19a..52198a574 100755 --- a/doc/salome/gui/GEOM/whtopic.js +++ b/doc/salome/gui/GEOM/whtopic.js @@ -722,4 +722,4 @@ setButtonFont("hide","","","","","",""); gbWhTopic=true; } else - document.location.reload(); \ No newline at end of file + document.location.reload(); diff --git a/doc/salome/gui/GEOM/whxdata/whftdata0.xml b/doc/salome/gui/GEOM/whxdata/whftdata0.xml index 567a7c535..0f5be19c9 100755 --- a/doc/salome/gui/GEOM/whxdata/whftdata0.xml +++ b/doc/salome/gui/GEOM/whxdata/whftdata0.xml @@ -10,6 +10,7 @@ + @@ -30,9 +31,9 @@ - - - + + + diff --git a/doc/salome/gui/GEOM/whxdata/whfwdata0.xml b/doc/salome/gui/GEOM/whxdata/whfwdata0.xml index d03042aed..b924603e1 100755 --- a/doc/salome/gui/GEOM/whxdata/whfwdata0.xml +++ b/doc/salome/gui/GEOM/whxdata/whfwdata0.xml @@ -1,986 +1,999 @@ - 0,3,4,5,6,8,10,17,36,39,43,45,55,56,58,64,67,73,75, - 58, - 17, + 0,3,4,5,6,8,11,18,37,40,44,46,56,57,59,65,68,74,76,33, + 59, + 18, 4, - 0,2,3,4,5,6,8,9,10,13,14,17,19,22,24,25,26,27,28,33,34,36,38,39,42,43,44,45,46,47,48,52,53,54,55,56,57,58,59,60,61,63,64,66,67,69,71,30,73,74,75,76,81,82, - 3,17,43,56,67,73, - 3,4,5,8,17,36,43,45,58,67,73, - 3,73, + 44, + 0,2,3,4,5,6,8,9,10,11,14,15,18,20,23,25,26,27,28,29,34,35,37,39,40,43,44,45,46,47,48,49,53,54,55,56,57,58,59,60,61,62,64,65,67,68,70,72,74,75,76,77,31,82,83, + 3,18,37,44,57,68,74, + 3,4,5,18,37,44,46,59,68,74, + 3,74, 4, - 43, - 43, - 43, - 32, + 44, + 44, + 44, + 33, 8, - 58, - 58, - 8,17,43,56,67, - 3,8,36,58,67, - 10, - 56, + 59, + 59, + 8,18,44,57,68, + 3,8,37,59,68, + 11, + 57, 3, - 58,64,67, - 43, - 5,73, - 43,58, - 49,5,7,13,16,17,20,21,22,23,26,35,36,39,40,41,43,46,47,48,52,58,62,66,32,30,73,74,76,77,81, - 3,6,8,17,36,56,58,67,73, - 3,4,5,39,43,45,58,73, - 73, - 10, - 73, - 43, - 3,5,6,56,73, - 36,43,58,67, - 5,34,58,64,30,73, - 1,2,5,7,10,13,17,19,36,39,43,47,54,55,58,66,30,73,74,77, - 3,8,10,17,43,56,58,67,73, - 36,67, - 43, - 10, - 58, - 43, - 6,56,58,73, - 13,20,34,42,50,52,54,55,58,64,70,32,30,77,78,80,82, - 49,36,39,43,47,66,30,73, - 6,8,17,36,56,58,73, - 58, - 8,56,58, - 0,3,10,17,34,36,39,43,55,58,66,67,31,73, - 3,5,8,10,17,36,43,58,67,73,75, + 59,65,68, + 44, + 5,74, + 44,59, + 50,5,7,14,17,18,21,22,23,24,27,28,36,37,40,41,42,44,47,48,49,53,59,63,67,74,75,77,31,78,82, + 3,6,18,37,57,59,68,74, + 3,4,5,40,44,46,59,74, + 74, + 11, + 74, + 44, + 3,5,6,57,74, + 37,44,59,68, + 5,35,59,65,74,31, + 1,2,5,7,11,14,18,20,37,40,44,48,55,56,59,67,74,75,31,78, + 3,8,11,18,37,44,57,59,68,74, + 37,68, + 44, + 11, + 59, + 44, + 6,8,57,59,74, + 14,21,35,43,51,53,55,56,59,65,71,31,33,78,79,81,83, + 50,37,40,44,48,67,74,31, + 6,8,18,37,57,59,74, + 59, + 57,59, + 0,3,11,18,35,37,40,32,44,56,59,67,68,74, + 3,5,8,11,18,37,44,59,68,74,76, 4, - 6,56,58, - 49,43,32, - 17,58,73, - 58, - 36,43,58, - 3,8,36,56,58,67,73, - 43, - 43,58,67,73, - 36,43,66, - 64,66, - 50,66, - 66, - 75, - 50,78, - 7,15,27,28,41,69, + 6,57,59, + 50,5,44,33, + 18,37,59,74, + 59, + 37,44,59, + 3,8,37,57,59,68,74, + 44, + 44,59,68,74, + 37,44,67, + 65,67, + 51,67, + 67, + 76, + 51,79, + 7,16,29,42,70, 0, - 0,14, - 14,39,31,82, - 0,3,4,5,6,8,17,36,39,56,58,67,73,82, - 39,82, - 3,4,5,6,8,10,17,36,39,56,58,67,73, - 5,58, - 7,18,23,27,28,36,65,68,69,79, - 7,13,19,20,22,42,45,52,54,55,66,69,76,77,81, - 58, - 49,9,25,44,45,46,50,60,63,64,66,71,74,78, - 7,9,45,48,51,53,73,74, - 30, - 39, - 45, - 46,58,59,60,64,66,73, - 21,27,41,54,55,69, - 2,52,60,64,74, - 42,73,82, - 78,82, - 17,73, - 9,64, - 51, - 64,78, - 64, - 1,3,17,36,58,66,67,73, - 17, - 17, + 0,15, + 15,40,32,83, + 0,3,4,5,6,8,18,37,40,57,59,68,74,83, + 40,83, + 3,4,5,6,8,11,18,37,40,57,59,68,74, + 5,59, + 7,19,24,28,29,37,66,69,70,80, + 7,14,20,21,23,28,43,46,53,55,56,67,70,77,78,82, + 59, + 50,9,26,45,46,47,51,61,64,65,67,72,75,33,79, + 7,9,46,49,52,54,74,75, + 31, + 40, + 46, + 47,59,60,61,65,67,74, + 22,42,55,56,70,74, + 53,61,65,75, + 43,74,83, + 79,83, + 18,37,74, + 9,65, + 52, + 65,79, + 65, + 1,3,18,37,59,67,68,74, + 18, + 18, 2,4, - 43,50, - 0,1,2,49,7,9,13,14,16,18,19,20,21,22,23,24,25,26,27,28,33,34,35,38,40,41,42,44,45,46,47,48,51,52,53,54,55,57,59,60,61,62,63,65,66,68,69,70,71,72,30,74,76,77,79,81,82, - 46,59,73, - 49,42,78, - 0,49,14,50,66,70,71,72,31,82, - 7,42,50,74, - 17,19,22,42,44,45,46,48,59,60,32,73, - 3,20,64, - 78, - 19,22,27,46,50,53,58,59,61,64,74,76, - 53, - 27,50, - 1,2,3,4,13,20,24,37,29,41,42,43,52,54,55,66,32,77,81, - 43,32, - 43, - 23, - 58,64,66, - 58, + 44,51, + 0,1,2,50,7,9,10,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,41,42,43,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,66,67,69,70,71,72,73,75,77,31,78,80,82,83, + 47,60,74, + 50,43,79, + 0,50,15,32,51,67,71,72,73,83, + 7,43,49,51,75, + 18,20,23,43,45,46,47,60,61,74,33, + 3,21,65, + 79, + 20,23,28,47,51,54,59,60,62,65,75,77, + 54, + 28,51, + 1,2,3,4,14,21,25,38,30,42,43,44,53,55,56,67,33,78,82, + 44,33, + 44, + 24, + 59,65,67, + 59, 9, - 49, - 20, - 3,20,64, - 78, - 49,5,8,26,37,29,43,47,57,32, - 50,78, - 6,16,21,35,37,29,62,32,30, - 7,19,47,64, - 58, - 8,36,43,32, - 11,58,63,71, - 11,58,72, - 43,32, - 4,49,5,7,10,15,21,26,39,43,56,58,64,66,72,32,31,73,75,79,82, + 50, + 21, + 3,21,65, + 79, + 50,5,8,27,38,30,44,48,58,33, + 51,79, + 6,17,22,36,38,30,63,31,33, + 7,20,48,49,65, + 59, + 8,37,44,33, + 12,59,64,72, + 12,59,73, + 44,33, + 4,50,5,7,11,16,22,27,40,32,44,57,59,65,67,73,74,76,33,80,83, 5, 5, - 43,56,58, - 43,56,58, - 56, - 64, - 57, - 37,29,58,31, - 42,31,78,79, - 64, - 64, - 49,5,8,18,23,28,37,29,52,57,65,68,79, - 42,50,63,71,79,82, - 49, - 36,64,67, - 64, - 64, - 64, - 37,29, - 81, - 49,42,47,72, - 50, - 31, - 7,13,19,24,43,45,46,50,66,69,32,76, - 25, - 61, - 19,22,61,64, - 64,82, + 44,57,59, + 44,57,59, + 57, + 65, + 58, + 38,32,30,59, + 32,43,79,80, + 65, + 65, + 50,5,8,19,24,29,38,30,53,58,66,69,80, + 43,51,54,64,72,80,83, + 50, + 37,65,68, + 65, + 65, + 65, + 38,30, + 33, + 82, + 50,43,48,73, + 51, + 32, + 7,14,20,25,44,46,47,51,67,70,77,33, + 26, + 62, + 20,23,62,65, + 65,83, 5, - 9,73, - 73, - 73, - 73, - 73, - 10,15,40,75,78,80, - 5,11,12,26,28,43,58,64,72,32, + 9,74, + 74, + 74, + 74, + 74, + 10,11,16,41,76,79,81, + 10, + 12,13,27,29,44,59,65,73,33, 5, - 5, - 44,45,46,60,71,74, - 43,32, - 43,58,32, - 20, - 26,42,31, - 3,13,66, + 10,45,46,47,61,72,75,33, + 44,33, + 44,59, + 21, + 27,32,43, + 3,14,67, 3, 3, - 15,50,31,78,80,82, - 50, - 50, - 11,14,58,64,68,82, - 14,58, - 11,58, - 14, - 43, - 64, - 45, - 38, - 64, - 19,22, - 10,15,78,80, - 0,1,2,49,7,9,11,12,13,14,15,16,18,19,20,22,23,24,25,26,27,28,33,34,35,38,41,42,44,45,46,47,48,51,52,53,54,55,57,59,60,61,62,63,64,65,66,68,69,70,71,72,32,30,74,75,76,77,78,79,80,82, - 6,9,14,16,30,73, - 17,27,34,37,29,53,59,30, - 3,17,34,66,74, - 49,32, - 49,5,16,17,18,21,25,26,35,36,38,43,46,48,51,58,62,32, - 25,27,53,59, - 2,32, - 19,56,58, - 32, - 32, - 56, - 56, - 31,82, - 64, - 9,28,65,32,79, - 32, - 73, - 14,38,32, - 32, - 49, - 49,68, - 20,37,29,50,53,30, - 0,5,12,14,57, - 39,50,31, - 64, - 64, - 64, - 64, - 64, - 14,58, - 64, - 64, - 43, - 7,19,22,25,42,43,45,50,55,66,69,32,73,74,76,77,81, - 44,45,60,74, - 64, + 16,32,51,54,79,81,83, + 51, + 51, + 12,15,59,65,69,83, + 15,59, + 12,59, + 15, + 44, + 65, + 46, + 39, + 65, + 20,23, + 11,16,79,81, + 0,1,2,50,7,9,10,12,13,14,15,16,17,19,20,21,23,24,25,26,27,28,29,34,35,36,39,42,43,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,33,78,79,80,81,83, + 6,9,15,17,74,31, + 18,28,35,38,30,54,60,31, + 3,18,67,75, + 50,10,33, + 50,5,17,18,19,22,26,27,35,36,37,39,44,47,49,52,59,63,33, + 26,28,54,60, + 37, + 2,33, + 20,57,59, + 33, + 33, + 57, + 57, + 32,83, + 65, + 9,29,66,33,80, + 33, + 74, + 15,39,33, + 33, + 50, + 50,69, + 21,38,30,51,31, + 0,13,15,58, + 40,32,51, + 65, + 65, + 65, + 65, + 65, + 15,59, + 65, + 65, + 44, + 7,20,23,26,43,44,46,51,56,67,70,74,75,77,33,78,82, + 10,45,46,61,75, + 65, 7,8, - 64, - 64, - 2,11,20,23,26, - 58, - 66, - 30, - 1,2,3,4,49,5,6,7,8,9,13,14,17,18,19,20,22,23,24,25,27,28,33,34,35,36,39,41,42,43,44,45,46,50,53,54,55,56,58,59,60,61,62,65,66,67,68,69,32,73,74,76,77,78,79,81,82, - 3,4,5,6,8,10,17,36,39,56,58,67,73, - 39,82, - 1,3,7,13,14,17,18,19,20,22,23,24,27,28,34,36,37,39,29,41,53,54,55,56,58,59,65,68,69,76,77,79,82, - 50, - 42, - 73, - 73, - 45, - 7,27,41,50,66,69, - 3,20,34,64,66, - 64, - 64, - 64, - 64, - 6,16,21,52,58,30, - 58, - 6,19,22,56,58,73, - 17, - 64, - 9,58,64, - 9,73, - 9,73, - 32, - 58, - 50,55,66,78,82, - 1,7,9,13,19,20,22,24,25,26,27,33,34,41,42,46,47,48,50,53,54,55,59,60,61,64,66,69,31,74,76,77,81,82, - 71,32, - 53, + 65, + 65, + 2,12,21,24,27, + 59, + 67, + 31, + 1,2,3,4,50,5,6,7,8,9,10,14,15,18,19,20,21,23,24,25,26,28,29,34,35,36,37,40,42,43,44,45,46,47,51,54,55,56,57,59,60,61,62,63,66,67,68,69,70,74,75,77,33,78,79,80,82,83, + 3,4,5,6,8,11,18,37,40,57,59,68,74, + 40,83, + 1,3,7,14,15,18,19,20,21,23,24,25,28,29,35,37,38,40,30,42,54,55,56,57,59,60,66,69,70,77,78,80,83, + 5, + 51, + 43, + 74, + 74, + 46, + 7,42,51,67,70, + 3,21,35,65,67, + 65, + 65, + 65, + 65, + 6,17,22,53,59,31, + 59, + 6,20,23,57,59,74, + 18,57, + 57, + 57, + 65, + 9,59,65, + 9,74, + 9,74, + 33, + 59, + 44, + 51,56,67,79,83, + 1,7,9,14,20,21,23,25,26,27,28,34,35,32,42,43,47,48,49,51,54,55,56,60,61,62,65,67,70,75,77,78,82,83, + 72, + 54, 2, - 32, - 34,59,64,66, - 52,82, + 33, + 35,60,65,67, + 53,83, 2, - 47,64, - 64, - 43, - 49,43,66,67,32, - 82, - 37,29, - 66, - 11,63,71, - 64, - 50, - 49,21,64,66,31,75,79,82, - 39, - 44,32, - 7,9,22,27,46,32, - 46,48, - 48, - 48, - 42, - 2,13,19,24,27,42,46,47,48,50,59,60,64,66,76, - 47, - 47, - 47, - 47, - 47, - 47, - 3,4,5,6,8,10,15,17,36,39,40,50,56,58,63,67,71,32,31,73,75,78,80,82, - 78, - 38,43,51,64,32, - 0,58, - 0,58, - 39,50, - 7,14,27,48,50,69, - 46,47,48,66,75, - 82, - 50, - 50, - 50, - 64, - 64, - 64, - 50,78, - 50, - 7,43,66,74,77, - 7,43,66,74,77, - 7,43,74,77, - 64, - 49, - 49, - 49, - 49, - 82, - 0,1,49,7,8,9,11,13,14,17,20,23,24,25,27,33,34,36,41,43,53,55,57,58,59,64,65,66,32,73,77,79,80, - 58, - 58, + 48,65, + 65, + 44, + 50,44,67,68,33, + 83, + 38,30, + 67, + 12,64,72, + 65, + 51, + 50,22,32,65,67,76,80,83, + 40, + 45,33, + 7,9,23,28,47,33, + 47,49, + 49, + 49, + 43, + 2,14,20,25,28,43,47,48,49,51,60,61,65,67,77, + 48, + 48, + 48, + 48, + 48, + 48, + 3,4,5,6,8,11,16,18,37,40,32,41,51,57,59,64,68,72,74,76,33,79,81,83, + 79, + 39,44,52,65,33, + 0,59, + 0,59, + 40,51, + 7,10,15,28,49,51,70, + 47,48,49,67,76, + 83, + 51, + 51, + 51, + 65, + 65, + 65, + 51,79, + 51, + 7,44,67,75,78, + 7,44,67,75,78, + 7,44,75,78, + 44,65, + 50, + 50, + 50, + 50, + 83, + 0,1,50,7,8,9,12,14,15,18,21,24,25,26,28,34,35,37,42,44,54,56,58,59,60,65,66,67,74,33,78,80,81, + 59, + 59, 8, 8, 8, 8, 0, - 82, - 32, - 32, - 49,45, - 14,28,66,32,30,78,82, - 49, - 3,24, - 43,58, - 71,72, - 32, - 1,14,27,45,58,64,66,73,74,77, - 82, - 32, - 1,49,7,13,18,19,20,22,23,24,25,27,28,34,41,42,53,54,55,59,65,66,68,69,76,77,79,81,82, - 19,64,66, - 78, - 78, - 78, - 11,39,32, - 25,64, - 0,1,2,49,7,9,11,12,13,14,15,16,18,19,20,21,22,23,24,26,27,28,33,34,35,38,40,41,42,44,45,46,47,48,51,52,53,54,55,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,31,30,74,75,76,77,79,80,82, - 72, - 54,66,82, - 31, - 5,25,26,36, - 37,29,50,31,78, - 31, - 50, - 32, - 26, - 53,59, - 27, - 36,67, - 58, - 73, - 73, - 49, - 58, - 49, - 49, - 49, - 49, - 49, - 3,49,8,9,12,14,17,25,26,27,28,33,34,36,38,39,43,47,51,52,53,54,58,59,64,65,66,67,70,72,32,73,81, - 58, - 58, - 9,17,36, - 9,17,36, - 36, - 39, - 32, - 32, - 61,73, - 43,58, - 11, - 15,17,34,42,31,78,80, - 71, - 9,33,73, - 73, - 44,45,54,55,74,81,82, - 7,13,19,22,23,42,44,45,47,48,52,54,55,64,67,69,30,74,76,77,81, - 50, - 64, - 64, - 58,64, - 32, - 58, - 64,66,67,32,30,75,82, - 37,29,50,31,78, - 49,8,64, - 50, - 11,12,58,63,71, - 37,29,50,73, - 49, - 50,66,82, - 6,10,35,30, - 10, - 64, - 64, - 14, - 45, - 49,30, - 27,34,53, - 27,34,37,29,53,59, - 3,4,5,6,8,10,17,36,39,43,56,57,58,67,32,73, - 0,1,2,49,7,9,11,12,13,14,16,18,19,20,21,22,23,24,25,26,27,28,33,34,35,38,41,44,46,47,48,51,52,53,54,55,57,59,60,61,62,63,64,65,66,68,69,70,71,72,32,74,76,77,79,82, - 1,49,13,18,20,23,24,27,28,34,41,53,54,55,59,64,65,68,77,78,79, - 3,10,16,36,37,29,46,50,32,31,30,78,80,82, - 37,29,50,58,64,31, - 0,1,2,3,4,49,5,6,7,8,9,10,11,13,14,16,17,18,19,20,22,23,24,25,26,27,28,33,34,35,36,38,39,41,42,43,44,45,46,47,48,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,32,30,73,74,76,77,79,82, - 5,43,58,32,73, - 58, + 83, + 33, + 33, + 50,46, + 15,29,67,31,33,79,83, + 50, + 3,25, + 44,59, + 72,73, + 33, + 1,15,28,46,59,65,67,74,75,78, + 83, + 33, + 1,50,7,14,19,20,21,23,24,25,26,28,29,35,42,43,54,55,56,60,66,67,69,70,77,78,80,82,83, + 20,65,67, + 79, + 79, + 79, + 12,40,33, + 26,65, + 0,1,2,50,7,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,32,41,42,43,45,46,47,48,49,52,53,54,55,56,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,78,80,81,83, + 73, + 55,67,83, + 32, + 5,26,27,37, + 38,32,30,51,79, + 32, + 51, + 33, + 27, + 54,60, + 28,54, + 37,68, + 59, + 74, + 74, + 50, + 59, + 50, + 50, + 50, + 50, + 50, + 44, + 2,3,50,5,8,9,10,13,15,18,26,27,28,29,34,35,37,39,40,44,48,52,53,54,55,59,60,65,66,67,68,71,73,74,33,82, + 59, + 59, + 9,18,37, + 9,18,37, + 37, + 40, + 33, + 33, + 62,74, + 44,59, + 12, + 10, + 16,18,35,32,43,79,81, + 72, + 9,34,74, + 74, + 45,46,55,56,75,82,83, + 7,14,20,23,24,28,43,45,46,48,49,53,55,56,65,68,70,75,77,31,78,82, + 51, + 65, + 65, + 59,65, + 33, + 59, + 65,67,68,76,31,33,83, + 38,32,30,51,79, + 50,8,65, + 51, + 12,13,59,64,72, + 38,30,51,74, + 50, + 51,67,83, + 6,11,36,31, + 11, + 65, + 65, + 15, + 46, + 50,31, + 28,35,54, + 28,35,38,30,54,60, + 3,4,5,6,8,11,18,37,40,44,57,58,59,68,74,33, + 0,1,2,50,7,9,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,42,45,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,33,78,80,83, + 1,50,14,19,21,24,25,28,29,35,42,54,55,56,60,65,66,69,78,79,80, + 3,11,17,37,38,32,30,47,51,31,33,79,81,83, + 38,32,30,51,59,65,33, + 0,1,2,3,4,50,5,6,7,8,9,10,11,12,14,15,17,18,19,20,21,23,24,25,26,27,28,29,34,35,36,37,39,40,42,43,44,45,46,47,48,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,77,31,33,78,80,83, + 5,44,59,74,33, + 59, 5, - 11,58, - 12,58, - 82, - 58, - 39,58,73, - 5, - 3,4,5,6,8,10,15,17,36,39,43,56,58,67,73,75,80, - 13,24,54,64,31, - 3,5,8,9,12,17,22,25,26,28,33,36,38,41,46,51,55,58,64,67,32,73,76, - 42,45,50, - 5,38,43,52,58,32, - 50, - 25,43,46,32, - 50, - 5,37,39,29,50,57,82, - 82, - 39, - 82, - 64,65, - 6,19,22,27,58,73, - 82, + 12,59, + 13,59, + 83, + 59, + 5,40,59,74, + 3,4,5,6,8,11,16,18,37,40,44,57,59,68,74,76,81, + 14,25,32,55,65, + 3,5,8,9,13,18,23,26,27,29,34,37,39,42,47,52,56,59,65,68,74,77,33, + 43,46,51, + 5,39,44,53,59,33, + 51, + 26,44,47,33, + 51, + 5,38,40,30,51,58,83, + 83, + 40, + 83, + 65,66, + 6,20,23,28,57,59,74, + 83, 8, - 49,8,47, - 49, - 50,78, - 11,32, - 58,71, - 79, - 32, - 17,39,58,64, - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 0,12,14,15,25,47,58,70,71,72,73,75,78,80,82, + 50,8,48, + 50, + 51,79, + 12,33, + 59,72, + 80, + 33, + 18,37,40,59,65, + 33, + 33, + 33, + 33, + 33, + 33, + 33, + 33, + 33, + 0,13,15,16,26,48,59,71,72,73,74,76,79,81,83, 3, 4, - 73, + 74, 3, - 4,5,58,73, + 4,5,59,74, 5, 5, - 56,58, - 56,58, - 56, - 73, - 73, - 73, - 73, + 57,59, + 57,59, + 57, + 74, + 74, + 74, + 74, 3, 3, 6, - 5,17,58, - 56, - 56, - 73, - 73, - 6,58, - 58, - 6,73, - 58, - 17,36,58, + 5,18,37,59, + 57, + 57, + 74, + 74, + 6,59, + 59, + 6,74, + 57, + 57, + 59, + 18,37,59, 8, 8, 8, 8, 3, - 3,58,67, - 58, - 17,36, - 17,36, - 36, - 17, - 73, - 73, + 3,59,68, + 59, + 18,37, + 18,37, + 37, + 18, + 74, + 74, 6, - 58, - 39, - 58, + 59, + 40, + 59, 3, 3, 3, 5, - 73, - 73, - 73, - 73, - 58, + 74, + 74, + 74, + 74, + 59, 3, 3, 3,8, 3, 3,8, 3,8, - 3,8,73, + 3,8,74, 4, 4, 4, - 17, - 4,73, + 18, + 4,74, 3, 3, 3, 3, - 73, - 73, - 17, - 17, + 74, + 74, + 18, + 18, 3, 3, 3, 8, 8, 8, - 58, - 17, - 73, - 73, - 73, - 73, + 59, + 18, + 74, + 74, + 74, + 74, 6, - 58, - 58, - 36, - 67, - 67, - 36, + 59, + 59, + 37, + 68, + 68, + 37, 8, 8, 6, - 56, - 56, - 56, - 56, - 56, - 73, - 73, - 73, - 73, - 73, + 57, + 57, + 57, + 57, + 57, + 74, + 74, + 74, + 74, + 74, 3, 3, 3, - 17, - 73, + 18, + 74, 3, - 17,36,58, - 58, - 58,73, - 73, - 73, - 0,11,14,19,28,39,43,50,52,58,64,71,72,32, - 37,29,31, - 44,50,73,78, - 64, - 31, - 64, - 3,4,5,6,8,10,17,36,37,39,29,43,56,58,67,32,31,73, - 31, - 58, - 3,4,5,6,8,10,17,36,39,43,56,58,67,73, - 28, - 5, - 51,31, - 39, - 14, - 16, - 25,82, - 9,25,52,58, - 48,55, - 43,32, - 32, - 44,45,46,60,61,74, - 32, - 14, - 52, - 19, - 47, - 26,47, - 26, - 49, - 58,72, + 18,37,59, + 59, + 59,74, + 74, + 74, + 0,10,12,15,20,29,40,44,51,53,59,65,72,73,33, + 38,32,30, + 5, + 45,51,74,79, + 65, + 32, + 65, + 3,4,5,6,8,11,18,37,38,40,32,30,44,57,59,68,74,33, + 32, + 59, + 3,4,5,6,8,11,18,37,40,44,57,59,68,74, + 29, + 32,52, + 40, + 15, + 17, + 26,83, + 9,26,53,59, + 49,56, + 44,33, + 33, + 10,45,46,47,61,62,75, + 33, + 15, + 53, + 20, + 48, + 27,48, + 27, + 50, + 59,73, 3, - 20, - 52, - 52, - 49,37,29, - 43,58,64, - 50, - 75, + 21, + 53, + 53, + 50,38,30, + 44,59,65, + 51, + 76, + 10, 0, - 14, - 78, - 40,78, - 50, - 36, - 3,17,28,67, - 58, - 43,58, - 34, - 14, - 43,32, - 43,32, - 43,32, - 64, - 50,78, - 50,78, - 64, - 49, - 64, - 44,45,60,74,82, - 82, - 58, - 36,67, - 23,42, - 42,45, - 45, - 45, - 20, - 82, - 45,50,78, - 58, - 0,43,66,32, - 1,13, - 52, - 2,3,41,66,82, + 15, + 44, + 79, + 41,79, + 51, + 37, + 3,18,29,68, + 59, + 44,59, + 35, + 15, + 44,33, + 44,33, + 44,33, + 65, + 51,79, + 51,79, + 65, + 50, + 65, + 45,46,61,75,83, + 83, + 59, + 37,68, + 24,43, + 43,46, + 46, + 46, + 21, + 10,83, + 46,51,79, + 59, + 0,44,67,33, + 1,14, + 53, + 2,3,42,67,83, 3, 3, - 66, - 3,9,11,12,14,18,20,25,28,34,39,52,57,58,63,64,65,66,68,70,71,72,73,79,82, + 67, + 3,9,12,13,15,19,21,26,29,35,40,53,58,59,64,65,66,67,69,71,72,73,74,80,83, 5, 9, - 70, - 70, - 25, - 52, - 52, - 52, - 18,20,52,63,65,68,79, - 52, - 71, - 33, - 50, - 42,45,51,66,73, - 45, - 45, - 5, - 55, - 42,45,31,73, - 50, - 45, - 66,72, - 64, - 0,1,2,49,7,9,11,12,13,14,16,18,19,20,21,22,23,24,25,26,27,28,33,34,35,38,41,42,43,44,45,46,47,48,51,52,53,54,55,57,59,60,61,62,63,64,65,66,68,69,70,71,72,32,74,76,77,79,81,82, - 82, - 24,76, - 5,6,9,43,47,48,52,58,73,74,82, + 71, + 71, + 26, + 53, + 53, + 53, + 19,21,53,64,66,69,80, + 53, + 72, + 34, + 51, + 43,46,52,67,74, + 46, + 46, + 56, + 32,43,46,74, + 10,51, + 46, + 67,73, + 65, + 0,1,2,50,7,9,10,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,42,43,44,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,33,78,80,82,83, + 83, + 25,77, + 5,6,9,44,48,49,53,59,74,75,83, 5, - 1,3,17,36,58,67,73, - 3,20, - 5,26, - 10,30, - 7,10,43,56,58,73, - 5,7,43,56,58,73, - 4,7,39,56, - 43,32, - 73, - 9,73, - 9,73, - 9,73, - 3,13, - 3,13, - 6,16, - 5,17,18,43,58, - 19,56,58, - 19,56, - 6,58, - 6,22,58,73, - 22, - 8,17,23,36,58, - 3,24, - 3,17,28,36,58,67,73, - 28,36, - 17,34, - 33,73, - 33,73, - 6,35, - 38,43,58, - 4,52, - 49,8, - 49,8, - 3,20, - 3,41, - 3,41, - 42,73, - 44,73, - 44,73, - 44,73, - 46, - 46, - 5,47, - 5,47, - 48,73, - 48,73, - 51,73, - 4,52, - 17,53, - 3,4,54, - 3,54, - 3,54,73, - 3,20, - 45,73, - 17,27,36, - 17,27,58,73, - 49,8, - 49,8, - 49,8, - 17,59, - 58,60,73, - 61,73, - 6,62, - 58,63, - 36,65, - 36,66,67, - 67, - 36,68, - 5,6,10,56,69, - 56, - 56,76, - 56,76, - 17,73,74, - 73,74, - 73,74, - 3,6,17,36,56,58,67,73,77, - 3,4,17,77, - 3,4,5,6,8,17,36,39,43,55,56,58,67,73, - 3,55, - 3,55, - 3,17,36,58,67,73,79, - 82, - 50, - 43,32, - 52, - 43,58,73, - 43,32, - 26,34,43,64, - 17, - 34, - 26,64,32, - 26,34,38,64, - 26, - 64, - 64, - 51,55,66,80, - 32, - 43,32, - 31, - 64, - 50, - 49, - 0,1,2,49,7,9,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,33,34,35,38,40,41,42,44,45,46,47,48,51,52,53,54,55,57,59,60,61,62,63,64,65,66,68,69,70,71,72,32,31,74,76,77,78,79,80,81,82, - 64, - 2,49,50,78, + 1,3,18,37,59,68,74, + 3,21, + 5,27, + 11,31, + 7,11,44,57,59,74, + 5,7,44,57,59,74, + 4,7,40,57, + 44,33, + 74, + 9,74, + 9,74, + 9,74, + 3,14, + 3,14, + 6,17, + 5,18,19,37,44,59, + 20,57,59, + 20,57, + 6,59, + 6,23,57,59,74, + 23,57, + 8,18,24,37,59, + 3,25, + 3,18,29,37,59,68,74, + 29,37, + 18,35, + 34,74, + 34,74, + 6,36, + 39,44,59, + 4,53, + 50,8, + 50,8, + 3,21, + 3,42, + 3,42, + 43,74, + 45,74, + 45,74, + 45,74, + 47, + 47, + 5,48, + 5,48, + 49,74, + 49,74, + 52,74, + 4,53, + 18,54, + 3,4,55, + 3,55, + 3,55,74, + 3,21, + 46,74, + 18,28,37, + 18,28,59,74, + 50,8, + 50,8, + 50,8, + 18,60, + 59,61,74, + 62,74, + 6,63, + 59,64, + 37,66, + 37,67,68, + 68, + 37,69, + 5,6,11,57,70, + 57, + 57,77, + 57,77, + 18,37,74,75, + 74,75, + 74,75, + 3,6,18,37,57,59,68,74,78, + 3,4,18,78, + 3,4,5,6,8,18,37,40,44,56,57,59,68,74, + 3,56, + 3,56, + 3,18,37,59,68,74,80, + 83, + 51, + 44,33, + 53, + 44,59,74, + 44,33, + 27,35,44,65, + 5, + 18, + 35, + 27,65,33, + 27,35,39,65,33, + 27, + 65, + 65, + 52,56,67,81, + 33, + 44,33, + 32, + 65, + 51, + 50, + 0,1,2,50,7,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,32,41,42,43,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,33,78,79,80,81,82,83, + 65, + 2,50,51,79, 2,4, - 45, - 1,55, - 26,34,43,32, - 43, - 17, - 34, - 43,32, - 26,28,43,32, - 26,34,64, - 26, - 24,76, - 44,73, - 73, - 73, - 73, - 0,10,14,64,78,80, - 2,37,29, - 14,45, - 45,73, - 37,29,50,31, - 43,32, - 50,78, - 45,48, - 82, - 5,46,47,48,73, - 46,73, - 46,73, - 57, - 43,46,48,71,32, - 64, - 0,1,2,49,7,9,13,14,16,18,19,20,21,22,23,24,27,28,33,34,35,38,41,42,44,45,46,47,48,51,52,53,54,55,59,61,62,63,64,65,68,69,70,71,72,31,74,76,77,78,79,81,82, - 7,27,41,69, - 25, - 17,34, - 43, - 43, - 64, - 46,47,48, - 46,48, - 46,48, - 47, - 47, - 43, - 43, - 7,9,25,27,28,33,34,46,48,53,59,60,61,64,69,74, - 64, - 9,33,64,66,32, - 14, - 51, - 64, - 1,49,7,13,14,18,19,20,22,23,24,25,27,28,34,41,42,50,53,54,55,59,65,66,68,69,73,76,77,78,79,81,82, - 43, - 43, - 20, - 11, - 43, - 3,13,24,51,54,76, - 19, - 28, - 49, - 64, - 26,34,40,46,47,48,51,58,63,64,71,73,78, - 47, - 1,2,3,4,5,6,8,9,10,13,15,16,17,18,20,23,24,25,27,28,33,34,36,37,39,29,41,42,44,45,46,50,51,53,54,55,56,57,58,59,60,64,65,67,68,72,32,31,30,73,74,77,78,79,80,82, - 25,43,45,64, - 0,9,14,33,50,70,71,72,78,82, - 11, - 51,73, - 42,43,58,82, - 55, - 0,14,21,46,47,48,54,55,58,64,66,73,81, - 75, - 11,14,50,58,31,82, - 11,58, - 0,1,2,4,49,5,6,7,9,11,12,13,14,16,19,20,21,22,24,25,26,27,33,34,35,37,38,29,41,44,45,46,47,48,51,52,53,54,55,57,58,59,60,61,62,63,64,66,69,70,71,72,30,73,74,76,77,82, - 58,64, - 31, + 46, + 1,56, + 27,35,44,33, + 44, + 5, + 18, + 35, + 44,33, + 27,29,44,33, + 27,35,65,33, + 27, + 25,77, + 45,74, + 74, + 74, + 74, + 0,11,15,65,79,81, + 2,38,30, + 15,46, + 46,74, + 38,32,30,51, + 44,33, + 51,79, + 46,49, + 83, + 5,47,48,49,74, + 47,74, + 47,74, + 58, + 44,47,49,72,33, + 65, + 0,1,2,50,7,9,10,14,15,17,19,20,21,22,23,24,25,28,29,34,35,36,39,32,42,43,45,46,47,48,49,52,53,54,55,56,60,62,63,64,65,66,69,70,71,72,73,75,77,78,79,80,82,83, + 5,7,42,70, + 26, + 18,35, + 44, + 44, + 65, + 47,48,49, + 47,49, + 47,49, + 48, + 48, + 44, + 44, + 7,9,26,28,29,34,35,47,49,54,60,61,62,65,70,75, + 65, + 9,34,65,67,33, + 15, + 52, + 65, + 1,50,7,14,15,19,20,21,23,24,25,26,28,29,35,42,43,51,54,55,56,60,66,67,69,70,74,77,78,79,80,82,83, + 44, + 44, + 21, + 12, + 44, + 3,10,14,25,52,55,77, + 20, + 29, + 50, + 65, + 27,35,41,47,48,49,52,59,64,65,72,74,79, + 48, + 1,2,3,4,5,6,8,9,10,11,14,16,17,18,19,21,24,25,26,28,29,34,35,37,38,40,32,30,42,43,45,46,47,51,52,54,55,56,57,58,59,60,61,65,66,68,69,73,74,75,31,33,78,79,80,81,83, + 26,44,46,65, + 0,9,15,34,51,71,72,73,79,83, + 12, + 52,74, + 43,44,59,83, + 56, + 0,15,22,47,48,49,55,56,59,65,67,82, + 76, + 12,15,32,51,59,83, + 12,59, + 0,1,2,4,50,5,6,7,9,10,12,13,14,15,17,20,21,22,23,25,26,27,28,34,35,36,38,39,30,42,45,46,47,48,49,52,53,54,55,56,58,59,60,61,62,63,64,65,67,70,71,72,73,74,75,77,31,78,83, + 59,65, + 32, 7, - 37,29, - 78,80, - 64, - 49, - 50, - 50, - 7,19,22,42,50,69,76,77, - 58, - 0,14,44,45,60,74, - 0,1,2,49,7,9,11,12,13,14,15,16,18,19,20,21,22,23,24,26,27,28,33,34,35,38,41,44,45,46,47,48,51,52,53,54,55,57,59,60,61,62,63,64,65,66,68,69,70,71,72,32,30,74,75,76,77,79,80,82, - 50,64, - 52, - 42,66, - 42, - 19,22,42,66, - 56, + 38,30, + 79,81, + 65, + 50, + 51, + 10,51, + 7,20,23,43,51,70,77,78, + 59, + 0,15,45,46,61,75, + 0,1,2,50,7,9,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,42,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,33,78,80,81,83, + 51,65, + 53, + 10, + 43,67, + 43, + 20,23,43,67, + 57, 5, 5, 5, 3, - 3,4,17,36,39,56,58,73, - 3,6,8,17,56,58,67,73, + 3,4,8,18,37,40,57,59,74, + 3,6,8,18,37,57,59,68,74, 8, 3, 8, - 8, - 8, - 3,6,8,17,56,58,67,73, - 4,39, - 3,8,17,58,67,73, - 3,8,17,73, - 3,8,17,73, + 3,6,8,18,37,57,59,68,74, + 4,40, + 3,8,18,37,59,68,74, + 3,8,18,74, + 3,8,18,74, 3, - 8,17, - 8,17, - 56, - 8,17, + 8,18, + 8,18, + 57, + 8,18, 8, - 50, - 7,41,42,64, - 0,14,55,64, - 4,15,34,58,64,66,75,78,80, - 64, - 64, + 51, + 7,42,43,65, + 0,15,56,65, + 4,16,35,59,65,67,76,79,81, + 65, + 65, 0, - 16,19,50, - 4,52, + 17,20,51, + 4,53, 4, 4, 4, - 20,41,46,54,66, - 17,53, - 53, - 4,25,52,73, - 66, - 46,58,73, - 45, - 17,53, - 45,50,64, - 2,3,4,44,50,52,54,66,73,81,82, - 28,66,67,73,81, + 5,21,42,44,47,55,67, + 18,54, + 54, + 4,26,53,74, + 67, + 47,59,74, + 46, + 18,54, + 46,51,65, + 2,3,4,45,51,53,55,67,74,82,83, + 29,67,68,74,82, 3, 3, 3, - 31, + 32, 2, - 50,78, - 0,1,3,4,49,7,8,13,14,17,19,20,22,23,24,27,36,39,41,42,43,44,46,50,51,54,55,58,61,64,66,67,69,32,73,74,76,77,82, - 1,3,7,8,13,23,27,41,54,74,77, - 1,3,7,8,13,23,27,41,54,74,77, - 1,3,8,13,54, + 51,79, + 0,1,3,4,50,7,8,14,15,18,20,21,23,24,25,28,37,40,42,43,44,45,47,51,52,55,56,59,62,65,67,68,70,74,75,77,33,78,83, + 1,3,7,8,14,24,28,42,55,75,78, + 1,3,7,8,14,24,28,42,55,75,78, + 1,3,8,14,55, 3,8, 3, - 43,32, - 3,20, - 15,80, - 0,45,50,55,64,73,81, - 64, - 28, - 64, - 5,20,57,64,32, - 58,63, - 66, - 42,50, - 78, - 42, - 50, - 64,66, - 7,19,22,37,29,56,69,76, - 43,58,32, - 17,27,36,58,73, - 73, - 36,73, - 17, - 17, - 64, - 14,58,64,70, - 58,64, - 2,9,14,16,21,26,33,35,44,46,47,48,51,52,57,60,61,62,63,64,70,73,74, - 39, - 46,81, - 43, - 5,57, - 5,57, - 43,32, - 64, - 0,1,2,49,7,9,11,12,13,14,15,16,18,19,20,21,22,23,24,26,27,28,33,34,35,38,41,44,45,46,47,48,50,51,52,53,54,55,57,59,60,61,62,63,64,65,66,68,69,70,71,72,30,74,75,76,77,79,80,82, - 58, + 44,33, + 3,21, + 16,81, + 0,46,51,56,65,74,82, + 65, + 29, + 65, + 5,21,58,65,33, + 59,64, + 67, + 43,51, + 79, + 43, + 51, + 65,67, + 7,20,23,38,30,57,70,77, + 44,59,33, + 18,28,37,59,74, + 74, + 37,74, + 18, + 18, + 65, + 15,59,65,71, + 59,65, + 2,9,15,17,22,27,34,36,45,47,48,49,52,53,58,61,62,63,64,65,71,74,75, + 40, + 10, + 47,82, + 44, + 5,58, + 5,58, + 44,33, + 65, + 0,1,2,50,7,9,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,42,45,46,47,48,49,51,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,78,80,81,83, + 59, 2, - 3,17,36,58,73, - 73, - 17,36,73, - 3,17,36,58,73, - 58, - 32, - 3,4,17,36,58,73, + 3,18,37,59,74, + 74, + 18,37,74, + 3,18,37,59,74, + 59, + 33, + 3,4,18,37,59,74, 8, 8, 8, @@ -988,348 +1001,353 @@ 8, 8, 8, - 8, - 49,8,54,32, - 33,36,67, - 82, - 3,9,13,19,22,24,33,66,69,73,76, - 3,19,24,76, - 6,19,56,58,73, - 19,56, - 56, - 24,76, - 24,76, - 39,43,58, - 0,25,37,29,31,75, - 78, - 52, - 78, - 64, - 42,55, - 78, - 55, - 66, - 73, - 80, - 50,80, - 45, - 50, - 39,44,45,50,58,60,64,70,71,72,74,82, - 39,82, - 52, - 78, - 0,11,12,14,37,38,29,58,63,64,70,71,72, - 46,48, - 50,54, - 50, - 64,31, - 64, - 64, - 58, - 50, - 50, - 38,66, - 50, - 64, - 0,1,2,4,49,5,6,7,9,11,12,13,14,16,18,19,20,21,22,23,24,25,26,27,28,33,34,35,38,41,44,46,47,48,50,51,52,53,54,55,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,32,73,74,76,77,79,82, - 64, - 12, - 25,26,43,50,32,82, - 46,60, - 17,59,64, - 15,45,78,80, - 64, - 73, - 73, - 46,50,59,60,73, - 46,50,58,60,73, - 64, - 43,58, - 11,13,14,17,47,58,61,70,71,72,82, - 16,35,62, - 16,35,62, - 3,4,5,6,8,10,17,36,37,39,29,43,56,58,67,73, - 46,64,66,73,82, - 64, - 32, - 50,31, - 61,73, - 50, - 0,1,2,49,7,9,11,12,13,14,15,16,18,19,20,21,22,23,24,26,27,28,33,34,35,38,41,44,45,46,47,48,51,52,53,54,55,57,59,60,61,62,63,64,65,66,68,69,70,71,72,32,30,74,75,76,77,79,80,82, - 45,50,80, - 31, - 7,13,19,22,42,44,45,47,48,52,54,55,64,67,69,30,74,76,77,81, - 2,6,50,62,30, - 58, - 64,66, - 0,1,2,4,7,9,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,33,34,35,38,39,41,42,44,45,46,47,48,50,51,52,53,54,55,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,32,31,74,76,77,78,79,80,81,82, - 33,66,81,82, - 52, - 30, - 20,27,53,59, - 0,14,26,28,36,46,51,55,81, - 10,15, - 3,4,5,6,8,10,17,36,56,58,67,73,80, - 3,10,36,67,75, - 58,63, - 5,39,58,78, - 78,80, - 0,2,4,9,11,12,14,16,18,21,25,27,33,34,35,37,38,39,29,40,43,44,45,46,48,50,51,52,53,57,58,59,60,61,62,63,64,70,71,72,32,73,74,75,78,82, - 32,30, - 32,30, - 17, - 25, - 33,36,39,58,73,82, - 73, - 73, - 12, - 64, - 12,18,36,51,65,68,80, - 49,27,36,51,53,59,65,68, - 45,55,79,82, - 15,80, - 28, - 27,41,70,71,32, - 50,32, - 42, - 54, - 51, - 54, - 42, - 46,47,48, - 28, - 49,8, - 9,54,64, - 36,66,67, - 36, - 36,67, - 36,67, - 36, - 82, - 50,64, - 28,45, - 49,7,8,19,22,25,27,36,47,51,53,59,68,69,76, + 50,8,55,33, + 33, + 34,37,68, + 83, + 3,9,14,20,23,25,34,67,70,74,77, + 3,20,25,77, + 6,20,57,59,74, + 20,57, + 57, + 25,77, + 25,77, + 40,44,59, + 0,26,38,32,30,76, + 79, + 53, + 79, + 65, + 43,56, + 79, + 56, + 67, + 81, + 51,81, + 46, + 51, + 40,45,46,51,59,61,65,71,72,73,75,83, + 40,83, + 53, + 79, + 0,10,12,13,15,38,39,30,59,64,65,71,72,73, + 47,49, + 51,55, + 51, + 32,65, + 65, + 65, + 59, + 51, + 51, + 39,67, + 51, + 65, + 0,1,2,4,50,5,6,7,9,10,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,42,45,47,48,49,51,52,53,54,55,56,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,74,75,77,33,78,80,83, + 65, + 13, + 26,27,44,51,33,83, + 10,47,61, + 18,60,65, + 16,46,79,81, + 65, + 74, + 74, + 47,51,60,61,74, + 47,51,59,61,74, + 65, + 44,59, + 12,14,15,18,37,48,59,62,71,72,73,83, + 17,36,63, + 17,36,63, + 3,4,5,6,8,11,18,37,38,40,30,44,57,59,68,74, + 47,65,67,74,83, + 65, + 33, + 32,51, + 62,74, + 51, + 0,1,2,50,7,9,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,42,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,33,78,80,81,83, + 46,51,81, + 32, + 7,14,20,23,28,43,45,46,48,49,53,55,56,65,68,70,75,77,31,78,82, + 2,6,51,63,31, + 59, + 65,67, + 0,1,2,4,7,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,40,32,42,43,45,46,47,48,49,51,52,53,54,55,56,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,33,78,79,80,81,82,83, + 34,67,82,83, + 53, + 31, + 21,28,54,60, + 0,15,27,29,37,47,52,56,82, + 11,16, + 3,4,5,6,8,11,18,37,57,59,68,74,81, + 3,11,37,68,74,76, + 59,64, + 5,40,59,79, + 79,81, + 0,2,4,9,10,12,13,15,17,19,22,26,28,34,35,36,37,38,39,40,30,41,44,45,46,47,49,51,52,53,54,58,59,60,61,62,63,64,65,71,72,73,74,75,76,33,79,83, + 31,33, + 31,33, + 18,37, + 26, + 34,37,40,59,74,83, + 74, + 74, + 13, + 65, + 13,19,37,52,66,69,81, + 50,10,28,37,52,54,60,66,69, + 46,56,80,83, + 16,81, + 29, + 42,71,72,33, + 51,33, + 43, + 55, + 52, + 55, + 43, + 47,48,49, + 29, + 50,8, + 9,55,65, + 37,67,68, + 37, + 37,68, + 37,68, + 37, + 83, + 51,65, + 29,46, + 50,7,8,20,23,26,28,37,48,52,54,60,69,70,77, 8, 8, - 25, - 59, - 13,20,54,55,32,77, - 0,7,9,14,33,42,47,58,64,72,73, - 49, - 0,60, - 5,6,10,56,69,73, - 56, - 56, - 56, - 3,20, - 0,64, - 64, - 64, - 64, - 64, - 43, - 49, - 15,78, - 1,27,45,66,74,77, - 37,29,46,48,31, - 48, - 48, - 64, - 66, - 50, - 64, - 3,4,5,6,8,17,36,56,58,67,73, - 25,50,58,71,82, - 58, - 39, - 32, - 25,82, - 25, - 25, - 25,36,39,58,73, - 25, - 82, - 25, - 45, - 43, - 58, - 58,70,71,72, - 58,70, - 58,71, - 58,72, - 28,34,43,51,64,32,73, - 64, - 64, - 73, - 44,73, - 44, - 19,22,42,45,69,73,81, - 7,27,39,50,69, - 64, - 64,66, - 64, - 26,66, - 50, - 49, - 66,67, - 64, - 45, - 7,25,50,64,70,79,82, - 45, - 66, - 38,58, - 45, - 38, + 26, + 60, + 14,21,55,56,33,78, + 0,7,9,15,34,43,48,59,65,73,74, + 50, + 0,61, + 5,6,11,57,70,74, + 57, + 57, + 57, + 3,21, + 0,65, + 65, + 65, + 65, + 65, + 44, + 50, + 16,79, + 1,28,46,67,75,78, + 38,32,30,47,49, + 49, + 49, + 65, + 67, + 51, + 65, + 3,4,5,6,8,18,37,57,59,68,74, + 26,51,59,72,83, + 59, + 40, + 33, + 26,83, + 26, + 26, + 26,37,40,59,74, + 26, + 83, + 26, + 46, + 44, + 59, + 59,71,72,73, + 59,71, + 59,72, + 59,73, + 29,35,44,52,65,74,33, + 65, + 65, + 74, + 45,74, + 45, + 20,23,43,46,70,74,82, + 7,10,28,40,51,70, + 65, + 65,67, + 65, + 27,67, + 51, + 33, + 50, + 67,68, + 65, + 46, + 33, + 7,26,51,65,71,80,83, + 46, + 67, + 39,59,33, + 46, + 39, 7, - 1,3,13,17,20,36,42,44,54,55,67,73,81, - 64,75, - 20,46,48,55,73, - 64, - 82, - 43, - 17,34, - 17,34, - 14,34,38,43,58,64,32, - 64, - 58,64, - 43,52,32, - 50, + 1,3,14,18,21,37,43,45,55,56,68,74,82, + 65,76, + 21,47,49,56,74, + 65, + 83, + 44, + 18,35, + 18,35, + 15,35,39,44,59,65,33, + 65, + 59,65, + 44,53,33, + 51,54, 5, 5, - 56,76, - 56, - 56, - 56, - 73, - 73, - 5,16,47,61,73, + 33, + 57,77, + 57, + 57, + 57, + 74, + 74, + 5,17,48,62,74, 5, - 5,9,33,37,29,44,45,46,47,48,50,51,60,61,73,74, - 45,46,48,51,73,74, - 46,47,48,73,74, - 73, - 73, - 73, - 10,75,78, - 75,80, - 50, - 50, - 3,4,54, - 0,14,52,58,32, - 19, - 28, - 36,67, - 0,1,2,49,7,9,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,33,34,35,38,41,42,44,45,46,47,48,51,52,53,54,55,57,59,60,61,62,63,64,65,66,68,69,70,71,72,32,30,74,75,76,77,78,79,80,82, - 32, - 0,3,4,49,7,8,9,12,16,17,19,23,35,36,38,39,45,46,47,48,52,64,67,69,32,73,76,81,82, - 20,25,26,52,64,66,32,30,82, - 64, - 14,64, - 39, - 15,19,80, - 78, - 5,39,58, - 2,49,14,25,26,34,37,29,45,47,50,64,66,72,32,30,75,82, - 0,1,2,49,7,9,11,12,13,14,15,16,18,19,20,21,22,23,24,26,27,28,33,34,35,38,41,44,45,46,47,48,51,52,53,54,55,57,59,60,61,62,63,64,65,66,68,69,70,71,72,30,74,75,76,77,78,79,80,82, - 6,56,58,73, - 49, - 49, - 49, - 49, + 5,9,34,38,30,45,46,47,48,49,51,52,61,62,74,75, + 46,47,49,52,74,75, + 47,48,49,74,75, + 74, + 74, + 74, + 11,76,79, + 76,81, + 51, + 51, + 3,4,55, + 0,15,53,59,33, + 20, + 29, + 37,68, + 0,1,2,50,7,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,42,43,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,33,78,79,80,81,83, + 33, + 0,3,4,50,7,8,9,13,17,18,20,24,36,37,39,40,46,47,48,49,53,65,68,70,74,77,33,82,83, + 21,26,27,53,65,67,31,33,83, + 65, + 10, + 15,65, + 40, + 16,20,81, + 79, + 5,40,59, + 2,50,15,26,27,35,38,30,46,48,51,65,67,73,76,31,33,83, + 0,1,2,50,7,9,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,42,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,78,79,80,81,83, + 6,57,59,74, + 50, + 50, + 50, + 50, 0, - 43,58,32, - 32, - 0,2,7,9,14,19,22,27,33,38,40,42,43,45,46,48,51,54,58,59,63,64,66,69,32,74,76,77, - 25, - 64, - 3,4,6,13,17,19,22,24,27,36,41,42,44,46,48,54,56,58,59,60,64,66,67,73,74,76,77,81, - 3,67, - 3,17, - 17, - 17, - 3,17, - 17, - 17, - 17, - 64, - 3,4,6,13,14,17,19,22,23,24,27,43,44,53,54,55,56,58,59,61,69,32,73,76, - 55, - 23, - 23, - 32, - 32, - 1,3,49,5,7,8,14,17,23,25,36,39,41,54,56,58,67,73,74,77, - 49,7,27,28,41,50,66,69,31, - 64, - 0,9,10,14,33,42,50,70,71,72,32,78,79,80,82, - 50, - 50, - 43,32, - 73, - 73, - 73, - 73, - 73, - 3,17,36,58,73, + 44, + 44, + 44,59,33, + 33, + 0,2,7,9,15,20,23,28,34,39,41,43,44,46,47,49,52,55,59,60,64,65,67,70,75,77,33,78, + 26, + 65, + 3,4,6,14,18,20,23,25,28,37,42,43,45,47,49,55,57,59,60,61,65,67,68,74,75,77,78,82, + 3,68, + 3,18, + 18, + 18, + 3,18, + 18, + 18, + 18, + 65, + 3,4,6,14,15,18,20,23,24,25,28,37,44,45,54,55,56,57,59,60,62,70,74,77,33, + 56, + 24, + 24, + 33, + 33, + 1,3,50,5,7,8,15,18,24,26,28,37,40,42,55,57,59,68,74,75,78, + 50,7,29,32,42,51,67,70, + 65, + 0,9,11,15,34,43,51,71,72,73,33,79,80,81,83, + 51, + 51, + 44,33, + 74, + 74, + 74, + 74, + 74, + 3,18,37,59,74, 4, - 73, - 58, - 58, + 74, + 59, + 59, 2, 2,4, - 7,25,27,41,44,46,69,82, + 7,26,28,42,45,47,70,83, 2,4, - 64, - 67, - 43, - 43,32, - 32, - 11,17,43,64,80, - 28,32, - 37,29, - 0,1,2,49,7,9,11,12,13,14,16,18,19,20,21,22,23,24,25,26,27,28,33,34,35,38,41,42,44,45,46,47,48,50,51,52,53,54,55,57,59,60,61,62,63,64,65,66,68,69,70,71,72,31,74,76,77,79,82, - 3,49,11,14,17,25,27,28,36,43,53,58,59,66,67,71,72,73,79, - 58, - 58, - 17, - 17, - 78,80, - 25,50,31, - 14,40,78, - 58, - 37,29,46,50,64,66,81,82, - 66, - 36,67, - 3,7,24,42,45,55,66,69,32, + 65,33, + 68, + 44, + 44,33, + 33, + 12,18,37,44,65,81, + 29,33, + 38,30, + 0,1,2,50,7,9,10,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,32,42,43,45,46,47,48,49,51,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,78,80,83, + 3,50,12,15,18,26,28,29,37,44,54,59,60,67,68,72,73,74,80, + 59, + 59, + 18, + 18, + 79,81, + 10,26,32,51, + 15,41,79, + 59, + 38,30,47,51,65,67,82,83, + 67, + 37,68, + 3,7,25,43,46,56,67,70,33, 7, 7, - 42, - 42, - 42, - 43,32, - 43,32, - 66, - 81, + 43, + 43, + 43, + 44,33, + 44,33, + 67, + 82, 5, 5, - 3,7,24,42,55,66,69,32, + 3,7,25,43,56,67,70,33, 7, 7, - 42, - 42, - 42, - 43,32, - 43,32, - 15,34,63,71,32,31,78,81,82, - 42, + 43, + 43, + 43, + 44,33, + 44,33, + 16,32,64,72,79,82,83, + 43, 5, 5, - 2,3,7,42,55,69,32, + 2,3,7,43,56,70,33, 7, 7, - 19, - 43,32, - 43,32, - 50, + 20, + 44,33, + 44,33, + 51, diff --git a/doc/salome/gui/GEOM/whxdata/whtdata0.xml b/doc/salome/gui/GEOM/whxdata/whtdata0.xml index 346d9371b..7067bbd57 100755 --- a/doc/salome/gui/GEOM/whxdata/whtdata0.xml +++ b/doc/salome/gui/GEOM/whxdata/whtdata0.xml @@ -27,7 +27,7 @@ - + @@ -90,10 +90,12 @@ + - + + diff --git a/doc/salome/gui/GEOM/working_plane.htm b/doc/salome/gui/GEOM/working_plane.htm index 2f5b6d645..0ee62e910 100755 --- a/doc/salome/gui/GEOM/working_plane.htm +++ b/doc/salome/gui/GEOM/working_plane.htm @@ -17,7 +17,7 @@ if (navigator.appName !="Netscape") img_whs1 { width:20px; height:20px; border-style:none; } p.whs2 { font-size:12pt; } p.whs3 { font-size:12pt; margin-left:40px; } -img_whs4 { border:none; width:312px; height:231px; float:none; border-style:none; } +img_whs4 { border:none; width:400px; height:231px; float:none; } img_whs5 { border:none; width:312px; height:266px; float:none; border-style:none; } img_whs6 { border:none; width:312px; height:274px; float:none; border-style:none; } --> @@ -93,14 +93,17 @@ if (window.writeIntopicBar)

 

-

Firstly, you can select a Plane - or a Planar Face to be your Working Plane

+

Firstly, you can select a Plane, a Planar + Face or a Local Coordinate System + to be your Working Plane

-

Arguments: - Name + 1 selection (face or planar face),

+

Arguments: Name + 1 selection (face + or planar face),

+ +

 

-

+

 

diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index d5d18f0fa..6094c841e 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -339,7 +339,7 @@ module GEOM /*! * Create a plane, similar to the existing one, but with another size of representing face. - * \param theFace Referenced plane. + * \param theFace Referenced plane or LCS(Marker). * \param theTrimSize New half size of a side of quadrangle face, representing the plane. * \return New GEOM_Object, containing the created plane. */ @@ -616,15 +616,31 @@ module GEOM in double theFactor); /*! - * Modify the Location of the given object by LCS + * Modify the Location of the given object by LCS. + * \param theObject The object to be displaced. + * \param theStartLCS Coordinate system to perform displacement from it. + * If \a theStartLCS is NULL, displacement + * will be performed from global CS. + * If \a theObject itself is used as \a theStartLCS, + * its location will be changed to \a theEndLCS. + * \param theEndLCS Coordinate system to perform displacement to it. + * \return theObject. */ GEOM_Object PositionShape (in GEOM_Object theObject, in GEOM_Object theStartLCS, in GEOM_Object theEndLCS); /*! - * Modify the Location of the given object by LCS - * creating its copy before the setting + * Modify the Location of the given object by LCS, + * creating its copy before the setting. + * \param theObject The object to be displaced. + * \param theStartLCS Coordinate system to perform displacement from it. + * If \a theStartLCS is NULL, displacement + * will be performed from global CS. + * If \a theObject itself is used as \a theStartLCS, + * its location will be changed to \a theEndLCS. + * \param theEndLCS Coordinate system to perform displacement to it. + * \return New GEOM_Object, containing the displaced shape. */ GEOM_Object PositionShapeCopy (in GEOM_Object theObject, in GEOM_Object theStartLCS, @@ -868,7 +884,7 @@ module GEOM /*! * Create a face on the given wire. - * \param theWire Wire to build the face on. + * \param theWire closed Wire or Edge to build the face on. * \param isPlanarWanted If TRUE, only planar face will be built. * If impossible, NULL object will be returned. * \return New GEOM_Object, containing the created face. @@ -877,7 +893,7 @@ module GEOM /*! * Create a face on the given wires set. - * \param theWires List of wires to build the face on. + * \param theWires List of closed wires or edges to build the face on. * \param isPlanarWanted If TRUE, only planar face will be built. * If impossible, NULL object will be returned. * \return New GEOM_Object, containing the created face. @@ -1037,6 +1053,24 @@ module GEOM in long theShapeType, in GEOM_Object theAx1, in shape_state theState); + /*! + * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively + * the specified plane by the certain way, defined through \a theState parameter. + * \param theShape Shape to find sub-shapes of. + * \param theShapeType Type of sub-shapes to be retrieved. + * \param theAx1 Vector (or line, or linear edge), specifying normal + * direction of the plane to find shapes on. + * \param thePnt Point specifying location of the plane to find shapes on. + * \param theState The state of the subshapes to find. + * \return List of all found sub-shapes. + */ + ListOfGO GetShapesOnPlaneWithLocation (in GEOM_Object theShape, + in long theShapeType, + in GEOM_Object theAx1, + in GEOM_Object thePnt, + in shape_state theState); + + /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -1105,6 +1139,23 @@ module GEOM in long theShapeType, in GEOM_Object theAx1, in shape_state theState); + + /*! + * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively + * the specified plane by the certain way, defined through \a theState parameter. + * \param theShape Shape to find sub-shapes of. + * \param theShapeType Type of sub-shapes to be retrieved. + * \param theAx1 Vector (or line, or linear edge), specifying normal + * direction of the plane to find shapes on. + * \param thePnt Point specifying location of the plane to find shapes on. + * \param theState The state of the subshapes to find. + * \return List of IDs of all found sub-shapes. + */ + ListOfLong GetShapesOnPlaneWithLocationIDs (in GEOM_Object theShape, + in long theShapeType, + in GEOM_Object theAx1, + in GEOM_Object thePnt, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -1667,7 +1718,7 @@ module GEOM * For format of the description string see the previous method.\n * \param theCommand String, defining the sketcher in local * coordinates of the working plane. - * \param theWorkingPlane Planar Face of the working plane. + * \param theWorkingPlane Planar Face or LCS(Marker) of the working plane. * \return New GEOM_Object, containing the created wire. */ GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane); @@ -1894,6 +1945,15 @@ module GEOM boolean GetFreeBoundary (in GEOM_Object theObject, out ListOfGO theClosedWires, out ListOfGO theOpenWires); + + /*! + * Change orientation of the given object. + * \param theObject Shape to be processed. + * \return New GEOM_Object, containing processed shape. + */ + GEOM_Object ChangeOrientation (in GEOM_Object theObject); + GEOM_Object ChangeOrientationCopy (in GEOM_Object theObject); + }; /*! @@ -1952,6 +2012,22 @@ module GEOM */ interface GEOM_IMeasureOperations : GEOM_IOperations { + /*! + * Get position (LCS) of theShape. + * \param theShape Shape to calculate position of. + * \param Ox,Oy,Oz Output. Coordinates of shape's location origin. + * Origin of the LCS is situated at the shape's center of mass. + * \param Zx,Zy,Zz Output. Coordinates of shape's location normal(main) direction. + * \param Xx,Xy,Xz Output. Coordinates of shape's location X direction. + * Axes of the LCS are obtained from shape's location or, + * if the shape is a planar face, from position of its plane. + * \return Returns position of the shape through the last nine arguments. + */ + void GetPosition (in GEOM_Object theShape, + out double Ox, out double Oy, out double Oz, + out double Zx, out double Zy, out double Zz, + out double Xx, out double Xy, out double Xz); + /*! * Get summarized length of all wires, * area of surface and volume of the given shape. @@ -2021,6 +2097,15 @@ module GEOM boolean CheckShape (in GEOM_Object theShape, out string theDescription); + /*! + * Check a topology and a geometry of the given shape. + * \param theShape Shape to check validity of. + * \param theDescription Output. Description of problems in the shape, if they are. + * \return TRUE, if the shape "seems to be valid". + */ + boolean CheckShapeWithGeometry (in GEOM_Object theShape, + out string theDescription); + /*! * Obtain description of the given shape * \param theShape Shape to be described. diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 6fa3c613d..3c3b60aed 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -6,12 +6,17 @@
- +
- - - + + + + + + + +
diff --git a/resources/change_orientation.png b/resources/change_orientation.png new file mode 100755 index 0000000000000000000000000000000000000000..a2ce2c9509544ac69f59213e473ebc3a5c6558cd GIT binary patch literal 509 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VOS+@4BLl<6zM9{GlYxANWRD>fq}8Z)5S5QVouVZ|Nrfo zO&J{+3?EKSO;NdN*1&KmSK*9-5HBl-!X37M|Ic?g33DkiI0y>JzTwVf`tP^ zq6CLI4?ly{F@yALGOge9?->_-Dlpbb-b01slEwswLS3E4s_T0Oo0?DgsKq6%0cV zY@Ei-lm+ujG(=V7u#MslBY}Hk)`Hd^?p>b{CRl&(6AlyZv{Tbh6$H~xy@wSA9{4E> z==AdLokhhdhfaQz)r+}(ywcx$9~kc77PNH`Y72AD#T{y=mV=~VZPUhk_$ciBe2y&1 z&b5ib+NO=C58s2$)66)HS!f8mzFj5SLsvQKrsl#W3#?s@YupM0_yHX`X-IO8Ib{F< N002ovPDHLkV1iKaf=K`X literal 0 HcmV?d00001 diff --git a/src/BasicGUI/BasicGUI.cxx b/src/BasicGUI/BasicGUI.cxx index d28511706..41b484848 100644 --- a/src/BasicGUI/BasicGUI.cxx +++ b/src/BasicGUI/BasicGUI.cxx @@ -57,15 +57,6 @@ using namespace std; -//======================================================================= -// function : GetBasicGUI() -// purpose : Get the only BasicGUI object [ static ] -//======================================================================= -BasicGUI* BasicGUI::GetBasicGUI( GeometryGUI* parent ) -{ - return new BasicGUI( parent ); -} - //======================================================================= // function : BasicGUI() // purpose : Constructor @@ -146,38 +137,41 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox(); // Create Point dialog, OCC viewer - if ( aDlg && aDlg->isA( "BasicGUI_PointDlg" ) && theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() && pe->state() != Qt::ControlButton ) + if ( aDlg && aDlg->isA( "BasicGUI_PointDlg" ) && + theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() && + pe->state() != Qt::ControlButton ) { BasicGUI_PointDlg* aPntDlg = (BasicGUI_PointDlg*) aDlg; if ( aPntDlg->acceptMouseEvent() ) + { + OCCViewer_Viewer* anOCCViewer = + ((OCCViewer_ViewManager*)(theViewWindow->getViewManager()))->getOCCViewer(); + Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext(); + + gp_Pnt aPnt; + + ic->InitSelected(); + if ( pe->state() == Qt::ShiftButton ) + ic->ShiftSelect(); // Append selection + else + ic->Select(); // New selection + + ic->InitSelected(); + if ( ic->MoreSelected() ) { - OCCViewer_Viewer* anOCCViewer = ((OCCViewer_ViewManager*)(theViewWindow->getViewManager()))->getOCCViewer(); - Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext(); - - gp_Pnt aPnt; - - ic->InitSelected(); - if( pe->state() == Qt::ShiftButton ) - ic->ShiftSelect(); // Append selection - else - ic->Select(); // New selection - - ic->InitSelected(); - if( ic->MoreSelected() ) - { - TopoDS_Shape aShape = ic->SelectedShape(); - if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) - aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) ); - } - else - { - OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort(); - aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() ); - } - - aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog - } // acceptMouseEvent() - } + TopoDS_Shape aShape = ic->SelectedShape(); + if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) + aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) ); + } + else + { + OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort(); + aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() ); + } + + aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog + } // acceptMouseEvent() + } return false; } @@ -216,6 +210,6 @@ extern "C" GEOM_BASICGUI_EXPORT GEOMGUI* GetLibGUI( GeometryGUI* parent ) { - return BasicGUI::GetBasicGUI( parent ); + return new BasicGUI( parent ); } } diff --git a/src/BasicGUI/BasicGUI.h b/src/BasicGUI/BasicGUI.h index 0822236d6..73a16e6bd 100644 --- a/src/BasicGUI/BasicGUI.h +++ b/src/BasicGUI/BasicGUI.h @@ -40,15 +40,10 @@ //================================================================================= class GEOM_BASICGUI_EXPORT BasicGUI : public GEOMGUI { -protected: - BasicGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation - public: + BasicGUI( GeometryGUI* parent ); ~BasicGUI(); - // Get the only BasicGUI object - static BasicGUI* GetBasicGUI( GeometryGUI* parent ); - bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); bool OnMousePress(QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow); diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index 5bd907f71..ce76529d0 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -125,7 +125,7 @@ void BasicGUI_CircleDlg::Init() double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); /* min, max, step and decimals for spin boxes & initial values */ - GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, aStep, 3); + GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3); GroupPntVecR->SpinBox_DX->SetValue( 100 ); /* signals and slots connections */ diff --git a/src/BasicGUI/BasicGUI_CircleDlg.h b/src/BasicGUI/BasicGUI_CircleDlg.h index 82b87f137..fb0f51315 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.h +++ b/src/BasicGUI/BasicGUI_CircleDlg.h @@ -40,7 +40,7 @@ // class : BasicGUI_CircleDlg // purpose : //================================================================================= -class BasicGUI_CircleDlg : public GEOMBase_Skeleton +class GEOM_BASICGUI_EXPORT BasicGUI_CircleDlg : public GEOMBase_Skeleton { Q_OBJECT diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index 0aa2d0da7..ba6db7d30 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -114,8 +114,8 @@ void BasicGUI_EllipseDlg::Init() double aMajorR( 200. ), aMinorR( 100. ); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, 999.999, step, 3 ); - GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, 999.999, step, 3 ); + GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 ); + GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 ); GroupPoints->SpinBox_DX->SetValue( aMajorR ); GroupPoints->SpinBox_DY->SetValue( aMinorR ); diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.cxx b/src/BasicGUI/BasicGUI_MarkerDlg.cxx index 521d2a742..99e7ff9a5 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.cxx +++ b/src/BasicGUI/BasicGUI_MarkerDlg.cxx @@ -1,23 +1,23 @@ // GEOM GEOMGUI : GUI for Geometry component // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -37,21 +37,21 @@ #include #include "GEOMImpl_Types.hxx" + #include "utilities.h" +// OCCT Includes +#include #include #include #include #include #include -#include +#include #include -#include +#include #include #include -#include -#include -#include //================================================================================= // class : BasicGUI_MarkerDlg() @@ -114,13 +114,13 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th myData[ DY2 ] = new DlgRef_SpinBox( anYAxisGrp ); new QLabel( tr( "DZ" ), anYAxisGrp ); myData[ DZ2 ] = new DlgRef_SpinBox( anYAxisGrp ); - + Layout1->addWidget( aMainGrp, 2, 0 ); Layout1->addWidget( Group1, 2, 0 ); Layout1->addWidget( Group2, 2, 0 ); setHelpFileName("local_coordinate_system.htm"); - + Init(); } @@ -147,7 +147,7 @@ void BasicGUI_MarkerDlg::Init() Group2->LineEdit1->setReadOnly( true ); Group2->LineEdit2->setReadOnly( true ); Group2->LineEdit3->setReadOnly( true ); - + connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); @@ -166,17 +166,17 @@ void BasicGUI_MarkerDlg::Init() connect( buttonOk, SIGNAL( clicked() ), this, SLOT( onOk() ) ); connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onApply() ) ); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) ); initName( tr( "LCS_NAME" ) ); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); - + for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter ) { - anIter.data()->RangeStepAndValidator( -999.999, 999.999, step, 3 ); + anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 ); connect( anIter.data(), SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged( double ) ) ); } @@ -243,7 +243,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId ) { Group2->hide(); aMainGrp->hide(); - resize(0, 0); + //PAL6669: resize(0, 0); Group1->show(); globalSelection( GEOM_ALLGEOM ); @@ -255,7 +255,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId ) { aMainGrp->hide(); Group1->show(); - resize(0, 0); + //PAL6669: resize(0, 0); Group2->show(); globalSelection( GEOM_POINT ); @@ -267,7 +267,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId ) } } - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionDone())); onSelectionDone(); } @@ -302,7 +302,7 @@ bool BasicGUI_MarkerDlg::onApply() initName(); ConstructorsClicked( getConstructorId() ); - + return true; } @@ -314,16 +314,18 @@ void BasicGUI_MarkerDlg::onSelectionDone0() { if ( IObjectCount() == 1 ) { - Standard_Boolean aRes = Standard_False; Handle(SALOME_InteractiveObject) anIO = firstIObject(); GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes ); + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + if ( aRes && !aSelectedObj->_is_nil() ) { TopoDS_Shape aShape; if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) { + // Existing LCS selected if ( aSelectedObj->GetType() == GEOM_MARKER && aShape.ShapeType() == TopAbs_FACE ) { TopoDS_Face aFace = TopoDS::Face( aShape ); @@ -347,22 +349,21 @@ void BasicGUI_MarkerDlg::onSelectionDone0() myData[ DX2 ]->SetValue( aYDir.X() ); myData[ DY2 ]->SetValue( aYDir.Y() ); myData[ DZ2 ]->SetValue( aYDir.Z() ); - ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->clearSelected(); + aSelMgr->clearSelected(); } } else { TColStd_IndexedMapOfInteger aMap; - ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap ); + aSelMgr->GetIndexes( anIO, aMap ); if ( aMap.Extent() == 1 ) { int anIndex = aMap( 1 ); TopTools_IndexedMapOfShape aShapes; TopExp::MapShapes( aShape, aShapes ); aShape = aShapes.FindKey( anIndex ); - ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->clearSelected(); + aSelMgr->clearSelected(); } - if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) { @@ -386,12 +387,10 @@ void BasicGUI_MarkerDlg::onSelectionDone0() //================================================================================= void BasicGUI_MarkerDlg::onSelectionDone() { - if ( getConstructorId() == 0 ) - { + if ( getConstructorId() == 0 ) { onSelectionDone0(); return; } - myEditCurrentArgument->setText(""); QString aName; @@ -403,82 +402,60 @@ void BasicGUI_MarkerDlg::onSelectionDone() if ( !CORBA::is_nil( aSelectedObj ) && aRes ) { aName = GEOMBase::GetName( aSelectedObj ); - TopoDS_Shape aShape; - if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) { - GEOM::short_array anIndexes; - - TColStd_IndexedMapOfInteger aMap; - ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap ); - - if ( !aMap.IsEmpty() ) { - int anIndex = aMap( 1 ); - TopTools_IndexedMapOfShape aShapes; - TopExp::MapShapes( aShape, aShapes ); - aShape = aShapes.FindKey( anIndex ); - } - if ( getConstructorId() == 1 ) { - if ( !aShape.IsNull() ) { - gp_Pnt aPnt; - if (aShape.ShapeType() == TopAbs_VERTEX) { - aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape)); - } - else { - GProp_GProps aSystem; - if (aShape.ShapeType() == TopAbs_EDGE || aShape.ShapeType() == TopAbs_WIRE) - BRepGProp::LinearProperties(aShape, aSystem); - else if (aShape.ShapeType() == TopAbs_FACE || aShape.ShapeType() == TopAbs_SHELL) - BRepGProp::SurfaceProperties(aShape, aSystem); - else - BRepGProp::VolumeProperties(aShape, aSystem); - - aPnt = aSystem.CentreOfMass(); - } - - gp_Ax3 anAx3; - anAx3.Transform(aShape.Location().Transformation()); - if(aShape.ShapeType() == TopAbs_FACE) { - Handle(Geom_Surface) aGS = BRep_Tool::Surface( TopoDS::Face( aShape ) ); - if (!aGS.IsNull() && aGS->IsKind( STANDARD_TYPE( Geom_Plane ) ) ) { - Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast( aGS ); - gp_Pln aPln = aGPlane->Pln(); - anAx3 = aPln.Position(); - } - } - - gp_Dir aDirX = anAx3.XDirection(); - gp_Dir aDirY = anAx3.YDirection(); - - myData[ X ]->SetValue( aPnt.X() ); - myData[ Y ]->SetValue( aPnt.Y() ); - myData[ Z ]->SetValue( aPnt.Z() ); - - myData[ DX1 ]->SetValue( aDirX.X() ); - myData[ DY1 ]->SetValue( aDirX.Y() ); - myData[ DZ1 ]->SetValue( aDirX.Z() ); - - myData[ DX2 ]->SetValue( aDirY.X() ); - myData[ DY2 ]->SetValue( aDirY.Y() ); - myData[ DZ2 ]->SetValue( aDirY.Z() ); - - myEditCurrentArgument->setText( aName ); - } - else { - myData[ X ]->SetValue( 0 ); - myData[ Y ]->SetValue( 0 ); - myData[ Z ]->SetValue( 0 ); - - myData[ DX1 ]->SetValue( 0 ); - myData[ DY1 ]->SetValue( 0 ); - myData[ DZ1 ]->SetValue( 0 ); - - myData[ DX2 ]->SetValue( 0 ); - myData[ DY2 ]->SetValue( 0 ); - myData[ DZ2 ]->SetValue( 0 ); - } - } - else if ( getConstructorId() == 2 ) { - if (myEditCurrentArgument == Group2->LineEdit1) { + if ( getConstructorId() == 1 ) { // by shape position + // Get shape's position + CORBA::Double Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz, Yx,Yy,Yz; + Ox = Oy = Oz = Zx = Zy = Xy = Xz = Yx = Yz = 0; + Zz = Xx = Yy = 1.; + + GEOM::GEOM_IMeasureOperations_ptr aMeasureOp = + myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId()); + aMeasureOp->GetPosition(aSelectedObj, Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz); + + // Calculate Y direction + if (aMeasureOp->IsDone()) { + gp_Pnt aPnt (Ox,Oy,Oz); + gp_Dir aDirN (Zx,Zy,Zz); + gp_Dir aDirX (Xx,Xy,Xz); + gp_Ax3 anAx3 (aPnt, aDirN, aDirX); + + gp_Dir aDirY = anAx3.YDirection(); + aDirY.Coord(Yx,Yy,Yz); + } + + // Set values + myData[ X ]->SetValue( Ox ); + myData[ Y ]->SetValue( Oy ); + myData[ Z ]->SetValue( Oz ); + + myData[ DX1 ]->SetValue( Xx ); + myData[ DY1 ]->SetValue( Xy ); + myData[ DZ1 ]->SetValue( Xz ); + + myData[ DX2 ]->SetValue( Yx ); + myData[ DY2 ]->SetValue( Yy ); + myData[ DZ2 ]->SetValue( Yz ); + + myEditCurrentArgument->setText( aName ); + } + else if ( getConstructorId() == 2 ) { // by point and two vectors + TopoDS_Shape aShape; + if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) { + GEOM::short_array anIndexes; + + TColStd_IndexedMapOfInteger aMap; + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + aSelMgr->GetIndexes( anIO, aMap ); + + if ( !aMap.IsEmpty() ) { + int anIndex = aMap( 1 ); + TopTools_IndexedMapOfShape aShapes; + TopExp::MapShapes( aShape, aShapes ); + aShape = aShapes.FindKey( anIndex ); + } + + if (myEditCurrentArgument == Group2->LineEdit1) { if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) { gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); myData[ X ]->SetValue( aPnt.X() ); @@ -497,7 +474,7 @@ void BasicGUI_MarkerDlg::onSelectionDone() gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(aShape))); gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(aShape))); gp_Dir aDir(gp_Vec(aP1, aP2)); - + myData[ DX1 ]->SetValue( aDir.X() ); myData[ DY1 ]->SetValue( aDir.Y() ); myData[ DZ1 ]->SetValue( aDir.Z() ); @@ -514,7 +491,7 @@ void BasicGUI_MarkerDlg::onSelectionDone() gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(aShape))); gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(aShape))); gp_Dir aDir(gp_Vec(aP1, aP2)); - + myData[ DX2 ]->SetValue( aDir.X() ); myData[ DY2 ]->SetValue( aDir.Y() ); myData[ DZ2 ]->SetValue( aDir.Z() ); @@ -535,11 +512,11 @@ void BasicGUI_MarkerDlg::onSelectionDone() myData[ X ]->SetValue( 0 ); myData[ Y ]->SetValue( 0 ); myData[ Z ]->SetValue( 0 ); - + myData[ DX1 ]->SetValue( 0 ); myData[ DY1 ]->SetValue( 0 ); myData[ DZ1 ]->SetValue( 0 ); - + myData[ DX2 ]->SetValue( 0 ); myData[ DY2 ]->SetValue( 0 ); myData[ DZ2 ]->SetValue( 0 ); @@ -560,9 +537,9 @@ void BasicGUI_MarkerDlg::onSelectionDone() myData[ DY2 ]->SetValue( 0 ); myData[ DZ2 ]->SetValue( 0 ); } - } + } } - + displayPreview(); } @@ -573,7 +550,7 @@ void BasicGUI_MarkerDlg::onSelectionDone() void BasicGUI_MarkerDlg::SetEditCurrentArgument() { QPushButton* send = (QPushButton*)sender(); - + if(send == Group1->PushButton1) { myEditCurrentArgument = Group1->LineEdit1; globalSelection( GEOM_ALLGEOM ); @@ -590,7 +567,7 @@ void BasicGUI_MarkerDlg::SetEditCurrentArgument() myEditCurrentArgument = Group2->LineEdit3; globalSelection( GEOM_LINE ); } - + myEditCurrentArgument->setFocus(); onSelectionDone(); } @@ -614,7 +591,7 @@ void BasicGUI_MarkerDlg::LineEditReturnPressed() void BasicGUI_MarkerDlg::onActivate() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) ); ConstructorsClicked( getConstructorId() ); @@ -634,7 +611,7 @@ void BasicGUI_MarkerDlg::onDeactivate() // purpose : //================================================================================= void BasicGUI_MarkerDlg::enterEvent(QEvent* e) -{ +{ if ( !GroupConstructors->isEnabled() ) onActivate(); } @@ -674,8 +651,8 @@ bool BasicGUI_MarkerDlg::isValid( QString& msg ) case 1: return !Group1->LineEdit1->text().isEmpty() && isOk; case 2: - return !Group2->LineEdit1->text().isEmpty() && - !Group2->LineEdit2->text().isEmpty() && + return !Group2->LineEdit1->text().isEmpty() && + !Group2->LineEdit2->text().isEmpty() && !Group2->LineEdit3->text().isEmpty() && isOk; } return false; @@ -734,17 +711,3 @@ void BasicGUI_MarkerDlg::displayPreview ( const bool activate, } } } - - - - - - - - - - - - - - diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index 22975fe58..a48162902 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -1,22 +1,22 @@ // GEOM GEOMGUI : GUI for Geometry component // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // @@ -33,6 +33,8 @@ #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" +#include + #include #include "GEOMImpl_Types.hxx" @@ -41,7 +43,7 @@ using namespace std; //================================================================================= // class : BasicGUI_PlaneDlg() -// purpose : Constructs a BasicGUI_PlaneDlg which is a child of 'parent', with the +// purpose : Constructs a BasicGUI_PlaneDlg which is a child of 'parent', with the // name 'name' and widget flags set to 'f'. // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. @@ -89,20 +91,20 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren Group3Pnts->LineEdit3->setReadOnly( true ); GroupFace = new DlgRef_1Sel1Spin(this, "GroupFace"); - GroupFace->GroupBox1->setTitle(tr("GEOM_FACE")); + GroupFace->GroupBox1->setTitle(tr("GEOM_FACE_OR_LCS")); GroupFace->TextLabel1->setText(tr("GEOM_SELECTION")); GroupFace->TextLabel2->setText(tr("GEOM_PLANE_SIZE")); GroupFace->PushButton1->setPixmap(image3); GroupFace->LineEdit1->setReadOnly( true ); - + Layout1->addWidget(GroupPntDir, 2, 0); Layout1->addWidget(Group3Pnts, 2, 0); Layout1->addWidget(GroupFace, 2, 0); /***************************************************************/ setHelpFileName("plane.htm"); - + Init(); } @@ -112,7 +114,7 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren // purpose : Destroys the object and frees any allocated resources //================================================================================= BasicGUI_PlaneDlg::~BasicGUI_PlaneDlg() -{ +{ } @@ -132,15 +134,15 @@ void BasicGUI_PlaneDlg::Init() /* Get setting of step value from file configuration */ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); - + double aTrimSize = 2000.0; - + /* min, max, step and decimals for spin boxes */ - GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, 10000000.0, aStep, 3 ); + GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, aStep, 3 ); GroupPntDir->SpinBox_DX->SetValue( aTrimSize ); - Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, 10000000.0, aStep, 3); + Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3); Group3Pnts->SpinBox_DX->SetValue( aTrimSize ); - GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, 10000000.0, aStep, 3); + GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3); GroupFace->SpinBox_DX->SetValue( aTrimSize ); /* signals and slots connections */ @@ -196,7 +198,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId) switch ( constructorId ) { case 0: /* plane from a point and a direction (vector, edge...) */ - { + { Group3Pnts->hide(); GroupFace->hide(); resize(0, 0); @@ -225,7 +227,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId) /* for the first argument */ globalSelection( GEOM_POINT ); break; - } + } case 2: /* plane from a planar face selection */ { GroupPntDir->hide(); @@ -237,13 +239,17 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId) GroupFace->LineEdit1->setText(tr("")); /* for the first argument */ - globalSelection( GEOM_PLANE ); + //globalSelection( GEOM_PLANE ); + TColStd_MapOfInteger aMap; + aMap.Add( GEOM_PLANE ); + aMap.Add( GEOM_MARKER ); + globalSelection( aMap ); break; } } myEditCurrentArgument->setFocus(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); } @@ -289,8 +295,8 @@ void BasicGUI_PlaneDlg::ClickOnCancel() void BasicGUI_PlaneDlg::SelectionIntoArgument() { myEditCurrentArgument->setText(""); - - if ( IObjectCount() != 1 ) + + if ( IObjectCount() != 1 ) { if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil(); else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil(); @@ -305,7 +311,7 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument() Standard_Boolean aRes = Standard_False; GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes ); if ( !CORBA::is_nil( aSelectedObject ) && aRes ) - { + { myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) ); if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = aSelectedObject; else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = aSelectedObject; @@ -325,7 +331,7 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument() //================================================================================= void BasicGUI_PlaneDlg::SetEditCurrentArgument() { - QPushButton* send = (QPushButton*)sender(); + QPushButton* send = (QPushButton*)sender(); if ( send == GroupPntDir->PushButton1 ) myEditCurrentArgument = GroupPntDir->LineEdit1; else if ( send == GroupPntDir->PushButton2 ) myEditCurrentArgument = GroupPntDir->LineEdit2; @@ -335,14 +341,19 @@ void BasicGUI_PlaneDlg::SetEditCurrentArgument() else if ( send == GroupFace->PushButton1 ) myEditCurrentArgument = GroupFace->LineEdit1; myEditCurrentArgument->setFocus(); - + if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) globalSelection( GEOM_LINE ); - else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) - globalSelection( GEOM_PLANE ); + else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) { + //globalSelection( GEOM_PLANE ); + TColStd_MapOfInteger aMap; + aMap.Add( GEOM_PLANE ); + aMap.Add( GEOM_MARKER ); + globalSelection( aMap ); + } else - globalSelection( GEOM_POINT ); - + globalSelection( GEOM_POINT ); + SelectionIntoArgument(); } @@ -374,7 +385,7 @@ void BasicGUI_PlaneDlg::LineEditReturnPressed() void BasicGUI_PlaneDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); // myGeomGUI->SetState( 0 ); diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index a194408cc..16b642130 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -157,16 +157,16 @@ void BasicGUI_PointDlg::Init() double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); /* min, max, step and decimals for spin boxes */ - GroupXYZ->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupXYZ->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupXYZ->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupXYZ->SpinBox_DX->SetValue(0.0); GroupXYZ->SpinBox_DY->SetValue(0.0); GroupXYZ->SpinBox_DZ->SetValue(0.0); - GroupRefPoint->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupRefPoint->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupRefPoint->SpinBox_DX->SetValue(0.0); GroupRefPoint->SpinBox_DY->SetValue(0.0); GroupRefPoint->SpinBox_DZ->SetValue(0.0); diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index ab7a81556..48fb526cd 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -118,9 +118,9 @@ void BasicGUI_VectorDlg::Init() double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); /* min, max, step and decimals for spin boxes */ - GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); double dx( 0. ), dy( 0. ), dz( 200. ); GroupDimensions->SpinBox_DX->SetValue( dx ); diff --git a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx index 5fc545257..4522f191d 100644 --- a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -34,24 +34,22 @@ #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" -#include -#include +// OCCT Includes +#include #include -#include #include #include #include -#include #include #include -#include -#include - -#include "GEOMImpl_Types.hxx" +#include +// QT Includes #include #include +#include "GEOMImpl_Types.hxx" + using namespace std; //================================================================================= @@ -158,7 +156,7 @@ void BasicGUI_WorkingPlaneDlg::Init() connect(Group3->GroupBox1, SIGNAL(clicked(int)), this, SLOT(GroupClicked(int))); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); initName( tr( "GEOM_WPLANE" ) ); @@ -171,14 +169,19 @@ void BasicGUI_WorkingPlaneDlg::Init() //================================================================================= void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId) { - disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); - // myGeomGUI->SetState( 0 ); + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + + disconnect(aSelMgr, 0, this, 0); switch (constructorId) { case 0: { - globalSelection( GEOM_PLANE ); + //globalSelection( GEOM_PLANE ); + TColStd_MapOfInteger aMap; + aMap.Add( GEOM_PLANE ); + aMap.Add( GEOM_MARKER ); + globalSelection( aMap ); Group2->hide(); Group3->hide(); @@ -189,8 +192,7 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId) Group1->LineEdit1->setText(""); myFace = GEOM::GEOM_Object::_nil(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + connect(aSelMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); break; } case 1: @@ -208,8 +210,7 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId) myVectX = GEOM::GEOM_Object::_nil(); myVectZ = GEOM::GEOM_Object::_nil(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + connect(aSelMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); break; } case 2: @@ -221,7 +222,7 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId) Group3->RadioButton1->setChecked(true); aOriginType = 1; - break; + break; } } displayPreview(); @@ -256,87 +257,98 @@ bool BasicGUI_WorkingPlaneDlg::ClickOnApply() myGeomGUI->application()->putInfo(tr("")); const int id = getConstructorId(); - if (id == 0) { - if ( !CORBA::is_nil( myFace ) ) { - TopoDS_Face aPlaneShape; - if ( GEOMBase::GetShape( myFace, aPlaneShape, TopAbs_FACE ) ) { - Handle(Geom_Surface) aGS = BRep_Tool::Surface( TopoDS::Face( aPlaneShape ) ); - if ( !aGS.IsNull() && aGS->IsKind( STANDARD_TYPE( Geom_Plane ) ) ) { - Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast( aGS ); - gp_Pln aPln = aGPlane->Pln(); - - myWPlane = aPln.Position(); - myGeomGUI->SetWorkingPlane(myWPlane); - myGeomGUI->ActiveWorkingPlane(); - return true; - } - } + if (id == 0) { // by planar face selection + if (CORBA::is_nil(myFace)) { + showError( "Face has to be selected" ); + return false; + } + + // PAL12781: set center of WPL to face's center of mass + // like it is done for LCS creation + CORBA::Double Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz; + Ox = Oy = Oz = Zx = Zy = Xy = Xz = 0.; + Zz = Xx = 1.; + + GEOM::GEOM_IMeasureOperations_ptr aMeasureOp = + myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId()); + aMeasureOp->GetPosition(myFace, Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz); + + if (aMeasureOp->IsDone()) { + gp_Pnt aPnt (Ox,Oy,Oz); + gp_Dir aDirN (Zx,Zy,Zz); + gp_Dir aDirX (Xx,Xy,Xz); + myWPlane = gp_Ax3(aPnt, aDirN, aDirX); + } else { + showError( "Wrong shape selected (has to be a planar face)" ); + return false; } - } else if (id == 1) { + + } else if (id == 1) { // by two vectors (Ox & Oz) if ( CORBA::is_nil( myVectX ) || CORBA::is_nil( myVectZ ) ) { showError( "Two vectors have to be selected" ); return false; } TopoDS_Edge aVectX, aVectZ; - TopoDS_Vertex V1, V2; + TopoDS_Vertex VX1, VX2, VZ1, VZ2; gp_Vec aVX, aVZ; - if (GEOMBase::GetShape( myVectX, aVectX, TopAbs_EDGE ) && - GEOMBase::GetShape( myVectZ, aVectZ, TopAbs_EDGE )) { - TopExp::Vertices(aVectZ, V1, V2, Standard_True); - if (!V1.IsNull() && !V2.IsNull()) - aVZ = gp_Vec(BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2)); - else { - showError( "Bad OZ vector" ); - return false; - } - - TopExp::Vertices(aVectX, V1, V2, Standard_True); - if (!V1.IsNull() && !V2.IsNull()) - aVX = gp_Vec(BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2)); - else { - showError( "Bad OX vector" ); - return false; - } - gp_Dir aDirZ = gp_Dir(aVZ.X(), aVZ.Y(), aVZ.Z()); - gp_Dir aDirX = gp_Dir(aVX.X(), aVX.Y(), aVX.Z()); - - if (aDirX.IsParallel(aDirZ, Precision::Confusion())) { - showError( "Parallel vectors selected" ); - return false; - } + if (!GEOMBase::GetShape( myVectX, aVectX, TopAbs_EDGE ) || + !GEOMBase::GetShape( myVectZ, aVectZ, TopAbs_EDGE )) { + showError( "Wrong shape selected (two vectors(edges) have to be selected)" ); + return false; + } - myWPlane = gp_Ax3(BRep_Tool::Pnt(V1), aDirZ, aDirX); + TopExp::Vertices(aVectX, VX1, VX2, Standard_True); + TopExp::Vertices(aVectZ, VZ1, VZ2, Standard_True); - myGeomGUI->SetWorkingPlane(myWPlane); - myGeomGUI->ActiveWorkingPlane(); - return true; + if (VX1.IsNull() || VX2.IsNull()) { + showError( "Bad OX vector" ); + return false; + } + if (VZ1.IsNull() || VZ2.IsNull()) { + showError( "Bad OZ vector" ); + return false; } - } else if (id == 2) { - gp_Pnt P1 = gp_Pnt(0., 0., 0.); - gp_Dir aDirZ, aDirX; - if (aOriginType == 1) { - aDirZ = gp_Dir(0., 0., 1.); - aDirX = gp_Dir(1., 0., 0.); + aVX = gp_Vec(BRep_Tool::Pnt(VX1), BRep_Tool::Pnt(VX2)); + aVZ = gp_Vec(BRep_Tool::Pnt(VZ1), BRep_Tool::Pnt(VZ2)); + + if (aVX.Magnitude() < Precision::Confusion()) { + showError( "Bad OX vector" ); + return false; } - else if (aOriginType == 2) { - aDirZ = gp_Dir(1., 0., 0.); - aDirX = gp_Dir(0., 1., 0.); + if (aVZ.Magnitude() < Precision::Confusion()) { + showError( "Bad OZ vector" ); + return false; } - else if (aOriginType == 0) { - aDirZ = gp_Dir(0., 1., 0.); - aDirX = gp_Dir(0., 0., 1.); + + gp_Dir aDirX = gp_Dir(aVX.X(), aVX.Y(), aVX.Z()); + gp_Dir aDirZ = gp_Dir(aVZ.X(), aVZ.Y(), aVZ.Z()); + + if (aDirX.IsParallel(aDirZ, Precision::Angular())) { + showError( "Parallel vectors selected" ); + return false; } - myWPlane = gp_Ax3(P1, aDirZ, aDirX); + myWPlane = gp_Ax3(BRep_Tool::Pnt(VX1), aDirZ, aDirX); - myGeomGUI->SetWorkingPlane(myWPlane); - myGeomGUI->ActiveWorkingPlane(); - return true; + } else if (id == 2) { // by selection from standard (OXY or OYZ, or OZX) + gp_Ax2 anAx2; + + if (aOriginType == 1) anAx2 = gp::XOY(); + else if (aOriginType == 2) anAx2 = gp::YOZ(); + else if (aOriginType == 0) anAx2 = gp::ZOX(); + + myWPlane = gp_Ax3(anAx2); + + } else { + return false; } - return false; + + myGeomGUI->SetWorkingPlane(myWPlane); + myGeomGUI->ActiveWorkingPlane(); + return true; } //================================================================================= @@ -425,7 +437,7 @@ void BasicGUI_WorkingPlaneDlg::LineEditReturnPressed() void BasicGUI_WorkingPlaneDlg::ActivateThisDialog( ) { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); ConstructorsClicked( getConstructorId() ); diff --git a/src/BlocksGUI/BlocksGUI.cxx b/src/BlocksGUI/BlocksGUI.cxx index 66ad69008..2ab3c1db0 100644 --- a/src/BlocksGUI/BlocksGUI.cxx +++ b/src/BlocksGUI/BlocksGUI.cxx @@ -41,20 +41,6 @@ #include "SalomeApp_Application.h" -BlocksGUI* BlocksGUI::myGUIObject = 0; - -//======================================================================= -// function : GetBlocksGUI() -// purpose : Get the only BlocksGUI object [ static ] -//======================================================================= -BlocksGUI* BlocksGUI::GetBlocksGUI( GeometryGUI* parent ) -{ - if ( myGUIObject == 0 ) - myGUIObject = new BlocksGUI( parent ); - - return myGUIObject; -} - //======================================================================= // function : BlocksGUI() // purpose : Constructor @@ -108,6 +94,6 @@ extern "C" GEOM_BLOCKSGUI_EXPORT GEOMGUI* GetLibGUI( GeometryGUI* parent ) { - return BlocksGUI::GetBlocksGUI( parent ); + return new BlocksGUI( parent ); } } diff --git a/src/BlocksGUI/BlocksGUI.h b/src/BlocksGUI/BlocksGUI.h index 21430bf2c..9d546a298 100644 --- a/src/BlocksGUI/BlocksGUI.h +++ b/src/BlocksGUI/BlocksGUI.h @@ -23,7 +23,6 @@ // File : BuildGUI.h // Author : Julia DOROVSKIKH // Module : GEOM -// $Header$ #ifndef BLOCKSGUI_H #define BLOCKSGUI_H @@ -38,19 +37,11 @@ //================================================================================= class GEOM_BLOCKSGUI_EXPORT BlocksGUI : public GEOMGUI { - protected: - BlocksGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation - public: + BlocksGUI( GeometryGUI* parent ); ~BlocksGUI(); - // Get the only BuildGUI object - static BlocksGUI* GetBlocksGUI( GeometryGUI* parent ); - bool OnGUIEvent (int theCommandID, SUIT_Desktop* parent); - -private: - static BlocksGUI* myGUIObject; // the only BlocksGUI object }; #endif diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx index bfc6d9d66..1a4c04a64 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx @@ -143,7 +143,8 @@ void BlocksGUI_TrsfDlg::Init() double SpecificStep = 1.0; QMap::iterator anIter; for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) { - anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); + //anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); + anIter.data()->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3); } // signals and slots connections diff --git a/src/BooleanGUI/BooleanGUI.cxx b/src/BooleanGUI/BooleanGUI.cxx index 17702fe43..34ddff642 100644 --- a/src/BooleanGUI/BooleanGUI.cxx +++ b/src/BooleanGUI/BooleanGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -36,21 +36,6 @@ using namespace std; -BooleanGUI* BooleanGUI::myGUIObject = 0; - -//======================================================================= -// function : GetBooleanGUI() -// purpose : Get the only BooleanGUI object [ static ] -//======================================================================= -BooleanGUI* BooleanGUI::GetBooleanGUI( GeometryGUI* parent ) -{ - if ( myGUIObject == 0 ) { - // init BooleanGUI only once - myGUIObject = new BooleanGUI( parent ); - } - return myGUIObject; -} - //======================================================================= // function : BooleanGUI() // purpose : Constructor @@ -59,7 +44,6 @@ BooleanGUI::BooleanGUI( GeometryGUI* parent ) : GEOMGUI( parent ) { } - //======================================================================= // function : ~BooleanGUI() // purpose : Destructor @@ -91,7 +75,7 @@ bool BooleanGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) QDialog* aDlg = new BooleanGUI_Dialog( anOperation, getGeometryGUI(), parent, ""); aDlg->show(); - + return true; } @@ -103,6 +87,6 @@ extern "C" GEOM_BOOLEANGUI_EXPORT GEOMGUI* GetLibGUI( GeometryGUI* parent ) { - return BooleanGUI::GetBooleanGUI( parent ); + return new BooleanGUI( parent ); } } diff --git a/src/BooleanGUI/BooleanGUI.h b/src/BooleanGUI/BooleanGUI.h index 9592d6c44..32d8f57e0 100644 --- a/src/BooleanGUI/BooleanGUI.h +++ b/src/BooleanGUI/BooleanGUI.h @@ -17,14 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : BooleanGUI.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef BOOLEANGUI_H #define BOOLEANGUI_H @@ -55,21 +54,13 @@ //================================================================================= class GEOM_BOOLEANGUI_EXPORT BooleanGUI : public GEOMGUI { -protected: - BooleanGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation - public: enum BooleanOperation { COMMON = 1, CUT = 2, FUSE = 3, SECTION = 4 }; + BooleanGUI( GeometryGUI* parent ); ~BooleanGUI(); - // Get the only BooleanGUI object - static BooleanGUI* GetBooleanGUI( GeometryGUI* parent ); - bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); - -private: - static BooleanGUI* myGUIObject; // the only BooleanGUI object }; #endif diff --git a/src/BuildGUI/BuildGUI.cxx b/src/BuildGUI/BuildGUI.cxx index 21f5f9188..a9d443817 100644 --- a/src/BuildGUI/BuildGUI.cxx +++ b/src/BuildGUI/BuildGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -31,6 +31,8 @@ #include "SUIT_Desktop.h" #include "SUIT_Session.h" +#include "SalomeApp_Application.h" + #include "BuildGUI_EdgeDlg.h" // Method EDGE #include "BuildGUI_WireDlg.h" // Method WIRE #include "BuildGUI_FaceDlg.h" // Method FACE @@ -40,20 +42,6 @@ #include "GeometryGUI.h" -BuildGUI* BuildGUI::myGUIObject = 0; - -//======================================================================= -// function : GetBuildGUI() -// purpose : Get the only BuildGUI object [ static ] -//======================================================================= -BuildGUI* BuildGUI::GetBuildGUI( GeometryGUI* parent ) -{ - if ( myGUIObject == 0 ) - myGUIObject = new BuildGUI( parent ); - - return myGUIObject; -} - //======================================================================= // function : BuildGUI() // purpose : Constructor @@ -63,7 +51,6 @@ BuildGUI::BuildGUI( GeometryGUI* parent ) { } - //======================================================================= // function : ~BuildGUI() // purpose : Destructor @@ -80,7 +67,7 @@ BuildGUI::~BuildGUI() bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) { getGeometryGUI()->EmitSignalDeactivateDialog(); - + QDialog* aDlg = NULL; switch ( theCommandID ) @@ -91,15 +78,15 @@ bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) case 4084: aDlg = new BuildGUI_ShellDlg ( getGeometryGUI(), parent, "" ); break; case 4085: aDlg = new BuildGUI_SolidDlg ( getGeometryGUI(), parent, "" ); break; case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break; - + default: - SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); + getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break; } - + if ( aDlg != NULL ) aDlg->show(); - + return true; } @@ -111,6 +98,6 @@ extern "C" GEOM_BUILDGUI_EXPORT GEOMGUI* GetLibGUI( GeometryGUI* parent ) { - return BuildGUI::GetBuildGUI( parent ); + return new BuildGUI( parent ); } } diff --git a/src/BuildGUI/BuildGUI.h b/src/BuildGUI/BuildGUI.h index 6de75a9dd..60e57a347 100644 --- a/src/BuildGUI/BuildGUI.h +++ b/src/BuildGUI/BuildGUI.h @@ -17,14 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : BuildGUI.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef BUILDGUI_H #define BUILDGUI_H @@ -39,19 +38,11 @@ //================================================================================= class GEOM_BUILDGUI_EXPORT BuildGUI : public GEOMGUI { -protected: - BuildGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation - public : + BuildGUI( GeometryGUI* parent ); ~BuildGUI(); - // Get the only BuildGUI object - static BuildGUI* GetBuildGUI( GeometryGUI* parent ); - bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent ); - -private: - static BuildGUI* myGUIObject; // the only BuildGUI object }; #endif diff --git a/src/BuildGUI/BuildGUI_FaceDlg.cxx b/src/BuildGUI/BuildGUI_FaceDlg.cxx index 36d8605a9..953c54f8f 100644 --- a/src/BuildGUI/BuildGUI_FaceDlg.cxx +++ b/src/BuildGUI/BuildGUI_FaceDlg.cxx @@ -28,6 +28,7 @@ #include "BuildGUI_FaceDlg.h" #include "GEOMImpl_Types.hxx" +#include "TColStd_MapOfInteger.hxx" #include "SUIT_Session.h" #include "SalomeApp_Application.h" @@ -64,7 +65,7 @@ BuildGUI_FaceDlg::BuildGUI_FaceDlg(GeometryGUI* theGeometryGUI, QWidget* parent, GroupWire = new DlgRef_1Sel1Check_QTD(this, "GroupWire"); GroupWire->GroupBox1->setTitle(tr("GEOM_FACE_FFW")); - GroupWire->TextLabel1->setText(tr("GEOM_WIRES")); + GroupWire->TextLabel1->setText(tr("GEOM_OBJECTS")); GroupWire->CheckButton1->setText(tr("GEOM_FACE_OPT")); GroupWire->PushButton1->setPixmap(image1); @@ -100,7 +101,10 @@ void BuildGUI_FaceDlg::Init() GroupWire->CheckButton1->setChecked(TRUE); - globalSelection( GEOM_WIRE ); + TColStd_MapOfInteger aMap; + aMap.Add( GEOM_EDGE ); + aMap.Add( GEOM_WIRE ); + globalSelection( aMap ); /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); @@ -160,7 +164,7 @@ void BuildGUI_FaceDlg::SelectionIntoArgument() if (!myWires.length()) return; if(aNbSel != 1) - aName = tr("%1_wires").arg(aNbSel); + aName = tr("%1_objects").arg(aNbSel); myEditCurrentArgument->setText( aName ); @@ -178,7 +182,11 @@ void BuildGUI_FaceDlg::SetEditCurrentArgument() if (send != GroupWire->PushButton1) return; - globalSelection( GEOM_WIRE ); + TColStd_MapOfInteger aMap; + aMap.Add( GEOM_EDGE ); + aMap.Add( GEOM_WIRE ); + globalSelection( aMap ); + myEditCurrentArgument = GroupWire->LineEdit1; myEditCurrentArgument->setFocus(); @@ -195,7 +203,10 @@ void BuildGUI_FaceDlg::ActivateThisDialog() GEOMBase_Skeleton::ActivateThisDialog(); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - globalSelection( GEOM_WIRE ); + TColStd_MapOfInteger aMap; + aMap.Add( GEOM_EDGE ); + aMap.Add( GEOM_WIRE ); + globalSelection( aMap ); } diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx index 1f26121e5..7ce28c184 100644 --- a/src/DisplayGUI/DisplayGUI.cxx +++ b/src/DisplayGUI/DisplayGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -59,21 +59,6 @@ #include -DisplayGUI* DisplayGUI::myGUIObject = 0; - -//======================================================================= -// function : DisplayGUI::GetDisplayGUI() -// purpose : Get the only DisplayGUI object [ static ] -//======================================================================= -DisplayGUI* DisplayGUI::GetDisplayGUI( GeometryGUI* parent ) -{ - if ( myGUIObject == 0 ) { - // init DisplayGUI only once - myGUIObject = new DisplayGUI( parent ); - } - return myGUIObject; -} - //======================================================================= // function : DisplayGUI::DisplayGUI() // purpose : Constructor @@ -82,7 +67,6 @@ DisplayGUI::DisplayGUI( GeometryGUI* parent ) : GEOMGUI( parent ) { } - //======================================================================= // function : DisplayGUI::~DisplayGUI() // purpose : Destructor @@ -98,63 +82,64 @@ DisplayGUI::~DisplayGUI() //======================================================================= bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) { - DisplayGUI* myDisplayGUI = GetDisplayGUI( getGeometryGUI() ); - LightApp_SelectionMgr *Sel = getGeometryGUI()->getApp()->selectionMgr(); + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if (!app) return false; + + LightApp_SelectionMgr *Sel = app->selectionMgr(); SALOME_ListIO selected; Sel->selectedObjects( selected ); switch (theCommandID) { case 211: // MENU VIEW - WIREFRAME/SHADING { - myDisplayGUI->InvertDisplayMode(); - int newMode = myDisplayGUI->GetDisplayMode(); - getGeometryGUI()->action( 211 )->setMenuText( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") ); + InvertDisplayMode(); + int newMode = GetDisplayMode(); + getGeometryGUI()->action( 211 )->setMenuText + ( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") ); getGeometryGUI()->menuMgr()->update(); -// SUIT_Session::session()->activeApplication()->desktop()->menuBar()-> -// changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") ); break; } case 212: // MENU VIEW - DISPLAY ALL { getGeometryGUI()->EmitSignalDeactivateDialog(); - myDisplayGUI->DisplayAll(); + DisplayAll(); break; } case 213: // MENU VIEW - DISPLAY ONLY { getGeometryGUI()->EmitSignalDeactivateDialog(); - myDisplayGUI->DisplayOnly(); + DisplayOnly(); break; } case 214: // MENU VIEW - ERASE ALL { - myDisplayGUI->EraseAll(); + EraseAll(); break; } case 215: // MENU VIEW - ERASE { - myDisplayGUI->Erase(); + Erase(); break; } case 216: // MENU VIEW - DISPLAY { getGeometryGUI()->EmitSignalDeactivateDialog(); - myDisplayGUI->Display(); + Display(); break; } case 80311: // POPUP VIEWER - WIREFRAME { - myDisplayGUI->ChangeDisplayMode( 0 ); + ChangeDisplayMode( 0 ); break; } case 80312: // POPUP VIEWER - SHADING { - myDisplayGUI->ChangeDisplayMode( 1 ); + ChangeDisplayMode( 1 ); break; } default: { - SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; } } @@ -168,7 +153,10 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) //===================================================================================== void DisplayGUI::DisplayAll() { - SalomeApp_Study* appStudy = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return; + + SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); if ( !appStudy ) return; _PTR(Study) aStudy = appStudy->studyDS(); if ( !aStudy ) return; @@ -186,7 +174,9 @@ void DisplayGUI::DisplayAll() _PTR(SObject) valSO ( anIter->Value() ); _PTR(SObject) refSO; if ( !valSO->ReferencedObject( refSO ) ) { - listIO.Append( new SALOME_InteractiveObject( valSO->GetID().c_str(), SC->ComponentDataType().c_str() ,valSO->GetName().c_str() ) ); + listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(), + SC->ComponentDataType().c_str(), + valSO->GetName().c_str()) ); } anIter->Next(); } @@ -201,7 +191,7 @@ void DisplayGUI::EraseAll() { SUIT_OverrideCursor(); - SUIT_Application* app = SUIT_Session::session()->activeApplication(); + SUIT_Application* app = getGeometryGUI()->getApp(); if ( app ) { SUIT_ViewWindow* vw = app->desktop()->activeWindow(); if ( vw ) { @@ -232,28 +222,28 @@ void DisplayGUI::DisplayOnly() void DisplayGUI::Display() { SALOME_ListIO listIO; - - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + + SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; SalomeApp_Study* anActiveStudy = dynamic_cast( app->activeStudy() ); if ( !anActiveStudy ) return; - + //get SalomeApp selection manager LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if ( !aSelMgr ) return; - + SALOME_ListIO aList; aSelMgr->selectedObjects( aList ); SALOME_ListIteratorOfListIO It( aList ); - + SUIT_OverrideCursor(); for( ;It.More();It.Next() ) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); if ( anIObject->hasEntry() ) { _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); - if ( SO && QString( SO->GetID().c_str() ) == QString( SO->GetFatherComponent()->GetID().c_str() ) ) { + if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) { _PTR(SComponent) SC ( SO->GetFatherComponent() ); // if component is selected listIO.Clear(); @@ -263,8 +253,10 @@ void DisplayGUI::Display() _PTR(SObject) valSO ( anIter->Value() ); _PTR(SObject) refSO; if ( !valSO->ReferencedObject( refSO ) ) { - listIO.Append( new SALOME_InteractiveObject( valSO->GetID().c_str(), SC->ComponentDataType().c_str() ,valSO->GetName().c_str() ) ); - } + listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(), + SC->ComponentDataType().c_str(), + valSO->GetName().c_str()) ); + } anIter->Next(); } break; @@ -289,27 +281,27 @@ void DisplayGUI::Erase() { SALOME_ListIO listIO; - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; SalomeApp_Study* anActiveStudy = dynamic_cast( app->activeStudy() ); if ( !anActiveStudy ) return; - + //get SalomeApp selection manager LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if ( !aSelMgr ) return; - + SALOME_ListIO aList; aSelMgr->selectedObjects( aList ); SALOME_ListIteratorOfListIO It( aList ); SUIT_OverrideCursor(); - for( ;It.More();It.Next() ) { + for( ; It.More(); It.Next() ) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); if ( anIObject->hasEntry() ) { _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); - if ( SO && QString( SO->GetID().c_str() ) == QString( SO->GetFatherComponent()->GetID().c_str() ) ) { + if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) { _PTR(SComponent) SC ( SO->GetFatherComponent() ); // if component is selected listIO.Clear(); @@ -319,8 +311,10 @@ void DisplayGUI::Erase() _PTR(SObject) valSO ( anIter->Value() ); _PTR(SObject) refSO; if ( !valSO->ReferencedObject( refSO ) ) { - listIO.Append( new SALOME_InteractiveObject( valSO->GetID().c_str(), SC->ComponentDataType().c_str() ,valSO->GetName().c_str() ) ); - } + listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(), + SC->ComponentDataType().c_str(), + valSO->GetName().c_str()) ); + } anIter->Next(); } break; @@ -334,7 +328,7 @@ void DisplayGUI::Erase() } } GEOM_Displayer(anActiveStudy).Erase( listIO, true ); - ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->clearSelected(); + getGeometryGUI()->getApp()->selectionMgr()->clearSelected(); } //===================================================================================== @@ -346,7 +340,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) SUIT_OverrideCursor(); if ( !viewWindow ) - viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); + viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow(); if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView(); aView->SetDisplayMode( mode ); @@ -360,7 +354,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) AIS_ListOfInteractive List1; ic->ObjectsInCollector( List1 ); List.Append( List1 ); - + AIS_ListIteratorOfListOfInteractive ite( List ); while( ite.More() ) { if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) { @@ -369,7 +363,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) } ite.Next(); } - + ic->SetDisplayMode( newmode, Standard_False ); } } @@ -382,7 +376,7 @@ int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow ) { int dispMode = 0; if ( !viewWindow ) - viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); + viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow(); if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView(); dispMode = aView->GetDisplayMode(); @@ -413,19 +407,19 @@ void DisplayGUI::InvertDisplayMode( SUIT_ViewWindow* viewWindow ) //===================================================================================== void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) { - if ( !viewWindow ) - viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); - - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; + if ( !viewWindow ) + viewWindow = app->desktop()->activeWindow(); + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if ( !aSelMgr ) return; - + SUIT_OverrideCursor(); SALOME_ListIO aList; - + if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { SVTK_ViewWindow* vw = dynamic_cast( viewWindow ); SVTK_View* aView = vw->getView(); @@ -435,7 +429,8 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow for( ;It.More(); It.Next() ) { SVTK_Viewer* stvkViewer = dynamic_cast(vw->getViewManager()->getViewModel()); - SVTK_Prs* vtkPrs = stvkViewer ? dynamic_cast( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0; + SVTK_Prs* vtkPrs = + stvkViewer ? dynamic_cast( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0; if ( vtkPrs && !vtkPrs->IsNull() ) { if ( mode == 0 ) aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() ); @@ -478,6 +473,6 @@ extern "C" GEOM_DISPLAYGUI_EXPORT GEOMGUI* GetLibGUI( GeometryGUI* parent ) { - return DisplayGUI::GetDisplayGUI( parent ); + return new DisplayGUI( parent ); } } diff --git a/src/DisplayGUI/DisplayGUI.h b/src/DisplayGUI/DisplayGUI.h index bf69a3286..9e31f223c 100644 --- a/src/DisplayGUI/DisplayGUI.h +++ b/src/DisplayGUI/DisplayGUI.h @@ -17,14 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : DisplayGUI.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef DISPLAYGUI_H #define DISPLAYGUI_H @@ -33,22 +32,15 @@ #include "GEOMBase.h" #ifdef WNT - #if defined DISPLAYGUI_EXPORTS - #if defined WIN32 - #define GEOM_DISPLAYGUI_EXPORT __declspec( dllexport ) - #else - #define GEOM_DISPLAYGUI_EXPORT - #endif - #else - #if defined WIN32 - #define GEOM_DISPLAYGUI_EXPORT __declspec( dllimport ) - #else - #define GEOM_DISPLAYGUI_EXPORT - #endif - #endif +# if defined DISPLAYGUI_EXPORTS +# define GEOM_DISPLAYGUI_EXPORT __declspec( dllexport ) +# else +# define GEOM_DISPLAYGUI_EXPORT __declspec( dllimport ) +# endif #else - #define GEOM_DISPLAYGUI_EXPORT +# define GEOM_DISPLAYGUI_EXPORT #endif + //================================================================================= // class : GEOMBase_Display // purpose : @@ -57,15 +49,10 @@ class SUIT_ViewWindow; class GEOM_DISPLAYGUI_EXPORT DisplayGUI : public GEOMGUI { -protected: - DisplayGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation - -public : +public: + DisplayGUI( GeometryGUI* parent ); ~DisplayGUI(); - // Get the only DisplayGUI object - static DisplayGUI* GetDisplayGUI( GeometryGUI* parent ); - // Dispatch menu command bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); @@ -92,9 +79,6 @@ public : // Set display mode for selected objects in the viewer given // (current viewer if = 0 ) void ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindo = 0 ); - -private: - static DisplayGUI* myGUIObject; // the only DisplayGUI object }; #endif diff --git a/src/DlgRef/DlgRef_SpinBox.cxx b/src/DlgRef/DlgRef_SpinBox.cxx index af86865ab..8a7ad7931 100644 --- a/src/DlgRef/DlgRef_SpinBox.cxx +++ b/src/DlgRef/DlgRef_SpinBox.cxx @@ -96,6 +96,8 @@ QString DlgRef_SpinBox::GetString() void DlgRef_SpinBox::RangeStepAndValidator(double min, double max,double step, unsigned short decimals) { + setPrecision(-decimals); // PAL12789. Minus is for using 'g' double->string conversion specifier, + // see QtxDblSpinBox::mapValueToText( double v ) setRange(min, max); setLineStep(step); ((QDoubleValidator*)validator())->setRange(min, max, decimals); diff --git a/src/DlgRef/DlgRef_SpinBox.h b/src/DlgRef/DlgRef_SpinBox.h index 1d7e4a036..d9675462b 100644 --- a/src/DlgRef/DlgRef_SpinBox.h +++ b/src/DlgRef/DlgRef_SpinBox.h @@ -33,6 +33,10 @@ #include "QtxDblSpinBox.h" +#define COORD_MIN -1e+15 +#define COORD_MAX +1e+15 +#define MAX_NUMBER 100000 + //================================================================================= // class : DlgRef_SpinBox // purpose : Derivated from QSpinBox class and modified to accept floats diff --git a/src/EntityGUI/EntityGUI.cxx b/src/EntityGUI/EntityGUI.cxx index 9fd2a6380..8bdee4ae6 100644 --- a/src/EntityGUI/EntityGUI.cxx +++ b/src/EntityGUI/EntityGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -37,6 +37,7 @@ #include "OCCViewer_ViewManager.h" #include "SalomeApp_Study.h" #include "SalomeApp_Tools.h" +#include "SalomeApp_Application.h" #include #include @@ -50,15 +51,6 @@ using namespace boost; using namespace std; -//======================================================================= -// function : GetEntityGUI() -// purpose : Get the only EntityGUI object [ static ] -//======================================================================= -EntityGUI* EntityGUI::GetEntityGUI( GeometryGUI* parent ) -{ - return new EntityGUI( parent ); -} - //======================================================================= // function : EntityGUI() // purpose : Constructor @@ -84,6 +76,9 @@ EntityGUI::~EntityGUI() //======================================================================= bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) { + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return false; + getGeometryGUI()->EmitSignalDeactivateDialog(); QDialog* aDlg = NULL; @@ -97,7 +92,7 @@ bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) aDlg = new EntityGUI_SubShapeDlg(getGeometryGUI(), parent, ""); break; default: - SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; } if ( aDlg ) @@ -113,8 +108,10 @@ bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) //===================================================================================== void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2) { - SUIT_ViewManager* aVM = - SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager(); + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return; + + SUIT_ViewManager* aVM = app->desktop()->activeWindow()->getViewManager(); if (aVM->getType() != OCCViewer_Viewer::Type()) return; @@ -129,7 +126,7 @@ void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shap mySimulationShape1 = new AIS_Shape(TopoDS_Shape()); mySimulationShape1->Set(S1); mySimulationShape1->SetColor(Quantity_NOC_RED); - + ic->Deactivate(mySimulationShape1); ic->Display(mySimulationShape1, Standard_False); mySimulationShape1->UnsetColor(); @@ -160,15 +157,18 @@ void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shap //================================================================================== void EntityGUI::EraseSimulationShape() { + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return; + // get all view windows at the desktop - QPtrList aWndLst = SUIT_Session::session()->activeApplication()->desktop()->windows(); + QPtrList aWndLst = app->desktop()->windows(); //get all view windows, which belong to the active study QPtrList aWndLstAS; SUIT_ViewWindow* vw; for ( vw = aWndLst.first(); vw; vw = aWndLst.next() ) - if ( vw->getViewManager()->study() == SUIT_Session::session()->activeApplication()->activeStudy() ) + if ( vw->getViewManager()->study() == app->activeStudy() ) aWndLstAS.append( vw ); - + for ( vw = aWndLstAS.first(); vw; vw = aWndLstAS.next() ) { if ( vw->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(vw->getViewManager()))->getOCCViewer(); @@ -188,9 +188,11 @@ void EntityGUI::EraseSimulationShape() //===================================================================================== bool EntityGUI::SObjectExist(const _PTR(SObject)& theFatherObject, const char* IOR) { - SalomeApp_Study* appStudy = dynamic_cast - ( SUIT_Session::session()->activeApplication()->activeStudy() ); + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return false; + SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); if ( !appStudy ) return false; + _PTR(Study) aStudy = appStudy->studyDS(); _PTR(ChildIterator) it ( aStudy->NewChildIterator(theFatherObject) ); _PTR(SObject) RefSO; @@ -222,6 +224,6 @@ extern "C" GEOM_ENTITYGUI_EXPORT GEOMGUI* GetLibGUI( GeometryGUI* parent ) { - return EntityGUI::GetEntityGUI( parent ); + return new EntityGUI( parent ); } } diff --git a/src/EntityGUI/EntityGUI.h b/src/EntityGUI/EntityGUI.h index fbd7b78cb..a4fd8c001 100644 --- a/src/EntityGUI/EntityGUI.h +++ b/src/EntityGUI/EntityGUI.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -43,15 +43,10 @@ //================================================================================= class GEOM_ENTITYGUI_EXPORT EntityGUI : public GEOMGUI { -protected: - EntityGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation - public : + EntityGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation ~EntityGUI(); - // Get the only EntityGUI object - static EntityGUI* GetEntityGUI( GeometryGUI* parent ); - bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2); diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index 3dc02c0c9..dac57b966 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -1,30 +1,30 @@ // GEOM GEOMGUI : GUI for Geometry component // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : EntityGUI_SketcherDlg.cxx // Author : Damien COQUERET // Module : GEOM -// $Header: +// $Header$ #include "EntityGUI_SketcherDlg.h" #include "Sketcher_Profile.hxx" @@ -58,7 +58,7 @@ using namespace std; //================================================================================= // class : EntityGUI_SketcherDlg() -// purpose : Constructs a EntityGUI_SketcherDlg which is a child of 'parent', with the +// purpose : Constructs a EntityGUI_SketcherDlg which is a child of 'parent', with the // name 'name' and widget flags set to 'f'. // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. @@ -80,7 +80,7 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent, buttonClose->setText(tr("GEOM_BUT_CLOSE_SKETCH")); buttonHelp->setText(tr("GEOM_BUT_HELP")); - GroupVal->close(TRUE); + GroupVal->close(TRUE); GroupDest2->close(TRUE); GroupDest3->close(TRUE); @@ -132,24 +132,42 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent, Group1Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY")); Group1Spin->buttonUndo->setPixmap(image1); Group1Spin->buttonRedo->setPixmap(image2); + QWidget::setTabOrder(Group1Spin->SpinBox_DX , Group1Spin->buttonApply); + QWidget::setTabOrder(Group1Spin->buttonApply, Group1Spin->buttonUndo); + QWidget::setTabOrder(Group1Spin->buttonUndo , Group1Spin->buttonRedo); Group2Spin = new EntityGUI_2Spin(this, "Group2Spin"); Group2Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES")); Group2Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY")); Group2Spin->buttonUndo->setPixmap(image1); Group2Spin->buttonRedo->setPixmap(image2); + QWidget::setTabOrder(Group2Spin->SpinBox_DX , Group2Spin->SpinBox_DY); + QWidget::setTabOrder(Group2Spin->SpinBox_DY , Group2Spin->buttonApply); + QWidget::setTabOrder(Group2Spin->buttonApply, Group2Spin->buttonUndo); + QWidget::setTabOrder(Group2Spin->buttonUndo , Group2Spin->buttonRedo); Group3Spin = new EntityGUI_3Spin(this, "Group3Spin"); Group3Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES")); Group3Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY")); Group3Spin->buttonUndo->setPixmap(image1); Group3Spin->buttonRedo->setPixmap(image2); + QWidget::setTabOrder(Group3Spin->SpinBox_DX , Group3Spin->SpinBox_DY); + QWidget::setTabOrder(Group3Spin->SpinBox_DY , Group3Spin->SpinBox_DZ); + QWidget::setTabOrder(Group3Spin->SpinBox_DZ , Group3Spin->buttonApply); + QWidget::setTabOrder(Group3Spin->buttonApply, Group3Spin->buttonUndo); + QWidget::setTabOrder(Group3Spin->buttonUndo , Group3Spin->buttonRedo); Group4Spin = new EntityGUI_4Spin(this, "Group4Spin"); Group4Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES")); Group4Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY")); Group4Spin->buttonUndo->setPixmap(image1); Group4Spin->buttonRedo->setPixmap(image2); + QWidget::setTabOrder(Group4Spin->SpinBox_DX , Group4Spin->SpinBox_DY); + QWidget::setTabOrder(Group4Spin->SpinBox_DY , Group4Spin->SpinBox_DZ); + QWidget::setTabOrder(Group4Spin->SpinBox_DZ , Group4Spin->SpinBox_DS); + QWidget::setTabOrder(Group4Spin->SpinBox_DS , Group4Spin->buttonApply); + QWidget::setTabOrder(Group4Spin->buttonApply, Group4Spin->buttonUndo); + QWidget::setTabOrder(Group4Spin->buttonUndo , Group4Spin->buttonRedo); Layout5->addMultiCellWidget(GroupPt, 1, 1, 0, 1); Layout5->addWidget(GroupD1, 1, 0); @@ -217,7 +235,19 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent, connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - + + // install event filter on spin-boxes to provide Apply action on Return pressed + Group1Spin->SpinBox_DX->installEventFilter(this); + Group2Spin->SpinBox_DX->installEventFilter(this); + Group2Spin->SpinBox_DY->installEventFilter(this); + Group3Spin->SpinBox_DX->installEventFilter(this); + Group3Spin->SpinBox_DY->installEventFilter(this); + Group3Spin->SpinBox_DZ->installEventFilter(this); + Group4Spin->SpinBox_DX->installEventFilter(this); + Group4Spin->SpinBox_DY->installEventFilter(this); + Group4Spin->SpinBox_DZ->installEventFilter(this); + Group4Spin->SpinBox_DS->installEventFilter(this); + Init(); } @@ -228,7 +258,42 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent, //================================================================================= EntityGUI_SketcherDlg::~EntityGUI_SketcherDlg() { - myGeometryGUI->SetActiveDialogBox( 0 ); + myGeometryGUI->SetActiveDialogBox( 0 ); +} + + +//================================================================================= +// function : eventFilter() +// purpose : event filter for spin-boxes to provide Apply action on Return pressed +//================================================================================= +bool EntityGUI_SketcherDlg::eventFilter (QObject* object, QEvent* event) +{ + if (event->type() == QEvent::KeyPress) { + QKeyEvent* ke = (QKeyEvent*)event; + if (ke->key() == Key_Return) { + if (object == Group1Spin->SpinBox_DX) { + Group1Spin->buttonApply->animateClick(); + return true; + } else if (object == Group2Spin->SpinBox_DX || + object == Group2Spin->SpinBox_DY) { + Group2Spin->buttonApply->animateClick(); + return true; + } else if (object == Group3Spin->SpinBox_DX || + object == Group3Spin->SpinBox_DY || + object == Group3Spin->SpinBox_DZ) { + Group3Spin->buttonApply->animateClick(); + return true; + } else if (object == Group4Spin->SpinBox_DX || + object == Group4Spin->SpinBox_DY || + object == Group4Spin->SpinBox_DZ || + object == Group4Spin->SpinBox_DS) { + Group4Spin->buttonApply->animateClick(); + return true; + } + } + } + + return EntityGUI_Skeleton_QTD::eventFilter(object, event); } @@ -257,16 +322,16 @@ void EntityGUI_SketcherDlg::Init() double step = SUIT_Session::session()->resourceMgr()->doubleValue( "Geometry", "SettingsGeomStep", 100.0 ); /* min, max, step and decimals for spin boxes */ - Group1Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group4Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); - Group4Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); - Group4Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group4Spin->SpinBox_DS->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); + Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3); + Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3); + Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); /* displays Dialog */ GroupConstructors->setEnabled(false); @@ -289,7 +354,7 @@ void EntityGUI_SketcherDlg::Init() //================================================================================= void EntityGUI_SketcherDlg::InitClick() { - disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); + disconnect(myGeometryGUI->getApp()->selectionMgr(), 0, this, 0); Group1Sel->hide(); Group1Spin->hide(); @@ -359,13 +424,16 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId) { InitClick(); + // Get setting of step value from file configuration + double step = SUIT_Session::session()->resourceMgr()->doubleValue("Geometry", "SettingsGeomStep", 100.0); + if ( myConstructorId == 0 ) { // SEGMENT if ( constructorId == 1 ) { // XY mySketchType = PT_ABS; - Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); + Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2")); myX = 0.0; @@ -380,8 +448,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId) else if ( constructorId == 0 ) { // DXDY mySketchType = PT_RELATIVE; - Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); + Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2")); myDX = 0.0; @@ -397,8 +465,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId) { // Selection mySketchType = PT_SEL; myEditCurrentArgument = Group1Sel->LineEdit1; - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; + connect(myGeometryGUI->getApp()->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); Group1Sel->show(); Group1Sel->buttonApply->setFocus(); SelectionIntoArgument(); @@ -428,6 +496,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) InitClick(); myAngle = 0.0; + // Get setting of step value from file configuration + double step = SUIT_Session::session()->resourceMgr()->doubleValue("Geometry", "SettingsGeomStep", 100.0); + if ( myConstructorId == 0 ) { // SEGMENT myX = 0.0; @@ -435,8 +506,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) myLength = 100.0; if ( myConstructorDirId == 2 ) { // Angle - Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); + Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2")); Group2Spin->SpinBox_DX->SetValue(myAngle); Group2Spin->buttonApply->setFocus(); @@ -460,7 +531,7 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y3")); Group2Spin->SpinBox_DY->SetValue(myY); } - } + } else if ( myConstructorDirId == 0 ) { // Perpendicular Group1Spin->show(); @@ -511,9 +582,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) } else if ( myConstructorDirId == 3 ) { // DXDY - Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); - Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); - Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); + Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3); + Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3); + Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2")); Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2")); myDX = 0.0; @@ -550,9 +621,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) if ( constructorId == 2 ) { // Length mySketchType = DIR_ANGLE_LENGTH; - Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); - Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); - Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); + Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); + Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2")); Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2")); Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2")); @@ -570,8 +641,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) if ( constructorId == 2 ) { // Length mySketchType = DIR_PER_LENGTH; - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2")); myRadius = 100.0; @@ -587,8 +658,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) if ( constructorId == 2 ) { // Length mySketchType = DIR_TAN_LENGTH; - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2")); myRadius = 100.0; @@ -651,7 +722,7 @@ void EntityGUI_SketcherDlg::ClickOnEnd() tr( "GEOM_ERROR_STATUS" ), tr( "CANNOT_CLOSE" ), tr( "BUT_OK" ) ); return; } - + QString Command = myCommand.join( "" ) + GetNewCommand(); Sketcher_Profile aProfile (Command.ascii()); @@ -660,11 +731,11 @@ void EntityGUI_SketcherDlg::ClickOnEnd() TopoDS_Shape myShape; if ( aProfile.IsDone() ) myShape = aProfile.GetShape(); - + if(myShape.ShapeType() != TopAbs_VERTEX) myCommand.append( ":WW" ); } - else + else myIsAllAdded = true; if( myCommand.size() > 2 ) @@ -680,7 +751,7 @@ void EntityGUI_SketcherDlg::ClickOnEnd() //================================================================================= bool EntityGUI_SketcherDlg::ClickOnApply() { - ((QPushButton*)sender())->setFocus(); + ((QPushButton*)sender())->setFocus(); // to update value of currently edited spin-box (PAL11948) myCommand.append( GetNewCommand() ); mySketchState = NEXT_POINT; @@ -695,6 +766,24 @@ bool EntityGUI_SketcherDlg::ClickOnApply() GEOMBase_Helper::displayPreview(); + // Set focus to SpinBox_DX + if (sender() == Group1Spin->buttonApply) { + (Group1Spin->SpinBox_DX)->setFocus(); + (Group1Spin->SpinBox_DX)->selectAll(); + } + else if (sender() == Group2Spin->buttonApply) { + (Group2Spin->SpinBox_DX)->setFocus(); + (Group2Spin->SpinBox_DX)->selectAll(); + } + else if (sender() == Group3Spin->buttonApply) { + (Group3Spin->SpinBox_DX)->setFocus(); + (Group3Spin->SpinBox_DX)->selectAll(); + } + else if (sender() == Group4Spin->buttonApply) { + (Group4Spin->SpinBox_DX)->setFocus(); + (Group4Spin->SpinBox_DX)->selectAll(); + } + return true; } @@ -705,7 +794,7 @@ bool EntityGUI_SketcherDlg::ClickOnApply() void EntityGUI_SketcherDlg::ClickOnHelp() { LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - if (app) + if (app) app->onHelpContextModule(myGeometryGUI ? app->moduleName(myGeometryGUI->moduleName()) : QString(""), myHelpFileName); else { QString platform; @@ -733,7 +822,7 @@ void EntityGUI_SketcherDlg::ClickOnUndo() if(myCommand.count() == 1) { mySketchState = FIRST_POINT; - + RadioButton1->setChecked(true); TypeClicked(0); @@ -879,7 +968,7 @@ void EntityGUI_SketcherDlg::DeactivateActiveDialog() setEnabled( false ); globalSelection(); - disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); + disconnect(myGeometryGUI->getApp()->selectionMgr(), 0, this, 0); myGeometryGUI->SetActiveDialogBox(0); } @@ -894,8 +983,8 @@ void EntityGUI_SketcherDlg::ActivateThisDialog() setEnabled(true); myGeometryGUI->SetActiveDialogBox((QDialog*)this); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; + connect(myGeometryGUI->getApp()->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); //myGeometryGUI->SetState( 0 ); globalSelection( GEOM_POINT ); @@ -925,7 +1014,7 @@ void EntityGUI_SketcherDlg::enterEvent(QEvent* e) void EntityGUI_SketcherDlg::closeEvent(QCloseEvent* e) { //myGeometryGUI->SetState( -1 ); - disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); + disconnect(myGeometryGUI->getApp()->selectionMgr(), 0, this, 0); QDialog::closeEvent( e ); } @@ -1272,28 +1361,29 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects ) } QString cmd; - if( ( mySketchState != FIRST_POINT && myLastX1 == myLastX2 && myLastY1 == myLastY2 ) || myIsAllAdded ) { + if( ( mySketchState != FIRST_POINT && + myLastX1 == myLastX2 && myLastY1 == myLastY2 ) || myIsAllAdded ) { cmd = myCommand.join( "" ); if ( Group1Sel->isVisible() ) { Group1Sel->buttonApply->setEnabled(false); - Group1Sel->buttonApply->setFocus(); + //Group1Sel->buttonApply->setFocus(); } if ( Group1Spin->isVisible() ) { Group1Spin->buttonApply->setEnabled(false); - Group1Spin->buttonApply->setFocus(); + //Group1Spin->buttonApply->setFocus(); } if ( Group2Spin->isVisible() ) { Group2Spin->buttonApply->setEnabled(false); - Group2Spin->buttonApply->setFocus(); + //Group2Spin->buttonApply->setFocus(); } if ( Group3Spin->isVisible() ) { Group3Spin->buttonApply->setEnabled(false); - Group3Spin->buttonApply->setFocus(); + //Group3Spin->buttonApply->setFocus(); } if ( Group4Spin->isVisible() ) { Group4Spin->buttonApply->setEnabled(false); - Group4Spin->buttonApply->setFocus(); + //Group4Spin->buttonApply->setFocus(); } } else { @@ -1301,26 +1391,26 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects ) if ( Group1Sel->isVisible() ) { Group1Sel->buttonApply->setEnabled(true); - Group1Sel->buttonApply->setFocus(); + //Group1Sel->buttonApply->setFocus(); } if ( Group1Spin->isVisible() ) { Group1Spin->buttonApply->setEnabled(true); - Group1Spin->buttonApply->setFocus(); + //Group1Spin->buttonApply->setFocus(); } if ( Group2Spin->isVisible() ) { Group2Spin->buttonApply->setEnabled(true); - Group2Spin->buttonApply->setFocus(); + //Group2Spin->buttonApply->setFocus(); } if ( Group3Spin->isVisible() ) { Group3Spin->buttonApply->setEnabled(true); - Group3Spin->buttonApply->setFocus(); + //Group3Spin->buttonApply->setFocus(); } if ( Group4Spin->isVisible() ) { Group4Spin->buttonApply->setEnabled(true); - Group4Spin->buttonApply->setFocus(); + //Group4Spin->buttonApply->setFocus(); } } - + gp_Ax3 myWPlane = myGeometryGUI->GetWorkingPlane(); GEOM::ListOfDouble_var WPlane = new GEOM::ListOfDouble; WPlane->length(9); @@ -1336,7 +1426,8 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects ) WPlane[7] = myWPlane.XDirection().Y(); WPlane[8] = myWPlane.XDirection().Z(); - GEOM::GEOM_Object_var anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeSketcher( cmd.latin1(), WPlane ); + GEOM::GEOM_Object_var anObj = + GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeSketcher( cmd.latin1(), WPlane ); if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() ); @@ -1433,9 +1524,19 @@ bool EntityGUI_SketcherDlg::createShapes( GEOM::GEOM_Object_ptr theObject, return true; } +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void EntityGUI_SketcherDlg::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; - - - - - + if ( e->key() == Key_F1 ) + { + e->accept(); + ClickOnHelp(); + } +} diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.h b/src/EntityGUI/EntityGUI_SketcherDlg.h index b79bcc1e4..4f930f9bc 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.h +++ b/src/EntityGUI/EntityGUI_SketcherDlg.h @@ -1,23 +1,23 @@ // GEOM GEOMGUI : GUI for Geometry component // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -68,6 +68,8 @@ public: const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~EntityGUI_SketcherDlg(); + bool eventFilter (QObject* object, QEvent* event); + protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); @@ -75,6 +77,7 @@ protected: virtual bool execute( ObjectList& objects ); void closeEvent( QCloseEvent* e ); + void keyPressEvent( QKeyEvent* e ); private : void Init(); diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index 8caa47da0..2475cce34 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -55,6 +55,7 @@ #include #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC static GEOM_Engine* TheEngine = NULL; @@ -214,6 +215,9 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) theMainShape, aSSI.SetIndices(theIndices); try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif GEOM_Solver aSolver (GEOM_Engine::GetEngine()); if (!aSolver.ComputeFunction(aFunction)) { MESSAGE("GEOM_Engine::AddSubShape Error: Can't build a sub shape"); diff --git a/src/GEOM/GEOM_Function.cxx b/src/GEOM/GEOM_Function.cxx index d79dd01a3..03cd586af 100644 --- a/src/GEOM/GEOM_Function.cxx +++ b/src/GEOM/GEOM_Function.cxx @@ -54,6 +54,7 @@ #include #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #define ARGUMENT_LABEL 1 @@ -165,7 +166,10 @@ TopoDS_Shape GEOM_Function::GetValue() if(anObject.IsNull()) return aShape; if(!anObject->IsMainShape()) { try { - GEOM_Solver aSolver(GEOM_Engine::GetEngine()); +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + GEOM_Solver aSolver(GEOM_Engine::GetEngine()); if (!aSolver.ComputeFunction(this)) { MESSAGE("GEOM_Object::GetValue Error : Can't build a sub shape"); return aShape; diff --git a/src/GEOM/GEOM_PythonDump.cxx b/src/GEOM/GEOM_PythonDump.cxx index d11673b2e..a3ff987bd 100644 --- a/src/GEOM/GEOM_PythonDump.cxx +++ b/src/GEOM/GEOM_PythonDump.cxx @@ -104,9 +104,13 @@ namespace GEOM TPythonDump& TPythonDump::operator<< (const Handle(GEOM_Object)& theObject) { - TCollection_AsciiString anEntry; - TDF_Tool::Entry(theObject->GetEntry(), anEntry); - myStream << anEntry.ToCString(); + if (theObject.IsNull()) { + myStream << "None"; + } else { + TCollection_AsciiString anEntry; + TDF_Tool::Entry(theObject->GetEntry(), anEntry); + myStream << anEntry.ToCString(); + } return *this; } diff --git a/src/GEOMBase/GEOMBase_Skeleton.cxx b/src/GEOMBase/GEOMBase_Skeleton.cxx index e9e1c5a37..33a6fe5ac 100644 --- a/src/GEOMBase/GEOMBase_Skeleton.cxx +++ b/src/GEOMBase/GEOMBase_Skeleton.cxx @@ -249,3 +249,20 @@ void GEOMBase_Skeleton::setHelpFileName(const QString& theName) { myHelpFileName = theName; } + +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void GEOMBase_Skeleton::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Key_F1 ) + { + e->accept(); + ClickOnHelp(); + } +} diff --git a/src/GEOMBase/GEOMBase_Skeleton.h b/src/GEOMBase/GEOMBase_Skeleton.h index 3223f6d4b..251c29436 100644 --- a/src/GEOMBase/GEOMBase_Skeleton.h +++ b/src/GEOMBase/GEOMBase_Skeleton.h @@ -58,6 +58,7 @@ private: protected: void closeEvent(QCloseEvent* e); + void keyPressEvent(QKeyEvent* e); /*! initialize "Name" field with a string "thePrefix_X" (Vertex_3) */ diff --git a/src/GEOMBase/Makefile.in b/src/GEOMBase/Makefile.in index b3c750a77..4bdc8b6b1 100644 --- a/src/GEOMBase/Makefile.in +++ b/src/GEOMBase/Makefile.in @@ -58,6 +58,7 @@ LIB_CLIENT_IDL = SALOME_Exception.idl \ SALOMEDS.idl \ SALOMEDS_Attributes.idl \ SALOME_GenericObj.idl \ + SALOME_Component.idl \ GEOM_Gen.idl LIB_SERVER_IDL = diff --git a/src/GEOMContext/GEOM_icons.po b/src/GEOMContext/GEOM_icons.po index 0bd0c46ee..996122d66 100644 --- a/src/GEOMContext/GEOM_icons.po +++ b/src/GEOMContext/GEOM_icons.po @@ -337,6 +337,10 @@ msgstr "supresshole.png" msgid "ICON_DLG_SUPRESS_HOLE_FACE_SHELL" msgstr "supressHolesOnFaceShell.png" +#ChangeOrientationDlg +msgid "ICON_DLG_CHANGE_ORIENTATION" +msgstr "change_orientation.png" + #MultiTranslationDlg msgid "ICON_DLG_MULTITRANSLATION_SIMPLE" msgstr "multitranslationsimple.png" diff --git a/src/GEOMContext/GEOM_msg_en.po b/src/GEOMContext/GEOM_msg_en.po index 03a616200..ae88996a2 100644 --- a/src/GEOMContext/GEOM_msg_en.po +++ b/src/GEOMContext/GEOM_msg_en.po @@ -992,6 +992,10 @@ msgstr "Prism Construction" msgid "GEOM_PRISM_BSV" msgstr "Base Shape + Vector" +#: GeometryGUI_PrismDlg.cxx:83 +msgid "GEOM_PRISM_BSV_2P" +msgstr "Base Shape + 2 Points" + #: GeometryGUI_PropertiesDlg.cxx:56 msgid "GEOM_PROPERTIES_TITLE" msgstr "Basic Properties Informations" diff --git a/src/GEOMContext/GEOM_msg_fr.po b/src/GEOMContext/GEOM_msg_fr.po index 556d2d35f..45c9b0ead 100644 --- a/src/GEOMContext/GEOM_msg_fr.po +++ b/src/GEOMContext/GEOM_msg_fr.po @@ -994,6 +994,10 @@ msgstr "Extruder une Shape de base" msgid "GEOM_PRISM_BSV" msgstr "Shape de base + Vecteur" +#: GeometryGUI_PrismDlg.cxx:83 +msgid "GEOM_PRISM_BSV_2P" +msgstr "Shape de base + 2 Points" + #: GeometryGUI_PropertiesDlg.cxx:56 msgid "GEOM_PROPERTIES_TITLE" msgstr "Proprietes Basiques" diff --git a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx index 3632a9f28..57b182233 100644 --- a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx +++ b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx @@ -39,6 +39,9 @@ #include #include +#include +#include + //================================================================ // Function : GEOMGUI_OCCSelector @@ -209,7 +212,10 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) const LightApp_DataOwner* owner = dynamic_cast( (*itr).operator->() ); if ( owner ) { - globalSelMap[owner->entry()] = 1; + SalomeApp_Study* appStudy = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + QString anEntry = appStudy->referencedToEntry( owner->entry() ); + + globalSelMap[anEntry] = 1; } } } diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 68724bb38..4f3192b3e 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -69,6 +69,7 @@ // OCCT Includes #include #include +#include #include #include #include @@ -520,6 +521,19 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) AISShape->SetDisplayMode( myDisplayMode ); AISShape->SetShadingColor( myShadingColor ); + // Set color for iso lines + SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); + QColor col = aResMgr->colorValue( "Geometry", "isos_color", QColor(int(0.5*255), int(0.5*255), int(0.5*255)) ); + Quantity_Color aColor = SalomeApp_Tools::color( col ); + + Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect(); + anAspect->SetColor( aColor ); + AISShape->Attributes()->SetUIsoAspect( anAspect ); + + anAspect = AISShape->Attributes()->VIsoAspect(); + anAspect->SetColor( aColor ); + AISShape->Attributes()->SetVIsoAspect( anAspect ); + if ( HasColor() ) { AISShape->SetColor( (Quantity_NameOfColor)GetColor() ); @@ -530,6 +544,49 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) AISShape->Attributes()->SetPointAspect( anAspect ); } } + else + { + if ( myShape.ShapeType() == TopAbs_VERTEX ) + { + col = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ); + aColor = SalomeApp_Tools::color( col ); + + Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect(); + anAspect->SetColor( aColor ); + AISShape->Attributes()->SetPointAspect( anAspect ); + } + else + { + // Set line aspect + col = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) ); + aColor = SalomeApp_Tools::color( col ); + + Handle(Prs3d_LineAspect) anAspect = AISShape->Attributes()->LineAspect(); + anAspect->SetColor( aColor ); + AISShape->Attributes()->SetLineAspect( anAspect ); + + // Set unfree boundaries aspect + anAspect = AISShape->Attributes()->UnFreeBoundaryAspect(); + anAspect->SetColor( aColor ); + AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect ); + + // Set free boundaries aspect + col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) ); + aColor = SalomeApp_Tools::color( col ); + + anAspect = AISShape->Attributes()->FreeBoundaryAspect(); + anAspect->SetColor( aColor ); + AISShape->Attributes()->SetFreeBoundaryAspect( anAspect ); + + // Set wire aspect + col = aResMgr->colorValue( "Geometry", "line_color", QColor( 255, 0, 0 ) ); + aColor = SalomeApp_Tools::color( col ); + + anAspect = AISShape->Attributes()->WireAspect(); + anAspect->SetColor( aColor ); + AISShape->Attributes()->SetWireAspect( anAspect ); + } + } if ( HasWidth() ) AISShape->SetWidth( GetWidth() ); diff --git a/src/GEOMGUI/GEOM_images.po b/src/GEOMGUI/GEOM_images.po index 60c149fc1..e8132904a 100644 --- a/src/GEOMGUI/GEOM_images.po +++ b/src/GEOMGUI/GEOM_images.po @@ -307,6 +307,10 @@ msgstr "pointonedge.png" msgid "ICON_DLG_SEWING" msgstr "sewing.png" +#ChangeOrientationDlg +msgid "ICON_DLG_CHANGE_ORIENTATION" +msgstr "change_orientation.png" + #PipeDlg msgid "ICON_DLG_PIPE" msgstr "pipe.png" @@ -315,6 +319,9 @@ msgstr "pipe.png" msgid "ICON_DLG_PRISM" msgstr "prism.png" +msgid "ICON_DLG_PRISM_2P" +msgstr "prism2.png" + #RevolutionDlg msgid "ICON_DLG_REVOL" msgstr "revol.png" @@ -698,6 +705,9 @@ msgstr "free_bound.png" msgid "ICO_CHECK_FREE_FACES" msgstr "free_faces.png" +msgid "ICO_CHANGE_ORIENTATION" +msgstr "change_orientation.png" + msgid "ICO_POINT_COORDS" msgstr "point_coord.png" diff --git a/src/GEOMGUI/GEOM_msg_en.po b/src/GEOMGUI/GEOM_msg_en.po index 0c2e2dcab..6d538e649 100644 --- a/src/GEOMGUI/GEOM_msg_en.po +++ b/src/GEOMGUI/GEOM_msg_en.po @@ -522,8 +522,8 @@ msgid "GEOM_MIRROR" msgstr "Mirror" #Prism -msgid "GEOM_PRISM" -msgstr "Prism" +msgid "GEOM_EXTRUSION" +msgstr "Extrusion" #Sub Shapes msgid "GEOM_SUB_SHAPE" @@ -651,6 +651,10 @@ msgstr "Face" msgid "GEOM_FACES" msgstr "Faces" +#Face or LCS +msgid "GEOM_FACE_OR_LCS" +msgstr "Face or LCS" + #Line msgid "GEOM_LINE" msgstr "Line" @@ -899,7 +903,7 @@ msgstr "Create A Face" #: GeometryGUI_FaceDlg.cxx:78 msgid "GEOM_FACE_FFW" -msgstr "Face from a wire" +msgstr "Face from a closed wire and edge" #: GeometryGUI_FaceDlg.cxx:103 msgid "GEOM_FACE_OPT" @@ -907,7 +911,7 @@ msgstr "Try to create a planar face" #: GeometryGUI_FillingDlg.cxx:53 msgid "GEOM_FILLING_TITLE" -msgstr "Filling Surface With Curves" +msgstr "Filling Surface With Edges" #: GeometryGUI_FillingDlg.cxx:112 msgid "GEOM_FILLING_ARG" @@ -927,7 +931,7 @@ msgstr "Tol. 2D :" #: GeometryGUI_FillingDlg.cxx:170 msgid "GEOM_FILLING_COMPOUND" -msgstr "Curves Comp." +msgstr "Edges compound" #: GeometryGUI_FillingDlg.cxx:184 msgid "GEOM_FILLING_TOL_3D" @@ -1052,13 +1056,16 @@ msgid "GEOM_PLANE_PV" msgstr "Point + Vector" #: GeometryGUI_PrismDlg.cxx:54 -msgid "GEOM_PRISM_TITLE" -msgstr "Prism Construction" +msgid "GEOM_EXTRUSION_TITLE" +msgstr "Construction by Extrusion" #: GeometryGUI_PrismDlg.cxx:83 -msgid "GEOM_PRISM_BSV" +msgid "GEOM_EXTRUSION_BSV" msgstr "Base Shape + Vector" +msgid "GEOM_EXTRUSION_BSV_2P" +msgstr "Base Shape + 2 Points" + #: GeometryGUI_PropertiesDlg.cxx:56 msgid "GEOM_PROPERTIES_TITLE" msgstr "Basic Properties Informations" @@ -1226,7 +1233,7 @@ msgstr "Working Plane Selection" #: GeometryGUI_WorkingPlaneDlg.cxx:107 msgid "GEOM_WPLANE_FACE" -msgstr "Plane Or Planar Face" +msgstr "Plane, Planar Face or LCS" #: GeometryGUI_WorkingPlaneDlg.cxx:107 msgid "GEOM_WPLANE_VECTOR" @@ -1639,6 +1646,12 @@ msgstr "Free boundaries" msgid "GEOM_FREE_FACES" msgstr "Free faces" +msgid "GEOM_CHANGE_ORIENTATION_TITLE" +msgstr "Change orientation" + +msgid "GEOM_CHANGE_ORIENTATION" +msgstr "Objects to change orientation" + msgid "GEOM_BY_PARAMETER" msgstr "By parameter" @@ -1711,6 +1724,9 @@ msgstr "Point Coordinates" msgid "MeasureGUI_PointDlg::COORDINATES" msgstr "Point and its coordinates" +msgid "MeasureGUI_1Sel1TextView1Check_QTD::CHECK_SHAPE_GEOMETRY" +msgstr "Check also geometry" + msgid "GroupGUI_GroupDlg::CREATE_GROUP_TITLE" msgstr "Create Group" @@ -1982,6 +1998,9 @@ msgstr "ProcessShape" msgid "SUPRESS_FACE_NEW_OBJ_NAME" msgstr "SupressFaces" +msgid "CHANGE_ORIENTATION_NEW_OBJ_NAME" +msgstr "Invert" + msgid "NON_GEOM_OBJECTS_SELECTED" msgstr "There are objects selected which do not belong to %1 component." @@ -2200,13 +2219,13 @@ msgid "STB_FILLING" msgstr "Create a filling" msgid "TOP_PIPE" -msgstr "Create a pipe" +msgstr "Extrusion along a path" msgid "MEN_PIPE" -msgstr "Pipe" +msgstr "Extrusion along a path" msgid "STB_PIPE" -msgstr "Create a pipe" +msgstr "Create a shape by Extrusion along a path" msgid "MEN_GROUP" msgstr "Group" @@ -2607,6 +2626,15 @@ msgstr "Check free faces" msgid "STB_CHECK_FREE_FACES" msgstr "Check free faces" +msgid "TOP_CHANGE_ORIENTATION" +msgstr "Change orientation" + +msgid "MEN_CHANGE_ORIENTATION" +msgstr "Change orientation" + +msgid "STB_CHANGE_ORIENTATION" +msgstr "Change orientation" + msgid "MEN_MEASURES" msgstr "Measures" @@ -2907,6 +2935,21 @@ msgstr "General" msgid "PREF_SHADING_COLOR" msgstr "Default shading color" +msgid "PREF_WIREFRAME_COLOR" +msgstr "Default wireframe color" + +msgid "PREF_FREE_BOUND_COLOR" +msgstr "Color of free boundaries" + +msgid "PREF_LINE_COLOR" +msgstr "Color of edges, vectors, wires" + +msgid "PREF_POINT_COLOR" +msgstr "Color of points" + +msgid "PREF_ISOS_COLOR" +msgstr "Color of isolines" + msgid "PREF_STEP_VALUE" msgstr "Step value for spin boxes" @@ -2915,3 +2958,9 @@ msgstr "Default display mode" msgid "PREF_TAB_SETTINGS" msgstr "Settings" + +msgid "ERROR_SHAPE_TYPE" +msgstr "Object of incorrect type selected!\nPlease, select face, shell or solid and try again" + +msgid "DEP_OBJECT" +msgstr "Selected object has been used to create another one\n It can't be deleted " diff --git a/src/GEOMGUI/GEOM_msg_fr.po b/src/GEOMGUI/GEOM_msg_fr.po index 0ccd32f9d..8d5b1b24d 100644 --- a/src/GEOMGUI/GEOM_msg_fr.po +++ b/src/GEOMGUI/GEOM_msg_fr.po @@ -481,7 +481,7 @@ msgstr "Distance" #Filling msgid "GEOM_FILLING" -msgstr "Surface Par Courbes" +msgstr "Surface Par Edges" #Fuse msgid "GEOM_FUSE" @@ -512,7 +512,7 @@ msgid "GEOM_MIRROR" msgstr "Miroir" #Prism -msgid "GEOM_PRISM" +msgid "GEOM_EXTRUSION" msgstr "Extrusion" #Sub Shapes @@ -891,7 +891,7 @@ msgstr "Création d'une Face plane" #: GeometryGUI_FillingDlg.cxx:53 msgid "GEOM_FILLING_TITLE" -msgstr "Surface Par Courbes" +msgstr "Surface Par Edges" #: GeometryGUI_FillingDlg.cxx:112 msgid "GEOM_FILLING_ARG" @@ -911,7 +911,7 @@ msgstr "Tol. 2D" #: GeometryGUI_FillingDlg.cxx:170 msgid "GEOM_FILLING_COMPOUND" -msgstr "Compound de Courbes" +msgstr "Compound de Edges" #: GeometryGUI_FillingDlg.cxx:184 msgid "GEOM_FILLING_TOL_3D" @@ -1036,13 +1036,16 @@ msgid "GEOM_PLANE_PV" msgstr "Point + Vecteur" #: GeometryGUI_PrismDlg.cxx:54 -msgid "GEOM_PRISM_TITLE" +msgid "GEOM_EXTRUSION_TITLE" msgstr "Extruder une Shape de base" #: GeometryGUI_PrismDlg.cxx:83 -msgid "GEOM_PRISM_BSV" +msgid "GEOM_EXTRUSION_BSV" msgstr "Shape de base + Vecteur" +msgid "GEOM_EXTRUSION_BSV_2P" +msgstr "Shape de base + 2 Points" + #: GeometryGUI_PropertiesDlg.cxx:56 msgid "GEOM_PROPERTIES_TITLE" msgstr "Proprietes Basiques" diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index bbaf4214d..e78d469eb 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -96,7 +96,7 @@ bool GeometryGUI::InitGeomGen() //======================================================================= // function : ClientSObjectToObject -// purpose : +// purpose : //======================================================================= CORBA::Object_var GeometryGUI::ClientSObjectToObject (_PTR(SObject) theSObject) { @@ -116,7 +116,7 @@ CORBA::Object_var GeometryGUI::ClientSObjectToObject (_PTR(SObject) theSObject) //======================================================================= // function : ClientStudyToStudy -// purpose : +// purpose : //======================================================================= SALOMEDS::Study_var GeometryGUI::ClientStudyToStudy (_PTR(Study) theStudy) { @@ -171,12 +171,12 @@ GeometryGUI::GeometryGUI() : SalomeApp_Module( "GEOM" ) { if ( CORBA::is_nil( myComponentGeom ) ) - { + { SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA( getApp()->namingService() ); Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "GEOM" ); myComponentGeom = GEOM::GEOM_Gen::_narrow( comp ); } - + myState = -1; myActiveDialogBox = 0; myFatherior = ""; @@ -350,7 +350,7 @@ void GeometryGUI::OnGUIEvent( int id ) bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); // if current viewframe is not of OCC and not of VTK type - return immediately // fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example) - bool NotViewerDependentCommand = ( id == 901 || id == 216 || id == 213 ); + bool NotViewerDependentCommand = ( id == 901 || id == 216 || id == 213 ); if ( !ViewOCC && !ViewVTK && !NotViewerDependentCommand ) return; @@ -486,7 +486,7 @@ void GeometryGUI::OnGUIEvent( int id ) else if( id == 503 || // MENU OPERATION - PARTITION id == 504 || // MENU OPERATION - ARCHIMEDE id == 505 || // MENU OPERATION - FILLET - id == 506 || // MENU OPERATION - CHAMFER + id == 506 || // MENU OPERATION - CHAMFER id == 507 ) { // MENU OPERATION - CLIPPING RANGE #ifndef WNT library = getLibrary( "libOperationGUI.so" ); @@ -503,6 +503,7 @@ void GeometryGUI::OnGUIEvent( int id ) id == 608 || // MENU REPAIR - ADD POINT ON EDGE id == 609 || // MENU REPAIR - FREE BOUNDARIES id == 610 || // MENU REPAIR - FREE FACES + id == 611 || // MENU REPAIR - CHANGE ORIENTATION id == 602 ) { // MENU REPAIR - GLUE FACES #ifndef WNT library = getLibrary( "libRepairGUI.so" ); @@ -548,9 +549,9 @@ void GeometryGUI::OnGUIEvent( int id ) } // call method of corresponding GUI library - if ( library ) + if ( library ) library->OnGUIEvent( id, desk ); - else + else SUIT_MessageBox::error1( desk, tr( "GEOM_ERROR" ), tr( "GEOM_ERR_LIB_NOT_FOUND" ), tr( "GEOM_BUT_OK" ) ); } @@ -577,7 +578,7 @@ void GeometryGUI::OnKeyPress( SUIT_ViewWindow* win, QKeyEvent* pe ) // purpose : Manages mouse move events [static] //================================================================================= void GeometryGUI::OnMouseMove( SUIT_ViewWindow* win, QMouseEvent* pe ) -{ +{ GUIMap::Iterator it; bool bOk = true; for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) { @@ -636,7 +637,7 @@ bool GeometryGUI::SetSettings() { QMenuBar* Mb = parent->getMainMenuBar(); SUIT_Study* ActiveStudy = application()->activeStudy(); - + // Wireframe or Shading int DisplayMode = 0; SUIT_ViewWindow* window = application()->desktop()->activeWindow(); @@ -670,16 +671,16 @@ bool GeometryGUI::SetSettings() // if(!AddInStudy.isEmpty()) // Settings_AddInStudy = AddInStudy.toInt(); // else - + Settings_AddInStudy = 1; Mb->setItemChecked(411, Settings_AddInStudy); - // step value + // step value QString S = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); if(S.isEmpty()) QAD_CONFIG->addSetting("Geometry:SettingsGeomStep", "100"); - // isos + // isos int count = ActiveStudy->getStudyFramesCount(); for(int i = 0; i < count; i++) { if(ActiveStudy->getStudyFrame(i)->getTypeView() == VIEW_OCC) { @@ -703,22 +704,22 @@ bool GeometryGUI::SetSettings() GUIMap::Iterator it; for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) bOk = bOk && it.data()->SetSettings( parent ); - - // MZN: Enable/disable "Clipping range" menu item(from GEOM_CLIPPING variable) + + // MZN: Enable/disable "Clipping range" menu item(from GEOM_CLIPPING variable) if (getenv( "GEOM_CLIPPING" ) == NULL) { QMenuItem* mi = Mb->findItem(50); if (mi && mi->popup()) - mi->popup()->removeItem(507); - } - + mi->popup()->removeItem(507); + } + return bOk; } */ //======================================================================= // function : createGeomAction -// purpose : +// purpose : //======================================================================= void GeometryGUI::createGeomAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle ) { @@ -726,7 +727,7 @@ void GeometryGUI::createGeomAction( const int id, const QString& po_id, const QS QWidget* parent = application()->desktop(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); QPixmap pix; - if ( icon_id.length() ) + if ( icon_id.length() ) pix = resMgr->loadPixmap( "GEOM", tr( icon_id ) ); else pix = resMgr->loadPixmap( "GEOM", tr( QString( "ICO_" )+po_id ), false ); @@ -829,7 +830,8 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( 608, "POINT_ON_EDGE" ); createGeomAction( 609, "CHECK_FREE_BNDS" ); createGeomAction( 610, "CHECK_FREE_FACES" ); - + createGeomAction( 611, "CHANGE_ORIENTATION" ); + createGeomAction( 708, "POINT_COORDS" ); createGeomAction( 701, "BASIC_PROPS" ); createGeomAction( 702, "MASS_CENTER" ); @@ -843,7 +845,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( 7072, "CHECK_COMPOUND" ); createGeomAction( 5103, "CHECK_GEOMETRY" ); - + createGeomAction( 412, "SHADING_COLOR" ); createGeomAction( 413, "ISOS" ); createGeomAction( 414, "STEP_VALUE" ); @@ -894,124 +896,125 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( 4020, basicId, -1 ); int primId = createMenu( tr( "MEN_PRIMITIVES" ), newEntId, -1 ); - createMenu( 4021, primId, -1 ); - createMenu( 4022, primId, -1 ); - createMenu( 4023, primId, -1 ); - createMenu( 4024, primId, -1 ); - createMenu( 4025, primId, -1 ); + createMenu( 4021, primId, -1 ); + createMenu( 4022, primId, -1 ); + createMenu( 4023, primId, -1 ); + createMenu( 4024, primId, -1 ); + createMenu( 4025, primId, -1 ); int genId = createMenu( tr( "MEN_GENERATION" ), newEntId, -1 ); - createMenu( 4031, genId, -1 ); - createMenu( 4032, genId, -1 ); - createMenu( 4033, genId, -1 ); - createMenu( 4034, genId, -1 ); + createMenu( 4031, genId, -1 ); + createMenu( 4032, genId, -1 ); + createMenu( 4033, genId, -1 ); + createMenu( 4034, genId, -1 ); createMenu( separator(), newEntId, -1 ); int groupId = createMenu( tr( "MEN_GROUP" ), newEntId, -1 ); - createMenu( 800, groupId, -1 ); - createMenu( 801, groupId, -1 ); + createMenu( 800, groupId, -1 ); + createMenu( 801, groupId, -1 ); createMenu( separator(), newEntId, -1 ); int blocksId = createMenu( tr( "MEN_BLOCKS" ), newEntId, -1 ); - createMenu( 9997, blocksId, -1 ); - createMenu( 9999, blocksId, -1 ); + createMenu( 9997, blocksId, -1 ); + createMenu( 9999, blocksId, -1 ); createMenu( separator(), newEntId, -1 ); - createMenu( 404, newEntId, -1 ); + createMenu( 404, newEntId, -1 ); createMenu( separator(), newEntId, -1 ); - createMenu( 407, newEntId, -1 ); + createMenu( 407, newEntId, -1 ); int buildId = createMenu( tr( "MEN_BUILD" ), newEntId, -1 ); - createMenu( 4081, buildId, -1 ); - createMenu( 4082, buildId, -1 ); - createMenu( 4083, buildId, -1 ); - createMenu( 4084, buildId, -1 ); - createMenu( 4085, buildId, -1 ); - createMenu( 4086, buildId, -1 ); + createMenu( 4081, buildId, -1 ); + createMenu( 4082, buildId, -1 ); + createMenu( 4083, buildId, -1 ); + createMenu( 4084, buildId, -1 ); + createMenu( 4085, buildId, -1 ); + createMenu( 4086, buildId, -1 ); int operId = createMenu( tr( "MEN_OPERATIONS" ), -1, -1, 10 ); int boolId = createMenu( tr( "MEN_BOOLEAN" ), operId, -1 ); - createMenu( 5011, boolId, -1 ); - createMenu( 5012, boolId, -1 ); - createMenu( 5013, boolId, -1 ); - createMenu( 5014, boolId, -1 ); + createMenu( 5011, boolId, -1 ); + createMenu( 5012, boolId, -1 ); + createMenu( 5013, boolId, -1 ); + createMenu( 5014, boolId, -1 ); int transId = createMenu( tr( "MEN_TRANSFORMATION" ), operId, -1 ); - createMenu( 5021, transId, -1 ); - createMenu( 5022, transId, -1 ); - createMenu( 5023, transId, -1 ); - createMenu( 5024, transId, -1 ); - createMenu( 5025, transId, -1 ); - createMenu( 5026, transId, -1 ); + createMenu( 5021, transId, -1 ); + createMenu( 5022, transId, -1 ); + createMenu( 5023, transId, -1 ); + createMenu( 5024, transId, -1 ); + createMenu( 5025, transId, -1 ); + createMenu( 5026, transId, -1 ); createMenu( separator(), transId, -1 ); - createMenu( 5027, transId, -1 ); - createMenu( 5028, transId, -1 ); + createMenu( 5027, transId, -1 ); + createMenu( 5028, transId, -1 ); - createMenu( 503, operId, -1 ); - createMenu( 504, operId, -1 ); + createMenu( 503, operId, -1 ); + createMenu( 504, operId, -1 ); createMenu( separator(), operId, -1 ); - createMenu( 505, transId, -1 ); - createMenu( 506, transId, -1 ); - //createMenu( 507, transId, -1 ); + createMenu( 505, transId, -1 ); + createMenu( 506, transId, -1 ); + //createMenu( 507, transId, -1 ); int blockId = createMenu( tr( "MEN_BLOCKS" ), operId, -1 ); - createMenu( 9998, blockId, -1 ); - createMenu( 9995, blockId, -1 ); - createMenu( 99991, blockId, -1 ); + createMenu( 9998, blockId, -1 ); + createMenu( 9995, blockId, -1 ); + createMenu( 99991, blockId, -1 ); int repairId = createMenu( tr( "MEN_REPAIR" ), -1, -1, 10 ); - createMenu( 605, repairId, -1 ); - createMenu( 603, repairId, -1 ); - createMenu( 606, repairId, -1 ); - createMenu( 607, repairId, -1 ); - createMenu( 604, repairId, -1 ); - createMenu( 601, repairId, -1 ); - createMenu( 602, repairId, -1 ); - createMenu( 608, repairId, -1 ); - createMenu( 609, repairId, -1 ); - createMenu( 610, repairId, -1 ); + createMenu( 605, repairId, -1 ); + createMenu( 603, repairId, -1 ); + createMenu( 606, repairId, -1 ); + createMenu( 607, repairId, -1 ); + createMenu( 604, repairId, -1 ); + createMenu( 601, repairId, -1 ); + createMenu( 602, repairId, -1 ); + createMenu( 608, repairId, -1 ); + createMenu( 609, repairId, -1 ); + createMenu( 610, repairId, -1 ); + createMenu( 611, repairId, -1 ); int measurId = createMenu( tr( "MEN_MEASURES" ), -1, -1, 10 ); - createMenu( 708, measurId, -1 ); - createMenu( 701, measurId, -1 ); + createMenu( 708, measurId, -1 ); + createMenu( 701, measurId, -1 ); createMenu( separator(), measurId, -1 ); - createMenu( 702, measurId, -1 ); - createMenu( 703, measurId, -1 ); + createMenu( 702, measurId, -1 ); + createMenu( 703, measurId, -1 ); createMenu( separator(), measurId, -1 ); int dimId = createMenu( tr( "MEN_DIMENSIONS" ), measurId, -1 ); - createMenu( 7041, dimId, -1 ); + createMenu( 7041, dimId, -1 ); createMenu( 7042, dimId, -1 ); createMenu( separator(), measurId, -1 ); - - createMenu( 705, measurId, -1 ); + + createMenu( 705, measurId, -1 ); createMenu( separator(), measurId, -1 ); - createMenu( 706, measurId, -1 ); - createMenu( 707, measurId, -1 ); - createMenu( 7072, measurId, -1 ); + createMenu( 706, measurId, -1 ); + createMenu( 707, measurId, -1 ); + createMenu( 7072, measurId, -1 ); int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 50 ); createMenu( separator(), toolsId, -1 ); - createMenu( 5103, toolsId, -1 ); - + createMenu( 5103, toolsId, -1 ); + //int prefId = createMenu( tr( "MEN_PREFERENCES" ), -1, -1, 50 ); //createMenu( separator(), prefId, -1 ); //int geomId = createMenu( tr( "MEN_PREFERENCES_GEOM" ), prefId, -1 ); - //createMenu( 412, geomId, -1 ); - //createMenu( 413, geomId, -1 ); - //createMenu( 414, geomId, -1 ); + //createMenu( 412, geomId, -1 ); + //createMenu( 413, geomId, -1 ); + //createMenu( 414, geomId, -1 ); //createMenu( separator(), prefId, -1 ); int viewId = createMenu( tr( "MEN_VIEW" ), -1, -1 ); createMenu( separator(), viewId, -1 ); int dispmodeId = createMenu( tr( "MEN_DISPLAY_MODE" ), viewId, -1 ); - createMenu( 211, dispmodeId, -1 ); - + createMenu( 211, dispmodeId, -1 ); + createMenu( separator(), viewId, -1 ); - createMenu( 212, viewId, -1 ); - createMenu( 214, viewId, -1 ); + createMenu( 212, viewId, -1 ); + createMenu( 214, viewId, -1 ); createMenu( separator(), viewId, -1 ); /* @@ -1019,8 +1022,8 @@ void GeometryGUI::initialize( CAM_Application* app ) because of these items are accessible through object browser and viewers we have removed they from main menu - createMenu( 216, viewId, -1 ); - createMenu( 213, viewId, -1 ); + createMenu( 216, viewId, -1 ); + createMenu( 213, viewId, -1 ); createMenu( 215, viewId, -1 ); */ @@ -1039,59 +1042,63 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( 4020, basicTbId ); int primTbId = createTool( tr( "TOOL_PRIMITIVES" ) ); - createTool( 4021, primTbId ); - createTool( 4022, primTbId ); - createTool( 4023, primTbId ); - createTool( 4024, primTbId ); - createTool( 4025, primTbId ); + createTool( 4021, primTbId ); + createTool( 4022, primTbId ); + createTool( 4023, primTbId ); + createTool( 4024, primTbId ); + createTool( 4025, primTbId ); int boolTbId = createTool( tr( "TOOL_BOOLEAN" ) ); - createTool( 5011, boolTbId ); - createTool( 5012, boolTbId ); - createTool( 5013, boolTbId ); - createTool( 5014, boolTbId ); + createTool( 5011, boolTbId ); + createTool( 5012, boolTbId ); + createTool( 5013, boolTbId ); + createTool( 5014, boolTbId ); int genTbId = createTool( tr( "TOOL_GENERATION" ) ); - createTool( 4031, genTbId ); - createTool( 4032, genTbId ); - createTool( 4033, genTbId ); - createTool( 4034, genTbId ); + createTool( 4031, genTbId ); + createTool( 4032, genTbId ); + createTool( 4033, genTbId ); + createTool( 4034, genTbId ); int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ) ); - createTool( 5021, transTbId ); - createTool( 5022, transTbId ); - createTool( 5023, transTbId ); - createTool( 5024, transTbId ); - createTool( 5025, transTbId ); - createTool( 5026, transTbId ); + createTool( 5021, transTbId ); + createTool( 5022, transTbId ); + createTool( 5023, transTbId ); + createTool( 5024, transTbId ); + createTool( 5025, transTbId ); + createTool( 5026, transTbId ); createTool( separator(), transTbId ); - createTool( 5027, transTbId ); + createTool( 5027, transTbId ); createTool( 5028, transTbId ); + // ---- create popup menus -------------------------- + + QString clientOCCorVTK = "(client='OCCViewer' or client='VTKViewer')"; + QString clientOCCorVTK_AndSomeVisible = clientOCCorVTK + " and selcount>0 and isVisible"; + QtxPopupMgr* mgr = popupMgr(); - mgr->insert( action( 901 ), -1, -1 ); // rename + mgr->insert( action( 901 ), -1, -1 ); // rename mgr->setRule( action( 901 ), "$type in {'Shape' 'Group'} and selcount=1", true ); mgr->insert( action( 8001 ), -1, -1 ); // create group mgr->setRule( action( 8001 ), "client='ObjectBrowser' and type='Shape' and selcount=1 and isOCC=true", true ); - mgr->insert( action( 801 ), -1, -1 ); // edit group + mgr->insert( action( 801 ), -1, -1 ); // edit group mgr->setRule( action( 801 ), "client='ObjectBrowser' and type='Group' and selcount=1 and isOCC=true", true ); - mgr->insert( separator(), -1, -1 ); // ----------- + mgr->insert( separator(), -1, -1 ); // ----------- dispmodeId = mgr->insert( tr( "MEN_DISPLAY_MODE" ), -1, -1 ); // display mode menu mgr->insert( action( 80311 ), dispmodeId, -1 ); // wireframe - mgr->setRule( action( 80311 ), "(client='OCCViewer' or client='VTKViewer') and selcount>0 and isVisible", true ); - mgr->setRule( action( 80311 ), "(client='OCCViewer' or client='VTKViewer') and displaymode='Wireframe'", false ); + mgr->setRule( action( 80311 ), clientOCCorVTK_AndSomeVisible, true ); + mgr->setRule( action( 80311 ), clientOCCorVTK + " and displaymode='Wireframe'", false ); mgr->insert( action( 80312 ), dispmodeId, -1 ); // shading - mgr->setRule( action( 80312 ), "(client='OCCViewer' or client='VTKViewer') and selcount>0 and isVisible", true ); - mgr->setRule( action( 80312 ), "(client='OCCViewer' or client='VTKViewer') and displaymode='Shading'", false ); - mgr->insert( separator(), -1, -1 ); // ----------- + mgr->setRule( action( 80312 ), clientOCCorVTK_AndSomeVisible, true ); + mgr->setRule( action( 80312 ), clientOCCorVTK + " and displaymode='Shading'", false ); + mgr->insert( separator(), -1, -1 ); // ----------- mgr->insert( action( 8032 ), -1, -1 ); // color - mgr->setRule( action( 8032 ), "(client='OCCViewer' or client='VTKViewer') and selcount>0 and isVisible", true ); + mgr->setRule( action( 8032 ), clientOCCorVTK_AndSomeVisible + " and ($component={'GEOM'})", true ); mgr->insert( action( 8033 ), -1, -1 ); // transparency - mgr->setRule( action( 8033 ), "(client='OCCViewer' or client='VTKViewer') and selcount>0 and isVisible", true ); + mgr->setRule( action( 8033 ), clientOCCorVTK_AndSomeVisible, true ); mgr->insert( action( 8034 ), -1, -1 ); // isos mgr->setRule( action( 8034 ), "client='OCCViewer' and selcount>0 and isVisible", true ); - mgr->insert( separator(), -1, -1 ); // ----------- - + mgr->insert( separator(), -1, -1 ); // ----------- QString canDisplay = "($component={'GEOM'}) and (selcount>0) and ({true} in $canBeDisplayed) ", @@ -1106,7 +1113,7 @@ void GeometryGUI::initialize( CAM_Application* app ) mgr->setRule( action( 215 ), rule.arg( types ).arg( "isVisible" ), true ); mgr->insert( action( 214 ), -1, -1 ); // erase All - mgr->setRule( action( 214 ), "client='OCCViewer' or client='VTKViewer'", true ); + mgr->setRule( action( 214 ), clientOCCorVTK, true ); mgr->insert( action( 213 ), -1, -1 ); // display only mgr->setRule( action( 213 ), rule.arg( types ).arg( "true" ), true ); @@ -1178,14 +1185,20 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study ) setMenuShown( false ); setToolShown( false ); - disconnect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ), + disconnect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ), this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) ); EmitSignalCloseAllDialogs(); GUIMap::Iterator it; for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) - it.data()->deactivate(); + it.data()->deactivate(); + + // Unset actions accelerator keys + //action(111)->setAccel(QKeySequence()); // Import + //action(121)->setAccel(QKeySequence()); // Export + action(111)->setEnabled(false); // Import + action(121)->setEnabled(false); // Export // Unset actions accelerator keys //action(111)->setAccel(QKeySequence()); // Import @@ -1279,7 +1292,7 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr if( nbSel == 0 ) { ////// NOTHING SELECTED popup->clear(); - } + } else if ( nbSel == 1 ) { ////// SINGLE OBJECT SELECTION if ( parentComponent != parent->getActiveComponent() ) { @@ -1506,7 +1519,7 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr //======================================================================= // function : GeometryGUI::BuildPresentation() -// purpose : +// purpose : //======================================================================= void GeometryGUI::BuildPresentation( const Handle(SALOME_InteractiveObject)& io, SUIT_ViewWindow* win ) { @@ -1524,7 +1537,7 @@ void GeometryGUI::onWindowActivated( SUIT_ViewWindow* win ) const bool ViewOCC = ( win->getViewManager()->getType() == OCCViewer_Viewer::Type() ); // const bool ViewVTK = ( win->getViewManager()->getType() == SVTK_Viewer::Type() ); - + // disable non-OCC viewframe menu commands // action( 404 )->setEnabled( ViewOCC ); // SKETCHER action( 603 )->setEnabled( ViewOCC ); // SuppressFace @@ -1645,34 +1658,60 @@ void GeometryGUI::createPreferences() int tabId = addPreference( tr( "PREF_TAB_SETTINGS" ) ); int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId ); - addPreference( tr( "PREF_SHADING_COLOR" ), genGroup, - LightApp_Preferences::Color, "Geometry", "shading_color" ); - int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup, - LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" ); + setPreferenceProperty( genGroup, "columns", 1 ); + int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup, LightApp_Preferences::Selector, "Geometry", "display_mode" ); - setPreferenceProperty( genGroup, "columns", 1 ); + addPreference( tr( "PREF_SHADING_COLOR" ), genGroup, + LightApp_Preferences::Color, "Geometry", "shading_color" ); - setPreferenceProperty( step, "min", 0.001 ); - setPreferenceProperty( step, "max", 10000 ); - setPreferenceProperty( step, "precision", 3 ); + addPreference( tr( "PREF_WIREFRAME_COLOR" ), genGroup, + LightApp_Preferences::Color, "Geometry", "wireframe_color" ); + + addPreference( tr( "PREF_FREE_BOUND_COLOR" ), genGroup, + LightApp_Preferences::Color, "Geometry", "free_bound_color" ); + + addPreference( tr( "PREF_LINE_COLOR"), genGroup, + LightApp_Preferences::Color, "Geometry", "line_color" ); + + addPreference( tr( "PREF_POINT_COLOR"), genGroup, + LightApp_Preferences::Color, "Geometry", "point_color" ); + + addPreference( tr( "PREF_ISOS_COLOR" ), genGroup, + LightApp_Preferences::Color, "Geometry", "isos_color" ); + + int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup, + LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" ); // Set property for default display mode QStringList aModesList; aModesList.append( tr("MEN_WIREFRAME") ); aModesList.append( tr("MEN_SHADING") ); - + QValueList anIndexesList; anIndexesList.append(0); anIndexesList.append(1); - + setPreferenceProperty( dispmode, "strings", aModesList ); setPreferenceProperty( dispmode, "indexes", anIndexesList ); + + // Set property for step value for spinboxes + setPreferenceProperty( step, "min", 0.001 ); + setPreferenceProperty( step, "max", 10000 ); + setPreferenceProperty( step, "precision", 3 ); + } void GeometryGUI::preferencesChanged( const QString& section, const QString& param ) { + if (section == "Geometry") { + SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); + if (param == QString("SettingsGeomStep")) { + double spin_step = aResourceMgr->doubleValue(section, param, 100.); + EmitSignalDefaultStepValueChanged(spin_step); + } + } } LightApp_Displayer* GeometryGUI::displayer() diff --git a/src/GEOMGUI/GeometryGUI_Swig.cxx b/src/GEOMGUI/GeometryGUI_Swig.cxx index 6eebe4a5d..c94dfdb9f 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.cxx +++ b/src/GEOMGUI/GeometryGUI_Swig.cxx @@ -110,14 +110,16 @@ GEOM_Swig::~GEOM_Swig() // MESSAGE("Destructeur"); } -void GEOM_Swig::createAndDisplayGO (const char* Entry) +void GEOM_Swig::createAndDisplayGO (const char* Entry, bool isUpdated) { class TEvent: public SALOME_Event { std::string myEntry; + bool myUpdateViewer; public: - TEvent(const char* theEntry): - myEntry(theEntry) + TEvent(const char* theEntry, bool toUpdateViewer): + myEntry(theEntry), + myUpdateViewer(toUpdateViewer) {} virtual void Execute() { @@ -179,7 +181,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry) "GEOM", const_cast( obj->GetID().c_str())); - GEOM_Displayer(ActiveStudy).Display(anIO, true); + GEOM_Displayer(ActiveStudy).Display(anIO, myUpdateViewer); /*if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(app)) { SVTK_View* aView = aViewWindow->getView(); int aMode = aView->GetDisplayMode(); @@ -217,7 +219,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry) }; // MESSAGE("createAndDisplayGO"); - ProcessVoidEvent(new TEvent (Entry)); + ProcessVoidEvent(new TEvent (Entry, isUpdated)); class TEventUpdateBrowser: public SALOME_Event { @@ -234,7 +236,8 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry) } }; - ProcessVoidEvent(new TEventUpdateBrowser ()); + if (isUpdated) + ProcessVoidEvent(new TEventUpdateBrowser ()); } void GEOM_Swig::createAndDisplayFitAllGO (const char* Entry) @@ -267,6 +270,25 @@ void GEOM_Swig::createAndDisplayFitAllGO (const char* Entry) ProcessVoidEvent(new TEventFitAll()); } +void GEOM_Swig::UpdateViewer() +{ + class TEventUpdateViewer: public SALOME_Event + { + public: + TEventUpdateViewer() {} + virtual void Execute() { + SUIT_Application* app = SUIT_Session::session()->activeApplication(); + if (!app) return; + SalomeApp_Study* ActiveStudy = dynamic_cast(app->activeStudy()); + if (!ActiveStudy) return; + + GEOM_Displayer(ActiveStudy).UpdateViewer(); + } + }; + + ProcessVoidEvent(new TEventUpdateViewer()); +} + int GEOM_Swig::getIndexTopology(const char* SubIOR, const char* IOR) { GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen(); @@ -345,14 +367,15 @@ const char* GEOM_Swig::getShapeTypeIcon(const char* IOR) return "None"; } -void GEOM_Swig::setDisplayMode(const char* theEntry, int theMode) +void GEOM_Swig::setDisplayMode(const char* theEntry, int theMode, bool isUpdated) { class TEvent: public SALOME_Event { std::string myEntry; int myMode; + bool myUpdateViewer; public: - TEvent(const char* theEntryArg, int theModeArg): - myEntry(theEntryArg), myMode(theModeArg) + TEvent(const char* theEntryArg, int theModeArg, bool theUpdated): + myEntry(theEntryArg), myMode(theModeArg), myUpdateViewer(theUpdated) {} virtual void Execute() { SUIT_Application* anApp = SUIT_Session::session()->activeApplication(); @@ -364,29 +387,31 @@ void GEOM_Swig::setDisplayMode(const char* theEntry, int theMode) if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)) { SVTK_View* aView = aViewWindow->getView(); aView->SetDisplayMode(anIO, myMode); - aView->Repaint(); + if (myUpdateViewer) + aView->Repaint(); } else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) { SOCC_Viewer* soccViewer = dynamic_cast(occViewer); if (soccViewer) - soccViewer->switchRepresentation(anIO, myMode); + soccViewer->switchRepresentation(anIO, myMode, myUpdateViewer); } } }; - ProcessVoidEvent(new TEvent (theEntry, theMode)); + ProcessVoidEvent(new TEvent (theEntry, theMode, isUpdated)); } -void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue) +void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue, bool isUpdated) { class TEvent: public SALOME_Event { std::string myEntry; int myRed; int myGreen; int myBlue; + bool myUpdateViewer; public: - TEvent(const char* theEntryArg, int theR, int theG, int theB): - myEntry(theEntryArg), myRed(theR), myGreen(theG), myBlue(theB) + TEvent(const char* theEntryArg, int theR, int theG, int theB, bool theUpdated): + myEntry(theEntryArg), myRed(theR), myGreen(theG), myBlue(theB), myUpdateViewer(theUpdated) {} virtual void Execute() { SUIT_Application* anApp = SUIT_Session::session()->activeApplication(); @@ -399,7 +424,8 @@ void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue) SVTK_View* aView = aViewWindow->getView(); QColor aColor (myRed, myGreen, myBlue); aView->SetColor(anIO, aColor); - aView->Repaint(); + if (myUpdateViewer) + aView->Repaint(); } else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) { Handle(AIS_InteractiveContext) ic = occViewer->getAISContext(); AIS_ListOfInteractive List; @@ -414,25 +440,27 @@ void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue) ite.Value()->SetColor(CSFColor); if (ite.Value()->IsKind(STANDARD_TYPE(GEOM_AISShape))) Handle(GEOM_AISShape)::DownCast(ite.Value())->SetShadingColor(CSFColor); - ite.Value()->Redisplay(Standard_True); - occViewer->update(); + ic->Redisplay(ite.Value(), true, true); + if (myUpdateViewer) + occViewer->update(); break; } } } } }; - ProcessVoidEvent(new TEvent(theEntry, red, green, blue)); + ProcessVoidEvent(new TEvent(theEntry, red, green, blue, isUpdated)); } -void GEOM_Swig::setTransparency(const char* theEntry, float transp) +void GEOM_Swig::setTransparency(const char* theEntry, float transp, bool isUpdated) { class TEvent: public SALOME_Event { std::string myEntry; float myParam; + bool myUpdateViewer; public: - TEvent(const char* theEntryArg, float theParam): - myEntry(theEntryArg), myParam(theParam) + TEvent(const char* theEntryArg, float theParam, bool theUpdated): + myEntry(theEntryArg), myParam(theParam), myUpdateViewer(theUpdated) {} virtual void Execute() { SUIT_Application* anApp = SUIT_Session::session()->activeApplication(); @@ -444,16 +472,17 @@ void GEOM_Swig::setTransparency(const char* theEntry, float transp) if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)) { SVTK_View* aView = aViewWindow->getView(); aView->SetTransparency(anIO, myParam); - aView->Repaint(); + if (myUpdateViewer) + aView->Repaint(); } else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) { SOCC_Viewer* soccViewer = dynamic_cast(occViewer); if (soccViewer) - soccViewer->setTransparency(anIO, myParam); + soccViewer->setTransparency(anIO, myParam, myUpdateViewer); } } }; - ProcessVoidEvent(new TEvent (theEntry, transp)); + ProcessVoidEvent(new TEvent (theEntry, transp, isUpdated)); } diff --git a/src/GEOMGUI/GeometryGUI_Swig.hxx b/src/GEOMGUI/GeometryGUI_Swig.hxx index e441a6cdc..86fa64594 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.hxx +++ b/src/GEOMGUI/GeometryGUI_Swig.hxx @@ -45,12 +45,13 @@ public: GEOM_Swig(); ~GEOM_Swig(); - void createAndDisplayGO(const char* Entry); + void createAndDisplayGO(const char* Entry, bool isUpdated = true); void eraseGO(const char* Entry, bool allWindows); void createAndDisplayFitAllGO(const char* Entry); - void setDisplayMode(const char* Entry, int mode); - void setColor(const char* Entry, int red, int green, int blue); - void setTransparency(const char* Entry, float transp); + void UpdateViewer(); + void setDisplayMode(const char* Entry, int mode, bool isUpdated = true); + void setColor(const char* Entry, int red, int green, int blue, bool isUpdated = true); + void setTransparency(const char* Entry, float transp, bool isUpdated = true); void setDeflection(const char* Entry, float deflect); int getIndexTopology(const char *SubEntry, const char *Entry); diff --git a/src/GEOMGUI/GeometryGUI_Swig.i b/src/GEOMGUI/GeometryGUI_Swig.i index 07a99e9ac..d562c0ffc 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.i +++ b/src/GEOMGUI/GeometryGUI_Swig.i @@ -1,23 +1,23 @@ // GEOM GEOMGUI : GUI for Geometry component // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -30,23 +30,44 @@ #include "GeometryGUI_Swig.hxx" %} +/* + managing C++ exception in the Python API +*/ +%exception +{ + class PyAllowThreadsGuard { + public: + // Py_BEGIN_ALLOW_THREADS + PyAllowThreadsGuard() { _save = PyEval_SaveThread(); } + // Py_END_ALLOW_THREADS + ~PyAllowThreadsGuard() { PyEval_RestoreThread(_save); } + private: + PyThreadState *_save; + }; + + PyAllowThreadsGuard guard; + + $action +} + class GEOM_Swig { public: GEOM_Swig(); ~GEOM_Swig(); - void createAndDisplayGO(const char* Entry); + void createAndDisplayGO(const char* Entry, bool isUpdated =true); void eraseGO(const char* Entry, bool allWindows); void createAndDisplayFitAllGO(const char* Entry); + void UpdateViewer(); int getIndexTopology(const char *SubEntry, const char *Entry); const char* getShapeTypeString(const char *Entry); - void setDisplayMode(const char* Entry, int mode); - void setColor(const char* Entry, int red, int green, int blue); - void setTransparency(const char* Entry, float transp); + void setDisplayMode(const char* Entry, int mode, bool isUpdated =true); + void setColor(const char* Entry, int red, int green, int blue, bool isUpdated =true); + void setTransparency(const char* Entry, float transp, bool isUpdated =true); void setDeflection(const char* Entry, float deflect); const char* getShapeTypeIcon(const char *Ior); - + bool initGeomGen(); }; diff --git a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx index a0ae0bc0c..045ca5ade 100644 --- a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx @@ -1,36 +1,42 @@ // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include - #include #include #include +#include #include +#include #include #include #include #include #include #include +#include +#include +#include +#include +#include +#include #include #include @@ -54,6 +60,30 @@ GEOMImpl_BooleanDriver::GEOMImpl_BooleanDriver() { } +void AddSimpleShapes(TopoDS_Shape theShape, TopTools_ListOfShape& theList) +{ + if (theShape.ShapeType() != TopAbs_COMPOUND && + theShape.ShapeType() != TopAbs_COMPSOLID) { + theList.Append(theShape); + return; + } + + TopTools_MapOfShape mapShape; + TopoDS_Iterator It (theShape, Standard_True, Standard_True); + + for (; It.More(); It.Next()) { + TopoDS_Shape aShape_i = It.Value(); + if (mapShape.Add(aShape_i)) { + if (aShape_i.ShapeType() == TopAbs_COMPOUND || + aShape_i.ShapeType() == TopAbs_COMPSOLID) { + AddSimpleShapes(aShape_i, theList); + } else { + theList.Append(aShape_i); + } + } + } +} + //======================================================================= //function : Execute //purpose : @@ -73,38 +103,200 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const TopoDS_Shape aShape1 = aRefShape1->GetValue(); TopoDS_Shape aShape2 = aRefShape2->GetValue(); if (!aShape1.IsNull() && !aShape2.IsNull()) { + + // perform COMMON operation if (aType == BOOLEAN_COMMON) { - BRepAlgoAPI_Common BO (aShape1, aShape2); -// BO.Build(); - if (!BO.IsDone()) { - StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes"); + BRep_Builder B; + TopoDS_Compound C; + B.MakeCompound(C); + + TopTools_ListOfShape listShape1, listShape2; + AddSimpleShapes(aShape1, listShape1); + AddSimpleShapes(aShape2, listShape2); + + Standard_Boolean isCompound = + (listShape1.Extent() > 1 || listShape2.Extent() > 1); + + TopTools_ListIteratorOfListOfShape itSub1 (listShape1); + for (; itSub1.More(); itSub1.Next()) { + TopoDS_Shape aValue1 = itSub1.Value(); + TopTools_ListIteratorOfListOfShape itSub2 (listShape2); + for (; itSub2.More(); itSub2.Next()) { + TopoDS_Shape aValue2 = itSub2.Value(); + BRepAlgoAPI_Common BO (aValue1, aValue2); + if (!BO.IsDone()) { + StdFail_NotDone::Raise("Common operation can not be performed on the given shapes"); + } + if (isCompound) { + TopoDS_Shape aStepResult = BO.Shape(); + + // check result of this step: if it is a compound (boolean operations + // allways return a compound), we add all sub-shapes of it. + // This allows to avoid adding empty compounds, + // resulting from COMMON on two non-intersecting shapes. + if (aStepResult.ShapeType() == TopAbs_COMPOUND) { + TopoDS_Iterator aCompIter (aStepResult); + for (; aCompIter.More(); aCompIter.Next()) { + // add shape in a result + B.Add(C, aCompIter.Value()); + } + } + else { + // add shape in a result + B.Add(C, aStepResult); + } + } + else + aShape = BO.Shape(); + } } - aShape = BO.Shape(); - } else if (aType == BOOLEAN_CUT) { - BRepAlgoAPI_Cut BO (aShape1, aShape2); - if (!BO.IsDone()) { - StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes"); + + if (isCompound) { + TopTools_ListOfShape listShapeC; + AddSimpleShapes(C, listShapeC); + TopTools_ListIteratorOfListOfShape itSubC (listShapeC); + bool isOnlySolids = true; + for (; itSubC.More(); itSubC.Next()) { + TopoDS_Shape aValueC = itSubC.Value(); + if (aValueC.ShapeType() != TopAbs_SOLID) isOnlySolids = false; + } + if (isOnlySolids) + aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion()); + else + aShape = C; } - aShape = BO.Shape(); - } else if (aType == BOOLEAN_FUSE) { + } + + // perform CUT operation + else if (aType == BOOLEAN_CUT) { + BRep_Builder B; + TopoDS_Compound C; + B.MakeCompound(C); + + TopTools_ListOfShape listShapes, listTools; + AddSimpleShapes(aShape1, listShapes); + AddSimpleShapes(aShape2, listTools); + + Standard_Boolean isCompound = (listShapes.Extent() > 1); + + TopTools_ListIteratorOfListOfShape itSub1 (listShapes); + for (; itSub1.More(); itSub1.Next()) { + TopoDS_Shape aCut = itSub1.Value(); + // tools + TopTools_ListIteratorOfListOfShape itSub2 (listTools); + for (; itSub2.More(); itSub2.Next()) { + TopoDS_Shape aTool = itSub2.Value(); + BRepAlgoAPI_Cut BO (aCut, aTool); + if (!BO.IsDone()) { + StdFail_NotDone::Raise("Cut operation can not be performed on the given shapes"); + } + aCut = BO.Shape(); + } + if (isCompound) { + // check result of this step: if it is a compound (boolean operations + // allways return a compound), we add all sub-shapes of it. + // This allows to avoid adding empty compounds, + // resulting from CUT of parts + if (aCut.ShapeType() == TopAbs_COMPOUND) { + TopoDS_Iterator aCompIter (aCut); + for (; aCompIter.More(); aCompIter.Next()) { + // add shape in a result + B.Add(C, aCompIter.Value()); + } + } + else { + // add shape in a result + B.Add(C, aCut); + } + } + else + aShape = aCut; + } + + if (isCompound) { + TopTools_ListOfShape listShapeC; + AddSimpleShapes(C, listShapeC); + TopTools_ListIteratorOfListOfShape itSubC (listShapeC); + bool isOnlySolids = true; + for (; itSubC.More(); itSubC.Next()) { + TopoDS_Shape aValueC = itSubC.Value(); + if (aValueC.ShapeType() != TopAbs_SOLID) isOnlySolids = false; + } + if (isOnlySolids) + aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion()); + else + aShape = C; + } + } + + // perform FUSE operation + else if (aType == BOOLEAN_FUSE) { BRepAlgoAPI_Fuse BO (aShape1, aShape2); if (!BO.IsDone()) { - StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes"); + StdFail_NotDone::Raise("Fuse operation can not be performed on the given shapes"); } aShape = BO.Shape(); - } else if (aType == BOOLEAN_SECTION) { - BRepAlgoAPI_Section BO (aShape1, aShape2); - if (!BO.IsDone()) { - StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes"); + } + + // perform SECTION operation + else if (aType == BOOLEAN_SECTION) { + BRep_Builder B; + TopoDS_Compound C; + B.MakeCompound(C); + + TopTools_ListOfShape listShape1, listShape2; + AddSimpleShapes(aShape1, listShape1); + AddSimpleShapes(aShape2, listShape2); + + Standard_Boolean isCompound = + (listShape1.Extent() > 1 || listShape2.Extent() > 1); + + TopTools_ListIteratorOfListOfShape itSub1 (listShape1); + for (; itSub1.More(); itSub1.Next()) { + TopoDS_Shape aValue1 = itSub1.Value(); + TopTools_ListIteratorOfListOfShape itSub2 (listShape2); + for (; itSub2.More(); itSub2.Next()) { + TopoDS_Shape aValue2 = itSub2.Value(); + BRepAlgoAPI_Section BO (aValue1, aValue2); + if (!BO.IsDone()) { + StdFail_NotDone::Raise("Section operation can not be performed on the given shapes"); + } + if (isCompound) { + TopoDS_Shape aStepResult = BO.Shape(); + + // check result of this step: if it is a compound (boolean operations + // allways return a compound), we add all sub-shapes of it. + // This allows to avoid adding empty compounds, + // resulting from SECTION on two non-intersecting shapes. + if (aStepResult.ShapeType() == TopAbs_COMPOUND) { + TopoDS_Iterator aCompIter (aStepResult); + for (; aCompIter.More(); aCompIter.Next()) { + // add shape in a result + B.Add(C, aCompIter.Value()); + } + } + else { + // add shape in a result + B.Add(C, aStepResult); + } + } + else + aShape = BO.Shape(); + } } - aShape = BO.Shape(); - } else { + + if (isCompound) + aShape = C; + } + + // UNKNOWN operation + else { } } if (aShape.IsNull()) return 0; if (!BRepAlgo::IsValid(aShape)) { - Standard_ConstructionError::Raise("Boolean aborted : non valid shape result"); + Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result"); } aFunction->SetValue(aShape); diff --git a/src/GEOMImpl/GEOMImpl_ExportDriver.cxx b/src/GEOMImpl/GEOMImpl_ExportDriver.cxx index 045e2a7cd..e2d0629e4 100644 --- a/src/GEOMImpl/GEOMImpl_ExportDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ExportDriver.cxx @@ -54,37 +54,6 @@ typedef int (*funcPoint)(const TopoDS_Shape&, const TCollection_AsciiString&, const TCollection_AsciiString&); -//This class is workaround of BUG OCC13051 ( SWP13103 ) -//It's stored all loaded libraries for export and unload that in destructor -class DLL_Collector -{ - typedef NCollection_DataMap DLL_Collector_Map; - DLL_Collector_Map myMapOfDLL; -public: - DLL_Collector(){}; - ~DLL_Collector() - { - DLL_Collector_Map::Iterator Iter( myMapOfDLL ); - for( ; Iter.More(); Iter.Next() ) - UnLoadLib( Iter.Value() ); - } - -public: - LibHandle LoadDLL( const TCollection_AsciiString& theLibName ) - { - if ( myMapOfDLL.IsBound( theLibName ) ) - return myMapOfDLL( theLibName ); - - LibHandle res = LoadLib( theLibName.ToCString() ); - if ( res ) - myMapOfDLL.Bind( theLibName, res ); - - return res; - } -}; - -static DLL_Collector GlobalCollector; - //======================================================================= //function : GetID //purpose : @@ -132,7 +101,7 @@ Standard_Integer GEOMImpl_ExportDriver::Execute(TFunction_Logbook& log) const return 0; // load plugin library - LibHandle anExportLib = GlobalCollector.LoadDLL( aLibName ); //This is workaround of BUG OCC13051 + LibHandle anExportLib = LoadLib( aLibName.ToCString() ); //This is workaround of BUG OCC13051 funcPoint fp = 0; if ( anExportLib ) fp = (funcPoint)GetProc( anExportLib, "Export" ); diff --git a/src/GEOMImpl/GEOMImpl_HealingDriver.cxx b/src/GEOMImpl/GEOMImpl_HealingDriver.cxx index ffe05748e..d4921d648 100644 --- a/src/GEOMImpl/GEOMImpl_HealingDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_HealingDriver.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -115,6 +116,9 @@ Standard_Integer GEOMImpl_HealingDriver::Execute(TFunction_Logbook& log) const case DIVIDE_EDGE: AddPointOnEdge(&HI, anOriginalShape, aShape); break; + case CHANGE_ORIENTATION: + ChangeOrientation(&HI, anOriginalShape, aShape); + break; default: return 0; } @@ -379,6 +383,27 @@ Standard_Boolean GEOMImpl_HealingDriver::AddPointOnEdge (GEOMImpl_IHealing* theH } +//======================================================================= +//function : ChangeOrientation +//purpose : +//======================================================================= +Standard_Boolean GEOMImpl_HealingDriver::ChangeOrientation (GEOMImpl_IHealing* theHI, + const TopoDS_Shape& theOriginalShape, + TopoDS_Shape& theOutShape) const +{ + ShHealOper_ChangeOrientation aHealer (theOriginalShape); + + Standard_Boolean aResult = aHealer.Perform(); + + if (aResult) + theOutShape = aHealer.GetResultShape(); + else + raiseNotDoneExeption( aHealer.GetErrorStatus() ); + + return aResult; +} + + //======================================================================= //function : GEOMImpl_HealingDriver_Type_ //purpose : diff --git a/src/GEOMImpl/GEOMImpl_HealingDriver.hxx b/src/GEOMImpl/GEOMImpl_HealingDriver.hxx index aa1086b51..3bc27c1a8 100644 --- a/src/GEOMImpl/GEOMImpl_HealingDriver.hxx +++ b/src/GEOMImpl/GEOMImpl_HealingDriver.hxx @@ -163,7 +163,7 @@ Standard_Boolean RemoveIntWires( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS Standard_Boolean RemoveHoles ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean Sew ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean AddPointOnEdge( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; - +Standard_Boolean ChangeOrientation( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; }; diff --git a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx index 1fd9e6a5b..a4ed0e79e 100644 --- a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx @@ -60,6 +60,7 @@ #include #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC //============================================================================= @@ -111,6 +112,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxDXDYDZ (double theDX, dou //Compute the box value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Box driver failed"); return NULL; @@ -165,6 +169,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxTwoPnt (Handle(GEOM_Objec //Compute the Box value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Box driver failed"); return NULL; @@ -211,6 +218,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, dou //Compute the Cylinder value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Cylinder driver failed"); return NULL; @@ -269,6 +279,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEO //Compute the Cylinder value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Cylinder driver failed"); return NULL; @@ -318,6 +331,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConeR1R2H (double theR1, dou //Compute the Cone value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Cone driver failed"); return NULL; @@ -378,6 +394,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConePntVecR1R2H (Handle(GEOM //Compute the Cone value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Cone driver failed"); return NULL; @@ -423,6 +442,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSphereR (double theR) //Compute the Sphere value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Sphere driver failed"); return NULL; @@ -475,6 +497,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSpherePntR (Handle(GEOM_Obje //Compute the Sphere value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Sphere driver failed"); return NULL; @@ -523,6 +548,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusRR //Compute the Torus value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Torus driver failed"); return NULL; @@ -580,6 +608,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusPntVecRR //Compute the Torus value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Torus driver failed"); return NULL; @@ -637,8 +668,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec //Compute the Prism value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { - SetErrorCode("Prism driver failed"); + //SetErrorCode("Prism driver failed"); + SetErrorCode("Extrusion can not be created, check input data"); return NULL; } } @@ -694,8 +729,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt //Compute the Prism value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { - SetErrorCode("Prism driver failed"); + //SetErrorCode("Prism driver failed"); + SetErrorCode("Extrusion can not be created, check input data"); return NULL; } } @@ -749,6 +788,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) th //Compute the Pipe value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Pipe driver failed"); return NULL; @@ -806,6 +848,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle( //Compute the Revolution value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Revolution driver failed"); return NULL; @@ -858,6 +903,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSolidShell (Handle(GEOM_Obje //Compute the Solid value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Solid driver failed"); return NULL; @@ -914,6 +962,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling //Compute the Solid value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Filling driver failed"); return NULL; @@ -1000,6 +1051,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections( //Compute the ThruSections value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("ThruSections driver failed"); return anObj; @@ -1122,6 +1176,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections( //Compute the Pipe value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Pipe with defferent section driver failed"); return anObj; diff --git a/src/GEOMImpl/GEOMImpl_IBasicOperations.cxx b/src/GEOMImpl/GEOMImpl_IBasicOperations.cxx index 917ad2c25..6ed1de04e 100644 --- a/src/GEOMImpl/GEOMImpl_IBasicOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBasicOperations.cxx @@ -47,6 +47,7 @@ #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC //============================================================================= @@ -100,6 +101,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointXYZ //Compute the point value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Point driver failed"); return NULL; @@ -152,6 +156,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointWithReference //Compute the point value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Point driver failed"); return NULL; @@ -202,6 +209,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurve //Compute the point value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Point driver failed"); return NULL; @@ -252,6 +262,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentOnCurve //Compute the vector value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Vector driver failed"); return NULL; @@ -300,6 +313,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorDXDYDZ //Compute the Vector value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Vector driver failed"); return NULL; @@ -352,6 +368,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorTwoPnt //Compute the Vector value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Vector driver failed"); return NULL; @@ -405,6 +424,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLine //Compute the Line value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Line driver failed"); return NULL; @@ -457,6 +479,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoPnt //Compute the Line value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Line driver failed"); return NULL; @@ -514,6 +539,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneThreePnt //Compute the Plane value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Plane driver failed"); return NULL; @@ -568,6 +596,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlanePntVec //Compute the Plane value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Plane driver failed"); return NULL; @@ -619,6 +650,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneFace //Compute the Plane value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Plane driver failed"); return NULL; @@ -670,6 +704,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarker //Compute the marker value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Marker driver failed"); return NULL; @@ -728,6 +765,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentPlaneOnFace(const Hand //Compute the Plane value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Plane driver failed"); return NULL; diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx index aac760183..252a39d7f 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx @@ -94,6 +94,7 @@ #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC //============================================================================= @@ -161,6 +162,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad //Compute the Face value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Block driver failed to compute a face"); return NULL; @@ -216,6 +220,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad2Edges //Compute the Face value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Block driver failed to compute a face"); return NULL; @@ -278,6 +285,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad4Vertices //Compute the Face value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Block driver failed to compute a face"); return NULL; @@ -347,6 +357,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa //Compute the Block value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Block driver failed to compute a block"); return NULL; @@ -403,6 +416,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa2Faces //Compute the Block value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Block driver failed to compute a block"); return NULL; @@ -456,6 +472,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeBlockCompound //Compute the Blocks Compound value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Block driver failed to compute a blocks compound"); return NULL; @@ -585,6 +604,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetEdge //Compute the Edge value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopTools_IndexedDataMapOfShapeListOfShape MVE; GEOMImpl_Block6Explorer::MapShapesAndAncestors (aBlockOrComp, TopAbs_VERTEX, TopAbs_EDGE, MVE); @@ -688,6 +710,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetEdgeNearPoint //Compute the Edge value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopoDS_Shape aShape; TopoDS_Vertex aVert = TopoDS::Vertex(anArg); @@ -817,6 +842,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByPoints //Compute the Face value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopoDS_Shape aShape; TopTools_IndexedDataMapOfShapeListOfShape MVF; @@ -934,12 +962,6 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByEdges SetErrorCode("Block or compound is null"); return NULL; } - if (aBlockOrComp.ShapeType() != TopAbs_SOLID && - aBlockOrComp.ShapeType() != TopAbs_COMPOUND && - aBlockOrComp.ShapeType() != TopAbs_COMPSOLID) { - SetErrorCode("Shape is neither a block, nor a compound of blocks"); - return NULL; - } TopoDS_Shape anArg1 = theEdge1->GetValue(); TopoDS_Shape anArg2 = theEdge2->GetValue(); @@ -955,6 +977,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByEdges //Compute the Face value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopoDS_Shape aShape; TopTools_IndexedDataMapOfShapeListOfShape MEF; @@ -1077,6 +1102,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetOppositeFace //Compute the Face value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopoDS_Shape aShape; GEOMImpl_Block6Explorer aBlockTool; @@ -1127,12 +1155,6 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceNearPoint SetErrorCode("Block or compound is null"); return NULL; } - if (aBlockOrComp.ShapeType() != TopAbs_SOLID && - aBlockOrComp.ShapeType() != TopAbs_COMPOUND && - aBlockOrComp.ShapeType() != TopAbs_COMPSOLID) { - SetErrorCode("Shape is neither a block, nor a compound of blocks"); - return NULL; - } TopoDS_Shape anArg = thePoint->GetValue(); if (anArg.IsNull()) { @@ -1146,6 +1168,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceNearPoint //Compute the Face value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopoDS_Shape aShape; TopoDS_Vertex aVert = TopoDS::Vertex(anArg); @@ -1322,12 +1347,6 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByNormale SetErrorCode("Block or compound is null"); return NULL; } - if (aBlockOrComp.ShapeType() != TopAbs_SOLID && - aBlockOrComp.ShapeType() != TopAbs_COMPOUND && - aBlockOrComp.ShapeType() != TopAbs_COMPSOLID) { - SetErrorCode("Shape is neither a block, nor a compound of blocks"); - return NULL; - } TopoDS_Shape anArg = theVector->GetValue(); if (anArg.IsNull()) { @@ -1341,6 +1360,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByNormale //Compute the Face value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopoDS_Shape aShape; TopoDS_Edge anEdge = TopoDS::Edge(anArg); @@ -1454,6 +1476,9 @@ Standard_Boolean GEOMImpl_IBlocksOperations::IsCompoundOfBlocks //Check isCompOfBlocks = Standard_True; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopTools_MapOfShape mapShape; TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID); for (; exp.More(); exp.Next()) { @@ -2306,6 +2331,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::RemoveExtraEdges //Compute the fixed shape try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Block driver failed to remove extra edges of the given shape"); return NULL; @@ -2355,6 +2383,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::CheckAndImprove //Compute the fixed shape try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Block driver failed to improve the given blocks compound"); return NULL; @@ -2404,6 +2435,9 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IBlocksOperations::ExplodeCompound // Explode try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID); for (; exp.More(); exp.Next()) { if (mapShape.Add(exp.Current())) { @@ -2496,6 +2530,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetBlockNearPoint //Compute the Block value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopoDS_Shape aShape; TopoDS_Vertex aVert = TopoDS::Vertex(anArg); @@ -2672,6 +2709,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetBlockByParts //Compute the Block value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif // 1. Explode compound on solids TopTools_MapOfShape mapShape; Standard_Integer nbSolids = 0; @@ -2788,6 +2828,9 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IBlocksOperations::GetBlocksByPart //Get the Blocks try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif TopTools_MapOfShape mapShape; Standard_Integer nbSolids = 0; TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID); @@ -2908,6 +2951,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation1D //Compute the transformation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Block driver failed to make multi-transformation"); return NULL; @@ -2969,6 +3015,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation2D //Compute the transformation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Block driver failed to make multi-transformation"); return NULL; diff --git a/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx b/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx index 8c71c551c..bedeef3df 100644 --- a/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx @@ -36,6 +36,7 @@ #include "utilities.h" +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC //============================================================================= @@ -105,6 +106,9 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean (Handle(GEOM_Object //Compute the Boolean value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Boolean driver failed"); return NULL; @@ -251,6 +255,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition if (theMaterials.IsNull()) { Handle(TColStd_HArray1OfInteger) aMaterials = new TColStd_HArray1OfInteger (1, aShapesSeq->Length()); + aMaterials->Init(0); aCI.SetMaterials(aMaterials); } else { aCI.SetMaterials(theMaterials); @@ -259,6 +264,9 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition //Compute the Partition try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Partition driver failed"); return NULL; @@ -329,6 +337,9 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeHalfPartition //Compute the Partition value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Partition driver failed"); return NULL; diff --git a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx index c498996ef..a28543ca7 100644 --- a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx @@ -44,6 +44,7 @@ #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC //============================================================================= @@ -106,6 +107,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline (list 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Polyline driver failed"); return NULL; @@ -170,6 +174,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCircleThreePnt (Handle(GEOM_ //Compute the Circle value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Circle driver failed"); return NULL; @@ -225,6 +232,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCirclePntVecR //Compute the Circle value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Circle driver failed"); return NULL; @@ -282,6 +292,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeEllipse //Compute the Ellipse value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Ellipse driver failed"); return NULL; @@ -339,6 +352,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArc (Handle(GEOM_Object) the //Compute the Arc value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Arc driver failed"); return NULL; @@ -396,6 +412,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier //Compute the Spline value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Spline driver failed"); return NULL; @@ -460,6 +479,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation //Compute the Spline value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Spline driver failed"); return NULL; @@ -521,6 +543,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcher //Compute the Sketcher value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Sketcher driver failed"); return NULL; @@ -580,6 +605,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcherOnPlane //Compute the Sketcher value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Sketcher driver failed"); return NULL; diff --git a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx index 2693d4c8a..6c904ca2d 100644 --- a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -45,8 +46,6 @@ #include #include -#include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC - //============================================================================= /*! * constructor: @@ -195,20 +194,18 @@ void GEOMImpl_IGroupOperations::RemoveObject (Handle(GEOM_Object) theGroup, int else { aNewSeq = new TColStd_HArray1OfInteger(1, aLength-1); Standard_Boolean isFound = Standard_False; - for(Standard_Integer i = 1, k=1; i<=aLength; i++) { - if(i == aLength && !isFound) { - SetErrorCode(NOT_EXISTS); - return; - } - if(aSeq->Value(i) == theSubShapeID) { + for (Standard_Integer i = 1, k = 1; i <= aLength; i++) { + if (aSeq->Value(i) == theSubShapeID) { isFound = Standard_True; - continue; - } - aNewSeq->SetValue(k, aSeq->Value(i)); - k++; + } else { + if (k < aLength) { // this check is to avoid sequence overflow + aNewSeq->SetValue(k, aSeq->Value(i)); + k++; + } + } } - if(!isFound) { + if (!isFound) { SetErrorCode(NOT_EXISTS); return; } @@ -276,80 +273,68 @@ void GEOMImpl_IGroupOperations::UnionList (Handle(GEOM_Object) theGroup, TopTools_IndexedMapOfShape mapIndices; TopExp::MapShapes(aMainShape, mapIndices); + // Get group type + TopAbs_ShapeEnum aType = GetType(theGroup); + // Get IDs of sub-shapes to add Standard_Integer i, new_id; for (i = 1; i <= aLen; i++) { Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theSubShapes->Value(i)); + TopoDS_Shape aShape_i = anObj_i->GetValue(); + TopAbs_ShapeEnum aType_i = aShape_i.ShapeType(); + + // 1. If aShape_i is sub-shape of aMainShape - add it if (anObj_i->IsMainShape()) { - TopoDS_Shape aShape_i = anObj_i->GetValue(); - if (mapIndices.Contains(aShape_i)) { - new_id = mapIndices.FindIndex(aShape_i); - if (mapIDs.Add(new_id)) { - aNewIDs.Append(new_id); - } - } else { - SetErrorCode("One of given objects can not be added to the group, because it is not a sub-shape of the group's main shape"); + if (aType_i != aType && aType != TopAbs_SHAPE && aType != TopAbs_COMPOUND) { + SetErrorCode("Operation aborted: one of given objects has a wrong type"); return; } - } else { - // Check main shape of sub-shape to add - Handle(GEOM_Function) aFunc_i = anObj_i->GetFunction(1); - if (aFunc_i.IsNull()) return; - - GEOM_ISubShape aSSI_i (aFunc_i); - - Handle(GEOM_Function) aMainShapeFunc_i = aSSI_i.GetMainShape(); - if (aMainShapeFunc_i.IsNull()) return; - TDF_Label aLabel_i = aMainShapeFunc_i->GetOwnerEntry(); - if (aLabel_i.IsRoot()) return; - Handle(GEOM_Object) aMainObj_i = GEOM_Object::GetObject(aLabel); - if (aMainObj_i.IsNull()) return; - TopoDS_Shape aMainShape_i = aMainObj_i->GetValue(); - if (aMainShape_i.IsNull()) return; - - if (aMainShape_i.IsSame(aMainShape)) { - // add all sub-shape IDs to the list - - // Get IDs - Handle(TColStd_HArray1OfInteger) aSeq_i = aSSI_i.GetIndices(); - if (aSeq_i.IsNull()) return; - Standard_Integer aLength_i = aSeq_i->Length(); - - for (Standard_Integer i_j = 1; i_j <= aLength_i; i_j++) { - new_id = aSeq_i->Value(i_j); - if (new_id > 0) { - if (mapIDs.Add(new_id)) { - aNewIDs.Append(new_id); - } - } - } - - } else if (mapIndices.Contains(aMainShape_i)) { - // compute new IDs and add them to the list - TopTools_IndexedMapOfShape mapIndices_i; - TopExp::MapShapes(aMainShape_i, mapIndices_i); - - // Get IDs - Handle(TColStd_HArray1OfInteger) aSeq_i = aSSI_i.GetIndices(); - if (aSeq_i.IsNull()) return; - Standard_Integer aLength_i = aSeq_i->Length(); - - for (Standard_Integer i_j = 1; i_j <= aLength_i; i_j++) { - if (aSeq_i->Value(i_j) > 0) { - TopoDS_Shape aShape_i_j = mapIndices_i.FindKey(i_j); - new_id = mapIndices.FindIndex(aShape_i_j); - if (mapIDs.Add(new_id)) { - aNewIDs.Append(new_id); - } + if (!mapIndices.Contains(aShape_i)) { + SetErrorCode("Operation aborted: not a sub-shape given"); + return; + } + new_id = mapIndices.FindIndex(aShape_i); + if (mapIDs.Add(new_id)) { + aNewIDs.Append(new_id); + } + } + // 2. If type of group is not defined - add all sub-shapes of aShape_i + else if (aType == TopAbs_SHAPE || aType == TopAbs_COMPOUND) { + TopTools_IndexedMapOfShape mapIndices_i; + TopExp::MapShapes(aShape_i, mapIndices_i); + Standard_Integer ii = 1, nbSubSh = mapIndices_i.Extent(); + Standard_Boolean someGood = Standard_False; + for (; ii <= nbSubSh; ii++) { + TopoDS_Shape aSubShape_i = mapIndices_i.FindKey(ii); + if (mapIndices.Contains(aSubShape_i)) { + someGood = Standard_True; + new_id = mapIndices.FindIndex(aSubShape_i); + if (mapIDs.Add(new_id)) { + aNewIDs.Append(new_id); } } - - } else { - SetErrorCode("One of given objects can not be added to the group, because it is not a sub-shape of the group's main shape"); + } + if (!someGood) { + SetErrorCode("Operation aborted: not a sub-shape given"); return; } } + // 3. If type of group is defined - add all sub-shapes of aShape_i of that type + else { + TopExp_Explorer aSubShapes_i (aShape_i, aType); + for (; aSubShapes_i.More(); aSubShapes_i.Next()) { + TopoDS_Shape aSubShape_i = aSubShapes_i.Current(); + if (!mapIndices.Contains(aSubShape_i)) { + SetErrorCode("Operation aborted: not a sub-shape given"); + return; + } + new_id = mapIndices.FindIndex(aSubShape_i); + if (mapIDs.Add(new_id)) { + aNewIDs.Append(new_id); + } + } + } } if (aNewIDs.Extent() > 0) { @@ -431,78 +416,50 @@ void GEOMImpl_IGroupOperations::DifferenceList (Handle(GEOM_Object) theGroup, TopTools_IndexedMapOfShape mapIndices; TopExp::MapShapes(aMainShape, mapIndices); + // Get group type + TopAbs_ShapeEnum aType = GetType(theGroup); + // Get IDs of sub-shapes to be removed Standard_Integer i, rem_id; for (i = 1; i <= aLen; i++) { Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theSubShapes->Value(i)); - if (anObj_i->IsMainShape()) { - TopoDS_Shape aShape_i = anObj_i->GetValue(); - if (mapIndices.Contains(aShape_i)) { - rem_id = mapIndices.FindIndex(aShape_i); - if (mapIDsCurrent.Contains(rem_id)) { - mapIDsToRemove.Add(rem_id); - } - } else { - SetErrorCode("One of given objects can not be removed from the group, because it is not a sub-shape of the group's main shape"); - return; + TopoDS_Shape aShape_i = anObj_i->GetValue(); + + // 1. If aShape_i is sub-shape of aMainShape - remove it + if (mapIndices.Contains(aShape_i)) { + rem_id = mapIndices.FindIndex(aShape_i); + if (mapIDsCurrent.Contains(rem_id)) { + mapIDsToRemove.Add(rem_id); } - } else { - // Check main shape of sub-shape to be removed - Handle(GEOM_Function) aFunc_i = anObj_i->GetFunction(1); - if (aFunc_i.IsNull()) return; - - GEOM_ISubShape aSSI_i (aFunc_i); - - Handle(GEOM_Function) aMainShapeFunc_i = aSSI_i.GetMainShape(); - if (aMainShapeFunc_i.IsNull()) return; - TDF_Label aLabel_i = aMainShapeFunc_i->GetOwnerEntry(); - if (aLabel_i.IsRoot()) return; - Handle(GEOM_Object) aMainObj_i = GEOM_Object::GetObject(aLabel); - if (aMainObj_i.IsNull()) return; - TopoDS_Shape aMainShape_i = aMainObj_i->GetValue(); - if (aMainShape_i.IsNull()) return; - - if (aMainShape_i.IsSame(aMainShape)) { - // remove all sub-shapes - - // Get IDs - Handle(TColStd_HArray1OfInteger) aSeq_i = aSSI_i.GetIndices(); - if (aSeq_i.IsNull()) return; - Standard_Integer aLength_i = aSeq_i->Length(); - - for (Standard_Integer i_j = 1; i_j <= aLength_i; i_j++) { - rem_id = aSeq_i->Value(i_j); - if (rem_id > 0) { - if (mapIDsCurrent.Contains(rem_id)) { - mapIDsToRemove.Add(rem_id); - } + } + // 2. If type of group is not defined - remove all sub-shapes of aShape_i + else if (aType == TopAbs_SHAPE || aType == TopAbs_COMPOUND) { + TopTools_IndexedMapOfShape mapIndices_i; + TopExp::MapShapes(aShape_i, mapIndices_i); + Standard_Integer nbSubSh = mapIndices_i.Extent(); + Standard_Integer ii = 1; + for (; ii <= nbSubSh; ii++) { + TopoDS_Shape aSubShape_i = mapIndices_i.FindKey(ii); + if (mapIndices.Contains(aSubShape_i)) { + rem_id = mapIndices.FindIndex(aSubShape_i); + if (mapIDsCurrent.Contains(rem_id)) { + mapIDsToRemove.Add(rem_id); } } - - } else if (mapIndices.Contains(aMainShape_i)) { - // compute new IDs and add them to the map of ids to be removed - TopTools_IndexedMapOfShape mapIndices_i; - TopExp::MapShapes(aMainShape_i, mapIndices_i); - - // Get IDs - Handle(TColStd_HArray1OfInteger) aSeq_i = aSSI_i.GetIndices(); - if (aSeq_i.IsNull()) return; - Standard_Integer aLength_i = aSeq_i->Length(); - - for (Standard_Integer i_j = 1; i_j <= aLength_i; i_j++) { - if (aSeq_i->Value(i_j) > 0) { - TopoDS_Shape aShape_i_j = mapIndices_i.FindKey(i_j); - rem_id = mapIndices.FindIndex(aShape_i_j); - if (mapIDsCurrent.Contains(rem_id)) { - mapIDsToRemove.Add(rem_id); - } + } + } + // 3. If type of group is defined - remove all sub-shapes of aShape_i of that type + else { + TopExp_Explorer aSubShapes_i (aShape_i, aType); + for (; aSubShapes_i.More(); aSubShapes_i.Next()) { + TopoDS_Shape aSubShape_i = aSubShapes_i.Current(); + if (mapIndices.Contains(aSubShape_i)) { + rem_id = mapIndices.FindIndex(aSubShape_i); + if (mapIDsCurrent.Contains(rem_id)) { + mapIDsToRemove.Add(rem_id); } } - - } else { - SetErrorCode("One of given objects can not be removed from the group, because it is not a sub-shape of the group's main shape"); - return; } } } @@ -718,7 +675,7 @@ TopAbs_ShapeEnum GEOMImpl_IGroupOperations::GetType(Handle(GEOM_Object) theGroup TDF_Label aFreeLabel = theGroup->GetFreeLabel(); Handle(TDataStd_Integer) anAttrib; if(!aFreeLabel.FindAttribute(TDataStd_Integer::GetID(), anAttrib)) return TopAbs_SHAPE; - + SetErrorCode(OK); return (TopAbs_ShapeEnum) anAttrib->Get(); } diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx index 1d3d9f420..9e67bc310 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx @@ -49,6 +49,7 @@ #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC @@ -134,8 +135,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ShapeProcess (Handle(GEOM_Objec } //Compute the translation - try - { + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Shape Healing algorithm failed"); @@ -341,8 +344,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::SuppressFaces HI.SetOriginal( aLastFunction ); //Compute the translation - try - { + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Healing driver failed"); @@ -410,8 +415,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::CloseContour HI.SetOriginal( aLastFunction ); //Compute the translation - try - { + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Healing driver failed"); @@ -477,8 +484,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveIntWires HI.SetOriginal( aLastFunction ); //Compute the translation - try - { + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Healing driver failed"); @@ -543,8 +552,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::FillHoles (Handle(GEOM_Object) HI.SetOriginal( aLastFunction ); //Compute the translation - try - { + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Healing driver failed"); @@ -609,8 +620,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::Sew (Handle(GEOM_Object) theObj HI.SetOriginal( aLastFunction ); //Compute the translation - try - { + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Healing driver failed"); @@ -670,8 +683,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::DivideEdge (Handle(GEOM_Object) HI.SetOriginal( aLastFunction ); //Compute the translation - try - { + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Healing driver failed"); @@ -773,3 +788,122 @@ bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(GEOM_Object) theObject SetErrorCode(OK); return true; } + + +//============================================================================= +/*! + * ChangeOrientation + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientation (Handle(GEOM_Object) theObject) +{ + // set error code, check parameters + SetErrorCode(KO); + + if (theObject.IsNull()) + return NULL; + + if (!theObject->IsMainShape()) { + SetErrorCode("Sub shape cannot be transformed - need to create a copy"); + return NULL; + } + + Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction(); + if (aLastFunction.IsNull()) + return NULL; //There is no function which creates an object to be processed + + //Add the function + aFunction = theObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CHANGE_ORIENTATION); + + if (aFunction.IsNull()) + return NULL; + + //Check if the function is set correctly + if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL; + + // prepare "data container" class IHealing + GEOMImpl_IHealing HI(aFunction); + HI.SetOriginal( aLastFunction ); + + //Compute the translation + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + if (!GetSolver()->ComputeFunction(aFunction)) { + SetErrorCode("Healing driver failed"); + return NULL; + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return NULL; + } + + //Make a Python command + GEOM::TPythonDump(aFunction) << "geompy.ChangeOrientationShell(" + << theObject << ")"; + + SetErrorCode(OK); + return theObject; +} + + +//============================================================================= +/*! + * ChangeOrientationCopy + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(GEOM_Object) theObject) +{ + // set error code, check parameters + SetErrorCode(KO); + + if (theObject.IsNull()) + return NULL; + + Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction(); + if (aLastFunction.IsNull()) + return NULL; //There is no function which creates an object to be processed + + // Add a new object + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY ); + + //Add the function + aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CHANGE_ORIENTATION); + + if (aFunction.IsNull()) + return NULL; + + //Check if the function is set correctly + if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL; + + // prepare "data container" class IHealing + GEOMImpl_IHealing HI(aFunction); + HI.SetOriginal( aLastFunction ); + + //Compute the translation + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + if (!GetSolver()->ComputeFunction(aFunction)) { + SetErrorCode("Healing driver failed"); + return NULL; + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return NULL; + } + + //Make a Python command + GEOM::TPythonDump(aFunction) << aNewObject << " = geompy.ChangeOrientationShellCopy(" + << theObject << ")"; + + SetErrorCode(OK); + return aNewObject; +} + diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx index 1a7359374..3b36d040f 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx @@ -81,6 +81,10 @@ class GEOMImpl_IHealingOperations : public GEOM_IOperations { Standard_EXPORT bool GetFreeBoundary ( Handle(GEOM_Object) theObject, Handle(TColStd_HSequenceOfTransient)& theOutClosedWires, Handle(TColStd_HSequenceOfTransient)& theOutOpenWires ); + + Standard_EXPORT Handle(GEOM_Object) ChangeOrientation( Handle(GEOM_Object) theObject); + Standard_EXPORT Handle(GEOM_Object) ChangeOrientationCopy( Handle(GEOM_Object) theObject); + }; #endif diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx index ec850804c..094e2fbb7 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx @@ -42,6 +42,7 @@ #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC //============================================================================= @@ -98,6 +99,9 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::MakeCopy(Handle(GEOM_Object) the //Compute the Copy value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Copy driver failed"); return NULL; @@ -155,6 +159,9 @@ void GEOMImpl_IInsertOperations::Export //Perform the Export try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Export driver failed"); return; @@ -210,6 +217,9 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::Import //Perform the Import try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Import driver failed"); return NULL; @@ -388,9 +398,9 @@ Standard_Boolean GEOMImpl_IInsertOperations::InitResMgr() // Initialize the Resource Manager TCollection_AsciiString aResDir (getenv("GEOM_ROOT_DIR")); #ifdef WNT - aResDir += "\\share\\salome\\resources"; + aResDir += "\\share\\salome\\resources\\geom"; #else - aResDir += "/share/salome/resources"; + aResDir += "/share/salome/resources/geom"; #endif char * dir = getenv("GEOM_ENGINE_RESOURCES_DIR"); TCollection_AsciiString aUserResDir; diff --git a/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx b/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx index 96bb393b5..63e0126b0 100644 --- a/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx @@ -51,6 +51,7 @@ #include #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC //============================================================================= @@ -106,6 +107,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletAll //Compute the Fillet value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Fillet driver failed"); return NULL; @@ -164,6 +168,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletEdges //Compute the Fillet value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Fillet driver failed"); return NULL; @@ -230,6 +237,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFaces //Compute the Fillet value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Fillet driver failed"); return NULL; @@ -287,6 +297,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferAll (Handle(GEOM_Objec //Compute the Chamfer value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Chamfer driver failed"); return NULL; @@ -341,6 +354,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdge //Compute the Chamfer value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Chamfer driver failed"); return NULL; @@ -402,6 +418,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferFaces //Compute the Chamfer value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Chamfer driver failed"); return NULL; @@ -463,6 +482,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeArchimede (Handle(GEOM_Object //Compute the Archimede value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Archimede driver failed"); return NULL; diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx index 94ecb8458..33fc39a94 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx @@ -1,18 +1,18 @@ // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @@ -32,6 +32,7 @@ #include #include +// OCCT Includes #include #include #include @@ -62,6 +63,11 @@ #include #include +#include +#include +#include + +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC //============================================================================= @@ -86,6 +92,106 @@ GEOMImpl_IMeasureOperations::~GEOMImpl_IMeasureOperations() } +//============================================================================= +/*! Get LCS, corresponding to the given shape. + * Origin of the LCS is situated at the shape's center of mass. + * Axes of the LCS are obtained from shape's location or, + * if the shape is a planar face, from position of its plane. + */ +//============================================================================= +gp_Ax3 GEOMImpl_IMeasureOperations::GetPosition (const TopoDS_Shape& theShape) +{ + gp_Ax3 aResult; + + if (theShape.IsNull()) + return aResult; + + // Axes + aResult.Transform(theShape.Location().Transformation()); + if (theShape.ShapeType() == TopAbs_FACE) { + Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(theShape)); + if (!aGS.IsNull() && aGS->IsKind(STANDARD_TYPE(Geom_Plane))) { + Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast(aGS); + gp_Pln aPln = aGPlane->Pln(); + aResult = aPln.Position(); + } + } + + // Origin + gp_Pnt aPnt; + if (theShape.ShapeType() == TopAbs_VERTEX) { + aPnt = BRep_Tool::Pnt(TopoDS::Vertex(theShape)); + } + else { + GProp_GProps aSystem; + if (theShape.ShapeType() == TopAbs_EDGE || theShape.ShapeType() == TopAbs_WIRE) + BRepGProp::LinearProperties(theShape, aSystem); + else if (theShape.ShapeType() == TopAbs_FACE || theShape.ShapeType() == TopAbs_SHELL) + BRepGProp::SurfaceProperties(theShape, aSystem); + else + BRepGProp::VolumeProperties(theShape, aSystem); + + aPnt = aSystem.CentreOfMass(); + } + + aResult.SetLocation(aPnt); + + return aResult; +} + +//============================================================================= +/*! + * GetPosition + */ +//============================================================================= +void GEOMImpl_IMeasureOperations::GetPosition + (Handle(GEOM_Object) theShape, + Standard_Real& Ox, Standard_Real& Oy, Standard_Real& Oz, + Standard_Real& Zx, Standard_Real& Zy, Standard_Real& Zz, + Standard_Real& Xx, Standard_Real& Xy, Standard_Real& Xz) +{ + SetErrorCode(KO); + + //Set default values: global CS + Ox = Oy = Oz = Zx = Zy = Xy = Xz = 0.; + Zz = Xx = 1.; + + if (theShape.IsNull()) return; + + Handle(GEOM_Function) aRefShape = theShape->GetLastFunction(); + if (aRefShape.IsNull()) return; + + TopoDS_Shape aShape = aRefShape->GetValue(); + if (aShape.IsNull()) { + SetErrorCode("The Objects has NULL Shape"); + return; + } + + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + + gp_Ax3 anAx3 = GetPosition(aShape); + + gp_Pnt anOri = anAx3.Location(); + gp_Dir aDirZ = anAx3.Direction(); + gp_Dir aDirX = anAx3.XDirection(); + + // Output values + anOri.Coord(Ox, Oy, Oz); + aDirZ.Coord(Zx, Zy, Zz); + aDirX.Coord(Xx, Xy, Xz); + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return; + } + + SetErrorCode(OK); +} + //============================================================================= /*! * GetCentreOfMass @@ -118,6 +224,9 @@ Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetCentreOfMass //Compute the CentreOfMass value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Measure driver failed to compute centre of mass"); return NULL; @@ -162,6 +271,9 @@ void GEOMImpl_IMeasureOperations::GetBasicProperties (Handle(GEOM_Object) theSha //Compute the parameters GProp_GProps LProps, SProps; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif BRepGProp::LinearProperties(aShape, LProps); theLength = LProps.Mass(); @@ -215,6 +327,9 @@ void GEOMImpl_IMeasureOperations::GetInertia GProp_GProps System; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (aShape.ShapeType() == TopAbs_VERTEX || aShape.ShapeType() == TopAbs_EDGE || aShape.ShapeType() == TopAbs_WIRE) { @@ -279,6 +394,9 @@ void GEOMImpl_IMeasureOperations::GetBoundingBox Bnd_Box B; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif BRepBndLib::Add(aShape, B); B.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); } @@ -321,6 +439,9 @@ void GEOMImpl_IMeasureOperations::GetTolerance FaceMax = EdgeMax = VertMax = -RealLast(); try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif for (TopExp_Explorer ExF (aShape, TopAbs_FACE); ExF.More(); ExF.Next()) { TopoDS_Face Face = TopoDS::Face(ExF.Current()); T = BRep_Tool::Tolerance(Face); @@ -361,6 +482,7 @@ void GEOMImpl_IMeasureOperations::GetTolerance */ //============================================================================= bool GEOMImpl_IMeasureOperations::CheckShape (Handle(GEOM_Object) theShape, + const Standard_Boolean theIsCheckGeom, TCollection_AsciiString& theDump) { SetErrorCode(KO); @@ -379,7 +501,10 @@ bool GEOMImpl_IMeasureOperations::CheckShape (Handle(GEOM_Object) theShape, //Compute the parameters bool isValid = false; try { - BRepCheck_Analyzer ana (aShape, false); +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + BRepCheck_Analyzer ana (aShape, theIsCheckGeom); if (ana.IsValid()) { theDump.Clear(); isValid = true; @@ -429,6 +554,9 @@ TCollection_AsciiString GEOMImpl_IMeasureOperations::WhatIs (Handle(GEOM_Object) Astr = Astr + " Number of sub-shapes : \n"; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif int iType, nbTypes [TopAbs_SHAPE]; for (iType = 0; iType < TopAbs_SHAPE; ++iType) nbTypes[iType] = 0; @@ -499,6 +627,9 @@ Standard_Real GEOMImpl_IMeasureOperations::GetMinDistance //Compute the parameters try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif BRepExtrema_DistShapeShape dst (aShape1, aShape2); if (dst.IsDone()) { gp_Pnt PMin1, PMin2, P1, P2; @@ -552,8 +683,10 @@ void GEOMImpl_IMeasureOperations::PointCoordinates( Handle(GEOM_Object) theShape return; } - try - { + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); theX = aPnt.X(); theY = aPnt.Y(); diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx index d60ba9153..4a0cc980b 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx @@ -24,9 +24,11 @@ #include "GEOM_IOperations.hxx" #include +#include #include #include #include +#include class GEOM_Engine; class Handle(GEOM_Object); @@ -36,41 +38,51 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations { Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID); Standard_EXPORT ~GEOMImpl_IMeasureOperations(); + Standard_EXPORT void GetPosition (Handle(GEOM_Object) theShape, + Standard_Real& Ox, Standard_Real& Oy, Standard_Real& Oz, + Standard_Real& Zx, Standard_Real& Zy, Standard_Real& Zz, + Standard_Real& Xx, Standard_Real& Xy, Standard_Real& Xz); + Standard_EXPORT Handle(GEOM_Object) GetCentreOfMass (Handle(GEOM_Object) theShape); Standard_EXPORT void GetBasicProperties (Handle(GEOM_Object) theShape, - Standard_Real& theLength, - Standard_Real& theSurfArea, - Standard_Real& theVolume); + Standard_Real& theLength, + Standard_Real& theSurfArea, + Standard_Real& theVolume); Standard_EXPORT void GetInertia (Handle(GEOM_Object) theShape, - Standard_Real& I11, Standard_Real& I12, Standard_Real& I13, - Standard_Real& I21, Standard_Real& I22, Standard_Real& I23, - Standard_Real& I31, Standard_Real& I32, Standard_Real& I33, - Standard_Real& Ix , Standard_Real& Iy , Standard_Real& Iz); + Standard_Real& I11, Standard_Real& I12, Standard_Real& I13, + Standard_Real& I21, Standard_Real& I22, Standard_Real& I23, + Standard_Real& I31, Standard_Real& I32, Standard_Real& I33, + Standard_Real& Ix , Standard_Real& Iy , Standard_Real& Iz); Standard_EXPORT void GetBoundingBox (Handle(GEOM_Object) theShape, - Standard_Real& Xmin, Standard_Real& Xmax, - Standard_Real& Ymin, Standard_Real& Ymax, - Standard_Real& Zmin, Standard_Real& Zmax); + Standard_Real& Xmin, Standard_Real& Xmax, + Standard_Real& Ymin, Standard_Real& Ymax, + Standard_Real& Zmin, Standard_Real& Zmax); Standard_EXPORT void GetTolerance (Handle(GEOM_Object) theShape, - Standard_Real& FaceMin, Standard_Real& FaceMax, - Standard_Real& EdgeMin, Standard_Real& EdgeMax, - Standard_Real& VertMin, Standard_Real& VertMax); + Standard_Real& FaceMin, Standard_Real& FaceMax, + Standard_Real& EdgeMin, Standard_Real& EdgeMax, + Standard_Real& VertMin, Standard_Real& VertMax); Standard_EXPORT bool CheckShape (Handle(GEOM_Object) theShape, - TCollection_AsciiString& theDump); + const Standard_Boolean theIsCheckGeom, + TCollection_AsciiString& theDump); Standard_EXPORT TCollection_AsciiString WhatIs (Handle(GEOM_Object) theShape); - Standard_EXPORT Standard_Real GetMinDistance (Handle(GEOM_Object) theShape1, Handle(GEOM_Object) theShape2, - Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, - Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2); + Standard_EXPORT Standard_Real GetMinDistance (Handle(GEOM_Object) theShape1, + Handle(GEOM_Object) theShape2, + Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, + Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2); + + Standard_EXPORT void PointCoordinates(Handle(GEOM_Object) theShape, + Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ ); + + public: + Standard_EXPORT static gp_Ax3 GetPosition (const TopoDS_Shape& theShape); - Standard_EXPORT void PointCoordinates( Handle(GEOM_Object) theShape, - Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ ); - private: void StructuralDump (const BRepCheck_Analyzer& theAna, const TopoDS_Shape& theShape, diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index ec50792fa..67e8f4362 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -95,6 +95,7 @@ #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC //============================================================================= @@ -152,6 +153,9 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdge //Compute the Edge value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Vector driver failed"); return NULL; @@ -216,6 +220,9 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFace (Handle(GEOM_Object) th //Compute the Face value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Shape driver failed to compute a face"); return NULL; @@ -277,6 +284,9 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWires //Compute the shape try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Shape driver failed"); return NULL; @@ -360,6 +370,9 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShell (Handle(GEOM_Obje //Compute the Solid value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Solid driver failed"); return NULL; @@ -432,6 +445,9 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeShape //Compute the shape try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Shape driver failed"); return NULL; @@ -496,6 +512,9 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFaces //Compute the sub-shape value Standard_Boolean isWarning = Standard_False; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Shape driver failed to glue faces"); return NULL; @@ -947,6 +966,9 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ReverseShape(Handle(GEOM_Object) //Compute the sub-shape value try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Shape driver failed to reverse shape"); return NULL; @@ -1395,6 +1417,80 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnPlan return aSeq; } +//============================================================================= +/*! + * GetShapesOnPlaneWithLocation + */ +//============================================================================= +Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnPlaneWithLocation + (const Handle(GEOM_Object)& theShape, + const Standard_Integer theShapeType, + const Handle(GEOM_Object)& theAx1, + const Handle(GEOM_Object)& thePnt, + const GEOMAlgo_State theState) +{ + SetErrorCode(KO); + + if (theShape.IsNull() || theAx1.IsNull() || thePnt.IsNull()) return NULL; + + TopoDS_Shape aShape = theShape->GetValue(); + TopoDS_Shape anAx1 = theAx1->GetValue(); + TopoDS_Shape anPnt = thePnt->GetValue(); + + if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return NULL; + + TopAbs_ShapeEnum aShapeType = TopAbs_ShapeEnum(theShapeType); + if ( !checkTypeShapesOn( theShapeType )) + return NULL; + + // Create plane + if ( anAx1.ShapeType() != TopAbs_EDGE || anPnt.ShapeType() != TopAbs_VERTEX ) return NULL; + TopoDS_Vertex V1, V2, V3; + TopoDS_Edge anEdge = TopoDS::Edge(anAx1); + TopExp::Vertices(anEdge, V1, V2, Standard_True); + + if (V1.IsNull() || V2.IsNull()) { + SetErrorCode("Bad edge given for the plane normal vector"); + return NULL; + } + V3 = TopoDS::Vertex(anPnt); + + if(V3.IsNull()) { + SetErrorCode("Bad vertex given for the plane location"); + return NULL; + } + gp_Pnt aLoc = BRep_Tool::Pnt(V3); + gp_Vec aVec(BRep_Tool::Pnt(V1),BRep_Tool::Pnt(V2)); + + if (aVec.Magnitude() < Precision::Confusion()) { + SetErrorCode("Vector with null magnitude given"); + return NULL; + } + Handle(Geom_Surface) aPlane = new Geom_Plane(aLoc, aVec); + + if ( aPlane.IsNull() ) + return NULL; + + // Find objects + TCollection_AsciiString anAsciiList; + Handle(TColStd_HSequenceOfTransient) aSeq; + aSeq = getShapesOnSurface( aPlane, theShape, aShapeType, theState, anAsciiList ); + if ( aSeq.IsNull() || aSeq->Length() == 0 ) + return NULL; + + // Make a Python command + + Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast( aSeq->Value( 1 )); + Handle(GEOM_Function) aFunction = anObj->GetLastFunction(); + + GEOM::TPythonDump(aFunction) << "[" << anAsciiList.ToCString() + << "] = geompy.GetShapesOnPlaneWithLocation(" << theShape << ", " + << aShapeType << ", " << theAx1 << ", "<< thePnt <<", " << theState << ")"; + + SetErrorCode(OK); + return aSeq; +} + //============================================================================= /*! * GetShapesOnCylinder @@ -1543,6 +1639,73 @@ Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::GetShapesOnPlaneI return aSeq; } +//============================================================================= +/*! + * GetShapesOnPlaneWithLocationIDs + */ +//============================================================================= +Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::GetShapesOnPlaneWithLocationIDs + (const Handle(GEOM_Object)& theShape, + const Standard_Integer theShapeType, + const Handle(GEOM_Object)& theAx1, + const Handle(GEOM_Object)& thePnt, + const GEOMAlgo_State theState) +{ + SetErrorCode(KO); + + if (theShape.IsNull() || theAx1.IsNull() || thePnt.IsNull()) return NULL; + + TopoDS_Shape aShape = theShape->GetValue(); + TopoDS_Shape anAx1 = theAx1->GetValue(); + TopoDS_Shape anPnt = thePnt->GetValue(); + + if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return NULL; + + TopAbs_ShapeEnum aShapeType = TopAbs_ShapeEnum(theShapeType); + if ( !checkTypeShapesOn( aShapeType )) + return NULL; + + // Create plane + if (anAx1.ShapeType() != TopAbs_EDGE || anPnt.ShapeType() != TopAbs_VERTEX) return NULL; + TopoDS_Edge anEdge = TopoDS::Edge(anAx1); + TopoDS_Vertex V1, V2, V3; + TopExp::Vertices(anEdge, V1, V2, Standard_True); + if (V1.IsNull() || V2.IsNull()) { + SetErrorCode("Bad edge given for the plane normal vector"); + return NULL; + } + V3 = TopoDS::Vertex(anPnt); + if(V3.IsNull()) { + SetErrorCode("Bad vertex given for the plane location"); + return NULL; + } + gp_Pnt aLoc = BRep_Tool::Pnt(V3); + gp_Vec aVec(BRep_Tool::Pnt(V1),BRep_Tool::Pnt(V2)); + if (aVec.Magnitude() < Precision::Confusion()) { + SetErrorCode("Vector with null magnitude given"); + return NULL; + } + + Handle(Geom_Surface) aPlane = new Geom_Plane(aLoc, aVec); + if ( aPlane.IsNull() ) + return NULL; + + // Find object IDs + Handle(TColStd_HSequenceOfInteger) aSeq; + aSeq = getShapesOnSurfaceIDs( aPlane, aShape, aShapeType, theState ); + + // The GetShapesOnPlaneIDs() doesn't change object so no new function is required. + Handle(GEOM_Function) aFunction = GEOM::GetCreatedLast(theShape,theAx1)->GetLastFunction(); + + // Make a Python command + GEOM::TPythonDump(aFunction, /*append=*/true) + << "listShapesOnPlane = geompy.GetShapesOnPlaneWithLocationIDs" + << "(" << theShape << ", " << aShapeType << ", " << theAx1 << ", "<< thePnt << ", " << theState << ")"; + + SetErrorCode(OK); + return aSeq; +} + //============================================================================= /*! * GetShapesOnCylinderIDs diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx index d18b35c12..f24d1d03c 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx @@ -97,6 +97,13 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations { const Handle(GEOM_Object)& theAx1, const GEOMAlgo_State theState); + Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnPlaneWithLocation (const Handle(GEOM_Object)& theShape, + const Standard_Integer theShapeType, + const Handle(GEOM_Object)& theAx1, + const Handle(GEOM_Object)& thePnt, + const GEOMAlgo_State theState); + + Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnCylinder (const Handle(GEOM_Object)& theShape, const Standard_Integer theShapeType, const Handle(GEOM_Object)& theAxis, @@ -114,6 +121,12 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations { const Handle(GEOM_Object)& theAx1, const GEOMAlgo_State theState); + Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnPlaneWithLocationIDs (const Handle(GEOM_Object)& theShape, + const Standard_Integer theShapeType, + const Handle(GEOM_Object)& theAx1, + const Handle(GEOM_Object)& thePnt, + const GEOMAlgo_State theState); + Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape, const Standard_Integer theShapeType, const Handle(GEOM_Object)& theAxis, diff --git a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx index 270d78ff7..27ba4cb29 100644 --- a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx @@ -1,18 +1,18 @@ // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @@ -49,6 +49,7 @@ #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC //============================================================================= @@ -109,6 +110,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateTwoPoints //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Translation driver failed"); return NULL; @@ -159,6 +163,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateDXDYDZ //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Translation driver failed"); return NULL; @@ -212,6 +219,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateTwoPointsCopy //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Translation driver failed"); return NULL; @@ -264,6 +274,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateDXDYDZCopy //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Translation driver failed"); return NULL; @@ -316,6 +329,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVector //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Translation driver failed"); return NULL; @@ -367,6 +383,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorCopy //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Translation driver failed"); return NULL; @@ -420,6 +439,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate1D //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Translation driver failed"); return NULL; @@ -480,6 +502,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate2D (Handle(GEOM_Obje //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Translation driver failed"); return NULL; @@ -533,6 +558,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPlane //Compute the mirror try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Mirror driver failed"); return NULL; @@ -583,6 +611,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPlaneCopy //Compute the mirror try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Mirror driver failed"); return NULL; @@ -634,6 +665,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPoint //Compute the mirror try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Mirror driver failed"); return NULL; @@ -684,6 +718,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPointCopy //Compute the mirror try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Mirror driver failed"); return NULL; @@ -735,6 +772,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorAxis //Compute the mirror try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Mirror driver failed"); return NULL; @@ -785,6 +825,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorAxisCopy //Compute the mirror try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Mirror driver failed"); return NULL; @@ -834,6 +877,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShape //Compute the offset try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Offset driver failed"); return NULL; @@ -885,6 +931,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy //Compute the offset try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Offset driver failed"); return NULL; @@ -938,6 +987,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShape //Compute the scale try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Scale driver failed"); return NULL; @@ -990,6 +1042,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeCopy //Compute the scale try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Scale driver failed"); return NULL; @@ -1019,30 +1074,34 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShape { SetErrorCode(KO); - if (theObject.IsNull() || theStartLCS.IsNull() || theEndLCS.IsNull()) return NULL; + if (theObject.IsNull() || theEndLCS.IsNull()) return NULL; Handle(GEOM_Function) anOriginal = theObject->GetLastFunction(); if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be set in position - // Get last functions of the arguments - Handle(GEOM_Function) aStartLCS = theStartLCS->GetLastFunction(); - Handle(GEOM_Function) aEndLCS = theEndLCS->GetLastFunction(); - //Add a Position function + Standard_Integer aType = POSITION_SHAPE; + if (theStartLCS.IsNull()) aType = POSITION_SHAPE_FROM_GLOBAL; + Handle(GEOM_Function) aFunction = - theObject->AddFunction(GEOMImpl_PositionDriver::GetID(), POSITION_SHAPE); + theObject->AddFunction(GEOMImpl_PositionDriver::GetID(), aType); if (aFunction.IsNull()) return NULL; //Check if the function is set correctly if (aFunction->GetDriverGUID() != GEOMImpl_PositionDriver::GetID()) return NULL; + //Set operation arguments GEOMImpl_IPosition aTI (aFunction); aTI.SetShape(anOriginal); - aTI.SetStartLCS(aStartLCS); - aTI.SetEndLCS(aEndLCS); + aTI.SetEndLCS(theEndLCS->GetLastFunction()); + if (!theStartLCS.IsNull()) + aTI.SetStartLCS(theStartLCS->GetLastFunction()); //Compute the Position try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Position driver failed"); return NULL; @@ -1072,7 +1131,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShapeCopy { SetErrorCode(KO); - if (theObject.IsNull() || theStartLCS.IsNull() || theEndLCS.IsNull()) return NULL; + if (theObject.IsNull() || theEndLCS.IsNull()) return NULL; Handle(GEOM_Function) anOriginal = theObject->GetLastFunction(); if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be set in position @@ -1081,8 +1140,11 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShapeCopy Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); //Add a position function + Standard_Integer aType = POSITION_SHAPE_COPY; + if (theStartLCS.IsNull()) aType = POSITION_SHAPE_FROM_GLOBAL_COPY; + Handle(GEOM_Function) aFunction = - aCopy->AddFunction(GEOMImpl_PositionDriver::GetID(), POSITION_SHAPE_COPY); + aCopy->AddFunction(GEOMImpl_PositionDriver::GetID(), aType); if (aFunction.IsNull()) return NULL; //Check if the function is set correctly @@ -1090,11 +1152,15 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShapeCopy GEOMImpl_IPosition aTI (aFunction); aTI.SetShape(anOriginal); - aTI.SetStartLCS(theStartLCS->GetLastFunction()); aTI.SetEndLCS(theEndLCS->GetLastFunction()); + if (!theStartLCS.IsNull()) + aTI.SetStartLCS(theStartLCS->GetLastFunction()); //Compute the position try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Position driver failed"); return NULL; @@ -1148,6 +1214,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate (Handle(GEOM_Object) t //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Rotate driver failed"); return NULL; @@ -1198,6 +1267,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Objec //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Rotate driver failed"); return NULL; @@ -1250,6 +1322,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate1D (Handle(GEOM_Object) //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Rotate driver failed"); return NULL; @@ -1308,6 +1383,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate2D (Handle(GEOM_Object) //Compute the translation try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!GetSolver()->ComputeFunction(aFunction)) { SetErrorCode("Rotate driver failed"); return NULL; diff --git a/src/GEOMImpl/GEOMImpl_ImportDriver.cxx b/src/GEOMImpl/GEOMImpl_ImportDriver.cxx index 2231421b4..90b01ace0 100644 --- a/src/GEOMImpl/GEOMImpl_ImportDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ImportDriver.cxx @@ -56,37 +56,6 @@ typedef TopoDS_Shape (*funcPoint)(const TCollection_AsciiString&, const TCollection_AsciiString&, TCollection_AsciiString&); -//This class is workaround of BUG OCC13051 -//It's stored all loaded libraries for import and unload that in destructor -class DLL_Collector -{ - typedef NCollection_DataMap DLL_Collector_Map; - DLL_Collector_Map myMapOfDLL; -public: - DLL_Collector(){}; - ~DLL_Collector() - { - DLL_Collector_Map::Iterator Iter( myMapOfDLL ); - for( ; Iter.More(); Iter.Next() ) - UnLoadLib( Iter.Value() ); - } - -public: - LibHandle LoadDLL( const TCollection_AsciiString& theLibName ) - { - if ( myMapOfDLL.IsBound( theLibName ) ) - return myMapOfDLL( theLibName ); - - LibHandle res = LoadLib( theLibName.ToCString() ); - if ( res ) - myMapOfDLL.Bind( theLibName, res ); - - return res; - } -}; - -static DLL_Collector GlobalCollector; - //======================================================================= //function : GetID //purpose : @@ -126,7 +95,7 @@ Standard_Integer GEOMImpl_ImportDriver::Execute(TFunction_Logbook& log) const return 0; // load plugin library - LibHandle anImportLib = GlobalCollector.LoadDLL( aLibName ); //This is workaround of BUG OCC13051 + LibHandle anImportLib = LoadLib( aLibName.ToCString() ); //This is workaround of BUG OCC13051 funcPoint fp = 0; if ( anImportLib ) fp = (funcPoint)GetProc( anImportLib, "Import" ); diff --git a/src/GEOMImpl/GEOMImpl_LineDriver.cxx b/src/GEOMImpl/GEOMImpl_LineDriver.cxx index 8e27bcb3c..a7bf8d433 100644 --- a/src/GEOMImpl/GEOMImpl_LineDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_LineDriver.cxx @@ -79,7 +79,9 @@ Standard_Integer GEOMImpl_LineDriver::Execute(TFunction_Logbook& log) const TopoDS_Shape aShape1 = aRefPnt1->GetValue(); TopoDS_Shape aShape2 = aRefPnt2->GetValue(); if (aShape1.ShapeType() != TopAbs_VERTEX || - aShape2.ShapeType() != TopAbs_VERTEX) return 0; + aShape2.ShapeType() != TopAbs_VERTEX) { + Standard_ConstructionError::Raise("Wrong arguments: two points must be given"); + } if (aShape1.IsSame(aShape2)) { Standard_ConstructionError::Raise("The end points must be different"); } @@ -95,8 +97,12 @@ Standard_Integer GEOMImpl_LineDriver::Execute(TFunction_Logbook& log) const Handle(GEOM_Function) aRefDir = aPI.GetPoint2(); TopoDS_Shape aShape1 = aRefPnt->GetValue(); TopoDS_Shape aShape2 = aRefDir->GetValue(); - if (aShape1.ShapeType() != TopAbs_VERTEX || - aShape2.ShapeType() != TopAbs_EDGE) return 0; + if (aShape1.ShapeType() != TopAbs_VERTEX) { + Standard_ConstructionError::Raise("Wrong first argument: must be point"); + } + if (aShape2.ShapeType() != TopAbs_EDGE) { + Standard_ConstructionError::Raise("Wrong second argument: must be vector"); + } if (aShape1.IsSame(aShape2)) { Standard_ConstructionError::Raise("The end points must be different"); } diff --git a/src/GEOMImpl/GEOMImpl_PlaneDriver.cxx b/src/GEOMImpl/GEOMImpl_PlaneDriver.cxx index bd5ccdee1..1f3e28c77 100644 --- a/src/GEOMImpl/GEOMImpl_PlaneDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PlaneDriver.cxx @@ -1,18 +1,18 @@ // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @@ -25,6 +25,9 @@ #include #include +#include + +// OCCT Includes #include #include #include @@ -53,29 +56,29 @@ //======================================================================= //function : GetID //purpose : -//======================================================================= +//======================================================================= const Standard_GUID& GEOMImpl_PlaneDriver::GetID() { static Standard_GUID aPlaneDriver("FF1BBB05-5D14-4df2-980B-3A668264EA16"); - return aPlaneDriver; + return aPlaneDriver; } //======================================================================= //function : GEOMImpl_PlaneDriver -//purpose : +//purpose : //======================================================================= -GEOMImpl_PlaneDriver::GEOMImpl_PlaneDriver() +GEOMImpl_PlaneDriver::GEOMImpl_PlaneDriver() { } //======================================================================= //function : Execute //purpose : -//======================================================================= +//======================================================================= Standard_Integer GEOMImpl_PlaneDriver::Execute(TFunction_Logbook& log) const { - if (Label().IsNull()) return 0; + if (Label().IsNull()) return 0; Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label()); GEOMImpl_IPlane aPI (aFunction); @@ -124,13 +127,16 @@ Standard_Integer GEOMImpl_PlaneDriver::Execute(TFunction_Logbook& log) const } else if (aType == PLANE_FACE) { Handle(GEOM_Function) aRef = aPI.GetFace(); TopoDS_Shape aRefShape = aRef->GetValue(); - if (aRefShape.ShapeType() != TopAbs_FACE) return 0; - Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(aRefShape)); - if (!aGS->IsKind(STANDARD_TYPE(Geom_Plane))) { - Standard_TypeMismatch::Raise("Plane creation aborted: non-planar face given as argument"); - } - aShape = BRepBuilderAPI_MakeFace(aGS, -aSize, +aSize, -aSize, +aSize).Shape(); - } + //if (aRefShape.ShapeType() != TopAbs_FACE) return 0; + //Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(aRefShape)); + //if (!aGS->IsKind(STANDARD_TYPE(Geom_Plane))) { + // Standard_TypeMismatch::Raise("Plane creation aborted: non-planar face given as argument"); + //} + //aShape = BRepBuilderAPI_MakeFace(aGS, -aSize, +aSize, -aSize, +aSize).Shape(); + gp_Ax3 anAx3 = GEOMImpl_IMeasureOperations::GetPosition(aRefShape); + gp_Pln aPln (anAx3); + aShape = BRepBuilderAPI_MakeFace(aPln, -aSize, +aSize, -aSize, +aSize).Shape(); + } else if (aType == PLANE_TANGENT_FACE) { Handle(GEOM_Function) aRefFace = aPI.GetFace(); @@ -138,7 +144,7 @@ Standard_Integer GEOMImpl_PlaneDriver::Execute(TFunction_Logbook& log) const if(aShape1.IsNull()) Standard_TypeMismatch::Raise("Plane was not created.Basis face was not specified"); TopoDS_Face aFace = TopoDS::Face(aShape1); - + Standard_Real aKoefU = aPI.GetParameterU(); Standard_Real aKoefV = aPI.GetParameterV(); Standard_Real aUmin,aUmax,aVmin,aVmax; @@ -154,7 +160,7 @@ Standard_Integer GEOMImpl_PlaneDriver::Execute(TFunction_Logbook& log) const gp_Pnt aPLoc; aSurf->D1(aParamU,aParamV,aPLoc,aVecU,aVecV); BRepTopAdaptor_FClass2d clas(aFace,Precision::PConfusion()); - + TopAbs_State stOut= clas.PerformInfinitePoint(); gp_Pnt2d aP2d(aParamU,aParamV); TopAbs_State st= clas.Perform(aP2d); @@ -167,7 +173,6 @@ Standard_Integer GEOMImpl_PlaneDriver::Execute(TFunction_Logbook& log) const if(aTool.IsDone()) aShape = aTool.Shape(); } - else { } @@ -175,7 +180,7 @@ Standard_Integer GEOMImpl_PlaneDriver::Execute(TFunction_Logbook& log) const aFunction->SetValue(aShape); - log.SetTouched(Label()); + log.SetTouched(Label()); return 1; } @@ -184,17 +189,17 @@ Standard_Integer GEOMImpl_PlaneDriver::Execute(TFunction_Logbook& log) const //======================================================================= //function : GEOMImpl_PlaneDriver_Type_ //purpose : -//======================================================================= +//======================================================================= Standard_EXPORT Handle_Standard_Type& GEOMImpl_PlaneDriver_Type_() { static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); + if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); - + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PlaneDriver", @@ -209,7 +214,7 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_PlaneDriver_Type_() //======================================================================= //function : DownCast //purpose : -//======================================================================= +//======================================================================= const Handle(GEOMImpl_PlaneDriver) Handle(GEOMImpl_PlaneDriver)::DownCast (const Handle(Standard_Transient)& AnObject) { diff --git a/src/GEOMImpl/GEOMImpl_PositionDriver.cxx b/src/GEOMImpl/GEOMImpl_PositionDriver.cxx index 8e0fb508f..789575c79 100644 --- a/src/GEOMImpl/GEOMImpl_PositionDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PositionDriver.cxx @@ -1,30 +1,33 @@ // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include +//#include #include #include #include #include +#include + +// OCCT Includes #include #include #include @@ -43,29 +46,29 @@ //======================================================================= //function : GetID //purpose : -//======================================================================= +//======================================================================= const Standard_GUID& GEOMImpl_PositionDriver::GetID() { static Standard_GUID aPositionDriver("FF1BBB69-5D14-4df2-980B-3A668264EA16"); - return aPositionDriver; + return aPositionDriver; } //======================================================================= //function : GEOMImpl_PositionDriver -//purpose : +//purpose : //======================================================================= -GEOMImpl_PositionDriver::GEOMImpl_PositionDriver() +GEOMImpl_PositionDriver::GEOMImpl_PositionDriver() { } //======================================================================= //function : Execute //purpose : -//======================================================================= +//======================================================================= Standard_Integer GEOMImpl_PositionDriver::Execute(TFunction_Logbook& log) const { - if (Label().IsNull()) return 0; + if (Label().IsNull()) return 0; Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label()); GEOMImpl_IPosition aCI (aFunction); @@ -82,58 +85,48 @@ Standard_Integer GEOMImpl_PositionDriver::Execute(TFunction_Logbook& log) const TopoDS_Shape aShapeStartLCS = aRefStartLCS->GetValue(); TopoDS_Shape aShapeEndLCS = aRefEndLCS->GetValue(); - if (aShapeBase.IsNull() || aShapeStartLCS.IsNull() || + if (aShapeBase.IsNull() || aShapeStartLCS.IsNull() || aShapeEndLCS.IsNull() || aShapeEndLCS.ShapeType() != TopAbs_FACE) return 0; gp_Trsf aTrsf; gp_Ax3 aStartAx3, aDestAx3; - aStartAx3.Transform(aShapeStartLCS.Location().Transformation()); - aDestAx3.Transform(aShapeEndLCS.Location().Transformation()); - - Handle(Geom_Surface) aGS2 = BRep_Tool::Surface( TopoDS::Face( aShapeEndLCS ) ); - if (!aGS2.IsNull() && aGS2->IsKind( STANDARD_TYPE( Geom_Plane ) ) ) { - Handle(Geom_Plane) aGPlane2 = Handle(Geom_Plane)::DownCast( aGS2 ); - gp_Pln aPln2 = aGPlane2->Pln(); - aDestAx3 = aPln2.Position(); - } - - if(aShapeStartLCS.ShapeType() == TopAbs_FACE) { - Handle(Geom_Surface) aGS = BRep_Tool::Surface( TopoDS::Face( aShapeStartLCS ) ); - if (!aGS.IsNull() && aGS->IsKind( STANDARD_TYPE( Geom_Plane ) ) ) { - Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast( aGS ); - gp_Pln aPln = aGPlane->Pln(); - aStartAx3 = aPln.Position(); - } - aTrsf.SetDisplacement(aStartAx3, aDestAx3); - } - else { - gp_Trsf aTrsf1, aTrsf2; - aTrsf1.SetDisplacement(aStartAx3, aDestAx3); - BRepBuilderAPI_Transform aBT (aShapeBase, aTrsf1, Standard_False); - TopoDS_Shape aNewShape = aBT.Shape(); - - gp_Pnt aPnt; - if (aNewShape.ShapeType() == TopAbs_VERTEX) { - aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aNewShape)); - } - else { - GProp_GProps aSystem; - if (aNewShape.ShapeType() == TopAbs_EDGE || aNewShape.ShapeType() == TopAbs_WIRE) - BRepGProp::LinearProperties(aNewShape, aSystem); - else if (aNewShape.ShapeType() == TopAbs_FACE || aNewShape.ShapeType() == TopAbs_SHELL) - BRepGProp::SurfaceProperties(aNewShape, aSystem); - else - BRepGProp::VolumeProperties(aNewShape, aSystem); - - aPnt = aSystem.CentreOfMass(); - } - - gp_Vec aVec(aPnt, aDestAx3.Location()); - aTrsf2.SetTranslation(aVec); - aTrsf = aTrsf2 * aTrsf1; - } + // End LCS + aDestAx3 = GEOMImpl_IMeasureOperations::GetPosition(aShapeEndLCS); + + // Start LCS + aStartAx3 = GEOMImpl_IMeasureOperations::GetPosition(aShapeStartLCS); + + // Set transformation + aTrsf.SetDisplacement(aStartAx3, aDestAx3); + + // Perform transformation + BRepBuilderAPI_Transform aBRepTrsf (aShapeBase, aTrsf, Standard_False); + aShape = aBRepTrsf.Shape(); + } + else if (aType == POSITION_SHAPE_FROM_GLOBAL || + aType == POSITION_SHAPE_FROM_GLOBAL_COPY) { + Handle(GEOM_Function) aRefShape = aCI.GetShape(); + Handle(GEOM_Function) aRefEndLCS = aCI.GetEndLCS(); + + TopoDS_Shape aShapeBase = aRefShape->GetValue(); + TopoDS_Shape aShapeEndLCS = aRefEndLCS->GetValue(); + + if (aShapeBase.IsNull() || aShapeEndLCS.IsNull() || + aShapeEndLCS.ShapeType() != TopAbs_FACE) + return 0; + + gp_Trsf aTrsf; + gp_Ax3 aStartAx3, aDestAx3; + + // End LCS + aDestAx3 = GEOMImpl_IMeasureOperations::GetPosition(aShapeEndLCS); + + // Set transformation + aTrsf.SetDisplacement(aStartAx3, aDestAx3); + + // Perform transformation BRepBuilderAPI_Transform aBRepTrsf (aShapeBase, aTrsf, Standard_False); aShape = aBRepTrsf.Shape(); } @@ -144,26 +137,26 @@ Standard_Integer GEOMImpl_PositionDriver::Execute(TFunction_Logbook& log) const aFunction->SetValue(aShape); - log.SetTouched(Label()); + log.SetTouched(Label()); - return 1; + return 1; } //======================================================================= //function : GEOMImpl_PositionDriver_Type_ //purpose : -//======================================================================= +//======================================================================= Standard_EXPORT Handle_Standard_Type& GEOMImpl_PositionDriver_Type_() { static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); + if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); - + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PositionDriver", @@ -178,7 +171,7 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_PositionDriver_Type_() //======================================================================= //function : DownCast //purpose : -//======================================================================= +//======================================================================= const Handle(GEOMImpl_PositionDriver) Handle(GEOMImpl_PositionDriver)::DownCast(const Handle(Standard_Transient)& AnObject) { Handle(GEOMImpl_PositionDriver) _anOtherObject; diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx index 5177a5081..dc199ffee 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -114,18 +115,26 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const if (aShape_i.ShapeType() == TopAbs_EDGE) { B.Add(aWire, TopoDS::Edge(aShape_i)); MW.Add(TopoDS::Edge(aShape_i)); + if (!MW.IsDone()) { + // check status after each edge/wire addition, because the final status + // can be OK even in case, when some edges/wires was not accepted. + isMWDone = false; + } } else if (aShape_i.ShapeType() == TopAbs_WIRE) { - B.Add(aWire, TopoDS::Wire(aShape_i)); - MW.Add(TopoDS::Wire(aShape_i)); + TopExp_Explorer exp (aShape_i, TopAbs_EDGE); + for (; exp.More(); exp.Next()) { + B.Add(aWire, TopoDS::Edge(exp.Current())); + MW.Add(TopoDS::Edge(exp.Current())); + if (!MW.IsDone()) { + // check status after each edge/wire addition, because the final status + // can be OK even in case, when some edges/wires was not accepted. + isMWDone = false; + } + } } else { Standard_TypeMismatch::Raise ("Shape for wire construction is neither an edge nor a wire"); } - if (!MW.IsDone()) { - // check status after each edge/wire addition, because the final status - // can be OK even in case, when some edges/wires was not accepted. - isMWDone = false; - } } if (isMWDone) { @@ -146,48 +155,63 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const } aShape = aFW->WireAPIMake(); } - - } else if (aType == FACE_WIRE) { + } + else if (aType == FACE_WIRE) { Handle(GEOM_Function) aRefBase = aCI.GetBase(); TopoDS_Shape aShapeBase = aRefBase->GetValue(); - if (aShapeBase.IsNull() || aShapeBase.ShapeType() != TopAbs_WIRE) { + if (aShapeBase.IsNull()) Standard_NullObject::Raise("Argument Shape is null"); + TopoDS_Wire W; + if (aShapeBase.ShapeType() == TopAbs_WIRE) { + W = TopoDS::Wire(aShapeBase); + } + else if (aShapeBase.ShapeType() == TopAbs_EDGE && aShapeBase.Closed()) { + BRepBuilderAPI_MakeWire MW; + MW.Add(TopoDS::Edge(aShapeBase)); + if (!MW.IsDone()) { + Standard_ConstructionError::Raise("Wire construction failed"); + } + W = MW; + } + else { Standard_NullObject::Raise - ("Shape for face construction is null or not a wire"); + ("Shape for face construction is neither a wire nor a closed edge"); } - TopoDS_Wire W = TopoDS::Wire(aShapeBase); - //BRepBuilderAPI_MakeFace MF (W, aCI.GetIsPlanar()); - //if (!MF.IsDone()) { - // Standard_ConstructionError::Raise("Face construction failed"); - //} - //aShape = MF.Shape(); GEOMImpl_Block6Explorer::MakeFace(W, aCI.GetIsPlanar(), aShape); if (aShape.IsNull()) { Standard_ConstructionError::Raise("Face construction failed"); } - - } else if (aType == FACE_WIRES) { + } + else if (aType == FACE_WIRES) { Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes(); int nbshapes = aShapes->Length(); if (nbshapes < 1) { Standard_ConstructionError::Raise("No wires given"); } - // first wire + // first wire or edge Handle(GEOM_Function) aRefWire = Handle(GEOM_Function)::DownCast(aShapes->Value(1)); TopoDS_Shape aWire = aRefWire->GetValue(); - if (aWire.IsNull() || aWire.ShapeType() != TopAbs_WIRE) { - Standard_NullObject::Raise("Shape for face construction is null or not a wire"); + if (aWire.IsNull()) Standard_NullObject::Raise("Argument Shape is null"); + TopoDS_Wire W1; + if(aWire.ShapeType() == TopAbs_WIRE) { + W1 = TopoDS::Wire(aWire); + } + else if(aWire.ShapeType() == TopAbs_EDGE && aWire.Closed()) { + BRepBuilderAPI_MakeWire MW; + MW.Add(TopoDS::Edge(aWire)); + if (!MW.IsDone()) { + Standard_ConstructionError::Raise("Wire construction failed"); + } + W1 = MW; + } + else { + Standard_NullObject::Raise + ("Shape for face construction is neither a wire nor closed edge"); } - TopoDS_Wire W = TopoDS::Wire(aWire); // basic face - //BRepBuilderAPI_MakeFace MF (W, aCI.GetIsPlanar()); - //if (!MF.IsDone()) { - // Standard_ConstructionError::Raise("Face construction failed"); - //} - //TopoDS_Shape FFace = MF.Shape(); TopoDS_Shape FFace; - GEOMImpl_Block6Explorer::MakeFace(W, aCI.GetIsPlanar(), FFace); + GEOMImpl_Block6Explorer::MakeFace(W1, aCI.GetIsPlanar(), FFace); if (FFace.IsNull()) { Standard_ConstructionError::Raise("Face construction failed"); } @@ -209,11 +233,24 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const Handle(GEOM_Function) aRefWire_i = Handle(GEOM_Function)::DownCast(aShapes->Value(ind)); TopoDS_Shape aWire_i = aRefWire_i->GetValue(); - if (aWire_i.IsNull() || aWire_i.ShapeType() != TopAbs_WIRE) { - Standard_NullObject::Raise("Shape for face construction is null or not a wire"); - } - - FR.Add(TopoDS::Wire(aWire_i)); + if (aWire_i.IsNull()) Standard_NullObject::Raise("Argument Shape is null"); + TopoDS_Wire W_i; + if(aWire_i.ShapeType() == TopAbs_WIRE) { + W_i = TopoDS::Wire(aWire_i); + } + else if(aWire_i.ShapeType() == TopAbs_EDGE && aWire_i.Closed()) { + BRepBuilderAPI_MakeWire MW1; + MW1.Add(TopoDS::Edge(aWire_i)); + if (!MW1.IsDone()) { + Standard_ConstructionError::Raise("Wire construction failed"); + } + W_i = MW1; + } + else { + Standard_NullObject::Raise + ("Shape for face construction is neither a wire nor closed edges"); + } + FR.Add(W_i); } FR.Perform(); @@ -233,7 +270,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const } } } - } else if (aType == SHELL_FACES) { + } + else if (aType == SHELL_FACES) { Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes(); unsigned int ind, nbshapes = aShapes->Length(); @@ -250,17 +288,29 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const aSewing.Perform(); - TopExp_Explorer exp (aSewing.SewedShape(), TopAbs_SHELL); - Standard_Integer ish = 0; - for (; exp.More(); exp.Next()) { - aShape = exp.Current(); - ish++; + TopoDS_Shape sh = aSewing.SewedShape(); + if( sh.ShapeType()==TopAbs_FACE && nbshapes==1 ) { + // case for creation of shell from one face - PAL12722 (skl 26.06.2006) + TopoDS_Shell ss; + B.MakeShell(ss); + B.Add(ss,sh); + aShape = ss; } + else { + //TopExp_Explorer exp (aSewing.SewedShape(), TopAbs_SHELL); + TopExp_Explorer exp (sh, TopAbs_SHELL); + Standard_Integer ish = 0; + for (; exp.More(); exp.Next()) { + aShape = exp.Current(); + ish++; + } - if (ish != 1) - aShape = aSewing.SewedShape(); + if (ish != 1) + aShape = aSewing.SewedShape(); + } - } else if (aType == SOLID_SHELL) { + } + else if (aType == SOLID_SHELL) { Handle(GEOM_Function) aRefShell = aCI.GetBase(); TopoDS_Shape aShapeShell = aRefShell->GetValue(); if (aShapeShell.IsNull() || aShapeShell.ShapeType() != TopAbs_SHELL) { @@ -282,7 +332,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const aShape = Sol; - } else if (aType == SOLID_SHELLS) { + } + else if (aType == SOLID_SHELLS) { Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes(); unsigned int ind, nbshapes = aShapes->Length(); Standard_Integer ish = 0; @@ -313,7 +364,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const return 0; } - } else if (aType == COMPOUND_SHAPES) { + } + else if (aType == COMPOUND_SHAPES) { Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes(); unsigned int ind, nbshapes = aShapes->Length(); @@ -331,7 +383,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const aShape = C; - } else if (aType == REVERSE_ORIENTATION) { + } + else if (aType == REVERSE_ORIENTATION) { Handle(GEOM_Function) aRefShape = aCI.GetBase(); TopoDS_Shape aShape_i = aRefShape->GetValue(); if (aShape_i.IsNull()) { diff --git a/src/GEOMImpl/GEOMImpl_SketcherDriver.cxx b/src/GEOMImpl/GEOMImpl_SketcherDriver.cxx index b62081d4c..2a6eb0a7b 100644 --- a/src/GEOMImpl/GEOMImpl_SketcherDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_SketcherDriver.cxx @@ -25,6 +25,9 @@ #include #include +#include + +// OCCT Includes #include #include #include @@ -100,13 +103,14 @@ Standard_Integer GEOMImpl_SketcherDriver::Execute(TFunction_Logbook& log) const { Handle(GEOM_Function) aRefFace = aCI.GetWorkingPlane(); TopoDS_Shape aShape = aRefFace->GetValue(); - if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_FACE ) - return 0; - Handle(Geom_Surface) aGS = BRep_Tool::Surface( TopoDS::Face( aShape )); - if ( aGS.IsNull() || !aGS->IsKind( STANDARD_TYPE( Geom_Plane ))) - return 0; - Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast( aGS ); - aWPlane = aGPlane->Pln().Position(); + //if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_FACE ) + // return 0; + //Handle(Geom_Surface) aGS = BRep_Tool::Surface( TopoDS::Face( aShape )); + //if ( aGS.IsNull() || !aGS->IsKind( STANDARD_TYPE( Geom_Plane ))) + // return 0; + //Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast( aGS ); + //aWPlane = aGPlane->Pln().Position(); + aWPlane = GEOMImpl_IMeasureOperations::GetPosition(aShape); } gp_Trsf aTrans; aTrans.SetTransformation(aWPlane); diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index 4f679dd16..cc0ebb563 100755 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -135,6 +135,8 @@ #define POSITION_SHAPE 1 #define POSITION_SHAPE_COPY 2 +#define POSITION_SHAPE_FROM_GLOBAL 3 +#define POSITION_SHAPE_FROM_GLOBAL_COPY 4 #define TORUS_RR 1 #define TORUS_PNT_VEC_RR 2 @@ -204,13 +206,14 @@ #define ARCHIMEDE_TYPE 1 // Shape Healing operators -#define SHAPE_PROCESS 1 -#define SUPPRESS_FACES 2 -#define CLOSE_CONTOUR 3 -#define REMOVE_INT_WIRES 4 -#define FILL_HOLES 5 -#define SEWING 6 -#define DIVIDE_EDGE 7 +#define SHAPE_PROCESS 1 +#define SUPPRESS_FACES 2 +#define CLOSE_CONTOUR 3 +#define REMOVE_INT_WIRES 4 +#define FILL_HOLES 5 +#define SEWING 6 +#define DIVIDE_EDGE 7 +#define CHANGE_ORIENTATION 8 #define BASIC_FILLING 1 diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index 9c96d277c..330156a34 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -227,7 +227,8 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) void GEOMToolsGUI::OnEditDelete() { SALOME_ListIO selected; - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + SalomeApp_Application* app = + dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( app ) { LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); @@ -287,6 +288,10 @@ void GEOMToolsGUI::OnEditDelete() _PTR(GenericAttribute) anAttr; GEOM_Displayer* disp = new GEOM_Displayer( appStudy ); + _PTR(SComponent) aGeom ( aStudy->FindComponent("GEOM") ); + if ( !aGeom ) + return; + // MAIN LOOP OF SELECTED OBJECTS for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { @@ -300,42 +305,30 @@ void GEOMToolsGUI::OnEditDelete() if ( !strcmp( obj->GetIOR().c_str(), geomIOR ) ) continue; - // iterate through all children of obj, find IOR attributes on children - // and remove shapes that correspond to these IORs - for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) { - _PTR(SObject) child (it->Value()); - if (child->FindAttribute(anAttr, "AttributeIOR")) { - _PTR(AttributeIOR) anIOR (anAttr); - - // Delete child( s ) shape in Client : - const TCollection_AsciiString ASCior ((char*)anIOR->Value().c_str()); - getGeometryGUI()->GetShapeReader().RemoveShapeFromBuffer(ASCior); - - CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(child); - GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow(corbaObj); - if (!CORBA::is_nil(geomObj)) { - for (view = views.first(); view; view = views.next()) { - disp->Erase(geomObj, true, view); - } + //If the object has been used to create another one,then it can't be deleted + _PTR(ChildIterator) it (aStudy->NewChildIterator(aGeom)); + for ( it->InitEx( true ); it->More(); it->Next() ) { + _PTR(SObject) chobj (it->Value()); + CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(chobj); + GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj ); + if( CORBA::is_nil(geomObj) ) + continue; + GEOM::ListOfGO_var list = geomObj->GetDependency(); + if( list->length() > 1 ) + for(int i = 0; i < list->length(); i++ ){ + CORBA::Object_var corbaObj_rem = GeometryGUI::ClientSObjectToObject(obj); + GEOM::GEOM_Object_var geomObj_rem = GEOM::GEOM_Object::_narrow( corbaObj_rem ); + if( list[i]->_is_equivalent( geomObj_rem ) ){ + SUIT_MessageBox::warn1 ( app->desktop(), + QObject::tr("WRN_WARNING"), + QObject::tr("DEP_OBJECT"), + QObject::tr("BUT_OK") ); + return; + } } - } - } // for ( children of obj ) - - // Erase main graphical object - for ( view = views.first(); view; view = views.next() ) - disp->Erase( io, true, view ); - - // Delete main shape in Client : - if ( obj->FindAttribute( anAttr, "AttributeIOR" ) ) { - _PTR(AttributeIOR) anIOR( anAttr ); - const TCollection_AsciiString ASCIor( (char*)anIOR->Value().c_str() ); - getGeometryGUI()->GetShapeReader().RemoveShapeFromBuffer( ASCIor ); - } + } - CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(obj); - GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj ); - if ( !CORBA::is_nil( geomObj ) ) - GeometryGUI::GetGeomGen()->RemoveObject( geomObj ); + RemoveObjectWithChildren(obj, aStudy, views, disp); // Remove objects from Study aStudyBuilder->RemoveObject( obj ); @@ -450,6 +443,17 @@ bool GEOMToolsGUI::Import() QString fileName = getFileName(app->desktop(), "", aMap, tr("GEOM_MEN_IMPORT"), true, fileType); + + if (fileType.isEmpty() ) + { + // Trying to detect file type + QFileInfo aFileInfo( fileName ); + QString aPossibleType = (aFileInfo.extension(false)).upper() ; + + if ( (aMap.values()).contains(aPossibleType) ) + fileType = aPossibleType; + } + if (fileName.isEmpty() || fileType.isEmpty()) return false; @@ -638,6 +642,45 @@ QString GEOMToolsGUI::getParentComponent( _PTR( SObject ) obj ) return QString(); } +//===================================================================================== +// function : RemoveObjectWithChildren +// purpose : to be used by OnEditDelete() method +//===================================================================================== +void GEOMToolsGUI::RemoveObjectWithChildren(_PTR(SObject) obj, + _PTR(Study) aStudy, + QPtrList views, + GEOM_Displayer* disp) +{ + // iterate through all children of obj + for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) { + _PTR(SObject) child (it->Value()); + RemoveObjectWithChildren(child, aStudy, views, disp); + } + + // erase object and remove it from engine + _PTR(GenericAttribute) anAttr; + if (obj->FindAttribute(anAttr, "AttributeIOR")) { + _PTR(AttributeIOR) anIOR (anAttr); + + // Delete shape in Client + const TCollection_AsciiString ASCIor ((char*)anIOR->Value().c_str()); + getGeometryGUI()->GetShapeReader().RemoveShapeFromBuffer(ASCIor); + + CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(obj); + GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj ); + if (!CORBA::is_nil(geomObj)) { + // Erase graphical object + SALOME_View* view = views.first(); + for (; view; view = views.next()) { + disp->Erase(geomObj, true, view); + } + + // Remove object from Engine + GeometryGUI::GetGeomGen()->RemoveObject( geomObj ); + } + } +} + //===================================================================================== // EXPORTED METHODS //===================================================================================== diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.h b/src/GEOMToolsGUI/GEOMToolsGUI.h index 6cdd066f9..512b5b90d 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI.h @@ -32,11 +32,16 @@ #include "GEOM_ToolsGUI.hxx" #include "GEOMGUI.h" +#include "GEOM_Displayer.h" + +#include #include #include -#include +#include + +#include //================================================================================= // class : GEOMToolsGUI @@ -74,6 +79,12 @@ private: // if objects belong to different Components, a NULL string is returned. QString getParentComponent( _PTR( Study ), const SALOME_ListIO& ); QString getParentComponent( _PTR(SObject) ); + + // Recursive deletion of object with children + void RemoveObjectWithChildren(_PTR(SObject) obj, + _PTR(Study) aStudy, + QPtrList views, + GEOM_Displayer* disp); }; #endif diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 55de2df9d..94c92abfc 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -71,6 +71,8 @@ #include #include #include +#include +#include // VTK Includes #include @@ -260,6 +262,18 @@ void GEOMToolsGUI::OnColor() for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { io = GEOMBase::GetAIS( It.Value(), true ); if ( !io.IsNull() ) { + // Set color for a point + OCCViewer_Viewer* vm = dynamic_cast( window->getViewManager()->getViewModel() ); + Handle (AIS_InteractiveContext) ic = vm->getAISContext(); + Handle(AIS_Drawer) aCurDrawer = io->Attributes(); + Handle(Prs3d_PointAspect) aCurPointAspect = aCurDrawer->PointAspect(); + Quantity_Color aCurColor; + Standard_Real aCurScale; + Aspect_TypeOfMarker aCurTypeOfMarker; + aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale ); + aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aColor, aCurScale) ); + ic->SetLocalAttributes(io, aCurDrawer); + io->SetColor( aColor ); if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) ) Handle(GEOM_AISShape)::DownCast( io )->SetShadingColor( aColor ); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx index b2c5f7f88..05c9d39ab 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx @@ -183,3 +183,20 @@ void GEOMToolsGUI_NbIsosDlg::ClickOnHelp() QObject::tr("BUT_OK")); } } + +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void GEOMToolsGUI_NbIsosDlg::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Key_F1 ) + { + e->accept(); + ClickOnHelp(); + } +} diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h b/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h index 632e86473..e93b1ded3 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h @@ -54,7 +54,10 @@ public: void setV( const int ); private slots: - void ClickOnHelp(); + void ClickOnHelp(); + +private: + void keyPressEvent(QKeyEvent*); private: QSpinBox* SpinBoxU; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx index 89e434713..7e7151a6c 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx @@ -285,3 +285,20 @@ void GEOMToolsGUI_TransparencyDlg::ValueHasChanged( int newValue ) ic->UpdateCurrentViewer(); } // if ( isOCC ) } + +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void GEOMToolsGUI_TransparencyDlg::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Key_F1 ) + { + e->accept(); + ClickOnHelp(); + } +} diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h index 5153cfb4f..0b7aa869c 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h @@ -48,6 +48,9 @@ public: GEOMToolsGUI_TransparencyDlg( QWidget* parent ); ~GEOMToolsGUI_TransparencyDlg(); +private: + void keyPressEvent(QKeyEvent*); + private : bool myFirstInit ; /* Inform for the first init */ QSlider* mySlider; diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index ea5feedf4..2ae6d0a59 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -1,18 +1,18 @@ // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @@ -68,11 +68,25 @@ GEOM_Gen_i::GEOM_Gen_i(CORBA::ORB_ptr orb, _impl = new ::GEOMImpl_Gen; - OSD::SetSignal( true ); + //PAL10867: disable signals catching with "noexcepthandler" option + char* envNoCatchSignals = getenv("NOT_INTERCEPT_SIGNALS"); + if (!envNoCatchSignals || !atoi(envNoCatchSignals)) + { + //work around PAL12004, PAL12628 + //OSD::SetSignal( true ); + bool raiseFPE; +#ifdef _DEBUG_ + raiseFPE = true; + char* envDisableFPE = getenv("DISABLE_FPE"); + if (envDisableFPE && atoi(envDisableFPE)) + raiseFPE = false; +#else + raiseFPE = false; +#endif + OSD::SetSignal( raiseFPE ); + } } - - //============================================================================ // function : ~GEOM_Gen_i() // purpose : destructor @@ -94,7 +108,7 @@ char* GEOM_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, { GEOM::GEOM_Object_var anObject = GEOM::GEOM_Object::_narrow(_orb->string_to_object(IORString)); if (!CORBA::is_nil(anObject)) { - return strdup(anObject->GetEntry()); + return CORBA::string_dup(anObject->GetEntry()); } return 0; } @@ -119,7 +133,7 @@ char* GEOM_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, GEOM::GEOM_Object_var obj = GetObject(anObject->GetDocID(), anEntry.ToCString()); CORBA::String_var aPersRefString = _orb->object_to_string(obj); - return strdup(aPersRefString.in()); + return CORBA::string_dup(aPersRefString); } //============================================================================ @@ -173,8 +187,10 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, } anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR"); SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - CORBA::String_var aGeomObjIOR = _orb->object_to_string(theObject); - anIOR->SetValue( aGeomObjIOR .in() ); + //char *aGeomObjIOR = _orb->object_to_string(theObject); + CORBA::String_var aGeomObjIOR = _orb->object_to_string(theObject); + //anIOR->SetValue(CORBA::string_dup(aGeomObjIOR)); + anIOR->SetValue(aGeomObjIOR); anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributePixMap"); SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); @@ -229,7 +245,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, aShapeName = "Vertex_"; } //if (strlen(theName) == 0) aShapeName += TCollection_AsciiString(aResultSO->Tag()); - //else aShapeName = TCollection_AsciiString((char *)theName); + //else aShapeName = TCollection_AsciiString(CORBA::string_dup(theName)); // asv : 11.11.04 Introducing a more sofisticated method of name creation, just as // it is done in GUI in GEOMBase::GetDefaultName() - not just add a Tag() == number @@ -247,7 +263,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, aShapeName = aNewShapeName; } else // MOST PROBABLY CALLED FROM GEOM GUI (ALREADY WITH VALID NAME) - aShapeName = TCollection_AsciiString((char *)theName); + aShapeName = TCollection_AsciiString((char*)theName); //Set the study entry as a name of the published GEOM_Object aShape->SetStudyEntry(aResultSO->GetID()); @@ -339,7 +355,7 @@ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true); SALOMEDS::Study_var Study = theComponent->GetStudy(); - TCollection_AsciiString name( (char *)(Study->Name() ) ); + TCollection_AsciiString name (Study->Name()); return true; } @@ -454,6 +470,9 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, TDF_Tool::Entry(anObj->GetEntry(), anEntry); GEOM::GEOM_Object_var obj = GetObject(anObj->GetDocID(), anEntry.ToCString()); + //Set the study entry of the published GEOM_Object + obj->SetStudyEntry(aNewSO->GetID()); + // Add IORAttribute to the Study and set IOR of the created GEOM_Object to it SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSO, "AttributeIOR"); SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); @@ -470,7 +489,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, //============================================================================ char* GEOM_Gen_i::ComponentDataType() { - return strdup("GEOM"); + return CORBA::string_dup("GEOM"); } //============================================================================ @@ -520,9 +539,8 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy(SALOMEDS::Study_ptr theStudy, GEOM: //============================================================================ void GEOM_Gen_i::register_name(char * name) { - CORBA::Object_var obj = _this(); - GEOM::GEOM_Gen_var g = GEOM::GEOM_Gen::_narrow(obj); - name_service->Register(g, name); + GEOM::GEOM_Gen_ptr g = GEOM::GEOM_Gen::_narrow(_this()); + name_service->Register(g, CORBA::string_dup(name)); } //============================================================================ diff --git a/src/GEOM_I/GEOM_IBooleanOperations_i.cc b/src/GEOM_I/GEOM_IBooleanOperations_i.cc index 0af96885c..56726b072 100644 --- a/src/GEOM_I/GEOM_IBooleanOperations_i.cc +++ b/src/GEOM_I/GEOM_IBooleanOperations_i.cc @@ -154,10 +154,11 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition //Get the materials aLen = theMaterials.length(); - if ( aLen ) + if ( aLen ) { aMaterials = new TColStd_HArray1OfInteger (1, aLen); - for (ind = 0; ind < aLen; ind++) { - aMaterials->SetValue(ind+1, theMaterials[ind]); + for (ind = 0; ind < aLen; ind++) { + aMaterials->SetValue(ind+1, theMaterials[ind]); + } } // Make Partition diff --git a/src/GEOM_I/GEOM_IHealingOperations_i.cc b/src/GEOM_I/GEOM_IHealingOperations_i.cc index a3dc9b4aa..cdd3f1efe 100644 --- a/src/GEOM_I/GEOM_IHealingOperations_i.cc +++ b/src/GEOM_I/GEOM_IHealingOperations_i.cc @@ -454,3 +454,71 @@ CORBA::Boolean GEOM_IHealingOperations_i::GetFreeBoundary ( GEOM::GEOM_Object_pt return true; } + + +//============================================================================= +/*! + * ChangeOrientation + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientation (GEOM::GEOM_Object_ptr theObject) +{ + GEOM::GEOM_Object_var aGEOMObject; + + // Set a not done flag + GetOperations()->SetNotDone(); + + // Check parameters + if ( CORBA::is_nil(theObject) ) + return aGEOMObject._retn(); + + aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); + + // Get the object itself + Handle(GEOM_Object) anObject = + GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry()); + if (anObject.IsNull()) + return aGEOMObject._retn(); + + // Perform +// Handle(GEOM_Object) aNewObject = + GetOperations()->ChangeOrientation( anObject ); +// if (!GetOperations()->IsDone() || aNewObject.IsNull()) +// return aGEOMObject._retn(); + + //return GetObject(aNewObject); + return aGEOMObject._retn(); +} + + +//============================================================================= +/*! + * ChangeOrientationCopy + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientationCopy (GEOM::GEOM_Object_ptr theObject) +{ + GEOM::GEOM_Object_var aGEOMObject; + + // Set a not done flag + GetOperations()->SetNotDone(); + + // Check parameters + if ( CORBA::is_nil(theObject) ) + return aGEOMObject._retn(); + + // Get the object itself + Handle(GEOM_Object) anObject = + GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry()); + if (anObject.IsNull()) + return aGEOMObject._retn(); + + // Perform + Handle(GEOM_Object) aNewObject = + GetOperations()->ChangeOrientationCopy( anObject ); + if (!GetOperations()->IsDone() || aNewObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(aNewObject); +} + diff --git a/src/GEOM_I/GEOM_IHealingOperations_i.hh b/src/GEOM_I/GEOM_IHealingOperations_i.hh index 53b9778cb..1b3f45118 100644 --- a/src/GEOM_I/GEOM_IHealingOperations_i.hh +++ b/src/GEOM_I/GEOM_IHealingOperations_i.hh @@ -62,6 +62,9 @@ class GEOM_I_EXPORT GEOM_IHealingOperations_i : CORBA::Boolean GetFreeBoundary(GEOM::GEOM_Object_ptr theObject, GEOM::ListOfGO_out theClosedWires, GEOM::ListOfGO_out theOpenWires ); + GEOM::GEOM_Object_ptr ChangeOrientation (GEOM::GEOM_Object_ptr theObject); + GEOM::GEOM_Object_ptr ChangeOrientationCopy (GEOM::GEOM_Object_ptr theObject); + ::GEOMImpl_IHealingOperations* GetOperations() { return (::GEOMImpl_IHealingOperations*)GetImpl(); } private: diff --git a/src/GEOM_I/GEOM_IMeasureOperations_i.cc b/src/GEOM_I/GEOM_IMeasureOperations_i.cc index c29bf81d2..9b763dfaf 100644 --- a/src/GEOM_I/GEOM_IMeasureOperations_i.cc +++ b/src/GEOM_I/GEOM_IMeasureOperations_i.cc @@ -1,18 +1,18 @@ // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @@ -51,6 +51,36 @@ GEOM_IMeasureOperations_i::~GEOM_IMeasureOperations_i() } +//============================================================================= +/*! + * GetPosition + */ +//============================================================================= +void GEOM_IMeasureOperations_i::GetPosition + (GEOM::GEOM_Object_ptr theShape, + CORBA::Double& Ox, CORBA::Double& Oy, CORBA::Double& Oz, + CORBA::Double& Zx, CORBA::Double& Zy, CORBA::Double& Zz, + CORBA::Double& Xx, CORBA::Double& Xy, CORBA::Double& Xz) +{ + //Set a not done flag + GetOperations()->SetNotDone(); + + //Set default values: global CS + Ox = Oy = Oz = Zx = Zy = Xy = Xz = 0.; + Zz = Xx = 1.; + + if (theShape == NULL) return; + + //Get the reference shape + Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject + (theShape->GetStudyID(), theShape->GetEntry()); + + if (aShape.IsNull()) return; + + // Get shape parameters + GetOperations()->GetPosition(aShape, Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz); +} + //============================================================================= /*! * GetCentreOfMass @@ -201,7 +231,40 @@ CORBA::Boolean GEOM_IMeasureOperations_i::CheckShape (GEOM::GEOM_Object_ptr theS //Set a not done flag GetOperations()->SetNotDone(); - if (theShape == NULL) + if (theShape == NULL) + { + theDescription = CORBA::string_dup("null"); + return 0; + } + + //Get the reference shape + Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject + (theShape->GetStudyID(), theShape->GetEntry()); + + if (aShape.IsNull()) + { + theDescription = CORBA::string_dup("null2"); + return 0; + } + + // Get shape parameters + TCollection_AsciiString aDump; + if (GetOperations()->CheckShape(aShape, /*check_geom = */false, aDump)) + { + theDescription = CORBA::string_dup("OK"); + return 1; + } + theDescription = CORBA::string_dup(aDump.ToCString()); + return 0; +} + +CORBA::Boolean GEOM_IMeasureOperations_i::CheckShapeWithGeometry (GEOM::GEOM_Object_ptr theShape, + CORBA::String_out theDescription) +{ + //Set a not done flag + GetOperations()->SetNotDone(); + + if (theShape == NULL) { theDescription = CORBA::string_dup("null"); return 0; @@ -219,7 +282,7 @@ CORBA::Boolean GEOM_IMeasureOperations_i::CheckShape (GEOM::GEOM_Object_ptr theS // Get shape parameters TCollection_AsciiString aDump; - if (GetOperations()->CheckShape(aShape, aDump)) + if (GetOperations()->CheckShape(aShape, /*check_geom = */true, aDump)) { theDescription = CORBA::string_dup("OK"); return 1; diff --git a/src/GEOM_I/GEOM_IMeasureOperations_i.hh b/src/GEOM_I/GEOM_IMeasureOperations_i.hh index ff62a8bc9..39c495774 100644 --- a/src/GEOM_I/GEOM_IMeasureOperations_i.hh +++ b/src/GEOM_I/GEOM_IMeasureOperations_i.hh @@ -40,6 +40,11 @@ class GEOM_I_EXPORT GEOM_IMeasureOperations_i : ::GEOMImpl_IMeasureOperations* theImpl); ~GEOM_IMeasureOperations_i(); + void GetPosition (GEOM::GEOM_Object_ptr theShape, + CORBA::Double& Ox, CORBA::Double& Oy, CORBA::Double& Oz, + CORBA::Double& Zx, CORBA::Double& Zy, CORBA::Double& Zz, + CORBA::Double& Xx, CORBA::Double& Xy, CORBA::Double& Xz); + void GetBasicProperties (GEOM::GEOM_Object_ptr theShape, CORBA::Double& theLength, CORBA::Double& theSurfArea, @@ -66,6 +71,9 @@ class GEOM_I_EXPORT GEOM_IMeasureOperations_i : CORBA::Boolean CheckShape (GEOM::GEOM_Object_ptr theShape, CORBA::String_out theDescription); + CORBA::Boolean CheckShapeWithGeometry (GEOM::GEOM_Object_ptr theShape, + CORBA::String_out theDescription); + char* WhatIs (GEOM::GEOM_Object_ptr theShape); CORBA::Double GetMinDistance (GEOM::GEOM_Object_ptr theShape1, diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.cc b/src/GEOM_I/GEOM_IShapesOperations_i.cc index e26bc84ce..23afcacbe 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.cc +++ b/src/GEOM_I/GEOM_IShapesOperations_i.cc @@ -706,6 +706,49 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane return aSeq._retn(); } +//============================================================================= +/*! + * GetShapesOnPlaneWithLocation + */ +//============================================================================= +GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation + (GEOM::GEOM_Object_ptr theShape, + const CORBA::Long theShapeType, + GEOM::GEOM_Object_ptr theAx1, + GEOM::GEOM_Object_ptr thePnt, + const GEOM::shape_state theState) +{ + GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO; + + //Set a not done flag + GetOperations()->SetNotDone(); + + if (theShape == NULL || theAx1 == NULL || thePnt == NULL) return aSeq._retn(); + + //Get the reference objects + Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject + (theShape->GetStudyID(), theShape->GetEntry()); + Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject + (theAx1->GetStudyID(), theAx1->GetEntry()); + Handle(GEOM_Object) anPnt = GetOperations()->GetEngine()->GetObject + (thePnt->GetStudyID(), thePnt->GetEntry()); + + if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn(); + + //Get Shapes On Plane + Handle(TColStd_HSequenceOfTransient) aHSeq = + GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, ShapeState(theState)); + if (!GetOperations()->IsDone() || aHSeq.IsNull()) + return aSeq._retn(); + + Standard_Integer aLength = aHSeq->Length(); + aSeq->length(aLength); + for (Standard_Integer i = 1; i <= aLength; i++) + aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i))); + + return aSeq._retn(); +} + //============================================================================= /*! * GetShapesOnCylinder @@ -889,6 +932,49 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs return aSeq._retn(); } +//============================================================================= +/*! + * GetShapesOnPlaneWithLocationIDs + */ +//============================================================================= +GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs + (GEOM::GEOM_Object_ptr theShape, + const CORBA::Long theShapeType, + GEOM::GEOM_Object_ptr theAx1, + GEOM::GEOM_Object_ptr thePnt, + const GEOM::shape_state theState) +{ + GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong; + + //Set a not done flag + GetOperations()->SetNotDone(); + + if (theShape == NULL || theAx1 == NULL || thePnt == NULL) return aSeq._retn(); + + //Get the reference objects + Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject + (theShape->GetStudyID(), theShape->GetEntry()); + Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject + (theAx1->GetStudyID(), theAx1->GetEntry()); + Handle(GEOM_Object) anPnt = GetOperations()->GetEngine()->GetObject + (thePnt->GetStudyID(), thePnt->GetEntry()); + + if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn(); + + //Get Shapes On Plane + Handle(TColStd_HSequenceOfInteger) aHSeq = + GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType, anAx1, anPnt, ShapeState(theState)); + if (!GetOperations()->IsDone() || aHSeq.IsNull()) + return aSeq._retn(); + + Standard_Integer aLength = aHSeq->Length(); + aSeq->length(aLength); + for (Standard_Integer i = 1; i <= aLength; i++) + aSeq[i-1] = aHSeq->Value(i); + + return aSeq._retn(); +} + //============================================================================= /*! * GetShapesOnCylinderIDs diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.hh b/src/GEOM_I/GEOM_IShapesOperations_i.hh index 5a2cc0cde..1d738ba46 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.hh +++ b/src/GEOM_I/GEOM_IShapesOperations_i.hh @@ -98,6 +98,12 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i : GEOM::GEOM_Object_ptr theAx1, GEOM::shape_state theState); + GEOM::ListOfGO* GetShapesOnPlaneWithLocation(GEOM::GEOM_Object_ptr theShape, + CORBA::Long theShapeType, + GEOM::GEOM_Object_ptr theAx1, + GEOM::GEOM_Object_ptr thePnt, + GEOM::shape_state theState); + GEOM::ListOfGO* GetShapesOnCylinder (GEOM::GEOM_Object_ptr theShape, CORBA::Long theShapeType, GEOM::GEOM_Object_ptr theAxis, @@ -123,6 +129,12 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i : GEOM::GEOM_Object_ptr theAx1, GEOM::shape_state theState); + GEOM::ListOfLong* GetShapesOnPlaneWithLocationIDs (GEOM::GEOM_Object_ptr theShape, + CORBA::Long theShapeType, + GEOM::GEOM_Object_ptr theAx1, + GEOM::GEOM_Object_ptr thePnt, + GEOM::shape_state theState); + GEOM::ListOfLong* GetShapesOnCylinderIDs (GEOM::GEOM_Object_ptr theShape, CORBA::Long theShapeType, GEOM::GEOM_Object_ptr theAxis, diff --git a/src/GEOM_I/GEOM_ITransformOperations_i.cc b/src/GEOM_I/GEOM_ITransformOperations_i.cc index abc3b362c..e19197e80 100644 --- a/src/GEOM_I/GEOM_ITransformOperations_i.cc +++ b/src/GEOM_I/GEOM_ITransformOperations_i.cc @@ -1,18 +1,18 @@ // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @@ -63,7 +63,7 @@ GEOM_ITransformOperations_i::~GEOM_ITransformOperations_i() /*! * TranslateTwoPoints */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePoint1, @@ -72,7 +72,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints //Set a not done flag GetOperations()->SetNotDone(); GEOM::GEOM_Object_var aGEOMObject; - + if (thePoint1 == NULL || thePoint2 == NULL || theObject == NULL) return aGEOMObject._retn(); //check if the object is a subshape @@ -108,7 +108,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints /*! * TranslateTwoPointsCopy */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPointsCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePoint1, @@ -149,12 +149,12 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPointsCopy /*! * TranslateDXDYDZ */ -//============================================================================= -GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ (GEOM::GEOM_Object_ptr theObject, +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ (GEOM::GEOM_Object_ptr theObject, CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ) { //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); GEOM::GEOM_Object_var aGEOMObject ; if (theObject == NULL) return aGEOMObject._retn(); @@ -183,7 +183,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ (GEOM::GEOM_O /*! * TranslateDXDYDZCopy */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy (GEOM::GEOM_Object_ptr theObject, CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ) { @@ -210,18 +210,18 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy return GetObject(anObject); } - + //============================================================================= /*! * TranslateVector */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theVector) { //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); GEOM::GEOM_Object_var aGEOMObject; if (theObject == NULL || theVector == NULL) return aGEOMObject._retn(); @@ -243,18 +243,18 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector Handle(GEOM_Object) aVector = GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), theVector->GetEntry()); if (aVector.IsNull()) return aGEOMObject._retn(); - + //Perform the translation - GetOperations()->TranslateVector(anObject, aVector); + GetOperations()->TranslateVector(anObject, aVector); - return aGEOMObject._retn(); + return aGEOMObject._retn(); } - + //============================================================================= /*! * TranslateVectorCopy */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theVector) @@ -262,7 +262,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy GEOM::GEOM_Object_var aGEOMObject; //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); if (theObject == NULL || theVector == NULL) return aGEOMObject._retn(); @@ -275,13 +275,13 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy Handle(GEOM_Object) aVector = GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), theVector->GetEntry()); if (aVector.IsNull()) return aGEOMObject._retn(); - + //Perform the translation - Handle(GEOM_Object) anObject = GetOperations()->TranslateVectorCopy(aBasicObject, aVector); + Handle(GEOM_Object) anObject = GetOperations()->TranslateVectorCopy(aBasicObject, aVector); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); - return GetObject(anObject); + return GetObject(anObject); } @@ -289,13 +289,13 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy /*! * Rotate */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theAxis, CORBA::Double theAngle) { //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); GEOM::GEOM_Object_var aGEOMObject; if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn(); @@ -316,18 +316,18 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), theAxis->GetEntry()); if (anAxis.IsNull()) return aGEOMObject._retn(); - + //Perform the rotation - GetOperations()->Rotate(anObject, anAxis, theAngle); + GetOperations()->Rotate(anObject, anAxis, theAngle); - return aGEOMObject._retn(); + return aGEOMObject._retn(); } //============================================================================= /*! * RotateCopy */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theAxis, CORBA::Double theAngle) @@ -335,7 +335,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object GEOM::GEOM_Object_var aGEOMObject; //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn(); @@ -348,13 +348,13 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), theAxis->GetEntry()); if (anAxis.IsNull()) return aGEOMObject._retn(); - + //Perform the rotation - Handle(GEOM_Object) anObject = GetOperations()->RotateCopy(aBasicObject, anAxis, theAngle); + Handle(GEOM_Object) anObject = GetOperations()->RotateCopy(aBasicObject, anAxis, theAngle); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); - return GetObject(anObject); + return GetObject(anObject); } @@ -362,7 +362,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object /*! * MirrorPlane */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePlane) @@ -370,7 +370,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); if (theObject == NULL || thePlane == NULL) return aGEOMObject._retn(); @@ -391,16 +391,16 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane if (aPlane.IsNull()) return aGEOMObject._retn(); //Perform the mirror - GetOperations()->MirrorPlane(anObject, aPlane); + GetOperations()->MirrorPlane(anObject, aPlane); - return aGEOMObject._retn(); + return aGEOMObject._retn(); } - + //============================================================================= /*! * MirrorPlaneCopy */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePlane) @@ -408,7 +408,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy GEOM::GEOM_Object_var aGEOMObject; //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); if (theObject == NULL || thePlane == NULL) return aGEOMObject._retn(); @@ -421,20 +421,20 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy Handle(GEOM_Object) aPlane = GetOperations()->GetEngine()->GetObject(thePlane->GetStudyID(), thePlane->GetEntry()); if (aPlane.IsNull()) return aGEOMObject._retn(); - + //Perform the mirror - Handle(GEOM_Object) anObject = GetOperations()->MirrorPlaneCopy(aBasicObject, aPlane); + Handle(GEOM_Object) anObject = GetOperations()->MirrorPlaneCopy(aBasicObject, aPlane); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); - return GetObject(anObject); + return GetObject(anObject); } //============================================================================= /*! * MirrorAxis */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theAxis) @@ -442,7 +442,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn(); @@ -463,16 +463,16 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis if (aAxis.IsNull()) return aGEOMObject._retn(); //Perform the mirror - GetOperations()->MirrorAxis(anObject, aAxis); + GetOperations()->MirrorAxis(anObject, aAxis); - return aGEOMObject._retn(); + return aGEOMObject._retn(); } - + //============================================================================= /*! * MirrorAxisCopy */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theAxis) @@ -480,7 +480,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy GEOM::GEOM_Object_var aGEOMObject; //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn(); @@ -493,20 +493,20 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy Handle(GEOM_Object) aAxis = GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), theAxis->GetEntry()); if (aAxis.IsNull()) return aGEOMObject._retn(); - + //Perform the mirror - Handle(GEOM_Object) anObject = GetOperations()->MirrorAxisCopy(aBasicObject, aAxis); + Handle(GEOM_Object) anObject = GetOperations()->MirrorAxisCopy(aBasicObject, aAxis); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); - return GetObject(anObject); + return GetObject(anObject); } //============================================================================= /*! * MirrorPoint */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePoint) @@ -514,7 +514,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); if (theObject == NULL || thePoint == NULL) return aGEOMObject._retn(); @@ -535,16 +535,16 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint if (aPoint.IsNull()) return aGEOMObject._retn(); //Perform the mirror - GetOperations()->MirrorPoint(anObject, aPoint); + GetOperations()->MirrorPoint(anObject, aPoint); - return aGEOMObject._retn(); + return aGEOMObject._retn(); } - + //============================================================================= /*! * MirrorPointCopy */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePoint) @@ -552,7 +552,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy GEOM::GEOM_Object_var aGEOMObject; //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); if (theObject == NULL || thePoint == NULL) return aGEOMObject._retn(); @@ -565,13 +565,13 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), thePoint->GetEntry()); if (aPoint.IsNull()) return aGEOMObject._retn(); - + //Perform the mirror - Handle(GEOM_Object) anObject = GetOperations()->MirrorPointCopy(aBasicObject, aPoint); + Handle(GEOM_Object) anObject = GetOperations()->MirrorPointCopy(aBasicObject, aPoint); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); - return GetObject(anObject); + return GetObject(anObject); } @@ -579,7 +579,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy /*! * OffsetShape */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape (GEOM::GEOM_Object_ptr theObject, CORBA::Double theOffset) @@ -613,7 +613,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape /*! * OffsetShapeCopy */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy (GEOM::GEOM_Object_ptr theObject, CORBA::Double theOffset) @@ -643,7 +643,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy /*! * ScaleShape */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePoint, @@ -682,7 +682,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape /*! * ScaleShapeCopy */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePoint, @@ -718,7 +718,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeCopy /*! * PositionShape */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theStartLCS, @@ -729,7 +729,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape //Set a not done flag GetOperations()->SetNotDone(); - if (theObject == NULL || theStartLCS == NULL || theEndLCS == NULL) + if (theObject == NULL || theEndLCS == NULL) return aGEOMObject._retn(); //check if the object is a subshape @@ -743,10 +743,12 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry()); if (anObject.IsNull()) return aGEOMObject._retn(); - //Get the Start LCS - Handle(GEOM_Object) aStartLCS = - GetOperations()->GetEngine()->GetObject(theStartLCS->GetStudyID(), theStartLCS->GetEntry()); - if (aStartLCS.IsNull()) return aGEOMObject._retn(); + //Get the Start LCS (may be NULL for positioning from global LCS) + Handle(GEOM_Object) aStartLCS = NULL; + if (theStartLCS != NULL && !CORBA::is_nil(theStartLCS)) { + aStartLCS = GetOperations()->GetEngine()->GetObject(theStartLCS->GetStudyID(), theStartLCS->GetEntry()); + if (aStartLCS.IsNull()) return aGEOMObject._retn(); + } //Get the End LCS Handle(GEOM_Object) aEndLCS = @@ -763,7 +765,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape /*! * PositionShapeCopy */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theStartLCS, @@ -774,7 +776,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy //Set a not done flag GetOperations()->SetNotDone(); - if (theObject == NULL || theStartLCS == NULL || theEndLCS == NULL) + if (theObject == NULL || theEndLCS == NULL) return aGEOMObject._retn(); //Get the basic object @@ -782,10 +784,12 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry()); if (aBasicObject.IsNull()) return aGEOMObject._retn(); - //Get the Start LCS - Handle(GEOM_Object) aStartLCS = - GetOperations()->GetEngine()->GetObject(theStartLCS->GetStudyID(), theStartLCS->GetEntry()); - if (aStartLCS.IsNull()) return aGEOMObject._retn(); + //Get the Start LCS (may be NULL for positioning from global LCS) + Handle(GEOM_Object) aStartLCS = NULL; + if (theStartLCS != NULL && !CORBA::is_nil(theStartLCS)) { + aStartLCS = GetOperations()->GetEngine()->GetObject(theStartLCS->GetStudyID(), theStartLCS->GetEntry()); + if (aStartLCS.IsNull()) return aGEOMObject._retn(); + } //Get the End LCS Handle(GEOM_Object) aEndLCS = @@ -805,14 +809,14 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy /*! * MultiTranslate1D */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theVector, CORBA::Double theStep, CORBA::Long theNbTimes) { //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); GEOM::GEOM_Object_var aGEOMObject; @@ -830,27 +834,27 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D //Perform the translation Handle(GEOM_Object) anObject = - GetOperations()->Translate1D(aBasicObject, aVector, theStep, theNbTimes); + GetOperations()->Translate1D(aBasicObject, aVector, theStep, theNbTimes); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); - return GetObject(anObject); + return GetObject(anObject); } //============================================================================= /*! * MultiTranslate2D */ -//============================================================================= -GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_Object_ptr theObject, - GEOM::GEOM_Object_ptr theVector1, - CORBA::Double theStep1, +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_Object_ptr theObject, + GEOM::GEOM_Object_ptr theVector1, + CORBA::Double theStep1, CORBA::Long theNbTimes1, - GEOM::GEOM_Object_ptr theVector2, - CORBA::Double theStep2, + GEOM::GEOM_Object_ptr theVector2, + CORBA::Double theStep2, CORBA::Long theNbTimes2) { //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); GEOM::GEOM_Object_var aGEOMObject; @@ -873,23 +877,23 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_ //Perform the translation Handle(GEOM_Object) anObject = GetOperations()->Translate2D - (aBasicObject, aVector1, theStep1, theNbTimes1, aVector2, theStep2, theNbTimes2); + (aBasicObject, aVector1, theStep1, theNbTimes1, aVector2, theStep2, theNbTimes2); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); - return GetObject(anObject); + return GetObject(anObject); } //============================================================================= /*! * MultiRotate1D */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theVector, CORBA::Long theNbTimes) { //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); GEOM::GEOM_Object_var aGEOMObject; @@ -906,26 +910,26 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Obj if (aVector.IsNull()) return aGEOMObject._retn(); //Perform the rotation - Handle(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theNbTimes); + Handle(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theNbTimes); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); - return GetObject(anObject); + return GetObject(anObject); } //============================================================================= /*! * MultiRotate2D */ -//============================================================================= +//============================================================================= GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theVector, - CORBA::Double theAngle, - CORBA::Long theNbTimes1, - CORBA::Double theStep, + CORBA::Double theAngle, + CORBA::Long theNbTimes1, + CORBA::Double theStep, CORBA::Long theNbTimes2) { //Set a not done flag - GetOperations()->SetNotDone(); + GetOperations()->SetNotDone(); GEOM::GEOM_Object_var aGEOMObject; @@ -943,8 +947,8 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Obj //Perform the rotation Handle(GEOM_Object) anObject = GetOperations()->Rotate2D - (aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2); + (aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); - return GetObject(anObject); + return GetObject(anObject); } diff --git a/src/GEOM_I/Makefile.in b/src/GEOM_I/Makefile.in index ef367ca48..abed346f7 100644 --- a/src/GEOM_I/Makefile.in +++ b/src/GEOM_I/Makefile.in @@ -55,7 +55,7 @@ LIB_SRC = \ GEOM_DumpPython.cc # SALOME_Component.idl -LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Component.idl SALOME_Exception.idl +LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Component.idl SALOME_Exception.idl SALOME_GenericObj.idl #SALOME_Exception.idl SALOME_GenericObj.idl LIB_SERVER_IDL = GEOM_Gen.idl diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.cc b/src/GEOM_I_Superv/GEOM_Superv_i.cc index 2f4d96bf1..894e4f358 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.cc +++ b/src/GEOM_I_Superv/GEOM_Superv_i.cc @@ -119,7 +119,7 @@ void GEOM_Superv_i::SetStudyID( CORBA::Long theId ) if ( isNewStudy(myLastStudyID,myStudyID) ) { if (CORBA::is_nil(myGeomEngine)) setGeomEngine(); - CORBA::String_var anEngine = _orb->object_to_string( myGeomEngine ); + string anEngine = _orb->object_to_string( myGeomEngine ); CORBA::Object_var anObj = name_service->Resolve("/myStudyManager"); if ( !CORBA::is_nil(anObj) ) { @@ -130,7 +130,7 @@ void GEOM_Superv_i::SetStudyID( CORBA::Long theId ) _PTR(SComponent) aSCO = aDSStudy->FindComponent(myGeomEngine->ComponentDataType()); if ( aSCO ) { _PTR(StudyBuilder) aBuilder = aDSStudy->NewBuilder(); - if ( aBuilder ) aBuilder->LoadWith( aSCO, string( anEngine.in() ) ); + if ( aBuilder ) aBuilder->LoadWith( aSCO, anEngine ); } } } @@ -506,10 +506,13 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointXYZ(CORBA::Double theX, CORBA::Double theY, CORBA::Double theZ) { + beginService( " GEOM_Superv_i::MakePointXYZ" ); MESSAGE("GEOM_Superv_i::MakePointXYZ"); getBasicOp(); // make vertex and return - return myBasicOp->MakePointXYZ(theX, theY, theZ); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePointXYZ(theX, theY, theZ); + endService( " GEOM_Superv_i::MakePointXYZ" ); + return anObj; } //============================================================================= @@ -520,9 +523,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointWithReference (GEOM::GEOM_Object_p CORBA::Double theY, CORBA::Double theZ) { + beginService( " GEOM_Superv_i::MakePointWithReference" ); MESSAGE("GEOM_Superv_i::MakePointWithReference"); getBasicOp(); - return myBasicOp->MakePointWithReference(theReference, theX, theY, theZ); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePointWithReference(theReference, theX, theY, theZ); + endService( " GEOM_Superv_i::MakePointWithReference" ); + return anObj; } //============================================================================= @@ -531,9 +537,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointWithReference (GEOM::GEOM_Object_p GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnCurve (GEOM::GEOM_Object_ptr theRefCurve, CORBA::Double theParameter) { + beginService( " GEOM_Superv_i::MakePointOnCurve" ); MESSAGE("GEOM_Superv_i::MakePointOnCurve"); getBasicOp(); - return myBasicOp->MakePointOnCurve(theRefCurve, theParameter); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePointOnCurve(theRefCurve, theParameter); + endService( " GEOM_Superv_i::MakePointOnCurve" ); + return anObj; } //============================================================================= @@ -542,9 +551,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnCurve (GEOM::GEOM_Object_ptr the GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeTangentOnCurve (GEOM::GEOM_Object_ptr theRefCurve, CORBA::Double theParameter) { + beginService( " GEOM_Superv_i::MakeTangentOnCurve" ); MESSAGE("GEOM_Superv_i::MakeTangentOnCurve"); getBasicOp(); - return myBasicOp->MakeTangentOnCurve(theRefCurve, theParameter); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakeTangentOnCurve(theRefCurve, theParameter); + endService( " GEOM_Superv_i::MakeTangentOnCurve" ); + return anObj; } //============================================================================= @@ -554,9 +566,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeVectorDXDYDZ (CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ) { + beginService( " GEOM_Superv_i::MakeVectorDXDYDZ" ); MESSAGE("GEOM_Superv_i::MakeVectorDXDYDZ"); getBasicOp(); - return myBasicOp->MakeVectorDXDYDZ(theDX, theDY, theDZ); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakeVectorDXDYDZ(theDX, theDY, theDZ); + endService( " GEOM_Superv_i::MakeVectorDXDYDZ" ); + return anObj; } //============================================================================= @@ -565,9 +580,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeVectorDXDYDZ (CORBA::Double theDX, GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeVectorTwoPnt (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2) { + beginService( " GEOM_Superv_i::MakeVectorTwoPnt" ); MESSAGE("GEOM_Superv_i::MakeVector"); getBasicOp(); - return myBasicOp->MakeVectorTwoPnt(thePnt1, thePnt2); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakeVectorTwoPnt(thePnt1, thePnt2); + endService( " GEOM_Superv_i::MakeVectorTwoPnt" ); + return anObj; } //============================================================================= @@ -576,9 +594,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeVectorTwoPnt (GEOM::GEOM_Object_ptr the GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeLineTwoPnt (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2) { + beginService( " GEOM_Superv_i::MakeLineTwoPnt"); MESSAGE("GEOM_Superv_i::MakeLineTwoPnt"); getBasicOp(); - return myBasicOp->MakeLineTwoPnt(thePnt1, thePnt2); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakeLineTwoPnt(thePnt1, thePnt2); + endService( " GEOM_Superv_i::MakeLineTwoPnt"); + return anObj; } //============================================================================= @@ -589,9 +610,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePlaneThreePnt (GEOM::GEOM_Object_ptr th GEOM::GEOM_Object_ptr thePnt3, CORBA::Double theTrimSize) { + beginService( " GEOM_Superv_i::MakePlaneThreePnt"); MESSAGE("GEOM_Superv_i::MakePlaneThreePnt"); getBasicOp(); - return myBasicOp->MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize); + endService( " GEOM_Superv_i::MakePlaneThreePnt"); + return anObj; } //============================================================================= @@ -600,10 +624,13 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePlaneThreePnt (GEOM::GEOM_Object_ptr th GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePlanePntVec (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec, CORBA::Double theTrimSize) -{ +{ + beginService( " GEOM_Superv_i::MakePlanePntVec" ); MESSAGE("GEOM_Superv_i::MakePlanePntVec"); getBasicOp(); - return myBasicOp->MakePlanePntVec(thePnt, theVec, theTrimSize); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePlanePntVec(thePnt, theVec, theTrimSize); + endService( " GEOM_Superv_i::MakePlanePntVec" ); + return anObj; } //============================================================================= @@ -612,9 +639,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePlanePntVec (GEOM::GEOM_Object_ptr theP GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePlaneFace (GEOM::GEOM_Object_ptr theFace, CORBA::Double theTrimSize) { + beginService( " GEOM_Superv_i::MakePlaneFace" ); MESSAGE("GEOM_Superv_i::MakePlaneFace"); getBasicOp(); - return myBasicOp->MakePlaneFace(theFace, theTrimSize); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePlaneFace(theFace, theTrimSize); + endService( " GEOM_Superv_i::MakePlaneFace" ); + return anObj; } //============================================================================= @@ -625,9 +655,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeMarker CORBA::Double theXDX, CORBA::Double theXDY, CORBA::Double theXDZ, CORBA::Double theYDX, CORBA::Double theYDY, CORBA::Double theYDZ) { + beginService( " GEOM_Superv_i::MakeMarker" ); MESSAGE("GEOM_Superv_i::MakeMarker"); getBasicOp(); - return myBasicOp->MakeMarker(theOX, theOY, theOZ, theXDX, theXDY, theXDZ, theYDX, theYDY, theYDZ); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakeMarker(theOX, theOY, theOZ, theXDX, theXDY, theXDZ, theYDX, theYDY, theYDZ); + endService( " GEOM_Superv_i::MakeMarker" ); + return anObj; } //============================================================================= @@ -638,9 +671,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeTangentPlaneOnFace (GEOM::GEOM_Object_p CORBA::Double theParameterV, CORBA::Double theTrimSize) { + beginService( " GEOM_Superv_i::MakeTangentPlaneOnFace" ); MESSAGE("GEOM_Superv_i::MakeTangentPlaneOnFace"); getBasicOp(); - return myBasicOp->MakeTangentPlaneOnFace(theFace, theParameterU,theParameterV,theTrimSize); + GEOM::GEOM_Object_ptr anObj = myBasicOp->MakeTangentPlaneOnFace(theFace, theParameterU,theParameterV,theTrimSize); + endService( " GEOM_Superv_i::MakeTangentPlaneOnFace" ); + return anObj; } //================= Primitives Construction : 3DPrimOperations ================ @@ -654,11 +690,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBox (CORBA::Double theX1, CORBA::Double theY2, CORBA::Double theZ2) { + beginService( " GEOM_Superv_i::MakeBox" ); MESSAGE("GEOM_Superv_i::MakeBox"); getBasicOp(); get3DPrimOp(); - return my3DPrimOp->MakeBoxTwoPnt(myBasicOp->MakePointXYZ(theX1, theY1, theZ1), - myBasicOp->MakePointXYZ(theX2, theY2, theZ2)); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeBoxTwoPnt(myBasicOp->MakePointXYZ(theX1, theY1, theZ1), + myBasicOp->MakePointXYZ(theX2, theY2, theZ2)); + endService( " GEOM_Superv_i::MakeBox" ); + return anObj; } //============================================================================= @@ -668,9 +707,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoxDXDYDZ (CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ) { + beginService( " GEOM_Superv_i::MakeBoxDXDYDZ" ); MESSAGE("GEOM_Superv_i::MakeBoxDXDYDZ"); get3DPrimOp(); - return my3DPrimOp->MakeBoxDXDYDZ(theDX, theDY, theDZ); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeBoxDXDYDZ(theDX, theDY, theDZ); + endService( " GEOM_Superv_i::MakeBoxDXDYDZ" ); + return anObj; } //============================================================================= @@ -679,9 +721,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoxDXDYDZ (CORBA::Double theDX, GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoxTwoPnt (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2) { + beginService( " GEOM_Superv_i::MakeBoxTwoPnt" ); MESSAGE("GEOM_Superv_i::MakeBoxTwoPnt"); get3DPrimOp(); - return my3DPrimOp->MakeBoxTwoPnt(thePnt1, thePnt2); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeBoxTwoPnt(thePnt1, thePnt2); + endService( " GEOM_Superv_i::MakeBoxTwoPnt" ); + return anObj; } //============================================================================= @@ -692,9 +737,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCylinderPntVecRH (GEOM::GEOM_Object_ptr CORBA::Double theRadius, CORBA::Double theHeight) { + beginService( " GEOM_Superv_i::MakeCylinderPntVecRH" ); MESSAGE("GEOM_Superv_i::MakeCylinderPntVecRH"); get3DPrimOp(); - return my3DPrimOp->MakeCylinderPntVecRH(thePnt, theAxis, theRadius, theHeight); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeCylinderPntVecRH(thePnt, theAxis, theRadius, theHeight); + endService( " GEOM_Superv_i::MakeCylinderPntVecRH" ); + return anObj; } //============================================================================= @@ -703,9 +751,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCylinderPntVecRH (GEOM::GEOM_Object_ptr GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCylinderRH (CORBA::Double theR, CORBA::Double theH) { + beginService( " GEOM_Superv_i::MakeCylinderRH" ); MESSAGE("GEOM_Superv_i::MakeCylinderRH"); get3DPrimOp(); - return my3DPrimOp->MakeCylinderRH(theR, theH); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeCylinderRH(theR, theH); + endService( " GEOM_Superv_i::MakeCylinderRH" ); + return anObj; } //============================================================================= @@ -716,10 +767,13 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSphere (CORBA::Double theX, CORBA::Double theZ, CORBA::Double theRadius) { + beginService( " GEOM_Superv_i::MakeSphepe" ); MESSAGE("GEOM_Superv_i::MakeSphepe"); getBasicOp(); get3DPrimOp(); - return my3DPrimOp->MakeSpherePntR(myBasicOp->MakePointXYZ(theX, theY, theZ), theRadius); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeSpherePntR(myBasicOp->MakePointXYZ(theX, theY, theZ), theRadius); + endService( " GEOM_Superv_i::MakeSphepe" ); + return anObj; } //============================================================================= @@ -727,9 +781,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSphere (CORBA::Double theX, //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSphereR (CORBA::Double theR) { + beginService( " GEOM_Superv_i::MakeSphereR" ); MESSAGE("GEOM_Superv_i::MakeSphereR"); get3DPrimOp(); - return my3DPrimOp->MakeSphereR(theR); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeSphereR(theR); + endService( " GEOM_Superv_i::MakeSphereR" ); + return anObj; } //============================================================================= @@ -738,9 +795,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSphereR (CORBA::Double theR) GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSpherePntR (GEOM::GEOM_Object_ptr thePnt, CORBA::Double theR) { + beginService( " GEOM_Superv_i::MakeSpherePntR" ); MESSAGE("GEOM_Superv_i::MakeSpherePntR"); get3DPrimOp(); - return my3DPrimOp->MakeSpherePntR(thePnt, theR); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeSpherePntR(thePnt, theR); + endService( " GEOM_Superv_i::MakeSpherePntR" ); + return anObj; } //============================================================================= @@ -751,9 +811,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeTorusPntVecRR (GEOM::GEOM_Object_ptr th CORBA::Double theRMajor, CORBA::Double theRMinor) { + beginService( " GEOM_Superv_i::MakeTorusPntVecRR" ); MESSAGE("GEOM_Superv_i::MakeTorusPntVecRR"); get3DPrimOp(); - return my3DPrimOp->MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor); + endService( " GEOM_Superv_i::MakeTorusPntVecRR" ); + return anObj; } //============================================================================= @@ -762,9 +825,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeTorusPntVecRR (GEOM::GEOM_Object_ptr th GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeTorusRR (CORBA::Double theRMajor, CORBA::Double theRMinor) { + beginService( " GEOM_Superv_i::MakeTorusRR" ); MESSAGE("GEOM_Superv_i::MakeTorusRR"); get3DPrimOp(); - return my3DPrimOp->MakeTorusRR(theRMajor, theRMinor); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeTorusRR(theRMajor, theRMinor); + endService( " GEOM_Superv_i::MakeTorusRR" ); + return anObj; } //============================================================================= @@ -776,9 +842,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeConePntVecR1R2H (GEOM::GEOM_Object_ptr CORBA::Double theR2, CORBA::Double theHeight) { + beginService( " GEOM_Superv_i::MakeConePntVecR1R2H" ); MESSAGE("GEOM_Superv_i::MakeConePntVecR1R2H"); get3DPrimOp(); - return my3DPrimOp->MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theHeight); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theHeight); + endService( " GEOM_Superv_i::MakeConePntVecR1R2H" ); + return anObj; } //============================================================================= @@ -788,9 +857,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeConeR1R2H (CORBA::Double theR1, CORBA::Double theR2, CORBA::Double theHeight) { + beginService( " GEOM_Superv_i::MakeConeR1R2H" ); MESSAGE("GEOM_Superv_i::MakeConeR1R2H"); get3DPrimOp(); - return my3DPrimOp->MakeConeR1R2H(theR1, theR2, theHeight); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeConeR1R2H(theR1, theR2, theHeight); + endService( " GEOM_Superv_i::MakeConeR1R2H" ); + return anObj; } //============================================================================= @@ -800,9 +872,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismVecH (GEOM::GEOM_Object_ptr theBas GEOM::GEOM_Object_ptr theVec, CORBA::Double theH) { + beginService( " GEOM_Superv_i::MakePrismVecH" ); MESSAGE("GEOM_Superv_i::MakePrismVecH"); get3DPrimOp(); - return my3DPrimOp->MakePrismVecH(theBase, theVec, theH); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePrismVecH(theBase, theVec, theH); + endService( " GEOM_Superv_i::MakePrismVecH" ); + return anObj; } @@ -813,9 +888,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismTwoPnt (GEOM::GEOM_Object_ptr theB GEOM::GEOM_Object_ptr thePoint1, GEOM::GEOM_Object_ptr thePoint2) { + beginService( " GEOM_Superv_i::MakePrismTwoPnt" ); MESSAGE("GEOM_Superv_i::MakePrismTwoPnt"); get3DPrimOp(); - return my3DPrimOp->MakePrismTwoPnt(theBase, thePoint1, thePoint2); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePrismTwoPnt(theBase, thePoint1, thePoint2); + endService( " GEOM_Superv_i::MakePrismTwoPnt" ); + return anObj; } //============================================================================= @@ -824,9 +902,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismTwoPnt (GEOM::GEOM_Object_ptr theB GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipe (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr thePath) { + beginService( " GEOM_Superv_i::MakePipe" ); MESSAGE("GEOM_Superv_i::MakePipe"); get3DPrimOp(); - return my3DPrimOp->MakePipe(theBase, thePath); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePipe(theBase, thePath); + endService( " GEOM_Superv_i::MakePipe" ); + return anObj; } //============================================================================= @@ -836,9 +917,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeRevolutionAxisAngle (GEOM::GEOM_Object_ GEOM::GEOM_Object_ptr theAxis, CORBA::Double theAngle) { + beginService( " GEOM_Superv_i::MakeRevolutionAxisAngle" ); MESSAGE("GEOM_Superv_i::MakeRevolutionAxisAngle"); get3DPrimOp(); - return my3DPrimOp->MakeRevolutionAxisAngle(theBase, theAxis, theAngle); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeRevolutionAxisAngle(theBase, theAxis, theAngle); + endService( " GEOM_Superv_i::MakeRevolutionAxisAngle" ); + return anObj; } //============================================================================= @@ -849,9 +933,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilling (GEOM::GEOM_Object_ptr theShape CORBA::Double theTol2D, CORBA::Double theTol3D, CORBA::Long theNbIter) { + beginService( " GEOM_Superv_i::MakeFilling" ); MESSAGE("GEOM_Superv_i::MakeFilling"); get3DPrimOp(); - return my3DPrimOp->MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter); + endService( " GEOM_Superv_i::MakeFilling" ); + return anObj; } //============================= BooleanOperations ============================= @@ -862,11 +949,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoolean (GEOM::GEOM_Object_ptr theShape GEOM::GEOM_Object_ptr theShape2, CORBA::Long theOperation) { + beginService( " GEOM_Superv_i::MakeBoolean" ); // theOperation indicates the operation to be done: // 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section MESSAGE("GEOM_Superv_i::MakeBoolean"); getBoolOp(); - return myBoolOp->MakeBoolean(theShape1, theShape2, theOperation); + GEOM::GEOM_Object_ptr anObj = myBoolOp->MakeBoolean(theShape1, theShape2, theOperation); + endService( " GEOM_Superv_i::MakeBoolean" ); + return anObj; } //============================================================================= @@ -877,9 +967,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeThruSections(const GEOM::ListOfGO& theS CORBA::Double thePreci, CORBA::Boolean theRuled) { + beginService( " GEOM_Superv_i::MakeThruSections" ); MESSAGE("GEOM_Superv_i::MakeThruSections"); get3DPrimOp(); - return my3DPrimOp->MakeThruSections(theSeqSections, theModeSolid,thePreci,theRuled); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeThruSections(theSeqSections, theModeSolid,thePreci,theRuled); + endService( " GEOM_Superv_i::MakeThruSections" ); + return anObj; } //============================================================================= @@ -891,9 +984,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithDifferentSections(const GEOM::L CORBA::Boolean theWithContact, CORBA::Boolean theWithCorrections) { + beginService( " GEOM_Superv_i::MakePipeWithDifferentSections" ); MESSAGE("GEOM_Superv_i::MakePipeWithDifferentSections"); get3DPrimOp(); - return my3DPrimOp->MakePipeWithDifferentSections(theBases,theLocations, thePath,theWithContact,theWithCorrections); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePipeWithDifferentSections(theBases,theLocations, thePath,theWithContact,theWithCorrections); + endService( " GEOM_Superv_i::MakePipeWithDifferentSections" ); + return anObj; } //============================================================================= // MakeFuse: @@ -901,9 +997,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithDifferentSections(const GEOM::L GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFuse (GEOM::GEOM_Object_ptr theShape1, GEOM::GEOM_Object_ptr theShape2) { + beginService( " GEOM_Superv_i::MakeFuse" ); MESSAGE("GEOM_Superv_i::MakeFuse"); getBoolOp(); - return myBoolOp->MakeBoolean(theShape1, theShape2, 3); + GEOM::GEOM_Object_ptr anObj = myBoolOp->MakeBoolean(theShape1, theShape2, 3); + endService( " GEOM_Superv_i::MakeFuse" ); + return anObj; } //============================================================================= @@ -917,6 +1016,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePartition (GEOM::GEOM_List_ptr theSha CORBA::Boolean theRemoveWebs, GEOM::GEOM_List_ptr theMaterials) { + beginService( " GEOM_Superv_i::MakePartition" ); MESSAGE("GEOM_Superv_i::MakePartition"); GEOM_List_i* aListImplS = dynamic_cast*>(GetServant(theShapes, myPOA).in()); @@ -930,10 +1030,13 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePartition (GEOM::GEOM_List_ptr theSha dynamic_cast*>(GetServant(theMaterials, myPOA).in()); if (aListImplS && aListImplT && aListImplKI && aListImplRI && aListImplM) { getBoolOp(); - return myBoolOp->MakePartition(aListImplS->GetList(), aListImplT->GetList(), - aListImplKI->GetList(), aListImplRI->GetList(), - theLimit, theRemoveWebs, aListImplM->GetList()); + GEOM::GEOM_Object_ptr anObj = myBoolOp->MakePartition(aListImplS->GetList(), aListImplT->GetList(), + aListImplKI->GetList(), aListImplRI->GetList(), + theLimit, theRemoveWebs, aListImplM->GetList()); + endService( " GEOM_Superv_i::MakePartition" ); + return anObj; } + endService( " GEOM_Superv_i::MakePartition" ); return NULL; } @@ -943,9 +1046,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePartition (GEOM::GEOM_List_ptr theSha GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeHalfPartition (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr thePlane) { + beginService( " GEOM_Superv_i::MakeHalfPartition" ); MESSAGE("GEOM_Superv_i::MakeHalfPartition"); getBoolOp(); - return myBoolOp->MakeHalfPartition(theShape, thePlane); + GEOM::GEOM_Object_ptr anObj = myBoolOp->MakeHalfPartition(theShape, thePlane); + endService( " GEOM_Superv_i::MakeHalfPartition" ); + return anObj; } //============================== InsertOperations ============================= @@ -954,9 +1060,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeHalfPartition (GEOM::GEOM_Object_ptr th //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCopy (GEOM::GEOM_Object_ptr theOriginal) { + beginService( " GEOM_Superv_i::MakeCopy" ); MESSAGE("GEOM_Superv_i::MakeCopy"); getInsOp(); - return myInsOp->MakeCopy(theOriginal); + GEOM::GEOM_Object_ptr anObj = myInsOp->MakeCopy(theOriginal); + endService( " GEOM_Superv_i::MakeCopy" ); + return anObj; } //============================================================================= @@ -966,9 +1075,11 @@ void GEOM_Superv_i::Export (GEOM::GEOM_Object_ptr theObject, const char* theFileName, const char* theFormatName) { + beginService( " GEOM_Superv_i::Export" ); MESSAGE("GEOM_Superv_i::Export"); getInsOp(); myInsOp->Export(theObject, theFileName, theFormatName); + endService( " GEOM_Superv_i::Export" ); } //============================================================================= @@ -977,9 +1088,12 @@ void GEOM_Superv_i::Export (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr GEOM_Superv_i::Import (const char* theFileName, const char* theFormatName) { + beginService( " GEOM_Superv_i::Import" ); MESSAGE("GEOM_Superv_i::Import"); getInsOp(); - return myInsOp->Import(theFileName, theFormatName); + GEOM::GEOM_Object_ptr anObj = myInsOp->Import(theFileName, theFormatName); + endService( " GEOM_Superv_i::Import" ); + return anObj; } //============================================================================= @@ -988,9 +1102,11 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::Import (const char* theFileName, void GEOM_Superv_i::ImportTranslators (GEOM::string_array_out theFormats, GEOM::string_array_out thePatterns) { + beginService( " GEOM_Superv_i::ImportTranslators" ); MESSAGE("GEOM_Superv_i::ImportTranslators"); getInsOp(); myInsOp->ImportTranslators(theFormats, thePatterns); + endService( " GEOM_Superv_i::ImportTranslators" ); } //============================================================================= @@ -999,9 +1115,11 @@ void GEOM_Superv_i::ImportTranslators (GEOM::string_array_out theFormats, void GEOM_Superv_i::ExportTranslators (GEOM::string_array_out theFormats, GEOM::string_array_out thePatterns) { + beginService( " GEOM_Superv_i::ExportTranslators" ); MESSAGE("GEOM_Superv_i::ExportTranslators"); getInsOp(); myInsOp->ExportTranslators(theFormats, thePatterns); + endService( " GEOM_Superv_i::ExportTranslators" ); } //============================= TransformOperations =========================== @@ -1012,9 +1130,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateTwoPoints (GEOM::GEOM_Object_ptr t GEOM::GEOM_Object_ptr thePoint1, GEOM::GEOM_Object_ptr thePoint2) { + beginService( " GEOM_Superv_i::TranslateTwoPoints" ); MESSAGE("GEOM_Superv_i::TranslateTwoPoints"); getTransfOp(); - return myTransfOp->TranslateTwoPoints(theObject, thePoint1, thePoint2); + GEOM::GEOM_Object_ptr anObj = myTransfOp->TranslateTwoPoints(theObject, thePoint1, thePoint2); + endService( " GEOM_Superv_i::TranslateTwoPoints" ); + return anObj; } //============================================================================= @@ -1024,9 +1145,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateTwoPointsCopy (GEOM::GEOM_Object_p GEOM::GEOM_Object_ptr thePoint1, GEOM::GEOM_Object_ptr thePoint2) { + beginService( " GEOM_Superv_i::TranslateTwoPointsCopy" ); MESSAGE("GEOM_Superv_i::TranslateTwoPointsCopy"); getTransfOp(); - return myTransfOp->TranslateTwoPointsCopy(theObject, thePoint1, thePoint2); + GEOM::GEOM_Object_ptr anObj = myTransfOp->TranslateTwoPointsCopy(theObject, thePoint1, thePoint2); + endService( " GEOM_Superv_i::TranslateTwoPointsCopy" ); + return anObj; } //============================================================================= @@ -1037,9 +1161,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateDXDYDZ (GEOM::GEOM_Object_ptr theO CORBA::Double theDY, CORBA::Double theDZ) { + beginService( " GEOM_Superv_i::TranslateDXDYDZ" ); MESSAGE("GEOM_Superv_i::TranslateDXDYDZ"); getTransfOp(); - return myTransfOp->TranslateDXDYDZ(theObject, theDX, theDY, theDZ); + GEOM::GEOM_Object_ptr anObj = myTransfOp->TranslateDXDYDZ(theObject, theDX, theDY, theDZ); + endService( " GEOM_Superv_i::TranslateDXDYDZ" ); + return anObj; } //============================================================================= @@ -1050,9 +1177,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateDXDYDZCopy (GEOM::GEOM_Object_ptr CORBA::Double theDY, CORBA::Double theDZ) { + beginService( " GEOM_Superv_i::TranslateDXDYDZCopy" ); MESSAGE("GEOM_Superv_i::TranslateDXDYDZCopy"); getTransfOp(); - return myTransfOp->TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ); + GEOM::GEOM_Object_ptr anObj = myTransfOp->TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ); + endService( " GEOM_Superv_i::TranslateDXDYDZCopy" ); + return anObj; } //============================================================================= @@ -1061,9 +1191,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateDXDYDZCopy (GEOM::GEOM_Object_ptr GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateVector (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theVector) { + beginService( " GEOM_Superv_i::TranslateVector" ); MESSAGE("GEOM_Superv_i::TranslateVector"); getTransfOp(); - return myTransfOp->TranslateVector(theObject, theVector); + GEOM::GEOM_Object_ptr anObj = myTransfOp->TranslateVector(theObject, theVector); + endService( " GEOM_Superv_i::TranslateVector" ); + return anObj; } //============================================================================= @@ -1072,9 +1205,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateVector (GEOM::GEOM_Object_ptr theO GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateVectorCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theVector) { + beginService( " GEOM_Superv_i::TranslateVectorCopy" ); MESSAGE("GEOM_Superv_i::TranslateVectorCopy"); getTransfOp(); - return myTransfOp->TranslateVectorCopy(theObject, theVector); + GEOM::GEOM_Object_ptr anObj = myTransfOp->TranslateVectorCopy(theObject, theVector); + endService( " GEOM_Superv_i::TranslateVectorCopy" ); + return anObj; } //============================================================================= @@ -1085,9 +1221,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MultiTranslate1D (GEOM::GEOM_Object_ptr the CORBA::Double theStep, CORBA::Long theNbTimes) { + beginService( " GEOM_Superv_i::MultiTranslate1D" ); MESSAGE("GEOM_Superv_i::MultiTranslate1D"); getTransfOp(); - return myTransfOp->MultiTranslate1D(theObject, theVector, theStep, theNbTimes); + GEOM::GEOM_Object_ptr anObj = myTransfOp->MultiTranslate1D(theObject, theVector, theStep, theNbTimes); + endService( " GEOM_Superv_i::MultiTranslate1D" ); + return anObj; } //============================================================================= @@ -1101,10 +1240,13 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MultiTranslate2D (GEOM::GEOM_Object_ptr the CORBA::Double theStep2, CORBA::Long theNbTimes2) { + beginService( " GEOM_Superv_i::MultiTranslate2D" ); MESSAGE("GEOM_Superv_i::MultiTranslate2D"); getTransfOp(); - return myTransfOp->MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1, - theVector2, theStep2, theNbTimes2); + GEOM::GEOM_Object_ptr anObj = myTransfOp->MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1, + theVector2, theStep2, theNbTimes2); + endService( " GEOM_Superv_i::MultiTranslate2D" ); + return anObj; } //============================================================================= @@ -1114,9 +1256,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::Rotate (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theAxis, CORBA::Double theAngle) { + beginService( " GEOM_Superv_i::Rotate" ); MESSAGE("GEOM_Superv_i::Rotate"); getTransfOp(); - return myTransfOp->Rotate(theObject, theAxis, theAngle); + GEOM::GEOM_Object_ptr anObj = myTransfOp->Rotate(theObject, theAxis, theAngle); + endService( " GEOM_Superv_i::Rotate" ); + return anObj; } //============================================================================= @@ -1126,9 +1271,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::RotateCopy (GEOM::GEOM_Object_ptr theObject GEOM::GEOM_Object_ptr theAxis, CORBA::Double theAngle) { + beginService( " GEOM_Superv_i::RotateCopy" ); MESSAGE("GEOM_Superv_i::RotateCopy"); getTransfOp(); - return myTransfOp->RotateCopy(theObject, theAxis, theAngle); + GEOM::GEOM_Object_ptr anObj = myTransfOp->RotateCopy(theObject, theAxis, theAngle); + endService( " GEOM_Superv_i::RotateCopy" ); + return anObj; } //============================================================================= @@ -1138,9 +1286,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MultiRotate1D (GEOM::GEOM_Object_ptr theObj GEOM::GEOM_Object_ptr theAxis, CORBA::Long theNbTimes) { + beginService( " GEOM_Superv_i::MultiRotate1D" ); MESSAGE("GEOM_Superv_i::MultiRotate1D"); getTransfOp(); - return myTransfOp->MultiRotate1D(theObject, theAxis, theNbTimes); + GEOM::GEOM_Object_ptr anObj = myTransfOp->MultiRotate1D(theObject, theAxis, theNbTimes); + endService( " GEOM_Superv_i::MultiRotate1D" ); + return anObj; } //============================================================================= @@ -1153,9 +1304,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MultiRotate2D (GEOM::GEOM_Object_ptr theObj CORBA::Double theStep, CORBA::Long theNbTimes2) { + beginService( " GEOM_Superv_i::MultiRotate2D" ); MESSAGE("GEOM_Superv_i::MultiRotate2D"); getTransfOp(); - return myTransfOp->MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2); + GEOM::GEOM_Object_ptr anObj = myTransfOp->MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2); + endService( " GEOM_Superv_i::MultiRotate2D" ); + return anObj; } //============================================================================= @@ -1164,9 +1318,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MultiRotate2D (GEOM::GEOM_Object_ptr theObj GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPlane (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePlane) { + beginService( " GEOM_Superv_i::MirrorPlane" ); MESSAGE("GEOM_Superv_i::MirrorPlane"); getTransfOp(); - return myTransfOp->MirrorPlane(theObject, thePlane); + GEOM::GEOM_Object_ptr anObj = myTransfOp->MirrorPlane(theObject, thePlane); + endService( " GEOM_Superv_i::MirrorPlane" ); + return anObj; } //============================================================================= @@ -1175,9 +1332,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPlane (GEOM::GEOM_Object_ptr theObjec GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPlaneCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePlane) { + beginService( " GEOM_Superv_i::MirrorPlaneCopy" ); MESSAGE("GEOM_Superv_i::MirrorPlaneCopy"); getTransfOp(); - return myTransfOp->MirrorPlaneCopy(theObject, thePlane); + GEOM::GEOM_Object_ptr anObj = myTransfOp->MirrorPlaneCopy(theObject, thePlane); + endService( " GEOM_Superv_i::MirrorPlaneCopy" ); + return anObj; } //============================================================================= @@ -1186,9 +1346,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPlaneCopy (GEOM::GEOM_Object_ptr theO GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorAxis (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theAxis) { + beginService( " GEOM_Superv_i::MirrorAxis" ); MESSAGE("GEOM_Superv_i::MirrorAxis"); getTransfOp(); - return myTransfOp->MirrorAxis(theObject, theAxis); + GEOM::GEOM_Object_ptr anObj = myTransfOp->MirrorAxis(theObject, theAxis); + endService( " GEOM_Superv_i::MirrorAxis" ); + return anObj; } //============================================================================= @@ -1197,9 +1360,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorAxis (GEOM::GEOM_Object_ptr theObject GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorAxisCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theAxis) { + beginService( " GEOM_Superv_i::MirrorAxisCopy" ); MESSAGE("GEOM_Superv_i::MirrorAxisCopy"); getTransfOp(); - return myTransfOp->MirrorAxisCopy(theObject, theAxis); + GEOM::GEOM_Object_ptr anObj = myTransfOp->MirrorAxisCopy(theObject, theAxis); + endService( " GEOM_Superv_i::MirrorAxisCopy" ); + return anObj; } //============================================================================= @@ -1208,9 +1374,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorAxisCopy (GEOM::GEOM_Object_ptr theOb GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPoint (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePoint) { + beginService( " GEOM_Superv_i::MirrorPoint" ); MESSAGE("GEOM_Superv_i::MirrorPoint"); getTransfOp(); - return myTransfOp->MirrorPoint(theObject, thePoint); + GEOM::GEOM_Object_ptr anObj = myTransfOp->MirrorPoint(theObject, thePoint); + endService( " GEOM_Superv_i::MirrorPoint" ); + return anObj; } //============================================================================= @@ -1219,9 +1388,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPoint (GEOM::GEOM_Object_ptr theObjec GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPointCopy (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr thePoint) { + beginService( " GEOM_Superv_i::MirrorPoint" ); MESSAGE("GEOM_Superv_i::MirrorPointCopy"); getTransfOp(); - return myTransfOp->MirrorPointCopy(theObject, thePoint); + GEOM::GEOM_Object_ptr anObj = myTransfOp->MirrorPointCopy(theObject, thePoint); + endService( " GEOM_Superv_i::MirrorPoint" ); + return anObj; } //============================================================================= @@ -1230,9 +1402,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPointCopy (GEOM::GEOM_Object_ptr theO GEOM::GEOM_Object_ptr GEOM_Superv_i::OffsetShape (GEOM::GEOM_Object_ptr theObject, CORBA::Double theOffset) { + beginService( " GEOM_Superv_i::OffsetShape" ); MESSAGE("GEOM_Superv_i::OffsetShape"); getTransfOp(); - return myTransfOp->OffsetShape(theObject, theOffset); + GEOM::GEOM_Object_ptr anObj = myTransfOp->OffsetShape(theObject, theOffset); + endService( " GEOM_Superv_i::OffsetShape" ); + return anObj; } //============================================================================= @@ -1241,9 +1416,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::OffsetShape (GEOM::GEOM_Object_ptr theObjec GEOM::GEOM_Object_ptr GEOM_Superv_i::OffsetShapeCopy (GEOM::GEOM_Object_ptr theObject, CORBA::Double theOffset) { + beginService( " GEOM_Superv_i::OffsetShapeCopy" ); MESSAGE("GEOM_Superv_i::OffsetShapeCopy"); getTransfOp(); - return myTransfOp->OffsetShapeCopy(theObject, theOffset); + GEOM::GEOM_Object_ptr anObj = myTransfOp->OffsetShapeCopy(theObject, theOffset); + endService( " GEOM_Superv_i::OffsetShapeCopy" ); + return anObj; } //============================================================================= @@ -1253,9 +1431,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::ScaleShape (GEOM::GEOM_Object_ptr theObject GEOM::GEOM_Object_ptr thePoint, CORBA::Double theFactor) { + beginService( " GEOM_Superv_i::ScaleShape" ); MESSAGE("GEOM_Superv_i::ScaleShape"); getTransfOp(); - return myTransfOp->ScaleShape(theObject, thePoint, theFactor); + GEOM::GEOM_Object_ptr anObj = myTransfOp->ScaleShape(theObject, thePoint, theFactor); + endService( " GEOM_Superv_i::ScaleShape" ); + return anObj; } //============================================================================= @@ -1265,9 +1446,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::ScaleShapeCopy (GEOM::GEOM_Object_ptr theOb GEOM::GEOM_Object_ptr thePoint, CORBA::Double theFactor) { + beginService( " GEOM_Superv_i::ScaleShapeCopy" ); MESSAGE("GEOM_Superv_i::ScaleShapeCopy"); getTransfOp(); - return myTransfOp->ScaleShapeCopy(theObject, thePoint, theFactor); + GEOM::GEOM_Object_ptr anObj = myTransfOp->ScaleShapeCopy(theObject, thePoint, theFactor); + endService( " GEOM_Superv_i::ScaleShapeCopy" ); + return anObj; } //============================================================================= @@ -1277,9 +1461,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::PositionShape (GEOM::GEOM_Object_ptr theObj GEOM::GEOM_Object_ptr theStartLCS, GEOM::GEOM_Object_ptr theEndLCS) { + beginService( " GEOM_Superv_i::PositionShape" ); MESSAGE("GEOM_Superv_i::PositionShape"); getTransfOp(); - return myTransfOp->PositionShape(theObject, theStartLCS, theEndLCS); + GEOM::GEOM_Object_ptr anObj = myTransfOp->PositionShape(theObject, theStartLCS, theEndLCS); + endService( " GEOM_Superv_i::PositionShape" ); + return anObj; } //============================================================================= @@ -1289,9 +1476,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::PositionShapeCopy (GEOM::GEOM_Object_ptr th GEOM::GEOM_Object_ptr theStartLCS, GEOM::GEOM_Object_ptr theEndLCS) { + beginService( " GEOM_Superv_i::PositionShapeCopy" ); MESSAGE("GEOM_Superv_i::PositionShapeCopy"); getTransfOp(); - return myTransfOp->PositionShapeCopy(theObject, theStartLCS, theEndLCS); + GEOM::GEOM_Object_ptr anObj = myTransfOp->PositionShapeCopy(theObject, theStartLCS, theEndLCS); + endService( " GEOM_Superv_i::PositionShapeCopy" ); + return anObj; } //=============================== ShapesOperations ============================ @@ -1301,9 +1491,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::PositionShapeCopy (GEOM::GEOM_Object_ptr th GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeEdge (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2) { + beginService( " GEOM_Superv_i::MakeEdge" ); MESSAGE("GEOM_Superv_i::MakeEdge"); getShapesOp(); - return myShapesOp->MakeEdge(thePnt1, thePnt2); + GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeEdge(thePnt1, thePnt2); + endService( " GEOM_Superv_i::MakeEdge" ); + return anObj; } //============================================================================= @@ -1311,12 +1504,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeEdge (GEOM::GEOM_Object_ptr thePnt1, //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeWire (GEOM::GEOM_List_ptr theEdgesAndWires) { + beginService( " GEOM_Superv_i::MakeWire" ); MESSAGE("GEOM_Superv_i::MakeWire"); if (GEOM_List_i* aListImplEW = dynamic_cast*>(GetServant(theEdgesAndWires, myPOA).in())) { getShapesOp(); - return myShapesOp->MakeWire(aListImplEW->GetList()); + GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeWire(aListImplEW->GetList()); + endService( " GEOM_Superv_i::MakeWire" ); + return anObj; } + endService( " GEOM_Superv_i::MakeWire" ); return NULL; } @@ -1326,9 +1523,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeWire (GEOM::GEOM_List_ptr theEdgesAndWi GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFace (GEOM::GEOM_Object_ptr theWire, CORBA::Boolean isPlanarWanted) { + beginService( " GEOM_Superv_i::MakeFace" ); MESSAGE("GEOM_Superv_i::MakeFace"); getShapesOp(); - return myShapesOp->MakeFace(theWire, isPlanarWanted); + GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeFace(theWire, isPlanarWanted); + endService( " GEOM_Superv_i::MakeFace" ); + return anObj; } //============================================================================= @@ -1337,12 +1537,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFace (GEOM::GEOM_Object_ptr theWire, GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceWires (GEOM::GEOM_List_ptr theWires, CORBA::Boolean isPlanarWanted) { + beginService( " GEOM_Superv_i::MakeFaceWires" ); MESSAGE("GEOM_Superv_i::MakeFaceWires"); if (GEOM_List_i* aListImplW = dynamic_cast*>(GetServant(theWires, myPOA).in())) { getShapesOp(); - return myShapesOp->MakeFaceWires(aListImplW->GetList(), isPlanarWanted); + GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeFaceWires(aListImplW->GetList(), isPlanarWanted); + endService( " GEOM_Superv_i::MakeFaceWires" ); + return anObj; } + endService( " GEOM_Superv_i::MakeFaceWires" ); return NULL; } @@ -1351,12 +1555,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceWires (GEOM::GEOM_List_ptr theWires //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeShell (GEOM::GEOM_List_ptr theFacesAndShells) { + beginService( " GEOM_Superv_i::MakeShell" ); MESSAGE("GEOM_Superv_i::MakeShell"); if (GEOM_List_i* aListImplFS = dynamic_cast*>(GetServant(theFacesAndShells, myPOA).in())) { getShapesOp(); - return myShapesOp->MakeShell(aListImplFS->GetList()); + GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeShell(aListImplFS->GetList()); + endService( " GEOM_Superv_i::MakeShell" ); + return anObj; } + endService( " GEOM_Superv_i::MakeShell" ); return NULL; } @@ -1365,9 +1573,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeShell (GEOM::GEOM_List_ptr theFacesAndS //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSolidShell (GEOM::GEOM_Object_ptr theShell) { + beginService( " GEOM_Superv_i::MakeSolidShell" ); MESSAGE("GEOM_Superv_i::MakeSolidShell"); getShapesOp(); - return myShapesOp->MakeSolidShell(theShell); + GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeSolidShell(theShell); + endService( " GEOM_Superv_i::MakeSolidShell" ); + return anObj; } //============================================================================= @@ -1375,12 +1586,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSolidShell (GEOM::GEOM_Object_ptr theSh //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSolidShells (GEOM::GEOM_List_ptr theShells) { + beginService( " GEOM_Superv_i::MakeSolidShells" ); MESSAGE("GEOM_Superv_i::MakeSolidShells"); if (GEOM_List_i* aListImplS = dynamic_cast*>(GetServant(theShells, myPOA).in())) { getShapesOp(); - return myShapesOp->MakeSolidShells(aListImplS->GetList()); + GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeSolidShells(aListImplS->GetList()); + endService( " GEOM_Superv_i::MakeSolidShells" ); + return anObj; } + endService( " GEOM_Superv_i::MakeSolidShells" ); return NULL; } @@ -1389,12 +1604,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSolidShells (GEOM::GEOM_List_ptr theShe //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCompound (GEOM::GEOM_List_ptr theShapes) { + beginService( " GEOM_Superv_i::MakeCompound" ); MESSAGE("GEOM_Superv_i::MakeCompound"); if (GEOM_List_i* aListImpl = dynamic_cast*>(GetServant(theShapes, myPOA).in())) { getShapesOp(); - return myShapesOp->MakeCompound(aListImpl->GetList()); + GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeCompound(aListImpl->GetList()); + endService( " GEOM_Superv_i::MakeCompound" ); + return anObj; } + endService( " GEOM_Superv_i::MakeCompound" ); return NULL; } @@ -1404,9 +1623,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCompound (GEOM::GEOM_List_ptr theShapes GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFaces (GEOM::GEOM_Object_ptr theShape, CORBA::Double theTolerance) { + beginService( " GEOM_Superv_i::MakeGlueFaces" ); MESSAGE("GEOM_Superv_i::MakeGlueFaces"); getShapesOp(); - return myShapesOp->MakeGlueFaces(theShape, theTolerance); + GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeGlueFaces(theShape, theTolerance); + endService( " GEOM_Superv_i::MakeGlueFaces" ); + return anObj; } //============================================================================= @@ -1416,12 +1638,14 @@ GEOM::GEOM_List_ptr GEOM_Superv_i::MakeExplode (GEOM::GEOM_Object_ptr theShape, CORBA::Long theShapeType, CORBA::Boolean isSorted) { + beginService( " GEOM_Superv_i::MakeExplode" ); MESSAGE("GEOM_Superv_i::MakeExplode"); getShapesOp(); GEOM::ListOfGO* aList = myShapesOp->MakeExplode(theShape, theShapeType, isSorted); GEOM_List_i* aListPtr = new GEOM_List_i(*(aList)); MESSAGE(" List of "<GetList().length()<<" element(s)"); + endService( " GEOM_Superv_i::MakeExplode" ); return aListPtr->_this(); } @@ -1430,9 +1654,12 @@ GEOM::GEOM_List_ptr GEOM_Superv_i::MakeExplode (GEOM::GEOM_Object_ptr theShape, //============================================================================= CORBA::Long GEOM_Superv_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape) { + beginService( " GEOM_Superv_i::NumberOfFaces" ); MESSAGE("GEOM_Superv_i::NumberOfFaces"); getShapesOp(); - return myShapesOp->NumberOfFaces(theShape); + CORBA::Long aRes = myShapesOp->NumberOfFaces(theShape); + endService( " GEOM_Superv_i::NumberOfFaces" ); + return aRes; } //============================================================================= @@ -1440,9 +1667,12 @@ CORBA::Long GEOM_Superv_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape) //============================================================================= CORBA::Long GEOM_Superv_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape) { + beginService( " GEOM_Superv_i::NumberOfEdges" ); MESSAGE("GEOM_Superv_i::NumberOfEdges"); getShapesOp(); - return myShapesOp->NumberOfEdges(theShape); + CORBA::Long aRes = myShapesOp->NumberOfEdges(theShape); + endService( " GEOM_Superv_i::NumberOfEdges" ); + return aRes; } //============================================================================= @@ -1450,9 +1680,12 @@ CORBA::Long GEOM_Superv_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape) //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::ChangeOrientation (GEOM::GEOM_Object_ptr theShape) { + beginService( " GEOM_Superv_i::ChangeOrientation" ); MESSAGE("GEOM_Superv_i::ChangeOrientation"); getShapesOp(); - return myShapesOp->ChangeOrientation(theShape); + GEOM::GEOM_Object_ptr anObj = myShapesOp->ChangeOrientation(theShape); + endService( " GEOM_Superv_i::ChangeOrientation" ); + return anObj; } @@ -1465,9 +1698,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeQuad4Vertices (GEOM::GEOM_Object_ptr th GEOM::GEOM_Object_ptr thePnt3, GEOM::GEOM_Object_ptr thePnt4) { + beginService( " GEOM_Superv_i::MakeQuad4Vertices" ); MESSAGE("GEOM_Superv_i::MakeQuad4Vertices"); getBlocksOp(); - return myBlocksOp->MakeQuad4Vertices(thePnt1, thePnt2, thePnt3, thePnt4); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->MakeQuad4Vertices(thePnt1, thePnt2, thePnt3, thePnt4); + endService( " GEOM_Superv_i::MakeQuad4Vertices" ); + return anObj; } //============================================================================= @@ -1478,9 +1714,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeQuad (GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge3, GEOM::GEOM_Object_ptr theEdge4) { + beginService( " GEOM_Superv_i::MakeQuad" ); MESSAGE("GEOM_Superv_i::MakeQuad"); getBlocksOp(); - return myBlocksOp->MakeQuad(theEdge1, theEdge2, theEdge3, theEdge4); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->MakeQuad(theEdge1, theEdge2, theEdge3, theEdge4); + endService( " GEOM_Superv_i::MakeQuad" ); + return anObj; } //============================================================================= @@ -1489,9 +1728,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeQuad (GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeQuad2Edges (GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2) { + beginService( " GEOM_Superv_i::MakeQuad2Edges" ); MESSAGE("GEOM_Superv_i::MakeQuad2Edges"); getBlocksOp(); - return myBlocksOp->MakeQuad2Edges(theEdge1, theEdge2); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->MakeQuad2Edges(theEdge1, theEdge2); + endService( " GEOM_Superv_i::MakeQuad2Edges" ); + return anObj; } //============================================================================= @@ -1504,9 +1746,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeHexa (GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace5, GEOM::GEOM_Object_ptr theFace6) { + beginService( " GEOM_Superv_i::MakeHexa" ); MESSAGE("GEOM_Superv_i::MakeHexa"); getBlocksOp(); - return myBlocksOp->MakeHexa(theFace1, theFace2, theFace3, theFace4, theFace5, theFace6); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->MakeHexa(theFace1, theFace2, theFace3, theFace4, theFace5, theFace6); + endService( " GEOM_Superv_i::MakeHexa" ); + return anObj; } //============================================================================= @@ -1515,9 +1760,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeHexa (GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeHexa2Faces (GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2) { + beginService( " GEOM_Superv_i::MakeHexa2Faces" ); MESSAGE("GEOM_Superv_i::MakeHexa2Faces"); getBlocksOp(); - return myBlocksOp->MakeHexa2Faces(theFace1, theFace2); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->MakeHexa2Faces(theFace1, theFace2); + endService( " GEOM_Superv_i::MakeHexa2Faces" ); + return anObj; } //============================================================================= @@ -1529,9 +1777,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetPoint (GEOM::GEOM_Object_ptr theShape, CORBA::Double theZ, CORBA::Double theEpsilon) { + beginService( " GEOM_Superv_i::GetPoint" ); MESSAGE("GEOM_Superv_i::GetPoint"); getBlocksOp(); - return myBlocksOp->GetPoint(theShape, theX, theY, theZ, theEpsilon); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->GetPoint(theShape, theX, theY, theZ, theEpsilon); + endService( " GEOM_Superv_i::GetPoint" ); + return anObj; } //============================================================================= @@ -1541,9 +1792,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetEdge (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr thePoint1, GEOM::GEOM_Object_ptr thePoint2) { + beginService( " GEOM_Superv_i::GetEdge" ); MESSAGE("GEOM_Superv_i::GetEdge"); getBlocksOp(); - return myBlocksOp->GetEdge(theShape, thePoint1, thePoint2); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->GetEdge(theShape, thePoint1, thePoint2); + endService( " GEOM_Superv_i::GetEdge" ); + return anObj; } //============================================================================= @@ -1552,9 +1806,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetEdge (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr GEOM_Superv_i::GetEdgeNearPoint (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr thePoint) { + beginService( " GEOM_Superv_i::GetEdgeNearPoint" ); MESSAGE("GEOM_Superv_i::GetEdgeNearPoint"); getBlocksOp(); - return myBlocksOp->GetEdgeNearPoint(theShape, thePoint); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->GetEdgeNearPoint(theShape, thePoint); + endService( " GEOM_Superv_i::GetEdgeNearPoint" ); + return anObj; } //============================================================================= @@ -1566,9 +1823,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetFaceByPoints (GEOM::GEOM_Object_ptr theS GEOM::GEOM_Object_ptr thePoint3, GEOM::GEOM_Object_ptr thePoint4) { + beginService( " GEOM_Superv_i::GetFaceByPoints" ); MESSAGE("GEOM_Superv_i::GetFaceByPoints"); getBlocksOp(); - return myBlocksOp->GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4); + endService( " GEOM_Superv_i::GetFaceByPoints" ); + return anObj; } //============================================================================= @@ -1578,9 +1838,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetFaceByEdges (GEOM::GEOM_Object_ptr theSh GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2) { + beginService( " GEOM_Superv_i::GetFaceByEdges" ); MESSAGE("GEOM_Superv_i::GetFaceByEdges"); getBlocksOp(); - return myBlocksOp->GetFaceByEdges(theShape, theEdge1, theEdge2); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->GetFaceByEdges(theShape, theEdge1, theEdge2); + endService( " GEOM_Superv_i::GetFaceByEdges" ); + return anObj; } //============================================================================= @@ -1589,9 +1852,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetFaceByEdges (GEOM::GEOM_Object_ptr theSh GEOM::GEOM_Object_ptr GEOM_Superv_i::GetOppositeFace (GEOM::GEOM_Object_ptr theBlock, GEOM::GEOM_Object_ptr theFace) { + beginService( " GEOM_Superv_i::GetOppositeFace" ); MESSAGE("GEOM_Superv_i::GetOppositeFace"); getBlocksOp(); - return myBlocksOp->GetOppositeFace(theBlock, theFace); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->GetOppositeFace(theBlock, theFace); + endService( " GEOM_Superv_i::GetOppositeFace" ); + return anObj; } //============================================================================= @@ -1600,9 +1866,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetOppositeFace (GEOM::GEOM_Object_ptr theB GEOM::GEOM_Object_ptr GEOM_Superv_i::GetFaceNearPoint (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr thePoint) { + beginService( " GEOM_Superv_i::GetFaceNearPoint" ); MESSAGE("GEOM_Superv_i::GetFaceNearPoint"); getBlocksOp(); - return myBlocksOp->GetFaceNearPoint(theShape, thePoint); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->GetFaceNearPoint(theShape, thePoint); + endService( " GEOM_Superv_i::GetFaceNearPoint" ); + return anObj; } //============================================================================= @@ -1611,9 +1880,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetFaceNearPoint (GEOM::GEOM_Object_ptr the GEOM::GEOM_Object_ptr GEOM_Superv_i::GetFaceByNormale (GEOM::GEOM_Object_ptr theBlock, GEOM::GEOM_Object_ptr theVector) { + beginService( " GEOM_Superv_i::GetFaceByNormale" ); MESSAGE("GEOM_Superv_i::GetFaceByNormale"); getBlocksOp(); - return myBlocksOp->GetFaceByNormale(theBlock, theVector); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->GetFaceByNormale(theBlock, theVector); + endService( " GEOM_Superv_i::GetFaceByNormale" ); + return anObj; } //============================================================================= @@ -1624,9 +1896,12 @@ CORBA::Boolean GEOM_Superv_i::IsCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompo CORBA::Long theMaxNbFaces, CORBA::Long& theNbBlocks) { + beginService( " GEOM_Superv_i::IsCompoundOfBlocks" ); MESSAGE("GEOM_Superv_i::IsCompoundOfBlocks"); getBlocksOp(); - return myBlocksOp->IsCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces, theNbBlocks); + CORBA::Boolean aRes = myBlocksOp->IsCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces, theNbBlocks); + endService( " GEOM_Superv_i::IsCompoundOfBlocks" ); + return aRes; } //============================================================================= @@ -1636,9 +1911,12 @@ CORBA::Boolean GEOM_Superv_i::CheckCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound, GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors) { + beginService( " GEOM_Superv_i::CheckCompoundOfBlocks" ); MESSAGE("GEOM_Superv_i::CheckCompoundOfBlocks"); getBlocksOp(); - return myBlocksOp->CheckCompoundOfBlocks(theCompound, theErrors); + CORBA::Boolean aRes = myBlocksOp->CheckCompoundOfBlocks(theCompound, theErrors); + endService( " GEOM_Superv_i::CheckCompoundOfBlocks" ); + return aRes; } //============================================================================= @@ -1647,9 +1925,12 @@ CORBA::Boolean GEOM_Superv_i::CheckCompoundOfBlocks char* GEOM_Superv_i::PrintBCErrors (GEOM::GEOM_Object_ptr theCompound, const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors) { + beginService( " GEOM_Superv_i::PrintBCErrors" ); MESSAGE("GEOM_Superv_i::PrintBCErrors"); getBlocksOp(); - return myBlocksOp->PrintBCErrors(theCompound, theErrors); + char* anErrors = myBlocksOp->PrintBCErrors(theCompound, theErrors); + endService( " GEOM_Superv_i::PrintBCErrors" ); + return anErrors; } //============================================================================= @@ -1659,10 +1940,12 @@ GEOM::GEOM_List_ptr GEOM_Superv_i::ExplodeCompoundOfBlocks (GEOM::GEOM_Object_pt CORBA::Long theMinNbFaces, CORBA::Long theMaxNbFaces) { + beginService( " GEOM_Superv_i::ExplodeCompoundOfBlocks" ); MESSAGE("GEOM_Superv_i::ExplodeCompoundOfBlocks"); getBlocksOp(); GEOM::ListOfGO* aBlocks = myBlocksOp->ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces); GEOM_List_i* aListPtr = new GEOM_List_i(*(aBlocks)); + endService( " GEOM_Superv_i::ExplodeCompoundOfBlocks" ); return aListPtr->_this(); } @@ -1672,9 +1955,12 @@ GEOM::GEOM_List_ptr GEOM_Superv_i::ExplodeCompoundOfBlocks (GEOM::GEOM_Object_pt GEOM::GEOM_Object_ptr GEOM_Superv_i::GetBlockNearPoint (GEOM::GEOM_Object_ptr theCompound, GEOM::GEOM_Object_ptr thePoint) { + beginService( " GEOM_Superv_i::GetBlockNearPoint" ); MESSAGE("GEOM_Superv_i::GetBlockNearPoint"); getBlocksOp(); - return myBlocksOp->GetBlockNearPoint(theCompound, thePoint); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->GetBlockNearPoint(theCompound, thePoint); + endService( " GEOM_Superv_i::GetBlockNearPoint" ); + return anObj; } //============================================================================= @@ -1683,12 +1969,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetBlockNearPoint (GEOM::GEOM_Object_ptr th GEOM::GEOM_Object_ptr GEOM_Superv_i::GetBlockByParts (GEOM::GEOM_Object_ptr theCompound, GEOM::GEOM_List_ptr theParts) { + beginService( " GEOM_Superv_i::GetBlockByParts" ); MESSAGE("GEOM_Superv_i::GetBlockByParts"); if (GEOM_List_i* aListImplP = dynamic_cast*>(GetServant(theParts, myPOA).in())) { getBlocksOp(); - return myBlocksOp->GetBlockByParts(theCompound, aListImplP->GetList()); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->GetBlockByParts(theCompound, aListImplP->GetList()); + endService( " GEOM_Superv_i::GetBlockByParts" ); + return anObj; } + endService( " GEOM_Superv_i::GetBlockByParts" ); return NULL; } @@ -1698,6 +1988,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetBlockByParts (GEOM::GEOM_Object_ptr theC GEOM::GEOM_List_ptr GEOM_Superv_i::GetBlocksByParts (GEOM::GEOM_Object_ptr theCompound, GEOM::GEOM_List_ptr theParts) { + beginService( " GEOM_Superv_i::GetBlocksByParts" ); MESSAGE("GEOM_Superv_i::GetBlocksByParts"); if (GEOM_List_i* aListImplP = dynamic_cast*>(GetServant(theParts, myPOA).in())) { @@ -1705,8 +1996,10 @@ GEOM::GEOM_List_ptr GEOM_Superv_i::GetBlocksByParts (GEOM::GEOM_Object_ptr theCo GEOM::ListOfGO* aBlocks = myBlocksOp->GetBlocksByParts(theCompound, aListImplP->GetList()); GEOM_List_i* aListPtr = new GEOM_List_i(*(aBlocks)); + endService( " GEOM_Superv_i::GetBlocksByParts" ); return aListPtr->_this(); } + endService( " GEOM_Superv_i::GetBlocksByParts" ); return NULL; } @@ -1718,9 +2011,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeMultiTransformation1D (GEOM::GEOM_Objec CORBA::Long theDirFace2, CORBA::Long theNbTimes) { + beginService( " GEOM_Superv_i::MakeMultiTransformation1D" ); MESSAGE("GEOM_Superv_i::MakeMultiTransformation1D"); getBlocksOp(); - return myBlocksOp->MakeMultiTransformation1D(theBlock, theDirFace1, theDirFace2, theNbTimes); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->MakeMultiTransformation1D(theBlock, theDirFace1, theDirFace2, theNbTimes); + endService( " GEOM_Superv_i::MakeMultiTransformation1D" ); + return anObj; } //============================================================================= @@ -1735,11 +2031,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeMultiTransformation2D CORBA::Long theDirFace2V, CORBA::Long theNbTimesV) { + beginService( " GEOM_Superv_i::MakeMultiTransformation2D" ); MESSAGE("GEOM_Superv_i::MakeMultiTransformation2D"); getBlocksOp(); - return myBlocksOp->MakeMultiTransformation2D(theBlock, - theDirFace1U, theDirFace2U, theNbTimesU, - theDirFace1V, theDirFace2V, theNbTimesV); + GEOM::GEOM_Object_ptr anObj = myBlocksOp->MakeMultiTransformation2D(theBlock, + theDirFace1U, theDirFace2U, theNbTimesU, + theDirFace1V, theDirFace2V, theNbTimesV); + endService( " GEOM_Superv_i::MakeMultiTransformation2D" ); + return anObj; } //=============================== CurvesOperations ============================ @@ -1750,9 +2049,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCirclePntVecR (GEOM::GEOM_Object_ptr th GEOM::GEOM_Object_ptr theVector, CORBA::Double theR) { + beginService( " GEOM_Superv_i::MakeCirclePntVecR" ); MESSAGE("GEOM_Superv_i::MakeCirclePntVecR"); getCurvesOp(); - return myCurvesOp->MakeCirclePntVecR(theCenter, theVector, theR); + GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeCirclePntVecR(theCenter, theVector, theR); + endService( " GEOM_Superv_i::MakeCirclePntVecR" ); + return anObj; } //============================================================================= @@ -1762,9 +2064,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCircleThreePnt (GEOM::GEOM_Object_ptr t GEOM::GEOM_Object_ptr thePnt2, GEOM::GEOM_Object_ptr thePnt3) { + beginService( " GEOM_Superv_i::MakeCircleThreePnt" ); MESSAGE("GEOM_Superv_i::MakeCircleThreePnt"); getCurvesOp(); - return myCurvesOp->MakeCircleThreePnt(thePnt1, thePnt2, thePnt3); + GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeCircleThreePnt(thePnt1, thePnt2, thePnt3); + endService( " GEOM_Superv_i::MakeCircleThreePnt" ); + return anObj; } //============================================================================= @@ -1775,9 +2080,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeEllipse (GEOM::GEOM_Object_ptr theCente CORBA::Double theRMajor, CORBA::Double theRMinor) { + beginService( " GEOM_Superv_i::MakeEllipse" ); MESSAGE("GEOM_Superv_i::MakeEllipse"); getCurvesOp(); - return myCurvesOp->MakeEllipse(theCenter, theVector, theRMajor, theRMinor); + GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeEllipse(theCenter, theVector, theRMajor, theRMinor); + endService( " GEOM_Superv_i::MakeEllipse" ); + return anObj; } //============================================================================= @@ -1787,9 +2095,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeArc (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2, GEOM::GEOM_Object_ptr thePnt3) { + beginService( " GEOM_Superv_i::MakeArc" ); MESSAGE("GEOM_Superv_i::MakeArc"); getCurvesOp(); - return myCurvesOp->MakeArc(thePnt1, thePnt2, thePnt3); + GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeArc(thePnt1, thePnt2, thePnt3); + endService( " GEOM_Superv_i::MakeArc" ); + return anObj; } //============================================================================= @@ -1797,12 +2108,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeArc (GEOM::GEOM_Object_ptr thePnt1, //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePolyline (GEOM::GEOM_List_ptr thePoints) { + beginService( " GEOM_Superv_i::MakePolyline" ); MESSAGE("GEOM_Superv_i::MakePolyline"); if (GEOM_List_i* aListImplP = dynamic_cast*>(GetServant(thePoints, myPOA).in())) { getCurvesOp(); - return myCurvesOp->MakePolyline(aListImplP->GetList()); + GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakePolyline(aListImplP->GetList()); + endService( " GEOM_Superv_i::MakePolyline" ); + return anObj; } + endService( " GEOM_Superv_i::MakePolyline" ); return NULL; } @@ -1811,12 +2126,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePolyline (GEOM::GEOM_List_ptr thePoints //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineBezier (GEOM::GEOM_List_ptr thePoints) { + beginService( " GEOM_Superv_i::MakeSplineBezier" ); MESSAGE("GEOM_Superv_i::MakeSplineBezier"); if (GEOM_List_i* aListImplP = dynamic_cast*>(GetServant(thePoints, myPOA).in())) { getCurvesOp(); - return myCurvesOp->MakeSplineBezier(aListImplP->GetList()); + GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeSplineBezier(aListImplP->GetList()); + endService( " GEOM_Superv_i::MakeSplineBezier" ); + return anObj; } + endService( " GEOM_Superv_i::MakeSplineBezier" ); return NULL; } @@ -1825,12 +2144,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineBezier (GEOM::GEOM_List_ptr thePo //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineInterpolation (GEOM::GEOM_List_ptr thePoints) { + beginService( " GEOM_Superv_i::MakeSplineInterpolation" ); MESSAGE("GEOM_Superv_i::MakeSplineInterpolation"); if (GEOM_List_i* aListImplP = dynamic_cast*>(GetServant(thePoints, myPOA).in())) { getCurvesOp(); - return myCurvesOp->MakeSplineInterpolation(aListImplP->GetList()); + GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeSplineInterpolation(aListImplP->GetList()); + endService( " GEOM_Superv_i::MakeSplineInterpolation" ); + return anObj; } + endService( " GEOM_Superv_i::MakeSplineInterpolation" ); return NULL; } @@ -1840,12 +2163,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineInterpolation (GEOM::GEOM_List_pt GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSketcher (const char* theCommand, GEOM::GEOM_List_ptr theWorkingPlane) { + beginService( " GEOM_Superv_i::MakeSketcher" ); MESSAGE("GEOM_Superv_i::MakeSketcher"); if (GEOM_List_i* aListImplWP = dynamic_cast*>(GetServant(theWorkingPlane, myPOA).in())) { getCurvesOp(); - return myCurvesOp->MakeSketcher(theCommand, aListImplWP->GetList()); + GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeSketcher(theCommand, aListImplWP->GetList()); + endService( " GEOM_Superv_i::MakeSketcher" ); + return anObj; } + endService( " GEOM_Superv_i::MakeSketcher" ); return NULL; } @@ -1856,9 +2183,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSketcher (const char* theCommand, GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilletAll (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR) { + beginService( " GEOM_Superv_i::MakeFilletAll" ); MESSAGE("GEOM_Superv_i::MakeFilletAllMakeSketcher"); getLocalOp(); - return myLocalOp->MakeFilletAll(theShape, theR); + GEOM::GEOM_Object_ptr anObj = myLocalOp->MakeFilletAll(theShape, theR); + endService( " GEOM_Superv_i::MakeFilletAll" ); + return anObj; } //============================================================================= @@ -1868,12 +2198,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilletEdges (GEOM::GEOM_Object_ptr theS CORBA::Double theR, GEOM::GEOM_List_ptr theEdges) { + beginService( " GEOM_Superv_i::MakeFilletEdges" ); MESSAGE("GEOM_Superv_i::MakeFilletEdges"); if (GEOM_List_i* aListImplE = dynamic_cast*>(GetServant(theEdges, myPOA).in())) { getLocalOp(); - return myLocalOp->MakeFilletEdges(theShape, theR, aListImplE->GetList()); + GEOM::GEOM_Object_ptr anObj = myLocalOp->MakeFilletEdges(theShape, theR, aListImplE->GetList()); + endService( " GEOM_Superv_i::MakeFilletEdges" ); + return anObj; } + endService( " GEOM_Superv_i::MakeFilletEdges" ); return NULL; } @@ -1884,12 +2218,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilletFaces (GEOM::GEOM_Object_ptr theS CORBA::Double theR, GEOM::GEOM_List_ptr theFaces) { + beginService( " GEOM_Superv_i::MakeFilletFaces" ); MESSAGE("GEOM_Superv_i::MakeFilletFaces"); if (GEOM_List_i* aListImplF = dynamic_cast*>(GetServant(theFaces, myPOA).in())) { getLocalOp(); - return myLocalOp->MakeFilletFaces(theShape, theR, aListImplF->GetList()); + GEOM::GEOM_Object_ptr anObj = myLocalOp->MakeFilletFaces(theShape, theR, aListImplF->GetList()); + endService( " GEOM_Superv_i::MakeFilletFaces" ); + return anObj; } + endService( " GEOM_Superv_i::MakeFilletFaces" ); return NULL; } @@ -1898,9 +2236,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilletFaces (GEOM::GEOM_Object_ptr theS //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeChamferAll (GEOM::GEOM_Object_ptr theShape, CORBA::Double theD) { + beginService( " GEOM_Superv_i::MakeChamferAll" ); MESSAGE("GEOM_Superv_i::MakeChamferAll"); getLocalOp(); - return myLocalOp->MakeChamferAll(theShape, theD); + GEOM::GEOM_Object_ptr anObj = myLocalOp->MakeChamferAll(theShape, theD); + endService( " GEOM_Superv_i::MakeChamferAll" ); + return anObj; } //============================================================================= @@ -1910,9 +2251,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeChamferEdge (GEOM::GEOM_Object_ptr theS CORBA::Double theD1, CORBA::Double theD2, CORBA::Long theFace1, CORBA::Long theFace2) { + beginService( " GEOM_Superv_i::MakeChamferEdge" ); MESSAGE("GEOM_Superv_i::MakeChamferEdge"); getLocalOp(); - return myLocalOp->MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2); + GEOM::GEOM_Object_ptr anObj = myLocalOp->MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2); + endService( " GEOM_Superv_i::MakeChamferEdge" ); + return anObj; } //============================================================================= @@ -1922,12 +2266,16 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeChamferFaces (GEOM::GEOM_Object_ptr the CORBA::Double theD1, CORBA::Double theD2, GEOM::GEOM_List_ptr theFaces) { + beginService( " GEOM_Superv_i::MakeChamferFaces" ); MESSAGE("GEOM_Superv_i::MakeChamferFaces"); if (GEOM_List_i* aListImplF = dynamic_cast*>(GetServant(theFaces, myPOA).in())) { getLocalOp(); - return myLocalOp->MakeChamferFaces(theShape, theD1, theD2, aListImplF->GetList()); + GEOM::GEOM_Object_ptr anObj = myLocalOp->MakeChamferFaces(theShape, theD1, theD2, aListImplF->GetList()); + endService( " GEOM_Superv_i::MakeChamferFaces" ); + return anObj; } + endService( " GEOM_Superv_i::MakeChamferFaces" ); return NULL; } @@ -1939,9 +2287,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeArchimede (GEOM::GEOM_Object_ptr theSha CORBA::Double theWaterDensity, CORBA::Double theMeshingDeflection) { + beginService( " GEOM_Superv_i::MakeArchimede" ); MESSAGE("GEOM_Superv_i::MakeArchimede"); getLocalOp(); - return myLocalOp->MakeArchimede(theShape, theWeight, theWaterDensity, theMeshingDeflection); + GEOM::GEOM_Object_ptr anObj = myLocalOp->MakeArchimede(theShape, theWeight, theWaterDensity, theMeshingDeflection); + endService( " GEOM_Superv_i::MakeArchimede" ); + return anObj; } //============================================================================= @@ -1950,9 +2301,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeArchimede (GEOM::GEOM_Object_ptr theSha CORBA::Long GEOM_Superv_i::GetSubShapeIndex (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr theSubShape) { + beginService( " GEOM_Superv_i::GetSubShapeIndex" ); MESSAGE("GEOM_Superv_i::GetSubShapeIndexMakeArchimede"); getLocalOp(); - return myLocalOp->GetSubShapeIndex(theShape, theSubShape); + CORBA::Long aRes = myLocalOp->GetSubShapeIndex(theShape, theSubShape); + endService( " GEOM_Superv_i::GetSubShapeIndex" ); + return aRes; } //=============================== GroupOperations ============================= @@ -1962,9 +2316,12 @@ CORBA::Long GEOM_Superv_i::GetSubShapeIndex (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr GEOM_Superv_i::CreateGroup (GEOM::GEOM_Object_ptr theMainShape, CORBA::Long theShapeType) { + beginService( " GEOM_Superv_i::CreateGroup" ); MESSAGE("GEOM_Superv_i::CreateGroup"); getGroupOp(); - return myGroupOp->CreateGroup(theMainShape, theShapeType); + GEOM::GEOM_Object_ptr anObj = myGroupOp->CreateGroup(theMainShape, theShapeType); + endService( " GEOM_Superv_i::CreateGroup" ); + return anObj; } //============================================================================= @@ -1973,9 +2330,11 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::CreateGroup (GEOM::GEOM_Object_ptr theMainS void GEOM_Superv_i::AddObject (GEOM::GEOM_Object_ptr theGroup, CORBA::Long theSubShapeId) { + beginService( " GEOM_Superv_i::AddObject" ); MESSAGE("GEOM_Superv_i::AddObject"); getGroupOp(); myGroupOp->AddObject(theGroup, theSubShapeId); + endService( " GEOM_Superv_i::AddObject" ); } //============================================================================= @@ -1984,9 +2343,11 @@ void GEOM_Superv_i::AddObject (GEOM::GEOM_Object_ptr theGroup, void GEOM_Superv_i::RemoveObject (GEOM::GEOM_Object_ptr theGroup, CORBA::Long theSubShapeId) { + beginService( " GEOM_Superv_i::RemoveObject" ); MESSAGE("GEOM_Superv_i::RemoveObject"); getGroupOp(); myGroupOp->RemoveObject(theGroup, theSubShapeId); + endService( " GEOM_Superv_i::RemoveObject" ); } //============================================================================= @@ -1994,9 +2355,12 @@ void GEOM_Superv_i::RemoveObject (GEOM::GEOM_Object_ptr theGroup, //============================================================================= CORBA::Long GEOM_Superv_i::GetType (GEOM::GEOM_Object_ptr theGroup) { + beginService( " GEOM_Superv_i::GetType" ); MESSAGE("GEOM_Superv_i::GetType"); getGroupOp(); - return myGroupOp->GetType(theGroup); + CORBA::Long aResult = myGroupOp->GetType(theGroup); + endService( " GEOM_Superv_i::GetType" ); + return aResult; } //============================================================================= @@ -2004,9 +2368,12 @@ CORBA::Long GEOM_Superv_i::GetType (GEOM::GEOM_Object_ptr theGroup) //============================================================================= GEOM::GEOM_Object_ptr GEOM_Superv_i::GetMainShape (GEOM::GEOM_Object_ptr theGroup) { + beginService( " GEOM_Superv_i::GetMainShape" ); MESSAGE("GEOM_Superv_i::GetMainShape"); getGroupOp(); - return myGroupOp->GetMainShape(theGroup); + GEOM::GEOM_Object_ptr anObj = myGroupOp->GetMainShape(theGroup); + endService( " GEOM_Superv_i::GetMainShape" ); + return anObj; } //============================================================================= @@ -2014,12 +2381,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetMainShape (GEOM::GEOM_Object_ptr theGrou //============================================================================= GEOM::GEOM_List_ptr GEOM_Superv_i::GetObjects (GEOM::GEOM_Object_ptr theGroup) { + beginService( " GEOM_Superv_i::GetObjects" ); MESSAGE("GEOM_Superv_i::GetObjects"); getGroupOp(); GEOM::ListOfLong* aList = myGroupOp->GetObjects(theGroup); GEOM_List_i* aListPtr = new GEOM_List_i(*(aList)); MESSAGE(" List of "<GetList().length()<<" element(s)"); + endService( " GEOM_Superv_i::GetObjects" ); return aListPtr->_this(); } diff --git a/src/GEOM_SWIG/GEOM_TestMeasures.py b/src/GEOM_SWIG/GEOM_TestMeasures.py index fe10c1dad..740d1b2d8 100644 --- a/src/GEOM_SWIG/GEOM_TestMeasures.py +++ b/src/GEOM_SWIG/GEOM_TestMeasures.py @@ -119,3 +119,13 @@ def TestMeasureOperations (geompy, math): #print " On Cube (", MinDist[4], ", ", MinDist[5], ", ", MinDist[6], ")" print "\nMinimal distance between Box and Cube = ", MinDist + + ####### Position (LCS) ####### + + Pos = geompy.GetPosition(box) + print "\nPosition(LCS) of box 10x30x70:" + print "Origin: (", Pos[0], ", ", Pos[1], ", ", Pos[2], ")" + print "Z axis: (", Pos[3], ", ", Pos[4], ", ", Pos[5], ")" + print "X axis: (", Pos[6], ", ", Pos[7], ", ", Pos[8], ")" + + pass diff --git a/src/GEOM_SWIG/GEOM_TestOthers.py b/src/GEOM_SWIG/GEOM_TestOthers.py index 3b4f6f943..bc47bd830 100644 --- a/src/GEOM_SWIG/GEOM_TestOthers.py +++ b/src/GEOM_SWIG/GEOM_TestOthers.py @@ -307,6 +307,7 @@ def TestOtherOperations (geompy, math): v_n0p = geompy.MakeVectorDXDYDZ(-1, 0, 1) v_pp0 = geompy.MakeVectorDXDYDZ( 1, 1, 0) v_np0 = geompy.MakeVectorDXDYDZ(-1, 1, 0) + v_0n0 = geompy.MakeVectorDXDYDZ( 0, -1, 0) pln_0pp = geompy.MakePlane(p0, v_0pp, 300) pln_0np = geompy.MakePlane(p0, v_0np, 300) @@ -422,6 +423,20 @@ def TestOtherOperations (geompy, math): geompy.UnionIDs(faces_above, faces_above_pln_ids) geompy.addToStudy(faces_above, "Group of faces above Plane (N = (0, 1, 1))") + # GetShapesOnPlaneWithLocation + Loc = geompy.MakeVertex(0, -50, 0) + edges_on_pln = geompy.GetShapesOnPlaneWithLocation(blocksComp, geompy.ShapeType["EDGE"], + v_0n0, Loc, geompy.GEOM.ST_ON) + for edge_i in edges_on_pln: + geompy.addToStudy(edge_i, "Edge on Plane (N = (0, -1, 0) & Location = (0, -50, 0)") + + # GetShapesOnPlaneWithLocationIDs + edges_on_pln_ids = geompy.GetShapesOnPlaneWithLocationIDs(blocksComp, geompy.ShapeType["EDGE"], + v_0n0, Loc, geompy.GEOM.ST_ON) + group_edges_on_pln = geompy.CreateGroup(blocksComp, geompy.ShapeType["EDGE"]) + geompy.UnionIDs(group_edges_on_pln, edges_on_pln_ids) + geompy.addToStudy(group_edges_on_pln, "Group of edges on Plane (N = (0, -1, 0) & Location = (0, -50, 0))") + # GetShapesOnCylinder edges_out_cyl = geompy.GetShapesOnCylinder(blocksComp, geompy.ShapeType["EDGE"], vy, 55, geompy.GEOM.ST_OUT) diff --git a/src/GEOM_SWIG/batchmode_geompy.py b/src/GEOM_SWIG/batchmode_geompy.py index 6d280f1f8..52ccbdfff 100644 --- a/src/GEOM_SWIG/batchmode_geompy.py +++ b/src/GEOM_SWIG/batchmode_geompy.py @@ -31,10 +31,16 @@ import GEOM g=None step = 0 -while step < 50 and g == None: +sleeping_time = 0.01 +sleeping_time_max = 1.0 +while 1: g = lcc.FindOrLoadComponent("FactoryServer", "GEOM") + if g is not None: break step = step + 1 - time.sleep(4) + if step > 100: break + time.sleep(sleeping_time) + sleeping_time = max(sleeping_time_max, 2*sleeping_time) + pass geom = g._narrow( GEOM.GEOM_Gen ) myBuilder = None @@ -920,8 +926,12 @@ def MakeCDG(aShape): print "GetCentreOfMass : ", MeasuOp.GetErrorCode() return anObj -def CheckShape(aShape): - (IsValid, Status) = MeasuOp.CheckShape(aShape) +def CheckShape(theShape, theIsCheckGeom = 0): + if theIsCheckGeom: + (IsValid, Status) = MeasuOp.CheckShapeWithGeometry(theShape) + else: + (IsValid, Status) = MeasuOp.CheckShape(theShape) + if MeasuOp.IsDone() == 0: print "CheckShape : ", MeasuOp.GetErrorCode() else: diff --git a/src/GEOM_SWIG/geompy.py b/src/GEOM_SWIG/geompy.py index b3d72514e..2247928c1 100644 --- a/src/GEOM_SWIG/geompy.py +++ b/src/GEOM_SWIG/geompy.py @@ -26,7 +26,10 @@ # Module : GEOM # $Header$ +import salome +salome.salome_init() from salome import * + import GEOM """ @@ -273,7 +276,7 @@ def MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize): return anObj ## Create a plane, similar to the existing one, but with another size of representing face. -# @param theFace Referenced plane. +# @param theFace Referenced plane or LCS(Marker). # @param theTrimSize New half size of a side of quadrangle face, representing the plane. # @return New GEOM_Object, containing the created plane. # @@ -452,7 +455,7 @@ def MakeSketcher(theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]): # For format of the description string see the previous method.\n # @param theCommand String, defining the sketcher in local # coordinates of the working plane. -# @param theWorkingPlane Planar Face of the working plane. +# @param theWorkingPlane Planar Face or LCS(Marker) of the working plane. # @return New GEOM_Object, containing the created wire. def MakeSketcherOnPlane(theCommand, theWorkingPlane): anObj = CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane) @@ -741,7 +744,7 @@ def MakeWire(theEdgesAndWires): return anObj ## Create a face on the given wire. -# @param theWire Wire to build the face on. +# @param theWire closed Wire or Edge to build the face on. # @param isPlanarWanted If TRUE, only planar face will be built. # If impossible, NULL object will be returned. # @return New GEOM_Object, containing the created face. @@ -754,7 +757,7 @@ def MakeFace(theWire, isPlanarWanted): return anObj ## Create a face on the given wires set. -# @param theWires List of wires to build the face on. +# @param theWires List of closed wires or edges to build the face on. # @param isPlanarWanted If TRUE, only planar face will be built. # If impossible, NULL object will be returned. # @return New GEOM_Object, containing the created face. @@ -897,6 +900,33 @@ def GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState): print "GetShapesOnPlaneIDs : ", ShapesOp.GetErrorCode() return aList +## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively +# the specified plane by the certain way, defined through \a theState parameter. +# @param theShape Shape to find sub-shapes of. +# @param theShapeType Type of sub-shapes to be retrieved. +# @param theAx1 Vector (or line, or linear edge), specifying normal +# direction of the plane to find shapes on. +# @param thePnt Point specifying location of the plane to find shapes on. +# @param theState The state of the subshapes to find. It can be one of +# ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN. +# @return List of all found sub-shapes. +# +# Example: see GEOM_TestOthers.py +def GetShapesOnPlaneWithLocation(theShape, theShapeType, theAx1, thePnt, theState): + aList = ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType, theAx1, thePnt, theState) + if ShapesOp.IsDone() == 0: + print "GetShapesOnPlaneWithLocation : ", ShapesOp.GetErrorCode() + return aList + +## Works like the above method, but returns list of sub-shapes indices +# +# Example: see GEOM_TestOthers.py +def GetShapesOnPlaneWithLocationIDs(theShape, theShapeType, theAx1, thePnt, theState): + aList = ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType, theAx1, thePnt, theState) + if ShapesOp.IsDone() == 0: + print "GetShapesOnPlaneWithLocationIDs : ", ShapesOp.GetErrorCode() + return aList + ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively # the specified cylinder by the certain way, defined through \a theState parameter. # @param theShape Shape to find sub-shapes of. @@ -954,8 +984,10 @@ def GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState) # the specified quadrangle by the certain way, defined through \a theState parameter. # @param theShape Shape to find sub-shapes of. # @param theShapeType Type of sub-shapes to be retrieved. -# @param theCenter Point, specifying center of the sphere to find shapes on. -# @param theRadius Radius of the sphere to find shapes on. +# @param theTopLeftPoint Point, specifying top left corner of a quadrangle +# @param theTopRigthPoint Point, specifying top right corner of a quadrangle +# @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle +# @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle # @param theState The state of the subshapes to find. It can be one of # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN. # @return List of all found sub-shapes. @@ -1058,7 +1090,7 @@ def SubShapeAllSortedIDs(aShape, aType): ListIDs = ShapesOp.SubShapeAllIDs(aShape,aType,1) if ShapesOp.IsDone() == 0: print "SubShapeAllSortedIDs : ", ShapesOp.GetErrorCode() - return ListObj + return ListIDs ## Obtain a compound of sub-shapes of , # selected by they indices in list of all sub-shapes of type . @@ -1197,6 +1229,23 @@ def DivideEdge(theObject, theEdgeIndex, theValue, isByParameter): print "DivideEdge : ", HealOp.GetErrorCode() return anObj +## Change orientation of the given object. +# @param theObject Shape to be processed. +# @update given shape +def ChangeOrientationShell(theObject): + theObject = HealOp.ChangeOrientation(theObject) + if HealOp.IsDone() == 0: + print "ChangeOrientation : ", HealOp.GetErrorCode() + +## Change orientation of the given object. +# @param theObject Shape to be processed. +# @return New GEOM_Object, containing processed shape. +def ChangeOrientationShellCopy(theObject): + anObj = HealOp.ChangeOrientationCopy(theObject) + if HealOp.IsDone() == 0: + print "ChangeOrientation : ", HealOp.GetErrorCode() + return anObj + ## Get a list of wires (wrapped in GEOM_Object-s), # that constitute a free boundary of the given shape. # @param theObject Shape to get free boundary of. @@ -1449,8 +1498,16 @@ def MakeMirrorByPoint(theObject, thePoint): print "MirrorPointCopy : ", TrsfOp.GetErrorCode() return anObj -## Modify the Location of the given object by LCS -# creating its copy before the setting +## Modify the Location of the given object by LCS, +# creating its copy before the setting. +# @param theObject The object to be displaced. +# @param theStartLCS Coordinate system to perform displacement from it. +# If \a theStartLCS is NULL, displacement +# will be performed from global CS. +# If \a theObject itself is used as \a theStartLCS, +# its location will be changed to \a theEndLCS. +# @param theEndLCS Coordinate system to perform displacement to it. +# @return New GEOM_Object, containing the displaced shape. # # Example: see GEOM_TestAll.py def MakePosition(theObject, theStartLCS, theEndLCS): @@ -1775,12 +1832,18 @@ def MakeCDG(theShape): ## Check a topology of the given shape. # @param theShape Shape to check validity of. -# @return TRUE, if the shape "seems to be valid" from the topological point of view. +# @param theIsCheckGeom If FALSE, only the shape's topology will be checked, +# if TRUE, the shape's geometry will be checked also. +# @return TRUE, if the shape "seems to be valid". # If theShape is invalid, prints a description of problem. # # Example: see GEOM_TestMeasures.py -def CheckShape(theShape): - (IsValid, Status) = MeasuOp.CheckShape(theShape) +def CheckShape(theShape, theIsCheckGeom = 0): + if theIsCheckGeom: + (IsValid, Status) = MeasuOp.CheckShapeWithGeometry(theShape) + else: + (IsValid, Status) = MeasuOp.CheckShape(theShape) + if MeasuOp.IsDone() == 0: print "CheckShape : ", MeasuOp.GetErrorCode() else: @@ -1788,6 +1851,25 @@ def CheckShape(theShape): print Status return IsValid +## Get position (LCS) of theShape. +# +# Origin of the LCS is situated at the shape's center of mass. +# Axes of the LCS are obtained from shape's location or, +# if the shape is a planar face, from position of its plane. +# +# @param theShape Shape to calculate position of. +# @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz]. +# Ox,Oy,Oz: Coordinates of shape's LCS origin. +# Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction. +# Xx,Xy,Xz: Coordinates of shape's LCS X direction. +# +# Example: see GEOM_TestMeasures.py +def GetPosition(theShape): + aTuple = MeasuOp.GetPosition(theShape) + if MeasuOp.IsDone() == 0: + print "GetPosition : ", MeasuOp.GetErrorCode() + return aTuple + # ----------------------------------------------------------------------------- # Import/Export objects # ----------------------------------------------------------------------------- @@ -2039,7 +2121,8 @@ def CheckCompoundOfBlocks(theCompound): return IsValid ## Remove all seam and degenerated edges from \a theShape. -# Unite faces and edges, sharing one surface. +# Unite faces and edges, sharing one surface. It means that +# this faces must have references to one C++ surface object (handle). # @param theShape The compound or single solid to remove irregular edges from. # @return Improved shape. # diff --git a/src/GenerationGUI/GenerationGUI.cxx b/src/GenerationGUI/GenerationGUI.cxx index 6b4bb06c0..85832ed84 100644 --- a/src/GenerationGUI/GenerationGUI.cxx +++ b/src/GenerationGUI/GenerationGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -31,6 +31,8 @@ #include "SUIT_Session.h" #include "SUIT_Desktop.h" +#include "SalomeApp_Application.h" + #include "GenerationGUI_PrismDlg.h" // Method PRISM #include "GenerationGUI_RevolDlg.h" // Method REVOL #include "GenerationGUI_FillingDlg.h" // Method FILLING @@ -38,20 +40,6 @@ using namespace std; -GenerationGUI* GenerationGUI::myGUIObject = 0; - -//======================================================================= -// function : GetGenerationGUI() -// purpose : Get the only GenerationGUI object [ static ] -//======================================================================= -GenerationGUI* GenerationGUI::GetGenerationGUI(GeometryGUI* parent) -{ - if ( myGUIObject == 0 ) - myGUIObject = new GenerationGUI(parent); - - return myGUIObject; -} - //======================================================================= // function : GenerationGUI() // purpose : Constructor @@ -60,7 +48,6 @@ GenerationGUI::GenerationGUI(GeometryGUI* parent) : GEOMGUI(parent) { } - //======================================================================= // function : ~GenerationGUI() // purpose : Destructor @@ -76,23 +63,26 @@ GenerationGUI::~GenerationGUI() //======================================================================= bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) { + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return false; + getGeometryGUI()->EmitSignalDeactivateDialog(); - + QDialog* aDlg = NULL; - switch ( theCommandID ) + switch (theCommandID) { case 4031: aDlg = new GenerationGUI_PrismDlg ( getGeometryGUI(), parent, ""); break; case 4032: aDlg = new GenerationGUI_RevolDlg ( getGeometryGUI(), parent, ""); break; case 4033: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent, ""); break; case 4034: aDlg = new GenerationGUI_PipeDlg ( getGeometryGUI(), parent, ""); break; - default: SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break; + default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break; } - if ( aDlg != NULL ) + if (aDlg != NULL) aDlg->show(); - + return true; } @@ -105,6 +95,6 @@ extern "C" GENERATIONGUI_EXPORT GEOMGUI* GetLibGUI(GeometryGUI* parent) { - return GenerationGUI::GetGenerationGUI(parent); + return new GenerationGUI(parent); } } diff --git a/src/GenerationGUI/GenerationGUI.h b/src/GenerationGUI/GenerationGUI.h index c4c85c3c5..a809bdcf7 100644 --- a/src/GenerationGUI/GenerationGUI.h +++ b/src/GenerationGUI/GenerationGUI.h @@ -17,34 +17,25 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : GenerationGUI.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef GENERATIONGUI_H #define GENERATIONGUI_H #ifdef WNT - #if defined GENERATIONGUI_EXPORTS - #if defined WIN32 - #define GENERATIONGUI_EXPORT __declspec( dllexport ) - #else - #define GENERATIONGUI_EXPORT - #endif - #else - #if defined WIN32 - #define GENERATIONGUI_EXPORT __declspec( dllimport ) - #else - #define GENERATIONGUI_EXPORT - #endif - #endif +# if defined GENERATIONGUI_EXPORTS +# define GENERATIONGUI_EXPORT __declspec( dllexport ) +# else +# define GENERATIONGUI_EXPORT __declspec( dllimport ) +# endif #else - #define GENERATIONGUI_EXPORT +# define GENERATIONGUI_EXPORT #endif #include "GEOMGUI.h" @@ -55,19 +46,11 @@ //================================================================================= class GENERATIONGUI_EXPORT GenerationGUI : public GEOMGUI { -protected: - GenerationGUI(GeometryGUI* parent); // hide constructor to avoid direct creation - -public : +public: + GenerationGUI(GeometryGUI* parent); ~GenerationGUI(); - // Get the only GenerationGUI object - static GenerationGUI* GetGenerationGUI(GeometryGUI* parent); - bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent ); - -private: - static GenerationGUI* myGUIObject; // the only GenerationGUI object }; #endif diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx index 5026f26b3..8939ae5b4 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include "GEOMImpl_Types.hxx" #include @@ -124,10 +123,10 @@ void GenerationGUI_FillingDlg::Init() double SpecificStep1 = 1; double SpecificStep2 = 0.0001; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_1->RangeStepAndValidator(2.0, 999.999, SpecificStep1, 3); + GroupPoints->SpinBox_1->RangeStepAndValidator(2.0, MAX_NUMBER, SpecificStep1, 3); GroupPoints->SpinBox_2->RangeStepAndValidator(0.00001, 10000.0, SpecificStep2, 5); - GroupPoints->SpinBox_3->RangeStepAndValidator(1.0, 999.999, SpecificStep1, 3); - GroupPoints->SpinBox_4->RangeStepAndValidator(1.0, 999.999, SpecificStep1, 3); + GroupPoints->SpinBox_3->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep1, 3); + GroupPoints->SpinBox_4->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep1, 3); GroupPoints->SpinBox_5->RangeStepAndValidator(0.00001, 10000.0, SpecificStep2, 5); GroupPoints->SpinBox_1->SetValue(myMinDeg); diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index a4464d5cc..54e4ad76b 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -57,18 +57,20 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWid { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); + QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM_2P"))); - setCaption(tr("GEOM_PRISM_TITLE")); + setCaption(tr("GEOM_EXTRUSION_TITLE")); /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_PRISM")); + GroupConstructors->setTitle(tr("GEOM_EXTRUSION")); RadioButton1->setPixmap(image0); - RadioButton2->close(TRUE); + RadioButton2->setPixmap(image2); + //RadioButton2->close(TRUE); RadioButton3->close(TRUE); GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints"); GroupPoints->CheckButton1->hide(); - GroupPoints->GroupBox1->setTitle(tr("GEOM_PRISM_BSV")); + GroupPoints->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV")); GroupPoints->TextLabel1->setText(tr("GEOM_BASE")); GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR")); GroupPoints->TextLabel3->setText(tr("GEOM_HEIGHT")); @@ -78,7 +80,17 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWid GroupPoints->LineEdit2->setReadOnly( true ); GroupPoints->CheckButton2->setText(tr("GEOM_REVERSE")); + GroupPoints2 = new DlgRef_3Sel_QTD(this, "GroupPoints2"); + GroupPoints2->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV_2P")); + GroupPoints2->TextLabel1->setText(tr("GEOM_BASE")); + GroupPoints2->TextLabel2->setText(tr("GEOM_POINT_I").arg("1")); + GroupPoints2->TextLabel3->setText(tr("GEOM_POINT_I").arg("2")); + GroupPoints2->PushButton1->setPixmap(image1); + GroupPoints2->PushButton2->setPixmap(image1); + GroupPoints2->PushButton3->setPixmap(image1); + Layout1->addWidget(GroupPoints, 2, 0); + Layout1->addWidget(GroupPoints2, 2, 0); /***************************************************************/ setHelpFileName("extrusion.htm"); @@ -109,20 +121,27 @@ void GenerationGUI_PrismDlg::Init() GroupPoints->LineEdit1->setReadOnly( true ); GroupPoints->LineEdit2->setReadOnly( true ); - myOkBase = myOkVec = false; + GroupPoints2->LineEdit1->setReadOnly( true ); + GroupPoints2->LineEdit2->setReadOnly( true ); + GroupPoints2->LineEdit3->setReadOnly( true ); + + //myOkBase = myOkVec = false; + myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false; /* Get setting of step value from file configuration */ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, +999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupPoints->SpinBox_DX->SetValue(100.0); /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); + connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); @@ -134,12 +153,78 @@ void GenerationGUI_PrismDlg::Init() connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse())); + + connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(GroupPoints2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(GroupPoints2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(GroupPoints2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupPoints2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupPoints2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - initName(tr("GEOM_PRISM")); + initName(tr("GEOM_EXTRUSION")); globalSelection( GEOM_ALLSHAPES ); + ConstructorsClicked(0); +} + + +//================================================================================= +// function : ConstructorsClicked() +// purpose : Radio button management +//================================================================================= +void GenerationGUI_PrismDlg::ConstructorsClicked(int constructorId) +{ + disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); + + switch (constructorId) + { + case 0: + { + globalSelection( GEOM_POINT ); + + GroupPoints2->hide(); + resize(0, 0); + GroupPoints->show(); + + //GroupPoints->LineEdit1->setFocus(); + //myEditCurrentArgument = GroupPoints->LineEdit1; + //displayPreview(); + + myEditCurrentArgument = GroupPoints->LineEdit1; + GroupPoints->LineEdit1->setText(""); + GroupPoints->LineEdit2->setText(""); + GroupPoints2->LineEdit1->setText(""); + GroupPoints2->LineEdit2->setText(""); + GroupPoints2->LineEdit3->setText(""); + myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil(); + myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false; + + break; + } + case 1: + { + GroupPoints->hide(); + resize(0, 0); + GroupPoints2->show(); + + myEditCurrentArgument = GroupPoints2->LineEdit1; + GroupPoints2->LineEdit1->setText(""); + GroupPoints2->LineEdit2->setText(""); + GroupPoints2->LineEdit3->setText(""); + myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil(); + myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false; + GroupPoints->LineEdit1->setText(""); + GroupPoints->LineEdit2->setText(""); + + break; + } + } + displayPreview(); } @@ -176,40 +261,79 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument() { erasePreview(); myEditCurrentArgument->setText(""); - - if (IObjectCount() != 1) { - if (myEditCurrentArgument == GroupPoints->LineEdit1) - myOkBase = false; - else if (myEditCurrentArgument == GroupPoints->LineEdit2) - myOkVec = false; - return; - } - // nbSel == 1 - Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_ptr aSelectedObject = - GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult ); + if ( getConstructorId()==0 ) { + + if (IObjectCount() != 1) { + if (myEditCurrentArgument == GroupPoints->LineEdit1) + myOkBase = false; + else if (myEditCurrentArgument == GroupPoints->LineEdit2) + myOkVec = false; + return; + } - if (!testResult) - return; + // nbSel == 1 + Standard_Boolean testResult = Standard_False; + GEOM::GEOM_Object_ptr aSelectedObject = + GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult ); - if (myEditCurrentArgument == GroupPoints->LineEdit1) { - myOkBase = false; - TopoDS_Shape S; - - if (!GEOMBase::GetShape(aSelectedObject, S) || - S.ShapeType() <= 2) + if (!testResult) return; - myBase = aSelectedObject; - myOkBase = true; - } else if (myEditCurrentArgument == GroupPoints->LineEdit2) { - myVec = aSelectedObject; - myOkVec = true; + if (myEditCurrentArgument == GroupPoints->LineEdit1) { + myBase = aSelectedObject; + myOkBase = true; + } + else if (myEditCurrentArgument == GroupPoints->LineEdit2) { + myVec = aSelectedObject; + myOkVec = true; + } + myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) ); + + displayPreview(); } - myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) ); - displayPreview(); + else { // getConstructorId()==1 - extrusion using 2 points + + if (IObjectCount() != 1) { + if (myEditCurrentArgument == GroupPoints2->LineEdit1) + myOkBase = false; + else if (myEditCurrentArgument == GroupPoints2->LineEdit2) { + myPoint1 = GEOM::GEOM_Object::_nil(); + myOkPnt1 = false; + } + else if (myEditCurrentArgument == GroupPoints2->LineEdit3) { + myPoint2 = GEOM::GEOM_Object::_nil(); + myOkPnt2 = false; + } + return; + } + + // nbSel == 1 + Standard_Boolean testResult = Standard_False; + GEOM::GEOM_Object_var aSelectedObject = + GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult ); + + if (!testResult || CORBA::is_nil( aSelectedObject )) + return; + + if (myEditCurrentArgument == GroupPoints2->LineEdit1) { + myBase = aSelectedObject; + myOkBase = true; + } + else if (myEditCurrentArgument == GroupPoints2->LineEdit2) { + myPoint1 = aSelectedObject; + myOkPnt1 = true; + } + else if (myEditCurrentArgument == GroupPoints2->LineEdit3) { + myPoint2 = aSelectedObject; + myOkPnt2 = true; + } + + myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) ); + + displayPreview(); + } } @@ -231,6 +355,20 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument() myEditCurrentArgument = GroupPoints->LineEdit2; globalSelection( GEOM_LINE ); } + else if(send == GroupPoints2->PushButton1) { + GroupPoints2->LineEdit1->setFocus(); + myEditCurrentArgument = GroupPoints2->LineEdit1; + } + else if(send == GroupPoints2->PushButton2) { + GroupPoints2->LineEdit2->setFocus(); + myEditCurrentArgument = GroupPoints2->LineEdit2; + globalSelection( GEOM_POINT ); + } + else if(send == GroupPoints2->PushButton3) { + GroupPoints2->LineEdit3->setFocus(); + myEditCurrentArgument = GroupPoints2->LineEdit3; + globalSelection( GEOM_POINT ); + } SelectionIntoArgument(); } @@ -243,7 +381,10 @@ void GenerationGUI_PrismDlg::LineEditReturnPressed() { QLineEdit* send = (QLineEdit*)sender(); if(send == GroupPoints->LineEdit1 || - send == GroupPoints->LineEdit2) + send == GroupPoints->LineEdit2 || + send == GroupPoints2->LineEdit1 || + send == GroupPoints2->LineEdit2 || + send == GroupPoints2->LineEdit3 ) { myEditCurrentArgument = send; GEOMBase_Skeleton::LineEditReturnPressed(); @@ -271,9 +412,10 @@ void GenerationGUI_PrismDlg::ActivateThisDialog() globalSelection( GEOM_ALLSHAPES ); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - GroupPoints->LineEdit1->setFocus(); - myEditCurrentArgument = GroupPoints->LineEdit1; - displayPreview(); + //GroupPoints->LineEdit1->setFocus(); + //myEditCurrentArgument = GroupPoints->LineEdit1; + //displayPreview(); + ConstructorsClicked( getConstructorId() ); } @@ -311,7 +453,7 @@ GEOM::GEOM_IOperations_ptr GenerationGUI_PrismDlg::createOperation() //================================================================================= bool GenerationGUI_PrismDlg::isValid( QString& ) { - return myOkBase && myOkVec; + return myOkBase && ( myOkVec || (myOkPnt1 && myOkPnt2) ); } //================================================================================= @@ -322,9 +464,21 @@ bool GenerationGUI_PrismDlg::execute( ObjectList& objects ) { GEOM::GEOM_Object_var anObj; - anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> - MakePrismVecH(myBase, myVec, getHeight()); - + switch ( getConstructorId() ) + { + case 0 : + { + anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> + MakePrismVecH(myBase, myVec, getHeight()); + break; + } + case 1 : + { + anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> + MakePrismTwoPnt(myBase, myPoint1, myPoint2); + break; + } + } if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() ); diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.h b/src/GenerationGUI/GenerationGUI_PrismDlg.h index ce0cced89..2c106080c 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.h +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.h @@ -32,6 +32,7 @@ #include "GEOMBase_Skeleton.h" #include "DlgRef_2Sel1Spin2Check.h" +#include "DlgRef_3Sel_QTD.h" //================================================================================= // class : GenerationGUI_PrismDlg @@ -59,11 +60,15 @@ private : GEOM::GEOM_Object_var myBase; /* Base shape */ GEOM::GEOM_Object_var myVec; /* Vector, defining the direction */ - + GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points for extrusion */ + bool myOkBase; bool myOkVec; + bool myOkPnt1; + bool myOkPnt2; DlgRef_2Sel1Spin2Check* GroupPoints; + DlgRef_3Sel_QTD* GroupPoints2; // for second layout for extrusion using 2 points private slots: void ClickOnOk(); @@ -72,6 +77,7 @@ private slots: void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); + void ConstructorsClicked(int); void ValueChangedInSpinBox(); void onReverse(); }; diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx index 8ef0d44e6..e8a6608ad 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include "GEOMImpl_Types.hxx" #include @@ -115,7 +114,7 @@ void GenerationGUI_RevolDlg::Init() double SpecificStep = 5; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, SpecificStep, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3); GroupPoints->SpinBox_DX->SetValue(45.0); /* signals and slots connections */ diff --git a/src/GroupGUI/GroupGUI.cxx b/src/GroupGUI/GroupGUI.cxx index fc0ebafe3..e335605c6 100644 --- a/src/GroupGUI/GroupGUI.cxx +++ b/src/GroupGUI/GroupGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -38,20 +38,6 @@ #include "SalomeApp_Study.h" #include "LightApp_SelectionMgr.h" -GroupGUI* GroupGUI::myGUIObject = 0; - -//======================================================================= -// function : GetGroupGUI() -// purpose : Get the only GroupGUI object [ static ] -//======================================================================= -GroupGUI* GroupGUI::GetGroupGUI(GeometryGUI* parent) -{ - if ( myGUIObject == 0 ) - myGUIObject = new GroupGUI(parent); - - return myGUIObject; -} - //======================================================================= // function : GroupGUI() // purpose : Constructor @@ -76,12 +62,14 @@ GroupGUI::~GroupGUI() //======================================================================= bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) { + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return false; + getGeometryGUI()->EmitSignalDeactivateDialog(); QDialog* aDlg = NULL; - SUIT_Application* suitApp = SUIT_Session::session()->activeApplication(); - SalomeApp_Study* appStudy = dynamic_cast(suitApp->activeStudy()); + SalomeApp_Study* appStudy = dynamic_cast(app->activeStudy()); if ( !appStudy ) return false; _PTR(Study) aStudy = appStudy->studyDS(); @@ -103,12 +91,9 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) SALOME_ListIO aList; aList.Clear(); - SalomeApp_Application* app = dynamic_cast(suitApp); - if (app) { - LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); - if (aSelMgr) - aSelMgr->selectedObjects(aList); - } + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); + if (aSelMgr) + aSelMgr->selectedObjects(aList); if (aList.Extent() == 1) { Standard_Boolean aResult = Standard_False; @@ -124,7 +109,7 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) break; } default: - suitApp->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; } @@ -144,6 +129,6 @@ extern "C" #endif GEOMGUI* GetLibGUI(GeometryGUI* p) { - return GroupGUI::GetGroupGUI(p); + return new GroupGUI(p); } } diff --git a/src/GroupGUI/GroupGUI.h b/src/GroupGUI/GroupGUI.h index a699547ff..71bac9677 100644 --- a/src/GroupGUI/GroupGUI.h +++ b/src/GroupGUI/GroupGUI.h @@ -17,14 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : GroupGUI.h // Author : Sergey ANIKIN // Module : GEOM -// $Header$ #ifndef GROUPGUI_H #define GROUPGUI_H @@ -39,19 +38,11 @@ class GroupGUI : public GEOMGUI { Q_OBJECT -protected: - GroupGUI(GeometryGUI* parent); // hide constructor to avoid direct creation - -public : +public: + GroupGUI(GeometryGUI* parent); ~GroupGUI(); - // Get the only GroupGUI object - static GroupGUI* GetGroupGUI(GeometryGUI* parent); - bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent ); - -private: - static GroupGUI* myGUIObject; // the only GroupGUI object }; #endif diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index cf55174ca..2016cbd34 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -217,6 +217,8 @@ bool GroupGUI_GroupDlg::ClickOnApply() initName(); myIdList->clear(); } + else + activateSelection(); return true; } diff --git a/src/MeasureGUI/MeasureGUI.cxx b/src/MeasureGUI/MeasureGUI.cxx index 7a07965d1..3458594d3 100644 --- a/src/MeasureGUI/MeasureGUI.cxx +++ b/src/MeasureGUI/MeasureGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -31,6 +31,7 @@ #include "SUIT_Session.h" #include "SalomeApp_Tools.h" +#include "SalomeApp_Application.h" #include "MeasureGUI_PropertiesDlg.h" // Method PROPERTIES #include "MeasureGUI_CenterMassDlg.h" // Method CENTER MASS @@ -43,21 +44,6 @@ #include "MeasureGUI_CheckCompoundOfBlocksDlg.h" // Method CHECKCOMPOUND #include "MeasureGUI_PointDlg.h" // Method POINTCOORDINATES -MeasureGUI* MeasureGUI::myGUIObject = 0; - -//======================================================================= -// function : GetMeasureGUI() -// purpose : Get the only MeasureGUI object [ static ] -//======================================================================= -MeasureGUI* MeasureGUI::GetMeasureGUI( GeometryGUI* parent ) -{ - if ( myGUIObject == 0 ) { - // init MeasureGUI only once - myGUIObject = new MeasureGUI( parent ); - } - return myGUIObject; -} - //======================================================================= // function : MeasureGUI() // purpose : Constructor @@ -66,7 +52,6 @@ MeasureGUI::MeasureGUI( GeometryGUI* parent ) : GEOMGUI( parent ) { } - //======================================================================= // function : ~MeasureGUI() // purpose : Destructor @@ -82,7 +67,9 @@ MeasureGUI::~MeasureGUI() //======================================================================= bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) { - MeasureGUI* myMeasureGUI = GetMeasureGUI( getGeometryGUI() ); + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return false; + getGeometryGUI()->EmitSignalDeactivateDialog(); switch ( theCommandID ) @@ -99,7 +86,7 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) case 708 : new MeasureGUI_PointDlg (getGeometryGUI(), parent); break; // POINT COORDINATES default: - SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); + app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break; } return true; @@ -114,6 +101,6 @@ extern "C" GEOM_MEASUREGUI_EXPORT GEOMGUI* GetLibGUI( GeometryGUI* parent ) { - return MeasureGUI::GetMeasureGUI( parent ); + return new MeasureGUI( parent ); } } diff --git a/src/MeasureGUI/MeasureGUI.h b/src/MeasureGUI/MeasureGUI.h index b312c9e91..295c3a742 100644 --- a/src/MeasureGUI/MeasureGUI.h +++ b/src/MeasureGUI/MeasureGUI.h @@ -17,14 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : MeasureGUI.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef MEASUREGUI_H #define MEASUREGUI_H @@ -39,16 +38,11 @@ //================================================================================= class GEOM_MEASUREGUI_EXPORT MeasureGUI : public GEOMGUI { -protected: - MeasureGUI( GeometryGUI* parent ); +public: + MeasureGUI( GeometryGUI* parent ); + ~MeasureGUI(); -public : - ~MeasureGUI(); - static MeasureGUI* GetMeasureGUI( GeometryGUI* parent ); - bool OnGUIEvent( int , SUIT_Desktop* ); - -private: - static MeasureGUI* myGUIObject; + bool OnGUIEvent( int , SUIT_Desktop* ); }; #endif diff --git a/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx index 848e9ff86..795107a57 100644 --- a/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -27,7 +27,6 @@ // $Header$ #include "MeasureGUI_CheckShapeDlg.h" -#include "MeasureGUI_1Sel1TextView_QTD.h" #include "utilities.h" #include "SUIT_Session.h" @@ -40,10 +39,27 @@ #include #include #include +#include #define TEXTEDIT_FONT_FAMILY "Courier" #define TEXTEDIT_FONT_SIZE 11 +MeasureGUI_1Sel1TextView1Check_QTD::MeasureGUI_1Sel1TextView1Check_QTD(QWidget* parent, + const char* name, WFlags fl) + : MeasureGUI_1Sel1TextView_QTD(parent, name, fl) +{ + CheckBoxGeom = new QCheckBox(GroupBox1, "CheckBoxGeom"); + CheckBoxGeom->setText(tr("CHECK_SHAPE_GEOMETRY")); + Layout1->addMultiCellWidget(CheckBoxGeom, 2, 2, 0, 2); + + CheckBoxGeom->setChecked(false); +} + +MeasureGUI_1Sel1TextView1Check_QTD::~MeasureGUI_1Sel1TextView1Check_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + //================================================================================= // class : MeasureGUI_CheckShapeDlg() // purpose : Constructs a MeasureGUI_CheckShapeDlg which is a child of 'parent', with the @@ -66,11 +82,11 @@ MeasureGUI_CheckShapeDlg::MeasureGUI_CheckShapeDlg( GeometryGUI* GUI, QWidget* p GroupConstructors->setTitle( tr( "GEOM_CHECK_SHAPE" ) ); RadioButton1->setPixmap( image0 ); - myGrp = new MeasureGUI_1Sel1TextView_QTD( this, "myGrp" ); + myGrp = new MeasureGUI_1Sel1TextView1Check_QTD( this, "myGrp" ); myGrp->GroupBox1->setTitle( tr( "GEOM_CHECK_INFOS" ) ); myGrp->TextLabel1->setText( tr( "GEOM_OBJECT" ) ); myGrp->TextEdit1->setReadOnly( TRUE ); - + QFont aFont( TEXTEDIT_FONT_FAMILY, TEXTEDIT_FONT_SIZE ); aFont.setStyleHint( QFont::TypeWriter, QFont::PreferAntialias ); myGrp->TextEdit1->setFont( aFont ); @@ -87,7 +103,6 @@ MeasureGUI_CheckShapeDlg::MeasureGUI_CheckShapeDlg( GeometryGUI* GUI, QWidget* p Init(); } - //================================================================================= // function : ~MeasureGUI_CheckShapeDlg() // purpose : Destroys the object and frees any allocated resources @@ -106,6 +121,9 @@ void MeasureGUI_CheckShapeDlg::Init() mySelBtn = myGrp->PushButton1; mySelEdit = myGrp->LineEdit1; MeasureGUI_Skeleton::Init(); + + connect(myGrp->CheckBoxGeom, SIGNAL(toggled(bool)), + this, SLOT(SelectionIntoArgument())); } //================================================================================= @@ -121,7 +139,13 @@ bool MeasureGUI_CheckShapeDlg::getParameters ( bool& theIsValid, QString& theMsg try { char* aMsg; - theIsValid = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->CheckShape( myObj, aMsg ); + bool isCheckGeometry = myGrp->CheckBoxGeom->isChecked(); + GEOM::GEOM_IMeasureOperations_ptr aMeasureOp = + GEOM::GEOM_IMeasureOperations::_narrow( getOperation() ); + if (isCheckGeometry) + theIsValid = aMeasureOp->CheckShapeWithGeometry(myObj, aMsg); + else + theIsValid = aMeasureOp->CheckShape(myObj, aMsg); theMsg = aMsg; } catch( const SALOME::SALOME_Exception& e ) diff --git a/src/MeasureGUI/MeasureGUI_CheckShapeDlg.h b/src/MeasureGUI/MeasureGUI_CheckShapeDlg.h index 6cba00c64..ba89aff2b 100644 --- a/src/MeasureGUI/MeasureGUI_CheckShapeDlg.h +++ b/src/MeasureGUI/MeasureGUI_CheckShapeDlg.h @@ -17,14 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : MeasureGUI_CheckShapeDlg.h // Author : Nicolas REJNERI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_CHECKSHAPEDLG_H #define DIALOGBOX_CHECKSHAPEDLG_H @@ -32,8 +31,24 @@ #include "GEOM_MeasureGUI.hxx" #include "MeasureGUI_Skeleton.h" +#include "MeasureGUI_1Sel1TextView_QTD.h" -class MeasureGUI_1Sel1TextView_QTD; +class QCheckBox; + +//================================================================================= +// class : MeasureGUI_1Sel1TextView1Check_QTD +// purpose : +//================================================================================= +class MeasureGUI_1Sel1TextView1Check_QTD : public MeasureGUI_1Sel1TextView_QTD +{ + Q_OBJECT + +public: + MeasureGUI_1Sel1TextView1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~MeasureGUI_1Sel1TextView1Check_QTD(); + + QCheckBox* CheckBoxGeom; +}; //================================================================================= // class : MeasureGUI_CheckShapeDlg @@ -44,24 +59,19 @@ class GEOM_MEASUREGUI_EXPORT MeasureGUI_CheckShapeDlg : public MeasureGUI_Skelet Q_OBJECT public: - MeasureGUI_CheckShapeDlg( GeometryGUI* GUI, - QWidget* parent ); - ~MeasureGUI_CheckShapeDlg(); -protected: + MeasureGUI_CheckShapeDlg(GeometryGUI* GUI, QWidget* parent); + ~MeasureGUI_CheckShapeDlg(); +protected: // redefined from GEOMBase_Helper and MeasureGUI_Skeleton - virtual void processObject(); + virtual void processObject(); private: - - void Init(); - bool getParameters( bool& theIsValid, - QString& theMsg); + void Init(); + bool getParameters(bool& theIsValid, QString& theMsg); private: - - MeasureGUI_1Sel1TextView_QTD* myGrp; - + MeasureGUI_1Sel1TextView1Check_QTD* myGrp; }; #endif // DIALOGBOX_CHECKSHAPEDLG_H diff --git a/src/MeasureGUI/MeasureGUI_Skeleton.cxx b/src/MeasureGUI/MeasureGUI_Skeleton.cxx index f2da1161d..ef4d92e8b 100644 --- a/src/MeasureGUI/MeasureGUI_Skeleton.cxx +++ b/src/MeasureGUI/MeasureGUI_Skeleton.cxx @@ -371,3 +371,19 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_Skeleton::createOperation() return getGeomEngine()->GetIMeasureOperations( getStudyId() ); } +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void MeasureGUI_Skeleton::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Key_F1 ) + { + e->accept(); + ClickOnHelp(); + } +} diff --git a/src/MeasureGUI/MeasureGUI_Skeleton.h b/src/MeasureGUI/MeasureGUI_Skeleton.h index 77c5d18f5..79d5ade21 100644 --- a/src/MeasureGUI/MeasureGUI_Skeleton.h +++ b/src/MeasureGUI/MeasureGUI_Skeleton.h @@ -68,6 +68,7 @@ protected: void enterEvent( QEvent* e ); void closeEvent( QCloseEvent* e ); + void keyPressEvent( QKeyEvent* e ); void redisplayPreview(); GEOM_Displayer* getDisplayer(); diff --git a/src/NMTAlgo/NMTAlgo_Splitter.cxx b/src/NMTAlgo/NMTAlgo_Splitter.cxx index 268da634a..a92245346 100644 --- a/src/NMTAlgo/NMTAlgo_Splitter.cxx +++ b/src/NMTAlgo/NMTAlgo_Splitter.cxx @@ -309,12 +309,18 @@ static return; } // - if (!mySourceShapes.Extent()){ + if (!mySourceShapes.Extent()) { // No source shapes to treat myErrorStatus=103; return; } // + if (!aDSF.IsDone()) { + // NMTTools_DSFiller failed + myErrorStatus=104; + return; + } + // NMTAlgo_Builder::ComputeWithFiller(aDSF); // myIsComputed=Standard_True; @@ -622,3 +628,4 @@ static // 101 - Null shape is not allowed here // 102 - DS is not computed // 103 - No source shapes to treat +// 104 - NMTTools_DSFiller failed diff --git a/src/NMTTools/NMTTools_DEProcessor.cxx b/src/NMTTools/NMTTools_DEProcessor.cxx index 6762a1dd3..b394de328 100644 --- a/src/NMTTools/NMTTools_DEProcessor.cxx +++ b/src/NMTTools/NMTTools_DEProcessor.cxx @@ -137,14 +137,14 @@ aNb=myDS->NumberOfShapesOfTheObject(); // for (i=1; i<=aNb; i++) { - const TopoDS_Shape& aF=myDS->Shape(i); + const TopoDS_Shape aF=myDS->Shape(i); if (aF.ShapeType()==TopAbs_FACE) { TopExp::MapShapesAndAncestors (aF, TopAbs_EDGE, TopAbs_FACE, aMEF); } } // for (i=1; i<=aNb; i++) { - const TopoDS_Shape& aS=myDS->Shape(i); + const TopoDS_Shape aS=myDS->Shape(i); if (aS.ShapeType()==TopAbs_EDGE) { const TopoDS_Edge& aE=TopoDS::Edge(aS); @@ -306,8 +306,8 @@ // Clear aPaveSet, aSplitEdges aPaveSet.ChangeSet().Clear(); // - const TopoDS_Edge& aDE=TopoDS::Edge(myDS->Shape(nED)); - const TopoDS_Face& aDF=TopoDS::Face(myDS->Shape(nFD)); + const TopoDS_Edge aDE=TopoDS::Edge(myDS->Shape(nED)); + const TopoDS_Face aDF=TopoDS::Face(myDS->Shape(nFD)); // // 2D Curve of degenerated edge on the face aDF Handle(Geom2d_Curve) aC2DDE=BRep_Tool::CurveOnSurface(aDE, aDF, aTD1, aTD2); @@ -333,7 +333,7 @@ for (; anIt.More(); anIt.Next()) { const BOPTools_PaveBlock& aPB=anIt.Value(); nE=aPB.Edge(); - const TopoDS_Edge& aE=TopoDS::Edge(myDS->Shape(nE)); + const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE)); Handle(Geom2d_Curve) aC2D=BRep_Tool::CurveOnSurface(aE, aDF, aT1, aT2); // @@ -427,8 +427,8 @@ TopoDS_Edge aE, aESplit; TopoDS_Vertex aV1, aV2; - const TopoDS_Edge& aDE=TopoDS::Edge(myDS->Shape(nED)); - const TopoDS_Face& aDF=TopoDS::Face(myDS->Shape(nFD)); + const TopoDS_Edge aDE=TopoDS::Edge(myDS->Shape(nED)); + const TopoDS_Face aDF=TopoDS::Face(myDS->Shape(nFD)); BOPTools_ListIteratorOfListOfPaveBlock aPBIt(aSplitEdges); diff --git a/src/NMTTools/NMTTools_PaveFiller.cxx b/src/NMTTools/NMTTools_PaveFiller.cxx index cfbd9d0f7..c3a4f9695 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cxx +++ b/src/NMTTools/NMTTools_PaveFiller.cxx @@ -224,8 +224,10 @@ NMTTools_DEProcessor aDEP(*this); aDEP.Do(); // + myIsDone = Standard_True; } catch (BOPTColStd_Failure& /*x*/) { //QQ MESSAGE(x.Message() << flush); + myIsDone = Standard_False; } } diff --git a/src/NMTTools/NMTTools_PaveFiller_1.cxx b/src/NMTTools/NMTTools_PaveFiller_1.cxx index 57c923e77..448804477 100644 --- a/src/NMTTools/NMTTools_PaveFiller_1.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_1.cxx @@ -78,8 +78,8 @@ aWith=n2; SortTypes(aWhat, aWith); if (!bJustAddInterference) { - const TopoDS_Shape& aS1=myDS->GetShape(aWhat); - const TopoDS_Shape& aS2=myDS->GetShape(aWith); + const TopoDS_Shape aS1=myDS->GetShape(aWhat); + const TopoDS_Shape aS2=myDS->GetShape(aWith); // const TopoDS_Vertex& aV1=TopoDS::Vertex(aS1); const TopoDS_Vertex& aV2=TopoDS::Vertex(aS2); @@ -127,7 +127,7 @@ aNbV=aChain.Extent(); for (j=1; j<=aNbV; ++j) { aIdV=aChain(j); - const TopoDS_Shape& aV=myDS->Shape(aIdV); + const TopoDS_Shape aV=myDS->Shape(aIdV); if (!aM.Contains(aV)) { aM.Add(aV); aLV.Append(aV); diff --git a/src/NMTTools/NMTTools_PaveFiller_4.cxx b/src/NMTTools/NMTTools_PaveFiller_4.cxx index 33f178c92..fb8123077 100644 --- a/src/NMTTools/NMTTools_PaveFiller_4.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_4.cxx @@ -145,8 +145,8 @@ static continue; } // - const TopoDS_Edge& aE1=TopoDS::Edge(myDS->Shape(nE1)); - const TopoDS_Edge& aE2=TopoDS::Edge(myDS->Shape(nE2)); + const TopoDS_Edge aE1=TopoDS::Edge(myDS->Shape(nE1)); + const TopoDS_Edge aE2=TopoDS::Edge(myDS->Shape(nE2)); // if (BRep_Tool::Degenerated(aE1) || BRep_Tool::Degenerated(aE2)){ continue; @@ -468,7 +468,7 @@ static aNbEdges=aME.Extent(); for (j=1; j<=aNbEdges; ++j) { nE=aME(j); - const TopoDS_Edge& aE=TopoDS::Edge(myDS->Shape(nE)); + const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE)); // aFlag=myContext.ComputeVE (aNewVertex, aE, aT); // @@ -775,10 +775,10 @@ static Standard_Real d1121, d1122, d1222, d1221, aTolSum, aCoeff=1.05; gp_Pnt aP11, aP12, aP21, aP22; - const TopoDS_Vertex& aV11=TopoDS::Vertex(myDS->Shape(aPB1.Pave1().Index())); - const TopoDS_Vertex& aV12=TopoDS::Vertex(myDS->Shape(aPB1.Pave2().Index())); - const TopoDS_Vertex& aV21=TopoDS::Vertex(myDS->Shape(aPB2.Pave1().Index())); - const TopoDS_Vertex& aV22=TopoDS::Vertex(myDS->Shape(aPB2.Pave2().Index())); + const TopoDS_Vertex aV11=TopoDS::Vertex(myDS->Shape(aPB1.Pave1().Index())); + const TopoDS_Vertex aV12=TopoDS::Vertex(myDS->Shape(aPB1.Pave2().Index())); + const TopoDS_Vertex aV21=TopoDS::Vertex(myDS->Shape(aPB2.Pave1().Index())); + const TopoDS_Vertex aV22=TopoDS::Vertex(myDS->Shape(aPB2.Pave2().Index())); aTolV11=BRep_Tool::Tolerance(aV11); aTolV12=BRep_Tool::Tolerance(aV12); diff --git a/src/NMTTools/NMTTools_PaveFiller_5.cxx b/src/NMTTools/NMTTools_PaveFiller_5.cxx index db8930c00..a29f760ab 100644 --- a/src/NMTTools/NMTTools_PaveFiller_5.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_5.cxx @@ -138,13 +138,13 @@ static continue; } // Edge - const TopoDS_Edge& aE=TopoDS::Edge(myDS->GetShape(nE)); + const TopoDS_Edge aE=TopoDS::Edge(myDS->GetShape(nE)); if (BRep_Tool::Degenerated(aE)){ continue; } aTolE=BRep_Tool::Tolerance(aE); // Face - const TopoDS_Face& aF=TopoDS::Face(myDS->GetShape(nF)); + const TopoDS_Face aF=TopoDS::Face(myDS->GetShape(nF)); aTolF=BRep_Tool::Tolerance(aF); const Bnd_Box& aBBF=myDS->GetBoundingBox(nF); // @@ -492,7 +492,7 @@ static aNbEdges=aME.Extent(); for (j=1; j<=aNbEdges; ++j) { nE=aME(j); - const TopoDS_Edge& aE=TopoDS::Edge(myDS->Shape(nE)); + const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE)); // aFlag=myContext.ComputeVE (aNewVertex, aE, aT); // @@ -575,7 +575,7 @@ static aNbV=aMVF.Extent(); for (i=1; i<=aNbV; ++i) { nVF=aMVF(i); - const TopoDS_Vertex& aVF=TopoDS::Vertex(myDS->Shape(nVF)); + const TopoDS_Vertex aVF=TopoDS::Vertex(myDS->Shape(nVF)); iFlag=IntTools_Tools::ComputeVV(aNewVertex, aVF); if (!iFlag) { return nVF; diff --git a/src/NMTTools/NMTTools_PaveFiller_6.cxx b/src/NMTTools/NMTTools_PaveFiller_6.cxx index 8c4852a4b..3ad988b62 100644 --- a/src/NMTTools/NMTTools_PaveFiller_6.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_6.cxx @@ -165,8 +165,8 @@ static continue; } // - const TopoDS_Face& aF1=TopoDS::Face(myDS->Shape(nF1)); - const TopoDS_Face& aF2=TopoDS::Face(myDS->Shape(nF2)); + const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1)); + const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2)); // // FF bToApproxC3d = mySectionAttribute.Approximation(); @@ -254,8 +254,8 @@ static // // Faces aFFi.Indices(nF1, nF2); - const TopoDS_Face& aF1=TopoDS::Face(myDS->Shape(nF1)); - const TopoDS_Face& aF2=TopoDS::Face(myDS->Shape(nF2)); + const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1)); + const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2)); // BOPTools_ListOfPaveBlock aLPB, aLPBC; // @@ -377,8 +377,8 @@ static // Make Section Edge TopoDS_Edge aES; // - const TopoDS_Vertex& aV1=TopoDS::Vertex(myDS->Shape(nV1)); - const TopoDS_Vertex& aV2=TopoDS::Vertex(myDS->Shape(nV2)); + const TopoDS_Vertex aV1=TopoDS::Vertex(myDS->Shape(nV1)); + const TopoDS_Vertex aV2=TopoDS::Vertex(myDS->Shape(nV2)); // BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES); // @@ -489,13 +489,13 @@ static for (j=1; j<=aNbSE; ++j) { const BOPTools_PaveBlock& aPBSE=aMEPB(j); nV1=aPBSE.Pave1().Index(); - const TopoDS_Shape& aV1=myDS->Shape(nV1); + const TopoDS_Shape aV1=myDS->Shape(nV1); if (aV1.IsSame(aV)) { aMNewOld.Add(i, nV1); break; } nV2=aPBSE.Pave2().Index(); - const TopoDS_Shape& aV2=myDS->Shape(nV2); + const TopoDS_Shape aV2=myDS->Shape(nV2); if (aV2.IsSame(aV)) { aMNewOld.Add(i, nV2); break; @@ -546,9 +546,9 @@ static BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq; // nV1=aPBSE.Pave1().Index(); - const TopoDS_Shape& aV1=myDS->Shape(nV1); + const TopoDS_Shape aV1=myDS->Shape(nV1); nV2=aPBSE.Pave2().Index(); - const TopoDS_Shape& aV2=myDS->Shape(nV2); + const TopoDS_Shape aV2=myDS->Shape(nV2); // anASSeq.SetNewSuccessor(nV1); anASSeq.SetNewOrientation(aV1.Orientation()); @@ -580,8 +580,8 @@ static BOPTools_PaveBlock aPB=aIt.Value(); // ////modified by NIZNHY-PKV Thu Jan 26 10:16:36 2006f - const TopoDS_Face& aF1=TopoDS::Face(myDS->Shape(nF1)); - const TopoDS_Face& aF2=TopoDS::Face(myDS->Shape(nF2)); + const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1)); + const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2)); ////modified by NIZNHY-PKV Thu Jan 26 10:16:39 2006t // if (aCBAPI.IsCommonBlock(aPB)) { @@ -617,13 +617,13 @@ static aT1=aPave1.Param(); mV1=aPave1.Index(); // index in tDS nV1=aMNewOld.FindFromKey(mV1); // index in myDS - const TopoDS_Shape& aV1=myDS->Shape(nV1); + const TopoDS_Shape aV1=myDS->Shape(nV1); // const BOPTools_Pave& aPave2=aPB.Pave2(); aT2=aPave2.Param(); mV2=aPave2.Index(); nV2=aMNewOld.FindFromKey(mV2); - const TopoDS_Shape& aV2=myDS->Shape(nV2); + const TopoDS_Shape aV2=myDS->Shape(nV2); // if (!aMNewOld.Contains(mE)) { // add new SE to the myDS @@ -684,8 +684,8 @@ static BOPTools_SSInterference& aFF=aFFs(i); aFF.Indices(nF1, nF2); // - const TopoDS_Face& aF1=TopoDS::Face(myDS->Shape(nF1)); - const TopoDS_Face& aF2=TopoDS::Face(myDS->Shape(nF2)); + const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1)); + const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2)); // aF1FWD=aF1; aF1FWD.Orientation(TopAbs_FORWARD); @@ -699,7 +699,7 @@ static for (; anIt.More(); anIt.Next()) { const BOPTools_PaveBlock& aPB=anIt.Value(); nE=aPB.Edge(); - const TopoDS_Edge& aE=TopoDS::Edge(myDS->Shape(nE)); + const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE)); BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD); BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD); @@ -768,7 +768,7 @@ static // //Edge nE2=aPBR.Edge(); - const TopoDS_Edge& aE2=TopoDS::Edge(myDS->GetShape(nE2)); + const TopoDS_Edge aE2=TopoDS::Edge(myDS->GetShape(nE2)); // VE iVM=myContext.ComputeVE(aVM, aE2, aTmp); // @@ -799,8 +799,8 @@ static aFFi.Indices(nF1, nF2); aTolR3D=aFFi.TolR3D(); // - const TopoDS_Face& aF1=TopoDS::Face(myDS->GetShape(nF1)); - const TopoDS_Face& aF2=TopoDS::Face(myDS->GetShape(nF2)); + const TopoDS_Face aF1=TopoDS::Face(myDS->GetShape(nF1)); + const TopoDS_Face aF2=TopoDS::Face(myDS->GetShape(nF2)); // bVF=myContext.IsValidPointForFaces (aP1, aF1, aF2, aTolR3D); if (bVF) { @@ -850,14 +850,13 @@ static TColStd_ListOfInteger& aTVs=aBC.TechnoVertices(); aTVs.Append(nV); } - if (bFound1 && !bFound2) { nV=aPave1.Index(); aPave.SetIndex(nV); aPave.SetParam(aT); aFFiPS.Append(aPave); // - const TopoDS_Vertex& aV=TopoDS::Vertex(myDS->Shape(nV)); + const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV)); BOPTools_Tools::UpdateVertex (aIC, aT, aV); } @@ -867,7 +866,7 @@ static aPave.SetParam(aT); aCPS.Append(aPave); // - const TopoDS_Vertex& aV=TopoDS::Vertex(myDS->Shape(nV)); + const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV)); BOPTools_Tools::UpdateVertex (aIC, aT, aV); } } @@ -888,7 +887,7 @@ static for (; anIt.More(); anIt.Next()) { const BOPTools_Pave& aPC=anIt.Value(); nV=aPC.Index(); - const TopoDS_Vertex& aV=TopoDS::Vertex(myDS->Shape(nV)); + const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV)); bIsVertex=IntTools_Tools::IsVertex (aP, aTolPV, aV); if (bIsVertex) { aPave=aPC; @@ -974,7 +973,7 @@ static const BOPTools_Pave& aPave=anIt.Value(); // nV=aPave.Index(); - const TopoDS_Vertex& aV=TopoDS::Vertex(myDS->Shape(nV)); + const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV)); // Bnd_Box aBBV; BRepBndLib::Add(aV, aBBV); diff --git a/src/NMTTools/NMTTools_PaveFiller_7.cxx b/src/NMTTools/NMTTools_PaveFiller_7.cxx index 50d899ad9..3c9d4f7ac 100644 --- a/src/NMTTools/NMTTools_PaveFiller_7.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_7.cxx @@ -236,7 +236,7 @@ for(i=1; i<=aNbF; ++i) { nF=aMF(i); iRankF=myDS->Rank(nF); - const TopoDS_Shape& aF=myDS->Shape(nF); + const TopoDS_Shape aF=myDS->Shape(nF); aExp.Init(aF, TopAbs_EDGE); for(; aExp.More(); aExp.Next()) { aE=TopoDS::Edge(aExp.Current()); diff --git a/src/OBJECT/GEOM_AISTrihedron.cxx b/src/OBJECT/GEOM_AISTrihedron.cxx index 8df9e0ff9..acf93656d 100755 --- a/src/OBJECT/GEOM_AISTrihedron.cxx +++ b/src/OBJECT/GEOM_AISTrihedron.cxx @@ -69,4 +69,4 @@ void GEOM_AISTrihedron::setIO( const Handle(SALOME_InteractiveObject)& theIO ) - \ No newline at end of file + diff --git a/src/OBJECT/GEOM_AssemblyBuilder.cxx b/src/OBJECT/GEOM_AssemblyBuilder.cxx index 603a071c9..b4d94c841 100644 --- a/src/OBJECT/GEOM_AssemblyBuilder.cxx +++ b/src/OBJECT/GEOM_AssemblyBuilder.cxx @@ -34,6 +34,8 @@ #include "GEOM_AssemblyBuilder.h" #include "GEOM_Actor.h" +#include + #include // Open CASCADE Includes @@ -80,12 +82,19 @@ void GEOM_AssemblyBuilder::InitProperties(vtkProperty* IsoProp, FaceProp->SetDiffuseColor(0.780392, 0.568627, 0.113725); FaceProp->SetSpecularColor(0.992157, 0.941176, 0.807843); + SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); + QColor aColor; + // Wireframe for iso + aColor = aResMgr->colorValue( "Geometry", "isos_color", QColor( int(0.5*255), int(0.5*255), int(0.5*255) ) ); + float red = aColor.red()/255.0; + float green = aColor.green()/255.0; + float blue = aColor.blue()/255.0; IsoProp->SetRepresentationToWireframe(); - IsoProp->SetAmbientColor(0.5, 0.5, 0.5); - IsoProp->SetDiffuseColor(0.5, 0.5, 0.5); - IsoProp->SetSpecularColor(0.5, 0.5, 0.5); - + IsoProp->SetAmbientColor(red, green, blue); + IsoProp->SetDiffuseColor(red, green, blue); + IsoProp->SetSpecularColor(red, green, blue); + // Wireframe for iso IsoPVProp->SetRepresentationToWireframe(); IsoPVProp->SetAmbientColor(0, 1, 1); @@ -93,23 +102,34 @@ void GEOM_AssemblyBuilder::InitProperties(vtkProperty* IsoProp, IsoPVProp->SetSpecularColor(0, 1, 1); // Wireframe for shared edge + aColor = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) ); + red = aColor.red()/255.0; + green = aColor.green()/255.0; + blue = aColor.blue()/255.0; EdgeSProp->SetRepresentationToWireframe(); - EdgeSProp->SetAmbientColor(1, 1, 0); - EdgeSProp->SetDiffuseColor(1, 1, 0); - EdgeSProp->SetSpecularColor(1, 1, 0); - + EdgeSProp->SetAmbientColor(red, green, blue); + EdgeSProp->SetDiffuseColor(red, green, blue); + EdgeSProp->SetSpecularColor(red, green, blue); + // Wireframe for free edge + aColor = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) ); + red = aColor.red()/255.0; + green = aColor.green()/255.0; + blue = aColor.blue()/255.0; EdgeFProp->SetRepresentationToWireframe(); - EdgeFProp->SetAmbientColor(0, 1, 0); - EdgeFProp->SetDiffuseColor(0, 1, 0); - EdgeFProp->SetSpecularColor(0, 1, 0); + EdgeFProp->SetAmbientColor(red, green, blue); + EdgeFProp->SetDiffuseColor(red, green, blue); + EdgeFProp->SetSpecularColor(red, green, blue); // Wireframe for isolated edge + aColor = aResMgr->colorValue( "Geometry", "line_color", QColor( 255, 0, 0 ) ); + red = aColor.red()/255.0; + green = aColor.green()/255.0; + blue = aColor.blue()/255.0; EdgeIProp->SetRepresentationToWireframe(); - EdgeIProp->SetAmbientColor(1, 0, 0); - EdgeIProp->SetDiffuseColor(1, 0, 0); - EdgeIProp->SetSpecularColor(1, 0, 0); - + EdgeIProp->SetAmbientColor(red, green, blue); + EdgeIProp->SetDiffuseColor(red, green, blue); + // Wireframe for Preview edge EdgePVProp->SetRepresentationToWireframe(); EdgePVProp->SetAmbientColor(1, 1, 0); @@ -117,11 +137,15 @@ void GEOM_AssemblyBuilder::InitProperties(vtkProperty* IsoProp, EdgePVProp->SetSpecularColor(1, 1, 0); // Wireframe for vertex + aColor = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ); + red = aColor.red()/255.0; + green = aColor.green()/255.0; + blue = aColor.blue()/255.0; VertexProp->SetRepresentationToWireframe(); - VertexProp->SetAmbientColor(1, 1, 0); - VertexProp->SetDiffuseColor(1, 1, 0); - VertexProp->SetSpecularColor(1, 1, 0); - + VertexProp->SetAmbientColor(red, green, blue); + VertexProp->SetDiffuseColor(red, green, blue); + VertexProp->SetSpecularColor(red, green, blue); + // Wireframe for vertex VertexPVProp->SetRepresentationToWireframe(); VertexPVProp->SetAmbientColor(0, 1, 1); @@ -230,6 +254,7 @@ vtkActorCollection* GEOM_AssemblyBuilder::BuildActors(const TopoDS_Shape& myShap GEOM_Actor* EdgeActor = GEOM_Actor::New(); EdgeActor->SubShapeOn(); EdgeActor->setInputShape(ex2.Current(),deflection,mode); + switch (nbf) { case 0 : // isolated edge @@ -252,6 +277,7 @@ vtkActorCollection* GEOM_AssemblyBuilder::BuildActors(const TopoDS_Shape& myShap EdgeActor->SetWireframeProperty(EdgeSProp); } } + EdgeActor->SetPreviewProperty(EdgePVProp); AISActors->AddItem(EdgeActor); } diff --git a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx index 149fdba75..886adba41 100644 --- a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx +++ b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx @@ -103,9 +103,9 @@ void OperationGUI_ArchimedeDlg::Init() double SpecificStep1 = 0.1; double SpecificStep2 = 0.01; /* min, max, myStep and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, myStep, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep1, 3); - GroupPoints->SpinBox_DZ->RangeStepAndValidator(0.001, 999.999, SpecificStep2, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, myStep, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep1, 3); + GroupPoints->SpinBox_DZ->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep2, 3); GroupPoints->SpinBox_DX->SetValue( 100.0 ); GroupPoints->SpinBox_DY->SetValue( 1.0 ); diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index fc2b12e96..fb6049f9f 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -146,7 +146,9 @@ OperationGUI_ChamferDlg::OperationGUI_ChamferDlg(GeometryGUI* theGeometryGUI, QW double SpecificStep = 10.0; QMap< int, DlgRef_SpinBox* >::iterator anIter; for ( anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter ) - anIter.data()->RangeStepAndValidator( 0.001, 999.999, SpecificStep, 3 ); + anIter.data()->RangeStepAndValidator( 0.001, COORD_MAX, SpecificStep, 3 ); + + setHelpFileName("chamfer.htm"); setHelpFileName("chamfer.htm"); diff --git a/src/OperationGUI/OperationGUI_ClippingDlg.cxx b/src/OperationGUI/OperationGUI_ClippingDlg.cxx index 221e1c073..9e451629f 100644 --- a/src/OperationGUI/OperationGUI_ClippingDlg.cxx +++ b/src/OperationGUI/OperationGUI_ClippingDlg.cxx @@ -109,8 +109,8 @@ OperationGUI_ClippingDlg::OperationGUI_ClippingDlg(GeometryGUI* theGeometryGUI, Layout1->addWidget( GroupArguments, 2, 0 ); /* Initialisations */ - SpinBox_Near->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_Far->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); + SpinBox_Near->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_Far->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); /* signals and slots connections */ connect( buttonOk , SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index d512a33b4..25455e2a2 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -105,9 +105,11 @@ OperationGUI_FilletDlg::OperationGUI_FilletDlg(GeometryGUI* theGeometryGUI, QWid /***************************************************************/ double SpecificStep = 10.0; - Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); + Group1->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3); + Group2->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3); + Group3->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3); + + setHelpFileName("fillet.htm"); setHelpFileName("fillet.htm"); diff --git a/src/OperationGUI/OperationGUI_MaterialDlg.cxx b/src/OperationGUI/OperationGUI_MaterialDlg.cxx index 5f0c9a25e..7259bdcbd 100644 --- a/src/OperationGUI/OperationGUI_MaterialDlg.cxx +++ b/src/OperationGUI/OperationGUI_MaterialDlg.cxx @@ -80,7 +80,7 @@ OperationGUI_MaterialDlg::OperationGUI_MaterialDlg (GeometryGUI* theGeometryGUI, Layout1->addWidget(GroupPoints, 1, 0); /***************************************************************/ - setHelpFileName("none.htm"); + setHelpFileName("partition.htm"); Init(); } diff --git a/src/PrimitiveGUI/PrimitiveGUI.cxx b/src/PrimitiveGUI/PrimitiveGUI.cxx index 218c832e6..45ca54db0 100644 --- a/src/PrimitiveGUI/PrimitiveGUI.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -33,26 +33,15 @@ #include "SUIT_Session.h" #include "SUIT_Desktop.h" +#include "SalomeApp_Application.h" + #include "PrimitiveGUI_BoxDlg.h" // Method BOX #include "PrimitiveGUI_CylinderDlg.h" // Method CYLINDER #include "PrimitiveGUI_SphereDlg.h" // Method SPHERE #include "PrimitiveGUI_TorusDlg.h" // Method TORUS #include "PrimitiveGUI_ConeDlg.h" // Method CONE -using namespace std; -PrimitiveGUI* PrimitiveGUI::myGUIObject = 0; -//======================================================================= -// function : GetPrimitiveGUI() -// purpose : Get the only PrimitiveGUI object [ static ] -//======================================================================= -PrimitiveGUI* PrimitiveGUI::GetPrimitiveGUI( GeometryGUI* parent ) -{ - if ( myGUIObject == 0 ) { - // init PrimitiveGUI only once - myGUIObject = new PrimitiveGUI( parent ); - } - return myGUIObject; -} +using namespace std; //======================================================================= // function : PrimitiveGUI() @@ -62,7 +51,6 @@ PrimitiveGUI::PrimitiveGUI(GeometryGUI* parent) : GEOMGUI(parent) { } - //======================================================================= // function : ~PrimitiveGUI // purpose : Destructor @@ -78,47 +66,38 @@ PrimitiveGUI::~PrimitiveGUI() //======================================================================= bool PrimitiveGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) { + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if (!app) return false; + getGeometryGUI()->EmitSignalDeactivateDialog(); - + QDialog* aDlg = NULL; switch (theCommandID) - { + { case 4021: // BOX - { aDlg = new PrimitiveGUI_BoxDlg(getGeometryGUI(), parent, ""); break; - } case 4022: // CYLINDER - { aDlg = new PrimitiveGUI_CylinderDlg(getGeometryGUI(), parent, ""); break; - } case 4023: // SPHERE - { aDlg = new PrimitiveGUI_SphereDlg(getGeometryGUI(), parent, ""); break; - } case 4024: // TORUS - { aDlg = new PrimitiveGUI_TorusDlg(getGeometryGUI(), parent, ""); break; - } case 4025: // CONE - { aDlg = new PrimitiveGUI_ConeDlg(getGeometryGUI(), parent, ""); break; - } default: - { - SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; - } } - if ( aDlg != NULL ) + if (aDlg != NULL) aDlg->show(); - + return true; } @@ -133,6 +112,6 @@ extern "C" #endif GEOMGUI* GetLibGUI( GeometryGUI* parent ) { - return PrimitiveGUI::GetPrimitiveGUI( parent ); + return new PrimitiveGUI( parent ); } } diff --git a/src/PrimitiveGUI/PrimitiveGUI.h b/src/PrimitiveGUI/PrimitiveGUI.h index 9bdef3508..ff2267323 100644 --- a/src/PrimitiveGUI/PrimitiveGUI.h +++ b/src/PrimitiveGUI/PrimitiveGUI.h @@ -17,14 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : PrimitiveGUI.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef PRIMITIVEGUI_H #define PRIMITIVEGUI_H @@ -38,19 +37,11 @@ //================================================================================= class PrimitiveGUI : public GEOMGUI { -protected: - PrimitiveGUI(GeometryGUI* parent); // hide constructor to avoid direct creation - -public : +public: + PrimitiveGUI(GeometryGUI* parent); ~PrimitiveGUI(); - // Get the only PrimitiveGUI object - static PrimitiveGUI* GetPrimitiveGUI(GeometryGUI* parent); - bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); - -private: - static PrimitiveGUI* myGUIObject; // the only PrimitiveGUI object }; #endif diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index 28e59287c..23e9ce46a 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -117,9 +117,9 @@ void PrimitiveGUI_BoxDlg::Init() double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); /* min, max, step and decimals for spin boxes */ - GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); double initValue = 200.0; GroupDimensions->SpinBox_DX->SetValue(initValue); diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index cd250f830..7de92356e 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -119,12 +119,12 @@ void PrimitiveGUI_ConeDlg::Init() double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, 999.999, step, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3); - GroupPoints->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3); - GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, 3); + GroupPoints->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); double aRadius1(100.0), aRadius2(0.0), aHeight(300.0); GroupPoints->SpinBox_DX->SetValue(aRadius1); diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 7a5f38236..503211cf2 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -118,13 +118,13 @@ void PrimitiveGUI_CylinderDlg::Init() /* min, max, step and decimals for spin boxes & initial values */ /* First constructor : radius */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); /* First constructor : algebric height */ - GroupPoints->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); /* Second constructor : radius */ - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); /* Second constructor : algebric height */ - GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupPoints->SpinBox_DX->SetValue(100.0); GroupPoints->SpinBox_DY->SetValue(300.0); diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index 3c4e8adeb..f52f0822a 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -112,8 +112,8 @@ void PrimitiveGUI_SphereDlg::Init() double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); /* min, max, step and decimals for spin boxes */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); GroupPoints->SpinBox_DX->SetValue(100.0); GroupDimensions->SpinBox_DX->SetValue(100.0); diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index fe98d7cc7..7ab9ca465 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -117,10 +117,10 @@ void PrimitiveGUI_TorusDlg::Init() double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, 3); GroupPoints->SpinBox_DX->SetValue(300.0); GroupPoints->SpinBox_DY->SetValue(100.0); diff --git a/src/RepairGUI/Makefile.in b/src/RepairGUI/Makefile.in index 3c698b919..b5aec03e1 100644 --- a/src/RepairGUI/Makefile.in +++ b/src/RepairGUI/Makefile.in @@ -50,6 +50,7 @@ LIB_SRC = RepairGUI.cxx \ RepairGUI_DivideEdgeDlg.cxx \ RepairGUI_FreeBoundDlg.cxx \ RepairGUI_FreeFacesDlg.cxx \ + RepairGUI_ChangeOrientationDlg.cxx \ RepairGUI_GlueDlg.cxx LIB_MOC = \ @@ -62,6 +63,7 @@ LIB_MOC = \ RepairGUI_DivideEdgeDlg.h \ RepairGUI_FreeBoundDlg.h \ RepairGUI_FreeFacesDlg.h \ + RepairGUI_ChangeOrientationDlg.h \ RepairGUI_GlueDlg.h LIB_CLIENT_IDL = SALOME_Exception.idl SALOME_GenericObj.idl SALOME_Component.idl diff --git a/src/RepairGUI/RepairGUI.cxx b/src/RepairGUI/RepairGUI.cxx index 8e5f50a1e..3631415bc 100644 --- a/src/RepairGUI/RepairGUI.cxx +++ b/src/RepairGUI/RepairGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -31,6 +31,8 @@ #include "SUIT_Desktop.h" #include "SUIT_Session.h" +#include "SalomeApp_Application.h" + #include "RepairGUI_SewingDlg.h" // Method SEWING #include "RepairGUI_SuppressFacesDlg.h" // Method SUPPRESS FACES #include "RepairGUI_RemoveHolesDlg.h" // Method SUPPRESS HOLE @@ -41,26 +43,12 @@ #include "RepairGUI_FreeBoundDlg.h" // Method FREE BOUNDARIES #include "RepairGUI_FreeFacesDlg.h" // Method FREE FACES #include "RepairGUI_GlueDlg.h" // Method GLUE FACES +#include "RepairGUI_ChangeOrientationDlg.h" // Method CHANGE ORIENTATION #include "utilities.h" using namespace std; -RepairGUI* RepairGUI::myGUIObject = 0; - -//======================================================================= -// function : GetRepairGUI() -// purpose : Get the only RepairGUI object [ static ] -//======================================================================= -RepairGUI* RepairGUI::GetRepairGUI( GeometryGUI* parent ) -{ - if ( myGUIObject == 0 ) { - // init RepairGUI only once - myGUIObject = new RepairGUI( parent ); - } - return myGUIObject; -} - //======================================================================= // function : RepairGUI() // purpose : Constructor @@ -69,7 +57,6 @@ RepairGUI::RepairGUI( GeometryGUI* parent ) : GEOMGUI( parent ) { } - //======================================================================= // function : ~RepairGUI() // purpose : Destructor @@ -85,6 +72,9 @@ RepairGUI::~RepairGUI() //======================================================================= bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) { + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if (!app) return false; + getGeometryGUI()->EmitSignalDeactivateDialog(); QDialog* aDlg = NULL; @@ -97,10 +87,11 @@ bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) case 606: aDlg = new RepairGUI_CloseContourDlg (getGeometryGUI(), parent, ""); break; case 607: aDlg = new RepairGUI_RemoveIntWiresDlg(getGeometryGUI(), parent, ""); break; case 608: aDlg = new RepairGUI_DivideEdgeDlg (getGeometryGUI(), parent, ""); break; - case 609: aDlg = new RepairGUI_FreeBoundDlg (getGeometryGUI(), parent, ""); break; - case 610: aDlg = new RepairGUI_FreeFacesDlg (getGeometryGUI(), parent, ""); break; + case 609: aDlg = new RepairGUI_FreeBoundDlg (getGeometryGUI(), parent, ""); break; + case 610: aDlg = new RepairGUI_FreeFacesDlg (getGeometryGUI(), parent, ""); break; + case 611: aDlg = new RepairGUI_ChangeOrientationDlg (getGeometryGUI(), parent, ""); break; default: - SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; } @@ -121,6 +112,6 @@ extern "C" #endif GEOMGUI* GetLibGUI( GeometryGUI* parent ) { - return RepairGUI::GetRepairGUI( parent ); + return new RepairGUI( parent ); } } diff --git a/src/RepairGUI/RepairGUI.h b/src/RepairGUI/RepairGUI.h index bbeadad2c..a99916239 100644 --- a/src/RepairGUI/RepairGUI.h +++ b/src/RepairGUI/RepairGUI.h @@ -17,14 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : RepairGUI.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef REPAIRGUI_H #define REPAIRGUI_H @@ -38,20 +37,11 @@ //================================================================================= class RepairGUI : public GEOMGUI { -protected: - RepairGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation - -public : +public: + RepairGUI( GeometryGUI* parent ); ~RepairGUI(); - // Get the only RepairGUI object - static RepairGUI* GetRepairGUI( GeometryGUI* parent ); - bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); - -private: - static RepairGUI* myGUIObject; // the only RepairGUI object - }; #endif diff --git a/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx new file mode 100644 index 000000000..afb28f5aa --- /dev/null +++ b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx @@ -0,0 +1,301 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : RepairGUI_ChangeOrientationDlg.cxx +// Author : Sergey KUUL +// Module : GEOM + +#include "RepairGUI_ChangeOrientationDlg.h" + +#include "SalomeApp_Application.h" +#include "LightApp_SelectionMgr.h" +#include "SUIT_Session.h" +#include "SALOME_ListIteratorOfListIO.hxx" + +#include "GEOMImpl_Types.hxx" + +#include + +#include + +using namespace std; + +//================================================================================= +// class : RepairGUI_ChangeOrientationDlg() +// purpose : Constructs a RepairGUI_ChangeOrientationDlg which is a child of 'parent', +// with the name 'name' and widget flags set to 'f'. +// The dialog will by default be modeless, unless you set 'modal' to +// TRUE to construct a modal dialog. +//================================================================================= +RepairGUI_ChangeOrientationDlg::RepairGUI_ChangeOrientationDlg(GeometryGUI* theGeometryGUI, + QWidget* parent, const char* name, + bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +{ + //QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SUPRESS_FACE"))); + QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CHANGE_ORIENTATION"))); + QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); + + setCaption(tr("GEOM_CHANGE_ORIENTATION_TITLE")); + + /***************************************************************/ + GroupConstructors->setTitle(tr("GEOM_CHANGE_ORIENTATION_TITLE")); + RadioButton1->setPixmap(image0); + RadioButton2->close(TRUE); + RadioButton3->close(TRUE); + + GroupPoints = new DlgRef_1Sel1Check_QTD(this, "GroupPoints"); + GroupPoints->GroupBox1->setTitle(tr("GEOM_CHANGE_ORIENTATION")); + GroupPoints->TextLabel1->setText(tr("GEOM_SELECTED_SHAPE")); + GroupPoints->CheckButton1->setText(tr("GEOM_CREATE_COPY")); + GroupPoints->PushButton1->setPixmap(image1); +// GroupPoints->LineEdit1->setReadOnly( true ); + + Layout1->addWidget(GroupPoints, 2, 0); + + setHelpFileName("change_orientation.htm"); + + Init(); +} + + +//================================================================================= +// function : ~RepairGUI_ChangeOrientationDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +RepairGUI_ChangeOrientationDlg::~RepairGUI_ChangeOrientationDlg() +{ +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void RepairGUI_ChangeOrientationDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupPoints->LineEdit1; + + GroupPoints->CheckButton1->setChecked(true); + + myOkObject = false; + + /* signals and slots connections */ + connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + + connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + + connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool))); + + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + initName( tr( "CHANGE_ORIENTATION_NEW_OBJ_NAME" ) ); +} + + +//================================================================================= +// function : ClickOnOk() +// purpose : Same than click on apply but close this dialog. +//================================================================================= +void RepairGUI_ChangeOrientationDlg::ClickOnOk() +{ + if ( ClickOnApply() ) + ClickOnCancel(); +} + + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +bool RepairGUI_ChangeOrientationDlg::ClickOnApply() +{ +// if ( !onAccept() ) + if ( !onAccept(GroupPoints->CheckButton1->isChecked()) ) + return false; + + initName(); + + myEditCurrentArgument->setText(""); + + return true; +} + + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void RepairGUI_ChangeOrientationDlg::SelectionIntoArgument() +{ + myEditCurrentArgument->setText(""); + QString aName; + + if(myEditCurrentArgument == GroupPoints->LineEdit1) { + if (IObjectCount() != 1) { + if (myEditCurrentArgument == GroupPoints->LineEdit1) + myOkObject = false; + return; + } + } + + // nbSel == 1 + Standard_Boolean testResult = Standard_False; + GEOM::GEOM_Object_ptr aSelectedObject = + GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult ); + + if (!testResult) + return; + + if (myEditCurrentArgument == GroupPoints->LineEdit1) { + myObject = aSelectedObject; + myOkObject = true; + } + + myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) ); + +} + + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void RepairGUI_ChangeOrientationDlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + if( send == GroupPoints->PushButton1 ) + { + GroupPoints->LineEdit1->setFocus(); + myEditCurrentArgument = GroupPoints->LineEdit1; + } + SelectionIntoArgument(); +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void RepairGUI_ChangeOrientationDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + if( send == GroupPoints->LineEdit1 ) { + myEditCurrentArgument = GroupPoints->LineEdit1; + GEOMBase_Skeleton::LineEditReturnPressed(); + } +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void RepairGUI_ChangeOrientationDlg::ActivateThisDialog() +{ + GEOMBase_Skeleton::ActivateThisDialog(); + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + +} + + +//================================================================================= +// function : enterEvent() +// purpose : Mouse enter onto the dialog to activate it +//================================================================================= +void RepairGUI_ChangeOrientationDlg::enterEvent(QEvent* e) +{ + if ( !GroupConstructors->isEnabled() ) + ActivateThisDialog(); +} + + +//================================================================================= +// function : closeEvent() +// purpose : +//================================================================================= +void RepairGUI_ChangeOrientationDlg::closeEvent(QCloseEvent* e) +{ + //myGeomGUI->SetState( -1 ); + GEOMBase_Skeleton::closeEvent( e ); +} + + +//================================================================================= +// function : createOperation +// purpose : +//================================================================================= +GEOM::GEOM_IOperations_ptr RepairGUI_ChangeOrientationDlg::createOperation() +{ + return getGeomEngine()->GetIHealingOperations( getStudyId() ); +} + + +//================================================================================= +// function : isValid +// purpose : +//================================================================================= +bool RepairGUI_ChangeOrientationDlg::isValid( QString& msg ) +{ + return myOkObject; +} + + +//================================================================================= +// function : execute +// purpose : +//================================================================================= +bool RepairGUI_ChangeOrientationDlg::execute( ObjectList& objects ) +{ + bool toCreateCopy = GroupPoints->CheckButton1->isChecked(); + + GEOM::GEOM_Object_var anObj; + if(toCreateCopy) { + anObj = GEOM::GEOM_IHealingOperations::_narrow(getOperation())->ChangeOrientationCopy(myObject); + } + else { + anObj = GEOM::GEOM_IHealingOperations::_narrow(getOperation())->ChangeOrientation(myObject); + } + + if ( !anObj->_is_nil() ) + objects.push_back( anObj._retn() ); + + return true; +} + + +//================================================================================= +// function : CreateCopyModeChanged() +// purpose : +//================================================================================= +void RepairGUI_ChangeOrientationDlg::CreateCopyModeChanged(bool isCreateCopy) +{ + GroupBoxName->setEnabled(isCreateCopy); +} diff --git a/src/RepairGUI/RepairGUI_ChangeOrientationDlg.h b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.h new file mode 100644 index 000000000..19f5be34c --- /dev/null +++ b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.h @@ -0,0 +1,77 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : RepairGUI_ChangeOrientationDlg.h +// Author : Sergey KUUL +// Module : GEOM + +#ifndef DIALOGBOX_CHANGEORIENTATION_H +#define DIALOGBOX_CHANGEORIENTATION_H + +#include "GEOMBase_Skeleton.h" +#include "DlgRef_1Sel1Check_QTD.h" +#include + +//#include + +//================================================================================= +// class : RepairGUI_ChangeOrientationDlg +// purpose : +//================================================================================= +class RepairGUI_ChangeOrientationDlg : public GEOMBase_Skeleton +{ + Q_OBJECT + +public: + RepairGUI_ChangeOrientationDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); + ~RepairGUI_ChangeOrientationDlg(); + +protected: + // redefined from GEOMBase_Helper + virtual GEOM::GEOM_IOperations_ptr createOperation(); + virtual bool isValid( QString& ); + virtual bool execute( ObjectList& objects ); + +private : + void Init(); + void enterEvent(QEvent* e); + void closeEvent(QCloseEvent* e); + + GEOM::GEOM_Object_var myObject; + bool myOkObject; + + DlgRef_1Sel1Check_QTD* GroupPoints; + + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + void ActivateThisDialog(); + void LineEditReturnPressed(); + void SelectionIntoArgument(); + void SetEditCurrentArgument(); + void CreateCopyModeChanged(bool isCreateCopy); +}; + +#endif // DIALOGBOX_SUPPRESSFACES_H diff --git a/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx b/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx index cc376d53f..9b8f1e085 100644 --- a/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx +++ b/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx @@ -304,3 +304,20 @@ bool RepairGUI_FreeBoundDlg::execute( ObjectList& objects ) return result; } + +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void RepairGUI_FreeBoundDlg::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Key_F1 ) + { + e->accept(); + onHelp(); + } +} diff --git a/src/RepairGUI/RepairGUI_FreeBoundDlg.h b/src/RepairGUI/RepairGUI_FreeBoundDlg.h index 4189527f2..0594fe2d6 100644 --- a/src/RepairGUI/RepairGUI_FreeBoundDlg.h +++ b/src/RepairGUI/RepairGUI_FreeBoundDlg.h @@ -60,6 +60,7 @@ private: void Init(); void enterEvent( QEvent* e ); void closeEvent( QCloseEvent* e ); + void keyPressEvent( QKeyEvent* e ); void activateSelection(); virtual GEOM::GEOM_IOperations_ptr createOperation(); diff --git a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx index 61c947f93..61881b7c3 100644 --- a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx @@ -358,3 +358,19 @@ void RepairGUI_FreeFacesDlg::onSetEditCurrentArgument() onSelectionDone(); } +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void RepairGUI_FreeFacesDlg::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Key_F1 ) + { + e->accept(); + onHelp(); + } +} diff --git a/src/RepairGUI/RepairGUI_FreeFacesDlg.h b/src/RepairGUI/RepairGUI_FreeFacesDlg.h index cafb9b1d6..582179b4d 100644 --- a/src/RepairGUI/RepairGUI_FreeFacesDlg.h +++ b/src/RepairGUI/RepairGUI_FreeFacesDlg.h @@ -60,6 +60,7 @@ private: void Init(); void enterEvent(QEvent* e); void closeEvent(QCloseEvent* e); + void keyPressEvent(QKeyEvent* e); void activateSelection(); GEOM_Displayer* getDisplayer(); diff --git a/src/STEPImport/STEPImport.cxx b/src/STEPImport/STEPImport.cxx index 00cd419e4..05f5b480c 100644 --- a/src/STEPImport/STEPImport.cxx +++ b/src/STEPImport/STEPImport.cxx @@ -34,6 +34,7 @@ #include #include +#include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #ifdef WNT @@ -76,6 +77,9 @@ STEPIMPORT_EXPORT BRep_Builder B; B.MakeCompound( compound ); try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString()); if (status == IFSelect_RetDone) { diff --git a/src/ShHealOper/Makefile.in b/src/ShHealOper/Makefile.in index f164e12eb..2497fc526 100644 --- a/src/ShHealOper/Makefile.in +++ b/src/ShHealOper/Makefile.in @@ -47,6 +47,7 @@ LIB_SRC = \ ShHealOper_ShapeProcess.cxx \ ShHealOper_SplitCurve2d.cxx \ ShHealOper_SplitCurve3d.cxx \ + ShHealOper_ChangeOrientation.cxx \ ShHealOper_Tool.cxx \ LIB_CLIENT_IDL = @@ -64,6 +65,7 @@ EXPORT_HEADERS = \ ShHealOper_SpiltCurve2d.hxx \ ShHealOper_SplitCurve2d.hxx \ ShHealOper_SplitCurve3d.hxx \ + ShHealOper_ChangeOrientation.hxx \ ShHealOper_Tool.hxx # idl files diff --git a/src/ShHealOper/ShHealOper_ChangeOrientation.cxx b/src/ShHealOper/ShHealOper_ChangeOrientation.cxx new file mode 100644 index 000000000..92912fa85 --- /dev/null +++ b/src/ShHealOper/ShHealOper_ChangeOrientation.cxx @@ -0,0 +1,88 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File: ShHealOper_ChangeOrientation.cxx +// Created: 11.07.06 11:46:45 +// Author: Sergey KUUL + + +#include + +#include +#include + +//======================================================================= +//function : ShHealOper_ChangeOrientation() +//purpose : Constructor +//======================================================================= + +ShHealOper_ChangeOrientation::ShHealOper_ChangeOrientation ( const TopoDS_Shape& theShape ) +{ + Init(theShape); +} + +//======================================================================= +//function : Init +//purpose : +//======================================================================= + +void ShHealOper_ChangeOrientation::Init(const TopoDS_Shape& theShape) +{ + ShHealOper_Tool::Init(theShape); +} + +//======================================================================= +//function : Perform +//purpose : +//======================================================================= + +Standard_Boolean ShHealOper_ChangeOrientation::Perform() +{ + BRep_Builder B; + if (myInitShape.ShapeType() == TopAbs_SHELL) { + myResultShape = myInitShape.EmptyCopied(); + TopoDS_Iterator itr(myInitShape); + while (itr.More()) { + B.Add(myResultShape,itr.Value().Reversed()); + itr.Next(); + } + } + else if (myInitShape.ShapeType() == TopAbs_FACE) { + myResultShape = myInitShape.EmptyCopied(); + TopoDS_Iterator itr(myInitShape); + while (itr.More()) { + B.Add(myResultShape,itr.Value()); + itr.Next(); + } + myResultShape.Reverse(); + } + else if (myInitShape.ShapeType() == TopAbs_WIRE) { + myResultShape = myInitShape.Reversed(); + } + else if (myInitShape.ShapeType() == TopAbs_EDGE) { + myResultShape = myInitShape.Reversed(); + } + else { + return false; + } + + return true; + +} diff --git a/src/ShHealOper/ShHealOper_ChangeOrientation.hxx b/src/ShHealOper/ShHealOper_ChangeOrientation.hxx new file mode 100644 index 000000000..fe6ee94e2 --- /dev/null +++ b/src/ShHealOper/ShHealOper_ChangeOrientation.hxx @@ -0,0 +1,66 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File: ShHealOper_ChangeOrientation.hxx +// Created: 11.07.06 11:22:26 +// Author: Sergey KUUL + + +#ifndef ShHealOper_ChangeOrientation_HeaderFile +#define ShHealOper_ChangeOrientation_HeaderFile + +#include +#include +#include + +/// Class ShHealOper_ChangeOrientation +// Intended for change orientation of given shape +// if shape is Shell - create empty copy and put to it +// each face as Reversed() + +class ShHealOper_ChangeOrientation : public ShHealOper_Tool +{ + public: + // ---------- PUBLIC METHODS ---------- + + /// Empty constructor + Standard_EXPORT ShHealOper_ChangeOrientation () {} + + /// Copy constructor + Standard_EXPORT ShHealOper_ChangeOrientation (const TopoDS_Shape& theShape); + //Method for initalization by whole shape. + + Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape); + //Method for initalization by whole shape. + + Standard_EXPORT Standard_Boolean Perform(); + //Change orientation + + + public: +// Declaration of CASCADE RTTI +//DEFINE_STANDARD_RTTI (ShHealOper_RemoveInternalWires) +}; + +// Definition of HANDLE object using Standard_DefineHandle.hxx +//DEFINE_STANDARD_HANDLE (ShHealOper_RemoveInternalWires, ) + + +#endif diff --git a/src/TransformationGUI/TransformationGUI.cxx b/src/TransformationGUI/TransformationGUI.cxx index cbeccad42..eb69c9037 100644 --- a/src/TransformationGUI/TransformationGUI.cxx +++ b/src/TransformationGUI/TransformationGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -32,6 +32,8 @@ #include "SUIT_Session.h" #include "SUIT_Desktop.h" +#include "SalomeApp_Application.h" + #include "TransformationGUI_MultiTranslationDlg.h" // Method MULTI TRANSLATION #include "TransformationGUI_MultiRotationDlg.h" // Method MULTI ROTATION #include "TransformationGUI_TranslationDlg.h" // Method TRANSLATION @@ -43,21 +45,6 @@ using namespace std; -TransformationGUI* TransformationGUI::myGUIObject = 0; - -//======================================================================= -// function : GetTransformationGUI() -// purpose : Get the only TransformationGUI object [ static ] -//======================================================================= -TransformationGUI* TransformationGUI::GetTransformationGUI( GeometryGUI* parent ) -{ - if ( myGUIObject == 0 ) { - // init TransformationGUI only once - myGUIObject = new TransformationGUI( parent ); - } - return myGUIObject; -} - //======================================================================= // function : TransformationGUI() // purpose : Constructor @@ -66,7 +53,6 @@ TransformationGUI::TransformationGUI(GeometryGUI* parent) : GEOMGUI(parent) { } - //======================================================================= // function : ~TransformationGUI() // purpose : Destructor @@ -82,6 +68,9 @@ TransformationGUI::~TransformationGUI() //======================================================================= bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) { + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if (!app) return false; + getGeometryGUI()->EmitSignalDeactivateDialog(); QDialog* aDlg = NULL; @@ -112,11 +101,11 @@ bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) aDlg = new TransformationGUI_MultiRotationDlg( getGeometryGUI(), parent, "" ); break; default: - SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; } - if ( aDlg != NULL ) + if (aDlg != NULL) aDlg->show(); return true; @@ -133,6 +122,6 @@ extern "C" #endif GEOMGUI* GetLibGUI( GeometryGUI* parent ) { - return TransformationGUI::GetTransformationGUI( parent ); + return new TransformationGUI( parent ); } } diff --git a/src/TransformationGUI/TransformationGUI.h b/src/TransformationGUI/TransformationGUI.h index 77ef5de5f..87ba9b55d 100644 --- a/src/TransformationGUI/TransformationGUI.h +++ b/src/TransformationGUI/TransformationGUI.h @@ -17,14 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // // File : TransformationGUI.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef TRANSFORMATIONGUI_H #define TRANSFORMATIONGUI_H @@ -38,19 +37,11 @@ //================================================================================= class TransformationGUI : public GEOMGUI { -protected: - TransformationGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation - -public : +public: + TransformationGUI( GeometryGUI* parent ); ~TransformationGUI(); - // Get the only TransformationGUI object - static TransformationGUI* GetTransformationGUI( GeometryGUI* parent ); - bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); - -private: - static TransformationGUI* myGUIObject; // the only TransformationGUI object }; #endif diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index 01c8b24a0..88535e435 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -124,13 +124,13 @@ void TransformationGUI_MultiRotationDlg::Init() double SpecificStep1 = 5; double SpecificStep2 = 1; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(1.0, 999.999, SpecificStep2, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 3); GroupPoints->SpinBox_DX->SetValue(myNbTimes1); - GroupDimensions->SpinBox_DX1->RangeStepAndValidator(-999.999, 999.999, SpecificStep1, 3); - GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, 999.999, SpecificStep2, 3); - GroupDimensions->SpinBox_DX2->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, 999.999, SpecificStep2, 3); + GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep1, 3); + GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 3); + GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 3); GroupDimensions->SpinBox_DX1->SetValue(myAng); GroupDimensions->SpinBox_DY1->SetValue(myNbTimes1); GroupDimensions->SpinBox_DX2->SetValue(myStep); diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index c1e7aed86..75f3e4d35 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -130,15 +130,15 @@ void TransformationGUI_MultiTranslationDlg::Init() double SpecificStep = 1; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3); GroupPoints->SpinBox_DX->SetValue(myStepU); GroupPoints->SpinBox_DY->SetValue(myNbTimesU); - GroupDimensions->SpinBox_DX1->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); - GroupDimensions->SpinBox_DX2->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); + GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3); + GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3); GroupDimensions->SpinBox_DX1->SetValue(myStepU); GroupDimensions->SpinBox_DY1->SetValue(myNbTimesU); GroupDimensions->SpinBox_DX2->SetValue(myStepV); diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx index 6fe4f3bc4..6a33e47e8 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx @@ -108,7 +108,7 @@ void TransformationGUI_OffsetDlg::Init() double step = 1; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupPoints->SpinBox_DX->setPrecision(5); //@ GroupPoints->SpinBox_DX->setDblPrecision(1e-05); GroupPoints->SpinBox_DX->SetValue(1e-05); @@ -270,7 +270,18 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_OffsetDlg::createOperation() //================================================================================= bool TransformationGUI_OffsetDlg::isValid( QString& msg ) { - return !(myObjects.length() == 0); + //return !(myObjects.length() == 0); + if (myObjects.length() == 0) return false; + + for (int i = 0; i < myObjects.length(); i++) + { + GEOM::shape_type aType = myObjects[i]->GetShapeType(); + if( aType != GEOM::FACE && aType != GEOM::SHELL && aType != GEOM::SOLID ){ + msg = tr("ERROR_SHAPE_TYPE"); + return false; + } + } + return true; } @@ -288,6 +299,7 @@ bool TransformationGUI_OffsetDlg::execute( ObjectList& objects ) if (GroupPoints->CheckButton1->isChecked() || IsPreview()) for (int i = 0; i < myObjects.length(); i++) { + anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShapeCopy( myObjects[i], GetOffset() ); if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() ); diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index 6f07b1c73..c22db8006 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -82,7 +82,7 @@ TransformationGUI_RotationDlg::TransformationGUI_RotationDlg double anAngle = 0; double SpecificStep = 5; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, SpecificStep, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3); GroupPoints->SpinBox_DX->SetValue(anAngle); // Activate Create a Copy mode diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index 259a1da2d..40e6cc20a 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -85,7 +85,7 @@ TransformationGUI_ScaleDlg::TransformationGUI_ScaleDlg(GeometryGUI* theGeometryG double aFactor = 2.0; double SpecificStep = 0.5; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, SpecificStep, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3); GroupPoints->SpinBox_DX->SetValue(aFactor); // Activate Create a Copy mode diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index 0a02a62a6..5e022bc88 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -124,9 +124,9 @@ void TransformationGUI_TranslationDlg::Init() double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox1->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupPoints->SpinBox2->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupPoints->SpinBox3->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupPoints->SpinBox1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupPoints->SpinBox2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupPoints->SpinBox3->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupPoints->SpinBox1->SetValue(0.0); GroupPoints->SpinBox2->SetValue(0.0); -- 2.39.2