[vtkusers] vtkViewport bug in v.3.1? I forgot the code !
Poty Virginie
poty at lil.univ-littoral.fr
Tue Nov 14 08:57:37 EST 2000
Hello,
I sent a message last week and I forgot to include the code !
Here is my last message followed by the code :
------------------------------------------------------------
Hello,
may be this point has already been discussed but I did not find anything
about it in the
mailing archive, so here it is. It seems that there is a bug in the
vtkViewport class when
one
try to draw in a viewport whose left border is close to the middle of
the window. The
program
in the attachment works well for left border values in the range
[0.0,0.36] but
makes a
segmentation fault
for values beyond 0.37. Compile it and try with the following line
commands:
viewport 0.36 0.0 1.0 1.0
viewport 0.37 0.0 1.0 1.0
Our system is Linux Mandrake 7.1 with g++ compiler.
Let us remarq that it works well with the Tcl api!
Is there anybody who could help me?
Virginie.
--
---------------------------------------------------------
\ Virginie Marion-Poty. LIL. B.P. 719 /
\ 62228 CALAIS Cedex. FRANCE. /
\ Tel : (+33) 3.21.46.56.74 /
\ Fax : (+33) 3.21.46.55.71 /
\ email : poty at lil.univ-littoral.fr /
--------------------------------------------------------
-------------- next part --------------
#include <vtkSphereSource.h>
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <stdio.h>
#include <math.h>
int
main(int argc, char *argv[])
{
if (argc != 5)
return -1;
vtkSphereSource *source = vtkSphereSource::New();
vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
mapper->SetInput(source->GetOutput());
vtkActor *actor = vtkActor::New();
actor->SetMapper(mapper);
vtkRenderer *renderer = vtkRenderer::New();
renderer->AddActor(actor);
vtkRenderWindow *renwin = vtkRenderWindow::New();
renwin->SetSize(600, 300);
renwin->AddRenderer(renderer);
renderer->SetViewport(atof(argv[1]), atof(argv[2]),
atof(argv[3]), atof(argv[4]));
renwin->Render();
getchar();
return 0;
}
More information about the vtkusers
mailing list