]> SALOME platform Git repositories - plugins/hexoticplugin.git/commitdiff
Salome HOME
0023102: [CEA 1486 ] Add the parameters for defining the boundary layers
authormpa <mpa@opencascade.com>
Wed, 24 Jun 2015 09:53:50 +0000 (12:53 +0300)
committermpa <mpa@opencascade.com>
Wed, 24 Jun 2015 09:53:50 +0000 (12:53 +0300)
24 files changed:
doc/salome/examples/hexoticdemo_vl.py [new file with mode: 0644]
doc/salome/gui/HexoticPLUGIN/images/hexotic_local_size_parameters.png
doc/salome/gui/HexoticPLUGIN/images/hexotic_parameters.png
doc/salome/gui/HexoticPLUGIN/images/hexotic_vl_example.png [new file with mode: 0644]
doc/salome/gui/HexoticPLUGIN/images/hexotic_vl_parameters.png [new file with mode: 0644]
doc/salome/gui/HexoticPLUGIN/input/hexotic_hypo.doc
doc/salome/gui/HexoticPLUGIN/input/hexoticplugin_python_interface.doc
idl/HexoticPlugin_Algorithm.idl
src/GUI/CMakeLists.txt
src/GUI/HexoticPLUGIN_msg_en.ts
src/GUI/HexoticPLUGIN_msg_fr.ts
src/GUI/HexoticPLUGIN_msg_ja.ts
src/GUI/HexoticPluginGUI_Dlg.h
src/GUI/HexoticPluginGUI_HypothesisCreator.cxx
src/GUI/HexoticPluginGUI_HypothesisCreator.h
src/GUI/HexoticPluginGUI_ViscousLayersWidget.cxx [new file with mode: 0644]
src/GUI/HexoticPluginGUI_ViscousLayersWidget_QTD.ui [new file with mode: 0644]
src/HexoticPlugin/HexoticPLUGINBuilder.py
src/HexoticPlugin/HexoticPlugin_Hexotic.cxx
src/HexoticPlugin/HexoticPlugin_Hexotic.hxx
src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx
src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx

diff --git a/doc/salome/examples/hexoticdemo_vl.py b/doc/salome/examples/hexoticdemo_vl.py
new file mode 100644 (file)
index 0000000..bc2b4a2
--- /dev/null
@@ -0,0 +1,54 @@
+# Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# 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, or (at your option) any later version.
+#
+# 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
+#
+
+import salome
+salome.salome_init()
+theStudy = salome.myStudy
+
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
+
+# Create geometry
+Box_1 = geompy.MakeBoxDXDYDZ(50, 50, 50)
+geompy.addToStudy( Box_1, 'Box_1' )
+
+# Create mesh
+Mesh_mghexa_vl = smesh.Mesh(Box_1, "Mesh_mghexa_vl")
+
+Regular_1D = Mesh_mghexa_vl.Segment()
+Local_Length_1 = Regular_1D.LocalLength(8.66025,None,1e-07)
+
+MEFISTO_2D = Mesh_mghexa_vl.Triangle(algo=smeshBuilder.MEFISTO)
+
+MG_Hexa = Mesh_mghexa_vl.Hexahedron(algo=smeshBuilder.MG_Hexa)
+MG_Hexa_Parameters = MG_Hexa.Parameters()
+MG_Hexa.SetViscousLayers(5,5,3,"Inward",[13,23])
+MG_Hexa_Parameters.SetMinSize( 2 )
+MG_Hexa_Parameters.SetMaxSize( 4 )
+MG_Hexa_Parameters.SetHexesMinLevel( 2 )
+MG_Hexa_Parameters.SetHexesMaxLevel( 4 )
+
+# Compute
+Mesh_mghexa_vl.Compute()
+
+# End of script
index 15091c811df4305c14f82c9764e6257134de0665..5cf1043ceacb30b83430e08111311c80721b9c67 100644 (file)
Binary files a/doc/salome/gui/HexoticPLUGIN/images/hexotic_local_size_parameters.png and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_local_size_parameters.png differ
index b425dc639c8c86622056e7ce6aa5fd9399a22493..def5da78da2cdff89c131719d8896f939af9b528 100644 (file)
Binary files a/doc/salome/gui/HexoticPLUGIN/images/hexotic_parameters.png and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_parameters.png differ
diff --git a/doc/salome/gui/HexoticPLUGIN/images/hexotic_vl_example.png b/doc/salome/gui/HexoticPLUGIN/images/hexotic_vl_example.png
new file mode 100644 (file)
index 0000000..0be4f23
Binary files /dev/null and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_vl_example.png differ
diff --git a/doc/salome/gui/HexoticPLUGIN/images/hexotic_vl_parameters.png b/doc/salome/gui/HexoticPLUGIN/images/hexotic_vl_parameters.png
new file mode 100644 (file)
index 0000000..16099a8
Binary files /dev/null and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_vl_parameters.png differ
index df292c337741ad5b298871fa8b222bb7061090cb..60d962494b3aecb473fa542970ab986974bcea9b 100644 (file)
@@ -74,4 +74,22 @@ The area where the mesh has to be refined is given as a geometrical shape.
 
 \note The local size will only influence the density towards a locally denser mesh. If the required density is coarser than the one determined automatically by the global size parameters 
 (min size, max size, min level, max level), it will be ignored and the default density will be used.
+
+\section hexotic_viscous_layers_parameters Viscous layers
+
+The viscous layers allows you to set up parameters of Viscous Layers supported by MG_Hexa mesher.
+
+\image html hexotic_vl_parameters.png
+<ul>
+<li><b>Number of layers</b> - number of boundary layers.</li>
+<li><b>Size of the first layer</b> - height of the first layer.</li>
+<li><b>Direction of the layers</b> - describes whether the layers grow inwards or outwards.</li>
+<li><b>Growth</b> - geometric progression for the boundary layer growth.</li>
+<li><b>Faces with layers</b> - list of surface references from which the boundary 
+layers should be grown.</li>
+<li><b>Imprinted faces</b> - list of surface references that can be imprinted by 
+boundary layers.</li>
+</ul>
+
 */
index 96cb32ebe3939b775bdc3101f53b7cf78c5f35ff..abad64fbd15c3bc91909209e0c5968e7d9e972f5 100644 (file)
@@ -35,6 +35,11 @@ Below you can see examples of usage of this class for hexahedral mesh generation
 
 \image html hexotic_basic_subdivisions_4_8.png Left: MG-Hexa mesh without hypothesis, right: MG-Hexa mesh with an hypothesis defined by minl=4 and maxl=8
 
+<h2>Example of mesh generation with MG-Hexa algorithm and viscous layers parameters:</h2>
+\tui_script{hexoticdemo_vl.py}
+
+\image html hexotic_vl_example.png Left: MG-Hexa mesh without viscous layers parameters, right: MG-Hexa mesh with viscous layers parameters
+
 \subsection tui_local_size Local size
 
 \image html hexotic_local_size_example.png Example of use of a local size on the skin of a sphere
index e1d09e98b34009e1859743d4032214dc8e44ce8f..8c3cd0ac439df3012eaef3978965b6c23b043a23 100644 (file)
@@ -26,6 +26,7 @@
 #define _SMESH_HexoticALGORITHM_IDL_
 
 #include "SMESH_Hypothesis.idl"
+#include "SMESH_Mesh.idl"
 #include "GEOM_Gen.idl"
 
 /*!
@@ -100,6 +101,24 @@ module HexoticPlugin
     void UnsetSizeMap(in GEOM::GEOM_Object GeomObj);
 
     HexoticPluginSizeMapsList GetSizeMaps();
+    
+    void SetNbLayers(in long theVal);
+    long GetNbLayers();
+
+    void SetFirstLayerSize(in double theVal);
+    double GetFirstLayerSize();
+
+    void SetDirection(in boolean theVal);
+    boolean GetDirection();
+
+    void SetGrowth(in double theVal);
+    double GetGrowth();
+
+    void SetFacesWithLayers(in SMESH::long_array theVal);
+    SMESH::long_array GetFacesWithLayers();
+
+    void SetImprintedFaces(in SMESH::long_array theVal);
+    SMESH::long_array GetImprintedFaces();
   };
 };
 
index 6abe9178fb38f4d60cd22bbde38635cd1202893c..e7dae2d5f512a8d8c7818afa1aaa1a1eace1a014 100644 (file)
@@ -85,6 +85,7 @@ SET(_other_SOURCES
   HexoticPluginGUI.cxx
   HexoticPluginGUI_StdWidget.cxx
   HexoticPluginGUI_SizeMapsWidget.cxx
+  HexoticPluginGUI_ViscousLayersWidget.cxx
   HexoticPluginGUI_HypothesisCreator.cxx
 )
 
@@ -102,6 +103,7 @@ SET(_ts_RESOURCES
 SET(_uic_files
   HexoticPluginGUI_StdWidget_QTD.ui
   HexoticPluginGUI_SizeMapsWidget_QTD.ui
+  HexoticPluginGUI_ViscousLayersWidget_QTD.ui
 )
 
 # header files / uic wrappings
index a0eeb3c20f349e16c578198b222c6a73b2944e44..716ca891417074db78b099dd38f8924d305049d7 100644 (file)
         <source>Hexotic_3D_TITLE</source>
         <translation>Hypothesis Construction</translation>
     </message>
+    <message>
+        <source>Hexotic_VISCOUS_LAYERS</source>
+        <translation>Viscous layers</translation>
+    </message>
     <message>
         <source>Hexotic_INPUT_SIZE</source>
         <translation>Sizes</translation>
         <source>Hexotic_NULL_LOCAL_SIZE</source>
         <translation>0 is not allowed as "Local size"</translation>
     </message>
+    <message>
+        <source>Hexotic_NB_LAYERS</source>
+        <translation>Number of layers</translation>
+    </message>
+    <message>
+        <source>Hexotic_FIRST_LAYER_SIZE</source>
+        <translation>Size of the first layer</translation>
+    </message>
+    <message>
+        <source>Hexotic_DIRECTION</source>
+        <translation>Direction of the layers</translation>
+    </message>
+    <message>
+        <source>Hexotic_GROWTH</source>
+        <translation>Growth</translation>
+    </message>
+    <message>
+        <source>Hexotic_FACES_WITH_LAYERS</source>
+        <translation>Faces with layers</translation>
+    </message>
+    <message>
+        <source>Hexotic_IMPRINTED_FACES</source>
+        <translation>Imprinted faces</translation>
+    </message>
 </context>
 </TS>
index b5fb72ca561ecb634476557fd35c6889fbd0bf6a..1d445fe17dfa0e53d19768bea589b72cdcb84707 100755 (executable)
         <source>Hexotic_3D_TITLE</source>
         <translation>Construction de l&apos;hypothèse</translation>
     </message>
+    <message>
+        <source>Hexotic_VISCOUS_LAYERS</source>
+        <translation>Couches limites</translation>
+    </message>
     <message>
         <source>Hexotic_INPUT_SIZE</source>
         <translation>Tailles</translation>
         <source>Hexotic_SEL_SHAPE</source>
         <translation>Sélectionnez un objet géométrique</translation>
     </message>
+    <message>
+        <source>Hexotic_NB_LAYERS</source>
+        <translation>Nombre de couches</translation>
+    </message>
+    <message>
+        <source>Hexotic_FIRST_LAYER_SIZE</source>
+        <translation>Taille de la première couche</translation>
+    </message>
+    <message>
+        <source>Hexotic_DIRECTION</source>
+        <translation>Direction des couches</translation>
+    </message>
+    <message>
+        <source>Hexotic_GROWTH</source>
+        <translation>Accroissement</translation>
+    </message>
+    <message>
+        <source>Hexotic_FACES_WITH_LAYERS</source>
+        <translation>Faces avec couche limite</translation>
+    </message>
+    <message>
+        <source>Hexotic_IMPRINTED_FACES</source>
+        <translation type="unfinished">Imprinted faces</translation>
+    </message>
 </context>
 </TS>
index a31833b0ead2df8a98d382afa134499e92ba32c2..0717ae76da07a8836afeaae6b769bfd074ad22f9 100644 (file)
       <source>Hexotic_3D_TITLE</source>
       <translation>仮定の構成</translation>
     </message>
+    <message>
+      <source>Hexotic_VISCOUS_LAYERS</source>
+      <translation>境界層設定</translation>
+    </message>
     <message>
       <source>Hexotic_INPUT_SIZE</source>
       <translation>サイズ</translation>
       <source>Hexotic_NULL_LOCAL_SIZE</source>
       <translation>局所サイズとしてゼロは許されていない</translation>
     </message>
+    <message>
+        <source>Hexotic_NB_LAYERS</source>
+        <translation>層数</translation>
+    </message>
+    <message>
+        <source>Hexotic_FIRST_LAYER_SIZE</source>
+        <translation type="unfinished">Size of the first layer</translation>
+    </message>
+    <message>
+        <source>Hexotic_DIRECTION</source>
+        <translation type="unfinished">Direction of the layers</translation>
+    </message>
+    <message>
+        <source>Hexotic_GROWTH</source>
+        <translation type="unfinished">Growth</translation>
+    </message>
+    <message>
+        <source>Hexotic_FACES_WITH_LAYERS</source>
+        <translation>面層</translation>
+    </message>
+    <message>
+        <source>Hexotic_IMPRINTED_FACES</source>
+        <translation type="unfinished">Imprinted faces</translation>
+    </message>
   </context>
 </TS>
index 73b2c0c0a0fa21012d06f8aeb8b75abf8c034cfb..9ffe39f1616b592314f5105c89ceb5acb5447b8b 100644 (file)
@@ -38,8 +38,11 @@ enum {
 
 #include "ui_HexoticPluginGUI_StdWidget_QTD.h"
 #include "ui_HexoticPluginGUI_SizeMapsWidget_QTD.h"
+#include "ui_HexoticPluginGUI_ViscousLayersWidget_QTD.h"
 #include "HexoticPluginGUI.h"
 
+#include <StdMeshersGUI_SubShapeSelectorWdg.h>
+
 class HEXOTICPLUGIN_GUI_EXPORT HexoticPluginGUI_StdWidget : public QWidget,
                                             public Ui::HexoticPluginGUI_StdWidget_QTD
 {
@@ -67,5 +70,21 @@ public:
   ~HexoticPluginGUI_SizeMapsWidget();
 };
 
+class HEXOTICPLUGIN_GUI_EXPORT HexoticPluginGUI_ViscousLayersWidget : public QWidget,
+                                            public Ui::HexoticPluginGUI_ViscousLayersWidget_QTD
+{
+  Q_OBJECT
+
+public:
+  HexoticPluginGUI_ViscousLayersWidget( QWidget* = 0, Qt::WindowFlags = 0 );
+  ~HexoticPluginGUI_ViscousLayersWidget();
+
+public slots:
+  void onSelectionChanged();
+
+public:
+  StdMeshersGUI_SubShapeSelectorWdg* myFacesWithLayers;
+  StdMeshersGUI_SubShapeSelectorWdg* myImprintedFaces;
+};
 
 #endif
index 3c212e2b346586f74f7a592130d141f984b103f7..99e1e32bfe524ac6670e3497b498f5e38fc1d0c3 100644 (file)
@@ -58,7 +58,8 @@
 // Main widget tabs identification
 enum {
   STD_TAB = 0,
-  SMP_TAB
+  SMP_TAB,
+  VL_TAB
 };
 
 // Size maps tab, table columns order
@@ -245,19 +246,48 @@ QFrame* HexoticPluginGUI_HypothesisCreator::buildFrame()
   aSmpLayout->setMargin( 0 );
   aSmpLayout->addWidget( mySmpWidget);
   
+  // Viscous Layers tab
+  QWidget* aVLGroup = new QWidget();
+  lay->addWidget( aVLGroup );
+
+  // Viscous layers widget creation and initialisation
+  myVLWidget = new HexoticPluginGUI_ViscousLayersWidget(aVLGroup);
+
+  QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+  QString aSubEntry  = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+
+  if ( !aMainEntry.isEmpty() )
+  {
+    myVLWidget->myFacesWithLayers->SetGeomShapeEntry( aSubEntry, aMainEntry );
+    myVLWidget->myImprintedFaces->SetGeomShapeEntry( aSubEntry, aMainEntry );
+  }
+  else
+  {
+       myVLWidget->labelFacesWithLayers->setVisible(false);
+    myVLWidget->myFacesWithLayers->setVisible(false);
+    myVLWidget->labelImprintedFaces->setVisible(false);
+    myVLWidget->myImprintedFaces->setVisible(false);
+  }
+
+  // Add the viscous layers widget to a layout
+  QHBoxLayout* aVLLayout = new QHBoxLayout( aVLGroup );
+  aVLLayout->setSpacing( 6 );
+  aVLLayout->setMargin( 11 );
+  aVLLayout->addWidget( myVLWidget );
+
 //  resizeEvent();
   
   aTabWidget->insertTab( STD_TAB, aStdGroup, tr( "SMESH_ARGUMENTS" ) );
   aTabWidget->insertTab( SMP_TAB, aSmpGroup, tr( "LOCAL_SIZE" ) );
+  aTabWidget->insertTab( VL_TAB, aVLGroup, tr( "Hexotic_VISCOUS_LAYERS") );
   
   myIs3D = true;
   
   // Size Maps
   mySizeMapsToRemove.clear();
-  connect( mySmpWidget->pushButton_1,  SIGNAL( clicked() ),                              this,  SLOT( onAddLocalSize() ) );
-  connect( mySmpWidget->pushButton_2,  SIGNAL( clicked() ),                              this,  SLOT( onRemoveLocalSize() ) );
-  
+  connect( mySmpWidget->pushButton_1, SIGNAL( clicked() ),          this, SLOT( onAddLocalSize() ) );
+  connect( mySmpWidget->pushButton_2, SIGNAL( clicked() ),          this, SLOT( onRemoveLocalSize() ) );
+  connect( aTabWidget,                SIGNAL( currentChanged(int)), this, SLOT( onTabChanged( int ) ) );
   return fr;
 }
 
@@ -434,6 +464,39 @@ void HexoticPluginGUI_HypothesisCreator::retrieveParams() const
     insertLocalSizeInWidget( entry, shapeName, size , row );
   }
 
+  myVLWidget->myNbLayers->setCleared(data.myNbLayers == 0);
+  if (data.myNbLayers == 0)
+    myVLWidget->myNbLayers->setText("");
+  else
+    myVLWidget->myNbLayers->setValue( data.myNbLayers );
+
+  myVLWidget->myFirstLayerSize->setCleared(data.myFirstLayerSize == 0);
+  if (data.myFirstLayerSize == 0)
+    myVLWidget->myFirstLayerSize->setText("");
+  else
+    myVLWidget->myFirstLayerSize->setValue( data.myFirstLayerSize );
+
+  myVLWidget->myDirection->setCurrentIndex( data.myDirection ? 0 : 1 );
+  myVLWidget->myGrowth->setCleared(data.myGrowth == 0);
+  if (data.myGrowth == 0)
+    myVLWidget->myGrowth->setText("");
+  else
+    myVLWidget->myGrowth->setValue( data.myGrowth );
+
+  std::vector<int> vector = data.myFacesWithLayers;
+  SMESH::long_array_var aVec = new SMESH::long_array;
+  aVec->length(vector.size());
+  for (int i = 0; i < vector.size(); i++)
+    aVec[i]=vector.at(i);
+  myVLWidget->myFacesWithLayers->SetListOfIDs(aVec);
+  vector = data.myImprintedFaces;
+  aVec = new SMESH::long_array;
+  aVec->length(vector.size());
+  for (int i = 0; i < vector.size(); i++)
+    aVec[i]=vector.at(i);
+  myVLWidget->myImprintedFaces->SetListOfIDs(aVec);
+
+
   std::cout << "myStdWidget->myMinSize->value(): " << myStdWidget->myMinSize->value() << std::endl;
   std::cout << "myStdWidget->myMaxSize->value(): " << myStdWidget->myMaxSize->value() << std::endl;
   std::cout << "myStdWidget->myHexesMinLevel->value(): " << myStdWidget->myHexesMinLevel->value() << std::endl;
@@ -481,6 +544,11 @@ QString HexoticPluginGUI_HypothesisCreator::storeParams() const
   valStr += tr("Hexotic_MAX_MEMORY") + " = " + QString::number( data.myHexoticMaxMemory ) + "; ";
   valStr += tr("Hexotic_SD_MODE") + " = " + QString::number( data.myHexoticSdMode) + "; ";
 
+  valStr += tr("Hexotic_NB_LAYERS") + " = " + QString::number(data.myNbLayers) + ";";
+  valStr += tr("Hexotic_FIRST_LAYER_SIZE") + " = " + QString::number(data.myFirstLayerSize) + ";";
+  valStr += tr("Hexotic_DIRECTION") + " = " + QString::number(data.myDirection) + ";";
+  valStr += tr("Hexotic_GROWTH") + " = " + QString::number(data.myGrowth) + ";";
+
 //  std::cout << "Data: " << valStr.toStdString() << std::endl;
 
   return valStr;
@@ -517,6 +585,18 @@ bool HexoticPluginGUI_HypothesisCreator::readParamsFromHypo( HexoticHypothesisDa
     MESSAGE("READING Size map : entry "<<entry<<" size : "<<size)
   }
   
+  // Viscous layers
+  h_data.myNbLayers = h->GetNbLayers();
+  h_data.myFirstLayerSize = h->GetFirstLayerSize();
+  h_data.myDirection = h->GetDirection();
+  h_data.myGrowth = h->GetGrowth();
+  SMESH::long_array_var vector = h->GetFacesWithLayers();
+  for (int i = 0; i < vector->length(); i++)
+    h_data.myFacesWithLayers.push_back(vector[i]);
+  vector = h->GetImprintedFaces();
+  for (int i = 0; i < vector->length(); i++)
+    h_data.myImprintedFaces.push_back(vector[i]);
+
   return true;
 }
 
@@ -557,6 +637,26 @@ bool HexoticPluginGUI_HypothesisCreator::storeParamsToHypo( const HexoticHypothe
     {
       h->UnsetSizeMapEntry(entry_it->c_str());
     }
+
+    // Viscous layers
+    h->SetNbLayers( h_data.myNbLayers );
+    h->SetFirstLayerSize( h_data.myFirstLayerSize );
+    h->SetDirection( h_data.myDirection );
+    h->SetGrowth( h_data.myGrowth );
+    
+    std::vector<int> vector = h_data.myFacesWithLayers;
+    SMESH::long_array_var aVec = new SMESH::long_array;
+    aVec->length(vector.size());
+    for (int i = 0; i < vector.size(); i++)
+      aVec[i]=vector.at(i);
+    h->SetFacesWithLayers( aVec );
+    
+    vector = h_data.myImprintedFaces;
+    aVec = new SMESH::long_array;
+    aVec->length(vector.size());
+    for (int i = 0; i < vector.size(); i++)
+      aVec[i]=vector.at(i);
+    h->SetImprintedFaces( aVec );
   }
   catch(const SALOME::SALOME_Exception& ex)
   {
@@ -591,6 +691,17 @@ bool HexoticPluginGUI_HypothesisCreator::readParamsFromWidgets( HexoticHypothesi
   if ( !ok )
     return false;
   
+  h_data.myNbLayers = myVLWidget->myNbLayers->text().isEmpty() ? 0.0 : myVLWidget->myNbLayers->value();
+  h_data.myFirstLayerSize = myVLWidget->myFirstLayerSize->text().isEmpty() ? 0.0 : myVLWidget->myFirstLayerSize->value();
+  h_data.myDirection = myVLWidget->myDirection->currentIndex() == 0 ? true : false;
+  h_data.myGrowth = myVLWidget->myGrowth->text().isEmpty() ? 0.0 : myVLWidget->myGrowth->value();
+  SMESH::long_array_var ids = myVLWidget->myFacesWithLayers->GetListOfIDs();
+  for (int i = 0; i < ids->length(); i++)
+    h_data.myFacesWithLayers.push_back( ids[i] );
+  ids = myVLWidget->myImprintedFaces->GetListOfIDs();
+  for (int i = 0; i < ids->length(); i++)
+    h_data.myImprintedFaces.push_back( ids[i] );
+
   printData(h_data);
 
   return true;
@@ -651,3 +762,9 @@ QString HexoticPluginGUI_HypothesisCreator::helpPage() const
 {
   return "hexotic_hypo_page.html";
 }
+
+void HexoticPluginGUI_HypothesisCreator::onTabChanged(int i)
+{
+  myVLWidget->myFacesWithLayers->ShowPreview( i == VL_TAB );
+  myVLWidget->myImprintedFaces->ShowPreview( false );
+}
index 6e7cfd1318c830d717f9dbc8c99aa9dcbe572b39..01b38104b09bc8e4f43777878d1ebc563ecc14fc 100644 (file)
@@ -40,6 +40,7 @@ class QTableWidgetItem;
 
 class HexoticPluginGUI_StdWidget;
 class HexoticPluginGUI_SizeMapsWidget;
+class HexoticPluginGUI_ViscousLayersWidget;
 
 typedef struct
 {
@@ -55,6 +56,12 @@ typedef struct
   int      myHexoticMaxMemory;
   int      myHexoticSdMode;
   HexoticPlugin_Hypothesis::THexoticSizeMaps mySizeMaps;
+  int      myNbLayers;
+  double   myFirstLayerSize;
+  bool     myDirection;
+  double   myGrowth;
+  std::vector<int> myFacesWithLayers;
+  std::vector<int> myImprintedFaces;
 } HexoticHypothesisData;
 
 /*!
@@ -97,6 +104,7 @@ private:
   QLineEdit*   myName;
   HexoticPluginGUI_StdWidget*           myStdWidget;
   HexoticPluginGUI_SizeMapsWidget*       mySmpWidget;
+  HexoticPluginGUI_ViscousLayersWidget*  myVLWidget;
   StdMeshersGUI_ObjectReferenceParamWdg* myGeomSelWdg;
 
   bool                           myIs3D;
@@ -106,6 +114,7 @@ private:
 protected slots:
   void             onAddLocalSize();
   void             onRemoveLocalSize();
+  void             onTabChanged(int);
   
 };
 
diff --git a/src/GUI/HexoticPluginGUI_ViscousLayersWidget.cxx b/src/GUI/HexoticPluginGUI_ViscousLayersWidget.cxx
new file mode 100644 (file)
index 0000000..2edaf43
--- /dev/null
@@ -0,0 +1,84 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D
+//
+// 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, or (at your option) any later version.
+//
+// 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    : HexoticPluginGUI_ViscousLayersWidget.cxx
+//
+
+#include "HexoticPluginGUI_Dlg.h"
+
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
+#include <StdMeshersGUI_SubShapeSelectorWdg.h>
+
+//////////////////////////////////////////
+// HexoticPluginGUI_ViscousLayersWidget
+//////////////////////////////////////////
+
+HexoticPluginGUI_ViscousLayersWidget::HexoticPluginGUI_ViscousLayersWidget( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+  setupUi( this );
+
+  // Obtain precision from preferences
+  int precision = SUIT_Session::session()->resourceMgr()->integerValue( "SMESH", "length_precision", -3 );
+
+  myNbLayers->setMinimum(0);
+  myNbLayers->setSingleStep( 1 );
+
+  myFirstLayerSize->setMinimum(0);
+  myFirstLayerSize->setPrecision(precision);
+  myFirstLayerSize->setSingleStep(0.1);
+
+  myGrowth->setMinimum(0);
+  myFirstLayerSize->setPrecision(precision);
+  myGrowth->setSingleStep( 0.1 );
+
+  myFacesWithLayers = new StdMeshersGUI_SubShapeSelectorWdg(0,TopAbs_FACE);
+  QHBoxLayout* layoutFacesWithLayers = new QHBoxLayout(myContainerFacesWithLayers);
+  layoutFacesWithLayers->setMargin(0);
+  layoutFacesWithLayers->addWidget(myFacesWithLayers);
+
+  myImprintedFaces = new StdMeshersGUI_SubShapeSelectorWdg(0,TopAbs_FACE);
+  QHBoxLayout* layoutImprintedFaces = new QHBoxLayout(myContainerImprintedFaces);
+  layoutImprintedFaces->setMargin(0);
+  layoutImprintedFaces->addWidget(myImprintedFaces);
+
+  connect( myFacesWithLayers, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
+  connect( myImprintedFaces, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
+}
+
+HexoticPluginGUI_ViscousLayersWidget::~HexoticPluginGUI_ViscousLayersWidget()
+{
+}
+
+void HexoticPluginGUI_ViscousLayersWidget::onSelectionChanged()
+{
+  StdMeshersGUI_SubShapeSelectorWdg* send = (StdMeshersGUI_SubShapeSelectorWdg*)sender();
+
+  bool isDefault = (send == myFacesWithLayers);
+  myFacesWithLayers->ShowPreview(isDefault);
+  myImprintedFaces->ShowPreview(!isDefault);
+  if (isDefault)
+    myImprintedFaces->ClearSelected();
+  else
+       myFacesWithLayers->ClearSelected();
+
+}
diff --git a/src/GUI/HexoticPluginGUI_ViscousLayersWidget_QTD.ui b/src/GUI/HexoticPluginGUI_ViscousLayersWidget_QTD.ui
new file mode 100644 (file)
index 0000000..e66ed8a
--- /dev/null
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>HexoticPluginGUI_ViscousLayersWidget_QTD</class>
+ <widget class="QWidget" name="HexoticPluginGUI_ViscousLayersWidget_QTD">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>403</width>
+    <height>496</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="margin">
+    <number>6</number>
+   </property>
+   <item row="1" column="0" colspan="2">
+    <widget class="QLabel" name="label_2">
+     <property name="text">
+      <string>Hexotic_FIRST_LAYER_SIZE</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="SalomeApp_DoubleSpinBox" name="myFirstLayerSize"/>
+   </item>
+   <item row="3" column="0">
+    <widget class="QLabel" name="label_3">
+     <property name="text">
+      <string>Hexotic_DIRECTION</string>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="0">
+    <widget class="QLabel" name="labelFacesWithLayers">
+     <property name="text">
+      <string>Hexotic_FACES_WITH_LAYERS</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="0">
+    <widget class="QLabel" name="label_4">
+     <property name="text">
+      <string>Hexotic_GROWTH</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="SalomeApp_IntSpinBox" name="myNbLayers"/>
+   </item>
+   <item row="3" column="2">
+    <widget class="QComboBox" name="myDirection">
+     <item>
+      <property name="text">
+       <string>Inward</string>
+      </property>
+     </item>
+     <item>
+      <property name="text">
+       <string>Outward</string>
+      </property>
+     </item>
+    </widget>
+   </item>
+   <item row="4" column="2">
+    <widget class="SalomeApp_DoubleSpinBox" name="myGrowth"/>
+   </item>
+   <item row="6" column="0">
+    <widget class="QLabel" name="labelImprintedFaces">
+     <property name="text">
+      <string>Hexotic_IMPRINTED_FACES</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="0">
+    <widget class="QLabel" name="label_1">
+     <property name="text">
+      <string>Hexotic_NB_LAYERS</string>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="2">
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>300</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="6" column="2">
+    <widget class="QWidget" name="myContainerImprintedFaces" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="2">
+    <widget class="QWidget" name="myContainerFacesWithLayers" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>SalomeApp_DoubleSpinBox</class>
+   <extends>QLineEdit</extends>
+   <header location="global">SalomeApp_DoubleSpinBox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>SalomeApp_IntSpinBox</class>
+   <extends>QLineEdit</extends>
+   <header location="global">SalomeApp_IntSpinBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>myFirstLayerSize</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
index 4a306ea9099f7279601a835e0ca559b4ba38363c..d8e034a7f921ec5b4d51f5ee83426af0696d1f93 100644 (file)
@@ -115,6 +115,33 @@ class Hexotic_Algorithm(Mesh_Algorithm):
     def MinMaxQuad(self, min=3, max=8, quad=True):
         print "WARNING: Function MinMaxQuad is deprecated, use SetMinMaxHexes instead"
         return self.SetMinMaxHexes(min, max)
+      
+    ## Defines "ViscousLayers" hypothesis to give MG-Hexa parameters
+    #  @param numberOfLayers number of boundary layers
+    #  @param firstLayerSize height of the first layer
+    #  @param growth geometric progression for the boundary layer growth
+    #  @param direction describes whether the layers grow inwards or outwards. 
+    #         if direction is:
+    #         \c Inward : means the layers grow inwards,
+    #         \c Outward : means the layers grow outwards
+    #  @param facesWithLayers list of surface references from which the boundary
+    #         layers should be grown
+    #  @param imprintedFaces list of surface references that can be imprinted by
+    #         boundary layers
+    #  @return hypothesis object
+    def SetViscousLayers(self, numberOfLayers, firstLayerSize, growth, 
+                          direction="Inward", facesWithLayers=[], imprintedFaces=[]): 
+        self.Parameters().SetNbLayers(numberOfLayers)
+        self.Parameters().SetFirstLayerSize(firstLayerSize)
+        self.Parameters().SetGrowth(growth)
+        if direction == "Inward":
+          self.Parameters().SetDirection(True)
+        elif direction == "Outward":
+          self.Parameters().SetDirection(False)
+        self.Parameters().SetFacesWithLayers(facesWithLayers)
+        self.Parameters().SetImprintedFaces(imprintedFaces)
+        
+        return self.Parameters()
 
     ## Defines hypothesis having several parameters
     #  @return hypothesis object
index 77ea8488af46fa54f4acb5e13d6e6903066b76aa..a2047d15f1fff3fd1a234e767785b9885d24aa15 100644 (file)
@@ -856,6 +856,12 @@ void HexoticPlugin_Hexotic::SetParameters(const HexoticPlugin_Hypothesis* hyp) {
     _hexoticMaxMemory = hyp->GetHexoticMaxMemory();
     _hexoticSdMode = hyp->GetHexoticSdMode();
     _sizeMaps = hyp->GetSizeMaps();
+    _nbLayers = hyp->GetNbLayers();
+    _firstLayerSize = hyp->GetFirstLayerSize();
+    _direction = hyp->GetDirection();
+    _growth = hyp->GetGrowth();
+    _facesWithLayers = hyp->GetFacesWithLayers();
+    _imprintedFaces = hyp->GetImprintedFaces();
   }
   else {
     cout << std::endl;
@@ -874,6 +880,12 @@ void HexoticPlugin_Hexotic::SetParameters(const HexoticPlugin_Hypothesis* hyp) {
     _hexoticMaxMemory = hyp->GetDefaultHexoticMaxMemory();
     _hexoticSdMode = hyp->GetDefaultHexoticSdMode();
     _sizeMaps = hyp->GetDefaultHexoticSizeMaps();
+    _nbLayers = hyp->GetDefaultNbLayers();
+    _firstLayerSize = hyp->GetDefaultFirstLayerSize();
+    _direction = hyp->GetDefaultDirection();
+    _growth = hyp->GetDefaultGrowth();
+    _facesWithLayers = hyp->GetDefaultFacesWithLayers();
+    _imprintedFaces = hyp->GetDefaultImprintedFaces();
   }
 }
 
@@ -964,6 +976,30 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   cout << "    " << _name << " Number of threads = " << _hexoticNbProc << std::endl;
   cout << "    " << _name << " Working directory = \"" << _hexoticWorkingDirectory << "\"" << std::endl;
   cout << "    " << _name << " Sub. Dom mode = " << _hexoticSdMode << std::endl;
+  cout << "    " << _name << " Number of layers = " << _nbLayers << std::endl;
+  cout << "    " << _name << " Size of the first layer  = " << _firstLayerSize << std::endl;
+  cout << "    " << _name << " Direction of the layers = " << ( _direction ? "Inward" : "Outward" ) << std::endl;
+  cout << "    " << _name << " Growth = " << _growth << std::endl;
+  if (!_facesWithLayers.empty()) {
+    cout << "    " << _name << " Faces with layers = ";
+    for (int i = 0; i < _facesWithLayers.size(); i++)
+    {
+      cout << _facesWithLayers.at(i);
+      if ((i + 1) != _facesWithLayers.size())
+        cout << ", ";
+    }
+    cout << std::endl;
+  }
+  if (!_imprintedFaces.empty()) {
+    cout << "    " << _name << " Imprinted faces = ";
+    for (int i = 0; i < _imprintedFaces.size(); i++)
+    {
+      cout << _imprintedFaces.at(i);
+      if ((i + 1) != _imprintedFaces.size())
+        cout << ", ";
+    }
+    cout << std::endl;
+  }
 
   TCollection_AsciiString run_Hexotic( "mg-hexa.exe" );
 
@@ -979,7 +1015,15 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   TCollection_AsciiString verb = " --verbose ";
   TCollection_AsciiString maxmem = " --max_memory ";
 
-  TCollection_AsciiString minLevel, maxLevel, minSize, maxSize, sharpAngle, mode, nbproc, verbosity, maxMemory;
+  TCollection_AsciiString comNbLayers = " --number_of_boundary_layers ";
+  TCollection_AsciiString comFirstLayerSize = " --height_of_the_first_layer ";
+  TCollection_AsciiString comDirection = " --boundary_layers_subdomain_direction ";
+  TCollection_AsciiString comGrowth = " --boundary_layers_geometric_progression ";
+  TCollection_AsciiString comFacesWithLayers = " --boundary_layers_surface_ids ";
+  TCollection_AsciiString comImptintedFaces = " --imprinted_surface_ids ";
+
+  TCollection_AsciiString minLevel, maxLevel, minSize, maxSize, sharpAngle, mode, nbproc, verbosity, maxMemory,
+                          nbLayers, firstLayerSize, direction, growth, facesWithLayers, imprintedFaces;
   minLevel = _hexesMinLevel;
   maxLevel = _hexesMaxLevel;
   minSize = _hexesMinSize;
@@ -1004,6 +1048,22 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   nbproc = _hexoticNbProc;
   verbosity = _hexoticVerbosity;
   maxMemory = _hexoticMaxMemory;
+  nbLayers = _nbLayers;
+  firstLayerSize = _firstLayerSize;
+  direction = _direction ? "1" : "-1";
+  growth = _growth;
+  for (int i = 0; i < _facesWithLayers.size(); i++)
+  {
+    facesWithLayers += _facesWithLayers[i];
+    if ((i + 1) != _facesWithLayers.size())
+      facesWithLayers += ",";
+  }
+  for (int i = 0; i < _imprintedFaces.size(); i++)
+  {
+    imprintedFaces += _imprintedFaces[i];
+    if ((i + 1) != _imprintedFaces.size())
+      imprintedFaces += ",";
+  }
 
   if (_hexoticIgnoreRidges)
     run_Hexotic +=  ignoreRidges;
@@ -1029,6 +1089,23 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   if (_sizeMaps.begin() != _sizeMaps.end())
     run_Hexotic += sizeMap + Hexotic_SizeMap_Prefix;
 
+  if (_nbLayers > 0)
+    run_Hexotic += comNbLayers + nbLayers;
+
+  if (_firstLayerSize > 0)
+    run_Hexotic += comFirstLayerSize + firstLayerSize;
+
+  run_Hexotic += comDirection + direction;
+
+  if (_growth > 0)
+    run_Hexotic += comGrowth + growth;
+
+  if (!_facesWithLayers.empty())
+    run_Hexotic += comFacesWithLayers + facesWithLayers;
+
+  if (!_imprintedFaces.empty())
+    run_Hexotic += comImptintedFaces + imprintedFaces;
+
   run_Hexotic += in + Hexotic_In + out + Hexotic_Out;
   run_Hexotic += subdom + mode;
 #ifndef WIN32
index da6adc04a728e7fdf989f07fb9d090c6ac4a652a..da6a84096adb7bd5a246a01f5dc10addf9cd0019 100644 (file)
@@ -136,6 +136,12 @@ private:
   int _hexoticMaxMemory;
   int _hexoticSdMode;
   HexoticPlugin_Hypothesis::THexoticSizeMaps _sizeMaps;
+  int    _nbLayers;
+  double _firstLayerSize;
+  bool   _direction;
+  double _growth;
+  std::vector<int> _facesWithLayers;
+  std::vector<int> _imprintedFaces;
   SMDS_MeshNode** _tabNode;
   
 #ifdef WITH_BLSURFPLUGIN
index 02e084d5c2b30f3297994f2003be4fe0afed43fe..b2432b412a1891bd1c96da5722599184c97d60c4 100644 (file)
@@ -47,7 +47,13 @@ HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis (int hypId, int studyId,
     _hexoticSdMode(GetDefaultHexoticSdMode()),
     _hexoticVerbosity(GetDefaultHexoticVerbosity()),
     _hexoticMaxMemory(GetDefaultHexoticMaxMemory()),
-    _sizeMaps(GetDefaultHexoticSizeMaps())
+    _sizeMaps(GetDefaultHexoticSizeMaps()),
+    _nbLayers(GetDefaultNbLayers()),
+    _firstLayerSize(GetDefaultFirstLayerSize()),
+    _direction(GetDefaultDirection()),
+    _growth(GetDefaultGrowth()),
+    _facesWithLayers(GetDefaultFacesWithLayers()),
+    _imprintedFaces(GetDefaultImprintedFaces())
 {
   MESSAGE("HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis");
   _name = GetHypType();
@@ -195,6 +201,52 @@ bool HexoticPlugin_Hypothesis::UnsetSizeMap(std::string theEntry) {
     return false;
 }
 
+void HexoticPlugin_Hypothesis::SetNbLayers(int theVal) {
+  if (theVal != _nbLayers) {
+    _nbLayers = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+void HexoticPlugin_Hypothesis::SetFirstLayerSize(double theVal) {
+  if (theVal != _firstLayerSize) {
+    _firstLayerSize = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+void HexoticPlugin_Hypothesis::SetDirection(bool theVal) {
+  if (theVal != _direction) {
+    _direction = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+void HexoticPlugin_Hypothesis::SetGrowth(double theVal) {
+  if (theVal != _growth) {
+    _growth = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+bool HexoticPlugin_Hypothesis::SetFacesWithLayers(const std::vector<int>& theVal) {
+  if ( _facesWithLayers != theVal ) {
+         _facesWithLayers = theVal;
+    NotifySubMeshesHypothesisModification();
+    return true;
+  }
+  return false;
+}
+
+bool HexoticPlugin_Hypothesis::SetImprintedFaces(const std::vector<int>& theVal) {
+  if ( _imprintedFaces != theVal ) {
+         _imprintedFaces = theVal;
+    NotifySubMeshesHypothesisModification();
+    return true;
+  }
+  return false;
+}
+
 //=============================================================================
 /*!
  *  
@@ -227,6 +279,28 @@ std::ostream& HexoticPlugin_Hypothesis::SaveTo(std::ostream& save)
     }
     save<<";";
   }
+  save<<"nbLayers="<<_nbLayers<<";";
+  save<<"firstLayerSize="<<_firstLayerSize<<";";
+  save<<"direction="<<_direction<<";";
+  save<<"growth="<<_growth<<";";
+  if ( !_facesWithLayers.empty() )
+  {
+    save<<"facesWithLayers=";
+    for ( int i = 0; i < _facesWithLayers.size(); i++ )
+    {
+      save<< _facesWithLayers.at(i) << "#" ;
+    }
+    save<<";";
+  }
+  if ( !_imprintedFaces.empty() )
+  {
+    save<<"imprintedFaces=";
+    for ( int i = 0; i < _imprintedFaces.size(); i++ )
+    {
+      save<< _imprintedFaces.at(i) << "#" ;
+    }
+    save<<";";
+  }
   return save;
 }
 
@@ -287,6 +361,34 @@ std::istream& HexoticPlugin_Hypothesis::LoadFrom(std::istream& load)
           sm_pos = sm_found + 1;
         }
       }
+      if (str3 == "nbLayers") _nbLayers = atoi(str4.c_str());
+      if (str3 == "firstLayerSize") _firstLayerSize = atof(str4.c_str());
+      if (str3 == "direction") _direction = atoi(str4.c_str());
+      if (str3 == "growth") _growth = atof(str4.c_str());
+      if (str3 == "facesWithLayers")
+      {
+        std::string id;
+        int pos = 0;
+        while ( pos < str4.length() )
+        {
+          int found = str4.find('#',pos);
+          id = str4.substr(pos, found-pos);
+          _facesWithLayers.push_back(atoi(id.c_str()));
+          pos = found + 1;
+        }
+      }
+      if (str3 == "imprintedFaces")
+      {
+        std::string id;
+        int pos = 0;
+        while ( pos < str4.length() )
+        {
+          int found = str4.find('#',pos);
+          id = str4.substr(pos, found-pos);
+          _imprintedFaces.push_back(atoi(id.c_str()));
+          pos = found + 1;
+        }
+      }
    }
    return load;
 }
@@ -429,4 +531,32 @@ HexoticPlugin_Hypothesis::THexoticSizeMaps HexoticPlugin_Hypothesis::GetDefaultH
   return THexoticSizeMaps();
 }
 
+int HexoticPlugin_Hypothesis::GetDefaultNbLayers()
+{
+  return 0;
+}
+
+double HexoticPlugin_Hypothesis::GetDefaultFirstLayerSize()
+{
+  return 0.0;
+}
+
+bool HexoticPlugin_Hypothesis::GetDefaultDirection()
+{
+  return true;
+}
+
+double HexoticPlugin_Hypothesis::GetDefaultGrowth()
+{
+  return 0.0;
+}
+
+std::vector<int> HexoticPlugin_Hypothesis::GetDefaultFacesWithLayers()
+{
+  return std::vector<int>();
+}
 
+std::vector<int> HexoticPlugin_Hypothesis::GetDefaultImprintedFaces()
+{
+  return std::vector<int>();
+}
index 6f66b74d444dcd1a9ff6eded328f0b010d08e603..788b8d7bf337f64a267ba5db1ce05fa699eb75ac 100644 (file)
@@ -31,6 +31,7 @@
 #include "Utils_SALOME_Exception.hxx"
 
 #include <map>
+#include <vector>
 
 // class HexoticSizeMap
 // {
@@ -100,6 +101,24 @@ public:
   bool AddSizeMap(std::string theEntry, double theSize);
   bool UnsetSizeMap(std::string theEntry);
 
+  void SetNbLayers(int theVal);
+  int GetNbLayers() const { return _nbLayers; }
+
+  void SetFirstLayerSize(double theVal);
+  double GetFirstLayerSize() const { return _firstLayerSize; }
+
+  void SetDirection(bool theVal);
+  bool GetDirection() const { return _direction; }
+
+  void SetGrowth(double theVal);
+  double GetGrowth() const { return _growth; }
+
+  bool SetFacesWithLayers(const std::vector<int>& theVal);
+  std::vector<int> GetFacesWithLayers() const { return _facesWithLayers; }
+
+  bool SetImprintedFaces(const std::vector<int>& theVal);
+  std::vector<int> GetImprintedFaces() const { return _imprintedFaces; }
+
   // the parameters default values 
   static int GetDefaultHexesMinLevel();
   static int GetDefaultHexesMaxLevel();
@@ -114,6 +133,12 @@ public:
   static int GetDefaultHexoticVerbosity();
   static int GetDefaultHexoticMaxMemory();
   static THexoticSizeMaps GetDefaultHexoticSizeMaps();
+  static int GetDefaultNbLayers();
+  static double GetDefaultFirstLayerSize();
+  static bool GetDefaultDirection();
+  static double GetDefaultGrowth();
+  static std::vector<int> GetDefaultFacesWithLayers();
+  static std::vector<int> GetDefaultImprintedFaces();
 
   // Persistence
   virtual std::ostream& SaveTo(std::ostream& save);
@@ -149,6 +174,12 @@ private:
   int    _hexoticMaxMemory;
   THexoticSizeMaps _sizeMaps;
   std::string _hexoticWorkingDirectory ;
+  int    _nbLayers;
+  double _firstLayerSize;
+  bool   _direction;
+  double _growth;
+  std::vector<int> _facesWithLayers;
+  std::vector<int> _imprintedFaces;
 };
 
 #endif
index 3c261b27f7033c7ac81f9e31c9b939e801f0f12c..ac0285fa3638339e91f83407838b5607db8e1910 100644 (file)
@@ -76,6 +76,12 @@ HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i()
  *  HexoticPlugin_Hypothesis_i::SetHexoticSdMode
  *  HexoticPlugin_Hypothesis_i::SetVerbosity
  *  HexoticPlugin_Hypothesis_i::SetHexoticMaxMemory
+ *  HexoticPlugin_Hypothesis_i::SetNbLayers
+ *  HexoticPlugin_Hypothesis_i::SetFirstLayerSize
+ *  HexoticPlugin_Hypothesis_i::SetDirection
+ *  HexoticPlugin_Hypothesis_i::SetGrowth
+ *  HexoticPlugin_Hypothesis_i::SetFacesWithLayers
+ *  HexoticPlugin_Hypothesis_i::SetImprintedFaces
  */
 //=============================================================================
 
@@ -266,6 +272,70 @@ void HexoticPlugin_Hypothesis_i::UnsetSizeMap (const GEOM::GEOM_Object_ptr theGe
   UnsetSizeMapEntry( entry.c_str());
 }
 
+void HexoticPlugin_Hypothesis_i::SetNbLayers(CORBA::Long theVal)
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetNbLayers");
+  ASSERT(myBaseImpl);
+  CORBA::Long oldValue = GetNbLayers();
+  this->GetImpl()->SetNbLayers(theVal);
+  if (theVal != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetNbLayers( " << theVal << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetFirstLayerSize(CORBA::Double theVal)
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetFirstLayerSize");
+  ASSERT(myBaseImpl);
+  CORBA::Double oldValue = GetFirstLayerSize();
+  this->GetImpl()->SetFirstLayerSize(theVal);
+  if (theVal != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetFirstLayerSize( " << theVal << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetDirection(CORBA::Boolean theVal)
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetDirection");
+  ASSERT(myBaseImpl);
+  CORBA::Boolean oldValue = GetDirection();
+  this->GetImpl()->SetDirection(theVal);
+  if (theVal != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetDirection( " << theVal << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetGrowth(CORBA::Double theVal)
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetGrowth");
+  ASSERT(myBaseImpl);
+  CORBA::Double oldValue = GetGrowth();
+  this->GetImpl()->SetGrowth(theVal);
+  if (theVal != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetGrowth( " << theVal << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetFacesWithLayers(const ::SMESH::long_array& theVal)
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetFacesWithLayers");
+  vector<int> ids( theVal.length() );
+  for ( unsigned i = 0; i < ids.size(); ++i )
+   ids[i] = theVal[i];
+
+  bool valueChanged = this->GetImpl()->SetFacesWithLayers(ids);
+  if (valueChanged)
+    SMESH::TPythonDump() << _this() << ".SetFacesWithLayers( "<< theVal << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetImprintedFaces(const ::SMESH::long_array& theVal)
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetImprintedFaces");
+  vector<int> ids( theVal.length() );
+  for ( unsigned i = 0; i < ids.size(); ++i )
+   ids[i] = theVal[i];
+
+  bool valueChanged = this->GetImpl()->SetImprintedFaces(ids);
+  if (valueChanged)
+    SMESH::TPythonDump() << _this() << ".SetImprintedFaces( "<< theVal << " )";
+}
+
 //=============================================================================
 /*!
  *  HexoticPlugin_Hypothesis_i::GetHexesMinLevel
@@ -280,6 +350,12 @@ void HexoticPlugin_Hypothesis_i::UnsetSizeMap (const GEOM::GEOM_Object_ptr theGe
  *  HexoticPlugin_Hypothesis_i::GetHexoticSdMode
  *  HexoticPlugin_Hypothesis_i::GetVerbosity
  *  HexoticPlugin_Hypothesis_i::GetHexoticMaxMemory
+ *  HexoticPlugin_Hypothesis_i::GetNbLayers
+ *  HexoticPlugin_Hypothesis_i::GetFirstLayerSize
+ *  HexoticPlugin_Hypothesis_i::GetDirection
+ *  HexoticPlugin_Hypothesis_i::GetGrowth
+ *  HexoticPlugin_Hypothesis_i::GetFacesWithLayers
+ *  HexoticPlugin_Hypothesis_i::GetImprintedFaces
  */
 //=============================================================================
 
@@ -366,6 +442,59 @@ CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticMaxMemory()
   return this->GetImpl()->GetHexoticMaxMemory();
 }
 
+CORBA::Long HexoticPlugin_Hypothesis_i::GetNbLayers()
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetNbLayers");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetNbLayers();
+}
+
+CORBA::Double HexoticPlugin_Hypothesis_i::GetFirstLayerSize()
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetFirstLayerSize");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetFirstLayerSize();
+}
+
+CORBA::Boolean HexoticPlugin_Hypothesis_i::GetDirection()
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetDirection");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetDirection();
+}
+
+CORBA::Double HexoticPlugin_Hypothesis_i::GetGrowth()
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetGrowth");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetGrowth();
+}
+
+SMESH::long_array* HexoticPlugin_Hypothesis_i::GetFacesWithLayers()
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetFacesWithLayers");
+  ASSERT(myBaseImpl);
+  std::vector<int> idsVec = this->GetImpl()->GetFacesWithLayers();
+  SMESH::long_array_var ids = new SMESH::long_array;
+  ids->length( idsVec.size() );
+  std::vector<int>::const_iterator anIt;
+  for ( unsigned i = 0; i < idsVec.size(); ++i )
+    ids[i] = idsVec[i];
+  return ids._retn();
+}
+
+SMESH::long_array* HexoticPlugin_Hypothesis_i::GetImprintedFaces()
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetImprintedFaces");
+  ASSERT(myBaseImpl);
+  std::vector<int> idsVec = this->GetImpl()->GetImprintedFaces();
+  SMESH::long_array_var ids = new SMESH::long_array;
+  ids->length( idsVec.size() );
+  std::vector<int>::const_iterator anIt;
+  for ( unsigned i = 0; i < idsVec.size(); ++i )
+    ids[i] = idsVec[i];
+  return ids._retn();
+}
 //=============================================================================
 /*!
  *  HexoticPlugin_Hypothesis_i::GetImpl
index 692a02dd55081750e607ed1416523c9b0eb51ba5..154d7775e38dcdcf54b78f5d1d428034accdf11c 100644 (file)
@@ -91,6 +91,24 @@ class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis_i:
   void UnsetSizeMap(GEOM::GEOM_Object_ptr theGeomObj);
   HexoticPlugin::HexoticPluginSizeMapsList* GetSizeMaps ();
 
+  void SetNbLayers(CORBA::Long theVal);
+  CORBA::Long GetNbLayers();
+
+  void SetFirstLayerSize(CORBA::Double theVal);
+  CORBA::Double GetFirstLayerSize();
+
+  void SetDirection(CORBA::Boolean theVal);
+  CORBA::Boolean GetDirection();
+
+  void SetGrowth(CORBA::Double theVal);
+  CORBA::Double GetGrowth();
+
+  void SetFacesWithLayers(const SMESH::long_array& theVal);
+  SMESH::long_array* GetFacesWithLayers();
+
+  void SetImprintedFaces(const SMESH::long_array& theVal);
+  SMESH::long_array* GetImprintedFaces();
+
   // Get implementation
   ::HexoticPlugin_Hypothesis* GetImpl();