[Paraview] problems setting vtkDoubleArray with 3 components

Natalie Happenhofer nataliehapp at hotmail.com
Wed Mar 18 11:23:30 EDT 2009


Ok, thanks a lot, that works! 

Greetings,
Natalie

> Date: Sun, 15 Mar 2009 18:37:22 -0400
> Subject: Re: [Paraview] problems setting vtkDoubleArray with 3 components
> From: berk.geveci at kitware.com
> To: bob.obara at kitware.com
> CC: nataliehapp at hotmail.com; paraview at paraview.org
> 
> That's correct.
> 
> On Sun, Mar 15, 2009 at 6:10 PM, Robert Michael O'Bara
> <bob.obara at kitware.com> wrote:
> > Hi All,
> >
> > I'm not 100% sure but I think you must call SetNumberOfComponents prior to
> > SetNumberOfTuples.
> >
> > Bob
> >
> > Robert M. O'Bara, MEng.
> > Research & Development Engineer
> >
> > On Mar 15, 2009, at 5:50 PM, Burlen Loring wrote:
> >
> >> Also, if you SetNumberOfComponents, and SetNumberOfTuples, you want to use
> >> SetTuple(i,Tuple) not InsertNextTuple, because that will add them at the
> >> end.
> >>
> >> Natalie Happenhofer wrote:
> >>>
> >>> 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
> >>>
> >>
> >> _______________________________________________
> >> 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
> >
> > _______________________________________________
> > 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
> >

_________________________________________________________________
¿Quieres saber cómo va a estar el clima mañana? Ingresa ahora a MSN
http://tiempo.latam.msn.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090318/bf329c4a/attachment-0001.htm>


More information about the ParaView mailing list