[Paraview] problems setting vtkDoubleArray with 3 components
Jérôme
jerome.velut at gmail.com
Sun Mar 15 17:46:20 EDT 2009
Hi !
Maybe I am an old-fashion programmer, but I don't think you are allowed to
initialized an array in this way. The braces should delimit constant
values... The best I can remember, the compiler should outputs errors for
your line :
double Tuple[3] = {xm_array -> GetValue(i), ym_array -> GetValue(i), 0.0};
Which one do you use?
Then for your specific problem, I recommend you to use the
InsertNextTupleValue from vtkDoubleArray instead of InsertNextTuple, that is
a pure virtual function of the parent class vtkDataArray.
I hope expert programmers will take a look at this !
Best regards,
Jerome
2009/3/15 Natalie Happenhofer <nataliehapp at hotmail.com>
> Hi!
> I´d like to set a vtkDoubleArray with 3 Components, it should be a vector
> array, the code looks like this:
>
>
> vtkDoubleArray* momentum = vtkDoubleArray::New();
> momentum -> SetNumberOfTuples(numOfTuples);
> momentum -> SetNumberOfComponents(3);
>
> for(vtkIdType i = 0; i < numOfTuples; i++)
> {double Tuple[3] = {xm_array -> GetValue(i), ym_array -> GetValue(i),
> 0.0};
>
> momentum -> InsertNextTuple(Tuple);
> }
>
> Executing the code, I get the following error:
> " Point array Momentum with 3 components, has 78520 tuples but there are
> only 58890 points"
>
> numOfTuples just has the value 58890, it should not be inserting more
> tuples than that.. ?
>
> thx,
> Natalie
>
>
> ------------------------------
> Casi 50 razones para tener el nuevo Messenger. ¡Conócelas aquí y bájate el
> nuevo! <http://www.nuevomessenger2009.com/>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090315/9efd9f1d/attachment.htm>
More information about the ParaView
mailing list