+ StdMeshers::StdMeshers_ImportSource2D_var h =
+ StdMeshers::StdMeshers_ImportSource2D::_narrow( hyp );
+
+ SMESH::string_array_var groupEntries = h->GetSourceFaces();
+ CORBA::Boolean toCopyMesh, toCopyGroups;
+ h->GetCopySourceMesh(toCopyMesh, toCopyGroups);
+
+ item.myName = tr( "SMESH_SOURCE_FACES" ); p.append( item );
+ customWidgets()->append( newObjRefParamWdg( new SMESH_TypeFilter( SMESH::GROUP_FACE ),
+ groupEntries));
+
+ item.myName = tr( "SMESH_COPY_MESH" ); p.append( item );
+ QCheckBox* aQCheckBox = new QCheckBox(dlg());
+ aQCheckBox->setChecked( toCopyMesh );
+ connect( aQCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( onValueChanged() ));
+ customWidgets()->append( aQCheckBox );
+
+ item.myName = tr( "SMESH_COPY_GROUPS" ); p.append( item );
+ aQCheckBox = new QCheckBox(dlg());
+ aQCheckBox->setChecked( toCopyGroups );
+ 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( hyp, item, "SetTotalThickness" ))
+ item.myValue = h->GetTotalThickness();
+ p.append( item );
+ customWidgets()->append (0);
+
+ item.myName = tr( "SMESH_NUMBER_OF_LAYERS" );
+ if(!initVariableName( hyp, item, "SetNumberLayers" ))
+ item.myValue = h->GetNumberLayers();
+ p.append( item );
+ customWidgets()->append (0);
+
+ item.myName = tr( "SMESH_STRETCH_FACTOR" );
+ if(!initVariableName( hyp, item, "SetStretchFactor" ))
+ 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()=="ViscousLayers2D" )
+ {
+ StdMeshers::StdMeshers_ViscousLayers2D_var h =
+ StdMeshers::StdMeshers_ViscousLayers2D::_narrow( hyp );
+
+ item.myName = tr( "SMESH_TOTAL_THICKNESS" );
+ if(!initVariableName( hyp, item, "SetTotalThickness" ))
+ item.myValue = h->GetTotalThickness();
+ p.append( item );
+ customWidgets()->append (0);
+
+ item.myName = tr( "SMESH_NUMBER_OF_LAYERS" );
+ if(!initVariableName( hyp, item, "SetNumberLayers" ))
+ item.myValue = h->GetNumberLayers();
+ p.append( item );
+ customWidgets()->append (0);
+
+ item.myName = tr( "SMESH_STRETCH_FACTOR" );
+ if(!initVariableName( hyp, item, "SetStretchFactor" ))
+ item.myValue = h->GetStretchFactor();
+ p.append( item );
+ customWidgets()->append (0);
+
+ QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+ if ( !aMainEntry.isEmpty() )
+ {
+ item.myName = tr( "SMESH_EDGES_WO_LAYERS" );
+ p.append( item );
+
+ StdMeshersGUI_SubShapeSelectorWdg* idsWg =
+ new StdMeshersGUI_SubShapeSelectorWdg(0,TopAbs_EDGE);
+
+ idsWg->SetGeomShapeEntry( aMainEntry );
+ idsWg->SetMainShapeEntry( aMainEntry );
+ idsWg->SetListOfIDs( h->GetIgnoreEdges() );
+ idsWg->showPreview( true );
+ customWidgets()->append ( idsWg );
+ }
+ }
+ else if (hypType() == "QuadrangleParams")
+ {
+ StdMeshers::StdMeshers_QuadrangleParams_var h =
+ StdMeshers::StdMeshers_QuadrangleParams::_narrow(hyp);
+
+ item.myName = tr("SMESH_BASE_VERTEX");
+ p.append(item);
+
+ StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
+ new StdMeshersGUI_SubShapeSelectorWdg(0, TopAbs_VERTEX);
+ aDirectionWidget->SetMaxSize(1);
+ QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+ QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+ if (anEntry == "")
+ anEntry = h->GetObjectEntry();
+ aDirectionWidget->SetGeomShapeEntry(anEntry);
+ aDirectionWidget->SetMainShapeEntry(aMainEntry);
+ if (!isCreation()) {
+ SMESH::long_array_var aVec = new SMESH::long_array;
+ int vertID = h->GetTriaVertex();
+ if (vertID > 0) {
+ aVec->length(1);
+ aVec[0] = vertID;
+ aDirectionWidget->SetListOfIDs(aVec);
+ }
+ }
+ aDirectionWidget->showPreview(true);
+
+ item.myName = tr("SMESH_QUAD_TYPE");
+ p.append(item);
+
+ StdMeshersGUI_QuadrangleParamWdg* aTypeWidget =
+ new StdMeshersGUI_QuadrangleParamWdg();
+ if (!isCreation()) {
+ aTypeWidget->SetType(int(h->GetQuadType()));
+ }
+
+ customWidgets()->append(aDirectionWidget);
+ customWidgets()->append(aTypeWidget);
+ }
+ else
+ res = false;
+ return res;
+}
+
+//================================================================================
+/*!
+ * \brief tune "standard" control
+ * \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 ( sb )
+ {
+ 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" );
+ 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().startsWith( "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" );
+ }