]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
\ No newline at end of file0020832: EDF 1359 SMESH : Automatic meshing of boundary...
authoreap <eap@opencascade.com>
Tue, 18 Jan 2011 12:20:52 +0000 (12:20 +0000)
committereap <eap@opencascade.com>
Tue, 18 Jan 2011 12:20:52 +0000 (12:20 +0000)
     work with StdMeshers_ViscousLayers

src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
src/StdMeshersGUI/StdMeshers_images.ts
src/StdMeshersGUI/StdMeshers_msg_en.ts

index 9595e67a0084357e32d576c2984d5bbd1caed484..383d3d5dc8f50bdd8848ca44773eed34ee185271 100644 (file)
@@ -666,6 +666,25 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
       QCheckBox* toCopyGroups = widget< QCheckBox >( 2 );
       h->SetCopySourceMesh( toCopyMesh->isChecked(), toCopyGroups->isChecked());
     }
+    else if( hypType()=="ViscousLayers" )
+    {
+      StdMeshers::StdMeshers_ViscousLayers_var h =
+        StdMeshers::StdMeshers_ViscousLayers::_narrow( hypothesis() );
+
+      h->SetTotalThickness( params[0].myValue.toDouble() );
+      /*  */ h->SetParameters(aVariablesList.join(":").toLatin1().constData());
+      h->SetNumberLayers  ( params[1].myValue.toInt() );
+      /*  */ h->SetParameters(aVariablesList.join(":").toLatin1().constData());
+      h->SetStretchFactor ( params[2].myValue.toDouble() );
+      /*  */ h->SetParameters(aVariablesList.join(":").toLatin1().constData());
+      
+      if ( StdMeshersGUI_SubShapeSelectorWdg* idsWg = 
+           widget< StdMeshersGUI_SubShapeSelectorWdg >( 3 ))
+      {
+        h->SetIgnoreFaces( idsWg->GetListOfIDs() );
+        //h->SetObjectEntry( idsWg->GetMainShapeEntry() );
+      }
+    }
     else if( hypType()=="QuadrangleParams" )
     {
       StdMeshers::StdMeshers_QuadrangleParams_var h =
@@ -1099,6 +1118,45 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
     aQCheckBox->setEnabled( toCopyMesh );
     customWidgets()->append( aQCheckBox );
   }
+  else if( hypType()=="ViscousLayers" )
+  {
+    StdMeshers::StdMeshers_ViscousLayers_var h =
+      StdMeshers::StdMeshers_ViscousLayers::_narrow( hyp );
+
+    item.myName = tr( "SMESH_TOTAL_THICKNESS" );
+    if(!initVariableName(aParameters,item,0))
+      item.myValue = h->GetTotalThickness();
+    p.append( item );
+    customWidgets()->append (0);
+
+    item.myName = tr( "SMESH_NUMBER_OF_LAYERS" );
+    if(!initVariableName(aParameters,item,1))
+      item.myValue = h->GetNumberLayers();
+    p.append( item );
+    customWidgets()->append (0);
+
+    item.myName = tr( "SMESH_STRETCH_FACTOR" );
+    if(!initVariableName(aParameters,item,2))
+      item.myValue = h->GetStretchFactor();
+    p.append( item );
+    customWidgets()->append (0);
+
+    QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+    if ( !aMainEntry.isEmpty() )
+    {
+      item.myName = tr( "SMESH_FACES_WO_LAYERS" );
+      p.append( item );
+
+      StdMeshersGUI_SubShapeSelectorWdg* idsWg =
+        new StdMeshersGUI_SubShapeSelectorWdg(0,TopAbs_FACE);
+
+      idsWg->SetGeomShapeEntry( aMainEntry );
+      idsWg->SetMainShapeEntry( aMainEntry );
+      idsWg->SetListOfIDs( h->GetIgnoreFaces() );
+      idsWg->showPreview( true );
+      customWidgets()->append ( idsWg );
+    }
+  }
   else if (hypType() == "QuadrangleParams")
   {
     StdMeshers::StdMeshers_QuadrangleParams_var h =
@@ -1108,9 +1166,8 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
     p.append(item);
 
     StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
-      new StdMeshersGUI_SubShapeSelectorWdg();
+      new StdMeshersGUI_SubShapeSelectorWdg(0, TopAbs_VERTEX);
     aDirectionWidget->SetMaxSize(1);
-    aDirectionWidget->SetSubShType(TopAbs_VERTEX);
     QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
     QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
     if (anEntry == "")
@@ -1148,50 +1205,66 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
 //================================================================================
 /*!
  * \brief tune "standard" control
 * \param w - control widget
 * \param int - parameter index
 \param w - control widget
 \param int - parameter index
  */
 //================================================================================
 
 void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget (QWidget* w, const int) const
 {
   SMESHGUI_SpinBox* sb = w->inherits( "SMESHGUI_SpinBox" ) ? ( SMESHGUI_SpinBox* )w : 0;
-  if( hypType()=="LocalLength" &&  sb )
+  if ( sb )
   {
-    if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PARAM"))
+    if( hypType()=="LocalLength" )
+    {
+      if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PARAM"))
+        sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
+      else if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PRECISION"))
+        sb->RangeStepAndValidator( 0.0, 1.0, 0.05, "len_tol_precision" );
+    }
+    else if( hypType()=="Arithmetic1D" )
+    {
+      sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
+    }
+    else if( hypType()=="MaxLength" )
+    {
       sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
-    else if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PRECISION"))
-      sb->RangeStepAndValidator( 0.0, 1.0, 0.05, "len_tol_precision" );
-  }
-  else if( hypType()=="Arithmetic1D" && sb )
-  {
-    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
-  }
-  else if( hypType()=="MaxLength" && sb )
-  {
-    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
-    sb->setEnabled( !widget< QCheckBox >( 1 )->isChecked() );
-  }
-  else if( hypType()=="MaxElementArea" && sb )
-  {
-    sb->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 1.0, "area_precision" );
-  }
-  else if( hypType()=="MaxElementVolume" && sb )
-  {
-    sb->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 1.0, "vol_precision" );
-  }
-  else if( hypType()=="StartEndLength" && sb )
-  {
-    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
-  }
-  else if( hypType()=="Deflection1D" && sb )
-  {
-    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
-  }
-  else if ( sb ) // default validator for possible ancestors
-  {
-    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
+      sb->setEnabled( !widget< QCheckBox >( 1 )->isChecked() );
+    }
+    else if( hypType()=="MaxElementArea" )
+    {
+      sb->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 1.0, "area_precision" );
+    }
+    else if( hypType()=="MaxElementVolume" )
+    {
+      sb->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 1.0, "vol_precision" );
+    }
+    else if( hypType()=="StartEndLength" )
+    {
+      sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
+    }
+    else if( hypType()=="Deflection1D" )
+    {
+      sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
+    }
+    else if( hypType()=="ViscousLayers" )
+    {
+      if (sb->objectName() == tr("SMESH_STRETCH_FACTOR"))
+        sb->RangeStepAndValidator( 1.0, VALUE_MAX, 0.1, "parametric_precision" );
+      else
+        sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
+    }
+    else // default validator for possible ancestors
+    {
+      sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
+    }
   }
+//   else if ( QtxIntSpinBox* ib = w->inherits( "QtxIntSpinBox" ) ? ( QtxIntSpinBox* )w : 0)
+//   {
+//     if( hypType()=="ViscousLayers" )
+//     {
+//     }
+//   }
 }
 
 //================================================================================
@@ -1265,6 +1338,7 @@ QString StdMeshersGUI_StdHypothesisCreator::hypTypeName( const QString& t ) cons
     types.insert( "LayerDistribution2D", "LAYER_DISTRIBUTION" );
     types.insert( "SegmentLengthAroundVertex", "SEGMENT_LENGTH_AROUND_VERTEX" );
     types.insert( "MaxLength", "MAX_LENGTH" );
+    types.insert( "ViscousLayers", "VISCOUS_LAYERS" );
     types.insert( "QuadrangleParams", "QUADRANGLE_PARAMS" );
   }
 
index 87444b56a3b3c47e78b41eecf108d8862c08dff8..a895ca62eb3955ebd938cf6292890460ead3cc59 100644 (file)
             <source>ICON_DLG_MAX_LENGTH</source>
             <translation>mesh_hypo_length.png</translation>
         </message>
+        <message>
+            <source>ICON_DLG_VISCOUS_LAYERS</source>
+            <translation>mesh_hypo_viscous_layers.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_MAX_ELEMENT_AREA</source>
             <translation>mesh_hypo_area.png</translation>
             <source>ICON_SMESH_TREE_HYPO_NumberOfSegments</source>
             <translation>mesh_tree_hypo_segment.png</translation>
         </message>
+        <message>
+            <source>ICON_SMESH_TREE_HYPO_ViscousLayers</source>
+            <translation>mesh_tree_hypo_viscous_layers.png</translation>
+        </message>
         <message>
             <source>ICON_SMESH_TREE_HYPO_ProjectionSource1D</source>
             <translation>mesh_tree_hypo_source_edge.png</translation>
index 75888dfa36a0efa6ee3021ecad9a1b3881b24900..584ecc01c941434ed4cadd5060ca248f7bf92aa4 100644 (file)
         <source>SMESH_USE_PREESTIMATED_LENGTH</source>
         <translation>Use preestimated length</translation>
     </message>
+    <message>
+        <source>SMESH_VISCOUS_LAYERS_HYPOTHESIS</source>
+        <translation>Viscous Layers</translation>
+    </message>
+    <message>
+        <source>SMESH_VISCOUS_LAYERS_TITLE</source>
+        <translation>Hypothesis Construction</translation>
+    </message>
+    <message>
+        <source>SMESH_TOTAL_THICKNESS</source>
+        <translation>Total thickness</translation>
+    </message>
+    <message>
+        <source>SMESH_STRETCH_FACTOR</source>
+        <translation>Stretch factor</translation>
+    </message>
+    <message>
+        <source>SMESH_FACES_WO_LAYERS</source>
+        <translation>Faces without layers</translation>
+    </message>
     <message>
         <source>SMESH_MAX_LENGTH_TITLE</source>
         <translation>Hypothesis Construction</translation>
     </message>
     <message>
         <source>SMESH_NUMBER_OF_LAYERS</source>
-        <translation>Number of Layers</translation>
+        <translation>Number of layers</translation>
     </message>
     <message>
         <source>SMESH_NUMBER_OF_LAYERS_HYPOTHESIS</source>