Salome HOME
Add full-quadrangles support, available since MeshGems v2.5 cbr/add_full_quadrangle_support
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Tue, 29 Aug 2017 09:44:20 +0000 (11:44 +0200)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Tue, 29 Aug 2017 09:44:20 +0000 (11:44 +0200)
19 files changed:
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters.png
doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc
idl/BLSURFPlugin_Algorithm.idl
src/BLSURFPlugin/BLSURFPluginBuilder.py
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx
src/GUI/BLSURFPluginGUI_Dlg.h
src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.h
src/GUI/BLSURFPluginGUI_StdWidget.cxx
src/GUI/BLSURFPluginGUI_StdWidget_QTD.ui
src/GUI/BLSURFPlugin_msg_en.ts
src/GUI/BLSURFPlugin_msg_fr.ts
src/GUI/BLSURFPlugin_msg_ja.ts
tests/test_quadrangles_gradation.py
tests/test_remove_tiny_edges.py

index 8b743fa1f7d380baad12e84a1e1486e3757ce265..884b4112e0cf275ae196a582bdc04b32879288fc 100644 (file)
Binary files a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters.png and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters.png differ
index ec7d33c7e5249a68324a7ac0001e1f645ba99f47..ee4a8789d62ca4894ca90a3e989277de26a74b36 100644 (file)
@@ -57,7 +57,13 @@ The smaller this distance is, the closer the mesh is to the exact surface (only
 
 - <b>Mesh optimisation</b> - if checked, the mesh will be optimized in order to get better shaped elements.
 
-- <b>Allow Quadrangles</b> - if checked, allows the creation of quadrilateral elements.
+- <b>Elements type</b> - Type of the elements to generate the mesh with:
+
+  - Triangles: generate a mesh with only triangles.
+
+  - Quadrangle dominant: generate a mesh with a majority of quadrangles and a few triangles.
+
+  - Quadrangles: generate a mesh with only quadrangles.
 
 - <b>Anisotropic</b> - if checked, this parameter defines the maximum anisotropic ratio of the metric governing the anisotropic meshing process.
 The default value (0) means that the metric (and thus the generated elements) can be arbitrarily stretched.
index 671fd60ffd2e7b6178641046211cc8341289fbb9..e02d105a7e07ba5602f4bf4441bcdeb79099664f 100644 (file)
@@ -199,7 +199,8 @@ module BLSURFPlugin
      * Sets to create quadrilateral elements or not
      */
     void SetQuadAllowed(in boolean allowed);
-    boolean GetQuadAllowed();
+    void SetElementType(in long elementType);
+    long GetElementType();
 
     /*!
      * Sets angular deflection (in degrees) of a mesh face and edge from CAD surface
index 4548fa314698a9d019fc9cb19dd95c144cf1d3ce..53e2d8e9551d01cb344343c746ff8390cdb4531f 100644 (file)
@@ -26,6 +26,9 @@ import GEOM
 
 LIBRARY = "libBLSURFEngine.so"
 
+# ElementType enum
+Triangles, QuadrangleDominant, Quadrangles = 0, 1, 2
+
 # Topology treatment way of MG-CADSurf
 FromCAD, PreProcess, PreProcessPlus, PreCAD = 0,1,2,3
 
@@ -652,12 +655,19 @@ class BLSURF_Algorithm(Mesh_Algorithm):
     self.Parameters().ClearSizeMaps()
     pass
 
-  ## Sets QuadAllowed flag.
+  ## Sets QuadAllowed flag (DEPRECATED: use SetElementType)
   #  @param toAllow "allow quadrangles" flag value
+  # TODO: to remove in Salome 9
   def SetQuadAllowed(self, toAllow=True):
     self.Parameters().SetQuadAllowed(toAllow)
     pass
 
+  ## Sets elements type
+  #  @param theElementType: 0 (Triangles), 1 (QuadrangleDominant), 2 (Quadrangles)
+  def SetElementType(self, theElementType=Triangles):
+    self.Parameters().SetElementType(theElementType)
+    pass
+
   ## Defines hypothesis having several parameters
   #  @return hypothesis object
   def Parameters(self):
index 509972da10cacdb8d05fb64dd8f3dd06cede0154..ea2ecf66757c0546f44a7b0149fcfa2ae380a16f 100644 (file)
@@ -875,7 +875,7 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
   double _gradation             = BLSURFPlugin_Hypothesis::GetDefaultGradation();
   double _use_volume_gradation  = BLSURFPlugin_Hypothesis::GetDefaultUseVolumeGradation();
   double _volume_gradation      = BLSURFPlugin_Hypothesis::GetDefaultVolumeGradation();
-  bool   _quadAllowed           = BLSURFPlugin_Hypothesis::GetDefaultQuadAllowed();
+  BLSURFPlugin_Hypothesis::ElementType _elementType = BLSURFPlugin_Hypothesis::GetDefaultElementType();
   double _angleMesh             = BLSURFPlugin_Hypothesis::GetDefaultAngleMesh();
   double _chordalError          = BLSURFPlugin_Hypothesis::GetDefaultChordalError(diagonal);
   bool   _anisotropic           = BLSURFPlugin_Hypothesis::GetDefaultAnisotropic();
@@ -925,7 +925,7 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
     _use_volume_gradation    = hyp->GetUseVolumeGradation();
     if (hyp->GetVolumeGradation() > 0 && _use_volume_gradation )
       _volume_gradation      = hyp->GetVolumeGradation();
-    _quadAllowed     = hyp->GetQuadAllowed();
+    _elementType     = hyp->GetElementType();
     if (hyp->GetAngleMesh() > 0)
       _angleMesh     = hyp->GetAngleMesh();
     if (hyp->GetChordalError() > 0)
@@ -1055,13 +1055,29 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
      set_param(css, "max_size", _maxSizeRel ? val_to_string_rel(_maxSize).c_str() : val_to_string(_maxSize).c_str());
    }
    // anisotropic and quadrangle mesh requires disabling gradation
-   if ( _anisotropic && _quadAllowed )
+   if ( _anisotropic && _elementType != BLSURFPlugin_Hypothesis::Triangles )
      useGradation = false; // limitation of V1.3
    if ( useGradation && _use_gradation )
      set_param(css, "gradation",                       val_to_string(_gradation).c_str());
    if ( useGradation && _use_volume_gradation )
      set_param(css, "volume_gradation",                val_to_string(_volume_gradation).c_str());
-   set_param(css, "element_generation",                _quadAllowed ? "quad_dominant" : "triangle");
+
+   // New since MeshGems 2.5: add full_quad
+   const char * element_generation = "";
+   switch ( _elementType )
+   {
+     case BLSURFPlugin_Hypothesis::Triangles:
+       element_generation = "triangle";
+       break;
+     case BLSURFPlugin_Hypothesis::QuadrangleDominant:
+       element_generation = "quad_dominant";
+       break;
+     case BLSURFPlugin_Hypothesis::Quadrangles:
+       element_generation = "full_quad";
+       break;
+     default: ;
+   }
+   set_param(css, "element_generation",                element_generation);
 
 
    set_param(css, "metric",                            _anisotropic ? "anisotropic" : "isotropic");
@@ -3378,7 +3394,7 @@ bool BLSURFPlugin_BLSURF::Evaluate(SMESH_Mesh&         aMesh,
   bool   _phySizeRel    = BLSURFPlugin_Hypothesis::GetDefaultPhySizeRel();
   //int    _geometricMesh = BLSURFPlugin_Hypothesis::GetDefaultGeometricMesh();
   double _angleMesh     = BLSURFPlugin_Hypothesis::GetDefaultAngleMesh();
-  bool   _quadAllowed   = BLSURFPlugin_Hypothesis::GetDefaultQuadAllowed();
+  BLSURFPlugin_Hypothesis::ElementType   _elementType   = BLSURFPlugin_Hypothesis::GetDefaultElementType();
   if(_hypothesis) {
     _physicalMesh  = (int) _hypothesis->GetPhysicalMesh();
     _phySizeRel         = _hypothesis->IsPhySizeRel();
@@ -3387,7 +3403,7 @@ bool BLSURFPlugin_BLSURF::Evaluate(SMESH_Mesh&         aMesh,
     //_geometricMesh = (int) hyp->GetGeometricMesh();
     if (_hypothesis->GetAngleMesh() > 0)
       _angleMesh        = _hypothesis->GetAngleMesh();
-    _quadAllowed        = _hypothesis->GetQuadAllowed();
+    _elementType        = _hypothesis->GetElementType();
   } else {
     //0020968: EDF1545 SMESH: Problem in the creation of a mesh group on geometry
     // GetDefaultPhySize() sometimes leads to computation failure
@@ -3467,7 +3483,7 @@ bool BLSURFPlugin_BLSURF::Evaluate(SMESH_Mesh&         aMesh,
     int nbQuad = 0;
     int nbTria = (int) ( anArea/( ELen*ELen*sqrt(3.) / 4 ) );
     int nbNodes = (int) ( ( nbTria*3 - (nb1d-1)*2 ) / 6 + 1 );
-    if ( _quadAllowed )
+    if ( _elementType != BLSURFPlugin_Hypothesis::Quadrangles )
     {
       if ( nb1dVec.size() == 4 ) // quadrangle geom face
       {
index d567f50e71685b858392aa3753db1bac50046bed..4eed18794c86aa4104f26cd63f8ab379d30e0f47 100644 (file)
@@ -63,7 +63,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G
   _gradation(GetDefaultGradation()),
   _useVolumeGradation(GetDefaultUseVolumeGradation()),
   _volumeGradation(GetDefaultVolumeGradation()),
-  _quadAllowed(GetDefaultQuadAllowed()),
+  _elementType(GetDefaultElementType()),
   _angleMesh(GetDefaultAngleMesh()),
   _chordalError(GetDefaultChordalError()), 
   _anisotropic(GetDefaultAnisotropic()),
@@ -360,9 +360,9 @@ void BLSURFPlugin_Hypothesis::SetVolumeGradation(double theVal) {
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetQuadAllowed(bool theVal) {
-  if (theVal != _quadAllowed) {
-    _quadAllowed = theVal;
+void BLSURFPlugin_Hypothesis::SetElementType(ElementType theElementType) {
+  if (theElementType != _elementType) {
+    _elementType = theElementType;
     NotifySubMeshesHypothesisModification();
   }
 }
@@ -1930,7 +1930,7 @@ std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save)
   }
 
   save << " " << (int) _topology << " " << (int) _physicalMesh << " " << (int) _geometricMesh << " " << _phySize << " "
-       << _angleMesh << " " << _gradation << " " << (int) _quadAllowed << " " << _decimesh;
+       << _angleMesh << " " << _gradation << " " << (int) _elementType << " " << _decimesh;
   save << " " << _minSize << " " << _maxSize << " " << _angleMesh << " " << _minSize << " " << _maxSize << " " << _verb;
   save << " " << (int) _preCADMergeEdges << " " << _preCADRemoveNanoEdges << " " << (int) _preCADDiscardInput << " " << _preCADEpsNano ;
   save << " " << (int) _enforcedInternalVerticesAllFaces;
@@ -2257,7 +2257,7 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load)
 
   isOK = static_cast<bool>(load >> i);
   if (isOK)
-    _quadAllowed = (bool) i;
+    _elementType = (ElementType) i;
   else
     load.clear(std::ios::badbit | load.rdstate());
 
index 1531872641aeb3787c63124c492b9ce55a03f6c9..f44510593f155356210a2d475aba87d5480b4414 100644 (file)
@@ -64,6 +64,12 @@ public:
     GeometricalLocalSize
   };
 
+  enum ElementType {
+    Triangles,
+    QuadrangleDominant,
+    Quadrangles
+  };
+
   static const char* GetHypType(bool hasgeom)
   { return hasgeom ? "MG-CADSurf Parameters" : "MG-CADSurf Parameters_NOGEOM"; }
 
@@ -97,8 +103,8 @@ public:
   void SetVolumeGradation(double theGradation);
   double GetVolumeGradation() const { return _volumeGradation; }
 
-  void SetQuadAllowed(bool theVal);
-  bool GetQuadAllowed() const { return _quadAllowed; }
+  void SetElementType(ElementType theElementType);
+  ElementType GetElementType() const { return _elementType; }
 
   void SetAngleMesh(double theAngle);
   double GetAngleMesh() const { return _angleMesh; }
@@ -425,7 +431,7 @@ public:
   static double          GetDefaultGradation() { return 1.3; }
   static bool            GetDefaultUseVolumeGradation() { return false; }
   static double          GetDefaultVolumeGradation() { return 2; }
-  static bool            GetDefaultQuadAllowed() { return false; }
+  static ElementType     GetDefaultElementType() { return Triangles; }
   static double          GetDefaultAngleMesh() { return 8.0; }
   
   static double          GetDefaultChordalError(double diagonal);
@@ -567,7 +573,7 @@ private:
   double          _gradation;
   bool            _useVolumeGradation;
   double          _volumeGradation;
-  bool            _quadAllowed;
+  ElementType     _elementType;
   double          _angleMesh;
   double          _chordalError;
   bool            _anisotropic;
index 3eef21beb1a39d0645e4ab3597ea7d89027e6f7a..0de4975862a613009e043a58bacf5cf333634ffe 100644 (file)
@@ -362,25 +362,42 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetVolumeGradation()
  *  BLSURFPlugin_Hypothesis_i::SetQuadAllowed
  *
  *  Set true or false
+ *
+ *  DEPRACATED, kept for python script compatibility
+ *
+ *  TO be removed in Salome 9
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue)
 {
-  this->GetImpl()->SetQuadAllowed(theValue);
-  std::string theValueStr = theValue ? "True" : "False";
-  SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValueStr.c_str() << " )";
+  ::BLSURFPlugin_Hypothesis::ElementType theElementType = theValue ?
+                 ::BLSURFPlugin_Hypothesis::QuadrangleDominant : ::BLSURFPlugin_Hypothesis::Triangles;
+  this->GetImpl()->SetElementType(theElementType);
+  SMESH::TPythonDump() << _this() << ".SetElementType( " << theElementType << " )";
 }
 
 //=============================================================================
 /*!
- *  BLSURFPlugin_Hypothesis_i::GetQuadAllowed
+ *  BLSURFPlugin_Hypothesis_i::SetElementType
  *
- *  Get true or false
+ *  Set ElementType
+ */
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetElementType(CORBA::Long theValue)
+{
+  this->GetImpl()->SetElementType((::BLSURFPlugin_Hypothesis::ElementType) theValue);
+  SMESH::TPythonDump() << _this() << ".SetElementType( " << theValue << " )";
+}
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::GetElementType
+ *
+ *  Get ElementType
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed()
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetElementType()
 {
-  return this->GetImpl()->GetQuadAllowed();
+  return this->GetImpl()->GetElementType();
 }
 
 //=============================================================================
index aceec48f0f89a4c00e7bce4f55afe3797fc17358..e5517d9a4b34d7b54865e18001d109535a98e3ad 100644 (file)
@@ -82,7 +82,9 @@ public:
   CORBA::Double GetVolumeGradation();
 
   void SetQuadAllowed(CORBA::Boolean theValue);
-  CORBA::Boolean GetQuadAllowed();
+
+  void SetElementType(CORBA::Long theValue);
+  CORBA::Long GetElementType();
 
   void SetAngleMesh(CORBA::Double theValue);
   CORBA::Double GetAngleMesh();
index 7c244265c14e84e25370bf2e74fbf17697f13a65..e82becaacefb13b133a69492ea39afa6a5a6419a 100644 (file)
@@ -37,6 +37,12 @@ enum GeometricMesh
     GeometricalLocalSize
   };
 
+enum ElementType {
+  Triangles,
+  QuadrangleDominant,
+  Quadrangles
+};
+
 enum Topology {
     FromCAD = 0,
     Process,
index 94ba8e72e4b64316a58756f2d7c43f6726156ab9..48cf60ceebea38686428e74f9649e8dbc6826bd3 100644 (file)
@@ -1168,7 +1168,6 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   myTabWidget->setCurrentIndex( STD_TAB );
 
   connect( myAdvWidget->addBtn, SIGNAL( clicked() ),           this, SLOT( onAddOption() ) );
-  connect( myStdWidget->myAllowQuadrangles, SIGNAL( stateChanged( int ) ), this, SLOT( onStateChange() ));
 
   // Size Maps
   connect( addMapButton,        SIGNAL( clicked()),                    this,         SLOT( onAddMap() ) );
@@ -1802,8 +1801,14 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const
     myStdWidget->myVolumeGradation->setText("");
   else
     myStdWidget->myVolumeGradation->SetValue( data.myVolumeGradation );
-  myStdWidget->myAllowQuadrangles->setChecked( data.myAllowQuadrangles );
   
+  foreach (QAbstractButton* button, myStdWidget->myButtonGroupElementType->buttons()) {
+    if (myStdWidget->myButtonGroupElementType->id(button) == data.myElementType) {
+      button->setChecked(true);
+      break;
+    }
+  }
+
   if (data.myAngleMesh < 0)
     myStdWidget->myAngleMesh->setText("");
   else
@@ -2002,7 +2007,7 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData
   h_data.myGradation              = h->GetGradation();
   h_data.myUseVolumeGradation     = h->GetUseVolumeGradation();
   h_data.myVolumeGradation        = h->GetVolumeGradation();
-  h_data.myAllowQuadrangles       = h->GetQuadAllowed();
+  h_data.myElementType            = h->GetElementType();
   double angle                    = h->GetAngleMesh();
   h_data.myAngleMesh              = angle > 0 ? angle : -1.0;
   double chordalError             = h->GetChordalError();
@@ -2261,8 +2266,8 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
     if ( h->GetVolumeGradation() !=  h_data.myVolumeGradation )
       h->SetVolumeGradation( h_data.myVolumeGradation <= 0 ? -1 : h_data.myVolumeGradation );
 
-    if ( h->GetQuadAllowed() != h_data.myAllowQuadrangles )
-      h->SetQuadAllowed( h_data.myAllowQuadrangles );
+    if ( h->GetElementType() != h_data.myElementType )
+      h->SetElementType( h_data.myElementType );
     
     if ( (int) h_data.myGeometricMesh != DefaultGeom ) {
       if ( h->GetAngleMesh() != h_data.myAngleMesh )
@@ -2493,7 +2498,7 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes
   h_data.myGradation             = h_data.myUseGradation ? myStdWidget->myGradation->GetValue() : -1.0;
   h_data.myUseVolumeGradation    = myStdWidget->myUseVolumeGradation->isChecked() && !myStdWidget->myVolumeGradation->text().isEmpty();
   h_data.myVolumeGradation       = h_data.myUseVolumeGradation ? myStdWidget->myVolumeGradation->GetValue() : -1. ;
-  h_data.myAllowQuadrangles      = myStdWidget->myAllowQuadrangles->isChecked();
+  h_data.myElementType           = myStdWidget->myButtonGroupElementType->checkedId();
   h_data.myAngleMesh             = myStdWidget->myAngleMesh->text().isEmpty() ? -1.0 : myStdWidget->myAngleMesh->GetValue();
   h_data.myChordalError          = myStdWidget->myChordalError->text().isEmpty() ? -1.0 : myStdWidget->myChordalError->GetValue();
   h_data.myAnisotropic           = myStdWidget->myAnisotropic->isChecked();
@@ -2524,7 +2529,7 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes
   guiHyp += tr("BLSURF_MAXSIZE") + " = "+ QString::number( h_data.myMaxSize ) + "; ";
   guiHyp += tr("BLSURF_MAXSIZE") + " " + tr("BLSURF_SIZE_REL") + " = " + QString(h_data.myMaxSizeRel ? "yes" : "no") + "; ";
   guiHyp += tr("BLSURF_GRADATION") + " = " + QString::number( h_data.myGradation ) + "; ";
-  guiHyp += tr("BLSURF_ALLOW_QUADRANGLES") + " = " + QString(h_data.myAllowQuadrangles ? "yes" : "no") + "; ";
+  guiHyp += tr("BLSURF_ELEMENT_TYPE") + " = " + QString::number(h_data.myElementType) + "; ";
   guiHyp += tr("BLSURF_ANGLE_MESH") + " = " + QString::number( h_data.myAngleMesh ) + "; ";
   guiHyp += tr("BLSURF_CHORDAL_ERROR") + " = " + QString::number( h_data.myChordalError ) + "; ";
   guiHyp += tr("BLSURF_ANISOTROPIC") + " = " + QString(h_data.myAnisotropic ? "yes" : "no") + "; ";
index 4c5a952cdc4b7738bb0769ccb37948830e11fcc4..edf0098975913d3ba1ed2c80cc93b08a8f53a80c 100644 (file)
@@ -169,7 +169,8 @@ typedef struct
   bool    myAnisotropic, myOptimiseTinyEdges, myRemoveTinyEdges, myForceBadElementRemoval, myCorrectSurfaceIntersection;
   double  myAnisotropicRatio, myTinyEdgeLength, myTinyEdgeOptimisLength, myBadElementAspectRatio, myCorrectSurfaceIntersectionMaxCost;
   bool    myOptimizeMesh, myQuadraticMesh;
-  bool    myAllowQuadrangles, mySmpsurface,mySmpedge,mySmppoint,myEnforcedVertex,myInternalEnforcedVerticesAllFaces;
+  bool    mySmpsurface,mySmpedge,mySmppoint,myEnforcedVertex,myInternalEnforcedVerticesAllFaces;
+  long    myElementType;
   // bool    myPreCADMergeEdges, myPreCADProcess3DTopology, myPreCADDiscardInput;
 //   bool    myGMFFileMode;
   std::string myGMFFileName, myInternalEnforcedVerticesAllFacesGroup;
index 35a60c4b3749e3c33ac052c91b182e5ef81012e3..830ce66c7da1c12baafe6ce2a45b4a1106d5f33e 100644 (file)
@@ -61,6 +61,9 @@ BLSURFPluginGUI_StdWidget::BLSURFPluginGUI_StdWidget( QWidget* parent, Qt::Windo
   myTinyEdgeOptimisLength->setText("");
   myCorrectSurfaceIntersectionMaxCost->setText("");
   myBadElementAspectRatio->setText("");
+  myButtonGroupElementType->setId(myRadioButtonTriangles, Triangles);
+  myButtonGroupElementType->setId(myRadioButtonQuadrangleDominant, QuadrangleDominant);
+  myButtonGroupElementType->setId(myRadioButtonQuadrangles, Quadrangles);
 }
 
 BLSURFPluginGUI_StdWidget::~BLSURFPluginGUI_StdWidget()
index 53b0517df3b44a93ff33c13cb9f67edb72c442c8..608fe0d8352bbfa375ffe6b02a33568d86a42697 100644 (file)
@@ -7,23 +7,11 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>667</width>
-    <height>342</height>
+    <width>723</width>
+    <height>399</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout_5">
-   <property name="leftMargin">
-    <number>0</number>
-   </property>
-   <property name="topMargin">
-    <number>0</number>
-   </property>
-   <property name="rightMargin">
-    <number>0</number>
-   </property>
-   <property name="bottomMargin">
-    <number>0</number>
-   </property>
    <item row="0" column="0">
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
          <string>BLSURF_GEOM_MESH_TOOLTIP</string>
         </property>
         <property name="currentText">
-         <string>GLOBAL_SIZE</string>
+         <string>BLSURF_DEFAULT_USER</string>
         </property>
         <item>
          <property name="text">
       <string>BLSURF_MAIN_PARAMETERS</string>
      </property>
      <layout class="QGridLayout" name="gridLayout_3">
-      <item row="2" column="0">
-       <widget class="QCheckBox" name="myOptimizeMesh">
-        <property name="toolTip">
-         <string>BLSURF_OPTIMISATION_TOOLTIP</string>
-        </property>
-        <property name="text">
-         <string>BLSURF_OPTIMISATION</string>
-        </property>
-        <property name="checked">
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0">
-       <widget class="QCheckBox" name="myQuadraticMesh">
+      <item row="1" column="0">
+       <widget class="QCheckBox" name="myUseGradation">
         <property name="toolTip">
-         <string>BLSURF_ELEMENT_ORDER_TOOLTIP</string>
+         <string>BLSURF_GRADATION_TOOLTIP</string>
         </property>
         <property name="text">
-         <string>BLSURF_ELEMENT_ORDER</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <widget class="SMESHGUI_SpinBox" name="myGradation">
-        <property name="enabled">
-         <bool>false</bool>
+         <string>BLSURF_GRADATION</string>
         </property>
        </widget>
       </item>
-      <item row="4" column="0">
+      <item row="3" column="0">
        <spacer name="verticalSpacer_3">
         <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
        </spacer>
       </item>
-      <item row="1" column="0">
-       <widget class="QCheckBox" name="myUseGradation">
+      <item row="0" column="0">
+       <widget class="QCheckBox" name="myQuadraticMesh">
         <property name="toolTip">
-         <string>BLSURF_GRADATION_TOOLTIP</string>
+         <string>BLSURF_ELEMENT_ORDER_TOOLTIP</string>
         </property>
         <property name="text">
-         <string>BLSURF_GRADATION</string>
+         <string>BLSURF_ELEMENT_ORDER</string>
         </property>
        </widget>
       </item>
-      <item row="3" column="0">
-       <widget class="QCheckBox" name="myAllowQuadrangles">
+      <item row="1" column="1">
+       <widget class="SMESHGUI_SpinBox" name="myGradation">
+        <property name="enabled">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0">
+       <widget class="QCheckBox" name="myOptimizeMesh">
         <property name="toolTip">
-         <string>BLSURF_ALLOW_QUADRANGLES_TOOLTIP</string>
+         <string>BLSURF_OPTIMISATION_TOOLTIP</string>
         </property>
         <property name="text">
-         <string>BLSURF_ALLOW_QUADRANGLES</string>
+         <string>BLSURF_OPTIMISATION</string>
+        </property>
+        <property name="checked">
+         <bool>true</bool>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
-   <item row="1" column="1">
+   <item row="1" column="1" rowspan="2">
     <widget class="QGroupBox" name="groupBox_3">
      <property name="title">
       <string>BLSURF_OTHER_PARAMETERS</string>
      </layout>
     </widget>
    </item>
+   <item row="2" column="0">
+    <widget class="QGroupBox" name="groupBox_4">
+     <property name="title">
+      <string>BLSURF_ELEMENT_TYPE</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <widget class="QRadioButton" name="myRadioButtonTriangles">
+        <property name="toolTip">
+         <string>BLSURF_TRIANGLES_TOOLTIP</string>
+        </property>
+        <property name="text">
+         <string>BLSURF_TRIANGLES</string>
+        </property>
+        <property name="checked">
+         <bool>true</bool>
+        </property>
+        <attribute name="buttonGroup">
+         <string notr="true">myButtonGroupElementType</string>
+        </attribute>
+       </widget>
+      </item>
+      <item>
+       <widget class="QRadioButton" name="myRadioButtonQuadrangleDominant">
+        <property name="toolTip">
+         <string>BLSURF_ALLOW_QUADRANGLES_TOOLTIP</string>
+        </property>
+        <property name="text">
+         <string>BLSURF_QUADRANGLE_DOMINANT</string>
+        </property>
+        <attribute name="buttonGroup">
+         <string notr="true">myButtonGroupElementType</string>
+        </attribute>
+       </widget>
+      </item>
+      <item>
+       <widget class="QRadioButton" name="myRadioButtonQuadrangles">
+        <property name="toolTip">
+         <string>BLSURF_QUADRANGLES_TOOLTIP</string>
+        </property>
+        <property name="text">
+         <string>BLSURF_QUADRANGLES</string>
+        </property>
+        <attribute name="buttonGroup">
+         <string notr="true">myButtonGroupElementType</string>
+        </attribute>
+       </widget>
+      </item>
+      <item>
+       <spacer name="verticalSpacer_6">
+        <property name="orientation">
+         <enum>Qt::Vertical</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>3</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>
   <tabstop>myUseGradation</tabstop>
   <tabstop>myGradation</tabstop>
   <tabstop>myOptimizeMesh</tabstop>
-  <tabstop>myAllowQuadrangles</tabstop>
   <tabstop>myAnisotropic</tabstop>
   <tabstop>myAnisotropicRatio</tabstop>
   <tabstop>myOptimiseTinyEdges</tabstop>
   <slot>onPhysicalMeshChanged()</slot>
   <slot>onEditingFinished()</slot>
  </slots>
+ <buttongroups>
+  <buttongroup name="myButtonGroupElementType"/>
+ </buttongroups>
 </ui>
index 6162398a4d906d4e71e2838ad282a0dc590f789e..8117f433edde3ae75f4ed3c679bf29464975408b 100644 (file)
@@ -100,13 +100,33 @@ The default computed value is &lt;em&gt;diag&lt;/em&gt;/5.</translation>
         <translation>Maximum ratio between the lengths of two adjacent edges in 3D mesh.</translation>
     </message>
     <message>
-        <source>BLSURF_ALLOW_QUADRANGLES</source>
-        <translation>Allow Quadrangles</translation>
+        <source>BLSURF_ELEMENT_TYPE</source>
+        <translation>Elements type</translation>
+    </message>
+    <message>
+        <source>BLSURF_TRIANGLES</source>
+        <translation>Triangles</translation>
+    </message>
+    <message>
+        <source>BLSURF_QUADRANGLE_DOMINANT</source>
+        <translation>Quadrangle dominant</translation>
+    </message>
+    <message>
+        <source>BLSURF_QUADRANGLES</source>
+        <translation>Quadrangles</translation>
     </message>
     <message>
         <source>BLSURF_ALLOW_QUADRANGLES_TOOLTIP</source>
         <translation>To generate quadrangle dominant mesh</translation>
     </message>
+    <message>
+        <source>BLSURF_TRIANGLES_TOOLTIP</source>
+        <translation>To generate triangles-only mesh</translation>
+    </message>
+    <message>
+        <source>BLSURF_QUADRANGLES_TOOLTIP</source>
+        <translation>To generate quadrangles-only mesh</translation>
+    </message>
     <message>
         <source>BLSURF_GEOMETRICAL_SIZE</source>
         <translation>Geometrical size</translation>
index 56d7efd6e1d0da17feac4ea60d0904c9504a1c49..bd56b83d8f95ae767653c6bfac0af38966fa5fe6 100755 (executable)
@@ -104,13 +104,33 @@ La valeur par défaut est calculée par &lt;em&gt;diag&lt;/em&gt;/5.</translatio
         <translation>Ratio maximum entre les longueurs de deux segments adjacents.</translation>
     </message>
     <message>
-        <source>BLSURF_ALLOW_QUADRANGLES</source>
-        <translation>Autoriser les quadrangles</translation>
+        <source>BLSURF_ELEMENT_TYPE</source>
+        <translation>Type d'éléments</translation>
+    </message>
+    <message>
+        <source>BLSURF_TRIANGLES</source>
+        <translation>Triangles</translation>
+    </message>
+    <message>
+        <source>BLSURF_QUADRANGLE_DOMINANT</source>
+        <translation>Quadrangles en majorité</translation>
+    </message>
+    <message>
+        <source>BLSURF_QUADRANGLES</source>
+        <translation>Quadrangles</translation>
     </message>
     <message>
         <source>BLSURF_ALLOW_QUADRANGLES_TOOLTIP</source>
         <translation>Générer un maillage à majorité de quadrangles</translation>
     </message>
+    <message>
+        <source>BLSURF_TRIANGLES_TOOLTIP</source>
+        <translation>Générer un maillage en triangles uniquement</translation>
+    </message>
+    <message>
+        <source>BLSURF_QUADRANGLES_TOOLTIP</source>
+        <translation>Générer un maillage en quadrangles uniquement</translation>
+    </message>
     <message>
         <source>BLSURF_GEOMETRICAL_SIZE</source>
         <translation> Taille géométrique </translation>
index 1e0eb84bc1e2ef2476ac5c4763fdcefd47dfb779..d5085f3b4fb5071897b414e0ba45e68232bdea58 100644 (file)
       <translation>四角形を許可</translation>
     </message>
     <message>
-      <source>BLSURF_ALLOW_QUADRANGLES_TOOLTIP</source>
-      <translation>ドミナント四角形要素の生成</translation>
+        <source>BLSURF_ELEMENT_TYPE</source>
+        <translation type="unfinished">Element type</translation>
+    </message>
+    <message>
+        <source>BLSURF_TRIANGLES</source>
+        <translation type="unfinished">Triangles</translation>
+    </message>
+    <message>
+        <source>BLSURF_QUADRANGLE_DOMINANT</source>
+        <translation type="unfinished">Quadrangle dominant</translation>
+    </message>
+    <message>
+        <source>BLSURF_QUADRANGLES</source>
+        <translation type="unfinished">Quadrangles</translation>
+    </message>
+    <message>
+        <source>BLSURF_ALLOW_QUADRANGLES_TOOLTIP</source>
+        <translation>ドミナント四角形要素の生成</translation>
+    </message>
+    <message>
+        <source>BLSURF_TRIANGLES_TOOLTIP</source>
+        <translation type="unfinished">To generate triangles-only mesh</translation>
+    </message>
+    <message>
+        <source>BLSURF_QUADRANGLES_TOOLTIP</source>
+        <translation type="unfinished">To generate quadrangles-only mesh</translation>
     </message>
     <message>
       <source>BLSURF_GEOMETRICAL_SIZE</source>
index 9a8f1083fdd2188d88687cd3b3a4aecc9d201294..264fd8f266207c5ac96787d785badbd81b773792 100644 (file)
@@ -87,7 +87,7 @@ params.SetGeometricMesh( 1 )
 params.SetAngleMesh( 4 )
 params.SetPhySize( 8 )
 algo2d.SetGradation(1.05)
-params.SetQuadAllowed( True )
+params.SetElementType( True )
 
 ok = Mesh_1.Compute()
 
@@ -124,7 +124,7 @@ params.SetGeometricMesh( 1 )
 params.SetAngleMesh( 4 )
 params.SetPhySize( 8 )
 algo2d.SetGradation(1.05)
-params.SetQuadAllowed( True )
+params.SetElementType( 1 )
 params.SetAnisotropic(True)
 
 ok = Mesh_2.Compute()
index 1e863ee6e7c07d703ed8b563081d7dac529bcd3c..0b61607876df3b08d9aefbf585d57c27ea2fe647 100644 (file)
@@ -76,7 +76,6 @@ params.SetGeometricMesh( 1 )
 params.SetAngleMesh( 4 )
 params.SetPhySize( 8 )
 #algo2d.SetGradation(1.05)
-#params.SetQuadAllowed( True )
 params.SetQuadraticMesh( True )
 params.SetRemoveTinyEdges( True )
 params.SetTinyEdgeLength( tiny_edge_length )