[vtkusers] ShallowCopy in vtk 7.0 works correct?
Cory Quammen
cory.quammen at kitware.com
Tue Feb 9 10:26:02 EST 2016
Daniel,
Thanks for sharing the code sample. You are using different actors for
different renderers, which is good. But the shallow copy sets the same
mapper for each of the different actors. This should be fine within the
same renderer, but using the same mapper in different renders is not
supported. The reason is because each mapper has some OpenGL state
associated with the context in one of the renderers, and that state is not
valid in the other renderers.
It likely worked in the first OpenGL backend by sheer luck.
HTH,
Cory
On Tue, Feb 9, 2016 at 8:12 AM, -Daniel- <ich_daniel at habmalnefrage.de>
wrote:
> Hi,
>
> Now I try a new compilation and set VTK_RENDERING_BACKEND to OpenGL. It
> works!
> Why not with OpenGL2?
>
> approximate example - code snippet: /
> // I create three vtkActors like...
> vtkLineSource lineX = new vtkLineSource();
> lineX.SetPoint1(50, 0, 0);
> lineX.SetPoint2(150, 0, 0);
> vtkActor lineXActor = setLine(lineX); // separate method:
> vtkLineSource->vtkPolyDataMapper->vtkActor
> lineXActor.GetProperty().SetColor(1, 0, 0);
>
> // copy of vtkActor
> vtkActor copyLineXActor = new vtkActor();
> copyLineXActor.ShallowCopy(lineXActor);
> copyLineXActor.VisibilityOn();
>
> // add actors to different renderer ( vtkPanel().getRenderer() )
> // -> renderer1.AddActor(lineXActor);
> // -> renderer2.AddActor2D(copyLineXActor);
> /
> The vtkActor's are not visible at the same time. (By using OpenGL2 in the
> VTK_Rendering_Backend settings)
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/ShallowCopy-in-vtk-7-0-works-correct-tp5736416p5736442.html
> Sent from the VTK - Users mailing list archive at Nabble.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 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/20160209/edd7cf3a/attachment.html>
More information about the vtkusers
mailing list