diff --git a/doc/salome/gui/SMESH/input/2d_meshing_hypo.doc b/doc/salome/gui/SMESH/input/2d_meshing_hypo.doc
index 05ab6dd36..292a5034a 100644
--- a/doc/salome/gui/SMESH/input/2d_meshing_hypo.doc
+++ b/doc/salome/gui/SMESH/input/2d_meshing_hypo.doc
@@ -7,6 +7,7 @@
\ref max_element_area_anchor "Max Element Area"
\ref length_from_edges_anchor "Length from Edges"
\ref quadrangle_preference_anchor "Quadrangle Preference"
+\ref triangle_preference_anchor "Triangle Preference"
@@ -48,4 +49,14 @@ otherwise this mesh will contain some triangular elements.
This hypothesis has one restriction on its work: the total quantity of
segments on all four sides of the face must be even (divisible by 2).
+
+
+\anchor triangle_preference_anchor
+Triangle Preference
+
+This algorithm can be used only together with Quadrangle (Mapping)
+algorithm. It allows to build triangular mesh faces in the refinement
+area if the number of nodes at the opposite edges of a meshed face is not equal,
+otherwise refinement area will contain some quadrangular elements.
+
*/
diff --git a/doc/salome/gui/SMESH/input/about_hypo.doc b/doc/salome/gui/SMESH/input/about_hypo.doc
index 40b8ff590..2220ba0cb 100644
--- a/doc/salome/gui/SMESH/input/about_hypo.doc
+++ b/doc/salome/gui/SMESH/input/about_hypo.doc
@@ -28,6 +28,7 @@ them, you operate numerical values):
\ref max_element_area_anchor "Max Element Area"
\ref length_from_edges_anchor "Length from Edges"
\ref quadrangle_preference_anchor "Quadrangle Preference"
+\ref triangle_preference_anchor "Triangle Preference"
3D Hypothesis (for meshing of volumes):
@@ -49,4 +50,4 @@ The choice of a hypothesis depends on:
- the algorithm, which will be selected for meshing of this geometrical object (shape)
-*/
\ No newline at end of file
+*/
diff --git a/doc/salome/gui/SMESH/input/introduction_to_mesh.doc b/doc/salome/gui/SMESH/input/introduction_to_mesh.doc
index 5b80bb158..f50800894 100644
--- a/doc/salome/gui/SMESH/input/introduction_to_mesh.doc
+++ b/doc/salome/gui/SMESH/input/introduction_to_mesh.doc
@@ -18,6 +18,7 @@ allows to apply 1D, 2D, 3D meshing algorithms and a set of hypotheses:
\ref max_element_area_anchor "Max Element Area"
\ref length_from_edges_anchor "Length from Edges"
\ref quadrangle_preference_anchor "Quadrangle Preference"
+\ref triangle_preference_anchor "Triangle Preference"
\ref max_element_volume_hypo_page "Max Element Volume"
@@ -61,4 +62,4 @@ allows to apply 1D, 2D, 3D meshing algorithms and a set of hypotheses:
\image html image7.jpg
-*/
\ No newline at end of file
+*/
diff --git a/idl/SMESH_BasicHypothesis.idl b/idl/SMESH_BasicHypothesis.idl
index 5978aa052..1fd3f02d7 100644
--- a/idl/SMESH_BasicHypothesis.idl
+++ b/idl/SMESH_BasicHypothesis.idl
@@ -306,6 +306,16 @@ module StdMeshers
{
};
+ /*!
+ * StdMeshers_TrianglePreference: interface of "TrianglePreference" hypothesis.
+ * This hypothesis is used by StdMeshers_Quadrangle_2D algorithm.
+ * Presence of this hypothesis forces construction of triangles in the refinement
+ * area if the number of nodes on opposite edges is not the same.
+ */
+ interface StdMeshers_TrianglePreference : SMESH::SMESH_Hypothesis
+ {
+ };
+
/*!
* StdMeshers_QuadraticMesh: interface of "QuadraticMesh" hypothesis.
* This is an auxiliary 1D hypothesis whose presence forces construction
diff --git a/resources/StdMeshers.xml b/resources/StdMeshers.xml
index 25cbd18bc..892779e3c 100644
--- a/resources/StdMeshers.xml
+++ b/resources/StdMeshers.xml
@@ -63,6 +63,12 @@
auxiliary="true"
dim="2"/>
+
+
diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx
index a24d8dcbe..96724a917 100644
--- a/src/SMESH_I/SMESH_2smeshpy.cxx
+++ b/src/SMESH_I/SMESH_2smeshpy.cxx
@@ -1034,6 +1034,9 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th
hyp->SetConvMethodAndType( "QuadranglePreference", "Quadrangle_2D");
hyp->SetConvMethodAndType( "QuadranglePreference", "NETGEN_2D_ONLY");
}
+ else if ( hypType == "TrianglePreference" ) {
+ hyp->SetConvMethodAndType( "TrianglePreference", "Quadrangle_2D");
+ }
// NETGEN ----------
// else if ( hypType == "NETGEN_2D") { // 1D-2D
// algo->SetConvMethodAndType( "Triangle" , hypType.ToCString());
diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py
index 9b77ceaa5..218415f05 100644
--- a/src/SMESH_SWIG/smeshDC.py
+++ b/src/SMESH_SWIG/smeshDC.py
@@ -3428,6 +3428,16 @@ class Mesh_Quadrangle(Mesh_Algorithm):
CompareMethod=self.CompareEqualHyp)
return hyp
+ ## Defines "TrianglePreference" hypothesis, forcing construction
+ # of triangles in the refinement area if the number of nodes
+ # on the opposite edges is not the same
+ #
+ # @ingroup l3_hypos_additi
+ def TrianglePreference(self):
+ hyp = self.Hypothesis("TrianglePreference", UseExisting=1,
+ CompareMethod=self.CompareEqualHyp)
+ return hyp
+
# Public class: Mesh_Tetrahedron
# ------------------------------
diff --git a/src/StdMeshers/Makefile.am b/src/StdMeshers/Makefile.am
index bc886b5df..892b0e094 100644
--- a/src/StdMeshers/Makefile.am
+++ b/src/StdMeshers/Makefile.am
@@ -64,7 +64,8 @@ salomeinclude_HEADERS = \
StdMeshers_CompositeSegment_1D.hxx \
StdMeshers_UseExisting_1D2D.hxx \
StdMeshers_QuadToTriaAdaptor.hxx \
- SMESH_StdMeshers.hxx
+ SMESH_StdMeshers.hxx \
+ StdMeshers_TrianglePreference.hxx
# Libraries targets
@@ -106,7 +107,8 @@ dist_libStdMeshers_la_SOURCES = \
StdMeshers_FaceSide.cxx \
StdMeshers_CompositeSegment_1D.cxx \
StdMeshers_UseExisting_1D2D.cxx \
- StdMeshers_QuadToTriaAdaptor.cxx
+ StdMeshers_QuadToTriaAdaptor.cxx \
+ StdMeshers_TrianglePreference.cxx
# additionnal information to compil and link file
diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
index 9fd2d0105..aa6b28165 100644
--- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
+++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
@@ -1,4 +1,4 @@
-// SMESH SMESH : implementaion of SMESH idl descriptions
+ // SMESH SMESH : implementaion of SMESH idl descriptions
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -83,6 +83,7 @@ StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D (int hypId, int studyId, SMES
_name = "Quadrangle_2D";
_shapeType = (1 << TopAbs_FACE);
_compatibleHypothesis.push_back("QuadranglePreference");
+ _compatibleHypothesis.push_back("TrianglePreference");
myTool = 0;
}
@@ -111,10 +112,25 @@ bool StdMeshers_Quadrangle_2D::CheckHypothesis
bool isOk = true;
aStatus = SMESH_Hypothesis::HYP_OK;
- // there is only one compatible Hypothesis so far
- const list &hyps = GetUsedHypothesis(aMesh, aShape, false);
- myQuadranglePreference = hyps.size() > 0;
+ const list &hyps = GetUsedHypothesis(aMesh, aShape, false);
+ const SMESHDS_Hypothesis *theHyp = 0;
+
+ if(hyps.size() > 0){
+ theHyp = *hyps.begin();
+ if(strcmp("QuadranglePreference", theHyp->GetName()) == 0) {
+ myQuadranglePreference= true;
+ myTrianglePreference= false;
+ }
+ else if(strcmp("TrianglePreference", theHyp->GetName()) == 0){
+ myQuadranglePreference= false;
+ myTrianglePreference= true;
+ }
+ }
+ else {
+ myQuadranglePreference = false;
+ myTrianglePreference = false;
+ }
return isOk;
}
@@ -307,8 +323,17 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
else
d = quad->uv_grid[nbhoriz + near - 1].node;
//SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d);
- SMDS_MeshFace* face = myTool->AddFace(a, b, c, d);
- meshDS->SetMeshElementOnShape(face, geomFaceID);
+
+ if(!myTrianglePreference){
+ SMDS_MeshFace* face = myTool->AddFace(a, b, c, d);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ }
+ else {
+ SMDS_MeshFace* face = myTool->AddFace(a, b, c);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ face = myTool->AddFace(a, c, d);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ }
// if node d is not at position g - make additional triangles
if (near - 1 > g) {
@@ -391,8 +416,16 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
else
d = quad->uv_grid[nbhoriz*(nbvertic - 2) + near + 1].node;
//SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d);
- SMDS_MeshFace* face = myTool->AddFace(a, b, c, d);
- meshDS->SetMeshElementOnShape(face, geomFaceID);
+ if(!myTrianglePreference){
+ SMDS_MeshFace* face = myTool->AddFace(a, b, c, d);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ }
+ else {
+ SMDS_MeshFace* face = myTool->AddFace(a, b, c);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ face = myTool->AddFace(a, c, d);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ }
if (near + 1 < g) { // if d not is at g - make additional triangles
for (int k = near + 1; k < g; k++) {
@@ -460,8 +493,17 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
else
d = quad->uv_grid[nbhoriz*near - 2].node;
//SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d);
- SMDS_MeshFace* face = myTool->AddFace(a, b, c, d);
- meshDS->SetMeshElementOnShape(face, geomFaceID);
+
+ if(!myTrianglePreference){
+ SMDS_MeshFace* face = myTool->AddFace(a, b, c, d);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ }
+ else {
+ SMDS_MeshFace* face = myTool->AddFace(a, b, c);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ face = myTool->AddFace(a, c, d);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ }
if (near - 1 > g) { // if d not is at g - make additional triangles
for (int k = near - 1; k > g; k--) {
@@ -526,8 +568,16 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
else
d = quad->uv_grid[nbhoriz*(near + 1) + 1].node;
//SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d);
- SMDS_MeshFace* face = myTool->AddFace(a, b, c, d);
- meshDS->SetMeshElementOnShape(face, geomFaceID);
+ if(!myTrianglePreference){
+ SMDS_MeshFace* face = myTool->AddFace(a, b, c, d);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ }
+ else {
+ SMDS_MeshFace* face = myTool->AddFace(a, b, c);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ face = myTool->AddFace(a, c, d);
+ meshDS->SetMeshElementOnShape(face, geomFaceID);
+ }
if (near + 1 < g) { // if d not is at g - make additional triangles
for (int k = near + 1; k < g; k++) {
diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx
index 72b317be2..cf9d78461 100644
--- a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx
+++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx
@@ -103,6 +103,9 @@ protected:
// is not the same in the case where the global number of nodes on edges is even
bool myQuadranglePreference;
+ bool myTrianglePreference;
+
+
SMESH_MesherHelper* myTool; // tool for working with quadratic elements
};
diff --git a/src/StdMeshers/StdMeshers_TrianglePreference.cxx b/src/StdMeshers/StdMeshers_TrianglePreference.cxx
new file mode 100644
index 000000000..af14e2ef2
--- /dev/null
+++ b/src/StdMeshers/StdMeshers_TrianglePreference.cxx
@@ -0,0 +1,116 @@
+// SMESH StdMeshers_TrianglePreference
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : StdMeshers_TrianglePreference.cxx
+// Module : SMESH
+// $Header$
+
+#include "StdMeshers_TrianglePreference.hxx"
+#include "utilities.h"
+
+using namespace std;
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+StdMeshers_TrianglePreference::StdMeshers_TrianglePreference(int hypId,
+ int studyId,
+ SMESH_Gen * gen)
+ :SMESH_Hypothesis(hypId, studyId, gen)
+{
+ _name = "TrianglePreference";
+ _param_algo_dim = -2; // auxiliary used by StdMeshers_Quadrangle_2D
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+StdMeshers_TrianglePreference::~StdMeshers_TrianglePreference()
+{
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+ostream & StdMeshers_TrianglePreference::SaveTo(ostream & save)
+{
+ return save;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+istream & StdMeshers_TrianglePreference::LoadFrom(istream & load)
+{
+ return load;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+ostream & operator <<(ostream & save, StdMeshers_TrianglePreference & hyp)
+{
+ return hyp.SaveTo( save );
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+istream & operator >>(istream & load, StdMeshers_TrianglePreference & hyp)
+{
+ return hyp.LoadFrom( load );
+}
+//================================================================================
+/*!
+ * \brief Initialize my parameter values by the mesh built on the geometry
+ * \param theMesh - the built mesh
+ * \param theShape - the geometry of interest
+ * \retval bool - true if parameter values have been successfully defined
+ *
+ * Just return false as this hypothesis does not have parameters values
+ */
+//================================================================================
+
+bool StdMeshers_TrianglePreference::SetParametersByMesh(const SMESH_Mesh* /*theMesh*/,
+ const TopoDS_Shape& /*theShape*/)
+{
+ return false;
+}
diff --git a/src/StdMeshers/StdMeshers_TrianglePreference.hxx b/src/StdMeshers/StdMeshers_TrianglePreference.hxx
new file mode 100644
index 000000000..247bf1d47
--- /dev/null
+++ b/src/StdMeshers/StdMeshers_TrianglePreference.hxx
@@ -0,0 +1,64 @@
+// SMESH StdMeshers : implementaion of SMESH idl descriptions
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : StdMeshers_TrianglePreference.hxx
+// Module : SMESH
+// $Header$
+
+#ifndef _StdMeshers_TrianglePreference_HXX_
+#define _StdMeshers_TrianglePreference_HXX_
+
+#include "SMESH_StdMeshers.hxx"
+
+#include "SMESH_Hypothesis.hxx"
+#include "Utils_SALOME_Exception.hxx"
+
+/*!
+ * \brief Hypothesis for StdMeshers_Quadrangle_2D, forcing construction
+ * of triangles in the in a refinement area if the number of nodes
+ * on opposite edges is not the same. See Issue 16186.
+ */
+class STDMESHERS_EXPORT StdMeshers_TrianglePreference:public SMESH_Hypothesis
+{
+ public:
+ StdMeshers_TrianglePreference(int hypId, int studyId, SMESH_Gen * gen);
+ virtual ~ StdMeshers_TrianglePreference();
+
+ virtual std::ostream & SaveTo(std::ostream & save);
+ virtual std::istream & LoadFrom(std::istream & load);
+ friend std::ostream & operator <<(std::ostream & save, StdMeshers_TrianglePreference & hyp);
+ friend std::istream & operator >>(std::istream & load, StdMeshers_TrianglePreference & hyp);
+
+ /*!
+ * \brief Initialize my parameter values by the mesh built on the geometry
+ * \param theMesh - the built mesh
+ * \param theShape - the geometry of interest
+ * \retval bool - true if parameter values have been successfully defined
+ *
+ * Just return false as this hypothesis does not have parameters values
+ */
+ virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
+
+};
+
+#endif
diff --git a/src/StdMeshersGUI/StdMeshers_images.po b/src/StdMeshersGUI/StdMeshers_images.po
index e087d1d1e..88cc6f005 100644
--- a/src/StdMeshersGUI/StdMeshers_images.po
+++ b/src/StdMeshersGUI/StdMeshers_images.po
@@ -110,6 +110,10 @@ msgstr "mesh_tree_hypo_area.png"
msgid "ICON_SMESH_TREE_HYPO_QuadranglePreference"
msgstr "mesh_tree_algo_quad.png"
+#mesh_tree_hypo_trianglepreference
+msgid "ICON_SMESH_TREE_HYPO_TrianglePreference"
+msgstr "mesh_tree_algo_mefisto.png"
+
#mesh_tree_hypo_quadraticmesh
msgid "ICON_SMESH_TREE_HYPO_QuadraticMesh"
msgstr "mesh_tree_hypo_length.png"
diff --git a/src/StdMeshers_I/Makefile.am b/src/StdMeshers_I/Makefile.am
index 9f908c722..01e005599 100644
--- a/src/StdMeshers_I/Makefile.am
+++ b/src/StdMeshers_I/Makefile.am
@@ -58,6 +58,7 @@ salomeinclude_HEADERS = \
StdMeshers_CompositeSegment_1D_i.hxx \
StdMeshers_SegmentAroundVertex_0D_i.hxx \
StdMeshers_SegmentLengthAroundVertex_i.hxx \
+ StdMeshers_TrianglePreference_i.hxx \
SMESH_StdMeshers_I.hxx
# Libraries targets
@@ -93,6 +94,7 @@ dist_libStdMeshersEngine_la_SOURCES = \
StdMeshers_CompositeSegment_1D_i.cxx \
StdMeshers_SegmentAroundVertex_0D_i.cxx \
StdMeshers_SegmentLengthAroundVertex_i.cxx \
+ StdMeshers_TrianglePreference_i.cxx \
StdMeshers_UseExisting_1D2D_i.cxx
# additionnal information to compil and link file
diff --git a/src/StdMeshers_I/StdMeshers_TrianglePreference_i.cxx b/src/StdMeshers_I/StdMeshers_TrianglePreference_i.cxx
new file mode 100644
index 000000000..18bddd713
--- /dev/null
+++ b/src/StdMeshers_I/StdMeshers_TrianglePreference_i.cxx
@@ -0,0 +1,95 @@
+// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : StdMeshers_TrianglePreference_i.cxx
+// Author :
+// Module : SMESH
+
+#include "StdMeshers_TrianglePreference_i.hxx"
+#include "SMESH_Gen_i.hxx"
+#include "SMESH_Gen.hxx"
+
+#include "Utils_CorbaException.hxx"
+#include "utilities.h"
+
+#include
+
+using namespace std;
+
+//=============================================================================
+/*!
+ * StdMeshers_TrianglePreference_i::StdMeshers_TrianglePreference_i
+ *
+ * Constructor
+ */
+//=============================================================================
+
+StdMeshers_TrianglePreference_i::StdMeshers_TrianglePreference_i
+( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl ): SALOME::GenericObj_i( thePOA ),
+ SMESH_Hypothesis_i( thePOA )
+{
+ myBaseImpl = new ::StdMeshers_TrianglePreference( theGenImpl->GetANewId(),
+ theStudyId,
+ theGenImpl );
+}
+
+//=============================================================================
+/*!
+ * StdMeshers_TrianglePreference_i::~StdMeshers_TrianglePreference_i
+ *
+ * Destructor
+ */
+//=============================================================================
+
+StdMeshers_TrianglePreference_i::~StdMeshers_TrianglePreference_i()
+{
+}
+
+//=============================================================================
+/*!
+ * StdMeshers_TrianglePreference_i::GetImpl
+ *
+ * Get implementation
+ */
+//=============================================================================
+
+::StdMeshers_TrianglePreference* StdMeshers_TrianglePreference_i::GetImpl()
+{
+ return ( ::StdMeshers_TrianglePreference* )myBaseImpl;
+}
+
+//================================================================================
+/*!
+ * \brief Verify whether hypothesis supports given entity type
+ * \param type - dimension (see SMESH::Dimension enumeration)
+ * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
+ *
+ * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
+ */
+//================================================================================
+
+CORBA::Boolean StdMeshers_TrianglePreference_i::IsDimSupported( SMESH::Dimension type )
+{
+ return type == SMESH::DIM_2D;
+}
+
diff --git a/src/StdMeshers_I/StdMeshers_TrianglePreference_i.hxx b/src/StdMeshers_I/StdMeshers_TrianglePreference_i.hxx
new file mode 100644
index 000000000..f57ad7171
--- /dev/null
+++ b/src/StdMeshers_I/StdMeshers_TrianglePreference_i.hxx
@@ -0,0 +1,59 @@
+// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : StdMeshers_TrianglePreference_i.hxx
+// Author :
+// Module : SMESH
+
+
+#ifndef _SMESH_TrianglePreference_I_HXX_
+#define _SMESH_TrianglePreference_I_HXX_
+
+#include "SMESH_StdMeshers_I.hxx"
+
+#include
+#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
+
+#include "SMESH_Hypothesis_i.hxx"
+#include "StdMeshers_TrianglePreference.hxx"
+
+class SMESH_Gen;
+
+class STDMESHERS_I_EXPORT StdMeshers_TrianglePreference_i:
+ public virtual POA_StdMeshers::StdMeshers_TrianglePreference,
+ public virtual SMESH_Hypothesis_i
+{
+public:
+ // Constructor
+ StdMeshers_TrianglePreference_i( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl );
+ // Destructor
+ virtual ~StdMeshers_TrianglePreference_i();
+
+ // Get implementation
+ ::StdMeshers_TrianglePreference* GetImpl();
+
+ // Verify whether hypothesis supports given entity type
+ CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+};
+
+#endif //_SMESH_TrianglePreference_I_HXX_
diff --git a/src/StdMeshers_I/StdMeshers_i.cxx b/src/StdMeshers_I/StdMeshers_i.cxx
index ee8fe66ea..38fae1733 100644
--- a/src/StdMeshers_I/StdMeshers_i.cxx
+++ b/src/StdMeshers_I/StdMeshers_i.cxx
@@ -40,6 +40,7 @@
#include "StdMeshers_Propagation_i.hxx"
#include "StdMeshers_LengthFromEdges_i.hxx"
#include "StdMeshers_QuadranglePreference_i.hxx"
+#include "StdMeshers_TrianglePreference_i.hxx"
#include "StdMeshers_QuadraticMesh_i.hxx"
#include "StdMeshers_MaxElementArea_i.hxx"
#include "StdMeshers_MaxElementVolume_i.hxx"
@@ -108,6 +109,8 @@ STDMESHERS_I_EXPORT
aCreator = new StdHypothesisCreator_i;
else if (strcmp(aHypName, "QuadranglePreference") == 0)
aCreator = new StdHypothesisCreator_i;
+ else if (strcmp(aHypName, "TrianglePreference") == 0)
+ aCreator = new StdHypothesisCreator_i;
else if (strcmp(aHypName, "QuadraticMesh") == 0)
aCreator = new StdHypothesisCreator_i;
else if (strcmp(aHypName, "ProjectionSource3D") == 0)