[vtkusers] update unstructured grid

Dominik Szczerba domi at vision.ee.ethz.ch
Sat Sep 30 08:00:07 EDT 2006


my guess is you have a confusion as to cell id's in your loop.
--DS

Naim wrote:
> Exactly, the results coloring are random.
> I have 5 steps to plot my model. When I plot one by one step creating again
> the unstructured grid, all plots are correct (color), but when I do it on
> the loop by changing just the scalars values and update my unstructured
> grid, the coloring results are not the same.
> 
> 
> Naim Himrane
> Electromagneticworks Inc.
> 
> 
> 1 Provost street, Suite 305 
> Montreal, Quebec H8S 4H2
> Canada
> Phone: (514) 634-9797
> 
> 
> -----Original Message-----
> From: Dominik Szczerba [mailto:domi at vision.ee.ethz.ch] 
> Sent: September 29, 2006 11:51 AM
> To: Naim
> Cc: 'Olivier Feys'; vtkusers at public.kitware.com
> Subject: Re: [vtkusers] update unstructured grid
> 
> what do you mean by not correct results. I once had a similar problem 
> which turned out to be merely an error in cell id numbering (my cell 
> id's didnt match those of vtk and resulting coloring seemed random)
> --DS
> 
> Naim wrote:
>> Hi Olivier,
>>
>> I try it, but the results still the same.
>> I try also calling Modified() and/or Update() functions for all pipeline
>> objects, it still not working. May be there is a bug when we update an
>> unstructured grid 's scalars inside the pipeline connections (sources,
>> filters and mappers).
>>
>> Thank you.
>>
>> Naim Himrane
>> Electromagneticworks Inc.
>>
>> -----Original Message-----
>> From: Olivier Feys [mailto:olivier.feys at gmail.com] 
>> Sent: September 29, 2006 5:01 AM
>> To: Naim
>> Cc: vtkusers at public.kitware.com
>> Subject: Re: [vtkusers] update unstructured grid
>>
>>
>> try
>>
>> pUnstructuredGrid->Modified()
>>
>> Naim wrote:
>>> Hi vtkUsers,
>>>
>>> I need help how to update an unstructured grid?
>>>
>>> I change the scalars and I call "update" and/or "modified" functions, 
>>> but the results are wrong.
>>>
>>> I create pScalars (vtkDoubleArray)
>>>
>>> pUnstructuredGrid->GetPointData()->SetScalars(pScalars);
>>>
>>> .
>>>
>>> I show the plot. The plot is fine.
>>>
>>> I change the scalars like this:
>>>
>>> for(long i = 0; i < Size; ++i)
>>>
>>> {
>>>
>>> aNodeValue = pPlotData[i]; // new scalars data
>>>
>>> pScalars->SetValue(i, aNodeValue);
>>>
>>> }
>>>
>>> pScalars->Update(); // or pScalars->Modified();
>>>
>>> pUnstructuredGrid->GetPointData()->SetScalars(pScalars);
>>>
>>> .
>>>
>>> I show the plot but the results are not correct.
>>>
>>> Please any idea.
>>>
>>> //Naim Himrane//////
>>>
>>> //Electromagneticworks Inc.//
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> This is the private VTK discussion list. 
>>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>   
>> _______________________________________________
>> This is the private VTK discussion list. 
>> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
> 

-- 
Dominik Szczerba, Ph.D.
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi



More information about the vtkusers mailing list