1 // Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : StdMeshersGUI_StdHypothesisCreator.cxx
23 // Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
26 #include "StdMeshersGUI_StdHypothesisCreator.h"
29 #include <SMESHGUI_SpinBox.h>
30 #include <SMESHGUI_HypothesesUtils.h>
31 #include <SMESHGUI_Utils.h>
32 #include <SMESHGUI_GEOMGenUtils.h>
33 #include <SMESH_TypeFilter.hxx>
34 #include <SMESH_NumberFilter.hxx>
36 #include "StdMeshersGUI_FixedPointsParamWdg.h"
37 #include "StdMeshersGUI_LayerDistributionParamWdg.h"
38 #include "StdMeshersGUI_ObjectReferenceParamWdg.h"
39 #include "StdMeshersGUI_PropagationHelperWdg.h"
40 #include "StdMeshersGUI_QuadrangleParamWdg.h"
41 #include "StdMeshersGUI_RadioButtonsGrpWdg.h"
42 #include "StdMeshersGUI_NameCheckableGrpWdg.h"
43 #include "StdMeshersGUI_SubShapeSelectorWdg.h"
45 #include <SALOMEDSClient_Study.hxx>
47 #include <GEOM_wrap.hxx>
49 // SALOME GUI includes
50 #include <SUIT_MessageBox.h>
51 #include <SUIT_ResourceMgr.h>
52 #include <SalomeApp_IntSpinBox.h>
55 #include <SALOMEconfig.h>
56 #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
57 #include CORBA_SERVER_HEADER(SMESH_Mesh)
58 #include CORBA_SERVER_HEADER(SMESH_Group)
61 #include <QHBoxLayout>
65 #include <QButtonGroup>
67 const double VALUE_MAX = 1.0e+15, // COORD_MAX
68 VALUE_MAX_2 = VALUE_MAX * VALUE_MAX,
69 VALUE_MAX_3 = VALUE_MAX_2 * VALUE_MAX,
70 VALUE_SMALL = 1.0e-15,
71 VALUE_SMALL_2 = VALUE_SMALL * VALUE_SMALL,
72 VALUE_SMALL_3 = VALUE_SMALL_2 * VALUE_SMALL;
74 //================================================================================
77 * \param type - hypothesis type
79 //================================================================================
81 StdMeshersGUI_StdHypothesisCreator::StdMeshersGUI_StdHypothesisCreator( const QString& type )
82 : SMESHGUI_GenericHypothesisCreator( type ), myHelperWidget( 0 )
86 //================================================================================
90 //================================================================================
92 StdMeshersGUI_StdHypothesisCreator::~StdMeshersGUI_StdHypothesisCreator()
96 //================================================================================
98 * \brief Return widget for i-th hypothesis parameter (got from myParamWidgets)
99 * \param i - index of hypothesis parameter
100 * \retval QWidget* - found widget
102 //================================================================================
104 QWidget* StdMeshersGUI_StdHypothesisCreator::getWidgetForParam( int i ) const
107 if ( isCreation() ) ++i; // skip widget of 'name' parameter
109 if ( i < myCustomWidgets.count() ) {
110 QList<QWidget*>::const_iterator anIt = myCustomWidgets.begin();
111 QList<QWidget*>::const_iterator aLast = myCustomWidgets.end();
112 for ( int j = 0 ; !w && anIt != aLast; ++anIt, ++j )
117 // list has no at() const, so we iterate
118 QList<QWidget*>::const_iterator anIt = widgets().begin();
119 QList<QWidget*>::const_iterator aLast = widgets().end();
120 for( int j = 0; !w && anIt!=aLast; anIt++, ++j ) {
128 //================================================================================
130 * \brief Allow modifying myCustomWidgets in const methods
131 * \retval ListOfWidgets* - non-const pointer to myCustomWidgets
133 //================================================================================
135 StdMeshersGUI_StdHypothesisCreator::ListOfWidgets*
136 StdMeshersGUI_StdHypothesisCreator::customWidgets() const
138 return const_cast< ListOfWidgets* >( & myCustomWidgets );
141 //================================================================================
143 * \brief Builds dlg layout
144 * \retval QFrame* - the built widget
146 //================================================================================
148 QFrame* StdMeshersGUI_StdHypothesisCreator::buildFrame()
150 return buildStdFrame();
153 //================================================================================
155 * \brief Initialise parameter values in controls
157 //================================================================================
159 void StdMeshersGUI_StdHypothesisCreator::retrieveParams() const
161 // buildStdFrame() sets values itself calling stdParams()
163 if ( hypType().startsWith("ProjectionSource" ))
165 // we use this method to connect depending custom widgets
166 StdMeshersGUI_ObjectReferenceParamWdg* widgetToActivate = 0;
167 ListOfWidgets::const_iterator anIt = myCustomWidgets.begin();
168 for ( ; anIt != myCustomWidgets.end(); anIt++)
170 if ( *anIt && (*anIt)->inherits("StdMeshersGUI_ObjectReferenceParamWdg"))
172 StdMeshersGUI_ObjectReferenceParamWdg * w1 =
173 ( StdMeshersGUI_ObjectReferenceParamWdg* ) ( *anIt );
174 ListOfWidgets::const_iterator anIt2 = anIt;
175 for ( ++anIt2; anIt2 != myCustomWidgets.end(); anIt2++)
176 if ( *anIt2 && (*anIt2)->inherits("StdMeshersGUI_ObjectReferenceParamWdg"))
178 StdMeshersGUI_ObjectReferenceParamWdg * w2 =
179 ( StdMeshersGUI_ObjectReferenceParamWdg* ) ( *anIt2 );
180 w1->AvoidSimultaneousSelection( w2 );
182 if ( !widgetToActivate )
183 widgetToActivate = w1;
186 if ( widgetToActivate )
187 widgetToActivate->activateSelection();
191 dlg()->setMinimumSize( dlg()->minimumSizeHint().width(), dlg()->minimumSizeHint().height() );
196 //================================================================================
198 * \brief Widget: slider with left and right labels
200 //================================================================================
202 class TDoubleSliderWith2Labels: public QWidget
205 TDoubleSliderWith2Labels( const QString& leftLabel, const QString& rightLabel,
206 const double initValue, const double bottom,
207 const double top , const double precision,
208 QWidget * parent=0 , const char * name=0 )
209 :QWidget(parent), _bottom(bottom), _precision(precision)
213 QHBoxLayout* aHBoxL = new QHBoxLayout(this);
215 if ( !leftLabel.isEmpty() ) {
216 QLabel* aLeftLabel = new QLabel( this );
217 aLeftLabel->setText( leftLabel );
218 aHBoxL->addWidget( aLeftLabel );
221 _slider = new QSlider( Qt::Horizontal, this );
222 _slider->setRange( 0, toInt( top ));
223 _slider->setValue( toInt( initValue ));
224 aHBoxL->addWidget( _slider );
226 if ( !rightLabel.isEmpty() ) {
227 QLabel* aRightLabel = new QLabel( this );
228 aRightLabel->setText( rightLabel );
229 aHBoxL->addWidget( aRightLabel );
234 double value() const { return _bottom + _slider->value() * _precision; }
235 QSlider * getSlider() const { return _slider; }
236 int toInt( double val ) const { return (int) ceil(( val - _bottom ) / _precision ); }
238 double _bottom, _precision;
242 //================================================================================
244 * \brief Retrieve GEOM_Object held by widget
246 //================================================================================
248 inline GEOM::GEOM_Object_var geomFromWdg(const QWidget* wdg)
250 const StdMeshersGUI_ObjectReferenceParamWdg * objRefWdg =
251 dynamic_cast<const StdMeshersGUI_ObjectReferenceParamWdg*>( wdg );
253 return objRefWdg->GetObject< GEOM::GEOM_Object >();
255 return GEOM::GEOM_Object::_nil();
257 //================================================================================
259 * \brief Retrieve SMESH_Mesh held by widget
261 //================================================================================
263 inline SMESH::SMESH_Mesh_var meshFromWdg(const QWidget* wdg)
265 const StdMeshersGUI_ObjectReferenceParamWdg * objRefWdg =
266 dynamic_cast<const StdMeshersGUI_ObjectReferenceParamWdg*>( wdg );
268 return objRefWdg->GetObject< SMESH::SMESH_Mesh >();
270 return SMESH::SMESH_Mesh::_nil();
272 //================================================================================
274 * \brief Retrieve SMESH_Mesh held by widget
276 //================================================================================
278 inline SMESH::ListOfGroups_var groupsFromWdg(const QWidget* wdg)
280 SMESH::ListOfGroups_var groups = new SMESH::ListOfGroups;
281 const StdMeshersGUI_ObjectReferenceParamWdg * objRefWdg =
282 dynamic_cast<const StdMeshersGUI_ObjectReferenceParamWdg*>( wdg );
285 groups->length( objRefWdg->NbObjects() );
286 for ( unsigned i = 0; i < groups->length(); ++i )
287 groups[i] = objRefWdg->GetObject< SMESH::SMESH_GroupBase >(i);
291 //================================================================================
293 * \brief creates a filter for selection of shapes of given dimension
294 * \param dim - dimension
295 * \param subShapeType - required type of sub-shapes, number of which must be \a nbSubShapes
296 * \param nbSubShapes - number of sub-shapes of given type
297 * \param closed - required closeness flag of a shape
298 * \retval SUIT_SelectionFilter* - created filter
300 //================================================================================
302 SUIT_SelectionFilter* filterForShapeOfDim(const int dim,
303 TopAbs_ShapeEnum subShapeType = TopAbs_SHAPE,
304 const int nbSubShapes = 0,
307 TColStd_MapOfInteger shapeTypes;
309 case 0: shapeTypes.Add( TopAbs_VERTEX ); break;
311 if ( subShapeType == TopAbs_SHAPE ) subShapeType = TopAbs_EDGE;
312 shapeTypes.Add( TopAbs_EDGE );
313 shapeTypes.Add( TopAbs_COMPOUND ); // for a group
316 if ( subShapeType == TopAbs_SHAPE ) subShapeType = TopAbs_FACE;
317 shapeTypes.Add( TopAbs_FACE );
318 shapeTypes.Add( TopAbs_COMPOUND ); // for a group
321 shapeTypes.Add( TopAbs_SHELL );
322 shapeTypes.Add( TopAbs_SOLID );
323 shapeTypes.Add( TopAbs_COMPSOLID );
324 shapeTypes.Add( TopAbs_COMPOUND );
327 return new SMESH_NumberFilter("GEOM", subShapeType, nbSubShapes,
328 shapeTypes, GEOM::GEOM_Object::_nil(), closed);
331 //================================================================================
333 * \brief Create a widget for object selection
334 * \param object - initial object
335 * \param filter - selection filter
336 * \retval QWidget* - created widget
338 //================================================================================
340 QWidget* newObjRefParamWdg( SUIT_SelectionFilter* filter,
341 CORBA::Object_var object)
343 StdMeshersGUI_ObjectReferenceParamWdg* w =
344 new StdMeshersGUI_ObjectReferenceParamWdg( filter, 0);
345 w->SetObject( object.in() );
348 QWidget* newObjRefParamWdg( SUIT_SelectionFilter* filter,
349 SMESH::string_array_var& objEntries)
351 StdMeshersGUI_ObjectReferenceParamWdg* w =
352 new StdMeshersGUI_ObjectReferenceParamWdg( filter, 0, /*multiSel=*/true);
353 //RNV: Firstly, activate selection, then set objects
354 w->activateSelection();
355 w->SetObjects( objEntries );
359 //================================================================================
361 * \brief calls deactivateSelection() for StdMeshersGUI_ObjectReferenceParamWdg
362 * \param widgetList - list of widgets
364 //================================================================================
366 void deactivateObjRefParamWdg( QList<QWidget*>* widgetList )
368 StdMeshersGUI_ObjectReferenceParamWdg* w = 0;
369 QList<QWidget*>::iterator anIt = widgetList->begin();
370 QList<QWidget*>::iterator aLast = widgetList->end();
371 for ( ; anIt != aLast; anIt++ ) {
372 if ( (*anIt) && (*anIt)->inherits( "StdMeshersGUI_ObjectReferenceParamWdg" ))
374 w = (StdMeshersGUI_ObjectReferenceParamWdg* )( *anIt );
375 w->deactivateSelection();
381 //================================================================================
383 * \brief Remove a group, whose name is stored by hypothesis, upon group name modification
384 * \param [in] oldName - old group name
385 * \param [in] newName - new group name
386 * \param [in] type - group type
388 //================================================================================
390 void StdMeshersGUI_StdHypothesisCreator::
391 removeOldGroup(const char* oldName, const char* newName, SMESH::ElementType type) const
393 if ( !oldName || !oldName[0] )
394 return; // old name undefined
395 if ( newName && strcmp( oldName, newName ) == 0 )
398 SMESH::SMESH_Hypothesis_var h = hypothesis();
399 SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( h );
400 for ( size_t i = 0; i < listSOmesh.size(); i++ )
402 _PTR(SObject) submSO = listSOmesh[i];
403 SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
404 SMESH::SMESH_subMesh_var subMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
405 if( !subMesh->_is_nil() )
406 mesh = subMesh->GetFather();
407 if ( mesh->_is_nil() )
409 SMESH::ListOfGroups_var groups = mesh->GetGroups();
410 for ( CORBA::ULong iG = 0; iG < groups->length(); iG++ )
412 if ( groups[iG]->GetType() != type )
414 CORBA::String_var name = groups[iG]->GetName();
415 if ( strcmp( name.in(), oldName ))
417 mesh->RemoveGroup( groups[iG] );
422 //================================================================================
424 * \brief Check parameter values before accept()
425 * \retval bool - true if OK
427 //================================================================================
429 bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const
431 if( !SMESHGUI_GenericHypothesisCreator::checkParams( msg ) )
434 // check if object reference parameter is set, as it has no default value
436 if ( hypType().startsWith("ProjectionSource" ))
438 StdMeshersGUI_ObjectReferenceParamWdg* w =
439 widget< StdMeshersGUI_ObjectReferenceParamWdg >( 0 );
440 ok = ( w->IsObjectSelected() );
441 if ( !ok ) w->SetObject( CORBA::Object::_nil() );
442 int nbAssocVert = ( hypType() == "ProjectionSource1D" ? 1 : 2 );
443 int nbNonEmptyAssoc = 0;
444 for ( int i = 0; ok && i < nbAssocVert*2; i += 2)
447 StdMeshersGUI_ObjectReferenceParamWdg* w1 =
448 widget< StdMeshersGUI_ObjectReferenceParamWdg >( i+2 );
449 StdMeshersGUI_ObjectReferenceParamWdg* w2 =
450 widget< StdMeshersGUI_ObjectReferenceParamWdg >( i+3 );
451 srcV = w1->GetValue();
452 tgtV = w2->GetValue();
453 ok = (( srcV.isEmpty() && tgtV.isEmpty() ) ||
454 ( !srcV.isEmpty() && !tgtV.isEmpty() /*&& srcV != tgtV*/ ));
456 w1->SetObject( CORBA::Object::_nil() );
457 w2->SetObject( CORBA::Object::_nil() );
459 nbNonEmptyAssoc += !srcV.isEmpty();
461 if ( ok && nbNonEmptyAssoc == 1 && nbAssocVert == 2 )
463 // only one pair of VERTEXes is given for a FACE,
464 // then the FACE must have only one VERTEX
465 GEOM::GEOM_Object_var face = w->GetObject< GEOM::GEOM_Object >();
467 GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen( face );
468 _PTR(Study) aStudy = SMESH::getStudy();
469 GEOM::GEOM_IShapesOperations_wrap shapeOp;
470 if ( !geomGen->_is_nil() && aStudy )
471 shapeOp = geomGen->GetIShapesOperations();
472 if ( !shapeOp->_is_nil() )
474 GEOM::ListOfLong_var vertices =
475 shapeOp->GetAllSubShapesIDs (face, GEOM::VERTEX, /*isSorted=*/false);
476 ok = ( vertices->length() == 1 );
479 // Uninstall filters of StdMeshersGUI_ObjectReferenceParamWdg
481 deactivateObjRefParamWdg( customWidgets() );
483 else if ( hypType().startsWith("ImportSource" ))
485 StdMeshersGUI_ObjectReferenceParamWdg* w =
486 widget< StdMeshersGUI_ObjectReferenceParamWdg >( 0 );
487 ok = ( w->IsObjectSelected() );
489 else if ( hypType() == "LayerDistribution" || hypType() == "LayerDistribution2D" )
491 StdMeshersGUI_LayerDistributionParamWdg* w =
492 widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
493 ok = ( w && w->IsOk() );
499 //================================================================================
501 * \brief Store params from GUI controls to a hypothesis
502 * \retval QString - text representation of parameters
504 //================================================================================
506 QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
508 ListOfStdParams params;
509 bool res = getStdParamFromDlg( params );
512 SMESH::SetName( SMESH::FindSObject( hypothesis() ), params[0].myValue.toString().toUtf8().data() );
513 params.erase( params.begin() );
516 QString valueStr = stdParamValues( params );
517 //QStringList aVariablesList = getVariablesFromDlg();
519 if( res && !params.isEmpty() )
521 if( hypType()=="LocalLength" )
523 StdMeshers::StdMeshers_LocalLength_var h =
524 StdMeshers::StdMeshers_LocalLength::_narrow( hypothesis() );
526 h->SetVarParameter( params[0].text(), "SetLength" );
527 h->SetLength( params[0].myValue.toDouble() );
528 h->SetVarParameter( params[1].text(), "SetPrecision" );
529 h->SetPrecision( params[1].myValue.toDouble() );
531 else if( hypType()=="MaxLength" )
533 StdMeshers::StdMeshers_MaxLength_var h =
534 StdMeshers::StdMeshers_MaxLength::_narrow( hypothesis() );
536 h->SetVarParameter( params[0].text(), "SetLength" );
537 h->SetLength( params[0].myValue.toDouble() );
538 h->SetUsePreestimatedLength( widget< QCheckBox >( 1 )->isChecked() );
539 if ( !h->HavePreestimatedLength() && !h->_is_equivalent( initParamsHypothesis() )) {
540 StdMeshers::StdMeshers_MaxLength_var hInit =
541 StdMeshers::StdMeshers_MaxLength::_narrow( initParamsHypothesis() );
542 h->SetPreestimatedLength( hInit->GetPreestimatedLength() );
545 else if( hypType()=="SegmentLengthAroundVertex" )
547 StdMeshers::StdMeshers_SegmentLengthAroundVertex_var h =
548 StdMeshers::StdMeshers_SegmentLengthAroundVertex::_narrow( hypothesis() );
550 h->SetVarParameter( params[0].text(), "SetLength" );
551 h->SetLength( params[0].myValue.toDouble() );
553 else if( hypType()=="Arithmetic1D" )
555 StdMeshers::StdMeshers_Arithmetic1D_var h =
556 StdMeshers::StdMeshers_Arithmetic1D::_narrow( hypothesis() );
558 StdMeshersGUI_SubShapeSelectorWdg* w =
559 widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 );
561 h->SetVarParameter( params[0].text(), "SetStartLength" );
562 h->SetStartLength( params[0].myValue.toDouble() );
563 h->SetVarParameter( params[1].text(), "SetEndLength" );
564 h->SetEndLength( params[1].myValue.toDouble() );
566 h->SetReversedEdges( w->GetListOfIDs() );
567 h->SetObjectEntry( w->GetMainShapeEntry() );
570 else if( hypType()=="GeometricProgression" )
572 StdMeshers::StdMeshers_Geometric1D_var h =
573 StdMeshers::StdMeshers_Geometric1D::_narrow( hypothesis() );
575 StdMeshersGUI_SubShapeSelectorWdg* w =
576 widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 );
578 h->SetVarParameter( params[0].text(), "SetStartLength" );
579 h->SetStartLength( params[0].myValue.toDouble() );
580 h->SetVarParameter( params[1].text(), "SetCommonRatio" );
581 h->SetCommonRatio( params[1].myValue.toDouble() );
583 h->SetReversedEdges( w->GetListOfIDs() );
584 h->SetObjectEntry( w->GetMainShapeEntry() );
587 else if( hypType()=="FixedPoints1D" )
589 StdMeshers::StdMeshers_FixedPoints1D_var h =
590 StdMeshers::StdMeshers_FixedPoints1D::_narrow( hypothesis() );
592 StdMeshersGUI_FixedPointsParamWdg* w1 =
593 widget< StdMeshersGUI_FixedPointsParamWdg >( 0 );
595 StdMeshersGUI_SubShapeSelectorWdg* w2 =
596 widget< StdMeshersGUI_SubShapeSelectorWdg >( 1 );
599 h->SetPoints( w1->GetListOfPoints() );
600 h->SetNbSegments( w1->GetListOfSegments() );
603 h->SetReversedEdges( w2->GetListOfIDs() );
604 h->SetObjectEntry( w2->GetMainShapeEntry() );
607 else if( hypType()=="MaxElementArea" )
609 StdMeshers::StdMeshers_MaxElementArea_var h =
610 StdMeshers::StdMeshers_MaxElementArea::_narrow( hypothesis() );
611 h->SetVarParameter( params[0].text(), "SetMaxElementArea" );
612 h->SetMaxElementArea( params[0].myValue.toDouble() );
614 else if( hypType()=="MaxElementVolume" )
616 StdMeshers::StdMeshers_MaxElementVolume_var h =
617 StdMeshers::StdMeshers_MaxElementVolume::_narrow( hypothesis() );
619 h->SetVarParameter( params[0].text(), "SetMaxElementVolume" );
620 h->SetMaxElementVolume( params[0].myValue.toDouble() );
622 else if( hypType()=="StartEndLength" )
624 StdMeshers::StdMeshers_StartEndLength_var h =
625 StdMeshers::StdMeshers_StartEndLength::_narrow( hypothesis() );
627 StdMeshersGUI_SubShapeSelectorWdg* w =
628 widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 );
630 h->SetVarParameter( params[0].text(), "SetStartLength" );
631 h->SetStartLength( params[0].myValue.toDouble() );
632 h->SetVarParameter( params[1].text(), "SetEndLength" );
633 h->SetEndLength( params[1].myValue.toDouble() );
635 h->SetReversedEdges( w->GetListOfIDs() );
636 h->SetObjectEntry( w->GetMainShapeEntry() );
639 else if( hypType()=="Deflection1D" )
641 StdMeshers::StdMeshers_Deflection1D_var h =
642 StdMeshers::StdMeshers_Deflection1D::_narrow( hypothesis() );
643 h->SetVarParameter( params[0].text(), "SetDeflection" );
644 h->SetDeflection( params[0].myValue.toDouble() );
646 else if( hypType()=="Adaptive1D" )
648 StdMeshers::StdMeshers_Adaptive1D_var h =
649 StdMeshers::StdMeshers_Adaptive1D::_narrow( hypothesis() );
650 h->SetVarParameter( params[0].text(), "SetMinSize" );
651 h->SetMinSize( params[0].myValue.toDouble() );
652 h->SetVarParameter( params[0].text(), "SetMaxSize" );
653 h->SetMaxSize( params[1].myValue.toDouble() );
654 h->SetVarParameter( params[0].text(), "SetDeflection" );
655 h->SetDeflection( params[2].myValue.toDouble() );
657 else if( hypType()=="AutomaticLength" )
659 StdMeshers::StdMeshers_AutomaticLength_var h =
660 StdMeshers::StdMeshers_AutomaticLength::_narrow( hypothesis() );
662 h->SetVarParameter( params[0].text(), "SetFineness" );
663 h->SetFineness( params[0].myValue.toDouble() );
665 else if( hypType()=="NumberOfLayers" )
667 StdMeshers::StdMeshers_NumberOfLayers_var h =
668 StdMeshers::StdMeshers_NumberOfLayers::_narrow( hypothesis() );
670 h->SetVarParameter( params[0].text(), "SetNumberOfLayers" );
671 h->SetNumberOfLayers( params[0].myValue.toInt() );
673 else if( hypType()=="LayerDistribution" )
675 StdMeshers::StdMeshers_LayerDistribution_var h =
676 StdMeshers::StdMeshers_LayerDistribution::_narrow( hypothesis() );
677 StdMeshersGUI_LayerDistributionParamWdg* w =
678 widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
680 h->SetLayerDistribution( w->GetHypothesis() );
682 else if( hypType()=="NumberOfLayers2D" )
684 StdMeshers::StdMeshers_NumberOfLayers2D_var h =
685 StdMeshers::StdMeshers_NumberOfLayers2D::_narrow( hypothesis() );
687 h->SetVarParameter( params[0].text(), "SetNumberOfLayers" );
688 h->SetNumberOfLayers( params[0].myValue.toInt() );
690 else if( hypType()=="LayerDistribution2D" )
692 StdMeshers::StdMeshers_LayerDistribution2D_var h =
693 StdMeshers::StdMeshers_LayerDistribution2D::_narrow( hypothesis() );
694 StdMeshersGUI_LayerDistributionParamWdg* w =
695 widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
697 h->SetLayerDistribution( w->GetHypothesis() );
699 else if( hypType()=="ProjectionSource1D" )
701 StdMeshers::StdMeshers_ProjectionSource1D_var h =
702 StdMeshers::StdMeshers_ProjectionSource1D::_narrow( hypothesis() );
704 h->SetSourceEdge ( geomFromWdg ( getWidgetForParam( 0 )));
705 h->SetSourceMesh ( meshFromWdg ( getWidgetForParam( 1 )));
706 h->SetVertexAssociation( geomFromWdg ( getWidgetForParam( 2 )),
707 geomFromWdg ( getWidgetForParam( 3 )));
709 else if( hypType()=="ProjectionSource2D" )
711 StdMeshers::StdMeshers_ProjectionSource2D_var h =
712 StdMeshers::StdMeshers_ProjectionSource2D::_narrow( hypothesis() );
714 h->SetSourceFace ( geomFromWdg ( getWidgetForParam( 0 )));
715 h->SetSourceMesh ( meshFromWdg ( getWidgetForParam( 1 )));
716 h->SetVertexAssociation( geomFromWdg ( getWidgetForParam( 2 )), // src1
717 geomFromWdg ( getWidgetForParam( 4 )), // src2
718 geomFromWdg ( getWidgetForParam( 3 )), // tgt1
719 geomFromWdg ( getWidgetForParam( 5 ))); // tgt2
721 else if( hypType()=="ProjectionSource3D" )
723 StdMeshers::StdMeshers_ProjectionSource3D_var h =
724 StdMeshers::StdMeshers_ProjectionSource3D::_narrow( hypothesis() );
726 h->SetSource3DShape ( geomFromWdg ( getWidgetForParam( 0 )));
727 h->SetSourceMesh ( meshFromWdg ( getWidgetForParam( 1 )));
728 h->SetVertexAssociation( geomFromWdg ( getWidgetForParam( 2 )), // src1
729 geomFromWdg ( getWidgetForParam( 4 )), // src2
730 geomFromWdg ( getWidgetForParam( 3 )), // tgt1
731 geomFromWdg ( getWidgetForParam( 5 ))); // tgt2
733 else if( hypType()=="ImportSource1D" )
735 StdMeshers::StdMeshers_ImportSource1D_var h =
736 StdMeshers::StdMeshers_ImportSource1D::_narrow( hypothesis() );
738 SMESH::ListOfGroups_var groups = groupsFromWdg( getWidgetForParam( 0 ));
739 h->SetSourceEdges( groups.in() );
740 QCheckBox* toCopyMesh = widget< QCheckBox >( 1 );
741 QCheckBox* toCopyGroups = widget< QCheckBox >( 2 );
742 h->SetCopySourceMesh( toCopyMesh->isChecked(), toCopyGroups->isChecked());
744 else if( hypType()=="ImportSource2D" )
746 StdMeshers::StdMeshers_ImportSource2D_var h =
747 StdMeshers::StdMeshers_ImportSource2D::_narrow( hypothesis() );
749 SMESH::ListOfGroups_var groups = groupsFromWdg( getWidgetForParam( 0 ));
750 h->SetSourceFaces( groups.in() );
751 QCheckBox* toCopyMesh = widget< QCheckBox >( 1 );
752 QCheckBox* toCopyGroups = widget< QCheckBox >( 2 );
753 h->SetCopySourceMesh( toCopyMesh->isChecked(), toCopyGroups->isChecked());
755 else if( hypType()=="ViscousLayers" )
757 StdMeshers::StdMeshers_ViscousLayers_var h =
758 StdMeshers::StdMeshers_ViscousLayers::_narrow( hypothesis() );
760 h->SetVarParameter ( params[0].text(), "SetTotalThickness" );
761 h->SetTotalThickness( params[0].myValue.toDouble() );
762 h->SetVarParameter ( params[1].text(), "SetNumberLayers" );
763 h->SetNumberLayers ( params[1].myValue.toInt() );
764 h->SetVarParameter ( params[2].text(), "SetStretchFactor" );
765 h->SetStretchFactor ( params[2].myValue.toDouble() );
766 h->SetMethod (( StdMeshers::VLExtrusionMethod ) params[3].myValue.toInt() );
768 if ( StdMeshersGUI_SubShapeSelectorWdg* idsWg =
769 widget< StdMeshersGUI_SubShapeSelectorWdg >( 5 ))
771 h->SetFaces( idsWg->GetListOfIDs(), params[4].myValue.toInt() );
774 if ( StdMeshersGUI_NameCheckableGrpWdg* nameWg =
775 widget< StdMeshersGUI_NameCheckableGrpWdg >( 6 ))
777 CORBA::String_var oldName = h->GetGroupName();
778 h->SetGroupName( nameWg->getName().toUtf8().data() );
779 CORBA::String_var newName = h->GetGroupName();
780 removeOldGroup( oldName, newName, SMESH::VOLUME );
783 else if( hypType()=="ViscousLayers2D" )
785 StdMeshers::StdMeshers_ViscousLayers2D_var h =
786 StdMeshers::StdMeshers_ViscousLayers2D::_narrow( hypothesis() );
788 h->SetVarParameter ( params[0].text(), "SetTotalThickness" );
789 h->SetTotalThickness( params[0].myValue.toDouble() );
790 h->SetVarParameter ( params[1].text(), "SetNumberLayers" );
791 h->SetNumberLayers ( params[1].myValue.toInt() );
792 h->SetVarParameter ( params[2].text(), "SetStretchFactor" );
793 h->SetStretchFactor ( params[2].myValue.toDouble() );
795 if ( StdMeshersGUI_SubShapeSelectorWdg* idsWg =
796 widget< StdMeshersGUI_SubShapeSelectorWdg >( 4 ))
798 h->SetEdges( idsWg->GetListOfIDs(), params[3].myValue.toInt() );
801 if ( StdMeshersGUI_NameCheckableGrpWdg* nameWg =
802 widget< StdMeshersGUI_NameCheckableGrpWdg >( 5 ))
804 CORBA::String_var oldName = h->GetGroupName();
805 h->SetGroupName( nameWg->getName().toUtf8().data() );
806 CORBA::String_var newName = h->GetGroupName();
807 removeOldGroup( oldName, newName, SMESH::FACE );
810 // else if( hypType()=="QuadrangleParams" )
812 // StdMeshers::StdMeshers_QuadrangleParams_var h =
813 // StdMeshers::StdMeshers_QuadrangleParams::_narrow( hypothesis() );
814 // StdMeshersGUI_SubShapeSelectorWdg* w1 =
815 // widget< StdMeshersGUI_SubShapeSelectorWdg >( 0 );
816 // StdMeshersGUI_QuadrangleParamWdg* w2 =
817 // widget< StdMeshersGUI_QuadrangleParamWdg >( 1 );
819 // if (w1->GetListSize() > 0) {
820 // h->SetTriaVertex(w1->GetListOfIDs()[0]); // getlist must be called once
821 // const char * entry = w1->GetMainShapeEntry();
822 // h->SetObjectEntry(entry);
824 // h->SetQuadType(StdMeshers::QuadType(w2->GetType()));
831 //================================================================================
833 * \brief Return parameter values as SMESHGUI_GenericHypothesisCreator::StdParam
834 * \param p - list of parameters
835 * \retval bool - success flag
837 * Is called from SMESHGUI_GenericHypothesisCreator::buildStdFrame().
838 * Parameters will be shown using "standard" controls:
839 * Int by QtxIntSpinBox
840 * Double by SMESHGUI_SpinBox
841 * String by QLineEdit
842 * getCustomWidget() allows to redefine control for a parameter
844 //================================================================================
846 bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
849 SMESHGUI_GenericHypothesisCreator::StdParam item;
852 customWidgets()->clear();
855 HypothesisData* data = SMESH::GetHypothesisData( hypType() );
856 item.myName = tr( "SMESH_NAME" );
857 item.myValue = data ? hypName() : QString();
859 customWidgets()->append(0);
862 SMESH::SMESH_Hypothesis_var hyp = initParamsHypothesis();
863 //SMESH::ListOfParameters_var aParameters = hyp->GetLastParameters();
865 if( hypType()=="LocalLength" )
867 StdMeshers::StdMeshers_LocalLength_var h =
868 StdMeshers::StdMeshers_LocalLength::_narrow( hyp );
870 item.myName = tr("SMESH_LOCAL_LENGTH_PARAM");
871 if(!initVariableName( hyp, item, "SetLength"))
872 item.myValue = h->GetLength();
875 item.myName = tr("SMESH_LOCAL_LENGTH_PRECISION");
876 if(!initVariableName( hyp, item, "SetPrecision"))
877 item.myValue = h->GetPrecision();
880 else if( hypType()=="MaxLength" )
882 StdMeshers::StdMeshers_MaxLength_var h =
883 StdMeshers::StdMeshers_MaxLength::_narrow( hyp );
884 // try to set a right preestimated length to edited hypothesis
885 bool noPreestimatedAtEdition = false;
886 if ( !isCreation() ) {
887 StdMeshers::StdMeshers_MaxLength_var initHyp =
888 StdMeshers::StdMeshers_MaxLength::_narrow( initParamsHypothesis(true) );
889 noPreestimatedAtEdition =
890 ( initHyp->_is_nil() || !initHyp->HavePreestimatedLength() );
891 if ( !noPreestimatedAtEdition )
892 h->SetPreestimatedLength( initHyp->GetPreestimatedLength() );
895 item.myName = tr("SMESH_LOCAL_LENGTH_PARAM");
896 if(!initVariableName( hyp, item, "SetLength"))
897 item.myValue = h->GetLength();
899 customWidgets()->append(0);
901 item.myName = tr("SMESH_USE_PREESTIMATED_LENGTH");
903 QCheckBox* aQCheckBox = new QCheckBox(dlg());
904 if ( h->HavePreestimatedLength() ) {
905 aQCheckBox->setChecked( h->GetUsePreestimatedLength() );
906 connect( aQCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( onValueChanged() ) );
909 aQCheckBox->setChecked( false );
910 aQCheckBox->setEnabled( false );
912 customWidgets()->append( aQCheckBox );
914 else if( hypType()=="SegmentLengthAroundVertex" )
916 StdMeshers::StdMeshers_SegmentLengthAroundVertex_var h =
917 StdMeshers::StdMeshers_SegmentLengthAroundVertex::_narrow( hyp );
919 item.myName = tr("SMESH_LOCAL_LENGTH_PARAM");
920 if(!initVariableName( hyp, item, "SetLength"))
921 item.myValue = h->GetLength();
925 else if( hypType()=="Arithmetic1D" )
927 StdMeshers::StdMeshers_Arithmetic1D_var h =
928 StdMeshers::StdMeshers_Arithmetic1D::_narrow( hyp );
930 item.myName = tr( "SMESH_START_LENGTH_PARAM" );
931 if(!initVariableName( hyp, item, "SetStartLength" ))
932 item.myValue = h->GetLength( true );
935 customWidgets()->append (0);
937 item.myName = tr( "SMESH_END_LENGTH_PARAM" );
938 if(!initVariableName( hyp, item, "SetEndLength" ))
939 item.myValue = h->GetLength( false );
942 customWidgets()->append (0);
944 item.myName = tr( "SMESH_REVERSED_EDGES" );
947 customWidgets()->append ( makeReverseEdgesWdg( h->GetReversedEdges(), h->GetObjectEntry() ));
950 else if( hypType()=="GeometricProgression" )
952 StdMeshers::StdMeshers_Geometric1D_var h =
953 StdMeshers::StdMeshers_Geometric1D::_narrow( hyp );
955 item.myName = tr( "SMESH_START_LENGTH_PARAM" );
956 if(!initVariableName( hyp, item, "SetStartLength" ))
957 item.myValue = h->GetStartLength();
960 customWidgets()->append (0);
962 item.myName = tr( "SMESH_COMMON_RATIO" );
963 if(!initVariableName( hyp, item, "SetCommonRatio" ))
964 item.myValue = h->GetCommonRatio();
967 customWidgets()->append (0);
969 item.myName = tr( "SMESH_REVERSED_EDGES" );
972 customWidgets()->append ( makeReverseEdgesWdg( h->GetReversedEdges(), h->GetObjectEntry() ));
975 else if( hypType()=="FixedPoints1D" )
977 StdMeshers::StdMeshers_FixedPoints1D_var h =
978 StdMeshers::StdMeshers_FixedPoints1D::_narrow( hyp );
980 item.myName = tr( "SMESH_FIXED_POINTS" );
983 StdMeshersGUI_FixedPointsParamWdg* aFixedPointsWidget =
984 new StdMeshersGUI_FixedPointsParamWdg();
986 if ( !isCreation() ) {
987 aFixedPointsWidget->SetListOfPoints( h->GetPoints() );
988 aFixedPointsWidget->SetListOfSegments( h->GetNbSegments() );
990 customWidgets()->append( aFixedPointsWidget );
992 item.myName = tr( "SMESH_REVERSED_EDGES" );
995 customWidgets()->append ( makeReverseEdgesWdg( h->GetReversedEdges(), h->GetObjectEntry() ));
999 else if( hypType()=="MaxElementArea" )
1001 StdMeshers::StdMeshers_MaxElementArea_var h =
1002 StdMeshers::StdMeshers_MaxElementArea::_narrow( hyp );
1004 item.myName = tr( "SMESH_MAX_ELEMENT_AREA_PARAM" );
1005 if(!initVariableName( hyp, item, "SetMaxElementArea" ))
1006 item.myValue = h->GetMaxElementArea();
1010 else if( hypType()=="MaxElementVolume" )
1012 StdMeshers::StdMeshers_MaxElementVolume_var h =
1013 StdMeshers::StdMeshers_MaxElementVolume::_narrow( hyp );
1015 item.myName = tr( "SMESH_MAX_ELEMENT_VOLUME_PARAM" );
1016 if(!initVariableName( hyp, item, "SetMaxElementVolume" ))
1017 item.myValue = h->GetMaxElementVolume();
1020 else if( hypType()=="StartEndLength" )
1022 StdMeshers::StdMeshers_StartEndLength_var h =
1023 StdMeshers::StdMeshers_StartEndLength::_narrow( hyp );
1025 item.myName = tr( "SMESH_START_LENGTH_PARAM" );
1027 if(!initVariableName( hyp, item, "SetStartLength" ))
1028 item.myValue = h->GetLength( true );
1030 customWidgets()->append(0);
1032 item.myName = tr( "SMESH_END_LENGTH_PARAM" );
1033 if(!initVariableName( hyp, item, "SetEndLength" ))
1034 item.myValue = h->GetLength( false );
1036 customWidgets()->append(0);
1038 item.myName = tr( "SMESH_REVERSED_EDGES" );
1041 customWidgets()->append ( makeReverseEdgesWdg( h->GetReversedEdges(), h->GetObjectEntry() ));
1043 else if( hypType()=="Deflection1D" )
1045 StdMeshers::StdMeshers_Deflection1D_var h =
1046 StdMeshers::StdMeshers_Deflection1D::_narrow( hyp );
1048 item.myName = tr( "SMESH_DEFLECTION1D_PARAM" );
1049 if(!initVariableName( hyp, item, "SetDeflection" ))
1050 item.myValue = h->GetDeflection();
1053 else if( hypType()=="Adaptive1D" )
1055 StdMeshers::StdMeshers_Adaptive1D_var h =
1056 StdMeshers::StdMeshers_Adaptive1D::_narrow( hyp );
1058 item.myName = tr( "SMESH_MIN_SIZE" );
1059 if(!initVariableName( hyp, item, "SetMinSize" ))
1060 item.myValue = h->GetMinSize();
1063 item.myName = tr( "SMESH_MAX_SIZE" );
1064 if(!initVariableName( hyp, item, "SetMaxSize" ))
1065 item.myValue = h->GetMaxSize();
1068 item.myName = tr( "SMESH_DEFLECTION1D_PARAM" );
1069 if(!initVariableName( hyp, item, "SetDeflection" ))
1070 item.myValue = h->GetDeflection();
1073 else if( hypType()=="AutomaticLength" )
1075 StdMeshers::StdMeshers_AutomaticLength_var h =
1076 StdMeshers::StdMeshers_AutomaticLength::_narrow( hyp );
1078 item.myName = tr( "SMESH_FINENESS_PARAM" );
1079 //item.myValue = h->GetFineness();
1081 SMESHGUI_SpinBox* _autoLengthSpinBox = new SMESHGUI_SpinBox(dlg());
1082 _autoLengthSpinBox->RangeStepAndValidator(0, 1, 0.01, "length_precision");
1083 _autoLengthSpinBox->SetValue(h->GetFineness());
1084 customWidgets()->append( _autoLengthSpinBox);
1086 else if( hypType()=="NumberOfLayers" )
1088 StdMeshers::StdMeshers_NumberOfLayers_var h =
1089 StdMeshers::StdMeshers_NumberOfLayers::_narrow( hyp );
1091 item.myName = tr( "SMESH_NUMBER_OF_LAYERS" );
1092 if(!initVariableName( hyp, item, "SetNumberOfLayers" ))
1093 item.myValue = (int) h->GetNumberOfLayers();
1096 else if( hypType()=="LayerDistribution" )
1098 StdMeshers::StdMeshers_LayerDistribution_var h =
1099 StdMeshers::StdMeshers_LayerDistribution::_narrow( hyp );
1101 item.myName = tr( "SMESH_LAYERS_DISTRIBUTION" ); p.append( item );
1102 initVariableName( hyp, item, "SetLayerDistribution" );
1103 customWidgets()->append ( new StdMeshersGUI_LayerDistributionParamWdg
1104 ( h, h->GetLayerDistribution(), hypName(), dlg() ));
1106 else if( hypType()=="NumberOfLayers2D" )
1108 StdMeshers::StdMeshers_NumberOfLayers2D_var h =
1109 StdMeshers::StdMeshers_NumberOfLayers2D::_narrow( hyp );
1111 item.myName = tr( "SMESH_NUMBER_OF_LAYERS" );
1112 if(!initVariableName( hyp, item, "SetNumberOfLayers" ))
1113 item.myValue = (int) h->GetNumberOfLayers();
1116 else if( hypType()=="LayerDistribution2D" )
1118 StdMeshers::StdMeshers_LayerDistribution2D_var h =
1119 StdMeshers::StdMeshers_LayerDistribution2D::_narrow( hyp );
1121 item.myName = tr( "SMESH_LAYERS_DISTRIBUTION" ); p.append( item );
1122 initVariableName( hyp, item, "SetLayerDistribution" );
1123 customWidgets()->append ( new StdMeshersGUI_LayerDistributionParamWdg
1124 ( h, h->GetLayerDistribution(), hypName(), dlg() ));
1126 else if( hypType()=="ProjectionSource1D" )
1128 StdMeshers::StdMeshers_ProjectionSource1D_var h =
1129 StdMeshers::StdMeshers_ProjectionSource1D::_narrow( hyp );
1131 item.myName = tr( "SMESH_SOURCE_EDGE" ); p.append( item );
1132 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 1 ),
1133 h->GetSourceEdge()));
1134 item.myName = tr( "SMESH_SOURCE_MESH" ); p.append( item );
1135 customWidgets()->append( newObjRefParamWdg( new SMESH_TypeFilter( SMESH::MESH ),
1136 h->GetSourceMesh()));
1137 item.myName = tr( "SMESH_SOURCE_VERTEX" ); p.append( item );
1138 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ),
1139 h->GetSourceVertex()));
1140 item.myName = tr( "SMESH_TARGET_VERTEX" ); p.append( item );
1141 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ),
1142 h->GetTargetVertex()));
1144 else if( hypType()=="ProjectionSource2D" )
1146 StdMeshers::StdMeshers_ProjectionSource2D_var h =
1147 StdMeshers::StdMeshers_ProjectionSource2D::_narrow( hyp );
1149 item.myName = tr( "SMESH_SOURCE_FACE" ); p.append( item );
1150 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 2 ),
1151 h->GetSourceFace()));
1152 item.myName = tr( "SMESH_SOURCE_MESH" ); p.append( item );
1153 customWidgets()->append( newObjRefParamWdg( new SMESH_TypeFilter( SMESH::MESH ),
1154 h->GetSourceMesh()));
1155 item.myName = tr( "SMESH_SOURCE_VERTEX1" ); p.append( item );
1156 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ),
1157 h->GetSourceVertex( 1 )));
1158 item.myName = tr( "SMESH_TARGET_VERTEX1" ); p.append( item );
1159 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ),
1160 h->GetTargetVertex( 1 )));
1161 item.myName = tr( "SMESH_SOURCE_VERTEX2" ); p.append( item );
1162 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ),
1163 h->GetSourceVertex( 2 )));
1164 item.myName = tr( "SMESH_TARGET_VERTEX2" ); p.append( item );
1165 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ),
1166 h->GetTargetVertex( 2 )));
1168 else if( hypType()=="ProjectionSource3D" )
1170 StdMeshers::StdMeshers_ProjectionSource3D_var h =
1171 StdMeshers::StdMeshers_ProjectionSource3D::_narrow( hyp );
1173 item.myName = tr( "SMESH_SOURCE_3DSHAPE" ); p.append( item );
1174 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 3, TopAbs_FACE, 6, true ),
1175 h->GetSource3DShape()));
1176 item.myName = tr( "SMESH_SOURCE_MESH" ); p.append( item );
1177 customWidgets()->append( newObjRefParamWdg( new SMESH_TypeFilter( SMESH::MESH ),
1178 h->GetSourceMesh()));
1179 item.myName = tr( "SMESH_SOURCE_VERTEX1" ); p.append( item );
1180 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ),
1181 h->GetSourceVertex( 1 )));
1182 item.myName = tr( "SMESH_TARGET_VERTEX1" ); p.append( item );
1183 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ),
1184 h->GetTargetVertex( 1 )));
1185 item.myName = tr( "SMESH_SOURCE_VERTEX2" ); p.append( item );
1186 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ),
1187 h->GetSourceVertex( 2 )));
1188 item.myName = tr( "SMESH_TARGET_VERTEX2" ); p.append( item );
1189 customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ),
1190 h->GetTargetVertex( 2 )));
1192 else if( hypType()=="ImportSource1D" )
1194 StdMeshers::StdMeshers_ImportSource1D_var h =
1195 StdMeshers::StdMeshers_ImportSource1D::_narrow( hyp );
1197 SMESH::string_array_var groupEntries = h->GetSourceEdges();
1198 CORBA::Boolean toCopyMesh, toCopyGroups;
1199 h->GetCopySourceMesh(toCopyMesh, toCopyGroups);
1201 item.myName = tr( "SMESH_SOURCE_EDGES" ); p.append( item );
1202 customWidgets()->append( newObjRefParamWdg( new SMESH_TypeFilter( SMESH::GROUP_EDGE ),
1205 item.myName = tr( "SMESH_COPY_MESH" ); p.append( item );
1206 QCheckBox* aQCheckBox = new QCheckBox(dlg());
1207 aQCheckBox->setChecked( toCopyMesh );
1208 connect( aQCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( onValueChanged() ));
1209 customWidgets()->append( aQCheckBox );
1211 item.myName = tr( "SMESH_TO_COPY_GROUPS" ); p.append( item );
1212 aQCheckBox = new QCheckBox(dlg());
1213 aQCheckBox->setChecked( toCopyGroups );
1214 aQCheckBox->setEnabled( toCopyMesh );
1215 customWidgets()->append( aQCheckBox );
1217 else if( hypType()=="ImportSource2D" )
1219 StdMeshers::StdMeshers_ImportSource2D_var h =
1220 StdMeshers::StdMeshers_ImportSource2D::_narrow( hyp );
1222 SMESH::string_array_var groupEntries = h->GetSourceFaces();
1223 CORBA::Boolean toCopyMesh, toCopyGroups;
1224 h->GetCopySourceMesh(toCopyMesh, toCopyGroups);
1226 item.myName = tr( "SMESH_SOURCE_FACES" ); p.append( item );
1227 customWidgets()->append( newObjRefParamWdg( new SMESH_TypeFilter( SMESH::GROUP_FACE ),
1230 item.myName = tr( "SMESH_COPY_MESH" ); p.append( item );
1231 QCheckBox* aQCheckBox = new QCheckBox(dlg());
1232 aQCheckBox->setChecked( toCopyMesh );
1233 connect( aQCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( onValueChanged() ));
1234 customWidgets()->append( aQCheckBox );
1236 item.myName = tr( "SMESH_COPY_GROUPS" ); p.append( item );
1237 aQCheckBox = new QCheckBox(dlg());
1238 aQCheckBox->setChecked( toCopyGroups );
1239 aQCheckBox->setEnabled( toCopyMesh );
1240 customWidgets()->append( aQCheckBox );
1242 else if( hypType()=="ViscousLayers" )
1244 StdMeshers::StdMeshers_ViscousLayers_var h =
1245 StdMeshers::StdMeshers_ViscousLayers::_narrow( hyp );
1247 item.myName = tr( "SMESH_TOTAL_THICKNESS" );
1248 if(!initVariableName( hyp, item, "SetTotalThickness" ))
1249 item.myValue = h->GetTotalThickness();
1251 customWidgets()->append (0);
1253 item.myName = tr( "SMESH_NUMBER_OF_LAYERS" );
1254 if(!initVariableName( hyp, item, "SetNumberLayers" ))
1255 item.myValue = h->GetNumberLayers();
1257 customWidgets()->append (0);
1259 item.myName = tr( "SMESH_STRETCH_FACTOR" );
1260 if(!initVariableName( hyp, item, "SetStretchFactor" ))
1261 item.myValue = h->GetStretchFactor();
1263 customWidgets()->append (0);
1265 item.myName = tr( "EXTRUSION_METHOD" );
1267 StdMeshersGUI_RadioButtonsGrpWdg* methodWdg = new StdMeshersGUI_RadioButtonsGrpWdg("");
1268 methodWdg->setButtonLabels ( QStringList()
1269 << tr("EXTMETH_SURF_OFFSET_SMOOTH")
1270 << tr("EXTMETH_FACE_OFFSET")
1271 << tr("EXTMETH_NODE_OFFSET"),
1273 << tr("ICON_EXTMETH_SURF_OFFSET_SMOOTH")
1274 << tr("ICON_EXTMETH_FACE_OFFSET")
1275 << tr("ICON_EXTMETH_NODE_OFFSET"));
1276 methodWdg->setChecked( (int) h->GetMethod() );
1277 customWidgets()->append( methodWdg );
1279 QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
1280 QString aSubEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
1281 if ( !aMainEntry.isEmpty() )
1283 item.myName = tr( "TO_IGNORE_FACES_OR_NOT" );
1286 StdMeshersGUI_RadioButtonsGrpWdg* ignoreWdg = new StdMeshersGUI_RadioButtonsGrpWdg("");
1287 ignoreWdg->setButtonLabels ( QStringList()
1288 << tr("NOT_TO_IGNORE_FACES")
1289 << tr("TO_IGNORE_FACES") );
1290 ignoreWdg->setChecked( h->GetIsToIgnoreFaces() );
1291 connect(ignoreWdg->getButtonGroup(),SIGNAL(buttonClicked(int)),this,SLOT(onValueChanged()));
1292 customWidgets()->append( ignoreWdg );
1295 tr( h->GetIsToIgnoreFaces() ? "SMESH_FACES_WO_LAYERS" : "SMESH_FACES_WITH_LAYERS" );
1298 StdMeshersGUI_SubShapeSelectorWdg* idsWg =
1299 new StdMeshersGUI_SubShapeSelectorWdg(0,TopAbs_FACE);
1301 idsWg->SetGeomShapeEntry( aSubEntry, aMainEntry );
1302 if ( idsWg->SetListOfIDs( h->GetFaces() ))
1304 idsWg->ShowPreview( true );
1308 SUIT_MessageBox::warning( dlg(),tr( "SMESH_WRN_WARNING" ),tr( "BAD_FACES_WARNING" ));
1309 idsWg->setEnabled( false );
1311 customWidgets()->append ( idsWg );
1316 StdMeshersGUI_NameCheckableGrpWdg* nameWdg =
1317 new StdMeshersGUI_NameCheckableGrpWdg( tr( "CREATE_GROUPS_FROM_LAYERS" ),
1318 tr( "GROUP_NAME" ));
1319 nameWdg->setName( h->GetGroupName() );
1320 if ( nameWdg->getName().isEmpty() )
1322 nameWdg->setDefaultName( type() );
1323 nameWdg->setChecked( false );
1325 customWidgets()->append ( nameWdg );
1327 else if( hypType()=="ViscousLayers2D" )
1329 StdMeshers::StdMeshers_ViscousLayers2D_var h =
1330 StdMeshers::StdMeshers_ViscousLayers2D::_narrow( hyp );
1332 item.myName = tr( "SMESH_TOTAL_THICKNESS" );
1333 if(!initVariableName( hyp, item, "SetTotalThickness" ))
1334 item.myValue = h->GetTotalThickness();
1336 customWidgets()->append (0);
1338 item.myName = tr( "SMESH_NUMBER_OF_LAYERS" );
1339 if(!initVariableName( hyp, item, "SetNumberLayers" ))
1340 item.myValue = h->GetNumberLayers();
1342 customWidgets()->append (0);
1344 item.myName = tr( "SMESH_STRETCH_FACTOR" );
1345 if(!initVariableName( hyp, item, "SetStretchFactor" ))
1346 item.myValue = h->GetStretchFactor();
1348 customWidgets()->append (0);
1350 QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
1351 QString aSubEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
1352 if ( !aMainEntry.isEmpty() )
1354 item.myName = tr("TO_IGNORE_EDGES_OR_NOT");
1357 StdMeshersGUI_RadioButtonsGrpWdg* ignoreWdg = new StdMeshersGUI_RadioButtonsGrpWdg("");
1358 ignoreWdg->setButtonLabels ( QStringList()
1359 << tr("NOT_TO_IGNORE_EDGES")
1360 << tr("TO_IGNORE_EDGES") );
1361 ignoreWdg->setChecked( h->GetIsToIgnoreEdges() );
1362 connect(ignoreWdg->getButtonGroup(),SIGNAL(buttonClicked(int)),this,SLOT(onValueChanged()));
1363 customWidgets()->append( ignoreWdg );
1366 tr( h->GetIsToIgnoreEdges() ? "SMESH_EDGES_WO_LAYERS" : "SMESH_EDGES_WITH_LAYERS" );
1369 StdMeshersGUI_SubShapeSelectorWdg* idsWg =
1370 new StdMeshersGUI_SubShapeSelectorWdg(0,TopAbs_EDGE);
1372 idsWg->SetGeomShapeEntry( aSubEntry, aMainEntry );
1373 if ( idsWg->SetListOfIDs( h->GetEdges() ))
1375 idsWg->ShowPreview( true );
1379 SUIT_MessageBox::warning( dlg(),tr( "SMESH_WRN_WARNING" ),tr( "BAD_EDGES_WARNING" ));
1380 idsWg->setEnabled( false );
1382 customWidgets()->append ( idsWg );
1387 StdMeshersGUI_NameCheckableGrpWdg* nameWdg =
1388 new StdMeshersGUI_NameCheckableGrpWdg( tr( "CREATE_GROUPS_FROM_LAYERS" ),
1389 tr( "GROUP_NAME" ));
1390 nameWdg->setName( h->GetGroupName() );
1391 if ( nameWdg->getName().isEmpty() )
1393 nameWdg->setDefaultName( type() );
1394 nameWdg->setChecked( false );
1396 customWidgets()->append ( nameWdg );
1403 //================================================================================
1405 * \brief tune "standard" control
1406 * \param w - control widget
1407 * \param int - parameter index
1409 //================================================================================
1411 void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget (QWidget* w, const int) const
1413 SMESHGUI_SpinBox* sb = w->inherits( "SMESHGUI_SpinBox" ) ? ( SMESHGUI_SpinBox* )w : 0;
1416 if( hypType()=="LocalLength" )
1418 if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PARAM"))
1419 sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
1420 else if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PRECISION"))
1421 sb->RangeStepAndValidator( 0.0, 1.0, 0.05, "len_tol_precision" );
1423 else if( hypType()=="Arithmetic1D" )
1425 sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
1427 else if( hypType()=="GeometricProgression" )
1429 if (sb->objectName() == tr("SMESH_START_LENGTH_PARAM"))
1430 sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
1431 else if (sb->objectName() == tr("SMESH_COMMON_RATIO"))
1432 sb->RangeStepAndValidator( -VALUE_MAX, VALUE_MAX, 0.5, "len_tol_precision" );
1434 else if( hypType()=="MaxLength" )
1436 sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
1437 sb->setEnabled( !widget< QCheckBox >( 1 )->isChecked() );
1438 sb->setMinimumWidth( 150 );
1440 else if( hypType()=="MaxElementArea" )
1442 sb->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 1.0, "area_precision" );
1444 else if( hypType()=="MaxElementVolume" )
1446 sb->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 1.0, "vol_precision" );
1448 else if( hypType()=="StartEndLength" )
1450 sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
1452 else if( hypType()=="Deflection1D" )
1454 sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
1456 else if( hypType()=="Adaptive1D" )
1458 sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
1460 else if( hypType().startsWith( "ViscousLayers" ))
1462 if (sb->objectName() == tr("SMESH_STRETCH_FACTOR"))
1463 sb->RangeStepAndValidator( 1.0, VALUE_MAX, 0.1, "parametric_precision" );
1465 sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
1467 else // default validator for possible ancestors
1469 sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
1472 else if ( SalomeApp_IntSpinBox* sb = qobject_cast< SalomeApp_IntSpinBox* >( w ))
1474 if ( hypType().startsWith( "NumberOfLayers" ) ||
1475 hypType().startsWith( "ViscousLayers" ))
1477 sb->setMinimum( 1 );
1482 //================================================================================
1484 * \brief Return dlg title
1485 * \retval QString - title string
1487 //================================================================================
1489 QString StdMeshersGUI_StdHypothesisCreator::caption() const
1491 return tr( QString( "SMESH_%1_TITLE" ).arg( hypTypeName( hypType() ) ).toLatin1().data() );
1494 //================================================================================
1496 * \brief return pixmap for dlg icon
1499 //================================================================================
1501 QPixmap StdMeshersGUI_StdHypothesisCreator::icon() const
1503 QString hypIconName = tr( QString( "ICON_DLG_%1" ).arg( hypTypeName( hypType() ) ).toLatin1().data() );
1504 return SMESHGUI::resourceMgr()->loadPixmap( "SMESH", hypIconName );
1507 //================================================================================
1509 * \brief Return hypothesis type name to show in dlg
1512 //================================================================================
1514 QString StdMeshersGUI_StdHypothesisCreator::type() const
1516 return tr( QString( "SMESH_%1_HYPOTHESIS" ).arg( hypTypeName( hypType() ) ).toLatin1().data() );
1519 //================================================================================
1521 * \brief String to insert in "SMESH_%1_HYPOTHESIS" to get hypothesis type name
1522 * from message resource file
1523 * \param t - hypothesis type
1524 * \retval QString - result string
1526 //================================================================================
1528 QString StdMeshersGUI_StdHypothesisCreator::hypTypeName( const QString& t ) const
1530 static QMap<QString,QString> types;
1531 if( types.isEmpty() )
1533 types.insert( "LocalLength", "LOCAL_LENGTH" );
1534 types.insert( "NumberOfSegments", "NB_SEGMENTS" );
1535 types.insert( "MaxElementArea", "MAX_ELEMENT_AREA" );
1536 types.insert( "MaxElementVolume", "MAX_ELEMENT_VOLUME" );
1537 types.insert( "StartEndLength", "START_END_LENGTH" );
1538 types.insert( "Deflection1D", "DEFLECTION1D" );
1539 types.insert( "Adaptive1D", "ADAPTIVE1D" );
1540 types.insert( "Arithmetic1D", "ARITHMETIC_1D" );
1541 types.insert( "GeometricProgression", "GEOMETRIC_1D" );
1542 types.insert( "FixedPoints1D", "FIXED_POINTS_1D" );
1543 types.insert( "AutomaticLength", "AUTOMATIC_LENGTH" );
1544 types.insert( "ProjectionSource1D", "PROJECTION_SOURCE_1D" );
1545 types.insert( "ProjectionSource2D", "PROJECTION_SOURCE_2D" );
1546 types.insert( "ProjectionSource3D", "PROJECTION_SOURCE_3D" );
1547 types.insert( "ImportSource1D", "IMPORT_SOURCE_1D" );
1548 types.insert( "ImportSource2D", "IMPORT_SOURCE_2D" );
1549 types.insert( "NumberOfLayers", "NUMBER_OF_LAYERS" );
1550 types.insert( "LayerDistribution", "LAYER_DISTRIBUTION" );
1551 types.insert( "NumberOfLayers2D", "NUMBER_OF_LAYERS_2D" );
1552 types.insert( "LayerDistribution2D", "LAYER_DISTRIBUTION" );
1553 types.insert( "SegmentLengthAroundVertex", "SEGMENT_LENGTH_AROUND_VERTEX" );
1554 types.insert( "MaxLength", "MAX_LENGTH" );
1555 types.insert( "ViscousLayers", "VISCOUS_LAYERS" );
1556 types.insert( "ViscousLayers2D", "VISCOUS_LAYERS" );
1557 types.insert( "QuadrangleParams", "QUADRANGLE_PARAMS" );
1558 types.insert( "CartesianParameters3D", "CARTESIAN_PARAMS" );
1562 if( types.contains( t ) )
1569 //=======================================================================
1570 //function : getCustomWidget
1571 //purpose : is called from buildStdFrame()
1572 //=======================================================================
1574 QWidget* StdMeshersGUI_StdHypothesisCreator::getCustomWidget( const StdParam & /*param*/,
1576 const int index) const
1579 if ( index < customWidgets()->count() ) {
1580 w = customWidgets()->at( index );
1582 w->setParent( parent );
1583 w->move( QPoint( 0, 0 ) );
1589 //================================================================================
1591 * \brief Set param value taken from a custom widget
1592 * \param param - SMESHGUI_GenericHypothesisCreator::StdParam structure
1593 * \param widget - widget presenting param
1594 * \retval bool - success flag
1596 * this method is called from getStdParamFromDlg()
1598 //================================================================================
1600 bool StdMeshersGUI_StdHypothesisCreator::getParamFromCustomWidget( StdParam & param,
1601 QWidget* widget) const
1603 if ( hypType()=="AutomaticLength" ) {
1604 SMESHGUI_SpinBox* w = dynamic_cast<SMESHGUI_SpinBox*>( widget );
1606 param.myValue = w->GetValue();
1610 if ( hypType() == "MaxLength" ) {
1614 if ( widget->inherits( "StdMeshersGUI_ObjectReferenceParamWdg" ))
1616 // show only 1st reference value
1617 if ( true /*widget == getWidgetForParam( 0 )*/) {
1618 const StdMeshersGUI_ObjectReferenceParamWdg * w =
1619 static_cast<const StdMeshersGUI_ObjectReferenceParamWdg*>( widget );
1620 param.myValue = w->GetValue();
1624 if ( widget->inherits( "StdMeshersGUI_LayerDistributionParamWdg" ))
1626 const StdMeshersGUI_LayerDistributionParamWdg * w =
1627 static_cast<const StdMeshersGUI_LayerDistributionParamWdg*>( widget );
1628 param.myValue = w->GetValue();
1631 if ( widget->inherits( "StdMeshersGUI_SubShapeSelectorWdg" ))
1633 const StdMeshersGUI_SubShapeSelectorWdg * w =
1634 static_cast<const StdMeshersGUI_SubShapeSelectorWdg*>( widget );
1635 param.myValue = w->GetValue();
1638 // if ( widget->inherits( "StdMeshersGUI_QuadrangleParamWdg" ))
1640 // param.myValue = "QuadType";
1643 if ( widget->inherits( "StdMeshersGUI_FixedPointsParamWdg" ))
1645 const StdMeshersGUI_FixedPointsParamWdg * w =
1646 static_cast<const StdMeshersGUI_FixedPointsParamWdg*>( widget );
1647 param.myValue = w->GetValue();
1650 if ( widget->inherits( "QCheckBox" ))
1652 //const QCheckBox * w = static_cast<const QCheckBox*>( widget );
1653 //param.myValue = w->isChecked();
1656 if ( widget->inherits( "StdMeshersGUI_RadioButtonsGrpWdg" ))
1658 const StdMeshersGUI_RadioButtonsGrpWdg * w =
1659 static_cast<const StdMeshersGUI_RadioButtonsGrpWdg*>( widget );
1660 param.myValue = w->checkedId();
1663 if ( widget->inherits( "StdMeshersGUI_NameCheckableGrpWdg" ))
1670 //================================================================================
1672 * \brief called when operation cancelled
1674 //================================================================================
1676 void StdMeshersGUI_StdHypothesisCreator::onReject()
1678 if ( hypType().startsWith("ProjectionSource" ) ||
1679 hypType().startsWith("ImportSource" ))
1681 // Uninstall filters of StdMeshersGUI_ObjectReferenceParamWdg
1682 deactivateObjRefParamWdg( customWidgets() );
1686 //================================================================================
1688 * \brief Update widgets dependent on paramWidget
1690 //================================================================================
1692 void StdMeshersGUI_StdHypothesisCreator::valueChanged( QWidget* paramWidget)
1694 if ( hypType() == "MaxLength" && paramWidget == getWidgetForParam(1) )
1696 getWidgetForParam(0)->setEnabled( !widget< QCheckBox >( 1 )->isChecked() );
1697 if ( !getWidgetForParam(0)->isEnabled() ) {
1698 StdMeshers::StdMeshers_MaxLength_var h =
1699 StdMeshers::StdMeshers_MaxLength::_narrow( initParamsHypothesis() );
1700 widget< QtxDoubleSpinBox >( 0 )->setValue( h->GetPreestimatedLength() );
1703 else if ( hypType().startsWith("ImportSource") && paramWidget == getWidgetForParam(1) )
1705 QCheckBox* toCopyMesh = (QCheckBox*) paramWidget;
1706 QCheckBox* toCopyGroups = widget< QCheckBox >( 2 );
1707 if ( !toCopyMesh->isChecked() )
1709 toCopyGroups->setChecked( false );
1710 toCopyGroups->setEnabled( false );
1714 toCopyGroups->setEnabled( true );
1717 else if ( hypType().startsWith( "ViscousLayers" ) && paramWidget->inherits("QButtonGroup"))
1719 int widgetNumber = hypType() == "ViscousLayers2D" ? 3 : 4;
1720 if ( QLabel* label = getLabel( widgetNumber + 1 ) )
1722 bool toIgnore = widget< StdMeshersGUI_RadioButtonsGrpWdg >( widgetNumber )->checkedId();
1723 if ( hypType() == "ViscousLayers2D" )
1724 label->setText( tr( toIgnore ? "SMESH_EDGES_WO_LAYERS" : "SMESH_EDGES_WITH_LAYERS" ));
1726 label->setText( tr( toIgnore ? "SMESH_FACES_WO_LAYERS" : "SMESH_FACES_WITH_LAYERS" ));
1731 //================================================================================
1735 //================================================================================
1737 bool StdMeshersGUI_StdHypothesisCreator::initVariableName(SMESH::SMESH_Hypothesis_var /*theHyp*/,
1738 StdParam & theParams,
1739 const char* theMethod) const
1741 QString aVaribaleName = getVariableName( theMethod );
1742 theParams.isVariable = !aVaribaleName.isEmpty();
1743 if (theParams.isVariable)
1744 theParams.myValue = aVaribaleName;
1746 return theParams.isVariable;
1749 //================================================================================
1751 * \brief Creates two widgets used to define reversed edges for some 1D hypotheses
1752 * \param [in] edgeIDs - ids of reversed edges to set to the widgets
1753 * \param [in] shapeEntry - entry of a sub-shape of a sub-mesh if any
1754 * \return QWidget* - new StdMeshersGUI_SubShapeSelectorWdg;
1755 * new StdMeshersGUI_PropagationHelperWdg is stored in \a myHelperWidget field.
1757 //================================================================================
1760 StdMeshersGUI_StdHypothesisCreator::makeReverseEdgesWdg( SMESH::long_array_var edgeIDs,
1761 CORBA::String_var shapeEntry) const
1763 QString aGeomEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
1764 QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
1765 if ( aGeomEntry.isEmpty() && shapeEntry.in() )
1766 aGeomEntry = shapeEntry.in();
1768 StdMeshersGUI_SubShapeSelectorWdg* wdg = new StdMeshersGUI_SubShapeSelectorWdg();
1769 wdg->SetGeomShapeEntry( aGeomEntry, aMainEntry );
1770 wdg->SetListOfIDs( edgeIDs );
1771 wdg->ShowPreview( true );
1773 if ( !aGeomEntry.isEmpty() || !aMainEntry.isEmpty() )
1774 const_cast<StdMeshersGUI_StdHypothesisCreator*>( this )->
1775 myHelperWidget = new StdMeshersGUI_PropagationHelperWdg( wdg );