From edc15a218bc88620c8694efefb72e9a734053880 Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 15 Nov 2005 08:13:09 +0000 Subject: [PATCH] To show all data in picking functionality --- src/OBJECT/VISU_GaussPtsAct.cxx | 29 ++++++++++++++++++++--------- src/PIPELINE/VISU_Extractor.cxx | 3 ++- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 14b6921e..a39c6266 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -47,7 +47,10 @@ #include #include +#include + #include +#include #include #include @@ -720,12 +723,9 @@ VISU_GaussPtsAct float aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.}; // vtkDataSet* aDataSet = GetInput(); - vtkCellData* aCellData = aDataSet->GetCellData(); + vtkCellData* aDataSetAttributes = aDataSet->GetCellData(); // - vtkDataArray* aScalarArray = aCellData->GetScalars(); - vtkDataArray *aVectorArray = aCellData->GetVectors(); - // - if(aScalarArray){ + if(vtkDataArray* aScalarArray = aDataSetAttributes->GetScalars()){ aVal = aScalarArray->GetTuple1(aVtkId); aRadius = myGaussPointsPL->GetPointSize(aVtkId, aScalarArray); // @@ -734,7 +734,7 @@ VISU_GaussPtsAct GetScalarBarCtrl()->Update(); // float aPyramidHeight = myPickingSettings->GetPyramidHeight(); - aPyramidHeight=aPyramidHeight*myGaussPointsPL->GetMaxPointSize(); + aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize(); myCursorPyramidSelected->Init(aPyramidHeight, aRadius, aNodeCoord, @@ -756,9 +756,20 @@ VISU_GaussPtsAct aStr<<"\nLocalPntID: "<GetTuple3(aVtkId); - aStr<<"\nVector: {"<GetArray("VISU_FIELD")){ + if(vtkFloatArray *aFloatArray = dynamic_cast(aFieldArray)){ + int aNbComp = aFloatArray->GetNumberOfComponents(); + aStr<<"\nData: {"; + int anId = 0; + while(anId < aNbComp){ + float aComp = aFloatArray->GetComponent(aVtkId,anId++); + aStr<GetVectors(); vtkDataArray* aFieldArray = theInputData->GetArray("VISU_FIELD"); if(vtkFloatArray *aFloatArray = dynamic_cast(aFieldArray)){ int aNbComp = aFloatArray->GetNumberOfComponents(); @@ -104,6 +103,7 @@ void VISU_Extractor::Execute(){ else output->GetPointData()->CopyScalarsOn(); outData->PassData(inData); + outData->AddArray(inData->GetArray("VISU_FIELD")); }else{ output->GetCellData()->CopyVectorsOn(); int aNbElems = input->GetNumberOfCells(); @@ -113,5 +113,6 @@ void VISU_Extractor::Execute(){ else output->GetCellData()->CopyScalarsOn(); outData->PassData(inData); + outData->AddArray(inData->GetArray("VISU_FIELD")); } } -- 2.39.2