[vtkusers] vtkImageViewer2 image display

Oleksandr Dzyubak adzyubak at gmail.com
Mon Apr 14 16:49:00 EDT 2008


Hi Anka,

After inclusion the headers below, the code compiles fine, thanks.

#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkProperty.h"
#include "vtkCamera.h"


Following the advice of Tobias, I have recalculated the focal points,
view angle, and distance. Using Set_X() and Get_X() methods, I checked
what I am getting before and after resetting a camera.
 From outputs I see that the parameters are changed but it does not affect
the output image size though. The image is still a small dot in a 
rendering window
when application starts up. Later I can zoom it in by a mouse.
What I need is that the output image could take the largest possible 
area in a rendering window.

Any ideas?

Alex

Anka Kochanowska wrote:
> Have you included vtkRenderer.h?
> Anka
>
> Oleksandr Dzyubak wrote:
>> Hi Tobias,
>>
>> I tried your suggestion and got compiler errors below.
>>
>> myProject.cxx: In function ‘int main(int, char**)’:
>> myProject.cxx:56: error: invalid use of incomplete type ‘struct 
>> vtkRenderer’
>> /usr/bin/../include/vtk-5.0/vtkRenderWindowInteractor.h:46: error: 
>> forward declaration of ‘struct vtkRenderer’
>> make[2]: *** [CMakeFiles/myProject.dir/myProject.o] Error 1
>> make[1]: *** [CMakeFiles/myProject.dir/all] Error 2
>> make: *** [all] Error 2
>>
>> What am I doing wrong?
>>
>> Alex
>>
>> tobse wrote:
>>> Hi Alex,
>>>
>>> you can setup the active camera via the renderer of the imageviewer.
>>> viewer->GetRenderer()->GetActiveCamera()->SetFocalPoint(x,y,z);
>>> Doesn't look nice but works...
>>>
>>> tobse 




More information about the vtkusers mailing list