}
meshDim = 0;
+ meshDimBG = 0;
// Mesh in
aMeshIn = new QGroupBox( tr( "MeshIn" ), this );
aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn );
int typeStepInField = it->second > 2 ? 2 : it->second ;
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
{
meshNameLineEdit->setText(aMeshName);
- ADAPTATION_MODE aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE; // and when dimesh 3 without 2D mesh?
- emit meshDimSignal(aMode);
+ valueAdaptation ();
+// ADAPTATION_MODE aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE; // and when dimesh 3 without 2D mesh?
+// emit meshDimSignal(aMode);
}
}
else
}
+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)
{
myFieldList = GetListeChamps(filePath, false);
valueLabel->hide();
dvalue->hide();
sizeMapField->setEnabled(true);
-
}
else
{
dvalue->show();
sizeMapField->setEnabled(false);
}
+ meshDimBG = 0;
+ valueAdaptation();
}
void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disableOther, int vmax)
{
meshNameLineEdit->clear();
selectOutMedFileLineEdit->clear();
}
-med_int SMESHGUI_MgAdaptArguments::getMeshDim() const
-{
- return meshDim;
-}
+// med_int SMESHGUI_MgAdaptArguments::getMeshDim() const
+// {
+// return meshDim;
+// }
QWidget* ItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const
{
bool editable = index.data( EDITABLE_ROLE ).toInt();
void MgAdaptAdvWidget::onMeshDimChanged(ADAPTATION_MODE aMode)
{
/* 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
* else BOTH
*/
std::string remove_extension(const std::string& filename);\r
\r
enum ADAPTATION_MODE{\r
- SURFACE, // surface adaption when meshDim == 2\r
- VOLUME, //\r
+ SURFACE,\r
+ VOLUME,\r
BOTH\r
};\r
//=================================================================================\r
SMESHGUI_MgAdaptArguments( QWidget* parent);\r
~SMESHGUI_MgAdaptArguments();\r
void setMode( const Mode, const SIZEMAP );\r
- med_int getMeshDim() const;\r
\r
QString* myFileInDir;\r
QString* myFileOutDir;\r
void onLastTimeStep(bool disableOther = false);\r
void onChosenTimeStep(bool disableOther = false, int vmax = 0);\r
void visibleTimeStepRankLabel(bool visible);\r
+ void valueAdaptation ();\r
\r
private:\r
\r
QString getMedFileName(bool avertir);\r
LightApp_SelectionMgr* selMgr ;\r
med_int meshDim;\r
+ med_int meshDimBG;\r
std::map<QString, int> myFieldList;\r
\r
};\r