[Paraview] casting vtkPointData* to double*

David E DeMarle dave.demarle at kitware.com
Thu Sep 4 08:57:13 EDT 2008


vtkPointData is a collection of arrays (for example temperature,
density, velocity), each of which may have multiple components (for
example VEL_X, VEL_Y, VEL_Z) and multiple tuples (the temperature at
the first point, the temperature at the second point, ..., the
temperature at the millionth point). vtkPointData::GetScalars() will
give you access to the currently active scalar array. You will then
have to get access to the raw pointer or use element indexing (both of
which are descibed in the vtkDataArray documentation) to do element
wise arithmetic. Lastly, you may want to look at the calculator
filter.

cheers,
Dave DeMarle


On Thu, Sep 4, 2008 at 3:23 AM, Natalie Happenhofer
<nataliehapp at hotmail.com> wrote:
> Hi!
> I´m writing a filter and I want to perform arithmetic operations, i.e. "+="
> with the scalar data associated to each point of my grid. So I get the Point
> Data from the input file:
>
> void vtkHorizontalAverage::Execute()
> {vtkStructuredGrid *input = this->GetInput();
> vtkStructuredGrid *output = this->GetOutput();
>
>  vtkPointData *inPtr = input->GetPointData();
>  vtkPointData *outPtr = output->GetPointData();
> ...
>
> here and now I want to apply the += operator, but I have no idea how to cast
> my vtkPointData - object, since I do not really know where to fit the cast
> operator in, to the vtkPointData class or to the vtkDataArray..
>
> I could also use a reinterpretcast, but I´m not sure if the format of the
> data in vtkPointData is double or float..
>
> So, any help would be apreciated!
> thx,
> NH
>
>
>
> ________________________________
> Express yourself instantly with MSN Messenger! MSN Messenger
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list