From: apo Date: Mon, 26 May 2008 15:01:53 +0000 (+0000) Subject: To improve ELNO related selection X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR_ELNO_visualization;p=modules%2Fvisu.git To improve ELNO related selection --- 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);