<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello all!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Yesterday I encountered a problem using the
vtkRenderer with two vtkActors. I want to display two image datasets with
the one vtkRenderer. In order to display both datasets I would like to translate
one of them. For this task I will need an vtkActor. While the program is running
I have both Datasets shown by</FONT><FONT face=Arial size=2> two different
vtkRenderers. The Datasets are stored in the vtkAbstractVolumeMapper of
the corresponding vtkVolume for rendering. So here for a better
understanding:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>1. Dataset: vtkRenderer -> vtkVolume ->
vtkAbstractVolumeMapper -> Image Dataset</FONT></DIV>
<DIV>
<DIV><FONT face=Arial size=2>2. Dataset: vtkRenderer -> vtkVolume ->
vtkAbstractVolumeMapper -> Image Dataset</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>My problem is now, that I would like to render both
datasets with the second vtkRenderer and to translate the second dataset before
the rendering.</FONT></DIV>
<DIV><FONT face=Arial size=2>So the idea was to use two vtkActors in the
second vtkRenderer. I thought that it would be possible to use the mapper of the
first vtkRenderer as the mapper for the vtkActors in the second vtkRenderer. But
there is a problem with the class hierarchy in vtk version 4.4.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>When I use myMapper
= vtkVolume->GetMapper() it returns an
vtkAbstractVolumeMapper, which includes my image dataset.</FONT></DIV>
<DIV><FONT face=Arial size=2>Now I have my mapper.</FONT></DIV>
<DIV><FONT face=Arial size=2>If I am trying to add this mapper to the vtkActor
of the second vtkRenderer with vtkActor->SetMapper(myMapper) I will get an
error message. This is because vtkActor->SetMapper() expects a vtkMapper
and not a vtkAbstractVolumeMapper.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The problem is now that it is not possible to cast
the vtkAbstractVolumeMapper to a vtkMapper.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>My qestion is now: Is there anybody who might help
me solving this problem? I think this situation might come up quite
often.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>So any help would be appreciated!</FONT></DIV>
<DIV><FONT face=Arial size=2>Thanks a lot, Matthias</FONT></DIV></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Heres some code, maybe it helps understanding my
problem:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><BR>vtkRenderer *myRenderer1 = vtkRenderer::New();<BR>vtkRenderer
*myRenderer2 = vtkRenderer::New();</DIV>
<DIV> </DIV>
<DIV>vtkVolume *testvol;<BR>vtkAbstractVolumeMapper *testmap;</DIV>
<DIV> </DIV>
<DIV> <BR>vtkActor *testact = vtkActor::New();<BR>vtkActor *testact2 =
vtkActor::New();<BR> <BR>testvol =
myRenderer1->GetVolumes()->GetNextVolume();</DIV>
<DIV> </DIV>
<DIV>testmap = testvol->GetMapper();<BR> <BR> if (testmap !=
NULL)<BR> {<BR> testact->RotateX(-90);<BR>
testact->SetMapper(testmap); // error because vtkMapper is expected and
vtkAbstractVolumeMapper is set<BR> <BR>
myRenderer2->AddActor(testact);<BR>
myRenderer2->AddActor(testact2);<BR> }<BR></FONT></DIV></BODY></HTML>