aFilename = fd->selectedFile();
aFormat = aFilterMap[fd->selectedFilter()];
delete fd;
- if( !aFilename.isEmpty()
- && (aMesh->NbPolygons()>0 or aMesh->NbPolyhedrons()>0)
- && aFormat==SMESH::MED_V2_1){
- int aRet = SUIT_MessageBox::warn2(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_MED_V2_1").arg(anIObject->getName()),
- QObject::tr("SMESH_BUT_YES"),
- QObject::tr("SMESH_BUT_NO"),
- 0,1,0);
- if(aRet){
- return;
- }
- }
}
if ( !aFilename.isEmpty() ) {
// Check whether the file already exists and delete it if yes
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_NodesDlg( desktop(), "", SMESHGUI::selectionMgr() );
+ new SMESHGUI_NodesDlg(this);
}
else {
SUIT_MessageBox::warn1(desktop(),
EmitSignalDeactivateDialog();
- new SMESHGUI_DeleteGroupDlg( desktop(), SMESHGUI::selectionMgr() );
+ new SMESHGUI_DeleteGroupDlg(this);
break;
}
aTypes.append( SMESH::FACE );
aTypes.append( SMESH::VOLUME );
}
- new SMESHGUI_FilterLibraryDlg( desktop(), aTypes, SMESHGUI_FilterLibraryDlg::EDIT );
+ new SMESHGUI_FilterLibraryDlg( this, SMESH::GetDesktop( this ), aTypes, SMESHGUI_FilterLibraryDlg::EDIT );
}
break;
if( !popupMgr()->contains( popupMgr()->actionId( action( id ) ) ) )
popupMgr()->insert( action( id ), parentId, 0 );
- QChar lc = popupMgr()->equality();
+ QChar lc = QtxPopupMgr::Selection::defEquality();
QString rule = "(%1) and (%2) and (%3)";
- rule = rule.arg( QString( "%1>0" ).arg( popupMgr()->selCountParam() ) );
+ rule = rule.arg( QString( "%1>0" ).arg( QtxPopupMgr::Selection::defSelCountParam() ) );
rule = rule.arg( QString( "%1client in {%2}" ).arg( lc ).arg( clients ) );
rule = rule.arg( QString( "%1type in {%2}" ).arg( lc ).arg( types ) );
rule += theRule;
createSMESHAction( 813, "DEL_GROUP", "ICON_DEL_GROUP" );
createSMESHAction( 900, "ADV_INFO", "ICON_ADV_INFO" );
createSMESHAction( 902, "STD_INFO", "ICON_STD_INFO" );
- createSMESHAction( 6001, "LENGTH", "ICON_LENGTH" );
- createSMESHAction( 6002, "FREE_EDGE", "ICON_FREE_EDGE" );
- createSMESHAction( 6003, "FREE_BORDER", "ICON_FREE_EDGE_2D" );
- createSMESHAction( 6004, "CONNECTION", "ICON_CONNECTION" );
- createSMESHAction( 6011, "AREA", "ICON_AREA" );
- createSMESHAction( 6012, "TAPER", "ICON_TAPER" );
- createSMESHAction( 6013, "ASPECT", "ICON_ASPECT" );
- createSMESHAction( 6014, "MIN_ANG", "ICON_ANGLE" );
- createSMESHAction( 6015, "WRAP", "ICON_WRAP" );
- createSMESHAction( 6016, "SKEW", "ICON_SKEW" );
- createSMESHAction( 6017, "ASPECT_3D", "ICON_ASPECT_3D" );
- createSMESHAction( 6018, "LENGTH_2D", "ICON_LENGTH_2D" );
- createSMESHAction( 6019, "CONNECTION_2D", "ICON_CONNECTION_2D" );
+ createSMESHAction( 6001, "LENGTH", "ICON_LENGTH" , 0, true );
+ createSMESHAction( 6002, "FREE_EDGE", "ICON_FREE_EDGE" , 0, true );
+ createSMESHAction( 6003, "FREE_BORDER", "ICON_FREE_EDGE_2D" , 0, true );
+ createSMESHAction( 6004, "CONNECTION", "ICON_CONNECTION" , 0, true );
+ createSMESHAction( 6011, "AREA", "ICON_AREA" , 0, true );
+ createSMESHAction( 6012, "TAPER", "ICON_TAPER" , 0, true );
+ createSMESHAction( 6013, "ASPECT", "ICON_ASPECT" , 0, true );
+ createSMESHAction( 6014, "MIN_ANG", "ICON_ANGLE" , 0, true );
+ createSMESHAction( 6015, "WRAP", "ICON_WRAP" , 0, true );
+ createSMESHAction( 6016, "SKEW", "ICON_SKEW", 0, true );
+ createSMESHAction( 6017, "ASPECT_3D", "ICON_ASPECT_3D", 0, true );
+ createSMESHAction( 6018, "LENGTH_2D", "ICON_LENGTH_2D", 0, true );
+ createSMESHAction( 6019, "CONNECTION_2D", "ICON_CONNECTION_2D", 0, true );
createSMESHAction( 400, "NODE", "ICON_DLG_NODE" );
createSMESHAction( 401, "EDGE", "ICON_DLG_EDGE" );
createSMESHAction( 4021, "TRIANGLE", "ICON_DLG_TRIANGLE" );
createSMESHAction( 10071, "DISP_ENT", "", 0, true );
createSMESHAction( 200, "RESET" );
createSMESHAction( 201, "SCALAR_BAR_PROP" );
- createSMESHAction( 211, "WIRE", "ICON_WIRE" );
- createSMESHAction( 212, "SHADE", "ICON_SHADE" );
- createSMESHAction( 213, "SHRINK", "ICON_SHRINK" );
+ createSMESHAction( 211, "WIRE", "ICON_WIRE", 0, true );
+ createSMESHAction( 212, "SHADE", "ICON_SHADE", 0, true );
+ createSMESHAction( 213, "SHRINK", "ICON_SHRINK", 0, true );
createSMESHAction( 214, "UPDATE", "ICON_UPDATE" );
- createSMESHAction( 215, "NODES", "ICON_POINTS" );
- createSMESHAction( 217, "EDGES", "ICON_DLG_EDGE" );
- createSMESHAction( 218, "FACES", "ICON_DLG_TRIANGLE" );
- createSMESHAction( 219, "VOLUMES", "ICON_DLG_TETRAS" );
+ createSMESHAction( 215, "NODES", "ICON_POINTS", 0, true );
+ createSMESHAction( 217, "EDGES", "ICON_DLG_EDGE", 0, true );
+ createSMESHAction( 218, "FACES", "ICON_DLG_TRIANGLE", 0, true );
+ createSMESHAction( 219, "VOLUMES", "ICON_DLG_TETRAS", 0, true );
createSMESHAction( 220, "ALL" );
+ createSMESHAction( 1100, "EDIT_HYPO" );
createSMESHAction( 1101, "RENAME" );
- createSMESHAction( 9010, "NUM_NODES" );
- createSMESHAction( 9011, "NUM_ELEMENTS" );
+ createSMESHAction( 9010, "NUM_NODES", "", 0, true );
+ createSMESHAction( 9011, "NUM_ELEMENTS", "", 0, true );
createSMESHAction( 1131, "DISPMODE" );
createSMESHAction( 1132, "COLORS" );
createSMESHAction( 1133, "TRANSP" );
hasFaces("{'Face'} in elemTypes"),
hasVolumes("{'Volume'} in elemTypes");
- QString aSelCount = popupMgr()->selCountParam() + "= 1";
- QString aClient = QString( popupMgr()->equality() )+ "client in {" + View + "}";
- QString aType = QString( popupMgr()->equality() ) + "type in {" + mesh_group + "}";
+ QString aSelCount = QString( "%1 = 1" ).arg( QtxPopupMgr::Selection::defSelCountParam() );
+ QString aClient = QString( "%1client in {%2}" ).arg( QtxPopupMgr::Selection::defEquality() ).arg( View );
+ QString aType = QString( "%1type in {%2}" ).arg( QtxPopupMgr::Selection::defEquality() ).arg( mesh_group );
QString aMeshInVTK = aClient + "&&" + aType + "&&" + aSelCount;
//-------------------------------------------------
popupMgr()->insert( action( 6003 ), anId, -1 ); // FREE_BORDER
popupMgr()->setRule( action( 6003 ), aMeshInVtkHasEdges, true );
- popupMgr()->setRule( action( 6003 ), "&& controlMode = 'eFreeEdges'", true );
+ popupMgr()->setRule( action( 6003 ), "controlMode = 'eFreeEdges'", false );
popupMgr()->insert( action( 6001 ), anId, -1 ); // LENGTH
popupMgr()->setRule( action( 6001 ), aMeshInVtkHasEdges, true );
- popupMgr()->setRule( action( 6001 ), "&& controlMode = 'eLength'", true );
+ popupMgr()->setRule( action( 6001 ), "controlMode = 'eLength'", false );
popupMgr()->insert( action( 6004 ), anId, -1 ); // CONNECTION
popupMgr()->setRule( action( 6004 ), aMeshInVtkHasEdges, true );
- popupMgr()->setRule( action( 6004 ), "&& controlMode = 'eMultiConnection'", true );
+ popupMgr()->setRule( action( 6004 ), "controlMode = 'eMultiConnection'", false );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 6002 ), anId, -1 ); // FREE_EDGE
popupMgr()->setRule( action( 6002 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6002 ), "&& controlMode = 'eFreeBorders'", true );
+ popupMgr()->setRule( action( 6002 ), "controlMode = 'eFreeBorders'", false );
popupMgr()->insert( action( 6018 ), anId, -1 ); // LENGTH_2D
popupMgr()->setRule( action( 6018 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6018 ), "&& controlMode = 'eLength2D'", true );
+ popupMgr()->setRule( action( 6018 ), "controlMode = 'eLength2D'", false );
popupMgr()->insert( action( 6019 ), anId, -1 ); // CONNECTION_2D
popupMgr()->setRule( action( 6019 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6019 ), "&& controlMode = 'eMultiConnection2D'", true );
+ popupMgr()->setRule( action( 6019 ), "controlMode = 'eMultiConnection2D'", false );
popupMgr()->insert( action( 6011 ), anId, -1 ); // AREA
popupMgr()->setRule( action( 6011 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6011 ), "&& controlMode = 'eArea'", true );
+ popupMgr()->setRule( action( 6011 ), "controlMode = 'eArea'", false );
popupMgr()->insert( action( 6012 ), anId, -1 ); // TAPER
popupMgr()->setRule( action( 6012 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6012 ), "&& controlMode = 'eTaper'", true );
+ popupMgr()->setRule( action( 6012 ), "controlMode = 'eTaper'", false );
popupMgr()->insert( action( 6013 ), anId, -1 ); // ASPECT
popupMgr()->setRule( action( 6013 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6013 ), "&& controlMode = 'eAspectRatio'", true );
+ popupMgr()->setRule( action( 6013 ), "controlMode = 'eAspectRatio'", false );
popupMgr()->insert( action( 6014 ), anId, -1 ); // MIN_ANG
popupMgr()->setRule( action( 6014 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6014 ), "&& controlMode = 'eMinimumAngle'", true );
+ popupMgr()->setRule( action( 6014 ), "controlMode = 'eMinimumAngle'", false );
popupMgr()->insert( action( 6015 ), anId, -1 ); // WRAP
popupMgr()->setRule( action( 6015 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6015 ), "&& controlMode = 'eWarping'", true );
+ popupMgr()->setRule( action( 6015 ), "controlMode = 'eWarping'", false );
popupMgr()->insert( action( 6016 ), anId, -1 ); // SKEW
popupMgr()->setRule( action( 6016 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6016 ), "&& controlMode = 'eSkew'", true );
+ popupMgr()->setRule( action( 6016 ), "controlMode = 'eSkew'", false );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 6017 ), anId, -1 ); // ASPECT_3D
popupMgr()->setRule( action( 6017 ), aMeshInVtkHasVolumes, true );
- popupMgr()->setRule( action( 6017 ), "&& controlMode = 'eAspectRatio3D'", true );
+ popupMgr()->setRule( action( 6017 ), "controlMode = 'eAspectRatio3D'", false );
popupMgr()->insert( separator(), anId, -1 );
void SMESHGUI::contextMenuPopup( const QString& client, QPopupMenu* menu, QString& /*title*/ )
{
- SMESHGUI_Selection sel( client, selectionMgr() );
+ SMESHGUI_Selection sel;
+ sel.init( client, selectionMgr() );
popupMgr()->updatePopup( menu, &sel );
}
#include "SalomeApp_Study.h"
#include "SalomeApp_SelectionMgr.h"
-#include "SVTK_Selection.h"
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
+#include "SVTK_Selection.h"
+#include "SVTK_ViewWindow.h"
+
// QT Includes
#include <qframe.h>
#include <qlayout.h>
// function : SMESHGUI_DeleteGroupDlg()
// purpose : Constructor
//=================================================================================
-SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (QWidget* theParent,
- SalomeApp_SelectionMgr* theSelection)
- : QDialog(theParent, "SMESHGUI_DeleteGroupDlg", false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule):
+ QDialog(SMESH::GetDesktop(theModule),
+ "SMESHGUI_DeleteGroupDlg",
+ false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+ myViewWindow(SMESH::GetViewWindow(mySMESHGUI)),
+ mySMESHGUI(theModule)
{
setCaption(tr("CAPTION"));
aDlgLay->setStretchFactor(aMainFrame, 1);
- Init(theSelection);
+ Init();
}
//=================================================================================
// function : Init()
// purpose : Init dialog fields, connect signals and slots, show dialog
//=================================================================================
-void SMESHGUI_DeleteGroupDlg::Init (SalomeApp_SelectionMgr* theSelection)
+void SMESHGUI_DeleteGroupDlg::Init ()
{
myBlockSelection = false;
- mySelectionMgr = theSelection;
- SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI();
- aSMESHGUI->SetActiveDialogBox((QDialog*)this);
+ mySMESHGUI->SetActiveDialogBox((QDialog*)this);
// selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
- connect(aSMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
- connect(aSMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+ connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
int x, y;
- aSMESHGUI->DefineDlgPosition(this, x, y);
+ mySMESHGUI->DefineDlgPosition(this, x, y);
this->move(x, y);
this->show();
// set selection mode
-#ifdef NEW_GUI
- mySelectionMgr->setSelectionModes(ActorSelection, true);
-#else
- mySelectionMgr->setSelectionModes(ActorSelection);
-#endif
mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP));
+ myViewWindow->SetSelectionMode(ActorSelection);
onSelectionDone();
return;
return false;
}
- return !SMESHGUI::GetSMESHGUI()->isActiveStudyLocked();
+ return !mySMESHGUI->isActiveStudyLocked();
}
//=================================================================================
myListGrp.clear();
mySelectionMgr->clearSelected();
SMESH::UpdateView();
- SMESHGUI::GetSMESHGUI()->updateObjBrowser(true);
+ mySMESHGUI->updateObjBrowser(true);
myBlockSelection = false;
return true;
//=================================================================================
void SMESHGUI_DeleteGroupDlg::onClose()
{
- mySelectionMgr->setSelectionModes(ActorSelection);
+ myViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0);
- disconnect(SMESHGUI::GetSMESHGUI(), 0, this, 0);
- SMESHGUI::GetSMESHGUI()->ResetState();
+ disconnect(mySMESHGUI, 0, this, 0);
+ mySMESHGUI->ResetState();
mySelectionMgr->clearFilters();
reject();
}
//=================================================================================
void SMESHGUI_DeleteGroupDlg::enterEvent (QEvent*)
{
- SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
+ mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true);
-#ifdef NEW_GUI
- mySelectionMgr->setSelectionModes(ActorSelection, true);
-#else
- mySelectionMgr->setSelectionModes(ActorSelection);
-#endif
+ myViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
}
class QCloseEvent;
class QFrame;
class QPushButton;
-class SalomeApp_SelectionMgr;
class QListBox;
+class SMESHGUI;
+class SVTK_ViewWindow;
+class SalomeApp_SelectionMgr;
+
/*!
* Class : SMESHGUI_DeleteGroupDlg
* Description : Delete groups and their contents
Q_OBJECT
public:
- SMESHGUI_DeleteGroupDlg (QWidget*,
- SalomeApp_SelectionMgr*);
+ SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule);
virtual ~SMESHGUI_DeleteGroupDlg();
- void Init (SalomeApp_SelectionMgr*);
+ void Init ();
private:
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QListBox* myListBox;
+
+ SMESHGUI* mySMESHGUI;
+ SVTK_ViewWindow* myViewWindow;
SalomeApp_SelectionMgr* mySelectionMgr;
QValueList<SMESH::SMESH_GroupBase_var> myListGrp;
if (anEditRow >= 0 && anEditCol >= 0)
endEdit(anEditRow, anEditCol, true, false);
- QTable::insertRows(row, count);
+ QTable::insertRows( row, count );
}
//=======================================================================
// name : SMESHGUI_FilterTable::SMESHGUI_FilterTable
// Purpose : Constructor
//=======================================================================
-SMESHGUI_FilterTable::SMESHGUI_FilterTable (QWidget* parent,
+SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule,
+ QWidget* parent,
const int type)
-: QFrame(parent)
+: QFrame(parent),
+ myIsLocked( false ),
+ mySMESHGUI( theModule )
{
myEntityType = -1;
Init(type);
// name : SMESHGUI_FilterTable::SMESHGUI_FilterTable
// Purpose : Constructor
//=======================================================================
-SMESHGUI_FilterTable::SMESHGUI_FilterTable (QWidget* parent,
+SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule,
+ QWidget* parent,
const QValueList<int>& types)
-: QFrame(parent)
+: QFrame(parent),
+ myIsLocked( false ),
+ mySMESHGUI( theModule )
{
myEntityType = -1;
Init(types);
myAddWidgets[ anItem ]->SetDouble(AdditionalWidget::Tolerance, theCriterion.Tolerance);
}
- emit CretarionChanged(theRow, aType);
+ emit CriterionChanged(theRow, aType);
}
//=======================================================================
void SMESHGUI_FilterTable::onCurrentChanged (int theRow, int theCol)
{
- updateAdditionalWidget();
+ if( !myIsLocked )
+ updateAdditionalWidget();
emit CurrentChanged(theRow, theCol);
}
updateAdditionalWidget();
- emit CretarionChanged(row, entityType);
+ emit CriterionChanged(row, entityType);
}
//=======================================================================
int aSelectedRow = getFirstSelectedRow();
int aCurrCol = theTable->currentColumn();
+ myIsLocked = true;
if (toTheEnd || aSelectedRow == -1)
{
theTable->insertRows(theTable->numRows());
theTable->insertRows(aSelectedRow);
aCurrRow = aSelectedRow;
}
+ myIsLocked = false;
// Criteria
theTable->setItem(aCurrRow, 0, getCriterionItem(theTable, theType));
{
if (myLibDlg == 0)
myLibDlg = new SMESHGUI_FilterLibraryDlg(
- this, GetType(), SMESHGUI_FilterLibraryDlg::COPY_FROM);
+ mySMESHGUI, this, GetType(), SMESHGUI_FilterLibraryDlg::COPY_FROM);
else
myLibDlg->Init(GetType(), SMESHGUI_FilterLibraryDlg::COPY_FROM);
return;
if (myLibDlg == 0)
myLibDlg = new SMESHGUI_FilterLibraryDlg(
- this, GetType(), SMESHGUI_FilterLibraryDlg::ADD_TO);
+ mySMESHGUI, this, GetType(), SMESHGUI_FilterLibraryDlg::ADD_TO);
else
myLibDlg->Init(GetType(), SMESHGUI_FilterLibraryDlg::ADD_TO);
: QDialog( SMESH::GetDesktop( theModule ), theName, false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- myViewWindow( SMESH::GetViewWindow( theModule ) ),
- mySelector( myViewWindow->GetSelector() )
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
+ myViewWindow = SMESH::GetViewWindow( theModule );
+ mySelector = myViewWindow->GetSelector();
QValueList<int> aTypes;
aTypes.append(theType);
construct(aTypes);
// filter frame
- myTable = new SMESHGUI_FilterTable(aMainFrame, myTypes);
+ myTable = new SMESHGUI_FilterTable( mySMESHGUI, aMainFrame, myTypes );
myTable->SetLibsEnabled(true);
QFrame* aLine = new QFrame(myTable->GetTableGrp());
// other controls
mySourceGrp = createSourceGroup(aMainFrame);
- connect(myTable, SIGNAL(CretarionChanged(const int, const int)),
+ connect(myTable, SIGNAL(CriterionChanged(const int, const int)),
SLOT(onCriterionChanged(const int, const int)));
connect(myTable, SIGNAL(CurrentChanged(int, int)),
if (myTable->GetCriterionType(aRow) == FT_BelongToGeom ||
myTable->GetCriterionType(aRow) == FT_LyingOnGeom) {
- mySelectionMgr->installFilter(new SMESH_NumberFilter("GEOM",TopAbs_SHAPE,0,allTypes));
+ mySelectionMgr->installFilter(new GEOM_SelectionFilter( aStudy, true ));
} else if (myTable->GetCriterionType(aRow) == FT_BelongToPlane) {
mySelectionMgr->installFilter(new GEOM_FaceFilter( aStudy, StdSelect_Plane ) );
} else {
if (myIsSelectionChanged) {
- mySelectionMgr->installFilter(new SMESH_NumberFilter ("This filter deactivates selection",TopAbs_SHAPE,0,allTypes));
+ mySelectionMgr->installFilter( new GEOM_TypeFilter( aStudy, -1 ) ); // This filter deactivates selection
}
}
}
typedef QMap<int, Table*> TableMap;
public:
- SMESHGUI_FilterTable (QWidget* parent,
+ SMESHGUI_FilterTable( SMESHGUI*,
+ QWidget* parent,
const int type);
- SMESHGUI_FilterTable (QWidget* parent,
+ SMESHGUI_FilterTable( SMESHGUI*,
+ QWidget* parent,
const QValueList<int>& type);
virtual ~SMESHGUI_FilterTable();
void AddToClicked();
void EntityTypeChanged (const int);
void NeedValidation();
- void CretarionChanged (const int theRow, const int theEntityType);
+ void CriterionChanged (const int theRow, const int theEntityType);
void CurrentChanged (int, int);
private slots:
const QMap<int, QString>& getSupportedTypes() const;
private:
+ SMESHGUI* mySMESHGUI;
QGroupBox* myTableGrp;
QGroupBox* mySwitchTableGrp;
QButtonGroup* myEntityTypeGrp;
int myEntityType;
int myIsValid;
+ bool myIsLocked;
SMESHGUI_FilterLibraryDlg* myLibDlg;
bool SMESHGUI_FilterLibraryDlg::Dialog::acceptData()
{
-#ifdef NEW_GUI
- if (mode() != QFileDialogP::AnyFile)
- return SUIT_FileDlg::acceptData();
-#endif
+// if (mode() != QFileDialogP::AnyFile)
+// return SUIT_FileDlg::acceptData();
return true;
}
// name : SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg
// Purpose : Constructor
//=======================================================================
-SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg (QWidget* theParent,
+SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg (SMESHGUI* theModule,
+ QWidget* parent,
const QValueList<int>& theTypes,
const int theMode,
const char* theName)
- : QDialog(theParent, theName, true, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+ : QDialog( parent, theName, true, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
+ mySMESHGUI( theModule )
{
construct(theTypes, theMode);
}
// name : SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg
// Purpose : Constructor
//=======================================================================
-SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg (QWidget* theParent,
+SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg (SMESHGUI* theModule,
+ QWidget* parent,
const int theType,
const int theMode,
const char* theName)
- : QDialog(theParent, theName, true, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+ : QDialog( parent, theName, true, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
+ mySMESHGUI( theModule )
{
QValueList<int> aTypes;
aTypes.append(theType);
// table
- myTable = new SMESHGUI_FilterTable(aMainFrame, myTypes);
+ myTable = new SMESHGUI_FilterTable( mySMESHGUI, aMainFrame, myTypes);
myTable->SetEditable(myMode == EDIT);
myTable->SetLibsEnabled(false);
updateControlsVisibility();
setEnabled(true);
- SMESHGUI* aModeler = SMESHGUI::GetSMESHGUI();
-
- connect(aModeler, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
- connect(aModeler, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+ connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
+ connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
if (myMode == ADD_TO)
{
}
int x, y;
- aModeler->DefineDlgPosition(this, x, y);
+ mySMESHGUI->DefineDlgPosition(this, x, y);
this->move(x, y);
this->show();
{
if (onApply())
{
- disconnect(SMESHGUI::GetSMESHGUI(), 0, this, 0);
- SMESHGUI::GetSMESHGUI()->ResetState();
+ disconnect( mySMESHGUI, 0, this, 0);
+ mySMESHGUI->ResetState();
accept();
}
}
//=======================================================================
void SMESHGUI_FilterLibraryDlg::onClose()
{
- disconnect(SMESHGUI::GetSMESHGUI(), 0, this, 0);
- SMESHGUI::GetSMESHGUI()->ResetState();
+ disconnect( mySMESHGUI, 0, this, 0);
+ mySMESHGUI->ResetState();
reject();
}
public:
- SMESHGUI_FilterLibraryDlg( QWidget* parent,
+ SMESHGUI_FilterLibraryDlg( SMESHGUI*,
+ QWidget*,
const QValueList<int>& types,
const int mode,
const char* name = 0 );
- SMESHGUI_FilterLibraryDlg( QWidget* parent,
+ SMESHGUI_FilterLibraryDlg( SMESHGUI*,
+ QWidget*,
const int type,
const int mode,
const char* name = 0 );
QPushButton* myDeleteBtn;
QGroupBox* myNameGrp;
QLineEdit* myName;
+ SMESHGUI* mySMESHGUI;
QValueList<int> myTypes;
int myMode;
{
SMESH::FilterManager_var GetFilterManager()
{
- return SMESHGUI::GetSMESHGen()->CreateFilterManager(); // DumpPython
+ static SMESH::FilterManager_var aFilterManager;
+ if (CORBA::is_nil(aFilterManager)){
+ aFilterManager = SMESHGUI::GetSMESHGen()->CreateFilterManager();
+ }
+ return aFilterManager;
}
}
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myViewWindow( SMESH::GetViewWindow( theModule ) ),
- mySelector( myViewWindow->GetSelector() )
+ mySelector( myViewWindow->GetSelector() ),
+ myIsBusy( false )
{
if (!name) setName("SMESHGUI_GroupDlg");
initDialog(true);
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myViewWindow( SMESH::GetViewWindow( theModule ) ),
- mySelector( myViewWindow->GetSelector() )
+ mySelector( myViewWindow->GetSelector() ),
+ myIsBusy( false )
{
if (!name) setName("SMESHGUI_GroupDlg");
initDialog(false);
//=================================================================================
void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
{
+ mySelectionMgr->installFilter(myMeshFilter);
+
/* init data from current selection */
myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
myGroup = SMESH::SMESH_Group::_nil();
myActor = SMESH::FindActorByObject(myMesh);
SMESH::SetPickable(myActor);
- const SALOME_ListIO& aList = mySelector->StoredIObjects();
-
- QString aName = aList.First()->getName();
- myMeshGroupLine->setText(aName) ;
- myMeshGroupLine->home( false );
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+ if( !aList.IsEmpty() )
+ {
+ QString aName = aList.First()->getName();
+ myMeshGroupLine->setText(aName) ;
+ myMeshGroupLine->home( false );
+ }
myCurrentLineEdit = 0;
onClose();
}
-static bool busy = false;
//=================================================================================
// function : onListSelectionChanged()
// purpose : Called when selection in element list is changed
void SMESHGUI_GroupDlg::onListSelectionChanged()
{
// MESSAGE("SMESHGUI_GroupDlg::onListSelectionChanged(); myActor = " << myActor);
- if (busy || !myActor) return;
- busy = true;
+ if( myIsBusy || !myActor) return;
+ myIsBusy = true;
if (myCurrentLineEdit == 0) {
mySelectionMgr->clearSelected();
mySelectionMgr->setSelectedObjects(aList,false);
myViewWindow->highlight( myActor->getIO(), true, true );
}
- busy = false;
+ myIsBusy = false;
}
//=================================================================================
//=================================================================================
void SMESHGUI_GroupDlg::onObjectSelectionChanged()
{
- if (busy || !isEnabled()) return;
- busy = true;
-
- const SALOME_ListIO& aList = mySelector->StoredIObjects();
+ if ( myIsBusy || !isEnabled()) return;
+ myIsBusy = true;
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+
int aNbSel = aList.Extent();
myElements->clearSelection();
myElements->clear();
- if (aNbSel != 1) {
+ if (aNbSel == 0 ) {
myGroup = SMESH::SMESH_Group::_nil();
myMesh = SMESH::SMESH_Mesh::_nil();
- busy = false;
+ myIsBusy = false;
return;
}
Handle(SALOME_InteractiveObject) IO = aList.First();
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
if (myMesh->_is_nil())
{
- busy = false;
+ myIsBusy = false;
return;
}
myGroup = SMESH::SMESH_Group::_nil();
SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(IO);
if (aGroup->_is_nil())
{
- busy = false;
+ myIsBusy = false;
return;
}
- busy = false;
+ myIsBusy = false;
myCurrentLineEdit = 0;
init(aGroup);
- busy = true;
+ myIsBusy = true;
mySelectSubMesh->setEnabled(true);
mySelectGroup->setEnabled(true);
myGeomGroupBtn->setEnabled(true);
myGeomGroupLine->setEnabled(true);
}
myCurrentLineEdit = 0;
- busy = false;
+ myIsBusy = false;
if (!myCreate)
- {
- busy = false;
return;
- }
if (myTypeId == -1)
onTypeChanged(0);
setSelectionMode(myTypeId);
}
- busy = false;
+ myIsBusy = false;
return;
} else if (myCurrentLineEdit == myGeomGroupLine) {
- if (aNbSel != 1) {
+ if (aNbSel == 0) {
myGeomGroup = GEOM::GEOM_Object::_nil();
- busy = false;
+ myIsBusy = false;
return;
}
// Check if the object is a geometry group
if (!testResult || CORBA::is_nil(myGeomGroup)) {
myGeomGroup = GEOM::GEOM_Object::_nil();
- busy = false;
+ myIsBusy = false;
return;
}
// Check if group constructed on the same shape as a mesh or on its child
_PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
if (!aMeshSO) {
myGeomGroup = GEOM::GEOM_Object::_nil();
- busy = false;
+ myIsBusy = false;
return;
}
_PTR(SObject) anObj, aRef;
}
if (!isRefOrSubShape) {
myGeomGroup = GEOM::GEOM_Object::_nil();
- busy = false;
+ myIsBusy = false;
return;
}
}
- if (aNbSel >= 1) {
- if (aNbSel > 1) {
- if (myCurrentLineEdit == mySubMeshLine)
+ if(aNbSel >= 1) {
+ if(aNbSel > 1) {
+ if(myCurrentLineEdit == mySubMeshLine)
aString = tr("SMESH_SUBMESH_SELECTED").arg(aNbSel);
- else if (myCurrentLineEdit == myGroupLine || myCurrentLineEdit == myGeomGroupLine)
+ else if(myCurrentLineEdit == myGroupLine || myCurrentLineEdit == myGeomGroupLine)
aString = tr("SMESH_GROUP_SELECTED").arg(aNbSel);
} else {
aString = aList.First()->getName();
myActor = SMESH::FindActorByObject(myMesh);
}
- busy = false;
+ myIsBusy = false;
}
//=================================================================================
//=================================================================================
void SMESHGUI_GroupDlg::onAdd()
{
- const SALOME_ListIO& aList = mySelector->StoredIObjects();
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+
int aNbSel = aList.Extent();
if (aNbSel == 0 || !myActor || myMesh->_is_nil()) return;
- busy = true;
+ myIsBusy = true;
SMESH::ElementType aType = SMESH::ALL;
switch(myTypeId) {
}
if (myCurrentLineEdit == 0) {
- //if (aNbSel != 1) { busy = false; return; }
+ //if (aNbSel != 1) { myIsBusy = false; return; }
QString aListStr = "";
int aNbItems = 0;
if (myTypeId == 0) {
}
} else if (myCurrentLineEdit == mySubMeshLine) {
//SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
- const SALOME_ListIO& aList = mySelector->StoredIObjects();
+
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+
SALOME_ListIteratorOfListIO anIt (aList);
for (; anIt.More(); anIt.Next()) {
SMESH::SMESH_subMesh_var aSubMesh =
}
}
mySelectSubMesh->setChecked(false);
- busy = false;
+ myIsBusy = false;
onListSelectionChanged();
} else if (myCurrentLineEdit == myGroupLine) {
//SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
- const SALOME_ListIO& aList = mySelector->StoredIObjects();
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+
SALOME_ListIteratorOfListIO anIt (aList);
for (; anIt.More(); anIt.Next()) {
SMESH::SMESH_Group_var aGroup =
}
}
mySelectGroup->setChecked(false);
- busy = false;
+ myIsBusy = false;
onListSelectionChanged();
} else if (myCurrentLineEdit == myGeomGroupLine && !CORBA::is_nil(myGeomGroup)) {
case 6: aGroupType = SMESH::EDGE; break;
case 4: aGroupType = SMESH::FACE; break;
case 2: aGroupType = SMESH::VOLUME; break;
- default: busy = false; return;
+ default: myIsBusy = false; return;
}
if (aGroupType == aType) {
}
//VSR: mySelectGeomGroup->setChecked(false);
- busy = false;
+ myIsBusy = false;
onListSelectionChanged();
}
- busy = false;
+ myIsBusy = false;
// mySelectionMgr->clearSelected();
updateButtons();
}
//=================================================================================
void SMESHGUI_GroupDlg::onRemove()
{
- busy = true;
+ myIsBusy = true;
if (myCurrentLineEdit == 0) {
for (int i = myElements->count(); i > 0; i--) {
if (myElements->isSelected(i-1)) {
}
}
} else {
- const SALOME_ListIO& aList = mySelector->StoredIObjects();
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+
int aNbSel = aList.Extent();
- if (aNbSel == 0) { busy = false; return; }
+ if (aNbSel == 0) { myIsBusy = false; return; }
SMESH::ElementType aType = SMESH::ALL;
switch(myTypeId) {
if (myCurrentLineEdit == mySubMeshLine) {
//SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
- const SALOME_ListIO& aList = mySelector->StoredIObjects();
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+
SALOME_ListIteratorOfListIO anIt (aList);
for (; anIt.More(); anIt.Next()) {
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
else if (myCurrentLineEdit == myGroupLine) {
Standard_Boolean aRes;
//SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
- const SALOME_ListIO& aList = mySelector->StoredIObjects();
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+
SALOME_ListIteratorOfListIO anIt (aList);
for (; anIt.More(); anIt.Next()) {
SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
}
}
}
- busy = false;
+ myIsBusy = false;
updateButtons();
}
// myElements->update();
int i, k = myElements->count();
if (k > 0) {
- busy = true;
+ myIsBusy = true;
QStringList aSelected;
std::vector<int> anArray(k);
// QMemArray<int> anArray(k);
anItem = myElements->findItem(*it, Qt::ExactMatch);
if (anItem) myElements->setSelected(anItem, true);
}
- busy = false;
+ myIsBusy = false;
}
}
SMESHGUI_FilterDlg* myFilterDlg;
- bool myCreate;
+ bool myCreate, myIsBusy;
};
#endif // DIALOGBOX_GROUP_H
//=======================================================================
bool SMESHGUI_MoveNodesDlg::onApply()
{
- if (SMESHGUI::GetSMESHGUI()->isActiveStudyLocked())
+ if (mySMESHGUI->isActiveStudyLocked())
return false;
if (!isValid(true))
{
mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false);
- mySelector->SetSelectionMode(ActorSelection);
+ myViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState();
void SMESHGUI_MoveNodesDlg::enterEvent (QEvent*)
{
if (!isEnabled()) {
- SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
+ mySMESHGUI->EmitSignalDeactivateDialog();
// set selection mode
SMESH::SetPointRepresentation(true);
#include "SUIT_ViewWindow.h"
#include "SUIT_ViewManager.h"
#include "SUIT_MessageBox.h"
+#include "SUIT_Desktop.h"
#include "SalomeApp_Study.h"
-#include "SalomeApp_Application.h"
+#include "SalomeApp_SelectionMgr.h"
+#include "SVTK_Selector.h"
#include "SVTK_ViewWindow.h"
#include "SALOME_Actor.h"
#include "SALOME_ListIO.hxx"
-#include "SVTK_Selection.h"
#include "utilities.h"
}
class TNodeSimulation {
- SalomeApp_Application* myApplication;
- SUIT_ViewWindow* myViewWindow;
- SVTK_ViewWindow* myVTKViewWindow;
+ SVTK_ViewWindow* myViewWindow;
SALOME_Actor *myPreviewActor;
vtkDataSetMapper* myMapper;
vtkPoints* myPoints;
public:
- TNodeSimulation (SalomeApp_Application* theApplication)
+ TNodeSimulation(SVTK_ViewWindow* theViewWindow):
+ myViewWindow(theViewWindow)
{
- myApplication = theApplication;
- SUIT_ViewManager* mgr = theApplication->activeViewManager();
- if (!mgr) return;
- myViewWindow = mgr->getActiveView();
- myVTKViewWindow = GetVtkViewWindow(myViewWindow);
-
vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::New();
// Create points
myPreviewActor->SetProperty(aProp);
aProp->Delete();
- myVTKViewWindow->AddActor(myPreviewActor);
+ myViewWindow->AddActor(myPreviewActor);
}
void SetPosition (float x, float y, float z)
~TNodeSimulation()
{
- if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
- myVTKViewWindow->RemoveActor(myPreviewActor);
- }
+ myViewWindow->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
myMapper->RemoveAllInputs();
// class : SMESHGUI_NodesDlg()
// purpose :
//=================================================================================
-SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (QWidget* parent,
+SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule,
const char* name,
- SalomeApp_SelectionMgr* Sel,
bool modal,
- WFlags fl)
- : QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose)
+ WFlags fl):
+ QDialog(SMESH::GetDesktop(theModule),
+ name,
+ modal,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
+ mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
+ mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+ myViewWindow(SMESH::GetViewWindow(theModule)),
+ mySMESHGUI(theModule)
{
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
- (SUIT_Session::session()->activeApplication());
- mySimulation = new SMESH::TNodeSimulation (anApp);
+ mySimulation = new SMESH::TNodeSimulation(myViewWindow);
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
if (!name)
SMESHGUI_NodesDlgLayout->addWidget(GroupCoordinates, 1, 0);
/* Initialisation and display */
- Init(Sel);
+ Init();
}
//=======================================================================
// function : Init()
// purpose :
//=================================================================================
-void SMESHGUI_NodesDlg::Init (SalomeApp_SelectionMgr* Sel)
+void SMESHGUI_NodesDlg::Init ()
{
/* Get setting of step value from file configuration */
double step;
SpinBox_Y->SetValue(0.0);
SpinBox_Z->SetValue(0.0);
- mySelectionMgr = Sel;
- myMeshGUI = SMESHGUI::GetSMESHGUI();
- myMeshGUI->SetActiveDialogBox((QDialog*)this);
+ mySMESHGUI->SetActiveDialogBox((QDialog*)this);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(SpinBox_Z, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
- connect(myMeshGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
+ connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
/* to close dialog if study frame change */
- connect(myMeshGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
/* Move widget on the botton right corner of main widget */
int x, y;
- myMeshGUI->DefineDlgPosition(this, x, y);
+ mySMESHGUI->DefineDlgPosition(this, x, y);
this->move(x, y);
this->show();
// set selection mode
SMESH::SetPointRepresentation(true);
-#ifdef NEW_GUI
- mySelectionMgr->setSelectionModes(NodeSelection, true);
-#else
- mySelectionMgr->setSelectionModes(NodeSelection);
-#endif
+ myViewWindow->SetSelectionMode(NodeSelection);
SelectionIntoArgument();
}
//=================================================================================
bool SMESHGUI_NodesDlg::ClickOnApply()
{
- if (myMeshGUI->isActiveStudyLocked())
+ if (mySMESHGUI->isActiveStudyLocked())
return false;
if (myMesh->_is_nil()) {
if (anActor->hasIO()) {
if (SMESH_MeshObj *aMeshObj = dynamic_cast<SMESH_MeshObj*>(anActor->GetObject().get())) {
if (myMesh->_is_equivalent(aMeshObj->GetMeshServer())) {
-#ifdef NEW_GUI
- mySelectionMgr->clearSelected();
- mySelectionMgr->AddIObject(anActor->getIO(), false);
-#else
aList.Clear();
aList.Append(anActor->getIO());
mySelectionMgr->setSelectedObjects(aList, false);
-#endif
break;
}
}
//=================================================================================
void SMESHGUI_NodesDlg::ClickOnCancel()
{
- MESSAGE("SMESHGUI_NodesDlg::ClickOnCancel() 1");
disconnect(mySelectionMgr, 0, this, 0);
- mySelectionMgr->clearSelected();
- mySelectionMgr->setSelectionModes(ActorSelection);
+ myViewWindow->SetSelectionMode(ActorSelection);
- MESSAGE("SMESHGUI_NodesDlg::ClickOnCancel() 2");
mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(false);
- myMeshGUI->ResetState();
+ mySMESHGUI->ResetState();
reject();
- MESSAGE("SMESHGUI_NodesDlg::ClickOnCancel() 3");
}
//=================================================================================
mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(true);
- SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList);
+ const SALOME_ListIO& aList = mySelector->StoredIObjects();
if (aList.Extent() == 1) {
Handle(SALOME_InteractiveObject) anIO = aList.First();
if (anIO->hasEntry()) {
myMesh = SMESH::GetMeshByIO(anIO);
if (myMesh->_is_nil()) return;
QString aText;
- if (SMESH::GetNameOfSelectedNodes(mySelectionMgr, aText) == 1) {
+ if (SMESH::GetNameOfSelectedNodes(mySelector,anIO,aText) == 1) {
if (SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh.in())) {
if (SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh()) {
if (const SMDS_MeshNode* aNode = aMesh->FindNode(aText.toInt())) {
GroupCoordinates->setEnabled(false);
GroupButtons->setEnabled(false);
mySimulation->SetVisibility(false);
- myMeshGUI->ResetState();
- myMeshGUI->SetActiveDialogBox(0);
+ mySMESHGUI->ResetState();
+ mySMESHGUI->SetActiveDialogBox(0);
}
}
//=================================================================================
void SMESHGUI_NodesDlg::ActivateThisDialog()
{
- myMeshGUI->EmitSignalDeactivateDialog();
+ mySMESHGUI->EmitSignalDeactivateDialog();
GroupConstructors->setEnabled(true);
GroupCoordinates->setEnabled(true);
GroupButtons->setEnabled(true);
SMESH::SetPointRepresentation(true);
-#ifdef NEW_GUI
- mySelectionMgr->setSelectionModes(NodeSelection, true);
-#else
- mySelectionMgr->setSelectionModes(NodeSelection);
-#endif
+ myViewWindow->SetSelectionMode(NodeSelection);
SelectionIntoArgument();
}
#ifndef DIALOGBOX_NODES_H
#define DIALOGBOX_NODES_H
-#include "SalomeApp_SelectionMgr.h"
-
#include <qvariant.h>
#include <qdialog.h>
class QLineEdit;
class QPushButton;
class QRadioButton;
+
class SMESHGUI;
+class SVTK_Selector;
+class SVTK_ViewWindow;
class SMESHGUI_SpinBox;
+class SalomeApp_SelectionMgr;
namespace SMESH{
struct TNodeSimulation;
Q_OBJECT
public:
- SMESHGUI_NodesDlg (QWidget* parent = 0, const char* name = 0,
- SalomeApp_SelectionMgr* Sel = 0,
+ SMESHGUI_NodesDlg (SMESHGUI* theModule,
+ const char* name = 0,
bool modal = FALSE,
WFlags fl = 0);
~SMESHGUI_NodesDlg();
private:
-
SalomeApp_SelectionMgr* mySelectionMgr;
- SMESHGUI* myMeshGUI;
+ SVTK_ViewWindow* myViewWindow;
+ SVTK_Selector* mySelector;
+ SMESHGUI* mySMESHGUI;
SMESH::SMESH_Mesh_var myMesh;
SMESH::TNodeSimulation* mySimulation;
- void Init (SalomeApp_SelectionMgr*);
+ void Init ();
void enterEvent(QEvent* e);
void closeEvent(QCloseEvent*);
void hideEvent (QHideEvent *); /* ESC key */
//function : SMESHGUI_Selection
//purpose :
//=======================================================================
+SMESHGUI_Selection::SMESHGUI_Selection()
+: SalomeApp_Selection()
+{
+}
+
+//=======================================================================
+//function : ~SMESHGUI_Selection
+//purpose :
+//=======================================================================
+SMESHGUI_Selection::~SMESHGUI_Selection()
+{
+}
-SMESHGUI_Selection::SMESHGUI_Selection( const QString& client,
- SalomeApp_SelectionMgr* mgr )
+//=======================================================================
+//function : init
+//purpose :
+//=======================================================================
+void SMESHGUI_Selection::init( const QString& client, SalomeApp_SelectionMgr* mgr )
{
- myPopupClient = client;
-
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
- (SUIT_Session::session()->activeApplication()->activeStudy());
+ SalomeApp_Selection::init( client, mgr );
- if( mgr && appStudy )
+ if( mgr && study() )
{
- _PTR(Study) study = appStudy->studyDS();
+ _PTR(Study) aStudy = study()->studyDS();
SUIT_DataOwnerPtrList sel;
mgr->selected( sel, client );
SUIT_DataOwner* owner = ( SUIT_DataOwner* )( (*anIt ).get() );
SalomeApp_DataOwner* sowner = dynamic_cast<SalomeApp_DataOwner*>( owner );
if( sowner )
- myTypes.append( typeName( type( sowner, study ) ) );
+ myTypes.append( typeName( type( sowner, aStudy ) ) );
else
myTypes.append( "Unknown" );
}
}
}
-SMESHGUI_Selection::~SMESHGUI_Selection()
-{
-}
-
-//=======================================================================
-//function : count
-//purpose :
-//=======================================================================
-
-int SMESHGUI_Selection::count() const
-{
- return myTypes.count();
-}
-
//=======================================================================
//function : param
//purpose :
//=======================================================================
-
QtxValue SMESHGUI_Selection::param( const int ind, const QString& p ) const
{
QtxValue val;
- if ( p=="client" ) val = QtxValue( myPopupClient );
+ if ( p=="client" ) val = QtxValue( globalParam( p ) );
else if ( p=="type" ) val = QtxValue( myTypes[ind] );
else if ( p=="elemTypes" ) val = QtxValue( elemTypes( ind ) );
else if ( p=="numberOfNodes" ) val = QtxValue( numberOfNodes( ind ) );
else if ( p=="hasReference" ) val = QtxValue( hasReference( ind ) );
else if ( p=="isVisible" ) val = QtxValue( isVisible( ind ) );
- printf( "--> param() : [%s] = %s (%s)\n", p.latin1(), val.toString().latin1(), val.typeName() );
- if ( val.type() == QVariant::List )
- cout << "size: " << val.toList().count() << endl;
+// printf( "--> param() : [%s] = %s (%s)\n", p.latin1(), val.toString().latin1(), val.typeName() );
+// if ( val.type() == QVariant::List )
+// cout << "size: " << val.toList().count() << endl;
return val;
}
#ifndef SMESHGUI_SELECTION_HeaderFile
#define SMESHGUI_SELECTION_HeaderFile
-#include <QtxPopupMgr.h>
-
+#include "SalomeApp_Selection.h"
#include "SALOMEDSClient_definitions.hxx"
#include "SUIT_DataOwner.h"
class SalomeApp_DataOwner;
class SMESH_Actor;
-class SMESHGUI_Selection : public QtxPopupMgr::Selection
+class SMESHGUI_Selection : public SalomeApp_Selection
{
public:
- SMESHGUI_Selection( const QString&, SalomeApp_SelectionMgr* );
+ SMESHGUI_Selection();
virtual ~SMESHGUI_Selection();
+ virtual void init( const QString&, SalomeApp_SelectionMgr* );
virtual QtxValue param( const int , const QString& paramName ) const;
- virtual int count() const;
-
// got from object, not from actor
virtual int numberOfNodes( int ind ) const;
virtual QVariant isComputable( int ind ) const;
static QString typeName( const int type);
private:
- QString myPopupClient;
QStringList myTypes;
SUIT_DataOwnerPtrList myDataOwners;
};