New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boxfill/isofill missing attrbute does not change coor of missing #855

Closed
doutriaux1 opened this Issue Oct 29, 2014 · 8 comments

Comments

Projects
None yet
3 participants
@doutriaux1
Member

doutriaux1 commented Oct 29, 2014

No description provided.

@doutriaux1 doutriaux1 self-assigned this Oct 29, 2014

@doutriaux1 doutriaux1 added this to the 2.1 milestone Oct 29, 2014

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Oct 29, 2014

@dlonie actually can you please take a look, the mapper seems to be
1- overwritten by the actual data, which is not "transparent where" missing, hence does not show up
2- seems to be drawn has a big square all over
Here's a sample to produce data with missing value:

import vcs,MV2
x=vcs.init()         
data = MV2.sin(MV2.reshape(MV2.arange(25),(5,5)))

data=MV2.masked_less(data,-.5)
b=x.createboxfill()
b.missing=242 # red
x.plot(data,b)

@doutriaux1 doutriaux1 assigned aashish24 and unassigned doutriaux1 Oct 29, 2014

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Oct 29, 2014

it actually respects the color, just seems that the data is drawn in white on top of it so it doesn't show up.

@allisonvacanti

This comment has been minimized.

Contributor

allisonvacanti commented Oct 30, 2014

Taking a look after a rebuild...been in VTK land for a while, need to update my uvcdat ;-)

allisonvacanti added a commit that referenced this issue Oct 30, 2014

@allisonvacanti

This comment has been minimized.

Contributor

allisonvacanti commented Oct 30, 2014

@doutriaux1 See the branch I just pushed (ef6d2a4). Two issues:

  1. The "missing data" actor and the data actor are both being added to different renderers with vtkRenderer::GetLayer() == 0. Layer 0 renderers are always treated as opaque, so the missing-mapper renderer gets drawn, then the screen is cleared with the background color (white), and then the data actor is drawn on the pure-white background.

  2. The alpha values weren't set on the missing mapper's lookup table, and both visibility == 0 and visibility == 1 were set to draw opaque red.

1 will probably be fixed by your branch that reuses renderers. My workaround branch 'fixes' the issue by faking a higher data priority to create transparent renderers.

2 is solved by patching vcs2vtk (see branch above).

Don't merge my branch, it's just an example -- we need a better solution for the renderer layering problem. It's just to show what the root of the issue is. I'll let you handle that since you're actively working on refactoring the renderer design ;-)

Let me know if there's anything else you need from me.

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Nov 4, 2014

@dlonie any progress on this? I think it is the same issue as #871

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Nov 4, 2014

ooops just seeing the branch! Doh! will take a look

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Nov 4, 2014

@dlonie that was it! setLayer was setting to layer 0, fixed both bugs will push a branch soon.

@allisonvacanti

This comment has been minimized.

Contributor

allisonvacanti commented Nov 4, 2014

Cool. BTW, while you're looking at performance, setting the layer number to really high values will have a negative impact on speed:

http://www.vtk.org/doc/nightly/html/classvtkRenderWindow.html#a270c62e248c8a479ec61b839e3a4c4d8

For example, the code that performs the actual rendering does this:

https://github.com/Kitware/VTK/blob/master/Rendering/Core/vtkRendererCollection.cxx#L45

It iterates from 0 --> numLayers, and in each iteration checks all of the renderers to find the ones at that layer that need to be rendered. You'd have to profile/benchmark this to see what specific impact it would have, but it might be worth looking into while you're working on the renderer code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment