From 64fa9a8d8919c1d6c0467068f87aa5cee30f963f Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 26 May 2008 15:01:53 +0000 Subject: [PATCH] To improve ELNO related selection --- src/CONVERTOR/VISU_ConvertorUtils.cxx | 18 ++++++++++++++++++ src/CONVERTOR/VISU_ConvertorUtils.hxx | 6 ++++++ src/VISUGUI/VisuGUI_Selection.cxx | 11 +++++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/CONVERTOR/VISU_ConvertorUtils.cxx b/src/CONVERTOR/VISU_ConvertorUtils.cxx index 53a2708a..78c84a03 100644 --- a/src/CONVERTOR/VISU_ConvertorUtils.cxx +++ b/src/CONVERTOR/VISU_ConvertorUtils.cxx @@ -233,6 +233,24 @@ namespace VISU return aDataSetAttributes->GetArray("VISU_FIELD") != NULL; } + //--------------------------------------------------------------- + bool + IsElnoData(vtkDataSet* theDataSet) + { + theDataSet->Update(); + + if ( vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData() ) + if ( aDataSetAttributes->GetArray( "ELNO_FIELD" ) != NULL ) + return true; + + if ( vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData() ) + if ( aDataSetAttributes->GetArray( "ELNO_POINT_COORDS" ) != NULL ) + return true; + + return false; + } + + //--------------------------------------------------------------- bool IsDataOnElnoCells(vtkDataSet* theDataSet) diff --git a/src/CONVERTOR/VISU_ConvertorUtils.hxx b/src/CONVERTOR/VISU_ConvertorUtils.hxx index 0b19a68d..cb2da444 100644 --- a/src/CONVERTOR/VISU_ConvertorUtils.hxx +++ b/src/CONVERTOR/VISU_ConvertorUtils.hxx @@ -90,6 +90,12 @@ namespace VISU bool IsDataOnCells(vtkDataSet* theDataSet); + //--------------------------------------------------------------- + VISU_CONVERTOR_EXPORT + bool + IsElnoData(vtkDataSet* theDataSet); + + //--------------------------------------------------------------- VISU_CONVERTOR_EXPORT bool diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index bb92fe97..53b40711 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -54,6 +54,8 @@ #include "SVTK_ViewWindow.h" #include "SVTK_Selector.h" +#include "VISU_ConvertorUtils.hxx" + #include "utilities.h" // OCCT Includes @@ -450,8 +452,13 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { 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)); + if ( !VISU::IsElnoData( aDataSet ) ) { + myScalarValLbl->setText( getValue( aPntData, aVTKID ) ); + myVectorValLbl->setText( getVector( aPntData, aVTKID ) ); + } else { + myScalarValLbl->setText( "< ELNO data >" ); + myVectorValLbl->setText( "< ELNO data >" ); + } const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper(); VISU::TStructuredId aStructuredId = aMapper->GetIndexesOfNode(anID); -- 2.39.2