[vtkusers] SetScalar() removes my color scalars

Doug Hoppes dhoppes at mbfbioscience.com
Thu Mar 3 15:59:07 EST 2016


Ah…. Okay!  Thanks!  That’s extremely helpful.

From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Cory Quammen
Sent: Thursday, March 03, 2016 9:56 AM
To: jhirsch
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] SetScalar() removes my color scalars

Doug,

This is a long-standing oddness in VTK. If you call SetScalars() on point data, for example, a side effect is that the current active scalars is removed from the point data! I have been bitten by this in the past. We should probably change this behavior to avoid surprising effects like this despite the backwards compatibility issues (which are hopefully few).

I recommend calling SetActiveScalars(const char* name) instead, which shouldn't remove your array.

HTH,
Cory


On Thu, Mar 3, 2016 at 8:09 AM, jhirsch <jan.hirsch at st.ovgu.de<mailto:jan.hirsch at st.ovgu.de>> wrote:
Hello Doug,
your source example just creates two arrays and set their names and
therefore has little to do with your problem, I guess. Can you copy more
lines of code that show the problem with the scalar replacement?

In general I would recommend to create a scalar array with 3 components and
use that for colours. Like this:

(that's from the example  here
<http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColoredPoints>  )




--
View this message in context: http://vtk.1045678.n5.nabble.com/SetScalar-removes-my-color-scalars-tp5736971p5736995.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com<http://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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



--
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160303/fbd51974/attachment.html>


More information about the vtkusers mailing list