Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
authorjfa <jfa@opencascade.com>
Mon, 13 Mar 2006 15:29:49 +0000 (15:29 +0000)
committerjfa <jfa@opencascade.com>
Mon, 13 Mar 2006 15:29:49 +0000 (15:29 +0000)
192 files changed:
Makefile.in
adm_local/Makefile.in [new file with mode: 0644]
adm_local/unix/config_files/check_Geom.m4 [deleted file]
adm_local/unix/config_files/check_Med.m4 [deleted file]
adm_local/unix/config_files/check_SMESH.m4 [new file with mode: 0644]
adm_local/unix/config_files/check_f77.m4 [new file with mode: 0644]
adm_local/unix/make_commence.in
build_configure
configure.in.base
doc/salome/gui/SMESH/defining_hypotheses_tui.htm
idl/SMESH_BasicHypothesis.idl
idl/SMESH_Gen.idl
idl/SMESH_Group.idl
idl/SMESH_Mesh.idl
resources/StdMeshers.xml
resources/mesh_quad_edge.png [new file with mode: 0644]
resources/mesh_quad_hexahedron.png [new file with mode: 0644]
resources/mesh_quad_pentahedron.png [new file with mode: 0644]
resources/mesh_quad_pyramid.png [new file with mode: 0644]
resources/mesh_quad_quadrangle.png [new file with mode: 0644]
resources/mesh_quad_tetrahedron.png [new file with mode: 0644]
resources/mesh_quad_triangle.png [new file with mode: 0644]
src/Controls/SMESH_Controls.cxx
src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx
src/DriverMED/DriverMED_Family.cxx
src/DriverMED/DriverMED_Family.h
src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
src/DriverSTL/DriverSTL_W_SMDS_Mesh.cxx
src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx
src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx
src/DriverUNV/UNV2412_Structure.cxx
src/Makefile.in
src/OBJECT/Makefile.in
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_DeviceActor.cxx
src/OBJECT/SMESH_Object.cxx
src/OBJECT/SMESH_ObjectDef.h
src/SMDS/Makefile.in
src/SMDS/SMDS_ElemIterator.hxx
src/SMDS/SMDS_FaceOfEdges.cxx
src/SMDS/SMDS_FaceOfEdges.hxx
src/SMDS/SMDS_FaceOfNodes.cxx
src/SMDS/SMDS_FaceOfNodes.hxx
src/SMDS/SMDS_Mesh.cxx
src/SMDS/SMDS_Mesh.hxx
src/SMDS/SMDS_MeshEdge.cxx
src/SMDS/SMDS_MeshEdge.hxx
src/SMDS/SMDS_MeshElement.cxx
src/SMDS/SMDS_MeshElement.hxx
src/SMDS/SMDS_MeshNode.hxx
src/SMDS/SMDS_PolygonalFaceOfNodes.cxx
src/SMDS/SMDS_PolygonalFaceOfNodes.hxx
src/SMDS/SMDS_QuadraticEdge.cxx [new file with mode: 0644]
src/SMDS/SMDS_QuadraticEdge.hxx [new file with mode: 0644]
src/SMDS/SMDS_QuadraticFaceOfNodes.cxx [new file with mode: 0644]
src/SMDS/SMDS_QuadraticFaceOfNodes.hxx [new file with mode: 0644]
src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx [new file with mode: 0644]
src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx [new file with mode: 0644]
src/SMDS/SMDS_SetIterator.hxx [new file with mode: 0644]
src/SMDS/SMDS_VolumeOfNodes.cxx
src/SMDS/SMDS_VolumeOfNodes.hxx
src/SMDS/SMDS_VolumeTool.cxx
src/SMDS/SMDS_VolumeTool.hxx
src/SMESH/Makefile.in
src/SMESH/SMESH_2D_Algo.cxx
src/SMESH/SMESH_2D_Algo.hxx
src/SMESH/SMESH_3D_Algo.cxx
src/SMESH/SMESH_3D_Algo.hxx
src/SMESH/SMESH_Algo.cxx
src/SMESH/SMESH_Algo.hxx
src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_Gen.hxx
src/SMESH/SMESH_Group.hxx
src/SMESH/SMESH_HypoFilter.cxx
src/SMESH/SMESH_HypoFilter.hxx
src/SMESH/SMESH_Hypothesis.cxx
src/SMESH/SMESH_Hypothesis.hxx
src/SMESH/SMESH_Mesh.cxx
src/SMESH/SMESH_Mesh.hxx
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_MeshEditor.hxx
src/SMESH/SMESH_Pattern.cxx
src/SMESH/SMESH_subMesh.cxx
src/SMESH/SMESH_subMesh.hxx
src/SMESHClient/Makefile.in [new file with mode: 0644]
src/SMESHClient/SMESHClientBin.cxx [new file with mode: 0644]
src/SMESHClient/SMESH_Client.cxx [new file with mode: 0644]
src/SMESHClient/SMESH_Client.hxx [new file with mode: 0644]
src/SMESHDS/SMESHDS_Command.cxx
src/SMESHDS/SMESHDS_Command.hxx
src/SMESHDS/SMESHDS_CommandType.hxx
src/SMESHDS/SMESHDS_Document.cxx
src/SMESHDS/SMESHDS_Document.hxx
src/SMESHDS/SMESHDS_GroupBase.hxx
src/SMESHDS/SMESHDS_Mesh.cxx
src/SMESHDS/SMESHDS_Mesh.hxx
src/SMESHDS/SMESHDS_Script.cxx
src/SMESHDS/SMESHDS_Script.hxx
src/SMESHFiltersSelection/Makefile.in
src/SMESHGUI/Makefile.in
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx [new file with mode: 0644]
src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.h [new file with mode: 0644]
src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
src/SMESHGUI/SMESHGUI_CreateHypothesesDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h
src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx
src/SMESHGUI/SMESHGUI_Dialog.cxx
src/SMESHGUI/SMESHGUI_EditHypothesesDlg.cxx
src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.h
src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx
src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx
src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESHGUI/SMESHGUI_NodesDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h
src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_Selection.cxx
src/SMESHGUI/SMESHGUI_SewingDlg.cxx
src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx
src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx
src/SMESHGUI/SMESHGUI_Utils.cxx
src/SMESHGUI/SMESHGUI_Utils.h
src/SMESHGUI/SMESH_icons.po
src/SMESHGUI/SMESH_images.po
src/SMESHGUI/SMESH_msg_en.po
src/SMESH_I/Makefile.in
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_I/SMESH_2smeshpy.hxx
src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_I/SMESH_Gen_i.hxx
src/SMESH_I/SMESH_Group_i.cxx
src/SMESH_I/SMESH_Group_i.hxx
src/SMESH_I/SMESH_Hypothesis_i.cxx
src/SMESH_I/SMESH_MEDMesh_i.cxx
src/SMESH_I/SMESH_MeshEditor_i.cxx
src/SMESH_I/SMESH_MeshEditor_i.hxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_I/SMESH_Mesh_i.hxx
src/SMESH_I/SMESH_subMesh_i.cxx
src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py
src/SMESH_SWIG/smesh.py
src/StdMeshers/Makefile.in
src/StdMeshers/StdMeshers_Distribution.cxx
src/StdMeshers/StdMeshers_Helper.cxx [new file with mode: 0644]
src/StdMeshers/StdMeshers_Helper.hxx [new file with mode: 0644]
src/StdMeshers/StdMeshers_Hexa_3D.cxx
src/StdMeshers/StdMeshers_Hexa_3D.hxx
src/StdMeshers/StdMeshers_MEFISTO_2D.cxx
src/StdMeshers/StdMeshers_MEFISTO_2D.hxx
src/StdMeshers/StdMeshers_NumberOfSegments.cxx
src/StdMeshers/StdMeshers_Penta_3D.cxx
src/StdMeshers/StdMeshers_Penta_3D.hxx
src/StdMeshers/StdMeshers_Propagation.cxx
src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
src/StdMeshers/StdMeshers_Quadrangle_2D.hxx
src/StdMeshers/StdMeshers_QuadraticMesh.cxx [new file with mode: 0644]
src/StdMeshers/StdMeshers_QuadraticMesh.hxx [new file with mode: 0644]
src/StdMeshers/StdMeshers_Regular_1D.cxx
src/StdMeshers/StdMeshers_Regular_1D.hxx
src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
src/StdMeshersGUI/StdMeshers_images.po
src/StdMeshers_I/Makefile.in
src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx
src/StdMeshers_I/StdMeshers_QuadraticMesh_i.cxx [new file with mode: 0644]
src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx [new file with mode: 0644]
src/StdMeshers_I/StdMeshers_i.cxx

index f3a90df..ded60d8 100644 (file)
@@ -14,7 +14,7 @@ VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:./bin:@top_srcdir@/idl
 
 @COMMENCE@
 
-SUBDIRS = idl src doc
+SUBDIRS = idl src doc adm_local
 
 RESOURCES_FILES = \
 delete.png  \
@@ -131,7 +131,14 @@ mesh_pattern.png \
 pattern_sample_2d.png \
 pattern_sample_3D.png \
 mesh_add.png \
-mesh_remove.png
+mesh_remove.png \
+mesh_quad_edge.png \
+mesh_quad_triangle.png \
+mesh_quad_quadrangle.png \
+mesh_quad_tetrahedron.png \
+mesh_quad_pyramid.png \
+mesh_quad_pentahedron.png \
+mesh_quad_hexahedron.png
 
 BIN_SCRIPT= \
 VERSION
diff --git a/adm_local/Makefile.in b/adm_local/Makefile.in
new file mode 100644 (file)
index 0000000..9b5e810
--- /dev/null
@@ -0,0 +1,41 @@
+# source path
+top_srcdir=@top_srcdir@
+top_builddir=..
+srcdir=@srcdir@
+VPATH=.:$(srcdir)/adm_local
+
+
+all: resources
+
+install:
+       cp -rf @top_srcdir@/adm_local @prefix@
+
+bin:
+
+resources :
+       cp -rf @top_srcdir@/adm_local $(top_builddir)
+
+inc:
+
+lib:
+
+depend:
+
+depend_idl:
+
+install-end:
+
+install-include:
+
+install-bin:
+
+uninstall:
+
+uninstall-idl:
+
+distclean:
+
+clean:
+
+distclean-other:
+
diff --git a/adm_local/unix/config_files/check_Geom.m4 b/adm_local/unix/config_files/check_Geom.m4
deleted file mode 100644 (file)
index 13f3be4..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# Check availability of Geom binary distribution
-#
-# Author : Nicolas REJNERI (OPEN CASCADE, 2003)
-#
-
-AC_DEFUN([CHECK_GEOM],[
-
-AC_CHECKING(for Geom)
-
-Geom_ok=no
-
-AC_ARG_WITH(geom,
-           [  --with-geom=DIR root directory path of GEOM installation ],
-           GEOM_DIR="$withval",GEOM_DIR="")
-
-if test "x$GEOM_DIR" == "x" ; then
-
-# no --with-geom-dir option used
-
-   if test "x$GEOM_ROOT_DIR" != "x" ; then
-
-    # GEOM_ROOT_DIR environment variable defined
-      GEOM_DIR=$GEOM_ROOT_DIR
-
-   fi
-# 
-fi
-
-if test -f ${GEOM_DIR}/lib/salome/libGEOMClient.so ; then
-   Geom_ok=yes
-   AC_MSG_RESULT(Using Geom module distribution in ${GEOM_DIR})
-
-   if test "x$GEOM_ROOT_DIR" == "x" ; then
-      GEOM_ROOT_DIR=${GEOM_DIR}
-   fi
-   AC_SUBST(GEOM_ROOT_DIR)
-
-else
-   AC_MSG_WARN("Cannot find compiled Geom module distribution")
-fi
-
-AC_MSG_RESULT(for Geom: $Geom_ok)
-])dnl
diff --git a/adm_local/unix/config_files/check_Med.m4 b/adm_local/unix/config_files/check_Med.m4
deleted file mode 100644 (file)
index 727bf43..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# Check availability of Med binary distribution
-#
-# Author : Nicolas REJNERI (OPEN CASCADE, 2003)
-#
-
-AC_DEFUN([CHECK_MED],[
-
-AC_CHECKING(for Med)
-
-Med_ok=no
-
-AC_ARG_WITH(med,
-           [  --with-med=DIR root directory path of MED installation ],
-           MED_DIR="$withval",MED_DIR="")
-
-if test "x$MED_DIR" == "x" ; then
-
-# no --with-med-dir option used
-
-   if test "x$MED_ROOT_DIR" != "x" ; then
-
-    # MED_ROOT_DIR environment variable defined
-      MED_DIR=$MED_ROOT_DIR
-
-   fi
-# 
-fi
-
-if test -f ${MED_DIR}/idl/salome/MED.idl ; then
-   Med_ok=yes
-   AC_MSG_RESULT(Using Med module distribution in ${MED_DIR})
-
-   if test "x$MED_ROOT_DIR" == "x" ; then
-      MED_ROOT_DIR=${MED_DIR}
-   fi
-   AC_SUBST(MED_ROOT_DIR)
-
-else
-   AC_MSG_WARN("Cannot find Med module sources")
-fi
-  
-AC_MSG_RESULT(for Med: $Med_ok)
-])dnl
diff --git a/adm_local/unix/config_files/check_SMESH.m4 b/adm_local/unix/config_files/check_SMESH.m4
new file mode 100644 (file)
index 0000000..86a8264
--- /dev/null
@@ -0,0 +1,54 @@
+# Check availability of SMesh binary distribution
+#
+# Author : Nicolas REJNERI (OPEN CASCADE, 2003)
+#
+
+AC_DEFUN([CHECK_SMESH],[
+
+AC_CHECKING(for SMesh)
+
+SMesh_ok=no
+
+AC_ARG_WITH(smesh,
+           [  --with-smesh=DIR root directory path of SMESH installation ],
+           SMESH_DIR="$withval",SMESH_DIR="")
+
+if test "x$SMESH_DIR" == "x" ; then
+
+# no --with-smesh option used
+
+   if test "x$SMESH_ROOT_DIR" != "x" ; then
+
+    # SMESH_ROOT_DIR environment variable defined
+      SMESH_DIR=$SMESH_ROOT_DIR
+
+   else
+
+    # search SMESH binaries in PATH variable
+      AC_PATH_PROG(TEMP, libSMESH_Swig.py)
+      if test "x$TEMP" != "x" ; then
+         SMESH_BIN_DIR=`dirname $TEMP`
+         SMESH_DIR=`dirname $SMESH_BIN_DIR`
+      fi
+      
+   fi
+# 
+fi
+
+if test -f ${SMESH_DIR}/bin/salome/libSMESH_Swig.py ; then
+   SMesh_ok=yes
+   AC_MSG_RESULT(Using SMesh module distribution in ${SMESH_DIR})
+
+   if test "x$SMESH_ROOT_DIR" == "x" ; then
+      SMESH_ROOT_DIR=${SMESH_DIR}
+   fi
+   AC_SUBST(SMESH_ROOT_DIR)
+
+else
+   AC_MSG_WARN("Cannot find compiled SMesh module distribution")
+fi
+
+AC_MSG_RESULT(for SMesh: $SMesh_ok)
+])dnl
diff --git a/adm_local/unix/config_files/check_f77.m4 b/adm_local/unix/config_files/check_f77.m4
new file mode 100644 (file)
index 0000000..1b74a85
--- /dev/null
@@ -0,0 +1,29 @@
+dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+dnl 
+dnl  This library is free software; you can redistribute it and/or 
+dnl  modify it under the terms of the GNU Lesser General Public 
+dnl  License as published by the Free Software Foundation; either 
+dnl  version 2.1 of the License. 
+dnl 
+dnl  This library is distributed in the hope that it will be useful, 
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+dnl  Lesser General Public License for more details. 
+dnl 
+dnl  You should have received a copy of the GNU Lesser General Public 
+dnl  License along with this library; if not, write to the Free Software 
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+dnl 
+dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+dnl
+dnl
+dnl
+AC_DEFUN([CHECK_F77],[
+
+AC_PROG_F77
+
+AC_F77_LIBRARY_LDFLAGS
+AC_F77_WRAPPERS
+
+])dnl
index 5e55654..7f57ab3 100644 (file)
@@ -240,14 +240,27 @@ $(top_srcdir)/configure.in: $(top_srcdir)/configure.in.base
 
 
 ACLOCAL_SRC = \
-ac_cxx_bool.m4                    check_corba.m4     check_vtk.m4      \
+ac_cxx_bool.m4                    check_corba.m4                        \
 ac_cxx_depend_flag.m4             check_hdf5.m4      enable_pthreads.m4        \
 ac_cxx_mutable.m4                 check_mico.m4      libtool.m4                \
 ac_cxx_namespaces.m4              check_omniorb.m4   pyembed.m4                \
-ac_cxx_partial_specialization.m4  check_opengl.m4    python.m4         \
+ac_cxx_partial_specialization.m4  python.m4                             \
 ac_cxx_typename.m4                check_pthreads.m4  check_cas.m4      \
-ac_cc_warnings.m4                 check_qt.m4        check_boost.m4     \
-check_swig.m4                      
-
-$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%)
-       cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files
+ac_cc_warnings.m4                 check_boost.m4     check_swig.m4                      
+
+ACLOCAL_GUI = \
+check_vtk.m4                     check_opengl.m4    check_qt.m4        \
+check_GUI.m4                     check_corba_in_GUI.m4  
+
+ACLOCAL_MED =                 check_Med.m4
+ACLOCAL_GEOM =                check_GEOM.m4                      
+
+$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \
+                          $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%) \
+                         $(ACLOCAL_MED:%=@MED_ROOT_DIR@/adm_local/unix/config_files/%) \
+                         $(ACLOCAL_GEOM:%=@GEOM_ROOT_DIR@/adm_local/unix/config_files/%)
+       cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \
+                                                                      -I @GUI_ROOT_DIR@/adm_local/unix/config_files \
+                                                                      -I @MED_ROOT_DIR@/adm_local/unix/config_files \
+                                                                      -I @GEOM_ROOT_DIR@/adm_local/unix/config_files
+       
\ No newline at end of file
index b884b17..2d81c7e 100755 (executable)
@@ -26,6 +26,31 @@ fi
 #    echo "failed : KERNEL_SRC variable is not correct !"
 #    exit
 #fi
+
+########################################################################
+# Test if the GUI_ROOT_DIR is set correctly
+
+if test ! -d "${GUI_ROOT_DIR}"; then
+    echo "failed : GUI_ROOT_DIR variable is not correct !"
+    exit
+fi
+
+########################################################################
+# Test if the MED_ROOT_DIR is set correctly
+
+if test ! -d "${MED_ROOT_DIR}"; then
+    echo "failed : MED_ROOT_DIR variable is not correct !"
+    exit
+fi
+
+########################################################################
+# Test if the GEOM_ROOT_DIR is set correctly
+
+if test ! -d "${GEOM_ROOT_DIR}"; then
+    echo "failed : GEOM_ROOT_DIR variable is not correct !"
+    exit
+fi
+
 ########################################################################
 # find_in - utility function
 #
@@ -203,7 +228,10 @@ else
        echo -n "Creating 'configure' script ...  "
 fi
 
-aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+                                       -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
+                                       -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
+                                       -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files
 if autoconf
 then
        echo "done"
index d81e497..d0105c7 100644 (file)
@@ -267,6 +267,26 @@ CHECK_HTML_GENERATORS
 
 echo
 echo ---------------------------------------------
+echo Testing GUI
+echo ---------------------------------------------
+echo
+
+CHECK_SALOME_GUI
+
+echo
+echo ---------------------------------------------
+echo Testing full GUI
+echo ---------------------------------------------
+echo
+
+CHECK_CORBA_IN_GUI
+if test "x${CORBA_IN_GUI}" != "xyes"; then
+  echo "failed : For configure SMESH module necessary full GUI !"
+  exit
+fi
+
+echo
+echo ---------------------------------------------
 echo Testing Kernel
 echo ---------------------------------------------
 echo
index 5818050..0874e45 100755 (executable)
@@ -284,58 +284,54 @@ else
 \r
 <p class="whs3"># create vertices</p>\r
 \r
-<p class="whs2">px &nbsp;&nbsp;= \r
- geompy.MakeVertex(100., 0. &nbsp;, \r
- 0. &nbsp;)</p>\r
+<p class="whs2">px &nbsp;&nbsp;=geompy.MakeVertex(100., 0. &nbsp;,0. &nbsp;)</p>\r
 \r
-<p class="whs2">py &nbsp;&nbsp;= \r
- geompy.MakeVertex(0. &nbsp;, \r
- 100., 0. &nbsp;)</p>\r
+<p class="whs2">py &nbsp;&nbsp;=geompy.MakeVertex(0. &nbsp;,100., 0. &nbsp;)</p>\r
 \r
-<p class="whs2">pz &nbsp;&nbsp;= \r
- geompy.MakeVertex(0. &nbsp;, \r
- 0. &nbsp;, 100.)</p>\r
+<p class="whs2">pz &nbsp;&nbsp;=geompy.MakeVertex(0. &nbsp;,0. &nbsp;, 100.)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs3"># create a vector from \r
  two points</p>\r
 \r
-<p class="whs2">vxy = geompy.MakeVector(px, \r
- py)</p>\r
+<p class="whs2">vxy = geompy.MakeVector(px,py)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs3"># create an arc from \r
  three points</p>\r
 \r
-<p class="whs2">arc = geompy.MakeArc(py, \r
- pz, px)</p>\r
+<p class="whs2">arc = geompy.MakeArc(py, pz, px)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs3"># create a wire</p>\r
 \r
-<p class="whs2">wire = geompy.MakeWire([vxy, \r
- arc])</p>\r
+<p class="whs2">wire = geompy.MakeWire([vxy,arc])</p>\r
 \r
 <p class="whs2">isPlanarFace = 1</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># create a face from \r
- the wire</p>\r
+<p class="whs3"># create a face from the wire</p>\r
 \r
-<p class="whs2">face1 = geompy.MakeFace(wire, \r
- isPlanarFace)</p>\r
+<p class="whs2">face1 = geompy.MakeFace(wire,isPlanarFace)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># add objects in the \r
- study</p>\r
+<p class="whs3"># get edges from the face</p>\r
+\r
+<p class="whs2">vxy, arc = geompy.SubShapeAll(face1, geompy.ShapeType["EDGE"])</p>\r
+\r
+<p class="whs2">&nbsp;</p>\r
+\r
+<p class="whs3"># add objects in the study</p>\r
 \r
 <p class="whs2">id_face1 = geompy.addToStudy(face1,&quot;Face1&quot;)</p>\r
 \r
+<p class="whs2">id_arc = geompy.addToStudyInFather(face1,arc,&quot;Arc Edge&quot;)</p>\r
+\r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs3"># display faces</p>\r
@@ -350,44 +346,34 @@ else
 \r
 <p class="whs3"># create hexahedral mesh</p>\r
 \r
-<p class="whs2">hexa = smesh.Mesh(face1, \r
- &quot;Face compound : hexahedrical mesh&quot;)</p>\r
+<p class="whs2">hexa = smesh.Mesh(face1,&quot;Face compound : hexahedrical mesh&quot;)</p>\r
 \r
 <p class="whs2">algo = hexa.Triangle()</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># define &quot;MaxElementArea&quot; \r
- hypothesis to be applied &nbsp;to \r
- each triangle</p>\r
+<p class="whs3"># define &quot;MaxElementArea&quot;hypothesis</p>\r
 \r
 <p class="whs2">algo.MaxElementArea(30)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># create a quadrangle \r
- 2D algorithm for faces</p>\r
-\r
-<p class="whs2">hexa.Quadrangle()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a local hypothesis</p>\r
+<p class="whs3"># create a local hypothesis on the wire</p>\r
 \r
 <p class="whs2">algo = hexa.Segment(wire)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># define &quot;NumberOfSegments&quot; \r
- hypothesis to cut an edge in a fixed number of segments</p>\r
+<p class="whs3"># define &quot;NumberOfSegments&quot;hypothesis to cut\r
+a straight edge in a fixed number of segments</p>\r
 \r
 <p class="whs2">algo.NumberOfSegments(6)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># define &quot;Deflection1D&quot; \r
- hypothesis</p>\r
+<p class="whs3"># define a local &quot;Deflection1D&quot;hypothesis on the arc</p>\r
 \r
+<p class="whs2">algo = hexa.Segment(arc)</p>\r
 <p class="whs2">algo.Deflection1D(1)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
index b6367b7..7880020 100644 (file)
@@ -286,6 +286,20 @@ module StdMeshers
   {
   };
 
+  /*!
+   * StdMeshers_QuadraticMesh: interface of "QuadraticMesh" hypothesis.
+   * This is an auxiliary 1D hypothesis whose presence forces construction 
+   * of quadratic edges.
+   * If the 2D mesher sees that all boundary edges are quadratic ones,
+   * it generates quadratic faces, else it generates linear faces using
+   * medium nodes as if they were vertex ones.
+   * The 3D mesher generates quadratic volumes only if all boundary faces
+   * are quadratic ones, else it fails.
+   */
+  interface StdMeshers_QuadraticMesh : SMESH::SMESH_Hypothesis
+  {
+  };
+
 
   /*!
    * StdMeshers_Regular_1D: interface of "Wire discretisation" algorithm
index bc6edfb..ee234b9 100644 (file)
@@ -60,6 +60,16 @@ module SMESH
     SMESH_Pattern GetPattern();
 
     /*!
+      Set the current mode
+     */
+    void SetEmbeddedMode( in boolean theMode );
+
+    /*!
+      Get the current mode
+     */
+    boolean IsEmbeddedMode();
+
+    /*!
       Set the current study
      */
     void SetCurrentStudy( in SALOMEDS::Study theStudy );
index 3765767..3cbb606 100644 (file)
@@ -84,6 +84,16 @@ module SMESH
      * Returns the mesh object this group belongs to
      */
     SMESH_Mesh GetMesh();
+
+    /*!
+     * Sets group color number
+     */
+    void SetColorNumber( in long color );
+
+    /*!
+     * Returns group color number
+     */
+    long GetColorNumber();
   }; 
 
   /*!
index 1fe2f2d..4b7b547 100644 (file)
@@ -69,7 +69,14 @@ module SMESH
       MOVE_NODE,
       CHANGE_ELEMENT_NODES,
       CHANGE_POLYHEDRON_NODES,
-      RENUMBER
+      RENUMBER,
+      ADD_QUADEDGE,
+      ADD_QUADTRIANGLE,
+      ADD_QUADQUADRANGLE,
+      ADD_QUADTETRAHEDRON,
+      ADD_QUADPYRAMID,
+      ADD_QUADPENTAHEDRON,
+      ADD_QUADHEXAHEDRON
     };
 
   struct log_block
@@ -119,7 +126,8 @@ module SMESH
     HYP_INCOMPATIBLE, // hypothesis does not fit algo
     HYP_NOTCONFORM,   // not conform mesh is produced appling a hypothesis
     HYP_ALREADY_EXIST,// such hypothesis already exist
-    HYP_BAD_DIM       // bad dimension
+    HYP_BAD_DIM,      // bad dimension
+    HYP_BAD_SUBSHAPE  // shape is neither the main one, nor its subshape, nor a group
   };
 
   /*!
@@ -335,6 +343,11 @@ module SMESH
     SMESH_MeshEditor GetMeshEditor()
       raises (SALOME::SALOME_Exception);
 
+    /*! Check group names for duplications.
+     *  Consider maximum group name length stored in MED file.
+     */
+    boolean HasDuplicatedGroupNamesMED();
+
     /*!
      * Export Mesh to different MED Formats
      * @params
@@ -434,6 +447,12 @@ module SMESH
      * Get mesh description
      */
     string Dump();
+
+    /*!
+     * Get mesh pointer
+     */
+    long GetMeshPtr();
+
   };
 
   interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
@@ -514,6 +533,8 @@ module SMESH
 
     boolean AddFace(in long_array IDsOfNodes);
 
+    boolean AddPolygonalFace(in long_array IdsOfNodes);
+
     boolean AddVolume(in long_array IDsOfNodes);
 
     /*!
index 2c1cd12..6daf062 100644 (file)
                 icon-id="mesh_algo_quad.png"
                 dim="2"/>
 
+    <hypothesis type="QuadraticMesh"
+                label-id="Quadratic Mesh"
+                icon-id="mesh_algo_quad.png"
+                dim="1"
+                auxiliary="true"/>                
+
     <hypothesis type="MaxElementArea"
                 label-id="Max. Element Area"
                 icon-id="mesh_hypo_area.png"
diff --git a/resources/mesh_quad_edge.png b/resources/mesh_quad_edge.png
new file mode 100644 (file)
index 0000000..184498a
Binary files /dev/null and b/resources/mesh_quad_edge.png differ
diff --git a/resources/mesh_quad_hexahedron.png b/resources/mesh_quad_hexahedron.png
new file mode 100644 (file)
index 0000000..d7dcfb2
Binary files /dev/null and b/resources/mesh_quad_hexahedron.png differ
diff --git a/resources/mesh_quad_pentahedron.png b/resources/mesh_quad_pentahedron.png
new file mode 100644 (file)
index 0000000..1a5f7d8
Binary files /dev/null and b/resources/mesh_quad_pentahedron.png differ
diff --git a/resources/mesh_quad_pyramid.png b/resources/mesh_quad_pyramid.png
new file mode 100644 (file)
index 0000000..2de8673
Binary files /dev/null and b/resources/mesh_quad_pyramid.png differ
diff --git a/resources/mesh_quad_quadrangle.png b/resources/mesh_quad_quadrangle.png
new file mode 100644 (file)
index 0000000..ebab66c
Binary files /dev/null and b/resources/mesh_quad_quadrangle.png differ
diff --git a/resources/mesh_quad_tetrahedron.png b/resources/mesh_quad_tetrahedron.png
new file mode 100644 (file)
index 0000000..d9c2dae
Binary files /dev/null and b/resources/mesh_quad_tetrahedron.png differ
diff --git a/resources/mesh_quad_triangle.png b/resources/mesh_quad_triangle.png
new file mode 100644 (file)
index 0000000..d617c4e
Binary files /dev/null and b/resources/mesh_quad_triangle.png differ
index 717f8e6..c00cbae 100644 (file)
@@ -46,6 +46,8 @@
 #include "SMDS_MeshElement.hxx"
 #include "SMDS_MeshNode.hxx"
 #include "SMDS_VolumeTool.hxx"
+#include "SMDS_QuadraticFaceOfNodes.hxx"
+#include "SMDS_QuadraticEdge.hxx"
 
 
 /*
@@ -87,32 +89,69 @@ namespace{
       return 0;
 
     const SMDS_MeshElement* anEdge = theMesh->FindElement( theId );
-    if ( anEdge == 0 || anEdge->GetType() != SMDSAbs_Edge || anEdge->NbNodes() != 2 )
+    if ( anEdge == 0 || anEdge->GetType() != SMDSAbs_Edge/* || anEdge->NbNodes() != 2 */)
       return 0;
 
-    TColStd_MapOfInteger aMap;
-
-    int aResult = 0;
-    SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator();
-    if ( anIter != 0 ) {
-      while( anIter->more() ) {
-       const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
-       if ( aNode == 0 )
-         return 0;
-       SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
-       while( anElemIter->more() ) {
-         const SMDS_MeshElement* anElem = anElemIter->next();
-         if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) {
-           int anId = anElem->GetID();
-
-           if ( anIter->more() )              // i.e. first node
-             aMap.Add( anId );
-           else if ( aMap.Contains( anId ) )
-             aResult++;
-         }
-       }
+    // for each pair of nodes in anEdge (there are 2 pairs in a quadratic edge)
+    // count elements containing both nodes of the pair.
+    // Note that there may be such cases for a quadratic edge (a horizontal line):
+    //
+    //  Case 1          Case 2
+    //  |     |      |        |      |
+    //  |     |      |        |      |
+    //  +-----+------+  +-----+------+ 
+    //  |            |  |            |
+    //  |            |  |            |
+    // result sould be 2 in both cases
+    //
+    int aResult0 = 0, aResult1 = 0;
+     // last node, it is a medium one in a quadratic edge
+    const SMDS_MeshNode* aLastNode = anEdge->GetNode( anEdge->NbNodes() - 1 );
+    const SMDS_MeshNode* aNode0 = anEdge->GetNode( 0 );
+    const SMDS_MeshNode* aNode1 = anEdge->GetNode( 1 );
+    if ( aNode1 == aLastNode ) aNode1 = 0;
+
+    SMDS_ElemIteratorPtr anElemIter = aLastNode->GetInverseElementIterator();
+    while( anElemIter->more() ) {
+      const SMDS_MeshElement* anElem = anElemIter->next();
+      if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) {
+        SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
+        while ( anIter->more() ) {
+          if ( const SMDS_MeshElement* anElemNode = anIter->next() ) {
+            if ( anElemNode == aNode0 ) {
+              aResult0++;
+              if ( !aNode1 ) break; // not a quadratic edge
+            }
+            else if ( anElemNode == aNode1 )
+              aResult1++;
+          }
+        }
       }
     }
+    int aResult = max ( aResult0, aResult1 );
+
+//     TColStd_MapOfInteger aMap;
+
+//     SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator();
+//     if ( anIter != 0 ) {
+//       while( anIter->more() ) {
+//     const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
+//     if ( aNode == 0 )
+//       return 0;
+//     SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
+//     while( anElemIter->more() ) {
+//       const SMDS_MeshElement* anElem = anElemIter->next();
+//       if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) {
+//         int anId = anElem->GetID();
+
+//         if ( anIter->more() )              // i.e. first node
+//           aMap.Add( anId );
+//         else if ( aMap.Contains( anId ) )
+//           aResult++;
+//       }
+//     }
+//       }
+//     }
 
     return aResult;
   }
@@ -154,23 +193,41 @@ bool NumericalFunctor::GetPoints(const int theId,
 }
 
 bool NumericalFunctor::GetPoints(const SMDS_MeshElement* anElem,
-                                 TSequenceOfXYZ& theRes )
+                                 TSequenceOfXYZ&         theRes )
 {
   theRes.clear();
 
   if ( anElem == 0)
     return false;
 
+  theRes.reserve( anElem->NbNodes() );
+
   // Get nodes of the element
-  SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
-  if ( anIter != 0 )
-  {
-    while( anIter->more() )
-    {
-      const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
-      if ( aNode != 0 ){
+  SMDS_ElemIteratorPtr anIter;
+
+  if ( anElem->IsQuadratic() ) {
+    switch ( anElem->GetType() ) {
+    case SMDSAbs_Edge:
+      anIter = static_cast<const SMDS_QuadraticEdge*>
+        (anElem)->interlacedNodesElemIterator();
+      break;
+    case SMDSAbs_Face:
+      anIter = static_cast<const SMDS_QuadraticFaceOfNodes*>
+        (anElem)->interlacedNodesElemIterator();
+      break;
+    default:
+      anIter = anElem->nodesIterator();
+      //return false;
+    }
+  }
+  else {
+    anIter = anElem->nodesIterator();
+  }
+
+  if ( anIter ) {
+    while( anIter->more() ) {
+      if ( const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>( anIter->next() ))
         theRes.push_back( gp_XYZ( aNode->X(), aNode->Y(), aNode->Z() ) );
-      }
     }
   }
 
@@ -285,6 +342,7 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
   // According to "Mesh quality control" by Nadir Bouhamau referring to
   // Pascal Jean Frey and Paul-Louis George. Maillages, applications aux elements finis.
   // Hermes Science publications, Paris 1999 ISBN 2-7462-0024-4
+  // PAL10872
 
   int nbNodes = P.size();
 
@@ -840,22 +898,21 @@ SMDSAbs_ElementType Skew::GetType() const
 */
 double Area::GetValue( const TSequenceOfXYZ& P )
 {
-  double aArea = 0;
-  if ( P.size() == 3 )
-    return getArea( P( 1 ), P( 2 ), P( 3 ) );
-  else if (P.size() > 3)
-    aArea = getArea( P( 1 ), P( 2 ), P( 3 ) );
-  else
-    return 0;
-
-  for (int i=4; i<=P.size(); i++)
-    aArea += getArea(P(1),P(i-1),P(i));
-  return aArea;
+  gp_Vec aVec1( P(2) - P(1) );
+  gp_Vec aVec2( P(3) - P(1) );
+  gp_Vec SumVec = aVec1 ^ aVec2;
+  for (int i=4; i<=P.size(); i++) {
+    gp_Vec aVec1( P(i-1) - P(1) );
+    gp_Vec aVec2( P(i) - P(1) );
+    gp_Vec tmp = aVec1 ^ aVec2;
+    SumVec.Add(tmp);
+  }
+  return SumVec.Magnitude() * 0.5;
 }
 
 double Area::GetBadRate( double Value, int /*nbNodes*/ ) const
 {
-  // meaningless as it is not quality control functor
+  // meaningless as it is not quality control functor
   return Value;
 }
 
@@ -871,7 +928,11 @@ SMDSAbs_ElementType Area::GetType() const
 */
 double Length::GetValue( const TSequenceOfXYZ& P )
 {
-  return ( P.size() == 2 ? getDistance( P( 1 ), P( 2 ) ) : 0 );
+  switch ( P.size() ) {
+  case 2:  return getDistance( P( 1 ), P( 2 ) );
+  case 3:  return getDistance( P( 1 ), P( 2 ) ) + getDistance( P( 2 ), P( 3 ) );
+  default: return 0.;
+  }
 }
 
 double Length::GetBadRate( double Value, int /*nbNodes*/ ) const
@@ -894,7 +955,10 @@ double Length2D::GetValue( long theElementId)
 {
   TSequenceOfXYZ P;
 
+  //cout<<"Length2D::GetValue"<<endl;
   if (GetPoints(theElementId,P)){
+    //for(int jj=1; jj<=P.size(); jj++)
+    //  cout<<"jj="<<jj<<" P("<<P(jj).X()<<","<<P(jj).Y()<<","<<P(jj).Z()<<")"<<endl;
 
     double  aVal;// = GetValue( P );
     const SMDS_MeshElement* aElem = myMesh->FindElement( theElementId );
@@ -908,7 +972,11 @@ double Length2D::GetValue( long theElementId)
     case SMDSAbs_Edge:
       if (len == 2){
        aVal = getDistance( P( 1 ), P( 2 ) );
-       break;
+        break;
+      }
+      else if (len == 3){ // quadratic edge
+       aVal = getDistance(P( 1 ),P( 3 )) + getDistance(P( 3 ),P( 2 ));
+        break;
       }
     case SMDSAbs_Face:
       if (len == 3){ // triangles
@@ -926,6 +994,22 @@ double Length2D::GetValue( long theElementId)
        aVal = Max(Max(L1,L2),Max(L3,L4));
        break;
       }
+      if (len == 6){ // quadratic triangles
+       double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
+       double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
+       double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 ));
+       aVal = Max(L1,Max(L2,L3));
+        //cout<<"L1="<<L1<<" L2="<<L2<<"L3="<<L3<<" aVal="<<aVal<<endl;
+       break;
+      }
+      else if (len == 8){ // quadratic quadrangles
+       double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
+       double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
+       double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 7 ));
+       double L4 = getDistance(P( 7 ),P( 8 )) + getDistance(P( 8 ),P( 1 ));
+       aVal = Max(Max(L1,L2),Max(L3,L4));
+       break;
+      }
     case SMDSAbs_Volume:
       if (len == 4){ // tetraidrs
        double L1 = getDistance(P( 1 ),P( 2 ));
@@ -987,6 +1071,63 @@ double Length2D::GetValue( long theElementId)
 
       }
 
+      if (len == 10){ // quadratic tetraidrs
+       double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 ));
+       double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 ));
+       double L3 = getDistance(P( 3 ),P( 7 )) + getDistance(P( 7 ),P( 1 ));
+       double L4 = getDistance(P( 1 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
+       double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 ));
+       double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 ));
+       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+       break;
+      }
+      else if (len == 13){ // quadratic piramids
+       double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 ));
+       double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 ));
+       double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 1 ));
+       double L4 = getDistance(P( 4 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
+       double L5 = getDistance(P( 1 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
+       double L6 = getDistance(P( 2 ),P( 11 )) + getDistance(P( 11 ),P( 5 ));
+       double L7 = getDistance(P( 3 ),P( 12 )) + getDistance(P( 12 ),P( 5 ));
+       double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 ));
+       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+       aVal = Max(aVal,Max(L7,L8));
+       break;
+      }
+      else if (len == 15){ // quadratic pentaidres
+       double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 ));
+       double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 ));
+       double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
+       double L4 = getDistance(P( 4 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
+       double L5 = getDistance(P( 5 ),P( 11 )) + getDistance(P( 11 ),P( 6 ));
+       double L6 = getDistance(P( 6 ),P( 12 )) + getDistance(P( 12 ),P( 4 ));
+       double L7 = getDistance(P( 1 ),P( 13 )) + getDistance(P( 13 ),P( 4 ));
+       double L8 = getDistance(P( 2 ),P( 14 )) + getDistance(P( 14 ),P( 5 ));
+       double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 ));
+       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+       aVal = Max(aVal,Max(Max(L7,L8),L9));
+       break;
+      }
+      else if (len == 20){ // quadratic hexaider
+       double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 ));
+       double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 ));
+       double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 ));
+       double L4 = getDistance(P( 4 ),P( 12 )) + getDistance(P( 12 ),P( 1 ));
+       double L5 = getDistance(P( 5 ),P( 13 )) + getDistance(P( 13 ),P( 6 ));
+       double L6 = getDistance(P( 6 ),P( 14 )) + getDistance(P( 14 ),P( 7 ));
+       double L7 = getDistance(P( 7 ),P( 15 )) + getDistance(P( 15 ),P( 8 ));
+       double L8 = getDistance(P( 8 ),P( 16 )) + getDistance(P( 16 ),P( 5 ));
+       double L9 = getDistance(P( 1 ),P( 17 )) + getDistance(P( 17 ),P( 5 ));
+       double L10= getDistance(P( 2 ),P( 18 )) + getDistance(P( 18 ),P( 6 ));
+       double L11= getDistance(P( 3 ),P( 19 )) + getDistance(P( 19 ),P( 7 ));
+       double L12= getDistance(P( 4 ),P( 20 )) + getDistance(P( 20 ),P( 8 ));
+       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+       aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10)));
+       aVal = Max(aVal,Max(L11,L12));
+       break;
+
+      }
+
     default: aVal=-1;
     }
 
@@ -1038,38 +1179,81 @@ void Length2D::GetValues(TValues& theValues){
   SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
   for(; anIter->more(); ){
     const SMDS_MeshFace* anElem = anIter->next();
-    SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
-    long aNodeId[2];
-    gp_Pnt P[3];
 
-    double aLength;
-    const SMDS_MeshElement* aNode;
-    if(aNodesIter->more()){
-      aNode = aNodesIter->next();
-      const SMDS_MeshNode* aNodes = (SMDS_MeshNode*) aNode;
-      P[0] = P[1] = gp_Pnt(aNodes->X(),aNodes->Y(),aNodes->Z());
-      aNodeId[0] = aNodeId[1] = aNode->GetID();
-      aLength = 0;
-    }
-    for(; aNodesIter->more(); ){
-      aNode = aNodesIter->next();
-      const SMDS_MeshNode* aNodes = (SMDS_MeshNode*) aNode;
-      long anId = aNode->GetID();
-
-      P[2] = gp_Pnt(aNodes->X(),aNodes->Y(),aNodes->Z());
+    if(anElem->IsQuadratic()) {
+      const SMDS_QuadraticFaceOfNodes* F =
+        static_cast<const SMDS_QuadraticFaceOfNodes*>(anElem);
+      // use special nodes iterator
+      SMDS_NodeIteratorPtr anIter = F->interlacedNodesIterator();
+      long aNodeId[4];
+      gp_Pnt P[4];
+
+      double aLength;
+      const SMDS_MeshElement* aNode;
+      if(anIter->more()){
+        aNode = anIter->next();
+        const SMDS_MeshNode* aNodes = (SMDS_MeshNode*) aNode;
+        P[0] = P[1] = gp_Pnt(aNodes->X(),aNodes->Y(),aNodes->Z());
+        aNodeId[0] = aNodeId[1] = aNode->GetID();
+        aLength = 0;
+      }
+      for(; anIter->more(); ){
+        const SMDS_MeshNode* N1 = static_cast<const SMDS_MeshNode*> (anIter->next());
+        P[2] = gp_Pnt(N1->X(),N1->Y(),N1->Z());
+        aNodeId[2] = N1->GetID();
+        aLength = P[1].Distance(P[2]);
+        if(!anIter->more()) break;
+        const SMDS_MeshNode* N2 = static_cast<const SMDS_MeshNode*> (anIter->next());
+        P[3] = gp_Pnt(N2->X(),N2->Y(),N2->Z());
+        aNodeId[3] = N2->GetID();
+        aLength += P[2].Distance(P[3]);
+        Value aValue1(aLength,aNodeId[1],aNodeId[2]);
+        Value aValue2(aLength,aNodeId[2],aNodeId[3]);
+        P[1] = P[3];
+        aNodeId[1] = aNodeId[3];
+        theValues.insert(aValue1);
+        theValues.insert(aValue2);
+      }
+      aLength += P[2].Distance(P[0]);
+      Value aValue1(aLength,aNodeId[1],aNodeId[2]);
+      Value aValue2(aLength,aNodeId[2],aNodeId[0]);
+      theValues.insert(aValue1);
+      theValues.insert(aValue2);
+    }
+    else {
+      SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
+      long aNodeId[2];
+      gp_Pnt P[3];
+
+      double aLength;
+      const SMDS_MeshElement* aNode;
+      if(aNodesIter->more()){
+        aNode = aNodesIter->next();
+        const SMDS_MeshNode* aNodes = (SMDS_MeshNode*) aNode;
+        P[0] = P[1] = gp_Pnt(aNodes->X(),aNodes->Y(),aNodes->Z());
+        aNodeId[0] = aNodeId[1] = aNode->GetID();
+        aLength = 0;
+      }
+      for(; aNodesIter->more(); ){
+        aNode = aNodesIter->next();
+        const SMDS_MeshNode* aNodes = (SMDS_MeshNode*) aNode;
+        long anId = aNode->GetID();
+        
+        P[2] = gp_Pnt(aNodes->X(),aNodes->Y(),aNodes->Z());
+        
+        aLength = P[1].Distance(P[2]);
+        
+        Value aValue(aLength,aNodeId[1],anId);
+        aNodeId[1] = anId;
+        P[1] = P[2];
+        theValues.insert(aValue);
+      }
 
-      aLength = P[1].Distance(P[2]);
+      aLength = P[0].Distance(P[1]);
 
-      Value aValue(aLength,aNodeId[1],anId);
-      aNodeId[1] = anId;
-      P[1] = P[2];
+      Value aValue(aLength,aNodeId[0],aNodeId[1]);
       theValues.insert(aValue);
     }
-
-    aLength = P[0].Distance(P[1]);
-
-    Value aValue(aLength,aNodeId[0],aNodeId[1]);
-    theValues.insert(aValue);
   }
 }
 
@@ -1194,7 +1378,12 @@ void MultiConnection2D::GetValues(MValues& theValues){
   SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
   for(; anIter->more(); ){
     const SMDS_MeshFace* anElem = anIter->next();
-    SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
+    SMDS_ElemIteratorPtr aNodesIter;
+    if ( anElem->IsQuadratic() )
+      aNodesIter = static_cast<const SMDS_QuadraticFaceOfNodes*>
+        (anElem)->interlacedNodesElemIterator();
+    else
+      aNodesIter = anElem->nodesIterator();
     long aNodeId[3];
 
     //int aNbConnects=0;
@@ -1207,7 +1396,7 @@ void MultiConnection2D::GetValues(MValues& theValues){
       const SMDS_MeshNode* aNodes = (SMDS_MeshNode*) aNode1;
       aNodeId[0] = aNodeId[1] = aNodes->GetID();
     }
-    for(; aNodesIter->more(); ){
+    for(; aNodesIter->more(); ) {
       aNode2 = (SMDS_MeshNode*) aNodesIter->next();
       long anId = aNode2->GetID();
       aNodeId[2] = anId;
@@ -1217,7 +1406,8 @@ void MultiConnection2D::GetValues(MValues& theValues){
       if (aItr != theValues.end()){
        aItr->second += 1;
        //aNbConnects = nb;
-      } else {
+      }
+      else {
        theValues[aValue] = 1;
        //aNbConnects = 1;
       }
@@ -1227,10 +1417,11 @@ void MultiConnection2D::GetValues(MValues& theValues){
     }
     Value aValue(aNodeId[0],aNodeId[2]);
     MValues::iterator aItr = theValues.find(aValue);
-    if (aItr != theValues.end()){
+    if (aItr != theValues.end()) {
       aItr->second += 1;
       //aNbConnects = nb;
-    } else {
+    }
+    else {
       theValues[aValue] = 1;
       //aNbConnects = 1;
     }
@@ -1346,41 +1537,33 @@ bool FreeEdges::IsSatisfy( long theId )
   if ( aFace == 0 || aFace->GetType() != SMDSAbs_Face || aFace->NbNodes() < 3 )
     return false;
 
-  int nbNodes = aFace->NbNodes();
-  //const SMDS_MeshNode* aNodes[ nbNodes ];
-#ifndef WNT
-  const SMDS_MeshNode* aNodes [nbNodes];
-#else
-  const SMDS_MeshNode** aNodes = (const SMDS_MeshNode **)new SMDS_MeshNode*[nbNodes];
-#endif
-  int i = 0;
-  SMDS_ElemIteratorPtr anIter = aFace->nodesIterator();
+  SMDS_ElemIteratorPtr anIter;
+  if ( aFace->IsQuadratic() ) {
+    anIter = static_cast<const SMDS_QuadraticFaceOfNodes*>
+      (aFace)->interlacedNodesElemIterator();
+  }
+  else {
+    anIter = aFace->nodesIterator();
+  }
   if ( anIter != 0 )
+    return false;
+
+  int i = 0, nbNodes = aFace->NbNodes();
+  vector <const SMDS_MeshNode*> aNodes( nbNodes+1 );
+  while( anIter->more() )
   {
-    while( anIter->more() )
-    {
-      const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
-      if ( aNode == 0 )
-        return false;
-      aNodes[ i++ ] = aNode;
-    }
+    const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
+    if ( aNode == 0 )
+      return false;
+    aNodes[ i++ ] = aNode;
   }
+  aNodes[ nbNodes ] = aNodes[ 0 ];
 
-  for ( int i = 0; i < nbNodes - 1; i++ )
-         if ( IsFreeEdge( &aNodes[ i ], theId ) ) {
-#ifdef WNT
-               delete [] aNodes;
-#endif
+  for ( i = 0; i < nbNodes; i++ )
+    if ( IsFreeEdge( &aNodes[ i ], theId ) )
       return true;
-         }
 
-  aNodes[ 1 ] = aNodes[ nbNodes - 1 ];
-  const Standard_Boolean isFree = IsFreeEdge( &aNodes[ 0 ], theId );
-#ifdef WNT
-               delete [] aNodes;
-#endif
-//  return 
- return isFree;
+  return false;
 }
 
 SMDSAbs_ElementType FreeEdges::GetType() const
@@ -1423,7 +1606,12 @@ void FreeEdges::GetBoreders(TBorders& theBorders)
   for(; anIter->more(); ){
     const SMDS_MeshFace* anElem = anIter->next();
     long anElemId = anElem->GetID();
-    SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
+    SMDS_ElemIteratorPtr aNodesIter;
+    if ( anElem->IsQuadratic() )
+      aNodesIter = static_cast<const SMDS_QuadraticFaceOfNodes*>(anElem)->
+        interlacedNodesElemIterator();
+    else
+      aNodesIter = anElem->nodesIterator();
     long aNodeId[2];
     const SMDS_MeshElement* aNode;
     if(aNodesIter->more()){
@@ -2088,8 +2276,7 @@ static gp_XYZ getNormale( const SMDS_MeshFace* theFace )
   TColgp_Array1OfXYZ anArrOfXYZ(1,4);
   SMDS_ElemIteratorPtr aNodeItr = theFace->nodesIterator();
   int i = 1;
-  for ( ; aNodeItr->more() && i <= 4; i++ )
-  {
+  for ( ; aNodeItr->more() && i <= 4; i++ ) {
     SMDS_MeshNode* aNode = (SMDS_MeshNode*)aNodeItr->next();
     anArrOfXYZ.SetValue(i, gp_XYZ( aNode->X(), aNode->Y(), aNode->Z() ) );
   }
@@ -2097,8 +2284,7 @@ static gp_XYZ getNormale( const SMDS_MeshFace* theFace )
   gp_XYZ q1 = anArrOfXYZ.Value(2) - anArrOfXYZ.Value(1);
   gp_XYZ q2 = anArrOfXYZ.Value(3) - anArrOfXYZ.Value(1);
   n  = q1 ^ q2;
-  if ( aNbNode > 3 )
-  {
+  if ( aNbNode > 3 ) {
     gp_XYZ q3 = anArrOfXYZ.Value(4) - anArrOfXYZ.Value(1);
     n += q2 ^ q3;
   }
index 1f8d5ab..a54156d 100644 (file)
@@ -32,7 +32,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
   Status aResult = DRS_OK;
 
   int nbNodes, nbCells;
-  int i;
+  //int i;
   
   char *file2Read = (char *)myFile.c_str();
   FILE* aFileId = fopen(file2Read, "w+");
@@ -52,7 +52,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
   nbNodes = myMesh->NbNodes();
   
   /* Combien de mailles, faces ou aretes ? */
-  int nb_of_nodes, nb_of_edges, nb_of_faces, nb_of_volumes;
+  int /*nb_of_nodes,*/ nb_of_edges, nb_of_faces, nb_of_volumes;
   nb_of_edges = myMesh->NbEdges();
   nb_of_faces = myMesh->NbFaces();
   nb_of_volumes = myMesh->NbVolumes();
index 47a923d..0da2c4c 100644 (file)
@@ -34,20 +34,118 @@ using namespace std;
 
 //=============================================================================
 /*!
+ *  Default constructor
+ */
+//=============================================================================
+DriverMED_Family
+::DriverMED_Family():
+  myGroupAttributVal(0)
+{}
+
+
+//=============================================================================
+const ElementsSet& 
+DriverMED_Family
+::GetElements () const 
+{ 
+  return myElements; 
+}
+
+int 
+DriverMED_Family
+::GetId () const 
+{ 
+  return myId; 
+}
+
+void 
+DriverMED_Family
+::SetId (const int theId) 
+{ 
+  myId = theId; 
+}
+
+void
+DriverMED_Family
+::AddElement(const SMDS_MeshElement* theElement)
+{
+  myElements.insert(theElement); 
+}
+
+void
+DriverMED_Family
+::AddGroupName(std::string theGroupName)
+{
+  myGroupNames.insert(theGroupName); 
+}
+
+void
+DriverMED_Family
+::SetType(const SMDSAbs_ElementType theType) 
+{ 
+  myType = theType; 
+}
+
+SMDSAbs_ElementType
+DriverMED_Family
+::GetType()
+{
+  return myType; 
+}
+
+bool
+DriverMED_Family
+::MemberOf(std::string theGroupName) const
+{ 
+  return myGroupNames.find(theGroupName) != myGroupNames.end(); 
+}
+
+const MED::TStringSet& 
+DriverMED_Family
+::GetGroupNames () const 
+{ 
+  return myGroupNames; 
+}
+
+
+int 
+DriverMED_Family
+::GetGroupAttributVal() const 
+{
+  return myGroupAttributVal;
+} 
+
+void
+DriverMED_Family
+::SetGroupAttributVal( int theValue) 
+{
+  myGroupAttributVal = theValue;
+}
+
+bool
+DriverMED_Family
+::IsEmpty () const 
+{ 
+  return myElements.empty(); 
+}
+
+//=============================================================================
+/*!
  *  Split each group from list <aGroups> on some parts (families)
  *  on the basis of the elements membership in other groups from this list.
  *  Resulting families have no common elements.
  */
 //=============================================================================
-list<DriverMED_FamilyPtr> DriverMED_Family::MakeFamilies
-                         (const map <int, SMESHDS_SubMesh*>& theSubMeshes,
-                          const list<SMESHDS_GroupBase*>& theGroups,
-                          const bool doGroupOfNodes,
-                          const bool doGroupOfEdges,
-                          const bool doGroupOfFaces,
-                          const bool doGroupOfVolumes)
+DriverMED_FamilyPtrList 
+DriverMED_Family
+::MakeFamilies(const SMESHDS_SubMeshPtrMap& theSubMeshes,
+              const SMESHDS_GroupBasePtrList& theGroups,
+              const bool doGroupOfNodes,
+              const bool doGroupOfEdges,
+              const bool doGroupOfFaces,
+              const bool doGroupOfVolumes)
 {
-  list<DriverMED_FamilyPtr> aFamilies;
+  DriverMED_FamilyPtrList aFamilies;
 
   string anAllNodesGroupName = "Group_Of_All_Nodes";
   string anAllEdgesGroupName = "Group_Of_All_Edges";
@@ -61,22 +159,23 @@ list<DriverMED_FamilyPtr> DriverMED_Family::MakeFamilies
   int aElemFamId = FIRST_ELEM_FAMILY;
 
   // Process sub-meshes
-  map<int, SMESHDS_SubMesh*>::const_iterator aSMIter = theSubMeshes.begin();
+  SMESHDS_SubMeshPtrMap::const_iterator aSMIter = theSubMeshes.begin();
   for (; aSMIter != theSubMeshes.end(); aSMIter++)
   {
-    if ( aSMIter->second->IsComplexSubmesh() )
+    const int anId = aSMIter->first;
+    SMESHDS_SubMesh* aSubMesh = aSMIter->second;
+    if ( aSubMesh->IsComplexSubmesh() )
       continue; // submesh containing other submeshs
-    list<DriverMED_FamilyPtr> aSMFams = SplitByType((*aSMIter).second, (*aSMIter).first);
-    list<DriverMED_FamilyPtr>::iterator aSMFamsIter = aSMFams.begin();
+    DriverMED_FamilyPtrList aSMFams = SplitByType(aSubMesh,anId);
+    DriverMED_FamilyPtrList::iterator aSMFamsIter = aSMFams.begin();
     for (; aSMFamsIter != aSMFams.end(); aSMFamsIter++)
     {
       DriverMED_FamilyPtr aFam2 = (*aSMFamsIter);
-
-      list<DriverMED_FamilyPtr>::iterator aFamsIter = aFamilies.begin();
+      DriverMED_FamilyPtrList::iterator aFamsIter = aFamilies.begin();
       while (aFamsIter != aFamilies.end())
       {
         DriverMED_FamilyPtr aFam1 = *aFamsIter;
-        list<DriverMED_FamilyPtr>::iterator aCurrIter = aFamsIter++;
+        DriverMED_FamilyPtrList::iterator aCurrIter = aFamsIter++;
         if (aFam1->myType == aFam2->myType)
         {
           DriverMED_FamilyPtr aCommon (new DriverMED_Family);
@@ -89,7 +188,8 @@ list<DriverMED_FamilyPtr> DriverMED_Family::MakeFamilies
           {
             aFamilies.erase(aCurrIter);
           }
-          if (aFam2->IsEmpty()) break;
+          if (aFam2->IsEmpty()) 
+           break;
         }
       }
       // The rest elements of family
@@ -101,30 +201,32 @@ list<DriverMED_FamilyPtr> DriverMED_Family::MakeFamilies
   }
 
   // Process groups
-  list<SMESHDS_GroupBase*>::const_iterator aGroupsIter = theGroups.begin();
+  SMESHDS_GroupBasePtrList::const_iterator aGroupsIter = theGroups.begin();
   for (; aGroupsIter != theGroups.end(); aGroupsIter++)
   {
     DriverMED_FamilyPtr aFam2 (new DriverMED_Family);
     aFam2->Init(*aGroupsIter);
 
-    list<DriverMED_FamilyPtr>::iterator aFamsIter = aFamilies.begin();
+    DriverMED_FamilyPtrList::iterator aFamsIter = aFamilies.begin();
     while (aFamsIter != aFamilies.end())
     {
       DriverMED_FamilyPtr aFam1 = *aFamsIter;
-      list<DriverMED_FamilyPtr>::iterator aCurrIter = aFamsIter++;
+      DriverMED_FamilyPtrList::iterator aCurrIter = aFamsIter++;
       if (aFam1->myType == aFam2->myType)
       {
         DriverMED_FamilyPtr aCommon (new DriverMED_Family);
         aFam1->Split(aFam2, aCommon);
         if (!aCommon->IsEmpty())
         {
+         aCommon->SetGroupAttributVal(0);
           aFamilies.push_back(aCommon);
         }
         if (aFam1->IsEmpty())
         {
           aFamilies.erase(aCurrIter);
         }
-        if (aFam2->IsEmpty()) break;
+        if (aFam2->IsEmpty()) 
+         break;
       }
     }
     // The rest elements of group
@@ -134,7 +236,7 @@ list<DriverMED_FamilyPtr> DriverMED_Family::MakeFamilies
     }
   }
 
-  list<DriverMED_FamilyPtr>::iterator aFamsIter = aFamilies.begin();
+  DriverMED_FamilyPtrList::iterator aFamsIter = aFamilies.begin();
   for (; aFamsIter != aFamilies.end(); aFamsIter++)
   {
     DriverMED_FamilyPtr aFam = *aFamsIter;
@@ -210,33 +312,33 @@ MED::PFamilyInfo
 DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper, 
                                const MED::PMeshInfo& theMeshInfo) const
 {
-  string aValue;
-
   ostringstream aStr;
-
   aStr << "FAM_" << myId;
   set<string>::const_iterator aGrIter = myGroupNames.begin();
-  for (; aGrIter != myGroupNames.end(); aGrIter++)
-  {
+  for(; aGrIter != myGroupNames.end(); aGrIter++){
     aStr << "_" << *aGrIter;
   }
 
-  aValue = aStr.str();
-  /*
-  MED::TStringVector anAttrDescs (1, "");  // 1 attribute with empty description,
-  MED::TIntVector anAttrIds (1, myId);        // Id=0,
-  MED::TIntVector anAttrVals (1, myId);       // Value=0
-  */
-  
-  MED::PFamilyInfo anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
-                                                    aValue,
-                                                    myId,
-                                                    myGroupNames);
-/*                                                  
-                                                   anAttrDescs,
-                                                   anAttrIds,
-                                                   anAttrVals);
-*/
+  MED::PFamilyInfo anInfo;
+  string aValue = aStr.str();
+  if(myId == 0){
+    anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
+                                     aValue,
+                                     myId,
+                                     myGroupNames);
+  }else{
+    MED::TStringVector anAttrDescs (1, "");  // 1 attribute with empty description,
+    MED::TIntVector anAttrIds (1, myId);        // Id=0,
+    MED::TIntVector anAttrVals (1);
+    anAttrVals[0] = myGroupAttributVal != 0? myGroupAttributVal: myId;
+    anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
+                                     aValue,
+                                     myId,
+                                     myGroupNames,
+                                     anAttrDescs,
+                                     anAttrIds,
+                                     anAttrVals);
+  }
 
 //  cout << endl;
 //  cout << "Groups: ";
@@ -279,6 +381,14 @@ void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup)
   // Groups list
   myGroupNames.clear();
   myGroupNames.insert(string(theGroup->GetStoreName()));
+
+  myGroupAttributVal = 0;
+  
+  if (theGroup->GetColorGroup()!=0)
+    {
+      myGroupAttributVal = theGroup->GetColorGroup();
+    }
+
 }
 
 //=============================================================================
@@ -287,10 +397,12 @@ void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup)
  *  on the basis of the elements type.
  */
 //=============================================================================
-list<DriverMED_FamilyPtr> DriverMED_Family::SplitByType (SMESHDS_SubMesh* theSubMesh,
-                                                         const int        theId)
+DriverMED_FamilyPtrList 
+DriverMED_Family
+::SplitByType (SMESHDS_SubMesh* theSubMesh,
+              const int        theId)
 {
-  list<DriverMED_FamilyPtr> aFamilies;
+  DriverMED_FamilyPtrList aFamilies;
   DriverMED_FamilyPtr aNodesFamily   (new DriverMED_Family);
   DriverMED_FamilyPtr anEdgesFamily  (new DriverMED_Family);
   DriverMED_FamilyPtr aFacesFamily   (new DriverMED_Family);
@@ -361,7 +473,7 @@ void DriverMED_Family::Split (DriverMED_FamilyPtr by,
                               DriverMED_FamilyPtr common)
 {
   // Elements
-  set<const SMDS_MeshElement *>::iterator anIter = by->myElements.begin();
+  ElementsSet::iterator anIter = by->myElements.begin();
   while ( anIter != by->myElements.end())
   {
     if (myElements.find(*anIter) != myElements.end())
@@ -378,7 +490,7 @@ void DriverMED_Family::Split (DriverMED_FamilyPtr by,
   {
     // Groups list
     common->myGroupNames = myGroupNames;
-    set<string>::iterator aGrNamesIter = by->myGroupNames.begin();
+    MED::TStringSet::iterator aGrNamesIter = by->myGroupNames.begin();
     for (; aGrNamesIter != by->myGroupNames.end(); aGrNamesIter++)
     {
       common->myGroupNames.insert(*aGrNamesIter);
index 1632ccb..6a36227 100644 (file)
 
 class DriverMED_Family;
 typedef boost::shared_ptr<DriverMED_Family> DriverMED_FamilyPtr;
+typedef std::list<DriverMED_FamilyPtr> DriverMED_FamilyPtrList;
+typedef std::map<int,SMESHDS_SubMesh*> SMESHDS_SubMeshPtrMap;
+typedef std::list<SMESHDS_GroupBase*> SMESHDS_GroupBasePtrList;
+typedef std::set<const SMDS_MeshElement*> ElementsSet;
 
 class DriverMED_Family
 {
  public:
 
-  // Methods for groups storing to MED
-
-  static std::list<DriverMED_FamilyPtr> MakeFamilies (const std::map <int, SMESHDS_SubMesh*>& theSubMeshes,
-                                                     const std::list<SMESHDS_GroupBase*>& theGroups,
-                                                     const bool doGroupOfNodes,
-                                                     const bool doGroupOfEdges,
-                                                     const bool doGroupOfFaces,
-                                                     const bool doGroupOfVolumes);
-  // Split each group from list <theGroups> and each sub-mesh from list <theSubMeshes>
-  // on some parts (families) on the basis of the elements membership in other groups
-  // from <theGroups> and other sub-meshes from <theSubMeshes>.
-  // Resulting families have no common elements.
-
-  MED::PFamilyInfo GetFamilyInfo (const MED::PWrapper& theWrapper, 
-                                 const MED::PMeshInfo& theMeshInfo) const;
-  // Create TFamilyInfo for this family
-
-  const std::set<const SMDS_MeshElement *>& GetElements () const { return myElements; }
-  // Returns elements of this family
-
-  int GetId () const { return myId; }
-  // Returns a family ID
+  DriverMED_Family();
+
+  //! Methods for groups storing to MED
+  /*!
+    Split each group from list <theGroups> and each sub-mesh from list <theSubMeshes>
+    on some parts (families) on the basis of the elements membership in other groups
+    from <theGroups> and other sub-meshes from <theSubMeshes>.
+    Resulting families have no common elements.
+  */
+  static 
+  DriverMED_FamilyPtrList
+  MakeFamilies (const SMESHDS_SubMeshPtrMap& theSubMeshes,
+               const SMESHDS_GroupBasePtrList& theGroups,
+               const bool doGroupOfNodes,
+               const bool doGroupOfEdges,
+               const bool doGroupOfFaces,
+               const bool doGroupOfVolumes);
+
+  //! Create TFamilyInfo for this family
+  MED::PFamilyInfo 
+  GetFamilyInfo (const MED::PWrapper& theWrapper, 
+                const MED::PMeshInfo& theMeshInfo) const;
+
+  //! Returns elements of this family
+  const ElementsSet& GetElements () const;
+
+  //! Returns a family ID
+  int GetId () const;
+
+  //! Sets a family ID
+  void SetId (const int theId);
 
  public:
 
   // Methods for groups reading from MED
 
-  void AddElement (const SMDS_MeshElement* theElement) { myElements.insert(theElement); }
+  void AddElement(const SMDS_MeshElement* theElement);
 
-  void AddGroupName (std::string theGroupName) { myGroupNames.insert(theGroupName); }
+  const MED::TStringSet& GetGroupNames() const;
+  void AddGroupName(std::string theGroupName);
 
-  void SetType (const SMDSAbs_ElementType theType) { myType = theType; }
-  SMDSAbs_ElementType GetType () { return myType; }
+  void SetType(const SMDSAbs_ElementType theType);
+  SMDSAbs_ElementType GetType();
 
-  bool MemberOf (std::string theGroupName) const
-    { return (myGroupNames.find(theGroupName) != myGroupNames.end()); }
+  bool MemberOf(std::string theGroupName) const;
 
-  const MED::TStringSet& GetGroupNames () const { return myGroupNames; }
-
-  void SetId (const int theId) { myId = theId; }
-  // Sets a family ID
+  int GetGroupAttributVal() const;
+  void SetGroupAttributVal( int theValue);
 
  private:
+  //! Initialize the tool by SMESHDS_GroupBase
   void Init (SMESHDS_GroupBase* group);
-  // Initialize the tool by SMESHDS_GroupBase
 
-  static std::list<DriverMED_FamilyPtr> SplitByType (SMESHDS_SubMesh* theSubMesh,
-                                                    const int        theId);
-  // Split <theSubMesh> on some parts (families)
-  // on the basis of the elements type.
+  //! Split <theSubMesh> on some parts (families) on the basis of the elements type.
+  static
+  DriverMED_FamilyPtrList 
+  SplitByType(SMESHDS_SubMesh* theSubMesh,
+             const int        theId);
+
 
+  /*! Remove from <Elements> elements, common with <by>,
+    Remove from <by> elements, common with <Elements>,
+    Create family <common> from common elements, with combined groups list.
+  */
   void Split (DriverMED_FamilyPtr by,
              DriverMED_FamilyPtr common);
-  // Remove from <Elements> elements, common with <by>,
-  // Remove from <by> elements, common with <Elements>,
-  // Create family <common> from common elements, with combined groups list.
 
-  bool IsEmpty () const { return myElements.empty(); }
-  // Check, if this family has empty list of elements
+  //! Check, if this family has empty list of elements
+  bool IsEmpty () const;
+
 
  private:
   int                           myId;
   SMDSAbs_ElementType           myType;
-  std::set<const SMDS_MeshElement *> myElements;
+  ElementsSet                   myElements;
   MED::TStringSet               myGroupNames;
+  int                           myGroupAttributVal;
 };
 
 #endif
index 44e05bf..49c645f 100644 (file)
@@ -41,6 +41,7 @@
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
+//#define _DEXCEPT_
 #else
 static int MYDEBUG = 0;
 #endif
@@ -69,10 +70,12 @@ DriverMED_R_SMESHDS_Mesh
 ::Perform()
 {
   Status aResult = DRS_FAIL;
+#ifndef _DEXCEPT_
   try{
+#endif
     myFamilies.clear();
     if(MYDEBUG) MESSAGE("Perform - myFile : "<<myFile);
-    PWrapper aMed = CrWrapper(myFile);
+    PWrapper aMed = CrWrapper(myFile,true);
 
     aResult = DRS_EMPTY;
     if(TInt aNbMeshes = aMed->GetNbMeshes()){
@@ -195,7 +198,9 @@ DriverMED_R_SMESHDS_Mesh
                 SMDS_MeshElement* anElement = NULL;
                 TInt aFamNum = aPolygoneInfo->GetFamNum(iElem);
 
+#ifndef _DEXCEPT_
                 try{
+#endif
                   if(anIsElemNum){
                    TInt anElemId = aPolygoneInfo->GetElemNum(iElem);
                     anElement = myMesh->AddPolygonalFaceWithID(aNodeIds,anElemId);
@@ -207,12 +212,13 @@ DriverMED_R_SMESHDS_Mesh
                     anElement = myMesh->AddPolygonalFace(aNodes);
                     isRenum = anIsElemNum;
                   }
+#ifndef _DEXCEPT_
                 }catch(const std::exception& exc){
                   aResult = DRS_FAIL;
                 }catch (...){
                   aResult = DRS_FAIL;
                 }
-
+#endif
                 if(!anElement){
                   aResult = DRS_WARN_SKIP_ELEM;
                 }else{
@@ -265,7 +271,9 @@ DriverMED_R_SMESHDS_Mesh
                SMDS_MeshElement* anElement = NULL;
                TInt aFamNum = aPolyedreInfo->GetFamNum(iElem);
                
+#ifndef _DEXCEPT_
                try{
+#endif
                  if(anIsElemNum){
                    TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
                    anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId);
@@ -277,12 +285,13 @@ DriverMED_R_SMESHDS_Mesh
                    anElement = myMesh->AddPolyhedralVolume(aNodes,aQuantities);
                    isRenum = anIsElemNum;
                  }
+#ifndef _DEXCEPT_
                }catch(const std::exception& exc){
                  aResult = DRS_FAIL;
                }catch(...){
                  aResult = DRS_FAIL;
                }
-               
+#endif         
                if(!anElement){
                  aResult = DRS_WARN_SKIP_ELEM;
                }else{
@@ -302,238 +311,388 @@ DriverMED_R_SMESHDS_Mesh
               break;
             }
            default: {
-             PCellInfo aCellInfo = aMed->GetPCellInfo(aMeshInfo,anEntity,aGeom);
-             EBooleen anIsElemNum = takeNumbers ? aCellInfo->IsElemNum() : eFAUX;
-             TInt aNbElems = aCellInfo->GetNbElem();
-             if(MYDEBUG) MESSAGE("Perform - anEntity = "<<anEntity<<"; anIsElemNum = "<<anIsElemNum);
-             if(MYDEBUG) MESSAGE("Perform - aGeom = "<<aGeom<<"; aNbElems = "<<aNbElems);
-             
-             for(int iElem = 0; iElem < aNbElems; iElem++){
-               TInt aNbNodes = -1;
-               switch(aGeom){
-               case eSEG2:
-               case eSEG3:
-                 aNbNodes = 2;
-                 break;
-               case eTRIA3:
-               case eTRIA6:
-                 aNbNodes = 3;
-                 break;
-                 break;
-               case eQUAD4:
-               case eQUAD8:
-                 aNbNodes = 4;
-                 break;
-               case eTETRA4:
-               case eTETRA10:
-                 aNbNodes = 4;
-                 break;
-               case ePYRA5:
-               case ePYRA13:
-                 aNbNodes = 5;
-                 break;
-               case ePENTA6:
-               case ePENTA15:
-                 aNbNodes = 6;
-                 break;
-               case eHEXA8:
-               case eHEXA20:
-                 aNbNodes = 8;
-                 break;
-               }
-               TNodeIds aNodeIds(aNbNodes);
-               bool anIsValidConnect = false;
-               TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
-               try{
+              PCellInfo aCellInfo = aMed->GetPCellInfo(aMeshInfo,anEntity,aGeom);
+              EBooleen anIsElemNum = takeNumbers ? aCellInfo->IsElemNum() : eFAUX;
+              TInt aNbElems = aCellInfo->GetNbElem();
+              if(MYDEBUG) MESSAGE("Perform - anEntity = "<<anEntity<<"; anIsElemNum = "<<anIsElemNum);
+              if(MYDEBUG) MESSAGE("Perform - aGeom = "<<aGeom<<"; aNbElems = "<<aNbElems);
+
+              for(int iElem = 0; iElem < aNbElems; iElem++){
+                TInt aNbNodes = -1;
+                switch(aGeom){
+                case eSEG2:    aNbNodes = 2;  break;
+                case eSEG3:    aNbNodes = 3;  break;
+                case eTRIA3:   aNbNodes = 3;  break;
+                case eTRIA6:   aNbNodes = 6;  break;
+                case eQUAD4:   aNbNodes = 4;  break;
+                case eQUAD8:   aNbNodes = 8;  break;
+                case eTETRA4:  aNbNodes = 4;  break;
+                case eTETRA10: aNbNodes = 10; break;
+                case ePYRA5:   aNbNodes = 5;  break;
+                case ePYRA13:  aNbNodes = 13; break;
+                case ePENTA6:  aNbNodes = 6;  break;
+                case ePENTA15: aNbNodes = 15; break;
+                case eHEXA8:   aNbNodes = 8;  break;
+                case eHEXA20:  aNbNodes = 20; break;
+                default:;
+                }
+                vector<TInt> aNodeIds(aNbNodes);
+                bool anIsValidConnect = false;
+                TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
+#ifndef _DEXCEPT_
+                try{
+#endif
 #ifdef _EDF_NODE_IDS_
-                 if(anIsNodeNum)
-                   for(int iNode = 0; iNode < aNbNodes; iNode++)
-                     aNodeIds[iNode] = aNodeInfo->GetElemNum(aConnSlice[iNode] - 1);
-                 else
-                   for(int iNode = 0; iNode < aNbNodes; iNode++)
-                     aNodeIds[iNode] = aConnSlice[iNode];
+                  if(anIsNodeNum)
+                    for(int iNode = 0; iNode < aNbNodes; iNode++)
+                      aNodeIds[iNode] = aNodeInfo->GetElemNum(aConnSlice[iNode] - 1);
+                  else
+                    for(int iNode = 0; iNode < aNbNodes; iNode++)
+                      aNodeIds[iNode] = aConnSlice[iNode];
 #else
-                 for(int iNode = 0; iNode < aNbNodes; iNode++)
-                   aNodeIds[iNode] = aConnSlice[iNode];
+                  for(int iNode = 0; iNode < aNbNodes; iNode++)
+                    aNodeIds[iNode] = aConnSlice[iNode];
 #endif
-                 anIsValidConnect = true;
-               }catch(const std::exception& exc){
-                 //INFOS("Follow exception was cought:\n\t"<<exc.what());
-                 aResult = DRS_FAIL;
-               }catch(...){
-                 //INFOS("Unknown exception was cought !!!");
-                 aResult = DRS_FAIL;
-               }
-               
-               if(!anIsValidConnect)
-                 continue;
-               
-               bool isRenum = false;
-               SMDS_MeshElement* anElement = NULL;
-               TInt aFamNum = aCellInfo->GetFamNum(iElem);
-               try{
-                 //MESSAGE("Try to create element # " << iElem << " with id = "
-                 //        << aCellInfo->GetElemNum(iElem));
-                 switch(aGeom){
-                 case eSEG2:
-                 case eSEG3:
-                   if(anIsElemNum)
-                     anElement = myMesh->AddEdgeWithID(aNodeIds[0],
-                                                       aNodeIds[1],
-                                                       aCellInfo->GetElemNum(iElem));
-                   if (!anElement) {
-                     anElement = myMesh->AddEdge(FindNode(myMesh,aNodeIds[0]),
-                                                 FindNode(myMesh,aNodeIds[1]));
-                     isRenum = anIsElemNum;
-                   }
-                   break;
-                 case eTRIA3:
-                 case eTRIA6:
-                   aNbNodes = 3;
-                   if(anIsElemNum)
-                     anElement = myMesh->AddFaceWithID(aNodeIds[0],
-                                                       aNodeIds[1],
-                                                       aNodeIds[2],
-                                                       aCellInfo->GetElemNum(iElem));
-                   if (!anElement) {
-                     anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]),
-                                                 FindNode(myMesh,aNodeIds[1]),
-                                                 FindNode(myMesh,aNodeIds[2]));
-                     isRenum = anIsElemNum;
-                   }
-                   break;
-                 case eQUAD4:
-                 case eQUAD8:
-                   aNbNodes = 4;
-                   // There is some differnce between SMDS and MED
-                   if(anIsElemNum)
-                     anElement = myMesh->AddFaceWithID(aNodeIds[0],
-                                                       aNodeIds[1],
-                                                       aNodeIds[2],
-                                                       aNodeIds[3],
-                                                       aCellInfo->GetElemNum(iElem));
-                   if (!anElement) {
-                     anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]),
-                                                 FindNode(myMesh,aNodeIds[1]),
-                                                 FindNode(myMesh,aNodeIds[2]),
-                                                 FindNode(myMesh,aNodeIds[3]));
-                     isRenum = anIsElemNum;
-                   }
-                   break;
-                 case eTETRA4:
-                 case eTETRA10:
-                   aNbNodes = 4;
-                   if(anIsElemNum)
-                     anElement = myMesh->AddVolumeWithID(aNodeIds[0],
-                                                         aNodeIds[1],
-                                                         aNodeIds[2],
-                                                         aNodeIds[3],
-                                                         aCellInfo->GetElemNum(iElem));
-                   if (!anElement) {
-                     anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
-                                                   FindNode(myMesh,aNodeIds[1]),
-                                                   FindNode(myMesh,aNodeIds[2]),
-                                                   FindNode(myMesh,aNodeIds[3]));
-                     isRenum = anIsElemNum;
-                   }
-                   break;
-                 case ePYRA5:
-                 case ePYRA13:
-                   aNbNodes = 5;
-                   // There is some differnce between SMDS and MED
-                   if(anIsElemNum)
-                     anElement = myMesh->AddVolumeWithID(aNodeIds[0],
-                                                         aNodeIds[1],
-                                                         aNodeIds[2],
-                                                         aNodeIds[3],
-                                                         aNodeIds[4],
-                                                         aCellInfo->GetElemNum(iElem));
-                   if (!anElement) {
-                     anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
-                                                   FindNode(myMesh,aNodeIds[1]),
-                                                   FindNode(myMesh,aNodeIds[2]),
-                                                   FindNode(myMesh,aNodeIds[3]),
-                                                   FindNode(myMesh,aNodeIds[4]));
-                     isRenum = anIsElemNum;
-                   }
-                   break;
-                 case ePENTA6:
-                 case ePENTA15:
-                   aNbNodes = 6;
-                   if(anIsElemNum)
-                     anElement = myMesh->AddVolumeWithID(aNodeIds[0],
-                                                         aNodeIds[1],
-                                                         aNodeIds[2],
-                                                         aNodeIds[3],
-                                                         aNodeIds[4],
-                                                         aNodeIds[5],
-                                                         aCellInfo->GetElemNum(iElem));
-                   if (!anElement) {
-                     anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
-                                                   FindNode(myMesh,aNodeIds[1]),
-                                                   FindNode(myMesh,aNodeIds[2]),
-                                                   FindNode(myMesh,aNodeIds[3]),
-                                                   FindNode(myMesh,aNodeIds[4]),
-                                                   FindNode(myMesh,aNodeIds[5]));
-                     isRenum = anIsElemNum;
-                   }
-                   break;
-                 case eHEXA8:
-                 case eHEXA20:
-                   aNbNodes = 8;
-                   if(anIsElemNum)
-                     anElement = myMesh->AddVolumeWithID(aNodeIds[0],
-                                                         aNodeIds[1],
-                                                         aNodeIds[2],
-                                                         aNodeIds[3],
-                                                         aNodeIds[4],
-                                                         aNodeIds[5],
-                                                         aNodeIds[6],
-                                                         aNodeIds[7],
-                                                         aCellInfo->GetElemNum(iElem));
-                   if (!anElement) {
-                     anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
-                                                   FindNode(myMesh,aNodeIds[1]),
-                                                   FindNode(myMesh,aNodeIds[2]),
-                                                   FindNode(myMesh,aNodeIds[3]),
-                                                   FindNode(myMesh,aNodeIds[4]),
-                                                   FindNode(myMesh,aNodeIds[5]),
-                                                   FindNode(myMesh,aNodeIds[6]),
-                                                   FindNode(myMesh,aNodeIds[7]));
-                     isRenum = anIsElemNum;
-                   }
-                   break;
-                 }
-               }catch(const std::exception& exc){
-                 //INFOS("Follow exception was cought:\n\t"<<exc.what());
-                 aResult = DRS_FAIL;
-               }catch(...){
-                 //INFOS("Unknown exception was cought !!!");
-                 aResult = DRS_FAIL;
-               }
-               
-               if (!anElement) {
-                 aResult = DRS_WARN_SKIP_ELEM;
-               }
-               else {
-                 if (isRenum) {
-                   anIsElemNum = eFAUX;
-                   takeNumbers = false;
-                   if (aResult < DRS_WARN_RENUMBER)
-                     aResult = DRS_WARN_RENUMBER;
-                 }
-                 if ( checkFamilyID ( aFamily, aFamNum )) {
-                   // Save reference to this element from its family
-                   myFamilies[aFamNum]->AddElement(anElement);
-                   myFamilies[aFamNum]->SetType(anElement->GetType());
-                 }
-               }
-             }
-           }}
-         }
-       }
+                  anIsValidConnect = true;
+#ifndef _DEXCEPT_
+                }catch(const std::exception& exc){
+                  //INFOS("Follow exception was cought:\n\t"<<exc.what());
+                  aResult = DRS_FAIL;
+                }catch(...){
+                  //INFOS("Unknown exception was cought !!!");
+                  aResult = DRS_FAIL;
+                }
+#endif          
+                if(!anIsValidConnect)
+                  continue;
+
+                bool isRenum = false;
+                SMDS_MeshElement* anElement = NULL;
+                TInt aFamNum = aCellInfo->GetFamNum(iElem);
+#ifndef _DEXCEPT_
+                try{
+#endif
+                  //MESSAGE("Try to create element # " << iElem << " with id = "
+                  //        << aCellInfo->GetElemNum(iElem));
+                  switch(aGeom){
+                  case eSEG2:
+                    if(anIsElemNum)
+                      anElement = myMesh->AddEdgeWithID(aNodeIds[0],
+                                                        aNodeIds[1],
+                                                        aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddEdge(FindNode(myMesh,aNodeIds[0]),
+                                                  FindNode(myMesh,aNodeIds[1]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case eSEG3:
+                    if(anIsElemNum)
+                      anElement = myMesh->AddEdgeWithID(aNodeIds[0],
+                                                        aNodeIds[1],
+                                                        aNodeIds[2],
+                                                        aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddEdge(FindNode(myMesh,aNodeIds[0]),
+                                                  FindNode(myMesh,aNodeIds[1]),
+                                                  FindNode(myMesh,aNodeIds[2]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case eTRIA3:
+                    aNbNodes = 3;
+                    if(anIsElemNum)
+                      anElement = myMesh->AddFaceWithID(aNodeIds[0],
+                                                        aNodeIds[1],
+                                                        aNodeIds[2],
+                                                        aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]),
+                                                  FindNode(myMesh,aNodeIds[1]),
+                                                  FindNode(myMesh,aNodeIds[2]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case eTRIA6:
+                    aNbNodes = 6;
+                    if(anIsElemNum)
+                      anElement = myMesh->AddFaceWithID(aNodeIds[0], aNodeIds[1],
+                                                        aNodeIds[2], aNodeIds[3],
+                                                        aNodeIds[4], aNodeIds[5],
+                                                        aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]),
+                                                  FindNode(myMesh,aNodeIds[1]),
+                                                  FindNode(myMesh,aNodeIds[2]),
+                                                  FindNode(myMesh,aNodeIds[3]),
+                                                  FindNode(myMesh,aNodeIds[4]),
+                                                  FindNode(myMesh,aNodeIds[5]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case eQUAD4:
+                    aNbNodes = 4;
+                    if(anIsElemNum)
+                      anElement = myMesh->AddFaceWithID(aNodeIds[0], aNodeIds[1],
+                                                        aNodeIds[2], aNodeIds[3],
+                                                        aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]),
+                                                  FindNode(myMesh,aNodeIds[1]),
+                                                  FindNode(myMesh,aNodeIds[2]),
+                                                  FindNode(myMesh,aNodeIds[3]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case eQUAD8:
+                    aNbNodes = 8;
+                    if(anIsElemNum)
+                      anElement = myMesh->AddFaceWithID(aNodeIds[0], aNodeIds[1],
+                                                        aNodeIds[2], aNodeIds[3],
+                                                        aNodeIds[4], aNodeIds[5],
+                                                        aNodeIds[6], aNodeIds[7],
+                                                        aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]),
+                                                  FindNode(myMesh,aNodeIds[1]),
+                                                  FindNode(myMesh,aNodeIds[2]),
+                                                  FindNode(myMesh,aNodeIds[3]),
+                                                  FindNode(myMesh,aNodeIds[4]),
+                                                  FindNode(myMesh,aNodeIds[5]),
+                                                  FindNode(myMesh,aNodeIds[6]),
+                                                  FindNode(myMesh,aNodeIds[7]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case eTETRA4:
+                    aNbNodes = 4;
+                    if(anIsElemNum)
+                      anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
+                                                          aNodeIds[2], aNodeIds[3],
+                                                          aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
+                                                    FindNode(myMesh,aNodeIds[1]),
+                                                    FindNode(myMesh,aNodeIds[2]),
+                                                    FindNode(myMesh,aNodeIds[3]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case eTETRA10:
+                    aNbNodes = 10;
+                    if(anIsElemNum)
+                      anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
+                                                          aNodeIds[2], aNodeIds[3],
+                                                          aNodeIds[4], aNodeIds[5],
+                                                          aNodeIds[6], aNodeIds[7],
+                                                          aNodeIds[8], aNodeIds[9],
+                                                          aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
+                                                    FindNode(myMesh,aNodeIds[1]),
+                                                    FindNode(myMesh,aNodeIds[2]),
+                                                    FindNode(myMesh,aNodeIds[3]),
+                                                    FindNode(myMesh,aNodeIds[4]),
+                                                    FindNode(myMesh,aNodeIds[5]),
+                                                    FindNode(myMesh,aNodeIds[6]),
+                                                    FindNode(myMesh,aNodeIds[7]),
+                                                    FindNode(myMesh,aNodeIds[8]),
+                                                    FindNode(myMesh,aNodeIds[9]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case ePYRA5:
+                    aNbNodes = 5;
+                    // There is some differnce between SMDS and MED
+                    if(anIsElemNum)
+                      anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
+                                                          aNodeIds[2], aNodeIds[3],
+                                                          aNodeIds[4],
+                                                          aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
+                                                    FindNode(myMesh,aNodeIds[1]),
+                                                    FindNode(myMesh,aNodeIds[2]),
+                                                    FindNode(myMesh,aNodeIds[3]),
+                                                    FindNode(myMesh,aNodeIds[4]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case ePYRA13:
+                    aNbNodes = 13;
+                    // There is some differnce between SMDS and MED
+                    if(anIsElemNum)
+                      anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
+                                                          aNodeIds[2], aNodeIds[3],
+                                                          aNodeIds[4], aNodeIds[5],
+                                                          aNodeIds[6], aNodeIds[7],
+                                                          aNodeIds[8], aNodeIds[9],
+                                                          aNodeIds[10], aNodeIds[11],
+                                                          aNodeIds[12],
+                                                          aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
+                                                    FindNode(myMesh,aNodeIds[1]),
+                                                    FindNode(myMesh,aNodeIds[2]),
+                                                    FindNode(myMesh,aNodeIds[3]),
+                                                    FindNode(myMesh,aNodeIds[4]),
+                                                    FindNode(myMesh,aNodeIds[5]),
+                                                    FindNode(myMesh,aNodeIds[6]),
+                                                    FindNode(myMesh,aNodeIds[7]),
+                                                    FindNode(myMesh,aNodeIds[8]),
+                                                    FindNode(myMesh,aNodeIds[9]),
+                                                    FindNode(myMesh,aNodeIds[10]),
+                                                    FindNode(myMesh,aNodeIds[11]),
+                                                    FindNode(myMesh,aNodeIds[12]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case ePENTA6:
+                    aNbNodes = 6;
+                    if(anIsElemNum)
+                      anElement = myMesh->AddVolumeWithID(aNodeIds[0],
+                                                          aNodeIds[1],
+                                                          aNodeIds[2],
+                                                          aNodeIds[3],
+                                                          aNodeIds[4],
+                                                          aNodeIds[5],
+                                                          aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
+                                                    FindNode(myMesh,aNodeIds[1]),
+                                                    FindNode(myMesh,aNodeIds[2]),
+                                                    FindNode(myMesh,aNodeIds[3]),
+                                                    FindNode(myMesh,aNodeIds[4]),
+                                                    FindNode(myMesh,aNodeIds[5]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case ePENTA15:
+                    aNbNodes = 15;
+                    if(anIsElemNum)
+                      anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
+                                                          aNodeIds[2], aNodeIds[3],
+                                                          aNodeIds[4], aNodeIds[5],
+                                                          aNodeIds[6], aNodeIds[7],
+                                                          aNodeIds[8], aNodeIds[9],
+                                                          aNodeIds[10], aNodeIds[11],
+                                                          aNodeIds[12], aNodeIds[13],
+                                                          aNodeIds[14],
+                                                          aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
+                                                    FindNode(myMesh,aNodeIds[1]),
+                                                    FindNode(myMesh,aNodeIds[2]),
+                                                    FindNode(myMesh,aNodeIds[3]),
+                                                  FindNode(myMesh,aNodeIds[4]),
+                                                    FindNode(myMesh,aNodeIds[5]),
+                                                    FindNode(myMesh,aNodeIds[6]),
+                                                    FindNode(myMesh,aNodeIds[7]),
+                                                    FindNode(myMesh,aNodeIds[8]),
+                                                    FindNode(myMesh,aNodeIds[9]),
+                                                    FindNode(myMesh,aNodeIds[10]),
+                                                    FindNode(myMesh,aNodeIds[11]),
+                                                    FindNode(myMesh,aNodeIds[12]),
+                                                    FindNode(myMesh,aNodeIds[13]),
+                                                    FindNode(myMesh,aNodeIds[14]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case eHEXA8:
+                    aNbNodes = 8;
+                    if(anIsElemNum)
+                      anElement = myMesh->AddVolumeWithID(aNodeIds[0],
+                                                          aNodeIds[1],
+                                                          aNodeIds[2],
+                                                          aNodeIds[3],
+                                                          aNodeIds[4],
+                                                          aNodeIds[5],
+                                                          aNodeIds[6],
+                                                          aNodeIds[7],
+                                                          aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
+                                                    FindNode(myMesh,aNodeIds[1]),
+                                                    FindNode(myMesh,aNodeIds[2]),
+                                                    FindNode(myMesh,aNodeIds[3]),
+                                                    FindNode(myMesh,aNodeIds[4]),
+                                                    FindNode(myMesh,aNodeIds[5]),
+                                                    FindNode(myMesh,aNodeIds[6]),
+                                                    FindNode(myMesh,aNodeIds[7]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  case eHEXA20:
+                    aNbNodes = 20;
+                    if(anIsElemNum)
+                      anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
+                                                          aNodeIds[2], aNodeIds[3],
+                                                          aNodeIds[4], aNodeIds[5],
+                                                          aNodeIds[6], aNodeIds[7],
+                                                          aNodeIds[8], aNodeIds[9],
+                                                          aNodeIds[10], aNodeIds[11],
+                                                          aNodeIds[12], aNodeIds[13],
+                                                          aNodeIds[14], aNodeIds[15],
+                                                          aNodeIds[16], aNodeIds[17],
+                                                          aNodeIds[18], aNodeIds[19],
+                                                          aCellInfo->GetElemNum(iElem));
+                    if (!anElement) {
+                      anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
+                                                    FindNode(myMesh,aNodeIds[1]),
+                                                    FindNode(myMesh,aNodeIds[2]),
+                                                    FindNode(myMesh,aNodeIds[3]),
+                                                    FindNode(myMesh,aNodeIds[4]),
+                                                    FindNode(myMesh,aNodeIds[5]),
+                                                    FindNode(myMesh,aNodeIds[6]),
+                                                    FindNode(myMesh,aNodeIds[7]),
+                                                    FindNode(myMesh,aNodeIds[8]),
+                                                    FindNode(myMesh,aNodeIds[9]),
+                                                    FindNode(myMesh,aNodeIds[10]),
+                                                    FindNode(myMesh,aNodeIds[11]),
+                                                    FindNode(myMesh,aNodeIds[12]),
+                                                    FindNode(myMesh,aNodeIds[13]),
+                                                    FindNode(myMesh,aNodeIds[14]),
+                                                    FindNode(myMesh,aNodeIds[15]),
+                                                    FindNode(myMesh,aNodeIds[16]),
+                                                    FindNode(myMesh,aNodeIds[17]),
+                                                    FindNode(myMesh,aNodeIds[18]),
+                                                    FindNode(myMesh,aNodeIds[19]));
+                      isRenum = anIsElemNum;
+                    }
+                    break;
+                  }
+#ifndef _DEXCEPT_
+                }catch(const std::exception& exc){
+                  //INFOS("Follow exception was cought:\n\t"<<exc.what());
+                  aResult = DRS_FAIL;
+                }catch(...){
+                  //INFOS("Unknown exception was cought !!!");
+                  aResult = DRS_FAIL;
+                }
+#endif          
+                if (!anElement) {
+                  aResult = DRS_WARN_SKIP_ELEM;
+                }
+                else {
+                  if (isRenum) {
+                    anIsElemNum = eFAUX;
+                    takeNumbers = false;
+                    if (aResult < DRS_WARN_RENUMBER)
+                      aResult = DRS_WARN_RENUMBER;
+                  }
+                  if ( checkFamilyID ( aFamily, aFamNum )) {
+                    // Save reference to this element from its family
+                    myFamilies[aFamNum]->AddElement(anElement);
+                    myFamilies[aFamNum]->SetType(anElement->GetType());
+                  }
+                }
+              }
+            }}
+          }
+        }
       }
     }
+#ifndef _DEXCEPT_
   }catch(const std::exception& exc){
     INFOS("Follow exception was cought:\n\t"<<exc.what());
     aResult = DRS_FAIL;
@@ -541,6 +700,7 @@ DriverMED_R_SMESHDS_Mesh
     INFOS("Unknown exception was cought !!!");
     aResult = DRS_FAIL;
   }
+#endif
   if(MYDEBUG) MESSAGE("Perform - aResult status = "<<aResult);
   return aResult;
 }
index 22b33cf..3a26f75 100644 (file)
@@ -393,39 +393,90 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
 #ifdef _ELEMENTS_BY_DIM_
       SMDS_MED_ENTITY = eARETE;
 #endif
+      // count edges of diff types
+      int aNbSeg3 = 0, aNbSeg2 = 0;
       SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
-      TInt aNbConnectivity = MED::GetNbNodes(eSEG2);
-      MED::TIntVector anElemNums(aNbElems);
-      MED::TIntVector aFamilyNums(aNbElems);
-      MED::TIntVector aConnectivity(aNbElems*aNbConnectivity);
-
-      for(TInt iElem = 0, iConn = 0; anIter->more(); iElem++, iConn+=aNbConnectivity){
+      while ( anIter->more() )
+        if ( anIter->next()->NbNodes() == 3 )
+          ++aNbSeg3;
+      aNbSeg2 = aNbElems - aNbSeg3;
+
+      TInt aNbSeg2Conn = MED::GetNbNodes(eSEG2);
+      MED::TIntVector aSeg2ElemNums, aSeg2FamilyNums, aSeg2Conn;
+      aSeg2ElemNums  .reserve( aNbSeg2 );
+      aSeg2FamilyNums.reserve( aNbSeg2 );
+      aSeg2Conn      .reserve( aNbSeg2*aNbSeg2Conn );
+
+      TInt aNbSeg3Conn = MED::GetNbNodes(eSEG3);
+      MED::TIntVector aSeg3ElemNums, aSeg3FamilyNums, aSeg3Conn;
+      aSeg3ElemNums  .reserve( aNbSeg3 );
+      aSeg3FamilyNums.reserve( aNbSeg3 );
+      aSeg3Conn      .reserve( aNbSeg3*aNbSeg3Conn );
+
+      anIter = myMesh->edgesIterator();
+      while ( anIter->more() ) {
        const SMDS_MeshEdge* anElem = anIter->next();
-       SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
-       for(TInt iNode = 0; iNode < aNbConnectivity && aNodesIter->more(); iNode++){
-         const SMDS_MeshElement* aNode = aNodesIter->next();
+       TInt aNbNodes = anElem->NbNodes();
+
+       TInt aNbConnectivity;
+       MED::TIntVector* anElemNums;
+        MED::TIntVector* aFamilyNums;
+       MED::TIntVector* aConnectivity;
+        switch(aNbNodes){
+        case 2:
+          aNbConnectivity = aNbSeg2Conn;
+          anElemNums      = &aSeg2ElemNums;
+          aFamilyNums     = &aSeg2FamilyNums;
+          aConnectivity   = &aSeg2Conn;
+          break;
+        case 3:
+          aNbConnectivity = aNbSeg3Conn;
+          anElemNums      = &aSeg3ElemNums;
+          aFamilyNums     = &aSeg3FamilyNums;
+          aConnectivity   = &aSeg3Conn;
+          break;
+        default:
+          break;
+        }
+
+        for(TInt iNode = 0; iNode < aNbNodes; iNode++) {
+         const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
 #ifdef _EDF_NODE_IDS_
-         aConnectivity[iConn+iNode] = aNodeIdMap[aNode->GetID()];
+         aConnectivity->push_back( aNodeIdMap[aNode->GetID()] );
 #else
-         aConnectivity[iConn+iNode] = aNode->GetID();
+         aConnectivity->push_back( aNode->GetID() );
 #endif
-       }
-       anElemNums[iElem] = anElem->GetID();
+        }
 
-        if (anElemFamMap.find(anElem) != anElemFamMap.end())
-          aFamilyNums[iElem] = anElemFamMap[anElem];
+       anElemNums->push_back(anElem->GetID());
+
+        map<const SMDS_MeshElement*,int>::iterator edge_fam = anElemFamMap.find( anElem );
+        if ( edge_fam != anElemFamMap.end() )
+          aFamilyNums->push_back( edge_fam->second );
         else
-          aFamilyNums[iElem] = myEdgesDefaultFamilyId;
+          aFamilyNums->push_back( myFacesDefaultFamilyId );
       }
       
-      PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo,
-                                             SMDS_MED_ENTITY,
-                                             eSEG2,
-                                             aConnectivity,
-                                             SMDS_MED_CONNECTIVITY,
-                                             aFamilyNums,
-                                             anElemNums);
-      myMed->SetCellInfo(aCellInfo);
+      if ( aNbSeg2 ) {
+        PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo,
+                                                SMDS_MED_ENTITY,
+                                                eSEG2,
+                                                aSeg2Conn,
+                                                SMDS_MED_CONNECTIVITY,
+                                                aSeg2FamilyNums,
+                                                aSeg2ElemNums);
+        myMed->SetCellInfo(aCellInfo);
+      }
+      if ( aNbSeg3 ) {
+        PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo,
+                                                SMDS_MED_ENTITY,
+                                                eSEG3,
+                                                aSeg3Conn,
+                                                SMDS_MED_CONNECTIVITY,
+                                                aSeg3FamilyNums,
+                                                aSeg3ElemNums);
+        myMed->SetCellInfo(aCellInfo);
+      }
     }
 
     // Storing SMDS Faces
@@ -442,6 +493,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
       MED::TIntVector aTriaConn;
       aTriaConn.reserve(aNbElems*aNbTriaConn);
 
+      TInt aNbTria6Conn = MED::GetNbNodes(eTRIA6);
+      MED::TIntVector anTria6ElemNums; 
+      anTria6ElemNums.reserve(aNbElems);
+      MED::TIntVector aTria6FamilyNums;
+      aTria6FamilyNums.reserve(aNbElems);
+      MED::TIntVector aTria6Conn;
+      aTria6Conn.reserve(aNbElems*aNbTria6Conn);
+
       TInt aNbQuadConn = MED::GetNbNodes(eQUAD4);
       MED::TIntVector aQuadElemNums;
       aQuadElemNums.reserve(aNbElems);
@@ -450,6 +509,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
       MED::TIntVector aQuadConn;
       aQuadConn.reserve(aNbElems*aNbQuadConn);
 
+      TInt aNbQuad8Conn = MED::GetNbNodes(eQUAD8);
+      MED::TIntVector aQuad8ElemNums;
+      aQuad8ElemNums.reserve(aNbElems);
+      MED::TIntVector aQuad8FamilyNums;
+      aQuad8FamilyNums.reserve(aNbElems);
+      MED::TIntVector aQuad8Conn;
+      aQuad8Conn.reserve(aNbElems*aNbQuad8Conn);
+
       MED::TIntVector aPolygoneElemNums;
       aPolygoneElemNums.reserve(aNbElems);
       MED::TIntVector aPolygoneInds;
@@ -473,7 +540,8 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
           anElemNums = &aPolygoneElemNums;
           aFamilyNums = &aPolygoneFamilyNums;
           aConnectivity = &aPolygoneConn;
-        } else {
+        }
+        else {
           switch(aNbNodes){
           case 3:
             aNbConnectivity = aNbTriaConn;
@@ -487,6 +555,18 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
             aFamilyNums = &aQuadFamilyNums;
             aConnectivity = &aQuadConn;
             break;
+          case 6:
+            aNbConnectivity = aNbTria6Conn;
+            anElemNums = &anTria6ElemNums;
+            aFamilyNums = &aTria6FamilyNums;
+            aConnectivity = &aTria6Conn;
+            break;
+          case 8:
+            aNbConnectivity = aNbQuad8Conn;
+            anElemNums = &aQuad8ElemNums;
+            aFamilyNums = &aQuad8FamilyNums;
+            aConnectivity = &aQuad8Conn;
+            break;
           default:
             break;
           }
@@ -550,6 +630,28 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
        MESSAGE("Perform - anEntity = "<<SMDS_MED_ENTITY<<"; aGeom = "<<eQUAD4<<"; aNbElems = "<<aNbElems);
        myMed->SetCellInfo(aCellInfo);
       }
+      if(TInt aNbElems = anTria6ElemNums.size()){
+       PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo,
+                                               SMDS_MED_ENTITY,
+                                               eTRIA6,
+                                               aTria6Conn,
+                                               SMDS_MED_CONNECTIVITY,
+                                               aTria6FamilyNums,
+                                               anTria6ElemNums);
+       MESSAGE("Perform - anEntity = "<<SMDS_MED_ENTITY<<"; aGeom = "<<eTRIA6<<"; aNbElems = "<<aNbElems);
+       myMed->SetCellInfo(aCellInfo);
+      }
+      if(TInt aNbElems = aQuad8ElemNums.size()){
+       PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo,
+                                               SMDS_MED_ENTITY,
+                                               eQUAD8,
+                                               aQuad8Conn,
+                                               SMDS_MED_CONNECTIVITY,
+                                               aQuad8FamilyNums,
+                                               aQuad8ElemNums);
+       MESSAGE("Perform - anEntity = "<<SMDS_MED_ENTITY<<"; aGeom = "<<eQUAD8<<"; aNbElems = "<<aNbElems);
+       myMed->SetCellInfo(aCellInfo);
+      }
       if(TInt aNbElems = aPolygoneElemNums.size()){
         // add one element in connectivities,
         // referenced by the last element in indices
@@ -606,6 +708,38 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
       MED::TIntVector aHexaConn;
       aHexaConn.reserve(aNbElems*aNbHexaConn);
 
+      TInt aNbTetra10Conn = MED::GetNbNodes(eTETRA10);
+      MED::TIntVector anTetra10ElemNums; 
+      anTetra10ElemNums.reserve(aNbElems);
+      MED::TIntVector aTetra10FamilyNums;
+      aTetra10FamilyNums.reserve(aNbElems);
+      MED::TIntVector aTetra10Conn;
+      aTetra10Conn.reserve(aNbElems*aNbTetra10Conn);
+
+      TInt aNbPyra13Conn = MED::GetNbNodes(ePYRA13);
+      MED::TIntVector anPyra13ElemNums; 
+      anPyra13ElemNums.reserve(aNbElems);
+      MED::TIntVector aPyra13FamilyNums;
+      aPyra13FamilyNums.reserve(aNbElems);
+      MED::TIntVector aPyra13Conn;
+      aPyra13Conn.reserve(aNbElems*aNbPyra13Conn);
+
+      TInt aNbPenta15Conn = MED::GetNbNodes(ePENTA15);
+      MED::TIntVector anPenta15ElemNums; 
+      anPenta15ElemNums.reserve(aNbElems);
+      MED::TIntVector aPenta15FamilyNums;
+      aPenta15FamilyNums.reserve(aNbElems);
+      MED::TIntVector aPenta15Conn;
+      aPenta15Conn.reserve(aNbElems*aNbPenta15Conn);
+
+      TInt aNbHexa20Conn = MED::GetNbNodes(eHEXA20);
+      MED::TIntVector aHexa20ElemNums;
+      aHexa20ElemNums.reserve(aNbElems);
+      MED::TIntVector aHexa20FamilyNums;
+      aHexa20FamilyNums.reserve(aNbElems);
+      MED::TIntVector aHexa20Conn;
+      aHexa20Conn.reserve(aNbElems*aNbHexa20Conn);
+
       MED::TIntVector aPolyedreElemNums;
       aPolyedreElemNums.reserve(aNbElems);
       MED::TIntVector aPolyedreInds;
@@ -653,7 +787,8 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
           TInt aPrevPos = aPolyedreInds.back();
           aPolyedreInds.push_back(aPrevPos + aNbFaces);
 
-        } else {
+        }
+        else {
           TInt aNbNodes = anElem->NbNodes();
           SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
           TInt aNbConnectivity;
@@ -682,6 +817,30 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
             anElemNums = &aHexaElemNums;
             aFamilyNums = &aHexaFamilyNums;
             aConnectivity = &aHexaConn;
+           break;
+          case 10:
+            aNbConnectivity = aNbTetra10Conn;
+            anElemNums = &anTetra10ElemNums;
+            aFamilyNums = &aTetra10FamilyNums;
+            aConnectivity = &aTetra10Conn;
+            break;
+          case 13:
+            aNbConnectivity = aNbPyra13Conn;
+            anElemNums = &anPyra13ElemNums;
+            aFamilyNums = &aPyra13FamilyNums;
+            aConnectivity = &aPyra13Conn;
+            break;
+          case 15:
+            aNbConnectivity = aNbPenta15Conn;
+            anElemNums = &anPenta15ElemNums;
+            aFamilyNums = &aPenta15FamilyNums;
+            aConnectivity = &aPenta15Conn;
+            break;
+          case 20:
+            aNbConnectivity = aNbHexa20Conn;
+            anElemNums = &aHexa20ElemNums;
+            aFamilyNums = &aHexa20FamilyNums;
+            aConnectivity = &aHexa20Conn;
           }
 
           TInt aSize = aConnectivity->size();
@@ -762,6 +921,51 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
        MESSAGE("Perform - anEntity = "<<SMDS_MED_ENTITY<<"; aGeom = "<<eHEXA8<<"; aNbElems = "<<aNbElems);
        myMed->SetCellInfo(aCellInfo);
       }
+      if(TInt aNbElems = anTetra10ElemNums.size()){
+       PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo,
+                                               SMDS_MED_ENTITY,
+                                               eTETRA10,
+                                               aTetra10Conn,
+                                               SMDS_MED_CONNECTIVITY,
+                                               aTetra10FamilyNums,
+                                               anTetra10ElemNums);
+       MESSAGE("Perform - anEntity = "<<SMDS_MED_ENTITY<<"; aGeom = "<<eTETRA10<<"; aNbElems = "<<aNbElems);
+       myMed->SetCellInfo(aCellInfo);
+      }
+      if(TInt aNbElems = anPyra13ElemNums.size()){
+       PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo,
+                                               SMDS_MED_ENTITY,
+                                               ePYRA13,
+                                               aPyra13Conn,
+                                               SMDS_MED_CONNECTIVITY,
+                                               aPyra13FamilyNums,
+                                               anPyra13ElemNums);
+       MESSAGE("Perform - anEntity = "<<SMDS_MED_ENTITY<<"; aGeom = "<<ePYRA13<<"; aNbElems = "<<aNbElems);
+       myMed->SetCellInfo(aCellInfo);
+      }
+      if(TInt aNbElems = anPenta15ElemNums.size()){
+       PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo,
+                                               SMDS_MED_ENTITY,
+                                               ePENTA15,
+                                               aPenta15Conn,
+                                               SMDS_MED_CONNECTIVITY,
+                                               aPenta15FamilyNums,
+                                               anPenta15ElemNums);
+       MESSAGE("Perform - anEntity = "<<SMDS_MED_ENTITY<<"; aGeom = "<<ePENTA15<<"; aNbElems = "<<aNbElems);
+       myMed->SetCellInfo(aCellInfo);
+      }
+      if(TInt aNbElems = aHexa20ElemNums.size()){
+       PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo,
+                                               SMDS_MED_ENTITY,
+                                               eHEXA20,
+                                               aHexa20Conn,
+                                               SMDS_MED_CONNECTIVITY,
+                                               aHexa20FamilyNums,
+                                               aHexa20ElemNums);
+       MESSAGE("Perform - anEntity = "<<SMDS_MED_ENTITY<<"; aGeom = "<<eHEXA20<<"; aNbElems = "<<aNbElems);
+       myMed->SetCellInfo(aCellInfo);
+      }
+
       if(TInt aNbElems = aPolyedreElemNums.size()){
         // add one element in connectivities,
         // referenced by the last element in faces
@@ -780,9 +984,11 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
        myMed->SetPolyedreInfo(aCellInfo);
       }
     }
-  }catch(const std::exception& exc){
+  }
+  catch(const std::exception& exc) {
     INFOS("Follow exception was cought:\n\t"<<exc.what());
-  }catch(...){
+  }
+  catch(...) {
     INFOS("Unknown exception was cought !!!");
   }
 
index 04ce405..ed7c48e 100644 (file)
@@ -228,7 +228,7 @@ Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::writeBinary() const
   }
 
   // write number of triangles
-  unsigned int NBT = nbTri;
+  //unsigned int NBT = nbTri;
   aFile.Write((Standard_Address)sval,LABEL_SIZE);
   writeInteger(nbTri,aFile);  
 
index 12c0916..97ffd7d 100644 (file)
@@ -64,11 +64,22 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
        SMDS_MeshElement* anElement = NULL;
        const TElementLab& aLabel = anIter->first;
        const TRecord& aRec = anIter->second;
-       if(IsBeam(aRec.fe_descriptor_id)){
-         anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
-                                           aRec.node_labels[1],
-                                           aLabel);
-       }else if(IsFace(aRec.fe_descriptor_id)){
+       if(IsBeam(aRec.fe_descriptor_id)) {
+          if(aRec.fe_descriptor_id == 11) {
+            // edge with two nodes
+            anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
+                                              aRec.node_labels[1],
+                                              aLabel);
+          }
+          else {
+            // quadratic edge (with 3 nodes)
+            anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
+                                              aRec.node_labels[1],
+                                              aRec.node_labels[2],
+                                              aLabel);
+          }
+       }
+        else if(IsFace(aRec.fe_descriptor_id)) {
          switch(aRec.fe_descriptor_id){
          case 71: // TRI3
          case 72:
@@ -76,18 +87,31 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
            
          case 41: // Plane Stress Linear Triangle - TRI3
          case 91: // Thin Shell Linear Triangle - TRI3
+           anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+                                             aRec.node_labels[1],
+                                             aRec.node_labels[2],
+                                             aLabel);
+           break;
            
          case 42: // Plane Stress Quadratic Triangle - TRI6
          case 92: // Thin Shell Quadratic Triangle - TRI6
-           
            anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
                                              aRec.node_labels[1],
                                              aRec.node_labels[2],
+                                             aRec.node_labels[3],
+                                             aRec.node_labels[4],
+                                             aRec.node_labels[5],
                                              aLabel);
            break;
            
          case 44: // Plane Stress Linear Quadrilateral - QUAD4
          case 94: // Thin Shell   Linear Quadrilateral -  QUAD4
+           anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+                                             aRec.node_labels[1],
+                                             aRec.node_labels[2],
+                                             aRec.node_labels[3],
+                                             aLabel);
+           break;
            
          case 45: // Plane Stress Quadratic Quadrilateral - QUAD8
          case 95: // Thin Shell   Quadratic Quadrilateral - QUAD8
@@ -95,24 +119,40 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
                                              aRec.node_labels[1],
                                              aRec.node_labels[2],
                                              aRec.node_labels[3],
+                                             aRec.node_labels[4],
+                                             aRec.node_labels[5],
+                                             aRec.node_labels[6],
+                                             aRec.node_labels[7],
                                              aLabel);
            break;
          }
-       }else if(IsVolume(aRec.fe_descriptor_id)){
+       }
+        else if(IsVolume(aRec.fe_descriptor_id)){
          switch(aRec.fe_descriptor_id){
            
          case 111: // Solid Linear Tetrahedron - TET4
+           anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+                                               aRec.node_labels[2],
+                                               aRec.node_labels[1],
+                                               aRec.node_labels[3],
+                                               aLabel);
+           break;
+
          case 118: // Solid Quadratic Tetrahedron - TET10
-           
            anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
                                                aRec.node_labels[2],
                                                aRec.node_labels[1],
                                                aRec.node_labels[3],
+                                               aRec.node_labels[6],
+                                               aRec.node_labels[5],
+                                               aRec.node_labels[4],
+                                               aRec.node_labels[7],
+                                               aRec.node_labels[9],
+                                               aRec.node_labels[8],
                                                aLabel);
            break;
            
          case 112: // Solid Linear Prism - PRISM6
-           
            anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
                                                aRec.node_labels[2],
                                                aRec.node_labels[1],
@@ -123,13 +163,21 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
            break;
            
          case 113: // Solid Quadratic Prism - PRISM15
-           
            anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
-                                               aRec.node_labels[4],
                                                aRec.node_labels[2],
+                                               aRec.node_labels[1],
+                                               aRec.node_labels[3],
+                                               aRec.node_labels[5],
+                                               aRec.node_labels[4],
+                                               aRec.node_labels[8],
+                                               aRec.node_labels[7],
+                                               aRec.node_labels[6],
+                                               aRec.node_labels[11],
+                                               aRec.node_labels[10],
                                                aRec.node_labels[9],
+                                               aRec.node_labels[12],
+                                               aRec.node_labels[14],
                                                aRec.node_labels[13],
-                                               aRec.node_labels[11],
                                                aLabel);
            break;
            
@@ -146,26 +194,57 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
            break;
 
          case 116: // Solid Quadratic Brick - HEX20
-           
            anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
-                                               aRec.node_labels[6],
-                                               aRec.node_labels[4],
+                                               aRec.node_labels[3],
                                                aRec.node_labels[2],
+                                               aRec.node_labels[1],
+                                               aRec.node_labels[4],
+                                               aRec.node_labels[7],
+                                               aRec.node_labels[6],
+                                               aRec.node_labels[5],
+                                               aRec.node_labels[11],
+                                               aRec.node_labels[10],
+                                               aRec.node_labels[9],
+                                               aRec.node_labels[8],
+                                               aRec.node_labels[15],
+                                               aRec.node_labels[14],
+                                               aRec.node_labels[13],
                                                aRec.node_labels[12],
-                                               aRec.node_labels[18],
                                                aRec.node_labels[16],
-                                               aRec.node_labels[14],
+                                               aRec.node_labels[19],
+                                               aRec.node_labels[18],
+                                               aRec.node_labels[17],
+                                               aLabel);
+           break;
+
+         case 114: // pyramid of 13 nodes (quadratic) - PIRA13
+           anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+                                               aRec.node_labels[3],
+                                               aRec.node_labels[2],
+                                               aRec.node_labels[1],
+                                               aRec.node_labels[4],
+                                               aRec.node_labels[8],
+                                               aRec.node_labels[7],
+                                               aRec.node_labels[6],
+                                               aRec.node_labels[5],
+                                               aRec.node_labels[9],
+                                               aRec.node_labels[12],
+                                               aRec.node_labels[11],
+                                               aRec.node_labels[10],
                                                aLabel);
            break;
+
          }
        }
        if(!anElement)
          MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aLabel<<" and type = "<<aRec.fe_descriptor_id);
       }
     }
-  }catch(const std::exception& exc){
+  }
+  catch(const std::exception& exc){
     INFOS("Follow exception was cought:\n\t"<<exc.what());
-  }catch(...){
+  }
+  catch(...){
     INFOS("Unknown exception was cought !!!");
   }
   return aResult;
index 3fe3b18..a716945 100644 (file)
@@ -91,7 +91,10 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
            const SMDS_MeshElement* aNode = aNodesIter->next();
            aRec.node_labels.push_back(aNode->GetID());
          }
-         aRec.fe_descriptor_id = 11;
+          if(aNbNodes==2)
+            aRec.fe_descriptor_id = 11;
+          else
+            aRec.fe_descriptor_id = 21;
          aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
        }
        MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
@@ -118,6 +121,12 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
          case 4:
            aRec.fe_descriptor_id = 44;
            break;
+         case 6:
+           aRec.fe_descriptor_id = 42;
+           break;
+         case 8:
+           aRec.fe_descriptor_id = 45;
+           break;
          default:
            continue;
          }
@@ -160,6 +169,30 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
            anId = 115;
            break;
          }
+         case 10: {
+           static int anIds[] = {0,2,1,3,6,5,4,7,9,8};
+           aConn = anIds;
+           anId = 118;
+           break;
+         }
+         case 13: {
+           static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10};
+           aConn = anIds;
+           anId = 114;
+           break;
+         }
+         case 15: {
+           static int anIds[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13};
+           aConn = anIds;
+           anId = 113;
+           break;
+         }
+         case 20: {
+           static int anIds[] = {0,3,2,1,4,7,6,5,11,10,9,8,15,14,13,12,16,19,18,17};
+           aConn = anIds;
+           anId = 116;
+           break;
+         }
          default:
            continue;
          }
@@ -177,9 +210,11 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
       }
       UNV2412::Write(out_stream,aDataSet2412);
     }
-  }catch(const std::exception& exc){
+  }
+  catch(const std::exception& exc){
     INFOS("Follow exception was cought:\n\t"<<exc.what());
-  }catch(...){
+  }
+  catch(...){
     INFOS("Unknown exception was cought !!!");
   }
   return aResult;
index 0160d7b..2be3319 100644 (file)
@@ -142,8 +142,8 @@ void UNV2412::Write(std::ofstream& out_stream, const TDataSet& theDataSet)
 
 bool UNV2412::IsBeam(int theFeDescriptorId){
   switch (theFeDescriptorId){
-  case 11:
-  case 21:
+  case 11: // edge with 2 nodes
+  case 21: // edge with 3 nodes (quadratic)
   case 22:
   case 24:
   case 25:
@@ -197,6 +197,8 @@ bool UNV2412::IsVolume(int theFeDescriptorId){
   case 116: // Solid Quadratic Brick - HEX20
 
   case 117: // Solid Cubic Brick
+
+  case 114: // pyramid of 13 nodes (quadratic)
     return true;
   }
   return false;
index c4bbfd8..6618197 100644 (file)
@@ -33,7 +33,7 @@ VPATH=.:@srcdir@
 
 SUBDIRS = \
        SMDS SMESHDS Controls Driver DriverMED DriverDAT DriverUNV DriverSTL \
-       SMESH SMESH_I OBJECT SMESHFiltersSelection SMESHGUI SMESH_SWIG \
+       SMESH SMESH_I SMESHClient OBJECT SMESHFiltersSelection SMESHGUI SMESH_SWIG \
        MEFISTO2 StdMeshers StdMeshers_I StdMeshersGUI
 
 @MODULE@
index 8cf070c..3d47e38 100644 (file)
@@ -31,28 +31,105 @@ VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl
 
 @COMMENCE@
 
-EXPORT_HEADERS = SMESH_Actor.h SMESH_Object.h SMESH_ObjectDef.h SMESH_ActorUtils.h
+EXPORT_HEADERS = \
+       SMESH_Actor.h \
+        SMESH_Object.h \
+       SMESH_ObjectDef.h \
+       SMESH_ActorUtils.h
 
 
 # Libraries targets
 
 LIB = libSMESHObject.la
-LIB_SRC = SMESH_Object.cxx SMESH_DeviceActor.cxx SMESH_Actor.cxx \
-         SMESH_ExtractGeometry.cxx SMESH_ActorUtils.cxx
+LIB_SRC = \
+          SMESH_Object.cxx \
+          SMESH_DeviceActor.cxx \
+          SMESH_Actor.cxx \
+         SMESH_ExtractGeometry.cxx \
+          SMESH_ActorUtils.cxx
 
 LIB_CLIENT_IDL = SALOME_Exception.idl \
                 SALOME_GenericObj.idl \
                 SMESH_Mesh.idl \
-                SMESH_Group.idl
+                SMESH_Group.idl \
+                 SALOMEDS.idl \
+                SMESH_Gen.idl \
+                 GEOM_Gen.idl \
+                SMESH_Hypothesis.idl
 
 
 # Executables targets
 BIN = 
 BIN_SRC        =
 
-CPPFLAGS+=$(OCC_INCLUDES) $(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \
-         $(BOOST_CPPFLAGS) $(QT_INCLUDES)
-LDFLAGS+=$(OCC_KERNEL_LIBS) $(VTK_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome -lSMDS \
-         -lSalomeApp -lSalomeObject -lSMESHControls
+CPPFLAGS+= \
+        -I${KERNEL_ROOT_DIR}/include/salome \
+        -I${GUI_ROOT_DIR}/include/salome \
+       $(OCC_INCLUDES) \
+        $(VTK_INCLUDES) \
+        $(BOOST_CPPFLAGS) \
+        $(QT_INCLUDES)
+LDFLAGS+= \
+       -L${KERNEL_ROOT_DIR}/lib/salome \
+        -L${GUI_ROOT_DIR}/lib/salome \
+       $(OCC_KERNEL_LIBS) \
+        $(VTK_LIBS) \
+        -lSMDS \
+        -lSMESHClient \
+        -lSalomeApp \
+        -lSalomeObject \
+        -lSMESHControls
+
+LDFLAGSFORBIN += \
+       -L${GEOM_ROOT_DIR}/lib/salome \
+       -L${MED_ROOT_DIR}/lib/salome \
+       $(LDFLAGS) \
+       -lqtx \
+        -lsuit \
+       -lstd \
+       -lCAM \
+       -lLightApp \
+       -lObjBrowser \
+       -lSalomePrs \
+       -lSalomeDS \
+       -lTOOLSDS \
+       -lSalomeDSImpl \
+       -lSalomeDSClient \
+       -lSalomeHDFPersist \
+        -lSalomeResourcesManager \
+       -lSalomeLifeCycleCORBA \
+        -lSalomeNotification \
+        -lSalomeContainer \
+       -lSalomeCatalog \
+       -lSalomeSession \
+       -lRegistry \
+       -lNMTTools \
+       -lNMTDS \
+       -lmed_V2_1 \
+        -lMEDWrapper \
+        -lMEDWrapperBase \
+        -lMEDWrapper_V2_1 \
+        -lMEDWrapper_V2_2 \
+       -lPlot2d \
+       -lGLViewer \
+       -lOCCViewer \
+       -lVTKViewer \
+       -lSVTK \
+       -lSOCC \
+       -lSPlot2d \
+       -lSUPERVGraph \
+       -lPyInterp \
+       -lPythonConsole \
+       -lLogWindow \
+       -lLightApp \
+       -lSalomeContainer \
+       -lToolsGUI \
+        -lSalomeNS \
+       -lEvent \
+       -lSalomeGenericObj \
+        -lSALOMELocalTrace \
+       -lwith_loggerTraceCollector \
+        -lSALOMEBasics \
+        -lOpUtil
 
 @CONCLUDE@
index 5b21ac7..7f2ee90 100644 (file)
@@ -150,6 +150,8 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter->RegisterCellsWithType(VTK_TRIANGLE);
   aFilter->RegisterCellsWithType(VTK_POLYGON);
   aFilter->RegisterCellsWithType(VTK_QUAD);
+  aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
+  aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
 
   my3DActor = SMESH_DeviceActor::New();
   my3DActor->SetUserMatrix(aMatrix);
@@ -164,6 +166,8 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
   aFilter->RegisterCellsWithType(VTK_WEDGE);
   aFilter->RegisterCellsWithType(VTK_PYRAMID);
+  aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
+  aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
   aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
 
   //Definition 1D divice of the actor
@@ -185,6 +189,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter = my1DActor->GetExtractUnstructuredGrid();
   aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
   aFilter->RegisterCellsWithType(VTK_LINE);
+  aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
 
   my1DProp = vtkProperty::New();
   my1DProp->DeepCopy(myEdgeProp);
@@ -210,6 +215,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter = my1DExtActor->GetExtractUnstructuredGrid();
   aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
   aFilter->RegisterCellsWithType(VTK_LINE);
+  aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
 
 
   //Definition 0D divice of the actor
@@ -263,8 +269,6 @@ SMESH_ActorDef::SMESH_ActorDef()
   myHighlitableActor->PickableOff();
   myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
 
-  SetShrinkFactor( SMESH::GetFloat( "SMESH:shrink_coeff", 0.75 ) );
-
   myName = "";
   myIO = NULL;
 
@@ -748,13 +752,15 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
   my2DActor->GetPolygonOffsetParameters(aFactor,aUnits);
   my2DActor->SetPolygonOffsetParameters(aFactor,aUnits*0.75);
 
-  //SetIsShrunkable(theGrid->GetNumberOfCells() > 10);
-  SetIsShrunkable(true);
-
   SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
   if( !mgr )
     return false;
 
+  //SetIsShrunkable(theGrid->GetNumberOfCells() > 10);
+  SetIsShrunkable(true);
+
+  SetShrinkFactor( SMESH::GetFloat( "SMESH:shrink_coeff", 0.75 ) );
+
   int aMode = mgr->integerValue( "SMESH", "display_mode" );
   SetRepresentation(-1);
   
@@ -835,6 +841,8 @@ bool SMESH_ActorDef::IsInfinitive(){
 
 
 void SMESH_ActorDef::SetIsShrunkable(bool theShrunkable){
+  if ( myIsShrinkable == theShrunkable )
+    return;
   myIsShrinkable = theShrunkable;
   Modified();
 }
@@ -1015,6 +1023,7 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
   if(myEntityMode & eEdges){
     if (MYDEBUG) MESSAGE("EDGES");
     aFilter->RegisterCellsWithType(VTK_LINE);
+    aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
   }
 
   if(myEntityMode & eFaces){
@@ -1022,6 +1031,8 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
     aFilter->RegisterCellsWithType(VTK_TRIANGLE);
     aFilter->RegisterCellsWithType(VTK_POLYGON);
     aFilter->RegisterCellsWithType(VTK_QUAD);
+    aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
+    aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
   }
 
   if(myEntityMode & eVolumes){
@@ -1031,6 +1042,8 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
     aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
     aFilter->RegisterCellsWithType(VTK_WEDGE);
     aFilter->RegisterCellsWithType(VTK_PYRAMID);
+    aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
+    aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
     aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
   }
   aFilter->Update();
@@ -1135,6 +1148,8 @@ void SMESH_ActorDef::SetRepresentation(int theMode){
 
 
 void SMESH_ActorDef::SetPointRepresentation(bool theIsPointsVisible){
+  if ( myIsPointsVisible == theIsPointsVisible )
+    return;
   myIsPointsVisible = theIsPointsVisible;
   SetRepresentation(GetRepresentation());
 }
@@ -1175,12 +1190,16 @@ void SMESH_ActorDef::UpdateHighlight(){
 
 
 void SMESH_ActorDef::highlight(bool theHighlight){
+  if ( myIsHighlighted == theHighlight )
+    return;
   myIsHighlighted = theHighlight;
   UpdateHighlight();
 }
 
 
 void SMESH_ActorDef::SetPreSelected(bool thePreselect){ 
+  if ( myIsPreselected == thePreselect )
+    return;
   myIsPreselected = thePreselect; 
   UpdateHighlight();
 }
index 3548aae..28670e6 100644 (file)
@@ -547,14 +547,22 @@ void SMESH_DeviceActor::SetRepresentation(EReperesent theMode){
   switch(theMode){
   case ePoint:
     myGeomFilter->SetInside(true);
+    myGeomFilter->SetWireframeMode(false);
     GetProperty()->SetRepresentation(0);
     break;
+  case eWireframe:
+    myGeomFilter->SetInside(false);
+    myGeomFilter->SetWireframeMode(true);
+    GetProperty()->SetRepresentation(theMode);
+    break;
   case eInsideframe:
     myGeomFilter->SetInside(true);
+    myGeomFilter->SetWireframeMode(true);
     GetProperty()->SetRepresentation(1);
     break;
-  default :
+  case eSurface:
     myGeomFilter->SetInside(false);
+    myGeomFilter->SetWireframeMode(false);
     GetProperty()->SetRepresentation(theMode);
   }
   myRepresentation = theMode;
@@ -646,6 +654,8 @@ void SMESH_DeviceActor::SetShrinkFactor(float theValue){
 
 
 void SMESH_DeviceActor::SetHighlited(bool theIsHighlited){
+  if ( myIsHighlited == theIsHighlited )
+    return;
   myIsHighlited = theIsHighlited;
   Modified();
 }
index 885ee3d..33aa1b0 100644 (file)
 #include "SMDS_Mesh.hxx"
 #include "SMESH_Actor.h"
 #include "SMESH_ControlsDef.hxx"
-#include <VTKViewer_ExtractUnstructuredGrid.h>
+#include "SalomeApp_Application.h"
+#include "VTKViewer_ExtractUnstructuredGrid.h"
 
+#include CORBA_SERVER_HEADER(SMESH_Gen)
 #include CORBA_SERVER_HEADER(SALOME_Exception)
 
 #include <vtkCell.h>
@@ -69,271 +71,6 @@ static int MYDEBUGWITHFILES = 0;
 #endif
 
 
-namespace{
-
-  inline const SMDS_MeshNode* FindNode(const SMDS_Mesh* theMesh, int theId){
-    if(const SMDS_MeshNode* anElem = theMesh->FindNode(theId)) return anElem;
-    EXCEPTION(runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<<theId);
-  }
-
-
-  inline const SMDS_MeshElement* FindElement(const SMDS_Mesh* theMesh, int theId){
-    if(const SMDS_MeshElement* anElem = theMesh->FindElement(theId)) return anElem;
-    EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot find a SMDS_MeshElement for ID = "<<theId);
-  }
-
-
-  inline void AddNodesWithID(SMDS_Mesh* theMesh, 
-                            SMESH::log_array_var& theSeq,
-                            CORBA::Long theId)
-  {
-    const SMESH::double_array& aCoords = theSeq[theId].coords;
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(3*aNbElems != aCoords.length())
-      EXCEPTION(runtime_error,"AddNodesWithID - 3*aNbElems != aCoords.length()");
-    for(CORBA::Long aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){
-      SMDS_MeshElement* anElem = theMesh->AddNodeWithID(aCoords[aCoordId],
-                                                       aCoords[aCoordId+1],
-                                                       aCoords[aCoordId+2],
-                                                       anIndexes[anElemId]);
-      if(!anElem)
-       EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddNodeWithID for ID = "<<anElemId);
-    }
-  }
-
-
-  inline void AddEdgesWithID(SMDS_Mesh* theMesh, 
-                            SMESH::log_array_var& theSeq,
-                            CORBA::Long theId)
-  {
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(3*aNbElems != anIndexes.length())
-      EXCEPTION(runtime_error,"AddEdgeWithID - 3*aNbElems != aCoords.length()");
-    for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){
-      SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1],
-                                                       anIndexes[anIndexId+2],
-                                                       anIndexes[anIndexId]);
-      if(!anElem)
-       EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<<anElemId);
-    }
-  }
-
-
-  inline void AddTriasWithID(SMDS_Mesh* theMesh, 
-                            SMESH::log_array_var& theSeq,
-                            CORBA::Long theId)
-  {
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(4*aNbElems != anIndexes.length())
-      EXCEPTION(runtime_error,"AddEdgeWithID - 4*aNbElems != anIndexes.length()");
-    for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){
-      SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
-                                                       anIndexes[anIndexId+2],
-                                                       anIndexes[anIndexId+3],
-                                                       anIndexes[anIndexId]);
-      if(!anElem)
-       EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
-    }
-  }
-
-
-  inline void AddQuadsWithID(SMDS_Mesh* theMesh, 
-                            SMESH::log_array_var theSeq,
-                            CORBA::Long theId)
-  {
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(5*aNbElems != anIndexes.length())
-      EXCEPTION(runtime_error,"AddEdgeWithID - 4*aNbElems != anIndexes.length()");
-    for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
-      SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
-                                                       anIndexes[anIndexId+2],
-                                                       anIndexes[anIndexId+3],
-                                                       anIndexes[anIndexId+4],
-                                                       anIndexes[anIndexId]);
-      if(!anElem)
-       EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
-    }
-  }
-
-
-  inline void AddPolygonsWithID(SMDS_Mesh* theMesh, 
-                                SMESH::log_array_var& theSeq,
-                                CORBA::Long theId)
-  {
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number;
-
-    for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) {
-      int aFaceId = anIndexes[anIndexId++];
-
-      int aNbNodes = anIndexes[anIndexId++];
-      std::vector<int> nodes_ids (aNbNodes);
-      for (int i = 0; i < aNbNodes; i++) {
-        nodes_ids[i] = anIndexes[anIndexId++];
-      }
-
-      SMDS_MeshElement* anElem = theMesh->AddPolygonalFaceWithID(nodes_ids, aFaceId);
-      if (!anElem)
-       EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolygonalFaceWithID for ID = "
-                  << anElemId);
-    }
-  }
-
-
-  inline void AddTetrasWithID(SMDS_Mesh* theMesh, 
-                             SMESH::log_array_var& theSeq,
-                             CORBA::Long theId)
-  {
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(5*aNbElems != anIndexes.length())
-      EXCEPTION(runtime_error,"AddEdgeWithID - 5*aNbElems != anIndexes.length()");
-    for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
-      SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
-                                                         anIndexes[anIndexId+2],
-                                                         anIndexes[anIndexId+3],
-                                                         anIndexes[anIndexId+4],
-                                                         anIndexes[anIndexId]);
-      if(!anElem)
-       EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
-    }
-  }
-
-
-  inline void AddPiramidsWithID(SMDS_Mesh* theMesh, 
-                               SMESH::log_array_var& theSeq,
-                               CORBA::Long theId)
-  {
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(6*aNbElems != anIndexes.length())
-      EXCEPTION(runtime_error,"AddEdgeWithID - 6*aNbElems != anIndexes.length()");
-    for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){
-      SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
-                                                         anIndexes[anIndexId+2],
-                                                         anIndexes[anIndexId+3],
-                                                         anIndexes[anIndexId+4],
-                                                         anIndexes[anIndexId+5],
-                                                         anIndexes[anIndexId]);
-      if(!anElem)
-       EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
-    }
-  }
-
-
-  inline void AddPrismsWithID(SMDS_Mesh* theMesh, 
-                             SMESH::log_array_var& theSeq,
-                             CORBA::Long theId)
-  {
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(7*aNbElems != anIndexes.length())
-      EXCEPTION(runtime_error,"AddEdgeWithID - 7*aNbElems != anIndexes.length()");
-    for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=7){
-      SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
-                                                         anIndexes[anIndexId+2],
-                                                         anIndexes[anIndexId+3],
-                                                         anIndexes[anIndexId+4],
-                                                         anIndexes[anIndexId+5],
-                                                         anIndexes[anIndexId+6],
-                                                         anIndexes[anIndexId]);
-      if(!anElem)
-       EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
-    }
-  }
-
-
-  inline void AddHexasWithID(SMDS_Mesh* theMesh, 
-                            SMESH::log_array_var& theSeq,
-                            CORBA::Long theId)
-  {
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(9*aNbElems != anIndexes.length())
-      EXCEPTION(runtime_error,"AddEdgeWithID - 9*aNbElems != anIndexes.length()");
-    for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=9){
-      SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
-                                                         anIndexes[anIndexId+2],
-                                                         anIndexes[anIndexId+3],
-                                                         anIndexes[anIndexId+4],
-                                                         anIndexes[anIndexId+5],
-                                                         anIndexes[anIndexId+6],
-                                                         anIndexes[anIndexId+7],
-                                                         anIndexes[anIndexId+8],
-                                                         anIndexes[anIndexId]);
-      if(!anElem)
-       EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
-    }
-  }
-
-
-  inline void AddPolyhedronsWithID (SMDS_Mesh* theMesh, 
-                                    SMESH::log_array_var& theSeq,
-                                    CORBA::Long theId)
-  {
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number;
-
-    for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) {
-      int aFaceId = anIndexes[anIndexId++];
-
-      int aNbNodes = anIndexes[anIndexId++];
-      std::vector<int> nodes_ids (aNbNodes);
-      for (int i = 0; i < aNbNodes; i++) {
-        nodes_ids[i] = anIndexes[anIndexId++];
-      }
-
-      int aNbFaces = anIndexes[anIndexId++];
-      std::vector<int> quantities (aNbFaces);
-      for (int i = 0; i < aNbFaces; i++) {
-        quantities[i] = anIndexes[anIndexId++];
-      }
-
-      SMDS_MeshElement* anElem =
-        theMesh->AddPolyhedralVolumeWithID(nodes_ids, quantities, aFaceId);
-      if (!anElem)
-       EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolyhedralVolumeWithID for ID = "
-                  << anElemId);
-    }
-  }
-
-
-  inline void ChangePolyhedronNodes (SMDS_Mesh* theMesh, 
-                                     SMESH::log_array_var& theSeq,
-                                     CORBA::Long theId)
-  {
-    const SMESH::long_array& anIndexes = theSeq[theId].indexes;
-    CORBA::Long iind = 0, aNbElems = theSeq[theId].number;
-
-    for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++)
-    {
-      // find element
-      const SMDS_MeshElement* elem = FindElement(theMesh, anIndexes[iind++]);
-      // nb nodes
-      int nbNodes = anIndexes[iind++];
-      // nodes
-      std::vector<const SMDS_MeshNode*> aNodes (nbNodes);
-      for (int iNode = 0; iNode < nbNodes; iNode++) {
-        aNodes[iNode] = FindNode(theMesh, anIndexes[iind++]);
-      }
-      // nb faces
-      int nbFaces = anIndexes[iind++];
-      // quantities
-      std::vector<int> quantities (nbFaces);
-      for (int iFace = 0; iFace < nbFaces; iFace++) {
-        quantities[iFace] = anIndexes[iind++];
-      }
-      // change
-      theMesh->ChangePolyhedronNodes(elem, aNodes, quantities);
-    }
-  }
-
-
-}
 /*
   Class       : SMESH_VisualObjDef
   Description : Base class for all mesh objects to be visuilised
@@ -350,12 +87,16 @@ static inline vtkIdType getCellType( const SMDSAbs_ElementType theType,
   switch( theType )
   {
     case SMDSAbs_Edge: 
-      return theNbNodes == 2 ? VTK_LINE : VTK_EMPTY_CELL;
+      if( theNbNodes == 2 )         return VTK_LINE;
+      else if ( theNbNodes == 3 )   return VTK_QUADRATIC_EDGE;
+      else return VTK_EMPTY_CELL;
 
     case SMDSAbs_Face  :
       if (thePoly && theNbNodes>2 ) return VTK_POLYGON;
       else if ( theNbNodes == 3 )   return VTK_TRIANGLE;
       else if ( theNbNodes == 4 )   return VTK_QUAD;
+      else if ( theNbNodes == 6 )   return VTK_QUADRATIC_TRIANGLE;
+      else if ( theNbNodes == 8 )   return VTK_QUADRATIC_QUAD;
       else return VTK_EMPTY_CELL;
       
     case SMDSAbs_Volume:
@@ -364,6 +105,15 @@ static inline vtkIdType getCellType( const SMDSAbs_ElementType theType,
       else if ( theNbNodes == 5 )   return VTK_PYRAMID;
       else if ( theNbNodes == 6 )   return VTK_WEDGE;
       else if ( theNbNodes == 8 )   return VTK_HEXAHEDRON;
+      else if ( theNbNodes == 10 )  {
+        return VTK_QUADRATIC_TETRA;
+      }
+      else if ( theNbNodes == 20 )  {
+        return VTK_QUADRATIC_HEXAHEDRON;
+      }
+      else if ( theNbNodes==13 || theNbNodes==15 )  {
+        return VTK_CONVEX_POINT_SET;
+      }
       else return VTK_EMPTY_CELL;
 
     default: return VTK_EMPTY_CELL;
@@ -485,42 +235,6 @@ void SMESH_VisualObjDef::buildNodePrs()
   aPoints->Delete();
 
   myGrid->SetCells( 0, 0, 0 );
-
-  // Create cells
-  /*
-  int nbPoints = aPoints->GetNumberOfPoints();
-  vtkIdList *anIdList = vtkIdList::New();
-  anIdList->SetNumberOfIds( 1 );
-
-  vtkCellArray *aCells = vtkCellArray::New();
-  aCells->Allocate( 2 * nbPoints, 0 );
-
-  vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
-  aCellTypesArray->SetNumberOfComponents( 1 );
-  aCellTypesArray->Allocate( nbPoints );
-
-  for( vtkIdType aCellId = 0; aCellId < nbPoints; aCellId++ )
-  {
-    anIdList->SetId( 0, aCellId );
-    aCells->InsertNextCell( anIdList );
-    aCellTypesArray->InsertNextValue( VTK_VERTEX );
-  }
-
-  vtkIntArray* aCellLocationsArray = vtkIntArray::New();
-  aCellLocationsArray->SetNumberOfComponents( 1 );
-  aCellLocationsArray->SetNumberOfTuples( nbPoints );
-
-  aCells->InitTraversal();
-  for( vtkIdType i = 0, *pts, npts; aCells->GetNextCell( npts, pts ); i++ )
-    aCellLocationsArray->SetValue( i, aCells->GetTraversalLocation( npts ) );
-
-  myGrid->SetCells( aCellTypesArray, aCellLocationsArray, aCells );
-
-  aCellLocationsArray->Delete();
-  aCellTypesArray->Delete();
-  aCells->Delete();
-  anIdList->Delete(); 
-  */
 }
 
 //=================================================================================
@@ -651,11 +365,34 @@ void SMESH_VisualObjDef::buildElemPrs()
            static int anIds[] = {0,1,2,3,4,5};
            for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
 
-         } else if (aNbNodes == 8) {
+         }
+          else if (aNbNodes == 8) {
            static int anIds[] = {0,3,2,1,4,7,6,5};
            for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
 
-         } else {
+         }
+          else if (aNbNodes == 10) {
+           static int anIds[] = {0,2,1,3,6,5,4,7,9,8};
+           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+         }
+          else if (aNbNodes == 13) {
+           static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10};
+           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+         }
+          else if (aNbNodes == 15) {
+           static int anIds[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13};
+           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+           //for (int k = 0; k < aNbNodes; k++) {
+            //  int nn = aConnectivities[k];
+            //  const SMDS_MeshNode* N = static_cast<const SMDS_MeshNode*> (aConnect[nn]);
+            //  cout<<"k="<<k<<"  N("<<N->X()<<","<<N->Y()<<","<<N->Z()<<")"<<endl;
+            //}
+         }
+          else if (aNbNodes == 20) {
+           static int anIds[] = {0,3,2,1,4,7,6,5,11,10,9,8,15,14,13,12,16,19,18,17};
+           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+         }
+          else {
           }
 
          if (aConnectivities.size() > 0) {
@@ -748,14 +485,11 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
 // function : SMESH_MeshObj
 // purpose  : Constructor
 //=================================================================================
-SMESH_MeshObj::SMESH_MeshObj(SMESH::SMESH_Mesh_ptr theMesh)
+SMESH_MeshObj::SMESH_MeshObj(SMESH::SMESH_Mesh_ptr theMesh):
+  myClient(SalomeApp_Application::orb(),theMesh)
 {
   if ( MYDEBUG ) 
-    MESSAGE("SMESH_MeshObj - theMesh->_is_nil() = "<<theMesh->_is_nil());
-    
-  myMeshServer = SMESH::SMESH_Mesh::_duplicate( theMesh );
-  myMeshServer->Register();
-  myMesh = new SMDS_Mesh();
+    MESSAGE("SMESH_MeshObj - this = "<<this<<"; theMesh->_is_nil() = "<<theMesh->_is_nil());
 }
 
 //=================================================================================
@@ -764,8 +498,8 @@ SMESH_MeshObj::SMESH_MeshObj(SMESH::SMESH_Mesh_ptr theMesh)
 //=================================================================================
 SMESH_MeshObj::~SMESH_MeshObj()
 {
-  myMeshServer->Destroy();
-  delete myMesh;
+  if ( MYDEBUG ) 
+    MESSAGE("SMESH_MeshObj - this = "<<this<<"\n");
 }
 
 //=================================================================================
@@ -775,110 +509,8 @@ SMESH_MeshObj::~SMESH_MeshObj()
 void SMESH_MeshObj::Update( int theIsClear )
 {
   // Update SMDS_Mesh on client part
-  
-  try
-  {
-    SMESH::log_array_var aSeq = myMeshServer->GetLog( theIsClear );
-    CORBA::Long aLength = aSeq->length();
-    
-    if( MYDEBUG ) MESSAGE( "Update: length of the script is "<<aLength );
-    
-    if( !aLength )
-      return;
-
-    for ( CORBA::Long anId = 0; anId < aLength; anId++)
-    {
-      const SMESH::double_array& aCoords = aSeq[anId].coords;
-      const SMESH::long_array& anIndexes = aSeq[anId].indexes;
-      CORBA::Long anElemId = 0, aNbElems = aSeq[anId].number;
-      CORBA::Long aCommand = aSeq[anId].commandType;
-
-      switch(aCommand)
-      {
-        case SMESH::ADD_NODE       : AddNodesWithID      ( myMesh, aSeq, anId ); break;
-        case SMESH::ADD_EDGE       : AddEdgesWithID      ( myMesh, aSeq, anId ); break;
-        case SMESH::ADD_TRIANGLE   : AddTriasWithID      ( myMesh, aSeq, anId ); break;
-        case SMESH::ADD_QUADRANGLE : AddQuadsWithID      ( myMesh, aSeq, anId ); break;
-        case SMESH::ADD_POLYGON    : AddPolygonsWithID   ( myMesh, aSeq, anId ); break;
-        case SMESH::ADD_TETRAHEDRON: AddTetrasWithID     ( myMesh, aSeq, anId ); break;
-        case SMESH::ADD_PYRAMID    : AddPiramidsWithID   ( myMesh, aSeq, anId ); break;
-        case SMESH::ADD_PRISM      : AddPrismsWithID     ( myMesh, aSeq, anId ); break;
-        case SMESH::ADD_HEXAHEDRON : AddHexasWithID      ( myMesh, aSeq, anId ); break;
-        case SMESH::ADD_POLYHEDRON : AddPolyhedronsWithID( myMesh, aSeq, anId ); break;
-
-        case SMESH::REMOVE_NODE:
-          for( ; anElemId < aNbElems; anElemId++ )
-            myMesh->RemoveNode( FindNode( myMesh, anIndexes[anElemId] ) );
-        break;
-        
-        case SMESH::REMOVE_ELEMENT:
-          for( ; anElemId < aNbElems; anElemId++ )
-            myMesh->RemoveElement( FindElement( myMesh, anIndexes[anElemId] ) );
-        break;
-
-        case SMESH::MOVE_NODE:
-          for(CORBA::Long aCoordId=0; anElemId < aNbElems; anElemId++, aCoordId+=3)
-          {
-            SMDS_MeshNode* node =
-              const_cast<SMDS_MeshNode*>( FindNode( myMesh, anIndexes[anElemId] ));
-            node->setXYZ( aCoords[aCoordId], aCoords[aCoordId+1], aCoords[aCoordId+2] );
-          }
-        break;
-
-        case SMESH::CHANGE_ELEMENT_NODES:
-          for ( CORBA::Long i = 0; anElemId < aNbElems; anElemId++ )
-          {
-            // find element
-            const SMDS_MeshElement* elem = FindElement( myMesh, anIndexes[i++] );
-            // nb nodes
-            int nbNodes = anIndexes[i++];
-            // nodes
-            //ASSERT( nbNodes < 9 );
-            const SMDS_MeshNode* aNodes[ nbNodes ];
-            for ( int iNode = 0; iNode < nbNodes; iNode++ )
-              aNodes[ iNode ] = FindNode( myMesh, anIndexes[i++] );
-            // change
-            myMesh->ChangeElementNodes( elem, aNodes, nbNodes );
-          }
-          break;
-
-        case SMESH::CHANGE_POLYHEDRON_NODES:
-          ChangePolyhedronNodes(myMesh, aSeq, anId);
-          break;
-        case SMESH::RENUMBER:
-          for(CORBA::Long i=0; anElemId < aNbElems; anElemId++, i+=3)
-          {
-            myMesh->Renumber( anIndexes[i], anIndexes[i+1], anIndexes[i+2] );
-          }
-          break;
-          
-        default:;
-      }
-    }
-  }
-  catch ( SALOME::SALOME_Exception& exc )
-  {
-    INFOS("Following exception was cought:\n\t"<<exc.details.text);
-  }
-  catch( const std::exception& exc)
-  {
-    INFOS("Following exception was cought:\n\t"<<exc.what());
-  }
-  catch(...)
-  {
-    INFOS("Unknown exception was cought !!!");
-  }
-  
-  if ( MYDEBUG )
-  {
-    MESSAGE("Update - myMesh->NbNodes() = "<<myMesh->NbNodes());
-    MESSAGE("Update - myMesh->NbEdges() = "<<myMesh->NbEdges());
-    MESSAGE("Update - myMesh->NbFaces() = "<<myMesh->NbFaces());
-    MESSAGE("Update - myMesh->NbVolumes() = "<<myMesh->NbVolumes());
-  }
-
-  // Fill unstructured grid
-  buildPrs();
+  if ( myClient.Update(theIsClear) )
+    buildPrs();  // Fill unstructured grid
 }
 
 //=================================================================================
@@ -887,7 +519,7 @@ void SMESH_MeshObj::Update( int theIsClear )
 //=================================================================================
 int SMESH_MeshObj::GetElemDimension( const int theObjId )
 {
-  const SMDS_MeshElement* anElem = myMesh->FindElement( theObjId );
+  const SMDS_MeshElement* anElem = myClient->FindElement( theObjId );
   if ( anElem == 0 )
     return 0;
 
@@ -911,22 +543,22 @@ int SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const
   {
     case SMDSAbs_Node:
     {
-      return myMesh->NbNodes();
+      return myClient->NbNodes();
     }
     break;
     case SMDSAbs_Edge:
     {
-      return myMesh->NbEdges();
+      return myClient->NbEdges();
     }
     break;
     case SMDSAbs_Face:
     {
-      return myMesh->NbFaces();
+      return myClient->NbFaces();
     }
     break;
     case SMDSAbs_Volume:
     {
-      return myMesh->NbVolumes();
+      return myClient->NbVolumes();
     }
     break;
     default:
@@ -943,25 +575,25 @@ int SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList&
   {
     case SMDSAbs_Node:
     {
-      SMDS_NodeIteratorPtr anIter = myMesh->nodesIterator();
+      SMDS_NodeIteratorPtr anIter = myClient->nodesIterator();
       while ( anIter->more() ) theObjs.push_back( anIter->next() );
     }
     break;
     case SMDSAbs_Edge:
     {
-      SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
+      SMDS_EdgeIteratorPtr anIter = myClient->edgesIterator();
       while ( anIter->more() ) theObjs.push_back( anIter->next() );
     }
     break;
     case SMDSAbs_Face:
     {
-      SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
+      SMDS_FaceIteratorPtr anIter = myClient->facesIterator();
       while ( anIter->more() ) theObjs.push_back( anIter->next() );
     }
     break;
     case SMDSAbs_Volume:
     {
-      SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator();
+      SMDS_VolumeIteratorPtr anIter = myClient->volumesIterator();
       while ( anIter->more() ) theObjs.push_back( anIter->next() );
     }
     break;
@@ -987,7 +619,7 @@ void SMESH_MeshObj::UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor
 //=================================================================================
 bool SMESH_MeshObj::IsNodePrs() const
 {
-  return myMesh->NbEdges() == 0 &&myMesh->NbFaces() == 0 &&myMesh->NbVolumes() == 0 ;
+  return myClient->NbEdges() == 0 &&myClient->NbFaces() == 0 && myClient->NbVolumes() == 0 ;
 }
 
 
@@ -1256,15 +888,3 @@ bool SMESH_subMeshObj::IsNodePrs() const
 {
   return mySubMeshServer->GetNumberOfElements() == 0;
 }
-
-
-
-
-
-
-
-
-
-
-
-
index 134b47b..f45f14a 100644 (file)
 #ifndef SMESH_OBJECTDEF_H
 #define SMESH_OBJECTDEF_H
 
+#include "SMESH_Controls.hxx"
+#include "SMESH_Object.h"
+#include "SMESH_Client.hxx"
+
 // IDL Headers
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SMESH_Mesh)
@@ -37,9 +41,6 @@
 #include <map>
 #include <list>
 
-#include "SMESH_Controls.hxx"
-#include "SMESH_Object.h"
-
 class vtkPoints;
 class SALOME_ExtractUnstructuredGrid;
 
@@ -121,13 +122,11 @@ public:
 
   virtual void              UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor );
   
-  SMESH::SMESH_Mesh_ptr     GetMeshServer() { return myMeshServer.in(); }
-  SMDS_Mesh*                GetMesh() const { return myMesh; }
+  SMESH::SMESH_Mesh_ptr     GetMeshServer() { return myClient.GetMeshServer(); }
+  SMDS_Mesh*                GetMesh() const { return myClient.GetMesh(); }
 
 protected:
-
-  SMESH::SMESH_Mesh_var     myMeshServer;
-  SMDS_Mesh*                myMesh;
+  SMESH_Client              myClient;
 };
 
 
index e066e25..7ecaf31 100644 (file)
@@ -59,21 +59,10 @@ LIB_SRC = \
        SMDS_FaceOfEdges.cxx \
        SMDS_FaceOfNodes.cxx \
        SMDS_PolygonalFaceOfNodes.cxx \
-       SMDS_VolumeTool.cxx
-#      SMDS_Tria3OfNodes.cxx \
-#      SMDS_HexahedronOfNodes.cxx
-
-#SMDSControl_BoundaryEdges.cxx \
-#SMDSControl_BoundaryFaces.cxx \
-#SMDSControl.cxx \
-#SMDSControl_MeshBoundary.cxx \
-#SMDSEdit_Transform.cxx \
-#SMDS_MeshNodeIDFactory.cxx \
-#SMDS_MeshPrism.cxx \
-#SMDS_MeshPyramid.cxx \
-#SMDS_MeshQuadrangle.cxx \
-#SMDS_MeshTetrahedron.cxx \
-#SMDS_MeshTriangle.cxx \
+       SMDS_VolumeTool.cxx \
+       SMDS_QuadraticEdge.cxx \
+       SMDS_QuadraticFaceOfNodes.cxx \
+       SMDS_QuadraticVolumeOfNodes.cxx
 
 
 LIB_CLIENT_IDL = 
@@ -113,21 +102,11 @@ EXPORT_HEADERS= \
        SMDS_FaceOfEdges.hxx \
        SMDS_FaceOfNodes.hxx \
        SMDS_PolygonalFaceOfNodes.hxx \
-       SMDS_VolumeTool.hxx
-#      SMDS_Tria3OfNodes.hxx \
-#      SMDS_HexahedronOfNodes.hxx
-
-#SMDSControl_BoundaryEdges.hxx \
-#SMDSControl_BoundaryFaces.hxx \
-#SMDSControl.hxx \
-#SMDSControl_MeshBoundary.hxx \
-#SMDSEdit_Transform.hxx \
-#SMDS_MeshPrism.hxx \
-#SMDS_MeshPyramid.hxx \
-#SMDS_MeshQuadrangle.hxx \
-#SMDS_MeshTetrahedron.hxx \
-#SMDS_MeshTriangle.hxx \
-#SMDS_MeshNodeIDFactory.hxx
+       SMDS_VolumeTool.hxx \
+       SMDS_QuadraticEdge.hxx \
+       SMDS_QuadraticFaceOfNodes.hxx \
+       SMDS_QuadraticVolumeOfNodes.hxx \
+       SMDS_SetIterator.hxx
 
 # additionnal information to compil and link file
 CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome $(OCC_INCLUDES) $(BOOST_CPPFLAGS)
index c8432af..6ff0986 100755 (executable)
 #include <boost/shared_ptr.hpp>
 
 class SMDS_MeshElement;
+class SMDS_MeshNode;
+class SMDS_MeshEdge;
+class SMDS_MeshFace;
+class SMDS_MeshVolume;
 
 typedef SMDS_Iterator<const SMDS_MeshElement *> SMDS_ElemIterator;
 typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshElement *> > SMDS_ElemIteratorPtr;
 
+typedef SMDS_Iterator<const SMDS_MeshNode *> SMDS_NodeIterator;
+typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshNode *> > SMDS_NodeIteratorPtr;
+
+typedef SMDS_Iterator<const SMDS_MeshEdge *> SMDS_EdgeIterator;
+typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshEdge *> > SMDS_EdgeIteratorPtr;
+
+typedef SMDS_Iterator<const SMDS_MeshFace *> SMDS_FaceIterator;
+typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshFace *> > SMDS_FaceIteratorPtr;
+
+typedef SMDS_Iterator<const SMDS_MeshVolume *> SMDS_VolumeIterator;
+typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshVolume *> > SMDS_VolumeIteratorPtr;
+
 #endif
index 640c55d..7a014af 100644 (file)
@@ -155,3 +155,29 @@ SMDS_FaceOfEdges::SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
 
 }*/
 
+
+int SMDS_FaceOfEdges::NbNodes() const
+{
+  return myEdges[0]->NbNodes() + myEdges[1]->NbNodes() + myEdges[2]->NbNodes() +
+    ( myNbEdges == 4 ? myEdges[3]->NbNodes() : 0 ) - myNbEdges;
+}
+
+/*!
+ * \brief Return node by its index
+ * \param ind - node index
+ * \retval const SMDS_MeshNode* - the node
+ * 
+ * Index is wrapped if it is out of a valid range
+ */
+const SMDS_MeshNode* SMDS_FaceOfEdges::GetNode(const int ind) const
+{
+  int index = WrappedIndex( ind );
+  for ( int i = 0; i < myNbEdges; ++i ) {
+    if ( index >= myEdges[ i ]->NbNodes() )
+      index -= myEdges[ i ]->NbNodes();
+    else
+      return myEdges[ i ]->GetNode( index );
+  }
+  return 0;
+}
+
index cd8e5dd..54a9a68 100644 (file)
@@ -42,10 +42,21 @@ class SMDS_FaceOfEdges:public SMDS_MeshFace
                          const SMDS_MeshEdge* edge4);
                
        SMDSAbs_ElementType GetType() const;
+       int NbNodes() const;
        int NbEdges() const;
        int NbFaces() const;
 //     friend bool operator<(const SMDS_FaceOfEdges& e1, const SMDS_FaceOfEdges& e2);
 
+
+  /*!
+   * \brief Return node by its index
+    * \param ind - node index
+    * \retval const SMDS_MeshNode* - the node
+   * 
+   * Index is wrapped if it is out of a valid range
+   */
+  virtual const SMDS_MeshNode* GetNode(const int ind) const;
+
   protected:
        SMDS_ElemIteratorPtr
                elementsIterator(SMDSAbs_ElementType type) const;
index aa68708..018bd88 100644 (file)
@@ -23,6 +23,7 @@
 #pragma warning(disable:4786)
 #endif
 
+#include "SMDS_SetIterator.hxx"
 #include "SMDS_FaceOfNodes.hxx"
 #include "SMDS_IteratorOfElements.hxx"
 #include "SMDS_MeshNode.hxx"
@@ -68,25 +69,11 @@ void SMDS_FaceOfNodes::Print(ostream & OS) const
 //purpose  : 
 //=======================================================================
 
-class SMDS_FaceOfNodes_MyIterator:public SMDS_ElemIterator
+class SMDS_FaceOfNodes_MyIterator:public SMDS_NodeArrayElemIterator
 {
-  const SMDS_MeshNode* const *mySet;
-  int myLength;
-  int index;
  public:
   SMDS_FaceOfNodes_MyIterator(const SMDS_MeshNode* const *s, int l):
-    mySet(s),myLength(l),index(0) {}
-
-  bool more()
-  {
-    return index<myLength;
-  }
-
-  const SMDS_MeshElement* next()
-  {
-    index++;
-    return mySet[index-1];
-  }
+    SMDS_NodeArrayElemIterator( s, & s[ l ] ) {}
 };
 
 SMDS_ElemIteratorPtr SMDS_FaceOfNodes::elementsIterator
@@ -147,6 +134,18 @@ bool SMDS_FaceOfNodes::ChangeNodes(const SMDS_MeshNode* nodes[],
   return true;
 }
 
+/*!
+ * \brief Return node by its index
+ * \param ind - node index
+ * \retval const SMDS_MeshNode* - the node
+ * 
+ * Index is wrapped if it is out of a valid range
+ */
+const SMDS_MeshNode* SMDS_FaceOfNodes::GetNode(const int ind) const
+{
+  return myNodes[ WrappedIndex( ind )];
+}
+
 /*bool operator<(const SMDS_FaceOfNodes& f1, const SMDS_FaceOfNodes& f2)
 {
        set<SMDS_MeshNode> set1,set2;
index 2901951..8cbdf6f 100644 (file)
@@ -44,6 +44,16 @@ class SMDS_FaceOfNodes:public SMDS_MeshFace
        int NbEdges() const;
        int NbFaces() const;
        int NbNodes() const;
+
+  /*!
+   * \brief Return node by its index
+    * \param ind - node index
+    * \retval const SMDS_MeshNode* - the node
+   * 
+   * Index is wrapped if it is out of a valid range
+   */
+  virtual const SMDS_MeshNode* GetNode(const int ind) const;
+
   protected:
        SMDS_ElemIteratorPtr
                elementsIterator(SMDSAbs_ElementType type) const;
index 6381e54..5df2090 100644 (file)
@@ -31,6 +31,9 @@
 #include "SMDS_FaceOfEdges.hxx"
 #include "SMDS_PolyhedralVolumeOfNodes.hxx"
 #include "SMDS_PolygonalFaceOfNodes.hxx"
+#include "SMDS_QuadraticEdge.hxx"
+#include "SMDS_QuadraticFaceOfNodes.hxx"
+#include "SMDS_QuadraticVolumeOfNodes.hxx"
 
 #include <algorithm>
 #include <map>
@@ -1084,19 +1087,32 @@ bool SMDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * elem,
       if ( edge )
         Ok = const_cast<SMDS_MeshEdge*>( edge )->ChangeNodes( nodes[0], nodes[1] );
     }
+    else if ( nbnodes == 3 ) {
+      const SMDS_QuadraticEdge* edge = dynamic_cast<const SMDS_QuadraticEdge*>( elem );
+      if ( edge )
+        Ok = const_cast<SMDS_QuadraticEdge*>( edge )->ChangeNodes( nodes[0], nodes[1], nodes[2] );
+    }
     break;
   }
   case SMDSAbs_Face: {
     const SMDS_FaceOfNodes* face = dynamic_cast<const SMDS_FaceOfNodes*>( elem );
     if ( face ) {
       Ok = const_cast<SMDS_FaceOfNodes*>( face )->ChangeNodes( nodes, nbnodes );
-    } else {
-      /// ??? begin
-      const SMDS_PolygonalFaceOfNodes* face = dynamic_cast<const SMDS_PolygonalFaceOfNodes*>(elem);
-      if (face) {
-        Ok = const_cast<SMDS_PolygonalFaceOfNodes*>(face)->ChangeNodes(nodes, nbnodes);
+    }
+    else {
+      const SMDS_QuadraticFaceOfNodes* QF =
+        dynamic_cast<const SMDS_QuadraticFaceOfNodes*>( elem );
+      if ( QF ) {
+        Ok = const_cast<SMDS_QuadraticFaceOfNodes*>( QF )->ChangeNodes( nodes, nbnodes );
+      }
+      else {
+        /// ??? begin
+        const SMDS_PolygonalFaceOfNodes* face = dynamic_cast<const SMDS_PolygonalFaceOfNodes*>(elem);
+        if (face) {
+          Ok = const_cast<SMDS_PolygonalFaceOfNodes*>(face)->ChangeNodes(nodes, nbnodes);
+        }
+        /// ??? end
       }
-      /// ??? end
     }
     break;
   }
@@ -1109,8 +1125,15 @@ bool SMDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * elem,
   //}
   case SMDSAbs_Volume: {
     const SMDS_VolumeOfNodes* vol = dynamic_cast<const SMDS_VolumeOfNodes*>( elem );
-    if ( vol )
+    if ( vol ) {
       Ok = const_cast<SMDS_VolumeOfNodes*>( vol )->ChangeNodes( nodes, nbnodes );
+    }
+    else {
+      const SMDS_QuadraticVolumeOfNodes* QV = dynamic_cast<const SMDS_QuadraticVolumeOfNodes*>( elem );
+      if ( QV ) {
+        Ok = const_cast<SMDS_QuadraticVolumeOfNodes*>( QV )->ChangeNodes( nodes, nbnodes );
+      }
+    }
     break;
   }
   default:
@@ -1200,6 +1223,7 @@ bool SMDS_Mesh::ChangePolyhedronNodes (const SMDS_MeshElement * elem,
   return Ok;
 }
 
+
 //=======================================================================
 //function : FindEdge
 //purpose  :
@@ -1207,54 +1231,95 @@ bool SMDS_Mesh::ChangePolyhedronNodes (const SMDS_MeshElement * elem,
 
 const SMDS_MeshEdge* SMDS_Mesh::FindEdge(int idnode1, int idnode2) const
 {
-       const SMDS_MeshNode * node1=FindNode(idnode1);
-       const SMDS_MeshNode * node2=FindNode(idnode2);
-       if((node1==NULL)||(node2==NULL)) return NULL;
-       return FindEdge(node1,node2);
+  const SMDS_MeshNode * node1=FindNode(idnode1);
+  const SMDS_MeshNode * node2=FindNode(idnode2);
+  if((node1==NULL)||(node2==NULL)) return NULL;
+  return FindEdge(node1,node2);
 }
 
 //#include "Profiler.h"
 const SMDS_MeshEdge* SMDS_Mesh::FindEdge(const SMDS_MeshNode * node1,
                                          const SMDS_MeshNode * node2)
 {
-       const SMDS_MeshEdge * toReturn=NULL;
-       //PROFILER_Init();
-       //PROFILER_Set();
-       SMDS_ElemIteratorPtr it1=node1->edgesIterator();
-       //PROFILER_Get(0);
-       //PROFILER_Set();
-       while(it1->more())
-       {
-               const SMDS_MeshEdge * e=static_cast<const SMDS_MeshEdge *>
-                       (it1->next());
-               SMDS_ElemIteratorPtr it2=e->nodesIterator();
-               while(it2->more())
-               {
-                       if(it2->next()->GetID()==node2->GetID())
-                       {
-                               toReturn=e;
-                               break;
-                       }
-               }
-       }
-       //PROFILER_Get(1);
-       return toReturn;
+  const SMDS_MeshEdge * toReturn=NULL;
+  //PROFILER_Init();
+  //PROFILER_Set();
+  SMDS_ElemIteratorPtr it1=node1->edgesIterator();
+  //PROFILER_Get(0);
+  //PROFILER_Set();
+  while(it1->more()) {
+    const SMDS_MeshEdge * e=static_cast<const SMDS_MeshEdge *> (it1->next());
+    SMDS_ElemIteratorPtr it2=e->nodesIterator();
+    while(it2->more()) {
+      if(it2->next()->GetID()==node2->GetID()) {
+        toReturn = e;
+        break;
+      }
+    }
+  }
+  //PROFILER_Get(1);
+  return toReturn;
 }
 
 
+//=======================================================================
+//function : FindEdgeOrCreate
+//purpose  :
+//=======================================================================
+
 SMDS_MeshEdge* SMDS_Mesh::FindEdgeOrCreate(const SMDS_MeshNode * node1,
-       const SMDS_MeshNode * node2) 
+                                           const SMDS_MeshNode * node2) 
 {
-       SMDS_MeshEdge * toReturn=NULL;
-       toReturn=const_cast<SMDS_MeshEdge*>(FindEdge(node1,node2));
-       if(toReturn==NULL)      
-       {
-          toReturn=new SMDS_MeshEdge(node1,node2);
-          myEdges.Add(toReturn);
-       } 
-       return toReturn;
+  SMDS_MeshEdge * toReturn=NULL;
+  toReturn=const_cast<SMDS_MeshEdge*>(FindEdge(node1,node2));
+  if(toReturn==NULL) {
+    toReturn=new SMDS_MeshEdge(node1,node2);
+    myEdges.Add(toReturn);
+  } 
+  return toReturn;
+}
+
+
+//=======================================================================
+//function : FindEdge
+//purpose  :
+//=======================================================================
+
+const SMDS_MeshEdge* SMDS_Mesh::FindEdge(int idnode1, int idnode2,
+                                         int idnode3) const
+{
+  const SMDS_MeshNode * node1=FindNode(idnode1);
+  const SMDS_MeshNode * node2=FindNode(idnode2);
+  const SMDS_MeshNode * node3=FindNode(idnode3);
+  if( (node1==NULL) || (node2==NULL)  || (node3==NULL) ) return NULL;
+  return FindEdge(node1,node2,node3);
+}
+
+const SMDS_MeshEdge* SMDS_Mesh::FindEdge(const SMDS_MeshNode * node1,
+                                         const SMDS_MeshNode * node2,
+                                         const SMDS_MeshNode * node3)
+{
+  const SMDS_MeshEdge * toReturn = NULL;
+  SMDS_ElemIteratorPtr it1 = node1->edgesIterator();
+  while(it1->more()) {
+    const SMDS_MeshEdge * e = static_cast<const SMDS_MeshEdge *> (it1->next());
+    SMDS_ElemIteratorPtr it2 = e->nodesIterator();
+    int tmp = 0;
+    while(it2->more()) {
+      int nID = it2->next()->GetID();
+      if( nID==node2->GetID() || nID==node3->GetID() ) {
+        tmp++;
+        if(tmp==2) {
+          toReturn = e;
+          break;
+        }
+      }
+    }
+  }
+  return toReturn;
 }
 
+
 //=======================================================================
 //function : FindFace
 //purpose  :
@@ -1263,118 +1328,219 @@ SMDS_MeshEdge* SMDS_Mesh::FindEdgeOrCreate(const SMDS_MeshNode * node1,
 const SMDS_MeshFace* SMDS_Mesh::FindFace(int idnode1, int idnode2,
        int idnode3) const
 {
-       const SMDS_MeshNode * node1=FindNode(idnode1);
-       const SMDS_MeshNode * node2=FindNode(idnode2);
-       const SMDS_MeshNode * node3=FindNode(idnode3);
-       if((node1==NULL)||(node2==NULL)||(node3==NULL)) return NULL;
-       return FindFace(node1, node2, node3);
+  const SMDS_MeshNode * node1=FindNode(idnode1);
+  const SMDS_MeshNode * node2=FindNode(idnode2);
+  const SMDS_MeshNode * node3=FindNode(idnode3);
+  if( (node1==NULL) || (node2==NULL) || (node3==NULL) ) return NULL;
+  return FindFace(node1, node2, node3);
 }
 
-const SMDS_MeshFace* SMDS_Mesh::FindFace(
-               const SMDS_MeshNode *node1,
-               const SMDS_MeshNode *node2,
-               const SMDS_MeshNode *node3)
+const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1,
+                                         const SMDS_MeshNode *node2,
+                                         const SMDS_MeshNode *node3)
 {
-       const SMDS_MeshFace * face;
-       const SMDS_MeshElement * node;
-       bool node2found, node3found;
-
-       SMDS_ElemIteratorPtr it1=node1->facesIterator();
-       while(it1->more())
-       {
-               face=static_cast<const SMDS_MeshFace*>(it1->next());
-               if(face->NbNodes()!=3) continue;
-               SMDS_ElemIteratorPtr it2=face->nodesIterator();
-               node2found=false;
-               node3found=false;
-               while(it2->more())
-               {
-                       node=it2->next();
-                       if(node->GetID()==node2->GetID()) node2found=true;
-                       if(node->GetID()==node3->GetID()) node3found=true;
-               }
-               if(node2found&&node3found)
-                       return face;
-       }
-       return NULL;
+  const SMDS_MeshFace * face;
+  const SMDS_MeshElement * node;
+  bool node2found, node3found;
+
+  SMDS_ElemIteratorPtr it1 = node1->facesIterator();
+  while(it1->more()) {
+    face = static_cast<const SMDS_MeshFace*>(it1->next());
+    if(face->NbNodes()!=3) continue;
+    SMDS_ElemIteratorPtr it2 = face->nodesIterator();
+    node2found = false;
+    node3found = false;
+    while(it2->more()) {
+      node = it2->next();
+      if(node->GetID()==node2->GetID()) node2found = true;
+      if(node->GetID()==node3->GetID()) node3found = true;
+    }
+    if( node2found && node3found )
+      return face;
+  }
+  return NULL;
 }
 
-SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(
-               const SMDS_MeshNode *node1,
-               const SMDS_MeshNode *node2,
-               const SMDS_MeshNode *node3)
+SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(const SMDS_MeshNode *node1,
+                                           const SMDS_MeshNode *node2,
+                                           const SMDS_MeshNode *node3)
 {
-       SMDS_MeshFace * toReturn=NULL;
-       toReturn=const_cast<SMDS_MeshFace*>(FindFace(node1,node2,node3));
-       if(toReturn==NULL)
-       {
-         toReturn=createTriangle(node1,node2,node3);
-       }
-       return toReturn;
+  SMDS_MeshFace * toReturn=NULL;
+  toReturn = const_cast<SMDS_MeshFace*>(FindFace(node1,node2,node3));
+  if(toReturn==NULL) {
+    toReturn = createTriangle(node1,node2,node3);
+  }
+  return toReturn;
 }
 
+
 //=======================================================================
 //function : FindFace
 //purpose  :
 //=======================================================================
 
-const SMDS_MeshFace* SMDS_Mesh::FindFace(int idnode1, int idnode2, int idnode3,
-       int idnode4) const
+const SMDS_MeshFace* SMDS_Mesh::FindFace(int idnode1, int idnode2,
+                                         int idnode3, int idnode4) const
 {
-       const SMDS_MeshNode * node1=FindNode(idnode1);
-       const SMDS_MeshNode * node2=FindNode(idnode2);
-       const SMDS_MeshNode * node3=FindNode(idnode3);
-       const SMDS_MeshNode * node4=FindNode(idnode4);
-       if((node1==NULL)||(node2==NULL)||(node3==NULL)||(node4==NULL)) return NULL;
-       return FindFace(node1, node2, node3, node4);
+  const SMDS_MeshNode * node1=FindNode(idnode1);
+  const SMDS_MeshNode * node2=FindNode(idnode2);
+  const SMDS_MeshNode * node3=FindNode(idnode3);
+  const SMDS_MeshNode * node4=FindNode(idnode4);
+  if( (node1==NULL) || (node2==NULL) || (node3==NULL) || (node4==NULL) )
+    return NULL;
+  return FindFace(node1, node2, node3, node4);
 }
 
-const SMDS_MeshFace* SMDS_Mesh::FindFace(
-               const SMDS_MeshNode *node1,
-               const SMDS_MeshNode *node2,
-               const SMDS_MeshNode *node3,
-               const SMDS_MeshNode *node4)
+const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1,
+                                         const SMDS_MeshNode *node2,
+                                         const SMDS_MeshNode *node3,
+                                         const SMDS_MeshNode *node4)
 {
-       const SMDS_MeshFace * face;
-       const SMDS_MeshElement * node;
-       bool node2found, node3found, node4found;
-       SMDS_ElemIteratorPtr it1=node1->facesIterator();
-       while(it1->more())
-       {
-               face=static_cast<const SMDS_MeshFace *>(it1->next());
-               if(face->NbNodes()!=4) continue;
-               SMDS_ElemIteratorPtr it2=face->nodesIterator();
-               node2found=false;
-               node3found=false;
-               node4found=false;
-               while(it2->more())
-               {
-                       node=it2->next();
-                       if(node->GetID()==node2->GetID()) node2found=true;
-                       if(node->GetID()==node3->GetID()) node3found=true;
-                       if(node->GetID()==node4->GetID()) node4found=true;
-               }
-               if(node2found&&node3found&&node4found)
-                       return face;
-       }
-       return NULL;
+  const SMDS_MeshFace * face;
+  const SMDS_MeshElement * node;
+  bool node2found, node3found, node4found;
+  SMDS_ElemIteratorPtr it1 = node1->facesIterator();
+  while(it1->more()) {
+    face = static_cast<const SMDS_MeshFace *>(it1->next());
+    if(face->NbNodes()!=4) continue;
+    SMDS_ElemIteratorPtr it2 = face->nodesIterator();
+    node2found = false;
+    node3found = false;
+    node4found = false;
+    while(it2->more()) {
+      node=it2->next();
+      if(node->GetID()==node2->GetID()) node2found = true;
+      if(node->GetID()==node3->GetID()) node3found = true;
+      if(node->GetID()==node4->GetID()) node4found = true;
+    }
+    if( node2found && node3found && node4found )
+      return face;
+  }
+  return NULL;
 }
 
-SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(
-               const SMDS_MeshNode *node1,
-               const SMDS_MeshNode *node2,
-               const SMDS_MeshNode *node3,
-               const SMDS_MeshNode *node4)
+SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(const SMDS_MeshNode *node1,
+                                           const SMDS_MeshNode *node2,
+                                           const SMDS_MeshNode *node3,
+                                           const SMDS_MeshNode *node4)
 {
-       SMDS_MeshFace * toReturn=NULL;
-       toReturn=const_cast<SMDS_MeshFace*>(FindFace(node1,node2,node3,node4));
-       if(toReturn==NULL)
-       {
-         toReturn=createQuadrangle(node1,node2,node3,node4);
-       }
-       return toReturn;
+  SMDS_MeshFace * toReturn=NULL;
+  toReturn=const_cast<SMDS_MeshFace*>(FindFace(node1,node2,node3,node4));
+  if(toReturn==NULL) {
+    toReturn=createQuadrangle(node1,node2,node3,node4);
+  }
+  return toReturn;
+}
+
+
+//=======================================================================
+//function : FindFace
+//purpose  :quadratic triangle
+//=======================================================================
+
+const SMDS_MeshFace* SMDS_Mesh::FindFace(int idnode1, int idnode2,
+                                         int idnode3, int idnode4,
+                                         int idnode5, int idnode6) const
+{
+  const SMDS_MeshNode * node1 = FindNode(idnode1);
+  const SMDS_MeshNode * node2 = FindNode(idnode2);
+  const SMDS_MeshNode * node3 = FindNode(idnode3);
+  const SMDS_MeshNode * node4 = FindNode(idnode4);
+  const SMDS_MeshNode * node5 = FindNode(idnode5);
+  const SMDS_MeshNode * node6 = FindNode(idnode6);
+  if( (node1==NULL) || (node2==NULL) || (node3==NULL) ||
+      (node4==NULL) || (node5==NULL) || (node6==NULL) ) return NULL;
+  return FindFace(node1, node2, node3, node4, node5, node6);
+}
+
+const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1,
+                                         const SMDS_MeshNode *node2,
+                                         const SMDS_MeshNode *node3,
+                                         const SMDS_MeshNode *node4,
+                                         const SMDS_MeshNode *node5,
+                                         const SMDS_MeshNode *node6)
+{
+  const SMDS_MeshFace * face;
+  const SMDS_MeshElement * node;
+  SMDS_ElemIteratorPtr it1 = node1->facesIterator();
+  while(it1->more()) {
+    face = static_cast<const SMDS_MeshFace*>(it1->next());
+    if(face->NbNodes()!=6) continue;
+    SMDS_ElemIteratorPtr it2 = face->nodesIterator();
+    int tmp = 0;
+    while(it2->more()) {
+      node = it2->next();
+      if(node->GetID()==node2->GetID()) tmp++;
+      if(node->GetID()==node3->GetID()) tmp++;
+      if(node->GetID()==node4->GetID()) tmp++;
+      if(node->GetID()==node5->GetID()) tmp++;
+      if(node->GetID()==node6->GetID()) tmp++;
+    }
+    if( tmp==5 )
+      return static_cast<const SMDS_MeshFace*>(face);
+  }
+  return NULL;
+}
+
+
+//=======================================================================
+//function : FindFace
+//purpose  : quadratic quadrangle
+//=======================================================================
+
+const SMDS_MeshFace* SMDS_Mesh::FindFace(int idnode1, int idnode2,
+                                         int idnode3, int idnode4,
+                                         int idnode5, int idnode6,
+                                         int idnode7, int idnode8) const
+{
+  const SMDS_MeshNode * node1 = FindNode(idnode1);
+  const SMDS_MeshNode * node2 = FindNode(idnode2);
+  const SMDS_MeshNode * node3 = FindNode(idnode3);
+  const SMDS_MeshNode * node4 = FindNode(idnode4);
+  const SMDS_MeshNode * node5 = FindNode(idnode5);
+  const SMDS_MeshNode * node6 = FindNode(idnode6);
+  const SMDS_MeshNode * node7 = FindNode(idnode7);
+  const SMDS_MeshNode * node8 = FindNode(idnode8);
+  if( (node1==NULL) || (node2==NULL) || (node3==NULL) || (node4==NULL) ||
+      (node5==NULL) || (node6==NULL) || (node7==NULL) || (node8==NULL) )
+    return NULL;
+  return FindFace(node1, node2, node3, node4, node5, node6, node7, node8);
+}
+
+const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1,
+                                         const SMDS_MeshNode *node2,
+                                         const SMDS_MeshNode *node3,
+                                         const SMDS_MeshNode *node4,
+                                         const SMDS_MeshNode *node5,
+                                         const SMDS_MeshNode *node6,
+                                         const SMDS_MeshNode *node7,
+                                         const SMDS_MeshNode *node8)
+{
+  const SMDS_MeshFace * face;
+  const SMDS_MeshElement * node;
+  SMDS_ElemIteratorPtr it1 = node1->facesIterator();
+  while(it1->more()) {
+    face = static_cast<const SMDS_MeshFace *>(it1->next());
+    if(face->NbNodes()!=8) continue;
+    SMDS_ElemIteratorPtr it2 = face->nodesIterator();
+    int tmp = 0;
+    while(it2->more()) {
+      node = it2->next();
+      if(node->GetID()==node2->GetID()) tmp++;
+      if(node->GetID()==node3->GetID()) tmp++;
+      if(node->GetID()==node4->GetID()) tmp++;
+      if(node->GetID()==node5->GetID()) tmp++;
+      if(node->GetID()==node6->GetID()) tmp++;
+      if(node->GetID()==node7->GetID()) tmp++;
+      if(node->GetID()==node8->GetID()) tmp++;
+    }
+    if( tmp==7 )
+      return face;
+  }
+  return NULL;
 }
 
+
 //=======================================================================
 //function : FindElement
 //purpose  :
@@ -1382,7 +1548,7 @@ SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(
 
 const SMDS_MeshElement* SMDS_Mesh::FindElement(int IDelem) const
 {
-       return myElementIDFactory->MeshElement(IDelem);
+  return myElementIDFactory->MeshElement(IDelem);
 }
 
 //=======================================================================
@@ -2075,6 +2241,57 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
   delete s1;
 }
 
+  
+///////////////////////////////////////////////////////////////////////////////
+///@param elem The element to delete
+///////////////////////////////////////////////////////////////////////////////
+void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
+{
+  SMDSAbs_ElementType aType = elem->GetType();
+  if (aType == SMDSAbs_Node) {
+    // only free node can be removed by this method
+    const SMDS_MeshNode* n = static_cast<const SMDS_MeshNode*>(elem);
+    SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
+    if (!itFe->more()) { // free node
+      myNodes.Remove(const_cast<SMDS_MeshNode*>(n));
+      myNodeIDFactory->ReleaseID(elem->GetID());
+      delete elem;
+    }
+  } else {
+    if (hasConstructionEdges() || hasConstructionFaces())
+      // this methods is only for meshes without descendants
+      return;
+
+    // Remove element from <InverseElements> of its nodes
+    SMDS_ElemIteratorPtr itn = elem->nodesIterator();
+    while (itn->more()) {
+      SMDS_MeshNode * n = static_cast<SMDS_MeshNode *>
+        (const_cast<SMDS_MeshElement *>(itn->next()));
+      n->RemoveInverseElement(elem);
+    }
+
+    // in meshes without descendants elements are always free
+    switch (aType) {
+    case SMDSAbs_Edge:
+      myEdges.Remove(static_cast<SMDS_MeshEdge*>
+                     (const_cast<SMDS_MeshElement*>(elem)));
+      break;
+    case SMDSAbs_Face:
+      myFaces.Remove(static_cast<SMDS_MeshFace*>
+                     (const_cast<SMDS_MeshElement*>(elem)));
+      break;
+    case SMDSAbs_Volume:
+      myVolumes.Remove(static_cast<SMDS_MeshVolume*>
+                       (const_cast<SMDS_MeshElement*>(elem)));
+      break;
+    default:
+      break;
+    }
+    myElementIDFactory->ReleaseID(elem->GetID());
+    delete elem;
+  }
+}
+
 /*!
  * Checks if the element is present in mesh.
  * Useful to determine dead pointers.
@@ -2200,4 +2417,589 @@ SMDSAbs_ElementType SMDS_Mesh::GetElementType( const int id, const bool iselem )
   }
   else
     return elem->GetType();
-}
\ No newline at end of file
+}
+
+
+
+//********************************************************************
+//********************************************************************
+//********                                                   *********
+//*****       Methods for addition of quadratic elements        ******
+//********                                                   *********
+//********************************************************************
+//********************************************************************
+
+//=======================================================================
+//function : AddEdgeWithID
+//purpose  : 
+//=======================================================================
+SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(int n1, int n2, int n12, int ID) 
+{
+  SMDS_MeshNode* node1 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1);
+  SMDS_MeshNode* node2 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2);
+  SMDS_MeshNode* node12 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12);
+  if(!node1 || !node2 || !node12) return NULL;
+  return SMDS_Mesh::AddEdgeWithID(node1, node2, node12, ID);
+}
+
+//=======================================================================
+//function : AddEdge
+//purpose  : 
+//=======================================================================
+SMDS_MeshEdge* SMDS_Mesh::AddEdge(const SMDS_MeshNode* n1,
+                                 const SMDS_MeshNode* n2,
+                                  const SMDS_MeshNode* n12)
+{
+  return SMDS_Mesh::AddEdgeWithID(n1, n2, n12, myElementIDFactory->GetFreeID());
+}
+
+//=======================================================================
+//function : AddEdgeWithID
+//purpose  : 
+//=======================================================================
+SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
+                                       const SMDS_MeshNode * n2, 
+                                       const SMDS_MeshNode * n12, 
+                                       int ID)
+{
+  SMDS_QuadraticEdge* edge = new SMDS_QuadraticEdge(n1,n2,n12);
+  if(myElementIDFactory->BindID(ID, edge)) {
+    SMDS_MeshNode *node1,*node2, *node12;
+    node1 = const_cast<SMDS_MeshNode*>(n1);
+    node2 = const_cast<SMDS_MeshNode*>(n2);
+    node12 = const_cast<SMDS_MeshNode*>(n12);
+    node1->AddInverseElement(edge);
+    node2->AddInverseElement(edge);
+    node12->AddInverseElement(edge);
+    myEdges.Add(edge);
+    return edge;
+  } 
+  else {
+    delete edge;
+    return NULL;
+  }
+}
+
+
+//=======================================================================
+//function : AddFace
+//purpose  : 
+//=======================================================================
+SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1,
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n3,
+                                  const SMDS_MeshNode * n12,
+                                  const SMDS_MeshNode * n23,
+                                  const SMDS_MeshNode * n31)
+{
+  return SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31,
+                                  myElementIDFactory->GetFreeID());
+}
+
+//=======================================================================
+//function : AddFaceWithID
+//purpose  : 
+//=======================================================================
+SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3,
+                                        int n12,int n23,int n31, int ID)
+{
+  SMDS_MeshNode * node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n1);
+  SMDS_MeshNode * node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n2);
+  SMDS_MeshNode * node3 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n3);
+  SMDS_MeshNode * node12 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n12);
+  SMDS_MeshNode * node23 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n23);
+  SMDS_MeshNode * node31 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n31);
+  if(!node1 || !node2 || !node3 || !node12 || !node23 || !node31) return NULL;
+  return SMDS_Mesh::AddFaceWithID(node1, node2, node3,
+                                  node12, node23, node31, ID);
+}
+
+//=======================================================================
+//function : AddFaceWithID
+//purpose  : 
+//=======================================================================
+SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
+                                        const SMDS_MeshNode * n2,
+                                        const SMDS_MeshNode * n3,
+                                        const SMDS_MeshNode * n12,
+                                        const SMDS_MeshNode * n23,
+                                        const SMDS_MeshNode * n31, 
+                                        int ID)
+{
+  if(hasConstructionEdges()) {
+    // creation quadratic edges - not implemented
+  }
+  SMDS_QuadraticFaceOfNodes* face =
+    new SMDS_QuadraticFaceOfNodes(n1,n2,n3,n12,n23,n31);
+  myFaces.Add(face);
+
+  if (!registerElement(ID, face)) {
+    RemoveElement(face, false);
+    face = NULL;
+  }
+  return face;
+}
+
+
+//=======================================================================
+//function : AddFace
+//purpose  : 
+//=======================================================================
+SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1,
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n3,
+                                 const SMDS_MeshNode * n4,
+                                  const SMDS_MeshNode * n12,
+                                  const SMDS_MeshNode * n23,
+                                  const SMDS_MeshNode * n34,
+                                  const SMDS_MeshNode * n41)
+{
+  return SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41,
+                                  myElementIDFactory->GetFreeID());
+}
+
+//=======================================================================
+//function : AddFaceWithID
+//purpose  : 
+//=======================================================================
+SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4,
+                                        int n12,int n23,int n34,int n41, int ID)
+{
+  SMDS_MeshNode * node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n1);
+  SMDS_MeshNode * node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n2);
+  SMDS_MeshNode * node3 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n3);
+  SMDS_MeshNode * node4 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n4);
+  SMDS_MeshNode * node12 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n12);
+  SMDS_MeshNode * node23 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n23);
+  SMDS_MeshNode * node34 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n34);
+  SMDS_MeshNode * node41 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n41);
+  if(!node1 || !node2 || !node3 || !node4 ||
+     !node12 || !node23 || !node34 || !node41) return NULL;
+  return SMDS_Mesh::AddFaceWithID(node1, node2, node3, node4,
+                                  node12, node23, node34, node41, ID);
+}
+
+//=======================================================================
+//function : AddFaceWithID
+//purpose  : 
+//=======================================================================
+SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
+                                        const SMDS_MeshNode * n2,
+                                        const SMDS_MeshNode * n3,
+                                        const SMDS_MeshNode * n4,
+                                        const SMDS_MeshNode * n12,
+                                        const SMDS_MeshNode * n23,
+                                        const SMDS_MeshNode * n34, 
+                                        const SMDS_MeshNode * n41, 
+                                        int ID)
+{
+  if(hasConstructionEdges()) {
+    // creation quadratic edges - not implemented
+  }
+  SMDS_QuadraticFaceOfNodes* face =
+    new SMDS_QuadraticFaceOfNodes(n1,n2,n3,n4,n12,n23,n34,n41);
+  myFaces.Add(face);
+
+  if (!registerElement(ID, face)) {
+    RemoveElement(face, false);
+    face = NULL;
+  }
+  return face;
+}
+
+
+//=======================================================================
+//function : AddVolume
+//purpose  : 
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
+                                     const SMDS_MeshNode * n2, 
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                      const SMDS_MeshNode * n12,
+                                      const SMDS_MeshNode * n23,
+                                      const SMDS_MeshNode * n31,
+                                      const SMDS_MeshNode * n14, 
+                                      const SMDS_MeshNode * n24,
+                                      const SMDS_MeshNode * n34)
+{
+  int ID = myElementIDFactory->GetFreeID();
+  SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n12, n23,
+                                                   n31, n14, n24, n34, ID);
+  if(v==NULL) myElementIDFactory->ReleaseID(ID);
+  return v;
+}
+
+//=======================================================================
+//function : AddVolumeWithID
+//purpose  : 
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
+                                            int n12,int n23,int n31,
+                                            int n14,int n24,int n34, int ID)
+{
+  SMDS_MeshNode *node1, *node2, *node3, *node4, *node12, *node23;
+  SMDS_MeshNode *node31, *node14, *node24, *node34;
+  node1 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1);
+  node2 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2);
+  node3 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n3);
+  node4 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n4);
+  node12 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12);
+  node23 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n23);
+  node31 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n31);
+  node14 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n14);
+  node24 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n24);
+  node34 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n34);
+  if( !node1 || !node2 || !node3 || !node4 || !node12 || !node23 ||
+     !node31 || !node14 || !node24 || !node34 ) return NULL;
+  return SMDS_Mesh::AddVolumeWithID(node1, node2, node3, node4, node12, node23,
+                                    node31, node14, node24, node34, ID);
+}
+       
+//=======================================================================
+//function : AddVolumeWithID
+//purpose  : 2d order tetrahedron of 10 nodes
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
+                                            const SMDS_MeshNode * n2,
+                                            const SMDS_MeshNode * n3,
+                                            const SMDS_MeshNode * n4,
+                                            const SMDS_MeshNode * n12,
+                                            const SMDS_MeshNode * n23,
+                                            const SMDS_MeshNode * n31,
+                                            const SMDS_MeshNode * n14, 
+                                            const SMDS_MeshNode * n24,
+                                            const SMDS_MeshNode * n34,
+                                            int ID)
+{
+  if(hasConstructionFaces()) {
+    // creation quadratic faces - not implemented
+  }
+  SMDS_QuadraticVolumeOfNodes * volume =
+    new SMDS_QuadraticVolumeOfNodes(n1,n2,n3,n4,n12,n23,n31,n14,n24,n34);
+  myVolumes.Add(volume);
+
+  if (!registerElement(ID, volume)) {
+    RemoveElement(volume, false);
+    volume = NULL;
+  }
+  return volume;
+}
+
+
+//=======================================================================
+//function : AddVolume
+//purpose  : 
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
+                                     const SMDS_MeshNode * n2, 
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                      const SMDS_MeshNode * n5, 
+                                      const SMDS_MeshNode * n12,
+                                      const SMDS_MeshNode * n23,
+                                      const SMDS_MeshNode * n34,
+                                      const SMDS_MeshNode * n41,
+                                      const SMDS_MeshNode * n15, 
+                                      const SMDS_MeshNode * n25,
+                                      const SMDS_MeshNode * n35,
+                                      const SMDS_MeshNode * n45)
+{
+  int ID = myElementIDFactory->GetFreeID();
+  SMDS_MeshVolume * v =
+    SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n12, n23, n34, n41,
+                               n15, n25, n35, n45, ID);
+  if(v==NULL) myElementIDFactory->ReleaseID(ID);
+  return v;
+}
+
+//=======================================================================
+//function : AddVolumeWithID
+//purpose  : 
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5,
+                                            int n12,int n23,int n34,int n41,
+                                            int n15,int n25,int n35,int n45, int ID)
+{
+  SMDS_MeshNode *node1, *node2, *node3, *node4, *node5;
+  SMDS_MeshNode *node12, *node23, *node34, *node41;
+  SMDS_MeshNode *node15, *node25, *node35, *node45;
+  node1 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1);
+  node2 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2);
+  node3 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n3);
+  node4 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n4);
+  node5 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n5);
+  node12 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12);
+  node23 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n23);
+  node34 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n34);
+  node41 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n41);
+  node15 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n15);
+  node25 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n25);
+  node35 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n35);
+  node45 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n45);
+  if( !node1 || !node2 || !node3 || !node4 || !node5 ||
+      !node12 || !node23 || !node34 || !node41 ||
+      !node15 || !node25 || !node35 || !node45 ) return NULL;
+  return SMDS_Mesh::AddVolumeWithID(node1, node2, node3, node4, node5,
+                                    node12, node23, node34, node41,
+                                    node15, node25, node35, node45, ID);
+}
+       
+//=======================================================================
+//function : AddVolumeWithID
+//purpose  : 2d order pyramid of 13 nodes
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
+                                            const SMDS_MeshNode * n2,
+                                            const SMDS_MeshNode * n3,
+                                            const SMDS_MeshNode * n4,
+                                            const SMDS_MeshNode * n5, 
+                                            const SMDS_MeshNode * n12,
+                                            const SMDS_MeshNode * n23,
+                                            const SMDS_MeshNode * n34,
+                                            const SMDS_MeshNode * n41,
+                                            const SMDS_MeshNode * n15, 
+                                            const SMDS_MeshNode * n25,
+                                            const SMDS_MeshNode * n35,
+                                            const SMDS_MeshNode * n45,
+                                            int ID)
+{
+  if(hasConstructionFaces()) {
+    // creation quadratic faces - not implemented
+  }
+  SMDS_QuadraticVolumeOfNodes * volume =
+    new SMDS_QuadraticVolumeOfNodes(n1,n2,n3,n4,n5,n12,n23,
+                                    n34,n41,n15,n25,n35,n45);
+  myVolumes.Add(volume);
+
+  if (!registerElement(ID, volume)) {
+    RemoveElement(volume, false);
+    volume = NULL;
+  }
+  return volume;
+}
+
+
+//=======================================================================
+//function : AddVolume
+//purpose  : 
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
+                                     const SMDS_MeshNode * n2, 
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                      const SMDS_MeshNode * n5, 
+                                      const SMDS_MeshNode * n6, 
+                                      const SMDS_MeshNode * n12,
+                                      const SMDS_MeshNode * n23,
+                                      const SMDS_MeshNode * n31, 
+                                      const SMDS_MeshNode * n45,
+                                      const SMDS_MeshNode * n56,
+                                      const SMDS_MeshNode * n64, 
+                                      const SMDS_MeshNode * n14,
+                                      const SMDS_MeshNode * n25,
+                                      const SMDS_MeshNode * n36)
+{
+  int ID = myElementIDFactory->GetFreeID();
+  SMDS_MeshVolume * v =
+    SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n12, n23, n31,
+                               n45, n56, n64, n14, n25, n36, ID);
+  if(v==NULL) myElementIDFactory->ReleaseID(ID);
+  return v;
+}
+
+//=======================================================================
+//function : AddVolumeWithID
+//purpose  : 
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
+                                            int n4, int n5, int n6,
+                                            int n12,int n23,int n31,
+                                            int n45,int n56,int n64,
+                                            int n14,int n25,int n36, int ID)
+{
+  SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6;
+  SMDS_MeshNode *node12, *node23, *node31;
+  SMDS_MeshNode *node45, *node56, *node64;
+  SMDS_MeshNode *node14, *node25, *node36;
+  node1 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1);
+  node2 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2);
+  node3 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n3);
+  node4 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n4);
+  node5 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n5);
+  node6 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n6);
+  node12 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12);
+  node23 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n23);
+  node31 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n31);
+  node45 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n45);
+  node56 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n56);
+  node64 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n64);
+  node14 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n14);
+  node25 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n25);
+  node36 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n36);
+  if( !node1 || !node2 || !node3 || !node4 || !node5 || !node6 ||
+      !node12 || !node23 || !node31 || !node45 || !node56 ||
+      !node64 || !node14 || !node25 || !node36 ) return NULL;
+  return SMDS_Mesh::AddVolumeWithID(node1, node2, node3, node4, node5, node6,
+                                    node12, node23, node31, node45, node56,
+                                    node64, node14, node25, node36, ID);
+}
+       
+//=======================================================================
+//function : AddVolumeWithID
+//purpose  : 2d order Pentahedron with 15 nodes
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
+                                            const SMDS_MeshNode * n2,
+                                            const SMDS_MeshNode * n3,
+                                            const SMDS_MeshNode * n4,
+                                            const SMDS_MeshNode * n5, 
+                                            const SMDS_MeshNode * n6, 
+                                            const SMDS_MeshNode * n12,
+                                            const SMDS_MeshNode * n23,
+                                            const SMDS_MeshNode * n31, 
+                                            const SMDS_MeshNode * n45,
+                                            const SMDS_MeshNode * n56,
+                                            const SMDS_MeshNode * n64, 
+                                            const SMDS_MeshNode * n14,
+                                            const SMDS_MeshNode * n25,
+                                            const SMDS_MeshNode * n36,
+                                            int ID)
+{
+  if(hasConstructionFaces()) {
+    // creation quadratic faces - not implemented
+  }
+  SMDS_QuadraticVolumeOfNodes * volume =
+    new SMDS_QuadraticVolumeOfNodes(n1,n2,n3,n4,n5,n6,n12,n23,n31,
+                                    n45,n56,n64,n14,n25,n36);
+  myVolumes.Add(volume);
+
+  if (!registerElement(ID, volume)) {
+    RemoveElement(volume, false);
+    volume = NULL;
+  }
+  return volume;
+}
+
+
+//=======================================================================
+//function : AddVolume
+//purpose  : 
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
+                                     const SMDS_MeshNode * n2, 
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                      const SMDS_MeshNode * n5, 
+                                      const SMDS_MeshNode * n6, 
+                                      const SMDS_MeshNode * n7,
+                                      const SMDS_MeshNode * n8, 
+                                      const SMDS_MeshNode * n12,
+                                      const SMDS_MeshNode * n23,
+                                      const SMDS_MeshNode * n34,
+                                      const SMDS_MeshNode * n41, 
+                                      const SMDS_MeshNode * n56,
+                                      const SMDS_MeshNode * n67,
+                                      const SMDS_MeshNode * n78,
+                                      const SMDS_MeshNode * n85, 
+                                      const SMDS_MeshNode * n15,
+                                      const SMDS_MeshNode * n26,
+                                      const SMDS_MeshNode * n37,
+                                      const SMDS_MeshNode * n48)
+{
+  int ID = myElementIDFactory->GetFreeID();
+  SMDS_MeshVolume * v =
+    SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, n12, n23, n34, n41,
+                               n56, n67, n78, n85, n15, n26, n37, n48, ID);
+  if(v==NULL) myElementIDFactory->ReleaseID(ID);
+  return v;
+}
+
+//=======================================================================
+//function : AddVolumeWithID
+//purpose  : 
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
+                                            int n5, int n6, int n7, int n8,
+                                            int n12,int n23,int n34,int n41,
+                                            int n56,int n67,int n78,int n85,
+                                            int n15,int n26,int n37,int n48, int ID)
+{
+  SMDS_MeshNode *node1, *node2, *node3, *node4;
+  SMDS_MeshNode *node5, *node6, *node7, *node8;
+  SMDS_MeshNode *node12, *node23, *node34, *node41;
+  SMDS_MeshNode *node56, *node67, *node78, *node85;
+  SMDS_MeshNode *node15, *node26, *node37, *node48;
+  node1 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1);
+  node2 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2);
+  node3 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n3);
+  node4 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n4);
+  node5 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n5);
+  node6 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n6);
+  node7 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n7);
+  node8 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n8);
+  node12 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12);
+  node23 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n23);
+  node34 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n34);
+  node41 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n41);
+  node56 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n56);
+  node67 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n67);
+  node78 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n78);
+  node85 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n85);
+  node15 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n15);
+  node26 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n26);
+  node37 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n37);
+  node48 = (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n48);
+  if( !node1 || !node2 || !node3 || !node4 ||
+      !node5 || !node6 || !node7 || !node8 ||
+      !node12 || !node23 || !node34 || !node41 ||
+      !node56 || !node67 || !node78 || !node85 ||
+      !node15 || !node26 || !node37 || !node48 ) return NULL;
+  return SMDS_Mesh::AddVolumeWithID(node1, node2, node3, node4,
+                                    node5, node6, node7, node8,
+                                    node12, node23, node34, node41,
+                                    node56, node67, node78, node85,
+                                    node15, node26, node37, node48, ID);
+}
+       
+//=======================================================================
+//function : AddVolumeWithID
+//purpose  : 2d order Hexahedrons with 20 nodes
+//=======================================================================
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
+                                            const SMDS_MeshNode * n2,
+                                            const SMDS_MeshNode * n3,
+                                            const SMDS_MeshNode * n4,
+                                            const SMDS_MeshNode * n5, 
+                                            const SMDS_MeshNode * n6, 
+                                            const SMDS_MeshNode * n7,
+                                            const SMDS_MeshNode * n8, 
+                                            const SMDS_MeshNode * n12,
+                                            const SMDS_MeshNode * n23,
+                                            const SMDS_MeshNode * n34,
+                                            const SMDS_MeshNode * n41, 
+                                            const SMDS_MeshNode * n56,
+                                            const SMDS_MeshNode * n67,
+                                            const SMDS_MeshNode * n78,
+                                            const SMDS_MeshNode * n85, 
+                                            const SMDS_MeshNode * n15,
+                                            const SMDS_MeshNode * n26,
+                                            const SMDS_MeshNode * n37,
+                                            const SMDS_MeshNode * n48,
+                                            int ID)
+{
+  if(hasConstructionFaces()) {
+    // creation quadratic faces - not implemented
+  }
+  SMDS_QuadraticVolumeOfNodes * volume =
+    new SMDS_QuadraticVolumeOfNodes(n1,n2,n3,n4,n5,n6,n7,n8,n12,n23,n34,n41,
+                                    n56,n67,n78,n85,n15,n26,n37,n48);
+  myVolumes.Add(volume);
+
+  if (!registerElement(ID, volume)) {
+    RemoveElement(volume, false);
+    volume = NULL;
+  }
+  return volume;
+}
+
index 612082c..00db00f 100644 (file)
 #include <set>
 #include <list>
 
-typedef SMDS_Iterator<const SMDS_MeshNode *> SMDS_NodeIterator;
-typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshNode *> > SMDS_NodeIteratorPtr;
-typedef SMDS_Iterator<const SMDS_MeshEdge *> SMDS_EdgeIterator;
-typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshEdge *> > SMDS_EdgeIteratorPtr;
-typedef SMDS_Iterator<const SMDS_MeshFace *> SMDS_FaceIterator;
-typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshFace *> > SMDS_FaceIteratorPtr;
-typedef SMDS_Iterator<const SMDS_MeshVolume *> SMDS_VolumeIterator;
-typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshVolume *> > SMDS_VolumeIteratorPtr;
-
 class SMDS_WNT_EXPORT SMDS_Mesh:public SMDS_MeshObject{
 public:
   
@@ -84,6 +75,16 @@ public:
   virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
                                 const SMDS_MeshNode * n2);
   
+  // 2d order edge with 3 nodes: n12 - node between n1 and n2
+  virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID);
+  virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
+                                      const SMDS_MeshNode * n2, 
+                                      const SMDS_MeshNode * n12, 
+                                      int ID);
+  virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n12);
+
   virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID);
   virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
                                       const SMDS_MeshNode * n2,
@@ -120,6 +121,44 @@ public:
                                  const SMDS_MeshEdge * e3,
                                  const SMDS_MeshEdge * e4);
 
+  // 2d order triangle of 6 nodes
+  virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
+                                       int n12,int n23,int n31, int ID);
+  virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
+                                      const SMDS_MeshNode * n2,
+                                      const SMDS_MeshNode * n3, 
+                                      const SMDS_MeshNode * n12,
+                                      const SMDS_MeshNode * n23,
+                                      const SMDS_MeshNode * n31, 
+                                      int ID);
+  virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
+                                const SMDS_MeshNode * n2,
+                                const SMDS_MeshNode * n3,
+                                 const SMDS_MeshNode * n12,
+                                const SMDS_MeshNode * n23,
+                                const SMDS_MeshNode * n31);
+
+  // 2d order quadrangle
+  virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
+                                       int n12,int n23,int n34,int n41, int ID);
+  virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
+                                      const SMDS_MeshNode * n2,
+                                      const SMDS_MeshNode * n3,
+                                      const SMDS_MeshNode * n4, 
+                                      const SMDS_MeshNode * n12,
+                                      const SMDS_MeshNode * n23,
+                                      const SMDS_MeshNode * n34,
+                                      const SMDS_MeshNode * n41, 
+                                      int ID);
+  virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
+                                const SMDS_MeshNode * n2,
+                                const SMDS_MeshNode * n3,
+                                const SMDS_MeshNode * n4,
+                                 const SMDS_MeshNode * n12,
+                                const SMDS_MeshNode * n23,
+                                const SMDS_MeshNode * n34,
+                                const SMDS_MeshNode * n41);
+
   virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
                                           const SMDS_MeshNode * n2,
@@ -214,6 +253,153 @@ public:
                                      const SMDS_MeshFace * f5,
                                      const SMDS_MeshFace * f6);
 
+  // 2d order tetrahedron of 10 nodes
+  virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
+                                           int n12,int n23,int n31,
+                                           int n14,int n24,int n34, int ID);
+  virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
+                                          const SMDS_MeshNode * n2,
+                                          const SMDS_MeshNode * n3,
+                                          const SMDS_MeshNode * n4, 
+                                          const SMDS_MeshNode * n12,
+                                          const SMDS_MeshNode * n23,
+                                          const SMDS_MeshNode * n31,
+                                          const SMDS_MeshNode * n14, 
+                                          const SMDS_MeshNode * n24,
+                                          const SMDS_MeshNode * n34, 
+                                          int ID);
+  virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
+                                    const SMDS_MeshNode * n2,
+                                    const SMDS_MeshNode * n3,
+                                    const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n12,
+                                     const SMDS_MeshNode * n23,
+                                     const SMDS_MeshNode * n31,
+                                     const SMDS_MeshNode * n14, 
+                                     const SMDS_MeshNode * n24,
+                                     const SMDS_MeshNode * n34);
+
+  // 2d order pyramid of 13 nodes
+  virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5,
+                                           int n12,int n23,int n34,int n41,
+                                           int n15,int n25,int n35,int n45,
+                                           int ID);
+  virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
+                                          const SMDS_MeshNode * n2,
+                                          const SMDS_MeshNode * n3,
+                                          const SMDS_MeshNode * n4,
+                                          const SMDS_MeshNode * n5, 
+                                          const SMDS_MeshNode * n12,
+                                          const SMDS_MeshNode * n23,
+                                          const SMDS_MeshNode * n34,
+                                          const SMDS_MeshNode * n41, 
+                                          const SMDS_MeshNode * n15,
+                                          const SMDS_MeshNode * n25,
+                                          const SMDS_MeshNode * n35,
+                                          const SMDS_MeshNode * n45, 
+                                          int ID);
+  virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
+                                    const SMDS_MeshNode * n2,
+                                    const SMDS_MeshNode * n3,
+                                    const SMDS_MeshNode * n4,
+                                    const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n12,
+                                     const SMDS_MeshNode * n23,
+                                     const SMDS_MeshNode * n34,
+                                     const SMDS_MeshNode * n41, 
+                                     const SMDS_MeshNode * n15,
+                                     const SMDS_MeshNode * n25,
+                                     const SMDS_MeshNode * n35,
+                                     const SMDS_MeshNode * n45);
+
+  // 2d order Pentahedron with 15 nodes
+  virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3,
+                                           int n4, int n5, int n6,
+                                           int n12,int n23,int n31,
+                                           int n45,int n56,int n64,
+                                           int n14,int n25,int n36,
+                                           int ID);
+  virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
+                                          const SMDS_MeshNode * n2,
+                                          const SMDS_MeshNode * n3,
+                                          const SMDS_MeshNode * n4,
+                                          const SMDS_MeshNode * n5,
+                                          const SMDS_MeshNode * n6, 
+                                          const SMDS_MeshNode * n12,
+                                          const SMDS_MeshNode * n23,
+                                          const SMDS_MeshNode * n31, 
+                                          const SMDS_MeshNode * n45,
+                                          const SMDS_MeshNode * n56,
+                                          const SMDS_MeshNode * n64, 
+                                          const SMDS_MeshNode * n14,
+                                          const SMDS_MeshNode * n25,
+                                          const SMDS_MeshNode * n36, 
+                                          int ID);
+  virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
+                                    const SMDS_MeshNode * n2,
+                                    const SMDS_MeshNode * n3,
+                                    const SMDS_MeshNode * n4,
+                                    const SMDS_MeshNode * n5,
+                                    const SMDS_MeshNode * n6, 
+                                     const SMDS_MeshNode * n12,
+                                     const SMDS_MeshNode * n23,
+                                     const SMDS_MeshNode * n31, 
+                                     const SMDS_MeshNode * n45,
+                                     const SMDS_MeshNode * n56,
+                                     const SMDS_MeshNode * n64, 
+                                     const SMDS_MeshNode * n14,
+                                     const SMDS_MeshNode * n25,
+                                     const SMDS_MeshNode * n36);
+
+  // 2d oreder Hexahedrons with 20 nodes
+  virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
+                                           int n5, int n6, int n7, int n8,
+                                           int n12,int n23,int n34,int n41,
+                                           int n56,int n67,int n78,int n85,
+                                           int n15,int n26,int n37,int n48,
+                                           int ID);
+  virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
+                                          const SMDS_MeshNode * n2,
+                                          const SMDS_MeshNode * n3,
+                                          const SMDS_MeshNode * n4,
+                                          const SMDS_MeshNode * n5,
+                                          const SMDS_MeshNode * n6,
+                                          const SMDS_MeshNode