mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 01:30:34 +05:00
Filtrage des options selon les dimensions
This commit is contained in:
parent
af3f09b843
commit
0b1452b15d
@ -487,6 +487,7 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent )
|
|||||||
}
|
}
|
||||||
|
|
||||||
meshDim = 0;
|
meshDim = 0;
|
||||||
|
meshDimBG = 0;
|
||||||
// Mesh in
|
// Mesh in
|
||||||
aMeshIn = new QGroupBox( tr( "MeshIn" ), this );
|
aMeshIn = new QGroupBox( tr( "MeshIn" ), this );
|
||||||
aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn );
|
aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn );
|
||||||
@ -701,6 +702,10 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton()
|
|||||||
int typeStepInField = it->second > 2 ? 2 : it->second ;
|
int typeStepInField = it->second > 2 ? 2 : it->second ;
|
||||||
timeStepGroupChanged(typeStepInField, false);
|
timeStepGroupChanged(typeStepInField, false);
|
||||||
}
|
}
|
||||||
|
// Dimension du maillage de fonds
|
||||||
|
MEDCoupling::MCAuto<MEDCoupling::MEDFileData> mfd = MEDCoupling::MEDFileData::New(fileName.toStdString());
|
||||||
|
meshDimBG = mfd->getMeshes()->getMeshAtPos(0)->getMeshDimension() ;
|
||||||
|
valueAdaptation ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -756,8 +761,9 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
meshNameLineEdit->setText(aMeshName);
|
meshNameLineEdit->setText(aMeshName);
|
||||||
ADAPTATION_MODE aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE; // and when dimesh 3 without 2D mesh?
|
valueAdaptation ();
|
||||||
emit meshDimSignal(aMode);
|
// ADAPTATION_MODE aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE; // and when dimesh 3 without 2D mesh?
|
||||||
|
// emit meshDimSignal(aMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -776,6 +782,20 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SMESHGUI_MgAdaptArguments::valueAdaptation()
|
||||||
|
{
|
||||||
|
ADAPTATION_MODE aMode ;
|
||||||
|
if ( meshDimBG < 3 )
|
||||||
|
{
|
||||||
|
aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aMode = ADAPTATION_MODE::BOTH;
|
||||||
|
}
|
||||||
|
emit meshDimSignal(aMode);
|
||||||
|
}
|
||||||
|
|
||||||
void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath)
|
void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath)
|
||||||
{
|
{
|
||||||
myFieldList = GetListeChamps(filePath, false);
|
myFieldList = GetListeChamps(filePath, false);
|
||||||
@ -886,7 +906,6 @@ void SMESHGUI_MgAdaptArguments::sizeMapDefChanged( int theSizeMap )
|
|||||||
valueLabel->hide();
|
valueLabel->hide();
|
||||||
dvalue->hide();
|
dvalue->hide();
|
||||||
sizeMapField->setEnabled(true);
|
sizeMapField->setEnabled(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -899,6 +918,8 @@ void SMESHGUI_MgAdaptArguments::sizeMapDefChanged( int theSizeMap )
|
|||||||
dvalue->show();
|
dvalue->show();
|
||||||
sizeMapField->setEnabled(false);
|
sizeMapField->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
meshDimBG = 0;
|
||||||
|
valueAdaptation();
|
||||||
}
|
}
|
||||||
void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disableOther, int vmax)
|
void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disableOther, int vmax)
|
||||||
{
|
{
|
||||||
@ -925,10 +946,10 @@ void SMESHGUI_MgAdaptArguments::clear()
|
|||||||
meshNameLineEdit->clear();
|
meshNameLineEdit->clear();
|
||||||
selectOutMedFileLineEdit->clear();
|
selectOutMedFileLineEdit->clear();
|
||||||
}
|
}
|
||||||
med_int SMESHGUI_MgAdaptArguments::getMeshDim() const
|
// med_int SMESHGUI_MgAdaptArguments::getMeshDim() const
|
||||||
{
|
// {
|
||||||
return meshDim;
|
// return meshDim;
|
||||||
}
|
// }
|
||||||
QWidget* ItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const
|
QWidget* ItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
bool editable = index.data( EDITABLE_ROLE ).toInt();
|
bool editable = index.data( EDITABLE_ROLE ).toInt();
|
||||||
@ -1149,7 +1170,7 @@ void MgAdaptAdvWidget::_onWorkingDirectoryPushButton()
|
|||||||
void MgAdaptAdvWidget::onMeshDimChanged(ADAPTATION_MODE aMode)
|
void MgAdaptAdvWidget::onMeshDimChanged(ADAPTATION_MODE aMode)
|
||||||
{
|
{
|
||||||
/* default adaptation mode
|
/* default adaptation mode
|
||||||
* assume that if meshDim == 2 -->adaptation surface
|
* assume that if meshDim == 2 and no 3D backgrounmesh-->adaptation surface
|
||||||
* if meshDim == 3 and if there is not 2D mesh -->VOLUME
|
* if meshDim == 3 and if there is not 2D mesh -->VOLUME
|
||||||
* else BOTH
|
* else BOTH
|
||||||
*/
|
*/
|
||||||
|
@ -103,8 +103,8 @@ QString lireNomMaillage(QString aFile, med_int& meshDim);
|
|||||||
std::string remove_extension(const std::string& filename);
|
std::string remove_extension(const std::string& filename);
|
||||||
|
|
||||||
enum ADAPTATION_MODE{
|
enum ADAPTATION_MODE{
|
||||||
SURFACE, // surface adaption when meshDim == 2
|
SURFACE,
|
||||||
VOLUME, //
|
VOLUME,
|
||||||
BOTH
|
BOTH
|
||||||
};
|
};
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -164,7 +164,6 @@ public:
|
|||||||
SMESHGUI_MgAdaptArguments( QWidget* parent);
|
SMESHGUI_MgAdaptArguments( QWidget* parent);
|
||||||
~SMESHGUI_MgAdaptArguments();
|
~SMESHGUI_MgAdaptArguments();
|
||||||
void setMode( const Mode, const SIZEMAP );
|
void setMode( const Mode, const SIZEMAP );
|
||||||
med_int getMeshDim() const;
|
|
||||||
|
|
||||||
QString* myFileInDir;
|
QString* myFileInDir;
|
||||||
QString* myFileOutDir;
|
QString* myFileOutDir;
|
||||||
@ -239,12 +238,14 @@ private slots:
|
|||||||
void onLastTimeStep(bool disableOther = false);
|
void onLastTimeStep(bool disableOther = false);
|
||||||
void onChosenTimeStep(bool disableOther = false, int vmax = 0);
|
void onChosenTimeStep(bool disableOther = false, int vmax = 0);
|
||||||
void visibleTimeStepRankLabel(bool visible);
|
void visibleTimeStepRankLabel(bool visible);
|
||||||
|
void valueAdaptation ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QString getMedFileName(bool avertir);
|
QString getMedFileName(bool avertir);
|
||||||
LightApp_SelectionMgr* selMgr ;
|
LightApp_SelectionMgr* selMgr ;
|
||||||
med_int meshDim;
|
med_int meshDim;
|
||||||
|
med_int meshDimBG;
|
||||||
std::map<QString, int> myFieldList;
|
std::map<QString, int> myFieldList;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user