]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
SIGSEGV corrected
authorgdd <gdd>
Wed, 18 Feb 2009 15:56:00 +0000 (15:56 +0000)
committergdd <gdd>
Wed, 18 Feb 2009 15:56:00 +0000 (15:56 +0000)
Attractor button added (currently not used)

src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.h
src/GUI/BLSURFPlugin_msg_en.ts

index 747c61e4c54dfab51dd833d0a421793a747bbb5b..5080e6d369569c69533df22ca74f3af6f215040f 100644 (file)
@@ -208,7 +208,8 @@ BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator( const QStr
   cout << "BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator" << endl; 
   this->mySMPMap.clear();
 
-  this->getGeomSelectionTool();
+  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+  GeomToolSelected = new GeomSelectionTools(aStudy);
 
   /* Initialize the Python interpreter */
   assert(Py_IsInitialized());
@@ -487,7 +488,7 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   QGridLayout* anSmpLayout = new QGridLayout(mySmpGroup);
 
   mySizeMapTable = new QTableWidget( 0, SMP_NB_COLUMNS, mySmpGroup );
-  anSmpLayout->addWidget(mySizeMapTable, 1, 0, 6, 1);
+  anSmpLayout->addWidget(mySizeMapTable, 1, 0, 8, 1);
   QStringList sizeMapHeaders;
   sizeMapHeaders << tr( "SMP_ENTRY_COLUMN" )<< tr( "SMP_NAME_COLUMN" ) << tr( "SMP_SIZEMAP_COLUMN" ); 
   mySizeMapTable->setHorizontalHeaderLabels(sizeMapHeaders);
@@ -497,22 +498,30 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   mySizeMapTable->setAlternatingRowColors(true);
   mySizeMapTable->verticalHeader()->hide();
 
+  addAttractorButton = new QPushButton(tr("BLSURF_SM_ATTRACTOR"),mySmpGroup);
+  anSmpLayout->addWidget(addAttractorButton, 1, 1, 1, 1);
+
+  QFrame *line = new QFrame(mySmpGroup);
+  line->setFrameShape(QFrame::HLine);
+  line->setFrameShadow(QFrame::Sunken);
+  anSmpLayout->addWidget(line, 2, 1, 1, 1);
+
   addSurfaceButton = new QPushButton(tr("BLSURF_SM_SURFACE"),mySmpGroup);
-  anSmpLayout->addWidget(addSurfaceButton, 1, 1, 1, 1);
+  anSmpLayout->addWidget(addSurfaceButton, 3, 1, 1, 1);
 
   addEdgeButton = new QPushButton(tr("BLSURF_SM_EDGE"),mySmpGroup);
-  anSmpLayout->addWidget(addEdgeButton, 2, 1, 1, 1);
+  anSmpLayout->addWidget(addEdgeButton, 4, 1, 1, 1);
 
   addPointButton = new QPushButton(tr("BLSURF_SM_POINT"),mySmpGroup);
-  anSmpLayout->addWidget(addPointButton, 3, 1, 1, 1);
+  anSmpLayout->addWidget(addPointButton, 5, 1, 1, 1);
 
-  QFrame *line = new QFrame(mySmpGroup);
-  line->setFrameShape(QFrame::HLine);
-  line->setFrameShadow(QFrame::Sunken);
-  anSmpLayout->addWidget(line, 4, 1, 1, 1);
+  QFrame *line2 = new QFrame(mySmpGroup);
+  line2->setFrameShape(QFrame::HLine);
+  line2->setFrameShadow(QFrame::Sunken);
+  anSmpLayout->addWidget(line2, 6, 1, 1, 1);
 
   removeButton = new QPushButton(tr("BLSURF_SM_REMOVE"),mySmpGroup);
-  anSmpLayout->addWidget(removeButton, 5, 1, 1, 1);
+  anSmpLayout->addWidget(removeButton, 7, 1, 1, 1);
   
 
   // ---
@@ -596,7 +605,7 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const
   while (i.hasNext()) {
     i.next();
     const QString entry = i.key();
-    string shapeName = that->getGeomSelectionTool()->getNameFromEntry(entry.toStdString());
+    string shapeName = GeomToolSelected->getNameFromEntry(entry.toStdString());
     const QString sizeMap = i.value();
     int row = mySizeMapTable->rowCount();
     mySizeMapTable->setRowCount( row+1 );
@@ -681,7 +690,7 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData
        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]] = that->getGeomSelectionTool()->entryToShape(entry_sm[0].toStdString()).ShapeType();
+       that->mySMPShapeTypeMap[entry_sm[0]] = GeomToolSelected->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]]);
       }
@@ -1068,7 +1077,7 @@ void BLSURFPluginGUI_HypothesisCreator::insertElementType(TopAbs_ShapeEnum typeS
 
   TopoDS_Shape S;
   string entry, shapeName;
-  LightApp_SelectionMgr* aSel = that->getGeomSelectionTool()->selectionMgr();
+  LightApp_SelectionMgr* aSel = GeomToolSelected->selectionMgr();
   SALOME_ListIO ListSelectedObjects;
   aSel->selectedObjects(ListSelectedObjects, NULL, false );
   if (!ListSelectedObjects.IsEmpty())
@@ -1077,9 +1086,9 @@ void BLSURFPluginGUI_HypothesisCreator::insertElementType(TopAbs_ShapeEnum typeS
     for (; Object_It.More(); Object_It.Next()) 
     {
       Handle(SALOME_InteractiveObject) anObject = Object_It.Value();
-      entry     = that->getGeomSelectionTool()->getEntryOfObject(anObject);
+      entry     = GeomToolSelected->getEntryOfObject(anObject);
       shapeName = anObject->getName();
-      S         = that->getGeomSelectionTool()->entryToShape(entry);
+      S         = GeomToolSelected->entryToShape(entry);
       if ((! S.IsNull()) && (S.ShapeType() == typeShapeAsked)) 
       { 
         mySizeMapTable->setFocus();
index 17945748fe35d6c6ad17db11d1a91f9717f6fabf..2c85f451b248c41168ba0ea178bab049c285f224 100644 (file)
@@ -139,8 +139,9 @@ private:
 
   QWidget             *mySmpGroup;  
   QTableWidget        *mySizeMapTable;
-  QPushButton         *addEdgeButton;
+  QPushButton         *addAttractorButton;
   QPushButton         *addSurfaceButton;
+  QPushButton         *addEdgeButton;
   QPushButton         *addPointButton;
   QPushButton         *removeButton;
 
index 5712ed29914b8ecb5071bc2f87f675a7ec0fe62e..5c33a10b934c76a52cccbc271fc91bb193b34bb4 100644 (file)
             <source>BLSURF_SM_POINT</source>
             <translation>Add Map on Point</translation>
         </message>
+        <message>
+            <source>BLSURF_SM_ATTRACTOR</source>
+            <translation>Add Attractor</translation>
+        </message>
         <message>
             <source>BLSURF_SM_REMOVE</source>
             <translation>Remove Map</translation>