#include <vtkTextProperty.h>
#include <vtkCellData.h>
+#include <vtkPointData.h>
+
#include <vtkDataArray.h>
+#include <vtkFloatArray.h>
#include <vtkSphereSource.h>
#include <vtkPolyDataMapper.h>
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);
//
GetScalarBarCtrl()->Update();
//
float aPyramidHeight = myPickingSettings->GetPyramidHeight();
- aPyramidHeight=aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
+ aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
myCursorPyramidSelected->Init(aPyramidHeight,
aRadius,
aNodeCoord,
aStr<<"\nLocalPntID: "<<aLocalPntID;
aStr<<"\nScalar: "<<aVal;
}
- if(aVectorArray) {
- float* pVec = aVectorArray->GetTuple3(aVtkId);
- aStr<<"\nVector: {"<<pVec[0]<<"; "<<pVec[1]<<"; "<<pVec[2]<<"}";
+
+ if(vtkDataArray* aFieldArray = aDataSetAttributes->GetArray("VISU_FIELD")){
+ if(vtkFloatArray *aFloatArray = dynamic_cast<vtkFloatArray*>(aFieldArray)){
+ int aNbComp = aFloatArray->GetNumberOfComponents();
+ aStr<<"\nData: {";
+ int anId = 0;
+ while(anId < aNbComp){
+ float aComp = aFloatArray->GetComponent(aVtkId,anId++);
+ aStr<<aComp;
+ if(anId < aNbComp)
+ aStr<<"; ";
+ }
+ aStr<<"}";
+ }
}
//
// myTextActor
{
if(theNbElems < 1 )
return;
- vtkDataArray* aVectors = theInputData->GetVectors();
vtkDataArray* aFieldArray = theInputData->GetArray("VISU_FIELD");
if(vtkFloatArray *aFloatArray = dynamic_cast<vtkFloatArray*>(aFieldArray)){
int aNbComp = aFloatArray->GetNumberOfComponents();
else
output->GetPointData()->CopyScalarsOn();
outData->PassData(inData);
+ outData->AddArray(inData->GetArray("VISU_FIELD"));
}else{
output->GetCellData()->CopyVectorsOn();
int aNbElems = input->GetNumberOfCells();
else
output->GetCellData()->CopyScalarsOn();
outData->PassData(inData);
+ outData->AddArray(inData->GetArray("VISU_FIELD"));
}
}