[vtkusers] Select a POINT DATA set from .vtk File
Francesco Babboni
jimmigoo at gmail.com
Thu Jul 30 10:23:27 EDT 2009
Hi to all!
I would like to ask for a big problem I have.
I'm loading a vtkStructuredGrid from a vtk file in these format:
----
# vtk DataFile Version 3.0
vtk output
ASCII
DATASET STRUCTURED_GRID
DIMENSIONS 249 195 1
POINTS 48555 double
3.824635e+005 6.534164e+006 0
....
CELL_DATA 48112
SCALARS pressureVar double
LOOKUP_TABLE default
0 1 2 3 ..... 48111
SCALARS elevationVar double
LOOKUP_TABLE default
0 1 2 3 ..... 48111
------
I created a pipeline in Paraview, and everything worked
vtkStructuredGrid
CellDataToPointData
Threshold (ON pressureVar points)
WarpScalar (ON elevationVar points)
Elevation
and displaying pressureVar values.
I would like to know how to select elevationVar to get WarpScalar filter,
then select pressureVar to color mapping the rendering.
I searched on the Net, looking for how SetInputArrayToProcess works,
but it doesn't works on my code.
I look forward for any reply, AS SOON AS POSSIBLE!!!!
Kind Regards,
Francesco.
----------------------------------
vtkStructuredGridReader* sgridreader = vtkStructuredGridReader::New();
sgridreader->SetFileName(VtkFile);
sgridreader->Update();
//CellDataToPointData already defined
CellToPoint->SetInputConnection(0,sgridreader->GetOutputPort(0));
vtkThreshold* Threshold = vtkThreshold::New();
Threshold ->SetInputConnection(0,RadarSgrid->GetOutputPort(0));
* *Threshold *->SetSelectedComponent(0);* (I would like to find a method
like this)
Threshold ->ThresholdBetween(0,1.1);
Threshold ->Update();
double pressureValues[2];
Threshold->GetScalarRange(pressureValues);
////warp polygons based on elevation
Warp->SetInputConnection(0,Threshold>GetOutputPort(0));
Warp->SetInputArrayToProcess(1,0,0,vtkDataObject::FIELD_ASSOCIATION_POINTS,
"elevationVar");
//HERE IT DOESN'T WORKS, IT DOESN'T MAKE WARP by ELEVATION VALUES!
Warp->SetNormal(0.0, 0.0, 1.0);
Warp->UseNormalOn();
Warp->SetScaleFactor(1.05);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090730/9cf74e35/attachment.htm>
More information about the vtkusers
mailing list