Auxiliary class for creation of hypotheses. More...
#include <SMESHGUI_Hypotheses.h>

Data Structures | |
| struct | StdParam |
Signals | |
| void | finished (int) |
Public Member Functions | |
| SMESHGUI_GenericHypothesisCreator (const QString &) | |
| virtual | ~SMESHGUI_GenericHypothesisCreator () |
| void | create (SMESH::SMESH_Hypothesis_ptr, const QString &, QWidget *, QObject *, const QString &) |
| void | create (bool, const QString &, QWidget *, QObject *, const QString &) |
| void | edit (SMESH::SMESH_Hypothesis_ptr, const QString &, QWidget *, QObject *, const QString &) |
| void | setInitParamsHypothesis (SMESH::SMESH_Hypothesis_ptr) |
| virtual bool | checkParams (QString &) const |
| virtual void | onReject () |
| virtual QString | helpPage () const |
| QString | hypType () const |
| QString | hypName () const |
| bool | isCreation () const |
| QString | getShapeEntry () const |
| void | setShapeEntry (const QString &theEntry) |
| QString | getMainShapeEntry () const |
| void | setMainShapeEntry (const QString &theEntry) |
Protected Types | |
| typedef QList< StdParam > | ListOfStdParams |
| typedef QList< QWidget * > | ListOfWidgets |
Protected Slots | |
| virtual void | onValueChanged () |
Protected Member Functions | |
| SMESH::SMESH_Hypothesis_var | hypothesis () const |
| SMESH::SMESH_Hypothesis_var | initParamsHypothesis (const bool strict=false) const |
| Return hypothesis containing initial parameters. | |
| bool | hasInitParamsHypothesis () const |
| const ListOfWidgets & | widgets () const |
| ListOfWidgets & | changeWidgets () |
| QtxDialog * | dlg () const |
| virtual QFrame * | buildFrame ()=0 |
| QFrame * | buildStdFrame () |
| virtual void | retrieveParams () const =0 |
| virtual QString | storeParams () const =0 |
| virtual bool | stdParams (ListOfStdParams &) const |
| bool | getStdParamFromDlg (ListOfStdParams &) const |
| virtual QStringList | getVariablesFromDlg () const |
| virtual void | attuneStdWidget (QWidget *, const int) const |
| virtual QWidget * | getCustomWidget (const StdParam &, QWidget *, const int) const |
| virtual bool | getParamFromCustomWidget (StdParam &, QWidget *) const |
| virtual void | valueChanged (QWidget *) |
| virtual QString | caption () const |
| virtual QPixmap | icon () const |
| virtual QString | type () const |
Static Protected Member Functions | |
| static QString | stdParamValues (const ListOfStdParams &) |
Private Slots | |
| virtual void | onDialogFinished (int) |
Private Member Functions | |
| void | editHypothesis (SMESH::SMESH_Hypothesis_ptr, const QString &, QWidget *, QObject *obj, const QString &) |
Private Attributes | |
| SMESH::SMESH_Hypothesis_var | myHypo |
| SMESH::SMESH_Hypothesis_var | myInitParamsHypo |
| QString | myHypName |
| QString | myHypType |
| ListOfWidgets | myParamWidgets |
| bool | myIsCreate |
| QtxDialog * | myDlg |
| QString | myShapeEntry |
| QString | myMainShapeEntry |
Auxiliary class for creation of hypotheses.
Definition at line 47 of file SMESHGUI_Hypotheses.h.
typedef QList<StdParam> SMESHGUI_GenericHypothesisCreator.ListOfStdParams [protected] |
Definition at line 89 of file SMESHGUI_Hypotheses.h.
typedef QList<QWidget*> SMESHGUI_GenericHypothesisCreator.ListOfWidgets [protected] |
Definition at line 90 of file SMESHGUI_Hypotheses.h.
| SMESHGUI_GenericHypothesisCreator::SMESHGUI_GenericHypothesisCreator | ( | const QString & | theHypType | ) |
Definition at line 58 of file SMESHGUI_Hypotheses.cxx.
: myHypType( theHypType ), myIsCreate( false ), myDlg( 0 ) { }
| SMESHGUI_GenericHypothesisCreator::~SMESHGUI_GenericHypothesisCreator | ( | ) | [virtual] |
Definition at line 63 of file SMESHGUI_Hypotheses.cxx.
{
}
| void SMESHGUI_GenericHypothesisCreator::attuneStdWidget | ( | QWidget * | , |
| const int | |||
| ) | const [protected, virtual] |
Reimplemented in StdMeshersGUI_StdHypothesisCreator.
Definition at line 464 of file SMESHGUI_Hypotheses.cxx.
Referenced by buildStdFrame().
{
}
| virtual QFrame* SMESHGUI_GenericHypothesisCreator.buildFrame | ( | ) | [protected, pure virtual] |
Implemented in StdMeshersGUI_NbSegmentsCreator, and StdMeshersGUI_StdHypothesisCreator.
Referenced by editHypothesis().
| QFrame * SMESHGUI_GenericHypothesisCreator::buildStdFrame | ( | ) | [protected] |
Definition at line 157 of file SMESHGUI_Hypotheses.cxx.
References _PTR(), attuneStdWidget(), changeWidgets(), getCustomWidget(), hypothesis(), MARGIN, onValueChanged(), SPACING, stdParams(), and valueChanged().
Referenced by StdMeshersGUI_StdHypothesisCreator.buildFrame().
{
if( CORBA::is_nil( hypothesis() ) )
return 0;
ListOfStdParams params;
if( !stdParams( params ) || params.isEmpty() )
return 0;
QFrame* fr = new QFrame( 0 );
QVBoxLayout* lay = new QVBoxLayout( fr );
lay->setMargin( 5 );
lay->setSpacing( 0 );
QGroupBox* GroupC1 = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr );
lay->addWidget( GroupC1 );
QGridLayout* GroupC1Layout = new QGridLayout( GroupC1 );
GroupC1Layout->setSpacing( SPACING );
GroupC1Layout->setMargin( MARGIN );
ListOfStdParams::const_iterator anIt = params.begin(), aLast = params.end();
for( int i=0; anIt!=aLast; anIt++, i++ )
{
QLabel* lab = new QLabel( (*anIt).myName, GroupC1 );
GroupC1Layout->addWidget( lab, i, 0 );
QWidget* w = getCustomWidget( *anIt, GroupC1, i );
if ( !w )
switch( (*anIt).myValue.type() )
{
case QVariant::Int:
{
SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i );
sb->setValue( (*anIt).myValue.toInt() );
connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
w = sb;
}
break;
case QVariant::Double:
{
SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i );
sb->setValue( (*anIt).myValue.toDouble() );
connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
w = sb;
}
break;
case QVariant::String:
{
if((*anIt).isVariable) {
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
QString aVar = (*anIt).myValue.toString();
if(aStudy->IsInteger(aVar.toLatin1().constData())){
SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i );
sb->setText( aVar );
connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
w = sb;
}
else if(aStudy->IsReal(aVar.toLatin1().constData())){
SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i );
sb->setText( aVar );
connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
w = sb;
}
}
else {
QLineEdit* le = new QLineEdit( GroupC1 );
le->setObjectName( (*anIt).myName );
attuneStdWidget( le, i );
le->setText( (*anIt).myValue.toString() );
connect( le, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
w = le;
}
}
break;
}
if( w )
{
GroupC1Layout->addWidget( w, i, 1 );
changeWidgets().append( w );
}
}
return fr;
}
| QString SMESHGUI_GenericHypothesisCreator::caption | ( | ) | const [protected, virtual] |
Reimplemented in StdMeshersGUI_StdHypothesisCreator.
Definition at line 468 of file SMESHGUI_Hypotheses.cxx.
Referenced by editHypothesis().
{
return QString();
}
| SMESHGUI_GenericHypothesisCreator::ListOfWidgets & SMESHGUI_GenericHypothesisCreator::changeWidgets | ( | ) | [protected] |
Definition at line 449 of file SMESHGUI_Hypotheses.cxx.
References myParamWidgets.
Referenced by buildStdFrame(), and onDialogFinished().
{
return myParamWidgets;
}
| bool SMESHGUI_GenericHypothesisCreator::checkParams | ( | QString & | msg | ) | const [virtual] |
Reimplemented in StdMeshersGUI_NbSegmentsCreator, and StdMeshersGUI_StdHypothesisCreator.
Definition at line 493 of file SMESHGUI_Hypotheses.cxx.
References widgets().
Referenced by SMESHGUI_HypothesisDlg.accept(), StdMeshersGUI_StdHypothesisCreator.checkParams(), and StdMeshersGUI_NbSegmentsCreator.checkParams().
{
bool ok = true;
ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
for( ; anIt!=aLast; anIt++ )
{
if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
{
SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
ok = sb->isValid( msg, true ) && ok;
}
else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
{
SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
ok = sb->isValid( msg, true ) && ok;
}
}
return ok;
}
| void SMESHGUI_GenericHypothesisCreator::create | ( | bool | isAlgo, |
| const QString & | theHypName, | ||
| QWidget * | theParent, | ||
| QObject * | obj, | ||
| const QString & | slot | ||
| ) |
Definition at line 82 of file SMESHGUI_Hypotheses.cxx.
References SMESH.CreateHypothesis(), editHypothesis(), hypType(), MESSAGE, and myIsCreate.
{
MESSAGE( "Creation of hypothesis" );
myIsCreate = true;
// Create hypothesis/algorithm
if (isAlgo) {
SMESH::SMESH_Hypothesis_var anAlgo =
SMESH::CreateHypothesis( hypType(), theHypName, isAlgo );
#ifdef WITHGENERICOBJ
if (!CORBA::is_nil(anAlgo))
anAlgo->UnRegister();
#endif
}
else {
SMESH::SMESH_Hypothesis_var aHypothesis =
SMESH::CreateHypothesis( hypType(), theHypName, false );
editHypothesis( aHypothesis.in(), theHypName, theParent, obj, slot );
#ifdef WITHGENERICOBJ
if (!CORBA::is_nil(aHypothesis))
aHypothesis->UnRegister();
#endif
}
}
| void SMESHGUI_GenericHypothesisCreator::create | ( | SMESH::SMESH_Hypothesis_ptr | initParamsHyp, |
| const QString & | theHypName, | ||
| QWidget * | parent, | ||
| QObject * | obj, | ||
| const QString & | slot | ||
| ) |
Definition at line 73 of file SMESHGUI_Hypotheses.cxx.
References MESSAGE, and setInitParamsHypothesis().
Referenced by SMESHGUI_MeshOp.createHypothesis(), and SMESHGUI_MeshOp.getAlgo().
{
MESSAGE( "Creation of hypothesis with initial params" );
setInitParamsHypothesis( initParamsHyp );
create( false, theHypName, parent, obj, slot );
}
| QtxDialog * SMESHGUI_GenericHypothesisCreator::dlg | ( | ) | const [protected] |
Definition at line 454 of file SMESHGUI_Hypotheses.cxx.
References myDlg.
Referenced by StdMeshersGUI_NbSegmentsCreator.onValueChanged(), StdMeshersGUI_StdHypothesisCreator.retrieveParams(), StdMeshersGUI_NbSegmentsCreator.retrieveParams(), and StdMeshersGUI_StdHypothesisCreator.stdParams().
{
return myDlg;
}
| void SMESHGUI_GenericHypothesisCreator::edit | ( | SMESH::SMESH_Hypothesis_ptr | theHypothesis, |
| const QString & | theHypName, | ||
| QWidget * | theParent, | ||
| QObject * | obj, | ||
| const QString & | slot | ||
| ) |
Definition at line 110 of file SMESHGUI_Hypotheses.cxx.
References editHypothesis(), MESSAGE, and myIsCreate.
Referenced by StdMeshersGUI_LayerDistributionParamWdg.onEdit(), SMESHGUI_MeshOp.onEditHyp(), and SMESHGUI.OnGUIEvent().
{
if( CORBA::is_nil( theHypothesis ) )
return;
MESSAGE("Edition of hypothesis");
myIsCreate = false;
editHypothesis( theHypothesis, theHypName, theParent, obj, slot );
}
| void SMESHGUI_GenericHypothesisCreator::editHypothesis | ( | SMESH::SMESH_Hypothesis_ptr | h, |
| const QString & | theHypName, | ||
| QWidget * | theParent, | ||
| QObject * | obj, | ||
| const QString & | slot | ||
| ) | [private] |
Definition at line 124 of file SMESHGUI_Hypotheses.cxx.
References buildFrame(), caption(), finished(), SMESHGUI.GetSMESHGUI(), icon(), myDlg, myHypName, myHypo, onDialogFinished(), retrieveParams(), SMESHGUI_HypothesisDlg.setCustomFrame(), SMESHGUI_HypothesisDlg.setHIcon(), SMESHGUI_HypothesisDlg.setType(), and type().
Referenced by create(), and edit().
{
myHypName = theHypName;
myHypo = SMESH::SMESH_Hypothesis::_duplicate( h );
#ifdef WITHGENERICOBJ
myHypo->Register();
#endif
SMESHGUI_HypothesisDlg* Dlg = new SMESHGUI_HypothesisDlg( this, theParent );
connect( Dlg, SIGNAL( finished( int ) ), this, SLOT( onDialogFinished( int ) ) );
connect( this, SIGNAL( finished( int ) ), obj, slot.toLatin1().constData() );
connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalCloseAllDialogs() ), Dlg, SLOT( reject() ));
myDlg = Dlg;
QFrame* fr = buildFrame();
if( fr )
{
Dlg->setCustomFrame( fr );
Dlg->setWindowTitle( caption() );
Dlg->setObjectName( theHypName );
Dlg->setHIcon( icon() );
Dlg->setType( type() );
retrieveParams();
Dlg->show();
Dlg->resize( Dlg->minimumSizeHint() );
}
else
emit finished( QDialog::Accepted );
}
| void SMESHGUI_GenericHypothesisCreator.finished | ( | int | ) | [signal] |
Referenced by editHypothesis(), and onDialogFinished().
| QWidget * SMESHGUI_GenericHypothesisCreator::getCustomWidget | ( | const StdParam & | , |
| QWidget * | , | ||
| const int | |||
| ) | const [protected, virtual] |
Reimplemented in StdMeshersGUI_StdHypothesisCreator.
Definition at line 482 of file SMESHGUI_Hypotheses.cxx.
Referenced by buildStdFrame().
{
return 0;
}
| QString SMESHGUI_GenericHypothesisCreator.getMainShapeEntry | ( | ) | const |
Definition at line 72 of file SMESHGUI_Hypotheses.h.
Referenced by StdMeshersGUI_NbSegmentsCreator.buildFrame(), and StdMeshersGUI_StdHypothesisCreator.stdParams().
{ return myMainShapeEntry; }
| bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget | ( | StdParam & | , |
| QWidget * | |||
| ) | const [protected, virtual] |
Reimplemented in StdMeshersGUI_StdHypothesisCreator.
Definition at line 488 of file SMESHGUI_Hypotheses.cxx.
Referenced by getStdParamFromDlg().
{
return false;
}
| QString SMESHGUI_GenericHypothesisCreator.getShapeEntry | ( | ) | const |
Definition at line 69 of file SMESHGUI_Hypotheses.h.
Referenced by StdMeshersGUI_NbSegmentsCreator.buildFrame(), and StdMeshersGUI_StdHypothesisCreator.stdParams().
{ return myShapeEntry; }
| bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg | ( | ListOfStdParams & | params | ) | const [protected] |
Definition at line 321 of file SMESHGUI_Hypotheses.cxx.
References getParamFromCustomWidget(), SMESHGUI_GenericHypothesisCreator.StdParam.myName, SMESHGUI_GenericHypothesisCreator.StdParam.myValue, SMESH_AdvancedEditor.res, and widgets().
Referenced by StdMeshersGUI_StdHypothesisCreator.storeParams().
{
bool res = true;
StdParam item;
ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
for( ; anIt!=aLast; anIt++ )
{
item.myName = (*anIt)->objectName();
if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
{
SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
item.myValue = sb->value();
params.append( item );
}
else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
{
SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
item.myValue = sb->value();
params.append( item );
}
else if( (*anIt)->inherits( "QLineEdit" ) )
{
QLineEdit* line = ( QLineEdit* )( *anIt );
item.myValue = line->text();
params.append( item );
}
else if ( getParamFromCustomWidget( item, *anIt ))
{
params.append( item );
}
else
res = false;
}
return res;
}
| QStringList SMESHGUI_GenericHypothesisCreator::getVariablesFromDlg | ( | ) | const [protected, virtual] |
Definition at line 358 of file SMESHGUI_Hypotheses.cxx.
References widgets().
Referenced by StdMeshersGUI_StdHypothesisCreator.storeParams().
| bool SMESHGUI_GenericHypothesisCreator::hasInitParamsHypothesis | ( | ) | const [protected] |
Definition at line 429 of file SMESHGUI_Hypotheses.cxx.
References myInitParamsHypo.
{
return !CORBA::is_nil( myInitParamsHypo );
}
| QString SMESHGUI_GenericHypothesisCreator::helpPage | ( | ) | const [virtual] |
Definition at line 517 of file SMESHGUI_Hypotheses.cxx.
References hypType().
Referenced by SMESHGUI_HypothesisDlg.SMESHGUI_HypothesisDlg().
{
QString aHypType = hypType();
QString aHelpFileName = "";
if ( aHypType == "LocalLength" )
aHelpFileName = "a1d_meshing_hypo_page.html#average_length_anchor";
else if ( aHypType == "MaxLength" )
aHelpFileName = "a1d_meshing_hypo_page.html#max_length_anchor";
else if ( aHypType == "Arithmetic1D")
aHelpFileName = "a1d_meshing_hypo_page.html#arithmetic_1d_anchor";
else if ( aHypType == "FixedPoints1D")
aHelpFileName = "a1d_meshing_hypo_page.html#fixed_points_1d_anchor";
else if ( aHypType == "MaxElementArea")
aHelpFileName = "a2d_meshing_hypo_page.html#max_element_area_anchor";
else if ( aHypType == "MaxElementVolume")
aHelpFileName = "max_element_volume_hypo_page.html";
else if ( aHypType == "StartEndLength")
aHelpFileName = "a1d_meshing_hypo_page.html#start_and_end_length_anchor";
else if ( aHypType == "Deflection1D")
aHelpFileName = "a1d_meshing_hypo_page.html#deflection_1d_anchor";
else if ( aHypType == "AutomaticLength")
aHelpFileName = "a1d_meshing_hypo_page.html#automatic_length_anchor";
else if ( aHypType == "NumberOfSegments")
aHelpFileName = "a1d_meshing_hypo_page.html#number_of_segments_anchor";
else if ( aHypType == "ProjectionSource1D")
aHelpFileName = "projection_algos_page.html";
else if ( aHypType == "ProjectionSource2D")
aHelpFileName = "projection_algos_page.html";
else if ( aHypType == "ProjectionSource3D")
aHelpFileName = "projection_algos_page.html";
else if ( aHypType == "NumberOfLayers")
aHelpFileName = "radial_prism_algo_page.html";
else if ( aHypType == "NumberOfLayers2D")
aHelpFileName = "radial_quadrangle_1D2D_algo_page.html";
else if ( aHypType == "LayerDistribution")
aHelpFileName = "radial_prism_algo_page.html";
else if ( aHypType == "LayerDistribution2D")
aHelpFileName = "radial_quadrangle_1D2D_algo_page.html";
else if ( aHypType == "SegmentLengthAroundVertex")
aHelpFileName = "segments_around_vertex_algo_page.html";
else if ( aHypType == "QuadrangleParams")
aHelpFileName = "a2d_meshing_hypo_page.html#hypo_quad_params_anchor";
else if ( aHypType == "ViscousLayers")
aHelpFileName = "additional_hypo_page.html#viscous_layers_anchor";
else if ( aHypType == "ImportSource1D" || aHypType == "ImportSource2D")
aHelpFileName = "import_algos_page.html";
return aHelpFileName;
}
| QString SMESHGUI_GenericHypothesisCreator::hypName | ( | ) | const |
Definition at line 439 of file SMESHGUI_Hypotheses.cxx.
References myHypName.
Referenced by StdMeshersGUI_NbSegmentsCreator.readParamsFromHypo(), and StdMeshersGUI_StdHypothesisCreator.stdParams().
{
return myHypName;
}
| SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator::hypothesis | ( | ) | const [protected] |
Definition at line 401 of file SMESHGUI_Hypotheses.cxx.
References myHypo.
Referenced by StdMeshersGUI_NbSegmentsCreator.buildFrame(), buildStdFrame(), StdMeshersGUI_StdHypothesisCreator.storeParams(), and StdMeshersGUI_NbSegmentsCreator.storeParamsToHypo().
{
return myHypo;
}
| QString SMESHGUI_GenericHypothesisCreator::hypType | ( | ) | const |
Definition at line 434 of file SMESHGUI_Hypotheses.cxx.
References myHypType.
Referenced by StdMeshersGUI_StdHypothesisCreator.attuneStdWidget(), StdMeshersGUI_StdHypothesisCreator.caption(), StdMeshersGUI_StdHypothesisCreator.checkParams(), create(), StdMeshersGUI_StdHypothesisCreator.getParamFromCustomWidget(), helpPage(), StdMeshersGUI_StdHypothesisCreator.icon(), StdMeshersGUI_StdHypothesisCreator.onReject(), StdMeshersGUI_StdHypothesisCreator.retrieveParams(), setInitParamsHypothesis(), SMESHGUI_HypothesisDlg.SMESHGUI_HypothesisDlg(), StdMeshersGUI_StdHypothesisCreator.stdParams(), StdMeshersGUI_StdHypothesisCreator.storeParams(), StdMeshersGUI_StdHypothesisCreator.type(), and StdMeshersGUI_StdHypothesisCreator.valueChanged().
{
return myHypType;
}
| QPixmap SMESHGUI_GenericHypothesisCreator::icon | ( | ) | const [protected, virtual] |
Reimplemented in StdMeshersGUI_StdHypothesisCreator.
Definition at line 473 of file SMESHGUI_Hypotheses.cxx.
Referenced by editHypothesis().
{
return QPixmap();
}
| SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator::initParamsHypothesis | ( | const bool | strictly = false | ) | const [protected] |
Return hypothesis containing initial parameters.
| strictly | - if true, always return myInitParamsHypo, else, return myInitParamsHypo only in creation mode and if it is non-nil |
Definition at line 420 of file SMESHGUI_Hypotheses.cxx.
References isCreation(), myHypo, and myInitParamsHypo.
Referenced by StdMeshersGUI_NbSegmentsCreator.readParamsFromHypo(), StdMeshersGUI_StdHypothesisCreator.stdParams(), StdMeshersGUI_StdHypothesisCreator.storeParams(), and StdMeshersGUI_StdHypothesisCreator.valueChanged().
{
if ( strictly )
return myInitParamsHypo;
if ( !isCreation() || CORBA::is_nil( myInitParamsHypo ))
return myHypo;
return myInitParamsHypo;
}
| bool SMESHGUI_GenericHypothesisCreator::isCreation | ( | ) | const |
Definition at line 459 of file SMESHGUI_Hypotheses.cxx.
References myIsCreate.
Referenced by StdMeshersGUI_NbSegmentsCreator.buildFrame(), StdMeshersGUI_StdHypothesisCreator.getWidgetForParam(), initParamsHypothesis(), StdMeshersGUI_StdHypothesisCreator.stdParams(), StdMeshersGUI_StdHypothesisCreator.storeParams(), and StdMeshersGUI_NbSegmentsCreator.storeParamsToHypo().
{
return myIsCreate;
}
| void SMESHGUI_GenericHypothesisCreator::onDialogFinished | ( | int | result | ) | [private, virtual, slot] |
Definition at line 261 of file SMESHGUI_Hypotheses.cxx.
References _PTR(), changeWidgets(), finished(), SMESH.GetMeshesUsingAlgoOrHypothesis(), SMESHGUI.GetSMESHGUI(), SMESH.ModifiedMesh(), myDlg, myHypo, myInitParamsHypo, myIsCreate, SMESH_AdvancedEditor.res, and storeParams().
Referenced by editHypothesis().
{
bool res = result==QDialog::Accepted;
if( res )
{
/*QString paramValues = */storeParams();
// No longer needed since NoteBook appears and "Value" OB field shows names of variable
// if ( !paramValues.isEmpty() ) {
// if ( _PTR(SObject) SHyp = SMESH::FindSObject( myHypo ))
// SMESH::SetValue( SHyp, paramValues );
// }
}
changeWidgets().clear();
if( myIsCreate && !res )
{
//remove just created hypothesis
_PTR(SObject) aHypSObject = SMESH::FindSObject( myHypo );
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
if( aStudy && !aStudy->GetProperties()->IsLocked() )
{
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
aBuilder->RemoveObjectWithChildren( aHypSObject );
}
}
else if( !myIsCreate && res )
{
SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( myHypo );
if( listSOmesh.size() > 0 )
for( int i = 0; i < listSOmesh.size(); i++ )
{
_PTR(SObject) submSO = listSOmesh[i];
SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
if( !aSubMesh->_is_nil() )
aMesh = aSubMesh->GetFather();
_PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
}
}
SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
#ifdef WITHGENERICOBJ
myHypo->UnRegister();
#endif
myHypo = SMESH::SMESH_Hypothesis::_nil();
myInitParamsHypo = SMESH::SMESH_Hypothesis::_nil();
disconnect( myDlg, SIGNAL( finished( int ) ), this, SLOT( onDialogFinished( int ) ) );
myDlg->close();
//delete myDlg; since WA_DeleteOnClose==true
myDlg = 0;
emit finished( result );
}
| void SMESHGUI_GenericHypothesisCreator::onReject | ( | ) | [virtual] |
Reimplemented in StdMeshersGUI_StdHypothesisCreator.
Definition at line 513 of file SMESHGUI_Hypotheses.cxx.
Referenced by SMESHGUI_HypothesisDlg.reject().
{
}
| void SMESHGUI_GenericHypothesisCreator::onValueChanged | ( | ) | [protected, virtual, slot] |
Reimplemented in StdMeshersGUI_NbSegmentsCreator.
Definition at line 252 of file SMESHGUI_Hypotheses.cxx.
References valueChanged().
Referenced by buildStdFrame(), and StdMeshersGUI_StdHypothesisCreator.stdParams().
{
valueChanged( (QWidget*) sender() );
}
| virtual void SMESHGUI_GenericHypothesisCreator.retrieveParams | ( | ) | const [protected, pure virtual] |
Implemented in StdMeshersGUI_NbSegmentsCreator, and StdMeshersGUI_StdHypothesisCreator.
Referenced by editHypothesis().
| void SMESHGUI_GenericHypothesisCreator::setInitParamsHypothesis | ( | SMESH::SMESH_Hypothesis_ptr | hyp | ) |
Definition at line 67 of file SMESHGUI_Hypotheses.cxx.
References hypType(), and myInitParamsHypo.
Referenced by create(), and SMESHGUI_MeshOp.onEditHyp().
{
if ( !CORBA::is_nil( hyp ) && hypType() == hyp->GetName() )
myInitParamsHypo = SMESH::SMESH_Hypothesis::_duplicate( hyp );
}
| void SMESHGUI_GenericHypothesisCreator.setMainShapeEntry | ( | const QString & | theEntry | ) |
Definition at line 73 of file SMESHGUI_Hypotheses.h.
Referenced by SMESHGUI_MeshOp.createHypothesis(), and SMESHGUI_MeshOp.onEditHyp().
{ myMainShapeEntry = theEntry; }
| void SMESHGUI_GenericHypothesisCreator::setShapeEntry | ( | const QString & | theEntry | ) |
Definition at line 406 of file SMESHGUI_Hypotheses.cxx.
References myShapeEntry.
Referenced by SMESHGUI_MeshOp.createHypothesis(), and SMESHGUI_MeshOp.onEditHyp().
{
myShapeEntry = theEntry;
}
| bool SMESHGUI_GenericHypothesisCreator::stdParams | ( | ListOfStdParams & | ) | const [protected, virtual] |
Reimplemented in StdMeshersGUI_StdHypothesisCreator.
Definition at line 316 of file SMESHGUI_Hypotheses.cxx.
Referenced by buildStdFrame().
{
return false;
}
| QString SMESHGUI_GenericHypothesisCreator::stdParamValues | ( | const ListOfStdParams & | params | ) | [static, protected] |
Definition at line 371 of file SMESHGUI_Hypotheses.cxx.
Referenced by StdMeshersGUI_StdHypothesisCreator.storeParams().
{
QString valueStr = "";
ListOfStdParams::const_iterator param = params.begin(), aLast = params.end();
uint len0 = 0;
for( int i=0; param!=aLast; param++, i++ )
{
if ( valueStr.length() > len0 ) {
valueStr += "; ";
len0 = valueStr.length();
}
switch( (*param).myValue.type() )
{
case QVariant::Int:
valueStr += valueStr.number( (*param).myValue.toInt() );
break;
case QVariant::Double:
valueStr += valueStr.number( (*param).myValue.toDouble() );
break;
case QVariant::String:
valueStr += (*param).myValue.toString();
break;
default:
QVariant valCopy = (*param).myValue;
valueStr += valCopy.toString();
}
}
return valueStr;
}
| virtual QString SMESHGUI_GenericHypothesisCreator.storeParams | ( | ) | const [protected, pure virtual] |
Implemented in StdMeshersGUI_NbSegmentsCreator, and StdMeshersGUI_StdHypothesisCreator.
Referenced by onDialogFinished().
| QString SMESHGUI_GenericHypothesisCreator::type | ( | ) | const [protected, virtual] |
Reimplemented in StdMeshersGUI_StdHypothesisCreator.
Definition at line 478 of file SMESHGUI_Hypotheses.cxx.
Referenced by editHypothesis().
{
return QString();
}
| void SMESHGUI_GenericHypothesisCreator::valueChanged | ( | QWidget * | ) | [protected, virtual] |
Reimplemented in StdMeshersGUI_StdHypothesisCreator.
Definition at line 257 of file SMESHGUI_Hypotheses.cxx.
Referenced by buildStdFrame(), and onValueChanged().
{
}
| const SMESHGUI_GenericHypothesisCreator::ListOfWidgets & SMESHGUI_GenericHypothesisCreator::widgets | ( | ) | const [protected] |
Definition at line 444 of file SMESHGUI_Hypotheses.cxx.
References myParamWidgets.
Referenced by checkParams(), getStdParamFromDlg(), getVariablesFromDlg(), and StdMeshersGUI_StdHypothesisCreator.getWidgetForParam().
{
return myParamWidgets;
}
QtxDialog* SMESHGUI_GenericHypothesisCreator.myDlg [private] |
Definition at line 131 of file SMESHGUI_Hypotheses.h.
Referenced by dlg(), editHypothesis(), and onDialogFinished().
QString SMESHGUI_GenericHypothesisCreator.myHypName [private] |
Definition at line 127 of file SMESHGUI_Hypotheses.h.
Referenced by editHypothesis(), and hypName().
SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator.myHypo [private] |
Definition at line 126 of file SMESHGUI_Hypotheses.h.
Referenced by editHypothesis(), hypothesis(), initParamsHypothesis(), and onDialogFinished().
QString SMESHGUI_GenericHypothesisCreator.myHypType [private] |
Definition at line 128 of file SMESHGUI_Hypotheses.h.
Referenced by hypType().
SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator.myInitParamsHypo [private] |
Definition at line 126 of file SMESHGUI_Hypotheses.h.
Referenced by hasInitParamsHypothesis(), initParamsHypothesis(), onDialogFinished(), and setInitParamsHypothesis().
Definition at line 130 of file SMESHGUI_Hypotheses.h.
Referenced by create(), edit(), isCreation(), and onDialogFinished().
QString SMESHGUI_GenericHypothesisCreator.myMainShapeEntry [private] |
Definition at line 133 of file SMESHGUI_Hypotheses.h.
Definition at line 129 of file SMESHGUI_Hypotheses.h.
Referenced by changeWidgets(), and widgets().
QString SMESHGUI_GenericHypothesisCreator.myShapeEntry [private] |
Definition at line 132 of file SMESHGUI_Hypotheses.h.
Referenced by setShapeEntry().