Mesh* pMesh,
int pPosition)
{
- // debug
- //cout << "INSERT PARTS BEFORE: " << endl;
- //cout << (*this) << endl;
-
MeshDisPart* part = new MeshDisPart();
part->create(
{
mParts[i]->mId++;
}
-
- // debug
- //cout << "INSERT PARTS AFTER: " << endl;
- //cout << (*this) << endl;
}
void MeshDis::removeParts(const char* pPrefixPartName)
{
- // debug
- //cout << "REMOVE PARTS BEFORE: " << endl;
- //cout << (*this) << endl;
-
if (pPrefixPartName == NULL) throw NullArgumentException("", __FILE__, __LINE__);
char strPrefix[256];
// remove part which have the same name and all sub_parts
// e.g. if pPrefixPartName="PART_4" => remove "PART_4" and "PART_4_*", but not "PART41"
if ((strcmp(currentPart->getPartName(), pPrefixPartName) == 0) ||
- startWith(currentPart->getPartName(), strPrefix))
+ startsWith(currentPart->getPartName(), strPrefix))
{
mParts.erase(itPart);
delete currentPart;
}
}
-
- // debug
- //cout << "REMOVE PARTS AFTER: " << endl;
- //cout << (*this) << endl;
}
const char* pFilterParams)
{
MeshDisPart* part = findPart(pPartName);
- if (part == NULL) return "";
+ if (part == NULL)
+ {
+ return "";
+ }
try
{
}
multipr::DecimationFilter* filter = multipr::DecimationFilter::create(pFilterName);
- if (filter == NULL) return "";
+ if (filter == NULL)
+ {
+ return "";
+ }
multipr::DecimationFilterGradAvg* filterGrad = dynamic_cast<multipr::DecimationFilterGradAvg*>(filter);
}
catch(...)
{
- return "";
}
+
+ return "";
}
// read number of parts
int nbParts = atoi(charbuffer);
- //cout << "DBG: readDistributedMED: #parts=" << nbParts << endl;
+ //cout << "readDistributedMED: #parts=" << nbParts << endl;
//---------------------------------------------------------------------
// Read infos about sub-parts
//---------------------------------------------------------------------
fileMaster.close();
if (fileMaster.fail()) throw IOException("i/o error while closing MED master file", __FILE__, __LINE__);
- //cout << "DBG: readDistributedMED: close" << endl;
}
}
-bool multipr::startWith(const char* pStr, const char* pStrPrefix)
+bool multipr::startsWith(const char* pStr, const char* pStrPrefix)
{
- int lenStr = strlen(pStr);
-
int i = 0;
while ((pStr[i] != '\0') && (pStrPrefix[i] != '\0') && (pStr[i] == pStrPrefix[i]))
{
* \param pStrPrefix any valid C string ending with the char '\0'.
* \return true iff the given string starts by prefix.
*/
-bool startWith(const char* pStr, const char* pStrPrefix);
+bool startsWith(const char* pStr, const char* pStrPrefix);
/**
//-------------------------------------------------------------------------
// create actions
//-------------------------------------------------------------------------
- QPixmap aPixmapImportFromMEDFile = aResourceMgr->loadPixmap("MULTIPR", tr("ICON_IMPORT_MED"));
+ QPixmap aPixmapImportFromMEDFile = aResourceMgr->loadPixmap("MULTIPR", tr("MULTIPR_ICON_IMPORT_MED"));
createAction(
ACTION_IMPORT_MED,
- tr("TLT_IMPORT_FROM_MED_FILE"),
+ tr("MULTIPR_TLT_IMPORT_FROM_MED_FILE"),
QIconSet(aPixmapImportFromMEDFile),
- tr("MEN_IMPORT_FROM_MED_FILE"),
- tr("STS_IMPORT_FROM_MED_FILE"),
+ tr("MULTIPR_MEN_IMPORT_FROM_MED_FILE"),
+ tr("MULTIPR_STS_IMPORT_FROM_MED_FILE"),
(CTRL + Key_I),
aParent,
false,
createAction(
ACTION_SPLIT,
- tr("TLT_SPLIT"),
+ tr("MULTIPR_TLT_SPLIT"),
QIconSet(),
- tr("MEN_SPLIT"),
- tr("STS_SPLIT"),
+ tr("MULTIPR_MEN_SPLIT"),
+ tr("MULTIPR_STS_SPLIT"),
0,
aParent,
false,
createAction(
ACTION_DECIMATE,
- tr("TLT_DECIMATE"),
+ tr("MULTIPR_TLT_DECIMATE"),
QIconSet(),
- tr("MEN_DECIMATE"),
- tr("STS_DECIMATE"),
+ tr("MULTIPR_MEN_DECIMATE"),
+ tr("MULTIPR_STS_DECIMATE"),
0,
aParent,
false,
createAction(
ACTION_REMOVE,
- tr("TLT_REMOVE"),
+ tr("MULTIPR_TLT_REMOVE"),
QIconSet(),
- tr("MEN_REMOVE"),
- tr("STS_REMOVE"),
+ tr("MULTIPR_MEN_REMOVE"),
+ tr("MULTIPR_STS_REMOVE"),
0,
aParent,
false,
this,
SLOT(OnRemove()));
- QPixmap aPixmapSaveMEDFile = aResourceMgr->loadPixmap("MULTIPR", tr("ICON_SAVE_MED"));
+ QPixmap aPixmapSaveMEDFile = aResourceMgr->loadPixmap("MULTIPR", tr("MULTIPR_ICON_SAVE_MED"));
createAction(
ACTION_SAVE,
- tr("TLT_SAVE"),
+ tr("MULTIPR_TLT_SAVE"),
QIconSet(aPixmapSaveMEDFile),
- tr("MEN_SAVE"),
- tr("STS_SAVE"),
+ tr("MULTIPR_MEN_SAVE"),
+ tr("MULTIPR_STS_SAVE"),
0,
aParent,
false,
// create menus
//-------------------------------------------------------------------------
int aMenuId;
- aMenuId = createMenu(tr("MEN_FILE"), -1, -1);
+ aMenuId = createMenu(tr("MULTIPR_MEN_FILE"), -1, -1);
createMenu(separator(), aMenuId, -1, 10);
- aMenuId = createMenu(tr("MEN_FILE_MULTIPR"), aMenuId, -1, 10);
+ aMenuId = createMenu(tr("MULTIPR_MEN_FILE_MULTIPR"), aMenuId, -1, 10);
createMenu(ACTION_IMPORT_MED, aMenuId);
- aMenuId = createMenu(tr("MEN_MULTIPR"), -1, -1, 30);
+ 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);
//-------------------------------------------------------------------------
// create toolbars
//-------------------------------------------------------------------------
- int aToolId = createTool(tr("TOOL_MULTIPR"));
+ int aToolId = createTool(tr("MULTIPR_TOOL_MULTIPR"));
createTool(ACTION_IMPORT_MED, aToolId);
createTool(ACTION_SAVE, aToolId);
{
// Get file name
QStringList aFilter;
- aFilter.append(tr("FLT_MED_FILES"));
- aFilter.append(tr("FLT_ALL_FILES"));
+ aFilter.append(tr("MULTIPR_FLT_MED_FILES"));
+ aFilter.append(tr("MULTIPR_FLT_ALL_FILES"));
SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg(
this->application()->desktop(),
true,
- tr("USE_BUILD_PROGRESS") );
+ tr("MULTIPR_USE_BUILD_PROGRESS") );
- fd->setCaption(tr("MEN_IMPORT_FROM_MED_FILE"));
+ fd->setCaption(tr("MULTIPR_MEN_IMPORT_FROM_MED_FILE"));
fd->setFilters(aFilter);
fd->exec();
QFileInfo aFileInfo(fd->selectedFile());
getApp()->desktop(),
"Import MED file error",
"Invalid MED file (not recognized by MULTIPR)",
- tr("OK") );
+ tr("MULTIPR_OK") );
}
QApplication::restoreOverrideCursor();
getApp()->desktop(),
"Split warning",
"No parts selected",
- tr("OK") );
+ tr("MULTIPR_OK") );
return;
}
getApp()->desktop(),
"Decimation warning",
"No parts selected",
- tr("OK") );
+ tr("MULTIPR_OK") );
return;
}
getApp()->desktop(),
"Remove warning",
"No parts selected",
- tr("OK") );
+ tr("MULTIPR_OK") );
return;
}
getApp()->desktop(),
"Remove error",
"Error while removing selected part(s)",
- tr("OK") );
+ tr("MULTIPR_OK") );
}
QApplication::restoreOverrideCursor();
getApp()->desktop(),
"Save distributed MED file error",
"Error while writing distributed MED file",
- tr("OK") );
+ tr("MULTIPR_OK") );
}
QApplication::restoreOverrideCursor();
#include <SalomeApp_Module.h>
#include <LightApp_DataObject.h>
#include <LightApp_DataModel.h>
-#include <LightApp_RootObject.h>
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(MULTIPR)
-#include <qdialog.h>
-#include <qprogressdialog.h>
-#include <qstring.h>
-#include <qvariant.h>
-
#include "MULTIPR_ProgressCallback.hxx"
Q_OBJECT
public:
+
MULTIPR_GUI();
- void initialize(CAM_Application*);
+ void initialize(CAM_Application*);
+
QString engineIOR() const;
- void windows(QMap<int, int>&) const;
+
+ void windows(QMap<int, int>&) const;
MULTIPR_ORB::MULTIPR_Obj_ptr getMULTIPRObj();
+
SalomeApp_Application* getAppli() const;
+
void selected(QStringList&, const bool);
static MULTIPR_ORB::MULTIPR_Gen_ptr InitMULTIPRGen(SalomeApp_Application*);
const QStringList& getSelectedParts() const { return mSelectedParts; }
public slots:
+
bool deactivateModule(SUIT_Study*);
bool activateModule(SUIT_Study*);
protected slots:
+
void OnImportFromMEDFile();
void OnPartition1();
void OnPartition2();
void OnRemove();
void OnSave();
+protected:
+
+ virtual CAM_DataModel* createDataModel();
+
void retrieveSelectedParts();
bool isPartExist(const char* partName);
bool removeLowerResolution();
-protected:
- virtual CAM_DataModel* createDataModel();
-
protected:
enum
};
private:
+
QString mMEDFileName;
QStringList mSelectedParts;
MULTIPR_ORB::MULTIPR_Obj_ptr mMULTIPRObj;
//*****************************************************************************
// Class MULTIPR_GUI_DataObject
+// To use Object Browser
//*****************************************************************************
class MULTIPR_GUI_DataObject : public LightApp_DataObject
{
public:
+
MULTIPR_GUI_DataObject(SUIT_DataObject* parent, const char* name);
virtual ~MULTIPR_GUI_DataObject();
virtual QString toolTip() const;
protected:
+
QString mName;
};
class MULTIPR_GUI_DataObject_Module : public MULTIPR_GUI_DataObject, public LightApp_ModuleObject
{
public:
+
MULTIPR_GUI_DataObject_Module(CAM_DataModel* dm, SUIT_DataObject* parent, const char* name);
virtual ~MULTIPR_GUI_DataObject_Module();
virtual QString name() const;
virtual QPixmap icon() const;
virtual QString toolTip() const;
-
-private:
};
class MULTIPR_GUI_DataObject_Mesh : public MULTIPR_GUI_DataObject
{
public:
+
MULTIPR_GUI_DataObject_Mesh(SUIT_DataObject* parent, const char* name);
virtual ~MULTIPR_GUI_DataObject_Mesh();
virtual QString entry() const;
virtual QPixmap icon() const;
virtual QString toolTip() const;
-
-private:
};
class MULTIPR_GUI_DataObject_Part : public MULTIPR_GUI_DataObject
{
public:
+
MULTIPR_GUI_DataObject_Part(SUIT_DataObject* parent, const char* name, const char* info);
virtual ~MULTIPR_GUI_DataObject_Part();
virtual QString toolTip() const;
protected:
+
QString mMeshName;
int mId;
QString mPath;
class MULTIPR_GUI_DataObject_Resolution : public MULTIPR_GUI_DataObject_Part
{
public:
+
MULTIPR_GUI_DataObject_Resolution(SUIT_DataObject* parent, const char* name, const char* info);
virtual ~MULTIPR_GUI_DataObject_Resolution();
virtual QString entry() const;
virtual QPixmap icon() const;
virtual QString toolTip() const;
-
-private:
};
class MULTIPR_GUI_DataModel : public LightApp_DataModel
{
public:
+
MULTIPR_GUI_DataModel(CAM_Module*);
virtual ~MULTIPR_GUI_DataModel();
protected:
+
virtual void build();
private:
+
MULTIPR_GUI* mMULTIPR_GUI;
};
#include "MULTIPR_GUI_Dlg.h"
#include "MULTIPR_GUI.h"
-#include "MULTIPR_Mesh.hxx"
-#include "MULTIPR_DecimationFilter.hxx"
// Salome Includes
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SalomeApp_Application.h>
-#include <SalomeApp_DataModel.h>
-#include <SalomeApp_Study.h>
#include <SalomeApp_CheckFileDlg.h>
-#include <LightApp_Study.h>
-#include <LightApp_DataModel.h>
-#include <LightApp_DataOwner.h>
#include <LightApp_SelectionMgr.h>
-#include <CAM_DataModel.h>
-#include <CAM_Module.h>
#include <SALOME_LifeCycleCORBA.hxx>
-#include <QtxPopupMgr.h>
-
// QT Includes
#include <qapplication.h>
#include <qinputdialog.h>
MULTIPR_GUI_Partition1Dlg::MULTIPR_GUI_Partition1Dlg(MULTIPR_GUI* theModule) :
- QDialog( theModule->application()->desktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+ QDialog(
+ theModule->application()->desktop(),
+ 0,
+ false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
mModule = theModule;
MULTIPR_GUI_Partition2Dlg::MULTIPR_GUI_Partition2Dlg(MULTIPR_GUI* theModule) :
- QDialog( theModule->application()->desktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+ QDialog(
+ theModule->application()->desktop(),
+ 0,
+ false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
mModule = theModule;
connect(pushButtonCancel, SIGNAL(clicked()), this, SLOT(reject()));
}
+
/*
* Destroys the object and frees any allocated resources
*/
MULTIPR_GUI_DecimateDlg::MULTIPR_GUI_DecimateDlg(MULTIPR_GUI* theModule) :
- QDialog( theModule->application()->desktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+ QDialog(
+ theModule->application()->desktop(),
+ 0,
+ false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
mModule = theModule;
spinBoxBoxing->setMaxValue( 200 );
spinBoxBoxing->setMinValue( 2 );
spinBoxBoxing->setValue( 100 );
+ QToolTip::add( spinBoxBoxing, tr( "grid: number of cells along each axis" ) );
buttonGroupProcess = new QButtonGroup( this, "buttonGroupProcess" );
buttonGroupProcess->setGeometry( QRect( 10, 480, 450, 60 ) );
setCaption( tr( "Decimation" ) );
buttonGroupSelectField->setTitle( tr( "Select field" ) );
textLabelSelectFieldName->setText( tr( "Field name" ) );
- textLabelSelectFieldIteration->setText( tr( "Iteration" ) );
+ textLabelSelectFieldIteration->setText( tr( "Field iteration" ) );
buttonGroupSelectFilter->setTitle( tr( "Select filter" ) );
textLabelSelectFilter->setText( tr( "Filter name" ) );
buttonGroupParameters->setTitle( tr( "Set parameters" ) );
textLabelTMed->setText( tr( "Threshold for medium resolution" ) );
textLabelTLow->setText( tr( "Threshold for low resolution" ) );
textLabelRadius->setText( tr( "Radius (neighborhood)" ) );
- textLabelBoxing->setText( tr( "Boxing parameter" ) );
+ textLabelBoxing->setText( tr( "Acceleration structure (boxing)" ) );
lineEditTMed->setText( tr( "0.1" ) );
lineEditTLow->setText( tr( "0.2" ) );
lPartName,
lPath,
lMEDFileName);
+
+ if (ret != 5)
+ {
+ return;
+ }
QApplication::setOverrideCursor(Qt::waitCursor);
float defaultRadius = 0.5f;
//*****************************************************************************
// MULTIPR_GUI_ProgressCallbackDlg
+// QT dialog box used to display progress in time consuming task (e.g. save)
//*****************************************************************************
MULTIPR_GUI_ProgressCallbackDlg::MULTIPR_GUI_ProgressCallbackDlg(QWidget* parent) :
- QProgressDialog(parent, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+ QProgressDialog(
+ parent,
+ 0,
+ false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
setLabel(new QLabel(this, "Please wait"));
setLabelText("Please wait");
MULTIPR_GUI_ProgressCallbackDlg::~MULTIPR_GUI_ProgressCallbackDlg()
{
+ // do nothing
}
// Includes section
//*****************************************************************************
-#include <SalomeApp_Module.h>
-#include <LightApp_DataObject.h>
-#include <LightApp_DataModel.h>
-#include <LightApp_RootObject.h>
-
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(MULTIPR)
-
#include <qdialog.h>
#include <qprogressdialog.h>
-#include <qstring.h>
-#include <qvariant.h>
#include "MULTIPR_ProgressCallback.hxx"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
-msgid "ICON_GET_BANNER"
+msgid "MULTIPR_ICON_GET_BANNER"
msgstr "ExecMULTIPR.png"
-msgid "ICON_IMPORT_MED"
+msgid "MULTIPR_ICON_IMPORT_MED"
msgstr "MULTIPR_import_med.png"
-msgid "ICON_SAVE_MED"
+msgid "MULTIPR_ICON_SAVE_MED"
msgstr "MULTIPR_save_med.png"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
-msgid "MULTIPR_GUI::BUT_OK"
-msgstr "OKO"
+msgid "MULTIPR_BUT_OK"
+msgstr "OK"
-msgid "MULTIPR_GUI::BUT_CANCEL"
+msgid "MULTIPR_BUT_CANCEL"
msgstr "Cancel"
-msgid "TLT_IMPORT_FROM_MED_FILE"
+msgid "MULTIPR_TLT_IMPORT_FROM_MED_FILE"
msgstr "Import from MED file"
-msgid "MEN_IMPORT_FROM_MED_FILE"
+msgid "MULTIPR_MEN_IMPORT_FROM_MED_FILE"
msgstr "Import from MED file"
-msgid "STS_IMPORT_FROM_MED_FILE"
-msgstr "Call import from sequential or distributed MED file"
+msgid "MULTIPR_STS_IMPORT_FROM_MED_FILE"
+msgstr "Open a sequential or a distributed MED file"
-msgid "TLT_SPLIT"
+msgid "MULTIPR_TLT_SPLIT"
msgstr "Split part"
-msgid "MEN_SPLIT"
+msgid "MULTIPR_MEN_SPLIT"
msgstr "Split part"
-msgid "STS_SPLIT"
+msgid "MULTIPR_STS_SPLIT"
msgstr "Split selected parts of the current distributed mesh"
-msgid "TLT_DECIMATE"
+msgid "MULTIPR_TLT_DECIMATE"
msgstr "Decimate"
-msgid "MEN_DECIMATE"
+msgid "MULTIPR_MEN_DECIMATE"
msgstr "Decimate"
-msgid "STS_DECIMATE"
+msgid "MULTIPR_STS_DECIMATE"
msgstr "Decimate selected parts (build two new meshes at lower resolution)"
-msgid "TLT_REMOVE"
+msgid "MULTIPR_TLT_REMOVE"
msgstr "Remove"
-msgid "MEN_REMOVE"
+msgid "MULTIPR_MEN_REMOVE"
msgstr "Remove"
-msgid "STS_DECIMATE"
+msgid "MULTIPR_STS_DECIMATE"
msgstr "Remove selected parts"
-msgid "TLT_SAVE"
+msgid "MULTIPR_TLT_SAVE"
msgstr "Save distributed mesh"
-msgid "MEN_SAVE"
+msgid "MULTIPR_MEN_SAVE"
msgstr "Save distributed mesh"
-msgid "STS_SAVE"
+msgid "MULTIPR_STS_SAVE"
msgstr "Save the current distributed MED file"
-msgid "MEN_FILE"
+msgid "MULTIPR_MEN_FILE"
msgstr "&File"
-msgid "MEN_FILE_MULTIPR"
+msgid "MULTIPR_MEN_FILE_MULTIPR"
msgstr "Multipr"
-msgid "MEN_MULTIPR"
+msgid "MULTIPR_MEN_MULTIPR"
msgstr "Multipr"
-msgid "TOOL_MULTIPR"
+msgid "MULTIPR_TOOL_MULTIPR"
msgstr "MULTIPR"
-msgid "FLT_ALL_FILES"
+msgid "MULTIPR_FLT_ALL_FILES"
msgstr "All Files (*.*)"
-msgid "FLT_MED_FILES"
+msgid "MULTIPR_FLT_MED_FILES"
msgstr "MED Files (*.med)"
-msgid "USE_BUILD_PROGRESS"
+msgid "MULTIPR_USE_BUILD_PROGRESS"
msgstr "Use build progress"
EXPORT_HEADERS=
# .po files to transform in .qm
-PO_FILES = MULTIPR_msg_en.po MULTIPR_msg_fr.po MULTIPR_icons.po
+PO_FILES = MULTIPR_msg_en.po MULTIPR_icons.po
# Libraries targets
LIB = libMULTIPR.la