myTabWidget = new QTabWidget( mainFrame() );
+ // Labels for header of points' and cells' tables
+ QStringList aLabels;
+ aLabels.append( "ID" );
+ aLabels.append( "X" );
+ aLabels.append( "Y" );
+ aLabels.append( "Z" );
+ aLabels.append( "I" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aLabels.append( "J" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aLabels.append( "K" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aLabels.append( tr("DATA_SCALAR_HDR") );
+ aLabels.append( tr("DATA_VECTOR_HDR") );
+
// Create Points pane
myPointsPane = new QWidget (mainFrame());
QVBoxLayout* aVBoxLayout = new QVBoxLayout(myPointsPane);
//aGridLay->setSpacing(6);
aGridLay->addWidget( new QLabel (tr("DATA_ID_LBL"), aDataGrp) , 0, 0 );
- aGridLay->addWidget( new QLabel (tr("DATA_SCALAR_LBL"), aDataGrp), 1, 0 );
- aGridLay->addWidget( new QLabel (tr("DATA_VECTOR_LBL"), aDataGrp), 2, 0 );
myIDValLbl = new QLineEdit ("", aDataGrp);
aGridLay->addWidget( myIDValLbl, 0, 1 );
aGridLay->addWidget( anIDBtn, 0, 2 );
connect(anIDBtn, SIGNAL(clicked()), this, SLOT(onPointIdEdit()));
- myScalarValLbl = new QLabel ("", aDataGrp);
- aGridLay->addWidget( myScalarValLbl, 1, 1, 1, 2 );
-
- myVectorValLbl = new QLabel ("", aDataGrp);
- myVectorValLbl->setMinimumWidth(150);
- aGridLay->addWidget( myVectorValLbl, 2, 1, 1, 2 );
-
aVBoxLayout->addWidget( aDataGrp );
- QGroupBox* aCoordGrp = new QGroupBox ( tr("POINT_COORD_TITLE"), myPointsPane);
- aGridLay = new QGridLayout (aCoordGrp);
- //aGridLay->setSpacing(6);
+ myListPoints = new QTableWidget (myCellsPane);
+ myListPoints->setEditTriggers( QAbstractItemView::NoEditTriggers );
+ myListPoints->setColumnCount(9);
+ myListPoints->setRowCount(0);
+ myListPoints->setColumnWidth(0, 40);
+ myListPoints->setColumnWidth(1, 40);
+ myListPoints->setColumnWidth(2, 40);
+ myListPoints->setColumnWidth(3, 40);
+ myListPoints->setColumnWidth(4, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ myListPoints->setColumnWidth(5, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ myListPoints->setColumnWidth(6, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ myListPoints->setSelectionMode(QAbstractItemView::NoSelection);
+ myListPoints->setHorizontalHeaderLabels( aLabels );
- aGridLay->addWidget( new QLabel ("X:", aCoordGrp), 0, 0 );
- myXValLbl = new QLabel ("", aCoordGrp);
- aGridLay->addWidget( myXValLbl, 0, 1 );
- //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aGridLay->addWidget( new QLabel ("I:", aCoordGrp), 0, 2 );
- myIValLbl = new QLabel ("-", aCoordGrp);
- aGridLay->addWidget( myIValLbl, 0, 3 );
- //ENK: 23.11.2006
- aGridLay->addWidget( new QLabel ("Y:", aCoordGrp), 1, 0 );
- myYValLbl = new QLabel ("", aCoordGrp);
- aGridLay->addWidget( myYValLbl, 1, 1 );
- //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aGridLay->addWidget( new QLabel ("J:", aCoordGrp), 1, 2 );
- myJValLbl = new QLabel ("-", aCoordGrp);
- aGridLay->addWidget( myJValLbl, 1, 3 );
- //ENK: 23.11.2006
- aGridLay->addWidget( new QLabel ("Z:",aCoordGrp ), 2, 0 );
- myZValLbl = new QLabel ("", aCoordGrp);
- aGridLay->addWidget( myZValLbl, 2, 1 );
- //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aGridLay->addWidget( new QLabel ("K:", aCoordGrp), 2, 2 );
- myKValLbl = new QLabel ("-", aCoordGrp);
- aGridLay->addWidget( myKValLbl, 2, 3 );
- //ENK: 23.11.2006
-
- aVBoxLayout->addWidget( aCoordGrp );
- aVBoxLayout->addStretch();
+ aVBoxLayout->addWidget(myListPoints, 1, 0);
// Create Cells pane
myCellsPane = new QWidget (mainFrame());
aCellLayout->addWidget(aCellGrp, 0, 0);
- myListPoints = new QTableWidget (myCellsPane);
- myListPoints->setEditTriggers( QAbstractItemView::NoEditTriggers );
- myListPoints->setColumnCount(9);
- myListPoints->setRowCount(0);
- myListPoints->setColumnWidth(0, 40);
- myListPoints->setColumnWidth(1, 40);
- myListPoints->setColumnWidth(2, 40);
- myListPoints->setColumnWidth(3, 40);
- myListPoints->setColumnWidth(4, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- myListPoints->setColumnWidth(5, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- myListPoints->setColumnWidth(6, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- myListPoints->setSelectionMode(QAbstractItemView::NoSelection);
-
- QStringList aLabels;
- aLabels.append( "ID" );
- aLabels.append( "X" );
- aLabels.append( "Y" );
- aLabels.append( "Z" );
- aLabels.append( "I" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aLabels.append( "J" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aLabels.append( "K" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aLabels.append( tr("CELL_DATA_SCALAR_HDR") );
- aLabels.append( tr("CELL_DATA_VECTOR_HDR") );
- myListPoints->setHorizontalHeaderLabels( aLabels );
-
- aCellLayout->addWidget(myListPoints, 1, 0);
+ myCellListPoints = new QTableWidget (myCellsPane);
+ myCellListPoints->setEditTriggers( QAbstractItemView::NoEditTriggers );
+ myCellListPoints->setColumnCount(9);
+ myCellListPoints->setRowCount(0);
+ myCellListPoints->setColumnWidth(0, 40);
+ myCellListPoints->setColumnWidth(1, 40);
+ myCellListPoints->setColumnWidth(2, 40);
+ myCellListPoints->setColumnWidth(3, 40);
+ myCellListPoints->setColumnWidth(4, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ myCellListPoints->setColumnWidth(5, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ myCellListPoints->setColumnWidth(6, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ myCellListPoints->setSelectionMode(QAbstractItemView::NoSelection);
+ myCellListPoints->setHorizontalHeaderLabels( aLabels );
+
+ aCellLayout->addWidget(myCellListPoints, 1, 0);
// Actor Pane
myActorsPane = new QWidget (mainFrame());
break;
default:
close();
- //delete this;
return;
}
vtkDataSet* aDataSet = anVISUActor->GetMapper()->GetInput();
vtkPointData* aPntData = aDataSet->GetPointData();
- // controls are cleared in case of multi-selection of sub-elements
- //for (int ind = 1; ind <= aMapIndex.Extent(); ind++) {
- if( aMapIndex.Extent() == 1 ) {
- int anID = aMapIndex(1);
+ QTableWidget* aTable = 0;
+ if( aType == 1 )
+ aTable = myCellListPoints;
+ else if( aType == 2 )
+ aTable = myListPoints;
+
+ if( !aTable )
+ {
+ myFl = false;
+ return;
+ }
+
+ bool aSingleSelection = aMapIndex.Extent() == 1;
+
+ for (int ind = 1; ind <= aMapIndex.Extent(); ind++) {
+ int anID = aMapIndex(ind);
switch (aType) {
case 2:
int aVTKID = anVISUActor->GetNodeVTKID(anID);
if(aVTKID >= 0){
vtkFloatingPointType* aCoord = anVISUActor->GetNodeCoord(anID);
- myXValLbl->setText( QString::number( aCoord[0] ) );
- myYValLbl->setText( QString::number( aCoord[1] ) );
- myZValLbl->setText( QString::number( aCoord[2] ) );
- myIDValLbl->setText( QString::number(anID) );
- myScalarValLbl->setText(getValue(aPntData, aVTKID));
- myVectorValLbl->setText(getVector(aPntData, aVTKID));
- //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper();
- VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(anID);
- switch(aVec.size()){
- case 3:
- myKValLbl->setText(QString::number(aVec[2]));
- case 2:
- myJValLbl->setText(QString::number(aVec[1]));
- case 1:
- myIValLbl->setText(QString::number(aVec[0]));
- break;
- default:
- myIValLbl->setText("-");
- myJValLbl->setText("-");
- myKValLbl->setText("-");
- }
- //ENK: 23.11.2006
+
+ if( aSingleSelection )
+ myIDValLbl->setText( QString::number(anID) );
+
+ vtkIdType aNodeObjId = anVISUActor->GetNodeObjId(aVTKID);
+ TCoordArray aCoordArray(aCoord, aCoord + 3);
+ aPointCoordsMap[aNodeObjId] = aCoordArray;
}
}
break;
if (aCell != NULL) {
int aNbOfPoints = aCell->GetNumberOfPoints();
if ( aNbOfPoints > 0 ) {
- myCellIDValLbl->setText( QString::number(anID) );
- myCellScalarValLbl->setText(getValue(aCellData, aVTKID));
- myCellVectorValLbl->setText(getVector(aCellData, aVTKID));
+ if( aSingleSelection )
+ {
+ myCellIDValLbl->setText( QString::number(anID) );
+ myCellScalarValLbl->setText(getValue(aCellData, aVTKID));
+ myCellVectorValLbl->setText(getVector(aCellData, aVTKID));
+ }
vtkIdList *aPointList = aCell->GetPointIds();
for (int i = 0; i < aNbOfPoints; i++) {
}
}
- myListPoints->setRowCount(aPointCoordsMap.size());
+ aTable->setRowCount(aPointCoordsMap.size());
TPointCoordsMap::const_iterator anIter = aPointCoordsMap.begin();
const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper();
- for (int i = 0; anIter != aPointCoordsMap.end() && i < myListPoints->rowCount(); anIter++, i++) {
- myListPoints->model()->setHeaderData( i, Qt::Vertical, QVariant(QString::number( i )), Qt::DisplayRole );
+ for (int i = 0; anIter != aPointCoordsMap.end() && i < aTable->rowCount(); anIter++, i++) {
+ aTable->model()->setHeaderData( i, Qt::Vertical, QVariant(QString::number( i )), Qt::DisplayRole );
vtkIdType aNodeObjId = anIter->first;
//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(aNodeObjId);
}
//ENK: 23.11.2006
- QAbstractItemModel* aModel = myListPoints->model();
+ QAbstractItemModel* aModel = aTable->model();
aModel->setData( aModel->index(i,0), QVariant(QString::number( aNodeObjId )), Qt::DisplayRole );
const TCoordArray& aCoordArray = anIter->second;
aModel->setData( aModel->index(i,1), QVariant(QString::number( aCoordArray[0] )), Qt::DisplayRole );
aModel->setData( aModel->index(i,8), QVariant(getVector(aPntData, aNodeVTKId)), Qt::DisplayRole );
}
//for(int aColumnId = 0; aColumnId < 9; aColumnId++)
- myListPoints->resizeColumnsToContents();
+ aTable->resizeColumnsToContents();
}
}
myFl = false;
switch (aType) {
case 2:
myIDValLbl->setText( "" );
- myXValLbl->setText( "" );
- myYValLbl->setText( "" );
- myZValLbl->setText( "" );
- myIValLbl->setText( "-" );//ENK: 23.11.2006 - PAL13176
- myJValLbl->setText( "-" );//ENK: 23.11.2006 - PAL13176
- myKValLbl->setText( "-" );//ENK: 23.11.2006 - PAL13176
- myScalarValLbl->setText("");
- myVectorValLbl->setText("");
+ myListPoints->setRowCount(0);
break;
case 1:
myCellIDValLbl->setText( "" );
myCellScalarValLbl->setText("");
myCellVectorValLbl->setText("");
- myListPoints->setRowCount(0);
+ myCellListPoints->setRowCount(0);
break;
case 0:
myXPosLbl->setText("");