Salome HOME
Merge from V6_main 28/02/2013
authorvsr <vsr@opencascade.com>
Thu, 28 Feb 2013 15:07:35 +0000 (15:07 +0000)
committervsr <vsr@opencascade.com>
Thu, 28 Feb 2013 15:07:35 +0000 (15:07 +0000)
115 files changed:
build_cmake
build_cmake.bat
doc/salome/examples/Makefile.am
doc/salome/examples/filters_ex13.py
doc/salome/examples/filters_ex14.py
doc/salome/examples/filters_ex31.py
doc/salome/examples/modifying_meshes_ex10.py
doc/salome/examples/quality_controls_ex01.py
doc/salome/examples/quality_controls_ex02.py
doc/salome/examples/quality_controls_ex03.py
doc/salome/examples/testme.py
doc/salome/examples/transforming_meshes_ex04.py
doc/salome/examples/transforming_meshes_ex11.py
doc/salome/examples/viewing_meshes_ex02.py
doc/salome/gui/SMESH/doxyfile.in
doc/salome/gui/SMESH/input/smeshpy_interface.doc
doc/salome/gui/SMESH/input/tui_cartesian_algo.doc
doc/salome/gui/SMESH/input/tui_creating_meshes.doc
doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc
doc/salome/gui/SMESH/input/tui_filters.doc
doc/salome/gui/SMESH/input/tui_generate_flat_elements.doc
doc/salome/gui/SMESH/input/tui_grouping_elements.doc
doc/salome/gui/SMESH/input/tui_measurements.doc
doc/salome/gui/SMESH/input/tui_modifying_meshes.doc
doc/salome/gui/SMESH/input/tui_notebook_smesh.doc
doc/salome/gui/SMESH/input/tui_prism_3d_algo.doc
doc/salome/gui/SMESH/input/tui_quality_controls.doc
doc/salome/gui/SMESH/input/tui_transforming_meshes.doc
doc/salome/gui/SMESH/input/tui_use_existing_faces.doc
doc/salome/gui/SMESH/input/tui_viewing_meshes.doc
src/DriverGMF/DriverGMF_Read.cxx
src/DriverGMF/DriverGMF_Write.cxx
src/SMDS/SMDS_Downward.cxx
src/SMESH/SMESH_Algo.cxx
src/SMESH/SMESH_Algo.hxx
src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESH/SMESH_MesherHelper.hxx
src/SMESH/SMESH_subMesh.cxx
src/SMESH/SMESH_subMesh.hxx
src/SMESHDS/SMESHDS_Hypothesis.hxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h
src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx
src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.h
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h
src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
src/SMESHGUI/SMESHGUI_ClippingDlg.h
src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx
src/SMESHGUI/SMESHGUI_CopyMeshDlg.h
src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePatternDlg.h
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h
src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx
src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h
src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx
src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.h
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.h
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.h
src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx
src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.h
src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx
src/SMESHGUI/SMESHGUI_GroupOpDlg.h
src/SMESHGUI/SMESHGUI_MergeDlg.cxx
src/SMESHGUI/SMESHGUI_MergeDlg.h
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
src/SMESHGUI/SMESHGUI_MeshPatternDlg.h
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.h
src/SMESHGUI/SMESHGUI_NodesDlg.cxx
src/SMESHGUI/SMESHGUI_NodesDlg.h
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h
src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h
src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx
src/SMESHGUI/SMESHGUI_RenumberingDlg.h
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RevolutionDlg.h
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.h
src/SMESHGUI/SMESHGUI_ScaleDlg.cxx
src/SMESHGUI/SMESHGUI_ScaleDlg.h
src/SMESHGUI/SMESHGUI_SewingDlg.cxx
src/SMESHGUI/SMESHGUI_SewingDlg.h
src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx
src/SMESHGUI/SMESHGUI_SingleEditDlg.h
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.h
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.h
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.h
src/SMESHUtils/SMESH_TypeDefs.hxx
src/StdMeshers/StdMeshers_Import_1D.cxx
src/StdMeshers/StdMeshers_Prism_3D.cxx
src/StdMeshers/StdMeshers_ProjectionUtils.cxx
src/StdMeshers/StdMeshers_ProjectionUtils.hxx
src/StdMeshers/StdMeshers_Projection_1D.cxx
src/StdMeshers/StdMeshers_Projection_1D2D.cxx
src/StdMeshers/StdMeshers_Projection_2D.cxx
src/StdMeshers/StdMeshers_Projection_3D.cxx
src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx
src/StdMeshers/StdMeshers_RadialPrism_3D.cxx
src/StdMeshers/StdMeshers_ViscousLayers.cxx
src/StdMeshers/StdMeshers_ViscousLayers2D.cxx

index 01bb2ac7f6ea9927f174e938f6676e2dcaf3804e..30eeb733d64dfb8f1749b9ed979919dc99028f5f 100755 (executable)
@@ -21,7 +21,7 @@
 CURRENT_DIR=`pwd`
 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
 cd ${CONF_DIR}
-python $KERNEL_ROOT_DIR/salome_adm/cmake_files/am2cmake.py --smesh
+python $KERNEL_ROOT_DIR/salome_adm/cmake_files/deprecated/am2cmake.py --smesh
 status=$?
 cd ${CURRENT_DIR}
 exit $status
index 890adcdff07b6535d4edc1d866d5fad55092fafb..38e8e726bbfc65ce3b92a008e2b70121730523e7 100644 (file)
@@ -17,4 +17,4 @@
 @REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 @REM
 
-%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --smesh\r
+%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\deprecated\am2cmake.py --smesh\r
index 930edd9fc894ff6c0ccaced9a3020337e29b6ff8..6a5904b9155d40ae7726f8ae10e1f5095ef003c6 100644 (file)
@@ -26,16 +26,34 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 pyexamplesdir = $(docdir)/examples/SMESH
 
-BAD_TESTS = 
+BAD_TESTS = \
+       3dmesh.py \
+       creating_meshes_ex01.py \
+       creating_meshes_ex03.py \
+       creating_meshes_ex05.py \
+       defining_hypotheses_ex06.py \
+       defining_hypotheses_ex09.py \
+       defining_hypotheses_ex17.py \
+       filters_ex02.py \
+       filters_ex08.py \
+       filters_ex23.py \
+       filters_ex24.py \
+       filters_ex25.py \
+       filters_ex32.py \
+       filters_ex35.py \
+       generate_flat_elements.py \
+       modifying_meshes_ex26.py \
+       notebook_smesh.py \
+       quality_controls_ex06.py \
+       quality_controls_ex20.py \
+       quality_controls_ex21.py \
+       quality_controls_ex22.py \
+       viewing_meshes_ex01.py 
 
 GOOD_TESTS = \
-       3dmesh.py \
        cartesian_algo.py \
-       creating_meshes_ex01.py \
        creating_meshes_ex02.py \
-       creating_meshes_ex03.py \
        creating_meshes_ex04.py \
-       creating_meshes_ex05.py \
        creating_meshes_ex06.py \
        creating_meshes_ex07.py \
        creating_meshes_ex08.py \
@@ -44,10 +62,8 @@ GOOD_TESTS = \
        defining_hypotheses_ex03.py \
        defining_hypotheses_ex04.py \
        defining_hypotheses_ex05.py \
-       defining_hypotheses_ex06.py \
        defining_hypotheses_ex07.py \
        defining_hypotheses_ex08.py \
-       defining_hypotheses_ex09.py \
        defining_hypotheses_ex10.py \
        defining_hypotheses_ex11.py \
        defining_hypotheses_ex12.py \
@@ -55,15 +71,12 @@ GOOD_TESTS = \
        defining_hypotheses_ex14.py \
        defining_hypotheses_ex15.py \
        defining_hypotheses_ex16.py \
-       defining_hypotheses_ex17.py \
        filters_ex01.py \
-       filters_ex02.py \
        filters_ex03.py \
        filters_ex04.py \
        filters_ex05.py \
        filters_ex06.py \
        filters_ex07.py \
-       filters_ex08.py \
        filters_ex09.py \
        filters_ex10.py \
        filters_ex11.py \
@@ -78,21 +91,15 @@ GOOD_TESTS = \
        filters_ex20.py \
        filters_ex21.py \
        filters_ex22.py \
-       filters_ex23.py \
-       filters_ex24.py \
-       filters_ex25.py \
        filters_ex26.py \
        filters_ex27.py \
        filters_ex28.py \
        filters_ex29.py \
        filters_ex30.py \
        filters_ex31.py \
-       filters_ex32.py \
        filters_ex33.py \
        filters_ex34.py \
-       filters_ex35.py \
        filters_ex36.py \
-       generate_flat_elements.py \
        grouping_elements_ex01.py \
        grouping_elements_ex02.py \
        grouping_elements_ex03.py \
@@ -128,15 +135,12 @@ GOOD_TESTS = \
        modifying_meshes_ex23.py \
        modifying_meshes_ex24.py \
        modifying_meshes_ex25.py \
-       modifying_meshes_ex26.py \
-       notebook_smesh.py \
        prism_3d_algo.py \
        quality_controls_ex01.py \
        quality_controls_ex02.py \
        quality_controls_ex03.py \
        quality_controls_ex04.py \
        quality_controls_ex05.py \
-       quality_controls_ex06.py \
        quality_controls_ex07.py \
        quality_controls_ex08.py \
        quality_controls_ex09.py \
@@ -150,9 +154,6 @@ GOOD_TESTS = \
        quality_controls_ex17.py \
        quality_controls_ex18.py \
        quality_controls_ex19.py \
-       quality_controls_ex20.py \
-       quality_controls_ex21.py \
-       quality_controls_ex22.py \
        transforming_meshes_ex01.py \
        transforming_meshes_ex02.py \
        transforming_meshes_ex03.py \
@@ -167,14 +168,13 @@ GOOD_TESTS = \
        transforming_meshes_ex12.py \
        transforming_meshes_ex13.py \
        use_existing_faces.py \
-       viewing_meshes_ex01.py \
        viewing_meshes_ex02.py
 
 pyexamples_SCRIPTS = $(BAD_TESTS) $(GOOD_TESTS)
 
 EXTRA_DIST += $(pyexamples_SCRIPTS) testme.py
 
-check-local:
+installcheck-local:
        @for f in $(GOOD_TESTS) ; do \
-         python $(top_srcdir)/doc/salome/examples/testme.py $(top_srcdir)/doc/salome/examples/$$f || exit 1; \
+         env SMESH_ROOT_DIR=$(prefix) python -B $(top_srcdir)/doc/salome/examples/testme.py $(top_srcdir)/doc/salome/examples/$$f || exit 1; \
        done
index d5415e20a4fefef4f8de1e084e759f2fc2e90918..e20937d1b43526bfc3abab05f723a9b4a4529e38 100644 (file)
@@ -3,7 +3,7 @@
 # create mesh
 from SMESH_mechanic import *
 # remove some faces to have faces with bare borders
-mesh.RemoveElements( mesh.GetElementsByType(FACE)[0:5] )
+mesh.RemoveElements( mesh.GetElementsByType(smesh.FACE)[0:5] )
 # get all faces bare borders
 filter = smesh.GetFilter(smesh.FACE, smesh.FT_BareBorderFace)
 ids = mesh.GetIdsFromFilter(filter)
index 45c356cdfb140e2ebd87661e3ec1533635e462db..01ea27ab92bf14b16f4f76f29bcd1ccb14806fd4 100644 (file)
@@ -2,7 +2,7 @@
 
 # create mesh
 from SMESH_mechanic import *
-faceID = mesh.GetElementsByType(FACE)[0]
+faceID = mesh.GetElementsByType(smesh.FACE)[0]
 # get all faces co-planar to the first face with tolerance 5 degrees
 filter = smesh.GetFilter(smesh.FACE, smesh.FT_CoplanarFaces,faceID,Tolerance=5.0)
 ids = mesh.GetIdsFromFilter(filter)
index a20f7d70833aef5e7b820ba1d8faa009861f4e62..4a2acbfa85954f268692f34b0b2e4ef2d4e907de 100644 (file)
@@ -3,9 +3,9 @@
 # create mesh
 from SMESH_mechanic import *
 # get nodes with identifiers [5-10] and [15-30]
-criterion1 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Treshold="5-10",\
+criterion1 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Threshold="5-10",\
                                 BinaryOp=smesh.FT_LogicalOR)
-criterion2 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Treshold="15-30")
+criterion2 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Threshold="15-30")
 filter = smesh.CreateFilterManager().CreateFilter()
 filter.SetCriteria([criterion1,criterion2])
 ids = mesh.GetIdsFromFilter(filter)
index 7f36728c15caf27a2a8ccc98a0161a837cf6afad..1d1af1942247330ed82e636ece22a813a155df43 100644 (file)
@@ -1,6 +1,7 @@
 # Add Polyhedron
 
 import salome
+import smesh
 import math
 
 # create an empty mesh structure
@@ -39,18 +40,18 @@ for i in range(5):
     pass
 
 # Create a polyhedral volume (12-hedron with pentagonal faces)
-MeshEditor.AddPolyhedralVolume([dd[0], dd[1], dd[2], dd[3], dd[4],  # top
-                                dd[0], cc[0], bb[1], cc[1], dd[1],  # -
-                                dd[1], cc[1], bb[2], cc[2], dd[2],  # -
-                                dd[2], cc[2], bb[3], cc[3], dd[3],  # - below top
-                                dd[3], cc[3], bb[4], cc[4], dd[4],  # -
-                                dd[4], cc[4], bb[0], cc[0], dd[0],  # -
-                                aa[4], bb[4], cc[4], bb[0], aa[0],  # .
-                                aa[3], bb[3], cc[3], bb[4], aa[4],  # .
-                                aa[2], bb[2], cc[2], bb[3], aa[3],  # . above bottom
-                                aa[1], bb[1], cc[1], bb[2], aa[2],  # .
-                                aa[0], bb[0], cc[0], bb[1], aa[1],  # .
-                                aa[0], aa[1], aa[2], aa[3], aa[4]], # bottom
-                               [5,5,5,5,5,5,5,5,5,5,5,5])
+mesh.GetMeshEditor().AddPolyhedralVolume([dd[0], dd[1], dd[2], dd[3], dd[4],  # top
+                                          dd[0], cc[0], bb[1], cc[1], dd[1],  # -
+                                          dd[1], cc[1], bb[2], cc[2], dd[2],  # -
+                                          dd[2], cc[2], bb[3], cc[3], dd[3],  # - below top
+                                          dd[3], cc[3], bb[4], cc[4], dd[4],  # -
+                                          dd[4], cc[4], bb[0], cc[0], dd[0],  # -
+                                          aa[4], bb[4], cc[4], bb[0], aa[0],  # .
+                                          aa[3], bb[3], cc[3], bb[4], aa[4],  # .
+                                          aa[2], bb[2], cc[2], bb[3], aa[3],  # . above bottom
+                                          aa[1], bb[1], cc[1], bb[2], aa[2],  # .
+                                          aa[0], bb[0], cc[0], bb[1], aa[1],  # .
+                                          aa[0], aa[1], aa[2], aa[3], aa[4]], # bottom
+                                         [5,5,5,5,5,5,5,5,5,5,5,5])
 
 salome.sg.updateObjBrowser(1)
index ed4dc244ed7fe5dbd3d3633a56c7a21e7977afd3..f411d2e61562a1a926c441b6e3ddd2ac9a74d04f 100644 (file)
@@ -35,7 +35,7 @@ for i in range(len(anIds)):
 print ""
 
 # create a group
-aGroup = mesh.CreateGroup(SMESH.EDGE, "Free borders")
+aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Free borders")
 aGroup.Add(anIds)
 
 salome.sg.updateObjBrowser(1)
index 7b1f55e6fc5aca88cb4507986992a68093df42af..5373c4d6fdd9dec843588cbd347137a816dc82b7 100644 (file)
@@ -38,7 +38,7 @@ for i in range(len(anIds)):
 print ""
 
 # create a group
-aGroup = mesh.CreateGroup(SMESH.EDGE, "Borders at multi-connections")
+aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Borders at multi-connections")
 aGroup.Add(anIds)
 
 salome.sg.updateObjBrowser(1)
index 8cb409866181c3672f49c8c25832264234b631be..eaa607b94aa671a29703c07d6dd888ca45f78958 100644 (file)
@@ -37,7 +37,7 @@ for i in range(len(anIds)):
 print ""
 
 # create a group
-aGroup = mesh.CreateGroup(SMESH.EDGE, "Edges with length > " + `length_margin`)
+aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Edges with length > " + `length_margin`)
 aGroup.Add(anIds)
 
 salome.sg.updateObjBrowser(1)
index b1328b5967c810501d98fbfa7b1957fb67267fb3..c870ab656b0bf27485ec4fb03a260c49bf964cb9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-import unittest, sys
+import unittest, sys, os
 
 class SalomeSession(object):
     def __init__(self, script):
@@ -10,11 +10,10 @@ class SalomeSession(object):
         sys.argv += ["--modules=GEOM,MED,SMESH"]
         sys.argv += ["--execute=%s" % script]
         clt, d = runSalome.main()
-        self.port = d['port']
         return
 
     def __del__(self):
-        port = self.port
+        port = os.getenv('NSPORT')
         import killSalomeWithPort
         killSalomeWithPort.killMyPort(port)
         return
index ea7c72f540bddb42c944921f673cbb7b7ec9fac6..0bfea6188467d331ea2629dc53fae82fc21ad7fb 100644 (file)
@@ -8,6 +8,6 @@ smesh = SMESH_mechanic.smesh
 mesh = SMESH_mechanic.mesh 
 
 # create a symmetrical copy of the mesh mirrored through a point
-axis = SMESH.AxisStruct(0, 0, 0, 0, 0, 0)
+axis = smesh.AxisStruct(0, 0, 0, 0, 0, 0)
 
 mesh.Mirror([], axis, smesh.POINT, 1)
index 55fbe8f2853449e578551aadb1c0c1d02630dbd3..f94aafeda106e3e17794a49ea68a7028aa9ebe2b 100644 (file)
@@ -1,10 +1,18 @@
 # Duplicate nodes
 
 import salome
+import geompy
 import smesh
-import SMESH_test1
 
-mesh = SMESH_test1.mesh
+# Create a box
+
+box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
+
+# Define hexa mesh on a box
+mesh = smesh.Mesh(box, "Mesh")
+mesh.Segment().NumberOfSegments(7)
+mesh.Quadrangle()
+mesh.Hexahedron()
 
 # Compute mesh
 mesh.Compute()
@@ -13,53 +21,53 @@ mesh.Compute()
 
 # Nodes to duplicate
 nodes1 = mesh.CreateEmptyGroup( smesh.NODE, 'nodes1' )
-nodes1.Add( [ 289, 278, 302, 285 ] )
+nodes1.Add( [ 119, 125, 131, 137 ] )
 
 # Group of faces to replace nodes with new ones 
 faces1 = mesh.CreateEmptyGroup( smesh.FACE, 'faces1' )
-faces1.Add( [ 519, 556, 557 ] )
+faces1.Add( [ 144, 151, 158 ] )
 
 # Duplicate nodes
 print "\nMesh before the first nodes duplication:"
-print "Nodes      : ", mesh.NbNodes()
-print "Edges      : ", mesh.NbEdges()
-print "Triangles  : ", mesh.NbTriangles()
+print "Nodes       : ", mesh.NbNodes()
+print "Edges       : ", mesh.NbEdges()
+print "Quadrangles : ", mesh.NbQuadrangles()
 
 groupOfCreatedNodes = mesh.DoubleNodeGroup(nodes1, faces1, theMakeGroup=True)
 print "New nodes:", groupOfCreatedNodes.GetIDs()
 
 print "\nMesh after the first nodes duplication:"
-print "Nodes      : ", mesh.NbNodes()
-print "Edges      : ", mesh.NbEdges()
-print "Triangles  : ", mesh.NbTriangles()
+print "Nodes       : ", mesh.NbNodes()
+print "Edges       : ", mesh.NbEdges()
+print "Quadrangles : ", mesh.NbQuadrangles()
 
 # With the duplication of border elements
 
 # Edges to duplicate
 edges = mesh.CreateEmptyGroup( smesh.EDGE, 'edges' )
-edges.Add( [ 29, 30, 31 ] )
+edges.Add( [ 32, 33, 34 ] )
 
 # Nodes not to duplicate
 nodes2 = mesh.CreateEmptyGroup( smesh.NODE, 'nodes2' )
-nodes2.Add( [ 32, 5 ] )
+nodes2.Add( [ 35, 38 ] )
 
 # Group of faces to replace nodes with new ones 
 faces2 = mesh.CreateEmptyGroup( smesh.FACE, 'faces2' )
-faces2.Add( [ 576, 578, 580 ] )
+faces2.Add( [ 141, 148, 155 ] )
 
 # Duplicate nodes
 print "\nMesh before the second nodes duplication:"
-print "Nodes      : ", mesh.NbNodes()
-print "Edges      : ", mesh.NbEdges()
-print "Triangles  : ", mesh.NbTriangles()
+print "Nodes       : ", mesh.NbNodes()
+print "Edges       : ", mesh.NbEdges()
+print "Quadrangles : ", mesh.NbQuadrangles()
 
 groupOfNewEdges = mesh.DoubleNodeElemGroup( edges, nodes2, faces2, theMakeGroup=True )
 print "New edges:", groupOfNewEdges.GetIDs()
 
 print "\nMesh after the second nodes duplication:"
-print "Nodes      : ", mesh.NbNodes()
-print "Edges      : ", mesh.NbEdges()
-print "Triangles  : ", mesh.NbTriangles()
+print "Nodes       : ", mesh.NbNodes()
+print "Edges       : ", mesh.NbEdges()
+print "Quadrangles : ", mesh.NbQuadrangles()
 
 # Update object browser
 if salome.sg.hasDesktop():
index de345e8a39523cb4d062aa034aceebd1139ba3ad..cd096ca760df759c8a38d2936e9d3e8e34dab4ce 100644 (file)
@@ -8,7 +8,7 @@ import SMESH
 box = geompy.MakeBoxDXDYDZ(100,100,100)
 
 # Create a mesh
-mesh = Mesh(box,"Mesh")
+mesh = smesh.Mesh(box,"Mesh")
 mesh.AutomaticHexahedralization()
 mesh.Compute()
 
index a6a5fc1f1e4a46de9129e8597832b1f22b949b99..6b27a0c76d5b015389cb414a9f43a4cf5443a6bf 100755 (executable)
@@ -42,7 +42,7 @@ INPUT             = @srcdir@/input @top_srcdir@/src/Tools/padder/doc/input
 FILE_PATTERNS     = *.doc
 EXCLUDE           = 
 IMAGE_PATH        = @srcdir@/images @top_srcdir@/src/Tools/padder/doc/images
-EXAMPLE_PATH      = @top_srcdir@/src/SMESH_SWIG @top_srcdir@/doc/salome/examples
+EXAMPLE_PATH      = @top_srcdir@/doc/salome/examples @top_srcdir@/src/SMESH_SWIG
 
 #---------------------------------------------------------------------------
 #HTML related options
@@ -80,3 +80,8 @@ GENERATE_RTF      = NO
 TAGFILES          = smeshpy_doc.tag=../SMESH/smeshpy_doc #rnv: 07.04.2011 Workaround for the doxygen 1.7.3:
                                                          #because it wrongly defines location of the html files for search.                                                  
 SEARCHENGINE      = YES
+
+#---------------------------------------------------------------------------
+#Custom commands
+#---------------------------------------------------------------------------
+ALIASES += tui_script{1}="\include \1 <a href=\"../../examples/SMESH/\1\">Download this script</a>"
index 699e5c981ee9fe8046286bfafd5f5073b2316f8f..72d4585e1beac9664eaeedf4983f0ae477541eee 100644 (file)
@@ -36,8 +36,7 @@ An example below demonstrates usage of the Python API for 3d mesh generation.
 
 \anchor example_3d_mesh
 <h2>Example of 3d mesh generation:</h2>
-\include 3dmesh.py
-<a href="../../examples/SMESH/3dmesh.py">Download this script</a>
+\tui_script{3dmesh.py}
 
 Examples of Python scripts for Mesh operations are available by
 the following links:
index 4cc1ec654f4103892bc67e3a6e74df69ac39fa84..dccf68a5faf620d580987dd497ec0896490d436d 100644 (file)
@@ -1,7 +1,6 @@
 /*!
 
 \page tui_cartesian_algo Usage of Body Fitting algorithm
-\include cartesian_algo.py
-<a href="../../examples/SMESH/cartesian_algo.py">Download this script</a>
+\tui_script{cartesian_algo.py}
 
 */
index bdeeb8a7a9957243e1f5d20dc26e9853b66c9fc6..d7edad332fa10bff4daf53b00e1def2feb45e140 100644 (file)
@@ -7,52 +7,44 @@
 
 <br>
 <h2>Construction of a Mesh</h2>
-\include creating_meshes_ex01.py
-<a href="../../examples/SMESH/creating_meshes_ex01.py">Download this script</a>
+\tui_script{creating_meshes_ex01.py}
 
 <br>
 \anchor tui_construction_submesh
 <h2>Construction of a Submesh</h2>
-\include creating_meshes_ex02.py
-<a href="../../examples/SMESH/creating_meshes_ex02.py">Download this script</a>
+\tui_script{creating_meshes_ex02.py}
 
 <br>
 <h2>Change priority of submeshes in Mesh</h2>
-\include creating_meshes_ex03.py
-<a href="../../examples/SMESH/creating_meshes_ex03.py">Download this script</a>
+\tui_script{creating_meshes_ex03.py}
 
 <br>
 \anchor tui_editing_mesh
 <h2>Editing of a mesh</h2>
-\include creating_meshes_ex04.py
-<a href="../../examples/SMESH/creating_meshes_ex04.py">Download this script</a>
+\tui_script{creating_meshes_ex04.py}
 
 <br>
 \anchor tui_export_mesh
 <h2>Export of a Mesh</h2>
-\include creating_meshes_ex05.py
-<a href="../../examples/SMESH/creating_meshes_ex05.py">Download this script</a>
+\tui_script{creating_meshes_ex05.py}
 
 <br>
 <h2>How to mesh a cylinder with hexahedrons?</h2>
 Here you can see an example of python script, creating a hexahedral
 mesh on a cylinder. And a picture below the source code of the script,
 demonstrating the resulting mesh.
-\include creating_meshes_ex06.py
-<a href="../../examples/SMESH/creating_meshes_ex06.py">Download this script</a>
+\tui_script{creating_meshes_ex06.py}
 
 \image html mesh_cylinder_hexa.png
 
 <br>
 \anchor tui_building_compound
 <h2>Building a compound of meshes</h2>
-\include creating_meshes_ex07.py
-<a href="../../examples/SMESH/creating_meshes_ex07.py">Download this script</a>
+\tui_script{creating_meshes_ex07.py}
 
 <br>
 \anchor tui_copy_mesh
 <h2>Mesh Copying</h2>
-\include creating_meshes_ex08.py
-<a href="../../examples/SMESH/creating_meshes_ex08.py">Download this script</a>
+\tui_script{creating_meshes_ex08.py}
 
 */
index 3f3124db3df216755c23b75fafa5ed511dd2cfe4..71abf33b6e68bb8018930208f3c451ce270ef20b 100644 (file)
@@ -44,102 +44,84 @@ This page provides example codes of \ref tui_defining_meshing_algos
 <br>
 \anchor tui_1d_arithmetic
 <h3>Arithmetic 1D</h3>
-\include defining_hypotheses_ex01.py
-<a href="../../examples/SMESH/defining_hypotheses_ex01.py">Download this script</a>
+\tui_script{defining_hypotheses_ex01.py}
 
 <br>
 \anchor tui_deflection_1d
 <h3>Deflection 1D and Number of Segments</h3>
-\include defining_hypotheses_ex02.py
-<a href="../../examples/SMESH/defining_hypotheses_ex02.py">Download this script</a>
+\tui_script{defining_hypotheses_ex02.py}
 
 <br>
 \anchor tui_start_and_end_length
 <h3>Start and End Length</h3>
-\include defining_hypotheses_ex03.py
-<a href="../../examples/SMESH/defining_hypotheses_ex03.py">Download this script</a>
+\tui_script{defining_hypotheses_ex03.py}
 
 <br>
 \anchor tui_average_length
 <h3>Local Length</h3>
-\include defining_hypotheses_ex04.py
-<a href="../../examples/SMESH/defining_hypotheses_ex04.py">Download this script</a>
+\tui_script{defining_hypotheses_ex04.py}
 
 <br><h2>Defining 2D and 3D hypotheses</h2>
 
 <br>
 \anchor tui_max_element_area
 <h3>Maximum Element Area</h3>
-\include defining_hypotheses_ex05.py
-<a href="../../examples/SMESH/defining_hypotheses_ex05.py">Download this script</a>
+\tui_script{defining_hypotheses_ex05.py}
 
 <br>
 \anchor tui_max_element_volume
 <h3>Maximum Element Volume</h3>
-\include defining_hypotheses_ex06.py
-<a href="../../examples/SMESH/defining_hypotheses_ex06.py">Download this script</a>
+\tui_script{defining_hypotheses_ex06.py}
 
 <br>
 \anchor tui_length_from_edges
 <h3>Length from Edges</h3>
-\include defining_hypotheses_ex07.py
-<a href="../../examples/SMESH/defining_hypotheses_ex07.py">Download this script</a>
+\tui_script{defining_hypotheses_ex07.py}
 
 <br><h2>Defining Additional Hypotheses</h2>
 
 <br>
 \anchor tui_propagation
 <h3>Propagation</h3>
-\include defining_hypotheses_ex08.py
-<a href="../../examples/SMESH/defining_hypotheses_ex08.py">Download this script</a>
+\tui_script{defining_hypotheses_ex08.py}
 
 <br>
 \anchor tui_defining_meshing_algos
 <h2>Defining Meshing Algorithms</h2>
-\include defining_hypotheses_ex09.py
-<a href="../../examples/SMESH/defining_hypotheses_ex09.py">Download this script</a>
+\tui_script{defining_hypotheses_ex09.py}
 
 <br>
 \anchor tui_projection
 <h3>Projection Algorithms</h3>
-\include defining_hypotheses_ex10.py
-<a href="../../examples/SMESH/defining_hypotheses_ex10.py">Download this script</a>
+\tui_script{defining_hypotheses_ex10.py}
 
 <h3>Projection 1D2D</h3>
-\include defining_hypotheses_ex11.py
-<a href="../../examples/SMESH/defining_hypotheses_ex11.py">Download this script</a>
+\tui_script{defining_hypotheses_ex11.py}
 
 <br>
 
 \anchor tui_fixed_points
 
 <h2>1D Mesh with Fixed Points example</h2>
-\include defining_hypotheses_ex12.py
-<a href="../../examples/SMESH/defining_hypotheses_ex12.py">Download this script</a>
+\tui_script{defining_hypotheses_ex12.py}
 
 \anchor tui_radial_quadrangle
 <h2> Radial Quadrangle 1D2D example </h2>
-\include defining_hypotheses_ex13.py
-<a href="../../examples/SMESH/defining_hypotheses_ex13.py">Download this script</a>
+\tui_script{defining_hypotheses_ex13.py}
 
 \anchor tui_quadrangle_parameters
 <h2>Quadrangle Parameters example 1 (meshing a face with 3 edges) </h2>
-\include defining_hypotheses_ex14.py
-<a href="../../examples/SMESH/defining_hypotheses_ex14.py">Download this script</a>
+\tui_script{defining_hypotheses_ex14.py}
 
 <h2>Quadrangle Parameters example 2 (using different types) </h2>
-\include defining_hypotheses_ex15.py
-<a href="../../examples/SMESH/defining_hypotheses_ex15.py">Download this script</a>
+\tui_script{defining_hypotheses_ex15.py}
 
 \anchor tui_import
 <h2>"Use Existing Elements" example </h2>
-\include defining_hypotheses_ex16.py
-<a href="../../examples/SMESH/defining_hypotheses_ex16.py">Download this script</a>
+\tui_script{defining_hypotheses_ex16.py}
 
 \anchor tui_viscous_layers
 <h2>Viscous layers construction</h2>
-
-\include defining_hypotheses_ex17.py
-<a href="../../examples/SMESH/defining_hypotheses_ex17.py">Download this script</a>
+\tui_script{defining_hypotheses_ex17.py}
 
 */
index 2540f52b87f44e11d477fd814aea66e7d8317aca..eaf5d2803c54fee01d1f6a02921eb27f2362486c 100755 (executable)
@@ -27,8 +27,7 @@ Filter 2D mesh elements (faces) according to the aspect ratio value:
 - functor type should be \a smesh.FT_AspectRatio
 - threshold is floating point value (aspect ratio)
 
-\include filters_ex01.py
-<a href="../../examples/SMESH/filters_ex01.py">Download this script</a>
+\tui_script{filters_ex01.py}
 
 \sa \ref tui_aspect_ratio
 
@@ -39,8 +38,7 @@ Filter 3D mesh elements (volumes) according to the aspect ratio value:
 - functor type is \a smesh.FT_AspectRatio3D
 - threshold is floating point value (aspect ratio)
 
-\include filters_ex02.py
-<a href="../../examples/SMESH/filters_ex02.py">Download this script</a>
+\tui_script{filters_ex02.py}
 
 \sa \ref tui_aspect_ratio_3d
 
@@ -51,8 +49,7 @@ Filter 2D mesh elements (faces) according to the warping angle value:
 - functor type is \a smesh.FT_Warping
 - threshold is floating point value (warping angle)
 
-\include filters_ex03.py
-<a href="../../examples/SMESH/filters_ex03.py">Download this script</a>
+\tui_script{filters_ex03.py}
 
 \sa \ref tui_warping
 
@@ -63,8 +60,7 @@ Filter 2D mesh elements (faces) according to the minimum angle value:
 - functor type is \a smesh.FT_MinimumAngle
 - threshold is floating point value (minimum angle)
 
-\include filters_ex04.py
-<a href="../../examples/SMESH/filters_ex04.py">Download this script</a>
+\tui_script{filters_ex04.py}
 
 \sa \ref tui_minimum_angle
 
@@ -75,8 +71,7 @@ Filter 2D mesh elements (faces) according to the taper value:
 - functor type is \a smesh.FT_Taper
 - threshold is floating point value (taper)
 
-\include filters_ex05.py
-<a href="../../examples/SMESH/filters_ex05.py">Download this script</a>
+\tui_script{filters_ex05.py}
 
 \sa \ref tui_taper
 
@@ -87,8 +82,7 @@ Filter 2D mesh elements (faces) according to the skew value:
 - functor type is \a smesh.FT_Skew
 - threshold is floating point value (skew)
 
-\include filters_ex06.py
-<a href="../../examples/SMESH/filters_ex06.py">Download this script</a>
+\tui_script{filters_ex06.py}
 
 \sa \ref tui_skew
 
@@ -99,8 +93,7 @@ Filter 2D mesh elements (faces) according to the area value:
 - functor type is \a smesh.FT_Area
 - threshold is floating point value (area)
 
-\include filters_ex07.py
-<a href="../../examples/SMESH/filters_ex07.py">Download this script</a>
+\tui_script{filters_ex07.py}
 
 \sa \ref tui_area
 
@@ -111,8 +104,7 @@ Filter 3D mesh elements (volumes) according to the volume value:
 - functor type is \a smesh.FT_Volume3D
 - threshold is floating point value (volume)
 
-\include filters_ex08.py
-<a href="../../examples/SMESH/filters_ex08.py">Download this script</a>
+\tui_script{filters_ex08.py}
 
 \sa \ref tui_volume
 
@@ -123,8 +115,7 @@ Filter 1D mesh elements (edges) which represent free borders of a mesh:
 - functor type is \a smesh.FT_FreeBorders
 - threshold value is not required
 
-\include filters_ex09.py
-<a href="../../examples/SMESH/filters_ex09.py">Download this script</a>
+\tui_script{filters_ex09.py}
 
 \sa \ref tui_free_borders
 
@@ -136,8 +127,7 @@ element of mesh only:
 - functor type is \a smesh.FT_FreeEdges
 - threshold value is not required
 
-\include filters_ex10.py
-<a href="../../examples/SMESH/filters_ex10.py">Download this script</a>
+\tui_script{filters_ex10.py}
 
 \sa \ref tui_free_edges
 
@@ -148,8 +138,7 @@ Filter free nodes:
 - functor type is \a smesh.FT_FreeNodes
 - threshold value is not required
 
-\include filters_ex11.py
-<a href="../../examples/SMESH/filters_ex11.py">Download this script</a>
+\tui_script{filters_ex11.py}
 
 \sa \ref tui_free_nodes
 
@@ -160,8 +149,7 @@ Filter free faces:
 - functor type is \a smesh.FT_FreeFaces
 - threshold value is not required
 
-\include filters_ex12.py
-<a href="../../examples/SMESH/filters_ex12.py">Download this script</a>
+\tui_script{filters_ex12.py}
 
 \sa \ref tui_free_faces
 
@@ -172,8 +160,7 @@ Filter faces with bare borders:
 - functor type is \a smesh.FT_BareBorderFace
 - threshold value is not required
 
-\include filters_ex13.py
-<a href="../../examples/SMESH/filters_ex13.py">Download this script</a>
+\tui_script{filters_ex13.py}
 
 \sa \ref tui_bare_border_faces
 
@@ -185,8 +172,7 @@ Filter faces with bare borders:
 - threshold value is the face ID
 - tolerance is in degrees
 
-\include filters_ex14.py
-<a href="../../examples/SMESH/filters_ex14.py">Download this script</a>
+\tui_script{filters_ex14.py}
 
 \section filter_over_constrained_faces Over-constrained faces
 
@@ -195,8 +181,7 @@ Filter over-constrained faces:
 - functor type is \a smesh.FT_OverConstrainedFace
 - threshold value is not required
 
-\include filters_ex15.py
-<a href="../../examples/SMESH/filters_ex15.py">Download this script</a>
+\tui_script{filters_ex15.py}
 
 \sa \ref tui_over_constrained_faces
 
@@ -208,8 +193,7 @@ filter mesh elements basing on the same set of nodes:
           smesh.FT_EqualFaces or \a smesh.FT_EqualVolumes, 
 - threshold value is not required
 
-\include filters_ex16.py
-<a href="../../examples/SMESH/filters_ex16.py">Download this script</a>
+\tui_script{filters_ex16.py}
 
 
 \section tui_double_nodes_control Double nodes
@@ -220,8 +204,7 @@ filters mesh nodes which are coincident with other nodes (within a given toleran
 - threshold value is not required
 - default tolerance is 1.0e-7
 
-\include filters_ex17.py
-<a href="../../examples/SMESH/filters_ex17.py">Download this script</a>
+\tui_script{filters_ex17.py}
 
 
 \section filter_borders_multiconnection Borders at multi-connection
@@ -232,8 +215,7 @@ connections (faces belonging the border edges)
 - functor type is \a smesh.FT_MultiConnection
 - threshold is integer value (number of connections)
 
-\include filters_ex18.py
-<a href="../../examples/SMESH/filters_ex18.py">Download this script</a>
+\tui_script{filters_ex18.py}
 
 \sa \ref tui_borders_at_multiconnection
 
@@ -245,8 +227,7 @@ to the specified number of mesh elements
 - functor type is \a smesh.FT_MultiConnection2D
 - threshold is integer value (number of connections)
 
-\include filters_ex19.py
-<a href="../../examples/SMESH/filters_ex19.py">Download this script</a>
+\tui_script{filters_ex19.py}
 
 \sa \ref tui_borders_at_multiconnection_2d
 
@@ -257,8 +238,7 @@ Filter 1D mesh elements (edges) according to the edge length value:
 - functor type should be \a smesh.FT_Length
 - threshold is floating point value (length)
 
-\include filters_ex20.py
-<a href="../../examples/SMESH/filters_ex20.py">Download this script</a>
+\tui_script{filters_ex20.py}
 
 \sa \ref tui_length_1d
 
@@ -270,8 +250,7 @@ value of its edges:
 - functor type should be \a smesh.FT_Length2D
 - threshold is floating point value (edge length)
 
-\include filters_ex21.py
-<a href="../../examples/SMESH/filters_ex21.py">Download this script</a>
+\tui_script{filters_ex21.py}
 
 \sa \ref tui_length_2d
 
@@ -283,8 +262,7 @@ value of its edges and diagonals:
 - functor type should be \a smesh.FT_MaxElementLength2D
 - threshold is floating point value (edge/diagonal length)
 
-\include filters_ex22.py
-<a href="../../examples/SMESH/filters_ex22.py">Download this script</a>
+\tui_script{filters_ex22.py}
 
 \sa \ref tui_max_element_length_2d
 
@@ -296,8 +274,7 @@ value of its edges and diagonals:
 - functor type should be \a smesh.FT_MaxElementLength3D
 - threshold is floating point value (edge/diagonal length)
 
-\include filters_ex23.py
-<a href="../../examples/SMESH/filters_ex23.py">Download this script</a>
+\tui_script{filters_ex23.py}
 
 \sa \ref tui_max_element_length_3d
 
@@ -308,8 +285,7 @@ Filter 3D mesh elements with bare borders:
 - functor type is \a smesh.FT_BareBorderVolume
 - threshold value is not required
 
-\include filters_ex24.py
-<a href="../../examples/SMESH/filters_ex24.py">Download this script</a>
+\tui_script{filters_ex24.py}
 
 \sa \ref tui_bare_border_volumes
 
@@ -320,8 +296,7 @@ Filter over-constrained volumes:
 - functor type is \a smesh.FT_OverConstrainedVolume
 - threshold value is not required
 
-\include filters_ex25.py
-<a href="../../examples/SMESH/filters_ex25.py">Download this script</a>
+\tui_script{filters_ex25.py}
 
 \sa \ref tui_over_constrained_faces
 
@@ -333,8 +308,7 @@ shape defined by threshold value:
 - functor type should be \a smesh.FT_BelongToGeom
 - threshold is geometrical object
 
-\include filters_ex26.py
-<a href="../../examples/SMESH/filters_ex26.py">Download this script</a>
+\tui_script{filters_ex26.py}
 
 \section filter_lying_on_geom Lying on Geom
 
@@ -344,8 +318,7 @@ shape defined by threshold value:
 - functor type should be \a smesh.FT_LyingOnGeom
 - threshold is geometrical object
 
-\include filters_ex27.py
-<a href="../../examples/SMESH/filters_ex27.py">Download this script</a>
+\tui_script{filters_ex27.py}
 
 \section filter_belong_to_plane Belong to Plane
 
@@ -356,8 +329,7 @@ plane defined by threshold value with the given tolerance:
 - threshold is geometrical object (plane)
 - default tolerance is 1.0e-7
 
-\include filters_ex28.py
-<a href="../../examples/SMESH/filters_ex28.py">Download this script</a>
+\tui_script{filters_ex28.py}
 
 \section filter_belong_to_cylinder Belong to Cylinder
 
@@ -368,8 +340,7 @@ cylindrical face defined by threshold value with the given tolerance:
 - threshold is geometrical object (cylindrical face)
 - default tolerance is 1.0e-7
 
-\include filters_ex29.py
-<a href="../../examples/SMESH/filters_ex29.py">Download this script</a>
+\tui_script{filters_ex29.py}
 
 \section filter_belong_to_surface Belong to Surface
 
@@ -380,8 +351,7 @@ arbitrary surface defined by threshold value with the given tolerance:
 - threshold is geometrical object (arbitrary surface)
 - default tolerance is 1.0e-7
 
-\include filters_ex30.py
-<a href="../../examples/SMESH/filters_ex30.py">Download this script</a>
+\tui_script{filters_ex30.py}
 
 \section filter_range_of_ids Range of IDs
 
@@ -391,8 +361,7 @@ specified identifiers range:
 - functor type is \a smesh.FT_RangeOfIds
 - threshold is string listing required IDs and/or ranges of IDs, e.g."1,2,3,50-60,63,67,70-78" 
 
-\include filters_ex31.py
-<a href="../../examples/SMESH/filters_ex31.py">Download this script</a>
+\tui_script{filters_ex31.py}
 
 \section filter_bad_oriented_volume Badly oriented volume
 
@@ -402,8 +371,7 @@ the point of view of MED convention.
 - functor type is \a smesh.FT_BadOrientedVolume
 - threshold is not required
 
-\include filters_ex32.py
-<a href="../../examples/SMESH/filters_ex32.py">Download this script</a>
+\tui_script{filters_ex32.py}
 
 \section filter_linear_or_quadratic Linear / quadratic
 
@@ -414,8 +382,7 @@ Filter linear / quadratic mesh elements:
 - if unary operator is set to smesh.FT_LogicalNOT, the quadratic
 elements are selected, otherwise (by default) linear elements are selected
 
-\include filters_ex33.py
-<a href="../../examples/SMESH/filters_ex33.py">Download this script</a>
+\tui_script{filters_ex33.py}
 
 \section filter_group_color Group color
 
@@ -424,8 +391,7 @@ Filter mesh entities, belonging to the group with the color defined by the thres
 - functor type is \a smesh.FT_GroupColor
 - threshold should be of SALOMEDS.Color type
 
-\include filters_ex34.py
-<a href="../../examples/SMESH/filters_ex34.py">Download this script</a>
+\tui_script{filters_ex34.py}
 
 \section filter_geom_type Geometry type
 
@@ -436,8 +402,7 @@ entity type.
 - functor type should be \a smesh.FT_ElemGeomType
 - threshold is of smesh.GeometryType value
 
-\include filters_ex35.py
-<a href="../../examples/SMESH/filters_ex35.py">Download this script</a>
+\tui_script{filters_ex35.py}
 
 \section combining_filters How to combine filters with Criterion structures?
 
@@ -445,8 +410,7 @@ Filters can be combined by making use of "criteria".
 
 Example :
 
-\include filters_ex36.py
-<a href="../../examples/SMESH/filters_ex36.py">Download this script</a>
+\tui_script{filters_ex36.py}
 
 
 */
index 36e13d30424ac6b62366d8da9a5b151e08725cbc..7284a76b54c2480a553b9a135d3fee2f263372ce 100644 (file)
@@ -17,8 +17,7 @@ by flat elements.
 \n This example represents an iron cable (a thin cylinder) in a concrete bloc (a big cylinder).
 The big cylinder is defined by two geometric volumes.
 
-\include generate_flat_elements.py
-<a href="../../examples/SMESH/generate_flat_elements.py">Download this script</a>
+\tui_script{generate_flat_elements.py}
 
 \n Here, the 4 groups of volumes [Solid_1_1, Solid_2_1, Solid_3_1, Solid_4_1] constitute a partition of the mesh.
 The flat elements on group boundaries and on faces are built with the
index d3113ab2c26997d7d392a238c1bcd85bbf7d0af3..a264f254262ab5913013a6864836b11c1582c162 100644 (file)
@@ -5,29 +5,25 @@
 <br>
 \anchor tui_create_standalone_group
 <h2>Create a Standalone Group</h2>
-\include grouping_elements_ex01.py
-<a href="../../examples/SMESH/grouping_elements_ex01.py">Download this script</a>
+\tui_script{grouping_elements_ex01.py}
 
 \image html create_group.png
 
 <br>
 \anchor tui_create_group_on_geometry
 <h2>Create a Group on Geometry</h2>
-\include grouping_elements_ex02.py
-<a href="../../examples/SMESH/grouping_elements_ex02.py">Download this script</a>
+\tui_script{grouping_elements_ex02.py}
 
 <br>
 \anchor tui_create_group_on_filter
 
 <h2>Create a Group on Filter</h2>
-\include grouping_elements_ex03.py
-<a href="../../examples/SMESH/grouping_elements_ex03.py">Download this script</a>
+\tui_script{grouping_elements_ex03.py}
 
 <br>
 \anchor tui_edit_group
 <h2>Edit a Group</h2>
-\include grouping_elements_ex04.py
-<a href="../../examples/SMESH/grouping_elements_ex04.py">Download this script</a>
+\tui_script{grouping_elements_ex04.py}
 
 \image html editing_groups1.png
 
@@ -36,8 +32,7 @@
 <br>
 \anchor tui_union_of_groups
 <h2>Union of groups</h2>
-\include grouping_elements_ex05.py
-<a href="../../examples/SMESH/grouping_elements_ex05.py">Download this script</a>
+\tui_script{grouping_elements_ex05.py}
 
 \image html union_groups1.png
 
@@ -48,8 +43,7 @@
 <br>
 \anchor tui_intersection_of_groups
 <h2>Intersection of groups</h2>
-\include grouping_elements_ex06.py
-<a href="../../examples/SMESH/grouping_elements_ex06.py">Download this script</a>
+\tui_script{grouping_elements_ex06.py}
 
 \image html intersect_groups1.png
 
@@ -60,8 +54,7 @@
 <br>
 \anchor tui_cut_of_groups
 <h2>Cut of groups</h2>
-\include grouping_elements_ex07.py
-<a href="../../examples/SMESH/grouping_elements_ex07.py">Download this script</a>
+\tui_script{grouping_elements_ex07.py}
 
 \image html cut_groups1.png
 
@@ -72,8 +65,7 @@
 <br>
 \anchor tui_create_dim_group
 <h2>Creating groups of entities from existing groups of superior dimensions</h2>
-\include grouping_elements_ex08.py
-<a href="../../examples/SMESH/grouping_elements_ex08.py">Download this script</a>
+\tui_script{grouping_elements_ex08.py}
 
 \image html dimgroup_tui1.png
 <center>Source groups of faces</center>
index 8ca283fc37020b5005a439ea2023c8299e85da1d..4d25c73584fc30d33a76068e5c7fbd7c175470f4 100644 (file)
@@ -3,11 +3,9 @@
 \page tui_measurements_page Measurements
 
 \section tui_min_distance Minimum Distance
-\include measurements_ex01.py
-<a href="../../examples/SMESH/measurements_ex01.py">Download this script</a>
+\tui_script{measurements_ex01.py}
 
 \section tui_bounding_box Bounding Box
-\include measurements_ex02.py
-<a href="../../examples/SMESH/measurements_ex02.py">Download this script</a>
+\tui_script{measurements_ex02.py}
 
 */
index e7844327c721e01c7c781ab9b0c67eed9bd45b28..7ceb5ebf7d3df335804156e73c12817bd4f1c6a0 100644 (file)
@@ -9,62 +9,52 @@
 <br>
 \anchor tui_add_node
 <h3>Add Node</h3>
-\include modifying_meshes_ex01.py
-<a href="../../examples/SMESH/modifying_meshes_ex01.py">Download this script</a>
+\tui_script{modifying_meshes_ex01.py}
 
 <br>
 \anchor tui_add_0DElement
 <h3>Add 0D Element</h3>
-\include modifying_meshes_ex02.py
-<a href="../../examples/SMESH/modifying_meshes_ex02.py">Download this script</a>
+\tui_script{modifying_meshes_ex02.py}
 
 <br>
 \anchor tui_add_0DElement_on_all_nodes
 <h3>Add 0D Element on Element Nodes</h3>
-\include modifying_meshes_ex03.py
-<a href="../../examples/SMESH/modifying_meshes_ex03.py">Download this script</a>
+\tui_script{modifying_meshes_ex03.py}
 
 <br>
 \anchor tui_add_edge
 <h3>Add Edge</h3>
-\include modifying_meshes_ex04.py
-<a href="../../examples/SMESH/modifying_meshes_ex04.py">Download this script</a>
+\tui_script{modifying_meshes_ex04.py}
 
 <br>
 \anchor tui_add_triangle
 <h3>Add Triangle</h3>
-\include modifying_meshes_ex05.py
-<a href="../../examples/SMESH/modifying_meshes_ex05.py">Download this script</a>
+\tui_script{modifying_meshes_ex05.py}
 
 <br>
 \anchor tui_add_quadrangle
 <h3>Add Quadrangle</h3>
-\include modifying_meshes_ex06.py
-<a href="../../examples/SMESH/modifying_meshes_ex06.py">Download this script</a>
+\tui_script{modifying_meshes_ex06.py}
 
 <br>
 \anchor tui_add_tetrahedron
 <h3>Add Tetrahedron</h3>
-\include modifying_meshes_ex07.py
-<a href="../../examples/SMESH/modifying_meshes_ex07.py">Download this script</a>
+\tui_script{modifying_meshes_ex07.py}
 
 <br>
 \anchor tui_add_hexahedron
 <h3>Add Hexahedron</h3>
-\include modifying_meshes_ex08.py
-<a href="../../examples/SMESH/modifying_meshes_ex08.py">Download this script</a>
+\tui_script{modifying_meshes_ex08.py}
 
 <br>
 \anchor tui_add_polygon
 <h3>Add Polygon</h3>
-\include modifying_meshes_ex09.py
-<a href="../../examples/SMESH/modifying_meshes_ex09.py">Download this script</a>
+\tui_script{modifying_meshes_ex09.py}
 
 <br>
 \anchor tui_add_polyhedron
 <h3>Add Polyhedron</h3>
-\include modifying_meshes_ex10.py
-<a href="../../examples/SMESH/modifying_meshes_ex10.py">Download this script</a>
+\tui_script{modifying_meshes_ex10.py}
 
 <br>
 \anchor tui_removing_nodes_and_elements
 <br>
 \anchor tui_removing_nodes
 <h3>Removing Nodes</h3>
-\include modifying_meshes_ex11.py
-<a href="../../examples/SMESH/modifying_meshes_ex11.py">Download this script</a>
+\tui_script{modifying_meshes_ex11.py}
 
 <br>
 \anchor tui_removing_elements
 <h3>Removing Elements</h3>
-\include modifying_meshes_ex12.py
-<a href="../../examples/SMESH/modifying_meshes_ex12.py">Download this script</a>
+\tui_script{modifying_meshes_ex12.py}
 
 <br>
 \anchor tui_removing_orphan_nodes
 <h3>Removing Orphan Nodes</h3>
-\include modifying_meshes_ex13.py
-<a href="../../examples/SMESH/modifying_meshes_ex13.py">Download this script</a>
+\tui_script{modifying_meshes_ex13.py}
 
 <br>
 \anchor tui_renumbering_nodes_and_elements
 <h2>Renumbering Nodes and Elements</h2>
-\include modifying_meshes_ex14.py
-<a href="../../examples/SMESH/modifying_meshes_ex14.py">Download this script</a>
+\tui_script{modifying_meshes_ex14.py}
 
 <br>
 \anchor tui_moving_nodes
 <h2>Moving Nodes</h2>
-\include modifying_meshes_ex15.py
-<a href="../../examples/SMESH/modifying_meshes_ex15.py">Download this script</a>
+\tui_script{modifying_meshes_ex15.py}
 
 <br>
 \anchor tui_diagonal_inversion
 <h2>Diagonal Inversion</h2>
-\include modifying_meshes_ex16.py
-<a href="../../examples/SMESH/modifying_meshes_ex16.py">Download this script</a>
+\tui_script{modifying_meshes_ex16.py}
 
 <br>
 \anchor tui_uniting_two_triangles
 <h2>Uniting two Triangles</h2>
-\include modifying_meshes_ex17.py
-<a href="../../examples/SMESH/modifying_meshes_ex17.py">Download this script</a>
+\tui_script{modifying_meshes_ex17.py}
 
 <br>
 \anchor tui_uniting_set_of_triangles
 <h2>Uniting a Set of Triangles</h2>
-\include modifying_meshes_ex18.py
-<a href="../../examples/SMESH/modifying_meshes_ex18.py">Download this script</a>
+\tui_script{modifying_meshes_ex18.py}
 
 <br>
 \anchor tui_orientation
 <h2>Orientation</h2>
-\include modifying_meshes_ex19.py
-<a href="../../examples/SMESH/modifying_meshes_ex19.py">Download this script</a>
+\tui_script{modifying_meshes_ex19.py}
 
 <br>
 \anchor tui_cutting_quadrangles
 <h2>Cutting Quadrangles</h2>
-\include modifying_meshes_ex20.py
-<a href="../../examples/SMESH/modifying_meshes_ex20.py">Download this script</a>
+\tui_script{modifying_meshes_ex20.py}
 
 <br>
 \anchor tui_smoothing
 <h2>Smoothing</h2>
-\include modifying_meshes_ex21.py
-<a href="../../examples/SMESH/modifying_meshes_ex21.py">Download this script</a>
+\tui_script{modifying_meshes_ex21.py}
 
 <br>
 \anchor tui_extrusion
 <h2>Extrusion</h2>
-\include modifying_meshes_ex22.py
-<a href="../../examples/SMESH/modifying_meshes_ex22.py">Download this script</a>
+\tui_script{modifying_meshes_ex22.py}
 
 <br>
 \anchor tui_extrusion_along_path
 <h2>Extrusion along a Path</h2>
-\include modifying_meshes_ex23.py
-<a href="../../examples/SMESH/modifying_meshes_ex23.py">Download this script</a>
+\tui_script{modifying_meshes_ex23.py}
 
 <br>
 \anchor tui_revolution
 <h2>Revolution</h2>
-\include modifying_meshes_ex24.py
-<a href="../../examples/SMESH/modifying_meshes_ex24.py">Download this script</a>
+\tui_script{modifying_meshes_ex24.py}
 
 <br>
 \anchor tui_pattern_mapping
 <h2>Pattern Mapping</h2>
-\include modifying_meshes_ex25.py
-<a href="../../examples/SMESH/modifying_meshes_ex25.py">Download this script</a>
+\tui_script{modifying_meshes_ex25.py}
 
 <br>
 \anchor tui_quadratic
 <h2>Convert mesh to/from quadratic</h2>
-\include modifying_meshes_ex26.py
-<a href="../../examples/SMESH/modifying_meshes_ex26.py">Download this script</a>
+\tui_script{modifying_meshes_ex26.py}
 
 */
index 3403590697e6a95e0244eb2dca6214625fb6a2ca..7f34deca91911fc926ba45fe31a3d625b6bb9565 100644 (file)
@@ -3,7 +3,6 @@
 \page tui_notebook_smesh_page Using SALOME NoteBook
 
 \anchor tui_notebook_smesh
-\include notebook_smesh.py
-<a href="../../examples/SMESH/notebook_smesh.py">Download this script</a>
+\tui_script{notebook_smesh.py}
 
 */
index d0234a7ab0b620dfcd142c8f45abd2649b889947..6ba5e25d38eea29550d4be84a34d94ef766c9aca 100644 (file)
@@ -1,8 +1,7 @@
 /*!
 
 \page tui_prism_3d_algo Use 3D extrusion meshing algorithm
-\include prism_3d_algo.py
-<a href="../../examples/SMESH/prism_3d_algo.py">Download this script</a>
+\tui_script{prism_3d_algo.py}
 
 The result geometry and mesh is shown below
 \image html prism_tui_sample.png
index e09389d3f815d25eef339afde955d06564e6f8de..be849962cee00808c17bc3e4b1130433355ef043 100644 (file)
@@ -3,91 +3,69 @@
 \page tui_quality_controls_page Quality Controls
 
 \section tui_free_borders Free Borders
-\include quality_controls_ex01.py
-<a href="../../examples/SMESH/quality_controls_ex01.py">Download this script</a>
+\tui_script{quality_controls_ex01.py}
 
 \section tui_borders_at_multiconnection Borders at Multiconnection
-\include quality_controls_ex02.py
-<a href="../../examples/SMESH/quality_controls_ex02.py">Download this script</a>
+\tui_script{quality_controls_ex02.py}
 
 \section tui_length_1d Length 1D
-\include quality_controls_ex03.py
-<a href="../../examples/SMESH/quality_controls_ex03.py">Download this script</a>
+\tui_script{quality_controls_ex03.py}
 
 \section tui_free_edges Free Edges
-\include quality_controls_ex04.py
-<a href="../../examples/SMESH/quality_controls_ex04.py">Download this script</a>
+\tui_script{quality_controls_ex04.py}
 
 \section tui_free_nodes Free Nodes
-\include quality_controls_ex05.py
-<a href="../../examples/SMESH/quality_controls_ex05.py">Download this script</a>
+\tui_script{quality_controls_ex05.py}
 
 \section tui_free_faces Free Faces
-\include quality_controls_ex06.py
-<a href="../../examples/SMESH/quality_controls_ex06.py">Download this script</a>
+\tui_script{quality_controls_ex06.py}
 
 \section tui_bare_border_faces Bare border faces
-\include quality_controls_ex07.py
-<a href="../../examples/SMESH/quality_controls_ex07.py">Download this script</a>
+\tui_script{quality_controls_ex07.py}
 
 \section tui_bare_border_volumes Bare border volumes
-\include quality_controls_ex08.py
-<a href="../../examples/SMESH/quality_controls_ex08.py">Download this script</a>
+\tui_script{quality_controls_ex08.py}
 
 \section tui_over_constrained_faces Over-constrained faces
-\include quality_controls_ex09.py
-<a href="../../examples/SMESH/quality_controls_ex09.py">Download this script</a>
+\tui_script{quality_controls_ex09.py}
 
 \section tui_over_constrained_volumes Over-constrained volumes
-\include quality_controls_ex10.py
-<a href="../../examples/SMESH/quality_controls_ex10.py">Download this script</a>
+\tui_script{quality_controls_ex10.py}
 
 \section tui_length_2d Length 2D
-\include quality_controls_ex11.py
-<a href="../../examples/SMESH/quality_controls_ex11.py">Download this script</a>
+\tui_script{quality_controls_ex11.py}
 
 \section tui_borders_at_multiconnection_2d Borders at Multiconnection 2D
-\include quality_controls_ex12.py
-<a href="../../examples/SMESH/quality_controls_ex12.py">Download this script</a>
+\tui_script{quality_controls_ex12.py}
 
 \section tui_area Area
-\include quality_controls_ex13.py
-<a href="../../examples/SMESH/quality_controls_ex13.py">Download this script</a>
+\tui_script{quality_controls_ex13.py}
 
 \section tui_taper Taper
-\include quality_controls_ex14.py
-<a href="../../examples/SMESH/quality_controls_ex14.py">Download this script</a>
+\tui_script{quality_controls_ex14.py}
 
 \section tui_aspect_ratio Aspect Ratio
-\include quality_controls_ex15.py
-<a href="../../examples/SMESH/quality_controls_ex15.py">Download this script</a>
+\tui_script{quality_controls_ex15.py}
 
 \section tui_minimum_angle Minimum Angle
-\include quality_controls_ex16.py
-<a href="../../examples/SMESH/quality_controls_ex16.py">Download this script</a>
+\tui_script{quality_controls_ex16.py}
 
 \section tui_warping Warping
-\include quality_controls_ex17.py
-<a href="../../examples/SMESH/quality_controls_ex17.py">Download this script</a>
+\tui_script{quality_controls_ex17.py}
 
 \section tui_skew Skew
-\include quality_controls_ex18.py
-<a href="../../examples/SMESH/quality_controls_ex18.py">Download this script</a>
+\tui_script{quality_controls_ex18.py}
 
 \section tui_max_element_length_2d Element Diameter 2D
-\include quality_controls_ex19.py
-<a href="../../examples/SMESH/quality_controls_ex19.py">Download this script</a>
+\tui_script{quality_controls_ex19.py}
 
 \section tui_aspect_ratio_3d Aspect Ratio 3D
-\include quality_controls_ex20.py
-<a href="../../examples/SMESH/quality_controls_ex20.py">Download this script</a>
+\tui_script{quality_controls_ex20.py}
 
 \section tui_volume Volume
-\include quality_controls_ex21.py
-<a href="../../examples/SMESH/quality_controls_ex21.py">Download this script</a>
+\tui_script{quality_controls_ex21.py}
 
 \section tui_max_element_length_3d Element Diameter 3D
-\include quality_controls_ex22.py
-<a href="../../examples/SMESH/quality_controls_ex22.py">Download this script</a>
+\tui_script{quality_controls_ex22.py}
 
 */
index 3b77fab34b86bbff2f75ce650aa9f85eb7a60a22..303b7cec4a7d07797a9be1e330f612c39df00ab7 100644 (file)
@@ -7,81 +7,68 @@
 <br>
 \anchor tui_translation
 <h3>Translation</h3>
-\include transforming_meshes_ex01.py
-<a href="../../examples/SMESH/transforming_meshes_ex01.py">Download this script</a>
+\tui_script{transforming_meshes_ex01.py}
 
 <br>
 \anchor tui_rotation
 <h3>Rotation</h3>
-\include transforming_meshes_ex02.py
-<a href="../../examples/SMESH/transforming_meshes_ex02.py">Download this script</a>
+\tui_script{transforming_meshes_ex02.py}
 
 <br>
 \anchor tui_scale
 <h3>Scale</h3>
-\include transforming_meshes_ex03.py
-<a href="../../examples/SMESH/transforming_meshes_ex03.py">Download this script</a>
+\tui_script{transforming_meshes_ex03.py}
 
 <br>
 \anchor tui_symmetry
 <h3>Symmetry</h3>
-\include transforming_meshes_ex04.py
-<a href="../../examples/SMESH/transforming_meshes_ex04.py">Download this script</a>
+\tui_script{transforming_meshes_ex04.py}
 
 <br>
 \anchor tui_merging_nodes
 <h3>Merging Nodes</h3>
-\include transforming_meshes_ex05.py
-<a href="../../examples/SMESH/transforming_meshes_ex05.py">Download this script</a>
+\tui_script{transforming_meshes_ex05.py}
 
 <br>
 \anchor tui_merging_elements
 <h3>Merging Elements</h3>
-\include transforming_meshes_ex06.py
-<a href="../../examples/SMESH/transforming_meshes_ex06.py">Download this script</a>
+\tui_script{transforming_meshes_ex06.py}
 
 <br><h2>Sewing Meshes</h2>
 
 <br>
 \anchor tui_sew_meshes_border_to_side
 <h3>Sew Meshes Border to Side</h3>
-\include transforming_meshes_ex07.py
-<a href="../../examples/SMESH/transforming_meshes_ex07.py">Download this script</a>
+\tui_script{transforming_meshes_ex07.py}
 
 <br>
 \anchor tui_sew_conform_free_borders
 <h3>Sew Conform Free Borders</h3>
-\include transforming_meshes_ex08.py
-<a href="../../examples/SMESH/transforming_meshes_ex08.py">Download this script</a>
+\tui_script{transforming_meshes_ex08.py}
 
 <br>
 \anchor tui_sew_free_borders
 <h3>Sew Free Borders</h3>
-\include transforming_meshes_ex09.py
-<a href="../../examples/SMESH/transforming_meshes_ex09.py">Download this script</a>
+\tui_script{transforming_meshes_ex09.py}
 
 <br>
 \anchor tui_sew_side_elements
 <h3>Sew Side Elements</h3>
-\include transforming_meshes_ex10.py
-<a href="../../examples/SMESH/transforming_meshes_ex10.py">Download this script</a>
+\tui_script{transforming_meshes_ex10.py}
 
 <br>
 \anchor tui_duplicate_nodes
 <h3>Duplicate nodes</h3>
-\include transforming_meshes_ex11.py
-<a href="../../examples/SMESH/transforming_meshes_ex11.py">Download this script</a>
+\tui_script{transforming_meshes_ex11.py}
 
 <br>
 \anchor tui_make_2dmesh_from_3d
 <h3>Create boundary elements</h3>
-\include transforming_meshes_ex12.py
-<a href="../../examples/SMESH/transforming_meshes_ex12.py">Download this script</a>
+\tui_script{transforming_meshes_ex12.py}
 
 <br>
 \anchor tui_reorient_faces
 <h3>Reorient faces by vector</h3>
-\include transforming_meshes_ex13.py
-<a href="../../examples/SMESH/transforming_meshes_ex13.py">Download this script</a>
+\tui_script{transforming_meshes_ex13.py}
 
 */
index 46dfe1e054a22efa783bbc87e876b3511d05e89a..ddc56cb839bb9b44b5ca437d7e49a018d62160f0 100644 (file)
@@ -6,8 +6,7 @@ This sample demonstrates how to use <b>Use existing faces</b> algorithm,
 which is actulally just a stub allowing to use your own 2D algoritm
 implemented in Python.
 
-\include use_existing_faces.py
-<a href="../../examples/SMESH/use_existing_faces.py">Download this script</a>
+\tui_script{use_existing_faces.py}
 
 Resulting mesh:
 \image html use_existing_face_sample_mesh.png
index 06586ffea212f7e88f9edb190bc10296498d7113..2f3c4b40494c765ba4a95c1151d3b4336e4ac3b1 100644 (file)
@@ -5,13 +5,11 @@
 <br>
 \anchor tui_viewing_mesh_infos
 <h2>Viewing Mesh Infos</h2>
-\include viewing_meshes_ex01.py
-<a href="../../examples/SMESH/viewing_meshes_ex01.py">Download this script</a>
+\tui_script{viewing_meshes_ex01.py}
 
 <br>
 \anchor tui_find_element_by_point
 <h2>Find Element by Point</h2>
-\include viewing_meshes_ex02.py
-<a href="../../examples/SMESH/viewing_meshes_ex02.py">Download this script</a>
+\tui_script{viewing_meshes_ex02.py}
 
 */
index 9cf599fee4198e0e0eb88554b1e9060ad6f66a44..e3fc5d76bd1d60e737cd22e8628a3c3b1172bb4a 100644 (file)
@@ -107,113 +107,214 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
 
   // Read elements
 
-  int iN[28];
+  int iN[28]; // 28 - nb nodes in HEX27 (+ 1 for safety :)
+
+  /* Read extra vertices for quadratic edges */
+  std::vector<int> quadNodesAtEdges;
+  int nbQuadEdges = 0;
+  if ( (nbQuadEdges = GmfStatKwd(meshID, GmfExtraVerticesAtEdges)) )
+  {
+    quadNodesAtEdges.reserve( nbQuadEdges );
+    GmfGotoKwd(meshID, GmfExtraVerticesAtEdges);
+    for ( int i = 1; i <= nbQuadEdges; ++i )
+    {
+      GmfGetLin(meshID, GmfExtraVerticesAtEdges, &iN[0], &iN[1], &iN[2]);
+      quadNodesAtEdges.push_back(iN[2]);
+    }
+  }
 
   /* Read edges */
   const int edgeIDShift = myMesh->GetMeshInfo().NbElements();
   if ( int nbEdges = GmfStatKwd(meshID, GmfEdges))
   {
+    const bool readQuadNodes = ( nbQuadEdges == nbEdges );
     GmfGotoKwd(meshID, GmfEdges);
     for ( int i = 1; i <= nbEdges; ++i )
     {
       GmfGetLin(meshID, GmfEdges, &iN[0], &iN[1], &ref);
-      if ( !myMesh->AddEdgeWithID( iN[0], iN[1], edgeIDShift + i ))
-        status = storeBadNodeIds( "GmfEdges",i, 2, iN[0], iN[1] );
+      if ( readQuadNodes )
+      {
+        const int midN = quadNodesAtEdges[i-1];
+        if ( !myMesh->AddEdgeWithID( iN[0], iN[1], midN, edgeIDShift + i ))
+          status = storeBadNodeIds( "GmfEdges + GmfExtraVerticesAtEdges",i, 3, iN[0],iN[1],midN);
+      }
+      else
+      {
+        if ( !myMesh->AddEdgeWithID( iN[0], iN[1], edgeIDShift + i ))
+          status = storeBadNodeIds( "GmfEdges",i, 2, iN[0], iN[1] );
+      }
     }
   }
-  /* Read quadratic edges */
-  const int edge2IDShift = myMesh->GetMeshInfo().NbElements();
-  if ( int nbEdges = GmfStatKwd(meshID, GmfEdgesP2))
+  // the vector of extra vertices at edges won't be used anymore so it is cleared
+  quadNodesAtEdges.clear();
+
+  /* Read extra vertices for quadratic triangles */
+  std::vector< std::vector<int> > quadNodesAtTriangles;
+  int nbQuadTria = 0;
+  if ( (nbQuadTria = GmfStatKwd(meshID, GmfExtraVerticesAtTriangles)) )
   {
-    GmfGotoKwd(meshID, GmfEdgesP2);
-    for ( int i = 1; i <= nbEdges; ++i )
+    GmfGotoKwd(meshID, GmfExtraVerticesAtTriangles);
+    quadNodesAtTriangles.reserve( nbQuadTria );
+    std::vector<int> nodes(4);
+    for ( int i = 1; i <= nbQuadTria; ++i )
     {
-      GmfGetLin(meshID, GmfEdgesP2, &iN[0], &iN[1], &iN[2], &ref);
-      if ( !myMesh->AddEdgeWithID( iN[0], iN[1], iN[2], edge2IDShift + i ))
-        status = storeBadNodeIds( "GmfEdgesP2",i, 3, iN[0], iN[1], iN[2] );
+      GmfGetLin(meshID, GmfExtraVerticesAtTriangles,
+                &iN[0], &iN[1], &iN[2], &iN[3], &iN[4],
+                &iN[5]); // iN[5] - preview TRIA7
+      nodes.clear();
+      nodes.push_back(iN[2]);
+      nodes.push_back(iN[3]);
+      nodes.push_back(iN[4]);
+      nodes.push_back(iN[5]);
+      nodes.resize( iN[1] );
+
+      quadNodesAtTriangles.push_back(nodes);
     }
   }
+
   /* Read triangles */
   const int triaIDShift = myMesh->GetMeshInfo().NbElements();
   if ( int nbTria = GmfStatKwd(meshID, GmfTriangles))
   {
+    const bool readQuadNodes = (nbQuadTria == nbTria);
     GmfGotoKwd(meshID, GmfTriangles);
     for ( int i = 1; i <= nbTria; ++i )
     {
       GmfGetLin(meshID, GmfTriangles, &iN[0], &iN[1], &iN[2], &ref);
-      if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], triaIDShift + i ))
-        status = storeBadNodeIds( "GmfTriangles",i, 3, iN[0], iN[1], iN[2] );
+      if ( readQuadNodes )
+      {
+        const std::vector<int>& midN = quadNodesAtTriangles[ i-1 ];
+        if ( !myMesh->AddFaceWithID( iN[0],iN[1],iN[2], midN[0],midN[1],midN[2],  triaIDShift + i ))
+          status = storeBadNodeIds( "GmfTriangles + GmfExtraVerticesAtTriangles",i, 6, 
+                                    iN[0],iN[1],iN[2], midN[0],midN[1],midN[2] );
+      }
+      else
+      {
+        if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], triaIDShift + i ))
+          status = storeBadNodeIds( "GmfTriangles",i, 3, iN[0], iN[1], iN[2] );
+      }
     }
   }
-  /* Read quadratic triangles */
-  const int tria2IDShift = myMesh->GetMeshInfo().NbElements();
-  if ( int nbTria = GmfStatKwd(meshID, GmfTrianglesP2))
+  // the vector of extra vertices at triangles won't be used anymore so it is cleared
+  quadNodesAtTriangles.clear();
+
+  /* Read extra vertices for quadratic quadrangles */
+  std::vector< std::vector<int> > quadNodesAtQuadrilaterals;
+  int nbQuadQuad = 0;
+  if ( (nbQuadQuad = GmfStatKwd(meshID, GmfExtraVerticesAtQuadrilaterals)) )
   {
-    GmfGotoKwd(meshID, GmfTrianglesP2);
-    for ( int i = 1; i <= nbTria; ++i )
+    GmfGotoKwd(meshID, GmfExtraVerticesAtQuadrilaterals);
+    quadNodesAtQuadrilaterals.reserve( nbQuadQuad );
+    std::vector<int> nodes( 5 );
+    for ( int i = 1; i <= nbQuadQuad; ++i )
     {
-      GmfGetLin(meshID, GmfTrianglesP2,
-                &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &ref);
-      if ( !myMesh->AddFaceWithID( iN[0],iN[1],iN[2],iN[3],iN[4],iN[5],
-                                   tria2IDShift + i ))
-        status = storeBadNodeIds( "GmfTrianglesP2",i, 6, iN[0],iN[1],iN[2],iN[3],iN[4],iN[5] );
+      GmfGetLin(meshID, GmfExtraVerticesAtQuadrilaterals,
+                &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &iN[6]);
+      nodes.clear();
+      nodes.push_back(iN[2]);
+      nodes.push_back(iN[3]);
+      nodes.push_back(iN[4]);
+      nodes.push_back(iN[5]);
+      nodes.push_back(iN[6]);
+      nodes.resize( iN[1] );
+
+      quadNodesAtQuadrilaterals.push_back(nodes);
     }
   }
-  /* Read quadrangles */
+
+ /* Read quadrangles */
   const int quadIDShift = myMesh->GetMeshInfo().NbElements();
   if ( int nbQuad = GmfStatKwd(meshID, GmfQuadrilaterals))
   {
+    const bool readQuadNodes = (nbQuadQuad == nbQuad);
     GmfGotoKwd(meshID, GmfQuadrilaterals);
     for ( int i = 1; i <= nbQuad; ++i )
     {
       GmfGetLin(meshID, GmfQuadrilaterals, &iN[0], &iN[1], &iN[2], &iN[3], &ref);
-      if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3], quadIDShift + i ))
-        status = storeBadNodeIds( "GmfQuadrilaterals",i, 4, iN[0], iN[1],iN[2], iN[3] );
+      if ( readQuadNodes )
+      {
+        const std::vector<int>& midN = quadNodesAtQuadrilaterals[ i-1 ];
+        if ( midN.size() == 4 )
+        {
+          if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3],
+                                       midN[0], midN[1], midN[2], midN[3],
+                                       quadIDShift + i ))
+            status = storeBadNodeIds( "GmfQuadrilaterals + GmfExtraVerticesAtQuadrilaterals",i, 8,
+                                      iN[0], iN[1],iN[2], iN[3],
+                                      midN[0], midN[1], midN[2], midN[3]);
+        }
+        else
+        {
+          if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3],
+                                       midN[0], midN[1], midN[2], midN[3], midN[4],
+                                       quadIDShift + i ))
+            status = storeBadNodeIds( "GmfQuadrilaterals + GmfExtraVerticesAtQuadrilaterals",i, 9,
+                                      iN[0], iN[1],iN[2], iN[3],
+                                      midN[0], midN[1], midN[2], midN[3], midN[4]);
+        }
+      }
+      else
+      {
+        if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3], quadIDShift + i ))
+          status = storeBadNodeIds( "GmfQuadrilaterals",i, 4, iN[0], iN[1],iN[2], iN[3] );
+      }
     }
   }
-  /* Read bi-quadratic quadrangles */
-  const int quad2IDShift = myMesh->GetMeshInfo().NbElements();
-  if ( int nbQuad = GmfStatKwd(meshID, GmfQuadrilateralsQ2))
+  // the vector of extra vertices at quadrilaterals won't be used anymore so it is cleared
+  quadNodesAtQuadrilaterals.clear();
+
+  /* Read extra vertices for quadratic tetrahedra */
+  std::vector< std::vector<int> > quadNodesAtTetrahedra;
+  int nbQuadTetra = 0;
+  if ( (nbQuadTetra = GmfStatKwd(meshID, GmfExtraVerticesAtTetrahedra)) )
   {
-    GmfGotoKwd(meshID, GmfQuadrilateralsQ2);
-    for ( int i = 1; i <= nbQuad; ++i )
+    GmfGotoKwd(meshID, GmfExtraVerticesAtTetrahedra);
+    quadNodesAtTetrahedra.reserve( nbQuadTetra );
+    std::vector<int> nodes( 6 );
+    for ( int i = 1; i <= nbQuadTetra; ++i )
     {
-      GmfGetLin(meshID, GmfQuadrilateralsQ2,
-                &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &iN[6], &iN[7], &iN[8], &ref);
-      if ( !myMesh->AddFaceWithID( iN[0],iN[1],iN[2],iN[3],iN[4],iN[5],iN[6],iN[7],iN[8],
-                                   quad2IDShift + i ))
-        status = storeBadNodeIds( "GmfQuadrilateralsQ2",i,
-                                  9, iN[0],iN[1],iN[2],iN[3],iN[4],iN[5],iN[6],iN[7],iN[8] );
+      GmfGetLin(meshID, GmfExtraVerticesAtTetrahedra,
+                &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &iN[6], &iN[7]);
+      nodes.clear();
+      nodes.push_back(iN[2]);
+      nodes.push_back(iN[3]);
+      nodes.push_back(iN[4]);
+      nodes.push_back(iN[5]);
+      nodes.push_back(iN[6]);
+      nodes.push_back(iN[7]);
+      nodes.resize( iN[1] );
+
+      quadNodesAtTetrahedra.push_back(nodes);
     }
   }
   /* Read terahedra */
   const int tetIDShift = myMesh->GetMeshInfo().NbElements();
   if ( int nbTet = GmfStatKwd(meshID, GmfTetrahedra))
   {
+    const bool readQuadNodes = (nbQuadTetra == nbTet);
     GmfGotoKwd(meshID, GmfTetrahedra);
     for ( int i = 1; i <= nbTet; ++i )
     {
       GmfGetLin(meshID, GmfTetrahedra, &iN[0], &iN[1], &iN[2], &iN[3], &ref);
-      if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], tetIDShift + i ))
-        status = storeBadNodeIds( "GmfTetrahedra",i, 4, iN[0], iN[1],iN[2], iN[3] );
-    }
-  }
-  /* Read quadratic terahedra */
-  const int tet2IDShift = myMesh->GetMeshInfo().NbElements();
-  if ( int nbTet = GmfStatKwd(meshID, GmfTetrahedraP2))
-  {
-    GmfGotoKwd(meshID, GmfTetrahedraP2);
-    for ( int i = 1; i <= nbTet; ++i )
-    {
-      GmfGetLin(meshID, GmfTetrahedraP2, &iN[0], &iN[1], &iN[2],
-                &iN[3], &iN[4], &iN[5], &iN[6], &iN[7], &iN[8], &iN[9], &ref);
-      if ( !myMesh->AddVolumeWithID( iN[0],iN[2],iN[1],iN[3],
-                                     iN[6],iN[5],iN[4],
-                                     iN[7],iN[9],iN[8], tet2IDShift + i ))
-        status = storeBadNodeIds( "GmfTetrahedraP2",i, 10, iN[0],iN[1],iN[2],iN[3],
-                                  iN[4],iN[5],iN[6],iN[7],iN[8],iN[9] );
+      if ( readQuadNodes )
+      {
+        const std::vector<int>& midN = quadNodesAtTetrahedra[ i-1 ];  
+        if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], 
+                                       midN[2], midN[1], midN[0], midN[3], midN[5], midN[4], tetIDShift + i ))
+          status = storeBadNodeIds( "GmfTetrahedra + GmfExtraVerticesAtTetrahedra",i, 10, iN[0], iN[2], iN[1], iN[3], 
+                                                                midN[2], midN[1], midN[0], midN[3], midN[5], midN[4] );
+      }
+      else
+      {
+        if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], tetIDShift + i ) )
+          status = storeBadNodeIds( "GmfTetrahedra" ,i, 4, iN[0], iN[2], iN[1], iN[3] );
+      }
     }
   }
+  // the vector of extra vertices at tetrahedra won't be used anymore so it is cleared
+  quadNodesAtTetrahedra.clear();
+
   /* Read pyramids */
   const int pyrIDShift = myMesh->GetMeshInfo().NbElements();
   if ( int nbPyr = GmfStatKwd(meshID, GmfPyramids))
@@ -226,42 +327,115 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
         status = storeBadNodeIds( "GmfPyramids",i, 5, iN[0], iN[1],iN[2], iN[3], iN[4] );
     }
   }
-  /* Read hexahedra */
-  const int hexIDShift = myMesh->GetMeshInfo().NbElements();
-  if ( int nbHex = GmfStatKwd(meshID, GmfHexahedra))
+
+  /* Read extra vertices for quadratic hexahedra */
+  std::vector< std::vector<int> > quadNodesAtHexahedra;
+  int nbQuadHexa = 0;
+  if ( (nbQuadHexa = GmfStatKwd(meshID, GmfExtraVerticesAtHexahedra)) )
   {
-    GmfGotoKwd(meshID, GmfHexahedra);
-    for ( int i = 1; i <= nbHex; ++i )
+    GmfGotoKwd(meshID, GmfExtraVerticesAtHexahedra);
+    quadNodesAtHexahedra.reserve( nbQuadHexa );
+    std::vector<int> nodes( 19 );
+    for ( int i = 1; i <= nbQuadHexa; ++i )
     {
-      GmfGetLin(meshID, GmfHexahedra,
-                &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &iN[6], &iN[7], &ref);
-      if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1], iN[4], iN[7], iN[6], iN[5],
-                                     hexIDShift + i))
-        status = storeBadNodeIds( "GmfHexahedra",i,
-                                  8, iN[0], iN[1],iN[2], iN[3], iN[4], iN[7], iN[6], iN[5] );
+      GmfGetLin(meshID, GmfExtraVerticesAtHexahedra, &iN[0], &iN[1],    // Hexa Id, Nb of extra vertices
+                                                     &iN[2], &iN[3], &iN[4], &iN[5],
+                                                     &iN[6], &iN[7], &iN[8], &iN[9],
+                                                     &iN[10], &iN[11], &iN[12], &iN[13], // HEXA20
+                                                     &iN[14], 
+                                                     &iN[15], &iN[16], &iN[17], &iN[18], 
+                                                     &iN[19],
+                                                     &iN[20]);                          // HEXA27
+      nodes.clear();
+      nodes.push_back(iN[2]);
+      nodes.push_back(iN[3]);
+      nodes.push_back(iN[4]);
+      nodes.push_back(iN[5]);
+      nodes.push_back(iN[6]);
+      nodes.push_back(iN[7]);
+      nodes.push_back(iN[8]);
+      nodes.push_back(iN[9]);
+      nodes.push_back(iN[10]);
+      nodes.push_back(iN[11]);
+      nodes.push_back(iN[12]);
+      nodes.push_back(iN[13]);     
+      nodes.push_back(iN[14]);
+      nodes.push_back(iN[15]);
+      nodes.push_back(iN[16]);
+      nodes.push_back(iN[17]);
+      nodes.push_back(iN[18]);
+      nodes.push_back(iN[19]);
+      nodes.push_back(iN[20]);
+      nodes.resize( iN[1] );
+
+      quadNodesAtHexahedra.push_back(nodes);
     }
   }
-  /* Read tri-quadratic hexahedra */
-  const int hex2IDShift = myMesh->GetMeshInfo().NbElements();
-  if ( int nbHex = GmfStatKwd(meshID, GmfHexahedraQ2))
+  
+  /* Read hexahedra */
+  const int hexIDShift = myMesh->GetMeshInfo().NbElements();
+  if ( int nbHex = GmfStatKwd(meshID, GmfHexahedra))
   {
-    GmfGotoKwd(meshID, GmfHexahedraQ2);
+    const bool readQuadNodes = (nbQuadHexa == nbHex);
+    GmfGotoKwd(meshID, GmfHexahedra);
     for ( int i = 1; i <= nbHex; ++i )
     {
-      GmfGetLin(meshID, GmfHexahedraQ2, &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5],
-                &iN[6], &iN[7], &iN[8],&iN[9],&iN[10],&iN[11],&iN[12],&iN[13],&iN[14],
-                &iN[15],&iN[16],&iN[17],&iN[18],&iN[19],&iN[20],&iN[21],&iN[22],&iN[23],
-                &iN[24],&iN[25],&iN[26], &ref);
-      if ( !myMesh->AddVolumeWithID( iN[0],iN[3],iN[2],iN[1],iN[4],iN[7],iN[6],iN[5],iN[11],iN[10],
-                                     iN[9],iN[8],iN[12],iN[15],iN[14], iN[13],iN[19],iN[18],iN[17],
-                                     iN[16],iN[20],iN[24],iN[23],iN[22],iN[21], iN[25],iN[26],
-                                     hex2IDShift + i ))
-        status = storeBadNodeIds( "GmfHexahedraQ2",i, 27,
-                                  iN[0],iN[3],iN[2],iN[1],iN[4], iN[7],iN[6],iN[5],iN[11],iN[10],
-                                  iN[9],iN[8],iN[12],iN[15],iN[14], iN[13],iN[19],iN[18],iN[17],
-                                  iN[16],iN[20],iN[24],iN[23],iN[22],iN[21], iN[25],iN[26]);
+      GmfGetLin(meshID, GmfHexahedra, &iN[0], &iN[1], &iN[2], &iN[3],
+                                      &iN[4], &iN[5], &iN[6], &iN[7],&ref);
+      if ( readQuadNodes )
+      {
+        const std::vector<int>& midN = quadNodesAtHexahedra[ i-1 ];  
+        if ( midN.size() == 12 )  // HEXA20
+        {
+          if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1],
+                                         iN[4], iN[7], iN[6], iN[5],
+                                         midN[3], midN[2], midN[1], midN[0],
+                                         midN[7], midN[6], midN[5], midN[4],
+                                         midN[8], midN[11], midN[10], midN[9],
+                                         tetIDShift + i ))
+            status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 20, 
+                                       iN[0], iN[3], iN[2], iN[1],
+                                       iN[4], iN[7], iN[6], iN[5],
+                                       midN[3], midN[2], midN[1], midN[0],
+                                       midN[7], midN[6], midN[5], midN[4],
+                                       midN[8], midN[11], midN[10], midN[9]);
+        }
+        else                      // HEXA27
+        {
+           if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1],
+                                          iN[4], iN[7], iN[6], iN[5],
+                                          midN[3], midN[2], midN[1], midN[0],
+                                          midN[7], midN[6], midN[5], midN[4],
+                                          midN[8], midN[11], midN[10], midN[9],
+                                          midN[12],
+                                          midN[16], midN[15], midN[14], midN[13],
+                                          midN[17],
+                                          midN[18],                                                        
+                                          tetIDShift + i ))
+            status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 27, 
+                                       iN[0], iN[3], iN[2], iN[1],
+                                       iN[4], iN[7], iN[6], iN[5],
+                                       midN[3], midN[2], midN[1], midN[0],
+                                       midN[7], midN[6], midN[5], midN[4],
+                                       midN[8], midN[11], midN[10], midN[9],
+                                       midN[12],
+                                       midN[16], midN[15], midN[14], midN[13],
+                                       midN[17],
+                                       midN[18]);
+        }
+      }
+      else
+      {
+        if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1],
+                                       iN[4], iN[7], iN[6], iN[5], hexIDShift + i ) )
+          status = storeBadNodeIds( "GmfHexahedra" ,i, 8, iN[0], iN[3], iN[2], iN[1],
+                                                          iN[4], iN[7], iN[6], iN[5] );
+      }
     }
   }
+  // the vector of extra vertices at tetrahedra won't be used anymore so it is cleared
+  quadNodesAtHexahedra.clear();
+
   /* Read prism */
   const int prismIDShift = myMesh->GetMeshInfo().NbElements();
   if ( int nbPrism = GmfStatKwd(meshID, GmfPrisms))
index 926f7f4c3a4689831557607f042cd0cd8e25ae9a..432551e796d2c73a51c613eb0213acce045a4b30 100644 (file)
@@ -49,6 +49,16 @@ extern "C"
   const SMDS_MeshElement* elem = elemIt->next();                        \
   GmfSetLin(meshID, GmfKwd,
 
+#define BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity, GmfKwd, elem, nbVertices ) \
+  elemIt = myMesh->elementEntityIterator( SMDSEntity );                 \
+  if ( elemIt->more() )                                                 \
+  {                                                                     \
+  GmfSetKwd(meshID, GmfKwd, myMesh->GetMeshInfo().NbEntities( SMDSEntity )); \
+  for ( int gmfID = 1; elemIt->more(); ++gmfID )                        \
+  {                                                                     \
+  const SMDS_MeshElement* elem = elemIt->next();                        \
+  GmfSetLin(meshID, GmfKwd, gmfID, nbVertices,
+
 #define END_ELEM_WRITE( elem )                  \
   elem->getshapeId() );                         \
   }}                                            \
@@ -58,6 +68,10 @@ extern "C"
   e2id.insert( e2id.end(), make_pair( elem, gmfID ));   \
   }}                                                    \
 
+#define END_EXTRA_VERTICES_WRITE()           \
+  );                                         \
+  }}                                         \
+
 
 DriverGMF_Write::DriverGMF_Write():
   Driver_SMESHDS_Mesh(), _exportRequiredGroups( true )
@@ -67,6 +81,12 @@ DriverGMF_Write::~DriverGMF_Write()
 {
 }
 
+//================================================================================
+/*!
+ * \brief Reads a GMF file
+ */
+//================================================================================
+
 Driver_Mesh::Status DriverGMF_Write::Perform()
 {
   Kernel_Utils::Localizer loc;
@@ -110,14 +130,17 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
     node2IdMap[ edge->GetNode( 0 )],
     node2IdMap[ edge->GetNode( 1 )],
     END_ELEM_WRITE_ADD_TO_MAP( edge, edge2IDMap );
-    
+
   // quadratic edges
-  BEGIN_ELEM_WRITE( SMDSEntity_Quad_Edge, GmfEdgesP2, edge )
+  BEGIN_ELEM_WRITE( SMDSEntity_Quad_Edge, GmfEdges, edge )
     node2IdMap[ edge->GetNode( 0 )],
     node2IdMap[ edge->GetNode( 1 )],
-    node2IdMap[ edge->GetNode( 2 )],
     END_ELEM_WRITE( edge );
-    
+
+  BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_Quad_Edge, GmfExtraVerticesAtEdges, edge, 1 )
+    node2IdMap[ edge->GetNode( 2 )]
+    END_EXTRA_VERTICES_WRITE();
+
   // triangles
   TElem2IDMap tria2IDMap;
   BEGIN_ELEM_WRITE( SMDSEntity_Triangle, GmfTriangles, tria )
@@ -125,17 +148,20 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
     node2IdMap[ tria->GetNode( 1 )],
     node2IdMap[ tria->GetNode( 2 )],
     END_ELEM_WRITE_ADD_TO_MAP( tria, tria2IDMap );
-    
+
   // quadratic triangles
-  BEGIN_ELEM_WRITE( SMDSEntity_Quad_Triangle, GmfTrianglesP2, tria )
+  BEGIN_ELEM_WRITE( SMDSEntity_Quad_Triangle, GmfTriangles, tria )
     node2IdMap[ tria->GetNode( 0 )],
     node2IdMap[ tria->GetNode( 1 )],
     node2IdMap[ tria->GetNode( 2 )],
+    END_ELEM_WRITE( tria );
+
+  BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_Quad_Triangle, GmfExtraVerticesAtTriangles, tria, 3 )
     node2IdMap[ tria->GetNode( 3 )],
     node2IdMap[ tria->GetNode( 4 )],
-    node2IdMap[ tria->GetNode( 5 )],
-    END_ELEM_WRITE( tria );
-    
+    node2IdMap[ tria->GetNode( 5 )]
+    END_EXTRA_VERTICES_WRITE();
+
   // quadrangles
   TElem2IDMap quad2IDMap;
   BEGIN_ELEM_WRITE( SMDSEntity_Quadrangle, GmfQuadrilaterals, quad )
@@ -145,19 +171,37 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
     node2IdMap[ quad->GetNode( 3 )],
     END_ELEM_WRITE_ADD_TO_MAP( quad, quad2IDMap );
 
-  // bi-quadratic quadrangles
-  BEGIN_ELEM_WRITE( SMDSEntity_BiQuad_Quadrangle, GmfQuadrilateralsQ2, quad )
+  // quadratic quadrangles
+  BEGIN_ELEM_WRITE( SMDSEntity_Quad_Quadrangle, GmfQuadrilaterals, quad )
     node2IdMap[ quad->GetNode( 0 )],
-    node2IdMap[ quad->GetNode( 3 )],
-    node2IdMap[ quad->GetNode( 2 )],
     node2IdMap[ quad->GetNode( 1 )],
-    node2IdMap[ quad->GetNode( 7 )],
-    node2IdMap[ quad->GetNode( 6 )],
-    node2IdMap[ quad->GetNode( 5 )],
+    node2IdMap[ quad->GetNode( 2 )],
+    node2IdMap[ quad->GetNode( 3 )],
+    END_ELEM_WRITE( quad );
+
+  BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_Quad_Quadrangle, GmfExtraVerticesAtQuadrilaterals, quad, 4 )
     node2IdMap[ quad->GetNode( 4 )],
-    node2IdMap[ quad->GetNode( 8 )],
+    node2IdMap[ quad->GetNode( 5 )],
+    node2IdMap[ quad->GetNode( 6 )],
+    node2IdMap[ quad->GetNode( 7 )]
+    END_EXTRA_VERTICES_WRITE();
+
+  // bi-quadratic quadrangles
+  BEGIN_ELEM_WRITE( SMDSEntity_BiQuad_Quadrangle, GmfQuadrilaterals, quad )
+    node2IdMap[ quad->GetNode( 0 )],
+    node2IdMap[ quad->GetNode( 1 )],
+    node2IdMap[ quad->GetNode( 2 )],
+    node2IdMap[ quad->GetNode( 3 )],
     END_ELEM_WRITE( quad );
-    
+
+  BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_BiQuad_Quadrangle, GmfExtraVerticesAtQuadrilaterals, quad, 5 )
+    node2IdMap[ quad->GetNode( 4 )],
+    node2IdMap[ quad->GetNode( 5 )],
+    node2IdMap[ quad->GetNode( 6 )],
+    node2IdMap[ quad->GetNode( 7 )],
+    node2IdMap[ quad->GetNode( 8 )]
+    END_EXTRA_VERTICES_WRITE();
+
   // terahedra
   BEGIN_ELEM_WRITE( SMDSEntity_Tetra, GmfTetrahedra, tetra )
     node2IdMap[ tetra->GetNode( 0 )],
@@ -165,20 +209,23 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
     node2IdMap[ tetra->GetNode( 1 )],
     node2IdMap[ tetra->GetNode( 3 )],
     END_ELEM_WRITE( tetra );
-    
+
   // quadratic terahedra
-  BEGIN_ELEM_WRITE( SMDSEntity_Quad_Tetra, GmfTetrahedraP2, tetra )
+  BEGIN_ELEM_WRITE( SMDSEntity_Quad_Tetra, GmfTetrahedra, tetra )
     node2IdMap[ tetra->GetNode( 0 )],
     node2IdMap[ tetra->GetNode( 2 )],
     node2IdMap[ tetra->GetNode( 1 )],
     node2IdMap[ tetra->GetNode( 3 )],
+    END_ELEM_WRITE( tetra );
+    
+  BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_Quad_Tetra, GmfExtraVerticesAtTetrahedra, tetra, 6 )
     node2IdMap[ tetra->GetNode( 6 )],
     node2IdMap[ tetra->GetNode( 5 )],
     node2IdMap[ tetra->GetNode( 4 )],
     node2IdMap[ tetra->GetNode( 7 )],
     node2IdMap[ tetra->GetNode( 9 )],
-    node2IdMap[ tetra->GetNode( 8 )],
-    END_ELEM_WRITE( tetra );
+    node2IdMap[ tetra->GetNode( 8 )]
+    END_EXTRA_VERTICES_WRITE();
     
   // pyramids
   BEGIN_ELEM_WRITE( SMDSEntity_Pyramid, GmfPyramids, pyra )
@@ -201,8 +248,8 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
     node2IdMap[ hexa->GetNode( 5 )],
     END_ELEM_WRITE( hexa );
 
-  // tri-quadratic hexahedra
-  BEGIN_ELEM_WRITE( SMDSEntity_TriQuad_Hexa, GmfHexahedraQ2, hexa )
+  // quadratic hexahedra
+  BEGIN_ELEM_WRITE( SMDSEntity_Quad_Hexa, GmfHexahedra, hexa )
     node2IdMap[ hexa->GetNode( 0 )],
     node2IdMap[ hexa->GetNode( 3 )],
     node2IdMap[ hexa->GetNode( 2 )],
@@ -211,26 +258,56 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
     node2IdMap[ hexa->GetNode( 7 )],
     node2IdMap[ hexa->GetNode( 6 )],
     node2IdMap[ hexa->GetNode( 5 )],
+    END_ELEM_WRITE( hexa );
+    
+  BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_Quad_Hexa, GmfExtraVerticesAtHexahedra, hexa, 12 )
     node2IdMap[ hexa->GetNode( 11 )],
     node2IdMap[ hexa->GetNode( 10 )],
     node2IdMap[ hexa->GetNode( 9 )],
     node2IdMap[ hexa->GetNode( 8 )],
+    node2IdMap[ hexa->GetNode( 15 )],
+    node2IdMap[ hexa->GetNode( 14 )],
+    node2IdMap[ hexa->GetNode( 13 )],
     node2IdMap[ hexa->GetNode( 12 )],
+    node2IdMap[ hexa->GetNode( 16 )],
+    node2IdMap[ hexa->GetNode( 19 )],
+    node2IdMap[ hexa->GetNode( 18 )],
+    node2IdMap[ hexa->GetNode( 17 )]
+    END_EXTRA_VERTICES_WRITE();
+    
+  // tri-quadratic hexahedra
+  BEGIN_ELEM_WRITE( SMDSEntity_TriQuad_Hexa, GmfHexahedra, hexa )
+    node2IdMap[ hexa->GetNode( 0 )],
+    node2IdMap[ hexa->GetNode( 3 )],
+    node2IdMap[ hexa->GetNode( 2 )],
+    node2IdMap[ hexa->GetNode( 1 )],
+    node2IdMap[ hexa->GetNode( 4 )],
+    node2IdMap[ hexa->GetNode( 7 )],
+    node2IdMap[ hexa->GetNode( 6 )],
+    node2IdMap[ hexa->GetNode( 5 )],
+    END_ELEM_WRITE( hexa );
+    
+  BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_TriQuad_Hexa, GmfExtraVerticesAtHexahedra, hexa, 19 )
+    node2IdMap[ hexa->GetNode( 11 )],
+    node2IdMap[ hexa->GetNode( 10 )],
+    node2IdMap[ hexa->GetNode( 9 )],
+    node2IdMap[ hexa->GetNode( 8 )],
     node2IdMap[ hexa->GetNode( 15 )],
     node2IdMap[ hexa->GetNode( 14 )],
     node2IdMap[ hexa->GetNode( 13 )],
+    node2IdMap[ hexa->GetNode( 12 )],
+    node2IdMap[ hexa->GetNode( 16 )],
     node2IdMap[ hexa->GetNode( 19 )],
     node2IdMap[ hexa->GetNode( 18 )],
     node2IdMap[ hexa->GetNode( 17 )],
-    node2IdMap[ hexa->GetNode( 16 )],
     node2IdMap[ hexa->GetNode( 20 )],
     node2IdMap[ hexa->GetNode( 24 )],
     node2IdMap[ hexa->GetNode( 23 )],
     node2IdMap[ hexa->GetNode( 22 )],
     node2IdMap[ hexa->GetNode( 21 )],
     node2IdMap[ hexa->GetNode( 25 )],
-    node2IdMap[ hexa->GetNode( 26 )],
-    END_ELEM_WRITE( hexa );
+    node2IdMap[ hexa->GetNode( 26 )]
+    END_EXTRA_VERTICES_WRITE();
 
   // prism
   BEGIN_ELEM_WRITE( SMDSEntity_Penta, GmfPrisms, prism )
index 67ff05ffc8d5076dfc687d3af2e367d9377a0585..20a7c81d97da924ba4916b1bb421d5307852e83a 100644 (file)
@@ -1362,6 +1362,7 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>&
   set<int> tofind;
   int ids[16] = { 0, 1, 2, 3,   0, 3, 4,   3, 2, 4,   2, 1, 4,   1, 0, 4 };
 
+  // Quadrangular face
   tofind.clear();
   for (int i = 0; i < 4; i++)
     tofind.insert(nodes[ids[i]]);
@@ -1371,6 +1372,7 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>&
         orderedNodes[i] = nodes[ids[i]];
       return;
     }
+  // Triangular faces
   for (int k = 0; k < 4; k++)
     {
       tofind.clear();
@@ -1489,6 +1491,7 @@ SMDS_DownQuadPyramid::~SMDS_DownQuadPyramid()
 
 void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes)
 {
+//   MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId);
   set<int> setNodes;
   setNodes.clear();
   for (int i = 0; i < orderedNodes.size(); i++)
@@ -1503,8 +1506,9 @@ void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdTy
   int ids[32] = { 0, 1, 2, 3, 5, 6, 7, 8,
                   0, 3, 4, 8, 12, 9,   3, 2, 4, 7 , 11, 12,   2, 1, 4, 6, 10, 11,   1, 0, 4, 5, 9, 10 };
 
+  // Quadrangular face
   tofind.clear();
-  for (int i = 0; i < 4; i++)
+  for (int i = 0; i < 8; i++)
     tofind.insert(nodes[ids[i]]);
   if (setNodes == tofind)
     {
@@ -1512,6 +1516,7 @@ void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdTy
         orderedNodes[i] = nodes[ids[i]];
       return;
     }
+  // Triangular faces
   for (int k = 0; k < 4; k++)
     {
       tofind.clear();
@@ -1525,7 +1530,7 @@ void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdTy
         }
     }
   MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
-  MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
+  MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
 }
 
@@ -1661,6 +1666,7 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
 //int ids[18] = { 0, 2, 1,  3, 4, 5,   0, 1, 4, 3,   1, 2, 5, 4,   2, 0, 3, 5 };
   int ids[18] = { 0, 1, 2,  3, 5, 4,   0, 3, 4, 1,   1, 4, 5, 2,   2, 5, 3, 0 };
 
+  // Triangular faces
   for (int k = 0; k < 2; k++)
     {
       tofind.clear();
@@ -1673,6 +1679,7 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
           return;
         }
     }
+  // Quadrangular faces
   for (int k = 0; k < 3; k++)
     {
       tofind.clear();
@@ -1810,6 +1817,7 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
   int ids[36] = { 0, 1, 2, 6, 7, 8,  3, 5, 4, 11, 10, 9,
                   0, 3, 4, 1, 12, 9, 13, 6,   1, 4, 5, 2, 13, 10, 14, 7,   2, 5, 3, 0, 14, 11, 12, 8 };
 
+  // Triangular faces
   for (int k = 0; k < 2; k++)
     {
       tofind.clear();
@@ -1822,6 +1830,7 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
           return;
         }
     }
+  // Quadrangular faces
   for (int k = 0; k < 3; k++)
     {
       tofind.clear();
index ac294864b2a4bf35362f1a99e99488ea3ff33d17..9f3ed80532907460f7c3078a881b8ecf339a59bf 100644 (file)
@@ -49,6 +49,7 @@
 #include <GCPnts_AbscissaPoint.hxx>
 #include <GeomAdaptor_Curve.hxx>
 #include <Geom_Surface.hxx>
+#include <LDOMParser.hxx>
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopLoc_Location.hxx>
 
 using namespace std;
 
+//================================================================================
+/*!
+ * \brief Returns \a true if two algorithms (described by \a this and the given
+ *        algo data) are compatible by their output and input types of elements.
+ */
+//================================================================================
+
+bool SMESH_Algo::Features::IsCompatible( const SMESH_Algo::Features& algo2 ) const
+{
+  if ( _dim > algo2._dim ) return algo2.IsCompatible( *this );
+  // algo2 is of highter dimension
+  if ( _outElemTypes.empty() || algo2._inElemTypes.empty() )
+    return false;
+  bool compatible = true;
+  set<SMDSAbs_GeometryType>::const_iterator myOutType = _outElemTypes.begin();
+  for ( ; myOutType != _outElemTypes.end() && compatible; ++myOutType )
+    compatible = algo2._inElemTypes.count( *myOutType );
+  return compatible;
+}
+
+//================================================================================
+/*!
+ * \brief Return Data of the algorithm
+ */
+//================================================================================
+
+const SMESH_Algo::Features& SMESH_Algo::GetFeatures( const std::string& algoType )
+{
+  static map< string, SMESH_Algo::Features > theFeaturesByName;
+  if ( theFeaturesByName.empty() )
+  {
+    // Read Plugin.xml files
+    vector< string > xmlPaths = SMESH_Gen::GetPluginXMLPaths();
+    LDOMParser xmlParser;
+    for ( size_t iXML = 0; iXML < xmlPaths.size(); ++iXML )
+    {
+      bool error = xmlParser.parse( xmlPaths[iXML].c_str() );
+      if ( error )
+      {
+        TCollection_AsciiString data;
+        INFOS( xmlParser.GetError(data) );
+        continue;
+      }
+      // <algorithm type="Regular_1D"
+      //            ...
+      //            input="EDGE"
+      //            output="QUAD,TRIA">
+      //
+      LDOM_Document xmlDoc = xmlParser.getDocument();
+      LDOM_NodeList algoNodeList = xmlDoc.getElementsByTagName( "algorithm" );
+      for ( int i = 0; i < algoNodeList.getLength(); ++i )
+      {
+        LDOM_Node     algoNode           = algoNodeList.item( i );
+        LDOM_Element& algoElem           = (LDOM_Element&) algoNode;
+        TCollection_AsciiString algoType = algoElem.getAttribute("type");
+        TCollection_AsciiString input    = algoElem.getAttribute("input");
+        TCollection_AsciiString output   = algoElem.getAttribute("output");
+        TCollection_AsciiString dim      = algoElem.getAttribute("dim");
+        TCollection_AsciiString label    = algoElem.getAttribute("label-id");
+        if ( algoType.IsEmpty() ) continue;
+
+        Features & data = theFeaturesByName[ algoType.ToCString() ];
+        data._dim   = dim.IntegerValue();
+        data._label = label.ToCString();
+        for ( int isInput = 0; isInput < 2; ++isInput )
+        {
+          TCollection_AsciiString&   typeStr = isInput ? input : output;
+          set<SMDSAbs_GeometryType>& typeSet = isInput ? data._inElemTypes : data._outElemTypes;
+          int beg = 1, end;
+          while ( beg <= typeStr.Length() )
+          {
+            while ( beg < typeStr.Length() && !isalpha( typeStr.Value( beg ) ))
+              ++beg;
+            end = beg;
+            while ( end < typeStr.Length() && isalpha( typeStr.Value( end + 1 ) ))
+              ++end;
+            if ( end > beg )
+            {
+              TCollection_AsciiString typeName = typeStr.SubString( beg, end );
+              if      ( typeName == "EDGE" ) typeSet.insert( SMDSGeom_EDGE );
+              else if ( typeName == "TRIA" ) typeSet.insert( SMDSGeom_TRIANGLE );
+              else if ( typeName == "QUAD" ) typeSet.insert( SMDSGeom_QUADRANGLE );
+            }
+            beg = end + 1;
+          }
+        }
+      }
+    }
+  }
+  return theFeaturesByName[ algoType ];
+}
+
 //=============================================================================
 /*!
  *  
@@ -252,120 +345,13 @@ bool SMESH_Algo::FaceNormal(const SMDS_MeshElement* F, gp_XYZ& normal, bool norm
   return ok;
 }
 
-//================================================================================
-/*!
- * \brief Find out elements orientation on a geometrical face
- * \param theFace - The face correctly oriented in the shape being meshed
- * \param theMeshDS - The mesh data structure
- * \retval bool - true if the face normal and the normal of first element
- *                in the correspoding submesh point in different directions
+/*
+ * Moved to SMESH_MesherHelper
  */
-//================================================================================
-
-bool SMESH_Algo::IsReversedSubMesh (const TopoDS_Face&  theFace,
-                                    SMESHDS_Mesh*       theMeshDS)
-{
-  if ( theFace.IsNull() || !theMeshDS )
-    return false;
-
-  // find out orientation of a meshed face
-  int faceID = theMeshDS->ShapeToIndex( theFace );
-  TopoDS_Shape aMeshedFace = theMeshDS->IndexToShape( faceID );
-  bool isReversed = ( theFace.Orientation() != aMeshedFace.Orientation() );
-
-  const SMESHDS_SubMesh * aSubMeshDSFace = theMeshDS->MeshElements( faceID );
-  if ( !aSubMeshDSFace )
-    return isReversed;
-
-  // find element with node located on face and get its normal
-  const SMDS_FacePosition* facePos = 0;
-  int vertexID = 0;
-  gp_Pnt nPnt[3];
-  gp_Vec Ne;
-  bool normalOK = false;
-  SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
-  while ( iteratorElem->more() ) // loop on elements on theFace
-  {
-    const SMDS_MeshElement* elem = iteratorElem->next();
-    if ( elem && elem->NbNodes() > 2 ) {
-      SMDS_ElemIteratorPtr nodesIt = elem->nodesIterator();
-      const SMDS_FacePosition* fPos = 0;
-      int i = 0, vID = 0;
-      while ( nodesIt->more() ) { // loop on nodes
-        const SMDS_MeshNode* node
-          = static_cast<const SMDS_MeshNode *>(nodesIt->next());
-        if ( i == 3 ) i = 2;
-        nPnt[ i++ ].SetCoord( node->X(), node->Y(), node->Z() );
-        // check position
-        const SMDS_PositionPtr& pos = node->GetPosition();
-        if ( !pos ) continue;
-        if ( pos->GetTypeOfPosition() == SMDS_TOP_FACE ) {
-          fPos = dynamic_cast< const SMDS_FacePosition* >( pos );
-        }
-        else if ( pos->GetTypeOfPosition() == SMDS_TOP_VERTEX ) {
-          vID = node->getshapeId();
-        }
-      }
-      if ( fPos || ( !normalOK && vID )) {
-        // compute normal
-        gp_Vec v01( nPnt[0], nPnt[1] ), v02( nPnt[0], nPnt[2] );
-        if ( v01.SquareMagnitude() > RealSmall() &&
-             v02.SquareMagnitude() > RealSmall() )
-        {
-          Ne = v01 ^ v02;
-          normalOK = ( Ne.SquareMagnitude() > RealSmall() );
-        }
-        // we need position on theFace or at least on vertex
-        if ( normalOK ) {
-          vertexID = vID;
-          if ((facePos = fPos))
-            break;
-        }
-      }
-    }
-  }
-  if ( !normalOK )
-    return isReversed;
-
-  // node position on face
-  double u,v;
-  if ( facePos ) {
-    u = facePos->GetUParameter();
-    v = facePos->GetVParameter();
-  }
-  else if ( vertexID ) {
-    TopoDS_Shape V = theMeshDS->IndexToShape( vertexID );
-    if ( V.IsNull() || V.ShapeType() != TopAbs_VERTEX )
-      return isReversed;
-    gp_Pnt2d uv = BRep_Tool::Parameters( TopoDS::Vertex( V ), theFace );
-    u = uv.X();
-    v = uv.Y();
-  }
-  else
-  {
-    return isReversed;
-  }
-
-  // face normal at node position
-  TopLoc_Location loc;
-  Handle(Geom_Surface) surf = BRep_Tool::Surface( theFace, loc );
-  // if ( surf.IsNull() || surf->Continuity() < GeomAbs_C1 )
-  // some surfaces not detected as GeomAbs_C1 are nevertheless correct for meshing
-  if ( surf.IsNull() || surf->Continuity() < GeomAbs_C0 )
-    {
-      if (!surf.IsNull())
-        MESSAGE("surf->Continuity() < GeomAbs_C1 " << (surf->Continuity() < GeomAbs_C1));
-      return isReversed;
-    }
-  gp_Vec d1u, d1v;
-  surf->D1( u, v, nPnt[0], d1u, d1v );
-  gp_Vec Nf = (d1u ^ d1v).Transformed( loc );
-
-  if ( theFace.Orientation() == TopAbs_REVERSED )
-    Nf.Reverse();
-
-  return Ne * Nf < 0.;
-}
+// bool SMESH_Algo::IsReversedSubMesh (const TopoDS_Face&  theFace,
+//                                     SMESHDS_Mesh*       theMeshDS)
+// {
+// }
 
 //================================================================================
 /*!
index 76f6de97957d6168ffd8a7d2ada8f59598e06321..8a9fad6c9743a187874b5d07150d503a43992f83 100644 (file)
 
 #include "SMESH_SMESH.hxx"
 
-#include "SMESH_Hypothesis.hxx"
-#include "SMESH_ComputeError.hxx"
+#include "SMDSAbs_ElementType.hxx"
 #include "SMESH_Comment.hxx"
+#include "SMESH_ComputeError.hxx"
+#include "SMESH_Hypothesis.hxx"
 
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Edge.hxx>
@@ -42,6 +43,7 @@
 #include <vector>
 #include <list>
 #include <map>
+#include <set>
 
 class SMDS_MeshNode;
 class SMESHDS_Mesh;
@@ -60,6 +62,7 @@ class gp_XYZ;
 typedef std::map< SMESH_subMesh*, std::vector<int> >           MapShapeNbElems;
 typedef std::map< SMESH_subMesh*, std::vector<int> >::iterator MapShapeNbElemsItr;
 
+// ==================================================================================
 /*!
  * \brief Root of all algorithms
  *
@@ -69,9 +72,33 @@ typedef std::map< SMESH_subMesh*, std::vector<int> >::iterator MapShapeNbElemsIt
  *  - methods related to dependencies between sub-meshes imposed by the algorith
  *  - static utilities, like EdgeLength()
  */
-class SMESH_EXPORT SMESH_Algo:public SMESH_Hypothesis
+// ==================================================================================
+
+class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
 {
-public:
+ public:
+  //==================================================================================
+  /*!
+   * \brief Structure describing algorithm features
+   */
+  // --------------------------------------------------------------------------------
+  struct Features
+  {
+    int                            _dim;
+    std::set<SMDSAbs_GeometryType> _inElemTypes;  // acceptable types of input mesh element
+    std::set<SMDSAbs_GeometryType> _outElemTypes; // produced types of mesh elements
+    std::string                    _label;        // GUI type name
+
+    bool IsCompatible( const Features& algo2 ) const;
+  };
+  /*!
+   * \brief Returns a structure describing algorithm features
+   */
+  static const Features& GetFeatures( const std::string& algoType );
+  const Features&        GetFeatures() const { return GetFeatures( _name ); }
+
+ public:
+  //==================================================================================
   /*!
    * \brief Creates algorithm
     * \param hypId - algorithm ID
@@ -287,14 +314,10 @@ public:
                                    const bool                                 ignoreMediumNodes,
                                    std::map< double, const SMDS_MeshNode* > & theNodes);
   /*!
-   * \brief Find out elements orientation on a geometrical face
-   * \param theFace - The face correctly oriented in the shape being meshed
-   * \param theMeshDS - The mesh data structure
-   * \retval bool - true if the face normal and the normal of first element
-   *                in the correspoding submesh point in different directions
+   * Moved to SMESH_MesherHelper
    */
-  static bool IsReversedSubMesh (const TopoDS_Face&  theFace,
-                                 SMESHDS_Mesh*       theMeshDS);
+  // static bool IsReversedSubMesh (const TopoDS_Face&  theFace,
+  //                                SMESHDS_Mesh*       theMeshDS);
   /*!
    * \brief Compute length of an edge
     * \param E - the edge
index a9ef17d1eb215f0aa5ebb2679111f65eef81a9bb..2e8a963078a6e67d006db824b98c0e813d38c4bc 100644 (file)
 #include "Utils_ExceptHandlers.hxx"
 
 #include <TopoDS_Iterator.hxx>
-#include <LDOMParser.hxx>
 
 #include "memoire.h"
 
 #ifdef WNT
   #include <windows.h>
-#endif\r
+#endif
 
 using namespace std;
 
@@ -523,6 +522,7 @@ bool SMESH_Gen::Evaluate(SMESH_Mesh &          aMesh,
           .And( SMESH_HypoFilter::IsMoreLocalThan( algoShape, aMesh ));
 
         if ( SMESH_Algo* subAlgo = (SMESH_Algo*) aMesh.GetHypothesis( aSubShape, filter, true )) {
+          if ( ! subAlgo->NeedDiscreteBoundary() ) continue;
           SMESH_Hypothesis::Hypothesis_Status status;
           if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status ))
             // mesh a lower smToCompute starting from vertices
@@ -998,100 +998,6 @@ std::vector< std::string > SMESH_Gen::GetPluginXMLPaths()
   return xmlPaths;
 }
 
-//=======================================================================
-namespace // Access to type of input and output of an algorithm
-//=======================================================================
-{
-  struct AlgoData
-  {
-    int                       _dim;
-    set<SMDSAbs_GeometryType> _inElemTypes; // acceptable types of input mesh element
-    set<SMDSAbs_GeometryType> _outElemTypes; // produced types of mesh elements
-
-    bool IsCompatible( const AlgoData& algo2 ) const
-    {
-      if ( _dim > algo2._dim ) return algo2.IsCompatible( *this );
-      // algo2 is of highter dimension
-      if ( _outElemTypes.empty() || algo2._inElemTypes.empty() )
-        return false;
-      bool compatible = true;
-      set<SMDSAbs_GeometryType>::const_iterator myOutType = _outElemTypes.begin();
-      for ( ; myOutType != _outElemTypes.end() && compatible; ++myOutType )
-        compatible = algo2._inElemTypes.count( *myOutType );
-      return compatible;
-    }
-  };
-
-  //================================================================================
-  /*!
-   * \brief Return AlgoData of the algorithm
-   */
-  //================================================================================
-
-  const AlgoData& getAlgoData( const SMESH_Algo* algo )
-  {
-    static map< string, AlgoData > theDataByName;
-    if ( theDataByName.empty() )
-    {
-      // Read Plugin.xml files
-      vector< string > xmlPaths = SMESH_Gen::GetPluginXMLPaths();
-      LDOMParser xmlParser;
-      for ( size_t iXML = 0; iXML < xmlPaths.size(); ++iXML )
-      {
-        bool error = xmlParser.parse( xmlPaths[iXML].c_str() );
-        if ( error )
-        {
-          TCollection_AsciiString data;
-          INFOS( xmlParser.GetError(data) );
-          continue;
-        }
-        // <algorithm type="Regular_1D"
-        //            ...
-        //            input="EDGE"
-        //            output="QUAD,TRIA">
-        //
-        LDOM_Document xmlDoc = xmlParser.getDocument();
-        LDOM_NodeList algoNodeList = xmlDoc.getElementsByTagName( "algorithm" );
-        for ( int i = 0; i < algoNodeList.getLength(); ++i )
-        {
-          LDOM_Node     algoNode           = algoNodeList.item( i );
-          LDOM_Element& algoElem           = (LDOM_Element&) algoNode;
-          TCollection_AsciiString algoType = algoElem.getAttribute("type");
-          TCollection_AsciiString input    = algoElem.getAttribute("input");
-          TCollection_AsciiString output   = algoElem.getAttribute("output");
-          TCollection_AsciiString dim      = algoElem.getAttribute("dim");
-          if ( algoType.IsEmpty() ) continue;
-          AlgoData & data                  = theDataByName[ algoType.ToCString() ];
-          data._dim = dim.IntegerValue();
-          for ( int isInput = 0; isInput < 2; ++isInput )
-          {
-            TCollection_AsciiString&   typeStr = isInput ? input : output;
-            set<SMDSAbs_GeometryType>& typeSet = isInput ? data._inElemTypes : data._outElemTypes;
-            int beg = 1, end;
-            while ( beg <= typeStr.Length() )
-            {
-              while ( beg < typeStr.Length() && !isalpha( typeStr.Value( beg ) ))
-                ++beg;
-              end = beg;
-              while ( end < typeStr.Length() && isalpha( typeStr.Value( end + 1 ) ))
-                ++end;
-              if ( end > beg )
-              {
-                TCollection_AsciiString typeName = typeStr.SubString( beg, end );
-                if      ( typeName == "EDGE" ) typeSet.insert( SMDSGeom_EDGE );
-                else if ( typeName == "TRIA" ) typeSet.insert( SMDSGeom_TRIANGLE );
-                else if ( typeName == "QUAD" ) typeSet.insert( SMDSGeom_QUADRANGLE );
-              }
-              beg = end + 1;
-            }
-          }
-        }
-      }
-    }
-    return theDataByName[ algo->GetName() ];
-  }
-}
-
 //=============================================================================
 /*!
  * Finds algo to mesh a shape. Optionally returns a shape the found algo is bound to
@@ -1105,6 +1011,8 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh &         aMesh,
   SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
   filter.And( filter.IsApplicableTo( aShape ));
 
+  typedef SMESH_Algo::Features AlgoData;
+
   TopoDS_Shape assignedToShape;
   SMESH_Algo* algo =
     (SMESH_Algo*) aMesh.GetHypothesis( aShape, filter, true, &assignedToShape );
@@ -1144,10 +1052,10 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh &         aMesh,
       // check compatibility of algos
       if ( algos3D.size() > 1 )
       {
-        const AlgoData& algoData    = getAlgoData( algo );
-        const AlgoData& algoData2   = getAlgoData( algo2 );
-        const AlgoData& algoData3d0 = getAlgoData( algos3D[0] );
-        const AlgoData& algoData3d1 = getAlgoData( algos3D[1] );
+        const AlgoData& algoData    = algo->SMESH_Algo::GetFeatures();
+        const AlgoData& algoData2   = algo2->SMESH_Algo::GetFeatures();
+        const AlgoData& algoData3d0 = algos3D[0]->SMESH_Algo::GetFeatures();
+        const AlgoData& algoData3d1 = algos3D[1]->SMESH_Algo::GetFeatures();
         if (( algoData2.IsCompatible( algoData3d0 ) &&
               algoData2.IsCompatible( algoData3d1 ))
             &&
index 668b33232fa2f7db2d42f58171660cb93405419e..4f732effc61f0fa0f569a847094c4184d174144a 100644 (file)
@@ -2002,6 +2002,79 @@ bool SMESH_MesherHelper::IsStructured( SMESH_subMesh* faceSM )
   return true;
 }
 
+//================================================================================
+/*!
+ * \brief Find out elements orientation on a geometrical face
+ * \param theFace - The face correctly oriented in the shape being meshed
+ * \retval bool - true if the face normal and the normal of first element
+ *                in the correspoding submesh point in different directions
+ */
+//================================================================================
+
+bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace)
+{
+  if ( theFace.IsNull() )
+    return false;
+
+  // find out orientation of a meshed face
+  int faceID = GetMeshDS()->ShapeToIndex( theFace );
+  TopoDS_Shape aMeshedFace = GetMeshDS()->IndexToShape( faceID );
+  bool isReversed = ( theFace.Orientation() != aMeshedFace.Orientation() );
+
+  const SMESHDS_SubMesh * aSubMeshDSFace = GetMeshDS()->MeshElements( faceID );
+  if ( !aSubMeshDSFace )
+    return isReversed;
+
+  // find an element with a good normal
+  gp_Vec Ne;
+  bool normalOK = false;
+  gp_XY uv;
+  SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
+  while ( !normalOK && iteratorElem->more() ) // loop on elements on theFace
+  {
+    const SMDS_MeshElement* elem = iteratorElem->next();
+    if ( elem && elem->NbCornerNodes() > 2 )
+    {
+      SMESH_TNodeXYZ nPnt[3];
+      SMDS_ElemIteratorPtr nodesIt = elem->nodesIterator();
+      for ( int iN = 0; nodesIt->more() && iN < 3; ++iN) // loop on nodes
+        nPnt[ iN ] = nodesIt->next();
+
+      // compute normal
+      gp_Vec v01( nPnt[0], nPnt[1] ), v02( nPnt[0], nPnt[2] );
+      if ( v01.SquareMagnitude() > RealSmall() &&
+           v02.SquareMagnitude() > RealSmall() )
+      {
+        Ne = v01 ^ v02;
+        if (( normalOK = ( Ne.SquareMagnitude() > RealSmall() )))
+          uv = GetNodeUV( theFace, nPnt[0]._node, nPnt[2]._node, &normalOK );
+      }
+    }
+  }
+  if ( !normalOK )
+    return isReversed;
+
+  // face normal at node position
+  TopLoc_Location loc;
+  Handle(Geom_Surface) surf = BRep_Tool::Surface( theFace, loc );
+  // if ( surf.IsNull() || surf->Continuity() < GeomAbs_C1 )
+  // some surfaces not detected as GeomAbs_C1 are nevertheless correct for meshing
+  if ( surf.IsNull() || surf->Continuity() < GeomAbs_C0 )
+    {
+      if (!surf.IsNull())
+        MESSAGE("surf->Continuity() < GeomAbs_C1 " << (surf->Continuity() < GeomAbs_C1));
+      return isReversed;
+    }
+  gp_Vec d1u, d1v; gp_Pnt p;
+  surf->D1( uv.X(), uv.Y(), p, d1u, d1v );
+  gp_Vec Nf = (d1u ^ d1v).Transformed( loc );
+
+  if ( theFace.Orientation() == TopAbs_REVERSED )
+    Nf.Reverse();
+
+  return Ne * Nf < 0.;
+}
+
 //=======================================================================
 //function : Count
 //purpose  : Count nb of sub-shapes
index af5e106731c2794b5649096f1332a64dcacda3c6..cf515dfba0566992d3684e5c80759bcdbf893238 100644 (file)
@@ -221,6 +221,11 @@ public:
    */
   bool GetIsQuadratic() const { return myCreateQuadratic; }
 
+  /*
+   * \brief Find out elements orientation on a geometrical face
+   */
+  bool IsReversedSubMesh (const TopoDS_Face& theFace);
+
   /*!
    * \brief Move medium nodes of faces and volumes to fix distorted elements
    * \param error - container of fixed distorted elements
@@ -373,6 +378,7 @@ public:
   /*!
    * \brief Return node UV on face
    *  \param inFaceNode - a node of element being created located inside a face
+   *  \param check - if provided, returns result of UV check that it enforces
    */
   gp_XY GetNodeUV(const TopoDS_Face&   F,
                   const SMDS_MeshNode* n,
index 1c03f3fc3e2c3f0381b36b24fae218ff37d9c5c5..d015be18dd7d6ff92f267fb2cc829736974c1c7a 100644 (file)
@@ -88,22 +88,22 @@ SMESH_subMesh::SMESH_subMesh(int                  Id,
                              SMESHDS_Mesh *       meshDS,
                              const TopoDS_Shape & aSubShape)
 {
-        _subShape = aSubShape;
-        _subMeshDS = meshDS->MeshElements(_subShape);   // may be null ...
-        _father = father;
-        _Id = Id;
-        _dependenceAnalysed = _alwaysComputed = false;
-
-        if (_subShape.ShapeType() == TopAbs_VERTEX)
-        {
-                _algoState = HYP_OK;
-                _computeState = READY_TO_COMPUTE;
-        }
-        else
-        {
-          _algoState = NO_ALGO;
-          _computeState = NOT_READY;
-        }
+  _subShape           = aSubShape;
+  _subMeshDS          = meshDS->MeshElements(_subShape);   // may be null ...
+  _father             = father;
+  _Id                 = Id;
+  _dependenceAnalysed = _alwaysComputed = false;
+  _algo               = 0;
+  if (_subShape.ShapeType() == TopAbs_VERTEX)
+  {
+    _algoState = HYP_OK;
+    _computeState = READY_TO_COMPUTE;
+  }
+  else
+  {
+    _algoState = NO_ALGO;
+    _computeState = NOT_READY;
+  }
 }
 
 //=============================================================================
@@ -194,7 +194,9 @@ SMESH_subMesh *SMESH_subMesh::GetFirstToCompute()
 
 SMESH_Algo* SMESH_subMesh::GetAlgo() const
 {
-  return _father->GetGen()->GetAlgo(*_father, _subShape);
+  if ( !_algo )
+    ((SMESH_subMesh*)this)->_algo = _father->GetGen()->GetAlgo(*_father, _subShape);
+  return _algo;
 }
 
 //================================================================================
@@ -268,11 +270,12 @@ bool SMESH_subMesh::IsMeshComputed() const
  */
 //=============================================================================
 
-bool SMESH_subMesh::SubMeshesComputed() const
+bool SMESH_subMesh::SubMeshesComputed(bool * isFailedToCompute/*=0*/) const
 {
   int myDim = SMESH_Gen::GetShapeDim( _subShape );
   int dimToCheck = myDim - 1;
   bool subMeshesComputed = true;
+  if ( isFailedToCompute ) *isFailedToCompute = false;
   // check subMeshes with upper dimension => reverse iteration
   SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,true);
   while ( smIt->more() )
@@ -281,66 +284,72 @@ bool SMESH_subMesh::SubMeshesComputed() const
     if ( sm->_alwaysComputed )
       continue;
     const TopoDS_Shape & ss = sm->GetSubShape();
+
     // MSV 07.04.2006: restrict checking to myDim-1 only. Ex., there is no sense
     // in checking of existence of edges if the algo needs only faces. Moreover,
     // degenerated edges may have no submesh, as after computing NETGEN_2D.
-    int dim = SMESH_Gen::GetShapeDim( ss );
-    if (dim < dimToCheck)
-      break; // the rest subMeshes are all of less dimension
+    if ( !_algo || _algo->NeedDiscreteBoundary() ) {
+      int dim = SMESH_Gen::GetShapeDim( ss );
+      if (dim < dimToCheck)
+        break; // the rest subMeshes are all of less dimension
+    }
     SMESHDS_SubMesh * ds = sm->GetSubMeshDS();
     bool computeOk = (sm->GetComputeState() == COMPUTE_OK ||
                       (ds && ( dimToCheck ? ds->NbElements() : ds->NbNodes()  )));
     if (!computeOk)
     {
-      int type = ss.ShapeType();
-
       subMeshesComputed = false;
-
-      switch (type)
-      {
-      case TopAbs_COMPOUND:
-        {
-          MESSAGE("The not computed sub mesh is a COMPOUND");
-          break;
-        }
-      case TopAbs_COMPSOLID:
-        {
-          MESSAGE("The not computed sub mesh is a COMPSOLID");
-          break;
-        }
-      case TopAbs_SHELL:
-        {
-          MESSAGE("The not computed sub mesh is a SHEL");
-          break;
-        }
-      case TopAbs_WIRE:
-        {
-          MESSAGE("The not computed sub mesh is a WIRE");
-          break;
-        }
-      case TopAbs_SOLID:
-        {
-          MESSAGE("The not computed sub mesh is a SOLID");
-          break;
-        }
-      case TopAbs_FACE:
-        {
-          MESSAGE("The not computed sub mesh is a FACE");
-          break;
-        }
-      case TopAbs_EDGE:
-        {
-          MESSAGE("The not computed sub mesh is a EDGE");
-          break;
-        }
-      default:
-        {
-          MESSAGE("The not computed sub mesh is of unknown type");
-          break;
-        }
-      }
-
-      break;
+      if ( isFailedToCompute && !(*isFailedToCompute) )
+        *isFailedToCompute = ( sm->GetComputeState() == FAILED_TO_COMPUTE );
+
+      // int type = ss.ShapeType();
+
+      // switch (type)
+      // {
+      // case TopAbs_COMPOUND:
+      //   {
+      //     MESSAGE("The not computed sub mesh is a COMPOUND");
+      //     break;
+      //   }
+      // case TopAbs_COMPSOLID:
+      //   {
+      //     MESSAGE("The not computed sub mesh is a COMPSOLID");
+      //     break;
+      //   }
+      // case TopAbs_SHELL:
+      //   {
+      //     MESSAGE("The not computed sub mesh is a SHEL");
+      //     break;
+      //   }
+      // case TopAbs_WIRE:
+      //   {
+      //     MESSAGE("The not computed sub mesh is a WIRE");
+      //     break;
+      //   }
+      // case TopAbs_SOLID:
+      //   {
+      //     MESSAGE("The not computed sub mesh is a SOLID");
+      //     break;
+      //   }
+      // case TopAbs_FACE:
+      //   {
+      //     MESSAGE("The not computed sub mesh is a FACE");
+      //     break;
+      //   }
+      // case TopAbs_EDGE:
+      //   {
+      //     MESSAGE("The not computed sub mesh is a EDGE");
+      //     break;
+      //   }
+      // default:
+      //   {
+      //     MESSAGE("The not computed sub mesh is of unknown type");
+      //     break;
+      //   }
+      // }
+
+      if ( !isFailedToCompute )
+        break;
     }
   }
   return subMeshesComputed;
@@ -601,10 +610,6 @@ bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis,
 SMESH_Hypothesis::Hypothesis_Status
   SMESH_subMesh::AlgoStateEngine(int event, SMESH_Hypothesis * anHyp)
 {
-  //  MESSAGE("SMESH_subMesh::AlgoStateEngine");
-  //SCRUTE(_algoState);
-  //SCRUTE(event);
-
   // **** les retour des evenement shape sont significatifs
   // (add ou remove fait ou non)
   // le retour des evenement father n'indiquent pas que add ou remove fait
@@ -612,8 +617,8 @@ SMESH_Hypothesis::Hypothesis_Status
   SMESH_Hypothesis::Hypothesis_Status aux_ret, ret = SMESH_Hypothesis::HYP_OK;
 
   SMESHDS_Mesh* meshDS =_father->GetMeshDS();
-  //SMESH_Gen*    gen    =_father->GetGen();
   SMESH_Algo*   algo   = 0;
+  _algo = 0;
 
   if (_subShape.ShapeType() == TopAbs_VERTEX )
   {
@@ -642,7 +647,7 @@ SMESH_Hypothesis::Hypothesis_Status
 
   int oldAlgoState = _algoState;
   bool modifiedHyp = (event == MODIF_HYP);  // if set to true, force event MODIF_ALGO_STATE
-  bool needFullClean = false;
+  bool needFullClean = false, subMeshesSupported = false;
 
   bool isApplicableHyp = IsApplicableHypotesis( anHyp );
 
@@ -665,7 +670,7 @@ SMESH_Hypothesis::Hypothesis_Status
       SMESH_HypoFilter filter( SMESH_HypoFilter::HasType( algo->GetType() ));
       filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+1 ));
       filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+2 ));
-      if ( SMESH_Algo * curAlgo = (SMESH_Algo*) _father->GetHypothesis( _subShape, filter, true ))
+      if ( SMESH_Algo * curAlgo = (SMESH_Algo*)_father->GetHypothesis(_subShape, filter, true ))
         needFullClean = ( !curAlgo->NeedDiscreteBoundary() );
     }
   }
@@ -702,6 +707,7 @@ SMESH_Hypothesis::Hypothesis_Status
         // we must perform it now because later
         // we will have no information about the type of the removed algo
         needFullClean = true;
+        subMeshesSupported = algo->SupportSubmeshes();
       }
     }
   }
@@ -984,8 +990,10 @@ SMESH_Hypothesis::Hypothesis_Status
       // CLEAN was not called at event REMOVE_ALGO because the algo is not applicable to SOLID.
       algo = dynamic_cast<SMESH_Algo*> (anHyp);
       if (!algo->NeedDiscreteBoundary())
+      {
         needFullClean = true;
-
+        subMeshesSupported = algo->SupportSubmeshes();
+      }
       algo = GetAlgo();
       if (algo == NULL)  // no more applying algo on father
       {
@@ -1064,7 +1072,7 @@ SMESH_Hypothesis::Hypothesis_Status
   if ( needFullClean ) {
     // added or removed algo is all-dimensional
     ComputeStateEngine( CLEAN );
-    cleanDependsOn();
+    cleanDependsOn( subMeshesSupported );
     ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE );
   }
 
@@ -1163,17 +1171,59 @@ SMESH_Hypothesis::Hypothesis_Status
   return ret;
 }
 
-//=============================================================================
+//================================================================================
 /*!
- *
+ * \brief Remove elements from sub-meshes.
+ *  \param keepSupportedsubMeshes - if true, the sub-meshes computed using more 
+ *         local algorithms are not cleaned
  */
-//=============================================================================
+//================================================================================
 
-void SMESH_subMesh::cleanDependsOn()
+void SMESH_subMesh::cleanDependsOn( bool keepSupportedsubMeshes )
 {
-  SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,false);
-  while ( smIt->more() )
-    smIt->next()->ComputeStateEngine(CLEAN);
+  if ( _father->NbNodes() == 0 ) return;
+
+  SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,
+                                                       /*complexShapeFirst=*/true);
+  if ( !keepSupportedsubMeshes )
+  {
+    while ( smIt->more() )
+      smIt->next()->ComputeStateEngine(CLEAN);
+  }
+  else
+  {
+    // find sub-meshes to keep elements on
+    set< SMESH_subMesh* > smToKeep;
+    SMESHDS_Mesh* meshDS = _father->GetMeshDS();
+    while ( smIt->more() )
+    {
+      SMESH_subMesh* sm = smIt->next();
+      if ( sm->IsEmpty() ) continue;
+
+      // look for an algo assigned to sm
+      bool algoFound = false;
+      const list<const SMESHDS_Hypothesis*>& hyps = meshDS->GetHypothesis( sm->_subShape );
+      list<const SMESHDS_Hypothesis*>::const_iterator h = hyps.begin();
+      for ( ; ( !algoFound && h != hyps.end() ); ++h )
+        algoFound = ((*h)->GetType() != SMESHDS_Hypothesis::PARAM_ALGO );
+
+      // remember all sub-meshes of sm
+      if ( algoFound )
+      {
+        SMESH_subMeshIteratorPtr smIt2 = getDependsOnIterator(false,true);
+        while ( smIt2->more() )
+          smToKeep.insert( smIt2->next() );
+      }
+    }
+    // remove elements
+    SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,true);
+    while ( smIt->more() )
+    {
+      SMESH_subMesh* sm = smIt->next();
+      if ( !smToKeep.count( sm ))
+        sm->ComputeStateEngine(CLEAN);
+    }
+  }
 }
 
 //=============================================================================
@@ -1283,10 +1333,6 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
   default:;
   }
 
-  //MESSAGE("SMESH_subMesh::ComputeStateEngine");
-  //SCRUTE(_computeState);
-  //SCRUTE(event);
-
   if (_subShape.ShapeType() == TopAbs_VERTEX)
   {
     _computeState = READY_TO_COMPUTE;
@@ -1328,7 +1374,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
     case MODIF_ALGO_STATE:
       algo = GetAlgo();
       if (algo && !algo->NeedDiscreteBoundary())
-        cleanDependsOn(); // clean sub-meshes with event CLEAN
+        cleanDependsOn( algo->SupportSubmeshes() ); // clean sub-meshes with event CLEAN
       if ( _algoState == HYP_OK )
         _computeState = READY_TO_COMPUTE;
       break;
@@ -1374,7 +1420,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
       if (algo)
       {
         if (!algo->NeedDiscreteBoundary())
-          cleanDependsOn(); // clean sub-meshes with event CLEAN
+          cleanDependsOn( algo->SupportSubmeshes() ); // clean sub-meshes with event CLEAN
         if ( _algoState == HYP_OK )
           _computeState = READY_TO_COMPUTE;
       }
@@ -1394,21 +1440,22 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         TopoDS_Shape shape = _subShape;
         // check submeshes needed
         if (_father->HasShapeToMesh() ) {
-          bool subComputed = false;
+          bool subComputed = false, subFailed = false;
           if (!algo->OnlyUnaryInput())
-            shape = getCollection( gen, algo, subComputed );
+            shape = getCollection( gen, algo, subComputed, subFailed );
           else
             subComputed = SubMeshesComputed();
           ret = ( algo->NeedDiscreteBoundary() ? subComputed :
-                  algo->SupportSubmeshes() ? true :
+                  algo->SupportSubmeshes() ? !subFailed :
                   ( !subComputed || _father->IsNotConformAllowed() ));
-          if (!ret) {
+          if (!ret)
+          {
             _computeState = FAILED_TO_COMPUTE;
-            if ( !algo->NeedDiscreteBoundary() )
+            if ( !algo->NeedDiscreteBoundary() && !subFailed )
               _computeError =
                 SMESH_ComputeError::New(COMPERR_BAD_INPUT_MESH,
                                         "Unexpected computed submesh",algo);
-            break;
+            break; // goto exit
           }
         }
         // Compute
@@ -1494,6 +1541,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         }
         // check if an error reported on any sub-shape
         bool isComputeErrorSet = !checkComputeError( algo, ret, shape );
+        if ( isComputeErrorSet )
+          ret = false;
         // check if anything was built
         TopExp_Explorer subS(shape, _subShape.ShapeType());
         if (ret)
@@ -1597,7 +1646,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
       ComputeStateEngine( CLEAN );
       algo = GetAlgo();
       if (algo && !algo->NeedDiscreteBoundary())
-        cleanDependsOn(); // clean sub-meshes with event CLEAN
+        cleanDependsOn( algo->SupportSubmeshes() ); // clean sub-meshes with event CLEAN
       break;
     case COMPUTE:               // nothing to do
       break;
@@ -1652,7 +1701,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         ComputeStateEngine( CLEAN );
       algo = GetAlgo();
       if (algo && !algo->NeedDiscreteBoundary())
-        cleanDependsOn(); // clean sub-meshes with event CLEAN
+        cleanDependsOn( algo->SupportSubmeshes() ); // clean sub-meshes with event CLEAN
       if (_algoState == HYP_OK)
         _computeState = READY_TO_COMPUTE;
       else
@@ -1951,9 +2000,10 @@ void SMESH_subMesh::removeSubMeshElementsAndNodes()
 
 TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
                                           SMESH_Algo* theAlgo,
-                                          bool &      theSubComputed)
+                                          bool &      theSubComputed,
+                                          bool &      theSubFailed)
 {
-  theSubComputed = SubMeshesComputed();
+  theSubComputed = SubMeshesComputed( & theSubFailed );
 
   TopoDS_Shape mainShape = _father->GetMeshDS()->ShapeToMesh();
 
index 0c956cea623af7fa8627fde9e16b659e71c95be7..a1b3a8568e1e6530dbe21699ecdbed5fa0a43969 100644 (file)
@@ -253,7 +253,7 @@ public:
   void SetIsAlwaysComputed(bool isAlCo);
   bool IsAlwaysComputed() { return _alwaysComputed; }
 
-  bool SubMeshesComputed() const;
+  bool SubMeshesComputed(bool * isFailedToCompute=0) const;
 
   
   /*!
@@ -273,7 +273,7 @@ protected:
   void updateDependantsState(const compute_event theEvent);
   void updateSubMeshState(const compute_state theState);
   void cleanDependants();
-  void cleanDependsOn();
+  void cleanDependsOn( bool keepSupportedsubMeshes = false );
   void setAlgoState(algo_state state);
 
   /*!
@@ -282,7 +282,8 @@ protected:
    */
   TopoDS_Shape getCollection(SMESH_Gen * theGen,
                              SMESH_Algo* theAlgo,
-                             bool &      theSubComputed);
+                             bool &      theSubComputed,
+                             bool &      theSubFailed);
   /*!
    * \brief Update compute_state by _computeError
     * \retval bool - false if there are errors
@@ -313,11 +314,12 @@ protected:
   std::map < int, SMESH_subMesh * >_mapDepend;
   bool                  _dependenceAnalysed;
 
+  SMESH_Algo *          _algo; // the algorithm found by last *StateEngine() call
   algo_state            _algoState;
   compute_state         _computeState;
   SMESH_ComputeErrorPtr _computeError;
 
-  // allow algo->Compute() if a subshape of lower dim is meshed but
+  // allow algo->Compute() if a sub-shape of lower dim is meshed but
   // none mesh entity is bound to it. Eg StdMeshers_CompositeSegment_1D can
   // mesh several edges as a whole and leave some of them  without mesh entities
   bool                  _alwaysComputed;
index 85e115c05d149150d026b3b0f07fb479cddd4e32..32705efae63e145a9a42287bab654c99b0e61c71 100644 (file)
@@ -39,9 +39,11 @@ class SMESHDS_EXPORT SMESHDS_Hypothesis
   SMESHDS_Hypothesis(int hypId);
   virtual ~SMESHDS_Hypothesis();
 
+  enum hypothesis_type { PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D, ALGO_3D };
+
   const char* GetName() const;
-  int GetID() const;
-  int GetType() const;
+  int         GetID()   const;
+  int         GetType() const;
 
   virtual std::ostream & SaveTo(std::ostream & save)=0;
   virtual std::istream & LoadFrom(std::istream & load)=0;
@@ -49,12 +51,10 @@ class SMESHDS_EXPORT SMESHDS_Hypothesis
   virtual bool operator==(const SMESHDS_Hypothesis& other) const;
   bool operator!=(const SMESHDS_Hypothesis& other) const { return !(*this==other); }
 
-  enum hypothesis_type { PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D, ALGO_3D };
-
  protected:
-  std::string _name;  // identifier if hypothesis type
-  int         _hypId; // ID unique within application session
-  int         _type;  // enum hypothesis_type
+  std::string     _name;  // identifier of hypothesis type
+  int             _hypId; // ID unique within application session
+  hypothesis_type _type;  // enum hypothesis_type
 };
 
 #endif
index 5c87d1c2c7e2d7fdb27e6a6b9b5191b55699234e..47f42b997031a8aca65ef8023b627deedec0e508 100644 (file)
     {
       format = "GMF";
       notSupportedElemTypes.push_back( SMESH::Entity_0D );
-      notSupportedElemTypes.push_back( SMESH::Entity_Quad_Quadrangle );
       notSupportedElemTypes.push_back( SMESH::Entity_Polygon );
       notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polygon );
       notSupportedElemTypes.push_back( SMESH::Entity_Quad_Pyramid );
-      notSupportedElemTypes.push_back( SMESH::Entity_Quad_Hexa );
       notSupportedElemTypes.push_back( SMESH::Entity_Quad_Penta );
       notSupportedElemTypes.push_back( SMESH::Entity_Hexagonal_Prism );
       notSupportedElemTypes.push_back( SMESH::Entity_Polyhedra );
index 8d77bc3570d17188e308151b07321e079a77323e..ce220e259bc0ab6f427e78953483cd937a0b7bb8 100644 (file)
@@ -441,7 +441,7 @@ void SMESHGUI_AddMeshElementDlg::Init()
 
   /* signals and slots connections */
   connect(buttonOk,        SIGNAL(clicked()),                     SLOT(ClickOnOk()));
-  connect(buttonCancel,    SIGNAL(clicked()),                     SLOT(ClickOnCancel()));
+  connect(buttonCancel,    SIGNAL(clicked()),                     SLOT(reject()));
   connect(buttonApply,     SIGNAL(clicked()),                     SLOT(ClickOnApply()));
   connect(buttonHelp,      SIGNAL(clicked()),                     SLOT(ClickOnHelp()));
 
@@ -450,8 +450,8 @@ void SMESHGUI_AddMeshElementDlg::Init()
   connect(mySMESHGUI,      SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr,  SIGNAL(currentSelectionChanged()),     SLOT(SelectionIntoArgument()));
   /* to close dialog if study frame change */
-  connect(mySMESHGUI,      SIGNAL(SignalStudyFrameChanged()),     SLOT(ClickOnCancel()));
-  connect(mySMESHGUI,      SIGNAL(SignalCloseAllDialogs()),       SLOT(ClickOnCancel()));    
+  connect(mySMESHGUI,      SIGNAL(SignalStudyFrameChanged()),     SLOT(reject()));
+  connect(mySMESHGUI,      SIGNAL(SignalCloseAllDialogs()),       SLOT(reject()));    
 
   if (Reverse)
     connect(Reverse,       SIGNAL(stateChanged(int)),             SLOT(CheckBox(int)));
@@ -599,14 +599,14 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
 void SMESHGUI_AddMeshElementDlg::ClickOnOk()
 {
   ClickOnApply();
-  ClickOnCancel();
+  reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
+void SMESHGUI_AddMeshElementDlg::reject()
 {
   //mySelectionMgr->clearSelected();
   mySimulation->SetVisibility(false);
@@ -615,7 +615,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
     aViewWindow->SetSelectionMode( ActorSelection );
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -874,26 +874,6 @@ void SMESHGUI_AddMeshElementDlg::enterEvent (QEvent*)
   ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_AddMeshElementDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=================================================================================
-// function : hideEvent()
-// purpose  : caused by ESC key
-//=================================================================================
-void SMESHGUI_AddMeshElementDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : CheckBox()
 // purpose  :
index 72ad06d9308db6cef46c114a8a8e10b3c8ec6884..d5f420eb122da01f44f456983117b511f7e396bc 100644 (file)
@@ -71,8 +71,6 @@ public:
   
 private:
   void                        Init();
-  void                        closeEvent( QCloseEvent* );
-  void                        hideEvent( QHideEvent* );     /* ESC key */
   void                        enterEvent( QEvent* );        /* mouse enter the QWidget */
   void                        keyPressEvent( QKeyEvent* );
   void                        displaySimulation();
@@ -119,9 +117,11 @@ private:
   
   QString                     myHelpFileName;
   
+protected slots:
+  virtual void                reject();
+
 private slots:
   void                        ClickOnOk();
-  void                        ClickOnCancel();
   void                        ClickOnApply();
   void                        ClickOnHelp();
   void                        SetEditCurrentArgument();
index c4bc516ad7b4496ec0c2015c44e23d9643cbd233..3a72de15241aab33b4caa01ea809753d0067e84d 100644 (file)
@@ -628,13 +628,13 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
   connect(myReverseCB,    SIGNAL(stateChanged(int)), SLOT(onReverse(int)));
 
   connect(buttonOk, SIGNAL(clicked()),     SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), SLOT(reject()));
   connect(buttonApply, SIGNAL(clicked()),  SLOT(ClickOnApply()));
   connect(buttonHelp, SIGNAL(clicked()),   SLOT(ClickOnHelp()));
 
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
-  connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(ClickOnCancel()));
+  connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(reject()));
 
   myCurrentLineEdit = myCornerNodes;
 
@@ -803,14 +803,14 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
 void SMESHGUI_AddQuadraticElementDlg::ClickOnOk()
 {
   ClickOnApply();
-  ClickOnCancel();
+  reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_AddQuadraticElementDlg::ClickOnCancel()
+void SMESHGUI_AddQuadraticElementDlg::reject()
 {
   mySelectionMgr->clearSelected();
   mySimulation->SetVisibility(false);
@@ -819,7 +819,7 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnCancel()
     aViewWindow->SetSelectionMode( ActorSelection );
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -1134,26 +1134,6 @@ void SMESHGUI_AddQuadraticElementDlg::enterEvent (QEvent*)
   ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_AddQuadraticElementDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=================================================================================
-// function : hideEvent()
-// purpose  : caused by ESC key
-//=================================================================================
-void SMESHGUI_AddQuadraticElementDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : onReverse()
 // purpose  :
index 3b2c360b26f6bcf5dcdb889a6cad339b47b321b9..7ef5800229dafcdc6005404a1ed0f77d78e8c003 100644 (file)
@@ -73,8 +73,6 @@ private:
   typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
 
   void                        Init();
-  void                        closeEvent( QCloseEvent* );
-  void                        hideEvent( QHideEvent* );    /* ESC key */
   void                        enterEvent( QEvent* );       /* mouse enter the QWidget */
   void                        keyPressEvent( QKeyEvent* );
   void                        displaySimulation();
@@ -128,6 +126,9 @@ private:
   
   QString                     myHelpFileName;
   
+protected slots:
+  virtual void                reject();
+
 private slots:
   void                        onTextChange( const QString& );
   void                        onCellTextChange( int, int );
@@ -135,7 +136,6 @@ private slots:
   void                        onCellDoubleClicked( int, int );
   
   void                        ClickOnOk();
-  void                        ClickOnCancel();
   void                        ClickOnApply();
   void                        ClickOnHelp();
   void                        SetCurrentSelection();
index cadd4593f51688b49182c8cc8966723736e8986d..3ca0fff25ae06442733a331c70577a4a220863ff 100644 (file)
@@ -212,7 +212,7 @@ void SMESHGUI_BuildCompoundDlg::Init()
 
   // signals and slots connections
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
 
@@ -223,7 +223,7 @@ void SMESHGUI_BuildCompoundDlg::Init()
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
-  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(reject()));
 
   LineEditName->setText(GetDefaultName(tr("COMPOUND_MESH")));
   LineEditMeshes->setFocus();
@@ -366,20 +366,20 @@ void SMESHGUI_BuildCompoundDlg::ClickOnOk()
 {
   setIsApplyAndClose( true );
   if (ClickOnApply())
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_BuildCompoundDlg::ClickOnCancel()
+void SMESHGUI_BuildCompoundDlg::reject()
 {
   //mySelectionMgr->clearSelected();
   mySelectionMgr->clearFilters();
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -480,27 +480,6 @@ void SMESHGUI_BuildCompoundDlg::enterEvent( QEvent* )
   ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_BuildCompoundDlg::closeEvent( QCloseEvent* )
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_BuildCompoundDlg::hideEvent( QHideEvent* )
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
-
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
index 6230022e82f42e9be2a1cbaa1b75854225942a03..a5890252c53e10ead824ce65baaca86aa9e5393e 100644 (file)
@@ -68,9 +68,7 @@ public:
 
 private:
   void                    Init();
-  void                    closeEvent( QCloseEvent* );
   void                    enterEvent( QEvent* );             /* mouse enter the QWidget */
-  void                    hideEvent( QHideEvent* );          /* ESC key */
   void                    keyPressEvent( QKeyEvent* );
 
   bool                    isValid();
@@ -115,9 +113,11 @@ private:
 
   bool                    myIsApplyAndClose;
 
+protected slots:
+  virtual void            reject();
+
 private slots:
   void                    ClickOnOk();
-  void                    ClickOnCancel();
   bool                    ClickOnApply();
   void                    ClickOnHelp();
   void                    SelectionIntoArgument();
index 993f69f283d905621447ba1439af1bf0bf128f31..c359f18a69c14ec2db046b66f3118c2320507803 100644 (file)
@@ -479,12 +479,12 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg( SMESHGUI* theModule, SVTK_ViewWindow
   connect(PreviewCheckBox, SIGNAL(toggled(bool)), this, SLOT(OnPreviewToggle(bool)));
   connect(AutoApplyCheckBox, SIGNAL(toggled(bool)), this, SLOT(onAutoApply(bool)));
   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
   /* to close dialog if study frame change */
-  connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), this, SLOT(reject()));
 
   this->show();
 }
@@ -589,16 +589,17 @@ void SMESHGUI_ClippingDlg::ClickOnApply()
 void SMESHGUI_ClippingDlg::ClickOnOk()
 {
   ClickOnApply();
-  ClickOnCancel();
+  reject();
 }
 
 //=======================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=======================================================================
-void SMESHGUI_ClippingDlg::ClickOnCancel()
+void SMESHGUI_ClippingDlg::reject()
 {
-  close();
+  //here we can insert actions to do at close.
+  QDialog::reject();
 }
 
 //=================================================================================
index e8cb095f89fa7f8293ed2a402ad851333e15f2bf..3ade2c9c7bfa6f9c9b1a760c70f9e26acbd7c81c 100644 (file)
@@ -192,6 +192,9 @@ private:
   bool                    myIsSelectPlane;
   QString                 myHelpFileName;
 
+protected slots:
+  virtual void            reject();
+
 public slots:
   void                    onSelectPlane( int );
   void                    ClickOnNew();
@@ -203,7 +206,6 @@ public slots:
   void                    OnPreviewToggle( bool );
   void                    onAutoApply(bool);
   void                    ClickOnOk();
-  void                    ClickOnCancel();
   void                    ClickOnApply();
   void                    ClickOnHelp();
 };
index dab7a224c7c4dcbfb7c5ece96d8b56d23b74d766..6a3b9038b216c755e22149844afa5ed39db6d7a6 100644 (file)
@@ -227,7 +227,7 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule )
 
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
 
@@ -236,7 +236,7 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule )
   connect(mySelectionMgr, SIGNAL (currentSelectionChanged()),
           this,           SLOT   (SelectionIntoArgument()));
   connect(mySMESHGUI,     SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */
-          this,           SLOT   (ClickOnCancel()));
+          this,           SLOT   (reject()));
 
   connect(myLineEditElements, SIGNAL(textChanged(const QString&)),
           this,               SLOT  (onTextChange(const QString&)));
@@ -369,14 +369,14 @@ void SMESHGUI_CopyMeshDlg::ClickOnOk()
 {
   setIsApplyAndClose( true );
   if( ClickOnApply() )
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_CopyMeshDlg::ClickOnCancel()
+void SMESHGUI_CopyMeshDlg::reject()
 {
   disconnect(mySelectionMgr, 0, this, 0);
   if ( mySelectionMgr )
@@ -384,7 +384,7 @@ void SMESHGUI_CopyMeshDlg::ClickOnCancel()
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode( ActorSelection );
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -618,26 +618,6 @@ void SMESHGUI_CopyMeshDlg::enterEvent (QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_CopyMeshDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_CopyMeshDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
index b0c3b9338ae653bb76628292b539d84edd9a1f83..d39f9cc5c894259e77d61ae0f89685c33ff5d12d 100644 (file)
@@ -65,9 +65,7 @@ public:
 
 private:
   void                   Init( bool = true );
-  void                   closeEvent( QCloseEvent* );
   void                   enterEvent( QEvent* );           /* mouse enter the QWidget */
-  void                   hideEvent( QHideEvent* );        /* ESC key */
   void                   keyPressEvent( QKeyEvent* );
   int                    GetConstructorId();
   void                   setNewMeshName();
@@ -114,9 +112,11 @@ private:
 
   bool                   myIsApplyAndClose;
 
+protected slots:
+  virtual void           reject();
+
 private slots:
   void                   ClickOnOk();
-  void                   ClickOnCancel();
   bool                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SelectionIntoArgument();
index ac3c7193196579be1b4678894c07883b0815141f..9413696e9852a5884a721a276a850e3128c64dde 100755 (executable)
@@ -230,7 +230,7 @@ QWidget* SMESHGUI_CreatePatternDlg::createButtonFrame( QWidget* theParent )
   aLay->addWidget( myHelpBtn );
 
   connect( myOkBtn,    SIGNAL( clicked() ), this, SLOT( onOk() ) );
-  connect( myCloseBtn, SIGNAL( clicked() ), this, SLOT( onClose() ) );
+  connect( myCloseBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
   connect( mySaveBtn,  SIGNAL( clicked() ), this, SLOT( onSave() ) );
   connect( myHelpBtn,  SIGNAL( clicked() ), this, SLOT( onHelp() ) );
 
@@ -279,7 +279,7 @@ void SMESHGUI_CreatePatternDlg::Init( const int theType )
   connect( mySMESHGUI,     SIGNAL( SignalDeactivateActiveDialog() ),
            this,           SLOT( onDeactivate() ) );
   connect( mySMESHGUI,     SIGNAL( SignalCloseAllDialogs() ),
-           this,           SLOT( onClose() ) );
+           this,           SLOT( reject() ) );
 
   mySwitch2d->setEnabled( theType == Type_2d );
   mySwitch3d->setEnabled( theType == Type_3d );
@@ -482,17 +482,17 @@ void SMESHGUI_CreatePatternDlg::onOk()
 }
 
 //=======================================================================
-// function : onClose()
+// function : reject()
 // purpose  : SLOT called when "Close" button pressed. Close dialog
 //=======================================================================
-void SMESHGUI_CreatePatternDlg::onClose()
+void SMESHGUI_CreatePatternDlg::reject()
 {
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
     aViewWindow->SetSelectionMode( ActorSelection );
   disconnect( mySelectionMgr, 0, this, 0 );
   disconnect( mySMESHGUI, 0, this, 0 );
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
   emit Close();
 }
 
@@ -648,15 +648,6 @@ void SMESHGUI_CreatePatternDlg::enterEvent( QEvent* )
   }
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  : Close dialog box
-//=================================================================================
-void SMESHGUI_CreatePatternDlg::closeEvent( QCloseEvent* )
-{
-  onClose();
-}
-
 //=======================================================================
 // function : onSelBtnClicked()
 // purpose  : SLOT. Called when -> button clicked.
index 0a03e1061d8542fc70f1b32fced52f5735546c52..096ce40fc677cade366fba67ddd0841ac8029843 100755 (executable)
@@ -74,14 +74,13 @@ signals:
   void                     Close();
 
 private:
-  void                     closeEvent( QCloseEvent* );
   void                     enterEvent( QEvent* );
   void                     keyPressEvent( QKeyEvent* );
  
 private slots:
   void                     onOk();
   void                     onSave();
-  void                     onClose();
+  void                     reject();
   void                     onHelp();
 
   void                     onDeactivate();
index 73eae4dd247ec919a481138ca35ed4c8fc85b0f5..8fdd03e6fdd00bf16b03ce7ddd2965e6edb9ecd2 100644 (file)
@@ -335,7 +335,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init()
 
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL( clicked() ), SLOT( ClickOnOk() ) );
-  connect(buttonCancel, SIGNAL( clicked() ), SLOT( ClickOnCancel() ) );
+  connect(buttonCancel, SIGNAL( clicked() ), SLOT( reject() ) );
   connect(buttonApply,  SIGNAL( clicked() ), SLOT( ClickOnApply() ) );
   connect(buttonHelp,   SIGNAL( clicked() ), SLOT( ClickOnHelp() ) );
 
@@ -351,7 +351,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init()
   connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
   connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool)));
   /* to close dialog if study change */
-  connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
+  connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
   
   ConstructorsClicked(0);
   SelectionIntoArgument();
@@ -589,15 +589,15 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnOk()
 {
   if(checkEditLine(false) == -1) {return;}
   ClickOnApply();
-  ClickOnCancel();
+  reject();
 }
 
         
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel()
+void SMESHGUI_CreatePolyhedralVolumeDlg::reject()
 {
   mySelectionMgr->clearFilters();
   //SALOME_ListIO aList;
@@ -608,7 +608,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel()
     aViewWindow->SetSelectionMode( ActorSelection );
   disconnect( mySelectionMgr, 0, this, 0 );
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -1037,30 +1037,6 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent(QEvent* e)
   ActivateThisDialog();
 }
 
-
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_CreatePolyhedralVolumeDlg::closeEvent( QCloseEvent* e )
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-
-//=======================================================================
-//function : hideEvent
-//purpose  : caused by ESC key
-//=======================================================================
-
-void SMESHGUI_CreatePolyhedralVolumeDlg::hideEvent ( QHideEvent * e )
-{
-  if ( !isMinimized() )
-    ClickOnCancel();
-}
-
-
 //=================================================================================
 // function : GetConstructorId()
 // purpose  : 
index 44dd3ab5de905b97d3909f6f2e47512901c68aa8..f0c2e77f3c82fb95fe50453f397d557079edff17 100644 (file)
@@ -72,9 +72,7 @@ private:
   typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
 
   void                     Init();
-  void                     closeEvent( QCloseEvent* );
   void                     enterEvent( QEvent* );          /* mouse enter the QWidget */
-  void                     hideEvent( QHideEvent* );       /* ESC key */
   void                     keyPressEvent( QKeyEvent* );
   int                      GetConstructorId();
   void                     displaySimulation();
@@ -125,11 +123,13 @@ public slots:
   void                     onAdd();
   void                     onRemove();
 
+protected slots:
+  virtual void             reject();
+
 private slots:
   void                     ConstructorsClicked( int );
   void                     ClickOnPreview( bool );
   void                     ClickOnOk();
-  void                     ClickOnCancel();
   void                     ClickOnApply();
   void                     ClickOnHelp();
   void                     SetEditCurrentArgument();
index 7b2c6e27a9a724b69d67c25db0c747b4d5abe498..3200bc02f881d1fac7190cbd66d8ca65a0b20d47 100644 (file)
@@ -146,7 +146,7 @@ QWidget* SMESHGUI_DeleteGroupDlg::createButtonFrame (QWidget* theParent)
 
   // connect signals and slots
   connect(myOkBtn,    SIGNAL(clicked()), SLOT(onOk()));
-  connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
+  connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject()));
   connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
   connect(myHelpBtn,  SIGNAL(clicked()), SLOT(onHelp()));
 
@@ -173,7 +173,7 @@ void SMESHGUI_DeleteGroupDlg::Init ()
   // selection and SMESHGUI
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
-  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
 
   // set selection mode
   mySelectionMgr->installFilter(new SMESH_TypeFilter(SMESH::GROUP));
@@ -239,14 +239,14 @@ bool SMESHGUI_DeleteGroupDlg::onApply()
 void SMESHGUI_DeleteGroupDlg::onOk()
 {
   if (onApply())
-    onClose();
+    reject();
 }
 
 //=================================================================================
-// function : onClose()
+// function : reject()
 // purpose  : SLOT called when "Close" button pressed. Close dialog
 //=================================================================================
-void SMESHGUI_DeleteGroupDlg::onClose()
+void SMESHGUI_DeleteGroupDlg::reject()
 {
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
@@ -254,7 +254,7 @@ void SMESHGUI_DeleteGroupDlg::onClose()
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
   mySelectionMgr->clearFilters();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -334,15 +334,6 @@ void SMESHGUI_DeleteGroupDlg::enterEvent (QEvent*)
   mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_DeleteGroupDlg::closeEvent (QCloseEvent*)
-{
-  onClose();
-}
-
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
index 76f6bd5b012bb57a2d7a26ecc466c9cee02bdc29..12ccb0023f66eee54202ca51d2df810f15ac24af 100644 (file)
@@ -59,14 +59,15 @@ public:
   void                    Init ();
 
 private:
-  void                    closeEvent( QCloseEvent* );
   void                    enterEvent( QEvent* );
   void                    keyPressEvent( QKeyEvent* );
 
+protected slots:
+  virtual void            reject();
+
 private slots:
   void                    onOk();
   bool                    onApply();
-  void                    onClose();
   void                    onHelp();
 
   void                    onDeactivate();
index 1ee5ab8c9af6dc321ffc7a2398c707d2932ed009..0c49d152e4139748bab978a0c3fcdb8e53b27b8a 100644 (file)
@@ -214,14 +214,14 @@ SMESHGUI_DuplicateNodesDlg::SMESHGUI_DuplicateNodesDlg( SMESHGUI* theModule )
   connect(mySelectButton3, SIGNAL (clicked()), this, SLOT(onEditCurrentArgument()));
 
   connect(myButtonOk,     SIGNAL(clicked()), this, SLOT(onOk()));
-  connect(myButtonClose,  SIGNAL(clicked()), this, SLOT(onClose()));
+  connect(myButtonClose,  SIGNAL(clicked()), this, SLOT(reject()));
   connect(myButtonApply,  SIGNAL(clicked()), this, SLOT(onApply()));
   connect(myButtonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
   
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionChanged()));
 
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(onClose()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
 }
 
 /*!
@@ -425,19 +425,19 @@ bool SMESHGUI_DuplicateNodesDlg::onApply()
 void SMESHGUI_DuplicateNodesDlg::onOk()
 {
   if (onApply())
-    onClose();
+    reject();
 }
 
 /*!
   \brief SLOT called to close the dialog.
 */
-void SMESHGUI_DuplicateNodesDlg::onClose()
+void SMESHGUI_DuplicateNodesDlg::reject()
 {
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
   mySelectionMgr->clearFilters();
-  reject();
+  QDialog::reject();
 }
 
 /*!
@@ -575,15 +575,6 @@ void SMESHGUI_DuplicateNodesDlg::enterEvent (QEvent*)
   }
 }
 
-/*!
-  \brief Receive close events.
-  Reimplemented from QWidget class.
-*/
-void SMESHGUI_DuplicateNodesDlg::closeEvent (QCloseEvent*)
-{
-  onClose();
-}
-
 /*!
   \brief Receive key press events.
   Reimplemented from QWidget class.
index 2714ba0932fd5f9aa3ee8662afc0a08e1a3b6608..ac91720b6de3996166bad7f1749dd82034838f35 100644 (file)
@@ -65,15 +65,16 @@ private:
 
   bool                    isValid();
   
-  void                    closeEvent( QCloseEvent* );
   void                    enterEvent( QEvent* );
   void                    keyPressEvent( QKeyEvent* );
   
+protected slots:
+  virtual void            reject();
+
 private slots:
   void                    onConstructorsClicked( int );
  
   void                    onOk();
-  void                    onClose();
   bool                    onApply();
   void                    onHelp();
 
index d23c6dc33b273705088091ad374b5ac5fbc17601..5a2c3eba62f8e29f74a00b25fd69fdda7912b78f 100644 (file)
@@ -305,7 +305,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
   /***************************************************************/
   // signals and slots connections
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
 
@@ -326,7 +326,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
   connect(mySMESHGUI,           SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr,       SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,           SIGNAL(SignalCloseAllDialogs()),   this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI,           SIGNAL(SignalCloseAllDialogs()),   this, SLOT(reject()));
   connect(LineEditElements,     SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,         SIGNAL(toggled(bool)),               SLOT(onSelectMesh(bool)));
 
@@ -664,16 +664,28 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
 void SMESHGUI_ExtrusionDlg::ClickOnOk()
 {
   if (ClickOnApply())
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  : Called when dialog box is closed
 //=================================================================================
-void SMESHGUI_ExtrusionDlg::ClickOnCancel()
+void SMESHGUI_ExtrusionDlg::reject()
 {
-  reject();
+  disconnect(mySelectionMgr, 0, this, 0);
+  mySelectionMgr->clearFilters();
+  //mySelectionMgr->clearSelected();
+  if (SMESH::GetCurrentVtkView()) {
+    SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
+    SMESH::SetPointRepresentation(false);
+    SMESH::SetPickable();
+  }
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
+  mySMESHGUI->ResetState();
+
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -998,32 +1010,6 @@ void SMESHGUI_ExtrusionDlg::enterEvent (QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_ExtrusionDlg::closeEvent( QCloseEvent* )
-{
-  /* same than click on cancel button */
-  disconnect(mySelectionMgr, 0, this, 0);
-  mySelectionMgr->clearFilters();
-  //mySelectionMgr->clearSelected();
-  if (SMESH::GetCurrentVtkView()) {
-    SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
-    SMESH::SetPointRepresentation(false);
-    SMESH::SetPickable();
-  }
-  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-    aViewWindow->SetSelectionMode(ActorSelection);
-  mySMESHGUI->ResetState();
-}
-
-void SMESHGUI_ExtrusionDlg::reject()
-{
-  QDialog::reject();
-  close();
-}
-
 //=================================================================================
 // function : onSelectMesh()
 // purpose  :
index 330951397bd9a219e8e1ffdde7de4ac13e158bd3..71d20ece01e03b918f1217e3d6d242964b72ae2b 100644 (file)
@@ -68,12 +68,9 @@ public:
   SMESHGUI_ExtrusionDlg( SMESHGUI* );
   ~SMESHGUI_ExtrusionDlg();
 
-  void                             reject();
-
 private:
   void                             Init( bool = true );
   void                             enterEvent( QEvent* );       /* mouse enter the QWidget */
-  void                             closeEvent( QCloseEvent* );
   void                             keyPressEvent( QKeyEvent* );
   int                              GetConstructorId();
   void                             getExtrusionVector(SMESH::DirStruct& aVector);
@@ -147,14 +144,14 @@ private:
   SMESHGUI_FilterDlg*              myFilterDlg;
 
 protected slots:
-  virtual void              onDisplaySimulation( bool );
+  virtual void                    onDisplaySimulation( bool );
+  virtual void                    reject();
    
 private slots:
   void                            ConstructorsClicked( int );
   void                            CheckIsEnable();
   void                            ClickOnOk();
   bool                            ClickOnApply();
-  void                            ClickOnCancel();
   void                            ClickOnHelp();
   void                            ClickOnRadio();
   void                            SetEditCurrentArgument();
index 108f7bed5e24780e97ff32670d68faba6248ebfb..f1097018ab771ebd18e960b3c5abf3ebd798b054 100755 (executable)
@@ -2653,7 +2653,7 @@ QWidget* SMESHGUI_FilterDlg::createButtonFrame (QWidget* theParent)
   aLay->addWidget(myButtons[ BTN_Help   ]);
 
   connect(myButtons[ BTN_OK     ], SIGNAL(clicked()), SLOT(onOk()));
-  connect(myButtons[ BTN_Close  ], SIGNAL(clicked()), SLOT(onClose()));
+  connect(myButtons[ BTN_Close  ], SIGNAL(clicked()), SLOT(reject()));
   connect(myButtons[ BTN_Apply  ], SIGNAL(clicked()), SLOT(onApply()));
   connect(myButtons[ BTN_Help   ], SIGNAL(clicked()), SLOT(onHelp()));
 
@@ -2718,7 +2718,7 @@ void SMESHGUI_FilterDlg::Init (const QList<int>& theTypes, const bool setInViewe
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
-  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
   
   updateMainButtons();
   updateSelection();
@@ -2768,10 +2768,10 @@ void SMESHGUI_FilterDlg::onOk()
 }
 
 //=======================================================================
-// name    : SMESHGUI_FilterDlg::onClose
+// name    : SMESHGUI_FilterDlg::reject
 // Purpose : SLOT called when "Close" button pressed. Close dialog
 //=======================================================================
-void SMESHGUI_FilterDlg::onClose()
+void SMESHGUI_FilterDlg::reject()
 {
   // Restore previously selected object
   if (mySelectionMgr)
@@ -2799,8 +2799,7 @@ void SMESHGUI_FilterDlg::onClose()
   disconnect(mySMESHGUI, 0, this, 0);
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
-  reject();
-  return;
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -2848,15 +2847,6 @@ void SMESHGUI_FilterDlg::enterEvent (QEvent*)
   setEnabled(true);
 }
 
-//=======================================================================
-// name    : closeEvent()
-// Purpose :
-//=======================================================================
-void SMESHGUI_FilterDlg::closeEvent (QCloseEvent*)
-{
-  onClose();
-}
-
 //=======================================================================
 // name    : SMESHGUI_FilterDlg::getIdsFromWg
 // Purpose : Retrieve list of ids from given widget
index 4501a9d373272a881efcab610c8354b2c9381a04..8081aec6994a7fc7434a3bc348862eb79a556db0 100755 (executable)
@@ -238,11 +238,13 @@ signals:
 
   void                      Accepted();
 
+protected slots:
+  virtual void              reject();
+
 private slots:
 
   void                      onOk();
   bool                      onApply();
-  void                      onClose();
   void                      onHelp();
   void                      onDeactivate();
   void                      onSelectionDone();
@@ -253,7 +255,6 @@ private:
 
   void                      construct( const QList<int>& ); 
 
-  void                      closeEvent( QCloseEvent* );
   void                      enterEvent( QEvent* );
   void                      keyPressEvent( QKeyEvent* );
 
index c17dde1fa69a7b6b4bbfa2563b0651d8af7a95fe..0a2ec7b6663e1d82fd262458c05ca6ad2b280eae 100644 (file)
@@ -269,7 +269,7 @@ QWidget* SMESHGUI_FilterLibraryDlg::createButtonFrame (QWidget* theParent)
   aLay->addWidget(myButtons[ BTN_Help   ]);
 
   connect(myButtons[ BTN_OK     ], SIGNAL(clicked()), SLOT(onOk()));
-  connect(myButtons[ BTN_Close  ], SIGNAL(clicked()), SLOT(onClose()));
+  connect(myButtons[ BTN_Close  ], SIGNAL(clicked()), SLOT(reject()));
   connect(myButtons[ BTN_Apply  ], SIGNAL(clicked()), SLOT(onApply()));
   connect(myButtons[ BTN_Help   ], SIGNAL(clicked()), SLOT(onHelp()));
 
@@ -337,7 +337,7 @@ void SMESHGUI_FilterLibraryDlg::Init (const QList<int>& theTypes,
   setEnabled(true);
 
   connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
-  connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+  connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
 
   if (myMode == ADD_TO)
   {
@@ -467,22 +467,18 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
 void SMESHGUI_FilterLibraryDlg::onOk()
 {
   if (onApply())
-  {
-    disconnect( mySMESHGUI, 0, this, 0);
-    mySMESHGUI->ResetState();
-    accept();
-  }
+    reject();
 }
 
 //=======================================================================
-// name    : SMESHGUI_FilterLibraryDlg::onClose
+// name    : SMESHGUI_FilterLibraryDlg::reject
 // Purpose : SLOT called when "Close" button pressed. Close dialog
 //=======================================================================
-void SMESHGUI_FilterLibraryDlg::onClose()
+void SMESHGUI_FilterLibraryDlg::reject()
 {
   disconnect( mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -527,15 +523,6 @@ void SMESHGUI_FilterLibraryDlg::enterEvent(QEvent*)
   setEnabled(true);
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  : Close dialog
-//=================================================================================
-void SMESHGUI_FilterLibraryDlg::closeEvent(QCloseEvent* e)
-{
-  onClose();
-}
-
 //=======================================================================
 // name    : SMESHGUI_FilterLibraryDlg::getFileName
 // Purpose : Get file name
index 5b5af4fd0cad7e23194261dc3c0ac0b3f6e747d3..539faab465a1a64cc5a97985a1a243de17393f45 100644 (file)
@@ -77,14 +77,15 @@ public:
   void                        SetTable( const SMESHGUI_FilterTable* );
 
 private:
-  void                        closeEvent( QCloseEvent* );
   void                        enterEvent( QEvent* );            
   void                        keyPressEvent( QKeyEvent* );
   
+protected slots:
+  virtual void                reject();
+
 private slots:
   void                        onOk();
   bool                        onApply();
-  void                        onClose();
   void                        onHelp();
 
   void                        onDeactivate();
index 03ebc273151c28875f28c9e3f5530e38c877ec56..be401f774e99ce65b61b4e26e34fa79842b7ade3 100644 (file)
@@ -439,7 +439,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
 
   connect(myOKBtn,         SIGNAL(clicked()), this, SLOT(onOK()));
   connect(myApplyBtn,      SIGNAL(clicked()), this, SLOT(onApply()));
-  connect(myCloseBtn,      SIGNAL(clicked()), this, SLOT(onClose()));
+  connect(myCloseBtn,      SIGNAL(clicked()), this, SLOT(reject()));
   connect(myHelpBtn,       SIGNAL(clicked()), this, SLOT(onHelp()));
 
   /* Init selection */
@@ -458,7 +458,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
   myGeomFilter = new GEOM_SelectionFilter( aStudy, true );
 
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
-  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(onClose()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(reject()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),  this, SLOT(onObjectSelectionChanged()));
   connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()),      this, SLOT(onVisibilityChanged()));
 
@@ -1189,7 +1189,7 @@ void SMESHGUI_GroupDlg::onOK()
 {
   setIsApplyAndClose( true );
   if ( onApply() )
-    onClose();
+    reject();
   setIsApplyAndClose( false );
 }
 
@@ -2165,15 +2165,6 @@ void SMESHGUI_GroupDlg::onSort()
   }
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*)
-{
-  onClose();
-}
-
 //=================================================================================
 // function : onVisibilityChanged()
 // purpose  :
@@ -2184,10 +2175,10 @@ void SMESHGUI_GroupDlg::onVisibilityChanged()
 }
 
 //=================================================================================
-// function : SMESHGUI_GroupDlg::onClose
+// function : SMESHGUI_GroupDlg::reject
 // purpose  : SLOT called when "Close" button pressed. Close dialog
 //=================================================================================
-void SMESHGUI_GroupDlg::onClose()
+void SMESHGUI_GroupDlg::reject()
 {
   if (SMESH::GetCurrentVtkView()) {
     SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
@@ -2208,7 +2199,7 @@ void SMESHGUI_GroupDlg::onClose()
   mySelectionMgr->clearFilters();
   mySMESHGUI->ResetState();
 
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -2262,16 +2253,6 @@ void SMESHGUI_GroupDlg::enterEvent (QEvent*)
   }
 }
 
-//=================================================================================
-// function : hideEvent
-// purpose  : caused by ESC key
-//=================================================================================
-void SMESHGUI_GroupDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized() && !myIsBusy)
-    onClose();
-}
-
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
index f3cb58f0fe5e90730c2bec23c4228438a8bc3773..638699e19db5bd8633724ba75d64f40770bb5848 100644 (file)
@@ -85,13 +85,15 @@ public slots:
   void onAdd();
   void onRemove();
 
+protected slots:
+  virtual void                  reject();
+
 private slots:
   void                          onTypeChanged( int );
   void                          onGrpTypeChanged( int );
   void                          onColorChanged( QColor );
   
   void                          onOK();
-  void                          onClose();
   bool                          onApply();
   void                          onHelp();
   void                          onDeactivate();
@@ -123,9 +125,7 @@ private:
   void                          init( SMESH::SMESH_Mesh_ptr );
   void                          init( SMESH::SMESH_GroupBase_ptr,
                                       const bool theIsConvert = false );
-  void                          closeEvent( QCloseEvent* );
   void                          enterEvent( QEvent* );
-  void                          hideEvent( QHideEvent* );   /* ESC key */
   void                          keyPressEvent( QKeyEvent* );
   void                          setSelectionMode( int );
   void                          updateButtons();
index 87b3ed7cdac8c2f29395f43ba5695b6a455037d1..2aeeea586a33b4b98ab3df6ab079aeb15c982452 100644 (file)
@@ -204,7 +204,7 @@ QWidget* SMESHGUI_GroupOpDlg::createButtonFrame (QWidget* theParent)
 
   // connect signals and slots
   connect(myOkBtn,    SIGNAL(clicked()), SLOT(onOk()));
-  connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
+  connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject()));
   connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
   connect(myHelpBtn,  SIGNAL(clicked()), SLOT(onHelp()));
 
@@ -228,7 +228,7 @@ void SMESHGUI_GroupOpDlg::Init()
   // selection and SMESHGUI
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
-  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnClose()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
 
   // set selection mode
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
@@ -315,14 +315,14 @@ void SMESHGUI_GroupOpDlg::onOk()
 {
   setIsApplyAndClose( true );
   if ( onApply() )
-    onClose();
+    reject();
   setIsApplyAndClose( false );
 }
 
 /*!
-  \brief SLOT called when "Close" button pressed closes dialog
+  \brief SLOT called when dialog is closed
 */
-void SMESHGUI_GroupOpDlg::onClose()
+void SMESHGUI_GroupOpDlg::reject()
 {
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
@@ -331,7 +331,7 @@ void SMESHGUI_GroupOpDlg::onClose()
   mySMESHGUI->ResetState();
   mySelectionMgr->clearFilters();
   reset();
-  reject();
+  QDialog::reject();
 }
 
 /*!
@@ -467,14 +467,6 @@ void SMESHGUI_GroupOpDlg::enterEvent(QEvent*)
   mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
 }
 
-/*!
-  \brief Provides reaction on close event, closes the dialog box
-*/
-void SMESHGUI_GroupOpDlg::closeEvent(QCloseEvent*)
-{
-  onClose();
-}
-
 /*!
   \brief Resets state of the dialog, initializes its fields with default value, etc. 
   Usually called by onApply() slot to reinitialize dialog  fields. This virtual method 
index ec3b4c2f5e28b8365c67d764386040a1e0b78df3..bf4c2c473a100f2d91f3f2d19a2365f6426237d9 100644 (file)
@@ -92,13 +92,14 @@ protected:
   bool                      isApplyAndClose() const;
 
 private:
-  void                      closeEvent( QCloseEvent* );
   void                      enterEvent( QEvent* );            
   void                      keyPressEvent( QKeyEvent* );
   
+protected slots:
+  virtual void              reject();
+
 private slots:
   void                      onOk();
-  void                      onClose();
   void                      onHelp();
 
   void                      onDeactivate();
index b1345a00afab7ff775757823ed5e22c6c82bda0b..82884701fc835d6ccb2285cf73a6477c13db4d7c 100644 (file)
@@ -552,7 +552,7 @@ void SMESHGUI_MergeDlg::Init()
   
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
 
@@ -571,7 +571,7 @@ void SMESHGUI_MergeDlg::Init()
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
 
   // Init Mesh field from selection
   SelectionIntoArgument();
@@ -697,14 +697,14 @@ bool SMESHGUI_MergeDlg::ClickOnApply()
 void SMESHGUI_MergeDlg::ClickOnOk()
 {
   if (ClickOnApply())
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_MergeDlg::ClickOnCancel()
+void SMESHGUI_MergeDlg::reject()
 {
   myIdPreview->SetPointsLabeled(false);
   SMESH::SetPointRepresentation(false);
@@ -718,7 +718,7 @@ void SMESHGUI_MergeDlg::ClickOnCancel()
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
 
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -1226,26 +1226,6 @@ void SMESHGUI_MergeDlg::enterEvent(QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_MergeDlg::closeEvent(QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_MergeDlg::hideEvent (QHideEvent *)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
index dd9458d616b6c44bd658b356dcd53bc6a7a0c511..9ec0dcb23bdcdc029563b67df2cbae6faabd7587 100644 (file)
@@ -78,9 +78,7 @@ public:
 
 private:
   void                      Init();
-  void                      closeEvent( QCloseEvent* );
   void                      enterEvent( QEvent* );              /* mouse enter the QWidget */
-  void                      hideEvent( QHideEvent* );           /* ESC key */
   void                      keyPressEvent( QKeyEvent* );
   void                      onEditGroup();
 
@@ -150,9 +148,11 @@ private:
   QString                   myEntry;
   GrpList                   myGroups;
 
+protected slots:
+  virtual void              reject();
+
  private slots:
   void                      ClickOnOk();
-  void                      ClickOnCancel();
   bool                      ClickOnApply();
   void                      ClickOnHelp();
   void                      updateControls();
index cfb1f0e649200e04b3d3db5fa9a6ac26b110c357..48b0a82b9770be9aacd217a92254f73474a5f355 100755 (executable)
@@ -352,7 +352,7 @@ QWidget* SMESHGUI_MeshPatternDlg::createButtonFrame (QWidget* theParent)
   aLay->addWidget(myHelpBtn);
 
   connect(myOkBtn,    SIGNAL(clicked()), SLOT(onOk()));
-  connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
+  connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject()));
   connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
   connect(myHelpBtn,  SIGNAL(clicked()), SLOT(onHelp()));
 
@@ -390,7 +390,7 @@ void SMESHGUI_MeshPatternDlg::Init()
   // selection and SMESHGUI
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
-  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
 
   myTypeGrp->button(Type_2d)->setChecked(true);
   onTypeChanged(Type_2d);
@@ -538,14 +538,14 @@ bool SMESHGUI_MeshPatternDlg::onApply()
 void SMESHGUI_MeshPatternDlg::onOk()
 {
   if (onApply())
-    onClose();
+    reject();
 }
 
 //=======================================================================
-// name    : SMESHGUI_MeshPatternDlg::onClose
+// name    : SMESHGUI_MeshPatternDlg::reject
 // Purpose : SLOT called when "Close" button pressed. Close dialog
 //=======================================================================
-void SMESHGUI_MeshPatternDlg::onClose()
+void SMESHGUI_MeshPatternDlg::reject()
 {
   mySelectionMgr->clearFilters();
   SMESH::SetPickable();
@@ -555,7 +555,7 @@ void SMESHGUI_MeshPatternDlg::onClose()
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
   erasePreview();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -724,15 +724,6 @@ void SMESHGUI_MeshPatternDlg::enterEvent (QEvent*)
   onTextChanged(mySelEdit[Ids]->text());
 }
 
-//=======================================================================
-// name    : SMESHGUI_MeshPatternDlg::closeEvent
-// Purpose :
-//=======================================================================
-void SMESHGUI_MeshPatternDlg::closeEvent (QCloseEvent*)
-{
-  onClose();
-}
-
 //=======================================================================
 // name    : SMESHGUI_MeshPatternDlg::onSelInputChanged
 // Purpose : SLOT. Called when -> button clicked.
index 76e6aca7738483d755961b4b04d31e00b7db1b19..ee1053f2a64eef34d22f8222505d8ab7b225db1e 100755 (executable)
@@ -75,10 +75,12 @@ public:
 
   void                                Init();
   
+protected slots:
+  virtual void                        reject();
+
 private slots:
   void                                onOk();
   bool                                onApply();
-  void                                onClose();
   void                                onHelp();
 
   void                                onDeactivate();
@@ -108,7 +110,6 @@ private:
   void                                activateSelection();
   QStringList                         prepareFilters() const;
   QString                             autoExtension( const QString& ) const;
-  void                                closeEvent( QCloseEvent* );
   void                                enterEvent( QEvent* );
   void                                keyPressEvent( QKeyEvent* );
   bool                                isValid( const bool = true );
index b87346e6313b43ff68d03ad5c241183776a06c21..1d3a35fc3bc3dbe925b595f9a66b4e4d2e98ebdf 100755 (executable)
@@ -384,14 +384,14 @@ void SMESHGUI_MultiEditDlg::Init()
 
   // main buttons
   connect(myOkBtn,    SIGNAL(clicked()), SLOT(onOk()));
-  connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
+  connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject()));
   connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
   connect(myHelpBtn,  SIGNAL(clicked()), SLOT(onHelp()));
 
   // selection and SMESHGUI
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
-  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
 
   // dialog controls
   connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn()  ));
@@ -423,7 +423,7 @@ void SMESHGUI_MultiEditDlg::Init()
 void SMESHGUI_MultiEditDlg::onOk()
 {
   if (onApply())
-    onClose();
+    reject();
 }
 
 //=======================================================================
@@ -510,10 +510,10 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& o
 }
 
 //=======================================================================
-// name    : SMESHGUI_MultiEditDlg::onClose
+// name    : SMESHGUI_MultiEditDlg::reject
 // Purpose : SLOT called when "Close" button pressed. Close dialog
 //=======================================================================
-void SMESHGUI_MultiEditDlg::onClose()
+void SMESHGUI_MultiEditDlg::reject()
 {
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
@@ -527,7 +527,7 @@ void SMESHGUI_MultiEditDlg::onClose()
   //mySelectionMgr->clearSelected();
   mySelectionMgr->clearFilters();
 
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -646,24 +646,6 @@ void SMESHGUI_MultiEditDlg::enterEvent (QEvent*)
   }
 }
 
-//=======================================================================
-// name    : SMESHGUI_MultiEditDlg::closeEvent
-// Purpose :
-//=======================================================================
-void SMESHGUI_MultiEditDlg::closeEvent (QCloseEvent*)
-{
-  onClose();
-}
-//=======================================================================
-// name    : SMESHGUI_MultiEditDlg::hideEvent
-// Purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_MultiEditDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    onClose();
-}
-
 //=======================================================================
 // name    : SMESHGUI_MultiEditDlg::onFilterBtn
 // Purpose : SLOT. Called when "Filter" button pressed.
@@ -1259,10 +1241,10 @@ SMESHGUI_CuttingOfQuadsDlg::~SMESHGUI_CuttingOfQuadsDlg()
 {
 }
 
-void SMESHGUI_CuttingOfQuadsDlg::onClose()
+void SMESHGUI_CuttingOfQuadsDlg::reject()
 {
   erasePreview();
-  SMESHGUI_MultiEditDlg::onClose();
+  SMESHGUI_MultiEditDlg::reject();
 }
 
 bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
index de9b0b67fed258a5ffe313a603a25fe72ee53f78..4c0aa432c268cb9270d5970caa9a8bc06f826ced 100755 (executable)
@@ -82,7 +82,7 @@ signals:
 protected slots:
   void                      onOk();
   virtual bool              onApply();
-  virtual void              onClose();
+  virtual void              reject();
   void                      onHelp();
 
   void                      onDeactivate();
@@ -102,9 +102,7 @@ protected slots:
   SMESH::NumericalFunctor_ptr getNumericalFunctor();
 
 protected:
-  void                      closeEvent( QCloseEvent* );
   void                      enterEvent( QEvent * );
-  void                      hideEvent( QHideEvent* );                        /* ESC key */
   void                      keyPressEvent( QKeyEvent* );
   QWidget*                  createButtonFrame( QWidget* );
   QWidget*                  createMainFrame( QWidget*, const bool );
@@ -221,7 +219,7 @@ protected:
                          SMESH::SMESH_IDSource_ptr obj);
 
 protected slots:
-  virtual void  onClose();
+  virtual void  reject();
   void          onCriterionRB();
   void          onPreviewChk();
 
index d82ec9c1d8aaaae1d3627a0783f13faa9543ba81..e4010b893cc37f4c151bd720da0bb934a2be36bb 100644 (file)
@@ -370,7 +370,7 @@ void SMESHGUI_NodesDlg::Init()
 
   /* signals and slots connections */
   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
-  connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
+  connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
   connect( buttonApply,  SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
   connect( buttonHelp,   SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) );
 
@@ -381,8 +381,8 @@ void SMESHGUI_NodesDlg::Init()
   connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ),      SLOT( SelectionIntoArgument() ) );
   connect( mySMESHGUI,     SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) );
   /* to close dialog if study frame change */
-  connect( mySMESHGUI,     SIGNAL( SignalStudyFrameChanged() ),      SLOT( ClickOnCancel() ) );
-  connect(mySMESHGUI,      SIGNAL(SignalCloseAllDialogs()),          SLOT(ClickOnCancel()));
+  connect( mySMESHGUI,     SIGNAL( SignalStudyFrameChanged() ),      SLOT( reject() ) );
+  connect(mySMESHGUI,      SIGNAL(SignalCloseAllDialogs()),          SLOT(reject()));
 
   // set selection mode
   SMESH::SetPointRepresentation( true );
@@ -414,7 +414,7 @@ void SMESHGUI_NodesDlg::ValueChangedInSpinBox( double newValue )
 void SMESHGUI_NodesDlg::ClickOnOk()
 {
   if ( ClickOnApply() )
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
@@ -539,10 +539,10 @@ bool SMESHGUI_NodesDlg::ClickOnApply()
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_NodesDlg::ClickOnCancel()
+void SMESHGUI_NodesDlg::reject()
 {
   disconnect( mySelectionMgr, 0, this, 0 );
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
@@ -552,7 +552,7 @@ void SMESHGUI_NodesDlg::ClickOnCancel()
   SMESH::SetPointRepresentation( false );
   mySMESHGUI->ResetState();
 
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -638,25 +638,6 @@ void SMESHGUI_NodesDlg::SelectionIntoArgument()
   }
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_NodesDlg::closeEvent( QCloseEvent* )
-{
-  this->ClickOnCancel(); /* same than click on cancel button */
-}
-
-//=================================================================================
-// function : hideEvent()
-// purpose  : caused by ESC key
-//=================================================================================
-void SMESHGUI_NodesDlg::hideEvent( QHideEvent* )
-{
-  if ( !isMinimized() )
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : enterEvent()
 // purpose  : to reactivate this dialog box when mouse enter onto the window
index de2058f5aed72ef2712347b640d67587950a18ad..7e4bca1ce266cf0ae540a3f0ee1c5ef189c970b4 100644 (file)
@@ -79,8 +79,6 @@ private:
 
   void                    Init();
   void                    enterEvent( QEvent* );
-  void                    closeEvent( QCloseEvent* );
-  void                    hideEvent ( QHideEvent* );
   void                    keyPressEvent( QKeyEvent* );
   
   bool                    isValid();
@@ -108,9 +106,11 @@ private:
 
   QString                 myHelpFileName;
 
+protected slots:
+  virtual void            reject();
+
 private slots:
   void                    ClickOnOk();
-  void                    ClickOnCancel();
   bool                    ClickOnApply();
   void                    ClickOnHelp();
   void                    DeactivateActiveDialog();
index 4e3f3d5b59a60fbfee7592761559f652de54de2d..bdb954b6b66b3008d66b576dab326c6f7852e395 100644 (file)
@@ -435,7 +435,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
   // Connect section
   connect( myOkBtn,             SIGNAL( clicked() ), this, SLOT( onOk() ) );
   connect( myApplyBtn,          SIGNAL( clicked() ), this, SLOT( onApply() ) );
-  connect( myCancelBtn,         SIGNAL( clicked() ), this, SLOT( onCancel() ) );
+  connect( myCancelBtn,         SIGNAL( clicked() ), this, SLOT( reject() ) );
   connect( myHelpBtn,           SIGNAL(clicked()),   this, SLOT( onHelp() ) );
   connect( myMinEdit,           SIGNAL( textChanged(const QString &) ), this, SLOT( onMinMaxChanged() ) );
   connect( myMaxEdit,           SIGNAL( textChanged(const QString &) ), this, SLOT( onMinMaxChanged() ) );
@@ -445,7 +445,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
   connect( myDistributionGrp,   SIGNAL( toggled(bool) ), this, SLOT(onDistributionActivated(bool)) );
   connect( myDistribColorGrp,   SIGNAL( buttonClicked( int ) ),   this, SLOT( onDistributionChanged( int ) ) );
   connect( mySelectionMgr,      SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
-  connect( mySMESHGUI,          SIGNAL( SignalCloseAllDialogs() ),   this, SLOT( onCancel() ) );
+  connect( mySMESHGUI,          SIGNAL( SignalCloseAllDialogs() ),   this, SLOT( reject() ) );
 
   myHelpFileName = "quality_page.html";
 }
@@ -471,7 +471,7 @@ SMESHGUI_Preferences_ScalarBarDlg::~SMESHGUI_Preferences_ScalarBarDlg()
 void SMESHGUI_Preferences_ScalarBarDlg::onOk()
 {
   if ( onApply() )
-    onCancel();
+    reject();
 }
 
 //=================================================================================================
@@ -588,14 +588,15 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply()
 
 //=================================================================================================
 /*!
- *  SMESHGUI_Preferences_ScalarBarDlg::onCancel
+ *  SMESHGUI_Preferences_ScalarBarDlg::reject
  *
  *  Cancel button slot
  */
 //=================================================================================================
-void SMESHGUI_Preferences_ScalarBarDlg::onCancel()
+void SMESHGUI_Preferences_ScalarBarDlg::reject()
 {
-  close();
+  myDlg = 0;
+  QDialog::reject();
 }
 
 //=================================================================================================
@@ -724,19 +725,6 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged()
   myDistributionGrp->setEnabled( false );
 }
 
-//=================================================================================================
-/*!
- *  SMESHGUI_Preferences_ScalarBarDlg::closeEvent
- *
- *  Close event handler
- */
-//=================================================================================================
-void SMESHGUI_Preferences_ScalarBarDlg::closeEvent( QCloseEvent* e )
-{
-  myDlg = 0;
-  QDialog::closeEvent( e );
-}
-
 //=================================================================================================
 /*!
  *  SMESHGUI_Preferences_ScalarBarDlg::onMinMaxChanged
index 05dea0f597033bc0a5ab2333b435ca67dabd5a05..6b3196e4cd48d94216476763b6df8f872ad3e3ca 100644 (file)
@@ -64,17 +64,18 @@ public:
 
   static void              ScalarBarProperties( SMESHGUI* );
 
-  void                     closeEvent( QCloseEvent* );
   void                     setOriginAndSize( const double,
                                              const double,
                                              const double,
                                              const double );
   void                     initScalarBarFromResources();
 
+protected slots:
+  virtual void             reject();
+
 protected slots:
   void                     onOk();
   bool                     onApply();
-  void                     onCancel();
   void                     onHelp();
   void                     onSelectionChanged();
   void                     onXYChanged();
index 6a5cedd86ccf94f8532607930e6432365cc98838..4bccb68c4d2eef29ec8a497090022745fa205ac5 100644 (file)
@@ -196,7 +196,7 @@ void SMESHGUI_RemoveElementsDlg::Init()
 
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
 
@@ -204,7 +204,7 @@ void SMESHGUI_RemoveElementsDlg::Init()
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
   connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
           SLOT(onTextChange(const QString&)));
 
@@ -257,14 +257,14 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply()
 void SMESHGUI_RemoveElementsDlg::ClickOnOk()
 {
   ClickOnApply();
-  ClickOnCancel();
+  reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
+void SMESHGUI_RemoveElementsDlg::reject()
 {
   if (SMESH::GetCurrentVtkView())
     SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
@@ -274,7 +274,7 @@ void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
   disconnect(mySelectionMgr, 0, this, 0);
   mySelectionMgr->clearFilters();
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -457,26 +457,6 @@ void SMESHGUI_RemoveElementsDlg::enterEvent(QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_RemoveElementsDlg::closeEvent(QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_RemoveElementsDlg::hideEvent( QHideEvent* )
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
index 6cc8d5ae44faefa329dd984129d864a65b838894..5c179e7eda05fbbd70c7298d3f34b9d2eb152326 100644 (file)
@@ -63,9 +63,7 @@ public:
 
 private:
   void                   Init();
-  void                   closeEvent( QCloseEvent* );
   void                   enterEvent( QEvent* );        /* mouse enter the QWidget */
-  void                   hideEvent( QHideEvent* );     /* ESC key */
   void                   keyPressEvent( QKeyEvent* );
   
   LightApp_SelectionMgr* mySelectionMgr;
@@ -96,9 +94,11 @@ private:
 
   SMESHGUI_FilterDlg*    myFilterDlg;
 
+protected slots:
+  virtual void           reject();
+
 private slots:
   void                   ClickOnOk();
-  void                   ClickOnCancel();
   void                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
index 303aee6f6935fa5fd6e2111f7e621e5c31ef0203..19103ebca6a849c21d0dcc2dbad651c5098e48bd 100644 (file)
@@ -196,7 +196,7 @@ void SMESHGUI_RemoveNodesDlg::Init()
 
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
 
@@ -204,7 +204,7 @@ void SMESHGUI_RemoveNodesDlg::Init()
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
   connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
           SLOT(onTextChange(const QString&)));
   
@@ -261,14 +261,14 @@ void SMESHGUI_RemoveNodesDlg::ClickOnApply()
 void SMESHGUI_RemoveNodesDlg::ClickOnOk()
 {
   ClickOnApply();
-  ClickOnCancel();
+  reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_RemoveNodesDlg::ClickOnCancel()
+void SMESHGUI_RemoveNodesDlg::reject()
 {
   //mySelectionMgr->clearSelected();
   if (SMESH::GetCurrentVtkView()) {
@@ -280,7 +280,7 @@ void SMESHGUI_RemoveNodesDlg::ClickOnCancel()
   disconnect(mySelectionMgr, 0, this, 0);
   mySelectionMgr->clearFilters();
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -463,26 +463,6 @@ void SMESHGUI_RemoveNodesDlg::enterEvent(QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_RemoveNodesDlg::closeEvent(QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_RemoveNodesDlg::hideEvent( QHideEvent* )
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
index 75a7afed3df6da7515543b9e3c68732a8a39f418..77a2378f15b54d6de30114587eb4e00913d84e8f 100644 (file)
@@ -63,9 +63,7 @@ public:
 
 private:
   void                   Init();
-  void                   closeEvent( QCloseEvent* );
   void                   enterEvent( QEvent* );           /* mouse enter the QWidget */
-  void                   hideEvent( QHideEvent* );        /* ESC key */
   void                   keyPressEvent( QKeyEvent* );
   
   LightApp_SelectionMgr* mySelectionMgr;
@@ -96,9 +94,11 @@ private:
 
   SMESHGUI_FilterDlg*    myFilterDlg;
   
+protected slots:
+  virtual void           reject();
+
 private slots:
   void                   ClickOnOk();
-  void                   ClickOnCancel();
   void                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
index 96d061cc6ef24874bbd0e903dac1a2352ac2f341..923688cddc84a0bd61dd07c8034e7c6d3bc3939c 100644 (file)
@@ -186,7 +186,7 @@ void SMESHGUI_RenumberingDlg::Init()
 
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
 
@@ -194,7 +194,7 @@ void SMESHGUI_RenumberingDlg::Init()
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
 
   myEditCurrentArgument = LineEditMesh;
   LineEditMesh->setFocus();
@@ -254,20 +254,20 @@ void SMESHGUI_RenumberingDlg::ClickOnApply()
 void SMESHGUI_RenumberingDlg::ClickOnOk()
 {
   ClickOnApply();
-  ClickOnCancel();
+  reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_RenumberingDlg::ClickOnCancel()
+void SMESHGUI_RenumberingDlg::reject()
 {
   //mySelectionMgr->clearSelected();
   mySelectionMgr->clearFilters();
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -392,26 +392,6 @@ void SMESHGUI_RenumberingDlg::enterEvent(QEvent* e)
   ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_RenumberingDlg::closeEvent(QCloseEvent* e)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_RenumberingDlg::hideEvent (QHideEvent * e)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
index 5ebbe6ca3bb9250d97386a351d66926349ce5c43..bb0a9232be5d9d77c3ca6044965d495e0d2b1e8a 100644 (file)
@@ -60,9 +60,7 @@ public:
 
 private:
   void                          Init();
-  void                          closeEvent( QCloseEvent* );
   void                          enterEvent( QEvent* );         /* mouse enter the QWidget */
-  void                          hideEvent( QHideEvent* );       /* ESC key */
   void                          keyPressEvent( QKeyEvent* );
   
   SMESHGUI*                     mySMESHGUI;              /* Current SMESHGUI object */
@@ -89,9 +87,11 @@ private:
   
   QString                       myHelpFileName;
 
+protected slots:
+  virtual void                  reject();
+
 private slots:
   void                          ClickOnOk();
-  void                          ClickOnCancel();
   void                          ClickOnApply();
   void                          ClickOnHelp();
   void                          SetEditCurrentArgument();
index f85e4eade0ae701c196507e88233cc9a8fb8759f..6baa81109ca6778bb8900507c316471484d2f974 100644 (file)
@@ -323,7 +323,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
 
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
   connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
@@ -343,7 +343,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
   connect(mySMESHGUI,     SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),      this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,       SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI,       SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),   SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                 SLOT(onSelectMesh(bool)));
 
@@ -574,21 +574,27 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
 void SMESHGUI_RevolutionDlg::ClickOnOk()
 {
   if( ClickOnApply() )
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_RevolutionDlg::ClickOnCancel()
-{
-  reject();
-}
-
 void SMESHGUI_RevolutionDlg::reject()
 {
-  close();
+  disconnect(mySelectionMgr, 0, this, 0);
+  mySelectionMgr->clearFilters();
+  //mySelectionMgr->clearSelected();
+  if (SMESH::GetCurrentVtkView()) {
+    SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
+    SMESH::SetPointRepresentation(false);
+  }
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
+  mySMESHGUI->ResetState();
+
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -910,25 +916,6 @@ void SMESHGUI_RevolutionDlg::enterEvent (QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_RevolutionDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  disconnect(mySelectionMgr, 0, this, 0);
-  mySelectionMgr->clearFilters();
-  //mySelectionMgr->clearSelected();
-  if (SMESH::GetCurrentVtkView()) {
-    SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
-    SMESH::SetPointRepresentation(false);
-  }
-  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-    aViewWindow->SetSelectionMode(ActorSelection);
-  mySMESHGUI->ResetState();
-}
-
 //=======================================================================
 //function : onSelectMesh
 //purpose  :
index 91d1e4268f1da83d3997011a60c83e005915b76c..cfb9e1fc9b8bd68421db7f2fa193362aad116246 100644 (file)
@@ -74,13 +74,10 @@ public:
   SMESHGUI_RevolutionDlg( SMESHGUI* );
   ~SMESHGUI_RevolutionDlg();
 
-  void                      reject();
-
 private:
   enum {NONE_SELECT, POINT_SELECT, FACE_SELECT};
   
   void                      Init( bool = true);
-  void                      closeEvent( QCloseEvent* );
   void                      enterEvent( QEvent* );           /* mouse enter the QWidget */
   void                      keyPressEvent( QKeyEvent* );
   int                       GetConstructorId();
@@ -163,11 +160,11 @@ private:
 
 protected slots:
   virtual void              onDisplaySimulation( bool );
+  virtual void                      reject();
    
 private slots:
   void                      ConstructorsClicked( int );
   void                      ClickOnOk();
-  void                      ClickOnCancel();
   bool                      ClickOnApply();
   void                      ClickOnHelp();
   void                      SetEditCurrentArgument();
index 0e0690c018c93550cdd9f6a0094cd2776bf65fa9..e737712df16e37ef372ac7711bcfeda05cab7aad 100644 (file)
@@ -297,7 +297,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) :
 
   /* signals and slots connections */
   connect(buttonOk, SIGNAL(clicked()),     this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply, SIGNAL(clicked()),  this, SLOT(ClickOnApply()));
   connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
 
@@ -312,7 +312,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) :
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,       SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI,       SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),    SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                  SLOT(onSelectMesh(bool)));
   connect(ActionGroup,      SIGNAL(buttonClicked(int)),             SLOT(onActionClicked(int)));
@@ -508,14 +508,14 @@ void SMESHGUI_RotationDlg::ClickOnOk()
 {
   setIsApplyAndClose( true );
   if( ClickOnApply() )
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_RotationDlg::ClickOnCancel()
+void SMESHGUI_RotationDlg::reject()
 {
   disconnect(mySelectionMgr, 0, this, 0);
   mySelectionMgr->clearFilters();
@@ -527,7 +527,7 @@ void SMESHGUI_RotationDlg::ClickOnCancel()
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -857,26 +857,6 @@ void SMESHGUI_RotationDlg::enterEvent (QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_RotationDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=================================================================================
-// function : hideEvent()
-// purpose  : caused by ESC key
-//=================================================================================
-void SMESHGUI_RotationDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : onSelectMesh()
 // purpose  :
index a4e6b4af244b4899be68af4c8551597ad7ee9d22..e52f59c1282e2ccb20d0ddefc7cc389fd79fde51 100644 (file)
@@ -66,9 +66,7 @@ public:
 
 private:
   void                   Init( bool = true );
-  void                   closeEvent( QCloseEvent* );
   void                   enterEvent( QEvent* );         /* mouse enter the QWidget */
-  void                   hideEvent( QHideEvent* );      /* ESC key */
   void                   keyPressEvent( QKeyEvent* );
   bool                   IsAxisOk();
   void                   setNewMeshName();
@@ -134,11 +132,11 @@ private:
   SMESHGUI_FilterDlg*    myFilterDlg;
 
 protected slots:
-  virtual void              onDisplaySimulation( bool );
+  virtual void           onDisplaySimulation( bool );
+  virtual void           reject();
  
 private slots:
   void                   ClickOnOk();
-  void                   ClickOnCancel();
   bool                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
index b74a31f123f70efe12e516691805c8885528d648..8dd25d87cb1c93c238a7d847849b5de34ce4126c 100644 (file)
@@ -301,7 +301,7 @@ SMESHGUI_ScaleDlg::SMESHGUI_ScaleDlg( SMESHGUI* theModule ) :
 
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
   connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
@@ -312,7 +312,7 @@ SMESHGUI_ScaleDlg::SMESHGUI_ScaleDlg( SMESHGUI* theModule ) :
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,       SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI,       SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),    SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                  SLOT(onSelectMesh(bool)));
   connect(ActionGroup,      SIGNAL(buttonClicked(int)),             SLOT(onActionClicked(int)));
@@ -545,14 +545,14 @@ void SMESHGUI_ScaleDlg::ClickOnOk()
 {
   setIsApplyAndClose( true );
   if( ClickOnApply() )
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_ScaleDlg::ClickOnCancel()
+void SMESHGUI_ScaleDlg::reject()
 {
   disconnect(mySelectionMgr, 0, this, 0);
   mySelectionMgr->clearFilters();
@@ -564,7 +564,7 @@ void SMESHGUI_ScaleDlg::ClickOnCancel()
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode( ActorSelection );
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -881,26 +881,6 @@ void SMESHGUI_ScaleDlg::enterEvent (QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_ScaleDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_ScaleDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=======================================================================
 //function : onSelectMesh
 //purpose  :
index 7293a99e7811c13735b73b48eab9a65ccca47b50..55bf4acc679cd3d63efdde9b5e75daa122dad57a 100644 (file)
@@ -62,9 +62,7 @@ public:
 
 private:
   void                   Init( bool = true );
-  void                   closeEvent( QCloseEvent* );
   void                   enterEvent( QEvent* );           /* mouse enter the QWidget */
-  void                   hideEvent( QHideEvent* );        /* ESC key */
   void                   keyPressEvent( QKeyEvent* );
   int                    GetConstructorId();
   void                   setNewMeshName();
@@ -129,12 +127,12 @@ private:
 
 
 protected slots:
-  virtual void              onDisplaySimulation( bool );
+  virtual void           onDisplaySimulation( bool );
+  virtual void           reject();
    
 private slots:
   void                   ConstructorsClicked( int );
   void                   ClickOnOk();
-  void                   ClickOnCancel();
   bool                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
index 24d85f012f425fbd6ce5adeb30a1122a9f91af1d..60ee923012b5d6e48f0225d018f5151e8b27d9fc 100644 (file)
@@ -257,7 +257,7 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule )
 
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
   connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
@@ -272,7 +272,7 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule )
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
 
   connect(LineEdit1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
   connect(LineEdit2, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
@@ -548,14 +548,14 @@ bool SMESHGUI_SewingDlg::ClickOnApply()
 void SMESHGUI_SewingDlg::ClickOnOk()
 {
   if (ClickOnApply())
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_SewingDlg::ClickOnCancel()
+void SMESHGUI_SewingDlg::reject()
 {
   //mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
@@ -563,7 +563,7 @@ void SMESHGUI_SewingDlg::ClickOnCancel()
     aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -873,26 +873,6 @@ void SMESHGUI_SewingDlg::enterEvent (QEvent* e)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_SewingDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_SewingDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : GetConstructorId()
 // purpose  :
index f8ff617d0a8b1b3e76b58ee3d6354e0bf00c6af9..3d9402714ff9797ea440ebf2ebee7c04b435143b 100644 (file)
@@ -63,9 +63,7 @@ public:
 
 private:
   void                    Init();
-  void                    closeEvent( QCloseEvent* );
   void                    enterEvent( QEvent* );                /* mouse enter the QWidget */
-  void                    hideEvent( QHideEvent* );             /* ESC key */
   void                    keyPressEvent( QKeyEvent* );
   int                     GetConstructorId();
   bool                    IsValid();
@@ -118,10 +116,12 @@ private:
 
   QString                 myHelpFileName;
 
+protected slots:
+  virtual void            reject();
+
 private slots:
   void                    ConstructorsClicked( int );
   void                    ClickOnOk();
-  void                    ClickOnCancel();
   bool                    ClickOnApply();
   void                    ClickOnHelp();
   void                    SetEditCurrentArgument();
index f93ce95565ca740eaef14420091c6bd91cf8bf83..ef9bf001419494b50f9827bfa14357697eadba9e 100755 (executable)
@@ -215,14 +215,14 @@ void SMESHGUI_SingleEditDlg::Init()
 
   // main buttons
   connect(myOkBtn,    SIGNAL(clicked()), SLOT(onOk()));
-  connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
+  connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject()));
   connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
   connect(myHelpBtn,  SIGNAL(clicked()), SLOT(onHelp()));
 
   // selection and SMESHGUI
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
-  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
   connect(myEdge, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
 
   myOkBtn->setEnabled(false);
@@ -244,14 +244,14 @@ void SMESHGUI_SingleEditDlg::Init()
 void SMESHGUI_SingleEditDlg::onOk()
 {
   if (onApply())
-    onClose();
+    reject();
 }
 
 //=======================================================================
-// name    : onClose()
+// name    : reject()
 // Purpose : SLOT called when "Close" button pressed. Close dialog
 //=======================================================================
-void SMESHGUI_SingleEditDlg::onClose()
+void SMESHGUI_SingleEditDlg::reject()
 {
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
@@ -259,7 +259,7 @@ void SMESHGUI_SingleEditDlg::onClose()
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -458,25 +458,6 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*)
   }
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_SingleEditDlg::closeEvent (QCloseEvent*)
-{
-  onClose();
-}
-
-//=======================================================================
-//function : hideEvent()
-//purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_SingleEditDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    onClose();
-}
-
 //=================================================================================
 // function : onApply()
 // purpose  : SLOT. Called when apply button is pressed
index cc04610ac82c60117ab94802733e9aa0e1d61b4a..bf88ec684a84721eaf6a86c1ac6ef893a185e02f 100755 (executable)
@@ -62,7 +62,7 @@ public:
 protected slots:
   void                    onOk();
   virtual bool            onApply();
-  void                    onClose();
+  virtual void            reject();
   void                    onHelp();
 
   void                    onDeactivate();
@@ -71,9 +71,7 @@ protected slots:
   void                    onTextChange( const QString& );
 
 protected:
-  void                    closeEvent( QCloseEvent* );
   void                    enterEvent( QEvent* );
-  void                    hideEvent( QHideEvent* );                        /* ESC key */
   void                    keyPressEvent( QKeyEvent* );
   QWidget*                createButtonFrame( QWidget* );
   QWidget*                createMainFrame( QWidget* );
index 61aaae845cf012b2524d7ca67dc37706f5ded7f9..e31d5c79b8df7ede974e9454e57bdcf003ad439b 100644 (file)
@@ -275,7 +275,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
   /***************************************************************/
   // signals and slots connections
   connect(buttonOk, SIGNAL(clicked()),     this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply, SIGNAL(clicked()),  this, SLOT(ClickOnApply()));
   connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
 
@@ -284,7 +284,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),
            SLOT(onTextChange(const QString&)));
   connect(LineEditNodes, SIGNAL(textChanged(const QString&)),
@@ -421,14 +421,14 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply()
 void SMESHGUI_SmoothingDlg::ClickOnOk()
 {
   if( ClickOnApply() )
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  : Called when dialog box is closed
 //=================================================================================
-void SMESHGUI_SmoothingDlg::ClickOnCancel()
+void SMESHGUI_SmoothingDlg::reject()
 {
   disconnect(mySelectionMgr, 0, this, 0);
   mySelectionMgr->clearFilters();
@@ -441,7 +441,7 @@ void SMESHGUI_SmoothingDlg::ClickOnCancel()
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -704,26 +704,6 @@ void SMESHGUI_SmoothingDlg::enterEvent (QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_SmoothingDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-// function : hideEvent()
-// purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_SmoothingDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=======================================================================
 // function : onSelectMesh()
 // purpose  :
index efb9723a6eb4f764060ad41ca2a8433dd5995992..78c4b2a6bc0e3d2ce116664ac3d2aabc0172c3c4 100644 (file)
@@ -71,9 +71,7 @@ public:
 
 private:
   void                   Init();
-  void                   closeEvent( QCloseEvent* );
   void                   enterEvent( QEvent* );        /* mouse enter the QWidget */
-  void                   hideEvent( QHideEvent* );     /* ESC key */
   void                   keyPressEvent( QKeyEvent* );
   void                   setFilters( const bool theIsElem );
 
@@ -124,9 +122,11 @@ private:
   QPushButton*           myElemFilterBtn;
   SMESHGUI_FilterDlg*    myFilterDlg;
    
+protected slots:
+  virtual void           reject();
+
 private slots:
   void                   ClickOnOk();
-  void                   ClickOnCancel();
   bool                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
index 5ab4f3f2274e4040c0c8ea3c66163b5243ba0a81..532e327ce8d1e50e4463036b8c22a85febe1d979 100644 (file)
@@ -300,7 +300,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
 
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
   connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
@@ -316,7 +316,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
   connect(mySMESHGUI,     SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),      this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,       SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI,       SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),   SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                 SLOT(onSelectMesh(bool)));
   connect(ActionGroup,      SIGNAL(buttonClicked(int)),            SLOT(onActionClicked(int)));
@@ -573,14 +573,14 @@ void SMESHGUI_SymmetryDlg::ClickOnOk()
 {
   setIsApplyAndClose( true );
   if( ClickOnApply() )
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_SymmetryDlg::ClickOnCancel()
+void SMESHGUI_SymmetryDlg::reject()
 {
   disconnect(mySelectionMgr, 0, this, 0);
   mySelectionMgr->clearFilters();
@@ -592,7 +592,7 @@ void SMESHGUI_SymmetryDlg::ClickOnCancel()
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -917,26 +917,6 @@ void SMESHGUI_SymmetryDlg::enterEvent (QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_SymmetryDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-// function : hideEvent()
-// purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_SymmetryDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=======================================================================
 //function : onSelectMesh
 //purpose  :
index a039ac27fef9a8b5c38a27d4c6c6137a868e45dc..660d946fe4d5c42547376447fdaa5260128f3f61 100644 (file)
@@ -66,9 +66,7 @@ public:
 
 private:
   void                   Init( bool = true );
-  void                   closeEvent( QCloseEvent* );
   void                   enterEvent( QEvent* );         /* mouse enter the QWidget */
-  void                   hideEvent( QHideEvent* );      /* ESC key */
   void                   keyPressEvent( QKeyEvent* );
   int                    GetConstructorId();
   bool                   IsMirrorOk();
@@ -139,11 +137,11 @@ private:
 
 protected slots:
   virtual void           onDisplaySimulation( bool );
+  virtual void           reject();
    
 private slots:
   void                   ConstructorsClicked( int );
   void                   ClickOnOk();
-  void                   ClickOnCancel();
   bool                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
index eaee5140990689efda0982ea4da32b5adbc8f69a..08305f6787a1a06436e79cadd9211cf07dcad6cf 100644 (file)
@@ -304,7 +304,7 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule ) :
 
   /* signals and slots connections */
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
   connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
@@ -316,7 +316,7 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule ) :
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,       SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+  connect(mySMESHGUI,       SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),    SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                  SLOT(onSelectMesh(bool)));
   connect(ActionGroup,      SIGNAL(buttonClicked(int)),             SLOT(onActionClicked(int)));
@@ -578,14 +578,14 @@ void SMESHGUI_TranslationDlg::ClickOnOk()
 {
   setIsApplyAndClose( true );
   if( ClickOnApply() )
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_TranslationDlg::ClickOnCancel()
+void SMESHGUI_TranslationDlg::reject()
 {
   disconnect(mySelectionMgr, 0, this, 0);
   mySelectionMgr->clearFilters();
@@ -597,7 +597,7 @@ void SMESHGUI_TranslationDlg::ClickOnCancel()
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode( ActorSelection );
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -883,26 +883,6 @@ void SMESHGUI_TranslationDlg::enterEvent (QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_TranslationDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose  : caused by ESC key
-//=======================================================================
-void SMESHGUI_TranslationDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=======================================================================
 //function : onSelectMesh
 //purpose  :
index 2c7294378683d247a7ba4419b5988a8f9b25c89d..61a86afee9b046fbf27b37876b18fb4ae81de149 100644 (file)
@@ -65,9 +65,7 @@ public:
 
 private:
   void                   Init( bool = true );
-  void                   closeEvent( QCloseEvent* );
   void                   enterEvent( QEvent* );           /* mouse enter the QWidget */
-  void                   hideEvent( QHideEvent* );        /* ESC key */
   void                   keyPressEvent( QKeyEvent* );
   int                    GetConstructorId();
   void                   setNewMeshName();
@@ -132,12 +130,12 @@ private:
   SMESHGUI_FilterDlg*    myFilterDlg;
 
 protected slots:
-  virtual void              onDisplaySimulation( bool );
+  virtual void           onDisplaySimulation( bool );
+  virtual void           reject();
    
 private slots:
   void                   ConstructorsClicked( int );
   void                   ClickOnOk();
-  void                   ClickOnCancel();
   bool                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
index daadb673c93f6fbb93438dfa09d1923072712c92..711335eac773811498505605366b3597242c5ac9 100644 (file)
@@ -109,7 +109,7 @@ struct SMESH_TNodeXYZ : public gp_XYZ
 {
   const SMDS_MeshNode* _node;
   double               _xyz[3];
-  SMESH_TNodeXYZ( const SMDS_MeshElement* e):gp_XYZ(0,0,0),_node(0) {
+  SMESH_TNodeXYZ( const SMDS_MeshElement* e=0):gp_XYZ(0,0,0),_node(0) {
     if (e) {
       assert( e->GetType() == SMDSAbs_Node );
       _node = static_cast<const SMDS_MeshNode*>(e);
index a856471205ed4d88875a67a60247e1ea1284c104..760a14a8ca40c3aee99531e032f4110e0dc07c63 100644 (file)
@@ -521,7 +521,7 @@ namespace // INTERNAL STUFF
     TopExp::MapShapes( SMESH_Mesh::PseudoShape(), pseudoSubShapes );
 
     // index of pseudoSubShapes corresponding to srcMeshDS
-    int subIndex = srcMeshDS->GetPersistentId() % pseudoSubShapes.Extent();
+    int    subIndex = 1 + srcMeshDS->GetPersistentId() % pseudoSubShapes.Extent();
     int nbSubShapes = 1 + srcMeshDS->GetPersistentId() / pseudoSubShapes.Extent();
 
     // try to find already present shapeForSrcMesh
index 00a53610546f39a9b6cf983e50dba7ed1accbc78..6584b16652576dabb3e1e993186a55e764e716dc 100644 (file)
@@ -69,8 +69,9 @@ using namespace std;
 // cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl;\
 // }
 
-typedef StdMeshers_ProjectionUtils TAssocTool;
-typedef SMESH_Comment              TCom;
+namespace TAssocTool = StdMeshers_ProjectionUtils;
+
+typedef SMESH_Comment TCom;
 
 enum { ID_BOT_FACE = SMESH_Block::ID_Fxy0,
        ID_TOP_FACE = SMESH_Block::ID_Fxy1,
@@ -457,19 +458,11 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
   if ( nbSolids < 1 )
     return true;
 
-  Prism_3D::TPrismTopo prism;
-
-  if ( nbSolids == 1 )
-  {
-    return ( initPrism( prism, TopExp_Explorer( theShape, TopAbs_SOLID ).Current() ) &&
-             compute( prism ));
-  }
-
   TopTools_IndexedDataMapOfShapeListOfShape faceToSolids;
   TopExp::MapShapesAndAncestors( theShape, TopAbs_FACE, TopAbs_SOLID, faceToSolids );
 
   // look for meshed FACEs ("source" FACEs) that must be prism bottoms
-  list< TopoDS_Face > meshedFaces;//, notQuadMeshedFaces, notQuadFaces;
+  list< TopoDS_Face > meshedFaces, notQuadMeshedFaces, notQuadFaces;
   const bool meshHasQuads = ( theMesh.NbQuadrangles() > 0 );
   for ( int iF = 1; iF < faceToSolids.Extent(); ++iF )
   {
@@ -479,17 +472,33 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
     {
       if ( !meshHasQuads ||
            !helper.IsSameElemGeometry( faceSM->GetSubMeshDS(), SMDSGeom_QUADRANGLE ) ||
-           !helper.IsStructured( faceSM ))
-        // notQuadMeshedFaces are of higher priority
+           !helper.IsStructured( faceSM )
+           )
+        notQuadMeshedFaces.push_front( face );
+      else if ( myHelper->Count( face, TopAbs_EDGE, /*ignoreSame=*/false ) != 4 )
         meshedFaces.push_front( face );
       else
         meshedFaces.push_back( face );
     }
+    else if ( myHelper->Count( face, TopAbs_EDGE, /*ignoreSame=*/false ) != 4 )
+    {
+      notQuadFaces.push_back( face );
+    }
   }
-  //meshedFaces.splice( meshedFaces.begin(), notQuadMeshedFaces );
+  // notQuadFaces are of medium priority, put them before ordinary meshed faces
+  meshedFaces.splice( meshedFaces.begin(), notQuadFaces );
+  // notQuadMeshedFaces are of highest priority, put them before notQuadFaces
+  meshedFaces.splice( meshedFaces.begin(), notQuadMeshedFaces );
 
-  // if ( meshedFaces.empty() )
-  //   return error( COMPERR_BAD_INPUT_MESH, "No meshed source faces found" );
+  Prism_3D::TPrismTopo prism;
+
+  if ( nbSolids == 1 )
+  {
+    if ( !meshedFaces.empty() )
+      prism.myBottom = meshedFaces.front();
+    return ( initPrism( prism, TopExp_Explorer( theShape, TopAbs_SOLID ).Current() ) &&
+             compute( prism ));
+  }
 
   TopTools_MapOfShape meshedSolids;
   list< Prism_3D::TPrismTopo > meshedPrism;
@@ -619,6 +628,27 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
     // TODO. there are other ways to find out the source FACE:
     // propagation, topological similarity, ect.
 
+    // simply try to mesh all not meshed SOLIDs
+    if ( meshedFaces.empty() )
+    {
+      for ( TopExp_Explorer solid( theShape, TopAbs_SOLID ); solid.More(); solid.Next() )
+      {
+        mySetErrorToSM = false;
+        prism.Clear();
+        if ( !meshedSolids.Contains( solid.Current() ) &&
+             initPrism( prism, solid.Current() ))
+        {
+          mySetErrorToSM = true;
+          if ( !compute( prism ))
+            return false;
+          meshedFaces.push_front( prism.myTop );
+          meshedFaces.push_front( prism.myBottom );
+          meshedPrism.push_back( prism );
+          meshedSolids.Add( solid.Current() );
+        }
+        mySetErrorToSM = true;
+      }
+    }
 
     if ( meshedFaces.empty() ) // set same error to 10 not-computed solids
     {
@@ -633,7 +663,7 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
           SMESH_subMesh* sm = theMesh.GetSubMesh( solid.Current() );
           sm->GetComputeError() = err;
         }
-      return false;
+      return error( err );
     }
   }
   return true;
@@ -708,7 +738,7 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
   // -------------------------
 
   // Compose a vector of indixes of right neighbour FACE for each wall FACE
-  // that is not so evident in case of several WIREs
+  // that is not so evident in case of several WIREs in the bottom FACE
   thePrism.myRightQuadIndex.clear();
   for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
     thePrism.myRightQuadIndex.push_back( i+1 );
@@ -1511,7 +1541,12 @@ bool StdMeshers_Prism_3D::assocOrProjBottom2Top()
   SMESHDS_SubMesh * topSMDS = topSM->GetSubMeshDS();
 
   if ( !botSMDS || botSMDS->NbElements() == 0 )
-    return toSM( error(TCom("No elememts on face #") << botSM->GetId() ));
+  {
+    _gen->Compute( *myHelper->GetMesh(), botSM->GetSubShape() );
+    botSMDS = botSM->GetSubMeshDS();
+    if ( !botSMDS || botSMDS->NbElements() == 0 )
+      return toSM( error(TCom("No elememts on face #") << botSM->GetId() ));
+  }
 
   bool needProject = !topSM->IsMeshComputed();
   if ( !needProject && 
@@ -1646,7 +1681,7 @@ bool StdMeshers_Prism_3D::projectBottomToTop()
   // if the bottom faces is orienetd OK then top faces must be reversed
   bool reverseTop = true;
   if ( myHelper->NbAncestors( botFace, *myBlock.Mesh(), TopAbs_SOLID ) > 1 )
-    reverseTop = ! SMESH_Algo::IsReversedSubMesh( TopoDS::Face( botFace ), meshDS );
+    reverseTop = ! myHelper->IsReversedSubMesh( TopoDS::Face( botFace ));
   int iFrw, iRev, *iPtr = &( reverseTop ? iRev : iFrw );
 
   // loop on bottom mesh faces
index 805915b56aff0f5bfbe7eaa0546b9f54b00d0ba8..0fddea3c722b3bc1f8be4d4dd2f9f13c30c67182 100644 (file)
 #include "StdMeshers_ProjectionSource2D.hxx"
 #include "StdMeshers_ProjectionSource3D.hxx"
 
+#include "SMDS_EdgePosition.hxx"
 #include "SMESH_Algo.hxx"
 #include "SMESH_Block.hxx"
 #include "SMESH_Gen.hxx"
+#include "SMESH_HypoFilter.hxx"
 #include "SMESH_Hypothesis.hxx"
 #include "SMESH_Mesh.hxx"
 #include "SMESH_MesherHelper.hxx"
 #include "SMESH_subMesh.hxx"
 #include "SMESH_subMeshEventListener.hxx"
-#include "SMDS_EdgePosition.hxx"
 
 #include "utilities.h"
 
@@ -417,15 +418,15 @@ namespace {
 } // namespace
 
 //=======================================================================
-/*!
- * \brief Looks for association of all sub-shapes of two shapes
- * \param theShape1 - target shape
- * \param theMesh1 - mesh built on shape 1
- * \param theShape2 - source shape
- * \param theMesh2 - mesh built on shape 2
- * \param theAssociation - association map to be filled that may
- *                         contain association of one or two pairs of vertices
- * \retval bool - true if association found
+/*
+ * Looks for association of all sub-shapes of two shapes
+ *  \param theShape1 - target shape
+ *  \param theMesh1 - mesh built on shape 1
+ *  \param theShape2 - source shape
+ *  \param theMesh2 - mesh built on shape 2
+ *  \param theAssociation - association map to be filled that may
+ *                          contain association of one or two pairs of vertices
+ *  \retval bool - true if association found
  */
 //=======================================================================
 
@@ -1263,15 +1264,15 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the
 }
 
 //================================================================================
-/*!
- * \brief Find association of edges of faces
- * \param face1 - face 1
- * \param VV1 - vertices of face 1
- * \param face2 - face 2
- * \param VV2 - vertices of face 2 associated with ones of face 1
- * \param edges1 - out list of edges of face 1
- * \param edges2 - out list of edges of face 2
- * \retval int - nb of edges in an outer wire in a success case, else zero
+/*
+ * Find association of edges of faces
+ *  \param face1 - face 1
+ *  \param VV1 - vertices of face 1
+ *  \param face2 - face 2
+ *  \param VV2 - vertices of face 2 associated with ones of face 1
+ *  \param edges1 - out list of edges of face 1
+ *  \param edges2 - out list of edges of face 2
+ *  \retval int - nb of edges in an outer wire in a success case, else zero
  */
 //================================================================================
 
@@ -1500,12 +1501,12 @@ void StdMeshers_ProjectionUtils::InitVertexAssociation( const SMESH_Hypothesis*
 }
 
 //=======================================================================
-/*!
- * \brief Inserts association theShape1 <-> theShape2 to TShapeShapeMap
- * \param theShape1 - target shape
- * \param theShape2 - source shape
- * \param theAssociationMap - association map 
- * \retval bool - true if there was no association for these shapes before
+/*
+ * Inserts association theShape1 <-> theShape2 to TShapeShapeMap
+ *  \param theShape1 - target shape
+ *  \param theShape2 - source shape
+ *  \param theAssociationMap - association map 
+ *  \retval bool - true if there was no association for these shapes before
  */
 //=======================================================================
 
@@ -1526,12 +1527,12 @@ bool StdMeshers_ProjectionUtils::InsertAssociation( const TopoDS_Shape& theShape
 }
 
 //=======================================================================
-/*!
- * \brief Finds an edge by its vertices in a main shape of the mesh
- * \param aMesh - the mesh
- * \param V1 - vertex 1
- * \param V2 - vertex 2
- * \retval TopoDS_Edge - found edge
+/*
+ * Finds an edge by its vertices in a main shape of the mesh
+ *  \param aMesh - the mesh
+ *  \param V1 - vertex 1
+ *  \param V2 - vertex 2
+ *  \retval TopoDS_Edge - found edge
  */
 //=======================================================================
 
@@ -1554,12 +1555,12 @@ TopoDS_Edge StdMeshers_ProjectionUtils::GetEdgeByVertices( SMESH_Mesh*
 }
 
 //================================================================================
-/*!
- * \brief Return another face sharing an edge
- * \param edgeToFaces - data map of descendants to ancestors
- * \param edge - edge
- * \param face - face
- * \retval TopoDS_Face - found face
+/*
+ * Return another face sharing an edge
+ *  \param edgeToFaces - data map of descendants to ancestors
+ *  \param edge - edge
+ *  \param face - face
+ *  \retval TopoDS_Face - found face
  */
 //================================================================================
 
@@ -1580,8 +1581,8 @@ TopoDS_Face StdMeshers_ProjectionUtils::GetNextFace( const TAncestorMap& edgeToF
 }
 
 //================================================================================
-/*!
- * \brief Return other vertex of an edge
+/*
+ * Return other vertex of an edge
  */
 //================================================================================
 
@@ -1596,12 +1597,12 @@ TopoDS_Vertex StdMeshers_ProjectionUtils::GetNextVertex(const TopoDS_Edge&   edg
 }
 
 //================================================================================
-/*!
- * \brief Return a propagation edge
- * \param aMesh - mesh
- * \param theEdge - edge to find by propagation
- * \param fromEdge - start edge for propagation
- * \retval pair<int,TopoDS_Edge> - propagation step and found edge
+/*
+ * Return a propagation edge
+ *  \param aMesh - mesh
+ *  \param theEdge - edge to find by propagation
+ *  \param fromEdge - start edge for propagation
+ *  \retval pair<int,TopoDS_Edge> - propagation step and found edge
  */
 //================================================================================
 
@@ -1680,16 +1681,16 @@ StdMeshers_ProjectionUtils::GetPropagationEdge( SMESH_Mesh*        aMesh,
 }
 
 //================================================================================
-  /*!
  * \brief Find corresponding nodes on two faces
   * \param face1 - the first face
   * \param mesh1 - mesh containing elements on the first face
   * \param face2 - the second face
   * \param mesh2 - mesh containing elements on the second face
   * \param assocMap - map associating sub-shapes of the faces
   * \param node1To2Map - map containing found matching nodes
   * \retval bool - is a success
  */
+/*
* Find corresponding nodes on two faces
 \param face1 - the first face
 \param mesh1 - mesh containing elements on the first face
 \param face2 - the second face
 \param mesh2 - mesh containing elements on the second face
 \param assocMap - map associating sub-shapes of the faces
 \param node1To2Map - map containing found matching nodes
 \retval bool - is a success
+ */
 //================================================================================
 
 bool StdMeshers_ProjectionUtils::
@@ -1702,7 +1703,7 @@ FindMatchingNodesOnFaces( const TopoDS_Face&     face1,
 {
   SMESHDS_Mesh* meshDS1 = mesh1->GetMeshDS();
   SMESHDS_Mesh* meshDS2 = mesh2->GetMeshDS();
-  
+
   SMESH_MesherHelper helper1( *mesh1 );
   SMESH_MesherHelper helper2( *mesh2 );
 
@@ -1996,23 +1997,23 @@ FindMatchingNodesOnFaces( const TopoDS_Face&     face1,
     node1To2Map.insert( make_pair( vNode1, vNode2 ));
   }
 
-// don't know why this condition is usually true :(
-//   if ( node1To2Map.size() * quadFactor < SM1->NbNodes() )
-//     MESSAGE("FindMatchingNodes() found too few node pairs starting from nodes ("
-//             << vNode1->GetID() << " - " << eNode1[0]->GetID() << ") ("
-//             << vNode2->GetID() << " - " << eNode2[0]->GetID() << "):"
-//             << node1To2Map.size() * quadFactor << " < " << SM1->NbNodes());
-  
+  // don't know why this condition is usually true :(
+  //   if ( node1To2Map.size() * quadFactor < SM1->NbNodes() )
+  //     MESSAGE("FindMatchingNodes() found too few node pairs starting from nodes ("
+  //             << vNode1->GetID() << " - " << eNode1[0]->GetID() << ") ("
+  //             << vNode2->GetID() << " - " << eNode2[0]->GetID() << "):"
+  //             << node1To2Map.size() * quadFactor << " < " << SM1->NbNodes());
+
   return true;
 }
 
 //================================================================================
-  /*!
  * \brief Return any sub-shape of a face belonging to the outer wire
   * \param face - the face
   * \param type - type of sub-shape to return
   * \retval TopoDS_Shape - the found sub-shape
  */
+/*
* Return any sub-shape of a face belonging to the outer wire
 \param face - the face
 \param type - type of sub-shape to return
 \retval TopoDS_Shape - the found sub-shape
+ */
 //================================================================================
 
 TopoDS_Shape StdMeshers_ProjectionUtils::OuterShape( const TopoDS_Face& face,
@@ -2025,12 +2026,12 @@ TopoDS_Shape StdMeshers_ProjectionUtils::OuterShape( const TopoDS_Face& face,
 }
 
 //================================================================================
-  /*!
  * \brief Check that submesh is computed and try to compute it if is not
   * \param sm - submesh to compute
   * \param iterationNb - int used to stop infinite recursive call
   * \retval bool - true if computed
  */
+/*
* Check that submesh is computed and try to compute it if is not
 \param sm - submesh to compute
 \param iterationNb - int used to stop infinite recursive call
 \retval bool - true if computed
+ */
 //================================================================================
 
 bool StdMeshers_ProjectionUtils::MakeComputed(SMESH_subMesh * sm, const int iterationNb)
@@ -2107,9 +2108,45 @@ bool StdMeshers_ProjectionUtils::MakeComputed(SMESH_subMesh * sm, const int iter
   return false;
 }
 
+
+//================================================================================
+/*
+ * Returns an error message to show in case if MakeComputed( sm ) fails.
+ */
+//================================================================================
+
+std::string StdMeshers_ProjectionUtils::SourceNotComputedError( SMESH_subMesh * sm,
+                                                                SMESH_Algo*     projAlgo )
+{
+  const char usualMessage [] = "Source mesh not computed";
+  if ( !projAlgo )
+    return usualMessage;
+  if ( !sm || sm->GetAlgoState() != SMESH_subMesh::NO_ALGO )
+    return usualMessage; // algo is OK, anything else is KO.
+
+  // Try to find a type of all-dimentional algorithm that would compute the
+  // given sub-mesh if it could be launched before projection
+  const TopoDS_Shape shape = sm->GetSubShape();
+  const int       shapeDim = SMESH_Gen::GetShapeDim( shape );
+
+  for ( int dimIncrement = 1; shapeDim + dimIncrement < 4; ++dimIncrement )
+  {
+    SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
+    filter.And( filter.HasDim( shapeDim + dimIncrement ));
+
+    SMESH_Algo* algo = (SMESH_Algo*) sm->GetFather()->GetHypothesis( shape, filter, true );
+    if ( algo && !algo->NeedDiscreteBoundary() )
+      return SMESH_Comment("\"")
+        << algo->GetFeatures()._label << "\""
+        << " can't be used to compute the source mesh for \""
+        << projAlgo->GetFeatures()._label << "\" in this case";
+  }
+  return usualMessage;
+}
+
 //================================================================================
-/*!
- * \brief Return a boundary EDGE (or all boundary EDGEs) of edgeContainer
+/*
+ * Return a boundary EDGE (or all boundary EDGEs) of edgeContainer
  */
 //================================================================================
 
@@ -2195,11 +2232,11 @@ namespace { // Definition of event listeners
 }
 
 //================================================================================
-/*!
- * \brief Set event listeners to submesh with projection algo
- * \param subMesh - submesh with projection algo
- * \param srcShape - source shape
- * \param srcMesh - source mesh
+/*
+ * Set event listeners to submesh with projection algo
+ *  \param subMesh - submesh with projection algo
+ *  \param srcShape - source shape
+ *  \param srcMesh - source mesh
  */
 //================================================================================
 
index 97d55ba22e9aab8f5be44a92242fa641a2893710..6e57ecc8188cf53e6275149d0472b05ac8f4266d 100644 (file)
 #include <list>
 #include <map>
 
-class TopoDS_Shape;
 class SMDS_MeshNode;
-class SMESH_Mesh;
+class SMESH_Algo;
 class SMESH_Hypothesis;
+class SMESH_Mesh;
 class SMESH_subMesh;
 class TopTools_IndexedDataMapOfShapeListOfShape;
+class TopoDS_Shape;
 
 /*!
  * \brief Struct used instead of a sole TopTools_DataMapOfShapeShape to avoid
@@ -69,149 +70,153 @@ struct StdMeshers_ShapeShapeBiDirectionMap
 };
 
 /*!
- * \brief Class encapsulating methods common to Projection algorithms
+ * \brief Methods common to Projection algorithms
  */
-class StdMeshers_ProjectionUtils
+namespace StdMeshers_ProjectionUtils
 {
- public:
-
   typedef StdMeshers_ShapeShapeBiDirectionMap                  TShapeShapeMap;
   typedef TopTools_IndexedDataMapOfShapeListOfShape            TAncestorMap;
   typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
 
   /*!
    * \brief Looks for association of all sub-shapes of two shapes
-    * \param theShape1 - shape 1
-    * \param theMesh1 - mesh built on shape 1
-    * \param theShape2 - shape 2
-    * \param theMesh2 - mesh built on shape 2
-    * \param theAssociation - association map to be filled that may
-    *                         contain association of one or two pairs of vertices
-    * \retval bool - true if association found
+   * \param theShape1 - shape 1
+   * \param theMesh1 - mesh built on shape 1
+   * \param theShape2 - shape 2
+   * \param theMesh2 - mesh built on shape 2
+   * \param theAssociation - association map to be filled that may
+   *                         contain association of one or two pairs of vertices
+   * \retval bool - true if association found
    */
-  static bool FindSubShapeAssociation(const TopoDS_Shape& theShape1,
-                                      SMESH_Mesh*         theMesh1,
-                                      const TopoDS_Shape& theShape2,
-                                      SMESH_Mesh*         theMesh2,
-                                      TShapeShapeMap &    theAssociationMap);
+  bool FindSubShapeAssociation(const TopoDS_Shape& theShape1,
+                               SMESH_Mesh*         theMesh1,
+                               const TopoDS_Shape& theShape2,
+                               SMESH_Mesh*         theMesh2,
+                               TShapeShapeMap &    theAssociationMap);
 
   /*!
    * \brief Find association of edges of faces
-    * \param face1 - face 1
-    * \param VV1 - vertices of face 1
-    * \param face2 - face 2
-    * \param VV2 - vertices of face 2 associated with oned of face 1
-    * \param edges1 - out list of edges of face 1
-    * \param edges2 - out list of edges of face 2
-    * \retval int - nb of edges in an outer wire in a success case, else zero
+   * \param face1 - face 1
+   * \param VV1 - vertices of face 1
+   * \param face2 - face 2
+   * \param VV2 - vertices of face 2 associated with oned of face 1
+   * \param edges1 - out list of edges of face 1
+   * \param edges2 - out list of edges of face 2
+   * \retval int - nb of edges in an outer wire in a success case, else zero
    */
-  static int FindFaceAssociation(const TopoDS_Face&         face1,
-                                 TopoDS_Vertex              VV1[2],
-                                 const TopoDS_Face&         face2,
-                                 TopoDS_Vertex              VV2[2],
-                                 std::list< TopoDS_Edge > & edges1,
-                                 std::list< TopoDS_Edge > & edges2);
+  int FindFaceAssociation(const TopoDS_Face&         face1,
+                          TopoDS_Vertex              VV1[2],
+                          const TopoDS_Face&         face2,
+                          TopoDS_Vertex              VV2[2],
+                          std::list< TopoDS_Edge > & edges1,
+                          std::list< TopoDS_Edge > & edges2);
 
   /*!
    * \brief Insert vertex association defined by a hypothesis into a map
-    * \param theHyp - hypothesis
-    * \param theAssociationMap - association map
-    * \param theTargetShape - the shape theHyp assigned to
+   * \param theHyp - hypothesis
+   * \param theAssociationMap - association map
+   * \param theTargetShape - the shape theHyp assigned to
    */
-  static void InitVertexAssociation( const SMESH_Hypothesis* theHyp,
-                                     TShapeShapeMap &        theAssociationMap);
+  void InitVertexAssociation( const SMESH_Hypothesis* theHyp,
+                              TShapeShapeMap &        theAssociationMap);
 
   /*!
    * \brief Inserts association theShape1 <-> theShape2 to TShapeShapeMap
-    * \param theShape1 - target shape
-    * \param theShape2 - source shape
-    * \param theAssociationMap - association map 
-    * \param theBidirectional - if false, inserts theShape1 -> theShape2 association
-    * \retval bool - true if there was no association for these shapes before
+   * \param theShape1 - target shape
+   * \param theShape2 - source shape
+   * \param theAssociationMap - association map 
+   * \param theBidirectional - if false, inserts theShape1 -> theShape2 association
+   * \retval bool - true if there was no association for these shapes before
    */
-  static bool InsertAssociation( const TopoDS_Shape& theShape1, // target
-                                 const TopoDS_Shape& theShape2, // source
-                                 TShapeShapeMap &    theAssociationMap);
+  bool InsertAssociation( const TopoDS_Shape& theShape1, // target
+                          const TopoDS_Shape& theShape2, // source
+                          TShapeShapeMap &    theAssociationMap);
 
   /*!
    * \brief Finds an edge by its vertices in a main shape of the mesh
    */
-  static TopoDS_Edge GetEdgeByVertices( SMESH_Mesh*          aMesh,
-                                        const TopoDS_Vertex& V1,
-                                        const TopoDS_Vertex& V2);
-                                        
+  TopoDS_Edge GetEdgeByVertices( SMESH_Mesh*          aMesh,
+                                 const TopoDS_Vertex& V1,
+                                 const TopoDS_Vertex& V2);
+
   /*!
    * \brief Return another face sharing an edge
    * \param edgeToFaces - data map of descendants to ancestors
    */
-  static TopoDS_Face GetNextFace( const TAncestorMap& edgeToFaces,
-                                  const TopoDS_Edge&  edge,
-                                  const TopoDS_Face&  face);
+  TopoDS_Face GetNextFace( const TAncestorMap& edgeToFaces,
+                           const TopoDS_Edge&  edge,
+                           const TopoDS_Face&  face);
   /*!
    * \brief Return other vertex of an edge
    */
-  static TopoDS_Vertex GetNextVertex(const TopoDS_Edge&   edge,
-                                     const TopoDS_Vertex& vertex);
+  TopoDS_Vertex GetNextVertex(const TopoDS_Edge&   edge,
+                              const TopoDS_Vertex& vertex);
 
   /*!
    * \brief Return an oriented propagation edge
-    * \param aMesh - mesh
-    * \param fromEdge - start edge for propagation
-    * \retval pair<int,TopoDS_Edge> - propagation step and found edge
+   * \param aMesh - mesh
+   * \param fromEdge - start edge for propagation
+   * \retval pair<int,TopoDS_Edge> - propagation step and found edge
    */
-  static std::pair<int,TopoDS_Edge> GetPropagationEdge( SMESH_Mesh*        aMesh,
-                                                        const TopoDS_Edge& anEdge,
-                                                        const TopoDS_Edge& fromEdge);
+  std::pair<int,TopoDS_Edge> GetPropagationEdge( SMESH_Mesh*        aMesh,
+                                                 const TopoDS_Edge& anEdge,
+                                                 const TopoDS_Edge& fromEdge);
 
   /*!
    * \brief Find corresponding nodes on two faces
-    * \param face1 - the first face
-    * \param mesh1 - mesh containing elements on the first face
-    * \param face2 - the second face
-    * \param mesh2 - mesh containing elements on the second face
-    * \param assocMap - map associating sub-shapes of the faces
-    * \param nodeIn2OutMap - map containing found matching nodes
-    * \retval bool - is a success
+   * \param face1 - the first face
+   * \param mesh1 - mesh containing elements on the first face
+   * \param face2 - the second face
+   * \param mesh2 - mesh containing elements on the second face
+   * \param assocMap - map associating sub-shapes of the faces
+   * \param nodeIn2OutMap - map containing found matching nodes
+   * \retval bool - is a success
    */
-  static bool FindMatchingNodesOnFaces( const TopoDS_Face&     face1,
-                                        SMESH_Mesh*            mesh1,
-                                        const TopoDS_Face&     face2,
-                                        SMESH_Mesh*            mesh2,
-                                        const TShapeShapeMap & assocMap,
-                                        TNodeNodeMap &         nodeIn2OutMap);
+  bool FindMatchingNodesOnFaces( const TopoDS_Face&     face1,
+                                 SMESH_Mesh*            mesh1,
+                                 const TopoDS_Face&     face2,
+                                 SMESH_Mesh*            mesh2,
+                                 const TShapeShapeMap & assocMap,
+                                 TNodeNodeMap &         nodeIn2OutMap);
   /*!
    * \brief Return any sub-shape of a face belonging to the outer wire
-    * \param face - the face
-    * \param type - type of sub-shape to return
-    * \retval TopoDS_Shape - the found sub-shape
+   * \param face - the face
+   * \param type - type of sub-shape to return
+   * \retval TopoDS_Shape - the found sub-shape
    */
-  static TopoDS_Shape OuterShape( const TopoDS_Face& face,
-                                  TopAbs_ShapeEnum   type);
+  TopoDS_Shape OuterShape( const TopoDS_Face& face,
+                           TopAbs_ShapeEnum   type);
 
   /*!
    * \brief Check that submeshis is computed and try to compute it if is not
-    * \param sm - submesh to compute
-    * \param iterationNb - int used to stop infinite recursive call
-    * \retval bool - true if computed
+   * \param sm - submesh to compute
+   * \param iterationNb - int used to stop infinite recursive call
+   * \retval bool - true if computed
+   */
+  bool MakeComputed(SMESH_subMesh * sm, const int iterationNb = 0);
+
+  /*!
+   * \brief Returns an error message to show in case if MakeComputed( sm ) fails.
    */
-  static bool MakeComputed(SMESH_subMesh * sm, const int iterationNb = 0);
+  std::string SourceNotComputedError( SMESH_subMesh * sm = 0,
+                                      SMESH_Algo*     projAlgo=0);
 
   /*!
    * \brief Set event listeners to submesh with projection algo
-    * \param subMesh - submesh with projection algo
-    * \param srcShape - source shape
-    * \param srcMesh - source mesh
+   * \param subMesh - submesh with projection algo
+   * \param srcShape - source shape
+   * \param srcMesh - source mesh
    */
-  static void SetEventListener(SMESH_subMesh* subMesh,
-                               TopoDS_Shape   srcShape,
-                               SMESH_Mesh*    srcMesh);
+  void SetEventListener(SMESH_subMesh* subMesh,
+                        TopoDS_Shape   srcShape,
+                        SMESH_Mesh*    srcMesh);
 
   /*!
    * \brief Return a boundary EDGE (or all boundary EDGEs) of edgeContainer
    */
-  static TopoDS_Edge GetBoundaryEdge(const TopoDS_Shape&       edgeContainer,
-                                     const SMESH_Mesh&         mesh,
-                                     std::list< TopoDS_Edge >* allBndEdges = 0 );
+  TopoDS_Edge GetBoundaryEdge(const TopoDS_Shape&       edgeContainer,
+                              const SMESH_Mesh&         mesh,
+                              std::list< TopoDS_Edge >* allBndEdges = 0 );
 };
 
 #endif
index 778b57c0e605d36495fe5dd7b72b1b9f3ff2921a..a52ffe6618987005b5a7642f8bf6f8d15c933b60 100644 (file)
@@ -57,7 +57,8 @@ using namespace std;
 
 #define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
 
-typedef StdMeshers_ProjectionUtils TAssocTool;
+//typedef StdMeshers_ProjectionUtils TAssocTool;
+namespace TAssocTool = StdMeshers_ProjectionUtils;
 
 //=======================================================================
 //function : StdMeshers_Projection_1D
@@ -238,14 +239,18 @@ bool StdMeshers_Projection_1D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
   SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcEdge );
   //SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( tgtEdge );
 
+  string srcMeshError;
   if ( tgtMesh == srcMesh ) {
     if ( !TAssocTool::MakeComputed( srcSubMesh ))
-      return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+      srcMeshError = TAssocTool::SourceNotComputedError( srcSubMesh, this );
   }
   else {
     if ( !srcSubMesh->IsMeshComputed() )
-      return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+      srcMeshError = TAssocTool::SourceNotComputedError();
   }
+  if ( !srcMeshError.empty() )
+    return error(COMPERR_BAD_INPUT_MESH, srcMeshError );
+
   // -----------------------------------------------
   // Find out nodes distribution on the source edge
   // -----------------------------------------------
index f9fe63dc3c6b87de66f08f83630be7065899a9a9..73feed3cc3d910346b2908a9d52b91dce50c5b61 100644 (file)
@@ -199,7 +199,7 @@ bool StdMeshers_Projection_1D2D::Evaluate(SMESH_Mesh&         theMesh,
   if ( !srcMesh ) srcMesh = & theMesh;
   SMESH_subMesh* srcFaceSM = srcMesh->GetSubMesh( srcFace );
 
-  typedef StdMeshers_ProjectionUtils SPU;
+  namespace SPU = StdMeshers_ProjectionUtils;
   SPU::TShapeShapeMap shape2ShapeMap;
   SPU::InitVertexAssociation( _sourceHypo, shape2ShapeMap );
   if ( !SPU::FindSubShapeAssociation( theShape, &theMesh, srcFace, srcMesh, shape2ShapeMap))
index 7467a19f9b5a9c913ea337c36cb15fd082ac4337..9f1c2fcf6c85ba2e62e0fbec4a1749c9c9bcab2b 100644 (file)
@@ -62,7 +62,8 @@ using namespace std;
 
 #define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
 
-typedef StdMeshers_ProjectionUtils TAssocTool;
+namespace TAssocTool = StdMeshers_ProjectionUtils;
+//typedef StdMeshers_ProjectionUtils TAssocTool;
 
 //=======================================================================
 //function : StdMeshers_Projection_2D
@@ -824,14 +825,17 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
   SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcFace );
   SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( tgtFace );
 
+  string srcMeshError;
   if ( tgtMesh == srcMesh ) {
-    if ( !TAssocTool::MakeComputed( srcSubMesh ) || !srcSubMesh->IsMeshComputed() )
-      return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+    if ( !TAssocTool::MakeComputed( srcSubMesh ))
+      srcMeshError = TAssocTool::SourceNotComputedError( srcSubMesh, this );
   }
   else {
     if ( !srcSubMesh->IsMeshComputed() )
-      return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+      srcMeshError = TAssocTool::SourceNotComputedError();
   }
+  if ( !srcMeshError.empty() )
+    return error(COMPERR_BAD_INPUT_MESH, srcMeshError );
 
   // ===========
   // Projection
@@ -861,15 +865,15 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
     done = projectBy2DSimilarity( tgtFace, srcFace, tgtMesh, srcMesh, shape2ShapeMap, is1DComputed);
   }
 
+  SMESH_MesherHelper helper( theMesh );
+  helper.SetSubShape( tgtFace );
+
   if ( !done )
   {
     // --------------------
     // Prepare to mapping 
     // --------------------
 
-    SMESH_MesherHelper helper( theMesh );
-    helper.SetSubShape( tgtFace );
-
     // Check if node projection to a face is needed
     Bnd_B2d uvBox;
     SMDS_ElemIteratorPtr faceIt = srcSubMesh->GetSubMeshDS()->GetElements();
@@ -1182,7 +1186,7 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
     }
   }
   // Fix orientation
-  if ( SMESH_Algo::IsReversedSubMesh( face, meshDS ))
+  if ( helper.IsReversedSubMesh( face ))
   {
     SMESH_MeshEditor editor( tgtMesh );
     SMDS_ElemIteratorPtr eIt = meshDS->MeshElements( face )->GetElements();
index 7c07b40f30df94dec0fa090391a5199268869a4e..cf42d5d4183c64cf834a554bff3a45d6a97fba52 100644 (file)
@@ -57,7 +57,7 @@
 // cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl;\
 // }
 
-typedef StdMeshers_ProjectionUtils TAssocTool;
+namespace TAssocTool = StdMeshers_ProjectionUtils;
 
 
 //=======================================================================
@@ -233,13 +233,14 @@ bool StdMeshers_Projection_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aS
   SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( _sourceHypo->GetSource3DShape() );
   //SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( aShape );
 
-  if ( tgtMesh == srcMesh && !aShape.IsSame( _sourceHypo->GetSource3DShape() )) {
+  string srcMeshError;
+  if ( tgtMesh == srcMesh  && !aShape.IsSame( _sourceHypo->GetSource3DShape() )) {
     if ( !TAssocTool::MakeComputed( srcSubMesh ))
-      return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+      srcMeshError = TAssocTool::SourceNotComputedError( srcSubMesh, this );
   }
   else {
     if ( !srcSubMesh->IsMeshComputed() )
-      return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+      srcMeshError = TAssocTool::SourceNotComputedError();
   }
 
   // Find 2 pairs of corresponding vertices
index 4c96220ea5297581e5a1ef7dedbd289ec2c88a00..54c3b7609f79c418c945cc1454a0095b68c07c0a 100644 (file)
@@ -756,7 +756,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh&         aMesh,
     {
       bool isRev = false;
       if ( helper.NbAncestors( aShapeFace, aMesh, aShape.ShapeType() ) > 1 )
-        isRev = SMESH_Algo::IsReversedSubMesh( TopoDS::Face(aShapeFace), meshDS );
+        isRev = helper.IsReversedSubMesh( TopoDS::Face(aShapeFace) );
 
       SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
       while ( iteratorElem->more() ) // loop on elements on a geometrical face
index ec34a041c16fa3710287259ebe06a6f5d7f979e2..143f58e7a4a41d28012dfd6a208cd5b7f1f8789c 100644 (file)
@@ -67,7 +67,7 @@ using namespace std;
 #define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
 #define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z())
 
-typedef StdMeshers_ProjectionUtils TAssocTool;
+namespace TAssocTool = StdMeshers_ProjectionUtils;
 
 //=======================================================================
 //function : StdMeshers_RadialPrism_3D
index a855c24a35a5a3182d9c9bcdc3f96b054ef9a581..124b61e1e66e93fdabe4468d1de23cc8247b1e2c 100644 (file)
@@ -1096,7 +1096,7 @@ bool _ViscousBuilder::findFacesWithLayers()
       {     
         _ignoreShapeIds.insert( faceInd );
         ignoreFaces.push_back( exp.Current() );
-        if ( SMESH_Algo::IsReversedSubMesh( TopoDS::Face( exp.Current() ), getMeshDS()))
+        if ( helper.IsReversedSubMesh( TopoDS::Face( exp.Current() )))
           _sdVec[i]._reversedFaceIds.insert( faceInd );
       }
     }
@@ -2074,7 +2074,7 @@ bool _ViscousBuilder::inflate(_SolidData& data)
   {
     if ( data._edges[i]->IsOnEdge() ) continue;
     data._edges[i]->FindIntersection( *searcher, intersecDist, data._epsilon );
-    if ( geomSize > intersecDist )
+    if ( geomSize > intersecDist && intersecDist > 0 )
       geomSize = intersecDist;
   }
   if ( data._stepSize > 0.3 * geomSize )
@@ -4480,7 +4480,7 @@ bool _ViscousBuilder::addBoundaryElements()
         reverse = ( helper.GetSubShapeOri( F, E ) == TopAbs_REVERSED );
         if ( helper.GetSubShapeOri( data._solid, F ) == TopAbs_REVERSED )
           reverse = !reverse, F.Reverse();
-        if ( SMESH_Algo::IsReversedSubMesh( TopoDS::Face(F), getMeshDS() ))
+        if ( helper.IsReversedSubMesh( TopoDS::Face(F) ))
           reverse = !reverse;
       }
       else
index 4e4d0ed8e28e716e8e9c84a69667af733c7ecac9..af1dcae601806c03dd994a8235edfae64f0e6acd 100644 (file)
@@ -442,7 +442,7 @@ StdMeshers_ViscousLayers2D::Compute(SMESH_Mesh&        theMesh,
       theMesh.GetSubMesh( theFace )->GetComputeError() = error;
     else if ( !pm )
       pm.reset( new SMESH_ProxyMesh( theMesh ));
-    if ( getenv("ONLY_VL2D"))
+    if ( getenv("__ONLY__VL2D__"))
       pm.reset();
   }
   else
@@ -1834,13 +1834,14 @@ bool _ViscousBuilder2D::refine()
       normPar[ i - L._firstPntInd ] = ( points[i].normParam - normF ) / normDist;
 
     // Create layers of faces
-
+    
     bool hasLeftNode  = ( !L._leftLine->_rightNodes.empty() && leftEdgeShared  );
     bool hasRightNode = ( !L._rightLine->_leftNodes.empty() && rightEdgeShared );
     bool hasOwnLeftNode  = ( !L._leftNodes.empty() );
     bool hasOwnRightNode = ( !L._rightNodes.empty() );
+    bool isClosedEdge = ( outerNodes.front() == outerNodes.back() );
     size_t iS,
-      iN0 = ( hasLeftNode || hasOwnLeftNode || _polyLineVec.size() == 1 ),
+      iN0 = ( hasLeftNode || hasOwnLeftNode || isClosedEdge ),
       nbN = innerNodes.size() - ( hasRightNode || hasOwnRightNode );
     L._leftNodes .reserve( _hyp->GetNumberLayers() );
     L._rightNodes.reserve( _hyp->GetNumberLayers() );
@@ -1872,7 +1873,7 @@ bool _ViscousBuilder2D::refine()
       else if ( hasLeftNode )  innerNodes.front() = L._leftLine->_rightNodes[ iF ];
       if ( hasOwnRightNode )   innerNodes.back()  = L._rightNodes[ iF ];
       else if ( hasRightNode ) innerNodes.back()  = L._rightLine->_leftNodes[ iF ];
-      if ( _polyLineVec.size() == 1 ) innerNodes.front() = innerNodes.back(); // circle
+      if ( isClosedEdge )      innerNodes.front() = innerNodes.back(); // circle
       if ( !hasOwnLeftNode )  L._leftNodes.push_back( innerNodes.front() );
       if ( !hasOwnRightNode ) L._rightNodes.push_back( innerNodes.back() );