[vtkusers] Display mesh with attributes

Alex Malyushytskyy alexmalvtk at gmail.com
Tue Aug 14 21:28:42 EDT 2012


I would recommend to check
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColorCells
or
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Graphs/ColorVerticesLookupTable


As for your code, at the first glance you do not have lookup table is created,
but "Setting ColorModeToMapScalars means that all scalar data will be
mapped through the lookup table."

I guess as a result color mapping does not happen.

Hope this helps,
   Alex



On Tue, Aug 14, 2012 at 8:26 AM, David Doria <daviddoria at gmail.com> wrote:
> On Tue, Aug 14, 2012 at 11:18 AM, agatte <agatakrason at gmail.com> wrote:
>>
>> Hi ;)
>>
>> I have a question.
>> I have already red mesh with attributes (in file).
>> But I can't display corectly  mesh with attributes in VTK.
>> I receive only one color. But When I open file in paraview, I can display
>> well mesh & attributes  with colors.
>> Could anyone help me please ? What is it wrong in this code  ? What should
>> I
>> add ?
>> I would appreciate for any help please.
>
>
> I would suggest looking through some of the examples:
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/TriangleColoredPoints
>
> and you should always try to generate the situation you are having in the
> smallest possible compilable, self contained code. That is, don't read a
> file, generate data programmatically (vtkSphereSource, etc). Remove all
> extraneous calls (you have a writer in the above code that doesn't seem
> necessary).
>
> Also, you should use smart pointers instead of normal pointers so you don't
> need the giant block of Delete() calls at the bottom (it makes the code
> longer and less appealing to look at for us at a glance).
>
> David
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list