cout << "BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator" << endl;
this->mySMPMap.clear();
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- GeomToolSelected = new GeomSelectionTools(aStudy);
+ this->getGeomSelectionTool();
/* Initialize the Python interpreter */
assert(Py_IsInitialized());
{
}
+GeomSelectionTools* BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool()
+{
+ BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+ if (that->GeomToolSelected == NULL) {
+ cout << "GeomToolSelected is created" << endl;
+ _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ that->GeomToolSelected = new GeomSelectionTools(aStudy);
+ }
+ return that->GeomToolSelected;
+}
+
namespace {
inline bool isDouble( const QString& theText, const bool emptyOK=false ) {
QString str = theText.trimmed();
while (i.hasNext()) {
i.next();
const QString entry = i.key();
- string shapeName = GeomToolSelected->getNameFromEntry(entry.toStdString());
+ string shapeName = that->getGeomSelectionTool()->getNameFromEntry(entry.toStdString());
const QString sizeMap = i.value();
int row = mySizeMapTable->rowCount();
mySizeMapTable->setRowCount( row+1 );
int pos = fullSizeMap.find("return")+7;
QString sizeMap = QString::fromStdString(fullSizeMap.substr(pos, fullSizeMap.size()-pos));
that->mySMPMap[entry_sm[0]] = sizeMap;
- that->mySMPShapeTypeMap[entry_sm[0]] = GeomToolSelected->entryToShape(entry_sm[0].toStdString()).ShapeType();
+ that->mySMPShapeTypeMap[entry_sm[0]] = that->getGeomSelectionTool()->entryToShape(entry_sm[0].toStdString()).ShapeType();
MESSAGE("mySMPMap[" << entry_sm[0].toStdString() << "] = " << sizeMap.toStdString());
MESSAGE("mySMPShapeTypeMap[" << entry_sm[0].toStdString() << "] = " << that->mySMPShapeTypeMap[entry_sm[0]]);
}
TopoDS_Shape S;
string entry, shapeName;
- LightApp_SelectionMgr* aSel = GeomToolSelected->selectionMgr();
+ LightApp_SelectionMgr* aSel = that->getGeomSelectionTool()->selectionMgr();
SALOME_ListIO ListSelectedObjects;
aSel->selectedObjects(ListSelectedObjects, NULL, false );
if (!ListSelectedObjects.IsEmpty())
for (; Object_It.More(); Object_It.Next())
{
Handle(SALOME_InteractiveObject) anObject = Object_It.Value();
- entry = GeomToolSelected->getEntryOfObject(anObject);
+ entry = that->getGeomSelectionTool()->getEntryOfObject(anObject);
shapeName = anObject->getName();
- S = GeomToolSelected->entryToShape(entry);
+ S = that->getGeomSelectionTool()->entryToShape(entry);
if ((! S.IsNull()) && (S.ShapeType() == typeShapeAsked))
{
mySizeMapTable->setFocus();
BLSURFPluginGUI_HypothesisCreator( const QString& );
virtual ~BLSURFPluginGUI_HypothesisCreator();
- virtual bool checkParams() const;
- virtual QString helpPage() const;
- void insertElementType( TopAbs_ShapeEnum );
+ virtual bool checkParams() const;
+ virtual QString helpPage() const;
+ void insertElementType( TopAbs_ShapeEnum );
static LightApp_SelectionMgr* selectionMgr();
protected:
- virtual QFrame* buildFrame ();
- virtual void retrieveParams() const;
- virtual QString storeParams () const;
+ virtual QFrame* buildFrame ();
+ virtual void retrieveParams() const;
+ virtual QString storeParams () const;
- virtual QString caption() const;
- virtual QPixmap icon() const;
- virtual QString type() const;
+ virtual QString caption() const;
+ virtual QPixmap icon() const;
+ virtual QString type() const;
protected slots:
- void onPhysicalMeshChanged();
- void onGeometricMeshChanged();
- void onAddOption();
- void onDeleteOption();
- void onOptionChosenInPopup( QAction* );
- void onAddMapOnSurface();
- void onAddMapOnEdge();
- void onAddMapOnPoint();
- void onRemoveMap();
- void onSetSizeMap(int,int);
+ void onPhysicalMeshChanged();
+ void onGeometricMeshChanged();
+ void onAddOption();
+ void onDeleteOption();
+ void onOptionChosenInPopup( QAction* );
+ void onAddMapOnSurface();
+ void onAddMapOnEdge();
+ void onAddMapOnPoint();
+ void onRemoveMap();
+ void onSetSizeMap(int,int);
private:
- bool readParamsFromHypo( BlsurfHypothesisData& ) const;
- QString readParamsFromWidgets( BlsurfHypothesisData& ) const;
- bool storeParamsToHypo( const BlsurfHypothesisData& ) const;
- bool sizeMapsValidation();
- bool sizeMapValidationFromRow(int);
- bool sizeMapValidationFromEntry(QString);
+ bool readParamsFromHypo( BlsurfHypothesisData& ) const;
+ QString readParamsFromWidgets( BlsurfHypothesisData& ) const;
+ bool storeParamsToHypo( const BlsurfHypothesisData& ) const;
+ bool sizeMapsValidation();
+ bool sizeMapValidationFromRow(int);
+ bool sizeMapValidationFromEntry(QString);
+ GeomSelectionTools* getGeomSelectionTool();
private:
QWidget* myStdGroup;
QPushButton *removeButton;
// map = entry , size map
- QMap<QString, QString> mySMPMap;
+ QMap<QString, QString> mySMPMap;
QMap<QString, TopAbs_ShapeEnum> mySMPShapeTypeMap;
- GeomSelectionTools* GeomToolSelected;
+ GeomSelectionTools* GeomToolSelected;
BLSURFPlugin::string_array_var myOptions;