#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
-#include "SalomeApp_SelectionMgr.h"
-#include "SalomeApp_VTKSelector.h"
+#include "LightApp_SelectionMgr.h"
+#include "LightApp_VTKSelector.h"
#include "SUIT_MessageBox.h"
#include "SUIT_ViewWindow.h"
#include <qlineedit.h>
#include <qvalidator.h>
#include <qtable.h>
-#include <qlistview.h>
// VTK Includes
#include <vtkDataSetMapper.h>
mySelectionDlg->close(true);
setCaption( "Data on elements" );
- setSizeGripEnabled( TRUE );
+ setSizeGripEnabled(TRUE);
- QGridLayout* TopLayout = new QGridLayout(this);
+ QGridLayout* TopLayout = new QGridLayout (this);
TopLayout->setSpacing(6);
TopLayout->setMargin(11);
TopLayout->setRowStretch(0, 0);
TopLayout->setRowStretch(2, 1);
TopLayout->setRowStretch(3, 0);
- QHButtonGroup* aTypeBox = new QHButtonGroup("Selection", this);
+ QHButtonGroup* aTypeBox = new QHButtonGroup ("Selection", this);
- QRadioButton* aPointBtn = new QRadioButton("Point", aTypeBox);
- QRadioButton* aCellBtn = new QRadioButton("Cell", aTypeBox);
- QRadioButton* aActorBtn = new QRadioButton("Actor", aTypeBox);
+ QRadioButton* aPointBtn =
+ new QRadioButton ("Point", aTypeBox);
+ new QRadioButton ("Cell" , aTypeBox);
+ new QRadioButton ("Actor", aTypeBox);
aPointBtn->setChecked(true);
connect(aTypeBox, SIGNAL(clicked(int)), this, SLOT(onSelectionChange(int)));
TopLayout->addWidget(aTypeBox, 0, 0);
- QWidget* aNamePane = new QWidget(this);
- QGridLayout* aNameLay = new QGridLayout(aNamePane);
+ QWidget* aNamePane = new QWidget (this);
+ QGridLayout* aNameLay = new QGridLayout (aNamePane);
- QLabel* aMeshLbl = new QLabel("Mesh name: ", aNamePane);
- myMeshName = new QLabel(aNamePane);
+ QLabel* aMeshLbl = new QLabel ("Mesh name: ", aNamePane);
+ myMeshName = new QLabel (aNamePane);
- QLabel* aFieldLbl = new QLabel("Field name: ", aNamePane);
- myFieldName = new QLabel(aNamePane);
+ QLabel* aFieldLbl = new QLabel ("Field name: ", aNamePane);
+ myFieldName = new QLabel (aNamePane);
aNameLay->addWidget(aMeshLbl, 0, 0);
aNameLay->addWidget(myMeshName, 0, 1);
TopLayout->addWidget(aNamePane, 1, 0);
- myWidgetStack = new QWidgetStack(this);
+ myWidgetStack = new QWidgetStack (this);
// Create Points pane
- myPointsPane = new QVBox(myWidgetStack);
+ myPointsPane = new QVBox (myWidgetStack);
myPointsPane->layout()->setSpacing(6);
- QGroupBox* aDataGrp = new QGroupBox(2, Qt::Horizontal, "Data of Point", myPointsPane);
+ QGroupBox* aDataGrp = new QGroupBox (2, Qt::Horizontal, "Data of Point", myPointsPane);
aDataGrp->layout()->setSpacing(6);
- QLabel* aIDLbl = new QLabel("ID:", aDataGrp);
- myIDValLbl = new QLineEdit("", aDataGrp);
- QIntValidator* aIntValidator = new QIntValidator(myIDValLbl);
+ new QLabel ("ID:", aDataGrp);
+ myIDValLbl = new QLineEdit ("", aDataGrp);
+ QIntValidator* aIntValidator = new QIntValidator (myIDValLbl);
aIntValidator->setBottom(0);
myIDValLbl->setValidator(aIntValidator);
connect(myIDValLbl, SIGNAL(textChanged(const QString&)), this, SLOT(onPointIdEdit(const QString&)));
- QLabel* aValueLbl = new QLabel("Scalar Value:", aDataGrp);
- myScalarValLbl = new QLabel("", aDataGrp);
- QLabel* aVectorLbl = new QLabel("Vector Value:", aDataGrp);
- myVectorValLbl = new QLabel("", aDataGrp);
+ new QLabel ("Scalar Value:", aDataGrp);
+ myScalarValLbl = new QLabel ("", aDataGrp);
+ new QLabel ("Vector Value:", aDataGrp);
+ myVectorValLbl = new QLabel ("", aDataGrp);
myVectorValLbl->setMinimumWidth(150);
- QGroupBox* aCoordGrp = new QGroupBox(2, Qt::Horizontal, "Coordinates", myPointsPane);
+ QGroupBox* aCoordGrp = new QGroupBox (2, Qt::Horizontal, "Coordinates", myPointsPane);
aCoordGrp->layout()->setSpacing(6);
- QLabel* aXLbl = new QLabel("X:", aCoordGrp);
- myXValLbl = new QLabel("", aCoordGrp);
- QLabel* aYLbl = new QLabel("Y:", aCoordGrp);
- myYValLbl = new QLabel("", aCoordGrp);
- QLabel* aZLbl = new QLabel("Z:",aCoordGrp );
- myZValLbl = new QLabel("", aCoordGrp);
+ new QLabel ("X:", aCoordGrp);
+ myXValLbl = new QLabel ("", aCoordGrp);
+ new QLabel ("Y:", aCoordGrp);
+ myYValLbl = new QLabel ("", aCoordGrp);
+ new QLabel ("Z:",aCoordGrp );
+ myZValLbl = new QLabel ("", aCoordGrp);
myWidgetStack->addWidget(myPointsPane, 0);
// Create Cells pane
- myCellsPane = new QWidget(myWidgetStack);
- QGridLayout* aCellLayout = new QGridLayout(myCellsPane);
+ myCellsPane = new QWidget (myWidgetStack);
+ QGridLayout* aCellLayout = new QGridLayout (myCellsPane);
aCellLayout->setSpacing(6);
aCellLayout->setRowStretch(0, 0);
aCellLayout->setRowStretch(1, 1);
QGroupBox* aCellGrp = new QGroupBox(2, Qt::Horizontal, "Data of Cell", myCellsPane);
- QLabel* aCellIDLbl = new QLabel("ID:", aCellGrp);
- myCellIDValLbl = new QLineEdit("", aCellGrp);
+ new QLabel ("ID:", aCellGrp);
+ myCellIDValLbl = new QLineEdit ("", aCellGrp);
myCellIDValLbl->setValidator(aIntValidator);
connect(myCellIDValLbl, SIGNAL(textChanged(const QString&)), this, SLOT(onCellIdEdit(const QString&)));
- QLabel* aCellValueLbl = new QLabel("Scalar Value:", aCellGrp);
- myCellScalarValLbl = new QLabel("", aCellGrp);
- QLabel* aCellVectorLbl = new QLabel("Vector Value:", aCellGrp);
- myCellVectorValLbl = new QLabel("", aCellGrp);
+ new QLabel ("Scalar Value:", aCellGrp);
+ myCellScalarValLbl = new QLabel ("", aCellGrp);
+ new QLabel ("Vector Value:", aCellGrp);
+ myCellVectorValLbl = new QLabel ("", aCellGrp);
aCellLayout->addWidget(aCellGrp, 0, 0);
- myListPoints = new QTable(myCellsPane);
+ myListPoints = new QTable (myCellsPane);
myListPoints->setReadOnly(true);
myListPoints->setNumCols(6);
myListPoints->setNumRows(0);
myWidgetStack->addWidget(myCellsPane, 1);
// Actor Pane
- myActorsPane = new QVBox(myWidgetStack);
+ myActorsPane = new QVBox (myWidgetStack);
myActorsPane->layout()->setSpacing(6);
- QGroupBox* aPosGrp = new QGroupBox(2, Qt::Horizontal, "Position", myActorsPane);
+ QGroupBox* aPosGrp = new QGroupBox (2, Qt::Horizontal, "Position", myActorsPane);
aPosGrp->layout()->setSpacing(6);
- QLabel* aXPosLbl = new QLabel("X:", aPosGrp);
- myXPosLbl = new QLabel("0", aPosGrp);
- QLabel* aYPosLbl = new QLabel("Y:", aPosGrp);
- myYPosLbl = new QLabel("0", aPosGrp);
- QLabel* aZPosLbl = new QLabel("Z:", aPosGrp);
- myZPosLbl = new QLabel("0", aPosGrp);
-
- QGroupBox* aSizeGrp = new QGroupBox(2, Qt::Horizontal, "Size", myActorsPane);
+ new QLabel ("X:", aPosGrp);
+ myXPosLbl = new QLabel ("0", aPosGrp);
+ new QLabel ("Y:", aPosGrp);
+ myYPosLbl = new QLabel ("0", aPosGrp);
+ new QLabel ("Z:", aPosGrp);
+ myZPosLbl = new QLabel ("0", aPosGrp);
+
+ QGroupBox* aSizeGrp = new QGroupBox (2, Qt::Horizontal, "Size", myActorsPane);
aSizeGrp->layout()->setSpacing(6);
- QLabel* aXSizeLbl = new QLabel("dX:", aSizeGrp);
- myDXLbl = new QLabel("0", aSizeGrp);
- QLabel* aYSizeLbl = new QLabel("dY:", aSizeGrp);
- myDYLbl = new QLabel("0", aSizeGrp);
- QLabel* aZSizeLbl = new QLabel("dZ:",aSizeGrp );
- myDZLbl = new QLabel("0", aSizeGrp);
+ new QLabel ("dX:", aSizeGrp);
+ myDXLbl = new QLabel ("0", aSizeGrp);
+ new QLabel ("dY:", aSizeGrp);
+ myDYLbl = new QLabel ("0", aSizeGrp);
+ new QLabel ("dZ:",aSizeGrp );
+ myDZLbl = new QLabel ("0", aSizeGrp);
myWidgetStack->addWidget(myActorsPane, 2);
TopLayout->addWidget(myWidgetStack, 2, 0);
// Create buttons group
- QHBox* aBtnBox = new QHBox(this);
+ QHBox* aBtnBox = new QHBox (this);
QHBoxLayout* aBtnLayout = (QHBoxLayout*)aBtnBox->layout();
aBtnLayout->addStretch();
- QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox);
+ QPushButton* aCloseBtn = new QPushButton (tr("BUT_CLOSE"), aBtnBox);
connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close()));
TopLayout->addWidget(aBtnBox, 3, 0);
myFl = false;
- SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
// Activate Points pane
+ SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
myWidgetStack->raiseWidget(myPointsPane);
if (aSVTKVW)
aSVTKVW->SetSelectionMode(NodeSelection);
#define ABS(a) (a>=0)?a:-a
void VisuGUI_SelectionDlg::onSelectionEvent() {
+ SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
+ if (!aSVTKVW) return;
+
if (myFl) return;
myFl = true;
+
int aType = myWidgetStack->id(myWidgetStack->visibleWidget());
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
(SUIT_Session::session()->activeApplication());
- SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
- if (!aSVTKVW) return;
SVTK_Selector* aSelector = aSVTKVW->GetSelector();
VISU::Prs3d_i* aPrs3d = NULL;
float* aCoord;
vtkIdList *aPointList = aCell->GetPointIds();
- QListViewItem* anItem = NULL;
for (int i = 0; i < aNbOfPoints; i++) {
int idCurrent = aPointList->GetId(i);
bool onIdEdit (const QString& theText,
TDataSetMethod theMethod,
bool theIsCell,
- SalomeApp_SelectionMgr* theSelectionMgr,
+ LightApp_SelectionMgr* theSelectionMgr,
QLabel* theMeshName,
QString theValue,
QLabel* theFieldName)
bool anIsSelected = onIdEdit(theText,aMethod,false,mySelectionMgr,
myMeshName,tr("WRN_NO_AVAILABLE_DATA"),
myFieldName);
- if (!anIsSelected)
+ if (anIsSelected)
+ // as selection manager doesn't send signal currentSelectionChanged()
+ onSelectionEvent();
+ else
clearFields();
}
bool anIsSelected = onIdEdit(theText,aMethod,true,mySelectionMgr,
myMeshName,tr("WRN_NO_AVAILABLE_DATA"),
myFieldName);
- if (!anIsSelected)
+ if (anIsSelected)
+ // as selection manager doesn't send signal currentSelectionChanged()
+ onSelectionEvent();
+ else
clearFields();
}