Salome HOME
0020946: EDF 1466 SMESH: Add a new control criteria: Max element length
authorouv <ouv@opencascade.com>
Thu, 14 Oct 2010 11:08:31 +0000 (11:08 +0000)
committerouv <ouv@opencascade.com>
Thu, 14 Oct 2010 11:08:31 +0000 (11:08 +0000)
38 files changed:
doc/salome/gui/SMESH/images/image42.png [new file with mode: 0755]
doc/salome/gui/SMESH/images/image43.png [new file with mode: 0755]
doc/salome/gui/SMESH/images/max_element_length_2d.png [new file with mode: 0755]
doc/salome/gui/SMESH/images/max_element_length_3d.png [new file with mode: 0755]
doc/salome/gui/SMESH/input/about_quality_controls.doc
doc/salome/gui/SMESH/input/area.doc
doc/salome/gui/SMESH/input/aspect_ratio.doc
doc/salome/gui/SMESH/input/aspect_ratio_3d.doc
doc/salome/gui/SMESH/input/length_2d.doc
doc/salome/gui/SMESH/input/max_element_length_2d.doc [new file with mode: 0644]
doc/salome/gui/SMESH/input/max_element_length_3d.doc [new file with mode: 0644]
doc/salome/gui/SMESH/input/minimum_angle.doc
doc/salome/gui/SMESH/input/selection_filter_library.doc
doc/salome/gui/SMESH/input/skew.doc
doc/salome/gui/SMESH/input/taper.doc
doc/salome/gui/SMESH/input/tui_filters.doc
doc/salome/gui/SMESH/input/tui_quality_controls.doc
doc/salome/gui/SMESH/input/volume.doc
doc/salome/gui/SMESH/input/warping.doc
idl/SMESH_Filter.idl
resources/Makefile.am
resources/mesh_max_element_length_2d.png [new file with mode: 0755]
resources/mesh_max_element_length_3d.png [new file with mode: 0755]
src/Controls/SMESHControls.cxx
src/Controls/SMESH_Controls.cxx
src/Controls/SMESH_ControlsDef.hxx
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_Actor.h
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESHGUI_Selection.cxx
src/SMESHGUI/SMESH_images.ts
src/SMESHGUI/SMESH_msg_en.ts
src/SMESH_I/SMESH_DumpPython.cxx
src/SMESH_I/SMESH_Filter_i.cxx
src/SMESH_I/SMESH_Filter_i.hxx
src/SMESH_SWIG/SMESH_controls.py
src/SMESH_SWIG/smeshDC.py

diff --git a/doc/salome/gui/SMESH/images/image42.png b/doc/salome/gui/SMESH/images/image42.png
new file mode 100755 (executable)
index 0000000..d0120fa
Binary files /dev/null and b/doc/salome/gui/SMESH/images/image42.png differ
diff --git a/doc/salome/gui/SMESH/images/image43.png b/doc/salome/gui/SMESH/images/image43.png
new file mode 100755 (executable)
index 0000000..7b6b895
Binary files /dev/null and b/doc/salome/gui/SMESH/images/image43.png differ
diff --git a/doc/salome/gui/SMESH/images/max_element_length_2d.png b/doc/salome/gui/SMESH/images/max_element_length_2d.png
new file mode 100755 (executable)
index 0000000..d19c80e
Binary files /dev/null and b/doc/salome/gui/SMESH/images/max_element_length_2d.png differ
diff --git a/doc/salome/gui/SMESH/images/max_element_length_3d.png b/doc/salome/gui/SMESH/images/max_element_length_3d.png
new file mode 100755 (executable)
index 0000000..356e5e2
Binary files /dev/null and b/doc/salome/gui/SMESH/images/max_element_length_3d.png differ
index 0d7ab61b0b05f5bbd7c39214228b1cf3e488c61c..8f78c38c5340d8ff4b4ed58fe057ca9bf3c8753a 100644 (file)
@@ -13,24 +13,25 @@ the meshing elements and these calculated values is shown with the
 help of a scalar bar, which is displayed near the presentation of your
 mesh.
 
-There are 0D, 1D, 2D and 3D quality controls.
+There are four types of quality controls, corresponding to node, edge,
+face and volume entity type.
 
-0D mesh quality controls:
+Node quality controls:
 <ul>
-<li>\ref free_nodes_page "Free nodes"</li>
+<li>\subpage free_nodes_page "Free nodes"</li>
 </ul>
 
-1D mesh quality controls:
+Edge quality controls:
 <ul>
+<li>\subpage free_edges_page "Free edges"</li>
 <li>\subpage free_borders_page "Free borders"</li>
-<li>\subpage borders_at_multi_connection_page "Borders at multi-connection"</li>
 <li>\subpage length_page "Length"</li>
+<li>\subpage borders_at_multi_connection_page "Borders at multi-connection"</li>
 </ul>
 
-2D mesh quality controls:
+Face quality controls:
 <ul>
-<li>\subpage free_nodes_page "Free nodes"</li>
-<li>\subpage free_edges_page "Free edges"</li>
+<li>\subpage free_faces_page "Free faces"</li>
 <li>\subpage length_2d_page "Length 2D"</li>
 <li>\subpage borders_at_multi_connection_2d_page "Borders at multi-connection 2D"</li>
 <li>\subpage area_page "Area"</li>
@@ -39,13 +40,14 @@ There are 0D, 1D, 2D and 3D quality controls.
 <li>\subpage minimum_angle_page "Minimum angle"</li>
 <li>\subpage warping_page "Warping"</li>
 <li>\subpage skew_page "Skew"</li>
+<li>\subpage max_element_length_2d_page "Max element length 2D"</li>
 </ul>
 
-3D mesh quality controls:
+Volume quality controls:
 <ul>
 <li>\subpage aspect_ratio_3d_page "Aspect ratio 3D"</li>
 <li>\subpage volume_page "Volume"</li>
-<li>\subpage free_faces_page "Free faces"</li>
+<li>\subpage max_element_length_3d_page "Max element length 3D"</li>
 </ul>
 
 */
index bef0c0f8aed9748c0b389fa53cef6b42216296dc..f650a3fd65b1b867cd932b75fd99cdbf9560104e 100644 (file)
@@ -11,7 +11,8 @@ quadrangles).
 <ol>
 <li>Display your mesh in the viewer.</li>
 
-<li>Choose <b>Controls > Area</b> or click <em>"Area"</em> button. 
+<li>Choose <b>Controls > Face Controls > Area</b> or click
+<em>"Area"</em> button. 
 
 \image html image35.png
 <center><em>"Area" button</em></center>
index 5e1f316738c7ee1a3a013862a502e0bc4d259ecf..c6c3dbdee3cb3bd648e253eef153bd84c57ffd89 100644 (file)
@@ -24,8 +24,8 @@ nodes is calculated by the formula:
 <ol>
 <li>Display your mesh in the viewer.</li>
 
-<li>Choose <b>Controls > Aspect Ratio</b> or click <em>"Aspect
-Ratio"</em> button in the toolbar.
+<li>Choose <b>Controls > Face Controls > Aspect Ratio</b> or click
+<em>"Aspect Ratio"</em> button in the toolbar.
 
 \image html image37.png
 <center><em>"Aspect Ratio" button</em></center>
index 751e411028fe4a3c9fe9d60ef633b7dba312c0a2..6e8b708080618c6d889f41dad1d6c0eefc1ba1f0 100644 (file)
@@ -21,8 +21,8 @@ by the formula:
 <ol>
 <li>Display your mesh in the viewer.</li>
 
-<li>Choose <b>Controls > Aspect Ratio 3D</b> or click <em>"Aspect Ratio 3D"</em> 
-button of the toolbar.
+<li>Choose <b>Controls > Volume Controls > Aspect Ratio 3D</b> or click
+<em>"Aspect Ratio 3D"</em> button of the toolbar.
 
 \image html image144.png
 <center><em>"Aspect Ratio 3D" button</em></center>
index def8afa9585b81a93e9edd949e47991acaed5292..4ed5b69e6a408857ce3e01af34ae6adb0c99f644 100644 (file)
@@ -10,8 +10,8 @@ of your mesh.
 <ol>
 <li>Display your mesh in the viewer. </li>
 
-<li>Choose <b>Controls > Length 2D</b> or click <em>"Length 2D"</em>
-button in the toolbar. 
+<li>Choose <b>Controls > Face Controls > Length 2D</b> or click
+<em>"Length 2D"</em> button in the toolbar. 
 
 \image html image34.png
 <center><em>"Length 2D" button</em></center>
diff --git a/doc/salome/gui/SMESH/input/max_element_length_2d.doc b/doc/salome/gui/SMESH/input/max_element_length_2d.doc
new file mode 100644 (file)
index 0000000..0c062f8
--- /dev/null
@@ -0,0 +1,29 @@
+/*!
+
+\page max_element_length_2d_page Max Element Length 2D
+
+\n This quality control criterion consists of calculation of length of
+the edges and diagonals combining the meshing elements (triangles and quadrangles)
+of your mesh.
+
+<em>To apply the Max Element Length 2D quality criterion to your mesh:</em>
+<ol>
+<li>Display your mesh in the viewer. </li>
+
+<li>Choose <b>Controls > Face Controls > Max Element Length 2D</b> or click
+<em>"Max Element Length 2D"</em> button in the toolbar. 
+
+\image html image42.png
+<center><em>"Max Element Length 2D" button</em></center>
+
+Your mesh will be displayed in the viewer with its elements colored according to the
+applied mesh quality control criterion:
+
+\image html max_element_length_2d.png
+</li>
+</ol>
+
+<br><b>See Also</b> a sample TUI Script of a 
+\ref tui_max_element_length_2d "Max Element Length 2D quality control" operation.  
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/SMESH/input/max_element_length_3d.doc b/doc/salome/gui/SMESH/input/max_element_length_3d.doc
new file mode 100644 (file)
index 0000000..287c3f2
--- /dev/null
@@ -0,0 +1,30 @@
+/*!
+
+\page max_element_length_3d_page Max Element Length 3D
+
+\n This quality control criterion consists of calculation of length of
+the edges and diagonals combining the 3D meshing elements
+(tetrahedrons, pyramids, pentahendrons, hexahedrons and polyhedrons)
+of your mesh.
+
+<em>To apply the Max Element Length 3D quality criterion to your mesh:</em>
+<ol>
+<li>Display your mesh in the viewer. </li>
+
+<li>Choose <b>Controls > Volume Controls > Max Element Length 3D</b> or click
+<em>"Max Element Length 3D"</em> button in the toolbar. 
+
+\image html image43.png
+<center><em>"Max Element Length 3D" button</em></center>
+
+Your mesh will be displayed in the viewer with its elements colored according to the
+applied mesh quality control criterion:
+
+\image html max_element_length_3d.png
+</li>
+</ol>
+
+<br><b>See Also</b> a sample TUI Script of a 
+\ref tui_max_element_length_3d "Max Element Length 3D quality control" operation.  
+
+*/
\ No newline at end of file
index af631b0ec14ce67dd61b2fd36b73e04b9354f134..4236d65627f02a43ba4dc9212643ecf227e1d9ae 100644 (file)
@@ -10,7 +10,8 @@ element (triangle or quadrangle).
 <ol>
 <li>Display your mesh in the viewer.</li>
 
-<li>Choose <b>Controls > Minimum angle</b> or click <em>"Minimum Angle"</em> button.
+<li>Choose <b>Controls > Face Controls > Minimum angle</b> or click
+<em>"Minimum Angle"</em> button.
 
 \image html image38.png
 <center><em>"Minimum Angle" button</em></center>
index 94dd3844c4b6f3f87537a738b5d61abf0edd3665..ab88e0edaffac07e9bb08adf8bf2b31878e8b296 100644 (file)
@@ -156,6 +156,11 @@ See also a
 length, which is more, less or equal (within a given <b>Tolerance</b>) to the predefined
 <b>Threshold Value</b>. See also a
 \ref length_2d_page "Length 2D quality control".
+</li><li>
+<b>Max Element Length 2D</b> selects triangles and quadrangles combining of the edges and
+diagonals with a value of length, which is more, less or equal
+(within a given <b>Tolerance</b>) to the predefined <b>Threshold Value</b>. See also a
+\ref max_element_length_2d_page "Max Element Length 2D quality control".
 </li>
 </ul>
 
@@ -169,6 +174,11 @@ Additional criteria to select mesh <b>Volumes</b> are the following:
 \ref volume_page "Volume quality control"), which is more, less or equal (within a given
 <b>Tolerance</b>) to the predefined <b>Threshold Value</b>.
 </li><li>
+<b>Max Element Length 3D</b> selects 3D mesh elements combining of the edges and
+diagonals with a value of length, which is more, less or equal
+(within a given <b>Tolerance</b>) to the predefined <b>Threshold Value</b>. See also a
+\ref max_element_length_3d_page "Max Element Length 3D quality control".
+</li><li>
 <b>Bad oriented volume</b> selects mesh volumes, which are incorrectly oriented from
 the point of view of MED convention.
 </li>
index 5235b4dddeb00c88b2bb7a9562d3e317f84c244e..036c70d83aaf7e9a655c1f646e0c97286e16cd28 100644 (file)
@@ -14,7 +14,8 @@ criterion can be applied to elements composed of 4 and 3 nodes
 <ol>
 <li>Display your mesh in the viewer.</li>
 
-<li>Choose <b>Controls > Skew</b> or click <em>"Skew"</em> button of the toolbar.
+<li>Choose <b>Controls > Face Controls > Skew</b> or click
+<em>"Skew"</em> button of the toolbar.
 
 \image html image40.png
 <center><em>"Skew" button </em></center>
index d2c4dd2b4358cd407db279825c5bcfcb15f63c8b..86472eabe82c537b2f40a3a9c72245ea1060e1c8 100644 (file)
@@ -13,8 +13,8 @@ for elements consisting of 4 nodes.
 <ol>
 <li>Display your mesh in the viewer.</li>
 
-<li>Choose <b>Controls > Taper</b> or click <em>"Taper"</em> button in
-the toolbar.
+<li>Choose <b>Controls > Face Controls > Taper</b> or click
+<em>"Taper"</em> button in the toolbar.
 
 \image html image36.png
 <center><em>"Taper" button</em></center>
index ad6dd5929348854032739ab2051f0c6e923a0461..df8b13992c40754f46fba6e3fa2df65075191d95 100755 (executable)
@@ -337,6 +337,46 @@ print "Number of faces with maximum edge length > 14:", len(ids)
 
 \sa \ref tui_length_2d
 
+\section filter_max_element_length_2d Max Element Length 2D
+
+Filter 2D mesh elements (faces) corresponding to the maximum length
+value of its edges and diagonals:
+- element type should be \a smesh.FACE
+- functor type should be \a smesh.FT_MaxElementLength2D
+- threshold is floating point value (edge/diagonal length)
+
+\code
+# create mesh
+from SMESH_mechanic import *
+# get all faces that have elements with length > 10
+filter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength2D, smesh.FT_MoreThan, 10)
+ids = mesh.GetIdsFromFilter(filter)
+print "Number of faces with maximum element length > 10:", len(ids)
+\endcode
+
+\sa \ref tui_max_element_length_2d
+
+\section filter_max_element_length_3d Max Element Length 3D
+
+Filter 3D mesh elements (volumes) corresponding to the maximum length
+value of its edges and diagonals:
+- element type should be \a smesh.VOLUME
+- functor type should be \a smesh.FT_MaxElementLength3D
+- threshold is floating point value (edge/diagonal length)
+
+\code
+# create mesh with volumes
+from SMESH_mechanic import *
+mesh.Tetrahedron( algo=smesh.NETGEN )
+mesh.Compute()
+# get all volumes that have elements with length > 10
+filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_MaxElementLength3D, smesh.FT_MoreThan, 10)
+ids = mesh.GetIdsFromFilter(filter)
+print "Number of volumes with maximum element length > 10:", len(ids)
+\endcode
+
+\sa \ref tui_max_element_length_3d
+
 \section filter_belong_to_geom Belong to Geom
 
 Filter mesh entities (nodes or elements) which all nodes lie on the
index 740c42247f584e2a7928a0402708b077550d845b..acbf89198437b748b58b487c12d7ec581d96b8bc 100644 (file)
@@ -603,6 +603,39 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
+\section tui_max_element_length_2d Max Element Length 2D
+
+\code
+import SMESH_mechanic
+
+smesh  = SMESH_mechanic.smesh
+mesh   = SMESH_mechanic.mesh
+salome = SMESH_mechanic.salome
+
+# Criterion : MAX ELEMENT LENGTH 2D > 10
+mel_2d_margin = 10
+
+aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength2D, smesh.FT_MoreThan, mel_2d_margin)
+
+anIds = mesh.GetIdsFromFilter(aFilter) 
+
+# print the result
+print "Criterion: Max Element Length 2D Ratio > ", mel_2d_margin, " Nb = ", len(anIds)
+j = 1
+for i in range(len(anIds)):
+  if j > 20: j = 1; print ""
+  print anIds[i],
+  j = j + 1
+  pass
+print ""
+
+# create a group
+aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Max Element Length 2D > " + `mel_2d_margin`)
+aGroup.Add(anIds)
+
+salome.sg.updateObjBrowser(1)
+\endcode
+
 \section tui_aspect_ratio_3d Aspect Ratio 3D
 
 \code
@@ -672,4 +705,37 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1) 
 \endcode
 
+\section tui_max_element_length_3d Max Element Length 3D
+
+\code
+import SMESH_mechanic_tetra
+
+smesh  = SMESH_mechanic_tetra.smesh
+mesh   = SMESH_mechanic_tetra.mesh
+salome = SMESH_mechanic_tetra.salome
+
+# Criterion : MAX ELEMENT LENGTH 3D > 10
+mel_3d_margin = 10
+
+aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength3D, smesh.FT_MoreThan, mel_3d_margin)
+
+anIds = mesh.GetIdsFromFilter(aFilter) 
+
+# print the result
+print "Criterion: Max Element Length 3D Ratio > ", mel_3d_margin, " Nb = ", len(anIds)
+j = 1
+for i in range(len(anIds)):
+  if j > 20: j = 1; print ""
+  print anIds[i],
+  j = j + 1
+  pass
+print ""
+
+# create a group
+aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Max Element Length 3D > " + `mel_3d_margin`)
+aGroup.Add(anIds)
+
+salome.sg.updateObjBrowser(1)
+\endcode
+
 */
index ba99c193ebc3b9bd3528f7f73894ef1c2149e551..4d74fcbf02efd33341a2dce73e33b22aa8685902 100644 (file)
@@ -9,8 +9,8 @@
 <ol>
 <li>Display your mesh in the viewer.</li>
 
-<li>Choose <b>Controls > Volume</b> or click <em>"Volume"</em> button
-in the toolbar.
+<li>Choose <b>Controls > Volume Controls > Volume</b> or click
+<em>"Volume"</em> button in the toolbar.
 
 \image html image145.png
 <center><em>"Volume" button</em></center>
index 83bfaa3ac638c4d11b7cd188669af966a62d8b5d..86ba0c9055e1bf0ed2426c77b468ae740a5602ca 100644 (file)
@@ -24,8 +24,8 @@ projection height ?h? to the half edge length ?l?.
 <ol>
 <li>Display your mesh in the viewer.</li>
 
-<li>Choose <b>Controls > Warping Angle</b> or click <em>"Warping angle"</em>
-button of the toolbar.
+<li>Choose <b>Controls > Face Controls > Warping Angle</b> or click
+<em>"Warping angle"</em> button of the toolbar.
 
 \image html image39.png
 <center><em>"Warping angle" button</em></center>
index d65ed3b46cc93dc3edf27d2e8eb0f0f092e685f6..50526cf0331ad8b9c4ea256e0897e06c526cf404 100644 (file)
@@ -47,6 +47,8 @@ module SMESH
     FT_Skew,         
     FT_Area,          
     FT_Volume3D,          
+    FT_MaxElementLength2D,
+    FT_MaxElementLength3D,
     FT_FreeBorders,
     FT_FreeEdges,
     FT_FreeNodes,
@@ -121,6 +123,8 @@ module SMESH
   interface Skew            : NumericalFunctor{};
   interface Area            : NumericalFunctor{};
   interface Volume3D        : NumericalFunctor{};
+  interface MaxElementLength2D : NumericalFunctor{};
+  interface MaxElementLength3D : NumericalFunctor{};
   interface Length          : NumericalFunctor{};
   interface Length2D        : NumericalFunctor
   {
@@ -463,6 +467,8 @@ module SMESH
     Skew              CreateSkew();
     Area              CreateArea();
     Volume3D          CreateVolume3D();
+    MaxElementLength2D CreateMaxElementLength2D();
+    MaxElementLength3D CreateMaxElementLength3D();
     Length            CreateLength();
     Length2D          CreateLength2D();
     MultiConnection   CreateMultiConnection();
index ed3f5aff7f32166ccacfab60e107025e13f5191f..d90cc400b2b3224b908e3102c545cf7f11bbc2a8 100644 (file)
@@ -57,6 +57,8 @@ dist_salomeres_DATA = \
        mesh_free_edges.png \
        mesh_free_edges_2d.png \
        mesh_free_nodes.png \
+       mesh_max_element_length_2d.png \
+       mesh_max_element_length_3d.png \
        mesh_multi_edges.png \
        mesh_multi_edges_2d.png \
        mesh_line_n.png \
diff --git a/resources/mesh_max_element_length_2d.png b/resources/mesh_max_element_length_2d.png
new file mode 100755 (executable)
index 0000000..d0120fa
Binary files /dev/null and b/resources/mesh_max_element_length_2d.png differ
diff --git a/resources/mesh_max_element_length_3d.png b/resources/mesh_max_element_length_3d.png
new file mode 100755 (executable)
index 0000000..7b6b895
Binary files /dev/null and b/resources/mesh_max_element_length_3d.png differ
index a2ad1e688b99431c243efa3ab607e2a831ccae09..d42072f1b61030fc14f7b25e756aa5f4014d9b54 100644 (file)
@@ -31,6 +31,8 @@ int main(int argc, char** argv)
   new Taper();
   new Skew();
   new Area();
+  new MaxElementLength2D();
+  new MaxElementLength3D();
   new Length();
   //  new Length2D();
   new MultiConnection();
index 8f18f66056f9372606ce51feb071aa28e8e0e687..3c079736ba023985371ad2422795a514bd1d697b 100644 (file)
@@ -370,6 +370,246 @@ SMDSAbs_ElementType Volume::GetType() const
 }
 
 
+/*
+  Class       : MaxElementLength2D
+  Description : Functor calculating maximum length of 2D element
+*/
+
+double MaxElementLength2D::GetValue( long theElementId )
+{
+  TSequenceOfXYZ P;
+  if( GetPoints( theElementId, P ) ) {
+    double aVal = 0;
+    const SMDS_MeshElement* aElem = myMesh->FindElement( theElementId );
+    SMDSAbs_ElementType aType = aElem->GetType();
+    int len = P.size();
+    switch( aType ) {
+    case SMDSAbs_Face:
+      if( len == 3 ) { // triangles
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 1 ));
+        aVal = Max(L1,Max(L2,L3));
+        break;
+      }
+      else if( len == 4 ) { // quadrangles
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 4 ));
+        double L4 = getDistance(P( 4 ),P( 1 ));
+        double D1 = getDistance(P( 1 ),P( 3 ));
+        double D2 = getDistance(P( 2 ),P( 4 ));
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(D1,D2));
+        break;
+      }
+      else 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));
+        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 ));
+        double D1 = getDistance(P( 1 ),P( 5 ));
+        double D2 = getDistance(P( 3 ),P( 7 ));
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(D1,D2));
+        break;
+      }
+    }
+
+    if( myPrecision >= 0 )
+    {
+      double prec = pow( 10., (double)myPrecision );
+      aVal = floor( aVal * prec + 0.5 ) / prec;
+    }
+    return aVal;
+  }
+  return 0.;
+}
+
+double MaxElementLength2D::GetBadRate( double Value, int /*nbNodes*/ ) const
+{
+  return Value;
+}
+
+SMDSAbs_ElementType MaxElementLength2D::GetType() const
+{
+  return SMDSAbs_Face;
+}
+
+/*
+  Class       : MaxElementLength3D
+  Description : Functor calculating maximum length of 3D element
+*/
+
+double MaxElementLength3D::GetValue( long theElementId )
+{
+  TSequenceOfXYZ P;
+  if( GetPoints( theElementId, P ) ) {
+    double aVal = 0;
+    const SMDS_MeshElement* aElem = myMesh->FindElement( theElementId );
+    SMDSAbs_ElementType aType = aElem->GetType();
+    int len = P.size();
+    switch( aType ) {
+    case SMDSAbs_Volume:
+      if( len == 4 ) { // tetras
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 1 ));
+        double L4 = getDistance(P( 1 ),P( 4 ));
+        double L5 = getDistance(P( 2 ),P( 4 ));
+        double L6 = getDistance(P( 3 ),P( 4 ));
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+        break;
+      }
+      else if( len == 5 ) { // pyramids
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 4 ));
+        double L4 = getDistance(P( 4 ),P( 1 ));
+        double L5 = getDistance(P( 1 ),P( 5 ));
+        double L6 = getDistance(P( 2 ),P( 5 ));
+        double L7 = getDistance(P( 3 ),P( 5 ));
+        double L8 = getDistance(P( 4 ),P( 5 ));
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+        aVal = Max(aVal,Max(L7,L8));
+        break;
+      }
+      else if( len == 6 ) { // pentas
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 1 ));
+        double L4 = getDistance(P( 4 ),P( 5 ));
+        double L5 = getDistance(P( 5 ),P( 6 ));
+        double L6 = getDistance(P( 6 ),P( 4 ));
+        double L7 = getDistance(P( 1 ),P( 4 ));
+        double L8 = getDistance(P( 2 ),P( 5 ));
+        double L9 = getDistance(P( 3 ),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 == 8 ) { // hexas
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 4 ));
+        double L4 = getDistance(P( 4 ),P( 1 ));
+        double L5 = getDistance(P( 5 ),P( 6 ));
+        double L6 = getDistance(P( 6 ),P( 7 ));
+        double L7 = getDistance(P( 7 ),P( 8 ));
+        double L8 = getDistance(P( 8 ),P( 5 ));
+        double L9 = getDistance(P( 1 ),P( 5 ));
+        double L10= getDistance(P( 2 ),P( 6 ));
+        double L11= getDistance(P( 3 ),P( 7 ));
+        double L12= getDistance(P( 4 ),P( 8 ));
+        double D1 = getDistance(P( 1 ),P( 7 ));
+        double D2 = getDistance(P( 2 ),P( 8 ));
+        double D3 = getDistance(P( 3 ),P( 5 ));
+        double D4 = getDistance(P( 4 ),P( 6 ));
+        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));
+        aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4)));
+        break;
+      }
+      else if( len == 10 ) { // quadratic tetras
+        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 pyramids
+        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( 4 ));
+        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 pentas
+        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 hexas
+        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 ));
+        double D1 = getDistance(P( 1 ),P( 7 ));
+        double D2 = getDistance(P( 2 ),P( 8 ));
+        double D3 = getDistance(P( 3 ),P( 5 ));
+        double D4 = getDistance(P( 4 ),P( 6 ));
+        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));
+        aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4)));
+        break;
+      }
+      else if( len > 1 && aElem->IsPoly() ) { // polys
+        // get the maximum distance between all pairs of nodes
+        for( int i = 1; i <= len; i++ ) {
+          for( int j = 1; j <= len; j++ ) {
+            if( j > i ) { // optimization of the loop
+              double D = getDistance( P(i), P(j) );
+              aVal = Max( aVal, D );
+            }
+          }
+        }
+      }
+    }
+
+    if( myPrecision >= 0 )
+    {
+      double prec = pow( 10., (double)myPrecision );
+      aVal = floor( aVal * prec + 0.5 ) / prec;
+    }
+    return aVal;
+  }
+  return 0.;
+}
+
+double MaxElementLength3D::GetBadRate( double Value, int /*nbNodes*/ ) const
+{
+  return Value;
+}
+
+SMDSAbs_ElementType MaxElementLength3D::GetType() const
+{
+  return SMDSAbs_Volume;
+}
+
+
 /*
   Class       : MinimumAngle
   Description : Functor for calculation of minimum angle
@@ -1198,7 +1438,7 @@ double Length2D::GetValue( long theElementId)
       else if (len == 5){ // piramids
         double L1 = getDistance(P( 1 ),P( 2 ));
         double L2 = getDistance(P( 2 ),P( 3 ));
-        double L3 = getDistance(P( 3 ),P( 1 ));
+        double L3 = getDistance(P( 3 ),P( 4 ));
         double L4 = getDistance(P( 4 ),P( 1 ));
         double L5 = getDistance(P( 1 ),P( 5 ));
         double L6 = getDistance(P( 2 ),P( 5 ));
@@ -1258,7 +1498,7 @@ double Length2D::GetValue( long theElementId)
       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 L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
         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 ));
index 2b7bffebac5e60967bdb4056dc7c8382ad448086..aba178ecee307e0b5f05b89507fbaad08eac5271 100644 (file)
@@ -159,6 +159,30 @@ namespace SMESH{
     };
   
   
+    /*
+      Class       : MaxElementLength2D
+      Description : Functor calculating maximum length of 2D element
+    */
+    class SMESHCONTROLS_EXPORT MaxElementLength2D: public virtual NumericalFunctor{
+    public:
+      virtual double GetValue( long theElementId );
+      virtual double GetBadRate( double Value, int nbNodes ) const;
+      virtual SMDSAbs_ElementType GetType() const;
+    };
+  
+  
+    /*
+      Class       : MaxElementLength3D
+      Description : Functor calculating maximum length of 3D element
+    */
+    class SMESHCONTROLS_EXPORT MaxElementLength3D: public virtual NumericalFunctor{
+    public:
+      virtual double GetValue( long theElementId );
+      virtual double GetBadRate( double Value, int nbNodes ) const;
+      virtual SMDSAbs_ElementType GetType() const;
+    };
+  
+  
     /*
       Class       : SMESH_MinimumAngle
       Description : Functor for calculation of minimum angle
index 8f5c5bae6f32958c48438efb6cc66731cccd0d8a..97bf66e85af6d03396ef8fc3b6f414792e4df748 100644 (file)
@@ -801,6 +801,22 @@ SetControlMode(eControl theMode,
       myControlActor = my3DActor;
       break;
     }
+    case eMaxElementLength2D:
+    {
+      SMESH::Controls::MaxElementLength2D* aControl = new SMESH::Controls::MaxElementLength2D();
+      aControl->SetPrecision( myControlsPrecision );
+      aFunctor.reset( aControl );
+      myControlActor = my2DActor;
+      break;
+    }
+    case eMaxElementLength3D:
+    {
+      SMESH::Controls::MaxElementLength3D* aControl = new SMESH::Controls::MaxElementLength3D();
+      aControl->SetPrecision( myControlsPrecision );
+      aFunctor.reset( aControl );
+      myControlActor = my3DActor;
+      break;
+    }
     case eMinimumAngle:
     {
       SMESH::Controls::MinimumAngle* aControl = new SMESH::Controls::MinimumAngle();
index bb4e2fb68a2e7a58d89d41688cc76ce65e97fdbe..9e53f5ac69f1cdfe2caf75b7908e6e35a339e24e 100644 (file)
@@ -115,7 +115,8 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
 
   enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eFreeNodes,
                 eFreeFaces, eMultiConnection, eArea, eTaper, eAspectRatio,
-                eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D};
+                eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D,
+                eMaxElementLength2D, eMaxElementLength3D};
   virtual void SetControlMode(eControl theMode) = 0;
   virtual eControl GetControlMode() = 0;
 
index c0a9ba9be1750a0adcd217ebcff37dd8f3577c86..e21f33a97b054af6416395f4802dacaa36fd1bba 100644 (file)
             aTitle = QObject::tr( "FREE_FACES" );
             aControl = SMESH_Actor::eFreeFaces;
             break;
+          case 6022:
+            aTitle = QObject::tr( "MAX_ELEMENT_LENGTH_2D" );
+            aControl = SMESH_Actor::eMaxElementLength2D;
+            break;
+          case 6023:
+            aTitle = QObject::tr( "MAX_ELEMENT_LENGTH_3D" );
+            aControl = SMESH_Actor::eMaxElementLength3D;
+            break;
           }
           anActor->SetControlMode(aControl);
           anActor->GetScalarBarActor()->SetTitle(aTitle.toLatin1().data());
@@ -2812,6 +2820,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   case 6005:
   case 6009:
   case 6021:
+  case 6022:
+  case 6023:
     if ( vtkwnd ) {
 
       LightApp_SelectionMgr* mgr = selectionMgr();
@@ -3042,6 +3052,8 @@ void SMESHGUI::initialize( CAM_Application* app )
   createSMESHAction( 6001, "LENGTH",          "ICON_LENGTH",        0, true );
   createSMESHAction( 6002, "FREE_EDGE",       "ICON_FREE_EDGE",     0, true );
   createSMESHAction( 6021, "FREE_FACES",      "ICON_FREE_FACES",    0, true );
+  createSMESHAction( 6022, "MAX_ELEMENT_LENGTH_2D", "ICON_MAX_ELEMENT_LENGTH_2D", 0, true );
+  createSMESHAction( 6023, "MAX_ELEMENT_LENGTH_3D", "ICON_MAX_ELEMENT_LENGTH_3D", 0, true );
   createSMESHAction( 6003, "FREE_BORDER",     "ICON_FREE_EDGE_2D",  0, true );
   createSMESHAction( 6004, "CONNECTION",      "ICON_CONNECTION",    0, true );
   createSMESHAction( 6005, "FREE_NODE",       "ICON_FREE_NODE",     0, true );
@@ -3147,6 +3159,10 @@ void SMESHGUI::initialize( CAM_Application* app )
 
   int importId = createMenu( tr( "MEN_IMPORT" ), fileId, -1, 10 ),
       exportId = createMenu( tr( "MEN_EXPORT" ), fileId, -1, 10 ),
+      nodeId   = createMenu( tr( "MEN_NODE_CTRL" ), ctrlId, -1, 10 ),
+      edgeId   = createMenu( tr( "MEN_EDGE_CTRL" ), ctrlId, -1, 10 ),
+      faceId   = createMenu( tr( "MEN_FACE_CTRL" ), ctrlId, -1, 10 ),
+      volumeId = createMenu( tr( "MEN_VOLUME_CTRL" ), ctrlId, -1, 10 ),
       addId    = createMenu( tr( "MEN_ADD" ),    modifyId, 402 ),
       removeId = createMenu( tr( "MEN_REMOVE" ), modifyId, 403 ),
       renumId  = createMenu( tr( "MEN_RENUM" ),  modifyId, 404 ),
@@ -3197,25 +3213,24 @@ void SMESHGUI::initialize( CAM_Application* app )
   createMenu( 904, meshId, -1 );
   createMenu( separator(), meshId, -1 );
 
-  createMenu( 6003, ctrlId, -1 );
-  createMenu( 6001, ctrlId, -1 );
-  createMenu( 6004, ctrlId, -1 );
-  createMenu( separator(), ctrlId, -1 );
-  createMenu( 6005, ctrlId, -1 );
-  createMenu( 6002, ctrlId, -1 );
-  createMenu( 6018, ctrlId, -1 );
-  createMenu( 6019, ctrlId, -1 );
-  createMenu( 6011, ctrlId, -1 );
-  createMenu( 6012, ctrlId, -1 );
-  createMenu( 6013, ctrlId, -1 );
-  createMenu( 6014, ctrlId, -1 );
-  createMenu( 6015, ctrlId, -1 );
-  createMenu( 6016, ctrlId, -1 );
-  createMenu( separator(), ctrlId, -1 );
-  createMenu( 6017, ctrlId, -1 );
-  createMenu( 6009, ctrlId, -1 );
-  createMenu( 6021, ctrlId, -1 );
-  createMenu( separator(), ctrlId, -1 );
+  createMenu( 6005, nodeId, -1 );
+  createMenu( 6002, edgeId, -1 );
+  createMenu( 6003, edgeId, -1 );
+  createMenu( 6001, edgeId, -1 );
+  createMenu( 6004, edgeId, -1 );
+  createMenu( 6021, faceId, -1 );
+  createMenu( 6018, faceId, -1 );
+  createMenu( 6019, faceId, -1 );
+  createMenu( 6011, faceId, -1 );
+  createMenu( 6012, faceId, -1 );
+  createMenu( 6013, faceId, -1 );
+  createMenu( 6014, faceId, -1 );
+  createMenu( 6015, faceId, -1 );
+  createMenu( 6016, faceId, -1 );
+  createMenu( 6022, faceId, -1 );
+  createMenu( 6017, volumeId, -1 );
+  createMenu( 6009, volumeId, -1 );
+  createMenu( 6023, volumeId, -1 );
 
   createMenu( 4000, addId, -1 );
   createMenu( 4009, addId, -1 );
@@ -3299,12 +3314,14 @@ void SMESHGUI::initialize( CAM_Application* app )
   createTool( 904, meshTb );
   createTool( separator(), meshTb );
 
-  createTool( 6001, ctrlTb );
+  createTool( 6005, ctrlTb );
+  createTool( separator(), ctrlTb );
+  createTool( 6002, ctrlTb );
   createTool( 6003, ctrlTb );
+  createTool( 6001, ctrlTb );
   createTool( 6004, ctrlTb );
   createTool( separator(), ctrlTb );
-  createTool( 6005, ctrlTb );
-  createTool( 6002, ctrlTb );
+  createTool( 6021, ctrlTb );
   createTool( 6018, ctrlTb );
   createTool( 6019, ctrlTb );
   createTool( 6011, ctrlTb );
@@ -3313,10 +3330,11 @@ void SMESHGUI::initialize( CAM_Application* app )
   createTool( 6014, ctrlTb );
   createTool( 6015, ctrlTb );
   createTool( 6016, ctrlTb );
+  createTool( 6022, ctrlTb );
   createTool( separator(), ctrlTb );
   createTool( 6017, ctrlTb );
   createTool( 6009, ctrlTb );
-  createTool( 6021, ctrlTb );
+  createTool( 6023, ctrlTb );
   createTool( separator(), ctrlTb );
 
   createTool( 4000, addRemTb );
@@ -3601,74 +3619,86 @@ void SMESHGUI::initialize( CAM_Application* app )
 
   popupMgr()->insert( separator(), anId, -1 );
 
-  popupMgr()->insert( action( 6003 ), anId, -1 ); // FREE_BORDER
+  int aSubId = popupMgr()->insert( tr( "MEN_NODE_CTRL" ), anId, -1 ); // NODE CONTROLS
+
+  popupMgr()->insert( action( 6005 ), aSubId, -1 ); // FREE_NODE
+  popupMgr()->setRule( action( 6005 ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule );
+  popupMgr()->setRule( action( 6005 ), "controlMode = 'eFreeNodes'", QtxPopupMgr::ToggleRule );
+
+  aSubId = popupMgr()->insert( tr( "MEN_EDGE_CTRL" ), anId, -1 ); // EDGE CONTROLS
+
+  popupMgr()->insert( action( 6002 ), aSubId, -1 ); // FREE_EDGE
+  popupMgr()->setRule( action( 6002 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
+  popupMgr()->setRule( action( 6002 ), "controlMode = 'eFreeEdges'", QtxPopupMgr::ToggleRule );
+
+  popupMgr()->insert( action( 6003 ), aSubId, -1 ); // FREE_BORDER
   popupMgr()->setRule( action( 6003 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6003 ), "controlMode = 'eFreeBorders'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6001 ), anId, -1 ); // LENGTH
+  popupMgr()->insert( action( 6001 ), aSubId, -1 ); // LENGTH
   popupMgr()->setRule( action( 6001 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6001 ), "controlMode = 'eLength'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6004 ), anId, -1 ); // CONNECTION
+  popupMgr()->insert( action( 6004 ), aSubId, -1 ); // CONNECTION
   popupMgr()->setRule( action( 6004 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6004 ), "controlMode = 'eMultiConnection'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( separator(), anId, -1 );
-
-  popupMgr()->insert( action( 6005 ), anId, -1 ); // FREE_NODE
-  popupMgr()->setRule( action( 6005 ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule );
-  popupMgr()->setRule( action( 6005 ), "controlMode = 'eFreeNodes'", QtxPopupMgr::ToggleRule );
+  aSubId = popupMgr()->insert( tr( "MEN_FACE_CTRL" ), anId, -1 ); // FACE CONTROLS
 
-  popupMgr()->insert( action( 6002 ), anId, -1 ); // FREE_EDGE
-  popupMgr()->setRule( action( 6002 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
-  popupMgr()->setRule( action( 6002 ), "controlMode = 'eFreeEdges'", QtxPopupMgr::ToggleRule );
+  popupMgr()->insert( action( 6021 ), aSubId, -1 ); // FREE_FACE
+  popupMgr()->setRule( action( 6021 ), aMeshInVtkHasFaces /*aMeshInVtkHasVolumes*/,
+                                       QtxPopupMgr::VisibleRule );
+  popupMgr()->setRule( action( 6021 ), "controlMode = 'eFreeFaces'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6018 ), anId, -1 ); // LENGTH_2D
+  popupMgr()->insert( action( 6018 ), aSubId, -1 ); // LENGTH_2D
   popupMgr()->setRule( action( 6018 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6018 ), "controlMode = 'eLength2D'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6019 ), anId, -1 ); // CONNECTION_2D
+  popupMgr()->insert( action( 6019 ), aSubId, -1 ); // CONNECTION_2D
   popupMgr()->setRule( action( 6019 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6019 ), "controlMode = 'eMultiConnection2D'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6011 ), anId, -1 ); // AREA
+  popupMgr()->insert( action( 6011 ), aSubId, -1 ); // AREA
   popupMgr()->setRule( action( 6011 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6011 ), "controlMode = 'eArea'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6012 ), anId, -1 ); // TAPER
+  popupMgr()->insert( action( 6012 ), aSubId, -1 ); // TAPER
   popupMgr()->setRule( action( 6012 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6012 ), "controlMode = 'eTaper'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6013 ), anId, -1 ); // ASPECT
+  popupMgr()->insert( action( 6013 ), aSubId, -1 ); // ASPECT
   popupMgr()->setRule( action( 6013 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6013 ), "controlMode = 'eAspectRatio'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6014 ), anId, -1 ); // MIN_ANG
+  popupMgr()->insert( action( 6014 ), aSubId, -1 ); // MIN_ANG
   popupMgr()->setRule( action( 6014 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6014 ), "controlMode = 'eMinimumAngle'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6015 ), anId, -1 ); // WARP
+  popupMgr()->insert( action( 6015 ), aSubId, -1 ); // WARP
   popupMgr()->setRule( action( 6015 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6015 ), "controlMode = 'eWarping'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6016 ), anId, -1 ); // SKEW
+  popupMgr()->insert( action( 6016 ), aSubId, -1 ); // SKEW
   popupMgr()->setRule( action( 6016 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6016 ), "controlMode = 'eSkew'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( separator(), anId, -1 );
+  popupMgr()->insert( action( 6022 ), aSubId, -1 ); // MAX_ELEMENT_LENGTH_2D
+  popupMgr()->setRule( action( 6022 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+  popupMgr()->setRule( action( 6022 ), "controlMode = 'eMaxElementLength2D'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6017 ), anId, -1 ); // ASPECT_3D
+  aSubId = popupMgr()->insert( tr( "MEN_VOLUME_CTRL" ), anId, -1 ); // VOLUME CONTROLS
+
+  popupMgr()->insert( action( 6017 ), aSubId, -1 ); // ASPECT_3D
   popupMgr()->setRule( action( 6017 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6017 ), "controlMode = 'eAspectRatio3D'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert ( action( 6009 ), anId, -1 ); // VOLUME_3D
+  popupMgr()->insert ( action( 6009 ), aSubId, -1 ); // VOLUME_3D
   popupMgr()->setRule( action( 6009 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( 6009 ), "controlMode = 'eVolume3D'", QtxPopupMgr::ToggleRule );
 
-  popupMgr()->insert( action( 6021 ), anId, -1 ); // FREE_FACE
-  popupMgr()->setRule( action( 6021 ), aMeshInVtkHasFaces /*aMeshInVtkHasVolumes*/,
-                                       QtxPopupMgr::VisibleRule );
-  popupMgr()->setRule( action( 6021 ), "controlMode = 'eFreeFaces'", QtxPopupMgr::ToggleRule );
+  popupMgr()->insert( action( 6023 ), aSubId, -1 ); // MAX_ELEMENT_LENGTH_3D
+  popupMgr()->setRule( action( 6023 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+  popupMgr()->setRule( action( 6023 ), "controlMode = 'eMaxElementLength3D'", QtxPopupMgr::ToggleRule );
 
   popupMgr()->insert( separator(), anId, -1 );
 
index 2ae183e7423c203a949a7226d3ad15309ecc50fa..bf1e387eaac5a0b432cbcff5f26c95e26669014e 100755 (executable)
@@ -1363,6 +1363,8 @@ const char* SMESHGUI_FilterTable::getPrecision( const int aType )
     retval = "len_tol_precision"; break;
   case SMESH::FT_Length:
   case SMESH::FT_Length2D:
+  case SMESH::FT_MaxElementLength2D:
+  case SMESH::FT_MaxElementLength3D:
     retval = "length_precision"; break;
   case SMESH::FT_Volume3D:
     retval = "vol_precision"; break;
@@ -1776,6 +1778,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
       aCriteria[ SMESH::FT_Taper              ] = tr("TAPER");
       aCriteria[ SMESH::FT_Skew               ] = tr("SKEW");
       aCriteria[ SMESH::FT_Area               ] = tr("AREA");
+      aCriteria[ SMESH::FT_MaxElementLength2D ] = tr("MAX_ELEMENT_LENGTH_2D");
       aCriteria[ SMESH::FT_FreeEdges          ] = tr("FREE_EDGES");
       aCriteria[ SMESH::FT_RangeOfIds         ] = tr("RANGE_OF_IDS");
       aCriteria[ SMESH::FT_BelongToGeom       ] = tr("BELONG_TO_GEOM");
@@ -1797,14 +1800,15 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
     static QMap<int, QString> aCriteria;
     if (aCriteria.isEmpty())
     {
-      aCriteria[ SMESH::FT_AspectRatio3D     ] = tr("ASPECT_RATIO_3D");
-      aCriteria[ SMESH::FT_RangeOfIds        ] = tr("RANGE_OF_IDS");
-      aCriteria[ SMESH::FT_BelongToGeom      ] = tr("BELONG_TO_GEOM");
-      aCriteria[ SMESH::FT_LyingOnGeom       ] = tr("LYING_ON_GEOM");
-      aCriteria[ SMESH::FT_BadOrientedVolume ] = tr("BAD_ORIENTED_VOLUME");
-      aCriteria[ SMESH::FT_Volume3D          ] = tr("VOLUME_3D");
-      aCriteria[ SMESH::FT_LinearOrQuadratic ] = tr("LINEAR");
-      aCriteria[ SMESH::FT_GroupColor        ] = tr("GROUP_COLOR");
+      aCriteria[ SMESH::FT_AspectRatio3D      ] = tr("ASPECT_RATIO_3D");
+      aCriteria[ SMESH::FT_RangeOfIds         ] = tr("RANGE_OF_IDS");
+      aCriteria[ SMESH::FT_BelongToGeom       ] = tr("BELONG_TO_GEOM");
+      aCriteria[ SMESH::FT_LyingOnGeom        ] = tr("LYING_ON_GEOM");
+      aCriteria[ SMESH::FT_BadOrientedVolume  ] = tr("BAD_ORIENTED_VOLUME");
+      aCriteria[ SMESH::FT_Volume3D           ] = tr("VOLUME_3D");
+      aCriteria[ SMESH::FT_MaxElementLength3D ] = tr("MAX_ELEMENT_LENGTH_3D");
+      aCriteria[ SMESH::FT_LinearOrQuadratic  ] = tr("LINEAR");
+      aCriteria[ SMESH::FT_GroupColor         ] = tr("GROUP_COLOR");
       aCriteria[ SMESH::FT_ElemGeomType       ] = tr("GEOM_TYPE");
     }
     return aCriteria;
index 887cdea084b5665689c2885312237483fc86ff87..15ca322b5e9b8a922a57b695bc46030d0df5aa85 100644 (file)
@@ -271,6 +271,8 @@ QString SMESHGUI_Selection::controlMode( int ind ) const
     case SMESH_Actor::eMultiConnection2D: return "eMultiConnection2D";
     case SMESH_Actor::eArea:              return "eArea";
     case SMESH_Actor::eVolume3D:          return "eVolume3D";
+    case SMESH_Actor::eMaxElementLength2D: return "eMaxElementLength2D";
+    case SMESH_Actor::eMaxElementLength3D: return "eMaxElementLength3D";
     case SMESH_Actor::eTaper:             return "eTaper";
     case SMESH_Actor::eAspectRatio:       return "eAspectRatio";
     case SMESH_Actor::eAspectRatio3D:     return "eAspectRatio3D";
index c22f4e96e906a5d232333e2a101e99d4035214da..8028ea25bc6e2c0b68e085c2a6de9f2b822d26ef 100644 (file)
             <source>ICON_MAP</source>
             <translation>mesh_pattern.png</translation>
         </message>
+        <message>
+            <source>ICON_MAX_ELEMENT_LENGTH_2D</source>
+            <translation>mesh_max_element_length_2d.png</translation>
+        </message>
+        <message>
+            <source>ICON_MAX_ELEMENT_LENGTH_3D</source>
+            <translation>mesh_max_element_length_3d.png</translation>
+        </message>
         <message>
             <source>ICON_OBJBROWSER_SMESH</source>
             <translation>mesh.png</translation>
index 4a3a32e3ff95254ed5db14ed69d3f0779d54560c..ef56941d2a0f80148217ea3d58a7ab04c256b3f2 100644 (file)
         <source>LOCAL_ALGO</source>
         <translation>Local</translation>
     </message>
+    <message>
+        <source>MAX_ELEMENT_LENGTH_2D</source>
+        <translation>Max Element Length 2D</translation>
+    </message>
+    <message>
+        <source>MAX_ELEMENT_LENGTH_3D</source>
+        <translation>Max Element Length 3D</translation>
+    </message>
     <message>
         <source>MEN_ADD</source>
         <translation>Add</translation>
         <source>MEN_CTRL</source>
         <translation>Controls</translation>
     </message>
+    <message>
+        <source>MEN_NODE_CTRL</source>
+        <translation>Node Controls</translation>
+    </message>
+    <message>
+        <source>MEN_EDGE_CTRL</source>
+        <translation>Edge Controls</translation>
+    </message>
+    <message>
+        <source>MEN_FACE_CTRL</source>
+        <translation>Face Controls</translation>
+    </message>
+    <message>
+        <source>MEN_VOLUME_CTRL</source>
+        <translation>Volume Controls</translation>
+    </message>
     <message>
         <source>MEN_CUT</source>
         <translation>Cutting of Quadrangles</translation>
         <source>MEN_MAP</source>
         <translation>Pattern Mapping</translation>
     </message>
+    <message>
+        <source>MEN_MAX_ELEMENT_LENGTH_2D</source>
+        <translation>Max Element Length 2D</translation>
+    </message>
+    <message>
+        <source>MEN_MAX_ELEMENT_LENGTH_3D</source>
+        <translation>Max Element Length 3D</translation>
+    </message>
     <message>
         <source>MEN_MED</source>
         <translation>MED file</translation>
@@ -2344,6 +2376,14 @@ Consider saving your work before application crash</translation>
         <source>STB_MAP</source>
         <translation>Pattern mapping</translation>
     </message>
+    <message>
+        <source>STB_MAX_ELEMENT_LENGTH_2D</source>
+        <translation>Max Element Length 2D</translation>
+    </message>
+    <message>
+        <source>STB_MAX_ELEMENT_LENGTH_3D</source>
+        <translation>Max Element Length 3D</translation>
+    </message>
     <message>
         <source>STB_MED</source>
         <translation>Import MED file</translation>
@@ -2864,6 +2904,14 @@ Consider saving your work before application crash</translation>
         <source>TOP_MAP</source>
         <translation>Pattern mapping</translation>
     </message>
+    <message>
+        <source>TOP_MAX_ELEMENT_LENGTH_2D</source>
+        <translation>Max Element Length 2D</translation>
+    </message>
+    <message>
+        <source>TOP_MAX_ELEMENT_LENGTH_3D</source>
+        <translation>Max Element Length 3D</translation>
+    </message>
     <message>
         <source>TOP_MED</source>
         <translation>Import MED file</translation>
@@ -4204,6 +4252,14 @@ Please enter correct value and try again</translation>
         <source>LYING_ON_GEOM</source>
         <translation>Lying on Geom</translation>
     </message>
+    <message>
+        <source>MAX_ELEMENT_LENGTH_2D</source>
+        <translation>Max Element Length 2D</translation>
+    </message>
+    <message>
+        <source>MAX_ELEMENT_LENGTH_3D</source>
+        <translation>Max Element Length 3D</translation>
+    </message>
     <message>
         <source>MINIMUM_ANGLE</source>
         <translation>Minimum angle</translation>
index 91aaa656e9414d0034d367c3678243ad5a3e9879..44a848a35f4d32ce51e518748d452cb443ae6d83 100644 (file)
@@ -274,6 +274,8 @@ namespace SMESH
       case FT_Skew:             myStream<< "aSkew";             break;
       case FT_Area:             myStream<< "aArea";             break;
       case FT_Volume3D:         myStream<< "aVolume3D";         break;
+      case FT_MaxElementLength2D:myStream<< "aMaxElementLength2D";break;
+      case FT_MaxElementLength3D:myStream<< "aMaxElementLength3D";break;
       case FT_FreeBorders:      myStream<< "aFreeBorders";      break;
       case FT_FreeEdges:        myStream<< "aFreeEdges";        break;
       case FT_FreeNodes:        myStream<< "aFreeNodes";        break;
index c878c2db020aacd10680a4c9c7e4ce2acfffb61e..4410a2d24ce0b3233aec8e1815e7122db427a044 100644 (file)
@@ -760,6 +760,36 @@ FunctorType Volume3D_i::GetFunctorType()
   return SMESH::FT_Volume3D;
 }
 
+/*
+  Class       : MaxElementLength2D_i
+  Description : Functor for calculating maximum length of 2D element
+*/
+MaxElementLength2D_i::MaxElementLength2D_i()
+{
+  myNumericalFunctorPtr.reset( new Controls::MaxElementLength2D() );
+  myFunctorPtr = myNumericalFunctorPtr;
+}
+
+FunctorType MaxElementLength2D_i::GetFunctorType()
+{
+  return SMESH::FT_MaxElementLength2D;
+}
+
+/*
+  Class       : MaxElementLength3D_i
+  Description : Functor for calculating maximum length of 3D element
+*/
+MaxElementLength3D_i::MaxElementLength3D_i()
+{
+  myNumericalFunctorPtr.reset( new Controls::MaxElementLength3D() );
+  myFunctorPtr = myNumericalFunctorPtr;
+}
+
+FunctorType MaxElementLength3D_i::GetFunctorType()
+{
+  return SMESH::FT_MaxElementLength3D;
+}
+
 /*
   Class       : Length_i
   Description : Functor for calculating length off edge
@@ -1817,6 +1847,24 @@ Volume3D_ptr FilterManager_i::CreateVolume3D()
 }
 
 
+MaxElementLength2D_ptr FilterManager_i::CreateMaxElementLength2D()
+{
+  SMESH::MaxElementLength2D_i* aServant = new SMESH::MaxElementLength2D_i();
+  SMESH::MaxElementLength2D_var anObj = aServant->_this();
+  TPythonDump()<<aServant<<" = "<<this<<".CreateMaxElementLength2D()";
+  return anObj._retn();
+}
+
+
+MaxElementLength3D_ptr FilterManager_i::CreateMaxElementLength3D()
+{
+  SMESH::MaxElementLength3D_i* aServant = new SMESH::MaxElementLength3D_i();
+  SMESH::MaxElementLength3D_var anObj = aServant->_this();
+  TPythonDump()<<aServant<<" = "<<this<<".CreateMaxElementLength3D()";
+  return anObj._retn();
+}
+
+
 Length_ptr FilterManager_i::CreateLength()
 {
   SMESH::Length_i* aServant = new SMESH::Length_i();
@@ -2528,6 +2576,12 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
       case SMESH::FT_Volume3D:
         aFunctor = aFilterMgr->CreateVolume3D();
         break;
+      case SMESH::FT_MaxElementLength2D:
+        aFunctor = aFilterMgr->CreateMaxElementLength2D();
+        break;
+      case SMESH::FT_MaxElementLength3D:
+        aFunctor = aFilterMgr->CreateMaxElementLength3D();
+        break;
 
       // Predicates
 
@@ -2817,6 +2871,8 @@ static inline LDOMString toString( CORBA::Long theType )
     case FT_Skew            : return "Skew";
     case FT_Area            : return "Area";
     case FT_Volume3D        : return "Volume3D";
+    case FT_MaxElementLength2D: return "Max element length 2D";
+    case FT_MaxElementLength3D: return "Max element length 3D";
     case FT_BelongToGeom    : return "Belong to Geom";
     case FT_BelongToPlane   : return "Belong to Plane";
     case FT_BelongToCylinder: return "Belong to Cylinder";
@@ -2859,6 +2915,8 @@ static inline SMESH::FunctorType toFunctorType( const LDOMString& theStr )
   else if ( theStr.equals( "Skew"                         ) ) return FT_Skew;
   else if ( theStr.equals( "Area"                         ) ) return FT_Area;
   else if ( theStr.equals( "Volume3D"                     ) ) return FT_Volume3D;
+  else if ( theStr.equals( "Max element length 2D"        ) ) return FT_MaxElementLength2D;
+  else if ( theStr.equals( "Max element length 3D"        ) ) return FT_MaxElementLength3D;
   else if ( theStr.equals( "Belong to Geom"               ) ) return FT_BelongToGeom;
   else if ( theStr.equals( "Belong to Plane"              ) ) return FT_BelongToPlane;
   else if ( theStr.equals( "Belong to Cylinder"           ) ) return FT_BelongToCylinder;
index 91fa638b732ec77bb94f8ae6f2a928c14ee23108..accb90035824c6f404d352ea32ca755da468edf3 100644 (file)
@@ -271,6 +271,32 @@ namespace SMESH
   };
   
   
+  /*
+    Class       : MaxElementLength2D_i
+    Description : Functor for calculating maximum length of 2D element
+  */
+  class SMESH_I_EXPORT MaxElementLength2D_i: public virtual POA_SMESH::MaxElementLength2D,
+                                             public virtual NumericalFunctor_i
+  {
+  public:
+    MaxElementLength2D_i();
+    FunctorType                     GetFunctorType();
+  };
+  
+  
+  /*
+    Class       : MaxElementLength3D_i
+    Description : Functor for calculating maximum length of 3D element
+  */
+  class SMESH_I_EXPORT MaxElementLength3D_i: public virtual POA_SMESH::MaxElementLength3D,
+                                             public virtual NumericalFunctor_i
+  {
+  public:
+    MaxElementLength3D_i();
+    FunctorType                     GetFunctorType();
+  };
+  
+  
   /*
     Class       : Length_i
     Description : Functor for calculating length of edge
@@ -891,6 +917,8 @@ namespace SMESH
     Skew_ptr                  CreateSkew();
     Area_ptr                  CreateArea();
     Volume3D_ptr              CreateVolume3D();
+    MaxElementLength2D_ptr    CreateMaxElementLength2D();
+    MaxElementLength3D_ptr    CreateMaxElementLength3D();
     Length_ptr                CreateLength();
     Length2D_ptr              CreateLength2D();
     MultiConnection_ptr       CreateMultiConnection();
index 43c1b5874d4917ff8a7a58eb0925031d6a43c08a..8cde5ac61bbe8c79a0dd385ca87f18815ffa7f5d 100644 (file)
@@ -128,4 +128,16 @@ print "Criterion: Borders at multi-connections = 2 Nb = ", len( anIds )
   #print anIds[ i ]
 
 
+# Criterion : Max Element Length 2D > 10
+
+# create group
+aGroup = mesh.MakeGroup("Max Element Length 2D > 10", smesh.FACE, smesh.FT_MaxElementLength2D, smesh.FT_MoreThan, 10 )
+
+# print result
+anIds = aGroup.GetIDs()
+print "Criterion: Max Element Length 2D > 10 Nb = ", len( anIds )
+#for i in range( len( anIds ) ):
+  #print anIds[ i ]
+
+
 salome.sg.updateObjBrowser(1)
index 7fcb7e1017bc2a063a5ad3e962ac67a90a5e8c73..10b0bf16348fe30158adf1d7c4691f56ec328aab 100644 (file)
@@ -866,6 +866,10 @@ class smeshDC(SMESH._objref_SMESH_Gen):
             return aFilterMgr.CreateArea()
         elif theCriterion == FT_Volume3D:
             return aFilterMgr.CreateVolume3D()
+        elif theCriterion == FT_MaxElementLength2D:
+            return aFilterMgr.CreateMaxElementLength2D()
+        elif theCriterion == FT_MaxElementLength3D:
+            return aFilterMgr.CreateMaxElementLength3D()
         elif theCriterion == FT_MultiConnection:
             return aFilterMgr.CreateMultiConnection()
         elif theCriterion == FT_MultiConnection2D:
@@ -3823,6 +3827,17 @@ class Mesh:
     def GetVolume(self, elemId):
         return self._valueFromFunctor(SMESH.FT_Volume3D, elemId)    
 
+    ## Get maximum element length.
+    #  @param elemId mesh element ID
+    #  @return element's maximum length value
+    #  @ingroup l1_measurements
+    def GetMaxElementLength(self, elemId):
+        if self.GetElementType(elemId, True) == SMESH.VOLUME:
+            ftype = SMESH.FT_MaxElementLength3D
+        else:
+            ftype = SMESH.FT_MaxElementLength2D
+        return self._valueFromFunctor(ftype, elemId)    
+
     ## Get aspect ratio of 2D or 3D element.
     #  @param elemId mesh element ID
     #  @return element's aspect ratio value