.. note::
Pour une référence à HOMARD, utiliser :
- G. Nicolas and T. Fouquet, Adaptive Mesh Refinement for Conformal Hexahedral Meshes, Finite Elements in Analysis and Design, Vol. 67, pp. 1-12, 2013, doi:10.1016/j.finel.2012.11.008
+ G. Nicolas and T. Fouquet, Adaptive Mesh Refinement for Conformal Hexahedral Meshes, Finite Elements in Analysis and Design, Vol. 67, pp. 1-12, 2013, doi:10.1016/j.finel.2012.11.008
`Acessible en cliquant ici <http://dx.doi.org/10.1016/j.finel.2012.11.008>`_ .
-
Quelques illustrations de maillage adaptés
""""""""""""""""""""""""""""""""""""""""""
.. index:: single: illustration
| .. index:: single: Delete |
| |
| **Delete()** |
-| Detruit le cas et toutes les itérations associées. |
-| Le fichier du maillage associé est conservé. |
+| Detruit le cas et toutes les itérations associées ainsi |
+| que tous les maillages produits. Le fichier du maillage |
+| initial associé est conservé. |
| |
| Retourne un entier : |
| * 0 : destruction réussie |
+---------------------------------------------------------------+
| .. index:: single: Delete |
| |
-| **Delete()** |
-| Detruit l'itération et toutes ses filles éventuelles. Les |
-| fichiers des maillages associés sont supprimés. |
+| **Delete(option)** |
+| Detruit l'itération et toutes ses filles éventuelles. |
+| |
+| - ``option`` : un entier précisant ce qui est fait des |
+| fichiers de maillage associés |
+| |
+| * 0 : les fichiers sont conservés |
+| * 1 : les fichiers sont détruits |
| |
| Retourne un entier : |
| * 0 : destruction réussie |
void InvalideBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception);
void InvalideHypo (in string HypoName) raises (SALOME::SALOME_Exception);
void InvalideIter (in string IterName) raises (SALOME::SALOME_Exception);
+ void InvalideIterOption (in string IterName, in long Option)
+ raises (SALOME::SALOME_Exception);
void InvalideZone (in string ZoneName) raises (SALOME::SALOME_Exception);
long DeleteBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception);
long DeleteCase(in string CaseName) raises (SALOME::SALOME_Exception);
long DeleteHypo(in string HypoName) raises (SALOME::SALOME_Exception);
- long DeleteIteration(in string IterName) raises (SALOME::SALOME_Exception);
- long DeleteIterationOption(in string IterName, in long Option)
+ long DeleteIteration(in string IterName, in long Option)
+ raises (SALOME::SALOME_Exception);
+ long DeleteIterationOption(in string IterName, in long Option1, in long Option2)
raises (SALOME::SALOME_Exception);
long DeleteZone (in string ZoneName) raises (SALOME::SALOME_Exception);
//
void PublishFileUnderIteration(in string IterName, in string FileName, in string Comment)
raises (SALOME::SALOME_Exception);
void PublishBoundaryUnderCase(in string CaseName, in string BoundaryName);
- void PublishResultInSmesh(in string FileName, in long IconeType)
+ void PublishResultInSmesh(in string FileName, in long Option)
raises (SALOME::SALOME_Exception);
};
void SetName(in string Name) raises (SALOME::SALOME_Exception);
string GetName() raises (SALOME::SALOME_Exception);
- long Delete() raises (SALOME::SALOME_Exception);
+ long Delete(in long Option) raises (SALOME::SALOME_Exception);
string GetDumpPython() raises (SALOME::SALOME_Exception);
/********************************************************************************
** Form generated from reading UI file 'CreateHypothesis.ui'
**
-** Created: Mon Jan 14 14:54:59 2013
+** Created: Thu Feb 28 13:29:51 2013
** by: Qt User Interface Compiler version 4.6.3
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
QRadioButton *RBUniforme;
QRadioButton *RBChamp;
QRadioButton *RBZone;
- QCheckBox *CBGroupe;
QGroupBox *GBUniform;
QGridLayout *gridLayout;
QRadioButton *RBUniDera;
QRadioButton *RBFieldAll;
QRadioButton *RBFieldChosen;
QTableWidget *TWField;
+ QCheckBox *CBGroupe;
QCheckBox *CBAdvanced;
QGroupBox *GBAdvancedOptions;
QGridLayout *gridLayout_1;
{
if (CreateHypothesis->objectName().isEmpty())
CreateHypothesis->setObjectName(QString::fromUtf8("CreateHypothesis"));
- CreateHypothesis->resize(770, 1453);
+ CreateHypothesis->resize(794, 1481);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
gridLayout_3->addWidget(GBTypeAdaptation, 1, 0, 1, 2);
- CBGroupe = new QCheckBox(CreateHypothesis);
- CBGroupe->setObjectName(QString::fromUtf8("CBGroupe"));
-
- gridLayout_3->addWidget(CBGroupe, 2, 0, 1, 2);
-
GBUniform = new QGroupBox(CreateHypothesis);
GBUniform->setObjectName(QString::fromUtf8("GBUniform"));
gridLayout = new QGridLayout(GBUniform);
SpinBox_RMuSigma->setObjectName(QString::fromUtf8("SpinBox_RMuSigma"));
SpinBox_RMuSigma->setEnabled(false);
SpinBox_RMuSigma->setDecimals(8);
- SpinBox_RMuSigma->setMinimum(0);
+ SpinBox_RMuSigma->setMinimum(-1e+12);
SpinBox_RMuSigma->setMaximum(1e+12);
SpinBox_RMuSigma->setSingleStep(0.1);
+ SpinBox_RMuSigma->setValue(3);
gridLayout3->addWidget(SpinBox_RMuSigma, 3, 1, 1, 1);
SpinBox_CMuSigma->setObjectName(QString::fromUtf8("SpinBox_CMuSigma"));
SpinBox_CMuSigma->setEnabled(false);
SpinBox_CMuSigma->setDecimals(8);
- SpinBox_CMuSigma->setMinimum(0);
+ SpinBox_CMuSigma->setMinimum(-1e+12);
SpinBox_CMuSigma->setMaximum(1e+12);
SpinBox_CMuSigma->setSingleStep(0.1);
+ SpinBox_CMuSigma->setValue(4);
gridLayout4->addWidget(SpinBox_CMuSigma, 3, 1, 1, 1);
gridLayout_3->addWidget(GBField, 7, 0, 1, 2);
+ CBGroupe = new QCheckBox(CreateHypothesis);
+ CBGroupe->setObjectName(QString::fromUtf8("CBGroupe"));
+
+ gridLayout_3->addWidget(CBGroupe, 2, 0, 1, 2);
+
CBAdvanced = new QCheckBox(CreateHypothesis);
CBAdvanced->setObjectName(QString::fromUtf8("CBAdvanced"));
RBUniforme->setText(QApplication::translate("CreateHypothesis", "Uniform", 0, QApplication::UnicodeUTF8));
RBChamp->setText(QApplication::translate("CreateHypothesis", "Driven by a field", 0, QApplication::UnicodeUTF8));
RBZone->setText(QApplication::translate("CreateHypothesis", "With geometrical zones", 0, QApplication::UnicodeUTF8));
- CBGroupe->setText(QApplication::translate("CreateHypothesis", "Filtering with groups", 0, QApplication::UnicodeUTF8));
GBUniform->setTitle(QApplication::translate("CreateHypothesis", "Uniform adaptation", 0, QApplication::UnicodeUTF8));
RBUniDera->setText(QApplication::translate("CreateHypothesis", "Coarsening", 0, QApplication::UnicodeUTF8));
RBUniRaff->setText(QApplication::translate("CreateHypothesis", "Refinement", 0, QApplication::UnicodeUTF8));
___qtablewidgetitem5->setText(QApplication::translate("CreateHypothesis", "Selection", 0, QApplication::UnicodeUTF8));
QTableWidgetItem *___qtablewidgetitem6 = TWField->horizontalHeaderItem(1);
___qtablewidgetitem6->setText(QApplication::translate("CreateHypothesis", "Field Name", 0, QApplication::UnicodeUTF8));
+ CBGroupe->setText(QApplication::translate("CreateHypothesis", "Filtering with groups", 0, QApplication::UnicodeUTF8));
CBAdvanced->setText(QApplication::translate("CreateHypothesis", "Advanced options", 0, QApplication::UnicodeUTF8));
GBAdvancedOptions->setTitle(QApplication::translate("CreateHypothesis", "Advanced options", 0, QApplication::UnicodeUTF8));
TLMinimalDiameter->setText(QApplication::translate("CreateHypothesis", "Minimal diameter", 0, QApplication::UnicodeUTF8));
<rect>
<x>0</x>
<y>0</y>
- <width>770</width>
- <height>1453</height>
+ <width>794</width>
+ <height>1481</height>
</rect>
</property>
<property name="sizePolicy">
</layout>
</widget>
</item>
- <item row="2" column="0" colspan="2">
- <widget class="QCheckBox" name="CBGroupe">
- <property name="text">
- <string>Filtering with groups</string>
- </property>
- </widget>
- </item>
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="GBUniform">
<property name="title">
<number>8</number>
</property>
<property name="minimum">
- <double>0.000000000000000</double>
+ <double>-1000000000000.000000000000000</double>
</property>
<property name="maximum">
<double>1000000000000.000000000000000</double>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
+ <property name="value">
+ <double>3.000000000000000</double>
+ </property>
</widget>
</item>
<item row="4" column="0">
<number>8</number>
</property>
<property name="minimum">
- <double>0.000000000000000</double>
+ <double>-1000000000000.000000000000000</double>
</property>
<property name="maximum">
<double>1000000000000.000000000000000</double>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
+ <property name="value">
+ <double>4.000000000000000</double>
+ </property>
</widget>
</item>
<item row="4" column="0">
</layout>
</widget>
</item>
+ <item row="2" column="0" colspan="2">
+ <widget class="QCheckBox" name="CBGroupe">
+ <property name="text">
+ <string>Filtering with groups</string>
+ </property>
+ </widget>
+ </item>
<item row="8" column="0" colspan="2">
<widget class="QCheckBox" name="CBAdvanced">
<property name="text">
/********************************************************************************
-** Form generated from reading ui file 'EditFile.ui'
+** Form generated from reading UI file 'EditFile.ui'
**
-** Created: Tue Mar 15 10:38:58 2011
-** by: Qt User Interface Compiler version 4.2.1
+** Created: Thu Feb 28 13:53:13 2013
+** by: Qt User Interface Compiler version 4.6.3
**
-** WARNING! All changes made in this file will be lost when recompiling ui file!
+** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef EDITFILE_H
#include <QtGui/QButtonGroup>
#include <QtGui/QGridLayout>
#include <QtGui/QGroupBox>
+#include <QtGui/QHeaderView>
#include <QtGui/QPushButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QTextBrowser>
#include <QtGui/QWidget>
+QT_BEGIN_NAMESPACE
+
class Ui_EditFile
{
public:
void setupUi(QWidget *EditFile)
{
- EditFile->setObjectName(QString::fromUtf8("EditFile"));
- gridLayout = new QGridLayout(EditFile);
- gridLayout->setSpacing(6);
- gridLayout->setMargin(9);
- gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
- spacerItem = new QSpacerItem(331, 49, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- gridLayout->addItem(spacerItem, 2, 1, 1, 1);
-
- GroupButtons = new QGroupBox(EditFile);
- GroupButtons->setObjectName(QString::fromUtf8("GroupButtons"));
- gridLayout1 = new QGridLayout(GroupButtons);
- gridLayout1->setSpacing(6);
- gridLayout1->setMargin(9);
- gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
- buttonPrint = new QPushButton(GroupButtons);
- buttonPrint->setObjectName(QString::fromUtf8("buttonPrint"));
-
- gridLayout1->addWidget(buttonPrint, 0, 1, 1, 1);
-
- buttonQuit = new QPushButton(GroupButtons);
- buttonQuit->setObjectName(QString::fromUtf8("buttonQuit"));
- buttonQuit->setAutoDefault(true);
- buttonQuit->setDefault(true);
- buttonQuit->setFlat(true);
-
- gridLayout1->addWidget(buttonQuit, 0, 0, 1, 1);
-
-
- gridLayout->addWidget(GroupButtons, 2, 0, 1, 1);
-
- spacerItem1 = new QSpacerItem(20, 14, QSizePolicy::Minimum, QSizePolicy::Expanding);
-
- gridLayout->addItem(spacerItem1, 1, 0, 1, 2);
-
- QTBEditFile = new QTextBrowser(EditFile);
- QTBEditFile->setObjectName(QString::fromUtf8("QTBEditFile"));
- QTBEditFile->setMinimumSize(QSize(530, 800));
- QFont font;
- font.setFamily(QString::fromUtf8("Courier New"));
- QTBEditFile->setFont(font);
-
- gridLayout->addWidget(QTBEditFile, 0, 0, 1, 2);
-
-
- retranslateUi(EditFile);
-
- QSize size(675, 901);
- size = size.expandedTo(EditFile->minimumSizeHint());
- EditFile->resize(size);
-
-
- QMetaObject::connectSlotsByName(EditFile);
+ if (EditFile->objectName().isEmpty())
+ EditFile->setObjectName(QString::fromUtf8("EditFile"));
+ EditFile->resize(675, 901);
+ gridLayout = new QGridLayout(EditFile);
+#ifndef Q_OS_MAC
+ gridLayout->setSpacing(6);
+#endif
+#ifndef Q_OS_MAC
+ gridLayout->setContentsMargins(9, 9, 9, 9);
+#endif
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ spacerItem = new QSpacerItem(331, 49, QSizePolicy::Expanding, QSizePolicy::Minimum);
+
+ gridLayout->addItem(spacerItem, 2, 1, 1, 1);
+
+ GroupButtons = new QGroupBox(EditFile);
+ GroupButtons->setObjectName(QString::fromUtf8("GroupButtons"));
+ gridLayout1 = new QGridLayout(GroupButtons);
+#ifndef Q_OS_MAC
+ gridLayout1->setSpacing(6);
+#endif
+#ifndef Q_OS_MAC
+ gridLayout1->setContentsMargins(9, 9, 9, 9);
+#endif
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
+ buttonPrint = new QPushButton(GroupButtons);
+ buttonPrint->setObjectName(QString::fromUtf8("buttonPrint"));
+ buttonPrint->setAutoDefault(false);
+ buttonPrint->setDefault(false);
+ buttonPrint->setFlat(false);
+
+ gridLayout1->addWidget(buttonPrint, 0, 1, 1, 1);
+
+ buttonQuit = new QPushButton(GroupButtons);
+ buttonQuit->setObjectName(QString::fromUtf8("buttonQuit"));
+ buttonQuit->setAutoDefault(false);
+ buttonQuit->setDefault(true);
+ buttonQuit->setFlat(false);
+
+ gridLayout1->addWidget(buttonQuit, 0, 0, 1, 1);
+
+
+ gridLayout->addWidget(GroupButtons, 2, 0, 1, 1);
+
+ spacerItem1 = new QSpacerItem(20, 14, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ gridLayout->addItem(spacerItem1, 1, 0, 1, 2);
+
+ QTBEditFile = new QTextBrowser(EditFile);
+ QTBEditFile->setObjectName(QString::fromUtf8("QTBEditFile"));
+ QTBEditFile->setMinimumSize(QSize(530, 800));
+ QFont font;
+ font.setFamily(QString::fromUtf8("Courier New"));
+ QTBEditFile->setFont(font);
+
+ gridLayout->addWidget(QTBEditFile, 0, 0, 1, 2);
+
+
+ retranslateUi(EditFile);
+
+ QMetaObject::connectSlotsByName(EditFile);
} // setupUi
void retranslateUi(QWidget *EditFile)
{
- EditFile->setWindowTitle(QApplication::translate("EditFile", "Edit a file", 0, QApplication::UnicodeUTF8));
- GroupButtons->setTitle(QString());
- buttonPrint->setText(QApplication::translate("EditFile", "Print", 0, QApplication::UnicodeUTF8));
- buttonQuit->setText(QApplication::translate("EditFile", "Quit", 0, QApplication::UnicodeUTF8));
- Q_UNUSED(EditFile);
+ EditFile->setWindowTitle(QApplication::translate("EditFile", "Edit a file", 0, QApplication::UnicodeUTF8));
+ GroupButtons->setTitle(QString());
+ buttonPrint->setText(QApplication::translate("EditFile", "Print", 0, QApplication::UnicodeUTF8));
+ buttonQuit->setText(QApplication::translate("EditFile", "Quit", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
class EditFile: public Ui_EditFile {};
} // namespace Ui
+QT_END_NAMESPACE
+
#endif // EDITFILE_H
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>EditFile</class>
- <widget class="QWidget" name="EditFile" >
- <property name="geometry" >
+ <widget class="QWidget" name="EditFile">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<height>901</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Edit a file</string>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="2" column="1" >
+ <item row="2" column="1">
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>331</width>
<height>49</height>
</property>
</spacer>
</item>
- <item row="2" column="0" >
- <widget class="QGroupBox" name="GroupButtons" >
- <property name="title" >
+ <item row="2" column="0">
+ <widget class="QGroupBox" name="GroupButtons">
+ <property name="title">
<string/>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="0" column="1" >
- <widget class="QPushButton" name="buttonPrint" >
- <property name="text" >
+ <item row="0" column="1">
+ <widget class="QPushButton" name="buttonPrint">
+ <property name="text">
<string>Print</string>
</property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ <property name="default">
+ <bool>false</bool>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
</widget>
</item>
- <item row="0" column="0" >
- <widget class="QPushButton" name="buttonQuit" >
- <property name="text" >
+ <item row="0" column="0">
+ <widget class="QPushButton" name="buttonQuit">
+ <property name="text">
<string>Quit</string>
</property>
- <property name="autoDefault" >
- <bool>true</bool>
+ <property name="autoDefault">
+ <bool>false</bool>
</property>
- <property name="default" >
+ <property name="default">
<bool>true</bool>
</property>
- <property name="flat" >
- <bool>true</bool>
+ <property name="flat">
+ <bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
- <item row="1" column="0" colspan="2" >
+ <item row="1" column="0" colspan="2">
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>14</height>
</property>
</spacer>
</item>
- <item row="0" column="0" colspan="2" >
- <widget class="QTextBrowser" name="QTBEditFile" >
- <property name="minimumSize" >
+ <item row="0" column="0" colspan="2">
+ <widget class="QTextBrowser" name="QTBEditFile">
+ <property name="minimumSize">
<size>
<width>530</width>
<height>800</height>
</size>
</property>
- <property name="font" >
+ <property name="font">
<font>
<family>Courier New</family>
</font>
else if (HOMARD_UTILS::isIter(obj))
{
try
- { homardGen->DeleteIteration(_ObjectName.toStdString().c_str()); }
+ { homardGen->DeleteIteration(_ObjectName.toStdString().c_str(), 1); }
catch( SALOME::SALOME_Exception& S_ex )
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
if ((obj) and ((HOMARD_UTILS::isFilelog(obj) or HOMARD_UTILS::isFileSummary(obj))))
{
MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ;
- aDlg->show();
+ if ( aDlg->_codret == 0 ) { aDlg->show(); }
}
break;
}
<source>HOM_SELECT_FILE_2</source>
<translation>Select only one file.</translation>
</message>
+ <message>
+ <source>HOM_SELECT_FILE_3</source>
+ <translation>This file cannot be opened.</translation>
+ </message>
<message>
<source>HOM_MED_FILE_1</source>
<translation>This MED file cannot be read.</translation>
<source>HOM_SELECT_FILE_2</source>
<translation>Sélectionner un seul fichier.</translation>
</message>
+ <message>
+ <source>HOM_SELECT_FILE_3</source>
+ <translation>Impossible d'ouvrir ce fichier.</translation>
+ </message>
<message>
<source>HOM_MED_FILE_1</source>
<translation>Ce fichier MED est illisible.</translation>
QString aFileName):
// QWidget(0),
Ui_EditFile(),
- _aFileName (aFileName)
+ _aFileName (aFileName),
+ _codret (0)
{
MESSAGE("Debut de MonEditFile " << aFileName.toStdString().c_str());
setupUi(this);
else
{
// GERALD -- QMESSAGE BOX
- MESSAGE( "EditText " << _aFileName.toStdString().c_str() << "est impossible a ouvrir ");
+ MESSAGE( "EditText " << _aFileName.toStdString().c_str() << " est impossible a ouvrir ");
+ QMessageBox::warning( 0, QObject::tr("HOM_WARNING"),
+ QObject::tr("HOM_SELECT_FILE_3") );
+ _codret = 1 ;
}
}
// ------------------------------------------------------------------------
HOMARD::HOMARD_Gen_var myHomardGen,
QString FileName );
~MonEditFile();
+ int _codret ;
protected :
void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Boolean EtatCalcul)
//=====================================================================================
{
- MESSAGE( "SetEtatIter : affectation de l etat " << EtatCalcul << " a l iteration " << nomIter );
+ MESSAGE( "SetEtatIter : affectation de l'etat '" << EtatCalcul << "' a l'iteration " << nomIter );
HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter];
if (CORBA::is_nil(myIteration))
{
};
// On commence par detruire toutes les iterations en partant de l'initiale et y compris elle
CORBA::String_var nomIter = myCase->GetIter0Name();
- CORBA::Long Option = 0 ;
- if ( DeleteIterationOption(nomIter, Option) != 0 )
+ CORBA::Long Option1 = 0 ;
+ CORBA::Long Option2 = 1 ;
+ if ( DeleteIterationOption(nomIter, Option1, Option2) != 0 )
{
return 2;
};
return 0 ;
}
//=============================================================================
-CORBA::Long HOMARD_Gen_i::DeleteIteration(const char* nomIter)
+CORBA::Long HOMARD_Gen_i::DeleteIteration(const char* nomIter, CORBA::Long Option)
{
+ // Option = 0 : On ne supprime pas le fichier du maillage associe
+ // Option = 1 : On supprime le fichier du maillage associe
+ // Option = 2 : On supprime le fichier du maillage associe, sauf si c'est la derniere iteration
// Pour detruire une iteration courante
- MESSAGE ( "DeleteIteration : nomIter = " << nomIter );
- CORBA::Long Option = 1 ;
- return DeleteIterationOption(nomIter, Option);
+ MESSAGE ( "DeleteIteration : nomIter = " << nomIter << ", avec option = " << Option );
+ CORBA::Long Option1 = 1 ;
+ return DeleteIterationOption(nomIter, Option1, Option);
}
//=============================================================================
-CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long Option)
+CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long Option1, CORBA::Long Option2)
{
- // Option = 0 : On autorise la destruction de l'iteration 0
- // Option = 1 : On interdit la destruction de l'iteration 0
- MESSAGE ( "DeleteIterationOption : nomIter = " << nomIter << ", avec option = " << Option );
+ // Option1 = 0 : On autorise la destruction de l'iteration 0
+ // Option1 = 1 : On interdit la destruction de l'iteration 0
+
+ // Option2 = 0 : On ne supprime pas le fichier du maillage associe
+ // Option2 = 1 : On supprime le fichier du maillage associe
+ MESSAGE ( "DeleteIterationOption : nomIter = " << nomIter << ", avec options = " << Option1<< ", " << Option2 );
HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter];
if (CORBA::is_nil(myIteration))
{
int numero = myIteration->GetNumber();
MESSAGE ( "DeleteIterationOption : numero = " << numero );
- if ( numero == 0 and Option == 1 )
+ if ( numero == 0 and Option1 == 1 )
{
SALOME::ExceptionStruct es;
es.type = SALOME::BAD_PARAM;
{
std::string nomIterFille = std::string((*maListe)[NumeIter]);
MESSAGE ( ".. appel recursif de DeleteIterationOption pour nomIter = " << nomIterFille.c_str() );
- DeleteIterationOption(nomIterFille.c_str(), Option);
+ DeleteIterationOption(nomIterFille.c_str(), Option1, Option2);
}
// On arrive ici pour une iteration sans fille
MESSAGE ( "Destruction effective de " << nomIter );
// On commence par invalider l'iteration pour faire le menage des dependances
- // et des publications dans SMESH
- InvalideIter(nomIter) ;
+ // et eventeullement du maillage associe
+ InvalideIterOption(nomIter, Option2) ;
// Retrait dans la descendance de l'iteration parent
if ( numero > 0 )
void HOMARD_Gen_i::InvalideIter(const char* nomIter)
{
MESSAGE("InvalideIter : nomIter = " << nomIter);
+ // Pour invalider totalement une iteration courante
+ CORBA::Long Option = 1 ;
+ return InvalideIterOption(nomIter, Option);
+}
+//=============================================================================
+void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option)
+{
+ // Option = 0 : On ne supprime pas le fichier du maillage associe
+ // Option = 1 : On supprime le fichier du maillage associe
+ MESSAGE ( "InvalideIterOption : nomIter = " << nomIter << ", avec option = " << Option );
HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter];
if (CORBA::is_nil(myIteration))
{
const char* nomDir = myIteration->GetDirName();
const char* nomFichier = myIteration->GetMeshFile();
std::string commande= "rm -rf " + std::string(dirCase) + "/" + std::string(nomDir);
- commande = commande + ";rm -rf " + std::string(nomFichier);
+ if ( Option == 1 ) { commande = commande + ";rm -rf " + std::string(nomFichier) ; }
MESSAGE ( "commande = " << commande );
if ((system(commande.c_str())) != 0)
{
return ;
}
// Suppression du maillage publie dans SMESH
- const char* MeshName = myIteration->GetMeshName();
+ const char* MeshName = myIteration->GetMeshName() ;
DeleteResultInSmesh(nomFichier, MeshName) ;
};
};
//=============================================================================
-void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long IconeType)
+void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
+// Option = 0 : fichier issu d'une importation
+// Option = 1 : fichier issu d'une execution HOMARD
{
- MESSAGE( "PublishResultInSmesh " << NomFich);
+ MESSAGE( "PublishResultInSmesh " << NomFich << ", avec Option = " << Option);
if (CORBA::is_nil(myCurrentStudy))
{
SALOME::ExceptionStruct es;
CORBA::String_var value=anAttr->Value();
if (strcmp((const char*)value,NomFich) == 0)
{
- // GERALD -- QMESSAGE BOX
- std::cerr << "fichier : "<< NomFich << " deja publie "<< std::endl;
+ MESSAGE ( "PublishResultInSmesh : le fichier " << NomFich << " est deja publie." );
+ // Pour un fichier importe, on ne republie pas
+ if ( Option == 0 )
+ {
return;
+ }
+ // Pour un fichier calcule, on commence par faire la depublication
+ else
+ {
+ MESSAGE ( "PublishResultInSmesh : depublication" );
+ SALOMEDS::AttributeName_var anAttr2 = SALOMEDS::AttributeName::_narrow(aGAttr);
+ CORBA::String_var value2=anAttr2->Value();
+ const char* MeshName = value2 ;
+ MESSAGE ( "PublishResultInSmesh : depublication de " << MeshName );
+ DeleteResultInSmesh(NomFich, MeshName) ;
+ }
}
}
}
anAttr->SetValue(NomFich);
SALOMEDS::GenericAttribute_var aPixMap = aStudyBuilder->FindOrCreateAttribute(aSO, "AttributePixMap" );
SALOMEDS::AttributePixMap_var anAttr2 = SALOMEDS::AttributePixMap::_narrow(aPixMap);
-// IconeType = 0 : fichier issu d'une importation
-// IconeType = 1 : fichier issu d'une execution HOMARD
const char* icone ;
- if ( IconeType == 0 ) { icone = "mesh_tree_importedmesh.png" ; }
- else { icone = "mesh_tree_mesh.png" ; }
+ if ( Option == 0 ) { icone = "mesh_tree_importedmesh.png" ; }
+ else { icone = "mesh_tree_mesh.png" ; }
anAttr2->SetPixMap( icone );
}
void InvalideBoundary(const char* nomBoundary);
void InvalideHypo(const char* nomHypo);
void InvalideIter(const char* nomIter);
+ void InvalideIterOption(const char* nomIter, CORBA::Long Option);
void InvalideIterInfo(const char* nomIter);
void InvalideZone(const char* nomZone);
CORBA::Long DeleteBoundary(const char* nomBoundary);
CORBA::Long DeleteCase(const char* nomCas);
CORBA::Long DeleteHypo(const char* nomHypothesis);
- CORBA::Long DeleteIteration(const char* nomIter);
- CORBA::Long DeleteIterationOption(const char* nomIter, CORBA::Long Option);
+ CORBA::Long DeleteIteration(const char* nomIter, CORBA::Long Option);
+ CORBA::Long DeleteIterationOption(const char* nomIter, CORBA::Long Option1, CORBA::Long Option2);
CORBA::Long DeleteZone(const char* nomZone);
void AssociateIterHypo(const char* nomIter, const char* nomHypothesis);
CORBA::Boolean VerifieDir(const char* nomDir);
- void PublishResultInSmesh(const char* NomFich, CORBA::Long IconeType);
+ void PublishResultInSmesh(const char* NomFich, CORBA::Long Option);
void DeleteResultInSmesh(const char* NomFich, const char* MeshName);
void PublishFileUnderIteration(const char* NomIter, const char* NomFich,
const char* Commentaire);
return CORBA::string_dup( myHomardIteration->GetName().c_str() );
}
//=============================================================================
-CORBA::Long HOMARD_Iteration_i::Delete()
+CORBA::Long HOMARD_Iteration_i::Delete( CORBA::Long Option )
{
ASSERT( myHomardIteration );
char* IterName = GetName() ;
- MESSAGE ( "Delete : destruction de l'iteration " << IterName );
- return _gen_i->DeleteIteration(IterName) ;
+ MESSAGE ( "Delete : destruction de l'iteration " << IterName << ", Option = " << Option );
+ return _gen_i->DeleteIteration(IterName, Option) ;
}
//=============================================================================
char* HOMARD_Iteration_i::GetDumpPython()
void SetName( const char* Name );
char* GetName();
- CORBA::Long Delete();
+ CORBA::Long Delete( CORBA::Long Option );
char* GetDumpPython();
# Destruction
if ( iaux < n_boucle ) :
# Recursive destruction of the iterations
- error = Iter_1.Delete()
+ error = Iter_1.Delete(1)
if error :
error = 10*iaux + 3
break