]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Join modifications from V3_2_0_maintainance (V3_2_6pre4 - T32x_16Aug2007_16h00m)
authorjfa <jfa@opencascade.com>
Wed, 22 Aug 2007 06:10:04 +0000 (06:10 +0000)
committerjfa <jfa@opencascade.com>
Wed, 22 Aug 2007 06:10:04 +0000 (06:10 +0000)
195 files changed:
build_configure
configure.ac
idl/GEOM_Gen.idl
idl/GEOM_Superv.idl
resources/GEOMCatalog.xml.in
src/BasicGUI/BasicGUI_ArcDlg.cxx
src/BasicGUI/BasicGUI_ArcDlg.h
src/BasicGUI/BasicGUI_CircleDlg.cxx
src/BasicGUI/BasicGUI_EllipseDlg.cxx
src/BasicGUI/BasicGUI_MarkerDlg.cxx
src/BasicGUI/BasicGUI_PlaneDlg.cxx
src/BasicGUI/BasicGUI_PointDlg.cxx
src/BasicGUI/BasicGUI_VectorDlg.cxx
src/DlgRef/DlgRef_2Sel1List1Check_QTD.cxx [new file with mode: 0644]
src/DlgRef/DlgRef_2Sel1List1Check_QTD.h [new file with mode: 0644]
src/DlgRef/DlgRef_Skeleton_QTD.cxx
src/DlgRef/DlgRef_Skeleton_QTD.h
src/DlgRef/DlgRef_SpinBox.cxx
src/DlgRef/DlgRef_SpinBox.h
src/DlgRef/Makefile.am
src/DlgRef/UIFiles/DlgRef_Skeleton_QTD.ui
src/EntityGUI/EntityGUI_Skeleton_QTD.cxx
src/EntityGUI/EntityGUI_Skeleton_QTD.h
src/EntityGUI/EntityGUI_SketcherDlg.cxx
src/EntityGUI/UIFiles/EntityGUI_Skeleton_QTD.ui
src/GEOM/GEOM_Object.cxx
src/GEOM/GEOM_PythonDump.cxx
src/GEOMAlgo/GEOMAlgo_Builder.cdl
src/GEOMAlgo/GEOMAlgo_Builder.cxx
src/GEOMAlgo/GEOMAlgo_Builder.hxx
src/GEOMAlgo/GEOMAlgo_Builder.jxx
src/GEOMAlgo/GEOMAlgo_Builder_0.cxx
src/GEOMAlgo/GEOMAlgo_Builder_1.cxx
src/GEOMAlgo/GEOMAlgo_Builder_2.cxx
src/GEOMAlgo/GEOMAlgo_Builder_3.cxx
src/GEOMAlgo/GEOMAlgo_Builder_4.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx
src/GEOMAlgo/GEOMAlgo_Gluer.cxx
src/GEOMAlgo/GEOMAlgo_Gluer.hxx
src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.cxx
src/GEOMAlgo/GEOMAlgo_Splitter.cdl
src/GEOMAlgo/GEOMAlgo_Splitter.cxx
src/GEOMAlgo/GEOMAlgo_Splitter.hxx
src/GEOMBase/GEOMBase_Skeleton.cxx
src/GEOMClient/GEOM_Client.cxx
src/GEOMContext/GEOM_msg_en.po
src/GEOMContext/GEOM_msg_fr.po
src/GEOMGUI/GEOMGUI_Selection.cxx
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GEOM_msg_en.po
src/GEOMGUI/GEOM_msg_fr.po
src/GEOMImpl/GEOMImpl_ArcDriver.cxx
src/GEOMImpl/GEOMImpl_BlockDriver.cxx
src/GEOMImpl/GEOMImpl_BooleanDriver.cxx
src/GEOMImpl/GEOMImpl_ExportDriver.cxx
src/GEOMImpl/GEOMImpl_GlueDriver.cxx
src/GEOMImpl/GEOMImpl_GlueDriver.hxx
src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx
src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx
src/GEOMImpl/GEOMImpl_IGlue.hxx
src/GEOMImpl/GEOMImpl_IPartition.hxx
src/GEOMImpl/GEOMImpl_IShapesOperations.cxx
src/GEOMImpl/GEOMImpl_IShapesOperations.hxx
src/GEOMImpl/GEOMImpl_ImportDriver.cxx
src/GEOMImpl/GEOMImpl_PartitionDriver.cxx
src/GEOMImpl/GEOMImpl_PipeDriver.cxx
src/GEOMImpl/GEOMImpl_PrismDriver.cxx
src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx
src/GEOMImpl/Makefile.am
src/GEOMToolsGUI/GEOMToolsGUI.cxx
src/GEOM_I/GEOM_IBooleanOperations_i.cc
src/GEOM_I/GEOM_IBooleanOperations_i.hh
src/GEOM_I/GEOM_IShapesOperations_i.cc
src/GEOM_I/GEOM_IShapesOperations_i.hh
src/GEOM_I_Superv/GEOM_Superv_i.cc
src/GEOM_I_Superv/GEOM_Superv_i.hh
src/GEOM_SWIG/GEOM_TestOthers.py
src/GEOM_SWIG/GEOM_cyl2complementary.py
src/GEOM_SWIG/Makefile.am
src/GEOM_SWIG/batchmode_geompy.py
src/GEOM_SWIG/geompyDC.py
src/GEOM_SWIG/libGEOM_Swig.i [deleted file]
src/GEOM_SWIG_WITHIHM/Makefile.am [new file with mode: 0644]
src/GEOM_SWIG_WITHIHM/libGEOM_Swig.i [new file with mode: 0644]
src/GenerationGUI/GenerationGUI_PrismDlg.cxx
src/GenerationGUI/GenerationGUI_PrismDlg.h
src/GenerationGUI/GenerationGUI_RevolDlg.cxx
src/GroupGUI/GroupGUI_GroupDlg.h
src/Makefile.am
src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx
src/MeasureGUI/MeasureGUI_DistanceDlg.cxx
src/MeasureGUI/MeasureGUI_InertiaDlg.cxx
src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx
src/MeasureGUI/MeasureGUI_PointDlg.cxx
src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx
src/MeasureGUI/MeasureGUI_Skeleton.cxx
src/MeasureGUI/MeasureGUI_Skeleton_QTD.cxx
src/MeasureGUI/MeasureGUI_Skeleton_QTD.h
src/MeasureGUI/UIFiles/MeasureGUI_Skeleton_QTD.ui
src/NMTDS/Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx [new file with mode: 0644]
src/NMTDS/Makefile.am
src/NMTDS/NMTDS.cdl
src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_0.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_0.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger_0.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_InterfPool.cdl [new file with mode: 0644]
src/NMTDS/NMTDS_InterfPool.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_InterfPool.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_InterfPool.ixx [new file with mode: 0644]
src/NMTDS/NMTDS_InterfPool.jxx [new file with mode: 0644]
src/NMTDS/NMTDS_InterfType.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_Iterator.cdl
src/NMTDS/NMTDS_Iterator.cxx
src/NMTDS/NMTDS_Iterator.hxx
src/NMTDS/NMTDS_IteratorCheckerSI.cdl [new file with mode: 0644]
src/NMTDS/NMTDS_IteratorCheckerSI.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_IteratorCheckerSI.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_IteratorCheckerSI.ixx [new file with mode: 0644]
src/NMTDS/NMTDS_IteratorCheckerSI.jxx [new file with mode: 0644]
src/NMTDS/NMTDS_PInterfPool.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_PIterator.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKey.cdl
src/NMTDS/NMTDS_PassKey.cxx
src/NMTDS/NMTDS_PassKey.hxx
src/NMTDS/NMTDS_PassKey.jxx
src/NMTDS/NMTDS_PassKeyBoolean.cdl
src/NMTDS/NMTDS_PassKeyBoolean.cxx
src/NMTDS/NMTDS_PassKeyBoolean.hxx
src/NMTDS/NMTDS_PassKeyMapHasher.cdl
src/NMTDS/NMTDS_PassKeyMapHasher.cxx
src/NMTDS/NMTDS_PassKeyShape.cdl [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShape.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShape.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShape.ixx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShape.jxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShapeMapHasher.cdl [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShapeMapHasher.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShapeMapHasher.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShapeMapHasher.ixx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShapeMapHasher.jxx [new file with mode: 0644]
src/NMTDS/NMTDS_ShapesDataStructure.cdl
src/NMTDS/NMTDS_ShapesDataStructure.cxx
src/NMTDS/NMTDS_ShapesDataStructure.hxx
src/NMTDS/NMTDS_ShapesDataStructure.jxx
src/NMTDS/NMTDS_Tools.cdl [new file with mode: 0644]
src/NMTDS/NMTDS_Tools.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_Tools.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_Tools.ixx [new file with mode: 0644]
src/NMTDS/NMTDS_Tools.jxx [new file with mode: 0644]
src/NMTTools/Makefile.am
src/NMTTools/NMTTools.cdl
src/NMTTools/NMTTools_CheckerSI.cdl [new file with mode: 0644]
src/NMTTools/NMTTools_CheckerSI.cxx [new file with mode: 0644]
src/NMTTools/NMTTools_CheckerSI.hxx [new file with mode: 0644]
src/NMTTools/NMTTools_CheckerSI.ixx [new file with mode: 0644]
src/NMTTools/NMTTools_CheckerSI.jxx [new file with mode: 0644]
src/NMTTools/NMTTools_CheckerSI_1.cxx [new file with mode: 0755]
src/NMTTools/NMTTools_DEProcessor.cxx
src/NMTTools/NMTTools_PaveFiller.cdl
src/NMTTools/NMTTools_PaveFiller.cxx
src/NMTTools/NMTTools_PaveFiller.hxx
src/NMTTools/NMTTools_PaveFiller.jxx
src/NMTTools/NMTTools_PaveFiller_0.cxx
src/NMTTools/NMTTools_PaveFiller_1.cxx
src/NMTTools/NMTTools_PaveFiller_2.cxx
src/NMTTools/NMTTools_PaveFiller_3.cxx
src/NMTTools/NMTTools_PaveFiller_4.cxx
src/NMTTools/NMTTools_PaveFiller_5.cxx
src/NMTTools/NMTTools_PaveFiller_6.cxx
src/NMTTools/NMTTools_PaveFiller_7.cxx
src/OBJECT/GEOM_AssemblyBuilder.cxx
src/OperationGUI/OperationGUI_ArchimedeDlg.cxx
src/OperationGUI/OperationGUI_ChamferDlg.cxx
src/OperationGUI/OperationGUI_ClippingDlg.cxx
src/OperationGUI/OperationGUI_FilletDlg.cxx
src/OperationGUI/OperationGUI_PartitionDlg.cxx
src/OperationGUI/OperationGUI_PartitionDlg.h
src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h
src/RepairGUI/RepairGUI_GlueDlg.cxx
src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx
src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx
src/TransformationGUI/TransformationGUI_OffsetDlg.cxx
src/TransformationGUI/TransformationGUI_RotationDlg.cxx
src/TransformationGUI/TransformationGUI_ScaleDlg.cxx
src/TransformationGUI/TransformationGUI_TranslationDlg.cxx
src/TransformationGUI/TransformationGUI_TranslationDlg.h

index cce3dce8f1180652dc125d7f1ccc6c493b7bcbb3..27672f14d2aefc040d79e53a68feee6eb75ce848 100755 (executable)
@@ -14,6 +14,7 @@
 
 ORIG_DIR=`pwd`
 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
+GEOM_WITH_GUI="yes"
 
 ########################################################################
 # Test if the KERNEL_ROOT_DIR is set correctly
@@ -28,16 +29,36 @@ fi
 #    echo "failed : KERNEL_SRC variable is not correct !"
 #    exit
 #fi
+
+for option
+do
+  case $option in
+      -with-ihm | --with-ihm)
+          GEOM_WITH_GUI="yes"
+          break;;
+      -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no)
+          GEOM_WITH_GUI="no"
+          break;;
+  esac
+done
+
 ########################################################################
 # Test if the GUI_ROOT_DIR is set correctly
-if test ! -d "${GUI_ROOT_DIR}"; then
-    echo "failed : GUI_ROOT_DIR variable is not correct !"
-    exit
+if test ${GEOM_WITH_GUI} = yes; then
+    if test ! -d "${GUI_ROOT_DIR}"; then
+        echo "failed : GUI_ROOT_DIR variable is not correct !"
+        exit
+    fi
 fi
 
 cd ${CONF_DIR}
 ABS_CONF_DIR=`pwd`
 
+#######################################################################
+# Update configure.ac script: to set NETGENPLUGIN_WITH_GUI variable
+sed -e s/GEOM_WITH_GUI=[a-z]*/GEOM_WITH_GUI=${GEOM_WITH_GUI}/g configure.ac > configure.tmp
+mv -f configure.tmp configure.ac
+
 mkdir -p salome_adm/unix/config_files
 #cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
 #cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
@@ -64,9 +85,14 @@ cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
 #   autom4te.cache (directory)
 echo "====================================================== aclocal"
 
-aclocal -I adm_local/unix/config_files \
-        -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-       -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
+if test ${GEOM_WITH_GUI} = yes; then
+  aclocal -I adm_local/unix/config_files \
+          -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+          -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
+else
+  aclocal -I adm_local/unix/config_files \
+          -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files || exit 1
+fi
 
 # ____________________________________________________________________
 # libtoolize creates some configuration files (ltmain.sh,
index 032af63cca44fce1c6537a6b763a49f5e2716d86..d8ef0003b9dd42f6d5f749fcd340967f7fca5d57 100644 (file)
@@ -213,37 +213,65 @@ corba=make_$ORB
 CORBA=adm_local/unix/$corba
 
 fi
+
 echo
 echo ---------------------------------------------
-echo testing openGL
+echo testing msg2qm
 echo ---------------------------------------------
 echo
 
-CHECK_OPENGL
+CHECK_MSG2QM
 
-echo
-echo ---------------------------------------------
-echo testing QT
-echo ---------------------------------------------
-echo
 
-CHECK_QT
+GEOM_WITH_GUI=yes
 
-echo
-echo ---------------------------------------------
-echo testing msg2qm
-echo ---------------------------------------------
-echo
+AM_CONDITIONAL(GEOM_ENABLE_GUI, [test "${GEOM_WITH_GUI}" = "yes"])
 
-CHECK_MSG2QM
+if test "${GEOM_WITH_GUI}" = "yes"; then
+    echo
+    echo ---------------------------------------------
+    echo testing openGL
+    echo ---------------------------------------------
+    echo
 
-echo
-echo ---------------------------------------------
-echo testing VTK
-echo ---------------------------------------------
-echo
+    CHECK_OPENGL
+
+    echo
+    echo ---------------------------------------------
+    echo testing QT
+    echo ---------------------------------------------
+    echo
+
+    CHECK_QT
 
-CHECK_VTK
+    echo
+    echo ---------------------------------------------
+    echo testing VTK
+    echo ---------------------------------------------
+    echo
+
+    CHECK_VTK
+
+    echo
+    echo ---------------------------------------------
+    echo Testing GUI
+    echo ---------------------------------------------
+    echo
+
+    CHECK_SALOME_GUI
+
+    echo
+    echo ---------------------------------------------
+    echo Testing full GUI
+    echo ---------------------------------------------
+    echo
+
+    CHECK_CORBA_IN_GUI
+    if test "x${CORBA_IN_GUI}" != "xyes"; then
+      echo "failed : For configure GEOM module necessary full GUI !"
+      exit
+    fi
+fi
 
 echo
 echo ---------------------------------------------
@@ -277,26 +305,6 @@ echo
 
 CHECK_HTML_GENERATORS
 
-echo
-echo ---------------------------------------------
-echo Testing GUI
-echo ---------------------------------------------
-echo
-
-CHECK_SALOME_GUI
-
-echo
-echo ---------------------------------------------
-echo Testing full GUI
-echo ---------------------------------------------
-echo
-
-CHECK_CORBA_IN_GUI
-if test "x${CORBA_IN_GUI}" != "xyes"; then
-  echo "failed : For configure GEOM module necessary full GUI !"
-  exit
-fi
-
 echo
 echo ---------------------------------------------
 echo Testing Kernel
@@ -387,6 +395,7 @@ AC_OUTPUT([ \
   ./src/GEOM_I/Makefile \
   ./src/GEOM_I_Superv/Makefile \
   ./src/GEOM_SWIG/Makefile \
+  ./src/GEOM_SWIG_WITHIHM/Makefile \
   ./src/GenerationGUI/Makefile \
   ./src/GroupGUI/Makefile \
   ./src/IGESExport/Makefile \
index 05c9fe46f90fc9f285614c2e7eb5869132cda9ca..118971724068050cac991dc835098a36e9c2858d 100644 (file)
@@ -896,7 +896,7 @@ module GEOM
      *  \param theSeqSubBases - list of corresponding subshapes of section shapes.
      *  \param theLocations - list of locations on the path corresponding
      *                        specified list of the Bases shapes. Number of locations
-     *                        should be equal to number of bases or list of locations can be empty.
+     *                        should be equal to number of bases.
      *  \param thePath - Path shape to extrude the base shape along it.
      *  \param theWithContact - the mode defining that the section is translated to be in
      *                          contact with the spine.
@@ -985,9 +985,10 @@ module GEOM
      *  Replace coincident faces in theShape by one face.
      *  \param theShape Initial shape.
      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
+     *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
      *  \return New GEOM_Object, containing a copy of theShape without coincident faces.
      */
-    GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance);
+    GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance, in boolean doKeepNonSolids);
 
     /*!
      *  Find coincident faces in theShape for possible gluing.
@@ -1003,10 +1004,11 @@ module GEOM
      *  \param theShape Initial shape.
      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
      *  \param theFaces List of faces for gluing.
+     *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
      *  \return New GEOM_Object, containing a copy of theShape without some faces.
      */
     GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, in double theTolerance,
-                                    in ListOfGO theFaces);
+                                    in ListOfGO theFaces, in boolean doKeepNonSolids);
 
     /*!
      *  Explode a shape on subshapes of a given type.
@@ -1309,7 +1311,7 @@ module GEOM
                             in shape_state theState);
 
     /*!
-     *  Get sub-shape(s) of theShapeWhere, which are
+     *  Get sub-shape(s) of \a theShapeWhere, which are
      *  coincident with \a theShapeWhat or could be a part of it.
      *  \param theShapeWhere Shape to find sub-shapes of.
      *  \param theShapeWhat Shape, specifying what to find.
@@ -1318,6 +1320,23 @@ module GEOM
     GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
                            in GEOM_Object theShapeWhat);
 
+    /*!
+     *  Get sub-shape(s) of \a theShapeWhere, which are
+     *  coincident with \a theShapeWhat or could be a part of it.
+     *
+     *  Implementation of this method is based on a saved history of an operation,
+     *  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
+     *  arguments (an argument shape or a sub-shape of an argument shape).
+     *  The operation could be the Partition or one of boolean operations,
+     *  performed on simple shapes (not on compounds).
+     *
+     *  \param theShapeWhere Shape to find sub-shapes of.
+     *  \param theShapeWhat Shape, specifying what to find.
+     *  \return Group of all found sub-shapes or a single found sub-shape.
+     */
+    GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
+                                    in GEOM_Object theShapeWhat);
+
     /*!
      *  Get sub-shape of theShapeWhere, which are
      *  coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
@@ -1690,6 +1709,10 @@ module GEOM
      *  \note  Each compound from ListShapes and ListTools will be exploded in order
      *         to avoid possible intersection between shapes from this compound.
      *  \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
+     #  \param KeepNonlimitShapes: if this parameter == 0 - only shapes with
+     #                             type <= Limit are kept in the result,
+     #                             else - shapes with type > Limit are kept
+     #                             also (if they exist)
      *
      *  After implementation new version of PartitionAlgo (October 2006)
      *  other parameters are ignored by current functionality. They are kept
@@ -1710,7 +1733,8 @@ module GEOM
                               in ListOfGO   theRemoveInside,
                               in short      theLimit,
                               in boolean    theRemoveWebs,
-                              in ListOfLong theMaterials);
+                              in ListOfLong theMaterials,
+                              in short      theKeepNonlimitShapes);
 
     /*!
      *  Perform partition operation.
@@ -1731,7 +1755,8 @@ module GEOM
                                                      in ListOfGO   theRemoveInside,
                                                      in short      theLimit,
                                                      in boolean    theRemoveWebs,
-                                                     in ListOfLong theMaterials);
+                                                     in ListOfLong theMaterials,
+                                                     in short      theKeepNonlimitShapes);
 
     /*!
      *  Perform partition of the Shape with the Plane
index 92e6fc36d8695eabdca9fce3f0b0c5168bb96c1a..4ad14db98f405e221cf56fdcfd7537b30666cad0 100644 (file)
@@ -198,7 +198,8 @@ module GEOM
                               in GEOM_List   theRemoveInside,
                               in short       theLimit,
                               in boolean     theRemoveWebs,
-                              in GEOM_List   theMaterials) ;
+                              in GEOM_List   theMaterials,
+                              in short       theKeepNonlimitShapes);
     GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
                                   in GEOM_Object thePlane) ;
 
@@ -312,12 +313,14 @@ module GEOM
     GEOM_Object MakeSolidShells (in GEOM_List theShells) ;
     GEOM_Object MakeCompound (in GEOM_List theShapes) ;
     GEOM_Object MakeGlueFaces (in GEOM_Object theShape, 
-                              in double theTolerance);
+                              in double theTolerance,
+                              in boolean doKeepNonSolids);
     GEOM_List GetGlueFaces (in GEOM_Object theShape, 
                            in double theTolerance);
     GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, 
                                     in double theTolerance,
-                                    in ListOfGO theFaces);
+                                    in ListOfGO theFaces,
+                                    in boolean doKeepNonSolids);
     GEOM_List MakeExplode (in GEOM_Object theShape,
                           in long        theShapeType,
                           in boolean     isSorted) ;
index 4b05e9c22168fb8c52acfdaf8625effd357a7575..2a3f4aa094b9279903d727f6c2b952175675fbb1 100644 (file)
                     </outParameter-list>
                     <DataStream-list></DataStream-list>
                 </component-service>
+                    <component-service>
+                        <service-name>GetDumpName</service-name>
+                        <service-author></service-author>
+                        <service-version></service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list>
+                            <inParameter>
+                                <inParameter-name>theStudyEntry</inParameter-name>
+                                <inParameter-type>string</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                        </inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>string</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
+                    <component-service>
+                        <service-name>GetAllDumpNames</service-name>
+                        <service-author></service-author>
+                        <service-version></service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list></inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>string_array</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
             </component-service-list>
         </component-interface-list>
     <constraint>hostname = localhost</constraint>
             <component-name>GEOM_Superv</component-name>
             <component-username>GEOM_Superv</component-username>
             <component-type>OTHER</component-type>
-            <component-author>mkr</component-author>
+            <component-author></component-author>
             <component-version>@VERSION@</component-version>
             <component-comment>Supervision wrapper for Geometry component</component-comment>
             <component-multistudy>1</component-multistudy>
-           <component-impltype>1</component-impltype>
+            <component-impltype>1</component-impltype>
             <component-icone></component-icone>
             <constraint></constraint>
             <component-interface-list>
                 <component-service-list>
                     <component-service>
                         <service-name>SetStudyID</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>CreateListOfGO</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list></inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>AddItemToListOfGO</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>CreateListOfLong</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list></inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>AddItemToListOfLong</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>CreateListOfDouble</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list></inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>AddItemToListOfDouble</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakePointXYZ</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakePointWithReference</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakePointOnCurve</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list>
+                            <inParameter>
+                                <inParameter-name>theRefCurve</inParameter-name>
+                                <inParameter-type>GEOM_Object</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theParameter</inParameter-name>
+                                <inParameter-type>double</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                        </inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>GEOM_Object</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
+                    <component-service>
+                        <service-name>MakeTangentOnCurve</service-name>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeVectorDXDYDZ</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeVectorTwoPnt</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeLineTwoPnt</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakePlaneThreePnt</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakePlanePntVec</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakePlaneFace</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeMarker</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                         </outParameter-list>
                         <DataStream-list></DataStream-list>
                     </component-service>
+                    <component-service>
+                        <service-name>MakeTangentPlaneOnFace</service-name>
+                        <service-author></service-author>
+                        <service-version></service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list>
+                            <inParameter>
+                                <inParameter-name>theFace</inParameter-name>
+                                <inParameter-type>GEOM_Object</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theParameterU</inParameter-name>
+                                <inParameter-type>double</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theParameterV</inParameter-name>
+                                <inParameter-type>double</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theTrimSize</inParameter-name>
+                                <inParameter-type>double</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                        </inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>GEOM_Object</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
                     <component-service>
                         <service-name>MakeBox</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeBoxDXDYDZ</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeBoxTwoPnt</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeCylinderPntVecRH</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeCylinderRH</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeSphere</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeSphereR</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeSpherePntR</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeTorusPntVecRR</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeTorusRR</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeConePntVecR1R2H</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeConeR1R2H</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakePrismVecH</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakePrismTwoPnt</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakePipe</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeRevolutionAxisAngle</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeFilling</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                         </outParameter-list>
                         <DataStream-list></DataStream-list>
                     </component-service>
+                    <component-service>
+                        <service-name>MakeThruSections</service-name>
+                        <service-author></service-author>
+                        <service-version></service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list>
+                            <inParameter>
+                                <inParameter-name>theSeqSections</inParameter-name>
+                                <inParameter-type>ListOfGO</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theModeSolid</inParameter-name>
+                                <inParameter-type>boolean</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>thePreci</inParameter-name>
+                                <inParameter-type>double</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theRuled</inParameter-name>
+                                <inParameter-type>boolean</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                        </inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>GEOM_Object</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
+                    <component-service>
+                        <service-name>MakePipeWithDifferentSections</service-name>
+                        <service-author></service-author>
+                        <service-version></service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list>
+                            <inParameter>
+                                <inParameter-name>theSeqBases</inParameter-name>
+                                <inParameter-type>ListOfGO</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theLocations</inParameter-name>
+                                <inParameter-type>ListOfGO</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>thePath</inParameter-name>
+                                <inParameter-type>GEOM_Object</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theWithContact</inParameter-name>
+                                <inParameter-type>boolean</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theWithCorrection</inParameter-name>
+                                <inParameter-type>boolean</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                        </inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>GEOM_Object</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
+                    <component-service>
+                        <service-name>MakePipeWithShellSections</service-name>
+                        <service-author></service-author>
+                        <service-version></service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list>
+                            <inParameter>
+                                <inParameter-name>theSeqBases</inParameter-name>
+                                <inParameter-type>ListOfGO</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theSeqSubBases</inParameter-name>
+                                <inParameter-type>ListOfGO</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theLocations</inParameter-name>
+                                <inParameter-type>ListOfGO</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>thePath</inParameter-name>
+                                <inParameter-type>GEOM_Object</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theWithContact</inParameter-name>
+                                <inParameter-type>boolean</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theWithCorrection</inParameter-name>
+                                <inParameter-type>boolean</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                        </inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>GEOM_Object</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
                     <component-service>
                         <service-name>MakeBoolean</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeFuse</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakePartition</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                                 <inParameter-type>GEOM_List</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
+                            <inParameter>
+                                <inParameter-name>theKeepNonlimitShapes</inParameter-name>
+                                <inParameter-type>short</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
                         </inParameter-list>
                         <outParameter-list>
                             <outParameter>
                     </component-service>
                     <component-service>
                         <service-name>MakeHalfPartition</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>Export</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>Import</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>ImportTranslators</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list></inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>ExportTranslators</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list></inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>TranslateTwoPoints</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>TranslateTwoPointsCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>TranslateDXDYDZ</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>TranslateDXDYDZCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>TranslateVector</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>TranslateVectorCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MultiTranslate1D</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MultiTranslate2D</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>Rotate</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>RotateCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>RotateThreePoints</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>RotateThreePointsCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MultiRotate1D</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MultiRotate2D</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MirrorPlane</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MirrorPlaneCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MirrorAxis</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MirrorAxisCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MirrorPoint</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MirrorPointCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>OffsetShape</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>OffsetShapeCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>ScaleShape</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>ScaleShapeCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>PositionShape</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>PositionShapeCopy</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeEdge</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeWire</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeFace</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeFaceWires</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeShell</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeSolidShell</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeSolidShells</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeCompound</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeGlueFaces</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list>
+                            <inParameter>
+                                <inParameter-name>theShape</inParameter-name>
+                                <inParameter-type>GEOM_Object</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theTolerance</inParameter-name>
+                                <inParameter-type>double</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>doKeepNonSolids</inParameter-name>
+                                <inParameter-type>boolean</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                        </inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>GEOM_Object</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
+                    <component-service>
+                        <service-name>GetGlueFaces</service-name>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                         </inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>GEOM_List</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
+                    <component-service>
+                        <service-name>MakeGlueFacesByList</service-name>
+                        <service-author></service-author>
+                        <service-version></service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list>
+                            <inParameter>
+                                <inParameter-name>theShape</inParameter-name>
+                                <inParameter-type>GEOM_Object</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theTolerance</inParameter-name>
+                                <inParameter-type>double</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>theFaces</inParameter-name>
+                                <inParameter-type>ListOfGO</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                            <inParameter>
+                                <inParameter-name>doKeepNonSolids</inParameter-name>
+                                <inParameter-type>boolean</inParameter-type>
+                                <inParameter-comment>unknown</inParameter-comment>
+                            </inParameter>
+                        </inParameter-list>
                         <outParameter-list>
                             <outParameter>
                                 <outParameter-name>return</outParameter-name>
                     </component-service>
                     <component-service>
                         <service-name>MakeExplode</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>NumberOfFaces</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>NumberOfEdges</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>ChangeOrientation</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeQuad4Vertices</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeQuad</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeQuad2Edges</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeHexa</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeHexa2Faces</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetPoint</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetEdge</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetEdgeNearPoint</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetFaceByPoints</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetFaceByEdges</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetOppositeFace</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetFaceNearPoint</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetFaceByNormale</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>IsCompoundOfBlocks</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                         <outParameter-list>
                             <outParameter>
                                 <outParameter-name>return</outParameter-name>
-                                <outParameter-type>long</outParameter-type>
+                                <outParameter-type>boolean</outParameter-type>
                                 <outParameter-comment>unknown</outParameter-comment>
                             </outParameter>
                             <outParameter>
                     </component-service>
                     <component-service>
                         <service-name>CheckCompoundOfBlocks</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                         <outParameter-list>
                             <outParameter>
                                 <outParameter-name>return</outParameter-name>
-                                <outParameter-type>long</outParameter-type>
+                                <outParameter-type>boolean</outParameter-type>
                                 <outParameter-comment>unknown</outParameter-comment>
                             </outParameter>
                             <outParameter>
                     </component-service>
                     <component-service>
                         <service-name>PrintBCErrors</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>ExplodeCompoundOfBlocks</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetBlockNearPoint</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetBlockByParts</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetBlocksByParts</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeMultiTransformation1D</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeMultiTransformation2D</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeCirclePntVecR</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeCircleThreePnt</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeEllipse</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeArc</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeArcCenter</service-name>
-                        <service-author>ngr</service-author>
-                        <service-version>3.2.6</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                             </outParameter>
                         </outParameter-list>
                         <DataStream-list></DataStream-list>
-                    </component-service>                    <component-service>
+                    </component-service>
+                    <component-service>
                         <service-name>MakePolyline</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeSplineBezier</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeSplineInterpolation</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeSketcher</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeFilletAll</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeFilletEdges</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeFilletFaces</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeChamferAll</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeChamferEdge</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeChamferFaces</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>MakeArchimede</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetSubShapeIndex</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>CreateGroup</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>AddObject</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>RemoveObject</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetType</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetMainShape</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>GetObjects</service-name>
-                        <service-author>mkr</service-author>
-                        <service-version>2.1.0</service-version>
+                        <service-author></service-author>
+                        <service-version></service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
index fec43e01e817b5f22fb9b52604f7014872bc25b2..86ea68832cf04e3b43592b8b4a33c5708e4f6967 100644 (file)
@@ -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
 //
 //
 //
 
 #include <qlabel.h>
 
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <GC_MakeArcOfCircle.hxx>
-#include <Geom_TrimmedCurve.hxx>
-#include <Precision.hxx>
-
 #include "GEOMImpl_Types.hxx"
 
 #include "utilities.h"
 
-using namespace std;
-
 //=================================================================================
 // class    : BasicGUI_ArcDlg()
 // purpose  : Constructs a BasicGUI_ArcDlg which is a child of 'parent', with the
@@ -58,9 +51,10 @@ BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
   : 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_ARC")));
-  QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC_CENTER")));
-  QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  QPixmap image0(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_ARC")));
+  QPixmap image1(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_ARC_CENTER")));
+  QPixmap image2(aResMgr->loadPixmap("GEOM",tr("ICON_SELECT")));
 
   setCaption(tr("GEOM_ARC_TITLE"));
 
@@ -98,11 +92,12 @@ BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
   Group3Pnts2->PushButton1->setPixmap(image2);
   Group3Pnts2->PushButton2->setPixmap(image2);
   Group3Pnts2->PushButton3->setPixmap(image2);
-  
+
   Group3Pnts2->radioButton4->setText(tr("GEOM_REVERSE"));
 
   Layout1->addWidget( Group3Pnts, 2, 0 );
   Layout1->addWidget( Group3Pnts2, 2, 0 );
+  /***************************************************************/
 
   setHelpFileName("arc.htm");
 
@@ -126,13 +121,7 @@ BasicGUI_ArcDlg::~BasicGUI_ArcDlg()
 void BasicGUI_ArcDlg::Init()
 {
   /* init variables */
-  // myGeomGUI->SetState( 0 );
-  globalSelection( GEOM_POINT );
-  
-  myConstructorId = -1;
   myEditCurrentArgument = Group3Pnts->LineEdit1;
-  myEditCurrentArgument->setFocus();
-
   myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
   Group3Pnts2->radioButton4->setChecked(FALSE);
 
@@ -140,9 +129,9 @@ void BasicGUI_ArcDlg::Init()
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
   connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+
   connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
+
   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
 
@@ -153,7 +142,7 @@ void BasicGUI_ArcDlg::Init()
   connect(Group3Pnts->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
   connect(Group3Pnts->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
   connect(Group3Pnts->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  
+
   connect(Group3Pnts2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(Group3Pnts2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(Group3Pnts2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
@@ -161,36 +150,80 @@ void BasicGUI_ArcDlg::Init()
   connect(Group3Pnts2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
   connect(Group3Pnts2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
   connect(Group3Pnts2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  
+
   connect(Group3Pnts2->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
 
   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
-  initName( tr( "GEOM_ARC" )); 
-  
-
+  initName( tr( "GEOM_ARC" ));
   ConstructorsClicked( 0 );
 }
 
 
 //=================================================================================
-// function : ClickOnOk()
-// purpose  :
+// function : ConstructorsClicked()
+// purpose  : Radio button management
 //=================================================================================
-void BasicGUI_ArcDlg::ClickOnOk()
+void BasicGUI_ArcDlg::ConstructorsClicked (int constructorId)
 {
-  if ( ClickOnApply() )
-    ClickOnCancel();
+  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
+  switch (constructorId)
+  {
+  case 0:
+    {
+      globalSelection( GEOM_POINT );
+
+      Group3Pnts->show();
+      resize(0, 0);
+      Group3Pnts2->hide();
+
+      Group3Pnts->LineEdit1->setText(Group3Pnts2->LineEdit1->text());
+      Group3Pnts->LineEdit2->setText(Group3Pnts2->LineEdit2->text());
+      Group3Pnts->LineEdit3->setText(Group3Pnts2->LineEdit3->text());
+
+      myEditCurrentArgument = Group3Pnts->LineEdit1;
+
+      break;
+    }
+  case 1:
+    {
+      globalSelection( GEOM_POINT );
+
+      Group3Pnts->hide();
+      resize(0, 0);
+      Group3Pnts2->show();
+
+      Group3Pnts2->LineEdit1->setText(Group3Pnts->LineEdit1->text());
+      Group3Pnts2->LineEdit2->setText(Group3Pnts->LineEdit2->text());
+      Group3Pnts2->LineEdit3->setText(Group3Pnts->LineEdit3->text());
+
+      myEditCurrentArgument = Group3Pnts2->LineEdit1;
+
+      break;
+    }
+  }
+
+  myEditCurrentArgument->setFocus();
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+          this, SLOT(SelectionIntoArgument()));
+
+  if (CORBA::is_nil(myPoint1))
+    SelectionIntoArgument();
+
+  displayPreview();
 }
 
+
 //=================================================================================
-// function : ClickOnCancel()
+// function : ClickOnOk()
 // purpose  :
 //=================================================================================
-void BasicGUI_ArcDlg::ClickOnCancel()
+void BasicGUI_ArcDlg::ClickOnOk()
 {
-  GEOMBase_Skeleton::ClickOnCancel();
+  if ( ClickOnApply() )
+    ClickOnCancel();
 }
 
 //=================================================================================
@@ -203,19 +236,6 @@ bool BasicGUI_ArcDlg::ClickOnApply()
     return false;
 
   initName();
-
-  // reset
-  myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
-  Group3Pnts->LineEdit1->setText( "" );
-  Group3Pnts->LineEdit2->setText( "" );
-  Group3Pnts->LineEdit3->setText( "" );
-  Group3Pnts2->LineEdit1->setText( "" );
-  Group3Pnts2->LineEdit2->setText( "" );
-  Group3Pnts2->LineEdit3->setText( "" );
-  if (getConstructorId() == 0)  myEditCurrentArgument = Group3Pnts->LineEdit1;
-  if (getConstructorId() == 1)  myEditCurrentArgument = Group3Pnts2->LineEdit1;
-
-  ConstructorsClicked( getConstructorId() );
   return true;
 }
 
@@ -228,21 +248,23 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
 {
   if ((getConstructorId() != 0) && (getConstructorId() != 1))
     return;
-  
+
   myEditCurrentArgument->setText("");
-  if ( IObjectCount() != 1 ){
+
+  if ( IObjectCount() != 1 )
+  {
     switch (getConstructorId())
     {
-      case 0:
-      {  
-          if      ( myEditCurrentArgument == Group3Pnts->LineEdit1 )   myPoint1 = GEOM::GEOM_Object::_nil();
-          else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 )   myPoint2 = GEOM::GEOM_Object::_nil();
-          else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 )   myPoint3 = GEOM::GEOM_Object::_nil();
-          return;
-          break;
+    case 0:
+      {
+        if      ( myEditCurrentArgument == Group3Pnts->LineEdit1 )   myPoint1 = GEOM::GEOM_Object::_nil();
+        else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 )   myPoint2 = GEOM::GEOM_Object::_nil();
+        else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 )   myPoint3 = GEOM::GEOM_Object::_nil();
+        return;
+        break;
       }
-      case 1:
-      {  
+    case 1:
+      {
         if      ( myEditCurrentArgument == Group3Pnts2->LineEdit1 )   myPoint1 = GEOM::GEOM_Object::_nil();
         else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 )   myPoint2 = GEOM::GEOM_Object::_nil();
         else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 )   myPoint3 = GEOM::GEOM_Object::_nil();
@@ -250,7 +272,8 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
         break;
       }
     }
-  }   
+  }
+
   // nbSel == 1
   Standard_Boolean aRes = Standard_False;
   GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
@@ -281,6 +304,22 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
 }
 
 
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose  :
+//=================================================================================
+void BasicGUI_ArcDlg::LineEditReturnPressed()
+{
+  QLineEdit* send = (QLineEdit*)sender();
+  if (send == Group3Pnts->LineEdit1  || send == Group3Pnts->LineEdit2  || send == Group3Pnts->LineEdit3 ||
+      send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3)
+  {
+    myEditCurrentArgument = send;
+    GEOMBase_Skeleton::LineEditReturnPressed();
+  }
+}
+
+
 //=================================================================================
 // function : SetEditCurrentArgument()
 // purpose  :
@@ -310,22 +349,6 @@ void BasicGUI_ArcDlg::SetEditCurrentArgument()
 }
 
 
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose  :
-//=================================================================================
-void BasicGUI_ArcDlg::LineEditReturnPressed()
-{
-  QLineEdit* send = (QLineEdit*)sender();
-  if ( send == Group3Pnts->LineEdit1 || send == Group3Pnts->LineEdit2 || send == Group3Pnts->LineEdit3 ||
-       send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3 )
-  {
-    myEditCurrentArgument = send;
-    GEOMBase_Skeleton::LineEditReturnPressed();
-  }
-}
-
-
 //=================================================================================
 // function : ActivateThisDialog()
 // purpose  :
@@ -333,33 +356,13 @@ void BasicGUI_ArcDlg::LineEditReturnPressed()
 void BasicGUI_ArcDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
-          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
-  // myGeomGUI->SetState( 0 );
-  globalSelection( GEOM_POINT );
-
-  myEditCurrentArgument = Group3Pnts->LineEdit1;
-  myEditCurrentArgument->setFocus();
 
-  Group3Pnts->LineEdit1->setText( "" );
-  Group3Pnts->LineEdit2->setText( "" );
-  Group3Pnts->LineEdit3->setText( "" );
-  myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
+  connect(myGeomGUI->getApp()->selectionMgr(),
+          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   ConstructorsClicked( getConstructorId() );
-  
 }
 
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose  : public slot to deactivate if active
-//=================================================================================
-void BasicGUI_ArcDlg::DeactivateActiveDialog()
-{
-  // myGeomGUI->SetState( -1 );
-  GEOMBase_Skeleton::DeactivateActiveDialog();
-}
 
 //=================================================================================
 // function : enterEvent()
@@ -367,10 +370,11 @@ void BasicGUI_ArcDlg::DeactivateActiveDialog()
 //=================================================================================
 void BasicGUI_ArcDlg::enterEvent(QEvent* e)
 {
-  if ( !GroupConstructors->isEnabled() )
+  if (!GroupConstructors->isEnabled())
     ActivateThisDialog();
 }
 
+
 //=================================================================================
 // function : createOperation
 // purpose  :
@@ -410,71 +414,33 @@ bool BasicGUI_ArcDlg::execute( ObjectList& objects )
 
   switch (getConstructorId())
   {
-    case 0:
+  case 0:
+    {
+      if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) )
       {
-        if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) ){
-          anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArc(myPoint1, myPoint2, myPoint3);
-          res = true;
-        }
-        break;
+        anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->
+          MakeArc(myPoint1, myPoint2, myPoint3);
+        res = true;
       }
-    case 1:
-    {
-        bool Sense;
-        (Group3Pnts2->radioButton4->isChecked()) ? Sense=true : Sense = false;
-        if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) ){
-          anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArcCenter(myPoint1, myPoint2, myPoint3,Sense);
-          res = true;
-        }
-        break;
-    }
-  }
-  if ( !anObj->_is_nil() ){
-    objects.push_back( anObj._retn() );
-  }
-  return res;
-}
-
-//=================================================================================
-// function : closeEvent
-// purpose  :
-//=================================================================================
-void BasicGUI_ArcDlg::closeEvent( QCloseEvent* e )
-{
-  GEOMBase_Skeleton::closeEvent( e );
-}
-
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose  : Radio button management
-//=================================================================================
-void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
-{
-
-  disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
-
-  switch (constructorId)
-  {
-    case 0:
-    {
-      Group3Pnts->show();
-      resize(0, 0);
-      Group3Pnts2->hide();
-
-     connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
       break;
     }
-    case 1:
+  case 1:
     {
-      Group3Pnts->hide();
-      resize(0, 0);
-      Group3Pnts2->show();
-      connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
+      bool Sense;
+      (Group3Pnts2->radioButton4->isChecked()) ? Sense = true : Sense = false;
+      if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) )
+      {
+        anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->
+          MakeArcCenter(myPoint1, myPoint2, myPoint3, Sense);
+        res = true;
+      }
       break;
     }
   }
-  displayPreview();
+  if ( !anObj->_is_nil() )
+    objects.push_back( anObj._retn() );
+
+  return res;
 }
 
 //=================================================================================
index 6a5e732172300f7a5c26987ac7df770c6d0f9d6d..9fdcc6ba6b6d09214579a00e4534a6b472ee695f 100644 (file)
@@ -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
 //
 //
 //
@@ -28,7 +28,7 @@
 #ifndef DIALOGBOX_ARC_H
 #define DIALOGBOX_ARC_H
 
-#include  "GEOM_BasicGUI.hxx"
+#include "GEOM_BasicGUI.hxx"
 
 #include "GEOMBase_Skeleton.h"
 #include "DlgRef_3Sel_QTD.h"
@@ -53,12 +53,10 @@ protected:
     virtual bool isValid( QString& );
     virtual bool execute( ObjectList& objects );
 
-    virtual void closeEvent( QCloseEvent* e );    
-
-private :
+private:
     void Init();
     void enterEvent(QEvent* e);
-    int myConstructorId;
+
     GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
 
     DlgRef_3Sel_QTD* Group3Pnts;
@@ -66,12 +64,10 @@ private :
 
 private slots:
     void ClickOnOk();
-    void ClickOnCancel();
     bool ClickOnApply();
-    
+
     void ActivateThisDialog();
-    void DeactivateActiveDialog();
-    void ConstructorsClicked( int );
+    void ConstructorsClicked(int);
     void LineEditReturnPressed();
     void SelectionIntoArgument();
     void SetEditCurrentArgument();
index ce76529d0e60780c6307c12e861413a55f6c8c56..42c3e5aa5ff0cb4aa33b11b20886d03a270f6846 100644 (file)
@@ -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, COORD_MAX, aStep, 3);
+  GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
   GroupPntVecR->SpinBox_DX->SetValue( 100 );
 
   /* signals and slots connections */
index ba6db7d30a171d68574b0a8b26cdedf6b12a6055..7103838b5b697905512be41984b6887af3035649 100644 (file)
@@ -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, COORD_MAX, step, 3 );
-  GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
+  GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY );
+  GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY );
   GroupPoints->SpinBox_DX->SetValue( aMajorR );
   GroupPoints->SpinBox_DY->SetValue( aMinorR );
 
index 99e7ff9a54406434ed32179fefa0dbad00bcbf26..17f6d25b49bb34bad6ec7ce13580b78300547c7a 100644 (file)
@@ -176,7 +176,7 @@ void BasicGUI_MarkerDlg::Init()
 
   for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
   {
-    anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 );
+    anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
     connect( anIter.data(), SIGNAL( valueChanged( double ) ),
              this, SLOT( onValueChanged( double ) ) );
   }
index a48162902d3307fbe105b1da8552bcfc92f6836c..62711faa6598a45fba4570c187c380c4eb11db41 100644 (file)
@@ -138,11 +138,11 @@ void BasicGUI_PlaneDlg::Init()
   double aTrimSize = 2000.0;
 
   /* min, max, step and decimals for spin boxes */
-  GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, aStep, 3 );
+  GroupPntDir->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
   GroupPntDir->SpinBox_DX->SetValue( aTrimSize );
-  Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
+  Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
   Group3Pnts->SpinBox_DX->SetValue( aTrimSize );
-  GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
+  GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
   GroupFace->SpinBox_DX->SetValue( aTrimSize );
 
   /* signals and slots connections */
index 16b642130b87f0c34d9dfe781022cc60dd178bf1..755a04b9b66bbb34578658ce17830ed0fbbf7ca0 100644 (file)
@@ -157,22 +157,22 @@ void BasicGUI_PointDlg::Init()
   double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
   
   /* min, max, step and decimals for spin boxes */
-  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->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
   GroupXYZ->SpinBox_DX->SetValue(0.0);
   GroupXYZ->SpinBox_DY->SetValue(0.0);
   GroupXYZ->SpinBox_DZ->SetValue(0.0);
 
-  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->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
   GroupRefPoint->SpinBox_DX->SetValue(0.0);
   GroupRefPoint->SpinBox_DY->SetValue(0.0);
   GroupRefPoint->SpinBox_DZ->SetValue(0.0);
 
   step = 0.1;
-  GroupOnCurve->SpinBox_DX->RangeStepAndValidator(0., 1., step, 3);
+  GroupOnCurve->SpinBox_DX->RangeStepAndValidator(0., 1., step, DBL_DIGITS_DISPLAY);
   GroupOnCurve->SpinBox_DX->SetValue( 0.5 );
 
   /* signals and slots connections */
index 48fb526cda7259e7f481418c0c284f4ae153136c..79a4f90c259246c7ad6466967220cd924be5f76e 100644 (file)
@@ -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(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);
+  GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
 
   double dx( 0. ), dy( 0. ), dz( 200. );
   GroupDimensions->SpinBox_DX->SetValue( dx );
diff --git a/src/DlgRef/DlgRef_2Sel1List1Check_QTD.cxx b/src/DlgRef/DlgRef_2Sel1List1Check_QTD.cxx
new file mode 100644 (file)
index 0000000..b469af6
--- /dev/null
@@ -0,0 +1,130 @@
+// 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
+//
+/****************************************************************************
+** Form implementation generated from reading ui file 'DlgRef_4Sel1List_QTD.ui'
+**
+** Created: lun oct 31 17:21:04 2006
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "DlgRef_2Sel1List1Check_QTD.h"
+
+#include <qvariant.h>
+#include <qcombobox.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qradiobutton.h>
+
+/* 
+ *  Constructs a DlgRef_2Sel1List_QTD which is a child of 'parent', with the 
+ *  name 'name' and widget flags set to 'f'.
+ */
+DlgRef_2Sel1List1Check_QTD::DlgRef_2Sel1List1Check_QTD( QWidget* parent,
+                                                       const char* name,
+                                                       WFlags fl )
+    : QWidget( parent, name, fl )
+{
+    if ( !name )
+       setName( "DlgRef_2Sel1List1Check_QTD" );
+    resize( 129, 175 ); 
+    setCaption( trUtf8( "DlgRef_2Sel1List1Check_QTD" ) );
+    DlgRef_2Sel1List1Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel1List1Check_QTDLayout"); 
+
+    GroupBox1 = new QGroupBox( this, "GroupBox1" );
+    GroupBox1->setTitle( trUtf8( "" ) );
+    GroupBox1->setColumnLayout(0, Qt::Vertical );
+    GroupBox1->layout()->setSpacing( 6 );
+    GroupBox1->layout()->setMargin( 11 );
+    GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+    GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+    Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); 
+
+    TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+    TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+    TextLabel1->setText( trUtf8( "TL1" ) );
+
+    Layout1->addWidget( TextLabel1, 0, 0 );
+
+    PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
+    PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
+    PushButton1->setText( trUtf8( "" ) );
+
+    Layout1->addWidget( PushButton1, 0, 1 );
+    
+    LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
+
+    Layout1->addWidget( LineEdit1, 0, 2 );
+   
+
+    TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+    TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+    TextLabel2->setText( trUtf8( "TL2" ) );
+
+    Layout1->addWidget( TextLabel2, 1, 0 );
+
+    PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
+    PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
+    PushButton2->setText( trUtf8( "" ) );
+
+    Layout1->addWidget( PushButton2, 1, 1 );
+    
+    LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
+
+    Layout1->addWidget( LineEdit2, 1, 2 );
+
+    
+    TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+    TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+    TextLabel3->setText( trUtf8( "TL3" ) );
+
+    Layout1->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 );
+    
+    ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
+    ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
+
+    Layout1->addWidget( ComboBox1, 2, 2 );
+   
+    radioButton4 = new QRadioButton( GroupBox1, "radioButton4" );
+    GroupBox1Layout->addMultiCellWidget( radioButton4, 3, 3, 0, 1 );
+
+    GroupBox1Layout->addLayout( Layout1, 0, 0 );
+    
+    DlgRef_2Sel1List1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
+
+    QSpacerItem* spacer = new QSpacerItem( 0, 80, QSizePolicy::Minimum, QSizePolicy::Expanding );
+    Layout1->addItem( spacer, 5, 2 );
+
+}
+
+/*  
+ *  Destroys the object and frees any allocated resources
+ */
+DlgRef_2Sel1List1Check_QTD::~DlgRef_2Sel1List1Check_QTD()
+{
+    // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/src/DlgRef/DlgRef_2Sel1List1Check_QTD.h b/src/DlgRef/DlgRef_2Sel1List1Check_QTD.h
new file mode 100644 (file)
index 0000000..14e7875
--- /dev/null
@@ -0,0 +1,69 @@
+// 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
+//
+/****************************************************************************
+** Form interface generated from reading ui file 'DlgRef_2Sel1List_QTD.ui'
+**
+** Created: lun oct 31 17:21:03 2006
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef DLGREF_2SEL1LIST_QTD_H
+#define DLGREF_2SEL1LIST_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout; 
+class QHBoxLayout; 
+class QGridLayout; 
+class QComboBox;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QRadioButton;
+
+class DlgRef_2Sel1List1Check_QTD : public QWidget
+{ 
+    Q_OBJECT
+
+public:
+    DlgRef_2Sel1List1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+    ~DlgRef_2Sel1List1Check_QTD();
+
+    QGroupBox* GroupBox1;
+    QLineEdit* LineEdit2;
+    QPushButton* PushButton1;
+    QPushButton* PushButton2;
+    QLabel* TextLabel1;
+    QLineEdit* LineEdit1;
+    QLabel* TextLabel2;
+    QComboBox* ComboBox1;
+    QLabel* TextLabel3;
+    QRadioButton* radioButton4;
+
+
+protected:
+    QGridLayout* DlgRef_2Sel1List1Check_QTDLayout;
+    QGridLayout* GroupBox1Layout;
+    QGridLayout* Layout1;
+};
+
+#endif // DLGREF_2SEL1LIST1CHECK_QTD_H
index dddb3e08729486b330af5085dacf29c6445a3eb8..0e2b081bcc8182aa612344220525399339a9fc42 100644 (file)
@@ -20,7 +20,7 @@
 /****************************************************************************
 ** Form implementation generated from reading ui file 'DlgRef_Skeleton_QTD.ui'
 **
-** Created: Fri Mar 17 11:18:06 2006
+** Created: Tue Mar 13 14:40:34 2007
 **      by: The User Interface Compiler ($Id$)
 **
 ** WARNING! All changes made in this file will be lost!
@@ -57,11 +57,6 @@ DlgRef_Skeleton_QTD::DlgRef_Skeleton_QTD( QWidget* parent, const char* name, boo
 
     Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); 
 
-    GroupMedium = new QGroupBox( this, "GroupMedium" );
-    GroupMedium->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupMedium->sizePolicy().hasHeightForWidth() ) );
-
-    Layout1->addWidget( GroupMedium, 2, 0 );
-
     GroupButtons = new QGroupBox( this, "GroupButtons" );
     GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth() ) );
     GroupButtons->setColumnLayout(0, Qt::Vertical );
@@ -155,19 +150,5 @@ DlgRef_Skeleton_QTD::~DlgRef_Skeleton_QTD()
  */
 void DlgRef_Skeleton_QTD::languageChange()
 {
-    setCaption( tr( "DlgRef_Skeleton_QTD" ) );
-    GroupMedium->setTitle( QString::null );
-    GroupButtons->setTitle( QString::null );
-    buttonOk->setText( tr( "&Ok" ) );
-    buttonApply->setText( tr( "&Apply" ) );
-    buttonCancel->setText( tr( "&Cancel" ) );
-    buttonHelp->setText( tr( "&Help" ) );
-    GroupConstructors->setTitle( QString::null );
-    RadioButton1->setText( QString::null );
-    RadioButton2->setText( QString::null );
-    RadioButton3->setText( QString::null );
-    RadioButton4->setText( QString::null );
-    GroupBoxName->setTitle( tr( "Result name" ) );
-    NameLabel->setText( tr( "Name" ) );
 }
 
index 511d489939ca84484763332b7901742ade877084..0ecfdfcaaff2b43862ba4768030160dc65d1fbe2 100644 (file)
@@ -20,7 +20,7 @@
 /****************************************************************************
 ** Form interface generated from reading ui file 'DlgRef_Skeleton_QTD.ui'
 **
-** Created: Fri Mar 17 11:18:06 2006
+** Created: Tue Mar 13 14:40:29 2007
 **      by: The User Interface Compiler ($Id$)
 **
 ** WARNING! All changes made in this file will be lost!
@@ -53,7 +53,6 @@ public:
     DlgRef_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
     ~DlgRef_Skeleton_QTD();
 
-    QGroupBox* GroupMedium;
     QGroupBox* GroupButtons;
     QPushButton* buttonOk;
     QPushButton* buttonApply;
index 8a7ad79314d1c3947c203ab76df5e8a568fd3a4e..35bec55ba5db9a59950f306a6db8cfc2cb04970e 100644 (file)
@@ -102,3 +102,28 @@ void DlgRef_SpinBox::RangeStepAndValidator(double min, double max,double step,
   setLineStep(step);
   ((QDoubleValidator*)validator())->setRange(min, max, decimals);
 }
+
+QString DlgRef_SpinBox::PrintDoubleValue (double theValue, int thePrecision)
+{
+  QString aRes;
+  aRes.setNum(theValue, 'g', thePrecision);
+
+  // remove trailing zeroes
+  QString delim( "." );
+
+  int idx = aRes.findRev( delim );
+  if ( idx == -1 )
+    return aRes;
+
+  QString iPart = aRes.left( idx );
+  QString fPart = aRes.mid( idx + 1 );
+
+  while ( !fPart.isEmpty() && fPart.at( fPart.length() - 1 ) == '0' )
+    fPart.remove( fPart.length() - 1, 1 );
+
+  aRes = iPart;
+  if ( !fPart.isEmpty() )
+    aRes += delim + fPart;
+
+  return aRes;
+}
index d9675462be7194c6cd414b1b82fc7b8333f87639..e576781d089441da363e12522e9006f269993a15 100644 (file)
@@ -36,6 +36,7 @@
 #define COORD_MIN -1e+15
 #define COORD_MAX +1e+15
 #define MAX_NUMBER 100000
+#define DBL_DIGITS_DISPLAY 16
 
 //=================================================================================
 // class    : DlgRef_SpinBox
@@ -54,10 +55,11 @@ public :
   void SetValue(double v);
   double GetValue();
   QString GetString();
+
+  static QString PrintDoubleValue (double theValue, int Precision = DBL_DIGITS_DISPLAY);
   
 public slots:
   void SetStep(double newStep);
-
 };
 
 #endif //  GEOMSPINBOX_H
index efc180f9005e06b557c39289ff89cc4100192051..27a7a9d8b2cda06c878c0d7f6c832ca0bc757f4c 100644 (file)
@@ -56,6 +56,7 @@ dist_libDlgRef_la_SOURCES = \
        DlgRef_3Sel4Spin2Check_QTD.cxx \
        DlgRef_4Sel1List_QTD.cxx \
        DlgRef_2Sel1List_QTD.cxx \
+       DlgRef_2Sel1List1Check_QTD.cxx \
        DlgRef_1List1Spin1Btn_QTD.cxx \
        DlgRef_4Sel1List1Check_QTD.cxx \
        DlgRef_1Spin_QTD.cxx \
@@ -112,6 +113,7 @@ MOC_FILES = \
        DlgRef_3Sel4Spin2Check_QTD_moc.cxx \
        DlgRef_4Sel1List_QTD_moc.cxx \
        DlgRef_2Sel1List_QTD_moc.cxx \
+       DlgRef_2Sel1List1Check_QTD_moc.cxx \
        DlgRef_1List1Spin1Btn_QTD_moc.cxx \
        DlgRef_4Sel1List1Check_QTD_moc.cxx \
        DlgRef_1Spin_QTD_moc.cxx \
@@ -170,6 +172,7 @@ salomeinclude_HEADERS = \
        DlgRef_3Sel4Spin2Check_QTD.h \
        DlgRef_4Sel1List_QTD.h \
        DlgRef_2Sel1List_QTD.h \
+       DlgRef_2Sel1List1Check_QTD.h \
        DlgRef_1List1Spin1Btn_QTD.h \
        DlgRef_4Sel1List1Check_QTD.h \
        DlgRef_1Spin_QTD.h \
index b675f277cecd81f5ee133e0c29f8beee8b7bbc84..8979116e8844322aee96f0303fc173a54ed19149 100644 (file)
@@ -20,9 +20,6 @@
             <verstretch>0</verstretch>
         </sizepolicy>
     </property>
-    <property name="caption">
-        <string>DlgRef_Skeleton_QTD</string>
-    </property>
     <property name="sizeGripEnabled">
         <bool>true</bool>
     </property>
                 <property name="spacing">
                     <number>6</number>
                 </property>
-                <widget class="QGroupBox" row="2" column="0">
-                    <property name="name">
-                        <cstring>GroupMedium</cstring>
-                    </property>
-                    <property name="sizePolicy">
-                        <sizepolicy>
-                            <hsizetype>7</hsizetype>
-                            <vsizetype>7</vsizetype>
-                            <horstretch>0</horstretch>
-                            <verstretch>0</verstretch>
-                        </sizepolicy>
-                    </property>
-                    <property name="title">
-                        <string></string>
-                    </property>
-                </widget>
                 <widget class="QGroupBox" row="3" column="0">
                     <property name="name">
                         <cstring>GroupButtons</cstring>
@@ -78,9 +59,6 @@
                             <verstretch>0</verstretch>
                         </sizepolicy>
                     </property>
-                    <property name="title">
-                        <string></string>
-                    </property>
                     <hbox>
                         <property name="name">
                             <cstring>unnamed</cstring>
                                     <property name="name">
                                         <cstring>buttonOk</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>&amp;Ok</string>
-                                    </property>
                                 </widget>
                                 <widget class="QPushButton">
                                     <property name="name">
                                         <cstring>buttonApply</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>&amp;Apply</string>
-                                    </property>
                                 </widget>
                                 <spacer>
                                     <property name="name">
                                     <property name="name">
                                         <cstring>buttonCancel</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>&amp;Cancel</string>
-                                    </property>
                                 </widget>
                                <widget class="QPushButton">
                                     <property name="name">
                                         <cstring>buttonHelp</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>&amp;Help</string>
-                                    </property>
                                 </widget>
                             </hbox>
                         </widget>
                             <verstretch>0</verstretch>
                         </sizepolicy>
                     </property>
-                    <property name="title">
-                        <string></string>
-                    </property>
                     <hbox>
                         <property name="name">
                             <cstring>unnamed</cstring>
                                     <property name="name">
                                         <cstring>RadioButton1</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string></string>
-                                    </property>
                                 </widget>
                                 <widget class="QRadioButton">
                                     <property name="name">
                                         <cstring>RadioButton2</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string></string>
-                                    </property>
                                 </widget>
                                 <widget class="QRadioButton">
                                     <property name="name">
                                         <cstring>RadioButton3</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string></string>
-                                    </property>
                                 </widget>
                                 <widget class="QRadioButton">
                                     <property name="name">
                                         <cstring>RadioButton4</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string></string>
-                                    </property>
                                 </widget>
                             </hbox>
                         </widget>
                     <property name="name">
                         <cstring>GroupBoxName</cstring>
                     </property>
-                    <property name="title">
-                        <string>Result name</string>
-                    </property>
                     <grid>
                         <property name="name">
                             <cstring>unnamed</cstring>
                                     <property name="name">
                                         <cstring>NameLabel</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>Name</string>
-                                    </property>
                                 </widget>
                             </grid>
                         </widget>
index 863f45fe98e0ec09ea8c8d28c92fc9ce7daf1818..302635f39d01d728f5294383223dab45a98b933f 100644 (file)
@@ -20,7 +20,7 @@
 /****************************************************************************
 ** Form implementation generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
 **
-** Created: Fri Mar 17 15:47:14 2006
+** Created: Tue Mar 13 14:04:48 2007
 **      by: The User Interface Compiler ($Id$)
 **
 ** WARNING! All changes made in this file will be lost!
@@ -30,9 +30,9 @@
 
 #include <qvariant.h>
 #include <qpushbutton.h>
-#include <qgroupbox.h>
 #include <qbuttongroup.h>
 #include <qradiobutton.h>
+#include <qgroupbox.h>
 #include <qlayout.h>
 #include <qtooltip.h>
 #include <qwhatsthis.h>
@@ -54,11 +54,6 @@ EntityGUI_Skeleton_QTD::EntityGUI_Skeleton_QTD( QWidget* parent, const char* nam
 
     Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); 
 
-    GroupVal = new QGroupBox( this, "GroupVal" );
-    GroupVal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupVal->sizePolicy().hasHeightForWidth() ) );
-
-    Layout1->addWidget( GroupVal, 2, 0 );
-
     GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
     GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) );
     GroupConstructors->setColumnLayout(0, Qt::Vertical );
@@ -111,26 +106,6 @@ EntityGUI_Skeleton_QTD::EntityGUI_Skeleton_QTD( QWidget* parent, const char* nam
 
     Layout5->addMultiCellWidget( GroupDest1, 0, 0, 0, 1 );
 
-    GroupDest2 = new QButtonGroup( GroupDest, "GroupDest2" );
-    GroupDest2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest2->sizePolicy().hasHeightForWidth() ) );
-    GroupDest2->setColumnLayout(0, Qt::Vertical );
-    GroupDest2->layout()->setSpacing( 6 );
-    GroupDest2->layout()->setMargin( 11 );
-    GroupDest2Layout = new QGridLayout( GroupDest2->layout() );
-    GroupDest2Layout->setAlignment( Qt::AlignTop );
-
-    Layout5->addWidget( GroupDest2, 1, 0 );
-
-    GroupDest3 = new QButtonGroup( GroupDest, "GroupDest3" );
-    GroupDest3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest3->sizePolicy().hasHeightForWidth() ) );
-    GroupDest3->setColumnLayout(0, Qt::Vertical );
-    GroupDest3->layout()->setSpacing( 6 );
-    GroupDest3->layout()->setMargin( 11 );
-    GroupDest3Layout = new QGridLayout( GroupDest3->layout() );
-    GroupDest3Layout->setAlignment( Qt::AlignTop );
-
-    Layout5->addWidget( GroupDest3, 1, 1 );
-
     GroupDestLayout->addLayout( Layout5, 0, 0 );
 
     Layout1->addWidget( GroupDest, 1, 0 );
@@ -190,21 +165,5 @@ EntityGUI_Skeleton_QTD::~EntityGUI_Skeleton_QTD()
  */
 void EntityGUI_Skeleton_QTD::languageChange()
 {
-    setCaption( tr( "EntityGUI_Skeleton_QTD" ) );
-    GroupVal->setTitle( QString::null );
-    GroupConstructors->setTitle( tr( "Element Type" ) );
-    RadioButton1->setText( tr( "Segment" ) );
-    RadioButton2->setText( tr( "Arc" ) );
-    GroupDest->setTitle( tr( "Destination" ) );
-    GroupDest1->setTitle( tr( "Type" ) );
-    RB_Dest2->setText( tr( "Direction" ) );
-    RB_Dest1->setText( tr( "Point" ) );
-    GroupDest2->setTitle( QString::null );
-    GroupDest3->setTitle( QString::null );
-    GroupButtons->setTitle( QString::null );
-    buttonEnd->setText( tr( "End Sketch" ) );
-    buttonClose->setText( tr( "Close Sketch" ) );
-    buttonCancel->setText( tr( "&Cancel" ) );
-    buttonHelp->setText( tr( "&Help" ) );
 }
 
index 70468d719d957f0cda4dcbeffc20f39d840fe0ae..11b95f50287b2d0245a277f3a34c0efebabff798 100644 (file)
@@ -20,7 +20,7 @@
 /****************************************************************************
 ** Form interface generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
 **
-** Created: Fri Mar 17 15:47:13 2006
+** Created: Tue Mar 13 14:04:42 2007
 **      by: The User Interface Compiler ($Id$)
 **
 ** WARNING! All changes made in this file will be lost!
@@ -38,9 +38,9 @@ class QVBoxLayout;
 class QHBoxLayout;
 class QGridLayout;
 class QSpacerItem;
-class QGroupBox;
 class QButtonGroup;
 class QRadioButton;
+class QGroupBox;
 class QPushButton;
 
 class GEOM_ENTITYGUI_EXPORT EntityGUI_Skeleton_QTD : public QDialog
@@ -51,7 +51,6 @@ public:
     EntityGUI_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
     ~EntityGUI_Skeleton_QTD();
 
-    QGroupBox* GroupVal;
     QButtonGroup* GroupConstructors;
     QRadioButton* RadioButton1;
     QRadioButton* RadioButton2;
@@ -59,8 +58,6 @@ public:
     QButtonGroup* GroupDest1;
     QRadioButton* RB_Dest2;
     QRadioButton* RB_Dest1;
-    QButtonGroup* GroupDest2;
-    QButtonGroup* GroupDest3;
     QGroupBox* GroupButtons;
     QPushButton* buttonEnd;
     QPushButton* buttonClose;
@@ -76,8 +73,6 @@ protected:
     QGridLayout* Layout5;
     QGridLayout* GroupDest1Layout;
     QGridLayout* Layout4;
-    QGridLayout* GroupDest2Layout;
-    QGridLayout* GroupDest3Layout;
     QHBoxLayout* GroupButtonsLayout;
     QHBoxLayout* Layout3;
     QSpacerItem* Spacer1;
index 5a3baf23fd3d9395012eeda343b1be63100f28d5..9fbd604b09071c743fa3938c8281e89ae4c3a448 100644 (file)
@@ -82,10 +82,6 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
   buttonClose->setText(tr("GEOM_BUT_CLOSE_SKETCH"));
   buttonHelp->setText(tr("GEOM_BUT_HELP"));
 
-  GroupVal->close(TRUE);
-  GroupDest2->close(TRUE);
-  GroupDest3->close(TRUE);
-
   QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
   QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_UNDO")));
   QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_REDO")));
@@ -253,7 +249,6 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
   Init();
 }
 
-
 //=================================================================================
 // function : ~EntityGUI_SketcherDlg()
 // purpose  : Destroys the object and frees any allocated resources
@@ -263,7 +258,6 @@ EntityGUI_SketcherDlg::~EntityGUI_SketcherDlg()
   myGeometryGUI->SetActiveDialogBox( 0 );
 }
 
-
 //=================================================================================
 // function : eventFilter()
 // purpose  : event filter for spin-boxes to provide Apply action on Return pressed
@@ -295,6 +289,16 @@ bool EntityGUI_SketcherDlg::eventFilter (QObject* object, QEvent* event)
     }
   }
 
+  if (event->type() == QEvent::KeyRelease) {
+    // NPAL16010 (Sketcher Apply non available if only one line is modified)
+    // To have Apply active as soon as value text changed
+    QString s = ((QtxDblSpinBox*) object)->text();
+    bool ok;
+    double newVal = s.toDouble( &ok );
+    if ( ok )
+      ValueChangedInSpinBox( newVal );
+  }
+
   return EntityGUI_Skeleton_QTD::eventFilter(object, event);
 }
 
@@ -324,16 +328,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(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);
+  Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+  Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+  Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
 
   /* displays Dialog */
   GroupConstructors->setEnabled(false);
@@ -434,8 +438,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId)
     if ( constructorId == 1 )
     {  // XY
       mySketchType = PT_ABS;
-      Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
-      Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+      Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+      Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
       Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2"));
       Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2"));
       myX = 0.0;
@@ -450,8 +454,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId)
     else if ( constructorId == 0 )
     {  // DXDY
       mySketchType = PT_RELATIVE;
-      Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
-      Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+      Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+      Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
       Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2"));
       Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2"));
       myDX = 0.0;
@@ -508,8 +512,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
     myLength = 100.0;
     if ( myConstructorDirId == 2 )
     {  // Angle
-      Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
-      Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+      Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+      Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
       Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
       Group2Spin->SpinBox_DX->SetValue(myAngle);
       Group2Spin->buttonApply->setFocus();
@@ -584,9 +588,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
     }
     else if ( myConstructorDirId == 3 )
     {  // DXDY
-      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->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+      Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+      Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
       Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
       Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
       myDX = 0.0;
@@ -622,54 +626,54 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
     {  // Angle
       if ( constructorId == 2 )
       {  // Length
-                               mySketchType = DIR_ANGLE_LENGTH;
-                               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"));
-                               Group3Spin->SpinBox_DX->SetValue(myAngle);
-                               myRadius = 100.0;
-                               Group3Spin->SpinBox_DY->SetValue(myRadius);
-                               myLength = 30.0;
-                               Group3Spin->SpinBox_DZ->SetValue(myLength);
-                               Group3Spin->show();
-                               Group3Spin->buttonApply->setFocus();
+        mySketchType = DIR_ANGLE_LENGTH;
+        Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+        Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+        Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+        Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
+        Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2"));
+        Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2"));
+        Group3Spin->SpinBox_DX->SetValue(myAngle);
+        myRadius = 100.0;
+        Group3Spin->SpinBox_DY->SetValue(myRadius);
+        myLength = 30.0;
+        Group3Spin->SpinBox_DZ->SetValue(myLength);
+        Group3Spin->show();
+        Group3Spin->buttonApply->setFocus();
       }
     }
     else if ( myConstructorDirId == 0 )
     {  // Perpendicular
       if ( constructorId == 2 )
       {  // Length
-                               mySketchType = DIR_PER_LENGTH;
-                               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;
-                               Group2Spin->SpinBox_DX->SetValue(myRadius);
-                               myLength = 30.0;
-                               Group2Spin->SpinBox_DY->SetValue(myLength);
-                               Group2Spin->show();
-                               Group2Spin->buttonApply->setFocus();
+        mySketchType = DIR_PER_LENGTH;
+        Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+        Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+        Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
+        Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
+        myRadius = 100.0;
+        Group2Spin->SpinBox_DX->SetValue(myRadius);
+        myLength = 30.0;
+        Group2Spin->SpinBox_DY->SetValue(myLength);
+        Group2Spin->show();
+        Group2Spin->buttonApply->setFocus();
       }
     }
     else if ( myConstructorDirId == 1 )
     {  // Tangent
       if ( constructorId == 2 )
       {  // Length
-                               mySketchType = DIR_TAN_LENGTH;
-                               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;
-                               Group2Spin->SpinBox_DX->SetValue(myRadius);
-                               myLength = 30.0;
-                               Group2Spin->SpinBox_DY->SetValue(myLength);
-                               Group2Spin->show();
-                               Group2Spin->buttonApply->setFocus();
+        mySketchType = DIR_TAN_LENGTH;
+        Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+        Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+        Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
+        Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
+        myRadius = 100.0;
+        Group2Spin->SpinBox_DX->SetValue(myRadius);
+        myLength = 30.0;
+        Group2Spin->SpinBox_DY->SetValue(myLength);
+        Group2Spin->show();
+        Group2Spin->buttonApply->setFocus();
       }
     }
     else if ( myConstructorDirId == 3 )
@@ -738,7 +742,18 @@ void EntityGUI_SketcherDlg::ClickOnEnd()
       myCommand.append( ":WW" );
   }
   else
+  {
+    // PAL16008 (Sketcher Validation should be equal to Apply&Close)
+    if (Group1Spin->buttonApply->isEnabled() && Group1Spin->isVisible() ||
+        Group2Spin->buttonApply->isEnabled() && Group2Spin->isVisible() ||
+        Group3Spin->buttonApply->isEnabled() && Group3Spin->isVisible() ||
+        Group4Spin->buttonApply->isEnabled() && Group4Spin->isVisible() ||
+        Group1Sel ->buttonApply->isEnabled() && Group1Sel->isVisible() )
+    {
+      ClickOnApply();
+    }
     myIsAllAdded = true;
+  }
 
   if( myCommand.size() > 2 )
     if( !onAccept() )
@@ -753,7 +768,8 @@ void EntityGUI_SketcherDlg::ClickOnEnd()
 //=================================================================================
 bool EntityGUI_SketcherDlg::ClickOnApply()
 {
-  ((QPushButton*)sender())->setFocus(); // to update value of currently edited spin-box (PAL11948)
+  if (sender() && sender()->inherits("QPushButton"))
+    ((QPushButton*)sender())->setFocus(); // to update value of currently edited spin-box (PAL11948)
 
   myCommand.append( GetNewCommand() );
   mySketchState = NEXT_POINT;
@@ -1091,6 +1107,68 @@ void EntityGUI_SketcherDlg::ValueChangedInSpinBox(double newValue)
     vz = Group4Spin->SpinBox_DZ->GetValue();
     vs = newValue;
   }
+  // NPAL16010 (Sketcher Apply non available if only one line is modified)
+  // if ValueChangedInSpinBox() called from eventFilter()
+  else if ( Group1Spin->SpinBox_DX->hasFocus() )
+  {
+    vx = newValue;
+  }
+  else if ( Group2Spin->SpinBox_DX ->hasFocus() )
+  {
+    vx = newValue;
+    vy = Group2Spin->SpinBox_DY->GetValue();
+  }
+  else if ( Group2Spin->SpinBox_DY->hasFocus() )
+  {
+    vx = Group2Spin->SpinBox_DX->GetValue();
+    vy = newValue;
+  }
+  else if ( Group3Spin->SpinBox_DX->hasFocus() )
+  {
+    vx = newValue;
+    vy = Group3Spin->SpinBox_DY->GetValue();
+    vz = Group3Spin->SpinBox_DZ->GetValue();
+  }
+  else if ( Group3Spin->SpinBox_DY->hasFocus() )
+  {
+    vx = Group3Spin->SpinBox_DX->GetValue();
+    vy = newValue;
+    vz = Group3Spin->SpinBox_DZ->GetValue();
+  }
+  else if ( Group3Spin->SpinBox_DZ->hasFocus() )
+  {
+    vx = Group3Spin->SpinBox_DX->GetValue();
+    vy = Group3Spin->SpinBox_DY->GetValue();
+    vz = newValue;
+  }
+  else if ( Group4Spin->SpinBox_DX->hasFocus() )
+  {
+    vx = newValue;
+    vy = Group4Spin->SpinBox_DY->GetValue();
+    vz = Group4Spin->SpinBox_DZ->GetValue();
+    vs = Group4Spin->SpinBox_DS->GetValue();
+  }
+  else if ( Group4Spin->SpinBox_DY->hasFocus() )
+  {
+    vx = Group4Spin->SpinBox_DX->GetValue();
+    vy = newValue;
+    vz = Group4Spin->SpinBox_DZ->GetValue();
+    vs = Group4Spin->SpinBox_DS->GetValue();
+  }
+  else if ( Group4Spin->SpinBox_DZ->hasFocus() )
+  {
+    vx = Group4Spin->SpinBox_DX->GetValue();
+    vy = Group4Spin->SpinBox_DY->GetValue();
+    vz = newValue;
+    vs = Group4Spin->SpinBox_DS->GetValue();
+  }
+  else if ( Group4Spin->SpinBox_DS->hasFocus() )
+  {
+    vx = Group4Spin->SpinBox_DX->GetValue();
+    vy = Group4Spin->SpinBox_DY->GetValue();
+    vz = Group4Spin->SpinBox_DZ->GetValue();
+    vs = newValue;
+  }
 
   if ( myConstructorId == 0 )
   {  // SEGMENT
index c257a8086550a369caca1dabd8a24e64b50abc51..cdcd86400ae51d578b113f3f4331dbfa814ee1d2 100644 (file)
@@ -20,9 +20,6 @@
             <verstretch>0</verstretch>
         </sizepolicy>
     </property>
-    <property name="caption">
-        <string>EntityGUI_Skeleton_QTD</string>
-    </property>
     <grid>
         <property name="name">
             <cstring>unnamed</cstring>
                 <property name="spacing">
                     <number>6</number>
                 </property>
-                <widget class="QGroupBox" row="2" column="0">
-                    <property name="name">
-                        <cstring>GroupVal</cstring>
-                    </property>
-                    <property name="sizePolicy">
-                        <sizepolicy>
-                            <hsizetype>7</hsizetype>
-                            <vsizetype>7</vsizetype>
-                            <horstretch>0</horstretch>
-                            <verstretch>0</verstretch>
-                        </sizepolicy>
-                    </property>
-                    <property name="title">
-                        <string></string>
-                    </property>
-                </widget>
                 <widget class="QButtonGroup" row="0" column="0">
                     <property name="name">
                         <cstring>GroupConstructors</cstring>
@@ -75,9 +56,6 @@
                             <verstretch>0</verstretch>
                         </sizepolicy>
                     </property>
-                    <property name="title">
-                        <string>Element Type</string>
-                    </property>
                     <grid>
                         <property name="name">
                             <cstring>unnamed</cstring>
                                     <property name="name">
                                         <cstring>RadioButton1</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>Segment</string>
-                                    </property>
                                 </widget>
                                 <widget class="QRadioButton">
                                     <property name="name">
                                         <cstring>RadioButton2</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>Arc</string>
-                                    </property>
                                 </widget>
                             </hbox>
                         </widget>
                             <verstretch>0</verstretch>
                         </sizepolicy>
                     </property>
-                    <property name="title">
-                        <string>Destination</string>
-                    </property>
                     <grid>
                         <property name="name">
                             <cstring>unnamed</cstring>
                                             <verstretch>0</verstretch>
                                         </sizepolicy>
                                     </property>
-                                    <property name="title">
-                                        <string>Type</string>
-                                    </property>
                                     <grid>
                                         <property name="name">
                                             <cstring>unnamed</cstring>
                                                     <property name="name">
                                                         <cstring>RB_Dest2</cstring>
                                                     </property>
-                                                    <property name="text">
-                                                        <string>Direction</string>
-                                                    </property>
                                                 </widget>
                                                 <widget class="QRadioButton" row="0" column="0">
                                                     <property name="name">
                                                         <cstring>RB_Dest1</cstring>
                                                     </property>
-                                                    <property name="text">
-                                                        <string>Point</string>
-                                                    </property>
                                                 </widget>
                                             </grid>
                                         </widget>
                                     </grid>
                                 </widget>
-                                <widget class="QButtonGroup" row="1" column="0">
-                                    <property name="name">
-                                        <cstring>GroupDest2</cstring>
-                                    </property>
-                                    <property name="sizePolicy">
-                                        <sizepolicy>
-                                            <hsizetype>7</hsizetype>
-                                            <vsizetype>7</vsizetype>
-                                            <horstretch>0</horstretch>
-                                            <verstretch>0</verstretch>
-                                        </sizepolicy>
-                                    </property>
-                                    <property name="title">
-                                        <string></string>
-                                    </property>
-                                    <grid>
-                                        <property name="name">
-                                            <cstring>unnamed</cstring>
-                                        </property>
-                                        <property name="margin">
-                                            <number>11</number>
-                                        </property>
-                                        <property name="spacing">
-                                            <number>6</number>
-                                        </property>
-                                    </grid>
-                                </widget>
-                                <widget class="QButtonGroup" row="1" column="1">
-                                    <property name="name">
-                                        <cstring>GroupDest3</cstring>
-                                    </property>
-                                    <property name="sizePolicy">
-                                        <sizepolicy>
-                                            <hsizetype>7</hsizetype>
-                                            <vsizetype>7</vsizetype>
-                                            <horstretch>0</horstretch>
-                                            <verstretch>0</verstretch>
-                                        </sizepolicy>
-                                    </property>
-                                    <property name="title">
-                                        <string></string>
-                                    </property>
-                                    <grid>
-                                        <property name="name">
-                                            <cstring>unnamed</cstring>
-                                        </property>
-                                        <property name="margin">
-                                            <number>11</number>
-                                        </property>
-                                        <property name="spacing">
-                                            <number>6</number>
-                                        </property>
-                                    </grid>
-                                </widget>
                             </grid>
                         </widget>
                     </grid>
                             <verstretch>0</verstretch>
                         </sizepolicy>
                     </property>
-                    <property name="title">
-                        <string></string>
-                    </property>
                     <hbox>
                         <property name="name">
                             <cstring>unnamed</cstring>
                                     <property name="name">
                                         <cstring>buttonEnd</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>End Sketch</string>
-                                    </property>
                                 </widget>
                                 <widget class="QPushButton">
                                     <property name="name">
                                         <cstring>buttonClose</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>Close Sketch</string>
-                                    </property>
                                 </widget>
                                 <spacer>
                                     <property name="name">
                                     <property name="name">
                                         <cstring>buttonCancel</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>&amp;Cancel</string>
-                                    </property>
                                 </widget>
                                <widget class="QPushButton">
                                     <property name="name">
                                         <cstring>buttonHelp</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>&amp;Help</string>
-                                    </property>
                                 </widget>
                             </hbox>
                         </widget>
index f04bda383883524456e4635b6747c5ee2c640a3d..5c91868fea89bb79eda6739752353302d0ece9e0 100644 (file)
@@ -95,19 +95,31 @@ Handle(GEOM_Object) GEOM_Object::GetObject(TDF_Label& theLabel)
 Handle(GEOM_Object) GEOM_Object::GetReferencedObject(TDF_Label& theLabel)
 {
   Handle(TDF_Reference) aRef;
-  if (!theLabel.FindAttribute(TDF_Reference::GetID(), aRef)) return NULL;
+  if (!theLabel.FindAttribute(TDF_Reference::GetID(), aRef)) {
+    return NULL;
+  }
+  
+  if(aRef.IsNull() || aRef->Get().IsNull()) {
+    return NULL;
+  }
+
 
   // Get TreeNode of a referenced function
   Handle(TDataStd_TreeNode) aT, aFather;
-  if (!TDataStd_TreeNode::Find(aRef->Get(), aT)) return NULL;
+  if (!TDataStd_TreeNode::Find(aRef->Get(), aT)) {
+    return NULL;
+  }
+
 
   // Get TreeNode of Object of the referenced function
   aFather = aT->Father();
-  if (aFather.IsNull()) return NULL;
+  if (aFather.IsNull()) {
+    return NULL;
+  }
 
   // Get label of the referenced object
   TDF_Label aLabel = aFather->Label();
-
+  
 
   return GEOM_Object::GetObject(aLabel);
 }
@@ -395,8 +407,10 @@ Handle(TColStd_HSequenceOfTransient) GEOM_Object::GetAllDependency()
   Standard_Integer aLength = aSeq.Length();
   if(aLength > 0) {
     anArray = new TColStd_HSequenceOfTransient;
-    for(Standard_Integer j =1; j<=aLength; j++)
-      anArray->Append(GetReferencedObject(aSeq(j)));
+    for(Standard_Integer j =1; j<=aLength; j++) {
+      Handle(GEOM_Object) aRefObj = GetReferencedObject(aSeq(j));
+      if(!aRefObj.IsNull()) anArray->Append(aRefObj);
+    }
   }
 
   return anArray;
index a3ff987bde2d2234fce5c3b84cf837c5f6a0dba1..41b9c184f84e1e9acb5ecbcb57e3fbd92cfd20b6 100644 (file)
@@ -43,19 +43,12 @@ namespace GEOM
       TCollection_AsciiString aDescr;
       if ( myAppend )
         aDescr = myFunction->GetDescription() + "\n\t";
-      aDescr += (char *)myStream.str().c_str();
+      std::string aString = myStream.str();
+      aDescr += (char *)aString.c_str();
       myFunction->SetDescription( aDescr );
     }
   }
 
-//  TPythonDump::operator TCollection_AsciiString () const
-//  {
-//    if (myCounter == 1) {
-//      return TCollection_AsciiString ((char *)myStream.str().c_str());
-//    }
-//    return TCollection_AsciiString ();
-//  }
-
   TPythonDump& TPythonDump::operator<< (long int theArg)
   {
     myStream<<theArg;
index 967bc05f99f0483c10280abfcf7957e62b388e3f..a6f4ca4065fd8d81d3d6b1df022fb02ef9627068 100755 (executable)
@@ -37,8 +37,8 @@ uses
     MapOfShape                       from TopTools,
     Image     from BRepAlgo, 
     
-    DSFiller  from NMTTools,
-    PDSFiller from NMTTools
+    PaveFiller from NMTTools, 
+    PPaveFiller from NMTTools 
     
 --raises
 
@@ -54,8 +54,8 @@ is
        is redefined; 
         
     PerformWithFiller(me:out; 
-       theDSF: DSFiller from NMTTools) 
-       ---Purpose:  Performs calculations using prepared DSFiller 
+       theDSF: PaveFiller from NMTTools) 
+       ---Purpose:  Performs calculations using prepared PaveFiller 
        --           object theDSF               
        is virtual;
    
@@ -99,13 +99,12 @@ is
     -- 
     --    protected methods  
     --  
-    -- 
     PerformInternal(me:out; 
-       theDSF: DSFiller from NMTTools) 
+       theDSF: PaveFiller from NMTTools) 
        ---Purpose:  Performs calculations using prepared DSFiller 
        --           object theDSF               
-       is protected; 
-    --
+       is virtual protected;  
+        
     PrepareHistory (me:out) 
        ---Purpose:  Prepare information for history support  
        is redefined protected;  
@@ -234,7 +233,7 @@ is
     -- =====================================================
  
 fields 
-    myDSFiller        : PDSFiller from NMTTools is protected;  
+    myPaveFiller      : PPaveFiller from NMTTools is protected;  
     myShapes          : ListOfShape from TopTools is protected; 
     -- Common usage 
     myNbTypes         : Integer from Standard is protected; 
@@ -248,7 +247,7 @@ fields
     mySameDomainShapes: IndexedDataMapOfShapeShape from TopTools is protected;
     --  solids 
     myDraftSolids     : IndexedDataMapOfShapeShape from TopTools is protected; 
-    myEntryPoint      : Integer from Standard is protected;    
+    myEntryPoint      : Integer from Standard is protected;
     --     
 end Builder;
 
index 284cd7b10b837f5bcbed6a39918053408c1239ec..ebb87589366b35f7173943f151da6ea3bc2f09b3 100755 (executable)
@@ -38,9 +38,8 @@
 
 #include <BOP_CorrectTolerances.hxx>
 
-#include <NMTTools_DSFiller.hxx>
-
 #include <BRepLib.hxx>
+#include <NMTTools_PaveFiller.hxx>
 
 //=======================================================================
 //function : 
@@ -51,7 +50,7 @@
   GEOMAlgo_BuilderShape()
 {
   myNbTypes=9;
-  myDSFiller=NULL;
+  myPaveFiller=NULL;
   myEntryPoint=0; // Entry point through PerformWithFiller ()
 }
 //=======================================================================
@@ -61,9 +60,9 @@
   GEOMAlgo_Builder::~GEOMAlgo_Builder()
 {
   if (myEntryPoint==1) {
-    if (myDSFiller) {
-      delete myDSFiller;
-      myDSFiller=NULL;
+    if (myPaveFiller) {
+      delete myPaveFiller;
+      myPaveFiller=NULL;
     }
   }
 }
     aBB.Add(aCS, aS);
   }
   //
-  if (myDSFiller) {
-    delete myDSFiller;
-    myDSFiller=NULL;
-  }
-  NMTTools_DSFiller* pDSF=new NMTTools_DSFiller;
+  NMTTools_PaveFiller* pPF=new NMTTools_PaveFiller;
   //
-  pDSF->SetCompositeShape(aCS);
-  pDSF->Perform();
+  pPF->SetCompositeShape(aCS);
+  pPF->Perform();
   //
   myEntryPoint=1;
-  PerformInternal(*pDSF);
+  PerformInternal(*pPF);
 }
 //=======================================================================
 //function : PerformWithFiller
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_DSFiller& theDSF)
+  void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_PaveFiller& theDSF)
 {
   myEntryPoint=0;
   //
 //function : PerformInternal
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_Builder::PerformInternal(const NMTTools_DSFiller& theDSF)
+  void GEOMAlgo_Builder::PerformInternal(const NMTTools_PaveFiller& pPF)
 {
   myErrorStatus=0;
   //
   Standard_Boolean bIsDone;
   //
-  // 0. myDSFiller
-  myDSFiller=(NMTTools_DSFiller *)&theDSF;
+  // 0. myPaveFiller
+  myPaveFiller=(NMTTools_PaveFiller *)&pPF;
   //
-  bIsDone=myDSFiller->IsDone();
+  bIsDone=myPaveFiller->IsDone();
   if (!bIsDone) {
-    myErrorStatus=2; // DSFiller is failed
+    myErrorStatus=2; // PaveFiller is failed
     return;
   }
   //
 // 
 // 0  - Ok
 // 1  - The object is just initialized
-// 2  - DSFiller is failed
+// 2  - PaveFiller is failed
 // 10 - No shapes to process
 // 30 - SolidBuilder failed
index 2f38d77fbd305be48ea31024ed23a042d91d2cff..930b3edf0a6744bf0b6e3a244a0d870fbf592201 100644 (file)
@@ -20,8 +20,8 @@
 #ifndef _GEOMAlgo_Builder_HeaderFile
 #define _GEOMAlgo_Builder_HeaderFile
 
-#ifndef _NMTTools_PDSFiller_HeaderFile
-#include <NMTTools_PDSFiller.hxx>
+#ifndef _NMTTools_PPaveFiller_HeaderFile
+#include <NMTTools_PPaveFiller.hxx>
 #endif
 #ifndef _TopTools_ListOfShape_HeaderFile
 #include <TopTools_ListOfShape.hxx>
@@ -50,7 +50,7 @@
 #ifndef _TopAbs_ShapeEnum_HeaderFile
 #include <TopAbs_ShapeEnum.hxx>
 #endif
-class NMTTools_DSFiller;
+class NMTTools_PaveFiller;
 class TopoDS_Shape;
 class TopTools_ListOfShape;
 class BRepAlgo_Image;
@@ -90,9 +90,9 @@ Standard_EXPORT virtual ~GEOMAlgo_Builder();
 //!  Performs calculations <br>
 Standard_EXPORT virtual  void Perform() ;
 
-//!  Performs calculations using prepared DSFiller <br>
+//!  Performs calculations using prepared PaveFiller <br>
 //!           object theDSF <br>
-Standard_EXPORT virtual  void PerformWithFiller(const NMTTools_DSFiller& theDSF) ;
+Standard_EXPORT virtual  void PerformWithFiller(const NMTTools_PaveFiller& theDSF) ;
 
 //!  Adds argument theShape of the operation <br>
 Standard_EXPORT virtual  void AddShape(const TopoDS_Shape& theShape) ;
@@ -139,7 +139,7 @@ protected:
 
 //!  Performs calculations using prepared DSFiller <br>
 //!           object theDSF <br>
-Standard_EXPORT   void PerformInternal(const NMTTools_DSFiller& theDSF) ;
+Standard_EXPORT virtual  void PerformInternal(const NMTTools_PaveFiller& theDSF) ;
 
 //!  Prepare information for history support <br>
 Standard_EXPORT virtual  void PrepareHistory() ;
@@ -214,7 +214,7 @@ Standard_EXPORT   void BuildDraftSolid(const TopoDS_Shape& theSolid,TopoDS_Shape
 
  // Fields PROTECTED
  //
-NMTTools_PDSFiller myDSFiller;
+NMTTools_PPaveFiller myPaveFiller;
 TopTools_ListOfShape myShapes;
 Standard_Integer myNbTypes;
 TopTools_MapOfShape myMapFence;
index 1965f5ec776ea60896c8605bc59ebc8a19712fb4..4cc8d4a529bc38c5a5b37354884a8d3bdf2caa0a 100644 (file)
@@ -17,8 +17,8 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
-#ifndef _NMTTools_DSFiller_HeaderFile
-#include <NMTTools_DSFiller.hxx>
+#ifndef _NMTTools_PaveFiller_HeaderFile
+#include <NMTTools_PaveFiller.hxx>
 #endif
 #ifndef _TopoDS_Shape_HeaderFile
 #include <TopoDS_Shape.hxx>
index 72a8b39dc966833e842bf372aeab5887d29d3658..728c8404def797d881fb0b68fc5a50d4003e0b11 100644 (file)
@@ -20,7 +20,7 @@
 #include <GEOMAlgo_Builder.hxx>
 
 #include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTTools_DSFiller.hxx>
+//#include <NMTTools_DSFiller.hxx>
 #include <NMTTools_PaveFiller.hxx>
 #include <IntTools_Context.hxx>
 #include <TopoDS_Shape.hxx>
index d42da67e28cf9e1a1084ad5879c0d4da9ddfa5ce..b6cdfee665e2799a345b460864bed9a2562417aa 100755 (executable)
@@ -47,7 +47,6 @@
 //
 #include <NMTDS_ShapesDataStructure.hxx>
 //
-#include <NMTTools_DSFiller.hxx>
 #include <NMTTools_PaveFiller.hxx>
 #include <NMTTools_CommonBlockPool.hxx>
 #include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
@@ -78,8 +77,8 @@ static
 {
   myErrorStatus=0;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   //
   Standard_Integer i, aNb, iV;
   //
@@ -94,7 +93,6 @@ static
          myImages.Bind(aV, aVSD);
          //
          mySameDomainShapes.Add(aV, aVSD);
-         //
        }
       }
     }
@@ -108,8 +106,8 @@ static
 {
   myErrorStatus=0;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   const BOPTools_SplitShapesPool& aSSP=pPF->SplitShapesPool();
   NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
   IntTools_Context& aCtx=pPF->ChangeContext();
@@ -218,8 +216,8 @@ static
   TopTools_MapOfShape aMS;
   TopTools_MapIteratorOfMapOfShape aItS;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   aNbS=aDS.NumberOfShapesOfTheObject();
index 068fbc564fb885007b2261ff540e8d4c682ab1d5..92e9e2cc87734acf270ca6e312b812cd4d74cf41 100755 (executable)
@@ -54,7 +54,6 @@
 #include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
 #include <BOPTools_ListOfPaveBlock.hxx>
 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
-#include <BOPTools_InterferencePool.hxx>
 #include <BOPTools_CArray1OfSSInterference.hxx>
 #include <BOPTools_SSInterference.hxx>
 #include <BOPTools_SequenceOfCurves.hxx>
@@ -68,7 +67,6 @@
 #include <BOPTools_CArray1OfESInterference.hxx>
 
 #include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTTools_DSFiller.hxx>
 #include <NMTTools_PaveFiller.hxx>
 #include <NMTTools_ListOfCoupleOfShape.hxx>
 #include <NMTTools_Tools.hxx>
@@ -83,6 +81,7 @@
 #include <GEOMAlgo_Tools3D.hxx>
 #include <GEOMAlgo_WireEdgeSet.hxx>
 #include <GEOMAlgo_BuilderFace.hxx>
+#include <NMTDS_InterfPool.hxx>
 
 static
   void UpdateCandidates(const Standard_Integer ,
@@ -109,9 +108,9 @@ static
 //=======================================================================
   void GEOMAlgo_Builder::FillIn2DParts()
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
-  BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
+  NMTDS_InterfPool* pIP=pPF->IP();
   BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
   NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
   //
@@ -193,9 +192,9 @@ static
 //=======================================================================
   void GEOMAlgo_Builder::BuildSplitFaces()
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
-  BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
+  NMTDS_InterfPool* pIP=pPF->IP();
   BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
@@ -388,9 +387,9 @@ static
 //=======================================================================
   void GEOMAlgo_Builder::FillSameDomainFaces()
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
-  BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
+  NMTDS_InterfPool* pIP=pPF->IP();
   BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
@@ -513,7 +512,7 @@ static
   TopTools_ListOfShape aLFx;
   TopTools_ListIteratorOfListOfShape aIt;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
   //
   aNb=aDS.NumberOfShapesOfTheObject();
   for (i=1; i<=aNb; ++i) {
@@ -557,9 +556,9 @@ static
 //=======================================================================
   void GEOMAlgo_Builder::FillInternalVertices()
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
-  BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
+  NMTDS_InterfPool* pIP=pPF->IP();
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
index 220cc453f8b220a36ec80dd9b0efdb8797025a5d..649c603703bc1cbce11a026c28c5b85d98fb8c39 100755 (executable)
@@ -56,7 +56,6 @@
 #include <IntTools_Context.hxx>
 
 #include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTTools_DSFiller.hxx>
 #include <NMTTools_PaveFiller.hxx>
 
 #include <GEOMAlgo_Tools3D.hxx>
@@ -93,8 +92,8 @@ static
 {
   myErrorStatus=0;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS(); 
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   Standard_Boolean bToReverse;
@@ -186,8 +185,8 @@ static
 {
   myErrorStatus=0;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS(); 
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   Standard_Boolean bIsIN, bHasImage;
@@ -416,8 +415,8 @@ static
 {
   myErrorStatus=0;
   // 
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   Standard_Integer i, aNbS, iErr;
@@ -589,8 +588,8 @@ static
 {
   myErrorStatus=0;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   //Standard_Boolean bHasImage;
index 080093803882e72b0853cecfed50d0457a478c4f..8465cebbaf5f6a920a7ae61bca0737cb0d96e31e 100755 (executable)
@@ -35,7 +35,6 @@
 #include <NMTDS_ShapesDataStructure.hxx>
 
 #include <NMTTools_PaveFiller.hxx>
-#include <NMTTools_DSFiller.hxx>
 
 #include <GEOMAlgo_Tools3D.hxx>
 
@@ -49,8 +48,8 @@ static
 //=======================================================================
   const TopTools_ListOfShape& GEOMAlgo_Builder::Generated(const TopoDS_Shape& theS)
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx=pPF->ChangeContext();
   //
   Standard_Boolean bHasImage, bToReverse;
@@ -104,8 +103,8 @@ static
 //=======================================================================
   const TopTools_ListOfShape& GEOMAlgo_Builder::Modified(const TopoDS_Shape& theS)
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx=pPF->ChangeContext();
   //
   Standard_Boolean bHasImage, bToReverse;
index 98f4afe30c84f438b2e6128ce2739b73ea79a58f..78c540b0895f1db1dfdb3c7e0e4aaf4b9ab7c999 100644 (file)
@@ -41,6 +41,7 @@
 #include <Poly_Triangle.hxx>
 #include <Poly_PolygonOnTriangulation.hxx>
 #include <Poly_Triangulation.hxx>
+#include <Poly_Polygon3D.hxx>
 
 #include <Geom_Curve.hxx>
 #include <Geom_Surface.hxx>
@@ -688,19 +689,32 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
   aLP.Clear();
   BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc);
   if (aTRE.IsNull() || aPTE.IsNull()) {
-    myErrorStatus=20; // no triangulation found
-    return;  
+    Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc);
+    if (aPE.IsNull()) {
+      myErrorStatus=20; // no triangulation found
+      return;
+    }
+    const gp_Trsf& aTrsf=aLoc.Transformation();
+    const TColgp_Array1OfPnt& aNodes=aPE->Nodes();
+    //
+    aNbNodes=aPE->NbNodes();
+    Standard_Integer low = aNodes.Lower(), up = aNodes.Upper();
+    for (j=low+1; j<up; ++j) {
+      aP=aNodes(j).Transformed(aTrsf);
+      aLP.Append(aP);
+    }
   }
-  //
-  const gp_Trsf& aTrsf=aLoc.Transformation();
-  const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
-  //
-  aNbNodes=aPTE->NbNodes();
-  const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
-  for (j=2; j<aNbNodes; ++j) {
-    aIndex=aInds(j);
-    aP=aNodes(aIndex).Transformed(aTrsf);
-    aLP.Append(aP);
+  else {
+    const gp_Trsf& aTrsf=aLoc.Transformation();
+    const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
+    //
+    aNbNodes=aPTE->NbNodes();
+    const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
+    for (j=2; j<aNbNodes; ++j) {
+      aIndex=aInds(j);
+      aP=aNodes(aIndex).Transformed(aTrsf);
+      aLP.Append(aP);
+    }
   }
   //
   aNb=aLP.Extent();
@@ -708,7 +722,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
     // try to fill it yourself
     InnerPoints(aE, myNbPntsMin, aLP);
     aNb=aLP.Extent();
-    
   }
 }
 //=======================================================================
index 8a386d0b84433c4956e16ffc626476b8a4d76295..9d8ff5a23999b22d2f1220baf0dd7708c8dc5ac6 100644 (file)
@@ -41,6 +41,7 @@
 #include <Poly_Triangle.hxx>
 #include <Poly_PolygonOnTriangulation.hxx>
 #include <Poly_Triangulation.hxx>
+#include <Poly_Polygon3D.hxx>
 
 #include <Geom_Curve.hxx>
 #include <Geom_Surface.hxx>
   aLP.Clear();
   BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc);
   if (aTRE.IsNull() || aPTE.IsNull()) {
-    myErrorStatus=20; // no triangulation found
-    return;  
+    Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc);
+    if (aPE.IsNull()) {
+      myErrorStatus=20; // no triangulation found
+      return;
+    }
+    const gp_Trsf& aTrsf=aLoc.Transformation();
+    const TColgp_Array1OfPnt& aNodes=aPE->Nodes();
+    //
+    aNbNodes=aPE->NbNodes();
+    Standard_Integer low = aNodes.Lower(), up = aNodes.Upper();
+    for (j=low+1; j<up; ++j) {
+      aP=aNodes(j).Transformed(aTrsf);
+      aLP.Append(aP);
+    }
   }
-  //
-  const gp_Trsf& aTrsf=aLoc.Transformation();
-  const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
-  //
-  aNbNodes=aPTE->NbNodes();
-  const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
-  for (j=2; j<aNbNodes; ++j) {
-    aIndex=aInds(j);
-    aP=aNodes(aIndex).Transformed(aTrsf);
-    aLP.Append(aP);
+  else {
+    const gp_Trsf& aTrsf=aLoc.Transformation();
+    const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
+    //
+    aNbNodes=aPTE->NbNodes();
+    const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
+    for (j=2; j<aNbNodes; ++j) {
+      aIndex=aInds(j);
+      aP=aNodes(aIndex).Transformed(aTrsf);
+      aLP.Append(aP);
+    }
   }
   //
   aNb=aLP.Extent();
     // try to fill it yourself
     InnerPoints(aE, myNbPntsMin, aLP);
     aNb=aLP.Extent();
-    
   }
 }
 //=======================================================================
 // 30- can not obtain the line from the link
 // 40- point can not be classified
 // 41- invalid data for classifier
-
index 9c27ede442c09280fd084daecf518600df92129d..e2f2c9a6953713998e7f77d31f634332fc4b2494 100755 (executable)
@@ -102,6 +102,7 @@ GEOMAlgo_Gluer::GEOMAlgo_Gluer()
   myTolerance=0.0001;
   myTol=myTolerance;
   myCheckGeometry=Standard_True;
+  myKeepNonSolids=Standard_False;
   myNbAlone=0;
 }
 //=======================================================================
@@ -128,6 +129,14 @@ Standard_Boolean GEOMAlgo_Gluer::CheckGeometry() const
   return myCheckGeometry;
 }
 //=======================================================================
+//function : SetKeepNonSolids
+//purpose  : 
+//=======================================================================
+void GEOMAlgo_Gluer::SetKeepNonSolids(const Standard_Boolean aFlag)
+{
+  myKeepNonSolids=aFlag;
+}
+//=======================================================================
 //function : AloneShapes
 //purpose  : 
 //=======================================================================
@@ -356,39 +365,45 @@ void GEOMAlgo_Gluer::MakeVertices()
   }
 }
 //=======================================================================
-//function : MakeSolids
+//function : MakeSubShapes
 //purpose  : 
 //=======================================================================
-void GEOMAlgo_Gluer::MakeSolids()
+void GEOMAlgo_Gluer::MakeSubShapes (const TopoDS_Shape&  theShape,
+                                    TopTools_MapOfShape& theMS,
+                                    TopoDS_Compound&     theResult)
 {
-  myErrorStatus=0;
+  if (theMS.Contains(theShape))
+    return;
   //
-  Standard_Integer aNbS;
-  TopAbs_Orientation anOr;
-  TopoDS_Compound aCmp;
-  TopoDS_Solid aNewSolid;
-  TopTools_IndexedMapOfShape aMS;
-  TopExp_Explorer aExpS, aExp;
   BRep_Builder aBB;
   //
-  aBB.MakeCompound(aCmp);
+  theMS.Add(theShape);
   //
-  aNbS=aMS.Extent();
-  aExpS.Init(myShape, TopAbs_SOLID);
-  for (; aExpS.More(); aExpS.Next()) {
-    const TopoDS_Solid& aSolid=TopoDS::Solid(aExpS.Current());
-    if (aMS.Contains(aSolid)) {
-      continue;
+  if (theShape.ShapeType() == TopAbs_COMPOUND ||
+      theShape.ShapeType() == TopAbs_COMPSOLID)
+  {
+    TopoDS_Iterator It (theShape, Standard_True, Standard_True);
+    for (; It.More(); It.Next())
+    {
+      MakeSubShapes(It.Value(), theMS, theResult);
     }
-    aMS.Add(aSolid);
+  }
+  else if (theShape.ShapeType() == TopAbs_SOLID)
+  {
+    // build a solid
+    TopoDS_Solid aNewSolid;
+    TopExp_Explorer aExpS, aExp;
+    //
+    const TopoDS_Solid& aSolid = TopoDS::Solid(theShape);
     //
-    anOr=aSolid.Orientation();
+    TopAbs_Orientation anOr = aSolid.Orientation();
     //
     aBB.MakeSolid(aNewSolid);
     aNewSolid.Orientation(anOr);
     //
     aExp.Init(aSolid, TopAbs_SHELL);
-    for (; aExp.More(); aExp.Next()) {
+    for (; aExp.More(); aExp.Next())
+    {
       const TopoDS_Shape& aShell=aExp.Current();
       const TopoDS_Shape& aShellR=myOrigins.Find(aShell);
       aBB.Add(aNewSolid, aShellR);
@@ -400,14 +415,88 @@ void GEOMAlgo_Gluer::MakeSolids()
     myImages.Bind(aNewSolid, aLS);
     myOrigins.Bind(aSolid, aNewSolid);
     //
-    aBB.Add(aCmp, aNewSolid);
+    aBB.Add(theResult, aNewSolid);
+  }
+  else if (theShape.ShapeType() == TopAbs_WIRE)
+  {
+    if (myKeepNonSolids)
+    {
+      // just add image
+      if (!myOrigins.IsBound(theShape))
+      {
+        // build wire
+        const TopoDS_Wire& aW=TopoDS::Wire(theShape);
+        //
+        TopoDS_Wire newWire;
+        aBB.MakeWire(newWire);
+        //
+        TopExp_Explorer aExpE (aW, TopAbs_EDGE);
+        for (; aExpE.More(); aExpE.Next()) {
+          const TopoDS_Edge& aE=TopoDS::Edge(aExpE.Current());
+          TopoDS_Edge aER=TopoDS::Edge(myOrigins.Find(aE));
+          //
+          aER.Orientation(TopAbs_FORWARD);
+          if (!BRep_Tool::Degenerated(aER)) {
+            // build p-curve
+            //if (bIsUPeriodic) {
+            //  GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
+            //}
+            //BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
+            //
+            // orient image
+            Standard_Boolean bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
+            if (bIsToReverse) {
+              aER.Reverse();
+            }
+          }
+          else {
+            aER.Orientation(aE.Orientation());
+          }
+          //
+          aBB.Add(newWire, aER);
+        }
+        // xf
+        TopTools_ListOfShape aLW;
+        //
+        aLW.Append(aW);
+        myImages.Bind(newWire, aLW);
+        myOrigins.Bind(aW, newWire);
+      }
+      const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
+      aBB.Add(theResult, aShapeR);
+    }
   }
+  else
+  {
+    if (myKeepNonSolids)
+    {
+      // just add image
+      const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
+      aBB.Add(theResult, aShapeR);
+    }
+  }
+}
+//=======================================================================
+//function : MakeSolids
+//purpose  : 
+//=======================================================================
+void GEOMAlgo_Gluer::MakeSolids()
+{
+  myErrorStatus=0;
+  //
+  BRep_Builder aBB;
+  TopoDS_Compound aCmp;
+  TopTools_MapOfShape aMS;
+  //
+  aBB.MakeCompound(aCmp);
+  //
+  // Add images of all initial sub-shapes in the result.
+  // If myKeepNonSolids==false, add only solids images.
+  MakeSubShapes(myShape, aMS, aCmp);
   //
   myResult=aCmp;
   //
-  aNbS=aMS.Extent();
-  if (aNbS) {
-    Standard_Real aTol=1.e-7;
+  if (aMS.Extent()) {
     BOP_CorrectTolerances::CorrectCurveOnSurface(myResult);
   }
 }
index 0f8a871ab08d4b807fa3bfa602b42b1ef8adbbb0..5ca326149aa9b810af5f3a0e47d7f5d4e6fba339 100644 (file)
 #ifndef _TopTools_ListOfShape_HeaderFile
 #include <TopTools_ListOfShape.hxx>
 #endif
+#ifndef _TopTools_MapOfShape_HeaderFile
+#include <TopTools_MapOfShape.hxx>
+#endif
 #ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
 #include <GEOMAlgo_ShapeAlgo.hxx>
 #endif
 #ifndef _TopAbs_ShapeEnum_HeaderFile
 #include <TopAbs_ShapeEnum.hxx>
 #endif
+#ifndef _TopoDS_Compound_HeaderFile
+#include <TopoDS_Compound.hxx>
+#endif
 class TopTools_ListOfShape;
 class TopoDS_Shape;
 class TopoDS_Edge;
@@ -92,6 +98,9 @@ Standard_EXPORT   void SetCheckGeometry(const Standard_Boolean aFlag) ;
 Standard_EXPORT   Standard_Boolean CheckGeometry() const;
 
 
+Standard_EXPORT   void SetKeepNonSolids(const Standard_Boolean aFlag) ;
+
+
 Standard_EXPORT virtual  void Perform() ;
 
 
@@ -143,6 +152,11 @@ Standard_EXPORT   void MakeShapes(const TopAbs_ShapeEnum aType) ;
 Standard_EXPORT   void MakeShells() ;
 
 
+Standard_EXPORT   void MakeSubShapes(const TopoDS_Shape& theShape,
+                                     TopTools_MapOfShape& theMS,
+                                     TopoDS_Compound& theResult);
+
+
 Standard_EXPORT   void MakeSolids() ;
 
 
@@ -173,6 +187,7 @@ Standard_EXPORT   Standard_Boolean HasNewSubShape(const TopoDS_Shape& aS) const;
  // Fields PROTECTED
  //
 Standard_Boolean myCheckGeometry;
+Standard_Boolean myKeepNonSolids;
 Standard_Real myTol;
 TopTools_DataMapOfShapeListOfShape myImages;
 TopTools_DataMapOfShapeShape myOrigins;
index 0e53aa6e4240ff78f495c3daeea165415c63420c..299fb5b1affd293f46cabde36b8c2bc80c9b6d96 100644 (file)
@@ -317,9 +317,6 @@ static
   aF=TopoDS::Face(aS);
   //
   aNbWires=NbWires(aF);
-  if (aNbWires>1) {
-    return;
-  }
   //
   aSurf=BRep_Tool::Surface(aF);
   GeomAdaptor_Surface aGAS(aSurf);
@@ -342,6 +339,8 @@ static
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
     //
+    if (aNbWires>1) return;
+    //
     //aSurf->Bounds(aUMin, aUMax, aVMin, aVMax);
     BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
     bInfU1=Precision::IsNegativeInfinite(aUMin);
@@ -374,6 +373,8 @@ static
     aInfo.SetPosition(aAx3);
     aInfo.SetRadius1(aR1);
     //
+    if (aNbWires>1) return;
+    //
     aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
     aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
     //
@@ -394,6 +395,8 @@ static
     aInfo.SetPosition(aAx3);
     aInfo.SetRadius1(aR1);
     //
+    if (aNbWires>1) return;
+    //
     BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
     bInfU1=Precision::IsNegativeInfinite(aUMin);
     bInfU2=Precision::IsPositiveInfinite(aUMax);
@@ -424,6 +427,8 @@ static
     aInfo.SetPosition(aAx3);
     //aInfo.SetRadius1(aR1);
     //
+    if (aNbWires>1) return;
+    //
     BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
     bInfU1=Precision::IsNegativeInfinite(aUMin);
     bInfU2=Precision::IsPositiveInfinite(aUMax);
@@ -456,8 +461,10 @@ static
     aInfo.SetRadius1(aR1);
     aInfo.SetRadius2(aR2);
     //
+    if (aNbWires>1) return;
+    //
     aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
-    
+    //
     FillDetails(aF, aTorus);
   }
 }
index a67c8e222c1f8b2a4193222e36b60552b8079ee0..19991027d2d72b044d4dbbe285cf04ae3a88ec52 100755 (executable)
@@ -63,6 +63,13 @@ is
         
     Limit(me)  
        returns ShapeEnum from TopAbs;   
+
+    SetLimitMode(me:out; 
+           aLimitMode:Integer from Standard); 
+            
+    LimitMode(me) 
+       returns Integer from Standard;    
+
     -- 
     --    Protected methods  
     --  
@@ -89,5 +96,7 @@ fields
     myTools           : ListOfShape from TopTools is protected; 
     myMapTools        : MapOfShape  from TopTools is protected;        
     myLimit           : ShapeEnum   from TopAbs   is protected;   
+    myLimitMode       : Integer from Standard     is protected;  
+
 end Splitter;
 
index 7ea27c32f1c257c1cb67d189dbcbbe7a83c64ae0..431719ab15fe5009ae12bd5f65928172e828712e 100755 (executable)
 
 #include <BOP_CorrectTolerances.hxx>
 
-#include <NMTTools_DSFiller.hxx>
+
+static 
+  void TreatCompound(const TopoDS_Shape& aC, 
+                    TopTools_ListOfShape& aLSX);
 
 //=======================================================================
 //function : 
@@ -53,6 +56,7 @@
   GEOMAlgo_Builder()
 {
   myLimit=TopAbs_SHAPE;
+  myLimitMode=0;
 }
 //=======================================================================
 //function : ~
   return myLimit;
 }
 //=======================================================================
+//function : SetLimitMode
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_Splitter::SetLimitMode(const Standard_Integer aMode)
+{
+  myLimitMode=aMode;
+}
+//=======================================================================
+//function : LimitMode
+//purpose  : 
+//=======================================================================
+  Standard_Integer GEOMAlgo_Splitter::LimitMode()const
+{
+  return myLimitMode;
+}
+//=======================================================================
 //function : Clear
 //purpose  : 
 //=======================================================================
     Standard_Integer i, aNbS;
     BRep_Builder aBB;
     TopoDS_Compound aC;
-    TopTools_IndexedMapOfShape aM;
+    TopTools_IndexedMapOfShape aMx;
     //
     aBB.MakeCompound(aC);
     //
-    TopExp::MapShapes(myShape, myLimit, aM);
-    aNbS=aM.Extent();
+    TopExp::MapShapes(myShape, myLimit, aMx);
+    aNbS=aMx.Extent();
     for (i=1; i<=aNbS; ++i) {
-      const TopoDS_Shape& aS=aM(i);
+      const TopoDS_Shape& aS=aMx(i);
       aBB.Add(aC, aS);
     }
+    //modified by NIZNHY-PKV Thu Feb 15 17:09:32 2007f
+    if (myLimitMode) {
+      Standard_Integer iType, iLimit, iTypeX;
+      TopAbs_ShapeEnum aType, aTypeX;
+      TopTools_ListOfShape aLSP, aLSX;
+      TopTools_ListIteratorOfListOfShape aIt, aItX, aItIm;
+      TopTools_MapOfShape  aM;
+      //
+      iLimit=(Standard_Integer)myLimit; 
+      //
+      // 1. Collect the shapes to process aLSP
+      aIt.Initialize(myShapes);
+      for (; aIt.More(); aIt.Next()) {
+       const TopoDS_Shape& aS=aIt.Value();
+       if (myMapTools.Contains(aS)) {
+         continue;
+       }
+       //
+       aType=aS.ShapeType();
+       iType=(Standard_Integer)aType;
+       //
+       if (iType>iLimit) {
+         aLSP.Append(aS);
+       }
+       //
+       else if (aType==TopAbs_COMPOUND) {
+         aLSX.Clear();
+         //
+         TreatCompound(aS, aLSX);
+         //
+         aItX.Initialize(aLSX);
+         for (; aItX.More(); aItX.Next()) {
+           const TopoDS_Shape& aSX=aItX.Value();
+           aTypeX=aSX.ShapeType();
+           iTypeX=(Standard_Integer)aTypeX;
+           //
+           if (iTypeX>iLimit) {
+             aLSP.Append(aSX);
+           }
+         }
+       }
+      }// for (; aIt.More(); aIt.Next()) {
+      //
+      // 2. Add them to aC
+      aIt.Initialize(aLSP);
+      for (; aIt.More(); aIt.Next()) {
+       const TopoDS_Shape& aS=aIt.Value();
+       if (myImages.HasImage(aS)) {
+         const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
+         aItIm.Initialize(aLSIm);
+         for (; aItIm.More(); aItIm.Next()) {
+           const TopoDS_Shape& aSIm=aItIm.Value();
+           if (aM.Add(aSIm)) {
+             aBB.Add(aC, aSIm);
+           }
+         }
+       }
+       else {
+         if (aM.Add(aS)) {
+           aBB.Add(aC, aS);
+         }
+       }
+      }
+    }// if (myLimitMode) {
+    //modified by NIZNHY-PKV Thu Feb 15 17:09:34 2007t
     myShape=aC;
-  }
+  }//if (myLimit!=TopAbs_SHAPE) {
   //
   GEOMAlgo_Builder::PostTreat();
+}
+//=======================================================================
+//function : TreatCompound
+//purpose  : 
+//=======================================================================
+void TreatCompound(const TopoDS_Shape& aC1, 
+                  TopTools_ListOfShape& aLSX)
+{
+  Standard_Integer aNbC1;
+  TopAbs_ShapeEnum aType;
+  TopTools_ListOfShape aLC, aLC1;
+  TopTools_ListIteratorOfListOfShape aIt, aIt1;
+  TopoDS_Iterator aItC;
   //
+  aLC.Append (aC1);
+  while(1) {
+    aLC1.Clear();
+    aIt.Initialize(aLC);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aC=aIt.Value(); //C is compound
+      //
+      aItC.Initialize(aC);
+      for (; aItC.More(); aItC.Next()) {
+       const TopoDS_Shape& aS=aItC.Value();
+       aType=aS.ShapeType();
+       if (aType==TopAbs_COMPOUND) {
+         aLC1.Append(aS);
+       }
+       else {
+         aLSX.Append(aS);
+       }
+      }
+    }
+    //
+    aNbC1=aLC1.Extent();
+    if (!aNbC1) {
+      break;
+    }
+    //
+    aLC.Clear();
+    aIt.Initialize(aLC1);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aSC=aIt.Value();
+      aLC.Append(aSC);
+    }
+  }// while(1)
 }
 //
 // myErrorStatus
 // 
 // 0  - Ok
 // 1  - The object is just initialized
-// 2  - DSFiller is failed
+// 2  - PaveFiller is failed
 // 10 - No shapes to process
 // 30 - SolidBuilder failed
index 6ef1e92ac33141f1630a142bb2b964f7ee461690..7f3b69fb74a037b0cebe40a5c2ee8e1ccb7d8ff9 100644 (file)
@@ -29,6 +29,9 @@
 #ifndef _TopAbs_ShapeEnum_HeaderFile
 #include <TopAbs_ShapeEnum.hxx>
 #endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
 #ifndef _GEOMAlgo_Builder_HeaderFile
 #include <GEOMAlgo_Builder.hxx>
 #endif
@@ -82,6 +85,12 @@ Standard_EXPORT   void SetLimit(const TopAbs_ShapeEnum aLimit) ;
 
 Standard_EXPORT   TopAbs_ShapeEnum Limit() const;
 
+
+Standard_EXPORT   void SetLimitMode(const Standard_Integer aLimitMode) ;
+
+
+Standard_EXPORT   Standard_Integer LimitMode() const;
+
 //!  Adds Tool arguments of the operation as <br>
 //!           shapes of upper level of container shape theShape <br>
 //! ===================================================== <br>
@@ -108,6 +117,7 @@ Standard_EXPORT virtual  void PostTreat() ;
 TopTools_ListOfShape myTools;
 TopTools_MapOfShape myMapTools;
 TopAbs_ShapeEnum myLimit;
+Standard_Integer myLimitMode;
 
 
 private: 
index 33a6fe5ac79534454f0ce18980ae13571ce535ad..c4e65d0bcfbc741544dd28f899172c37f3f49a3b 100644 (file)
@@ -36,6 +36,7 @@
 #include "SUIT_Session.h"
 #include "SUIT_MessageBox.h"
 
+#include <qlabel.h>
 #include <qpushbutton.h>
 
 using namespace std;
@@ -57,12 +58,14 @@ GEOMBase_Skeleton::GEOMBase_Skeleton(GeometryGUI* theGeometryGUI, QWidget* paren
   if (!name)
     setName("GEOMBase_Skeleton");
 
+  GroupBoxName->setTitle(tr("GEOM_RESULT_NAME_GRP"));
+  NameLabel->setText(tr("GEOM_RESULT_NAME_LBL"));
+
   buttonCancel->setText(tr("GEOM_BUT_CLOSE"));
   buttonOk->setText(tr("GEOM_BUT_OK"));
   buttonApply->setText(tr("GEOM_BUT_APPLY"));
   buttonHelp->setText(tr("GEOM_BUT_HELP"));
 
-  GroupMedium->close(TRUE);
   resize(0, 0);
 
   Init();
index 2659f6209b4f5a38bba8e62f6932f59d71aa854c..3e8eb2058c0d164fe2b3d97b64240038852f1254 100644 (file)
@@ -222,7 +222,7 @@ TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_p
   TopExp::MapShapes(aMainShape, anIndices);
 
   /* Case of only one subshape */
-  if (list->length() == 1) {
+  if (list->length() == 1 && list[0] > 0) {
     S = anIndices.FindKey(list[0]);
   }
   else {
index ae88996a29ce1e4133349822e88539af5f3f81c5..7dc8d22eac5cadb4aa684cd28ca3477776dab61a 100644 (file)
@@ -1189,6 +1189,9 @@ msgstr "\nShading"
 msgid "GEOM_RECONSTRUCTION_LIMIT"
 msgstr "Reconstruction Limit"
 
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
 msgid "GEOM_SUPPRESS_RESULT"
 msgstr "Suppress Result"
 
index 45c9b0ead272283d77d9dbe74706459f848cf72f..d88c449868a1eb8d584d024db6880a46171907db 100644 (file)
@@ -1190,6 +1190,9 @@ msgstr "Ombré"
 msgid "GEOM_RECONSTRUCTION_LIMIT"
 msgstr "Limite de Reconstruction"
 
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
 msgid "GEOM_SUPPRESS_RESULT"
 msgstr "Supprimer le Resultat"
 
index 7af013b20b3ebd1c29c335a75a03ba837e148131..029e8922a080e14c14e832cd475b2a8af7a81f99 100644 (file)
@@ -205,14 +205,14 @@ GEOM::GEOM_Object_ptr GEOMGUI_Selection::getObject( const int index ) const
   return GEOM::GEOM_Object::_nil();
 }
 
-QString GEOMGUI_Selection:: selectionMode() const
-{ 
+QString GEOMGUI_Selection::selectionMode() const
+{
   SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
   if (app) {
     GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
-    if(aGeomGUI)
-      switch(aGeomGUI->getLocalSelectionMode())
-       {
+    if (aGeomGUI) {
+      switch (aGeomGUI->getLocalSelectionMode())
+      {
        case GEOM_POINT      : return "VERTEX";
        case GEOM_EDGE       : return "EDGE";
        case GEOM_WIRE       : return "WIRE";
@@ -222,6 +222,8 @@ QString GEOMGUI_Selection:: selectionMode() const
        case GEOM_COMPOUND   : return "COMPOUND";
        case GEOM_ALLOBJECTS : return "ALL";
        default: return "";
-       }
+      }
+    }
   }
+  return "";
 }
index b0fd38adc342b73c55dc6325e23e24c32f0a35e0..5b1c41de5fa809992169771bfbbd9f32b42a632a 100644 (file)
@@ -82,6 +82,7 @@
 #include <gp_Pln.hxx>
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TopoDS_Iterator.hxx>
 
 // VTK Includes
 #include <vtkActorCollection.h>
@@ -525,8 +526,12 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
         Handle(GEOM_AISShape) AISShape;
         if (myType == GEOM_VECTOR)
           AISShape = new GEOM_AISVector (myShape, "");
-        else
+        else {
+          if (myShape.ShapeType() != TopAbs_VERTEX && // fix pb with not displayed points
+              !TopoDS_Iterator(myShape).More())
+            return;// NPAL15983 (Bug when displaying empty groups)
           AISShape = new GEOM_AISShape (myShape, "");
+        }
         // Temporary staff: vertex must be infinite for correct visualization
         AISShape->SetInfiniteState( myShape.Infinite() || myShape.ShapeType() == TopAbs_VERTEX );
 
index 01825cc9d326086daf3f46fcdeff1fe9da866c1e..3a2e2c94daef49e87d1c8291dfe7cef1a76ba451 100644 (file)
@@ -1312,6 +1312,9 @@ msgstr "\nShading"
 msgid "GEOM_RECONSTRUCTION_LIMIT"
 msgstr "Reconstruction Limit"
 
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
 msgid "GEOM_SUPPRESS_RESULT"
 msgstr "Suppress Result"
 
@@ -2939,6 +2942,12 @@ msgstr "Rename"
 msgid "NAME_LBL"
 msgstr "Name: "
 
+msgid "GEOM_RESULT_NAME_GRP"
+msgstr "Result name"
+
+msgid "GEOM_RESULT_NAME_LBL"
+msgstr "Name"
+
 msgid "GEOM_ERR_GET_ENGINE"
 msgstr "Failed to obtain GEOM Engine component.  Reload Geometry module and try again."
 
index 8d5b1b24dc4eaa5a47621bc073f92906cfddcb4c..d4efd381dcb5c38c266a4611c28e903d74640974 100644 (file)
@@ -1238,6 +1238,9 @@ msgstr "Ombré"
 msgid "GEOM_RECONSTRUCTION_LIMIT"
 msgstr "Limite de Reconstruction"
 
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
 msgid "GEOM_SUPPRESS_RESULT"
 msgstr "Supprimer le Resultat"
 
index d25eb21991c69afa9213c43b5c0ffa641b727024..d08ae24cce2561693ab6f791d963ff6aa6246bda 100644 (file)
 #include <TopExp.hxx>
 
 #include <GC_MakeArcOfCircle.hxx>
+#include <GC_MakeCircle.hxx>
 #include <Standard_ConstructionError.hxx>
 #include <Precision.hxx>
 #include <gp_Pnt.hxx>
 #include <gp_Vec.hxx>
-#include <gce_MakeCirc.hxx>
-#include <gce_MakePln.hxx>
-#include <ElCLib.hxx>
+#include <gp_Circ.hxx>
 #include <Geom_Circle.hxx>
-#include <Geom_TrimmedCurve.hxx>
-
 
 #include "utilities.h"
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -79,46 +77,54 @@ Standard_Integer GEOMImpl_ArcDriver::Execute(TFunction_Logbook& log) const
   Standard_Integer aType = aFunction->GetType();
 
   TopoDS_Shape aShape;
-  if ((aType == CIRC_ARC_THREE_PNT)||(aType == CIRC_ARC_CENTER)) {
+  if ((aType == CIRC_ARC_THREE_PNT) || (aType == CIRC_ARC_CENTER))
+  {
     Handle(GEOM_Function) aRefPoint1 = aCI.GetPoint1();
     Handle(GEOM_Function) aRefPoint2 = aCI.GetPoint2();
     Handle(GEOM_Function) aRefPoint3 = aCI.GetPoint3();
+
     TopoDS_Shape aShapePnt1 = aRefPoint1->GetValue();
     TopoDS_Shape aShapePnt2 = aRefPoint2->GetValue();
     TopoDS_Shape aShapePnt3 = aRefPoint3->GetValue();
+
     if (aShapePnt1.ShapeType() == TopAbs_VERTEX &&
         aShapePnt2.ShapeType() == TopAbs_VERTEX &&
-        aShapePnt3.ShapeType() == TopAbs_VERTEX) {
+        aShapePnt3.ShapeType() == TopAbs_VERTEX)
+    {
       gp_Pnt aP1 = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt1));
       gp_Pnt aP2 = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt2));
       gp_Pnt aP3 = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt3));
+
       if (aP1.Distance(aP2) < gp::Resolution() ||
           aP1.Distance(aP3) < gp::Resolution() ||
           aP2.Distance(aP3) < gp::Resolution())
         Standard_ConstructionError::Raise("Arc creation aborted: coincident points given");
+
       if (gp_Vec(aP1, aP2).IsParallel(gp_Vec(aP1, aP3), Precision::Angular()))
         Standard_ConstructionError::Raise("Arc creation aborted: points lay on one line");
-      if (aType == CIRC_ARC_THREE_PNT){
-        GC_MakeArcOfCircle arc(aP1, aP2, aP3);
-        aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
 
+      if (aType == CIRC_ARC_THREE_PNT)
+      {
+        GC_MakeArcOfCircle arc (aP1, aP2, aP3);
+        aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
       }
-      if (aType == CIRC_ARC_CENTER){
-        Standard_Real Rad = aP1.Distance(aP2);
-        gce_MakeCirc MC(aP1,gce_MakePln(aP1, aP2, aP3).Value(),Rad);
+      else // CIRC_ARC_CENTER
+      {
         Standard_Boolean sense = aCI.GetSense();
-        if (MC.IsDone()) {
-          const gp_Circ& Circ = MC.Value();
-          Standard_Real Alpha1 = ElCLib::Parameter(Circ,aP2);
-          Standard_Real Alpha2 = ElCLib::Parameter(Circ,aP3);
-          Handle(Geom_Circle) C = new Geom_Circle(Circ);
-          Handle(Geom_TrimmedCurve) TheArc;
-          if (!sense)
-            TheArc= new Geom_TrimmedCurve(C,Alpha1,Alpha2,false);
-          if (sense)
-            TheArc= new Geom_TrimmedCurve(C,Alpha2,Alpha1,false);
-          aShape = BRepBuilderAPI_MakeEdge(TheArc).Edge();
-        }
+
+        Standard_Real aRad = aP1.Distance(aP2);
+        gp_Vec aV1 (aP1, aP2);
+        gp_Vec aV2 (aP1, aP3);
+        gp_Vec aN = aV1 ^ aV2;
+
+        if (sense)
+          aN = -aN;
+
+        GC_MakeCircle circ (aP1, aN, aRad);
+        Handle(Geom_Circle) aGeomCirc = circ.Value();
+
+        GC_MakeArcOfCircle arc (aGeomCirc->Circ(), aP2, aP3, Standard_True);
+        aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
       }
     }
   } else {
@@ -129,8 +135,7 @@ Standard_Integer GEOMImpl_ArcDriver::Execute(TFunction_Logbook& log) const
   aFunction->SetValue(aShape);
 
   log.SetTouched(Label());
-  MESSAGE("Out of building step ...");
-  return 1;    
+  return 1;
 }
 
 
index 9e2d85745ca0a232b91ab60e3eadf496bba7f544..2efdd7ca2cf2df02030a47fd8fb108c56f72d477 100644 (file)
@@ -34,7 +34,8 @@
 #include <GEOM_Function.hxx>
 
 #include <ShHealOper_Sewing.hxx>
-#include <NMTAlgo_Splitter1.hxx>
+//#include <NMTAlgo_Splitter1.hxx>
+#include <GEOMAlgo_Gluer.hxx>
 #include <BlockFix_BlockFixAPI.hxx>
 
 #include "utilities.h"
@@ -470,14 +471,21 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(TFunction_Logbook& log) const
       TopoDS_Shape aCompound = anArgs(1);
 
       // Glue coincident faces and edges (with Partition algorithm).
-      NMTAlgo_Splitter1 PS;
-      PS.AddShape(aCompound);
-      PS.Compute();
-      PS.SetRemoveWebs(Standard_False);
-//      PS.Build(aCompound.ShapeType());
-      PS.Build(TopAbs_SOLID);
-
-      aShape = PS.Shape();
+      //NMTAlgo_Splitter1 PS;
+      //PS.AddShape(aCompound);
+      //PS.Compute();
+      //PS.SetRemoveWebs(Standard_False);
+      //      PS.Build(aCompound.ShapeType());
+      //PS.Build(TopAbs_SOLID);
+      //aShape = PS.Shape();
+
+      GEOMAlgo_Gluer aGluer;
+      aGluer.SetShape(aCompound);
+      aGluer.SetCheckGeometry(Standard_True);
+      aGluer.Perform();
+      aShape = aGluer.Result();
+
+
     } else {
     }
 
@@ -537,7 +545,7 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(TFunction_Logbook& log) const
         }
 
         // 5. Glue Faces
-        aShape = GEOMImpl_GlueDriver::GlueFaces(aComp, Precision::Confusion());
+        aShape = GEOMImpl_GlueDriver::GlueFaces(aComp, Precision::Confusion(), Standard_False);
       }
 
     } else if (aType == BLOCK_MULTI_TRANSFORM_1D ||
@@ -643,7 +651,7 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(TFunction_Logbook& log) const
       }
 
       // Glue faces of the multi-block
-      aShape = GEOMImpl_GlueDriver::GlueFaces(aMulti, aTol);
+      aShape = GEOMImpl_GlueDriver::GlueFaces(aMulti, aTol, Standard_False);
 
     } else { // unknown function type
       return 0;
index 4bf020b613f61545549e1b0ab13f0ea254538eaa..c419cd6d5f93adbc78297384662cad6e3a0c762f 100644 (file)
@@ -153,6 +153,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
       }
 
       if (isCompound) {
+        /*
         TopTools_ListOfShape listShapeC;
         AddSimpleShapes(C, listShapeC);
         TopTools_ListIteratorOfListOfShape itSubC (listShapeC);
@@ -165,6 +166,14 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
           aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
         else
           aShape = C;
+        */
+
+        // As GlueFaces has been improved to keep all kind of shapes
+        TopExp_Explorer anExp (C, TopAbs_VERTEX);
+        if (anExp.More())
+          aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+        else
+          aShape = C;
       }
     }
 
@@ -215,6 +224,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
       }
 
       if (isCompound) {
+        /*
         TopTools_ListOfShape listShapeC;
         AddSimpleShapes(C, listShapeC);
         TopTools_ListIteratorOfListOfShape itSubC (listShapeC);
@@ -227,11 +237,20 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
           aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
         else
           aShape = C;
+        */
+
+        // As GlueFaces has been improved to keep all kind of shapes
+        TopExp_Explorer anExp (C, TopAbs_VERTEX);
+        if (anExp.More())
+          aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+        else
+          aShape = C;
       }
     }
 
     // perform FUSE operation
     else if (aType == BOOLEAN_FUSE) {
+      /* Fix for NPAL15379: refused
       // Check arguments
       TopTools_ListOfShape listShape1, listShape2;
       AddSimpleShapes(aShape1, listShape1);
@@ -305,6 +324,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
           }
         }
       }
+      */
 
       // Perform
       BRepAlgoAPI_Fuse BO (aShape1, aShape2);
@@ -367,8 +387,16 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
         }
       }
 
-      if (isCompound)
-        aShape = C;
+      if (isCompound) {
+        //aShape = C;
+
+        // As GlueFaces has been improved to keep all kind of shapes
+        TopExp_Explorer anExp (C, TopAbs_VERTEX);
+        if (anExp.More())
+          aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+        else
+          aShape = C;
+      }
     }
 
     // UNKNOWN operation
index e2d0629e4a69d7a19a6fb4838d826bdba9f619cf..559908207e1f861d0037fc2704f2be1736bdf401 100644 (file)
@@ -113,7 +113,10 @@ Standard_Integer GEOMImpl_ExportDriver::Execute(TFunction_Logbook& log) const
   int res = fp( aShape, aFileName, aFormatName );
 
   // unload plugin library
-  //UnLoadLib( anExportLib );
+  // commented by enk:
+  // the bug was occured: using ACIS Import/Export plugin
+  // UnLoadLib( anExportLib );
+
   if ( res )
     log.SetTouched(Label()); 
 
index e056bf7d8479911ee17f766f9e23c45e3fc7838a..ec18620ffdb16e1d45b213e626408cfc37312d28 100644 (file)
@@ -73,6 +73,7 @@ const Standard_GUID& GEOMImpl_GlueDriver::GetID()
 //=======================================================================
 TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesWithWarnings (const TopoDS_Shape& theShape,
                                                          const Standard_Real theTolerance,
+                                                         const Standard_Boolean doKeepNonSolids,
                                                          TCollection_AsciiString& theWarning) const
 {
   Standard_Integer iErr, iWrn;
@@ -82,6 +83,7 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesWithWarnings (const TopoDS_Shape& the
   aGluer.SetShape(theShape);
   aGluer.SetTolerance(theTolerance);
   aGluer.SetCheckGeometry(Standard_True);
+  aGluer.SetKeepNonSolids(doKeepNonSolids);
 
   aGluer.Perform();
 
@@ -197,7 +199,8 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesWithWarnings (const TopoDS_Shape& the
 //purpose  :
 //=======================================================================
 TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
-                                             const Standard_Real theTolerance)
+                                             const Standard_Real theTolerance,
+                                             const Standard_Boolean doKeepNonSolids)
 {
   Standard_Integer iErr, iWrn;
   TopoDS_Shape aRes;
@@ -206,6 +209,7 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
   aGluer.SetShape(theShape);
   aGluer.SetTolerance(theTolerance);
   aGluer.SetCheckGeometry(Standard_True);
+  aGluer.SetKeepNonSolids(doKeepNonSolids);
 
   aGluer.Perform();
 
@@ -261,6 +265,7 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
 //=======================================================================
 TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesByList (const TopoDS_Shape& theShape,
                                                   const Standard_Real theTolerance,
+                                                   const Standard_Boolean doKeepNonSolids,
                                                   const TopTools_MapOfShape& aFaces)
 {
   TopoDS_Shape aRes;
@@ -272,6 +277,7 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesByList (const TopoDS_Shape& theShape,
 
   aGluer.SetShape(theShape);
   aGluer.SetTolerance(theTolerance);
+  aGluer.SetKeepNonSolids(doKeepNonSolids);
   aGluer.Perform();
   Standard_Integer iErr = aGluer.ErrorStatus();
   if (iErr) return aRes;
@@ -327,8 +333,10 @@ Standard_Integer GEOMImpl_GlueDriver::Execute(TFunction_Logbook& log) const
 
   Standard_Real tol3d = aCI.GetTolerance();
 
+  Standard_Boolean aKeepNonSolids = aCI.GetKeepNonSolids();
+
   if (aType == GLUE_FACES) {
-    aShape = GlueFacesWithWarnings(aShapeBase, tol3d, aWrn);
+    aShape = GlueFacesWithWarnings(aShapeBase, tol3d, aKeepNonSolids, aWrn);
   }
   else { // aType == GLUE_FACES_BY_LIST
     Handle(TColStd_HSequenceOfTransient) SF = aCI.GetFaces();
@@ -347,7 +355,7 @@ Standard_Integer GEOMImpl_GlueDriver::Execute(TFunction_Logbook& log) const
       if(!aFaces.Contains(aFace))
        aFaces.Add(aFace);
     }
-    aShape = GlueFacesByList(aShapeBase, tol3d, aFaces);
+    aShape = GlueFacesByList(aShapeBase, tol3d, aKeepNonSolids, aFaces);
   }
 
   if (aShape.IsNull()) return 0;
index eee00b868d75f9e096b733a9b066e7bae9d624cd..e7c3befa849c93a28e0484cf4cec58044f01a348 100644 (file)
@@ -150,14 +150,17 @@ Standard_EXPORT static const Standard_GUID& GetID();
 Standard_EXPORT ~GEOMImpl_GlueDriver() {};
 
 Standard_EXPORT static TopoDS_Shape GlueFaces (const TopoDS_Shape& theShape,
-                                               const Standard_Real theTolerance);
+                                               const Standard_Real theTolerance,
+                                               const Standard_Boolean doKeepNonSolids = Standard_True);
 
 Standard_EXPORT TopoDS_Shape GlueFacesWithWarnings (const TopoDS_Shape& theShape,
                                                     const Standard_Real theTolerance,
+                                                    const Standard_Boolean doKeepNonSolids,
                                                     TCollection_AsciiString& theWarning) const;
 
 Standard_EXPORT static TopoDS_Shape GlueFacesByList (const TopoDS_Shape& theShape,
                                                     const Standard_Real theTolerance,
+                                                     const Standard_Boolean doKeepNonSolids,
                                                     const TopTools_MapOfShape& aFaces);
 
 
index d2753622d2ce7d201bcaa524d4290d87c6c25a97..f5c4040a17a8f10b759d8bfab3b383dc505c66f3 100644 (file)
@@ -148,7 +148,8 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
                               const Standard_Integer                      theLimit,
                               const Standard_Boolean                      theRemoveWebs,
                               const Handle(TColStd_HArray1OfInteger)&     theMaterials,
-                              const Standard_Boolean                      thePerformSelfIntersections)
+                             const Standard_Integer theKeepNonlimitShapes,
+                              const Standard_Boolean thePerformSelfIntersections)
 {
   SetErrorCode(KO);
 
@@ -251,6 +252,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
 
   // Limit
   aCI.SetLimit(theLimit);
+  aCI.SetKeepNonlimitShapes(theKeepNonlimitShapes);
 
   // Materials
   if (theRemoveWebs) {
@@ -302,7 +304,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
       pd << ", " << theMaterials->Value(i);
     }
   }
-  pd << "])";
+  pd << "], " << theKeepNonlimitShapes <<")";
 
   SetErrorCode(OK);
   return aPartition;
index fd82587b27d7e736f0faeba1dedf6b6eda4531ce..6dc82d7be23d005e30b99069b6e4b5c2730b23c9 100644 (file)
@@ -46,7 +46,8 @@ class GEOMImpl_IBooleanOperations : public GEOM_IOperations {
                    const Standard_Integer                      theLimit,
                    const Standard_Boolean                      theRemoveWebs,
                    const Handle(TColStd_HArray1OfInteger)&     theMaterials,
-                   const Standard_Boolean                      thePerformSelfIntersections);
+                  const Standard_Integer theKeepNonlimitShapes,
+                  const Standard_Boolean thePerformSelfIntersections);
 
   Standard_EXPORT Handle(GEOM_Object) MakeHalfPartition (Handle(GEOM_Object) theShape,
                                                          Handle(GEOM_Object) thePlane);
index 7670ed70a65f14d3a49c0eae88aafa42b7046e39..e6e269221b7494f093bfc5894b327332d816b23d 100644 (file)
@@ -27,6 +27,7 @@
 #define GLUE_ARG_BASE   1
 #define GLUE_ARG_TOLER  2
 #define GLUE_ARG_FACES  3
+#define GLUE_ARG_KEEPALL 4
 
 class GEOMImpl_IGlue
 {
@@ -50,6 +51,9 @@ class GEOMImpl_IGlue
   Handle(TColStd_HSequenceOfTransient) GetFaces()
   { return _func->GetReferenceList(GLUE_ARG_FACES); }
 
+  void SetKeepNonSolids (Standard_Boolean theFlag) { _func->SetInteger(GLUE_ARG_KEEPALL, theFlag ? 1 : 0); }
+  Standard_Boolean GetKeepNonSolids() { return (_func->GetInteger(GLUE_ARG_KEEPALL) != 0); }
+
  private:
 
   Handle(GEOM_Function) _func;
index 1141f0f0c5ae44fd46b817067dc03a39e10d24bb..bf1ff4d7c59e3629e81bfb076dbd91c0798095c2 100644 (file)
@@ -36,6 +36,8 @@
 #define PART_ARG_SHAPE 7
 #define PART_ARG_PLANE 8
 
+#define PART_ARG_KEEP_NONLIMIT_SHAPES 9
+
 class GEOMImpl_IPartition
 {
  public:
@@ -44,6 +46,9 @@ class GEOMImpl_IPartition
 
   void SetLimit(int theLimit) { _func->SetInteger(PART_ARG_LIMIT, theLimit); }
 
+  void SetKeepNonlimitShapes(int theKeepNonlimitShapes)
+  { _func->SetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES,theKeepNonlimitShapes ); }
+
   void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
   { _func->SetReferenceList(PART_ARG_SHAPES, theShapes); }
 
@@ -62,6 +67,8 @@ class GEOMImpl_IPartition
 
   int GetLimit() { return _func->GetInteger(PART_ARG_LIMIT); }
 
+  int GetKeepNonlimitShapes() { return _func->GetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES); }
+
   Handle(TColStd_HSequenceOfTransient) GetShapes()    { return _func->GetReferenceList(PART_ARG_SHAPES); }
   Handle(TColStd_HSequenceOfTransient) GetTools()     { return _func->GetReferenceList(PART_ARG_TOOLS); }
   Handle(TColStd_HSequenceOfTransient) GetKeepIns()   { return _func->GetReferenceList(PART_ARG_KEEP_IN); }
index 28cae6290ac018fd7b04857d8a72e45ec136a934..8f698def7504c7579c7ba8b6eb66c69085044dbd 100644 (file)
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+// File      : GEOMImpl_IShapesOperations.cxx
+// Created   : 
+// Author    : modified by Lioka RAZAFINDRAZAKA (CEA) 22/06/2007
+// Project   : SALOME
+// $Header$
 
 #include <Standard_Stream.hxx>
 
@@ -42,7 +47,6 @@
 #include "GEOMAlgo_FinderShapeOnQuad.hxx"
 #include "GEOMAlgo_FinderShapeOn2.hxx"
 #include "GEOMAlgo_ClsfBox.hxx"
-//#include "GEOMAlgo_ClsfSurf.hxx"
 #include "GEOMAlgo_Gluer1.hxx"
 #include "GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx"
 #include "GEOMAlgo_CoupleOfShapes.hxx"
@@ -62,6 +66,7 @@
 #include <BRepExtrema_ExtCF.hxx>
 
 #include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
 #include <BRepTools.hxx>
 #include <BRepGProp.hxx>
 #include <BRepAdaptor_Curve.hxx>
@@ -78,6 +83,7 @@
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Vertex.hxx>
+#include <TopoDS_Compound.hxx>
 #include <TopoDS_Iterator.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopLoc_Location.hxx>
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
+// Includes added for GetInPlace algorithm improvement
+
+#include <GEOMImpl_MeasureDriver.hxx>
+#include <GEOMImpl_IMeasure.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+
+#include <BRepClass_FaceClassifier.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
+#include <Precision.hxx>
+
 //=============================================================================
 /*!
  *   constructor:
@@ -496,7 +512,8 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeShape
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFaces
                                                 (Handle(GEOM_Object) theShape,
-                                                 const Standard_Real theTolerance)
+                                                 const Standard_Real theTolerance,
+                                                 const Standard_Boolean doKeepNonSolids)
 {
   SetErrorCode(KO);
 
@@ -520,6 +537,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFaces
 
   aCI.SetBase(aRefShape);
   aCI.SetTolerance(theTolerance);
+  aCI.SetKeepNonSolids(doKeepNonSolids);
 
   //Compute the sub-shape value
   Standard_Boolean isWarning = Standard_False;
@@ -635,7 +653,8 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueFaces
 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
                                                 (Handle(GEOM_Object) theShape,
                                                  const Standard_Real theTolerance,
-                                                list<Handle(GEOM_Object)> theFaces)
+                                                list<Handle(GEOM_Object)> theFaces,
+                                                 const Standard_Boolean doKeepNonSolids)
 {
   SetErrorCode(KO);
 
@@ -659,6 +678,8 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
 
   aCI.SetBase(aRefShape);
   aCI.SetTolerance(theTolerance);
+  aCI.SetKeepNonSolids(doKeepNonSolids);
+
   Handle(TColStd_HSequenceOfTransient) aFaces = new TColStd_HSequenceOfTransient;
   list<Handle(GEOM_Object)>::iterator it = theFaces.begin();
   for (; it != theFaces.end(); it++) {
@@ -1420,6 +1441,12 @@ Handle(TColStd_HSequenceOfInteger)
   TopoDS_Shape aBox = theBox->GetValue();
   TopoDS_Shape aShape = theShape->GetValue();
 
+  // Check presence of triangulation, build if need
+  if (!CheckTriangulation(aShape)) {
+    SetErrorCode("Cannot build triangulation on the shape");
+    return aSeqOfIDs;
+  }
+
   // Call algo
   GEOMAlgo_FinderShapeOn2 aFinder;
   Standard_Real aTol = 0.0001; // default value
@@ -1581,8 +1608,10 @@ Handle(TColStd_HSequenceOfInteger)
   Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
 
   // Check presence of triangulation, build if need
-  if (!CheckTriangulation(theShape))
+  if (!CheckTriangulation(theShape)) {
+    SetErrorCode("Cannot build triangulation on the shape");
     return aSeqOfIDs;
+  }
 
   // Call algo
   GEOMAlgo_FinderShapeOn1 aFinder;
@@ -2201,8 +2230,10 @@ Handle(TColStd_HSequenceOfInteger)
   Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
 
   // Check presence of triangulation, build if need
-  if (!CheckTriangulation(aShape))
+  if (!CheckTriangulation(aShape)) {
+    SetErrorCode("Cannot build triangulation on the shape");
     return aSeqOfIDs;
+  }
 
   // Call algo
   gp_Pnt aPntTL = BRep_Tool::Pnt(TopoDS::Vertex(aTL));
@@ -2392,7 +2423,7 @@ Handle(TColStd_HSequenceOfInteger)
 
 //=============================================================================
 /*!
- *  GetInPlace
+ *  GetInPlaceOfShape
  */
 //=============================================================================
 static bool GetInPlaceOfShape (const Handle(GEOM_Function)& theWhereFunction,
@@ -2514,7 +2545,182 @@ static bool GetInPlaceOfShape (const Handle(GEOM_Function)& theWhereFunction,
   return isFound;
 }
 
-Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace
+//=============================================================================
+/*!
+ *  GetShapeProperties
+ */
+//=============================================================================
+
+void GEOMImpl_IShapesOperations::GetShapeProperties( const TopoDS_Shape aShape, Standard_Real tab[],
+                                                     gp_Pnt & aVertex )
+{
+  GProp_GProps SProps, VProps;
+  gp_Pnt aCenterMass;
+  TopoDS_Shape aPntShape;
+  Standard_Real aShapeSize;
+
+  BRepGProp::VolumeProperties(aShape, VProps);
+  aCenterMass = VProps.CentreOfMass();
+  aShapeSize  = VProps.Mass();
+  if (aShape.ShapeType() == TopAbs_FACE) {
+    BRepGProp::SurfaceProperties(aShape, SProps);
+    aCenterMass = SProps.CentreOfMass();
+    aShapeSize  = SProps.Mass();
+  }
+
+  aPntShape = BRepBuilderAPI_MakeVertex(aCenterMass).Shape();
+  aVertex   = BRep_Tool::Pnt( TopoDS::Vertex( aPntShape ) );
+  tab[0] = aVertex.X();
+  tab[1] = aVertex.Y();
+  tab[2] = aVertex.Z();
+  tab[3] = aShapeSize;
+  return;
+}
+
+//=============================================================================
+/*!
+ *  GetInPlace
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) theShapeWhere,
+                                                            Handle(GEOM_Object) theShapeWhat)
+{
+  SetErrorCode(KO);
+
+  if (theShapeWhere.IsNull() || theShapeWhat.IsNull()) return NULL;
+
+  TopoDS_Shape aWhere = theShapeWhere->GetValue();
+  TopoDS_Shape aWhat  = theShapeWhat->GetValue();
+
+  if (aWhere.IsNull() || aWhat.IsNull()) {
+    SetErrorCode("Error: aWhere and aWhat TopoDS_Shape are Null.");
+    return NULL;
+  }
+
+  Handle(GEOM_Function) aWhereFunction = theShapeWhere->GetLastFunction();
+  if (aWhereFunction.IsNull()) {
+    SetErrorCode("Error: aWhereFunction is Null.");
+    return NULL;
+  }
+
+  TopTools_IndexedMapOfShape aWhereIndices;
+  TopExp::MapShapes(aWhere, aWhereIndices);
+
+  TColStd_ListOfInteger aModifiedList;
+  Standard_Integer aWhereIndex;
+  Handle(TColStd_HArray1OfInteger) aModifiedArray;
+  Handle(GEOM_Object) aResult;
+
+  bool isFound = false;
+  Standard_Integer iType = TopAbs_SOLID;
+  Standard_Real    aWhat_Mass = 0., aWhere_Mass = 0.;
+  Standard_Real    tab_aWhat[4],    tab_aWhere[4];
+  Standard_Real    dl_l = 1e-3;
+  Standard_Real    min_l, Tol_1D, Tol_2D, Tol_3D, Tol_Mass;
+  gp_Pnt           aPnt, aPnt_aWhat;
+  GProp_GProps     aProps;
+
+  // 2D or 3D shapes
+  if ( aWhat.ShapeType() == TopAbs_COMPOUND  ||
+       aWhat.ShapeType() == TopAbs_SHELL     ||
+       aWhat.ShapeType() == TopAbs_COMPSOLID ) {
+    TopExp_Explorer Exp( aWhat, TopAbs_ShapeEnum( iType ) );
+    if ( ! Exp.More() ) iType = TopAbs_FACE;
+  }
+  else if ( aWhat.ShapeType() == TopAbs_FACE )
+    iType = TopAbs_FACE;
+
+  TopExp_Explorer Exp_aWhat( aWhat,   TopAbs_ShapeEnum( iType ) );
+  TopExp_Explorer Exp_aWhere( aWhere, TopAbs_ShapeEnum( iType ) );
+  TopExp_Explorer Exp_Edge( aWhere,   TopAbs_EDGE );
+
+  // Find the shortest edge in theShapeWhere shape
+  for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) {
+    BRepGProp::LinearProperties(Exp_Edge.Current(), aProps);
+    if ( ! nbEdge ) min_l = aProps.Mass();
+    if ( aProps.Mass() < min_l ) min_l = aProps.Mass();
+  }
+
+  // Compute tolerances
+  Tol_1D = dl_l * min_l;
+  Tol_2D = dl_l * ( min_l * min_l) * ( 2. + dl_l);
+  Tol_3D = dl_l * ( min_l * min_l * min_l ) * ( 3. + (3 * dl_l) + (dl_l * dl_l) );
+
+  Tol_Mass = Tol_3D;
+  if ( iType == TopAbs_FACE ) Tol_Mass = Tol_2D;
+
+  // Compute the ShapeWhat Mass
+  for ( ; Exp_aWhat.More(); Exp_aWhat.Next() ) {
+    if      ( iType == TopAbs_SOLID ) BRepGProp::VolumeProperties(Exp_aWhat.Current(), aProps);
+    else if ( iType == TopAbs_FACE )  BRepGProp::SurfaceProperties(Exp_aWhat.Current(), aProps);
+    aWhat_Mass += aProps.Mass();
+  }
+
+  // Finding the Sub-ShapeWhere
+  for ( Exp_aWhere.ReInit(); Exp_aWhere.More(); Exp_aWhere.Next() ) {
+    GetShapeProperties( Exp_aWhere.Current(), tab_aWhere, aPnt );
+    for ( Exp_aWhat.ReInit(); Exp_aWhat.More(); Exp_aWhat.Next() ) {
+      GetShapeProperties( Exp_aWhat.Current(), tab_aWhat, aPnt_aWhat );
+      if ( fabs(tab_aWhat[3] - tab_aWhere[3]) <= Tol_Mass && aPnt_aWhat.Distance(aPnt) <= Tol_1D )
+        isFound = true;
+      else if ( tab_aWhat[3] - ( tab_aWhere[3] > Tol_Mass) ) {
+        BRepClass3d_SolidClassifier SC_aWhere (Exp_aWhere.Current(), aPnt, Precision::Confusion());
+        BRepClass3d_SolidClassifier SC_aWhat  (Exp_aWhat.Current(),  aPnt, Precision::Confusion());
+        // Block construction 3D
+        if      ( SC_aWhere.State() == TopAbs_IN && SC_aWhat.State() == TopAbs_IN ) isFound = true;
+        // Block construction 2D
+        else if ( SC_aWhere.State() == TopAbs_ON && SC_aWhat.State() == TopAbs_ON ) isFound = true;
+      }
+      if ( isFound ) {
+        aWhereIndex = aWhereIndices.FindIndex(Exp_aWhere.Current());
+        aModifiedList.Append(aWhereIndex);
+        aWhere_Mass += tab_aWhere[3];
+        isFound = false;
+        break;
+      }
+    }
+    if ( fabs( aWhat_Mass - aWhere_Mass ) <= Tol_Mass ) break;
+  }
+
+  aModifiedArray = new TColStd_HArray1OfInteger (1, aModifiedList.Extent());
+  TColStd_ListIteratorOfListOfInteger anIterModif (aModifiedList);
+  for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++)
+    aModifiedArray->SetValue(imod, anIterModif.Value());
+
+  //Add a new object
+  aResult = GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
+  if (aResult.IsNull()) {
+    SetErrorCode("Error in algorithm: result found, but cannot be returned.");
+    return NULL;
+  }
+
+  if (aModifiedArray->Length() > 1) {
+    //Set a GROUP type
+    aResult->SetType(GEOM_GROUP);
+
+    //Set a sub shape type
+    TopoDS_Shape aFirstFound = aWhereIndices.FindKey(aModifiedArray->Value(1));
+    TopAbs_ShapeEnum aShapeType = aFirstFound.ShapeType();
+
+    TDF_Label aFreeLabel = aResult->GetFreeLabel();
+    TDataStd_Integer::Set(aFreeLabel, (Standard_Integer)aShapeType);
+  }
+
+  //Make a Python command
+  Handle(GEOM_Function) aFunction = aResult->GetFunction(1);
+
+  GEOM::TPythonDump(aFunction) << aResult << " = geompy.GetInPlace("
+    << theShapeWhere << ", " << theShapeWhat << ")";
+
+  SetErrorCode(OK);
+  return aResult;
+}
+
+//=======================================================================
+//function : GetInPlaceByHistory
+//purpose  :
+//=======================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
                                           (Handle(GEOM_Object) theShapeWhere,
                                            Handle(GEOM_Object) theShapeWhat)
 {
@@ -2645,22 +2851,65 @@ void GEOMImpl_IShapesOperations::SortShapes(TopTools_ListOfShape& SL)
     SL.Append( aShapes( OrderInd(Index) ));
 }
 
+//=======================================================================
+//function : CompsolidToCompound
+//purpose  :
+//=======================================================================
+TopoDS_Shape GEOMImpl_IShapesOperations::CompsolidToCompound (const TopoDS_Shape& theCompsolid)
+{
+  if (theCompsolid.ShapeType() != TopAbs_COMPSOLID) {
+    return theCompsolid;
+  }
+
+  TopoDS_Compound aCompound;
+  BRep_Builder B;
+  B.MakeCompound(aCompound);
+
+  TopTools_MapOfShape mapShape;
+  TopoDS_Iterator It (theCompsolid, Standard_True, Standard_True);
+
+  for (; It.More(); It.Next()) {
+    TopoDS_Shape aShape_i = It.Value();
+    if (mapShape.Add(aShape_i)) {
+      B.Add(aCompound, aShape_i);
+    }
+  }
+
+  return aCompound;
+}
+
 //=======================================================================
 //function : CheckTriangulation
 //purpose  :
 //=======================================================================
 bool GEOMImpl_IShapesOperations::CheckTriangulation (const TopoDS_Shape& aShape)
 {
+  bool isTriangulation = true;
+
   TopExp_Explorer exp (aShape, TopAbs_FACE);
-  if (!exp.More()) {
-    SetErrorCode("Shape without faces given");
-    return false;
+  if (exp.More())
+  {
+    TopLoc_Location aTopLoc;
+    Handle(Poly_Triangulation) aTRF;
+    aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc);
+    if (aTRF.IsNull()) {
+      isTriangulation = false;
+    }
+  }
+  else // no faces, try edges
+  {
+    TopExp_Explorer expe (aShape, TopAbs_EDGE);
+    if (!expe.More()) {
+      return false;
+    }
+    TopLoc_Location aLoc;
+    Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(expe.Current()), aLoc);
+    if (aPE.IsNull()) {
+      isTriangulation = false;
+    }
   }
 
-  TopLoc_Location aTopLoc;
-  Handle(Poly_Triangulation) aTRF;
-  aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc);
-  if (aTRF.IsNull()) {
+  if (!isTriangulation) {
     // calculate deflection
     Standard_Real aDeviationCoefficient = 0.001;
 
@@ -2773,6 +3022,7 @@ static bool isSameFace(const TopoDS_Face& theFace1, const TopoDS_Face& theFace2)
     if(P.Z() > zmaxB2) zmaxB2 = P.Z();
   }
 
+
   //Compare the bounding boxes of both faces
   if(gp_Pnt(xminB1, yminB1, zminB1).Distance(gp_Pnt(xminB2, yminB2, zminB2)) > MAX_TOLERANCE)
     return false;
@@ -2780,6 +3030,33 @@ static bool isSameFace(const TopoDS_Face& theFace1, const TopoDS_Face& theFace2)
   if(gp_Pnt(xmaxB1, ymaxB1, zmaxB1).Distance(gp_Pnt(xmaxB2, ymaxB2, zmaxB2)) > MAX_TOLERANCE)
     return false;
 
+  Handle(Geom_Surface) S1 = BRep_Tool::Surface(theFace1);
+  Handle(Geom_Surface) S2 = BRep_Tool::Surface(theFace2);
+
+  //Check if there a coincidence of two surfaces at least in two points
+  double U11, U12, V11, V12, U21, U22, V21, V22;
+  BRepTools::UVBounds(theFace1, U11, U12, V11, V12);
+  BRepTools::UVBounds(theFace2, U21, U22, V21, V22);
+
+  double rangeU = U12-U11;
+  double rangeV = V12-V11;
+  double U = U11 + rangeU/3.0;
+  double V = V11 + rangeV/3.0;
+  gp_Pnt P1 = S1->Value(U, V);
+  U = U11+rangeU*2.0/3.0;
+  V = V11+rangeV*2.0/3.0;
+  gp_Pnt P2 = S1->Value(U, V);
+  
+  if(!GeomLib_Tool::Parameters(S2, P1, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
+    return false;
+  
+  if(P1.Distance(S2->Value(U,V)) > MAX_TOLERANCE) return false;
+  
+  if(!GeomLib_Tool::Parameters(S2, P2, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
+    return false;
+  
+  if(P2.Distance(S2->Value(U, V)) > MAX_TOLERANCE) return false;
+
   //Check that each edge of the Face1 has a counterpart in the Face2
   TopTools_MapOfOrientedShape aMap;
   TopTools_ListIteratorOfListOfShape LSI1(LS1);
@@ -2799,36 +3076,6 @@ static bool isSameFace(const TopoDS_Face& theFace1, const TopoDS_Face& theFace2)
     if(!isFound) return false;
   }
 
-  Handle(Geom_Surface) S1 = BRep_Tool::Surface(theFace1);
-  Handle(Geom_Surface) S2 = BRep_Tool::Surface(theFace2);
-  if(S1->DynamicType() == S2->DynamicType()) {
-    return true;
-  }
-  else {   //Check if there a coincidence of two surfaces at least in two points
-    double U11, U12, V11, V12, U21, U22, V21, V22;
-    BRepTools::UVBounds(theFace1, U11, U12, V11, V12);
-    BRepTools::UVBounds(theFace2, U21, U22, V21, V22);
-
-    double rangeU = U12-U11;
-    double rangeV = V12-V11;
-    double U = U11 + rangeU/3.0;
-    double V = V11 + rangeV/3.0;
-    gp_Pnt P1 = S1->Value(U, V);
-    U = U11+rangeU*2.0/3.0;
-    V = V11+rangeV*2.0/3.0;
-    gp_Pnt P2 = S1->Value(U, V);
-
-    if(!GeomLib_Tool::Parameters(S2, P1, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
-      return false;
-
-    if(P1.Distance(S2->Value(U,V)) > MAX_TOLERANCE) return false;
-
-    if(!GeomLib_Tool::Parameters(S2, P2, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
-      return false;
-
-    if(P2.Distance(S2->Value(U, V)) > MAX_TOLERANCE) return false;
-  }
-
   return true;
 }
 
index 42d2ed991e3dde04f7e455508074fbb4b6def0f2..1e8cdc2c80a992099dbfac4be5e73e5cf41eae12 100644 (file)
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
+//=============================================================================
+// File      : GEOMImpl_IShapesOperations.hxx
+// Created   : 
+// Author    : modified by Lioka RAZAFINDRAZAKA (CEA) 22/06/2007
+// Project   : SALOME
+// Copyright : CEA 2003
+// $Header$
+//=============================================================================
 #ifndef _GEOMImpl_IShapesOperations_HXX_
 #define _GEOMImpl_IShapesOperations_HXX_
 
 #include <list>
 #include <Handle_Geom_Surface.hxx>
 
+#include <gp_Pnt.hxx>
+
 class GEOM_Engine;
 class Handle(GEOM_Object);
 class Handle(TColStd_HArray1OfInteger);
 
-class GEOMImpl_IShapesOperations : public GEOM_IOperations {
+class GEOMImpl_IShapesOperations : public GEOM_IOperations
+{
  public:
   Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID);
   Standard_EXPORT ~GEOMImpl_IShapesOperations();
@@ -60,22 +70,24 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
   Standard_EXPORT Handle(GEOM_Object) MakeCompound (list<Handle(GEOM_Object)> theShapes);
 
   Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (Handle(GEOM_Object) theShape,
-                                                    const Standard_Real theTolerance);
+                                                    const Standard_Real theTolerance,
+                                                     const Standard_Boolean doKeepNonSolids);
 
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueFaces (Handle(GEOM_Object) theShape,
                                                                     const Standard_Real theTolerance);
 
   Standard_EXPORT Handle(GEOM_Object) MakeGlueFacesByList (Handle(GEOM_Object) theShape,
                                                           const Standard_Real theTolerance,
-                                                          list<Handle(GEOM_Object)> theFaces);
+                                                          list<Handle(GEOM_Object)> theFaces,
+                                                           const Standard_Boolean doKeepNonSolids);
 
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode (Handle(GEOM_Object)    theShape,
-                                                    const Standard_Integer theShapeType,
-                                                    const Standard_Boolean isSorted);
+                                                                    const Standard_Integer theShapeType,
+                                                                    const Standard_Boolean isSorted);
 
   Standard_EXPORT Handle(TColStd_HSequenceOfInteger) SubShapeAllIDs (Handle(GEOM_Object)    theShape,
-                                                     const Standard_Integer theShapeType,
-                                                     const Standard_Boolean isSorted);
+                                                                     const Standard_Integer theShapeType,
+                                                                     const Standard_Boolean isSorted);
 
   Standard_EXPORT Handle(GEOM_Object) GetSubShape (Handle(GEOM_Object)    theMainShape,
                                                    const Standard_Integer theID);
@@ -112,22 +124,25 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
                                   const GEOMAlgo_State       theState);
 
 
-  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
-                                                            const Standard_Integer     theShapeType,
-                                                            const Handle(GEOM_Object)& theAxis,
-                                                            const Standard_Real        theRadius,
-                                                            const GEOMAlgo_State       theState);
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
+    GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
+                         const Standard_Integer     theShapeType,
+                         const Handle(GEOM_Object)& theAxis,
+                         const Standard_Real        theRadius,
+                         const GEOMAlgo_State       theState);
 
-  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnSphere (const Handle(GEOM_Object)& theShape,
-                                                          const Standard_Integer     theShapeType,
-                                                          const Handle(GEOM_Object)& theCenter,
-                                                          const Standard_Real        theRadius,
-                                                          const GEOMAlgo_State       theState);
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
+    GetShapesOnSphere (const Handle(GEOM_Object)& theShape,
+                       const Standard_Integer     theShapeType,
+                       const Handle(GEOM_Object)& theCenter,
+                       const Standard_Real        theRadius,
+                       const GEOMAlgo_State       theState);
 
-  Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnPlaneIDs (const Handle(GEOM_Object)& theShape,
-                                                          const Standard_Integer     theShapeType,
-                                                          const Handle(GEOM_Object)& theAx1,
-                                                          const GEOMAlgo_State       theState);
+  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
+    GetShapesOnPlaneIDs (const Handle(GEOM_Object)& theShape,
+                         const Standard_Integer     theShapeType,
+                         const Handle(GEOM_Object)& theAx1,
+                         const GEOMAlgo_State       theState);
 
   Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
     GetShapesOnPlaneWithLocationIDs (const Handle(GEOM_Object)& theShape,
@@ -136,17 +151,19 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
                                      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,
-                                                             const Standard_Real        theRadius,
-                                                             const GEOMAlgo_State       theState);
+  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
+    GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape,
+                            const Standard_Integer     theShapeType,
+                            const Handle(GEOM_Object)& theAxis,
+                            const Standard_Real        theRadius,
+                            const GEOMAlgo_State       theState);
 
-  Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnSphereIDs (const Handle(GEOM_Object)& theShape,
-                                                           const Standard_Integer     theShapeType,
-                                                           const Handle(GEOM_Object)& theCenter,
-                                                           const Standard_Real        theRadius,
-                                                           const GEOMAlgo_State       theState);
+  Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
+    GetShapesOnSphereIDs (const Handle(GEOM_Object)& theShape,
+                          const Standard_Integer     theShapeType,
+                          const Handle(GEOM_Object)& theCenter,
+                          const Standard_Real        theRadius,
+                          const GEOMAlgo_State       theState);
 
   /*!
    * \brief Find subshapes complying with given status about quadrangle
@@ -198,10 +215,13 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
                                             Handle(GEOM_Object)    theCenter,
                                             const Standard_Real    theRadius);
 
+  void GetShapeProperties(const TopoDS_Shape aShape, Standard_Real propertiesArray[], gp_Pnt & aPnt);
+
   Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
                                                   Handle(GEOM_Object) theShapeWhat);
 
-  Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL);
+  Standard_EXPORT Handle(GEOM_Object) GetInPlaceByHistory (Handle(GEOM_Object) theShapeWhere,
+                                                           Handle(GEOM_Object) theShapeWhat);
 
   /*!
    * \brief Searches a shape equal to theWhat in the context of theWhere
@@ -240,6 +260,30 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
                                                const Standard_Integer theShapeType,
                                                GEOMAlgo_State theState);
 
+ public:
+  /*!
+   * \brief Sort shapes in the list by their coordinates.
+   * \param SL The list of shapes to sort.
+   */
+  Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL);
+
+  /*!
+   * \brief Convert TopoDS_COMPSOLID to TopoDS_COMPOUND.
+   *
+   * If the argument shape is not of type TopoDS_COMPSOLID, this method returns it as is.
+   *
+   * \param theCompsolid The compsolid to be converted.
+   * \retval TopoDS_Shape Returns the resulting compound.
+   */
+  Standard_EXPORT static TopoDS_Shape CompsolidToCompound (const TopoDS_Shape& theCompsolid);
+
+  /*!
+   * \brief Build a triangulation on \a theShape if it is absent.
+   * \param theShape The shape to check/build triangulation on.
+   * \retval bool Returns false if the shape has no faces, i.e. impossible to build triangulation.
+   */
+  Standard_EXPORT static bool CheckTriangulation (const TopoDS_Shape& theShape);
+
  private:
   Handle(GEOM_Object) MakeShape (list<Handle(GEOM_Object)>      theShapes,
                                  const Standard_Integer         theObjectType,
@@ -247,11 +291,9 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
                                  const TCollection_AsciiString& theMethodName);
 
 // ----------------------------------------------------
-  // methods common for all GetShapesOnXXX() functions
+// methods common for all GetShapesOnXXX() functions
 // ----------------------------------------------------
 
-  bool CheckTriangulation (const TopoDS_Shape& aShape);
-
   /*!
    * \brief Checks if theShapeType parameter of GetShapesOnXXX() is OK
     * \param theShapeType - the shape type to check
index 90b01ace0589cc50fd70a2317365b0202d37bad0..b2ff8fe6b39fe40a8ecfc7ddbb7e90fefb90fc48 100644 (file)
@@ -107,7 +107,9 @@ Standard_Integer GEOMImpl_ImportDriver::Execute(TFunction_Logbook& log) const
   TCollection_AsciiString anError;
   TopoDS_Shape aShape = fp( aFileName, aFormatName, anError );
 
-  // unload plugin library  
+  // unload plugin library
+  // commented by enk:
+  // the bug was occured: using ACIS Import/Export plugin
   //UnLoadLib( anImportLib ); //This is workaround of BUG OCC13051
 
   if ( aShape.IsNull() ) {
index b079521e8d52b52f7152fb4e6882f403e8f0ae04..b681770981346109afa803f8a847d5c356b30871 100644 (file)
@@ -206,6 +206,7 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
       }
     }
 
+    PS.SetLimitMode(aCI.GetKeepNonlimitShapes());
     PS.SetLimit( (TopAbs_ShapeEnum)aCI.GetLimit() );
     PS.Perform();
 
index b14de152b39ee58f130d32391accd5b9c53510b9..320debb037fbf2012a5febd1b89462c2929ed821 100644 (file)
 #include <Standard_Stream.hxx>
 
 #include <GEOMImpl_PipeDriver.hxx>
+
+#include <GEOMImpl_IShapesOperations.hxx>
+#include <GEOMImpl_IPipeDiffSect.hxx>
+#include <GEOMImpl_IPipeShellSect.hxx>
 #include <GEOMImpl_IPipe.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
 
+#include <ShapeAnalysis_FreeBounds.hxx>
+#include <ShapeAnalysis_Edge.hxx>
+
 #include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepBuilderAPI_Sewing.hxx>
 #include <BRepCheck_Analyzer.hxx>
 #include <BRepOffsetAPI_MakePipe.hxx>
-#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepOffsetAPI_MakePipeShell.hxx>
+#include <GProp_GProps.hxx>
+#include <BRepGProp.hxx>
 
 #include <TopAbs.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Wire.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Solid.hxx>
 #include <TopoDS_Shell.hxx>
 #include <TopoDS_Face.hxx>
-#include <BRepOffsetAPI_MakePipeShell.hxx>
-#include <TColStd_HSequenceOfTransient.hxx>
-#include <GEOMImpl_IPipeDiffSect.hxx>
-#include <GEOMImpl_IPipeShellSect.hxx>
-
-#include <Standard_NullObject.hxx>
-#include <Standard_TypeMismatch.hxx>
-#include <Standard_ConstructionError.hxx>
-#include "utilities.h"
-#include <TopExp_Explorer.hxx>
-#include <TopTools_SequenceOfShape.hxx>
-#include <BRep_Builder.hxx>
 #include <TopoDS_Compound.hxx>
-#include <ShapeAnalysis_FreeBounds.hxx>
-#include <TColgp_SequenceOfPnt.hxx>
-#include <ShapeAnalysis_Edge.hxx>
+#include <TopTools_SequenceOfShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopExp.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
+
 #include <GeomAPI_ProjectPointOnCurve.hxx>
-#include <Precision.hxx>
 #include <Geom_TrimmedCurve.hxx>
-#include <BRepBuilderAPI_Sewing.hxx>
 
-//#include <BRepTools.hxx>
+#include <TColgp_SequenceOfPnt.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+
+#include <Precision.hxx>
+#include <Standard_NullObject.hxx>
+#include <Standard_TypeMismatch.hxx>
+#include <Standard_ConstructionError.hxx>
+
+#include "utilities.h"
+
+//#include "BRepTools.hxx"
 
 
 //=======================================================================
@@ -345,7 +353,6 @@ static void FindNextPairOfFaces(const TopoDS_Shape& aCurFace,
     }
 
     FindNextPairOfFaces(F1other, aMapEdgeFaces1, aMapEdgeFaces2, FF, aCI);
-    
   }
 }
 
@@ -423,6 +430,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
     Standard_ConstructionError::Raise
       ("First location shapes is not coincided with first vertex of aWirePath");
   }
+  VLocs.ChangeValue(1) = VF;
   edge = TopoDS::Edge(Edges.Last());
   tol = BRep_Tool::Tolerance(edge);
   TopoDS_Vertex VL = sae.LastVertex(edge);
@@ -432,11 +440,12 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
     Standard_ConstructionError::Raise
       ("Last location shapes is not coincided with last vertex of aWirePath");
   }
+  VLocs.ChangeValue(nbLocs) = VL;
   int jcurr = 2;
   TopTools_SequenceOfShape tmpEdges;
   for(i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
     TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
-    tol = BRep_Tool::Tolerance(edge);
+    tol = BRep_Tool::Tolerance(E);
     TopoDS_Vertex V1 = sae.FirstVertex(E);
     TopoDS_Vertex V2 = sae.LastVertex(E);
     gp_Pnt P1 = BRep_Tool::Pnt(V1);
@@ -450,11 +459,12 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
        B.Add(W,tmpEdges.Value(j));
       B.Add(W,E);
       Wires.Append(W);
+      VLocs.ChangeValue(jcurr) = V2;
       jcurr++;
       tmpEdges.Clear();
     }
     else {
-      // find distance between E and aLocs(icurr)
+      // find distance between E and aLocs(jcurr)
       double fp,lp;
       Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
       GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
@@ -467,7 +477,9 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
        Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
        Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
        TopoDS_Edge E1,E2;
-       if(PC1.Distance(P1)<tol) {
+       gp_Pnt Pfp;
+       C->D0(fp,Pfp);
+       if(Pfp.Distance(P1)<tol) {
          B.MakeEdge(E1,tc1,tol);
          B.Add(E1,V1);
          TopoDS_Shape tmpV = VLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
@@ -504,7 +516,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
        Edges.InsertAfter(i,E2);
       }
       else {
-       tmpEdges.Append(edge);
+       tmpEdges.Append(E);
       }
     }
   }
@@ -576,6 +588,153 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
       CreateFewSolids = true;
     }
 
+    /*
+    // check orientation of sections
+    bool NeedReverse = false;
+    {
+      // first section
+      anExp.Init( aShBase1, TopAbs_FACE );
+      TopoDS_Shape aFace = anExp.Current();
+      TColgp_SequenceOfPnt aPnts;
+      double xc=0, yc=0, zc=0;
+      for ( anExp.Init( aFace, TopAbs_VERTEX ); anExp.More(); anExp.Next() ) {
+       TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
+       aPnts.Append(BRep_Tool::Pnt(V));
+       xc += aPnts.Last().X();
+       yc += aPnts.Last().Y();
+       zc += aPnts.Last().Z();
+      }
+      gp_Pnt PC( xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length() );
+      gp_Vec V1(PC,aPnts.Value(1));
+      gp_Vec V2(PC,aPnts.Value(2));
+      gp_Vec VN = V1.Crossed(V2);
+      for(int ip=2; ip<aPnts.Length(); ip++) {
+       V1 = gp_Vec(PC,aPnts.Value(ip));
+       V2 = gp_Vec(PC,aPnts.Value(ip+1));
+       VN.Add(V1.Crossed(V2));
+      }
+      gp_Vec PathNorm;
+      gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i)));
+      TopExp_Explorer WE;
+      for ( WE.Init( WPath, TopAbs_EDGE ); WE.More(); WE.Next() ) {
+       TopoDS_Edge edge = TopoDS::Edge(WE.Current());
+       double tol = BRep_Tool::Tolerance(edge);
+       TopoDS_Vertex VF = sae.FirstVertex(edge);
+       gp_Pnt PF = BRep_Tool::Pnt(VF);
+       if( PF.Distance(PLoc) < tol ) {
+         double fp,lp;
+         Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+         gp_Pnt P1,P2;
+         C->D0(fp,P1);
+         if( P1.Distance(PLoc) < tol ) {
+           C->D0(fp+(lp-fp)/100,P2);
+         }
+         else {
+           C->D0(lp,P1);
+           C->D0(lp+(fp-lp)/100,P2);
+         }
+         PathNorm = gp_Vec(P1,P2);
+         break;
+       }
+       else {
+         TopoDS_Vertex VL = sae.LastVertex(edge);
+         gp_Pnt PL = BRep_Tool::Pnt(VL);
+         if( PL.Distance(PLoc) < tol ) {
+           double fp,lp;
+           Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+           gp_Pnt P1,P2;
+           C->D0(fp,P1);
+           if( P1.Distance(PLoc) < tol ) {
+             C->D0(fp+(lp-fp)/100,P2);
+           }
+           else {
+             C->D0(lp,P1);
+             C->D0(lp+(fp-lp)/100,P2);
+           }
+           PathNorm = gp_Vec(P2,P1);
+           break;
+         }
+       }
+      }
+      cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
+      cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
+      if(fabs(VN.Angle(PathNorm))>PI/2.) {
+       NeedReverse = true;
+       aShBase1.Reverse();
+      }
+    }
+    {
+      // second section
+      anExp.Init( aShBase2, TopAbs_FACE );
+      TopoDS_Shape aFace = anExp.Current();
+      TColgp_SequenceOfPnt aPnts;
+      double xc=0, yc=0, zc=0;
+      for ( anExp.Init( aFace, TopAbs_VERTEX ); anExp.More(); anExp.Next() ) {
+       TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
+       aPnts.Append(BRep_Tool::Pnt(V));
+       xc += aPnts.Last().X();
+       yc += aPnts.Last().Y();
+       zc += aPnts.Last().Z();
+      }
+      gp_Pnt PC( xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length() );
+      gp_Vec V1(PC,aPnts.Value(1));
+      gp_Vec V2(PC,aPnts.Value(2));
+      gp_Vec VN = V1.Crossed(V2);
+      for(int ip=2; ip<aPnts.Length(); ip++) {
+       V1 = gp_Vec(PC,aPnts.Value(ip));
+       V2 = gp_Vec(PC,aPnts.Value(ip+1));
+       VN.Add(V1.Crossed(V2));
+      }
+      gp_Vec PathNorm;
+      gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i+1)));
+      TopExp_Explorer WE;
+      for ( WE.Init( WPath, TopAbs_EDGE ); WE.More(); WE.Next() ) {
+       TopoDS_Edge edge = TopoDS::Edge(WE.Current());
+       double tol = BRep_Tool::Tolerance(edge);
+       TopoDS_Vertex VF = sae.FirstVertex(edge);
+       gp_Pnt PF = BRep_Tool::Pnt(VF);
+       if( PF.Distance(PLoc) < tol ) {
+         double fp,lp;
+         Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+         gp_Pnt P1,P2;
+         C->D0(fp,P1);
+         if( P1.Distance(PLoc) < tol ) {
+           C->D0(fp+(lp-fp)/100,P2);
+         }
+         else {
+           C->D0(lp,P1);
+           C->D0(lp+(fp-lp)/100,P2);
+         }
+         PathNorm = gp_Vec(P2,P1);
+         break;
+       }
+       else {
+         TopoDS_Vertex VL = sae.LastVertex(edge);
+         gp_Pnt PL = BRep_Tool::Pnt(VL);
+         if( PL.Distance(PLoc) < tol ) {
+           double fp,lp;
+           Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+           gp_Pnt P1,P2;
+           C->D0(fp,P1);
+           if( P1.Distance(PLoc) < tol ) {
+             C->D0(fp+(lp-fp)/100,P2);
+           }
+           else {
+             C->D0(lp,P1);
+             C->D0(lp+(fp-lp)/100,P2);
+           }
+           PathNorm = gp_Vec(P2,P1);
+           break;
+         }
+       }
+      }
+      //cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
+      //cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
+      if(fabs(VN.Angle(PathNorm))>PI/2.)
+       aShBase2.Reverse();
+    }
+    */
+
     if(!CreateFewSolids) {
       // we can create only one solid
       TopoDS_Shape aWire1, aWire2;
@@ -661,6 +820,11 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
        const TopoDS_Shape aSewShape = aSewing->SewedShape();
        if( aSewShape.ShapeType() == TopAbs_SHELL ) {
          aShell = TopoDS::Shell(aSewShape);
+         GProp_GProps aSystem;
+         BRepGProp::VolumeProperties(aShell, aSystem);
+         if(aSystem.Mass()<0) {
+           aShell.Reverse();
+         }
          if(BRep_Tool::IsClosed(aShell)) {
            TopoDS_Solid aSolid;
            B.MakeSolid(aSolid);
@@ -679,10 +843,12 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
     else {
       // main block - creation few solids (for each pair of faces)
       TopTools_MapOfShape aFaces1,aFaces2;
-      for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() )
+      for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
        aFaces1.Add(anExp.Current());
-      for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() )
+      }
+      for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
        aFaces2.Add(anExp.Current());
+      }
       // creating map of edge faces
       TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces1;
       TopExp::MapShapesAndAncestors(aShBase1, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces1);
@@ -844,7 +1010,6 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
 
 
       // make pipe for each pair of faces
-      //BRepTools::Write(WPath,"/dn02/users_Linux/skl/work/Bugs/14857/wpath.brep");
       for(j=1; j<=FF.Extent(); j++) {
        TopoDS_Shape F1 = FF.FindKey(j);
        if( F1.ShapeType() != TopAbs_FACE )
@@ -869,12 +1034,10 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
          TopoDS_Shape aShape = aBuilder.Shape();
          TopoDS_Shell aShell;
          B.MakeShell(aShell);
-         //int nbf=0;
          for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
-           //nbf++;
-           //cout<<"nbf="<<nbf<<endl;
            B.Add(aShell,anExp.Current());
          }
+
          B.Add(aShell,F1);
          B.Add(aShell,F2);
          // make sewing for this shell
@@ -890,6 +1053,12 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
          const TopoDS_Shape aSewShape = aSewing->SewedShape();
          if( aSewShape.ShapeType() == TopAbs_SHELL ) {
            aShell = TopoDS::Shell(aSewShape);
+           GProp_GProps aSystem;
+           BRepGProp::VolumeProperties(aShell, aSystem);
+           if(aSystem.Mass()<0) {
+             //cout<<"aSewShape is reversed"<<endl;
+             aShell.Reverse();
+           }
            if(BRep_Tool::IsClosed(aShell)) {
              TopoDS_Solid aSolid;
              B.MakeSolid(aSolid);
@@ -909,6 +1078,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
     }
   }
 
+  //BRepTools::Write(aComp,"/dn02/users_Linux/skl/work/Bugs/14857/comp.brep");
   return aComp;
 }
 
@@ -980,7 +1150,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
   {
     GEOMImpl_IPipeDiffSect* aCIDS = (GEOMImpl_IPipeDiffSect*)aCI;
     //GEOMImpl_IPipeDiffSect* aCIDS = static_cast<GEOMImpl_IPipeDiffSect*>(aCI);
-    BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
+    //BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
     Handle(TColStd_HSequenceOfTransient) aBasesObjs = aCIDS->GetBases ();
     Handle(TColStd_HSequenceOfTransient) aLocObjs = aCIDS->GetLocations ();
     Standard_Boolean aWithContact = (aCIDS->GetWithContactMode());
@@ -1069,6 +1239,116 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
     }
     
     nbLocs = aSeqLocs.Length();
+
+    // skl 02.05.2007
+    if(nbLocs>0) {
+      // we have to check that each location shape is a vertex from
+      // path and update aSeqLocs if it is needed (and possible)
+      TColgp_SequenceOfPnt PLocs;
+      for(i=1; i<=nbLocs; i++) {
+       TopoDS_Vertex V = TopoDS::Vertex(aSeqLocs.Value(i));
+       PLocs.Append(BRep_Tool::Pnt(V));
+      }
+      TopTools_SequenceOfShape Edges;
+      TopExp_Explorer anExp;
+      for ( anExp.Init( aWirePath, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
+       Edges.Append(anExp.Current());
+      }
+      int nbEdges = Edges.Length();
+      ShapeAnalysis_Edge sae;
+      TopoDS_Edge edge = TopoDS::Edge(Edges.First());
+      double tol = BRep_Tool::Tolerance(edge);
+      TopoDS_Vertex VF = sae.FirstVertex(edge);
+      gp_Pnt PF = BRep_Tool::Pnt(VF);
+      //cout<<"PF("<<PF.X()<<","<<PF.Y()<<","<<PF.Z()<<")"<<endl;
+      if( PF.Distance(PLocs.First()) > tol ) {
+       if(aCI) delete aCI;
+       Standard_ConstructionError::Raise
+         ("First location shapes is not coincided with first vertex of aWirePath");
+      }
+      aSeqLocs.ChangeValue(1) = VF;
+      edge = TopoDS::Edge(Edges.Last());
+      tol = BRep_Tool::Tolerance(edge);
+      TopoDS_Vertex VL = sae.LastVertex(edge);
+      gp_Pnt PL = BRep_Tool::Pnt(VL);
+      if( PL.Distance(PLocs.Last()) > tol ) {
+       if(aCI) delete aCI;
+       Standard_ConstructionError::Raise
+         ("Last location shapes is not coincided with last vertex of aWirePath");
+      }
+      aSeqLocs.ChangeValue(nbLocs) = VL;
+      int jcurr = 2;
+      for(i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
+       TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
+       tol = BRep_Tool::Tolerance(edge);
+       TopoDS_Vertex V1 = sae.FirstVertex(E);
+       TopoDS_Vertex V2 = sae.LastVertex(E);
+       gp_Pnt P1 = BRep_Tool::Pnt(V1);
+       gp_Pnt P2 = BRep_Tool::Pnt(V2);
+       if( P2.Distance(PLocs.Value(jcurr)) < tol ) {
+         aSeqLocs.ChangeValue(jcurr) = V2;
+         jcurr++;
+       }
+       else {
+         // find distance between E and aLocs(jcurr)
+         double fp,lp;
+         Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
+         GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
+         if( PPC.NbPoints()>0 &&
+             PLocs.Value(jcurr).Distance(PPC.Point(1)) < tol ) {
+           double param = PPC.Parameter(1);
+           gp_Pnt PC1;
+           C->D0(param,PC1);
+           // split current edge
+           Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
+           Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
+           TopoDS_Edge E1,E2;
+           BRep_Builder B;
+           gp_Pnt Pfp;
+           C->D0(fp,Pfp);
+           if(Pfp.Distance(P1)<tol) {
+             B.MakeEdge(E1,tc1,tol);
+             B.Add(E1,V1);
+             TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+             B.Add(E1,TopoDS::Vertex(tmpV));
+             B.MakeEdge(E2,tc2,tol);
+             tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+             B.Add(E2,TopoDS::Vertex(tmpV));
+             B.Add(E2,V2);
+           }
+           else {
+             B.MakeEdge(E1,tc2,tol);
+             TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+             B.Add(E1,TopoDS::Vertex(tmpV));
+             B.Add(E1,V1);
+             E1.Reverse();
+             B.MakeEdge(E2,tc1,tol);
+             B.Add(E2,V2);
+             tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+             B.Add(E2,TopoDS::Vertex(tmpV));
+             E2.Reverse();
+           }
+           jcurr++;
+           Edges.Remove(i);
+           Edges.InsertAfter(i-1,E1);
+           Edges.InsertAfter(i,E2);
+         }
+       }
+      }
+      if(nbEdges<Edges.Length()) {
+       // one of edges was splitted => we have to update WirePath
+       BRep_Builder B;
+       TopoDS_Wire W;
+       B.MakeWire(W);
+       for(i=1; i<=Edges.Length(); i++) {
+         B.Add(W,TopoDS::Edge(Edges.Value(i)));
+       }
+       aWirePath = W;
+      }
+    }
+
+    BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
+
     Standard_Integer nbShapes = aSeqBases.Length();
     Standard_Integer step = nbShapes/nbBases;
     
@@ -1135,7 +1415,8 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
     Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
   }
 
-  aFunction->SetValue(aShape);
+  TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
+  aFunction->SetValue(aRes);
 
   log.SetTouched(Label());
   if(aCI) delete aCI;
index 87157a5fcfada5d38e32adc67477dffa3e14ea21..8d049aa56b23fbbe1f044e4f521ecfaa1424b375 100644 (file)
@@ -21,6 +21,8 @@
 #include <Standard_Stream.hxx>
 
 #include <GEOMImpl_PrismDriver.hxx>
+
+#include <GEOMImpl_IShapesOperations.hxx>
 #include <GEOMImpl_IPrism.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
@@ -114,7 +116,8 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
 
   if (aShape.IsNull()) return 0;
 
-  aFunction->SetValue(aShape);
+  TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
+  aFunction->SetValue(aRes);
 
   log.SetTouched(Label()); 
 
index beec64f3c3387041c585ace91401777cc74d91f3..2f790ca3ee055a4435d3a86da8324f7dcf52a7e7 100644 (file)
@@ -21,6 +21,8 @@
 #include <Standard_Stream.hxx>
 
 #include <GEOMImpl_RevolutionDriver.hxx>
+
+#include <GEOMImpl_IShapesOperations.hxx>
 #include <GEOMImpl_IRevolution.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
@@ -114,11 +116,13 @@ Standard_Integer GEOMImpl_RevolutionDriver::Execute(TFunction_Logbook& log) cons
   }
 
   if (aShape.IsNull()) return 0;
-  aFunction->SetValue(aShape);
 
-  log.SetTouched(Label()); 
+  TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
+  aFunction->SetValue(aRes);
+
+  log.SetTouched(Label());
 
-  return 1;    
+  return 1;
 }
 
 
index 6ffbd0ce8b1fe56ab7ed804a1da1d600997e3e9d..8697b2e1c0d071c0a79656c995c7a1833946d176 100644 (file)
@@ -112,7 +112,6 @@ libGEOMimpl_la_CPPFLAGS = \
        $(KERNEL_CXXFLAGS) \
        $(BOOST_CPPFLAGS) \
        -I$(srcdir)/../ShHealOper \
-       -I$(srcdir)/../NMTAlgo \
        -I$(srcdir)/../NMTTools \
        -I$(srcdir)/../GEOM \
        -I$(srcdir)/../GEOMAlgo \
@@ -122,7 +121,6 @@ libGEOMimpl_la_CPPFLAGS = \
 
 libGEOMimpl_la_LDFLAGS  = \
        ../GEOM/libGEOMbasic.la \
-       ../NMTAlgo/libNMTAlgo.la \
        ../GEOMAlgo/libGEOMAlgo.la \
        ../ShHealOper/libShHealOper.la \
        ../ARCHIMEDE/libGEOMArchimede.la \
index 4a3e34a712e293906ffdd6da76e943cf594fd476..2527b21cd1cbf4248a8c022d4b9722896bacc603 100644 (file)
@@ -78,9 +78,15 @@ static QString getFileName( QWidget*           parent,
 {
   static QString lastUsedFilter;
   QStringList filters;
-  for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it )
+  QString aBrepFilter;
+  for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it ) {
     filters.push_back( it.key() );
 
+    if (it.key().contains("BREP", false)) {
+      aBrepFilter = it.key();
+    }
+  }
+
   SUIT_FileDlg* fd = new SUIT_FileDlg( parent, open, true, true );
   if ( !caption.isEmpty() )
     fd->setCaption( caption );
@@ -88,10 +94,15 @@ static QString getFileName( QWidget*           parent,
   if ( !initial.isEmpty() )
     fd->setSelection( initial );
 
+  fd->setFilters( filters );
+
   if ( !lastUsedFilter.isEmpty() && filterMap.contains( lastUsedFilter ) )
     fd->setSelectedFilter( lastUsedFilter );
-
-  fd->setFilters( filters );
+  else {
+    if (!aBrepFilter.isEmpty()) {
+      fd->setSelectedFilter(aBrepFilter);
+    }
+  }
 
   fd->exec();
   QString filename = fd->selectedFile();
index c7a594259d8ae63c97c649ad2ab0adc87ef9deff..836451282d49f7b6cc464ca4701a8c1d02fe5fff 100644 (file)
@@ -99,7 +99,8 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
                                       const GEOM::ListOfGO&   theRemoveIns,
                                       CORBA::Short            theLimit,
                                       CORBA::Boolean          theRemoveWebs,
-                                      const GEOM::ListOfLong& theMaterials)
+                                      const GEOM::ListOfLong& theMaterials,
+                                      CORBA::Short theKeepNonlimitShapes)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -166,6 +167,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
   Handle(GEOM_Object) anObject =
     GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
                                   theLimit, theRemoveWebs, aMaterials,
+                                  theKeepNonlimitShapes,
                                   /*PerformSelfIntersections*/Standard_True);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
@@ -185,7 +187,8 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
                                       const GEOM::ListOfGO&   theRemoveIns,
                                       CORBA::Short            theLimit,
                                       CORBA::Boolean          theRemoveWebs,
-                                      const GEOM::ListOfLong& theMaterials)
+                                      const GEOM::ListOfLong& theMaterials,
+                                      CORBA::Short theKeepNonlimitShapes)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -252,6 +255,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
   Handle(GEOM_Object) anObject =
     GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
                                   theLimit, theRemoveWebs, aMaterials,
+                                  theKeepNonlimitShapes,
                                   /*PerformSelfIntersections*/Standard_False);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
index 52e597ed46832bd9d103c4146dcea11869c690b0..7379d00b8d6089f5cd685245c1f21031319d552d 100644 (file)
@@ -50,7 +50,8 @@ class GEOM_I_EXPORT GEOM_IBooleanOperations_i :
                                       const GEOM::ListOfGO&   theRemoveInside,
                                       CORBA::Short            theLimit,
                                       CORBA::Boolean          theRemoveWebs,
-                                      const GEOM::ListOfLong& theMaterials);
+                                      const GEOM::ListOfLong& theMaterials,
+                                      CORBA::Short theKeepNonlimitShapes);
 
   GEOM::GEOM_Object_ptr MakePartitionNonSelfIntersectedShape (const GEOM::ListOfGO&   theShapes,
                                                              const GEOM::ListOfGO&   theTools,
@@ -58,7 +59,8 @@ class GEOM_I_EXPORT GEOM_IBooleanOperations_i :
                                                              const GEOM::ListOfGO&   theRemoveInside,
                                                              CORBA::Short            theLimit,
                                                              CORBA::Boolean          theRemoveWebs,
-                                                             const GEOM::ListOfLong& theMaterials);
+                                                             const GEOM::ListOfLong& theMaterials,
+                                                             CORBA::Short theKeepNonlimitShapes);
 
 
   GEOM::GEOM_Object_ptr MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
index b3edf98dbaeedf9c4c9a50b0ad6413bcdf3e74ab..32dd0f0236dd5498b79ef4ea19e026269cf48615 100644 (file)
@@ -328,7 +328,8 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
                                            (GEOM::GEOM_Object_ptr theShape,
-                                           const CORBA::Double   theTolerance)
+                                           const CORBA::Double   theTolerance,
+                                           const CORBA::Boolean  doKeepNonSolids)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -345,7 +346,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
 
   //Perform the gluing
   Handle(GEOM_Object) anObject =
-    GetOperations()->MakeGlueFaces(aShape, theTolerance);
+    GetOperations()->MakeGlueFaces(aShape, theTolerance, doKeepNonSolids);
   //if (!GetOperations()->IsDone() || anObject.IsNull())
   // to allow warning
   if (anObject.IsNull())
@@ -401,7 +402,8 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
                                            (GEOM::GEOM_Object_ptr theShape,
                                            const CORBA::Double   theTolerance,
-                                           const GEOM::ListOfGO& theFaces)
+                                           const GEOM::ListOfGO& theFaces,
+                                           const CORBA::Boolean  doKeepNonSolids)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -430,7 +432,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
 
   //Perform the gluing
   Handle(GEOM_Object) anObject =
-    GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces);
+    GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces, doKeepNonSolids);
   //if (!GetOperations()->IsDone() || anObject.IsNull())
   // to allow warning
   if (anObject.IsNull())
@@ -1323,6 +1325,41 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  GetInPlaceByHistory
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
+                                          (GEOM::GEOM_Object_ptr theShapeWhere,
+                                          GEOM::GEOM_Object_ptr theShapeWhat)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if (theShapeWhere == NULL ||
+      theShapeWhat == NULL) return aGEOMObject._retn();
+
+  //Get the reference objects
+  Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
+    (theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
+  Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
+    (theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
+
+  if (aShapeWhere.IsNull() ||
+      aShapeWhat.IsNull()) return aGEOMObject._retn();
+
+  //Get Shapes in place of aShapeWhat
+  Handle(GEOM_Object) anObject =
+    GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
 //=============================================================================
 /*!
  *  GetSame
index 84575a15dcafbb549689326a64d21c0d54314a2b..dc507db1c437411a448c5e9640e620abce2c71e7 100644 (file)
@@ -61,14 +61,16 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
   GEOM::GEOM_Object_ptr MakeCompound (const GEOM::ListOfGO& theShapes);
 
   GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
-                                      CORBA::Double         theTolerance);
+                                      CORBA::Double         theTolerance,
+                                      const CORBA::Boolean  doKeepNonSolids);
 
   GEOM::ListOfGO* GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
                                CORBA::Double         theTolerance);
 
   GEOM::GEOM_Object_ptr MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
                                             CORBA::Double         theTolerance,
-                                            const GEOM::ListOfGO& theFaces);
+                                            const GEOM::ListOfGO& theFaces,
+                                            const CORBA::Boolean  doKeepNonSolids);
 
   GEOM::ListOfGO* MakeExplode (GEOM::GEOM_Object_ptr theShape,
                               CORBA::Long           theShapeType,
@@ -175,6 +177,9 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
   GEOM::GEOM_Object_ptr GetInPlace (GEOM::GEOM_Object_ptr theShapeWhere,
                                    GEOM::GEOM_Object_ptr theShapeWhat);
 
+  GEOM::GEOM_Object_ptr GetInPlaceByHistory (GEOM::GEOM_Object_ptr theShapeWhere,
+                                            GEOM::GEOM_Object_ptr theShapeWhat);
+
   GEOM::GEOM_Object_ptr GetSame (GEOM::GEOM_Object_ptr theShapeWhere,
                                 GEOM::GEOM_Object_ptr theShapeWhat);
 
index 299d9f55098785b43cfc297fefbef28c0fde426e..fa0a64a0e70081a9cfcf5cefb2a60935cd624bcf 100644 (file)
@@ -1040,7 +1040,8 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePartition (GEOM::GEOM_List_ptr   theSha
                                                    GEOM::GEOM_List_ptr   theRemoveInside,
                                                    CORBA::Short      theLimit,
                                                    CORBA::Boolean    theRemoveWebs,
-                                                   GEOM::GEOM_List_ptr theMaterials)
+                                                   GEOM::GEOM_List_ptr theMaterials,
+                                                   CORBA::Short theKeepNonlimitShapes)
 {
   beginService( " GEOM_Superv_i::MakePartition" );
   MESSAGE("GEOM_Superv_i::MakePartition");
@@ -1056,9 +1057,11 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePartition (GEOM::GEOM_List_ptr   theSha
     dynamic_cast<GEOM_List_i<GEOM::ListOfLong>*>(GetServant(theMaterials, myPOA).in());
   if (aListImplS && aListImplT && aListImplKI && aListImplRI && aListImplM) {
     getBoolOp();
-    GEOM::GEOM_Object_ptr anObj = 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(),
+                             theKeepNonlimitShapes);
     endService( " GEOM_Superv_i::MakePartition" );
     return anObj;
   }
@@ -1678,12 +1681,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCompound (GEOM::GEOM_List_ptr theShapes
 //  MakeGlueFaces:
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
-                                                   CORBA::Double   theTolerance)
+                                                   CORBA::Double   theTolerance,
+                                                   CORBA::Boolean doKeepNonSolids)
 {
   beginService( " GEOM_Superv_i::MakeGlueFaces" );
   MESSAGE("GEOM_Superv_i::MakeGlueFaces");
   getShapesOp();
-  GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeGlueFaces(theShape, theTolerance);
+  GEOM::GEOM_Object_ptr anObj =
+    myShapesOp->MakeGlueFaces(theShape, theTolerance, doKeepNonSolids);
   endService( " GEOM_Superv_i::MakeGlueFaces" );
   return anObj;
 }
@@ -1709,12 +1714,14 @@ GEOM::GEOM_List_ptr GEOM_Superv_i::GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
                                                          CORBA::Double theTolerance,
-                                                         const GEOM::ListOfGO& theFaces)
+                                                         const GEOM::ListOfGO& theFaces,
+                                                         CORBA::Boolean doKeepNonSolids)
 {
   beginService( " GEOM_Superv_i::MakeGlueFacesByList" );
   MESSAGE("GEOM_Superv_i::MakeGlueFacesByList");
   getShapesOp();
-  GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeGlueFacesByList(theShape, theTolerance, theFaces);
+  GEOM::GEOM_Object_ptr anObj =
+    myShapesOp->MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids);
   endService( " GEOM_Superv_i::MakeGlueFacesByList" );
   return anObj;
 }
index 298a01edeb4df3906db2b849fbca897a58997d13..84773c8c4ca0b71ce7a8b8d5e7f101dda9b4b0f2 100644 (file)
@@ -258,7 +258,8 @@ public:
                                       GEOM::GEOM_List_ptr   theRemoveInside,
                                       CORBA::Short      theLimit,
                                       CORBA::Boolean    theRemoveWebs,
-                                      GEOM::GEOM_List_ptr theMaterials);
+                                      GEOM::GEOM_List_ptr theMaterials,
+                                      CORBA::Short theKeepNonlimitShapes);
   GEOM::GEOM_Object_ptr MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
                                           GEOM::GEOM_Object_ptr thePlane);
 
@@ -378,12 +379,14 @@ public:
   GEOM::GEOM_Object_ptr MakeSolidShells (GEOM::GEOM_List_ptr theShells);
   GEOM::GEOM_Object_ptr MakeCompound (GEOM::GEOM_List_ptr theShapes);
   GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
-                                      CORBA::Double theTolerance);
+                                      CORBA::Double theTolerance,
+                                      CORBA::Boolean doKeepNonSolids);
   GEOM::GEOM_List_ptr GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
                                    CORBA::Double theTolerance);
   GEOM::GEOM_Object_ptr MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
                                             CORBA::Double theTolerance,
-                                            const GEOM::ListOfGO& theFaces);
+                                            const GEOM::ListOfGO& theFaces,
+                                            CORBA::Boolean doKeepNonSolids);
   GEOM::GEOM_List_ptr MakeExplode (GEOM::GEOM_Object_ptr theShape,
                                       CORBA::Long theShapeType,
                                       CORBA::Boolean isSorted);
index 81b0aa1e059bc547df4b59728e76d7cd460fbe7d..3bf25cf7527c8c30f4ef368ce67c676af98e490e 100644 (file)
@@ -528,24 +528,72 @@ def TestOtherOperations (geompy, math):
   geompy.UnionIDs(vertices_on_quad, vertices_on_quad_ids)
   geompy.addToStudy(vertices_on_quad, "Group of vertices on Quadrangle F12")
 
-  # GetInPlace(theShapeWhere, theShapeWhat)
+  # Prepare arguments for GetInPlace and GetInPlaceByHistory
   box5 = geompy.MakeBoxDXDYDZ(100, 100, 100)
   box6 = geompy.MakeTranslation(box5, 50, 50, 0)
 
+  geompy.addToStudy(box5, "Box 5")
+  geompy.addToStudy(box6, "Box 6")
+
+  part = geompy.MakePartition([box5], [box6])
+  geompy.addToStudy(part, "Partitioned")
+
+  box5_faces = geompy.SubShapeAll(box5, geompy.ShapeType["FACE"])
+  box6_faces = geompy.SubShapeAll(box6, geompy.ShapeType["FACE"])
+
+  ifa = 1
+  for aface in box5_faces:
+    geompy.addToStudyInFather(box5, aface, "Face" + `ifa`)
+    ifa = ifa + 1
+
+  ifa = 1
+  for aface in box6_faces:
+    geompy.addToStudyInFather(box6, aface, "Face" + `ifa`)
+    ifa = ifa + 1
+
+  # GetInPlace(theShapeWhere, theShapeWhat)
+  ibb = 5
+  faces_list = [box5_faces, box6_faces]
+  for afaces in faces_list:
+    ifa = 1
+    for aface in afaces:
+      if ibb == 6 and (ifa == 2 or ifa == 4):
+        # use IDL interface directly to avoid error message appearence in Python console
+        refl_box_face = geompy.ShapesOp.GetInPlace(part, aface)
+        if refl_box_face is not None:
+          geompy.addToStudyInFather(part, refl_box_face,
+                                    "Reflection of face " + `ifa` + " of box " + `ibb`)
+          error = "Result of GetInPlace must be NULL for face " + `ifa` + " of box " + `ibb`
+          raise RuntimeError, error
+      else:
+        # use geompy interface
+        refl_box_face = geompy.GetInPlace(part, aface)
+        geompy.addToStudyInFather(part, refl_box_face,
+                                  "Reflection of face " + `ifa` + " of box " + `ibb`)
+      ifa = ifa + 1
+    ibb = ibb + 1
+
+  # GetInPlaceByHistory(theShapeWhere, theShapeWhat)
   part = geompy.MakePartition([box5], [box6])
   geompy.addToStudy(part, "Partitioned")
 
   ibb = 5
-  box_list = [box5, box6]
-  for abox in box_list:
-    geompy.addToStudy(abox, "Box " + `ibb`)
-    box_faces = geompy.SubShapeAll(abox, geompy.ShapeType["FACE"])
+  faces_list = [box5_faces, box6_faces]
+  for afaces in faces_list:
     ifa = 1
-    for aface in box_faces:
-      geompy.addToStudyInFather(abox, aface, "Face" + `ifa`)
-      refl_box_face = geompy.GetInPlace(part, aface)
-      if refl_box_face is not None:
+    for aface in afaces:
+      if ibb == 6 and (ifa == 2 or ifa == 4):
+        # use IDL interface directly to avoid error message appearence in Python console
+        refl_box_face = geompy.ShapesOp.GetInPlaceByHistory(part, aface)
+        if refl_box_face is not None:
+          geompy.addToStudyInFather(part, refl_box_face,
+                                    "Reflection of face " + `ifa` + " of box " + `ibb` + " (by history)")
+          error = "Result of GetInPlaceByHistory must be NULL for face " + `ifa` + " of box " + `ibb`
+          raise RuntimeError, error
+      else:
+        # use geompy interface
+        refl_box_face = geompy.GetInPlaceByHistory(part, aface)
         geompy.addToStudyInFather(part, refl_box_face,
-                                  "Reflection of Face " + `ifa` + " of box " + `ibb`)
+                                  "Reflection of face " + `ifa` + " of box " + `ibb` + " (by history)")
       ifa = ifa + 1
     ibb = ibb + 1
index 1190037abb5ef1bc51fb8bd242b80839c33ce045..fd979913d6d3e23bed69c5bd5d1bf7094580e135 100755 (executable)
@@ -97,7 +97,7 @@ p_tools.append(geompy.MakePlane(geompy.MakeVertex(gx+g_rayonPetit, 0, 0), geompy
 
 addToStudy(t_boite, "t_boite")
 
-p_element = geompy.MakePartition([t_boite], p_tools, [], [], 4, 0, [])
+p_element = geompy.MakePartition([t_boite], p_tools, [], [], 4, 0, [], 0)
 
 # Compound
 # --------
index a4f68108d721cb743fe9b21c7bc9cb6103f763b0..ca9cc2ea7a0f29672998a7d4fd557f840395f3a1 100644 (file)
@@ -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
 #
 #
 #
 
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-# ===============================================================
-# Swig targets
-# ===============================================================
-# (cf. http://www.geocities.com/foetsch/python/swig_linux.htm)
-#
-# Step 1: build the wrapping source files with swig
-#
-# libSALOME_LifeCycleCORBA.i -- swig --> swig_wrap.cpp
-#                                        libSALOME_Swig.py
-#
-# Step 2: build the dynamic library from cpp built source files and
-#         dependant libraries.
-#
-# swig_wrap.cpp -- gcc --> swig_wrap.o    |-- link --> _libSALOME_Swig.la
-#                          +              |
-#                          dependant libs |
-#
-# The file libSALOME_Swigcmodule.py will be installed in
-# <prefix>/lib/python<version>/site-package/salome.
-# The library will be installed in the same place.
-#
-
-# this option puts it to dist
-#BUILT_SOURCES = swig_wrap.cpp
-
-SWIG_FLAGS    = \
-       @SWIG_FLAGS@ \
-       -I$(srcdir) \
-       -I$(srcdir)/../GEOMGUI
-
-SWIG_SOURCES  = libGEOM_Swig.i
-
-# Libraries targets
-lib_LTLIBRARIES = libGEOM_Swigcmodule.la
-
-nodist_pkgpython_DATA = libGEOM_Swig.py
-libGEOM_Swig.py: swig_wrap.cpp
-
-libGEOM_Swigcmodule_la_SOURCES = \
-       $(BUILT_SOURCES) \
-       $(SWIG_SOURCES)
-
-nodist_libGEOM_Swigcmodule_la_SOURCES = swig_wrap.cpp
-
-#LIB_CLIENT_IDL = SALOMEDS.idl \
-#                 SALOMEDS_Attributes.idl \
-#               SALOME_Exception.idl \
-#               GEOM_Gen.idl \
-#               SALOME_Component.idl \
-#               SALOME_GenericObj.idl
 
 EXPORT_SHAREDPYSCRIPTS=\
        GEOM_shared_modules.py
 
-libGEOM_Swigcmodule_la_CPPFLAGS = \
-       $(QT_INCLUDES) \
-       $(PYTHON_INCLUDES) \
-       $(CAS_CPPFLAGS) \
-       $(VTK_INCLUDES) \
-       $(OGL_INCLUDES) \
-       $(KERNEL_CXXFLAGS) \
-       $(GUI_CXXFLAGS) \
-       $(CORBA_CXXFLAGS) \
-       $(CORBA_INCLUDES) \
-       -I$(srcdir)/../GEOMGUI \
-       -I$(top_builddir)/idl \
-       -I$(top_builddir)/salome_adm/unix
-
-libGEOM_Swigcmodule_la_LDFLAGS = \
-       ../GEOMGUI/libGEOM.la
-
-
-libGEOM_Swigcmodule_la_LIBADD  = \
-       $(PYTHON_LIBS)
-
-swig_wrap.cpp : $(SWIG_SOURCES)
-       $(SWIG) $(SWIG_FLAGS) -o $@ $<
-
-CLEANFILES = \
-       swig_wrap.cpp
-
 #
 # ===============================================================
 # Files to be installed
@@ -121,7 +44,6 @@ CLEANFILES = \
 
 # Scripts to be installed.
 dist_salomescript_DATA= \
-       libGEOM_Swig.py \
        geompy.py \
        geompyDC.py \
        batchmode_geompy.py \
@@ -157,9 +79,3 @@ dist_salomescript_DATA= \
 
 sharedpkgpython_PYTHON = \
        GEOM_shared_modules.py
-
-install-exec-hook:\
-       $(libdir)/_libGEOM_Swig.so
-
-$(libdir)/_libGEOM_Swig.so:
-       ( cd $(libdir); ln -sf libGEOM_Swigcmodule.so _libGEOM_Swig.so; )
index 0f91c8c9dcf4b9e4210e32176a133cf95ea46771..42e9ec5c292f961cb4086fd7a53ccf15f22d3a0c 100644 (file)
@@ -699,19 +699,23 @@ def MakeSection(s1, s2):
     return MakeBoolean(s1, s2, 4)
 
 def MakePartition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
-                  Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+                  Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+                  KeepNonlimitShapes=0):
     anObj = BoolOp.MakePartition(ListShapes, ListTools,
                                  ListKeepInside, ListRemoveInside,
-                                 Limit, RemoveWebs, ListMaterials);
+                                 Limit, RemoveWebs, ListMaterials,
+                                 KeepNonlimitShapes);
     if BoolOp.IsDone() == 0:
       print "MakePartition : ", BoolOp.GetErrorCode()
     return anObj
 
 def Partition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
-              Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+              Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+              KeepNonlimitShapes=0):
     anObj = MakePartition(ListShapes, ListTools,
                           ListKeepInside, ListRemoveInside,
-                          Limit, RemoveWebs, ListMaterials);
+                          Limit, RemoveWebs, ListMaterials,
+                          KeepNonlimitShapes);
     return anObj
 
 def MakeHalfPartition(theShape, thePlane):
index afff1b41757b197bc7b773a1672bf83fd8f282c8..78bbae079a589e1928a7bff3c8fdaf8190b308fb 100644 (file)
@@ -732,7 +732,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @param theSeqSubBases - list of corresponding subshapes of section shapes.
         #  @param theLocations - list of locations on the path corresponding
         #                        specified list of the Bases shapes. Number of locations
-        #                        should be equal to number of bases or list of locations can be empty.
+        #                        should be equal to number of bases. First and last
+        #                        locations must be coincided with first and last vertexes
+        #                        of path correspondingly.
         #  @param thePath - Path shape to extrude the base shape along it.
         #  @param theWithContact - the mode defining that the section is translated to be in
         #                          contact with the spine.
@@ -1079,6 +1081,27 @@ class geompyDC(GEOM._objref_GEOM_Gen):
                 print "GetInPlace : ", self.ShapesOp.GetErrorCode()
             return anObj
         
+        ## Get sub-shape(s) of \a theShapeWhere, which are
+        #  coincident with \a theShapeWhat or could be a part of it.
+        #
+        #  Implementation of this method is based on a saved history of an operation,
+        #  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
+        #  arguments (an argument shape or a sub-shape of an argument shape).
+        #  The operation could be the Partition or one of boolean operations,
+        #  performed on simple shapes (not on compounds).
+        #
+        #  @param theShapeWhere Shape to find sub-shapes of.
+        #  @param theShapeWhat Shape, specifying what to find (must be in the
+        #                      building history of the ShapeWhere).
+        #  @return Group of all found sub-shapes or a single found sub-shape.
+        #
+        #  Example: see GEOM_TestOthers.py
+        def GetInPlaceByHistory(theShapeWhere, theShapeWhat):
+            anObj = ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
+            if ShapesOp.IsDone() == 0:
+                print "GetInPlace : ", ShapesOp.GetErrorCode()
+            return anObj
+
         ## Get sub-shape of theShapeWhere, which is
         #  equal to \a theShapeWhat.
         #  @param theShapeWhere Shape to find sub-shape of.
@@ -1365,11 +1388,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         ## Replace coincident faces in theShape by one face.
         #  @param theShape Initial shape.
         #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
+        #  @param doKeepNonSolids If FALSE, only solids will present in the result,
+        #                         otherwise all initial shapes.
         #  @return New GEOM_Object, containing a copy of theShape without coincident faces.
         #
         #  Example: see GEOM_Spanner.py
-        def MakeGlueFaces(self,theShape, theTolerance):
-            anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance)
+        def MakeGlueFaces(theShape, theTolerance, doKeepNonSolids=True):
+            anObj = ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
             if self.ShapesOp.IsDone() == 0:
                 print "MakeGlueFaces : ", self.ShapesOp.GetErrorCode()
             return anObj
@@ -1382,7 +1407,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @return ListOfGO.
         #
         #  Example: see GEOM_Spanner.py
-        def GetGlueFaces(self,theShape, theTolerance):
+        def GetGlueFaces(self, theShape, theTolerance):
             anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
             if self.ShapesOp.IsDone() == 0:
                 print "GetGlueFaces : ", self.ShapesOp.GetErrorCode()
@@ -1395,12 +1420,14 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @param theTolerance Maximum distance between faces,
         #                      which can be considered as coincident.
         #  @param theFaces List of faces for gluing.
+        #  @param doKeepNonSolids If FALSE, only solids will present in the result,
+        #                         otherwise all initial shapes.
         #  @return New GEOM_Object, containing a copy of theShape
         #          without some faces.
         #
         #  Example: see GEOM_Spanner.py
-        def MakeGlueFacesByList(self,theShape, theTolerance, theFaces):
-            anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces)
+        def MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids=True):
+            anObj = ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
             if self.ShapesOp.IsDone() == 0:
                 print "MakeGlueFacesByList : ", self.ShapesOp.GetErrorCode()
             return anObj
@@ -1455,6 +1482,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #           in order to avoid possible intersection between shapes from
         #           this compound.
         #  @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
+        #  @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
+        #                             type <= Limit are kept in the result,
+        #                             else - shapes with type > Limit are kept
+        #                             also (if they exist)
         #
         #  After implementation new version of PartitionAlgo (October 2006)
         #  other parameters are ignored by current functionality. They are kept
@@ -1472,10 +1503,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #
         #  Example: see GEOM_TestAll.py
         def MakePartition(self,ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
-                          Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+                          Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+                          KeepNonlimitShapes=0):
             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
                                               ListKeepInside, ListRemoveInside,
-                                              Limit, RemoveWebs, ListMaterials);
+                                              Limit, RemoveWebs, ListMaterials,
+                                              KeepNonlimitShapes);
             if self.BoolOp.IsDone() == 0:
                 print "MakePartition : ", self.BoolOp.GetErrorCode()
             return anObj
@@ -1492,11 +1525,14 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #
         #  @return New GEOM_Object, containing the result shapes.
         #
-        def MakePartitionNonSelfIntersectedShape(self,ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
-                                                 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+        def MakePartitionNonSelfIntersectedShape(ListShapes, ListTools=[],
+                                                 ListKeepInside=[], ListRemoveInside=[],
+                                                 Limit=ShapeType["SHAPE"], RemoveWebs=0,
+                                                 ListMaterials=[], KeepNonlimitShapes=0):
             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
                                                                      ListKeepInside, ListRemoveInside,
-                                                                     Limit, RemoveWebs, ListMaterials);
+                                                                     Limit, RemoveWebs, ListMaterials,
+                                                                     KeepNonlimitShapes);
             if self.BoolOp.IsDone() == 0:
                 print "MakePartitionNonSelfIntersectedShape : ", self.BoolOp.GetErrorCode()
             return anObj
@@ -1505,10 +1541,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #
         #  Example: see GEOM_TestOthers.py
         def Partition(self,ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
-                      Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+                      Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+                      KeepNonlimitShapes=0):
             anObj = self.MakePartition(ListShapes, ListTools,
                                        ListKeepInside, ListRemoveInside,
-                                       Limit, RemoveWebs, ListMaterials);
+                                       Limit, RemoveWebs, ListMaterials,
+                                       KeepNonlimitShapes);
             return anObj
         
         ## Perform partition of the Shape with the Plane
diff --git a/src/GEOM_SWIG/libGEOM_Swig.i b/src/GEOM_SWIG/libGEOM_Swig.i
deleted file mode 100644 (file)
index b1c76a9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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      : libGeometry_Swig.i
-//  Created   : Tue Mar 26 15:04:48 2002
-//  Author    : Nicolas REJNERI, Paul RASCLE
-//  Project   : SALOME
-//  Module    : GEOM
-//  Copyright : Open CASCADE, EDF 2002
-//  $Header$
-
-%module libGEOM_Swig
-
-%include "GeometryGUI_Swig.i"
-
diff --git a/src/GEOM_SWIG_WITHIHM/Makefile.am b/src/GEOM_SWIG_WITHIHM/Makefile.am
new file mode 100644 (file)
index 0000000..e715931
--- /dev/null
@@ -0,0 +1,127 @@
+#  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
+#
+#  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   : Makefile.in
+#  Author : Nicolas REJNERI, Paul RASCLE
+#  Modified by : Alexander BORODIN (OCN) - autotools usage
+#  Module : GEOM
+#  $Header$
+
+
+# Libraries targets
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+# ===============================================================
+# Swig targets
+# ===============================================================
+# (cf. http://www.geocities.com/foetsch/python/swig_linux.htm)
+#
+# Step 1: build the wrapping source files with swig
+#
+# libSALOME_LifeCycleCORBA.i -- swig --> swig_wrap.cpp
+#                                        libSALOME_Swig.py
+#
+# Step 2: build the dynamic library from cpp built source files and
+#         dependant libraries.
+#
+# swig_wrap.cpp -- gcc --> swig_wrap.o    |-- link --> _libSALOME_Swig.la
+#                          +              |
+#                          dependant libs |
+#
+# The file libSALOME_Swigcmodule.py will be installed in
+# <prefix>/lib/python<version>/site-package/salome.
+# The library will be installed in the same place.
+#
+
+# this option puts it to dist
+#BUILT_SOURCES = swig_wrap.cpp
+
+SWIG_FLAGS    = \
+       @SWIG_FLAGS@ \
+       -I$(srcdir) \
+       -I$(srcdir)/../GEOMGUI
+
+SWIG_SOURCES  = libGEOM_Swig.i
+
+# Libraries targets
+lib_LTLIBRARIES = libGEOM_Swigcmodule.la
+
+nodist_pkgpython_DATA = libGEOM_Swig.py
+libGEOM_Swig.py: swig_wrap.cpp
+
+libGEOM_Swigcmodule_la_SOURCES = \
+       $(BUILT_SOURCES) \
+       $(SWIG_SOURCES)
+
+nodist_libGEOM_Swigcmodule_la_SOURCES = swig_wrap.cpp
+
+#LIB_CLIENT_IDL = SALOMEDS.idl \
+#                 SALOMEDS_Attributes.idl \
+#               SALOME_Exception.idl \
+#               GEOM_Gen.idl \
+#               SALOME_Component.idl \
+#               SALOME_GenericObj.idl
+
+libGEOM_Swigcmodule_la_CPPFLAGS = \
+       $(QT_INCLUDES) \
+       $(PYTHON_INCLUDES) \
+       $(CAS_CPPFLAGS) \
+       $(VTK_INCLUDES) \
+       $(OGL_INCLUDES) \
+       $(KERNEL_CXXFLAGS) \
+       $(GUI_CXXFLAGS) \
+       $(CORBA_CXXFLAGS) \
+       $(CORBA_INCLUDES) \
+       -I$(srcdir)/../GEOMGUI \
+       -I$(top_builddir)/idl \
+       -I$(top_builddir)/salome_adm/unix
+
+libGEOM_Swigcmodule_la_LDFLAGS = \
+       ../GEOMGUI/libGEOM.la
+
+
+libGEOM_Swigcmodule_la_LIBADD  = \
+       $(PYTHON_LIBS)
+
+swig_wrap.cpp : $(SWIG_SOURCES)
+       $(SWIG) $(SWIG_FLAGS) -o $@ $<
+
+CLEANFILES = \
+       swig_wrap.cpp
+
+#
+# ===============================================================
+# Files to be installed
+# ===============================================================
+#
+
+# Scripts to be installed.
+dist_salomescript_DATA= \
+       libGEOM_Swig.py
+
+install-exec-hook:\
+       $(libdir)/_libGEOM_Swig.so
+
+$(libdir)/_libGEOM_Swig.so:
+       ( cd $(libdir); ln -sf libGEOM_Swigcmodule.so _libGEOM_Swig.so; )
diff --git a/src/GEOM_SWIG_WITHIHM/libGEOM_Swig.i b/src/GEOM_SWIG_WITHIHM/libGEOM_Swig.i
new file mode 100644 (file)
index 0000000..b1c76a9
--- /dev/null
@@ -0,0 +1,31 @@
+// 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      : libGeometry_Swig.i
+//  Created   : Tue Mar 26 15:04:48 2002
+//  Author    : Nicolas REJNERI, Paul RASCLE
+//  Project   : SALOME
+//  Module    : GEOM
+//  Copyright : Open CASCADE, EDF 2002
+//  $Header$
+
+%module libGEOM_Swig
+
+%include "GeometryGUI_Swig.i"
+
index 54e4ad76b53696db865ebf64de5fcad5be8216d6..c1b1ffe5a1ae707bd58bff6ef9ebc8352be75ce2 100644 (file)
@@ -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
 //
 //
 //
 #include "SalomeApp_Application.h"
 #include "LightApp_SelectionMgr.h"
 
-#include <BRepPrimAPI_MakePrism.hxx>
-#include <BRepAdaptor_Curve.hxx>
-#include <gp_Lin.hxx>
-#include "GEOMImpl_Types.hxx"
-
 #include <qlabel.h>
 #include <qcheckbox.h>
 
+#include "GEOMImpl_Types.hxx"
+
 #include "utilities.h"
 
 //=================================================================================
 // class    : GenerationGUI_PrismDlg()
-// purpose  : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the 
+// purpose  : Constructs a GenerationGUI_PrismDlg 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.
 //=================================================================================
 GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(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)
+  : 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_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")));
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  QPixmap image0(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PRISM")));
+  QPixmap image1(aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+  QPixmap image2(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PRISM_2P")));
 
   setCaption(tr("GEOM_EXTRUSION_TITLE"));
 
@@ -65,9 +63,10 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWid
   GroupConstructors->setTitle(tr("GEOM_EXTRUSION"));
   RadioButton1->setPixmap(image0);
   RadioButton2->setPixmap(image2);
-  //RadioButton2->close(TRUE);
   RadioButton3->close(TRUE);
 
+  RadioButton1->setChecked(true);
+
   GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints");
   GroupPoints->CheckButton1->hide();
   GroupPoints->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV"));
@@ -95,7 +94,6 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWid
 
   setHelpFileName("extrusion.htm");
 
-  /* Initialisations */
   Init();
 }
 
@@ -105,8 +103,8 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWid
 // purpose  : Destroys the object and frees any allocated resources
 //=================================================================================
 GenerationGUI_PrismDlg::~GenerationGUI_PrismDlg()
-{  
-  /* no need to delete child widgets, Qt does it all for us */
+{
+  // no need to delete child widgets, Qt does it all for us
 }
 
 
@@ -125,15 +123,15 @@ void GenerationGUI_PrismDlg::Init()
   GroupPoints2->LineEdit2->setReadOnly( true );
   GroupPoints2->LineEdit3->setReadOnly( true );
 
-  //myOkBase = myOkVec = false;
+  myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
   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(COORD_MIN, COORD_MAX, step, 3);
+  GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
   GroupPoints->SpinBox_DX->SetValue(100.0);
 
   /* signals and slots connections */
@@ -149,9 +147,10 @@ void GenerationGUI_PrismDlg::Init()
   connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
 
   connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
+  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+          GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
 
-  connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)),      this, SLOT(onReverse()));
+  connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
 
 
   connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
@@ -163,12 +162,10 @@ void GenerationGUI_PrismDlg::Init()
   connect(GroupPoints2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
 
 
-  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
-         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+  connect(myGeomGUI->getApp()->selectionMgr(),
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   initName(tr("GEOM_EXTRUSION"));
-
-  globalSelection( GEOM_ALLSHAPES );
   ConstructorsClicked(0);
 }
 
@@ -179,52 +176,52 @@ void GenerationGUI_PrismDlg::Init()
 //=================================================================================
 void GenerationGUI_PrismDlg::ConstructorsClicked(int constructorId)
 {
-  disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
-  
+  erasePreview();
+  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
   switch (constructorId)
+  {
+  case 0:
     {
-    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;
-      }
+      globalSelection( GEOM_ALLSHAPES );
+
+      GroupPoints2->hide();
+      resize(0, 0);
+      GroupPoints->show();
+
+      myEditCurrentArgument = GroupPoints->LineEdit1;
+      GroupPoints->LineEdit1->setText(GroupPoints2->LineEdit1->text()); // keep base
+      GroupPoints->LineEdit2->setText("");
+      myVec = GEOM::GEOM_Object::_nil();
+      myOkVec = false;
+
+      break;
     }
-  displayPreview();
+  case 1:
+    {
+      globalSelection( GEOM_ALLSHAPES );
+
+      GroupPoints->hide();
+      resize(0, 0);
+      GroupPoints2->show();
+
+      myEditCurrentArgument = GroupPoints2->LineEdit1;
+      GroupPoints2->LineEdit1->setText(GroupPoints->LineEdit1->text()); // keep base
+      GroupPoints2->LineEdit2->setText("");
+      GroupPoints2->LineEdit3->setText("");
+      myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
+      myOkPnt1 = myOkPnt2 = false;
+
+      break;
+    }
+  }
+
+  myEditCurrentArgument->setFocus();
+  connect(myGeomGUI->getApp()->selectionMgr(),
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+  if (!myOkBase)
+    SelectionIntoArgument();
 }
 
 
@@ -262,8 +259,8 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
   erasePreview();
   myEditCurrentArgument->setText("");
 
-  if ( getConstructorId()==0 ) {
-
+  if (getConstructorId() == 0)
+  {
     if (IObjectCount() != 1) {
       if (myEditCurrentArgument == GroupPoints->LineEdit1)
         myOkBase = false;
@@ -288,13 +285,11 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
       myVec = aSelectedObject;
       myOkVec = true;
     }
-    myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
 
-    displayPreview();
+    myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
   }
-
-  else { // getConstructorId()==1 - extrusion using 2 points
-
+  else // getConstructorId()==1 - extrusion using 2 points
+  {
     if (IObjectCount() != 1) {
       if (myEditCurrentArgument == GroupPoints2->LineEdit1)
         myOkBase = false;
@@ -330,9 +325,28 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
       myOkPnt2 = true;
     }
 
-    myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+    myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
+  }
+
+  displayPreview();
+}
 
-    displayPreview();
+
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose  :
+//=================================================================================
+void GenerationGUI_PrismDlg::LineEditReturnPressed()
+{
+  QLineEdit* send = (QLineEdit*)sender();
+  if (send == GroupPoints->LineEdit1 ||
+      send == GroupPoints->LineEdit2 ||
+      send == GroupPoints2->LineEdit1 ||
+      send == GroupPoints2->LineEdit2 ||
+      send == GroupPoints2->LineEdit3 )
+  {
+    myEditCurrentArgument = send;
+    GEOMBase_Skeleton::LineEditReturnPressed();
   }
 }
 
@@ -344,81 +358,64 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
 void GenerationGUI_PrismDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-  globalSelection( GEOM_ALLSHAPES );
 
-  if(send == GroupPoints->PushButton1) {
+  if (send == GroupPoints->PushButton1) {
     GroupPoints->LineEdit1->setFocus();
     myEditCurrentArgument = GroupPoints->LineEdit1;
+    globalSelection( GEOM_ALLSHAPES );
   }
-  else if(send == GroupPoints->PushButton2) {
+  else if (send == GroupPoints->PushButton2) {
     GroupPoints->LineEdit2->setFocus();
     myEditCurrentArgument = GroupPoints->LineEdit2;
     globalSelection( GEOM_LINE );
   }
-  else if(send == GroupPoints2->PushButton1) {
+  else if (send == GroupPoints2->PushButton1) {
     GroupPoints2->LineEdit1->setFocus();
     myEditCurrentArgument = GroupPoints2->LineEdit1;
+    globalSelection( GEOM_ALLSHAPES );
   }
-  else if(send == GroupPoints2->PushButton2) {
+  else if (send == GroupPoints2->PushButton2) {
     GroupPoints2->LineEdit2->setFocus();
     myEditCurrentArgument = GroupPoints2->LineEdit2;
     globalSelection( GEOM_POINT );
   }
-  else if(send == GroupPoints2->PushButton3) {
+  else if (send == GroupPoints2->PushButton3) {
     GroupPoints2->LineEdit3->setFocus();
     myEditCurrentArgument = GroupPoints2->LineEdit3;
     globalSelection( GEOM_POINT );
   }
+
+  myEditCurrentArgument->setFocus();
   SelectionIntoArgument();
 }
 
 
 //=================================================================================
-// function : LineEditReturnPressed()
+// function : ActivateThisDialog()
 // purpose  :
 //=================================================================================
-void GenerationGUI_PrismDlg::LineEditReturnPressed()
+void GenerationGUI_PrismDlg::ActivateThisDialog()
 {
-  QLineEdit* send = (QLineEdit*)sender();
-  if(send == GroupPoints->LineEdit1 ||
-     send == GroupPoints->LineEdit2 ||
-     send == GroupPoints2->LineEdit1 ||
-     send == GroupPoints2->LineEdit2 ||
-     send == GroupPoints2->LineEdit3 )
-    {
-      myEditCurrentArgument = send;
-      GEOMBase_Skeleton::LineEditReturnPressed();
-    }
+  GEOMBase_Skeleton::ActivateThisDialog();
+
+  connect(myGeomGUI->getApp()->selectionMgr(),
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+  ConstructorsClicked( getConstructorId() );
 }
 
+
 //=================================================================================
 // function : enterEvent()
 // purpose  : when mouse enter onto the QWidget
 //=================================================================================
 void GenerationGUI_PrismDlg::enterEvent(QEvent * e)
 {
-  if ( !GroupConstructors->isEnabled() )
+  if (!GroupConstructors->isEnabled())
     ActivateThisDialog();
 }
 
 
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose  :
-//=================================================================================
-void GenerationGUI_PrismDlg::ActivateThisDialog()
-{
-  GEOMBase_Skeleton::ActivateThisDialog();
-  globalSelection( GEOM_ALLSHAPES );
-  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
-         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-  //GroupPoints->LineEdit1->setFocus();
-  //myEditCurrentArgument = GroupPoints->LineEdit1;
-  //displayPreview();
-  ConstructorsClicked( getConstructorId() );
-}
-
-
 //=================================================================================
 // function : ValueChangedInSpinBox()
 // purpose  :
@@ -453,7 +450,12 @@ GEOM::GEOM_IOperations_ptr GenerationGUI_PrismDlg::createOperation()
 //=================================================================================
 bool GenerationGUI_PrismDlg::isValid( QString& )
 {
-  return myOkBase && ( myOkVec || (myOkPnt1 && myOkPnt2) );
+  if (getConstructorId() == 0)
+    // by vector and height
+    return (myOkBase && myOkVec);
+
+  // by two points
+  return (myOkBase && myOkPnt1 && myOkPnt2);
 }
 
 //=================================================================================
@@ -464,15 +466,15 @@ bool GenerationGUI_PrismDlg::execute( ObjectList& objects )
 {
   GEOM::GEOM_Object_var anObj;
 
-  switch ( getConstructorId() ) 
+  switch ( getConstructorId() )
   {
-  case 0 :
-    { 
+  case 0:
+    {
       anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
         MakePrismVecH(myBase, myVec, getHeight());
       break;
     }
-  case 1 :
+  case 1:
     {
       anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
         MakePrismTwoPnt(myBase, myPoint1, myPoint2);
index 2c106080c9f8dec7692272c993931d3b5d7e5228..e9b265634dff5159708a4daac875b7e8d6616982 100644 (file)
@@ -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
 //
 //
 //
@@ -53,15 +53,15 @@ protected:
     virtual bool isValid( QString& msg );
     virtual bool execute( ObjectList& objects );    
 
-private :
+private:
     void Init();
     void enterEvent(QEvent* e);
     double getHeight() const;
-    
+
     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 */ 
+    GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points for extrusion */ 
+
     bool myOkBase;
     bool myOkVec;
     bool myOkPnt1;
@@ -73,11 +73,12 @@ private :
 private slots:
     void ClickOnOk();
     bool ClickOnApply();
+
     void ActivateThisDialog();
+    void ConstructorsClicked(int);
     void LineEditReturnPressed();
     void SelectionIntoArgument();
     void SetEditCurrentArgument();
-    void ConstructorsClicked(int);
     void ValueChangedInSpinBox();
     void onReverse();
 };
index e8a6608ad68efd99d95736a6ea6c4638cc72a357..1956395acefd6961061edd4a2bb873731ce1be66 100644 (file)
@@ -114,7 +114,7 @@ void GenerationGUI_RevolDlg::Init()
 
   double SpecificStep = 5;
   /* min, max, step and decimals for spin boxes & initial values */
-  GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3);
+  GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
   GroupPoints->SpinBox_DX->SetValue(45.0);
 
   /* signals and slots connections */
index a42fad91e6ec2aadc953f77ff7b60afce66de64f..3e9f34618b6766a1fb9b8341de9c8b2bc0b463c1 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <TopAbs_ShapeEnum.hxx>
 
+class QGroupBox;
 class QLineEdit;
 class QListBox;
 
@@ -89,6 +90,7 @@ private:
     GEOM::GEOM_Object_var myMainObj;
     GEOM::GEOM_Object_var myGroup;
 
+    QGroupBox*            GroupMedium;
     QPushButton*          mySelBtn;
     QLineEdit*            myMainName;
     QPushButton*          mySelSubBtn;
index 3a05c863fdfaa3dc4dcad118fd7c56103f2eaa06..5a9503b9453f98993e2727858404e0b779ec969e 100644 (file)
@@ -25,4 +25,8 @@
 #  Module : GEOM
 #  $Header$
 
-SUBDIRS = OBJECT ARCHIMEDE NMTDS NMTTools NMTAlgo GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport STLExport ShHealOper GEOMImpl GEOM_I GEOMClient DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_I_Superv GEOM_SWIG
+SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport STLExport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG
+
+if GEOM_ENABLE_GUI
+  SUBDIRS+= OBJECT DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_SWIG_WITHIHM
+endif
index ec3acf7833947e7e9fe6a111e4b8683178642de5..0105cf53a45d1916a3225392c1a6ed148dd8bf17 100644 (file)
@@ -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
 //
 //
 //
@@ -29,6 +29,8 @@
 #include "MeasureGUI_CenterMassDlg.h"
 #include "MeasureGUI_1Sel3LineEdit_QTD.h"
 
+#include "DlgRef_SpinBox.h"
+
 #include "utilities.h"
 #include "SUIT_Session.h"
 #include "SalomeApp_Application.h"
@@ -245,9 +247,9 @@ void MeasureGUI_CenterMassDlg::processObject()
     getParameters( x, y, z );
     
     myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) );
-    myGrp->LineEdit2->setText( QString( "%1" ).arg( x ) );
-    myGrp->LineEdit3->setText( QString( "%1" ).arg( y ) );
-    myGrp->LineEdit4->setText( QString( "%1" ).arg( z ) );
+    myGrp->LineEdit2->setText( DlgRef_SpinBox::PrintDoubleValue( x ) );
+    myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( y ) );
+    myGrp->LineEdit4->setText( DlgRef_SpinBox::PrintDoubleValue( z ) );
 
     displayPreview();
   }
index d7ac8ed90d721c34f060e04e6faad2ebebce3766..163b19653b0c00f783aa9561db2a6aa8ebc892dd 100644 (file)
@@ -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
 //
 //
 //
@@ -30,6 +30,7 @@
 #include "MeasureGUI_2Sel1LineEdit_QTD.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "DlgRef_SpinBox.h"
 
 #include "SUIT_Session.h"
 #include "SUIT_ViewWindow.h"
@@ -118,14 +119,13 @@ void MeasureGUI_DistanceDlg::Init()
   mySelEdit  = myGrp->LineEdit1;
   mySelBtn2  = myGrp->PushButton2;
   mySelEdit2 = myGrp->LineEdit2;
-  
+
   myEditCurrentArgument = mySelEdit;
 
   connect( mySelEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
   connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
 
   MeasureGUI_Skeleton::Init();
-
 }
 
 
@@ -163,7 +163,7 @@ void MeasureGUI_DistanceDlg::processObject()
   double aDist = 0.;
   if ( getParameters( aDist, aPnt1, aPnt2 ) )
   {
-    myGrp->LineEdit3->setText( QString( "%1" ).arg( aDist ) );
+    myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( aDist ) );
     redisplayPreview();
   }
   else
@@ -171,7 +171,6 @@ void MeasureGUI_DistanceDlg::processObject()
     myGrp->LineEdit3->setText( "" );
     erasePreview();
   }
-    
 }
 
 //=================================================================================
@@ -256,12 +255,14 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
 {
   double aDist = 0.;
   gp_Pnt aPnt1( 0, 0, 0 ), aPnt2( 0, 0, 0 );
-  
-  if ( myObj->_is_nil() || myObj2->_is_nil() || !getParameters( aDist, aPnt1, aPnt2 ) ||
-       SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() 
-       != OCCViewer_Viewer::Type() )
+
+  SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
+
+  if ( myObj->_is_nil() || myObj2->_is_nil() ||
+       !getParameters( aDist, aPnt1, aPnt2 ) ||
+       vw->getViewManager()->getType() != OCCViewer_Viewer::Type() )
     return 0;
-  
+
   try
   {
     if( aDist <= 1.e-9 )
@@ -282,7 +283,6 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
                     ( aPnt1.Y() + aPnt2.Y() ) / 2,
                     ( aPnt1.Z() + aPnt2.Z() ) / 2 + 100 );
 
-
       gp_Vec va( aPnt3, aPnt1 );
       gp_Vec vb( aPnt3, aPnt2 );
 
@@ -291,18 +291,15 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
         aPnt3.SetY( ( aPnt1.Y() + aPnt2.Y() ) / 2 + 100 );
         aPnt3.SetZ( ( aPnt1.Z() + aPnt2.Z() ) / 2 );
       }
-      
+
       gce_MakePln gce_MP( aPnt1, aPnt2, aPnt3 );
       Handle( Geom_Plane ) P = new Geom_Plane( gce_MP.Value() );
 
-      Handle( AIS_LengthDimension ) anIO = new AIS_LengthDimension(
-        aVert1, aVert2, P, aDist, TCollection_ExtendedString( (Standard_CString)aLabel.latin1() ) );
+      Handle( AIS_LengthDimension ) anIO = new AIS_LengthDimension
+        (aVert1, aVert2, P, aDist, TCollection_ExtendedString((Standard_CString)aLabel.latin1()));
 
-      SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
-      SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>( ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs( 0 ) );
-      
-      //QAD_ViewFrame* vf = GEOM_Displayer::GetActiveView();
-      //OCCViewer_Prs* aPrs = dynamic_cast<OCCViewer_Prs*>( vf->CreatePrs( 0 ) );
+      SOCC_Prs* aPrs =
+        dynamic_cast<SOCC_Prs*>( ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs( 0 ) );
 
       if ( aPrs )
         aPrs->AddObject( anIO );
@@ -324,17 +321,3 @@ bool MeasureGUI_DistanceDlg::isValid( QString& msg )
 {
   return MeasureGUI_Skeleton::isValid( msg ) && !myObj2->_is_nil();
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
index cd2a6743e6f095e4c2e79820be526dd5675689e9..516f9cd6cca64d94bc913c7c070baac8e1d4783f 100644 (file)
@@ -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
 //
 //
 //
@@ -203,4 +203,3 @@ bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I,
     return getOperation()->IsDone();
   }
 }
-
index ed42f21265069660191f81e75d99b4a9743c2d0a..a5b1bb77a3123076e039a7ddffd4aeb8706704d4 100644 (file)
@@ -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
 //
 //
 //
@@ -181,24 +181,3 @@ bool MeasureGUI_MaxToleranceDlg::getParameters( double& theMinFaceToler,
     return getOperation()->IsDone();
   }
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
index 1a14cc347908a97e93d75d04c9e6ef7798a3e343..ccd2a8f072ee9c511faf47d18b69a3bdb2cfefa7 100644 (file)
 #include "MeasureGUI_PointDlg.h"
 #include "GEOMBase.h"
 
+#include "DlgRef_SpinBox.h"
+
 #include "utilities.h"
+
 #include "SUIT_Session.h"
 #include "SalomeApp_Application.h"
 #include "LightApp_SelectionMgr.h"
 //=================================================================================
 // class    : MeasureGUI_PointDlg()
 // purpose  : Constructs a MeasureGUI_PointDlg which is a child of 'parent'
-//            
 //=================================================================================
 MeasureGUI_PointDlg::MeasureGUI_PointDlg( GeometryGUI* GUI, QWidget* parent )
 : MeasureGUI_Skeleton( GUI, parent, "MeasureGUI_PointDlg" )
 {
   QPixmap iconPnt( SUIT_Session::session()->resourceMgr()->loadPixmap(
     "GEOM",tr( "ICON_DLG_POINT" ) ) );
-  
+
   QPixmap iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap(
     "GEOM",tr( "ICON_SELECT" ) ) );
 
@@ -75,7 +77,7 @@ MeasureGUI_PointDlg::MeasureGUI_PointDlg( GeometryGUI* GUI, QWidget* parent )
   RadioButton1->setPixmap( iconPnt );
 
   QGroupBox* aGrp = new QGroupBox( 2, Qt::Horizontal, tr( "COORDINATES" ), this );
-  
+
   new QLabel( tr( "POINT" ), aGrp );
   QFrame* aFrame = new QFrame( aGrp );
   mySelBtn = new QPushButton( aFrame );
@@ -108,7 +110,7 @@ MeasureGUI_PointDlg::MeasureGUI_PointDlg( GeometryGUI* GUI, QWidget* parent )
 //=================================================================================
 // function : ~MeasureGUI_PointDlg()
 // purpose  : Destroys the object and frees any allocated resources
-//======================myX->setReadOnly( true );===========================================================
+//=================================================================================
 MeasureGUI_PointDlg::~MeasureGUI_PointDlg()
 {
 }
@@ -178,7 +180,7 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
 
       TopTools_IndexedMapOfShape aShapes;
       TopExp::MapShapes( aShape, aShapes );
-      
+
       if ( aShape != aShapes( i ) )
         aName += QString( ":%1" ).arg( i );
 
@@ -189,9 +191,9 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
     {
       gp_Pnt aPnt = BRep_Tool::Pnt( aPoint );
       mySelEdit->setText( aName );
-      myX->setText( QString( "%1" ).arg( aPnt.X() ) );
-      myY->setText( QString( "%1" ).arg( aPnt.Y() ) );
-      myZ->setText( QString( "%1" ).arg( aPnt.Z() ) );
+      myX->setText(DlgRef_SpinBox::PrintDoubleValue(aPnt.X()));
+      myY->setText(DlgRef_SpinBox::PrintDoubleValue(aPnt.Y()));
+      myZ->setText(DlgRef_SpinBox::PrintDoubleValue(aPnt.Z()));
     }
   }
   catch( ... )
@@ -203,23 +205,3 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
     myZ->setText( "" );
   }
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
index ea3bb594c07060a0ab3c2353414796b5803da129..71d3d69804d470c749f72d85bfe6b4fb965d528b 100644 (file)
@@ -31,6 +31,7 @@
 #include "GEOM_Displayer.h"
 #include "GEOMImpl_Types.hxx"
 #include "GEOMBase.h"
+#include "DlgRef_SpinBox.h"
 
 #include "SalomeApp_Tools.h"
 #include "utilities.h"
@@ -148,9 +149,9 @@ void MeasureGUI_PropertiesDlg::processObject()
   }
   else
   {
-    myGrp->LineEdit2->setText( QString( "%1" ).arg( aLength ) );
-    myGrp->LineEdit3->setText( QString( "%1" ).arg( anArea ) );
-    myGrp->LineEdit4->setText( QString( "%1" ).arg( aVolume ) );
+    myGrp->LineEdit2->setText( DlgRef_SpinBox::PrintDoubleValue( aLength ) );
+    myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( anArea ) );
+    myGrp->LineEdit4->setText( DlgRef_SpinBox::PrintDoubleValue( aVolume ) );
   }
 }
 
@@ -200,24 +201,3 @@ SALOME_Prs* MeasureGUI_PropertiesDlg::buildPrs()
   return getDisplayer()->BuildPrs( aResult );
   
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
index ef4d92e8b5c8594c60bc4f73f79386889f5b95f2..def236c386b04e011220b6e42934931fe55f4601 100644 (file)
@@ -61,12 +61,11 @@ MeasureGUI_Skeleton::MeasureGUI_Skeleton( GeometryGUI*      GUI,
   GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
   myGeomGUI( GUI )
 {
-
   mySelBtn = 0;
   mySelEdit = 0;
   myDisplayer = 0;
   myHelpFileName = "";
-  
+
   if ( !name )
     setName( "MeasureGUI_Skeleton" );
 
@@ -75,7 +74,6 @@ MeasureGUI_Skeleton::MeasureGUI_Skeleton( GeometryGUI*      GUI,
 
   buttonClose->setAutoDefault( false );
 
-  GroupMedium->close( TRUE );
   resize( 350, 0 );
 }
 
index cc518f461b6c78a6d1af10a84f3cbc994cfd7d1a..5a01f5818d4ac7dc6d0679a5f539dda56f37d1dc 100644 (file)
@@ -20,7 +20,7 @@
 /****************************************************************************
 ** Form implementation generated from reading ui file 'MeasureGUI_Skeleton_QTD.ui'
 **
-** Created: Tue Mar 21 10:10:08 2006
+** Created: Tue Mar 13 14:20:24 2007
 **      by: The User Interface Compiler ($Id$)
 **
 ** WARNING! All changes made in this file will be lost!
@@ -96,11 +96,6 @@ MeasureGUI_Skeleton_QTD::MeasureGUI_Skeleton_QTD( QWidget* parent, const char* n
 
     Layout1->addWidget( GroupConstructors, 0, 0 );
 
-    GroupMedium = new QGroupBox( this, "GroupMedium" );
-    GroupMedium->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupMedium->sizePolicy().hasHeightForWidth() ) );
-
-    Layout1->addWidget( GroupMedium, 1, 0 );
-
     MeasureGUI_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 );
     languageChange();
     resize( QSize(228, 266).expandedTo(minimumSizeHint()) );
@@ -121,12 +116,5 @@ MeasureGUI_Skeleton_QTD::~MeasureGUI_Skeleton_QTD()
  */
 void MeasureGUI_Skeleton_QTD::languageChange()
 {
-    setCaption( tr( "MeasureGUI_Skeleton_QTD" ) );
-    GroupButtons->setTitle( QString::null );
-    buttonClose->setText( tr( "&Close" ) );
-    buttonHelp->setText( tr( "&Help" ) );
-    GroupConstructors->setTitle( QString::null );
-    RadioButton1->setText( QString::null );
-    GroupMedium->setTitle( QString::null );
 }
 
index cdc2f7de4ab714aa44d1b1608ca4c266bb2daaaa..990f0a63ec942d6c9b561e7a8a083698910c1ae1 100644 (file)
@@ -20,7 +20,7 @@
 /****************************************************************************
 ** Form interface generated from reading ui file 'MeasureGUI_Skeleton_QTD.ui'
 **
-** Created: Tue Mar 21 10:10:08 2006
+** Created: Tue Mar 13 14:20:20 2007
 **      by: The User Interface Compiler ($Id$)
 **
 ** WARNING! All changes made in this file will be lost!
@@ -56,7 +56,6 @@ public:
     QPushButton* buttonHelp;
     QButtonGroup* GroupConstructors;
     QRadioButton* RadioButton1;
-    QGroupBox* GroupMedium;
 
 protected:
     QGridLayout* MeasureGUI_Skeleton_QTDLayout;
index 07f94c80d9a417af775c64aa8824d44b560da4e3..fa012c20391a681f54b5edb3f54608f743c70d8c 100644 (file)
@@ -20,9 +20,6 @@
             <verstretch>0</verstretch>
         </sizepolicy>
     </property>
-    <property name="caption">
-        <string>MeasureGUI_Skeleton_QTD</string>
-    </property>
     <property name="sizeGripEnabled">
         <bool>true</bool>
     </property>
@@ -62,9 +59,6 @@
                             <verstretch>0</verstretch>
                         </sizepolicy>
                     </property>
-                    <property name="title">
-                        <string></string>
-                    </property>
                     <grid>
                         <property name="name">
                             <cstring>unnamed</cstring>
                                     <property name="name">
                                         <cstring>buttonClose</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>&amp;Close</string>
-                                    </property>
                                 </widget>
                                <widget class="QPushButton" row="0" column="2">
                                     <property name="name">
                                         <cstring>buttonHelp</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string>&amp;Help</string>
-                                    </property>
                                 </widget>
                             </grid>
                         </widget>
                             <verstretch>0</verstretch>
                         </sizepolicy>
                     </property>
-                    <property name="title">
-                        <string></string>
-                    </property>
                     <grid>
                         <property name="name">
                             <cstring>unnamed</cstring>
                                     <property name="name">
                                         <cstring>RadioButton1</cstring>
                                     </property>
-                                    <property name="text">
-                                        <string></string>
-                                    </property>
                                 </widget>
                             </hbox>
                         </widget>
                     </grid>
                 </widget>
-                <widget class="QGroupBox" row="1" column="0">
-                    <property name="name">
-                        <cstring>GroupMedium</cstring>
-                    </property>
-                    <property name="sizePolicy">
-                        <sizepolicy>
-                            <hsizetype>7</hsizetype>
-                            <vsizetype>7</vsizetype>
-                            <horstretch>0</horstretch>
-                            <verstretch>0</verstretch>
-                        </sizepolicy>
-                    </property>
-                    <property name="title">
-                        <string></string>
-                    </property>
-                </widget>
             </grid>
         </widget>
     </grid>
diff --git a/src/NMTDS/Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx b/src/NMTDS/Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx
new file mode 100644 (file)
index 0000000..a48a632
--- /dev/null
@@ -0,0 +1,72 @@
+// 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
+
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#define _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_TCollection_MapNode_HeaderFile
+#include <Handle_TCollection_MapNode.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(TCollection_MapNode);
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger);
+
+class Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) : public Handle(TCollection_MapNode) {
+  public:
+    Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)():Handle(TCollection_MapNode)() {} 
+    Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)(const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& aHandle) : Handle(TCollection_MapNode)(aHandle) 
+     {
+     }
+
+    Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)(const NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) 
+     {
+     }
+
+    Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& operator=(const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& aHandle)
+     {
+      Assign(aHandle.Access());
+      return *this;
+     }
+
+    Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& operator=(const NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* anItem)
+     {
+      Assign((Standard_Transient *)anItem);
+      return *this;
+     }
+
+    NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* operator->() const
+     {
+      return (NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger *)ControlAccess();
+     }
+
+//   Standard_EXPORT ~Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)();
+   Standard_EXPORT static const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
index 7f5d642a938a91ca2e8351ee75a165df860f45a7..edc19fc6586c3d0b24158085928b75f50baaf781 100644 (file)
@@ -31,6 +31,7 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 # header files 
 salomeinclude_HEADERS = \
+       Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx \
        Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
        Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
        Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \
@@ -40,6 +41,9 @@ salomeinclude_HEADERS = \
        Handle_NMTDS_StdMapNodeOfMapOfPassKeyBoolean.hxx \
        Handle_NMTDS_StdMapNodeOfMapOfPassKey.hxx \
        NMTDS_CArray1OfIndexRange.hxx \
+       NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx \
+       NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx \
+       NMTDS_DataMapOfIntegerMapOfInteger.hxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \
@@ -47,7 +51,10 @@ salomeinclude_HEADERS = \
        NMTDS_IndexedDataMapOfIntegerShape.hxx \
        NMTDS_IndexedDataMapOfShapeBox.hxx \
        NMTDS_IndexRange.hxx \
+       NMTDS_InterfPool.hxx \
+       NMTDS_InterfType.hxx \
        NMTDS_Iterator.hxx \
+       NMTDS_IteratorCheckerSI.hxx \
        NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \
        NMTDS_ListIteratorOfListOfPassKeyBoolean.hxx \
        NMTDS_ListIteratorOfListOfPassKey.hxx \
@@ -62,12 +69,17 @@ salomeinclude_HEADERS = \
        NMTDS_MapOfPassKeyBoolean.hxx  \
        NMTDS_MapOfPassKey.hxx \
        NMTDS_PassKeyBoolean.hxx \
+       NMTDS_PInterfPool.hxx \
+       NMTDS_PIterator.hxx \
        NMTDS_PassKey.hxx \
        NMTDS_PassKeyMapHasher.hxx \
+       NMTDS_PassKeyShape.hxx \
+       NMTDS_PassKeyShapeMapHasher.hxx \
        NMTDS_PShapesDataStructure.hxx \
        NMTDS_ShapesDataStructure.hxx \
        NMTDS_StdMapNodeOfMapOfPassKeyBoolean.hxx \
        NMTDS_StdMapNodeOfMapOfPassKey.hxx \
+       NMTDS_Tools.hxx \
        NMTDS_BoxBndTree.hxx
 
 # Libraries targets
@@ -75,6 +87,9 @@ lib_LTLIBRARIES = libNMTDS.la
 
 dist_libNMTDS_la_SOURCES = \
        NMTDS_CArray1OfIndexRange_0.cxx \
+       NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_0.cxx \
+       NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_0.cxx \
+       NMTDS_DataMapOfIntegerMapOfInteger_0.cxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_0.cxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx \
@@ -82,7 +97,9 @@ dist_libNMTDS_la_SOURCES = \
        NMTDS_IndexedDataMapOfIntegerShape_0.cxx  \
        NMTDS_IndexedDataMapOfShapeBox_0.cxx \
        NMTDS_IndexRange.cxx \
+       NMTDS_InterfPool.cxx \
        NMTDS_Iterator.cxx \
+       NMTDS_IteratorCheckerSI.cxx \
        NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx  \
        NMTDS_ListIteratorOfListOfPassKey_0.cxx  \
        NMTDS_ListIteratorOfListOfPassKeyBoolean_0.cxx \
@@ -99,9 +116,12 @@ dist_libNMTDS_la_SOURCES = \
        NMTDS_PassKeyBoolean.cxx \
        NMTDS_PassKey.cxx \
        NMTDS_PassKeyMapHasher.cxx \
+       NMTDS_PassKeyShape.cxx \
+       NMTDS_PassKeyShapeMapHasher.cxx \
        NMTDS_ShapesDataStructure.cxx \
        NMTDS_StdMapNodeOfMapOfPassKey_0.cxx \
        NMTDS_StdMapNodeOfMapOfPassKeyBoolean_0.cxx \
+       NMTDS_Tools.cxx \
        NMTDS_BoxBndTree.cxx
 
 # additionnal information to compil and link file
index c023fff9e295daf945bc788e22dda679da4a421f..cabb10f4bf016cf7f4af84cc49693984ef297602 100644 (file)
@@ -28,29 +28,49 @@ package NMTDS
        ---Purpose: 
 
 uses   
-    
     TCollection, 
     TColStd,
     Bnd,
     TopoDS, 
     TopAbs, 
     TopTools, 
-    BooleanOperations,
-    BOPTColStd
+    BooleanOperations, 
+    BOPTools,
+    BOPTColStd 
+    
 is  
+    enumeration InterfType is
+       TI_VV,
+       TI_VE,
+       TI_VF,
+       TI_EE,
+       TI_EF,
+       TI_FF,
+       TI_UNKNOWN
+    end InterfType;      
+    --
     class ShapesDataStructure;
     class IndexRange;   
     
     -- Modified to Add new classes Thu Sep 14 14:35:18 2006 
     -- Contribution of Samtech www.samcef.com BEGIN 
     class Iterator; 
+    
     class PassKey; 
     class PassKeyBoolean; 
     class PassKeyMapHasher; 
     -- Contribution of Samtech www.samcef.com END  
-    
+    class PassKeyShape; 
+    class PassKeyShapeMapHasher; 
+    --modified by NIZNHY-PKV Tue Feb  6 10:40:02 2007f 
+    class IteratorCheckerSI; 
+    class Tools; 
+    class InterfPool; 
+    --modified by NIZNHY-PKV Tue Feb  6 10:40:04 2007t 
     pointer PShapesDataStructure to ShapesDataStructure from NMTDS;
-
+    pointer PIterator to Iterator from NMTDS;
+    pointer PInterfPool to InterfPool from NMTDS;
+     
     class CArray1OfIndexRange instantiates 
        CArray1 from BOPTColStd(IndexRange from NMTDS); 
      
@@ -79,7 +99,7 @@ is
                             PassKeyMapHasher from NMTDS);   
     -- Contribution of Samtech www.samcef.com END
 
-
+--modified by NIZNHY-PKV Tue Oct 10 11:19:06 2006f 
     class IndexedDataMapOfShapeBox  
        instantiates IndexedDataMap from TCollection    (Shape from TopoDS,
                                                         Box from Bnd,
@@ -88,6 +108,12 @@ is
        instantiates IndexedDataMap from TCollection    (Integer from Standard,
                                                         Shape from TopoDS,
                                                         MapIntegerHasher from TColStd); 
+                                                         
+    class DataMapOfIntegerMapOfInteger  
+       instantiates DataMap from TCollection           (Integer from Standard, 
+                                                        MapOfInteger from TColStd, 
+                                                        MapIntegerHasher from TColStd); 
 
+--modified by NIZNHY-PKV Tue Oct 10 11:19:08 2006t
  
 end NMTDS;
diff --git a/src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx b/src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx
new file mode 100644 (file)
index 0000000..5c782f2
--- /dev/null
@@ -0,0 +1,115 @@
+// 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
+
+#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+#define _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _TCollection_BasicMapIterator_HeaderFile
+#include <TCollection_BasicMapIterator.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+class Standard_NoSuchObject;
+class TColStd_MapOfInteger;
+class TColStd_MapIntegerHasher;
+class NMTDS_DataMapOfIntegerMapOfInteger;
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger  : public TCollection_BasicMapIterator {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger();
+
+
+Standard_EXPORT NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger(const NMTDS_DataMapOfIntegerMapOfInteger& aMap);
+
+
+Standard_EXPORT   void Initialize(const NMTDS_DataMapOfIntegerMapOfInteger& aMap) ;
+
+
+Standard_EXPORT  const Standard_Integer& Key() const;
+
+
+Standard_EXPORT  const TColStd_MapOfInteger& Value() const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_0.cxx b/src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_0.cxx
new file mode 100644 (file)
index 0000000..52c8d53
--- /dev/null
@@ -0,0 +1,54 @@
+// 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
+
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+
+#ifndef _Standard_NoSuchObject_HeaderFile
+#include <Standard_NoSuchObject.hxx>
+#endif
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TColStd_MapIntegerHasher_HeaderFile
+#include <TColStd_MapIntegerHasher.hxx>
+#endif
+#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <TCollection_DataMapIterator.gxx>
+
diff --git a/src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx b/src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx
new file mode 100644 (file)
index 0000000..89989c7
--- /dev/null
@@ -0,0 +1,131 @@
+// 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
+
+#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#define _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TCollection_MapNode_HeaderFile
+#include <TCollection_MapNode.hxx>
+#endif
+#ifndef _TCollection_MapNodePtr_HeaderFile
+#include <TCollection_MapNodePtr.hxx>
+#endif
+class TColStd_MapOfInteger;
+class TColStd_MapIntegerHasher;
+class NMTDS_DataMapOfIntegerMapOfInteger;
+class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger;
+
+
+
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger : public TCollection_MapNode {
+
+public:
+ // Methods PUBLIC
+ // 
+
+NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger(const Standard_Integer& K,const TColStd_MapOfInteger& I,const TCollection_MapNodePtr& n);
+
+  Standard_Integer& Key() const;
+
+  TColStd_MapOfInteger& Value() const;
+//Standard_EXPORT ~NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ //Standard_EXPORT Standard_Boolean           IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+Standard_Integer myKey;
+TColStd_MapOfInteger myValue;
+
+
+};
+
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+
+#include <TCollection_DataMapNode.lxx>
+
+#undef TheKey
+#undef TheKey_hxx
+#undef TheItem
+#undef TheItem_hxx
+#undef Hasher
+#undef Hasher_hxx
+#undef TCollection_DataMapNode
+#undef TCollection_DataMapNode_hxx
+#undef TCollection_DataMapIterator
+#undef TCollection_DataMapIterator_hxx
+#undef Handle_TCollection_DataMapNode
+#undef TCollection_DataMapNode_Type_
+#undef TCollection_DataMap
+#undef TCollection_DataMap_hxx
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_0.cxx b/src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_0.cxx
new file mode 100644 (file)
index 0000000..81d4ca5
--- /dev/null
@@ -0,0 +1,100 @@
+// 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
+
+#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TColStd_MapIntegerHasher_HeaderFile
+#include <TColStd_MapIntegerHasher.hxx>
+#endif
+#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+//NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::~NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger() {}
+
+
+Standard_EXPORT Handle_Standard_Type& NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+{
+
+    static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
+  static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
+  static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
+
+  static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
+  static Handle_Standard_Type _aType = new Standard_Type("NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger",
+                                                        sizeof(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger),
+                                                        1,
+                                                        (Standard_Address)_Ancestors,
+                                                        (Standard_Address)NULL);
+
+  return _aType;
+}
+
+
+// DownCast method
+//   allow safe downcasting
+//
+const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)::DownCast(const Handle(Standard_Transient)& AnObject) 
+{
+  Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) _anOtherObject;
+
+  if (!AnObject.IsNull()) {
+     if (AnObject->IsKind(STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger))) {
+       _anOtherObject = Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)((Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)&)AnObject);
+     }
+  }
+
+  return _anOtherObject ;
+}
+const Handle(Standard_Type)& NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::DynamicType() const 
+{ 
+  return STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) ; 
+}
+//Standard_Boolean NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::IsKind(const Handle(Standard_Type)& AType) const 
+//{ 
+//  return (STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) == AType || TCollection_MapNode::IsKind(AType)); 
+//}
+//Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::~Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger() {}
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <TCollection_DataMapNode.gxx>
+
diff --git a/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger.hxx b/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger.hxx
new file mode 100644 (file)
index 0000000..2e7c5b4
--- /dev/null
@@ -0,0 +1,154 @@
+// 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
+
+#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+#define _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _TCollection_BasicMap_HeaderFile
+#include <TCollection_BasicMap.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class Standard_DomainError;
+class Standard_NoSuchObject;
+class TColStd_MapOfInteger;
+class TColStd_MapIntegerHasher;
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
+class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_DataMapOfIntegerMapOfInteger  : public TCollection_BasicMap {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger(const Standard_Integer NbBuckets = 1);
+
+
+Standard_EXPORT   NMTDS_DataMapOfIntegerMapOfInteger& Assign(const NMTDS_DataMapOfIntegerMapOfInteger& Other) ;
+  NMTDS_DataMapOfIntegerMapOfInteger& operator =(const NMTDS_DataMapOfIntegerMapOfInteger& Other) 
+{
+  return Assign(Other);
+}
+
+
+
+Standard_EXPORT   void ReSize(const Standard_Integer NbBuckets) ;
+
+
+Standard_EXPORT   void Clear() ;
+~NMTDS_DataMapOfIntegerMapOfInteger()
+{
+  Clear();
+}
+
+
+
+Standard_EXPORT   Standard_Boolean Bind(const Standard_Integer& K,const TColStd_MapOfInteger& I) ;
+
+
+Standard_EXPORT   Standard_Boolean IsBound(const Standard_Integer& K) const;
+
+
+Standard_EXPORT   Standard_Boolean UnBind(const Standard_Integer& K) ;
+
+
+Standard_EXPORT  const TColStd_MapOfInteger& Find(const Standard_Integer& K) const;
+ const TColStd_MapOfInteger& operator()(const Standard_Integer& K) const
+{
+  return Find(K);
+}
+
+
+
+Standard_EXPORT   TColStd_MapOfInteger& ChangeFind(const Standard_Integer& K) ;
+  TColStd_MapOfInteger& operator()(const Standard_Integer& K) 
+{
+  return ChangeFind(K);
+}
+
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger(const NMTDS_DataMapOfIntegerMapOfInteger& Other);
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger_0.cxx b/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger_0.cxx
new file mode 100644 (file)
index 0000000..ca6e0ff
--- /dev/null
@@ -0,0 +1,57 @@
+// 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
+
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+
+#ifndef _Standard_DomainError_HeaderFile
+#include <Standard_DomainError.hxx>
+#endif
+#ifndef _Standard_NoSuchObject_HeaderFile
+#include <Standard_NoSuchObject.hxx>
+#endif
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TColStd_MapIntegerHasher_HeaderFile
+#include <TColStd_MapIntegerHasher.hxx>
+#endif
+#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <TCollection_DataMap.gxx>
+
diff --git a/src/NMTDS/NMTDS_InterfPool.cdl b/src/NMTDS/NMTDS_InterfPool.cdl
new file mode 100644 (file)
index 0000000..8b74d08
--- /dev/null
@@ -0,0 +1,151 @@
+-- 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:       NMTDS_InterfPool.cdl
+-- Created:    Wed Feb 21 10:10:58 2007
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+---Copyright:   Matra Datavision 2007
+
+
+class InterfPool from NMTDS 
+
+       ---Purpose: 
+
+uses
+    MapOfPassKeyBoolean  from NMTDS, 
+    ListOfPassKeyBoolean from NMTDS, 
+    PassKeyBoolean       from NMTDS,
+    InterfType           from NMTDS, 
+    --     
+    CArray1OfSSInterference from BOPTools,
+    CArray1OfESInterference from BOPTools,
+    CArray1OfVSInterference from BOPTools, 
+    CArray1OfEEInterference from BOPTools, 
+    CArray1OfVEInterference from BOPTools, 
+    CArray1OfVVInterference from BOPTools
+
+--raises
+
+is 
+    Create 
+       returns InterfPool from NMTDS; 
+    ---C++: alias "Standard_EXPORT virtual ~NMTDS_InterfPool();"  
+
+    Add (me:out;   
+           aPKB : PassKeyBoolean from NMTDS;
+            aType: InterfType from NMTDS) 
+       returns Boolean from Standard; 
+       
+    Add (me:out;   
+           aInd1 : Integer from Standard;
+           aInd2 : Integer from Standard; 
+            aType : InterfType from NMTDS) 
+       returns Boolean from Standard;
+      
+    Add (me:out;   
+           aInd1 : Integer from Standard;
+           aInd2 : Integer from Standard; 
+           bFlag : Boolean from Standard;                   
+            aType : InterfType from NMTDS) 
+       returns Boolean from Standard;
+
+    Contains(me; 
+           aPKB : PassKeyBoolean from NMTDS)
+       returns Boolean from Standard; 
+     
+    Contains(me; 
+           aInd1 : Integer from Standard;
+           aInd2 : Integer from Standard) 
+       returns Boolean from Standard; 
+     
+    Get(me) 
+       returns ListOfPassKeyBoolean from NMTDS; 
+    ---C++: return const &       
+
+    Get(me; 
+           aType : InterfType from NMTDS) 
+       returns ListOfPassKeyBoolean from NMTDS; 
+    ---C++: return const &      
+
+    Get(me; 
+           aInd : Integer from Standard) 
+       returns ListOfPassKeyBoolean from NMTDS; 
+    ---C++: return const & 
+      
+    Get(me; 
+           aInd : Integer from Standard; 
+           aType: InterfType from NMTDS) 
+       returns ListOfPassKeyBoolean from NMTDS; 
+    ---C++: return const &  
+    
+    -- 
+    -- Interferences 
+    -- 
+    SSInterferences (me:out)  
+       returns CArray1OfSSInterference from BOPTools; 
+       ---C++:  return  & 
+       ---Purpose: 
+       --- Returns the reference to array Of F/F interferences 
+       ---
+    ESInterferences (me:out)  
+       returns CArray1OfESInterference from BOPTools; 
+       ---C++:  return  & 
+       ---Purpose: 
+       --- Returns the reference to array Of E/F interferences 
+       ---
+    VSInterferences (me:out)  
+       returns CArray1OfVSInterference from BOPTools; 
+       ---C++:  return  &
+       ---Purpose: 
+       --- Returns the reference to array Of V/F interferences 
+       ---
+    EEInterferences (me:out)  
+       returns CArray1OfEEInterference from BOPTools; 
+       ---C++:  return  &  
+       ---Purpose: 
+       --- Returns the reference to arrray Of E/E interferences 
+       ---
+    VEInterferences (me:out)  
+       returns CArray1OfVEInterference from BOPTools; 
+       ---C++:  return  &              
+       ---Purpose: 
+       --- Returns the reference to arrray Of  V/E interferences 
+       ---
+    VVInterferences (me:out)  
+       returns CArray1OfVVInterference from BOPTools; 
+       ---C++:  return  &              
+       ---Purpose: 
+       --- Returns the reference to arrray Of  V/V interferences 
+       ---
+
+fields 
+    myTable : MapOfPassKeyBoolean from NMTDS [6] is protected; 
+    myList  : ListOfPassKeyBoolean from NMTDS is protected;
+    myMaxInd: Integer from Standard is protected; 
+    -- 
+    mySSInterferences  :  CArray1OfSSInterference from BOPTools is protected;
+    myESInterferences  :  CArray1OfESInterference from BOPTools is protected;
+    myVSInterferences  :  CArray1OfVSInterference from BOPTools is protected;
+    myEEInterferences  :  CArray1OfEEInterference from BOPTools is protected;
+    myVEInterferences  :  CArray1OfVEInterference from BOPTools is protected;
+    myVVInterferences  :  CArray1OfVVInterference from BOPTools is protected;   
+
+end InterfPool;
diff --git a/src/NMTDS/NMTDS_InterfPool.cxx b/src/NMTDS/NMTDS_InterfPool.cxx
new file mode 100644 (file)
index 0000000..95774e9
--- /dev/null
@@ -0,0 +1,281 @@
+// 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:       NMTDS_.InterfPoolcxx
+// Created:    Wed Feb 21 10:35:35 2007
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTDS_InterfPool.ixx>
+#include <NMTDS_PassKeyBoolean.hxx>
+#include <NMTDS_ListOfPassKeyBoolean.hxx>
+#include <NMTDS_MapIteratorOfMapOfPassKeyBoolean.hxx>
+#include <NMTDS_ListIteratorOfListOfPassKeyBoolean.hxx>
+
+static
+  Standard_Integer TypeToInteger(const NMTDS_InterfType aType);
+
+//=======================================================================
+//function : 
+//purpose  : 
+//=======================================================================
+  NMTDS_InterfPool::NMTDS_InterfPool()
+{
+  myMaxInd=6;
+}
+//=======================================================================
+//function : ~
+//purpose  : 
+//=======================================================================
+  NMTDS_InterfPool::~NMTDS_InterfPool()
+{
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_InterfPool::Add (const NMTDS_PassKeyBoolean& aPKB,
+                                         const NMTDS_InterfType aType)
+{
+  Standard_Boolean bRet;
+  Standard_Integer iType;
+  //
+  bRet=Standard_False;
+  //
+  iType=TypeToInteger(aType);
+  if (iType>-1 && iType<myMaxInd) {
+    bRet=myTable[iType].Add(aPKB);
+  }
+  return bRet;
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
+                                         const Standard_Integer aInd2,
+                                         const NMTDS_InterfType aType)
+{
+  NMTDS_PassKeyBoolean aPKB;
+  //
+  aPKB.SetIds(aInd1, aInd2);
+  return Add(aPKB, aType);
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
+                                         const Standard_Integer aInd2,
+                                         const Standard_Boolean bFlag,
+                                         const NMTDS_InterfType aType)
+{
+  NMTDS_PassKeyBoolean aPKB;
+  //
+  aPKB.SetIds(aInd1, aInd2);
+  aPKB.SetFlag(bFlag);
+  return Add(aPKB, aType);
+}
+//=======================================================================
+//function : Contains 
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_InterfPool::Contains(const NMTDS_PassKeyBoolean& aPKB)const
+{
+  Standard_Boolean bRet;
+  Standard_Integer i;
+  //
+  for (i=0; i<myMaxInd; ++i) {
+    bRet=myTable[i].Contains(aPKB);
+    if (bRet) {
+      break;
+    }
+  }
+  return bRet;
+}
+//=======================================================================
+//function : Contains 
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_InterfPool::Contains(const Standard_Integer aInd1,
+                                             const Standard_Integer aInd2)const
+{
+  NMTDS_PassKeyBoolean aPKB;
+  //
+  aPKB.SetIds(aInd1, aInd2);
+  return Contains(aPKB);
+}
+//=======================================================================
+//function :  Get
+//purpose  : 
+//=======================================================================
+  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get()const
+{
+  Standard_Integer i;
+  NMTDS_ListOfPassKeyBoolean* pL;
+  //
+  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL->Clear();
+  //
+  for (i=0; i<myMaxInd; ++i) {
+    NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+    //
+    aIt.Initialize(myTable[i]);
+    for(; aIt.More(); aIt.Next()) {
+      const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+      pL->Append(aPKB);
+    }
+  }
+  return myList;
+}
+//=======================================================================
+//function :  Get
+//purpose  : 
+//=======================================================================
+  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd)const
+{
+  Standard_Integer i, n1, n2;
+  NMTDS_ListOfPassKeyBoolean* pL;
+  //
+  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL->Clear();
+  //
+  for (i=0; i<myMaxInd; ++i) {
+    NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+    //
+    aIt.Initialize(myTable[i]);
+    for(; aIt.More(); aIt.Next()) {
+      const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+      aPKB.Ids(n1, n2);
+      if(n1==aInd || n2==aInd) {
+       pL->Append(aPKB);
+      }
+    }
+  }
+  return myList;
+}
+//=======================================================================
+//function :  Get
+//purpose  : 
+//=======================================================================
+  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const NMTDS_InterfType aType)const
+{
+  Standard_Integer iType;
+  NMTDS_ListOfPassKeyBoolean* pL;
+  //
+  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL->Clear();
+  //
+  iType=TypeToInteger(aType);
+  if (iType>-1 && iType<myMaxInd) {
+    NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+    //
+    aIt.Initialize(myTable[iType]);
+    for(; aIt.More(); aIt.Next()) {
+      const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+      pL->Append(aPKB);
+    }
+  }
+  return myList;
+}
+//=======================================================================
+//function :  Get
+//purpose  : 
+//=======================================================================
+  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd,
+                                                         const NMTDS_InterfType aType)const
+{
+  Standard_Integer n1, n2;
+  NMTDS_ListOfPassKeyBoolean *pL, aLPKB;
+  NMTDS_ListIteratorOfListOfPassKeyBoolean aIt;
+  //
+  aLPKB=Get(aType);
+  //
+  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL->Clear();
+  //
+  aIt.Initialize (aLPKB);
+  for (; aIt.More(); aIt.Next()) {
+    const NMTDS_PassKeyBoolean& aPKB=aIt.Value();
+    aPKB.Ids(n1, n2);
+    if(n1==aInd || n2==aInd) {
+      pL->Append(aPKB);
+    }
+  }
+  return myList;
+}
+////////////////////
+//===========================================================================
+//function : SSInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfSSInterference&  NMTDS_InterfPool::SSInterferences()
+{
+  return mySSInterferences;
+}
+//===========================================================================
+//function : ESInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfESInterference&  NMTDS_InterfPool::ESInterferences()
+{
+  return myESInterferences;
+}
+//===========================================================================
+//function : VSInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfVSInterference&  NMTDS_InterfPool::VSInterferences()
+{
+  return myVSInterferences;
+}
+//===========================================================================
+//function : EEInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfEEInterference&  NMTDS_InterfPool::EEInterferences()
+{
+  return myEEInterferences;
+}
+//===========================================================================
+//function : VEInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfVEInterference&  NMTDS_InterfPool::VEInterferences()
+{
+  return myVEInterferences;
+}
+//===========================================================================
+//function : VVInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfVVInterference&  NMTDS_InterfPool::VVInterferences()
+{
+  return myVVInterferences;
+}
+////////////////////
+//=======================================================================
+//function : TypeToInteger
+//purpose  : 
+//=======================================================================
+Standard_Integer TypeToInteger(const NMTDS_InterfType aType)
+{
+  return (Standard_Integer)aType;
+}
diff --git a/src/NMTDS/NMTDS_InterfPool.hxx b/src/NMTDS/NMTDS_InterfPool.hxx
new file mode 100644 (file)
index 0000000..f0bfd21
--- /dev/null
@@ -0,0 +1,191 @@
+// 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
+
+#ifndef _NMTDS_InterfPool_HeaderFile
+#define _NMTDS_InterfPool_HeaderFile
+
+#ifndef _NMTDS_MapOfPassKeyBoolean_HeaderFile
+#include <NMTDS_MapOfPassKeyBoolean.hxx>
+#endif
+#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile
+#include <NMTDS_ListOfPassKeyBoolean.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile
+#include <BOPTools_CArray1OfSSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfESInterference_HeaderFile
+#include <BOPTools_CArray1OfESInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile
+#include <BOPTools_CArray1OfVSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile
+#include <BOPTools_CArray1OfEEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile
+#include <BOPTools_CArray1OfVEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile
+#include <BOPTools_CArray1OfVVInterference.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+#ifndef _NMTDS_InterfType_HeaderFile
+#include <NMTDS_InterfType.hxx>
+#endif
+class NMTDS_PassKeyBoolean;
+class NMTDS_ListOfPassKeyBoolean;
+class BOPTools_CArray1OfSSInterference;
+class BOPTools_CArray1OfESInterference;
+class BOPTools_CArray1OfVSInterference;
+class BOPTools_CArray1OfEEInterference;
+class BOPTools_CArray1OfVEInterference;
+class BOPTools_CArray1OfVVInterference;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_InterfPool  {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT NMTDS_InterfPool();
+Standard_EXPORT virtual ~NMTDS_InterfPool();
+
+
+Standard_EXPORT   Standard_Boolean Add(const NMTDS_PassKeyBoolean& aPKB,const NMTDS_InterfType aType) ;
+
+
+Standard_EXPORT   Standard_Boolean Add(const Standard_Integer aInd1,const Standard_Integer aInd2,const NMTDS_InterfType aType) ;
+
+
+Standard_EXPORT   Standard_Boolean Add(const Standard_Integer aInd1,const Standard_Integer aInd2,const Standard_Boolean bFlag,const NMTDS_InterfType aType) ;
+
+
+Standard_EXPORT   Standard_Boolean Contains(const NMTDS_PassKeyBoolean& aPKB) const;
+
+
+Standard_EXPORT   Standard_Boolean Contains(const Standard_Integer aInd1,const Standard_Integer aInd2) const;
+
+
+Standard_EXPORT  const NMTDS_ListOfPassKeyBoolean& Get() const;
+
+
+Standard_EXPORT  const NMTDS_ListOfPassKeyBoolean& Get(const NMTDS_InterfType aType) const;
+
+
+Standard_EXPORT  const NMTDS_ListOfPassKeyBoolean& Get(const Standard_Integer aInd) const;
+
+
+Standard_EXPORT  const NMTDS_ListOfPassKeyBoolean& Get(const Standard_Integer aInd,const NMTDS_InterfType aType) const;
+
+
+//! Returns the reference to array Of F/F interferences <br>
+Standard_EXPORT   BOPTools_CArray1OfSSInterference& SSInterferences() ;
+
+
+//! Returns the reference to array Of E/F interferences <br>
+Standard_EXPORT   BOPTools_CArray1OfESInterference& ESInterferences() ;
+
+
+//! Returns the reference to array Of V/F interferences <br>
+Standard_EXPORT   BOPTools_CArray1OfVSInterference& VSInterferences() ;
+
+
+//! Returns the reference to arrray Of E/E interferences <br>
+Standard_EXPORT   BOPTools_CArray1OfEEInterference& EEInterferences() ;
+
+
+//! Returns the reference to arrray Of  V/E interferences <br>
+Standard_EXPORT   BOPTools_CArray1OfVEInterference& VEInterferences() ;
+
+
+//! Returns the reference to arrray Of  V/V interferences <br>
+Standard_EXPORT   BOPTools_CArray1OfVVInterference& VVInterferences() ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+NMTDS_MapOfPassKeyBoolean myTable[6];
+NMTDS_ListOfPassKeyBoolean myList;
+Standard_Integer myMaxInd;
+BOPTools_CArray1OfSSInterference mySSInterferences;
+BOPTools_CArray1OfESInterference myESInterferences;
+BOPTools_CArray1OfVSInterference myVSInterferences;
+BOPTools_CArray1OfEEInterference myEEInterferences;
+BOPTools_CArray1OfVEInterference myVEInterferences;
+BOPTools_CArray1OfVVInterference myVVInterferences;
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_InterfPool.ixx b/src/NMTDS/NMTDS_InterfPool.ixx
new file mode 100644 (file)
index 0000000..c608b68
--- /dev/null
@@ -0,0 +1,24 @@
+// 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
+
+#include <NMTDS_InterfPool.jxx>
+
+
+
diff --git a/src/NMTDS/NMTDS_InterfPool.jxx b/src/NMTDS/NMTDS_InterfPool.jxx
new file mode 100644 (file)
index 0000000..f12d529
--- /dev/null
@@ -0,0 +1,46 @@
+// 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
+
+#ifndef _NMTDS_PassKeyBoolean_HeaderFile
+#include <NMTDS_PassKeyBoolean.hxx>
+#endif
+#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile
+#include <NMTDS_ListOfPassKeyBoolean.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile
+#include <BOPTools_CArray1OfSSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfESInterference_HeaderFile
+#include <BOPTools_CArray1OfESInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile
+#include <BOPTools_CArray1OfVSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile
+#include <BOPTools_CArray1OfEEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile
+#include <BOPTools_CArray1OfVEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile
+#include <BOPTools_CArray1OfVVInterference.hxx>
+#endif
+#ifndef _NMTDS_InterfPool_HeaderFile
+#include <NMTDS_InterfPool.hxx>
+#endif
diff --git a/src/NMTDS/NMTDS_InterfType.hxx b/src/NMTDS/NMTDS_InterfType.hxx
new file mode 100644 (file)
index 0000000..d32f983
--- /dev/null
@@ -0,0 +1,39 @@
+// 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
+
+#ifndef _NMTDS_InterfType_HeaderFile
+#define _NMTDS_InterfType_HeaderFile
+
+
+enum NMTDS_InterfType { 
+ NMTDS_TI_VV,
+NMTDS_TI_VE,
+NMTDS_TI_VF,
+NMTDS_TI_EE,
+NMTDS_TI_EF,
+NMTDS_TI_FF,
+NMTDS_TI_UNKNOWN
+};
+
+
+#ifndef _Standard_PrimitiveTypes_HeaderFile
+#include <Standard_PrimitiveTypes.hxx>
+#endif
+
+#endif
index 05a026a73deee24dd884419b8af042855a47452f..d73a1d5d31a581f20e8e2e01b75355812ebd85e6 100755 (executable)
@@ -24,7 +24,7 @@
 
 
 class Iterator from NMTDS 
-
+     
        ---Purpose: 
 
 uses  
@@ -33,7 +33,9 @@ uses
     ShapesDataStructure  from NMTDS,
     PShapesDataStructure from NMTDS,
     ListOfPassKeyBoolean from NMTDS,
-    ListIteratorOfListOfPassKeyBoolean from NMTDS
+    ListIteratorOfListOfPassKeyBoolean from NMTDS,
+    PassKeyBoolean from NMTDS 
+    
 --raises
 
 is 
@@ -61,18 +63,28 @@ is
                aIndex2:out Integer from Standard;
                aWithSubShape: out Boolean from Standard); 
        
-    Prepare(me:out); 
-     
+    Prepare(me:out) 
+       is virtual; 
+      
+    Intersect(me:out) 
+       is virtual protected; 
+       
     ExpectedLength(me) 
        returns Integer from Standard;  
         
+    BlockLength(me) 
+       returns Integer from Standard;  
+     
     SDVertices(me) 
        returns DataMapOfIntegerListOfInteger from TColStd; 
-    ---C++:return const & 
-
+    ---C++:return const &  
+     
+    FillMVSD(myclass; 
+       aMVSD1:DataMapOfIntegerListOfInteger from TColStd; 
+       aMVSD2:out DataMapOfIntegerListOfInteger from TColStd); 
  
 fields
-    myPDS      :PShapesDataStructure from NMTDS     is protected; 
+    myDS       :PShapesDataStructure from NMTDS     is protected; 
     myLists    :ListOfPassKeyBoolean from NMTDS [6] is protected;  
     myIterator :ListIteratorOfListOfPassKeyBoolean from NMTDS is protected; 
     myEmptyList:ListOfPassKeyBoolean from NMTDS is protected; 
index d186736c06789c715c33fc4c1bad3a310a2daca2..8e894d6d4121542f1381c4d3e8f183d03f624b3f 100755 (executable)
@@ -1,18 +1,17 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2006 SAMTECH
+// 
 // 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 <NMTDS_Iterator.ixx>
-#include <NMTDS_CArray1OfIndexRange.hxx>
-#include <NMTDS_IndexRange.hxx>
+//
 #include <Bnd_Box.hxx>
-#include <TopoDS_Shape.hxx>
+//
 #include <TColStd_ListOfInteger.hxx>
-#include <TColStd_Array1OfListOfInteger.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <NMTDS_PassKeyBoolean.hxx>
-#include <NMTDS_MapOfPassKeyBoolean.hxx>
-#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
-#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
-#include <Bnd_HArray1OfBox.hxx>
-#include <Bnd_BoundSortBox.hxx>
-#include <TColStd_ListOfInteger.hxx>
 #include <TColStd_DataMapOfIntegerInteger.hxx>
-#include <TopTools_DataMapOfShapeInteger.hxx>
 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
-#include <TColStd_DataMapIteratorOfDataMapOfIntegerInteger.hxx>
 #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
-
+//
+#include <TopoDS.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Shape.hxx>
+//
+#include <TopTools_DataMapOfShapeInteger.hxx>
+//
 #include <NMTDS_BoxBndTree.hxx>
 #include <NCollection_UBTreeFiller.hxx>
-
-static 
-  void ComputeBoxEx(const Standard_Integer aIx,
-                   NMTDS_ShapesDataStructure* pDS,
-                   Bnd_Box& aBoxEx);
-
-static inline
-  Standard_Boolean IsValidType(const TopAbs_ShapeEnum aT);
-
-static
-  Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
-                                const TopAbs_ShapeEnum aType2);
-
+#include <NMTDS_CArray1OfIndexRange.hxx>
+#include <NMTDS_IndexRange.hxx>
+#include <NMTDS_PassKeyBoolean.hxx>
+#include <NMTDS_MapOfPassKeyBoolean.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
+#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
+#include <NMTDS_Tools.hxx>
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
 
 //=======================================================================
 //function : NMTDS_Iterator
@@ -69,7 +59,7 @@ static
 //=======================================================================
   NMTDS_Iterator::NMTDS_Iterator()
 {
-  myPDS=NULL; 
+  myDS=NULL; 
   myLength=0;
 }
 //=======================================================================
@@ -85,7 +75,7 @@ static
 //=======================================================================
   void NMTDS_Iterator::SetDS(const NMTDS_PShapesDataStructure& aDS)
 {
-  myPDS=aDS;
+  myDS=aDS;
 }
 //=======================================================================
 // function: DS
@@ -93,7 +83,7 @@ static
 //=======================================================================
   const NMTDS_ShapesDataStructure&  NMTDS_Iterator::DS()const
 {
-  return *myPDS;
+  return *myDS;
 }
 //=======================================================================
 // function: ExpectedLength
@@ -104,6 +94,24 @@ static
   return myLength;
 }
 //=======================================================================
+// function: BlockLength
+// purpose: 
+//=======================================================================
+  Standard_Integer NMTDS_Iterator::BlockLength() const
+{
+  Standard_Integer aNbIIs;
+  Standard_Real aCfPredict=.5;
+  
+  aNbIIs=ExpectedLength();
+  
+  if (aNbIIs<=1) {
+    return 1;
+  }
+  //
+  aNbIIs=(Standard_Integer) (aCfPredict*(Standard_Real)aNbIIs);
+  return aNbIIs;
+}
+//=======================================================================
 // function: Initialize
 // purpose: 
 //=======================================================================
@@ -112,7 +120,7 @@ static
 {
   Standard_Integer iX;
   //
-  iX=TypeToInteger(aType1, aType2);
+  iX=NMTDS_Tools::TypeToInteger(aType1, aType2);
   if (iX>=0) {
     myIterator.Initialize(myLists[iX]);
     myLength=myLists[iX].Extent();
@@ -158,52 +166,62 @@ static
 {
   return myMVSD;
 }
-
 //=======================================================================
 // function: Prepare
 // purpose: 
 //=======================================================================
   void NMTDS_Iterator::Prepare()
+{
+  Standard_Integer i;
+  //
+  myLength=0;
+  for (i=0; i<6; ++i) {
+    myLists[i].Clear();
+  }
+  myMVSD.Clear();
+  //
+  if (myDS==NULL){
+    return;
+  }
+  Intersect();
+}
+//=======================================================================
+// function: Intersect
+// purpose: 
+//=======================================================================
+  void NMTDS_Iterator::Intersect()
 {
   Standard_Boolean bFlag;
-  Standard_Integer aNb, i, aNbB, aNbR;
+  Standard_Integer aNb, i, aNbB, aNbR, iFlag;
   Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR, k, aNbLV;
   TColStd_ListIteratorOfListOfInteger aIt;
   TColStd_DataMapOfIntegerInteger aMII;
-  TColStd_MapOfInteger aMFence;
+  //modified by NIZNHY-PKV Mon Jan 22 15:08:00 2007f
+  //TColStd_MapOfInteger aMFence;
+  TColStd_DataMapOfIntegerListOfInteger aMVSD;
+  TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
+  //modified by NIZNHY-PKV Mon Jan 22 10:21:50 2007t
   TopTools_DataMapOfShapeInteger aMSI;
   TopAbs_ShapeEnum aTi, aTj;
   NMTDS_PassKeyBoolean aPKXB; 
   NMTDS_MapOfPassKeyBoolean aMPKXB;
   NMTDS_IndexedDataMapOfShapeBox aMSB;
-  Handle(Bnd_HArray1OfBox) aHAB;
-  Bnd_BoundSortBox aBSB;
   //
   NMTDS_BoxBndTreeSelector aSelector;
   NMTDS_BoxBndTree aBBTree;
   NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
   //
-  if (myPDS==NULL){
-    return;
-  }
-  //
-  myLength=0;
-  for (i=0; i<6; ++i) {
-    myLists[i].Clear();
-  }
-  myMVSD.Clear();
-  //
-  const NMTDS_CArray1OfIndexRange& aRanges=myPDS->Ranges();
+  const NMTDS_CArray1OfIndexRange& aRanges=myDS->Ranges();
   aNbR=aRanges.Extent();
   //
-  aNb=myPDS->NumberOfShapesOfTheObject();
+  aNb=myDS->NumberOfShapesOfTheObject();
   for (i=1; i<=aNb; ++i) {
-    const TopoDS_Shape& aS=myPDS->Shape(i);
+    const TopoDS_Shape& aS=myDS->Shape(i);
     aTi=aS.ShapeType();
-    if (IsValidType(aTi)) {
+    if (NMTDS_Tools::HasBRep(aTi)) {
       Bnd_Box aBoxEx;
       //
-      ComputeBoxEx(i, myPDS, aBoxEx);
+      myDS->ComputeBoxEx(i, aBoxEx);
       aMSI.Bind(aS, i);
       aMSB.Add(aS, aBoxEx);
     }
@@ -228,9 +246,9 @@ static
     i1=aR.First();
     i2=aR.Last();
     for (i=i1; i<=i2; ++i) {
-      const TopoDS_Shape& aSi=myPDS->Shape(i);
+      const TopoDS_Shape& aSi=myDS->Shape(i);
       aTi=aSi.ShapeType();
-      if (!IsValidType(aTi)){
+      if (!NMTDS_Tools::HasBRep(aTi)){
        continue;
       }
       const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi);
@@ -257,25 +275,24 @@ static
        }
        //
        aPKXB.SetIds(i, j);
+       //
        if (aMPKXB.Add(aPKXB)) {
          bFlag=Standard_False;// Bounding boxes are intersected
-         const Bnd_Box& aBoxi=myPDS->GetBoundingBox(i);
-         const Bnd_Box& aBoxj=myPDS->GetBoundingBox(j);
+         const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
+         const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
          if (aBoxi.IsOut(aBoxj)) {
            bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
          }
-         const TopoDS_Shape& aSj=myPDS->Shape(j);
+         const TopoDS_Shape& aSj=myDS->Shape(j);
          aTj=aSj.ShapeType();
-         iX=TypeToInteger(aTi, aTj);
-         
+         iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
+         //bFlag=(iStatus==2);
          aPKXB.SetFlag(bFlag);
          myLists[iX].Append(aPKXB);
          //
          // VSD prepare
          if (iX==5) { //VV
-           if (aMFence.Add(j)) {
-             aLV.Append(j);
-           }
+           aLV.Append(j);
          }
        }// if (aMPKXB.Add(aPKXB)) {
       }// for (; aIt.More(); aIt.Next()) {
@@ -283,112 +300,154 @@ static
       // VSD treatment
       aNbLV=aLV.Extent();
       if (aNbLV) {
-       myMVSD.Bind(i, aLV);
+       TColStd_ListOfInteger aLV1;
+       //
+       const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
+       aIt.Initialize(aLV);
+       for (; aIt.More(); aIt.Next()) {
+         j=aIt.Value();  
+         const TopoDS_Shape&  aSj=myDS->Shape(j);
+         const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
+         iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
+         if (!iFlag) {
+           aLV1.Append(j);
+         }
+         else {
+           aPKXB.SetIds(i, j);
+           aMPKXB.Remove(aPKXB);
+         }
+       }
+       aMVSD.Bind(i, aLV1);
       }
     }//for (i=i1; i<=i2; ++i) {
   }//for (iR=1; iR<aNbR; ++iR) {
-}
-
-//=======================================================================
-// function: IsValidType
-// purpose: 
-//=======================================================================
-Standard_Boolean IsValidType(const TopAbs_ShapeEnum aTi)
-{
-  return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
-}
-//=======================================================================
-// function: ComputeBoxEx
-// purpose: 
-//=======================================================================
-  void ComputeBoxEx(const Standard_Integer aIx,
-                   NMTDS_ShapesDataStructure* pDS,
-                   Bnd_Box& aBoxEx)
-{
-  Standard_Integer i, aNbS, iS;
   //
-  const Bnd_Box& aBox=pDS->GetBoundingBox(aIx);
-  aBoxEx.Add(aBox);
   //
-  aNbS=pDS->NumberOfSuccessors(aIx);
-  for (i=1; i<=aNbS; ++i) {
-    Bnd_Box aBoxS;
-    iS=pDS->GetSuccessor(aIx, i);
-    ComputeBoxEx(iS, pDS, aBoxS);
-    aBoxEx.Add(aBoxS);
-  }
+  // Chains
+  //=================
+  myMVSD.Clear();
+  NMTDS_Iterator::FillMVSD(aMVSD, myMVSD);
 }
-
 //=======================================================================
-// function: TypeToInteger
-// purpose
+//function : FillMVSD
+//purpose  
 //=======================================================================
-Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
-                              const TopAbs_ShapeEnum aType2)
+  void NMTDS_Iterator::FillMVSD(const TColStd_DataMapOfIntegerListOfInteger& aMVSD,
+                               TColStd_DataMapOfIntegerListOfInteger& bMVSD)
 {
-  Standard_Integer iRet, iT1, iT2, iX;
-  //
-  iRet=-1;
-  iT1=(Standard_Integer)aType1;
-  iT2=(Standard_Integer)aType2;
+  Standard_Boolean bFound;
+  Standard_Integer aNbVSD, iCnt, i, j, k;
+  TColStd_ListOfInteger aLV;
+  TColStd_ListIteratorOfListOfInteger aIt;
+  TColStd_MapOfInteger aMF;
+  TColStd_MapIteratorOfMapOfInteger aItMI;
+  TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
+  NMTDS_DataMapOfIntegerMapOfInteger aDMIMI;
+  NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger aIti, aItj;
   //
-  iX=iT2*10+iT1;
-  switch (iX) {
-    case 77:
-      iRet=5; // VV
-      break;
-    case 76:
-    case 67:
-      iRet=4; // VE
-      break;
-    case 74:
-    case 47:
-      iRet=2; // VF
-      break;
-    case 66:
-      iRet=3; // EE
-      break;
-    case 64:
-    case 46:
-      iRet=1; // EF
-      break;
-    case 44:
-      iRet=0; // FF
-      break;
-    default:
-      break;
+  aNbVSD=aMVSD.Extent();
+  if (!aNbVSD) {
+    return;
   }
-  return iRet; 
-}
-
-/*
-//
-  // check
-  TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
-  TColStd_DataMapIteratorOfDataMapOfIntegerInteger aIt2;
   //
-  printf(" \n");
-  printf(" aMVLV.Extent()=%d\n", aMVLV.Extent());
-  aIt1.Initialize(aMVLV);
-  for (; aIt1.More(); aIt1.Next()) {
-    i=aIt1.Key();
-    printf(" i=%d (", i);
-    const TColStd_ListOfInteger& aLV=aIt1.Value();
-    aIt.Initialize(aLV);
+  aItVSD.Initialize(aMVSD);
+  for (; aItVSD.More(); aItVSD.Next()) {
+    TColStd_MapOfInteger aMI;
+    //
+    i=aItVSD.Key();
+    aMI.Add(i);
+    const TColStd_ListOfInteger& aLVSD=aItVSD.Value();
+    aIt.Initialize(aLVSD);
     for (; aIt.More(); aIt.Next()) {
       j=aIt.Value();
-      printf(" %d", j);
+      aMI.Add(j);
     }
-    printf(")\n");
+    aDMIMI.Bind(i, aMI);
   }
-  //
-  printf(" \n");
-  printf(" aMVV.Extent()=%d\n", aMVV.Extent());
-  aIt2.Initialize(aMVV);
-  for (; aIt2.More(); aIt2.Next()) {
-    i=aIt2.Key();
-    j=aIt2.Value();
-    printf(" (%d, %d)\n", i, j);
+  // i
+  aIti.Initialize(aDMIMI);
+  for (; aIti.More(); aIti.Next()) {
+    i=aIti.Key();
+    if (aMF.Contains(i)) {
+      continue;
+    }
+    aMF.Add(i);
+    //
+    //TColStd_MapOfInteger& aMIi=aDMIMI.ChangeFind(i);
+    TColStd_MapOfInteger *pMIi=(TColStd_MapOfInteger *)&aIti.Value();
+    TColStd_MapOfInteger& aMIi=*pMIi;
+    //  j
+    while (1) {
+      iCnt=0;
+      aItj.Initialize(aDMIMI);
+      for (; aItj.More(); aItj.Next()) {
+       j=aItj.Key();
+       if (aMF.Contains(j)) {
+         continue;
+       }
+       //
+       //TColStd_MapOfInteger& aMIj=aDMIMI.ChangeFind(j);
+       TColStd_MapOfInteger *pMj=(TColStd_MapOfInteger *)&aItj.Value();
+       TColStd_MapOfInteger& aMIj=*pMj;
+       //
+       aItMI.Initialize(aMIj);
+       for (; aItMI.More(); aItMI.Next()) {
+         k=aItMI.Key();
+         bFound=aMIi.Contains(k);
+         if (bFound) {
+           break;
+         }
+       }
+       if (!bFound) {
+         continue;
+       }
+       //
+       aItMI.Initialize(aMIj);
+       for (; aItMI.More(); aItMI.Next()) {
+         k=aItMI.Key();
+         aMIi.Add(k);
+       }
+       //
+       if (aMF.Add(j)) {
+         ++iCnt;
+       }
+      } //for (; aItj.More(); aItj.Next()) {
+      if (!iCnt) {
+       break;
+      }
+    } // while (1) {
+    //
+    aLV.Clear();
+    aItMI.Initialize(aMIi);
+    for (; aItMI.More(); aItMI.Next()) {
+      k=aItMI.Key();
+       if (k!=i) {
+         aLV.Append(k);
+       }
+    }
+    bMVSD.Bind(i, aLV);
+  }// for (; aIti.More(); aIti.Next()) {
+}
+
+  /*  
+  {
+    // check
+    TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItX;
+    //
+    printf(" \n");
+    printf(" myMVSD.Extent()=%d\n", myMVSD.Extent());
+    aItX.Initialize(myMVSD);
+    for (; aItX.More(); aItX.Next()) {
+      i=aItX.Key();
+      printf(" i=%d (", i);
+      const TColStd_ListOfInteger& aLV=aItX.Value();
+      aIt.Initialize(aLV);
+      for (; aIt.More(); aIt.Next()) {
+       j=aIt.Value();
+       printf(" %d", j);
+      }
+      printf(")\n");
+    }
   }
-  printf("\n");
 */
+
index d2d260ccd0a6790cc709352571ed71792fb557e3..25ae15ec0fd2313c313483daa05dd622bd77f0b1 100644 (file)
@@ -95,15 +95,21 @@ Standard_EXPORT   void Next() ;
 Standard_EXPORT   void Current(Standard_Integer& aIndex1,Standard_Integer& aIndex2,Standard_Boolean& aWithSubShape) const;
 
 
-Standard_EXPORT   void Prepare() ;
+Standard_EXPORT virtual  void Prepare() ;
 
 
 Standard_EXPORT   Standard_Integer ExpectedLength() const;
 
 
+Standard_EXPORT   Standard_Integer BlockLength() const;
+
+
 Standard_EXPORT  const TColStd_DataMapOfIntegerListOfInteger& SDVertices() const;
 
 
+Standard_EXPORT static  void FillMVSD(const TColStd_DataMapOfIntegerListOfInteger& aMVSD1,TColStd_DataMapOfIntegerListOfInteger& aMVSD2) ;
+
+
 
 
 
@@ -113,9 +119,12 @@ protected:
  // 
 
 
+Standard_EXPORT virtual  void Intersect() ;
+
+
  // Fields PROTECTED
  //
-NMTDS_PShapesDataStructure myPDS;
+NMTDS_PShapesDataStructure myDS;
 NMTDS_ListOfPassKeyBoolean myLists[6];
 NMTDS_ListIteratorOfListOfPassKeyBoolean myIterator;
 NMTDS_ListOfPassKeyBoolean myEmptyList;
diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.cdl b/src/NMTDS/NMTDS_IteratorCheckerSI.cdl
new file mode 100644 (file)
index 0000000..c7f7650
--- /dev/null
@@ -0,0 +1,41 @@
+-- Copyright (C) 2007 SAMTECH
+-- 
+-- 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:       NMTDS_IteratorCheckerSI.cdl
+-- Created:    Tue Feb  6 10:18:27 2007
+-- Author:     Peter KURNEV
+
+
+class IteratorCheckerSI from NMTDS  
+    inherits Iterator from NMTDS
+
+       ---Purpose: 
+
+--uses 
+--raises
+
+is 
+    Create   
+       returns IteratorCheckerSI from NMTDS;
+    ---C++: alias "Standard_EXPORT virtual ~NMTDS_IteratorCheckerSI();" 
+     
+    Intersect(me:out) 
+       is redefined protected;  
+--fields
+end IteratorCheckerSI;
diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.cxx b/src/NMTDS/NMTDS_IteratorCheckerSI.cxx
new file mode 100644 (file)
index 0000000..da2290b
--- /dev/null
@@ -0,0 +1,225 @@
+// Copyright (C) 2007 SAMTECH
+// 
+// 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:       NMTDS_IteratorChecker.cxx
+// Created:    Tue Feb  6 10:37:59 2007
+// Author:     Peter KURNEV
+
+
+#include <NMTDS_IteratorCheckerSI.ixx>
+
+#include <TopAbs_ShapeEnum.hxx>
+#include <gp_Pnt.hxx>
+#include <Bnd_Box.hxx>
+//
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS.hxx>
+#include <BRep_Tool.hxx>
+//
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_DataMapOfIntegerInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
+#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
+//
+#include <TopTools_DataMapOfShapeInteger.hxx>
+//
+#include <NCollection_UBTreeFiller.hxx>
+#include <NMTDS_BoxBndTree.hxx>
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_CArray1OfIndexRange.hxx>
+#include <NMTDS_IndexRange.hxx>
+#include <NMTDS_PassKeyBoolean.hxx>
+#include <NMTDS_MapOfPassKeyBoolean.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
+#include <NMTDS_Tools.hxx>
+
+//=======================================================================
+//function : 
+//purpose  : 
+//=======================================================================
+  NMTDS_IteratorCheckerSI::NMTDS_IteratorCheckerSI()
+:
+  NMTDS_Iterator()
+{
+}
+//=======================================================================
+//function : ~
+//purpose  : 
+//=======================================================================
+  NMTDS_IteratorCheckerSI::~NMTDS_IteratorCheckerSI()
+{
+}
+//=======================================================================
+// function: Intersect
+// purpose: 
+//=======================================================================
+  void NMTDS_IteratorCheckerSI::Intersect()
+{
+  Standard_Boolean bFlag;
+  Standard_Integer aNbS, i, aNbA, aNbB, iFlag;
+  Standard_Integer aNbSD, iX, j, iDS, jB, k, aNbLV;
+  TColStd_ListIteratorOfListOfInteger aIt;
+  TColStd_DataMapOfIntegerInteger aMII;
+  TColStd_DataMapOfIntegerListOfInteger aMVSD;
+  TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
+  TopTools_DataMapOfShapeInteger aMSI;
+  TopAbs_ShapeEnum aTi, aTj;
+  NMTDS_PassKeyBoolean aPKXB; 
+  NMTDS_MapOfPassKeyBoolean aMPKXB;
+  NMTDS_IndexedDataMapOfShapeBox aMSB;
+  NMTDS_MapOfPassKeyBoolean aMPA;//myPairsAvoid
+  //
+  NMTDS_BoxBndTreeSelector aSelector;
+  NMTDS_BoxBndTree aBBTree;
+  NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
+  //
+  aNbS=myDS->NumberOfShapesOfTheObject();
+  //
+  // myPairsAvoid, aMSI, aMSB
+  for (i=1; i<=aNbS; ++i) {
+    const TopoDS_Shape& aSi=myDS->Shape(i);
+    aTi=aSi.ShapeType();
+    if (NMTDS_Tools::HasBRep(aTi)) {
+      if (aTi!=TopAbs_VERTEX) {
+       TColStd_IndexedMapOfInteger aMA;
+       //
+       myDS->GetAllSuccessors(i, aMA);
+       //
+       aNbA=aMA.Extent();
+       for (j=1; j<=aNbA; ++j) {
+         iX=aMA(j);
+         aPKXB.Clear();
+         aPKXB.SetIds(i, iX);
+         aMPA.Add(aPKXB);
+       }
+      }
+      else {
+       aPKXB.Clear();
+       aPKXB.SetIds(i, i);
+       aMPA.Add(aPKXB);
+      }
+      //
+      Bnd_Box aBoxEx;
+      //
+      myDS->ComputeBoxEx(i, aBoxEx);
+      aMSI.Bind(aSi, i);
+      aMSB.Add(aSi, aBoxEx);
+    }
+  }
+  // 
+  // aMII
+  aNbB=aMSB.Extent();
+  for (i=1; i<=aNbB; ++i) {
+    const TopoDS_Shape& aS=aMSB.FindKey(i);
+    const Bnd_Box& aBoxEx=aMSB(i);
+    //
+    aTreeFiller.Add(i, aBoxEx);
+    //
+    iDS=aMSI.Find(aS);
+    aMII.Bind(i, iDS);
+  }
+  //
+  aTreeFiller.Fill();
+  //
+  for (i=1; i<=aNbS; ++i) {
+    const TopoDS_Shape& aSi=myDS->Shape(i);
+    aTi=aSi.ShapeType();
+    if (!NMTDS_Tools::HasBRep(aTi)){
+      continue;
+    }
+    const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi);
+    aSelector.Clear();
+    aSelector.SetBox(aBoxEx);
+    //
+    aNbSD=aBBTree.Select(aSelector);
+    if (!aNbSD){
+      continue;
+    }
+    //
+    const TColStd_ListOfInteger& aLI=aSelector.Indices();
+    //
+    k=0;
+    TColStd_ListOfInteger aLV;
+    //
+    aIt.Initialize(aLI);
+    for (; aIt.More(); aIt.Next()) {
+      jB=aIt.Value();  // box index in MII
+      j=aMII.Find(jB); // DS index
+      //
+      aPKXB.SetIds(i, j);
+      if (aMPA.Contains(aPKXB)) {
+       continue;
+      }
+      //
+      if (aMPKXB.Add(aPKXB)) {
+       bFlag=Standard_False;// Bounding boxes are intersected
+       const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
+       const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
+       if (aBoxi.IsOut(aBoxj)) {
+         bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
+       }
+       const TopoDS_Shape& aSj=myDS->Shape(j);
+       aTj=aSj.ShapeType();
+       iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
+       //bFlag=(iStatus==2);
+       aPKXB.SetFlag(bFlag);
+       myLists[iX].Append(aPKXB);
+       //
+       // VSD prepare
+       if (iX==5) { //VV
+         aLV.Append(j);
+       }
+      }// if (aMPKXB.Add(aPKXB)) {
+    }// for (; aIt.More(); aIt.Next()) {
+    //
+    // VSD treatment
+    aNbLV=aLV.Extent();
+    if (aNbLV) {
+      TColStd_ListOfInteger aLV1;
+      //
+      const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
+      aIt.Initialize(aLV);
+      for (; aIt.More(); aIt.Next()) {
+       j=aIt.Value();  
+       const TopoDS_Shape&  aSj=myDS->Shape(j);
+       const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
+       iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
+       if (!iFlag) {
+         aLV1.Append(j);
+       }
+       else {
+         aPKXB.SetIds(i, j);
+         aMPKXB.Remove(aPKXB);
+       }
+      }        
+      aMVSD.Bind(i, aLV1);
+    }
+  }//for (i=1; i<=aNbS; ++i) {
+  //
+  //
+  // 2. Chains
+  //=================
+  myMVSD.Clear();
+  NMTDS_Iterator::FillMVSD(aMVSD, myMVSD);
+}
+
diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.hxx b/src/NMTDS/NMTDS_IteratorCheckerSI.hxx
new file mode 100644 (file)
index 0000000..f11a9c1
--- /dev/null
@@ -0,0 +1,96 @@
+// 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
+
+#ifndef _NMTDS_IteratorCheckerSI_HeaderFile
+#define _NMTDS_IteratorCheckerSI_HeaderFile
+
+#ifndef _NMTDS_Iterator_HeaderFile
+#include <NMTDS_Iterator.hxx>
+#endif
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_IteratorCheckerSI  : public NMTDS_Iterator {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT NMTDS_IteratorCheckerSI();
+Standard_EXPORT virtual ~NMTDS_IteratorCheckerSI();
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+Standard_EXPORT virtual  void Intersect() ;
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.ixx b/src/NMTDS/NMTDS_IteratorCheckerSI.ixx
new file mode 100644 (file)
index 0000000..6346ab5
--- /dev/null
@@ -0,0 +1,24 @@
+// 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
+
+#include <NMTDS_IteratorCheckerSI.jxx>
+
+
+
diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.jxx b/src/NMTDS/NMTDS_IteratorCheckerSI.jxx
new file mode 100644 (file)
index 0000000..dc6afc1
--- /dev/null
@@ -0,0 +1,22 @@
+// 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
+
+#ifndef _NMTDS_IteratorCheckerSI_HeaderFile
+#include <NMTDS_IteratorCheckerSI.hxx>
+#endif
diff --git a/src/NMTDS/NMTDS_PInterfPool.hxx b/src/NMTDS/NMTDS_PInterfPool.hxx
new file mode 100644 (file)
index 0000000..7084ba3
--- /dev/null
@@ -0,0 +1,27 @@
+// 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
+
+#ifndef _NMTDS_PInterfPool_HeaderFile
+#define _NMTDS_PInterfPool_HeaderFile
+
+class NMTDS_InterfPool;
+
+typedef NMTDS_InterfPool* NMTDS_PInterfPool;
+
+#endif
diff --git a/src/NMTDS/NMTDS_PIterator.hxx b/src/NMTDS/NMTDS_PIterator.hxx
new file mode 100644 (file)
index 0000000..8cefa5b
--- /dev/null
@@ -0,0 +1,27 @@
+// 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
+
+#ifndef _NMTDS_PIterator_HeaderFile
+#define _NMTDS_PIterator_HeaderFile
+
+class NMTDS_Iterator;
+
+typedef NMTDS_Iterator* NMTDS_PIterator;
+
+#endif
index e9a637a46217fac124944f857df57f1d385d8f90..905a8d62af018cfee7fede43578abf4b2d29bbb0 100755 (executable)
@@ -1,4 +1,5 @@
--- Copyright (C) 2006 SAMTECH 
+-- 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 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:       NMTDS_PassKey.cdl
--- Created:    
+-- Created:    Mon Nov 20 12:16:13 2006
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
 
+
 class PassKey from NMTDS 
 
        ---Purpose: 
 
 uses
     Shape from TopoDS, 
-    ListOfInteger from TColStd   
-        
+    IndexedMapOfInteger from TColStd, 
+    ListOfInteger from TColStd
+
 --raises
 
 is 
     Create  
        returns PassKey from NMTDS; 
-     
-    Assign(me:out;  
-           Other : PassKey from NMTDS) 
-       returns PassKey from NMTDS; 
-    ---C++: alias operator =
-    ---C++: return & 
---    
+    ---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKey();" 
+
+    Create(Other:PassKey from NMTDS) 
+       returns PassKey from NMTDS;
+   ---C++: alias "Standard_EXPORT NMTDS_PassKey& operator =(const NMTDS_PassKey& Other);" 
+
+    Clear(me:out);
+    
     SetIds(me:out; 
-           aI1 :Integer from Standard;    
+           aI1  :Integer from Standard); 
+            
+    SetIds(me:out; 
+           aI1 :Integer from Standard; 
            aI2 :Integer from Standard);  
             
-    NbMax(me) 
-       returns Integer  from Standard; 
-        
-    Clear(me:out); 
+    SetIds(me:out; 
+           aI1 :Integer from Standard;    
+           aI2 :Integer from Standard;    
+           aI3 :Integer from Standard);  
+
+    SetIds(me:out; 
+           aI1 :Integer from Standard;    
+           aI2 :Integer from Standard;    
+           aI3 :Integer from Standard;    
+           aI4 :Integer from Standard); 
      
-    Compute(me:out); 
+    SetIds(me:out;  
+           aLS  :ListOfInteger from TColStd);   
+
+    NbIds(me) 
+       returns Integer  from Standard; 
      
     IsEqual(me; 
            aOther:PassKey from NMTDS) 
        returns Boolean from Standard;                       
-
-    Key(me) 
-       returns Address from Standard;  
         
     HashCode(me; 
            Upper : Integer  from Standard)  
        returns Integer from Standard;           
      
+    Id(me; 
+           aIndex: Integer  from Standard)  
+       returns  Integer from Standard;
+       
     Ids(me; 
            aI1 :out Integer from Standard;    
            aI2 :out Integer from Standard);
-     
-    Dump(me); 
 
+    Dump(me; 
+       aHex:Integer from Standard=0);  
+     
+       
 fields 
     myNbIds: Integer from Standard is protected;  
-    myNbMax: Integer from Standard is protected; 
-    mySum  : Integer from Standard is protected;   
-    myIds  : Integer from Standard [2] is protected; 
+    mySum  : Integer from Standard is protected;  
+    myMap  : IndexedMapOfInteger from TColStd is protected; 
 
 end PassKey;
index 910400cd6309b5c3aa8bd6ce99890b3380208fb2..2d2d52ea0a5386292a7eefe810383791173d3eed 100755 (executable)
@@ -1,4 +1,5 @@
-// Copyright (C) 2006 SAMTECH
+// 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
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-// File:       NMTDS_PassKey.cxx
-// Created:    
+//
+// File:       NMTDS_Algo.cxx
+// Created:    Sat Dec 04 12:39:47 2004
 // Author:     Peter KURNEV
-//             <pkv@irinox>
+//             <peter@PREFEX>
 
 
 #include <NMTDS_PassKey.ixx>
 #include <stdio.h>
 #include <string.h>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
 
 #ifdef WNT
 #pragma warning( disable : 4101) 
 #endif
 
-static 
-  void SortShell(const int n, int* a); 
 static
   Standard_Integer NormalizedId(const Standard_Integer aId,
                                const Standard_Integer aDiv);
@@ -44,129 +45,197 @@ static
 //=======================================================================
   NMTDS_PassKey::NMTDS_PassKey()
 {
-  Clear();
+ Clear(); 
+}
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKey::NMTDS_PassKey(const NMTDS_PassKey& aOther)
+{
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
 }
 //=======================================================================
-//function :Assign
+//function :operator =
 //purpose  : 
 //=======================================================================
-  NMTDS_PassKey& NMTDS_PassKey::Assign(const NMTDS_PassKey& anOther)
+  NMTDS_PassKey& NMTDS_PassKey::operator =(const NMTDS_PassKey& aOther)
 {
-  myNbIds=anOther.myNbIds;
-  myNbMax=anOther.myNbMax;
-  mySum=anOther.mySum;
-  memcpy(myIds, anOther.myIds, sizeof(myIds));
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
   return *this;
 }
 //=======================================================================
+//function :~
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKey::~NMTDS_PassKey()
+{
+}
+//=======================================================================
 //function :Clear
 //purpose  : 
 //=======================================================================
   void NMTDS_PassKey::Clear()
 {
-  Standard_Integer i;
-  //
   myNbIds=0;
-  myNbMax=2;
   mySum=0;
-  for (i=0; i<myNbMax; ++i) {
-    myIds[i]=0;
-  }
+  myMap.Clear();
+}
+//=======================================================================
+//function :SetIds
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::SetIds(const Standard_Integer aId1)
+                              
+{
+  Clear();
+  myNbIds=1;
+  myMap.Add(aId1);
+  mySum=NormalizedId(aId1, myNbIds);
+}
+//=======================================================================
+//function :SetIds
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
+                            const Standard_Integer aId2)
+{
+  TColStd_ListOfInteger aLI;
+  //
+  aLI.Append(aId1);
+  aLI.Append(aId2);
+  SetIds(aLI);
 }
 //=======================================================================
 //function :SetIds
 //purpose  : 
 //=======================================================================
-  void NMTDS_PassKey::SetIds(const Standard_Integer anId1,
-                            const Standard_Integer anId2)
+  void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
+                            const Standard_Integer aId2,
+                            const Standard_Integer aId3)
 {
-  Standard_Integer aIdN1, aIdN2;
+  TColStd_ListOfInteger aLI;
   //
-  myNbIds=2;
-  aIdN1=NormalizedId(anId1, myNbIds);
-  aIdN2=NormalizedId(anId2, myNbIds);
-  mySum=aIdN1+aIdN2;
+  aLI.Append(aId1);
+  aLI.Append(aId2);
+  aLI.Append(aId3);
+  SetIds(aLI);
+}
+//=======================================================================
+//function :SetIds
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
+                            const Standard_Integer aId2,
+                            const Standard_Integer aId3,
+                            const Standard_Integer aId4)
+{ 
+  TColStd_ListOfInteger aLI;
   //
-  if (anId1<anId2) {
-    myIds[myNbMax-2]=anId1;
-    myIds[myNbMax-1]=anId2;
-    return;
-  }
-  myIds[myNbMax-2]=anId2;
-  myIds[myNbMax-1]=anId1;
+  aLI.Append(aId1);
+  aLI.Append(aId2);
+  aLI.Append(aId3);
+  aLI.Append(aId4);
+  SetIds(aLI);
 }
 //=======================================================================
-//function :Ids
+//function :SetIds
 //purpose  : 
 //=======================================================================
-  void NMTDS_PassKey::Ids(Standard_Integer& aId1,
-                         Standard_Integer& aId2)const
+  void NMTDS_PassKey::SetIds(const TColStd_ListOfInteger& aLI)
 {
-  aId1=myIds[0];
-  aId2=myIds[1];
+  Standard_Integer i, aId, aIdN;
+  TColStd_ListIteratorOfListOfInteger aIt;
+  //
+  Clear();
+  aIt.Initialize(aLI);
+  for (; aIt.More(); aIt.Next()) {
+    aId=aIt.Value();
+    myMap.Add(aId);
+  }
+  myNbIds=myMap.Extent();
+  for(i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    aIdN=NormalizedId(aId, myNbIds);
+    mySum+=aIdN;
+  }
 }
+
 //=======================================================================
-//function :NbMax
+//function :NbIds
 //purpose  : 
 //=======================================================================
-  Standard_Integer NMTDS_PassKey::NbMax()const
+  Standard_Integer NMTDS_PassKey::NbIds()const
 {
-  return myNbMax;
+  return myNbIds;
 }
 //=======================================================================
-//function :Compute
+//function :Id
 //purpose  : 
 //=======================================================================
-  void NMTDS_PassKey::Compute()
+  Standard_Integer NMTDS_PassKey::Id(const Standard_Integer aIndex) const
 {
-  SortShell(myNbIds, myIds+myNbMax-myNbIds);
+  if (aIndex<1 || aIndex>myNbIds) {
+    return -1;
+  }
+  return myMap(aIndex);
 }
 //=======================================================================
-//function :IsEqual
+//function :Ids
 //purpose  : 
 //=======================================================================
-  Standard_Boolean NMTDS_PassKey::IsEqual(const NMTDS_PassKey& anOther) const
+  void NMTDS_PassKey::Ids(Standard_Integer& aId1,
+                         Standard_Integer& aId2) const
 {
-  Standard_Integer iIsEqual;
-  Standard_Boolean bIsEqual;
-  //
-  iIsEqual=memcmp(myIds, anOther.myIds, sizeof(myIds));
-  bIsEqual=Standard_False;
-  if (!iIsEqual) {
-    bIsEqual=!bIsEqual;
+  aId1=0;
+  aId2=0;
+  if (myNbIds>1) {
+    aId1=myMap(1);
+    aId2=myMap(2);
   }
-  return bIsEqual;
 }
 //=======================================================================
-//function :Key
+//function :IsEqual
 //purpose  : 
 //=======================================================================
-  Standard_Address NMTDS_PassKey::Key()const
+  Standard_Boolean NMTDS_PassKey::IsEqual(const NMTDS_PassKey& aOther) const
 {
-  return (Standard_Address)myIds;
+  Standard_Boolean bRet;
+  Standard_Integer i, aId;
+  //
+  bRet=Standard_False;
+  //
+  if (myNbIds!=aOther.myNbIds) {
+    return bRet;
+  }
+  for (i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    if (!aOther.myMap.Contains(aId)) {
+      return bRet;
+    }
+  }
+  return !bRet;
 }
 //=======================================================================
 //function : HashCode
 //purpose  : 
 //=======================================================================
-  Standard_Integer NMTDS_PassKey::HashCode(const Standard_Integer Upper) const
+  Standard_Integer NMTDS_PassKey::HashCode(const Standard_Integer aUpper) const
 {
-  return ::HashCode(mySum, Upper);
+  return ::HashCode(mySum, aUpper);
 }
 //=======================================================================
 //function : Dump
 //purpose  : 
 //=======================================================================
-  void NMTDS_PassKey::Dump()const
+  void NMTDS_PassKey::Dump(const Standard_Integer )const
 {
-  Standard_Integer i;
-  //
-  printf(" PassKey: {");
-  for (i=0; i<myNbMax; ++i) {
-    printf(" %d", myIds[i]);
-  }
-  printf(" }");
 }
+
 //=======================================================================
 // function: NormalizedId
 // purpose : 
@@ -184,33 +253,109 @@ Standard_Integer NormalizedId(const Standard_Integer aId,
   }
   return aIdRet;
 }
+/*
+//=========
 //=======================================================================
-// function: SortShell
-// purpose : 
+//function : Contains
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_PassKey::Contains(const Standard_Integer aId) const
+{
+  return myMap.Contains(aId);
+}
+//=======================================================================
+//function :Contains
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_PassKey::Contains(const NMTDS_PassKey& aOther) const
+{
+  Standard_Boolean bRet;
+  Standard_Integer i, aId;
+  //
+  bRet=Standard_False;
+  //
+  if (myNbIds<aOther.myNbIds) {
+    return bRet;
+  }
+  for (i=1; i<=aOther.myNbIds; ++i) {
+    aId=aOther.myMap(i);
+    if (!myMap.Contains(aId)) {
+      return bRet;
+    }
+  }
+  return !bRet;
+}
+//=======================================================================
+//function :Intersected
+//purpose  : 
 //=======================================================================
-void SortShell(const int n, int* a) 
+  Standard_Boolean NMTDS_PassKey::Intersected(const NMTDS_PassKey& aOther) const
 {
-  int  x, nd, i, j, l, d=1;
+  Standard_Boolean bRet;
+  Standard_Integer i, aId;
   //
-  while(d<=n) {
-    d*=2;
+  bRet=Standard_False;
+  //
+  for (i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    if (aOther.Contains(aId)) {
+      return !bRet;
+    }
+  }
+  return bRet;
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::Add(const Standard_Integer aId)
+{
+  TColStd_ListOfInteger aLI;
+  aLI.Append(aId);
+  //
+  Add(aLI);
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::Add(const NMTDS_PassKey& aOther) 
+{
+  Standard_Integer i, aId;
+  TColStd_ListOfInteger aLS;
+  //
+  for(i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    aLS.Append(aId);
+  }
+  for(i=1; i<=aOther.myNbIds; ++i) {
+    aId=aOther.myMap(i);
+    aLS.Append(aId);
+  }
+  //
+  Add(aLS);
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::Add(const TColStd_ListOfInteger& aLI)
+{
+  Standard_Integer i, aId;
+  TColStd_ListOfInteger aLS;
+  TColStd_ListIteratorOfListOfInteger aIt;
+  //
+  for(i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    aLS.Append(aId);
+  }
+  aIt.Initialize(aLI);
+  for (; aIt.More(); aIt.Next()) {
+    aId=aIt.Value();
+    aLS.Append(aId);
   }
   //
-  while (d) {
-    d=(d-1)/2;
-    //
-    nd=n-d;
-    for (i=0; i<nd; ++i) {
-      j=i;
-    m30:;
-      l=j+d;
-      if (a[l] < a[j]){
-       x=a[j];
-       a[j]=a[l];
-       a[l]=x;
-       j-=d;
-       if (j > -1) goto m30;
-      }//if (a[l] < a[j]){
-    }//for (i=0; i<nd; ++i) 
-  }//while (1)
+  SetIds(aLS);
 }
+//=========
+*/
index 65ac7bb2b80764723ae41a6d652c05535d6d12d3..379b72f79d2e5de73b5703f17114c22ecdcbbc66 100644 (file)
 #ifndef _Standard_Integer_HeaderFile
 #include <Standard_Integer.hxx>
 #endif
+#ifndef _TColStd_IndexedMapOfInteger_HeaderFile
+#include <TColStd_IndexedMapOfInteger.hxx>
+#endif
 #ifndef _Standard_Boolean_HeaderFile
 #include <Standard_Boolean.hxx>
 #endif
-#ifndef _Standard_Address_HeaderFile
-#include <Standard_Address.hxx>
-#endif
+class TColStd_ListOfInteger;
 
 
 #ifndef _Standard_HeaderFile
@@ -60,41 +61,47 @@ public:
 
 
 Standard_EXPORT NMTDS_PassKey();
+Standard_EXPORT virtual ~NMTDS_PassKey();
+
 
+Standard_EXPORT NMTDS_PassKey(const NMTDS_PassKey& Other);
+Standard_EXPORT NMTDS_PassKey& operator =(const NMTDS_PassKey& Other);
+
+
+Standard_EXPORT   void Clear() ;
 
-Standard_EXPORT   NMTDS_PassKey& Assign(const NMTDS_PassKey& Other) ;
-  NMTDS_PassKey& operator =(const NMTDS_PassKey& Other) 
-{
-  return Assign(Other);
-}
 
+Standard_EXPORT   void SetIds(const Standard_Integer aI1) ;
 
 
 Standard_EXPORT   void SetIds(const Standard_Integer aI1,const Standard_Integer aI2) ;
 
 
-Standard_EXPORT   Standard_Integer NbMax() const;
+Standard_EXPORT   void SetIds(const Standard_Integer aI1,const Standard_Integer aI2,const Standard_Integer aI3) ;
 
 
-Standard_EXPORT   void Clear() ;
+Standard_EXPORT   void SetIds(const Standard_Integer aI1,const Standard_Integer aI2,const Standard_Integer aI3,const Standard_Integer aI4) ;
 
 
-Standard_EXPORT   void Compute() ;
+Standard_EXPORT   void SetIds(const TColStd_ListOfInteger& aLS) ;
 
 
-Standard_EXPORT   Standard_Boolean IsEqual(const NMTDS_PassKey& aOther) const;
+Standard_EXPORT   Standard_Integer NbIds() const;
 
 
-Standard_EXPORT   Standard_Address Key() const;
+Standard_EXPORT   Standard_Boolean IsEqual(const NMTDS_PassKey& aOther) const;
 
 
 Standard_EXPORT   Standard_Integer HashCode(const Standard_Integer Upper) const;
 
 
+Standard_EXPORT   Standard_Integer Id(const Standard_Integer aIndex) const;
+
+
 Standard_EXPORT   void Ids(Standard_Integer& aI1,Standard_Integer& aI2) const;
 
 
-Standard_EXPORT   void Dump() const;
+Standard_EXPORT   void Dump(const Standard_Integer aHex = 0) const;
 
 
 
@@ -109,9 +116,8 @@ protected:
  // Fields PROTECTED
  //
 Standard_Integer myNbIds;
-Standard_Integer myNbMax;
 Standard_Integer mySum;
-Standard_Integer myIds[2];
+TColStd_IndexedMapOfInteger myMap;
 
 
 private: 
index 02ef906d33255b21132320b4eb74620fbd454e62..ba0d04dd17ed07bdbc4dc1403387efb9e7e78a85 100644 (file)
@@ -17,6 +17,9 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
+#ifndef _TColStd_ListOfInteger_HeaderFile
+#include <TColStd_ListOfInteger.hxx>
+#endif
 #ifndef _NMTDS_PassKey_HeaderFile
 #include <NMTDS_PassKey.hxx>
 #endif
index 2ad7871a0e4c00b0d536f274d4f4633ac279468b..c34a3244a6b5d46627ec0c191175bcae2ce7db7d 100755 (executable)
@@ -36,21 +36,16 @@ uses
 is 
     Create  
        returns PassKeyBoolean from NMTDS; 
-     
-    Assign(me:out;  
-           Other : PassKeyBoolean from NMTDS) 
-       returns PassKeyBoolean from NMTDS; 
-    ---C++: alias operator =
-    ---C++: return & 
---     
+    ---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKeyBoolean();" 
+    
     SetFlag(me:out; 
            aFlag: Boolean from Standard); 
-        
+    ---C++: alias " Standard_EXPORT NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other);" 
+    
     Flag(me)  
        returns Boolean from Standard;      
 
 fields 
     myFlag: Boolean from Standard is protected;  
 
 end PassKeyBoolean;
index 11f90ee799a4730be0f1db17d6abdfc553adb251..059751fe2e180ebe2e29f2e6f81209cf5d4a7032 100755 (executable)
@@ -25,7 +25,7 @@
 #include <NMTDS_PassKeyBoolean.ixx>
 
 //=======================================================================
-//function : NMTDS_PassKeyBoolean
+//function : 
 //purpose  : 
 //=======================================================================
   NMTDS_PassKeyBoolean::NMTDS_PassKeyBoolean()
 {
 }
 //=======================================================================
-//function :Assign
+//function : ~
 //purpose  : 
 //=======================================================================
-  NMTDS_PassKeyBoolean& NMTDS_PassKeyBoolean::Assign(const NMTDS_PassKeyBoolean& anOther)
+  NMTDS_PassKeyBoolean::~NMTDS_PassKeyBoolean()
+{
+}
+//=======================================================================
+//function :operator =
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKeyBoolean& NMTDS_PassKeyBoolean::operator =(const NMTDS_PassKeyBoolean& anOther)
 {
   myFlag=anOther.myFlag;
-  NMTDS_PassKey::Assign(anOther);
+  NMTDS_PassKey::operator =(anOther);
   return *this;
 }
 //=======================================================================
index 0ac2e06b628f78bcdce0c0bc0300b046bdf59c49..604cfa30b368c4c1216748e83afcb38c1ac1eebf 100644 (file)
@@ -57,17 +57,11 @@ public:
 
 
 Standard_EXPORT NMTDS_PassKeyBoolean();
-
-
-Standard_EXPORT   NMTDS_PassKeyBoolean& Assign(const NMTDS_PassKeyBoolean& Other) ;
-  NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other) 
-{
-  return Assign(Other);
-}
-
+Standard_EXPORT virtual ~NMTDS_PassKeyBoolean();
 
 
 Standard_EXPORT   void SetFlag(const Standard_Boolean aFlag) ;
+ Standard_EXPORT NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other);
 
 
 Standard_EXPORT   Standard_Boolean Flag() const;
index ae537d7873bfe80de5be02e5faf41cda152fad05..de75ce8f9de1a32bd78fe3cf1f5cc07a9e56a78d 100755 (executable)
@@ -1,4 +1,5 @@
--- Copyright (C) 2006 SAMTECH 
+-- 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
@@ -14,8 +15,8 @@
 -- 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:       NMTDS_PassKeyMapHasher.cdl
 -- Created:    
 -- Author:     Peter KURNEV
index 09e4ad0476214c1b831171818a912ceb853b30a2..ac7910947f683d906b4c3a45e42e33bb8164999b 100755 (executable)
@@ -1,4 +1,5 @@
-// Copyright (C) 2006 SAMTECH
+// 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
 //function : HashCode
 //purpose  : 
 //=======================================================================
-  Standard_Integer NMTDS_PassKeyMapHasher::HashCode(const NMTDS_PassKey& aPKey,
+  Standard_Integer NMTDS_PassKeyMapHasher::HashCode(const NMTDS_PassKey& aPK,
                                                    const Standard_Integer Upper)
 {
-  return aPKey.HashCode(Upper);
+  return aPK.HashCode(Upper);
 }
 //=======================================================================
 //function :IsEqual
 //purpose  : 
 //=======================================================================
-  Standard_Boolean NMTDS_PassKeyMapHasher::IsEqual(const NMTDS_PassKey& aPKey1,
-                                                  const NMTDS_PassKey& aPKey2)
+  Standard_Boolean NMTDS_PassKeyMapHasher::IsEqual(const NMTDS_PassKey& aPK1,
+                                                  const NMTDS_PassKey& aPK2)
 {
-  return aPKey1.IsEqual(aPKey2);
+  return aPK1.IsEqual(aPK2);
 }
diff --git a/src/NMTDS/NMTDS_PassKeyShape.cdl b/src/NMTDS/NMTDS_PassKeyShape.cdl
new file mode 100644 (file)
index 0000000..0812265
--- /dev/null
@@ -0,0 +1,95 @@
+-- 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:       NMTDS_PassKeyShape.cdl
+-- Created:    
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+
+
+class PassKeyShape from NMTDS 
+   
+       ---Purpose: 
+
+uses
+    Shape from TopoDS, 
+    ListOfShape from TopTools,   
+    IndexedMapOfShape from TopTools 
+     
+--raises
+
+is 
+    Create  
+       returns PassKeyShape from NMTDS; 
+     ---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKeyShape();" 
+     
+    Create(Other:PassKeyShape from NMTDS) 
+       returns PassKeyShape from NMTDS;
+     
+    Assign(me:out;  
+           Other : PassKeyShape from NMTDS) 
+       returns PassKeyShape from NMTDS; 
+    ---C++: alias operator =
+    ---C++: return &  
+     
+    SetShapes(me:out; 
+           aS  :Shape from TopoDS); 
+           
+    SetShapes(me:out; 
+           aS1  :Shape from TopoDS; 
+           aS2  :Shape from TopoDS); 
+     
+    SetShapes(me:out; 
+           aS1  :Shape from TopoDS; 
+           aS2  :Shape from TopoDS; 
+           aS3  :Shape from TopoDS); 
+    SetShapes(me:out;  
+           aS1  :Shape from TopoDS; 
+           aS2  :Shape from TopoDS; 
+           aS3  :Shape from TopoDS;
+           aS4  :Shape from TopoDS);
+    SetShapes(me:out;  
+           aLS  :ListOfShape from TopTools); 
+        
+    Clear(me:out); 
+     
+
+    NbIds(me) 
+       returns Integer  from Standard; 
+     
+    IsEqual(me; 
+           aOther:PassKeyShape from NMTDS) 
+       returns Boolean from Standard;                       
+        
+    HashCode(me; 
+           Upper : Integer  from Standard)  
+       returns Integer from Standard;           
+     
+    Dump(me; 
+       aHex:Integer from Standard=0);  
+       
+fields 
+    myNbIds:Integer from Standard is protected;    
+    mySum  :Integer from Standard is protected;    
+    myUpper:Integer from Standard is protected;    
+    myMap  :IndexedMapOfShape from TopTools is protected;        
+
+end PassKeyShape;
diff --git a/src/NMTDS/NMTDS_PassKeyShape.cxx b/src/NMTDS/NMTDS_PassKeyShape.cxx
new file mode 100644 (file)
index 0000000..c4af3a4
--- /dev/null
@@ -0,0 +1,227 @@
+// 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:       NMTDS_PassKeyShape.cxx
+// Created:    
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTDS_PassKeyShape.ixx>
+
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+
+
+static 
+  Standard_Integer NormalizedId(const Standard_Integer aId,
+                               const Standard_Integer aDiv);
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKeyShape::NMTDS_PassKeyShape()
+{
+  myUpper=432123;
+}
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKeyShape::NMTDS_PassKeyShape(const NMTDS_PassKeyShape& aOther)
+{
+  myUpper=432123;
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
+}
+//=======================================================================
+//function :~
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKeyShape::~NMTDS_PassKeyShape()
+{
+}
+//=======================================================================
+//function :Assign
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKeyShape& NMTDS_PassKeyShape::Assign(const NMTDS_PassKeyShape& aOther)
+{
+  myUpper=432123;
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
+  return *this;
+}
+//=======================================================================
+//function :Clear
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::Clear()
+{
+  myNbIds=0;
+  mySum=0;
+  myMap.Clear();
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1)
+                              
+{
+  Standard_Integer aHC;
+  //
+  Clear();
+  myNbIds=1;
+  myMap.Add(aS1);
+  aHC=aS1.HashCode(myUpper);
+  mySum=NormalizedId(aHC, myNbIds);
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+                                       const TopoDS_Shape& aS2)
+{
+  TopTools_ListOfShape aLS;
+  //
+  aLS.Append(aS1);
+  aLS.Append(aS2);
+  SetShapes(aLS);
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+                                       const TopoDS_Shape& aS2,
+                                       const TopoDS_Shape& aS3)
+{
+  TopTools_ListOfShape aLS;
+  //
+  aLS.Append(aS1);
+  aLS.Append(aS2);
+  aLS.Append(aS3);
+  SetShapes(aLS);
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+                                       const TopoDS_Shape& aS2,
+                                       const TopoDS_Shape& aS3,
+                                       const TopoDS_Shape& aS4)
+{
+  TopTools_ListOfShape aLS;
+  //
+  aLS.Append(aS1);
+  aLS.Append(aS2);
+  aLS.Append(aS3);
+  aLS.Append(aS4);
+  SetShapes(aLS);
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::SetShapes(const TopTools_ListOfShape& aLS)
+{
+  Standard_Integer i, aId, aIdN;
+  TopTools_ListIteratorOfListOfShape aIt;
+  //
+  Clear();
+  aIt.Initialize(aLS);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aS=aIt.Value();
+    myMap.Add(aS);
+  }
+  myNbIds=myMap.Extent();
+  for(i=1; i<=myNbIds; ++i) {
+    const TopoDS_Shape& aS=myMap(i);
+    aId=aS.HashCode(myUpper);
+    aIdN=NormalizedId(aId, myNbIds);
+    mySum+=aIdN;
+  }
+}
+//=======================================================================
+//function :NbIds
+//purpose  : 
+//=======================================================================
+  Standard_Integer NMTDS_PassKeyShape::NbIds()const
+{
+  return myNbIds;
+}
+//=======================================================================
+//function :IsEqual
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_PassKeyShape::IsEqual(const NMTDS_PassKeyShape& aOther) const
+{
+  Standard_Boolean bRet;
+  Standard_Integer i;
+  //
+  bRet=Standard_False;
+  //
+  if (myNbIds!=aOther.myNbIds) {
+    return bRet;
+  }
+  for (i=1; i<=myNbIds; ++i) {
+    const TopoDS_Shape& aS=myMap(i);
+    if (!aOther.myMap.Contains(aS)) {
+      return bRet;
+    }
+  }
+  return !bRet;
+}
+//=======================================================================
+//function : HashCode
+//purpose  : 
+//=======================================================================
+  Standard_Integer NMTDS_PassKeyShape::HashCode(const Standard_Integer aUpper) const
+{
+  return ::HashCode(mySum, aUpper);
+}
+//=======================================================================
+//function : Dump
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::Dump(const Standard_Integer)const
+{
+}
+//=======================================================================
+// function: NormalizedId
+// purpose : 
+//=======================================================================
+Standard_Integer NormalizedId(const Standard_Integer aId,
+                             const Standard_Integer aDiv)
+{
+  Standard_Integer aMax, aTresh, aIdRet;
+  //
+  aIdRet=aId;
+  aMax=::IntegerLast();
+  aTresh=aMax/aDiv;
+  if (aId>aTresh) {
+    aIdRet=aId%aTresh;
+  }
+  return aIdRet;
+}
diff --git a/src/NMTDS/NMTDS_PassKeyShape.hxx b/src/NMTDS/NMTDS_PassKeyShape.hxx
new file mode 100644 (file)
index 0000000..81eaa80
--- /dev/null
@@ -0,0 +1,146 @@
+// 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
+
+#ifndef _NMTDS_PassKeyShape_HeaderFile
+#define _NMTDS_PassKeyShape_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _TopTools_IndexedMapOfShape_HeaderFile
+#include <TopTools_IndexedMapOfShape.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class TopoDS_Shape;
+class TopTools_ListOfShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_PassKeyShape  {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT NMTDS_PassKeyShape();
+Standard_EXPORT virtual ~NMTDS_PassKeyShape();
+
+
+Standard_EXPORT NMTDS_PassKeyShape(const NMTDS_PassKeyShape& Other);
+
+
+Standard_EXPORT   NMTDS_PassKeyShape& Assign(const NMTDS_PassKeyShape& Other) ;
+  NMTDS_PassKeyShape& operator =(const NMTDS_PassKeyShape& Other) 
+{
+  return Assign(Other);
+}
+
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2) ;
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3) ;
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3,const TopoDS_Shape& aS4) ;
+
+
+Standard_EXPORT   void SetShapes(const TopTools_ListOfShape& aLS) ;
+
+
+Standard_EXPORT   void Clear() ;
+
+
+Standard_EXPORT   Standard_Integer NbIds() const;
+
+
+Standard_EXPORT   Standard_Boolean IsEqual(const NMTDS_PassKeyShape& aOther) const;
+
+
+Standard_EXPORT   Standard_Integer HashCode(const Standard_Integer Upper) const;
+
+
+Standard_EXPORT   void Dump(const Standard_Integer aHex = 0) const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+Standard_Integer myNbIds;
+Standard_Integer mySum;
+Standard_Integer myUpper;
+TopTools_IndexedMapOfShape myMap;
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_PassKeyShape.ixx b/src/NMTDS/NMTDS_PassKeyShape.ixx
new file mode 100644 (file)
index 0000000..90c37bd
--- /dev/null
@@ -0,0 +1,24 @@
+// 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
+
+#include <NMTDS_PassKeyShape.jxx>
+
+
+
diff --git a/src/NMTDS/NMTDS_PassKeyShape.jxx b/src/NMTDS/NMTDS_PassKeyShape.jxx
new file mode 100644 (file)
index 0000000..9d79955
--- /dev/null
@@ -0,0 +1,28 @@
+// 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
+
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _TopTools_ListOfShape_HeaderFile
+#include <TopTools_ListOfShape.hxx>
+#endif
+#ifndef _NMTDS_PassKeyShape_HeaderFile
+#include <NMTDS_PassKeyShape.hxx>
+#endif
diff --git a/src/NMTDS/NMTDS_PassKeyShapeMapHasher.cdl b/src/NMTDS/NMTDS_PassKeyShapeMapHasher.cdl
new file mode 100644 (file)
index 0000000..77c0667
--- /dev/null
@@ -0,0 +1,47 @@
+-- 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:       NMTDS_PassKeyMapHasher.cdl
+-- Created:    
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+
+
+class PassKeyShapeMapHasher from NMTDS 
+
+       ---Purpose: 
+
+uses 
+    PassKeyShape from NMTDS 
+
+--raises
+
+is 
+    HashCode(myclass;  
+           aPKey : PassKeyShape from NMTDS;  
+           Upper : Integer from Standard)  
+       returns Integer from Standard;
+       
+       
+    IsEqual(myclass;  
+           aPKey1 : PassKeyShape from NMTDS;  
+           aPKey2 : PassKeyShape from NMTDS)  
+       returns Boolean from Standard;
+
+end PassKeyShapeMapHasher;
diff --git a/src/NMTDS/NMTDS_PassKeyShapeMapHasher.cxx b/src/NMTDS/NMTDS_PassKeyShapeMapHasher.cxx
new file mode 100644 (file)
index 0000000..e637e33
--- /dev/null
@@ -0,0 +1,45 @@
+// 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:       NMTDS_PassKeyMapHasher.cxx
+// Created:    
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTDS_PassKeyShapeMapHasher.ixx>
+
+//=======================================================================
+//function : HashCode
+//purpose  : 
+//=======================================================================
+  Standard_Integer NMTDS_PassKeyShapeMapHasher::HashCode(const NMTDS_PassKeyShape& aPK,
+                                                        const Standard_Integer Upper)
+{
+  return aPK.HashCode(Upper);
+}
+//=======================================================================
+//function :IsEqual
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_PassKeyShapeMapHasher::IsEqual(const NMTDS_PassKeyShape& aPK1,
+                                                       const NMTDS_PassKeyShape& aPK2)
+{
+  return aPK1.IsEqual(aPK2);
+}
diff --git a/src/NMTDS/NMTDS_PassKeyShapeMapHasher.hxx b/src/NMTDS/NMTDS_PassKeyShapeMapHasher.hxx
new file mode 100644 (file)
index 0000000..e484367
--- /dev/null
@@ -0,0 +1,99 @@
+// 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
+
+#ifndef _NMTDS_PassKeyShapeMapHasher_HeaderFile
+#define _NMTDS_PassKeyShapeMapHasher_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class NMTDS_PassKeyShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_PassKeyShapeMapHasher  {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT static  Standard_Integer HashCode(const NMTDS_PassKeyShape& aPKey,const Standard_Integer Upper) ;
+
+
+Standard_EXPORT static  Standard_Boolean IsEqual(const NMTDS_PassKeyShape& aPKey1,const NMTDS_PassKeyShape& aPKey2) ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_PassKeyShapeMapHasher.ixx b/src/NMTDS/NMTDS_PassKeyShapeMapHasher.ixx
new file mode 100644 (file)
index 0000000..c7148fd
--- /dev/null
@@ -0,0 +1,24 @@
+// 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
+
+#include <NMTDS_PassKeyShapeMapHasher.jxx>
+
+
+
diff --git a/src/NMTDS/NMTDS_PassKeyShapeMapHasher.jxx b/src/NMTDS/NMTDS_PassKeyShapeMapHasher.jxx
new file mode 100644 (file)
index 0000000..f0e81fc
--- /dev/null
@@ -0,0 +1,25 @@
+// 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
+
+#ifndef _NMTDS_PassKeyShape_HeaderFile
+#include <NMTDS_PassKeyShape.hxx>
+#endif
+#ifndef _NMTDS_PassKeyShapeMapHasher_HeaderFile
+#include <NMTDS_PassKeyShapeMapHasher.hxx>
+#endif
index 1922b4861f8e3a0d21c7e6ee7d2cfadc99911b7f..5a2f93f72ce08f2eb8f8d62f9f15f0a8a699e754 100644 (file)
@@ -27,8 +27,10 @@ class ShapesDataStructure from NMTDS
 
        ---Purpose: 
 
-uses
-    Shape from TopoDS,  
+uses  
+    Box from Bnd,
+    IndexedMapOfInteger from TColStd,
+    Shape from TopoDS, 
     IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations,
     CArray1OfIndexRange from NMTDS, 
     IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger from NMTDS
@@ -79,6 +81,14 @@ is
            aMS :out IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations); 
 -- Contribution of Samtech www.samcef.com END 
 
+    GetAllSuccessors(me; 
+       anIndex:Integer from Standard; 
+       aScrs  :out IndexedMapOfInteger from TColStd);   
+
+    ComputeBoxEx(me; 
+       anIndex:Integer from Standard; 
+       aBox:out Box from Bnd);   
+
 fields
     myCompositeShape:  Shape from TopoDS is protected; 
     myRanges        :  CArray1OfIndexRange from NMTDS is protected; 
index c7355995b5c7ac561d89b35293cebb3c156af3d7..a9a0e7370c65e3b5b0201ec41e137b1cab3cd2b6 100644 (file)
 
 
 #include <NMTDS_ShapesDataStructure.ixx>
-
-#include <TColStd_MapOfInteger.hxx>
-
 #include <TopoDS_Iterator.hxx>
 #include <TopoDS_Shape.hxx>
-
-#include <BooleanOperations_ShapeAndInterferences.hxx>
 #include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
-
 #include <NMTDS_ListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx>
 #include <NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx>
+#include <BooleanOperations_ShapeAndInterferences.hxx>
 #include <NMTDS_IndexRange.hxx>
+//
+#include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
+#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+#include <TColStd_MapOfInteger.hxx>
+#include <NMTDS_Tools.hxx>
+
+
+static
+  void ComputeBoxExS(const Standard_Integer aIx,
+                    const NMTDS_ShapesDataStructure* pDS,
+                    Bnd_Box& aBoxEx);
+static
+  void GetAllSuccessorsS(const Standard_Integer nS,
+                        const NMTDS_ShapesDataStructure* myDS,
+                        TColStd_IndexedMapOfInteger& aMA);
 
 //===========================================================================
 //function : NMTDS_ShapesDataStructure::NMTDS_ShapesDataStructure
     }
     //modified by NIZNHY-PKV Tue Feb 27 17:06:03 2007t
   }
-  //
   aNbS=aMSA.Extent(); 
   //
   // Fill myRanges
   // Contribution of Samtech www.samcef.com BEGIN
   //
   // Fill the table
+    
   //aShift=0;
   //for (i=0; i<2; ++i) {
   //  if (i) {
   //    InsertShapeAndAncestorsSuccessors(aSx, aASx, aShift);
   //  }
   //}
-
+  
   aShift=0;
   for (j=1; j<=aNbS; ++j) {
     const TopoDS_Shape& aSx=aMSA.FindKey(j);
   // Contribution of Samtech www.samcef.com END
   return aIndex;
 }
+
+//=======================================================================
+//function : ComputeBoxEx
+//purpose  : 
+//=======================================================================
+  void NMTDS_ShapesDataStructure::ComputeBoxEx (const Standard_Integer aIx,
+                                               Bnd_Box& aBoxEx)const
+{
+  ComputeBoxExS(aIx, this, aBoxEx);
+}
+//=======================================================================
+//function : GetAllSuccessors
+//purpose  : 
+//=======================================================================
+  void NMTDS_ShapesDataStructure::GetAllSuccessors(const Standard_Integer nS,
+                                                  TColStd_IndexedMapOfInteger& aMA)const
+{
+  GetAllSuccessorsS(nS, this, aMA);
+}
+//=======================================================================
+//function : GetAllSuccessorsS
+//purpose  : 
+//=======================================================================
+void GetAllSuccessorsS(const Standard_Integer nS,
+                      const NMTDS_ShapesDataStructure* myDS,
+                      TColStd_IndexedMapOfInteger& aMA)
+{
+  TopAbs_ShapeEnum aT;
+  Standard_Integer i, nSx, aNbSuccessors, *pSuccessors;
+  Standard_Address xSuccessors;
+  //
+  const TopoDS_Shape& aS=myDS->Shape(nS);
+  aT=aS.ShapeType();
+  if(NMTDS_Tools::HasBRep(aT)) {
+    aMA.Add(nS);
+    //
+    if (aT==TopAbs_VERTEX) {
+      return;
+    }
+  }
+  //
+  myDS->GetSuccessors(nS, xSuccessors, aNbSuccessors);
+  pSuccessors=(Standard_Integer*)xSuccessors;
+  for (i=0; i<aNbSuccessors; ++i) {
+    nSx=pSuccessors[i];
+    GetAllSuccessorsS(nSx, myDS, aMA);
+  }
+}
+//=======================================================================
+// function: ComputeBoxExS
+// purpose: 
+//=======================================================================
+  void ComputeBoxExS(const Standard_Integer aIx,
+                    const NMTDS_ShapesDataStructure* pDS,
+                    Bnd_Box& aBoxEx)
+{
+  Standard_Integer i, aNbS, iS;
+  //
+  const Bnd_Box& aBox=pDS->GetBoundingBox(aIx);
+  aBoxEx.Add(aBox);
+  //
+  aNbS=pDS->NumberOfSuccessors(aIx);
+  for (i=1; i<=aNbS; ++i) {
+    Bnd_Box aBoxS;
+    iS=pDS->GetSuccessor(aIx, i);
+    ComputeBoxExS(iS, pDS, aBoxS);
+    aBoxEx.Add(aBoxS);
+  }
+}
index b3e8065f806efda98797b152fa085bf75db8bbde..9d149f5a716193fbbe630634b059634643430b47 100644 (file)
@@ -38,6 +38,8 @@
 class TopoDS_Shape;
 class NMTDS_CArray1OfIndexRange;
 class BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors;
+class TColStd_IndexedMapOfInteger;
+class Bnd_Box;
 
 
 #ifndef _Standard_HeaderFile
@@ -98,6 +100,12 @@ Standard_EXPORT   void FillMap(const TopoDS_Shape& aS,BooleanOperations_IndexedD
 Standard_EXPORT   void FillSubshapes(const TopoDS_Shape& aS,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const;
 
 
+Standard_EXPORT   void GetAllSuccessors(const Standard_Integer anIndex,TColStd_IndexedMapOfInteger& aScrs) const;
+
+
+Standard_EXPORT   void ComputeBoxEx(const Standard_Integer anIndex,Bnd_Box& aBox) const;
+
+
 
 
 
index 5ae9a8554dc5459dd0c73c8b7ddb2e56c2bd763b..41897c6155a228076677b1cea8c684a07c6ee55b 100644 (file)
 #ifndef _BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors_HeaderFile
 #include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
 #endif
+#ifndef _TColStd_IndexedMapOfInteger_HeaderFile
+#include <TColStd_IndexedMapOfInteger.hxx>
+#endif
+#ifndef _Bnd_Box_HeaderFile
+#include <Bnd_Box.hxx>
+#endif
 #ifndef _NMTDS_ShapesDataStructure_HeaderFile
 #include <NMTDS_ShapesDataStructure.hxx>
 #endif
diff --git a/src/NMTDS/NMTDS_Tools.cdl b/src/NMTDS/NMTDS_Tools.cdl
new file mode 100644 (file)
index 0000000..1465d4d
--- /dev/null
@@ -0,0 +1,64 @@
+-- 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:       NMTDS_Tools.cdl
+-- Created:    Tue Feb 20 14:56:14 2007
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+---Copyright:   Matra Datavision 2007
+
+
+class Tools from NMTDS 
+
+       ---Purpose: 
+
+uses
+    ShapeEnum from TopAbs, 
+    Vertex    from TopoDS,
+    Shape     from TopoDS,
+    IndexedDataMapOfShapeShape from TopTools 
+    
+--raises
+
+is 
+    TypeToInteger(myclass; 
+           aT1: ShapeEnum from TopAbs; 
+           aT2: ShapeEnum from TopAbs) 
+       returns Integer from Standard; 
+        
+    HasBRep(myclass; 
+           aT: ShapeEnum from TopAbs) 
+       returns Boolean from Standard;  
+        
+    ComputeVV(myclass;  
+           aV1:Vertex from TopoDS;  
+           aV2:Vertex from TopoDS) 
+       returns Integer from Standard;  
+
+    CopyShape(myclass; 
+           aS:Shape from TopoDS;  
+           aSC:out Shape from TopoDS);  
+
+    CopyShape(myclass; 
+           aS:Shape from TopoDS;  
+           aSC  :out Shape from TopoDS; 
+           aMSS :out IndexedDataMapOfShapeShape from TopTools);
+--fields
+
+end Tools;
diff --git a/src/NMTDS/NMTDS_Tools.cxx b/src/NMTDS/NMTDS_Tools.cxx
new file mode 100644 (file)
index 0000000..8944fe5
--- /dev/null
@@ -0,0 +1,173 @@
+// 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:       NMTDS_Tools.cxx
+// Created:    Tue Feb 20 14:57:28 2007
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTDS_Tools.ixx>
+#include <TopoDS_Vertex.hxx>
+#include <gp_Pnt.hxx>
+#include <BRep_Tool.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopTools_IndexedDataMapOfShapeShape.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <BRep_Builder.hxx>
+
+void CopySource(const TopoDS_Shape& aS, 
+               TopTools_IndexedDataMapOfShapeShape& aMapSS, 
+               TopoDS_Shape& aSC);
+
+//=======================================================================
+//function : CopyShape
+//purpose  : 
+//=======================================================================
+  void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS, 
+                             TopoDS_Shape& aSC)
+{
+  TopTools_IndexedDataMapOfShapeShape aMapSS;
+  //
+  CopySource(aS, aMapSS, aSC);
+}
+//=======================================================================
+//function : CopyShape
+//purpose  : 
+//=======================================================================
+  void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS, 
+                             TopoDS_Shape& aSC,
+                             TopTools_IndexedDataMapOfShapeShape& aMapSS)
+{
+  CopySource(aS, aMapSS, aSC);
+}
+//=======================================================================
+//function : CopySource
+//purpose  : 
+//=======================================================================
+void CopySource(const TopoDS_Shape& aS, 
+               TopTools_IndexedDataMapOfShapeShape& aMapSS, 
+               TopoDS_Shape& aSC)
+{
+  Standard_Boolean bFree;
+  TopAbs_ShapeEnum aT;
+  TopoDS_Iterator aIt;
+  BRep_Builder BB;
+  //
+  aT=aS.ShapeType();
+  //
+  if (aMapSS.Contains(aS)) {
+    aSC=aMapSS.ChangeFromKey(aS);
+    aSC.Orientation(aS.Orientation());
+    return;
+  }
+  else {
+    aSC=aS.EmptyCopied();
+    aMapSS.Add(aS, aSC);
+  }
+  //
+  bFree=aSC.Free();
+  aSC.Free(Standard_True);
+  aIt.Initialize(aS);
+  for (; aIt.More();  aIt.Next()) {
+    TopoDS_Shape aSCx;
+    //
+    const TopoDS_Shape& aSx=aIt.Value();
+    //
+    CopySource (aSx, aMapSS, aSCx);  
+    //
+    aSCx.Orientation(aSx.Orientation());
+    BB.Add(aSC, aSCx);
+  }
+  aSC.Free(bFree);
+}
+//=======================================================================
+// function: ComputeVV
+// purpose: 
+//=======================================================================
+  Standard_Integer NMTDS_Tools::ComputeVV(const TopoDS_Vertex& aV1, 
+                                         const TopoDS_Vertex& aV2)
+{
+  Standard_Real aTolV1, aTolV2, aTolSum, aTolSum2, aD2;
+  gp_Pnt aP1, aP2;
+  //
+  aTolV1=BRep_Tool::Tolerance(aV1);
+  aTolV2=BRep_Tool::Tolerance(aV2);
+  aTolSum=aTolV1+aTolV2;
+  aTolSum2=aTolSum*aTolSum;
+  //
+  aP1=BRep_Tool::Pnt(aV1);
+  aP2=BRep_Tool::Pnt(aV2);
+  //
+  aD2=aP1.SquareDistance(aP2);
+  if (aD2>aTolSum2) {
+    return -1;
+  }
+  return 0;
+}
+//=======================================================================
+// function: HasBRep
+// purpose: 
+//=======================================================================
+  Standard_Boolean NMTDS_Tools::HasBRep(const TopAbs_ShapeEnum aTi)
+{
+  return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
+}
+//=======================================================================
+//function : TypeToInteger
+//purpose  : 
+//=======================================================================
+  Standard_Integer NMTDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1,
+                                           const TopAbs_ShapeEnum aType2)
+{
+  Standard_Integer iRet, iT1, iT2, iX;
+  //
+  iRet=-1;
+  iT1=(Standard_Integer)aType1;
+  iT2=(Standard_Integer)aType2;
+  //
+  iX=iT2*10+iT1;
+  switch (iX) {
+    case 77:
+      iRet=5; // VV
+      break;
+    case 76:
+    case 67:
+      iRet=4; // VE
+      break;
+    case 74:
+    case 47:
+      iRet=2; // VF
+      break;
+    case 66:
+      iRet=3; // EE
+      break;
+    case 64:
+    case 46:
+      iRet=1; // EF
+      break;
+    case 44:
+      iRet=0; // FF
+      break;
+    default:
+      break;
+  }
+  return iRet; 
+}
diff --git a/src/NMTDS/NMTDS_Tools.hxx b/src/NMTDS/NMTDS_Tools.hxx
new file mode 100644 (file)
index 0000000..c7eb8fd
--- /dev/null
@@ -0,0 +1,113 @@
+// 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
+
+#ifndef _NMTDS_Tools_HeaderFile
+#define _NMTDS_Tools_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _TopAbs_ShapeEnum_HeaderFile
+#include <TopAbs_ShapeEnum.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class TopoDS_Vertex;
+class TopoDS_Shape;
+class TopTools_IndexedDataMapOfShapeShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_Tools  {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT static  Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aT1,const TopAbs_ShapeEnum aT2) ;
+
+
+Standard_EXPORT static  Standard_Boolean HasBRep(const TopAbs_ShapeEnum aT) ;
+
+
+Standard_EXPORT static  Standard_Integer ComputeVV(const TopoDS_Vertex& aV1,const TopoDS_Vertex& aV2) ;
+
+
+Standard_EXPORT static  void CopyShape(const TopoDS_Shape& aS,TopoDS_Shape& aSC) ;
+
+
+Standard_EXPORT static  void CopyShape(const TopoDS_Shape& aS,TopoDS_Shape& aSC,TopTools_IndexedDataMapOfShapeShape& aMSS) ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_Tools.ixx b/src/NMTDS/NMTDS_Tools.ixx
new file mode 100644 (file)
index 0000000..8e5877b
--- /dev/null
@@ -0,0 +1,24 @@
+// 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
+
+#include <NMTDS_Tools.jxx>
+
+
+
diff --git a/src/NMTDS/NMTDS_Tools.jxx b/src/NMTDS/NMTDS_Tools.jxx
new file mode 100644 (file)
index 0000000..4359a18
--- /dev/null
@@ -0,0 +1,31 @@
+// 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
+
+#ifndef _TopoDS_Vertex_HeaderFile
+#include <TopoDS_Vertex.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _TopTools_IndexedDataMapOfShapeShape_HeaderFile
+#include <TopTools_IndexedDataMapOfShapeShape.hxx>
+#endif
+#ifndef _NMTDS_Tools_HeaderFile
+#include <NMTDS_Tools.hxx>
+#endif
index 67fa6c11480ccd72a4c3757c5eb09320503c59e5..ecd125530e2bbce5685e8ca7e2db95b3cc5abd9a 100644 (file)
@@ -38,12 +38,12 @@ salomeinclude_HEADERS = \
        Handle_NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock.hxx \
        Handle_NMTTools_ListNodeOfListOfCommonBlock.hxx \
        Handle_NMTTools_ListNodeOfListOfCoupleOfShape.hxx \
+       NMTTools_CheckerSI.hxx \
        NMTTools_CommonBlockAPI.hxx \
        NMTTools_CommonBlock.hxx \
        NMTTools_CommonBlockPool.hxx \
        NMTTools_CoupleOfShape.hxx \
        NMTTools_DEProcessor.hxx \
-       NMTTools_DSFiller.hxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger.hxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape.hxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock.hxx \
@@ -58,8 +58,6 @@ salomeinclude_HEADERS = \
        NMTTools_ListOfCommonBlock.hxx \
        NMTTools_ListOfCoupleOfShape.hxx \
        NMTTools_PaveFiller.hxx \
-       NMTTools_PCurveMaker.hxx \
-       NMTTools_PDSFiller.hxx \
        NMTTools_PPaveFiller.hxx \
        NMTTools_Tools.hxx \
        Handle_NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock.hxx \
@@ -75,12 +73,13 @@ salomeinclude_HEADERS = \
 lib_LTLIBRARIES = libNMTTools.la
 
 dist_libNMTTools_la_SOURCES = \
+       NMTTools_CheckerSI.cxx \
+       NMTTools_CheckerSI_1.cxx \
        NMTTools_CommonBlockAPI.cxx \
        NMTTools_CommonBlock.cxx \
        NMTTools_CommonBlockPool_0.cxx \
        NMTTools_CoupleOfShape.cxx \
        NMTTools_DEProcessor.cxx \
-       NMTTools_DSFiller.cxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger_0.cxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape_0.cxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock_0.cxx \
@@ -105,7 +104,6 @@ dist_libNMTTools_la_SOURCES = \
        NMTTools_PaveFiller_8.cxx \
        NMTTools_PaveFiller_9.cxx \
        NMTTools_PaveFiller.cxx \
-       NMTTools_PCurveMaker.cxx \
        NMTTools_Tools.cxx \
        NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock_0.cxx \
        NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock_0.cxx \
index 6342a3082816a076090775dab1e62d9764d917cb..14ce83e18de44cb5602624cf88063d0d2bde7593 100644 (file)
@@ -44,18 +44,21 @@ uses
     NMTDS
 
 is 
-    class IteratorOfCoupleOfShape; 
-    class DSFiller; 
+    --class IteratorOfCoupleOfShape; 
+    --class DSFiller; 
     class PaveFiller; 
     class Tools; 
     class CommonBlock; 
     class CommonBlockAPI; 
-    class PCurveMaker; 
+    --class PCurveMaker; 
     class DEProcessor; 
-    class CoupleOfShape; 
-        
+    class CoupleOfShape;  
+    --modified by NIZNHY-PKV Mon Feb 19 11:39:24 2007f
+    class CheckerSI;
+    --modified by NIZNHY-PKV Mon Feb 19 11:39:27 2007t 
+
     pointer PPaveFiller to PaveFiller from NMTTools;
-    pointer PDSFiller   to DSFiller   from NMTTools;
+    --pointer PDSFiller   to DSFiller   from NMTTools;
 
     class ListOfCommonBlock  instantiates  
        List from TCollection(CommonBlock from NMTTools); 
diff --git a/src/NMTTools/NMTTools_CheckerSI.cdl b/src/NMTTools/NMTTools_CheckerSI.cdl
new file mode 100644 (file)
index 0000000..50518ec
--- /dev/null
@@ -0,0 +1,64 @@
+-- Copyright (C) 2006 SAMTECH 
+-- 
+-- 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:       NMTTools_CheckerSI.cdl
+-- Created:    Mon Feb 19 11:23:55 2007
+-- Author:     Peter KURNEV
+
+
+class CheckerSI from NMTTools 
+       inherits PaveFiller from NMTTools 
+       ---Purpose: 
+
+uses 
+    ShapeEnum  from  TopAbs
+
+--raises
+
+is
+    Create 
+       returns CheckerSI from NMTTools;  
+    ---C++: alias "Standard_EXPORT virtual ~NMTTools_CheckerSI();" 
+     
+    Perform (me:out) 
+       is redefined; 
+        
+    Init  (me:out) 
+       is redefined protected;
+    Clear (me:out) 
+       is redefined protected;
+    PreparePaveBlocks (me:out;   
+           nE:Integer from Standard) 
+       is redefined protected;                 
+
+    PreparePaveBlocks (me:out; 
+           aType1: ShapeEnum  from  TopAbs; 
+           aType2: ShapeEnum  from  TopAbs) 
+       is redefined protected; 
+    
+    StopStatus(me) 
+       returns Integer from Standard;   
+
+
+fields
+    myStopStatus: Integer from Standard is protected; 
+     
+end CheckerSI;
diff --git a/src/NMTTools/NMTTools_CheckerSI.cxx b/src/NMTTools/NMTTools_CheckerSI.cxx
new file mode 100644 (file)
index 0000000..f315879
--- /dev/null
@@ -0,0 +1,177 @@
+// Copyright (C) 2006 SAMTECH
+// 
+// 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:       NMTTools_CheckerSI.cxx
+// Created:    Mon Feb 19 11:32:08 2007
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTTools_CheckerSI.ixx>
+
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_IteratorCheckerSI.hxx>
+#include <NMTDS_InterfPool.hxx>
+#include <NMTTools_DEProcessor.hxx>
+
+//=======================================================================
+//function : 
+//purpose  : 
+//=======================================================================
+  NMTTools_CheckerSI::NMTTools_CheckerSI()
+:
+  NMTTools_PaveFiller()
+{
+  myStopStatus=0;
+}
+//=======================================================================
+//function : ~
+//purpose  : 
+//=======================================================================
+  NMTTools_CheckerSI::~NMTTools_CheckerSI()
+{
+}
+//=======================================================================
+//function : Clear
+//purpose  : 
+//=======================================================================
+  void NMTTools_CheckerSI::Clear()
+{
+  NMTTools_PaveFiller::Clear();
+}
+//=======================================================================
+//function : StopStatus
+//purpose  : 
+//=======================================================================
+  Standard_Integer NMTTools_CheckerSI::StopStatus()const
+{
+  return myStopStatus;
+}
+//=======================================================================
+//function : Init
+//purpose  : 
+//=======================================================================
+  void NMTTools_CheckerSI::Init()
+{
+  myIsDone=Standard_False;
+  if (myCompositeShape.IsNull()) {
+    return;
+  }
+  //
+  Clear();
+  // 1.
+  myDS=new NMTDS_ShapesDataStructure;
+  myDS->SetCompositeShape(myCompositeShape);
+  myDS->Init();
+  //
+  // 2.
+  myDSIt=new NMTDS_IteratorCheckerSI;
+  myDSIt->SetDS(myDS);
+  myDSIt->Prepare();
+  //
+  // 4.
+  myNbSources=myDS->NumberOfShapesOfTheObject()+
+              myDS->NumberOfShapesOfTheTool();
+  myNbEdges=myDS->NbEdges();
+  // 5
+  myIP=new NMTDS_InterfPool;
+}
+//=======================================================================
+//function : Perform
+//purpose  : 
+//=======================================================================
+  void NMTTools_CheckerSI::Perform()
+{
+  myIsDone=Standard_False;
+  myStopStatus=0;
+  //
+  Init();
+  //1.VV
+  //
+  PerformVV();
+  //
+  // 2.VE
+  myPavePool.Resize (myNbEdges);
+
+  PrepareEdges();
+  //
+  PerformVE();
+  //
+  // 3.VF
+  PerformVF();
+  //
+  // 4.EE
+  myCommonBlockPool.Resize (myNbEdges);
+  mySplitShapesPool.Resize (myNbEdges);
+  myPavePoolNew    .Resize (myNbEdges);
+  //
+  PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
+  if (myStopStatus) {
+    return;
+  }
+  PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
+  if (myStopStatus) {
+    return;
+  }
+  //
+  PerformEE();
+  //
+  RefinePavePool ();
+  if (myStopStatus) {
+    return;
+  }
+  //
+  myPavePoolNew.Destroy();
+  myPavePoolNew.Resize (myNbEdges);
+  //
+  // 5.EF
+  PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
+  if (myStopStatus) {
+    return;
+  }
+  //
+  PerformEF();
+  //
+  RefinePavePool();
+  if (myStopStatus) {
+    return;
+  }
+  //
+  myPavePoolNew.Destroy();
+  //
+  MakeSplitEdges();
+  //
+  UpdateCommonBlocks();
+  //
+  // 6. FF
+  PerformFF ();
+  //
+  MakeBlocks();
+  //
+  MakePCurves();
+  //
+  // 7. Postprocessing 
+  UpdatePaveBlocks();
+  //
+  NMTTools_DEProcessor aDEP(*this);
+  aDEP.Do();
+  //
+  MakeAloneVertices();
+  //
+  myIsDone=Standard_True;
+}
diff --git a/src/NMTTools/NMTTools_CheckerSI.hxx b/src/NMTTools/NMTTools_CheckerSI.hxx
new file mode 100644 (file)
index 0000000..4aacb49
--- /dev/null
@@ -0,0 +1,118 @@
+// 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
+
+#ifndef _NMTTools_CheckerSI_HeaderFile
+#define _NMTTools_CheckerSI_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _NMTTools_PaveFiller_HeaderFile
+#include <NMTTools_PaveFiller.hxx>
+#endif
+#ifndef _TopAbs_ShapeEnum_HeaderFile
+#include <TopAbs_ShapeEnum.hxx>
+#endif
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTTools_CheckerSI  : public NMTTools_PaveFiller {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT NMTTools_CheckerSI();
+Standard_EXPORT virtual ~NMTTools_CheckerSI();
+
+
+Standard_EXPORT virtual  void Perform() ;
+
+
+Standard_EXPORT   Standard_Integer StopStatus() const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+Standard_EXPORT virtual  void Init() ;
+
+
+Standard_EXPORT virtual  void Clear() ;
+
+
+Standard_EXPORT virtual  void PreparePaveBlocks(const Standard_Integer nE) ;
+
+
+Standard_EXPORT virtual  void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ;
+
+
+ // Fields PROTECTED
+ //
+Standard_Integer myStopStatus;
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTTools/NMTTools_CheckerSI.ixx b/src/NMTTools/NMTTools_CheckerSI.ixx
new file mode 100644 (file)
index 0000000..5d3e020
--- /dev/null
@@ -0,0 +1,24 @@
+// 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
+
+#include <NMTTools_CheckerSI.jxx>
+
+
+
diff --git a/src/NMTTools/NMTTools_CheckerSI.jxx b/src/NMTTools/NMTTools_CheckerSI.jxx
new file mode 100644 (file)
index 0000000..68bdc30
--- /dev/null
@@ -0,0 +1,22 @@
+// 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
+
+#ifndef _NMTTools_CheckerSI_HeaderFile
+#include <NMTTools_CheckerSI.hxx>
+#endif
diff --git a/src/NMTTools/NMTTools_CheckerSI_1.cxx b/src/NMTTools/NMTTools_CheckerSI_1.cxx
new file mode 100755 (executable)
index 0000000..36ab867
--- /dev/null
@@ -0,0 +1,160 @@
+// Copyright (C) 2006 SAMTECH
+// 
+// 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:       NMTTools_CheckerSI.cxx
+// Created:    Mon Feb 19 11:32:08 2007
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTTools_CheckerSI.ixx>
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_IteratorCheckerSI.hxx>
+
+#include <NMTDS_InterfPool.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <BOPTools_ListOfPaveBlock.hxx>
+#include <TopoDS.hxx>
+#include <BRep_Tool.hxx>
+#include <BOPTools_PaveSet.hxx>
+#include <BOPTools_PaveBlockIterator.hxx>
+#include <BOPTools_PaveBlock.hxx>
+#include <IntTools_Range.hxx>
+#include <BOPTools_Pave.hxx>
+#include <IntTools_ShrunkRange.hxx>
+#include <BOPTColStd_Failure.hxx>
+#include <BOPTColStd_Dump.hxx>
+#include <Geom_Curve.hxx>
+#include <gp_Pnt.hxx>
+
+
+
+static
+  Standard_Boolean IsValid(const TopoDS_Edge& aE,
+                          const TopoDS_Vertex& aV,
+                          const Standard_Real aTV1,
+                          const Standard_Real aTV2);
+
+//=======================================================================
+// function: PreparePaveBlocks
+// purpose: 
+//=======================================================================
+  void NMTTools_CheckerSI::PreparePaveBlocks(const TopAbs_ShapeEnum aType1, 
+                                            const TopAbs_ShapeEnum aType2)
+{
+  NMTTools_PaveFiller::PreparePaveBlocks(aType1, aType2);
+}
+//=======================================================================
+// function: PreparePaveBlocks
+// purpose: 
+//=======================================================================
+  void NMTTools_CheckerSI::PreparePaveBlocks(const Standard_Integer nE)
+{
+  myIsDone=Standard_False;
+  //
+  char buf[32]={"SR"};
+  Standard_Boolean bIsValid;
+  Standard_Integer nV1, nV2, iErr;
+  Standard_Real aT1, aT2;
+  TopoDS_Edge aE;
+  TopoDS_Vertex aV1, aV2;
+  //
+  BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
+  // Edge 
+  aE=TopoDS::Edge(myDS->Shape(nE));
+  if (BRep_Tool::Degenerated(aE)) {
+    myIsDone=Standard_True;
+    return;
+  }
+  //
+  BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
+  
+  BOPTools_PaveBlockIterator aPBIt(nE, aPS);
+  for (; aPBIt.More(); aPBIt.Next()) {
+    BOPTools_PaveBlock& aPB=aPBIt.Value();
+    const IntTools_Range& aRange=aPB.Range();
+    //
+    const BOPTools_Pave& aPave1=aPB.Pave1();
+    nV1=aPave1.Index();
+    aV1=TopoDS::Vertex(myDS->Shape(nV1));
+    aT1=aPave1.Param();
+    //
+    const BOPTools_Pave& aPave2=aPB.Pave2();
+    nV2=aPave2.Index();
+    aV2=TopoDS::Vertex(myDS->Shape(nV2)); 
+    aT2=aPave2.Param();
+    //
+    bIsValid=Standard_True;
+    if (nV1==nV2) {
+      bIsValid=IsValid(aE, aV1, aT1, aT2);
+      if (!bIsValid) {
+       //printf(" pb SR: nV    nE: %d  nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
+       myStopStatus=1;
+      }
+    }
+    //
+    IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
+    iErr=aSR.ErrorStatus();
+    if (!aSR.IsDone()) {
+      //printf(" pb SR: Done  nE: %d  nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
+      aSR.SetShrunkRange(aRange);
+      //throw BOPTColStd_Failure(buf) ;
+    }
+    else if (iErr!=6) {
+      CorrectShrunkRanges (0, aPave1, aSR);
+      CorrectShrunkRanges (1, aPave2, aSR);
+    }
+    aPB.SetShrunkRange(aSR);
+    aLPB.Append(aPB);
+  } //for (; aPBIt.More(); aPBIt.Next()) 
+  myIsDone=Standard_True;
+}
+
+//=======================================================================
+//function : IsValid
+//purpose  : 
+//=======================================================================
+Standard_Boolean IsValid(const TopoDS_Edge& aE,
+                        const TopoDS_Vertex& aV,
+                        const Standard_Real aTV1,
+                        const Standard_Real aTV2)
+{
+  Standard_Boolean bRet;
+  Standard_Integer i, aNbP, aNbP1;
+  Standard_Real aTolV2, aTC1, aTC2, dT, aTC, aD2;
+  Handle(Geom_Curve) aC;
+  gp_Pnt aPV, aPC;
+  //
+  bRet=Standard_False;
+  aTolV2=BRep_Tool::Tolerance(aV);
+  aTolV2=aTolV2*aTolV2;
+  aPV=BRep_Tool::Pnt(aV);
+  aC=BRep_Tool::Curve(aE, aTC1, aTC2);
+  aNbP=7;
+  aNbP1=aNbP-1;
+  dT=(aTV2-aTV1)/aNbP1;
+  //
+  for (i=1; i<aNbP-1 && !bRet ; ++i) {
+    aTC=aTV1+dT*i;
+    aC->D0(aTC, aPC);
+    aD2=aPV.SquareDistance(aPC);
+    bRet=aD2>aTolV2;
+  }
+  return bRet;
+}
index 9c5f860f5fca955c6cf1ba8dc0f371ed0fbe8e5a..0933b0104516cb8ef58776ecc00a8dba94345d70 100644 (file)
@@ -74,7 +74,7 @@
 #include <BOPTools_PavePool.hxx>
 #include <BOPTools_PaveSet.hxx>
 #include <BOPTools_Tools3D.hxx>
-#include <BOPTools_InterferencePool.hxx>
+
 #include <BOPTools_CArray1OfSSInterference.hxx>
 #include <BOPTools_SplitShapesPool.hxx>
 
@@ -90,7 +90,7 @@
 #include <ElCLib.hxx>
 #include <gp_Lin2d.hxx>
 
-
+#include <NMTDS_InterfPool.hxx>
 
 //=======================================================================
 // function: NMTTools_DEProcessor::NMTTools_DEProcessor
   void NMTTools_DEProcessor::DoPaves()
 {
 
-  Standard_Integer i, aNbE, nED, nVD, nFD, aNbLPB;
+  Standard_Integer i, aNbE, nED, nVD, aNbLPB, nFD;
   //
   nFD=0;
   aNbE=myDEMap.Extent();
     TColStd_ListIteratorOfListOfInteger anIt(nLF);
     for (; anIt.More(); anIt.Next()) {
       nFD=anIt.Value();
-      //
+      
       BOPTools_ListOfPaveBlock aLPB;
       FindPaveBlocks(nED, nVD, nFD, aLPB);
-      //modified by NIZNHY-PKV Fri Mar 23 10:35:27 2007f
-      //
+      // xxf
       aNbLPB=aLPB.Extent();
       if (!aNbLPB) {
        continue;
       }
-      //modified by NIZNHY-PKV Fri Mar 23 10:35:33 2007t
+      //xxt
       FillPaveSet (nED, nVD, nFD, aLPB);
     }
     // 
   BOPTools_ListIteratorOfListOfPaveBlock anIt;
   Standard_Integer i, aNb, nF2, nV;
   //
-  BOPTools_CArray1OfSSInterference& aFFs=(myFiller->InterfPool())->SSInterferences();
+  //BOPTools_CArray1OfSSInterference& aFFs=(myFiller->InterfPool())->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=(myFiller->IP())->SSInterferences();
   //
   aNb=aFFs.Extent();
   for (i=1; i<=aNb; ++i) {
index 3cee74a1a95e9f2609fe5abc39b36c3567e89d44..19340bc8c10860baadcac84c2234737503a0ac05 100644 (file)
@@ -28,19 +28,18 @@ class PaveFiller from NMTTools
        ---Purpose: 
 
 uses   
-    -- Modified to add new definitions Thu Sep 14 14:35:18 2006 
-    -- Contribution of Samtech www.samcef.com BEGIN   
-    ListOfInteger from TColStd, 
-    -- Contribution of Samtech www.samcef.com END 
     DataMapOfIntegerInteger from TColStd,
     Pnt from gp,
     ShapeEnum  from  TopAbs, 
     Vertex     from  TopoDS, 
     Face       from  TopoDS,  
+    Shape      from TopoDS, 
     -- Modified to add new definitions Thu Sep 14 14:35:18 2006 
     -- Contribution of Samtech www.samcef.com BEGIN 
     Edge       from  TopoDS, 
-    ListOfShape from TopTools, 
+    ListOfShape from TopTools,  
+    DataMapOfShapeShape from TopTools,
+    ListOfInteger from TColStd,  
     -- Contribution of Samtech www.samcef.com END 
     
     Context     from IntTools, 
@@ -48,8 +47,8 @@ uses
     
     IndexedDataMapOfShapeInteger from BooleanOperations, 
     
-    InterferencePool  from BOPTools,
-    PInterferencePool from BOPTools, 
+    --InterferencePool  from BOPTools,
+    --PInterferencePool from BOPTools, 
     PavePool          from BOPTools, 
     PaveBlock         from BOPTools,
     ListOfPaveBlock   from BOPTools,
@@ -66,48 +65,77 @@ uses
     CommonBlockPool         from NMTTools, 
     CommonBlock             from NMTTools, 
     ListOfCommonBlock       from NMTTools, 
-    -- Modified to add new definitions Thu Sep 14 14:35:18 2006 
-    -- Contribution of Samtech www.samcef.com BEGIN
-    IndexedDataMapOfIndexedMapOfInteger from NMTTools,  
-    -- Contribution of Samtech www.samcef.com END
+   
     ShapesDataStructure  from NMTDS,  
+
     -- Modified to add new definitions Thu Sep 14 14:35:18 2006 
     -- Contribution of Samtech www.samcef.com BEGIN
     PShapesDataStructure from NMTDS, 
-    Iterator             from NMTDS 
+    Iterator             from NMTDS, 
+    IndexedDataMapOfIndexedMapOfInteger from NMTTools,  
     -- Contribution of Samtech www.samcef.com END
+     
+    PIterator from NMTDS, 
+    PInterfPool from NMTDS
 
 --raises
 
 is 
     Create 
-       returns PaveFiller from NMTTools; 
+       returns PaveFiller from NMTTools;  
+    ---C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller();"
       
-    Create(aIP:InterferencePool from BOPTools)
-       returns PaveFiller from NMTTools; 
+   -- Create(aIP:InterferencePool from BOPTools)
+    -- returns PaveFiller from NMTTools; 
      
-    Destroy (me: in out) 
-       is  virtual;    
-    ---C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}"
+   -- Destroy (me: in out) 
+       --is  virtual;    
+    --  -C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}"
     -- 
     --  Selectors/Modifiers
-    SetInterferencePool(me:out; 
-           aIP:InterferencePool from BOPTools);
-    
-    InterfPool(me:out) 
-       returns PInterferencePool from BOPTools; 
+    --SetInterferencePool(me:out; 
+    --     aIP:PInterferencePool from BOPTools);
+     
+    SetCompositeShape (me:out;  
+           aS:  Shape from TopoDS);  
+     
+    CompositeShape(me) 
+       returns  Shape from TopoDS; 
+       ---C++:  return  const&  
+       
+    --InterfPool(me:out) 
+       --returns PInterferencePool from BOPTools; 
+
+    --SetDS(me:out; 
+       --    aDS:PShapesDataStructure from NMTDS);  
+            
+    DS(me:out) 
+       returns PShapesDataStructure from NMTDS;  
+     
+    --SetDSIt(me:out; 
+       --      aIt:PIterator from NMTDS); 
+        
+    DSIt(me:out) 
+       returns PIterator from NMTDS; 
+     
+    IP(me:out)  
+       returns PInterfPool from NMTDS; 
     --  
     --  Perform the algo  
     -- Modified to add new method Thu Sep 14 14:35:18 2006 
     -- Contribution of Samtech www.samcef.com BEGIN      
-    Init       (me:out); 
+    Init       (me:out) 
+       is virtual  protected; 
     -- Contribution of Samtech www.samcef.com END
         
+    Clear   (me:out) 
+       is virtual  protected;
+
     Perform    (me:out) 
        is virtual;   
         
     PerformVV  (me:out) 
-       is virtual ;  
+       is virtual protected;  
      
     PerformVE  (me:out) 
        is virtual protected; 
@@ -142,28 +170,25 @@ is
            anE:Integer from Standard) 
        is virtual protected;             
                       
-    PerformNewVertices  (me:out) 
-       is virtual ;  
+    --PerformNewVertices  (me:out) 
+       --is virtual;  
      
     PrepareEdges  (me:out) 
        is virtual protected;  
      
-    SortTypes      (me;   
-           anInd1:in out Integer from Standard; 
-            anInd2:in out Integer from Standard) 
-       is protected; 
+    --SortTypes      (me;   
+    --     anInd1:in out Integer from Standard; 
+    --        anInd2:in out Integer from Standard) 
+    -- is protected; 
      
-    ExpectedPoolLength(me) 
-       returns  Integer from Standard 
-       is protected;  
+    --ExpectedPoolLength(me) 
+    -- returns  Integer from Standard 
+       --is protected;  
     --
     -- Query section 
     IsDone(me) 
        returns  Boolean from Standard; 
 
-    DS(me:out) 
-       returns PShapesDataStructure from NMTDS;  
-        
     Context(me) 
         returns Context from IntTools; 
        ---C++:return const &   
@@ -200,7 +225,7 @@ is
                    nV:  Integer  from  Standard) 
        returns Integer from Standard; 
 
-    IsSuccesstorsComputed (me;  
+    IsSuccessorsComputed (me;  
            iF1:Integer from  Standard; 
            iF2:Integer from  Standard) 
        returns  Boolean from Standard 
@@ -500,18 +525,17 @@ is
                 aLSE :out ListOfShape   from TopTools); 
     -- Contribution of Samtech www.samcef.com END 
 
+    FuseVertices(me; 
+       aC:Shape from TopoDS; 
+       aDMVV:  out  DataMapOfShapeShape from TopTools);  
+     
 fields 
-    myIntrPool         :  PInterferencePool from BOPTools      is protected; 
+    --myIntrPool         :  PInterferencePool from BOPTools            is protected; 
     myDS               :  PShapesDataStructure from NMTDS      is protected;   
     myIsDone           :  Boolean from Standard                 is protected; 
     myNbSources        :  Integer from Standard                 is protected;  
     myNbEdges          :  Integer from Standard                is protected;  
 
-    -- Modified to add new field Thu Sep 14 14:35:18 2006 
-    -- Contribution of Samtech www.samcef.com BEGIN     
-    myDSIt             :  Iterator from NMTDS is protected; 
-    -- Contribution of Samtech www.samcef.com END 
-     
     myPavePool         :  PavePool from BOPTools                is protected;     
     myPavePoolNew      :  PavePool from BOPTools                is protected;  
     myCommonBlockPool  :  CommonBlockPool from NMTTools         is protected;  
@@ -520,7 +544,10 @@ fields
     myContext          :  Context from IntTools                 is protected; 
     mySectionAttribute :  SSIntersectionAttribute from BOPTools is protected; 
     myAloneVertices    :  IndexedDataMapOfIndexedMapOfInteger from NMTTools is protected;   
-    --
-    myVSD              :  DataMapOfIntegerInteger from TColStd is protected;
-    --
+    --modified by NIZNHY-PKV Wed Oct 11 11:06:50 2006f
+    myVSD              :  DataMapOfIntegerInteger from TColStd is protected; 
+    myDSIt             :  PIterator from NMTDS is protected;  
+    myCompositeShape   :  Shape from TopoDS is protected;
+    myIP               :  PInterfPool from NMTDS is protected;     
+    --modified by NIZNHY-PKV Wed Oct 11 11:06:55 2006t 
 end PaveFiller;
index 9c76d8910d5521a1ec049e919fec55635afa35f3..236a077dcc04ffb74213b12b852a20c02c23f412 100644 (file)
 #include <BOPTColStd_Failure.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
 #include <NMTTools_DEProcessor.hxx>
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_InterfPool.hxx>
 
-//
 //=======================================================================
 // function: NMTTools_PaveFiller::NMTTools_PaveFiller
 // purpose: 
 //=======================================================================
   NMTTools_PaveFiller::NMTTools_PaveFiller()
 {
-  myIntrPool=NULL;
   myDS=NULL;
+  myDSIt=NULL;
   myIsDone=Standard_False;
   myNbSources=0;
   myNbEdges=0;
+  myIP=NULL;
 }
 //=======================================================================
-// function:NMTTools_PaveFiller::NMTTools_PaveFiller
+// function: ~
 // purpose: 
 //=======================================================================
-  NMTTools_PaveFiller::NMTTools_PaveFiller(const BOPTools_InterferencePool& aIP)
+  NMTTools_PaveFiller::~NMTTools_PaveFiller()
 {
-  SetInterferencePool(aIP);
+  Clear();
 }
 //=======================================================================
-// function: Destroy
+// function: Clear
 // purpose: 
 //=======================================================================
-  void NMTTools_PaveFiller::Destroy()
+  void NMTTools_PaveFiller::Clear()
 {
+  if (myDSIt) {
+    delete myDSIt;
+  } 
+  if (myDS) {
+    delete myDS;
+  }
+  myDSIt=NULL;
+  myDS=NULL;
+  
+  if (myIP) {
+    delete myIP;
+  }
+  myIP=NULL;
 }
 //=======================================================================
-// function: SetInterferencePool
+// function: SetCompositeShape
 // purpose: 
 //=======================================================================
-  void NMTTools_PaveFiller::SetInterferencePool(const BOPTools_InterferencePool& aIP)
+  void NMTTools_PaveFiller::SetCompositeShape(const TopoDS_Shape& aS)
 {
-  myIsDone=Standard_False;
-  //
-  myIntrPool=(BOPTools_InterferencePool*)&aIP;
-  myDS=(NMTDS_ShapesDataStructure*)myIntrPool->DS();
-  myNbSources=myDS->NumberOfShapesOfTheObject()+myDS->NumberOfShapesOfTheTool();
-  myNbEdges=myDS->NbEdges();
+  myCompositeShape=aS;
 }
 //=======================================================================
-// function:  InterfPool
+// function: CompositeShape
 // purpose: 
 //=======================================================================
-  BOPTools_PInterferencePool NMTTools_PaveFiller::InterfPool()
+  const TopoDS_Shape& NMTTools_PaveFiller::CompositeShape()const
 {
-  return myIntrPool;
+  return myCompositeShape;
 }
 //=======================================================================
-// function:IsDone
+// function:  DS
 // purpose: 
 //=======================================================================
-  Standard_Boolean NMTTools_PaveFiller::IsDone() const
+  NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
 {
-  return myIsDone;
+  return myDS;
 }
 //=======================================================================
-// function:  DS
+// function: DSIt
 // purpose: 
 //=======================================================================
-  NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
+  NMTDS_PIterator NMTTools_PaveFiller::DSIt()
 {
-  return myDS;
+  return myDSIt;
+}
+//=======================================================================
+// function:  IP
+// purpose: 
+//=======================================================================
+  NMTDS_PInterfPool NMTTools_PaveFiller::IP()
+{
+  return myIP;
+}
+//=======================================================================
+// function:IsDone
+// purpose: 
+//=======================================================================
+  Standard_Boolean NMTTools_PaveFiller::IsDone() const
+{
+  return myIsDone;
 }
 //=======================================================================
 // function: Context
 {
   return mySplitShapesPool;
 }
-
 //=======================================================================
 // function:  ChangeSplitShapesPool
 // purpose: 
 //=======================================================================
   void NMTTools_PaveFiller::Init()
 {
-  myDSIt.SetDS(myDS);
-  // Modified Thu Sep 14 14:35:18 2006 
-  // Contribution of Samtech www.samcef.com BEGIN
-  myDSIt.Prepare();
-  // Contribution of Samtech www.samcef.com END 
+  myIsDone=Standard_False;
+  if (myCompositeShape.IsNull()) {
+    return;
+  }
+  //
+  Clear();
+  // 1.
+  myDS=new NMTDS_ShapesDataStructure;
+  myDS->SetCompositeShape(myCompositeShape);
+  myDS->Init();
+  //
+  // 2.
+  myDSIt=new NMTDS_Iterator;
+  myDSIt->SetDS(myDS);
+  myDSIt->Prepare();
+  //
+  // 3.
+  myNbSources=myDS->NumberOfShapesOfTheObject()+
+              myDS->NumberOfShapesOfTheTool();
+  myNbEdges=myDS->NbEdges();
+  //
+  // 4
+  myIP=new NMTDS_InterfPool;
 }
 
 //=======================================================================
 {
   myIsDone=Standard_False;
   //
+  //----------------
   try {
     // 0.
     // Modified Thu Sep 14 14:35:18 2006 
     //1.VV
     //
     PerformVV();
-    PerformNewVertices();
     //
     // 2.VE
     myPavePool.Resize (myNbEdges);
     //
     // 5.EF
     PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
-
     PerformEF();
     //
     RefinePavePool();
index ab479896eadc3f6bb9333ee7df0a48b2822e1273..2d6492a3f72ff818809f93445920e5b3c2f33d27 100644 (file)
@@ -20,9 +20,6 @@
 #ifndef _NMTTools_PaveFiller_HeaderFile
 #define _NMTTools_PaveFiller_HeaderFile
 
-#ifndef _BOPTools_PInterferencePool_HeaderFile
-#include <BOPTools_PInterferencePool.hxx>
-#endif
 #ifndef _NMTDS_PShapesDataStructure_HeaderFile
 #include <NMTDS_PShapesDataStructure.hxx>
 #endif
@@ -32,9 +29,6 @@
 #ifndef _Standard_Integer_HeaderFile
 #include <Standard_Integer.hxx>
 #endif
-#ifndef _NMTDS_Iterator_HeaderFile
-#include <NMTDS_Iterator.hxx>
-#endif
 #ifndef _BOPTools_PavePool_HeaderFile
 #include <BOPTools_PavePool.hxx>
 #endif
 #ifndef _TColStd_DataMapOfIntegerInteger_HeaderFile
 #include <TColStd_DataMapOfIntegerInteger.hxx>
 #endif
+#ifndef _NMTDS_PIterator_HeaderFile
+#include <NMTDS_PIterator.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _NMTDS_PInterfPool_HeaderFile
+#include <NMTDS_PInterfPool.hxx>
+#endif
 #ifndef _TopAbs_ShapeEnum_HeaderFile
 #include <TopAbs_ShapeEnum.hxx>
 #endif
 #ifndef _Standard_Real_HeaderFile
 #include <Standard_Real.hxx>
 #endif
-class BOPTools_InterferencePool;
+class TopoDS_Shape;
 class BOPTools_Pave;
 class IntTools_ShrunkRange;
 class IntTools_Context;
@@ -86,6 +89,7 @@ class gp_Pnt;
 class NMTTools_IndexedDataMapOfIndexedMapOfInteger;
 class TopTools_ListOfShape;
 class TopoDS_Edge;
+class TopTools_DataMapOfShapeShape;
 
 
 #ifndef _Standard_HeaderFile
@@ -117,39 +121,30 @@ public:
 
 
 Standard_EXPORT NMTTools_PaveFiller();
+Standard_EXPORT virtual ~NMTTools_PaveFiller();
 
 
-Standard_EXPORT NMTTools_PaveFiller(const BOPTools_InterferencePool& aIP);
+Standard_EXPORT   void SetCompositeShape(const TopoDS_Shape& aS) ;
 
 
-Standard_EXPORT virtual  void Destroy() ;
-Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}
+Standard_EXPORT  const TopoDS_Shape& CompositeShape() const;
 
 
-Standard_EXPORT   void SetInterferencePool(const BOPTools_InterferencePool& aIP) ;
+Standard_EXPORT   NMTDS_PShapesDataStructure DS() ;
 
 
-Standard_EXPORT   BOPTools_PInterferencePool InterfPool() ;
+Standard_EXPORT   NMTDS_PIterator DSIt() ;
 
 
-Standard_EXPORT   void Init() ;
+Standard_EXPORT   NMTDS_PInterfPool IP() ;
 
 
 Standard_EXPORT virtual  void Perform() ;
 
 
-Standard_EXPORT virtual  void PerformVV() ;
-
-
-Standard_EXPORT virtual  void PerformNewVertices() ;
-
-
 Standard_EXPORT   Standard_Boolean IsDone() const;
 
 
-Standard_EXPORT   NMTDS_PShapesDataStructure DS() ;
-
-
 Standard_EXPORT  const IntTools_Context& Context() const;
 
 
@@ -285,6 +280,9 @@ Standard_EXPORT   Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlo
 Standard_EXPORT   void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ;
 
 
+Standard_EXPORT   void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const;
+
+
 
 
 
@@ -294,6 +292,15 @@ protected:
  // 
 
 
+Standard_EXPORT virtual  void Init() ;
+
+
+Standard_EXPORT virtual  void Clear() ;
+
+
+Standard_EXPORT virtual  void PerformVV() ;
+
+
 Standard_EXPORT virtual  void PerformVE() ;
 
 
@@ -324,13 +331,7 @@ Standard_EXPORT virtual  void PreparePaveBlocks(const Standard_Integer anE) ;
 Standard_EXPORT virtual  void PrepareEdges() ;
 
 
-Standard_EXPORT   void SortTypes(Standard_Integer& anInd1,Standard_Integer& anInd2) const;
-
-
-Standard_EXPORT   Standard_Integer ExpectedPoolLength() const;
-
-
-Standard_EXPORT   Standard_Boolean IsSuccesstorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const;
+Standard_EXPORT   Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const;
 
 
 Standard_EXPORT   Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const;
@@ -392,12 +393,10 @@ Standard_EXPORT   void MakeAloneVertices() ;
 
  // Fields PROTECTED
  //
-BOPTools_PInterferencePool myIntrPool;
 NMTDS_PShapesDataStructure myDS;
 Standard_Boolean myIsDone;
 Standard_Integer myNbSources;
 Standard_Integer myNbEdges;
-NMTDS_Iterator myDSIt;
 BOPTools_PavePool myPavePool;
 BOPTools_PavePool myPavePoolNew;
 NMTTools_CommonBlockPool myCommonBlockPool;
@@ -406,6 +405,9 @@ IntTools_Context myContext;
 BOPTools_SSIntersectionAttribute mySectionAttribute;
 NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices;
 TColStd_DataMapOfIntegerInteger myVSD;
+NMTDS_PIterator myDSIt;
+TopoDS_Shape myCompositeShape;
+NMTDS_PInterfPool myIP;
 
 
 private: 
index 0e63c963e9a887f232637aadd31255d811433980..1c7e98a59ac4ee6869c377404e9bcc2cee9b7cf0 100644 (file)
@@ -17,8 +17,8 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
-#ifndef _BOPTools_InterferencePool_HeaderFile
-#include <BOPTools_InterferencePool.hxx>
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
 #endif
 #ifndef _BOPTools_Pave_HeaderFile
 #include <BOPTools_Pave.hxx>
@@ -89,6 +89,9 @@
 #ifndef _TopoDS_Edge_HeaderFile
 #include <TopoDS_Edge.hxx>
 #endif
+#ifndef _TopTools_DataMapOfShapeShape_HeaderFile
+#include <TopTools_DataMapOfShapeShape.hxx>
+#endif
 #ifndef _NMTTools_PaveFiller_HeaderFile
 #include <NMTTools_PaveFiller.hxx>
 #endif
index e64607d3e8d06880a03ab2e469d38f0fc55da724..6a355d3df5941f0bf7b39139b0f722df8ff41435 100644 (file)
@@ -1,65 +1,70 @@
 // 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
 //
-// File:       NMTTools_PaveFiller_1.cxx
-// Created:    Mon Dec  8 11:47:55 2003
+// File:       NMTTools_PaveFiller_0.cxx
+// Created:    Mon Dec  8 11:45:51 2003
 // Author:     Peter KURNEV
 //             <pkv@irinox>
 
+
 #include <NMTTools_PaveFiller.ixx>
 
+#include <TColStd_IndexedMapOfInteger.hxx>
 #include <TopAbs_ShapeEnum.hxx>
-#include <BOPTools_ListOfCoupleOfInteger.hxx>
+
+#include <NMTDS_InterfPool.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
-#include <BooleanOperations_OnceExplorer.hxx>
+#include <NMTDS_Iterator.hxx>
 
 //=======================================================================
-//function : SortTypes
-//purpose  
+// function:IsSuccesstorsComputed
+// purpose
 //=======================================================================
-  void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
-                                     Standard_Integer& theWith)const 
-{ 
-  Standard_Boolean aReverseFlag=Standard_True;
-
-  TopAbs_ShapeEnum aType1= myDS->GetShapeType(theWhat),
-                   aType2= myDS->GetShapeType(theWith);
-  
-  if (aType1==aType2)
-    return;
-  
-  if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE){
-    aReverseFlag=Standard_False;
+  Standard_Boolean NMTTools_PaveFiller::IsSuccessorsComputed(const Standard_Integer aN1,
+                                                            const Standard_Integer aN2)const
+{
+  Standard_Boolean bComputed;
+  Standard_Integer i, nSuc, n1, n2, ntmp, aNbS;
+  TopAbs_ShapeEnum aType;
+  TColStd_IndexedMapOfInteger aMSuc;
+  //
+  n1=aN1;
+  n2=aN2;
+  aType=myDS->GetShapeType(aN1);
+  if (aType!=TopAbs_VERTEX) {
+    ntmp=n1;
+    n1=n2;
+    n2=ntmp;
   }
-
-  if (aType1==TopAbs_VERTEX && 
-      (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
-    aReverseFlag=Standard_False;
+  //
+  myDS->GetAllSuccessors(n2, aMSuc);
+  aNbS=aMSuc.Extent();
+  for (i=1; i<=aNbS; ++i) {
+    nSuc=aMSuc(i);
+    bComputed=myIP->Contains(n1, nSuc); 
+    if (bComputed) {
+      break;
+    }
   }
-  
-  Standard_Integer aWhat, aWith;
-  aWhat=(aReverseFlag) ? theWith : theWhat;
-  aWith=(aReverseFlag) ? theWhat : theWith;
-  
-  theWhat=aWhat;
-  theWith=aWith;
+  return bComputed;
 }
+/*
 //=======================================================================
 // function:  ExpectedPoolLength
 // purpose: 
@@ -72,7 +77,7 @@
   // Contribution of Samtech www.samcef.com BEGIN
   //const BOPTools_ListOfCoupleOfInteger& aLC=myDSIt.ListOfCouple();
   //aNbIIs=aLC.Extent();
-  aNbIIs=myDSIt.ExpectedLength();
+  aNbIIs=myDSIt->ExpectedLength();
   // Contribution of Samtech www.samcef.com END
   //
   if (aNbIIs==1) {
   
   return aNbIIs;
 }
+*/
+/*
 //=======================================================================
-// function:IsSuccesstorsComputed
-// purpose
+//function : SortTypes
+//purpose  
 //=======================================================================
-  Standard_Boolean NMTTools_PaveFiller::IsSuccesstorsComputed(const Standard_Integer aN1,
-                                                             const Standard_Integer aN2)const
-{
-  Standard_Integer nSuc, n1, n2;
-
-  BooleanOperations_OnceExplorer aExp(*myDS);
-  TopAbs_ShapeEnum aType=myDS->GetShapeType(aN1);
-
-  n1=aN1;
-  n2=aN2;
-
-  if (aType!=TopAbs_VERTEX) {
-    Standard_Integer ntmp=n1;
-    n1=n2;
-    n2=ntmp;
+  void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
+                                     Standard_Integer& theWith)const 
+{ 
+  Standard_Integer aWhat, aWith;
+  Standard_Boolean aReverseFlag;
+  TopAbs_ShapeEnum aType1, aType2;
+  //
+  aType1= myDS->GetShapeType(theWhat),
+  aType2= myDS->GetShapeType(theWith);
+  //
+  if (aType1==aType2) {
+    return;
   }
-
-  aType=myDS->GetShapeType(n2);
-  if (aType==TopAbs_EDGE) {
-    aExp.Init(n2, TopAbs_VERTEX);
-    for (; aExp.More(); aExp.Next()) {
-      nSuc=aExp.Current();
-      if (myIntrPool->IsComputed(n1, nSuc)) {
-       return Standard_True;
-      }
-    }
-  return Standard_False;
+  //
+  aReverseFlag=Standard_True;
+  if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE) {
+    aReverseFlag=Standard_False;
   }
-
-  else if (aType==TopAbs_FACE) {
-    aExp.Init(n2, TopAbs_VERTEX);
-    for (; aExp.More(); aExp.Next()) {
-      nSuc=aExp.Current();
-      if (myIntrPool->IsComputed(n1, nSuc)) {
-       return Standard_True;
-      }
-    }
-
-    aExp.Init(n2, TopAbs_EDGE);
-    for (; aExp.More(); aExp.Next()) {
-      nSuc=aExp.Current();
-      if (myIntrPool->IsComputed(n1, nSuc)) {
-       return Standard_True;
-      }
-    }
-    return Standard_False;
+  if (aType1==TopAbs_VERTEX && 
+      (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
+    aReverseFlag=Standard_False;
   }
-
-  return Standard_False;
+  //
+  aWhat=(aReverseFlag) ? theWith : theWhat;
+  aWith=(aReverseFlag) ? theWhat : theWith;
+  //
+  theWhat=aWhat;
+  theWith=aWith;
 }
+*/
index 086e395f62558fe2439f360edf19111e6cadd809..d4cca964a85ebc0394ca9af5e4aa3e80aff7d60d 100644 (file)
 // Created:    Mon Dec  8 11:47:55 2003
 // Author:     Peter KURNEV
 //             <pkv@irinox>
+
 #include <NMTTools_PaveFiller.ixx>
 
 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
 #include <TColStd_ListOfInteger.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
-  
+
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Vertex.hxx>
 #include <TopTools_ListOfShape.hxx>
 
 #include <IntTools_Tools.hxx>
+#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
 #include <BOPTools_VVInterference.hxx>
 #include <BOPTools_CArray1OfVVInterference.hxx>
-#include <BOPTools_VVInterference.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
 
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_InterfPool.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
+
 #include <NMTTools_Tools.hxx>
 
 //=======================================================================
 {
   myIsDone=Standard_False;
   //
-  Standard_Integer anIndexIn, aWhat, aWith, aNbVVs, aBlockLength, aNbVSD; 
-  Standard_Integer nVnew;
+  Standard_Integer aNbVVs, aBL, aNbVSD, nVnew, i, j, n1, n2;
   TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
-  TColStd_ListIteratorOfListOfInteger aIt;
+  TColStd_ListIteratorOfListOfInteger aItX, aItY;
+  TColStd_ListOfInteger aLIX;
   TopTools_ListOfShape aLV;
   TopoDS_Vertex aVnew;
-  TopoDS_Shape aS;
   //
   myVSD.Clear();
   //
-  BOPTools_CArray1OfVVInterference& aVVs=myIntrPool->VVInterferences();
-  //
-  // BlockLength correction
-  aNbVVs=ExpectedPoolLength();
-  aBlockLength=aVVs.BlockLength();
-  if (aNbVVs > aBlockLength) {
-    aVVs.SetBlockLength(aNbVVs);
-  }
-  //
-  const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt.SDVertices();
+  const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt->SDVertices();
   aNbVSD=aMVSD.Extent();
   if (!aNbVSD) {
     return;
   }
   //
+  BOPTools_CArray1OfVVInterference& aVVs=myIP->VVInterferences();
+  //
+  // BlockLength correction
+  myDSIt->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
+  aNbVVs=myDSIt->BlockLength();
+  aBL=aVVs.BlockLength();
+  if (aNbVVs > aBL) {
+    aVVs.SetBlockLength(aNbVVs);
+  }
+  //
   aIt1.Initialize(aMVSD);
   for (; aIt1.More(); aIt1.Next()) {
     aLV.Clear();
     //
-    aWhat=aIt1.Key();
+    n1=aIt1.Key();
     const TColStd_ListOfInteger& aLIV=aIt1.Value();
     //
     // new vertex
-    aIt.Initialize(aLIV);
-    for (; aIt.More(); aIt.Next()) {
-      aWith=aIt.Value();
-      aS=myDS->Shape(aWith);
-      aLV.Append(aS);
+    const TopoDS_Shape& aS1=myDS->Shape(n1);
+    aLV.Append(aS1);
+    aItX.Initialize(aLIV);
+    for (; aItX.More(); aItX.Next()) {
+      n2=aItX.Value();
+      const TopoDS_Shape& aS2=myDS->Shape(n2);
+      aLV.Append(aS2);
     }
-    aS=myDS->Shape(aWhat);
-    aLV.Append(aS);
     //
     NMTTools_Tools::MakeNewVertex(aLV, aVnew);
     //
     nVnew=myDS->NumberOfInsertedShapes();
     myDS->SetState (nVnew, BooleanOperations_ON);
     //
+    // myVSD, aLIX
+    aLIX.Clear();
+    aLIX.Append(n1);
+    myVSD.Bind(n1, nVnew);
+    //
+    aItX.Initialize(aLIV);
+    for (; aItX.More(); aItX.Next()) {
+      n2=aItX.Value();
+      aLIX.Append(n2);
+      myVSD.Bind(n2, nVnew);
+    }
+    //
     // interferences
-    aIt.Initialize(aLIV);
-    for (; aIt.More(); aIt.Next()) {
-      aWith=aIt.Value();
-      BOPTools_VVInterference aVV(aWhat, aWith);
-      aVV.SetNewShape(nVnew);
-      anIndexIn=aVVs.Append(aVV);
-      myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexVertex, anIndexIn);
-      //
-      // to find SD-Vertices
-      myVSD.Bind(aWith, nVnew);
+    aItX.Initialize(aLIX);
+    for (i=0; aItX.More(); aItX.Next(), ++i) {
+      aItY.Initialize(aLIX);
+      for (j=0; aItY.More(); aItY.Next(), ++j) {
+       if (j>i) {
+         n1=aItX.Value();
+         n2=aItY.Value();
+         myIP->Add(n1, n2, Standard_True, NMTDS_TI_VV);
+         //
+         BOPTools_VVInterference aVV(n1, n2);
+         aVV.SetNewShape(nVnew);
+         aVVs.Append(aVV);    
+       }
+      }
     }
-     myVSD.Bind(aWhat, nVnew);
   }//for (; aIt1.More(); aIt1.Next()) {
   myIsDone=Standard_True;
 }
 //=======================================================================
-// function: PerformNewVertices
-// purpose: 
-//=======================================================================
-  void NMTTools_PaveFiller::PerformNewVertices() 
-{
-}
-//=======================================================================
 // function: FindSDVertex
 // purpose: 
 //=======================================================================
   }
   return nVSD;
 }
+/*
+//=======================================================================
+// function: PerformNewVertices
+// purpose: 
+//=======================================================================
+  void NMTTools_PaveFiller::PerformNewVertices() 
+{
+}
+*/
index 8febb88c27ef7462923e935df9f2e2ccb307d637..4c3c9ed33f0360fed3ab019a5ac993936a4c3f01 100644 (file)
@@ -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
 #include <BOPTools_VEInterference.hxx>
 
 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
-
+#include <NMTDS_Iterator.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
 //
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
 #include <BOPTools_IndexedMapOfCoupleOfInteger.hxx>
 #include <BOPTools_CoupleOfInteger.hxx>
 #include <BooleanOperations_OnceExplorer.hxx>
-//
+
 
 static
   Standard_Boolean Contains(const TopoDS_Edge& aE,
                            const TopoDS_Vertex& aV);
 // Contribution of Samtech www.samcef.com END
+
+//=======================================================================
+// function: PerformVE
+// purpose: 
+//=======================================================================
+  void NMTTools_PaveFiller::PerformVE() 
+{
+  myIsDone=Standard_False;
+  //
+  Standard_Boolean bJustAdd;
+  Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVEs, aBlockLength, iSDV, nV1;
+  Standard_Real aT;
+  TopoDS_Vertex aV1;
+  TopoDS_Edge aE2;
+  BOPTools_IndexedMapOfCoupleOfInteger aSnareMap;
+  BOPTools_CoupleOfInteger aCouple;
+  //
+  BOPTools_CArray1OfVEInterference& aVEs=myIP->VEInterferences();
+  //
+  myDSIt->Initialize (TopAbs_VERTEX, TopAbs_EDGE);
+  //
+  // BlockLength correction
+  aNbVEs=myDSIt->BlockLength();
+  aBlockLength=aVEs.BlockLength();
+  if (aNbVEs > aBlockLength) {
+    aVEs.SetBlockLength(aNbVEs);
+  }
+  //
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, bJustAdd);
+    if (!IsSuccessorsComputed(n1, n2)) {
+      anIndexIn=0;
+      aWhat=n1; // Vertex
+      aWith=n2; // Edge
+      if (myDS->GetShapeType(n1)==TopAbs_EDGE) {
+       aWhat=n2;
+       aWith=n1;
+      }
+      //
+      if(bJustAdd) {
+       //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
+       continue;
+      }
+      // Edge
+      aE2=TopoDS::Edge(myDS->Shape(aWith));
+      if (BRep_Tool::Degenerated(aE2)){
+       continue;
+      }
+      // Vertex
+      nV1=aWhat;
+      aV1=TopoDS::Vertex(myDS->Shape(aWhat));
+      //
+      iSDV=FindSDVertex(aWhat);
+      if (iSDV) {
+       nV1=iSDV;
+       aV1=TopoDS::Vertex(myDS->Shape(nV1));
+       // Modified to find same domain vertex Thu Sep 14 14:35:18 2006 
+       // Contribution of Samtech www.samcef.com BEGIN
+       Standard_Integer nVE, iSDVE, iRet;
+       //
+       BooleanOperations_OnceExplorer aExp(*myDS);
+       iRet=0;
+       aExp.Init(aWith, TopAbs_VERTEX);
+       for (; aExp.More(); aExp.Next()) {
+         nVE=aExp.Current();
+         iSDVE=FindSDVertex(nVE);
+         if (iSDVE==iSDV) {
+           iRet=1;
+           break;
+         }
+       }
+       if (iRet) {
+         continue;
+       }
+      }
+      else {
+       if (Contains(aE2, aV1)) {
+         continue;
+       }
+       // Contribution of Samtech www.samcef.com END
+      }
+      //
+      aFlag=myContext.ComputeVE (aV1, aE2, aT);
+      //
+      if (!aFlag) {
+       // Add Interference to the Pool
+       BOPTools_VEInterference anInterf (aWhat, aWith, aT);
+       anIndexIn=aVEs.Append(anInterf);
+       //
+       // Add Pave to the Edge's myPavePool
+       aCouple.SetCouple(nV1, aWith);
+       if (!aSnareMap.Contains(aCouple)){
+         aSnareMap.Add(aCouple);
+         //
+         BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
+         aPave.SetInterference(anIndexIn);
+         BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
+         aPaveSet.Append(aPave);
+       }
+       //
+       // State for the Vertex in DS;
+       myDS->SetState (aWhat, BooleanOperations_ON);
+       // Insert Vertex in Interference Object
+       BOPTools_VEInterference& aVE=aVEs(anIndexIn);
+       aVE.SetNewShape(aWhat);
+       // qqf
+       {
+         myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VE);
+       }         
+       // qqt
+      }
+      //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
+    }
+  }
+  myIsDone=Standard_True;
+}
 //=======================================================================
 // function: PrepareEdges
 // purpose: 
@@ -106,116 +223,7 @@ static
     }
   }
 }
-//=======================================================================
-// function: PerformVE
-// purpose: 
-//=======================================================================
-  void NMTTools_PaveFiller::PerformVE() 
-{
-  myIsDone=Standard_False;
-  //
-  Standard_Boolean bJustAddInterference;
-  Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVEs, aBlockLength, iSDV, nV1;
-  Standard_Real aT;
-  TopoDS_Vertex aV1;
-  TopoDS_Edge aE2;
-  BOPTools_IndexedMapOfCoupleOfInteger aSnareMap;
-  BOPTools_CoupleOfInteger aCouple;
-  //
-  BOPTools_CArray1OfVEInterference& aVEs=myIntrPool->VEInterferences();
-  //
-  myDSIt.Initialize (TopAbs_VERTEX, TopAbs_EDGE);
-  //
-  // BlockLength correction
-  aNbVEs=ExpectedPoolLength();
-  aBlockLength=aVEs.BlockLength();
-  if (aNbVEs > aBlockLength) {
-    aVEs.SetBlockLength(aNbVEs);
-  }
-  //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, bJustAddInterference);
-    //
-    if (! myIntrPool->IsComputed(n1, n2)) {
-      if (! IsSuccesstorsComputed(n1, n2)) {
-       anIndexIn=0;
-       aWhat=n1; // Vertex
-       aWith=n2; // Edge
-       SortTypes(aWhat, aWith);
-       //
-       if(bJustAddInterference) {
-        myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
-        continue;
-       }
-       // Edge
-       aE2=TopoDS::Edge(myDS->Shape(aWith));
-       if (BRep_Tool::Degenerated(aE2)){
-         continue;
-       }
-       // Vertex
-       nV1=aWhat;
-       aV1=TopoDS::Vertex(myDS->Shape(aWhat));
-       //
-       iSDV=FindSDVertex(aWhat);
-       if (iSDV) {
-         nV1=iSDV;
-         aV1=TopoDS::Vertex(myDS->Shape(nV1));
-         // Modified to find same domain vertex Thu Sep 14 14:35:18 2006 
-         // Contribution of Samtech www.samcef.com BEGIN
-         Standard_Integer nVE, iSDVE, iRet;
-         //
-         BooleanOperations_OnceExplorer aExp(*myDS);
-         iRet=0;
-         aExp.Init(aWith, TopAbs_VERTEX);
-         for (; aExp.More(); aExp.Next()) {
-           nVE=aExp.Current();
-           iSDVE=FindSDVertex(nVE);
-           if (iSDVE==iSDV) {
-             iRet=1;
-             break;
-           }
-         }
-         if (iRet) {
-           continue;
-         }
-       }
-       else {
-         if (Contains(aE2, aV1)) {
-           continue;
-         }
-         // Contribution of Samtech www.samcef.com END
-       }
-       //
-       aFlag=myContext.ComputeVE (aV1, aE2, aT);
-       //
-       if (!aFlag) {
-         // Add Interference to the Pool
-         BOPTools_VEInterference anInterf (aWhat, aWith, aT);
-         anIndexIn=aVEs.Append(anInterf);
-         //
-         // Add Pave to the Edge's myPavePool
-         aCouple.SetCouple(nV1, aWith);
-         if (!aSnareMap.Contains(aCouple)){
-           aSnareMap.Add(aCouple);
-           //
-           BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
-           aPave.SetInterference(anIndexIn);
-           BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
-           aPaveSet.Append(aPave);
-         }
-         //
-         // State for the Vertex in DS;
-         myDS->SetState (aWhat, BooleanOperations_ON);
-         // Insert Vertex in Interference Object
-         BOPTools_VEInterference& aVE=aVEs(anIndexIn);
-         aVE.SetNewShape(aWhat);
-       }
-       myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
-      }
-    }
-  }
-  myIsDone=Standard_True;
-}
+
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
 //=======================================================================
index 7869f87d03432b566e38c77e2b68173b91c04658..ca458c3292f7e8918ef25abad89ede80a32b0f91 100644 (file)
@@ -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
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Face.hxx>
 
+#include <TopExp_Explorer.hxx>
+
 #include <BOPTools_VSInterference.hxx>
 #include <BOPTools_CArray1OfVSInterference.hxx>
 
+#include <NMTDS_Iterator.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
-#include <TopExp_Explorer.hxx>
+#include <NMTDS_InterfPool.hxx>
+
 
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
@@ -50,71 +54,76 @@ static
 {
   myIsDone=Standard_False;
   //
-  Standard_Boolean aJustAddInterference;
+  Standard_Boolean aJustAdd;
   Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVSs, aBlockLength, iSDV;
   Standard_Real aU, aV;
   TopoDS_Vertex aV1;
   TopoDS_Face aF2;
   //
-  BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences();
+  BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
   //
   // V/E Interferences 
-  myDSIt.Initialize(TopAbs_VERTEX, TopAbs_FACE);
+  myDSIt->Initialize(TopAbs_VERTEX, TopAbs_FACE);
   //
   // BlockLength correction
-  aNbVSs=ExpectedPoolLength();
+  aNbVSs=myDSIt->BlockLength();
   aBlockLength=aVSs.BlockLength();
   if (aNbVSs > aBlockLength) {
     aVSs.SetBlockLength(aNbVSs);
   }
   //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, aJustAddInterference);
-    //
-    if (! myIntrPool->IsComputed(n1, n2)) {
-      if (! IsSuccesstorsComputed(n1, n2)) {
-       anIndexIn=0;
-       aWhat=n1; // Vertex
-       aWith=n2; // Face
-       SortTypes(aWhat, aWith);
-       //
-       iSDV=FindSDVertex(aWhat);
-       //
-       if(aJustAddInterference) {
-         myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
-         continue;
-       }
-       //
-       aV1=TopoDS::Vertex(myDS->Shape(aWhat));
-       if (iSDV) {
-         aV1=TopoDS::Vertex(myDS->Shape(iSDV));
-       }
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, aJustAdd);
+    if (! IsSuccessorsComputed(n1, n2)) {
+      anIndexIn=0;
+      aWhat=n1; // Vertex
+      aWith=n2; // Face
+      if (myDS->GetShapeType(n1)==TopAbs_FACE) {
+       aWhat=n2;
+       aWith=n1;
+      }
+      //
+      iSDV=FindSDVertex(aWhat);
        //
-       aF2=TopoDS::Face(myDS->Shape(aWith));
+      if(aJustAdd) {
+       //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
+       continue;
+      }
+      //
+      aV1=TopoDS::Vertex(myDS->Shape(aWhat));
+      if (iSDV) {
+       aV1=TopoDS::Vertex(myDS->Shape(iSDV));
+      }
        //
-       // Modified  Thu Sep 14 14:35:18 2006 
-       // Contribution of Samtech www.samcef.com BEGIN
-       if (Contains(aF2, aV1)) {
-         continue;
-       }
-       // Contribution of Samtech www.samcef.com END
+      aF2=TopoDS::Face(myDS->Shape(aWith));
+      //
+      // Modified  Thu Sep 14 14:35:18 2006 
+      // Contribution of Samtech www.samcef.com BEGIN
+      if (Contains(aF2, aV1)) {
+       continue;
+      }
+      // Contribution of Samtech www.samcef.com END
+      //
+      aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
+      //
+      if (!aFlag) {
        //
-       aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
+       // Add Interference to the Pool
+       BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
+       anIndexIn=aVSs.Append(anInterf);
        //
-       if (!aFlag) {
-         //
-         // Add Interference to the Pool
-         BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
-         anIndexIn=aVSs.Append(anInterf);
-         //
-         // SetState for Vertex in DS;
-         myDS->SetState (aWhat, BooleanOperations_ON);
-         // Insert Vertex in Interference Object
-         BOPTools_VSInterference& aVS=aVSs(anIndexIn);
-         aVS.SetNewShape(aWhat);
+       // SetState for Vertex in DS;
+       myDS->SetState (aWhat, BooleanOperations_ON);
+       // Insert Vertex in Interference Object
+       BOPTools_VSInterference& aVS=aVSs(anIndexIn);
+       aVS.SetNewShape(aWhat);
+       // qqf
+       {
+         myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VF);
        }
-       myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
+       // qqt
       }
+      //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
     }
   }
   myIsDone=Standard_True;
index 3a9a1c5c9187b19370b1e59e163c7e43ccf73526..2c1d50e26251bb01820c5f7ea09065b805e1bf2e 100644 (file)
 #include <stdio.h>
 #include <Precision.hxx>
 
+#include <gp_XYZ.hxx>
+#include <gp_Pnt.hxx>
+#include <Bnd_Box.hxx>
+
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
 
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Compound.hxx>
 
 #include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
 
 #include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
+#include <BRepBndLib.hxx>
 
-#include <Bnd_Box.hxx>
+#include <BOPTColStd_Dump.hxx>
+#include <BOPTColStd_Failure.hxx>
 
 #include <IntTools_ShrunkRange.hxx>
 #include <IntTools_Range.hxx>
 #include <BOPTools_ListIteratorOfListOfPave.hxx>
 #include <BOPTools_SequenceOfPaveBlock.hxx>
 
-#include <BOPTColStd_Dump.hxx>
-#include <BOPTColStd_Failure.hxx>
-
 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
 #include <BooleanOperations_IndexedDataMapOfShapeInteger.hxx>
 #include <BooleanOperations_KindOfInterference.hxx>
 
+#include <NMTDS_Iterator.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
+#include <NMTDS_BoxBndTree.hxx>
+#include <NCollection_UBTreeFiller.hxx>
+#include <NMTDS_InterfPool.hxx>
 
 #include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
 #include <NMTTools_ListOfCommonBlock.hxx>
 #include <BOPTools_VSInterference.hxx>
 // Contribution of Samtech www.samcef.com END
 //
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <Bnd_HArray1OfBox.hxx>
-#include <Bnd_BoundSortBox.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
-#include <TopTools_DataMapOfShapeListOfShape.hxx>
-#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
-#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_DataMapOfShapeShape.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <gp_XYZ.hxx>
-#include <gp_Pnt.hxx>
-#include <BRep_Builder.hxx>
-#include <BRep_Tool.hxx>
-#include <TColStd_MapOfInteger.hxx>
 //
-#include <NMTDS_BoxBndTree.hxx>
-#include <NCollection_UBTreeFiller.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
 
 
 static
@@ -165,31 +158,30 @@ static
   BooleanOperations_IndexedDataMapOfShapeInteger aMapVI;
   BOPTools_IDMapOfPaveBlockIMapOfPaveBlock aMapCB;
   //
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
+  //
+  myDSIt->Initialize(TopAbs_EDGE, TopAbs_EDGE);
   //
   // BlockLength correction
-  aNbVEs=ExpectedPoolLength();
+  aNbVEs=myDSIt->BlockLength();
   aBlockLength=aEEs.BlockLength();
   if (aNbVEs > aBlockLength) {
     aEEs.SetBlockLength(aNbVEs);
   }
   //
-  myDSIt.Initialize(TopAbs_EDGE, TopAbs_EDGE);
-  //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, bJustAdd);
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, bJustAdd);
     anIndexIn = 0;
     //
-    if (myIntrPool->IsComputed(n1, n2)) {
-      continue;
-    }
+    //if (myIntrPool->IsComputed(n1, n2)) {
+    //  continue;
+    //}
     //
     nE1=n1; 
     nE2=n2; 
-    SortTypes(nE1, nE2);
     //
     if(bJustAdd) {
-      myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn);
+      //myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn);
       continue;
     }
     //
@@ -296,17 +288,68 @@ static
                bIsOnPave2=IsOnPave(aT2, aR2, aTol);
                //
                if(bIsOnPave1 || bIsOnPave2) {
-                 myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
-                 continue;
+                  continue;
                }
                //
                BOPTools_Tools::MakeNewVertex(aEWhat, aT1, aEWith, aT2, aNewVertex);
                //
+               //modified by NIZNHY-PKV Mon Jun 19 11:40:09 2007f
+               {
+                 Standard_Integer nV11, nV12, nV21, nV22, nVS[2], k, j, iFound;
+                 Standard_Real aTolVx, aTolVnew, aD2, aDT2;
+                 TColStd_MapOfInteger aMV;
+                 gp_Pnt aPnew, aPx;
+                 //
+                 iFound=0;
+                 j=-1;
+                 nV11=aPB1.Pave1().Index();
+                 nV12=aPB1.Pave2().Index();
+                 nV21=aPB2.Pave1().Index();
+                 nV22=aPB2.Pave2().Index();
+                 aMV.Add(nV11);
+                 aMV.Add(nV12);
+                 //
+                 if (aMV.Contains(nV21)) {
+                   ++j;
+                   nVS[j]=nV21;
+                 }
+                 if (aMV.Contains(nV22)) {
+                   ++j;
+                   nVS[j]=nV22;
+                 }
+                 //
+                 aTolVnew=BRep_Tool::Tolerance(aNewVertex);
+                 aPnew=BRep_Tool::Pnt(aNewVertex);
+                 //
+                 for (k=0; k<=j; ++k) {
+                   const TopoDS_Vertex& aVx=TopoDS::Vertex(myDS->Shape(nVS[k]));
+                   aTolVx=BRep_Tool::Tolerance(aVx);
+                   aPx=BRep_Tool::Pnt(aVx);
+                   aD2=aPnew.SquareDistance(aPx);
+                   //
+                   aDT2=100.*(aTolVnew+aTolVx)*(aTolVnew+aTolVx);
+                   //
+                   if (aD2<aDT2) {
+                     iFound=1;
+                     break;
+                   }
+                 }
+                 //
+                 if (iFound) {
+                   continue;
+                 }
+               }
+               //modified by NIZNHY-PKV Mon Jun 19 11:40:16 2007t
+               //
                // Add Interference to the Pool
                BOPTools_EEInterference anInterf (aWhat, aWith, aCPart);
                //
                anIndexIn=aEEs.Append(anInterf);
-               myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
+               // qqf
+               {
+                 myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
+               }
+               // qqt
                //
                // Collect
                aMapVI.Add(aNewVertex, anIndexIn);
@@ -321,7 +364,7 @@ static
                aCoinsideFlag=IsBlocksCoinside(aPB1, aPB2);
                //
                if (aNbComPrt2>1 || !aCoinsideFlag) {
-                 myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
+                 //myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
                  break;
                }
                //
@@ -349,6 +392,11 @@ static
                  aMapPB.Add(aPB2); 
                  aMapCB.Add(aPB2, aMapPB);
                }
+               // qqf
+               {
+                 myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
+               }
+               // qqt
              }
                break;
            default:
@@ -396,7 +444,7 @@ static
   TColStd_MapOfInteger aMFence;
   BOPTools_Pave aPave;
   //
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
   //
   aNb=aMapVI.Extent();
   if (!aNb) { // no new vertices, no new problems 
@@ -575,10 +623,7 @@ void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMap
     //...
     aNbIP=aMIPC.Extent();
     if (!aNbIP) {
-      //modified by NIZNHY-PKV Tue Jan  9 14:26:09 2007f
       aMIPC.Add(i);
-      //continue;
-      //modified by NIZNHY-PKV Tue Jan  9 14:26:12 2007t
     }
     //
     aIt1.Initialize(aMIPC);
@@ -698,7 +743,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
   BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;      
   BOPTools_Pave aPave;
   //
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
   //
   // one new vertex case is treated in usual way
   //
@@ -770,58 +815,43 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
 {
   myIsDone=Standard_False;
   //
-  Standard_Boolean Ok1, Ok2, Ok3;
-  Ok1= (aType1==TopAbs_VERTEX) &&  (aType2==TopAbs_EDGE) ;
-  Ok2= (aType1==TopAbs_EDGE)   &&  (aType2==TopAbs_EDGE) ;
-  Ok3= (aType1==TopAbs_EDGE)   &&  (aType2==TopAbs_FACE) ;
-  if (!Ok1 && !Ok2 && !Ok3) {
-    // error: Type mismatch
+  Standard_Boolean bOk1, bOk2, bOk3, bFlag;
+  Standard_Integer i, aNb, nE[2], n1, n2, aNbSplits;
+  TColStd_MapOfInteger aMap;
+  
+  bOk1= (aType1==TopAbs_VERTEX) &&  (aType2==TopAbs_EDGE) ;
+  bOk2= (aType1==TopAbs_EDGE)   &&  (aType2==TopAbs_EDGE) ;
+  bOk3= (aType1==TopAbs_EDGE)   &&  (aType2==TopAbs_FACE) ;
+  if (!bOk1 && !bOk2 && !bOk3) {// error: Type mismatch
     return;
   }
   //
-  Standard_Boolean aFlag = Standard_False;
-  Standard_Integer n1, n2, nE1, nE2, aNbSplits;
-  TColStd_MapOfInteger aMap;
-  //
-  myDSIt.Initialize(aType1, aType2);
+  aNb=bOk2 ? 2 : 1;
   //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, aFlag);
-    nE1=n1; 
-    nE2=n2; 
-    SortTypes(nE1, nE2);
+  myDSIt->Initialize(aType1, aType2);
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, bFlag);
     //
-    if (aType1==TopAbs_EDGE) {
-      BOPTools_ListOfPaveBlock& aLPB1=mySplitShapesPool(myDS->RefEdge(nE1));
-      aNbSplits=aLPB1.Extent();
-      if (!aNbSplits) {
-       if (!aMap.Contains(nE1)) { 
-         aMap.Add(nE1);
-         PreparePaveBlocks(nE1);
-         //
-         if (!myIsDone) {
-           return;
-         }
-       }
-      }
+    nE[0]=n1; 
+    nE[1]=n2; 
+    if (myDS->GetShapeType(n1)!=TopAbs_EDGE) {
+      nE[0]=n2; 
+      nE[1]=n1;
     }
     //
-    if (aType2==TopAbs_EDGE) {
-      BOPTools_ListOfPaveBlock& aLPB2=mySplitShapesPool(myDS->RefEdge(nE2));
-      aNbSplits=aLPB2.Extent();
+    for (i=0; i<aNb; ++i) {
+      BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE[i]));
+      aNbSplits=aLPB.Extent();
       if (!aNbSplits) {
-       if (!aMap.Contains(nE2)) { 
-         aMap.Add(nE2);
-         PreparePaveBlocks(nE2);
-         //
+       if (aMap.Add(nE[i])) { 
+         PreparePaveBlocks(nE[i]);
          if (!myIsDone) {
            return;
          }
        }
       }
-    }// if (aType2==TopAbs_EDGE)
+    }
   }// for (; myDSIt.More(); myDSIt.Next()) 
-
   myIsDone=Standard_True;
 }
 //=======================================================================
@@ -831,65 +861,60 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
   void NMTTools_PaveFiller::PreparePaveBlocks(const Standard_Integer nE)
 {
   myIsDone=Standard_False;
-  
-  Standard_Integer nV1, nV2;
-
+  //
+  char buf[512];
+  Standard_Integer nV1, nV2, iErr;
   TopoDS_Edge aE;
   TopoDS_Vertex aV1, aV2;
-    
-  // SplitShapesPool
+  //
   BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
   // Edge 
   aE=TopoDS::Edge(myDS->Shape(nE));
+  if (BRep_Tool::Degenerated(aE)) {
+    myIsDone=Standard_True;
+    return;
+  }
   //
-  if (!BRep_Tool::Degenerated(aE)){
+  BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
+  
+  BOPTools_PaveBlockIterator aPBIt(nE, aPS);
+  for (; aPBIt.More(); aPBIt.Next()) {
+    BOPTools_PaveBlock& aPB=aPBIt.Value();
+    const IntTools_Range& aRange=aPB.Range();
     //
-    BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
-    
-    BOPTools_PaveBlockIterator aPBIt(nE, aPS);
-    for (; aPBIt.More(); aPBIt.Next()) {
-      BOPTools_PaveBlock& aPB=aPBIt.Value();
-      
-      const IntTools_Range& aRange=aPB.Range();
-      
-      const BOPTools_Pave& aPave1=aPB.Pave1();
-      nV1=aPave1.Index();
-      aV1=TopoDS::Vertex(myDS->GetShape(nV1));
-      
-      const BOPTools_Pave& aPave2=aPB.Pave2();
-      nV2=aPave2.Index();
-      aV2=TopoDS::Vertex(myDS->GetShape(nV2));
-      //
-      // ShrunkRange
-      IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
-      //
-      Standard_Integer anErrorStatus;
-      anErrorStatus=aSR.ErrorStatus();
-
-      char buf[512];
-      if (!aSR.IsDone()) {
-       sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE);
-       BOPTColStd_Dump::PrintMessage(buf);
-       sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
-       throw 
-         BOPTColStd_Failure(buf) ;
-      }
-      //
-      if (anErrorStatus==6) {
-       sprintf(buf,
-               "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
-       BOPTColStd_Dump::PrintMessage(buf);
-      }
-      else {
-       // Check left paves and correct ShrunkRange if it is necessary
-       CorrectShrunkRanges (0, aPave1, aSR);
-       CorrectShrunkRanges (1, aPave2, aSR);
-      }
-      //
-      aPB.SetShrunkRange(aSR);
-      aLPB.Append(aPB);
-    } //for (; aPBIt1.More(); aPBIt1.Next()) 
-  }
+    const BOPTools_Pave& aPave1=aPB.Pave1();
+    nV1=aPave1.Index();
+    aV1=TopoDS::Vertex(myDS->GetShape(nV1));
+    //
+    const BOPTools_Pave& aPave2=aPB.Pave2();
+    nV2=aPave2.Index();
+    aV2=TopoDS::Vertex(myDS->GetShape(nV2));
+    //
+    // ShrunkRange
+    IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
+    iErr=aSR.ErrorStatus();
+    if (!aSR.IsDone()) {
+      sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE);
+      BOPTColStd_Dump::PrintMessage(buf);
+      sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
+      throw 
+       BOPTColStd_Failure(buf) ;
+    }
+    //
+    if (iErr==6) {
+      sprintf(buf,
+             "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
+      BOPTColStd_Dump::PrintMessage(buf);
+    }
+    else {
+      // Check left paves and correct ShrunkRange if it is necessary
+      CorrectShrunkRanges (0, aPave1, aSR);
+      CorrectShrunkRanges (1, aPave2, aSR);
+    }
+    //
+    aPB.SetShrunkRange(aSR);
+    aLPB.Append(aPB);
+  } //for (; aPBIt.More(); aPBIt.Next()) 
   myIsDone=Standard_True;
 }
 //=======================================================================
@@ -915,7 +940,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
     return;
   }
 
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
   const BOPTools_EEInterference& aEE=aEEs(anIndexInterf);
   const IntTools_CommonPrt& aCP=aEE.CommonPrt();
   const TopoDS_Edge& aE1=aCP.Edge1();
@@ -945,8 +970,10 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
       tNV=tV+aCoeff*(tNV-tV);
       aNewRange.SetFirst(tNV);
       aNewRange.SetLast (aSR.Last());
-
-      if(aNewRange.First() > aNewRange.Last()) {
+      //modified by NIZNHY-PKV Tue Jan 23 14:07:55 2007f
+      //if(aNewRange.First() > aNewRange.Last()) {
+      if(aNewRange.First() < aNewRange.Last()) {
+      //modified by NIZNHY-PKV Tue Jan 23 14:08:02 2007t
        aShrunkRange.SetShrunkRange(aNewRange);
       }
     }
@@ -1370,8 +1397,8 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB,
   TColStd_ListOfInteger aLFI;
   TColStd_ListIteratorOfListOfInteger aItLFI;
   //
-  BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences();
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+  BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
+  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
   //
   aNbS=myDS->NumberOfShapesOfTheObject();
   for (i=1; i<=aNbS; ++i) {
@@ -1427,213 +1454,3 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB,
   }
 } 
 // Contribution of Samtech www.samcef.com END
-/*
-//=======================================================================
-// function:EENewVertices
-// purpose: 
-//=======================================================================
-  void NMTTools_PaveFiller::EENewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI) 
-{
-  Standard_Integer aNb, i, j, aNewShape, aNbEdges, aNbIEE, aNbVV, aNbSimple;
-  Standard_Integer aWhat, aWith, i1, i2, nE1, nE2, nE, nV, aFlag;
-  Standard_Real aT;
-  TopoDS_Compound aCompound;
-  BRep_Builder aBB;
-  NMTTools_IndexedDataMapOfIndexedMapOfInteger aMNVE, aMNVIEE;
-  BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;      
-  BOPTools_Pave aPave;
-  TopoDS_Vertex aNewVertex;
-  TopTools_IndexedMapOfShape aMNVComplex, aMNVSimple;
-  //
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
-  //
-  aNb=aMapVI.Extent();
-  //
-  if (!aNb) { // no new vertices, no new problems 
-    return;
-  }
-  //
-  // 0. 
-  if (aNb==1) {
-    aNewVertex=TopoDS::Vertex(aMapVI.FindKey(1));
-    EENewVertices(aNewVertex, aMapVI);
-    return;
-  }
-  //
-  // 1. Make compound from new vertices
-  aBB.MakeCompound(aCompound);
-  for (i=1; i<=aNb; ++i) {
-    const TopoDS_Shape& aV=aMapVI.FindKey(i);
-    aBB.Add(aCompound, aV);
-  }
-  //
-  // 2. VV intersection between these vertices 
-  //       using the auxiliary Filler
-  NMTDS_ShapesDataStructure tDS;
-  //
-  tDS.SetCompositeShape(aCompound);
-  tDS.Init();
-  //
-  BOPTools_InterferencePool tInterfPool(tDS);
-  NMTTools_PaveFiller tPaveFiller(tInterfPool);
-  //
-  tPaveFiller.Init();
-  //
-  tPaveFiller.PerformVV();
-  tPaveFiller.PerformNewVertices();
-  //
-  const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
-  //
-  // 3. Separate Comlex and Simple new vertices
-  aNbVV=aVVInterfs.Extent();
-  for (i=1; i<=aNbVV; ++i) {
-    const BOPTools_VVInterference& aVV=aVVInterfs(i);
-    aVV.Indices(aWhat, aWith);
-    const TopoDS_Shape& aV1=tDS.Shape(aWhat);
-    const TopoDS_Shape& aV2=tDS.Shape(aWith);
-    aMNVComplex.Add(aV1);
-    aMNVComplex.Add(aV2);
-  }
-  //
-  for (i=1; i<=aNb; ++i) {
-    const TopoDS_Shape& aV=aMapVI.FindKey(i);
-    if (!aMNVComplex.Contains(aV)) {
-      aMNVSimple.Add(aV);
-    }
-  }
-  //
-  // 4. Treat Simple new Vertices
-  aNbSimple=aMNVSimple.Extent();
-  for (i=1; i<=aNbSimple; ++i) {
-    const TopoDS_Vertex& aV=TopoDS::Vertex(aMNVSimple(i));
-    EENewVertices(aV, aMapVI);
-  }
-  //
-  // 3. Fill Maps : NewVertex-edges (aMNVE) 
-  //                NewVertex-interferences (aMNVIEE)
-  for (i=1; i<=aNbVV; ++i) {
-    const BOPTools_VVInterference& aVV=aVVInterfs(i);
-    aNewShape=aVV.NewShape();
-    if (!aNewShape) {
-      continue;
-    }
-    //
-    if (!aMNVE.Contains(aNewShape)) {
-      TColStd_IndexedMapOfInteger aMx;
-      aMNVE.Add(aNewShape, aMx);
-    }
-    if (!aMNVIEE.Contains(aNewShape)) {
-      TColStd_IndexedMapOfInteger aMx;
-      aMNVIEE.Add(aNewShape, aMx);
-    }
-    //
-    TColStd_IndexedMapOfInteger& aME=aMNVE.ChangeFromKey(aNewShape);
-    TColStd_IndexedMapOfInteger& aMIEE=aMNVIEE.ChangeFromKey(aNewShape);
-    //
-    aVV.Indices(aWhat, aWith);
-    //aWhat
-    const TopoDS_Shape& aV1=tDS.Shape(aWhat);
-    i1=aMapVI.FindFromKey(aV1);
-    const BOPTools_EEInterference& aEE1=aEEs(i1);
-    aEE1.Indices(nE1, nE2);
-    aME.Add(nE1);
-    aME.Add(nE2);
-    aMIEE.Add(i1);
-    //aWith
-    const TopoDS_Shape& aV2=tDS.Shape(aWith);
-    i2=aMapVI.FindFromKey(aV2);
-    const BOPTools_EEInterference& aEE2=aEEs(i2);
-    aEE2.Indices(nE1, nE2);
-    aME.Add(nE1);
-    aME.Add(nE2);
-    aMIEE.Add(i2);
-    //
-    //printf(" VV: (%d, %d) -> %d\n", aWhat, aWith, aNewShape);
-  }
-  //
-  // 4. Process new vertices
-  aNb=aMNVE.Extent();
-  for (i=1; i<=aNb; ++i) { // xx
-    //
-    //  new Vertex
-    nV=aMNVE.FindKey(i);
-    aNewVertex=TopoDS::Vertex(tDS.Shape(nV));
-    //
-    // Insert New Vertex in DS;
-    myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
-    aNewShape=myDS->NumberOfInsertedShapes();
-    myDS->SetState (aNewShape, BooleanOperations_ON);
-    //
-    // Update index of NewShape in EE interferences
-    const TColStd_IndexedMapOfInteger& aMIEE=aMNVIEE.FindFromKey(nV);//(i);
-    aNbIEE=aMIEE.Extent();
-    for (j=1; j<=aNbIEE; ++j) {
-      i1=aMIEE(j);
-      BOPTools_EEInterference& aEE1=aEEs(i1);
-      aEE1.SetNewShape(aNewShape);
-    }
-    // 
-    // Update Paves on edges
-    const TColStd_IndexedMapOfInteger& aME=aMNVE(i);
-    aNbEdges=aME.Extent();
-    for (j=1; j<=aNbEdges; ++j) {
-      nE=aME(j);
-      const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv
-      //
-      aFlag=myContext.ComputeVE (aNewVertex, aE, aT);
-      //
-      if (!aFlag) {
-       aPave.SetInterference(-1);
-       aPave.SetType (BooleanOperations_EdgeEdge);
-       aPave.SetIndex(aNewShape);
-       aPave.SetParam(aT);
-       //
-       BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
-       aPaveSet.Append(aPave);
-      }
-    }
-  }// for (i=1; i<=aNb; ++i) {// xx
-}
-//=======================================================================
-// function:EENewVertices
-// purpose: 
-//=======================================================================
-  void NMTTools_PaveFiller::EENewVertices (const TopoDS_Vertex& aNewVertex,
-                                          const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI) 
-{
-  Standard_Integer  i, aNewShape, nE1, nE2;
-  Standard_Real  aT1, aT2;
-  BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;      
-  BOPTools_Pave aPave;
-  //
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
-  //
-  // one new vertex case is treated in usual way
-  //
-  // Insert New Vertex in DS;
-  myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
-  aNewShape=myDS->NumberOfInsertedShapes();
-  myDS->SetState (aNewShape, BooleanOperations_ON);
-  // Insert New Vertex in EE Interference
-  i=aMapVI.FindFromKey(aNewVertex);
-  BOPTools_EEInterference& aEEInterf= aEEs(i);
-  aEEInterf.SetNewShape(aNewShape);
-  // Extact interference info
-  aEEInterf.Indices(nE1, nE2);
-  const IntTools_CommonPrt& aCPart=aEEInterf.CommonPrt();
-  VertexParameters(aCPart, aT1, aT2);
-  //
-  // Add Paves to the myPavePoolNew
-  aPave.SetInterference(i);
-  aPave.SetType (BooleanOperations_EdgeEdge);
-  aPave.SetIndex(aNewShape);
-  // Pave for edge nE1
-  aPave.SetParam(aT1);
-  BOPTools_PaveSet& aPaveSet1=myPavePoolNew(myDS->RefEdge(nE1));
-  aPaveSet1.Append(aPave);
-  // Pave for edge nE2
-  aPave.SetParam(aT2);
-  BOPTools_PaveSet& aPaveSet2=myPavePoolNew(myDS->RefEdge(nE2));
-  aPaveSet2.Append(aPave);
-}
-*/
index 0c6dbab260a9233240bde2cb2dfdcff5980a92a0..01ec5e0bb346676c244a86f119f49fba88549ffc 100644 (file)
@@ -40,6 +40,8 @@
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Compound.hxx>
 
+#include <TopExp.hxx>
+
 #include <TopTools_IndexedMapOfShape.hxx>
 
 #include <IntTools_ShrunkRange.hxx>
@@ -63,7 +65,7 @@
 #include <BOPTools_ListOfPaveBlock.hxx>
 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
 #include <BOPTools_ESInterference.hxx>
-#include <BOPTools_InterferencePool.hxx>
+
 #include <BOPTools_CArray1OfVVInterference.hxx>
 #include <BOPTools_CArray1OfESInterference.hxx>
 #include <BOPTools_VVInterference.hxx>
 #include <BOPTools_IMapOfPaveBlock.hxx>
 
 #include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_InterfPool.hxx>
 
 #include <NMTTools_ListOfCommonBlock.hxx>
 #include <NMTTools_CommonBlockAPI.hxx>
 #include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
 #include <NMTTools_CommonBlockAPI.hxx>
 #include <NMTTools_ListOfCommonBlock.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopExp.hxx>
+
 
 static
   void VertexParameter(const IntTools_CommonPrt& aCPart,
@@ -105,28 +108,32 @@ static
   BOPTools_IDMapOfPaveBlockIMapOfInteger aMapCB;
   BOPTools_IMapOfPaveBlock aIMPBx;
   //
-  BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
+  BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
   //
-  myDSIt.Initialize(TopAbs_EDGE, TopAbs_FACE);
+  myDSIt->Initialize(TopAbs_EDGE, TopAbs_FACE);
   //
   // BlockLength correction
-  aNbEFs=ExpectedPoolLength();
+  aNbEFs=myDSIt->BlockLength();
   aBlockLength=aEFs.BlockLength();
   if (aNbEFs > aBlockLength) {
     aEFs.SetBlockLength(aNbEFs);
   }
   //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, bJustAdd);
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, bJustAdd);
     anIndexIn = 0;
     //
-    if (myIntrPool->IsComputed(n1, n2)) {
-      continue;
-    }
+    //if (myIntrPool->IsComputed(n1, n2)) {
+    //  continue;
+    //}
     //
     nE=n1; 
-    nF=n2; 
-    SortTypes(nE, nF);
+    nF=n2;
+    if (myDS->GetShapeType(n2)==TopAbs_EDGE) {
+      nE=n2; 
+      nF=n1;
+    }
+    //SortTypes(nE, nF);
     //
     // all Common Blocks for face nF
     //XXX
@@ -135,7 +142,7 @@ static
     NMTTools_CommonBlockAPI aCBAPIF(aLCBF);
     //XXX
     if(bJustAdd) {
-      myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
+      //myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
       continue;
     }
     // Edge
@@ -246,10 +253,15 @@ static
                  //
                  aMapVI.Add(aNewVertex, anIndexIn);
                  aIMPBx.Add(aPB);
+                 // qqf
+                 {
+                   myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
+                 }
+                 // qqt
                  //
                }// if (!nVF)
              }// if (!bIsOnPave1 && !bIsOnPave2) 
-             myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
+             //myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
            }// case TopAbs_VERTEX:
              break;
            //
@@ -258,7 +270,7 @@ static
              //
              aCoinsideFlag=BOPTools_Tools::IsBlockInOnFace(aPB, aF, myContext);
              if (!aCoinsideFlag) {
-               myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
+               //myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
                break;
              }
              //
@@ -272,9 +284,12 @@ static
                aMapF.Add(nF);
                aMapCB.Add(aPB, aMapF);
              }
-             //modified by NIZNHY-PKV Fri Jan 23 14:13:08 2004 f
              aIMPBx.Add(aPB);
-             //modified by NIZNHY-PKV Fri Jan 23 14:13:10 2004 t
+             // qqf
+             {
+               myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
+             }
+             // qqt
            }// case TopAbs_EDGE:
              break;
 
@@ -370,7 +385,7 @@ static
   void NMTTools_PaveFiller::EFNewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI) 
 {
   Standard_Integer i, j, aNb, aNewShape, aFlag, iX, aNbVV, aNbSimple;
-  Standard_Integer aWhat, aWith, nE, nF, nV, aNbIEF, aNbEdges;
+  Standard_Integer aWhat, aWith, nE, nF, nV, aNbIEF, aNbEdges, iTmp;
   Standard_Real aT;
   TopoDS_Compound aCompound;
   TopoDS_Vertex aNewVertex;
@@ -380,7 +395,7 @@ static
   BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
   TopTools_IndexedMapOfShape aMNVComplex, aMNVSimple;
   //
-  BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
+  BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
   //
   aNb=aMapVI.Extent();
   //
@@ -404,20 +419,19 @@ static
   //
   // 2. VV intersection between these vertices 
   //       using the auxiliary Filler
-  NMTDS_ShapesDataStructure tDS;
-  //
-  tDS.SetCompositeShape(aCompound);
-  tDS.Init();
-  //
-  BOPTools_InterferencePool tInterfPool(tDS);
-  NMTTools_PaveFiller tPaveFiller(tInterfPool);
+  NMTTools_PaveFiller tPF;
   //
-  tPaveFiller.Init();
+  tPF.SetCompositeShape(aCompound);
   //
-  tPaveFiller.PerformVV();
-  tPaveFiller.PerformNewVertices();
+  tPF.Init();
+  tPF.PerformVV();
+  //tPF.PerformNewVertices(); qq
   //
-  const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
+  NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
+  //const BOPTools_InterferencePool& tInterfPool=*(tPF.InterfPool());
+  NMTDS_InterfPool& tInterfPool=*(tPF.IP());
+  //const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
+  BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterferences();
   //
   // 3. Separate Comlex and Simple new vertices
   aNbVV=aVVInterfs.Extent();
@@ -472,7 +486,12 @@ static
     iX=aMapVI.FindFromKey(aV1);
     const BOPTools_ESInterference& aEF1=aEFs(iX);
     aEF1.Indices(nE, nF);
-    SortTypes(nE, nF);
+    //SortTypes(nE, nF);
+    if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
+      iTmp=nE;
+      nE=nF;
+      nF=iTmp;
+    }
     aME.Add(nE);
     aMIEF.Add(iX);
     //aWith
@@ -480,7 +499,12 @@ static
     iX=aMapVI.FindFromKey(aV2);
     const BOPTools_ESInterference& aEF2=aEFs(iX);
     aEF2.Indices(nE, nF);
-    SortTypes(nE, nF);
+    //SortTypes(nE, nF);
+    if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
+      iTmp=nE;
+      nE=nF;
+      nF=iTmp;
+    }
     aME.Add(nE);
     aMIEF.Add(iX);
   }
@@ -539,7 +563,7 @@ static
   BOPTools_Pave aPave;
   BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
   //
-  BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
+  BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
   //
   // Insert New Vertex in DS;
   myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
@@ -551,7 +575,10 @@ static
   aEFInterf.SetNewShape(aNewShape);
   // Extract interference info
   aEFInterf.Indices(nE, nF);
-  SortTypes(nE, nF);
+  //SortTypes(nE, nF);
+  if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
+    nE=nF;
+  }
   const IntTools_CommonPrt& aCPart=aEFInterf.CommonPrt();
   VertexParameter(aCPart, aT);
   //
index 298162362255814d0cf6c3d184a81ea3fb8dd0f1..90b631205ef0d6783a4fdd8d53c666afe7073424 100644 (file)
 
 #include <TColStd_IndexedMapOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
 
-#include <Geom2d_Curve.hxx>
 #include <Geom_TrimmedCurve.hxx>
-
+#include <Geom2d_TrimmedCurve.hxx>
+#include <Geom2d_Curve.hxx>
 #include <GeomAdaptor_Curve.hxx>
+
 #include <BndLib_Add3dCurve.hxx>
 
 #include <TopoDS_Face.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Compound.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
 
 #include <TopExp.hxx>
 
+#include <BRepLib.hxx>
 #include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
 #include <BRepBndLib.hxx>
 
 #include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
 
 #include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
 #include <BOPTColStd_IndexedDataMapOfIntegerInteger.hxx>
 #include <IntTools_SequenceOfCurves.hxx>
 #include <IntTools_FaceFace.hxx>
 #include <IntTools_Tools.hxx>
+#include <IntTools_ShrunkRange.hxx>
 
 #include <BOPTools_CArray1OfSSInterference.hxx>
-#include <BOPTools_ListIteratorOfListOfInterference.hxx>
-#include <BOPTools_CArray1OfInterferenceLine.hxx>
-#include <BOPTools_InterferenceLine.hxx>
-#include <BOPTools_ListOfInterference.hxx>
-#include <BOPTools_Interference.hxx>
-#include <BOPTools_InterferencePool.hxx>
+//#include <BOPTools_ListIteratorOfListOfInterference.hxx>
+//#include <BOPTools_CArray1OfInterferenceLine.hxx>
+//#include <BOPTools_InterferenceLine.hxx>
+//#include <BOPTools_ListOfInterference.hxx>
+//#include <BOPTools_Interference.hxx>
+
 #include <BOPTools_SSInterference.hxx>
 #include <BOPTools_ListOfPaveBlock.hxx>
 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
 #include <BOPTools_PaveBlockIterator.hxx>
 #include <BOPTools_Tools2D.hxx>
 
+#include <NMTDS_Iterator.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
+
+#include <NMTTools_Tools.hxx>
 #include <NMTTools_IndexedDataMapOfShapePaveBlock.hxx>
 #include <NMTTools_CommonBlockAPI.hxx>
-#include <Geom2d_Curve.hxx>
-#include <NMTTools_Tools.hxx>
-#include <BRepLib.hxx>
-#include <Geom2d_TrimmedCurve.hxx>
-//
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TColStd_ListOfInteger.hxx>
-////
 #include <NMTTools_DataMapOfIntegerListOfPaveBlock.hxx>
 #include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
+
 #include <NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock.hxx>
-#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <NMTTools_MapOfPaveBlock.hxx>
-//
-#include <IntTools_ShrunkRange.hxx>
-
-static 
-  Standard_Boolean IsPairFound(const Standard_Integer nF1,
-                              const Standard_Integer nF2,
-                              BOPTools_InterferencePool* myIntrPool,
-                              BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
-                              BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
-
-static
-  void FMapWhat(const Standard_Integer nF,
-               BOPTools_InterferencePool* myIntrPool,
-               TColStd_IndexedMapOfInteger& aMapWhat);
-static
-  void FMapWith(const Standard_Integer nF,
-               BOPTools_InterferencePool* myIntrPool,
-               TColStd_IndexedMapOfInteger& aMapWith);
-static
-  Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
-                          const TColStd_IndexedMapOfInteger& aMapWith);
 
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
@@ -137,9 +113,11 @@ static
                    TopTools_ListOfShape& aLS);
 // Contribution of Samtech www.samcef.com END
 
+//modified by NIZNHY-PKV Mon Dec  4 12:56:04 2006f
 static
   Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, 
                               IntTools_Context& aCtx);
+//modified by NIZNHY-PKV Mon Dec  4 12:56:08 2006t
 
 //=======================================================================
 // function: PerformFF
@@ -149,7 +127,7 @@ static
 {
   myIsDone=Standard_False;
   //
-  Standard_Boolean bIsFound, bJustAdd, bIsComputed;
+  Standard_Boolean bJustAdd;//, bIsComputed, bIsFound;
   Standard_Integer n1, n2, anIndexIn, nF1, nF2, aBlockLength, aNbFFs;
   Standard_Boolean bToApproxC3d, bToApproxC2dOnS1, bToApproxC2dOnS2, bIsDone;
   Standard_Integer aNbCurves, aNbPoints;
@@ -159,25 +137,25 @@ static
   IntTools_SequenceOfCurves aCvs;
   BooleanOperations_KindOfInterference aTypeFF=BooleanOperations_SurfaceSurface;
   //
-  BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
   //
   //  F/F Interferences  [BooleanOperations_SurfaceSurface]
-  myDSIt.Initialize(TopAbs_FACE, TopAbs_FACE);
+  myDSIt->Initialize(TopAbs_FACE, TopAbs_FACE);
   //
   // BlockLength correction
-  aNbFFs=ExpectedPoolLength();
+  aNbFFs=myDSIt->BlockLength();
   aBlockLength=aFFs.BlockLength();
   if (aNbFFs > aBlockLength) {
     aFFs.SetBlockLength(aNbFFs);
   }
   //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, bJustAdd);
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, bJustAdd);
     //
-    bIsComputed=myIntrPool->IsComputed(n1, n2);
-    if (bIsComputed) {
-      continue;
-    }
+    //bIsComputed=myIntrPool->IsComputed(n1, n2);
+    //if (bIsComputed) {
+    //  continue;
+    //}
     //
     nF1 = n2;
     nF2 = n1;
@@ -189,8 +167,8 @@ static
     aPnts.Clear();
     aCvs.Clear();
     //
+    /*
     bIsFound=IsPairFound(nF1, nF2, myIntrPool, aMapWhat, aMapWith);
-    //
     if (bJustAdd) {
       if (!bIsFound) {
        myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
@@ -202,6 +180,7 @@ static
       }
       continue;
     }
+    */
     //
     const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
     const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
@@ -222,7 +201,9 @@ static
     //
     bIsDone=aFF.IsDone();
     //
+
     if (!bIsDone) {
+      /*
       if (!bIsFound) {
        myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
       }
@@ -231,6 +212,7 @@ static
        anIndexIn=aFFs.Append(anInterf);
        myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
       }
+      */
       continue;
     }
     //
@@ -251,14 +233,14 @@ static
     if (!aNbCurves && !aNbPoints) {
       BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
       anIndexIn=aFFs.Append(anInterf);
-      myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
+      //myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
       continue;
     }
     //
     {
       BOPTools_SSInterference anInterf (nF1, nF2, aTolR3D, aTolR2D, aCvsX, aPntsX);
       anIndexIn=aFFs.Append(anInterf);
-      myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
+      //myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
     }
     //
   }// for (; myDSIt.More(); myDSIt.Next()) 
@@ -278,7 +260,7 @@ static
   Standard_Boolean bIsExistingPaveBlock, bIsValidIn2D, bIsCoincided;
   // Contribution of Samtech www.samcef.com END
   //
-  Standard_Boolean bIsMicroEdge;
+  Standard_Boolean bIsMicroEdge, bHasES;
   Standard_Integer i, aNbFFs, nF1, nF2, aBid=0;
   Standard_Integer nV1, nV2, j, aNbCurves;
   Standard_Real aTolR3D, aTol2D, aT1, aT2, aTolPPC=Precision::PConfusion();
@@ -286,7 +268,7 @@ static
   BooleanOperations_IndexedDataMapOfShapeInteger aMapEI;
   BOPTools_ListIteratorOfListOfPaveBlock anIt;  
   //
-  BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
   //
   aNbFFs=aFFs.Extent();
   //
@@ -375,11 +357,9 @@ static
   //
   // 1. Produce Section Edges from intersection curves
   //    between each pair of faces
-  //
   aNbFFs=aFFs.Extent();
   //
   for (i=1; i<=aNbFFs; ++i) {
-    
     BOPTools_SSInterference& aFFi=aFFs(i);
     // 
     // Faces
@@ -456,6 +436,7 @@ static
     }
     //
     //  Pave Blocks on Curves
+    bHasES=Standard_False;
     for (j=1; j<=aNbCurves; ++j) {
       BOPTools_Curve& aBC=aSCvs(j);
       const IntTools_Curve& aIC= aBC.Curve();
@@ -472,13 +453,12 @@ static
        nV2=aPBNew.Pave2().Index();
        aT1=aPBNew.Pave1().Param();
        aT2=aPBNew.Pave2().Param();
-       // ???
+       // 
        if((nV1==nV2) && (Abs(aT2 - aT1) < aTolPPC)) {
-         continue;// mkk ft
+         continue;// mkk ft ???
        }
        //
        // 1
-       
        bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLPB, aTolR3D);
        if (bIsExistingPaveBlock) {
          continue;
@@ -517,17 +497,13 @@ static
        //
        BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
        //
-       // use_01 f
-       //
        NMTTools_Tools::UpdateEdge (aES, aTolR3D);
        bIsMicroEdge=IsMicroEdge(aES, myContext);
        if (bIsMicroEdge) {
          continue;
        }
        //
-       //use_01 t
-       //
-       // SKL/PartC5 f
+       
        {
          Handle(Geom2d_Curve) aC2D1, aC2D2;
          //
@@ -536,14 +512,19 @@ static
          //
          NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
          NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
-         //SKL/PartC5 t 
        }
        //
        aMEPB.Add(aES, aPBNew);
        aMapEI.Add(aES, i);
-      }
-      
+       //
+       bHasES=Standard_True;
+      }// for (; aPBIter.More(); aPBIter.Next())
     } // end of for (j=1; j<=aNbCurves; ++j)
+    // qqf
+    if (bHasES) {
+      myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
+    }
+    // qqt
   }// for (i=1; i<=aNbFFs; ++i)
   //=============================================================
   //
@@ -572,18 +553,14 @@ static
   //
   //
   // 2. Intersect SE using auxiliary Filler
-  NMTDS_ShapesDataStructure tDS;
-  //
-  tDS.SetCompositeShape(aCompound);
-  tDS.Init();
+  NMTTools_PaveFiller tPF;
   //
-  BOPTools_InterferencePool tIP(tDS);
-  NMTTools_PaveFiller tPF(tIP);
+  tPF.SetCompositeShape(aCompound);
   //
   // 2.1.VV
   tPF.Init();
   tPF.PerformVV();
-  tPF.PerformNewVertices();
+  //tPF.PerformNewVertices(); qq
   //
   // 2.2.VE
   tPF.myPavePool.Resize (tPF.myNbEdges);
@@ -617,6 +594,7 @@ static
   BOPTools_ListIteratorOfListOfPaveBlock aIt;
   BOPTColStd_IndexedDataMapOfIntegerInteger aMNewOld;
   //
+  const NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
   const BOPTools_SplitShapesPool& aSSP=tPF.mySplitShapesPool;
   const NMTTools_CommonBlockPool& aCBP=tPF.myCommonBlockPool;
   //
@@ -743,11 +721,9 @@ static
        aF2FWD=aF2;
        aF2FWD.Orientation(TopAbs_FORWARD);
        //
-       // SKL/PartC5 f
        NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
        NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
        NMTTools_Tools::UpdateEdge (aEx, aTolEx);
-       //SKL/PartC5 t
       } //if (aCBAPI.IsCommonBlock(aPB))
       //
       // new SE
@@ -816,13 +792,13 @@ static
 {
   Standard_Integer i, aNb,  nF1, nF2, nE;
   Standard_Integer aNbCB, aNbF, nSp, nF;
+  TopAbs_ShapeEnum aType;
   TopoDS_Face aF1FWD, aF2FWD;
   TColStd_ListIteratorOfListOfInteger aItF;
   BOPTools_ListIteratorOfListOfPaveBlock anIt;
   NMTTools_ListIteratorOfListOfCommonBlock aItCB;
-  TopAbs_ShapeEnum aType;
   //
-  BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
   //
   aNb=aFFs.Extent();
   for (i=1; i<=aNb; i++) {
@@ -849,7 +825,7 @@ static
       BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
       BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
     }
-  }
+  } 
   //
   //modified by NIZNHY-PKV Fri Mar 23 10:35:02 2007f
   // Check common blocks between edges and faces
@@ -1211,122 +1187,8 @@ static
   }
 }
 /////////////
-//=======================================================================
-// function: IsPairFound
-// purpose: 
-//=======================================================================
-Standard_Boolean IsPairFound(const Standard_Integer nF1,
-                            const Standard_Integer nF2,
-                            BOPTools_InterferencePool* myIntrPool,
-                            BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
-                            BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
-{
-  Standard_Boolean bIsFound;
-  //
-  if (!aMapWhat.Contains(nF1)) {
-    TColStd_IndexedMapOfInteger aMWhat;
-    FMapWhat(nF1, myIntrPool, aMWhat);
-    aMapWhat.Add(nF1, aMWhat);
-  }
-  //
-  if (!aMapWith.Contains(nF2)) {
-    TColStd_IndexedMapOfInteger aMWith;
-    FMapWith(nF2, myIntrPool, aMWith);
-    aMapWith.Add(nF2, aMWith);
-  }
-  //
-  const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
-  const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
-  //
-  bIsFound=IsFound(aMWht, aMWit);
-  //
-  return bIsFound;
-}
-//=======================================================================
-// function: FMapWhat
-// purpose: 
-//=======================================================================
-void FMapWhat(const Standard_Integer nF,
-             BOPTools_InterferencePool* myIntrPool,
-             TColStd_IndexedMapOfInteger& aMapWhat)
-                   
-{
-  Standard_Integer nE, nV;
-  
 
-  BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
-  BooleanOperations_OnceExplorer aExp(*myDS);
-  //
-  //  What
-  aMapWhat.Add(nF);
-  aExp.Init(nF, TopAbs_VERTEX);
-  for (; aExp.More(); aExp.Next()) {
-    nV=aExp.Current();
-    aMapWhat.Add(nV);
-  }
-  //
-  aExp.Init(nF, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    nE=aExp.Current();
-    aMapWhat.Add(nE);
-  }
-}
-//=======================================================================
-// function: FMapWith
-// purpose: 
-//=======================================================================
-void FMapWith(const Standard_Integer nF,
-             BOPTools_InterferencePool* myIntrPool,
-             TColStd_IndexedMapOfInteger& aMapWith)
-{
-  TColStd_IndexedMapOfInteger aMapWhat;
-  
-  FMapWhat(nF, myIntrPool, aMapWhat);
-  //
-  // With
-  Standard_Integer i, aNb, anIndex, aWhat, aWith;
-  BOPTools_ListIteratorOfListOfInterference anIt;
-  
-  const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
 
-  aNb=aMapWhat.Extent();
-  for (i=1; i<=aNb; i++) {
-    aWhat=aMapWhat(i);
-    
-    const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
-  
-    const BOPTools_ListOfInterference& aLI=aWithLine.List();
-    anIt.Initialize(aLI);
-    for (; anIt.More(); anIt.Next()) {
-      const BOPTools_Interference& anIntf=anIt.Value();
-      anIndex=anIntf.Index();
-      if (anIndex) {
-       aWith=anIntf.With();
-       aMapWith.Add(aWith);
-      }
-    }
-  }
-}
-//=======================================================================
-// function: IsFound
-// purpose: 
-//=======================================================================
-Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
-                        const TColStd_IndexedMapOfInteger& aMapWith)
-{
-  Standard_Boolean bFlag=Standard_False;
-  Standard_Integer i, aNb, aWhat;
-
-  aNb=aMapWhat.Extent();
-  for (i=1; i<=aNb; i++) {
-    aWhat=aMapWhat(i);
-    if (aMapWith.Contains(aWhat)) {
-      return !bFlag;
-    }
-  }
-  return bFlag;
-}
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
 //=======================================================================
@@ -1475,7 +1337,7 @@ void SharedEdges1(const TopoDS_Face& aF1,
 //
 // Contribution of Samtech www.samcef.com END
 
-// use_01 f
+//modified by NIZNHY-PKV Mon Dec  4 12:30:38 2006f use_01
 //=======================================================================
 //function : IsMicroEdge
 //purpose  : 
@@ -1514,4 +1376,139 @@ Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
   //
   return bRet;
 }
-// use_01 t
+//modified by NIZNHY-PKV Mon Dec  4 12:55:50 2006t
+/*
+static 
+  Standard_Boolean IsPairFound(const Standard_Integer nF1,
+                              const Standard_Integer nF2,
+                              BOPTools_InterferencePool* myIntrPool,
+                              BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
+                              BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
+
+static
+  void FMapWhat(const Standard_Integer nF,
+               BOPTools_InterferencePool* myIntrPool,
+               TColStd_IndexedMapOfInteger& aMapWhat);
+static
+  void FMapWith(const Standard_Integer nF,
+               BOPTools_InterferencePool* myIntrPool,
+               TColStd_IndexedMapOfInteger& aMapWith);
+static
+  Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
+                          const TColStd_IndexedMapOfInteger& aMapWith);
+
+//=======================================================================
+// function: IsPairFound
+// purpose: 
+//=======================================================================
+Standard_Boolean IsPairFound(const Standard_Integer nF1,
+                            const Standard_Integer nF2,
+                            BOPTools_InterferencePool* myIntrPool,
+                            BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
+                            BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
+{
+  Standard_Boolean bIsFound;
+  //
+  if (!aMapWhat.Contains(nF1)) {
+    TColStd_IndexedMapOfInteger aMWhat;
+    FMapWhat(nF1, myIntrPool, aMWhat);
+    aMapWhat.Add(nF1, aMWhat);
+  }
+  //
+  if (!aMapWith.Contains(nF2)) {
+    TColStd_IndexedMapOfInteger aMWith;
+    FMapWith(nF2, myIntrPool, aMWith);
+    aMapWith.Add(nF2, aMWith);
+  }
+  //
+  const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
+  const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
+  //
+  bIsFound=IsFound(aMWht, aMWit);
+  //
+  return bIsFound;
+}
+//=======================================================================
+// function: FMapWhat
+// purpose: 
+//=======================================================================
+void FMapWhat(const Standard_Integer nF,
+             BOPTools_InterferencePool* myIntrPool,
+             TColStd_IndexedMapOfInteger& aMapWhat)
+                   
+{
+  Standard_Integer nE, nV;
+  //
+  BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
+  BooleanOperations_OnceExplorer aExp(*myDS);
+  //
+  //  What
+  aMapWhat.Add(nF);
+  aExp.Init(nF, TopAbs_VERTEX);
+  for (; aExp.More(); aExp.Next()) {
+    nV=aExp.Current();
+    aMapWhat.Add(nV);
+  }
+  //
+  aExp.Init(nF, TopAbs_EDGE);
+  for (; aExp.More(); aExp.Next()) {
+    nE=aExp.Current();
+    aMapWhat.Add(nE);
+  }
+}
+//=======================================================================
+// function: FMapWith
+// purpose: 
+//=======================================================================
+void FMapWith(const Standard_Integer nF,
+             BOPTools_InterferencePool* myIntrPool,
+             TColStd_IndexedMapOfInteger& aMapWith)
+{
+  TColStd_IndexedMapOfInteger aMapWhat;
+  
+  FMapWhat(nF, myIntrPool, aMapWhat);
+  //
+  // With
+  Standard_Integer i, aNb, anIndex, aWhat, aWith;
+  BOPTools_ListIteratorOfListOfInterference anIt;
+  
+  const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
+
+  aNb=aMapWhat.Extent();
+  for (i=1; i<=aNb; i++) {
+    aWhat=aMapWhat(i);
+    
+    const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
+  
+    const BOPTools_ListOfInterference& aLI=aWithLine.List();
+    anIt.Initialize(aLI);
+    for (; anIt.More(); anIt.Next()) {
+      const BOPTools_Interference& anIntf=anIt.Value();
+      anIndex=anIntf.Index();
+      if (anIndex) {
+       aWith=anIntf.With();
+       aMapWith.Add(aWith);
+      }
+    }
+  }
+}
+//=======================================================================
+// function: IsFound
+// purpose: 
+//=======================================================================
+Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
+                        const TColStd_IndexedMapOfInteger& aMapWith)
+{
+  Standard_Boolean bFlag=Standard_False;
+  Standard_Integer i, aNb, aWhat;
+
+  aNb=aMapWhat.Extent();
+  for (i=1; i<=aNb; i++) {
+    aWhat=aMapWhat(i);
+    if (aMapWith.Contains(aWhat)) {
+      return !bFlag;
+    }
+  }
+  return bFlag;
+}
+*/
index 30b69f3f02f5c69724f686f7048697776e7d7133..ef23a7e29b74b506cb1f636e75789390bf98ea37 100644 (file)
 
 #include <NMTTools_PaveFiller.ixx>
 
+#include <Bnd_HArray1OfBox.hxx>
+#include <Bnd_BoundSortBox.hxx>
+#include <Bnd_Box.hxx>
+#include <BRepBndLib.hxx>
+
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TopTools_DataMapOfShapeListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+
+#include <TopAbs_Orientation.hxx>
+
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Compound.hxx>
 
-#include <NMTDS_ShapesDataStructure.hxx>
-#include <TopAbs_Orientation.hxx>
-#include <BOPTools_ListOfPaveBlock.hxx>
-#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
-#include <BOPTools_PaveBlock.hxx>
-#include <BOPTools_Pave.hxx>
-#include <BOPTools_Tools.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfIntegerShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeInteger.hxx>
+#include <TopTools_DataMapOfShapeInteger.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
+#include <TopTools_DataMapOfShapeListOfInteger.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfInteger.hxx>
+#include <TopTools_DataMapOfIntegerShape.hxx>
+
+#include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
-#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
-#include <BOPTools_SSInterference.hxx>
-#include <BOPTools_CArray1OfSSInterference.hxx>
+
 #include <TopExp_Explorer.hxx>
-#include <TopoDS_Shape.hxx>
 #include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
 //
 #include <IntTools_SequenceOfPntOn2Faces.hxx>
 #include <IntTools_PntOnFace.hxx>
 #include <IntTools_PntOn2Faces.hxx>
-#include <BOPTools_Tools.hxx>
-#include <TopTools_DataMapOfShapeListOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TopoDS_Compound.hxx>
-#include <BRep_Builder.hxx>
+
+#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+
+#include <BOPTools_SSInterference.hxx>
+#include <BOPTools_CArray1OfSSInterference.hxx>
 #include <BOPTools_CArray1OfVVInterference.hxx>
 #include <BOPTools_VVInterference.hxx>
-#include <TopTools_DataMapOfShapeShape.hxx>
-#include <TopTools_DataMapOfShapeListOfInteger.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfInteger.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TopTools_DataMapOfIntegerShape.hxx>
-#include <Bnd_HArray1OfBox.hxx>
-#include <Bnd_BoundSortBox.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfIntegerShape.hxx>
-#include <TopTools_DataMapOfShapeInteger.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeInteger.hxx>
-#include <TopTools_DataMapOfShapeInteger.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+#include <BOPTools_Tools.hxx>
+#include <BOPTools_ListOfPaveBlock.hxx>
+#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
+#include <BOPTools_PaveBlock.hxx>
+#include <BOPTools_Pave.hxx>
+#include <BOPTools_Tools.hxx>
 
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
+
+#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
 static 
@@ -286,7 +293,7 @@ static
   BOPTools_Pave aPave1, aPave2;
   BOPTools_PaveBlock aPB;
   //
-  BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
   //
   aNbFFs=aFFs.Extent();
   for (i=1; i<=aNbFFs; ++i) {
@@ -371,7 +378,7 @@ static
   //
   myAloneVertices.Clear();
   //
-  BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
   //
   // 1. Collect alone vertices from FFs
   aNbV=0;
@@ -545,6 +552,50 @@ static
       }
     }
   }
+  // qqf
+  {
+    Standard_Integer aNbF, aNbAV, nF, k;
+    NMTTools_IndexedDataMapOfIndexedMapOfInteger aMAVF;
+    //
+    aNbF=myAloneVertices.Extent();
+    if (aNbF<2) {
+      return;
+    }
+    //
+    // 1. fill map Alone Vertex/Face ->  aMAVF
+    for (i=1; i<=aNbF; ++i) {
+      nF=myAloneVertices.FindKey(i);
+      const TColStd_IndexedMapOfInteger& aMAV=myAloneVertices(i);
+      aNbAV=aMAV.Extent();
+      for(j=1; j<=aNbAV; ++j) {
+       nV=aMAV(j);
+       if (aMAVF.Contains(nV)) {
+         TColStd_IndexedMapOfInteger& aMF=aMAVF.ChangeFromKey(nV);
+         aMF.Add(nF);
+       }
+       else{
+         TColStd_IndexedMapOfInteger aMF;
+         aMF.Add(nF);
+         aMAVF.Add(nV, aMF);
+       }
+      }
+    }
+    //
+    // 2 Obtain pairs of faces
+    aNbAV=aMAVF.Extent();
+    for (i=1; i<=aNbAV; ++i) {
+      const TColStd_IndexedMapOfInteger& aMF=aMAVF(i);
+      aNbF=aMF.Extent();
+      for(j=1; j<aNbF; ++j) {
+       nF1=aMF(j);
+       for(k=j+1; k<=aNbF; ++k) {
+         nF2=aMF(k);
+         myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
+       }
+      }
+    }
+  }
+  // qqt
 }
 //=======================================================================
 // function: AloneVertices
@@ -558,24 +609,22 @@ static
 // function: FuseVertices
 // purpose: 
 //=======================================================================
-void FuseVertices(const TopoDS_Shape& aCompound,
-                 TopTools_DataMapOfShapeShape& aDMVV)
+  void NMTTools_PaveFiller::FuseVertices(const TopoDS_Shape& aCompound,
+                                        TopTools_DataMapOfShapeShape& aDMVV)const
 {
   Standard_Integer i, aNbVV, n1, n2, nX;
-  NMTDS_ShapesDataStructure tDS;
-  //
-  tDS.SetCompositeShape(aCompound);
-  tDS.Init();
+  NMTTools_PaveFiller tPF;
   //
-  BOPTools_InterferencePool tInterfPool(tDS);
-  NMTTools_PaveFiller tPaveFiller(tInterfPool);
+  tPF.SetCompositeShape(aCompound);
   //
-  tPaveFiller.Init();
+  tPF.Init();
   //
-  tPaveFiller.PerformVV();
-  tPaveFiller.PerformNewVertices();
+  tPF.PerformVV();
+  //tPF.PerformNewVertices(); //qq
   //
-  const BOPTools_CArray1OfVVInterference& aVVt=tInterfPool.VVInterfs();
+  NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
+  NMTDS_InterfPool& tInterfPool=*(tPF.IP()); 
+  BOPTools_CArray1OfVVInterference& aVVt=tInterfPool.VVInterferences();
   //
   aNbVV=aVVt.Extent();
   for (i=1; i<=aNbVV; ++i) {
index cb1a8ba03cd8e09df2f6aadf63ac50fa1a1e6991..af6e55537190b0087a22977c2628df086de0b582 100644 (file)
@@ -174,6 +174,7 @@ void GEOM_AssemblyBuilder::MeshShape(const TopoDS_Shape myShape,
       // Compute default deflection
       Bnd_Box B;
       BRepBndLib::Add(myShape, B);
+      if ( B.IsVoid() ) return; // NPAL15983 (Bug when displaying empty groups) 
       Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
       B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
       deflection = MAX3( aXmax-aXmin , aYmax-aYmin , aZmax-aZmin) * 0.001 *4;
index 886adba410627710f68e6f3aebb4d70540775470..52ddfbce45d75b245084c0b72c3e8dc56df61e74 100644 (file)
@@ -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, 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->RangeStepAndValidator(0.001, COORD_MAX, myStep, DBL_DIGITS_DISPLAY);
+  GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep1, DBL_DIGITS_DISPLAY);
+  GroupPoints->SpinBox_DZ->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep2, DBL_DIGITS_DISPLAY);
 
   GroupPoints->SpinBox_DX->SetValue( 100.0 );
   GroupPoints->SpinBox_DY->SetValue( 1.0 );
index 1a4f75ecd379c995d218c6a755da1b3a38c646e4..29ecc1795def759b24192f801cd8b4c9896227fb 100644 (file)
@@ -146,7 +146,7 @@ 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, COORD_MAX, SpecificStep, 3 );
+    anIter.data()->RangeStepAndValidator( 0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY );
 
   setHelpFileName("chamfer.htm");
 
index 9e451629fe85e92f4d7a8b87c617bc6bf416c9fd..7f4d49762c09cd80dad1246a282abb93fa9e724f 100644 (file)
@@ -24,7 +24,7 @@
 //  File   : OperationGUI_ClippingDlg.cxx
 //  Author : Michael Zorin
 //  Module : GEOM
-//  $Header
+//  $Header$
 
 #include "OperationGUI_ClippingDlg.h"
 #include "DlgRef_SpinBox.h"
@@ -41,8 +41,6 @@
 #include <V3d_View.hxx>
 #include <V3d.hxx>
 
-//#include <V3d_Plane.hxx>
-
 // QT Includes
 #include <qapplication.h>
 #include <qgroupbox.h>
@@ -109,8 +107,8 @@ OperationGUI_ClippingDlg::OperationGUI_ClippingDlg(GeometryGUI* theGeometryGUI,
   Layout1->addWidget( GroupArguments, 2, 0 );
 
   /* Initialisations */
-  SpinBox_Near->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 );
-  SpinBox_Far->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 );
+  SpinBox_Near->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY );
+  SpinBox_Far->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY );
 
   /* signals and slots connections */
   connect( buttonOk   , SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
@@ -141,13 +139,13 @@ void OperationGUI_ClippingDlg::Init()
   SUIT_ViewWindow* anActiveWindow =  SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
   if (!anActiveWindow)
     return;
-  
+
   if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
     {
       SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
       if( !aVTKFrame )
        return;
-      
+
       TextLabelNear->setText( tr( "Near"  ) );
       TextLabelFar->setText( tr( "Far"  ) );
 
@@ -155,40 +153,40 @@ void OperationGUI_ClippingDlg::Init()
 
       vtkRenderer* aRenderer = aVTKFrame->getRenderer();
       if(!aRenderer) return;
-      
+
       vtkCamera* anActiveCamera = aRenderer->GetActiveCamera();
       if( anActiveCamera == NULL ){
        MESSAGE("Trying to reset clipping range of non-existant camera");
        return;
       }
-      
+
       // Find the plane equation for the camera view plane
       double vn[3];
       anActiveCamera->GetViewPlaneNormal(vn);
       double  position[3];
       anActiveCamera->GetPosition(position);
-      
+
       vtkFloatingPointType bounds[6];
       aRenderer->ComputeVisiblePropBounds(bounds);
-      
+
       double center[3];
       center[0] = (bounds[0] + bounds[1])/2.0;
       center[1] = (bounds[2] + bounds[3])/2.0;
       center[2] = (bounds[4] + bounds[5])/2.0;
-      
+
       double width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
                          (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
                          (bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
-      
+
       double distance = sqrt((position[0]-center[0])*(position[0]-center[0]) +
                             (position[1]-center[1])*(position[1]-center[1]) +
                             (position[2]-center[2])*(position[2]-center[2]));
-      
+
       vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0};
-      
+
       SpinBox_Near->SetValue(range[0]);
       SpinBox_Far->SetValue(range[1]);
-      
+
       return;
     }
   else if ( anActiveWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() )
@@ -200,7 +198,7 @@ void OperationGUI_ClippingDlg::Init()
 
       Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)aOCCFrame->getViewPort())->getView();
 
-      double depth, thickness; 
+      double depth, thickness;
       int ztype= view3d->ZClipping(depth, thickness);
       SpinBox_Near->SetValue(depth);
       SpinBox_Far->SetValue(thickness);
@@ -221,26 +219,26 @@ bool OperationGUI_ClippingDlg::ClickOnApply()
   SUIT_ViewWindow* anActiveWindow =  SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
   if (!anActiveWindow)
     return false;
-  
+
   if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
     {
       SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
       if( !aVTKFrame )
        return false;
-      
+
       vtkRenderer* aRenderer = aVTKFrame->getRenderer();
       if(!aRenderer) return false;
-      
+
       vtkCamera* anActiveCamera = aRenderer->GetActiveCamera();
       if( anActiveCamera == NULL ){
        MESSAGE("Trying to reset clipping range of non-existant camera");
        return false;
       }
-      
+
       vtkFloatingPointType range[2] = { SpinBox_Near->GetValue(), SpinBox_Far->GetValue() };
       if (range[0] < 0.0) range[0] = 0.0;
       anActiveCamera->SetClippingRange( range );
-      
+
       return true;
     }
   else if ( anActiveWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() )
@@ -248,11 +246,11 @@ bool OperationGUI_ClippingDlg::ClickOnApply()
       OCCViewer_ViewWindow* aOCCFrame = dynamic_cast<OCCViewer_ViewWindow*>( anActiveWindow );
 
       Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)aOCCFrame->getViewPort())->getView();
-      
+
       double depth = SpinBox_Near->GetValue();
       double thickness = SpinBox_Far->GetValue();
       int aType = TypeCB->currentItem();
-      
+
       view3d->SetZClippingType(V3d_TypeOfZclipping(aType));
       view3d->SetZClippingDepth(depth);
       view3d->SetZClippingWidth(thickness);
@@ -309,7 +307,7 @@ void OperationGUI_ClippingDlg::onReset()
     SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
   if (!anActiveWindow)
     return;
-  
+
   if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
     {
       SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
@@ -318,40 +316,40 @@ void OperationGUI_ClippingDlg::onReset()
 
       vtkRenderer* aRenderer = aVTKFrame->getRenderer();
       if(!aRenderer) return;
-      
+
       vtkCamera* anActiveCamera = aRenderer->GetActiveCamera();
       if( anActiveCamera == NULL ){
        MESSAGE("Trying to reset clipping range of non-existant camera");
        return;
       }
-      
+
       // Find the plane equation for the camera view plane
       double vn[3];
       anActiveCamera->GetViewPlaneNormal(vn);
       double  position[3];
       anActiveCamera->GetPosition(position);
-      
+
       vtkFloatingPointType bounds[6];
       aRenderer->ComputeVisiblePropBounds(bounds);
-      
+
       double center[3];
       center[0] = (bounds[0] + bounds[1])/2.0;
       center[1] = (bounds[2] + bounds[3])/2.0;
       center[2] = (bounds[4] + bounds[5])/2.0;
-      
+
       double width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
                          (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
                          (bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
-      
+
       double distance = sqrt((position[0]-center[0])*(position[0]-center[0]) +
                             (position[1]-center[1])*(position[1]-center[1]) +
                             (position[2]-center[2])*(position[2]-center[2]));
-      
+
       vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0};
-      
+
       SpinBox_Near->SetValue(range[0]);
       SpinBox_Far->SetValue(range[1]);
-      
+
       return;
     }
   else if ( anActiveWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() )
@@ -360,12 +358,12 @@ void OperationGUI_ClippingDlg::onReset()
 
       TextLabelNear->setText( tr( "Depth"  ) );
       TextLabelFar->setText( tr( "Thickness"  ) );
-      
+
       Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)aOCCFrame->getViewPort())->getView();
-      
+
       view3d->SetZClippingType(V3d_TypeOfZclipping(0));
       view3d->ZFitAll();
-      double depth, thickness; 
+      double depth, thickness;
       int ztype= view3d->ZClipping(depth, thickness);
       SpinBox_Near->SetValue(0);
       SpinBox_Far->SetValue(1000);
index 62633cd0aba23345caee4148b4259f59d9c30916..e4808de4ed76ae23f948d2bed19d8cb997f1f356 100644 (file)
@@ -105,9 +105,9 @@ OperationGUI_FilletDlg::OperationGUI_FilletDlg(GeometryGUI* theGeometryGUI, QWid
   /***************************************************************/
 
   double SpecificStep = 10.0;
-  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);
+  Group1->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
+  Group2->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
+  Group3->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
 
   setHelpFileName("fillet.htm");
 
index 12ebfba3c3ff05b8442e3743e909e1ca5fc32c12..9649e3a9174eeb7e9d48ece66d7e89cd9aaf5a87 100644 (file)
@@ -67,7 +67,7 @@ OperationGUI_PartitionDlg::OperationGUI_PartitionDlg(GeometryGUI* theGeometryGUI
   RadioButton3->close(TRUE);
 
   // Full partition (contains half-space partition)
-  GroupPoints = new DlgRef_2Sel1List_QTD(this, "GroupPoints");
+  GroupPoints = new DlgRef_2Sel1List1Check_QTD(this, "GroupPoints");
   GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION"));
   GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
   GroupPoints->TextLabel2->setText(tr("GEOM_TOOL_OBJECT"));
@@ -76,6 +76,7 @@ OperationGUI_PartitionDlg::OperationGUI_PartitionDlg(GeometryGUI* theGeometryGUI
   GroupPoints->PushButton2->setPixmap(image2);
   GroupPoints->LineEdit1->setReadOnly( true );
   GroupPoints->LineEdit2->setReadOnly( true );
+  GroupPoints->radioButton4->setText(tr("GEOM_KEEP_NONLIMIT_SHAPES"));
 
   Layout1->addWidget(GroupPoints, 2, 0);
   /***************************************************************/
@@ -109,6 +110,7 @@ void OperationGUI_PartitionDlg::Init()
   GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_WIRE"));
   GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_EDGE"));
   GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_VERTEX"));
+  GroupPoints->radioButton4->setChecked(FALSE);
   
   /* signals and slots connections */
   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
@@ -123,6 +125,8 @@ void OperationGUI_PartitionDlg::Init()
   
   connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
   
+  connect(GroupPoints->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
+
   connect(myGeomGUI->getApp()->selectionMgr(), 
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   
@@ -145,7 +149,7 @@ void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId)
   myListKeepInside.length(0);
   myListRemoveInside.length(0);
   myListMaterials.length(0);
-  
+
   switch (constructorId)
     {
     case 0: /*Full partition */
@@ -155,8 +159,8 @@ void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId)
        resize(0, 0);
        GroupPoints->TextLabel3->show();
        GroupPoints->ComboBox1->show();
-       
        GroupPoints->ComboBox1->setCurrentItem(0);
+       GroupPoints->radioButton4->show();
        break;
       }
     case 1: /*Half-space partition */
@@ -166,6 +170,7 @@ void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId)
        GroupPoints->TextLabel3->hide();
        GroupPoints->ComboBox1->hide();
        GroupPoints->TextLabel2->setText(tr("GEOM_PLANE"));
+       GroupPoints->radioButton4->hide();
        resize(0, 0);
        break;
       } 
@@ -357,15 +362,25 @@ bool OperationGUI_PartitionDlg::execute( ObjectList& objects )
   int aLimit = GetLimit();
   int aConstructorId = getConstructorId();
 
-  if (aConstructorId == 1)
+  int aKeepNonlimitShapes = 0;
+  if (aConstructorId == 1) {
     aLimit = GEOM::SHAPE;
+  }
+  else {
+    if(GroupPoints->radioButton4->isChecked()) {
+      aKeepNonlimitShapes = 1;
+    }
+    else {
+      aKeepNonlimitShapes = 0;
+    }
+  }
 
   if (isValid( msg )) {
 
     anObj = GEOM::GEOM_IBooleanOperations::_narrow(getOperation())->
       MakePartition(myListShapes, myListTools,
                     myListKeepInside, myListRemoveInside,
-                   aLimit, false, myListMaterials);
+                   aLimit, false, myListMaterials, aKeepNonlimitShapes);
     res = true;
   }
 
index dbfbd4dcce971025cb62dd6b1777163501178b85..ba321be37033aa2a9188f867f08212fc03768e12 100644 (file)
@@ -29,7 +29,7 @@
 #define DIALOGBOX_PARTITION_H
 
 #include "GEOMBase_Skeleton.h"
-#include "DlgRef_2Sel1List_QTD.h"
+#include "DlgRef_2Sel1List1Check_QTD.h"
 
 //=================================================================================
 // class    : OperationGUI_PartitionDlg
@@ -68,7 +68,7 @@ private:
     GEOM::ListOfGO   myListRemoveInside;
     GEOM::ListOfGO   myListKeepInside;
 
-    DlgRef_2Sel1List_QTD* GroupPoints;
+    DlgRef_2Sel1List1Check_QTD* GroupPoints;
 
 private slots:
     void ClickOnOk();
index 23e9ce46a4137627fcf7dc4b05f60d4aa7faac18..7230ca6a5fce48afee556989bea25103be74f34d 100644 (file)
@@ -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(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);
+  GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
 
   double initValue = 200.0;
   GroupDimensions->SpinBox_DX->SetValue(initValue);
index 7de92356e6b29073c8c310083422bd4c45e6a6bc..fd7f05cd61c986cb873d18b9bd41adb1446561a4 100644 (file)
@@ -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, 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);
+  GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupPoints->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
 
   double aRadius1(100.0), aRadius2(0.0), aHeight(300.0); 
   GroupPoints->SpinBox_DX->SetValue(aRadius1);
index 503211cf2f394004b5b25256ec6df16bf2145c22..6c2b1b726b1be32fe031f18abffe2dafdc2599a0 100644 (file)
@@ -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, COORD_MAX, step, 3);
+  GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
   /* First constructor : algebric height */
-  GroupPoints->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+  GroupPoints->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
   /* Second constructor : radius */
-  GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+  GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
   /* Second constructor : algebric height */
-  GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+  GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
 
   GroupPoints->SpinBox_DX->SetValue(100.0);
   GroupPoints->SpinBox_DY->SetValue(300.0);
index f52f0822a97e783c28ef24f28d4f4c72e3e89477..f7a79b15293e46eaabe9642f1180435874b9787b 100644 (file)
@@ -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, COORD_MAX, step, 3);
-  GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+  GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
   GroupPoints->SpinBox_DX->SetValue(100.0);
   GroupDimensions->SpinBox_DX->SetValue(100.0);
   
index 7ab9ca4652d7b181ff52a11e30f394e30d01fb2a..1f4279bcad914b2aee2885dd9ae9b04324615229 100644 (file)
@@ -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
 //
 //
 //
 
 #include "utilities.h"
 
-using namespace std;
-
 //=================================================================================
 // class    : PrimitiveGUI_TorusDlg()
-// purpose  : Constructs a PrimitiveGUI_TorusDlg which is a child of 'parent', with the 
+// purpose  : Constructs a PrimitiveGUI_TorusDlg 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.
 //=================================================================================
 PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(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)
+  : 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_TORUS_PV")));
-  QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_DXYZ")));
-  QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  QPixmap image0(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TORUS_PV")));
+  QPixmap image1(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TORUS_DXYZ")));
+  QPixmap image2(aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
 
   setCaption(tr("GEOM_TORUS_TITLE"));
 
@@ -83,8 +82,8 @@ PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidge
   Layout1->addWidget(GroupDimensions, 2, 0);
   /***************************************************************/
 
-  setHelpFileName("turus.htm");  
-  
+  setHelpFileName("turus.htm");
+
   Init();
 }
 
@@ -109,7 +108,7 @@ void PrimitiveGUI_TorusDlg::Init()
   myEditCurrentArgument = GroupPoints->LineEdit1;
   GroupPoints->LineEdit1->setReadOnly( true );
   GroupPoints->LineEdit2->setReadOnly( true );
+
   myPoint = myDir = GEOM::GEOM_Object::_nil();
 
   /* Get setting of step value from file configuration */
@@ -117,10 +116,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, 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->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
 
   GroupPoints->SpinBox_DX->SetValue(300.0);
   GroupPoints->SpinBox_DY->SetValue(100.0);
@@ -130,6 +129,7 @@ void PrimitiveGUI_TorusDlg::Init()
   /* 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()));
@@ -143,14 +143,18 @@ void PrimitiveGUI_TorusDlg::Init()
   connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
   connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
 
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
-  
-  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
-         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
-  
+  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+          GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
+  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+          GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
+  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+          GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
+  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+          GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
+
+  connect(myGeomGUI->getApp()->selectionMgr(),
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
   initName( tr( "GEOM_TORUS" ) );
   ConstructorsClicked(0);
 }
@@ -162,36 +166,39 @@ void PrimitiveGUI_TorusDlg::Init()
 //=================================================================================
 void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
 {
-  disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
-  
-  switch(constructorId)
-    { 
-    case 0 :
-      {
-       globalSelection( GEOM_LINE );
-
-       GroupDimensions->hide();
-       resize(0, 0);
-       GroupPoints->show();
-       
-       myEditCurrentArgument = GroupPoints->LineEdit1;
-       GroupPoints->LineEdit1->setText(tr(""));
-       GroupPoints->LineEdit2->setText(tr(""));
-       myPoint = myDir = GEOM::GEOM_Object::_nil();
-       
-       connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
-               SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-       break ;
-      }
-    case 1 :
-      {
-       GroupPoints->hide();
-       resize( 0, 0 );
-       GroupDimensions->show();
-       
-       break ;
-      }
+  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
+  switch (constructorId)
+  {
+  case 0:
+    {
+      globalSelection( GEOM_POINT );
+
+      GroupDimensions->hide();
+      resize(0, 0);
+      GroupPoints->show();
+
+      myEditCurrentArgument = GroupPoints->LineEdit1;
+      GroupPoints->LineEdit1->setText(tr(""));
+      GroupPoints->LineEdit2->setText(tr(""));
+      myPoint = myDir = GEOM::GEOM_Object::_nil();
+
+      connect(myGeomGUI->getApp()->selectionMgr(),
+              SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+      SelectionIntoArgument();
+
+      break;
+    }
+  case 1:
+    {
+      GroupPoints->hide();
+      resize(0, 0);
+      GroupDimensions->show();
+
+      break;
     }
+  }
+
   displayPreview();
 }
 
@@ -217,21 +224,10 @@ bool PrimitiveGUI_TorusDlg::ClickOnApply()
     return false;
 
   initName();
-  ConstructorsClicked( getConstructorId() );
   return true;
 }
 
 
-//=======================================================================
-// function : ClickOnCancel()
-// purpose  :
-//=======================================================================
-void PrimitiveGUI_TorusDlg::ClickOnCancel()
-{
-  GEOMBase_Skeleton::ClickOnCancel();
-}
-
-
 //=================================================================================
 // function : SelectionIntoArgument()
 // purpose  : Called when selection as changed or other case
@@ -240,36 +236,51 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
 {
   if ( getConstructorId() != 0 )
     return;
-  
+
   myEditCurrentArgument->setText("");
-  
-  if(IObjectCount() != 1)
-    {
-      if(myEditCurrentArgument == GroupPoints->LineEdit1)
-       myPoint = GEOM::GEOM_Object::_nil();
-      else if(myEditCurrentArgument == GroupPoints->LineEdit2)
-       myDir = GEOM::GEOM_Object::_nil();
-      return;
-    }
-  
-  
+
+  if (IObjectCount() != 1)
+  {
+    if (myEditCurrentArgument == GroupPoints->LineEdit1)
+      myPoint = GEOM::GEOM_Object::_nil();
+    else if (myEditCurrentArgument == GroupPoints->LineEdit2)
+      myDir = GEOM::GEOM_Object::_nil();
+    return;
+  }
+
   /* nbSel == 1 */
   Standard_Boolean testResult = Standard_False;
   GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-  
-  if(!testResult || CORBA::is_nil( aSelectedObject ))
+
+  if (!testResult || CORBA::is_nil( aSelectedObject ))
     return;
-  
-  if(myEditCurrentArgument == GroupPoints->LineEdit1)
+
+  if (myEditCurrentArgument == GroupPoints->LineEdit1)
     myPoint = aSelectedObject;
-  else if(myEditCurrentArgument == GroupPoints->LineEdit2)
+  else if (myEditCurrentArgument == GroupPoints->LineEdit2)
     myDir = aSelectedObject;
-    
+
   myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
   displayPreview();
 }
 
 
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose  :
+//=================================================================================
+void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
+{
+  QLineEdit* send = (QLineEdit*)sender();
+  if (send == GroupPoints->LineEdit1 ||
+      send == GroupPoints->LineEdit2)
+  {
+    myEditCurrentArgument = send;
+    GEOMBase_Skeleton::LineEditReturnPressed();
+  }
+}
+
+
 //=================================================================================
 // function : SetEditCurrentArgument()
 // purpose  :
@@ -277,37 +288,21 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
 void PrimitiveGUI_TorusDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-  
-  if(send == GroupPoints->PushButton1) {
+
+  if (send == GroupPoints->PushButton1) {
     myEditCurrentArgument = GroupPoints->LineEdit1;
     globalSelection( GEOM_POINT );
   }
-  else if(send == GroupPoints->PushButton2) {
+  else if (send == GroupPoints->PushButton2) {
     myEditCurrentArgument = GroupPoints->LineEdit2;
     globalSelection( GEOM_LINE );
   }
-  
+
   myEditCurrentArgument->setFocus();
   SelectionIntoArgument();
 }
 
 
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose  :
-//=================================================================================
-void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
-{  
-  QLineEdit* send = (QLineEdit*)sender();
-  if(send == GroupPoints->LineEdit1 ||
-     send == GroupPoints->LineEdit2)
-    {
-      myEditCurrentArgument = send;
-      GEOMBase_Skeleton::LineEditReturnPressed();
-    }
-}
-
-
 //=================================================================================
 // function : ActivateThisDialog()
 // purpose  :
@@ -315,9 +310,10 @@ void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
 void PrimitiveGUI_TorusDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
+
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
   ConstructorsClicked( getConstructorId() );
 }
 
@@ -333,16 +329,6 @@ void PrimitiveGUI_TorusDlg::enterEvent(QEvent* e)
 }
 
 
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose  : public slot to deactivate if active
-//=================================================================================
-void PrimitiveGUI_TorusDlg::DeactivateActiveDialog()
-{
-  GEOMBase_Skeleton::DeactivateActiveDialog();
-}
-
-
 //=================================================================================
 // function : ValueChangedInSpinBox
 // purpose  :
@@ -380,22 +366,25 @@ bool PrimitiveGUI_TorusDlg::isValid( QString& msg )
 bool PrimitiveGUI_TorusDlg::execute( ObjectList& objects )
 {
   bool res = false;
-  
+
   GEOM::GEOM_Object_var anObj;
 
-  switch ( getConstructorId() ) 
-  {
-  case 0 :
+  switch ( getConstructorId() )
   {
-    if (!CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir )){
-      anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
-      res = true;
+  case 0:
+    {
+      if (!CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ))
+      {
+        anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+          MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
+        res = true;
+      }
+      break;
     }
-    break;
-  }
-  case 1 :
+  case 1:
     {
-      anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusRR(getRadius1(), getRadius2());
+      anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+        MakeTorusRR(getRadius1(), getRadius2());
       res = true;
       break;
     }
@@ -408,16 +397,6 @@ bool PrimitiveGUI_TorusDlg::execute( ObjectList& objects )
 }
 
 
-//=================================================================================
-// function : closeEvent
-// purpose  :
-//=================================================================================
-void PrimitiveGUI_TorusDlg::closeEvent( QCloseEvent* e )
-{
-  GEOMBase_Skeleton::closeEvent( e );
-}
-
-
 //=================================================================================
 // function : getRadius1()
 // purpose  :
index 00d6a46b679dfcc140e8f9c963eae1acf440101c..08e86ced14fe4680c5871a1e5a558859d7d3989f 100644 (file)
@@ -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
 //
 //
 //
@@ -52,11 +52,10 @@ protected:
     virtual bool isValid( QString& );
     virtual bool execute( ObjectList& objects );
 
-    virtual void closeEvent( QCloseEvent* e );
-
 private:
     void Init();
     void enterEvent(QEvent* e);
+
     double getRadius1() const;
     double getRadius2() const;
 
@@ -65,12 +64,11 @@ private:
     DlgRef_2Sel2Spin* GroupPoints;
     DlgRef_2Spin* GroupDimensions;
 
-    private slots:
+private slots:
     void ClickOnOk();
     bool ClickOnApply();
-    void ClickOnCancel();
+
     void ActivateThisDialog();
-    void DeactivateActiveDialog();
     void LineEditReturnPressed();
     void SelectionIntoArgument();
     void SetEditCurrentArgument();
index 3c017c41083989764a5ba30598c370e4269ea908..1f87910ac0eb98132b3e0b8f57b47dcd9138a3da 100644 (file)
@@ -411,67 +411,69 @@ bool RepairGUI_GlueDlg::execute( ObjectList& objects )
   bool aResult = false;
   objects.clear();
 
-  switch ( getConstructorId() ) 
+  switch ( getConstructorId() )
+  {
+  case 0:
+    {
+      GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
+        ( getOperation() )->MakeGlueFaces( myObject, myTolEdt2->value(), true );
+      aResult = !anObj->_is_nil();
+      if ( aResult )
+        objects.push_back( anObj._retn() );
+      break;
+    }
+  case 1:
     {
-    case 0 :
+      if ( IsPreview() )
       {
-        GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
-        ( getOperation() )->MakeGlueFaces( myObject, myTolEdt2->value() );
-        aResult = !anObj->_is_nil();
-        if ( aResult )
-          objects.push_back( anObj._retn() );
-        break;
-      }
-    case 1 :
-        if ( IsPreview() )
-        {
-          // if this method is used for displaying preview then we must detect glue faces only
-          ObjectList::iterator anIter;
-          for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter)
-            objects.push_back( GEOM::GEOM_Object::_duplicate( *anIter ) );
-          return myTmpObjs.size() ? true : false;
-        } // IsPreview
-        
-        // Make glue face by list.
-        // Iterate through myTmpObjs and verifies where each object is currently selected or not.
-        QMap<QString, char> selected;
-        
-        // Get names of selected objects
-        SALOME_ListIteratorOfListIO it ( selectedIO() );
-        for (; it.More(); it.Next()) 
-          selected.insert( it.Value()->getName(), 0 );
-        
-        // Iterate through result and select objects with names from selection
-        // ObjectList toRemoveFromEnggine;
-        ObjectList toGlue;
+        // if this method is used for displaying preview then we must detect glue faces only
         ObjectList::iterator anIter;
-        for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter) 
-        {
-          if ( selected.contains( myGeomGUI->getApp()->orb()->object_to_string(*anIter) ) )
-            toGlue.push_back(*anIter);
-        }
-          
-        // make glue faces
-        GEOM::ListOfGO_var aListForGlue = new GEOM::ListOfGO();
-        aListForGlue->length( toGlue.size() );
-        ObjectList::iterator anIter3 = toGlue.begin();
-        for ( int i = 0; anIter3 != toGlue.end(); ++anIter3, ++i )
-          aListForGlue[ i ] = *anIter3;
-        GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
-          ( getOperation() )->MakeGlueFacesByList( myObject, myTolEdt2->value(), aListForGlue );
-        
-        aResult = !anObj->_is_nil();
-        
-        if ( aResult )
-          objects.push_back( anObj._retn() );
-      
-        // Remove from engine useless objects        
-        clearTemporary();
-        
-        updateButtonState();
-        
+        for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter)
+          objects.push_back( GEOM::GEOM_Object::_duplicate( *anIter ) );
+        return myTmpObjs.size() ? true : false;
+      } // IsPreview
+
+      // Make glue face by list.
+      // Iterate through myTmpObjs and verifies where each object is currently selected or not.
+      QMap<QString, char> selected;
+
+      // Get names of selected objects
+      SALOME_ListIteratorOfListIO it ( selectedIO() );
+      for (; it.More(); it.Next()) 
+        selected.insert( it.Value()->getName(), 0 );
+
+      // Iterate through result and select objects with names from selection
+      // ObjectList toRemoveFromEnggine;
+      ObjectList toGlue;
+      ObjectList::iterator anIter;
+      for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter) 
+      {
+        if ( selected.contains( myGeomGUI->getApp()->orb()->object_to_string(*anIter) ) )
+          toGlue.push_back(*anIter);
+      }
+
+      // make glue faces
+      GEOM::ListOfGO_var aListForGlue = new GEOM::ListOfGO();
+      aListForGlue->length( toGlue.size() );
+      ObjectList::iterator anIter3 = toGlue.begin();
+      for ( int i = 0; anIter3 != toGlue.end(); ++anIter3, ++i )
+        aListForGlue[ i ] = *anIter3;
+      GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
+        ( getOperation() )->MakeGlueFacesByList( myObject, myTolEdt2->value(), aListForGlue, true );
+
+      aResult = !anObj->_is_nil();
+
+      if ( aResult )
+        objects.push_back( anObj._retn() );
+
+      // Remove from engine useless objects
+      clearTemporary();
+
+      updateButtonState();
+
       break;
-    } // case
+    } // case 1
+  } // switch
 
   return aResult;
 }
index 88535e435aa0f89e87c5cb67c10585f26bfc8bcc..1311eb899149f4461e32c99b22e0dfd9bf6c75dc 100644 (file)
@@ -44,7 +44,7 @@ using namespace std;
 
 //=================================================================================
 // class    : TransformationGUI_MultiRotationDlg()
-// purpose  : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the 
+// purpose  : Constructs a TransformationGUI_MultiRotationDlg 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.
@@ -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, MAX_NUMBER, SpecificStep2, 3);
+  GroupPoints->SpinBox_DX->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 10);
   GroupPoints->SpinBox_DX->SetValue(myNbTimes1);
 
-  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->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep1, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 10);
+  GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 10);
   GroupDimensions->SpinBox_DX1->SetValue(myAng);
   GroupDimensions->SpinBox_DY1->SetValue(myNbTimes1);
   GroupDimensions->SpinBox_DX2->SetValue(myStep);
@@ -164,8 +164,8 @@ void TransformationGUI_MultiRotationDlg::Init()
   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY2, SLOT(SetStep(double)));
 
   connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseAngle()));
-  
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   initName( tr( "GEOM_MULTIROTATION" ) );
@@ -219,7 +219,7 @@ void TransformationGUI_MultiRotationDlg::ConstructorsClicked(int constructorId)
        GroupDimensions->SpinBox_DY2->SetValue(myNbTimes2);
 
        break;
-      }      
+      }
     }
 
   myEditCurrentArgument->setFocus();
@@ -248,7 +248,7 @@ bool TransformationGUI_MultiRotationDlg::ClickOnApply()
 {
   if ( !onAccept() )
     return false;
-  
+
   initName();
   ConstructorsClicked( getConstructorId() );
   return true;
@@ -301,7 +301,7 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
 void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-  
+
   if(send == GroupPoints->PushButton1) {
     myEditCurrentArgument = GroupPoints->LineEdit1;
     globalSelection( GEOM_ALLSHAPES );
@@ -331,10 +331,10 @@ void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
 void TransformationGUI_MultiRotationDlg::LineEditReturnPressed()
 {
   QLineEdit* send = (QLineEdit*)sender();
-  if(send == GroupPoints->LineEdit1 || send == GroupDimensions->LineEdit1 || 
+  if(send == GroupPoints->LineEdit1 || send == GroupDimensions->LineEdit1 ||
      send == GroupPoints->LineEdit2 || send == GroupDimensions->LineEdit2)
     {
-      myEditCurrentArgument = send; 
+      myEditCurrentArgument = send;
       GEOMBase_Skeleton::LineEditReturnPressed();
     }
 }
@@ -347,9 +347,9 @@ void TransformationGUI_MultiRotationDlg::LineEditReturnPressed()
 void TransformationGUI_MultiRotationDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-  
+
   ConstructorsClicked( getConstructorId() );
 }
 
@@ -381,7 +381,7 @@ void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox(double newValue)
     myStep = newValue;
   else if(send == GroupDimensions->SpinBox_DY2)
     myNbTimes2 = (int)newValue;
-  
+
   displayPreview();
 }
 
@@ -431,10 +431,10 @@ bool TransformationGUI_MultiRotationDlg::isValid( QString& msg )
 bool TransformationGUI_MultiRotationDlg::execute( ObjectList& objects )
 {
   bool res = false;
-  
+
   GEOM::GEOM_Object_var anObj;
 
-  switch ( getConstructorId() ) 
+  switch ( getConstructorId() )
     {
     case 0 :
       {
@@ -456,10 +456,10 @@ bool TransformationGUI_MultiRotationDlg::execute( ObjectList& objects )
        break;
       }
     }
-  
+
   if ( !anObj->_is_nil() )
     objects.push_back( anObj._retn() );
-  
+
   return res;
 }
 
index 75f3e4d3500d2cc942e389147cb55112ae12bba1..7f5e33c1584577c3e6907ac9157eca870a88fc08 100644 (file)
@@ -45,7 +45,7 @@ using namespace std;
 
 //=================================================================================
 // class    : TransformationGUI_MultiTranslationDlg()
-// purpose  : Constructs a TransformationGUI_MultiTranslationDlg which is a child of 'parent', with the 
+// purpose  : Constructs a TransformationGUI_MultiTranslationDlg 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.
@@ -127,18 +127,18 @@ void TransformationGUI_MultiTranslationDlg::Init()
   /* Get setting of step value from file configuration */
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
   double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
-  
+
   double SpecificStep = 1;
   /* min, max, step and decimals for spin boxes & initial values */
-  GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
-  GroupPoints->SpinBox_DY->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3);
+  GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupPoints->SpinBox_DY->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 10);
   GroupPoints->SpinBox_DX->SetValue(myStepU);
   GroupPoints->SpinBox_DY->SetValue(myNbTimesU);
 
-  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->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 10);
+  GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 10);
   GroupDimensions->SpinBox_DX1->SetValue(myStepU);
   GroupDimensions->SpinBox_DY1->SetValue(myNbTimesU);
   GroupDimensions->SpinBox_DX2->SetValue(myStepV);
@@ -178,11 +178,10 @@ void TransformationGUI_MultiTranslationDlg::Init()
   connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU()));
   connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU()));
   connect(GroupDimensions->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(ReverseStepV()));
-  
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
-  
   initName( tr( "GEOM_MULTITRANSLATION" ) );
   ConstructorsClicked( 0 );
 }
@@ -195,7 +194,7 @@ void TransformationGUI_MultiTranslationDlg::Init()
 void TransformationGUI_MultiTranslationDlg::ConstructorsClicked(int constructorId)
 {
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-  
+
   myStepU = myStepV = 50.0;
   myNbTimesU = myNbTimesV = 2;
 
@@ -238,10 +237,10 @@ void TransformationGUI_MultiTranslationDlg::ConstructorsClicked(int constructorI
        break;
       }
     }
-  
+
   myEditCurrentArgument->setFocus();
   myBase = myVectorU = GEOM::GEOM_Object::_nil();
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 }
 
@@ -265,7 +264,7 @@ bool TransformationGUI_MultiTranslationDlg::ClickOnApply()
 {
   if ( !onAccept() )
     return false;
-  
+
   initName();
   ConstructorsClicked( getConstructorId() );
   return true;
@@ -279,13 +278,15 @@ bool TransformationGUI_MultiTranslationDlg::ClickOnApply()
 void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
 {
   myEditCurrentArgument->setText("");
-  
-  if(IObjectCount() != 1) {
-    if(myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1)
+
+  if (IObjectCount() != 1) {
+    if (myEditCurrentArgument == GroupPoints->LineEdit1 ||
+        myEditCurrentArgument == GroupDimensions->LineEdit1)
       myBase = GEOM::GEOM_Object::_nil();
-    else if(myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupDimensions->LineEdit2)
+    else if (myEditCurrentArgument == GroupPoints->LineEdit2 ||
+             myEditCurrentArgument == GroupDimensions->LineEdit2)
       myVectorU = GEOM::GEOM_Object::_nil();
-    else if(myEditCurrentArgument == GroupDimensions->LineEdit3)
+    else if (myEditCurrentArgument == GroupDimensions->LineEdit3)
       myVectorV = GEOM::GEOM_Object::_nil();
     return;
   }
@@ -297,15 +298,17 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
   if ( !testResult || CORBA::is_nil( aSelectedObject ) || !GEOMBase::IsShape( aSelectedObject ) )
     return;
 
-  if(myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1)
-    myBase = aSelectedObject;        
-  else if(myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupDimensions->LineEdit2)
+  if (myEditCurrentArgument == GroupPoints->LineEdit1 ||
+      myEditCurrentArgument == GroupDimensions->LineEdit1)
+    myBase = aSelectedObject;
+  else if (myEditCurrentArgument == GroupPoints->LineEdit2 ||
+           myEditCurrentArgument == GroupDimensions->LineEdit2)
     myVectorU = aSelectedObject;
-  else if(myEditCurrentArgument == GroupDimensions->LineEdit3) 
+  else if (myEditCurrentArgument == GroupDimensions->LineEdit3)
     myVectorV = aSelectedObject;
 
   myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
-  
+
   displayPreview();    
 }
 
@@ -317,7 +320,6 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
 void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
 
   if(send == GroupPoints->PushButton1) {
     myEditCurrentArgument = GroupPoints->LineEdit1;
@@ -339,7 +341,7 @@ void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupDimensions->LineEdit3;
     globalSelection( GEOM_LINE  );
   }
-  
+
   myEditCurrentArgument->setFocus();
   SelectionIntoArgument();
 }
@@ -356,7 +358,7 @@ void TransformationGUI_MultiTranslationDlg::LineEditReturnPressed()
      send == GroupPoints->LineEdit2 || send == GroupDimensions->LineEdit2 ||
                                        send == GroupDimensions->LineEdit3)
     {
-      myEditCurrentArgument = send; 
+      myEditCurrentArgument = send;
       GEOMBase_Skeleton::LineEditReturnPressed();
     }
 }
@@ -369,7 +371,7 @@ void TransformationGUI_MultiTranslationDlg::LineEditReturnPressed()
 void TransformationGUI_MultiTranslationDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   ConstructorsClicked( getConstructorId() );
@@ -418,7 +420,7 @@ void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox(double newValu
        break;
       }
     }
-  
+
   displayPreview();
 }
 
@@ -430,14 +432,14 @@ void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox(double newValu
 void TransformationGUI_MultiTranslationDlg::ReverseStepU()
 {
   myStepU = -myStepU;
-  
+
   int aConstructorId = getConstructorId();
 
   if(aConstructorId == 0)
     GroupPoints->SpinBox_DX->SetValue(myStepU);
   else if(aConstructorId == 1)
     GroupDimensions->SpinBox_DX1->SetValue(myStepU);
-  
+
   displayPreview();
 }
 
@@ -449,9 +451,9 @@ void TransformationGUI_MultiTranslationDlg::ReverseStepU()
 void TransformationGUI_MultiTranslationDlg::ReverseStepV()
 {
   myStepV = -myStepV;
-  
+
   GroupDimensions->SpinBox_DX2->SetValue(myStepV);
+
   displayPreview();
 }
 
@@ -473,12 +475,12 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_MultiTranslationDlg::createOperatio
 bool TransformationGUI_MultiTranslationDlg::isValid( QString& msg )
 {
   int aConstructorId = getConstructorId();
-  
+
   if(aConstructorId == 0)
     return !(myBase->_is_nil() || myVectorU->_is_nil());
   else if(aConstructorId == 1)
     return !(myBase->_is_nil() || myVectorU->_is_nil() || myVectorV->_is_nil());
-  return 0;        
+  return 0;
 }
 
 //=================================================================================
@@ -488,10 +490,10 @@ bool TransformationGUI_MultiTranslationDlg::isValid( QString& msg )
 bool TransformationGUI_MultiTranslationDlg::execute( ObjectList& objects )
 {
   bool res = false;
-  
+
   GEOM::GEOM_Object_var anObj;
 
-  switch ( getConstructorId() ) 
+  switch ( getConstructorId() )
     {
     case 0 :
       {
@@ -512,10 +514,10 @@ bool TransformationGUI_MultiTranslationDlg::execute( ObjectList& objects )
        break;
       }
     }
-  
+
   if ( !anObj->_is_nil() )
     objects.push_back( anObj._retn() );
-  
+
   return res;
 }
 
index 6a33e47e837a62d7d2064f5dc8e3ae38f88a5a9c..42ee42499519aca4c94d46808f5144292716ef49 100644 (file)
@@ -42,7 +42,7 @@ using namespace std;
 
 //=================================================================================
 // class    : TransformationGUI_OffsetDlg()
-// purpose  : Constructs a TransformationGUI_OffsetDlg which is a child of 'parent', with the 
+// purpose  : Constructs a TransformationGUI_OffsetDlg 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.
@@ -62,7 +62,7 @@ TransformationGUI_OffsetDlg::TransformationGUI_OffsetDlg(GeometryGUI* theGeometr
   RadioButton1->setPixmap(image0);
   RadioButton2->close(TRUE);
   RadioButton3->close(TRUE);
+
   GroupPoints = new DlgRef_1Sel1Spin1Check(this, "GroupPoints");
   GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
   GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
@@ -73,13 +73,13 @@ TransformationGUI_OffsetDlg::TransformationGUI_OffsetDlg(GeometryGUI* theGeometr
   GroupPoints->CheckButton1->hide();
 
   GroupPoints->PushButton1->setPixmap(image1);
-  
+
   Layout1->addWidget(GroupPoints, 2, 0);
-  
+
   /***************************************************************/
 
-  setHelpFileName("offset_surface.htm");  
-  
+  setHelpFileName("offset_surface.htm");
+
   Init();
 }
 
@@ -89,7 +89,7 @@ TransformationGUI_OffsetDlg::TransformationGUI_OffsetDlg(GeometryGUI* theGeometr
 // purpose  : Destroys the object and frees any allocated resources
 //=================================================================================
 TransformationGUI_OffsetDlg::~TransformationGUI_OffsetDlg()
-{  
+{
   /* no need to delete child widgets, Qt does it all for us */
 }
 
@@ -99,20 +99,18 @@ TransformationGUI_OffsetDlg::~TransformationGUI_OffsetDlg()
 // purpose  :
 //=================================================================================
 void TransformationGUI_OffsetDlg::Init()
-{  
+{
   /* init variables */
   myEditCurrentArgument = GroupPoints->LineEdit1;
   GroupPoints->LineEdit1->setReadOnly( true );
-  
+
   /* Get setting of step value from file configuration */
   double step = 1;
-   
+
   /* min, max, step and decimals for spin boxes & initial values */
-  GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
-  GroupPoints->SpinBox_DX->setPrecision(5);
-  //@ GroupPoints->SpinBox_DX->setDblPrecision(1e-05);    
+  GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
   GroupPoints->SpinBox_DX->SetValue(1e-05);
-  
+
   // Activate Create a Copy mode
   GroupPoints->CheckButton1->setChecked(true);
   CreateCopyModeChanged(true);
@@ -120,18 +118,17 @@ void TransformationGUI_OffsetDlg::Init()
   /* 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(myGeomGUI->getApp()->selectionMgr(), 
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
   connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
-  
+
   initName( tr( "GEOM_OFFSET" ) );
 
   globalSelection( GEOM_ALLSHAPES );
-  
 }
 
 
@@ -154,7 +151,7 @@ bool TransformationGUI_OffsetDlg::ClickOnApply()
 {
   if ( !onAccept( GroupPoints->CheckButton1->isChecked() ) )
     return false;
-  
+
   initName();
   return true;
 }
@@ -180,9 +177,9 @@ void TransformationGUI_OffsetDlg::SelectionIntoArgument()
   GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), myObjects);
   if (!myObjects.length())
     return;
-  
+
   myEditCurrentArgument->setText( aName );
-  
+
   displayPreview();
 }
 
@@ -209,7 +206,7 @@ void TransformationGUI_OffsetDlg::LineEditReturnPressed()
 void TransformationGUI_OffsetDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-  
+
   if(send == GroupPoints->PushButton1)
     {
       myEditCurrentArgument = GroupPoints->LineEdit1;
@@ -237,7 +234,7 @@ void TransformationGUI_OffsetDlg::enterEvent(QEvent * e)
 void TransformationGUI_OffsetDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   globalSelection( GEOM_ALLSHAPES );
   myEditCurrentArgument = GroupPoints->LineEdit1;
@@ -292,28 +289,28 @@ bool TransformationGUI_OffsetDlg::isValid( QString& msg )
 bool TransformationGUI_OffsetDlg::execute( ObjectList& objects )
 {
   bool res = false;
-  
+
   GEOM::GEOM_Object_var anObj;
-  
-  
+
   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() );
-      }
+    {
+      anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+        OffsetShapeCopy( myObjects[i], GetOffset() );
+      if ( !anObj->_is_nil() )
+        objects.push_back( anObj._retn() );
+    }
   else
     for (int i = 0; i < myObjects.length(); i++)
-      {
-       anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShape( myObjects[i], GetOffset() );
-       if ( !anObj->_is_nil() )
-         objects.push_back( anObj._retn() );
-      }
-     
+    {
+      anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+        OffsetShape( myObjects[i], GetOffset() );
+      if ( !anObj->_is_nil() )
+        objects.push_back( anObj._retn() );
+    }
+
   res = true;
-    
+
   return res;
 }
 
index 39f71533bbb9f416445b25d9fd7c161dc64e3029..51b85c60b7fd6a964a3609164bbfbd331dac32c6 100644 (file)
@@ -44,7 +44,7 @@ using namespace std;
 
 //=================================================================================
 // class    : TransformationGUI_RotationDlg()
-// purpose  : Constructs a TransformationGUI_RotationDlg which is a child of 'parent', with the 
+// purpose  : Constructs a TransformationGUI_RotationDlg 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.
@@ -88,16 +88,17 @@ TransformationGUI_RotationDlg::TransformationGUI_RotationDlg
 
   Layout1->addWidget(GroupPoints, 2, 0);
   /***************************************************************/
+
   double anAngle = 0;
   double SpecificStep = 5;
   /* min, max, step and decimals for spin boxes & initial values */
-  GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3);
+  GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
   GroupPoints->SpinBox_DX->SetValue(anAngle);
 
   // Activate Create a Copy mode
   GroupPoints->CheckButton1->setChecked(true);
   CreateCopyModeChanged(true);
-  
+
   /* signals and slots connections */
   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
@@ -107,14 +108,14 @@ TransformationGUI_RotationDlg::TransformationGUI_RotationDlg
   connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupPoints->PushButton4, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupPoints->PushButton5, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+
   connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
   connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
 
   connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
   connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
   connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
-  
+
   connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
 
@@ -143,9 +144,9 @@ void TransformationGUI_RotationDlg::Init()
   /* init variables */
   myEditCurrentArgument = GroupPoints->LineEdit1;
   GroupPoints->LineEdit2->clear();
-  
+
   myAxis = myCentPoint = myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
-  
+
   initName( tr( "GEOM_ROTATION" ) );
   ConstructorsClicked( 0 );
 }
@@ -157,14 +158,14 @@ void TransformationGUI_RotationDlg::Init()
 void TransformationGUI_RotationDlg::ConstructorsClicked(int constructorId)
 {
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-  
+
   myEditCurrentArgument = GroupPoints->LineEdit1;
   globalSelection();
 
   switch (constructorId)
     {
     case 0: /* rotation an object angle and axis */
-      {         
+      {
        GroupPoints->ShowRows(2,3,false);
        resize(0,0);
        GroupPoints->TextLabel2->setText(tr("GEOM_AXIS"));
@@ -186,11 +187,11 @@ void TransformationGUI_RotationDlg::ConstructorsClicked(int constructorId)
        GroupPoints->LineEdit5->clear();
        myCentPoint = myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
        break;
-      } 
+      }
     }
-  
+
   myEditCurrentArgument->setFocus();
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 }
 
@@ -213,7 +214,7 @@ bool TransformationGUI_RotationDlg::ClickOnApply()
 {
   if ( !onAccept( GroupPoints->CheckButton1->isChecked()) )
     return false;
-  
+
   initName();
   ConstructorsClicked( getConstructorId() );
   return true;
@@ -228,7 +229,7 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
 {
   myEditCurrentArgument->setText("");
   QString aName;
-  
+
   if(myEditCurrentArgument == GroupPoints->LineEdit1)
     {
       int aNbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aName);
@@ -241,7 +242,7 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
       if (!myObjects.length())
        return;
     }
-  else 
+  else
     {
       if(IObjectCount() != 1)
        {
@@ -273,7 +274,7 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
       aName = GEOMBase::GetName( aSelectedObject );
     }
   myEditCurrentArgument->setText( aName );
-  
+
   displayPreview();
 }
 
@@ -285,7 +286,7 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
 void TransformationGUI_RotationDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-  
+
   if(send == GroupPoints->PushButton1) {
     myEditCurrentArgument = GroupPoints->LineEdit1;
     globalSelection();
@@ -316,7 +317,7 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument()
 // purpose  :
 //=================================================================================
 void TransformationGUI_RotationDlg::LineEditReturnPressed()
-{  
+{
   QLineEdit* send = (QLineEdit*)sender();
   if(send == GroupPoints->LineEdit1 ||
      send == GroupPoints->LineEdit2)
@@ -334,7 +335,7 @@ void TransformationGUI_RotationDlg::LineEditReturnPressed()
 void TransformationGUI_RotationDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   ConstructorsClicked( getConstructorId() );
@@ -380,12 +381,12 @@ bool TransformationGUI_RotationDlg::isValid( QString& msg )
 {
   switch (getConstructorId())
     {
-    case 0: 
+    case 0:
       {
        return !(myObjects.length() == 0 || myAxis->_is_nil());
        break;
       }
-    case 1: 
+    case 1:
       {
        return !(myObjects.length() == 0 || myCentPoint->_is_nil() || myPoint1->_is_nil() || myPoint2->_is_nil() );
        break;
@@ -405,22 +406,24 @@ bool TransformationGUI_RotationDlg::execute( ObjectList& objects )
   bool toCreateCopy = IsPreview() || GroupPoints->CheckButton1->isChecked();
 
   GEOM::GEOM_Object_var anObj;
-  
-  switch ( getConstructorId() ) 
+
+  switch ( getConstructorId() )
     {
     case 0 :
       {
        if (toCreateCopy)
          for (int i = 0; i < myObjects.length(); i++)
            {
-             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->RotateCopy( myObjects[i], myAxis, GetAngle() * PI180 );
+             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+                RotateCopy( myObjects[i], myAxis, GetAngle() * PI180 );
              if ( !anObj->_is_nil() )
                objects.push_back( anObj._retn() );
            }
        else
          for (int i = 0; i < myObjects.length(); i++)
            {
-             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->Rotate( myObjects[i], myAxis, GetAngle() * PI180 );
+             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+                Rotate( myObjects[i], myAxis, GetAngle() * PI180 );
              if ( !anObj->_is_nil() )
                objects.push_back( anObj._retn() );
            }
@@ -432,14 +435,16 @@ bool TransformationGUI_RotationDlg::execute( ObjectList& objects )
        if (toCreateCopy)
          for (int i = 0; i < myObjects.length(); i++)
            {
-             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->RotateThreePointsCopy( myObjects[i], myCentPoint, myPoint1, myPoint2 );
+             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+                RotateThreePointsCopy( myObjects[i], myCentPoint, myPoint1, myPoint2 );
              if ( !anObj->_is_nil() )
                objects.push_back( anObj._retn() );
            }
        else
          for (int i = 0; i < myObjects.length(); i++)
            {
-             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->RotateThreePoints( myObjects[i], myCentPoint, myPoint1, myPoint2 );   
+             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+                RotateThreePoints( myObjects[i], myCentPoint, myPoint1, myPoint2 );    
              if ( !anObj->_is_nil() )
                objects.push_back( anObj._retn() );
            }
@@ -447,7 +452,7 @@ bool TransformationGUI_RotationDlg::execute( ObjectList& objects )
        break;
       }
     }
-  
+
   return res;
 }
 
index 40e6cc20aa2f78812369d0103b5210ca8ee17dd4..44ec3615a5a343bd850d7f0d4287f7b8cd77f5f2 100644 (file)
@@ -44,7 +44,7 @@ using namespace std;
 
 //=================================================================================
 // class    : TransformationGUI_ScaleDlg()
-// purpose  : Constructs a TransformationGUI_ScaleDlg which is a child of 'parent', with the 
+// purpose  : Constructs a TransformationGUI_ScaleDlg 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.
@@ -85,9 +85,9 @@ 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(COORD_MIN, COORD_MAX, SpecificStep, 3);
+  GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
   GroupPoints->SpinBox_DX->SetValue(aFactor);
-  
+
   // Activate Create a Copy mode
   GroupPoints->CheckButton1->setChecked(true);
   CreateCopyModeChanged(true);
@@ -95,18 +95,18 @@ TransformationGUI_ScaleDlg::TransformationGUI_ScaleDlg(GeometryGUI* theGeometryG
   /* 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->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  
+
   connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
   connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
 
   connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
   connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
-   
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
 
   setHelpFileName("scale_transform.htm");
@@ -120,7 +120,7 @@ TransformationGUI_ScaleDlg::TransformationGUI_ScaleDlg(GeometryGUI* theGeometryG
 // purpose  : Destroys the object and frees any allocated resources
 //=================================================================================
 TransformationGUI_ScaleDlg::~TransformationGUI_ScaleDlg()
-{  
+{
   /* no need to delete child widgets, Qt does it all for us */
 }
 
@@ -133,9 +133,9 @@ void TransformationGUI_ScaleDlg::Init()
 {
   myEditCurrentArgument = GroupPoints->LineEdit1;
   GroupPoints->LineEdit2->clear();
-  
+
   myPoint = GEOM::GEOM_Object::_nil();
-  
+
   initName( tr( "GEOM_SCALE" ) );
 }
 
@@ -200,7 +200,7 @@ void TransformationGUI_ScaleDlg::SelectionIntoArgument()
       aName = GEOMBase::GetName( myPoint );
     }
   myEditCurrentArgument->setText( aName );
-  
+
   displayPreview();
 }
 
@@ -228,7 +228,7 @@ void TransformationGUI_ScaleDlg::LineEditReturnPressed()
 void TransformationGUI_ScaleDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-  
+
   if(send == GroupPoints->PushButton1) {
     myEditCurrentArgument = GroupPoints->LineEdit1;
     globalSelection();
@@ -237,7 +237,7 @@ void TransformationGUI_ScaleDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints->LineEdit2;
     globalSelection( GEOM_POINT );
   }
-  
+
   myEditCurrentArgument->setFocus();
   SelectionIntoArgument();
 }
@@ -250,7 +250,7 @@ void TransformationGUI_ScaleDlg::SetEditCurrentArgument()
 void TransformationGUI_ScaleDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   globalSelection();
   GroupPoints->LineEdit1->setFocus();
@@ -305,25 +305,27 @@ bool TransformationGUI_ScaleDlg::isValid( QString& msg )
 bool TransformationGUI_ScaleDlg::execute( ObjectList& objects )
 {
   bool res = false;
-  
+
   GEOM::GEOM_Object_var anObj;
 
   if (GroupPoints->CheckButton1->isChecked() || IsPreview())
     for (int i = 0; i < myObjects.length(); i++)
       {
-       anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->ScaleShapeCopy( myObjects[i], myPoint, GetFactor() );
+       anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+          ScaleShapeCopy( myObjects[i], myPoint, GetFactor() );
        if ( !anObj->_is_nil() )
          objects.push_back( anObj._retn() );
       }
   else
     for (int i = 0; i < myObjects.length(); i++)
       {
-       anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->ScaleShape( myObjects[i], myPoint, GetFactor() );
+       anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+          ScaleShape( myObjects[i], myPoint, GetFactor() );
        if ( !anObj->_is_nil() )
          objects.push_back( anObj._retn() );
       }
   res = true;
-  
+
   return res;
 }
 
index 5e022bc8817c9a6972986ff9ade5b47cf9c87aa9..aa29811d3589c5096f9416855844e5b953652c42 100644 (file)
@@ -33,8 +33,8 @@
 #include "SalomeApp_Application.h"
 #include "LightApp_SelectionMgr.h"
 
-#include <qcheckbox.h>
 #include <qlabel.h>
+#include <qcheckbox.h>
 
 #include "GEOMImpl_Types.hxx"
 
@@ -44,15 +44,15 @@ using namespace std;
 
 //=================================================================================
 // class    : TransformationGUI_TranslationDlg()
-// purpose  : Constructs a TransformationGUI_TranslationDlg which is a child of 'parent', with the 
+// purpose  : Constructs a TransformationGUI_TranslationDlg 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.
 //=================================================================================
 TransformationGUI_TranslationDlg::TransformationGUI_TranslationDlg
   (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)
+  : GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
+                      WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
   SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
   QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_DXYZ")));
@@ -84,9 +84,9 @@ TransformationGUI_TranslationDlg::TransformationGUI_TranslationDlg
 
   Layout1->addWidget(GroupPoints, 2, 0);
   /***************************************************************/
-  
+
   setHelpFileName("translation.htm");
-  
+
   Init();
 }
 
@@ -112,26 +112,26 @@ void TransformationGUI_TranslationDlg::Init()
   GroupPoints->LineEdit1->setReadOnly(true);
   GroupPoints->LineEdit2->setReadOnly(true);
   GroupPoints->LineEdit3->setReadOnly(true);
-  
+
   myVector = myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
-  
+
   // Activate Create a Copy mode
   GroupPoints->CheckBox1->setChecked(true);
   CreateCopyModeChanged(true);
-  
+
   /* 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->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->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupPoints->SpinBox2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+  GroupPoints->SpinBox3->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+
   GroupPoints->SpinBox1->SetValue(0.0);
   GroupPoints->SpinBox2->SetValue(0.0);
   GroupPoints->SpinBox3->SetValue(0.0);
-  
+
   /* signals and slots connections */
   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
@@ -146,15 +146,15 @@ void TransformationGUI_TranslationDlg::Init()
   connect(GroupPoints->SpinBox1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
   connect(GroupPoints->SpinBox2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
   connect(GroupPoints->SpinBox3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
-  
+
   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox1, SLOT(SetStep(double)));
   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox2, SLOT(SetStep(double)));
   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox3, SLOT(SetStep(double)));
-  
+
   connect(GroupPoints->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
-  
-  connect(myGeomGUI->getApp()->selectionMgr(), 
-         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+
+  connect(myGeomGUI->getApp()->selectionMgr(),
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   initName( tr( "GEOM_TRANSLATION" ) );
   ConstructorsClicked( 0 );
@@ -167,15 +167,16 @@ void TransformationGUI_TranslationDlg::Init()
 //=================================================================================
 void TransformationGUI_TranslationDlg::ConstructorsClicked(int constructorId)
 {
+  erasePreview();
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-  
+
   myEditCurrentArgument = GroupPoints->LineEdit1;
   globalSelection();
 
   switch (constructorId)
     {
     case 0: /* translation an object by dx, dy, dz */
-      {         
+      {
        GroupPoints->ShowRows(1,2,false);
        resize(0,0);
        GroupPoints->ShowRows(3,5,true);
@@ -191,7 +192,7 @@ void TransformationGUI_TranslationDlg::ConstructorsClicked(int constructorId)
        GroupPoints->LineEdit3->clear();
        myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
        break;
-      } 
+      }
     case 2: /* translation an object by vector */
       {
        GroupPoints->ShowRows(2,5,false);
@@ -203,9 +204,9 @@ void TransformationGUI_TranslationDlg::ConstructorsClicked(int constructorId)
        break;
       }
     }
-  
+
   myEditCurrentArgument->setFocus();
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 }
 
@@ -229,9 +230,8 @@ bool TransformationGUI_TranslationDlg::ClickOnApply()
 {
   if ( !onAccept(GroupPoints->CheckBox1->isChecked()) )
     return false;
-  
+
   initName();
-  ConstructorsClicked( getConstructorId() );
   return true;
 }
 
@@ -244,50 +244,49 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument()
 {
   myEditCurrentArgument->setText("");
   QString aName;
-  
-  if(myEditCurrentArgument == GroupPoints->LineEdit1)
+
+  if (myEditCurrentArgument == GroupPoints->LineEdit1)
+  {
+    int aNbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aName);
+
+    if (aNbSel < 1)
     {
-      int aNbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aName);
-      
-      if(aNbSel < 1)
-       {
-         myObjects.length(0);
-         return;
-       }
-      GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), myObjects);
-      if (!myObjects.length())
-       return;
+      myObjects.length(0);
+      return;
     }
+    GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), myObjects);
+    if (!myObjects.length())
+      return;
+  }
   else
-    {
-      if (IObjectCount() != 1) {
-       if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
-         myPoint1 = GEOM::GEOM_Object::_nil();
-       else if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
-         myVector = GEOM::GEOM_Object::_nil();
-       else if(myEditCurrentArgument == GroupPoints->LineEdit3)
-         myPoint2 = GEOM::GEOM_Object::_nil();
-       return;
-      }
-      
-      Standard_Boolean testResult = Standard_False;;
-      GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
-      
-      if (!testResult || CORBA::is_nil( aSelectedObject ))
-       return;
-      
-      if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
-       myPoint1 = aSelectedObject;
-      else if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
-       myVector = aSelectedObject;
-      else if(myEditCurrentArgument == GroupPoints->LineEdit3)
-       myPoint2 = aSelectedObject; 
-      
-      aName = GEOMBase::GetName( aSelectedObject );
+  {
+    if (IObjectCount() != 1) {
+      if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
+        myPoint1 = GEOM::GEOM_Object::_nil();
+      else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
+        myVector = GEOM::GEOM_Object::_nil();
+      else if (myEditCurrentArgument == GroupPoints->LineEdit3)
+        myPoint2 = GEOM::GEOM_Object::_nil();
+      return;
     }
-  
+
+    Standard_Boolean testResult = Standard_False;
+    GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult);
+
+    if (!testResult || CORBA::is_nil( aSelectedObject ))
+      return;
+
+    if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
+      myPoint1 = aSelectedObject;
+    else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
+      myVector = aSelectedObject;
+    else if (myEditCurrentArgument == GroupPoints->LineEdit3)
+      myPoint2 = aSelectedObject;
+
+    aName = GEOMBase::GetName( aSelectedObject );
+  }
+
   myEditCurrentArgument->setText( aName );
-  
   displayPreview();
 }
 
@@ -299,11 +298,11 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument()
 void TransformationGUI_TranslationDlg::LineEditReturnPressed()
 {
   QLineEdit* send = (QLineEdit*)sender();
-  if(send == GroupPoints->LineEdit1)
-    {
-      myEditCurrentArgument = send;
-      GEOMBase_Skeleton::LineEditReturnPressed();
-    }
+  if (send == GroupPoints->LineEdit1)
+  {
+    myEditCurrentArgument = send;
+    GEOMBase_Skeleton::LineEditReturnPressed();
+  }
 }
 
 
@@ -312,26 +311,23 @@ void TransformationGUI_TranslationDlg::LineEditReturnPressed()
 // purpose  :
 //=================================================================================
 void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
-{    
+{
   QPushButton* send = (QPushButton*)sender();
-  
-  if(send == GroupPoints->PushButton1) 
-    {
-      myEditCurrentArgument = GroupPoints->LineEdit1;
-      globalSelection();
-    }
-  else if (send == GroupPoints->PushButton2)
-    {
-      myEditCurrentArgument = GroupPoints->LineEdit2;
-      getConstructorId() == 1 ? globalSelection( GEOM_POINT ) :
-                               globalSelection( GEOM_LINE  );
-    }
-  else if (send == GroupPoints->PushButton3)
-    {
-      myEditCurrentArgument = GroupPoints->LineEdit3;
-      globalSelection( GEOM_POINT );
-    }
-  
+
+  if (send == GroupPoints->PushButton1) {
+    myEditCurrentArgument = GroupPoints->LineEdit1;
+    globalSelection();
+  }
+  else if (send == GroupPoints->PushButton2) {
+    myEditCurrentArgument = GroupPoints->LineEdit2;
+    getConstructorId() == 1 ? globalSelection( GEOM_POINT ) :
+                              globalSelection( GEOM_LINE  );
+  }
+  else if (send == GroupPoints->PushButton3) {
+    myEditCurrentArgument = GroupPoints->LineEdit3;
+    globalSelection( GEOM_POINT );
+  }
+
   myEditCurrentArgument->setFocus();
   SelectionIntoArgument();
 }
@@ -344,7 +340,8 @@ void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
 void TransformationGUI_TranslationDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(myGeomGUI->getApp()->selectionMgr(), 
+
+  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   ConstructorsClicked( getConstructorId() );
@@ -357,7 +354,7 @@ void TransformationGUI_TranslationDlg::ActivateThisDialog()
 //=================================================================================
 void TransformationGUI_TranslationDlg::enterEvent(QEvent* e)
 {
-  if(!GroupConstructors->isEnabled())
+  if (!GroupConstructors->isEnabled())
     ActivateThisDialog();
 }
 
@@ -378,7 +375,7 @@ void TransformationGUI_TranslationDlg::ValueChangedInSpinBox()
 //=================================================================================
 GEOM::GEOM_IOperations_ptr  TransformationGUI_TranslationDlg::createOperation()
 {
-  return myGeomGUI->GetGeomGen()->GetITransformOperations( getStudyId() );
+  return getGeomEngine()->GetITransformOperations( getStudyId() );
 }
 
 
@@ -389,24 +386,24 @@ GEOM::GEOM_IOperations_ptr  TransformationGUI_TranslationDlg::createOperation()
 bool  TransformationGUI_TranslationDlg::isValid( QString& msg )
 {
   int aConstructorId = getConstructorId();
-  
+
   switch (aConstructorId)
     {
-    case 0: 
+    case 0:
       {
        return !(myObjects.length() == 0 );
        break;
       }
-    case 1: 
+    case 1:
       {
        return !(myObjects.length() == 0 || myPoint1->_is_nil() || myPoint2->_is_nil() );
        break;
       }
-    case 2: 
+    case 2:
       {
        return !(myObjects.length() == 0 || myVector->_is_nil());
        break;
-      } 
+      }
     default: return false;
     }
 }
@@ -419,12 +416,12 @@ bool TransformationGUI_TranslationDlg::execute( ObjectList& objects )
 {
   bool res = false;
   bool toCreateCopy = IsPreview() || GroupPoints->CheckBox1->isChecked();
-  
+
   GEOM::GEOM_Object_var anObj;
 
-  switch ( getConstructorId() ) 
+  switch ( getConstructorId() )
     {
-    case 0 :
+    case 0:
       {
        double dx = GroupPoints->SpinBox1->GetValue();
        double dy = GroupPoints->SpinBox2->GetValue();
@@ -433,33 +430,37 @@ bool TransformationGUI_TranslationDlg::execute( ObjectList& objects )
        if (toCreateCopy)
          for (int i = 0; i < myObjects.length(); i++)
            {
-             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateDXDYDZCopy( myObjects[i], dx, dy, dz );
+             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+                TranslateDXDYDZCopy( myObjects[i], dx, dy, dz );
              if ( !anObj->_is_nil() )
                objects.push_back( anObj._retn() );
            }
        else
          for (int i = 0; i < myObjects.length(); i++)
            {
-             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateDXDYDZ( myObjects[i], dx, dy, dz );
+             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+                TranslateDXDYDZ( myObjects[i], dx, dy, dz );
              if ( !anObj->_is_nil() )
                objects.push_back( anObj._retn() );
            }
        res = true;
        break;
       }
-    case 1 :
+    case 1:
       {
        if (toCreateCopy)
          for (int i = 0; i < myObjects.length(); i++)
            {
-             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateTwoPointsCopy( myObjects[i], myPoint1, myPoint2 );
+             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+                TranslateTwoPointsCopy( myObjects[i], myPoint1, myPoint2 );
              if ( !anObj->_is_nil() )
                objects.push_back( anObj._retn() );
            }
        else
          for (int i = 0; i < myObjects.length(); i++)
            {
-             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateTwoPoints( myObjects[i], myPoint1, myPoint2 );       
+             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+                TranslateTwoPoints( myObjects[i], myPoint1, myPoint2 );        
              if ( !anObj->_is_nil() )
                objects.push_back( anObj._retn() );
            }
@@ -471,14 +472,16 @@ bool TransformationGUI_TranslationDlg::execute( ObjectList& objects )
        if (toCreateCopy)
          for (int i = 0; i < myObjects.length(); i++)
            {
-             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateVectorCopy( myObjects[i], myVector );
+             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+                TranslateVectorCopy( myObjects[i], myVector );
              if ( !anObj->_is_nil() )
                objects.push_back( anObj._retn() );
            }
        else
          for (int i = 0; i < myObjects.length(); i++)
            {
-             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateVector( myObjects[i], myVector );
+             anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+                TranslateVector( myObjects[i], myVector );
              if ( !anObj->_is_nil() )
                objects.push_back( anObj._retn() );
            }
@@ -486,19 +489,8 @@ bool TransformationGUI_TranslationDlg::execute( ObjectList& objects )
        break;
       }
     }
-  
-  return res;
-}
 
-
-//=================================================================================
-// function : closeEvent
-// purpose  :
-//=================================================================================
-void  TransformationGUI_TranslationDlg::closeEvent( QCloseEvent* e )
-{
-  // myGeomGUI->SetState( -1 );
-  GEOMBase_Skeleton::closeEvent( e );
+  return res;
 }
 
 
index 338c3ab154fc4d631f8430efdbf94789fae79823..dac586af04be5ff612f95c32bf612985343dadce 100644 (file)
@@ -51,9 +51,7 @@ protected:
     virtual bool isValid( QString& );
     virtual bool execute( ObjectList& objects );
 
-    virtual void closeEvent( QCloseEvent* e );
-
-private :
+private:
     void Init();
     void enterEvent(QEvent* e);
 
@@ -69,8 +67,8 @@ private slots :
     void LineEditReturnPressed();
     void SelectionIntoArgument();
     void SetEditCurrentArgument();
-    void ValueChangedInSpinBox();
     void ConstructorsClicked(int constructorId);
+    void ValueChangedInSpinBox();
     void CreateCopyModeChanged(bool isCreateCopy);
 };