[vtkusers] Set an order to vtkActor rendering

Najzero adrian.gabriel at 4plus.de
Fri May 25 07:25:31 EDT 2012


Hi,

Hm I guess we did something simmilar (but by hand) because we had issues
with Z-Order with partially transparent volumes.
Later we removed that and fixed our polydata instead, but maybe it still
gives you an idea what to do.

Since its a while, I just write down what we did.
vtkActors can be grouped via vtkAssembly, and abusing those vtkAssemblies a
bit, could work fine for you :-).

Pseudo-Code incomming:

1) convinient enum for your rendering Groups (so you can get the vtkAssembly
Pointer from your mainwidget anywhere by the enum)
2) generate them in desired order:
Widget::generateGroups()
{
_renderer->AddActor( _firstGroup = vtkAssembly::New() ); //3 pointers stored
in your main widget
_renderer->AddActor( _defaultGroup = vtkAssembly::New() );
_renderer->AddActor( _lastGroup = vtkAssembly::New() );
}

3) add Actor function:
Widget::AddActor( vtkAssembly* newAssembly )
{
if( _groups.contains( newAssembly ) return; // using a QMap or similar here
_groups.add( newAssembly );
}

4) add actor to your desired assembly-Group


There are shurely better ways to achive that (we reworked our polygon data
for example) - 
but somehow I feel it could work for you.

KR Adrian

--
View this message in context: http://vtk.1045678.n5.nabble.com/Set-an-order-to-vtkActor-rendering-tp5713391p5713394.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list