//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// Partitioning/decimation module for the SALOME v3.2 platform
+// File: MULTIPR.idl
+// Interface CORBA for the MULTIPR module
+// Author: Olivier LE ROUX - CS, Virtual Reality Dpt
+// Date: 01/2007
-// Partitioning/decimation module for the SALOME v3.2 platform
-// MULTIPR.idl
-// Interface CORBA for the MULTIPR module
-// Author: Olivier LE ROUX - CS, Virtual Reality Dpt
-// Date: 01/2007
-//
#ifndef __MULTIPR_INTERFACE_CORBA__
#define __MULTIPR_INTERFACE_CORBA__
interface MULTIPR_Obj : SALOME::GenericObj
{
- //---------------------------------------------------------------------
- // Basic accessors/mutators
- //--------------------------------------------------------------------
-
- /*!
- * Reset the object.
- */
- void reset();
-
- /*!
- * Return true iff this obj represents a valid sequential MED file.
- */
- boolean isValidSequentialMEDFile();
-
- /*!
- * Return true iff this obj represents a valid distributed MED file.
- */
- boolean isValidDistributedMEDFile();
-
- /*!
- * Return the name of the associated MED file.
- */
- string getFilename()
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Return the name of the associated sequential MED file (for a distributed MED file).
- */
- string getSeqFilename()
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Set the mesh to be partitionned/decimated.
- * Assume sequential MED file.
- */
- void setMesh(in string meshName)
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Set the boxing parameter used for decimation (100 by default).
- */
- void setBoxing(in long boxing)
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Return the list of meshes contained in the associated MED file.
- */
- string_array getMeshes()
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Return the list of fields contained in the current mesh of the associated MED file.
- */
- string_array getFields(in string pPartList)
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Return the number of iterations for a given field.
- */
- long getTimeStamps(in string pPartList, in string fieldName)
- raises (SALOME::SALOME_Exception);
+ //---------------------------------------------------------------------
+ // Basic accessors/mutators
+ //--------------------------------------------------------------------
+
+ /*!
+ * Reset the object.
+ */
+ void reset();
+
+ /*!
+ * Return true iff this obj represents a valid sequential MED file.
+ */
+ boolean isValidSequentialMEDFile();
+
+ /*!
+ * Return true iff this obj represents a valid distributed MED file.
+ */
+ boolean isValidDistributedMEDFile();
+
+ /*!
+ * Return the name of the associated MED file.
+ */
+ string getFilename()
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Return the name of the associated sequential MED file (for a distributed MED file).
+ */
+ string getSeqFilename()
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Set the mesh to be partitionned/decimated.
+ * Assume sequential MED file.
+ */
+ void setMesh(in string meshName)
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Set the boxing parameter used for decimation (100 by default).
+ */
+ void setBoxing(in long boxing)
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Return the list of meshes contained in the associated MED file.
+ */
+ string_array getMeshes()
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Return the list of fields contained in the current mesh of the associated MED file.
+ */
+ string_array getFields(in string pPartList)
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Return the number of iterations for a given field.
+ */
+ long getTimeStamps(in string pPartList, in string fieldName)
+ raises (SALOME::SALOME_Exception);
/*!
* Get the minimum and maximum value of a part's field.
*/
void getFieldMinMax(in string pPartName, in string pFieldName, inout float pMin, inout float pMax)
raises (SALOME::SALOME_Exception);
-
- /*!
- * Return the name of all partitions.
- * Assume this object encapsulates a distributed MED file.
- */
- string_array getParts()
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Return all information about a part.
- * Assume this object encapsulates a distributed MED file.
- */
- string getPartInfo(in string partName)
- raises (SALOME::SALOME_Exception);
-
- //---------------------------------------------------------------------
- // Algorithms
- //--------------------------------------------------------------------
-
- /*!
- * Create a distributed MED file (v2.3) by extracting all the groups from the
- * current mesh of the current MED sequential MED file.
- * Assume:
- * - the file is in MED format and can be read using MED file v2.3.
- * - the file is sequential (not a distributed MED).
- * - the file only contains TETRA10 elements (dimension of space and mesh is 3).
- * - the file have no profil.
- * \return the name of each part.
- */
- string_array partitionneDomaine()
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Create a distributed MED file (V2.3) by splitting a group of a MED file
- * previously created by partitionneDomaine.
- * Assume:
- * - the file is a distributed MED file, previously created by partitionneDomaine()
- * (=> each part only contain 1 mesh, TETRA10 elements only)
- * - nbPart > 1
- * - partitionner METIS=0 or SCOTCH=1
- * \return the name of each part.
- */
- string_array partitionneGroupe(
- in string partName,
- in long nbParts,
- in long partitionner)
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Create 3 resolutions of the given part of a distributed MED file (V2.3).
- * Assume:
- * - the file is a distributed MED file, previously created by
- * partitionneDomaine() or partitionneGrain()
- * (=> each part only contain 1 mesh, TETRA10 elements only)
- */
- string_array decimePartition(
- in string partName,
- in string fieldName,
- in long fieldIt,
- in string filterName,
- in string filterParams)
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Return useful information to configure decimation parameters.
- * Depends on part, field and filter: generic operation.
- */
- string evalDecimationParams(
- in string partName,
- in string fieldName,
- in long fieldIt,
- in string filterName,
- in string filterParams)
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Remove all the parts starting with the given prefix from the distributed MED file.
- * Example: if prefixPartName="PART_4" => remove "PART_4" and all sub-parts "PART_4_*",
- * but not "PART41".
- * Assume this object encapsulates a distributed MED file.
- */
- void removeParts(in string prefixPartName)
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Get mesh statistics.
- */
- string getMEDInfo(
- in string partName)
- raises (SALOME::SALOME_Exception);
-
- //---------------------------------------------------------------------
- // i/o
- //--------------------------------------------------------------------
-
- /*!
- * Save the current distributed MED file to disk.
- */
- void save(in string path)
- raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Return the name of all partitions.
+ * Assume this object encapsulates a distributed MED file.
+ */
+ string_array getParts()
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Return all information about a part.
+ * Assume this object encapsulates a distributed MED file.
+ */
+ string getPartInfo(in string partName)
+ raises (SALOME::SALOME_Exception);
+
+ //---------------------------------------------------------------------
+ // Algorithms
+ //--------------------------------------------------------------------
+
+ /*!
+ * Create a distributed MED file (v2.3) by extracting all the groups from the
+ * current mesh of the current MED sequential MED file.
+ * Assume:
+ * - the file is in MED format and can be read using MED file v2.3.
+ * - the file is sequential (not a distributed MED).
+ * - the file only contains TETRA10 elements (dimension of space and mesh is 3).
+ * - the file have no profil.
+ * \return the name of each part.
+ */
+ string_array partitionneDomaine()
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Create a distributed MED file (V2.3) by splitting a group of a MED file
+ * previously created by partitionneDomaine.
+ * Assume:
+ * - the file is a distributed MED file, previously created by partitionneDomaine()
+ * (=> each part only contain 1 mesh, TETRA10 elements only)
+ * - nbPart > 1
+ * - partitionner METIS=0 or SCOTCH=1
+ * \return the name of each part.
+ */
+ string_array partitionneGroupe(
+ in string partName,
+ in long nbParts,
+ in long partitionner)
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Create 3 resolutions of the given part of a distributed MED file (V2.3).
+ * Assume:
+ * - the file is a distributed MED file, previously created by
+ * partitionneDomaine() or partitionneGrain()
+ * (=> each part only contain 1 mesh, TETRA10 elements only)
+ */
+ string_array decimePartition(
+ in string partName,
+ in string fieldName,
+ in long fieldIt,
+ in string filterName,
+ in string filterParams)
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Return useful information to configure decimation parameters.
+ * Depends on part, field and filter: generic operation.
+ */
+ string evalDecimationParams(
+ in string partName,
+ in string fieldName,
+ in long fieldIt,
+ in string filterName,
+ in string filterParams)
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Remove all the parts starting with the given prefix from the distributed MED file.
+ * Example: if prefixPartName="PART_4" => remove "PART_4" and all sub-parts "PART_4_*",
+ * but not "PART41".
+ * Assume this object encapsulates a distributed MED file.
+ */
+ void removeParts(in string prefixPartName)
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Get mesh statistics.
+ */
+ string getMEDInfo(
+ in string partName)
+ raises (SALOME::SALOME_Exception);
+
+ //---------------------------------------------------------------------
+ // i/o
+ //--------------------------------------------------------------------
+
+ /*!
+ * Save the current distributed MED file to disk.
+ */
+ void save(in string path)
+ raises (SALOME::SALOME_Exception);
/*!
- * Check save progress.
- * \return current save progress in percents.
- */
+ * Check save progress.
+ * \return current save progress in percents.
+ */
long getSaveProgress();
/*!
- * Reset save progress to zero.
- */
+ * Reset save progress to zero.
+ */
void resetSaveProgress();
}; // interface MULTIPR_Obj
//*************************************************************************
-// Interface of the %MULTIPR component; used to create MULTIPR_Obj object
+// Interface of the %MULTIPR component; used to create MULTIPR_Obj object
// and to define high level API.
//*************************************************************************
-interface MULTIPR_Gen : Engines::Component, SALOMEDS::Driver
+interface MULTIPR_Gen : Engines::EngineComponent, SALOMEDS::Driver
{
- /*!
- * Return the version of the MULTIPR library.
- */
- string getVersion()
- raises (SALOME::SALOME_Exception);
-
- //------------------------------------------------------------------------
- // High level API
- // Directly apply one of the 3 main operations of the MULTIPR module on a MED file
- //------------------------------------------------------------------------
-
- /*!
- * Create a distributed MED file (v2.3) by extracting all the groups from the
- * mesh of a sequential MED file.
- * High level function.
- */
- void partitionneDomaine(
- in string medFilename,
- in string meshName)
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Create a distributed MED file (V2.3) by splitting a group of a MED file
- * previously created by partitionneDomaine().
- * High level function.
- */
- void partitionneGroupe(
- in string medFilename,
- in string partName,
- in long nbParts,
- in long partitionner) // 0=METIS 1=SCOTCH
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Creates 3 resolutions of the given part of a distributed MED file (V2.3).
- * High level function.
- */
- void decimePartition(
- in string medFilename,
- in string partName,
- in string fieldName,
- in long fieldIt,
- in string filterName,
- in string filterParams)
- raises (SALOME::SALOME_Exception);
-
- //------------------------------------------------------------------------
- // Low level API
- // Create an object to encapsulate a MED file.
- //------------------------------------------------------------------------
-
- /*!
- * Create a MULTIPR_Obj object which encapsulate a MED file.
- */
- MULTIPR_Obj getObject(in string medFilename)
- raises (SALOME::SALOME_Exception);
+ /*!
+ * Return the version of the MULTIPR library.
+ */
+ string getVersion()
+ raises (SALOME::SALOME_Exception);
+
+ //------------------------------------------------------------------------
+ // High level API
+ // Directly apply one of the 3 main operations of the MULTIPR module on a MED file
+ //------------------------------------------------------------------------
+
+ /*!
+ * Create a distributed MED file (v2.3) by extracting all the groups from the
+ * mesh of a sequential MED file.
+ * High level function.
+ */
+ void partitionneDomaine(
+ in string medFilename,
+ in string meshName)
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Create a distributed MED file (V2.3) by splitting a group of a MED file
+ * previously created by partitionneDomaine().
+ * High level function.
+ */
+ void partitionneGroupe(
+ in string medFilename,
+ in string partName,
+ in long nbParts,
+ in long partitionner) // 0=METIS 1=SCOTCH
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Creates 3 resolutions of the given part of a distributed MED file (V2.3).
+ * High level function.
+ */
+ void decimePartition(
+ in string medFilename,
+ in string partName,
+ in string fieldName,
+ in long fieldIt,
+ in string filterName,
+ in string filterParams)
+ raises (SALOME::SALOME_Exception);
+
+ //------------------------------------------------------------------------
+ // Low level API
+ // Create an object to encapsulate a MED file.
+ //------------------------------------------------------------------------
+
+ /*!
+ * Create a MULTIPR_Obj object which encapsulate a MED file.
+ */
+ MULTIPR_Obj getObject(in string medFilename)
+ raises (SALOME::SALOME_Exception);
//------------------------------------------------------------------------
// Engine API
*/
SALOMEDS::Study GetCurrentStudy();
-
+
}; // interface MULTIPR_Gen
-
-
+
+
}; // module MULTIPR_ORB
#endif // __MULTIPR_INTERFACE_CORBA__
-
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
// Partitioning/decimation module for the SALOME v3.2 platform
-//
+
/**
* \file MULTIPR_GUI.cxx
*
* \brief see MULTIPR_GUI.h
*
* \author Olivier LE ROUX - CS, Virtual Reality Dpt
- *
+ *
* \date 01/2007
*/
-
+
//*****************************************************************************
// Includes section
//*****************************************************************************
if (myIsError) {
SUIT_MessageBox::critical((QWidget*) MULTIPR_GUI::desktop(),
QObject::tr("SAVE_DISTMED_ERROR"),
-// QString("Save distributed MED file error"),
+// QString("Save distributed MED file error"),
QObject::tr("WRIT_DISTMED_ERROR"));
// QString("Error while writing distributed MED file"));
}
if (!aGen)
{
SALOME_LifeCycleCORBA aLCC (SalomeApp_Application::namingService());
- Engines::Component_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","MULTIPR" );
+ Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","MULTIPR" );
aGen = MULTIPR_ORB::MULTIPR_Gen::_narrow(comp);
if (!CORBA::is_nil(aGen))
{
void MULTIPR_GUI::initialize(CAM_Application* app)
{
SalomeApp_Module::initialize(app);
-
+
GetMultiprGen(dynamic_cast<SalomeApp_Application*>( app ));
-
+
QWidget* aParent = (QWidget*) application()->desktop();
SUIT_ResourceMgr* aResourceMgr = app->resourceMgr();
-
+
//-------------------------------------------------------------------------
// create actions
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
QPixmap aPixmapImportFromMEDFile = aResourceMgr->loadPixmap("MULTIPR", tr("MULTIPR_ICON_IMPORT_MED"));
-
- createAction(
- ACTION_IMPORT_MED,
- tr("MULTIPR_TLT_IMPORT_FROM_MED_FILE"),
- QIcon(aPixmapImportFromMEDFile),
- tr("MULTIPR_MEN_IMPORT_FROM_MED_FILE"),
- tr("MULTIPR_STS_IMPORT_FROM_MED_FILE"),
+
+ createAction(
+ ACTION_IMPORT_MED,
+ tr("MULTIPR_TLT_IMPORT_FROM_MED_FILE"),
+ QIcon(aPixmapImportFromMEDFile),
+ tr("MULTIPR_MEN_IMPORT_FROM_MED_FILE"),
+ tr("MULTIPR_STS_IMPORT_FROM_MED_FILE"),
(Qt::CTRL + Qt::Key_I),
- aParent,
+ aParent,
false,
- this,
+ this,
SLOT(OnImportFromMEDFile()));
-
- createAction(
- ACTION_SPLIT,
- tr("MULTIPR_TLT_SPLIT"),
- QIcon(),
- tr("MULTIPR_MEN_SPLIT"),
- tr("MULTIPR_STS_SPLIT"),
+
+ createAction(
+ ACTION_SPLIT,
+ tr("MULTIPR_TLT_SPLIT"),
+ QIcon(),
+ tr("MULTIPR_MEN_SPLIT"),
+ tr("MULTIPR_STS_SPLIT"),
0,
- aParent,
+ aParent,
false,
- this,
+ this,
SLOT(OnPartition2()));
-
- createAction(
- ACTION_DECIMATE,
- tr("MULTIPR_TLT_DECIMATE"),
- QIcon(),
- tr("MULTIPR_MEN_DECIMATE"),
- tr("MULTIPR_STS_DECIMATE"),
+
+ createAction(
+ ACTION_DECIMATE,
+ tr("MULTIPR_TLT_DECIMATE"),
+ QIcon(),
+ tr("MULTIPR_MEN_DECIMATE"),
+ tr("MULTIPR_STS_DECIMATE"),
0,
- aParent,
+ aParent,
false,
- this,
+ this,
SLOT(OnDecimate()));
-
- createAction(
- ACTION_REMOVE,
- tr("MULTIPR_TLT_REMOVE"),
- QIcon(),
- tr("MULTIPR_MEN_REMOVE"),
- tr("MULTIPR_STS_REMOVE"),
+
+ createAction(
+ ACTION_REMOVE,
+ tr("MULTIPR_TLT_REMOVE"),
+ QIcon(),
+ tr("MULTIPR_MEN_REMOVE"),
+ tr("MULTIPR_STS_REMOVE"),
0,
- aParent,
+ aParent,
false,
- this,
+ this,
SLOT(OnRemove()));
-
+
QPixmap aPixmapSaveMEDFile = aResourceMgr->loadPixmap("MULTIPR", tr("MULTIPR_ICON_SAVE_MED"));
-
- createAction(
- ACTION_SAVE,
- tr("MULTIPR_TLT_SAVE"),
- QIcon(aPixmapSaveMEDFile),
- tr("MULTIPR_MEN_SAVE"),
- tr("MULTIPR_STS_SAVE"),
+
+ createAction(
+ ACTION_SAVE,
+ tr("MULTIPR_TLT_SAVE"),
+ QIcon(aPixmapSaveMEDFile),
+ tr("MULTIPR_MEN_SAVE"),
+ tr("MULTIPR_STS_SAVE"),
0,
- aParent,
+ aParent,
false,
- this,
+ this,
SLOT(OnSave()));
-
+
//-------------------------------------------------------------------------
// create menus
//-------------------------------------------------------------------------
createMenu(separator(), aMenuId, -1, 10);
aMenuId = createMenu(tr("MULTIPR_MEN_FILE_MULTIPR"), aMenuId, -1, 10);
createMenu(ACTION_IMPORT_MED, aMenuId);
-
+
aMenuId = createMenu(tr("MULTIPR_MEN_MULTIPR"), -1, -1, 30);
createMenu(ACTION_IMPORT_MED, aMenuId, 10);
createMenu(ACTION_SAVE, aMenuId, 10);
createMenu(ACTION_SPLIT, aMenuId, 10);
createMenu(ACTION_DECIMATE, aMenuId, 10);
createMenu(ACTION_REMOVE, aMenuId, 10);
-
+
//-------------------------------------------------------------------------
// create toolbars
//-------------------------------------------------------------------------
int aToolId = createTool(tr("MULTIPR_TOOL_MULTIPR"));
createTool(ACTION_IMPORT_MED, aToolId);
createTool(ACTION_SAVE, aToolId);
-
+
//-------------------------------------------------------------------------
// create popup menus
//-------------------------------------------------------------------------
mgr->insert( action(ACTION_DECIMATE), -1, -1, -1 );
mgr->insert( action(ACTION_REMOVE), -1, -1, -1 );
mgr->insert( action(ACTION_SAVE), -1, -1, -1 );
-
+
QString aRule = "client='ObjectBrowser' and selcount>=1"; // $type in {'VISU::TMESH'}";
mgr->setRule(action(ACTION_SPLIT), aRule);
mgr->setRule(action(ACTION_DECIMATE), aRule);
mgr->setRule(action(ACTION_REMOVE), aRule);
mgr->setRule(action(ACTION_SAVE), aRule);
-
+
//-------------------------------------------------------------------------
// set progress dialog
//-------------------------------------------------------------------------
//MULTIPR_GUI_ProgressCallbackDlg* progressDlg =
// new MULTIPR_GUI_ProgressCallbackDlg(application()->desktop());
//multipr::gProgressCallback = progressDlg;
-
+
//MULTIPR_GUI_EmptyMeshCallbackDlg* emptyMeshDlg =
// new MULTIPR_GUI_EmptyMeshCallbackDlg(application()->desktop());
//multipr::gEmptyMeshCallback = emptyMeshDlg;
void MULTIPR_GUI::selected(QStringList& entries, const bool multiple)
{
LightApp_SelectionMgr* mgr = getApp()->selectionMgr();
-
+
if(!mgr) return;
-
+
SUIT_DataOwnerPtrList anOwnersList;
mgr->selected(anOwnersList);
-
+
for (int i = 0 ; i < anOwnersList.size() ; i++)
{
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>(anOwnersList[i].get());
-
+
if (!entries.contains(owner->entry()))
{
entries.append(owner->entry());
}
-
+
if (!multiple)
break;
}
QStringList aFilter;
aFilter.append(tr("MULTIPR_FLT_MED_FILES"));
aFilter.append(tr("MULTIPR_FLT_ALL_FILES"));
-
+
SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg(
- (QWidget*) MULTIPR_GUI::desktop(),
- true,
+ (QWidget*) MULTIPR_GUI::desktop(),
+ true,
tr("") );
-
+
fd->setWindowTitle(tr("MULTIPR_MEN_IMPORT_FROM_MED_FILE"));
fd->setFilters(aFilter);
if (fd->exec() == QDialog::Rejected)
delete fd;
return;
}
-
+
QFileInfo aFileInfo(fd->selectedFile());
delete fd;
-
+
// Check the file name
if (!aFileInfo.exists())
return;
}
catch(...)
{
- SUIT_MessageBox::critical(
+ SUIT_MessageBox::critical(
(QWidget*) MULTIPR_GUI::desktop(),
- QObject::tr("IMPORT_MED_ERROR"),
-// "Import MED file error",
+ QObject::tr("IMPORT_MED_ERROR"),
+// "Import MED file error",
QObject::tr("INVALID_MED_FILE"));
-// "Invalid MED file (not recognized by MULTIPR)");
+// "Invalid MED file (not recognized by MULTIPR)");
}
QApplication::restoreOverrideCursor();
-
+
//if (mMULTIPRObj != NULL)
if (!CORBA::is_nil(mMULTIPRObj))
{
{
return;
}
-
- // do the partition.
+
+ // do the partition.
MULTIPR_GUI_Partition1Dlg* dialog = new MULTIPR_GUI_Partition1Dlg(this);
dialog->exec();
delete dialog;
// Now we need to save the file.
SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg(
- (QWidget*) MULTIPR_GUI::desktop(),
- true,
+ (QWidget*) MULTIPR_GUI::desktop(),
+ true,
tr("") );
-
+
fd->setWindowTitle(tr("Save distributed MED file - Destination directory"));
fd->setFileMode(QFileDialog::DirectoryOnly);
-
+
if (fd->exec() == QDialog::Rejected)
{
delete fd;
getApp()->updateObjectBrowser();
return;
}
-
+
QFileInfo aFileInfo(fd->selectedFile());
delete fd;
-
+
QString path = aFileInfo.filePath();
-
+
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
mMULTIPRObj->resetSaveProgress();
MULTIPR_GUI_SaveThread* a = new MULTIPR_GUI_SaveThread (this, mMULTIPRObj, path);
a->start();
-
+
// save progress
//mProgress = new MULTIPR_GUI_ProgressCallbackDlg (getApp()->desktop());
//mProgress->start("Save mesh", 100);
//mTimer->start(500); // 0.5 seconds timer
//QApplication::restoreOverrideCursor();
//getApp()->updateObjectBrowser();
-
+
}
{
return;
}
-
+
retrieveSelectedParts();
-
+
if (mSelectedParts.count() == 0)
{
- SUIT_MessageBox::warning(
+ SUIT_MessageBox::warning(
(QWidget*) MULTIPR_GUI::desktop(),
- QString("Split warning"),
+ QString("Split warning"),
QString("No parts selected"));
return;
}
-
+
if (!removeLowerResolution())
{
return;
}
-
+
MULTIPR_GUI_Partition2Dlg* dialog = new MULTIPR_GUI_Partition2Dlg(this);
dialog->exec();
delete dialog;
{
return;
}
-
+
retrieveSelectedParts();
-
+
if (mSelectedParts.count() == 0)
{
- SUIT_MessageBox::warning(
+ SUIT_MessageBox::warning(
(QWidget*) MULTIPR_GUI::desktop(),
- QString("Decimation warning"),
- QString("No parts selected"));
+ QString("Decimation warning"),
+ QString("No parts selected"));
return;
}
MULTIPR_ORB::string_array* listFields = this->getMULTIPRObj()->getFields(allParts.toLatin1());
if (listFields->length() == 0)
{
- SUIT_MessageBox::critical(
+ SUIT_MessageBox::critical(
(QWidget*) MULTIPR_GUI::desktop(),
- QObject::tr("DECIM_ERROR"),
-// "Decimation error",
+ QObject::tr("DECIM_ERROR"),
+// "Decimation error",
QObject::tr("NO_FIELD_ON_PART"));
// "No field for this part.",);
return ;
{
return;
}
-
+
retrieveSelectedParts();
-
+
if (mSelectedParts.count() == 0)
{
- SUIT_MessageBox::warning(
+ SUIT_MessageBox::warning(
(QWidget*) MULTIPR_GUI::desktop(),
- QString("Remove warning"),
- QString("No parts selected"));
+ QString("Remove warning"),
+ QString("No parts selected"));
return;
}
-
+
if (QMessageBox::question(
(QWidget*) MULTIPR_GUI::desktop(),
QString("Remove selected part(s)"),
}
catch(...)
{
- SUIT_MessageBox::critical(
+ SUIT_MessageBox::critical(
(QWidget*) MULTIPR_GUI::desktop(),
- QString("Remove error"),
- QString("Error while removing selected part(s)"));
+ QString("Remove error"),
+ QString("Error while removing selected part(s)"));
}
QApplication::restoreOverrideCursor();
{
//if (mMULTIPRObj == NULL) return false;
if (CORBA::is_nil(mMULTIPRObj)) return false;
-
+
MULTIPR_ORB::string_array* listParts = mMULTIPRObj->getParts();
for (int i=0 ; i<listParts->length() ; i++)
{
const char* strItem = (*listParts)[i];
- if (strcmp(strItem, partName) == 0)
+ if (strcmp(strItem, partName) == 0)
{
return true;
}
QString partNameMed = partName + "_MED";
const char* strPartNameLow = partNameLow.toLatin1();
const char* strPartNameMed = partNameMed.toLatin1();
-
+
if (isPartExist(strPartNameLow))
{
partNameLowerResolution.push_back(partNameLow);
cout << "Part to be removed: " << strPartNameLow << endl;
}
-
+
if (isPartExist(strPartNameMed))
{
partNameLowerResolution.push_back(partNameMed);
cout << "Part to be removed: " << strPartNameMed << endl;
}
}
-
+
if (partNameLowerResolution.count() > 0)
{
if (QMessageBox::question(
{
return false;
}
-
+
QApplication::setOverrideCursor(Qt::WaitCursor);
-
+
try
{
for (QStringList::const_iterator it = partNameLowerResolution.begin(),
cout << "Remove " << (const char*)partName.toLatin1() << endl;
mMULTIPRObj->removeParts(partName.toLatin1());
}
-
}
catch(...)
{
- SUIT_MessageBox::critical(
+ SUIT_MessageBox::critical(
(QWidget*) MULTIPR_GUI::desktop(),
QObject::tr("DEL_ERROR"),
-// "Remove error",
- QObject::tr("ERROR_DEL_PREV_RESULT"));
-// "Error while removing previous results",
+// "Remove error",
+ QObject::tr("ERROR_DEL_PREV_RESULT"));
+// "Error while removing previous results",
}
-
+
QApplication::restoreOverrideCursor();
-
+
getApp()->updateObjectBrowser();
getApp()->updateActions();
}
-
+
return true;
}
{
//static QPixmap icon = SUIT_Session::session()->resourceMgr()->loadPixmap("MULTIPR", QObject::tr("ICON_IMPORT_MED"), false);
return QPixmap();
-
+
}
mId = 0;
mPath = "";
mMEDFileName = "";
-
+
mTooltip = info;
-
+
// parse info to retrieve all the fields
char lMeshName[256];
int lId;
char lPartName[256];
char lPath[256];
char lMEDFileName[256];
-
- int ret = sscanf(info, "%s %d %s %s %s",
+
+ int ret = sscanf(info, "%s %d %s %s %s",
lMeshName,
&lId,
lPartName,
lPath,
lMEDFileName);
-
+
// number of read parameters should be 5
if (ret != 5) return;
-
+
mMeshName = lMeshName;
mId = lId;
mPath = lPath;
if (!aSAStudy) return;
MULTIPR_GUI_DataObject_Module* modelRoot = dynamic_cast<MULTIPR_GUI_DataObject_Module*>(root());
- if (!modelRoot)
- {
+ if (!modelRoot)
+ {
// root is not set yet
modelRoot = new MULTIPR_GUI_DataObject_Module(this, NULL, "MULTIPR");
setRoot(modelRoot);
int lId;
char lPartName[256];
char lPath[256];
- char lMEDFileName[256];
+ char lMEDFileName[256];
// parse infos
- int ret = sscanf(strPartInfo0, "%s %d %s %s %s",
+ int ret = sscanf(strPartInfo0, "%s %d %s %s %s",
lMeshName,
&lId,
lPartName,
lPath,
lMEDFileName);
- if (ret != 5)
+ if (ret != 5)
{
cout << "MULTIPR: build() tree; error while parsing part info" << endl;
std::runtime_error("MULTIPR: build() tree; error while parsing part info");
char* strPartInfo = obj->getPartInfo(strItem);
// parse infos
- int ret = sscanf(strPartInfo, "%s %d %s %s %s",
+ int ret = sscanf(strPartInfo, "%s %d %s %s %s",
lMeshName,
&lId,
lPartName,
}
-extern "C"
+extern "C"
{
CAM_Module* createModule()
{