[vtkusers] Polydata sometimes just shown after moving mousewheel
Marc Huber
marchuber.hft at gmx.de
Sat Apr 20 11:08:23 EDT 2013
Sorry to start this again.
Reseting the camera solves the problem but then I am at the original
point of the camera again.
What I wanted was to transform the camera and stay at this place to take
screenshots.
When I repaint my RendererWindow not all content is redrawn. After I
move the mousewheel it's correctly displayed.
The problem doesn't occur always. Just with some objects with specific
transformations.
I have attached a screenshot what the problem is. The upper window is
how it is created and the lower is after I moved the mouse wheel.
I tried to just perform a zoom event and it doesn't help.
Best regards
Marc
Am 4/16/2013 2:28 PM, schrieb Marc Huber:
> thx! Reset the camera again after its movement solved the problem.
>
> Am 4/16/2013 1:58 PM, schrieb David Doria:
>> On Tue, Apr 16, 2013 at 7:34 AM, Marc Huber <marchuber.hft at gmx.de>
>> wrote:
>>> Hi,
>>>
>>> i have the problem, that if i load polydata to a renderer window
>>> depending
>>> on the dataset sometimes the object is shown directly and sometimes
>>> i have
>>> to move the mousewheel one time and then the object gets visible.
>>> For each object my camera is set depending on the center point of my
>>> polydata.
>>> I do a repaint but it doesn't help me.
>>>
>>> Has anyone an idea what the problem might be?
>>> Or can someone just tell me how i perform a simple event zooming in
>>> or out
>>> one time?
>>>
>>> My Code:
>>> double cent[3], bounds[6], lenX, lenY, lenZ, max;
>>> stlActor->GetMapper()->GetCenter(cent);
>>> stlActor->GetMapper()->GetBounds(bounds);
>>> lenX=bounds[1]-bounds[0];
>>> lenY=bounds[3]-bounds[2];
>>> lenZ=bounds[5]-bounds[4];
>>> max=lenX;
>>> if (lenY > max) {max=lenY;}
>>> if (lenZ > max) {max=lenZ;}
>>>
>>> cam->SetFocalPoint(cent[0],cent[1],cent[2]);
>>> cam->SetViewUp(0,0,1);
>>> cam->SetPosition(-2*max,0,0);
>>> if (direction==0) //azimuth
>>> {
>>> cam->Azimuth(degree);
>>> }
>>> else if (direction==1) //elevation
>>> {
>>> cam->Elevation(degree);
>>> }
>>> renderer->SetActiveCamera(cam);
>>> ui.qvtkWidget->repaint();
>>
>> Did you try renderer->ResetCamera()? Otherwise, please post compilable
>> code that demonstrates the problem. The code should be as simple as
>> possible (remove the Qt dependency, hard code data to view, etc.)
>>
>> David
>>
>
>
--
Best regards / Mit freundlichen Grüßen
Marc Huber
-------------- next part --------------
A non-text attachment was scrubbed...
Name: problemscreenshot.JPG
Type: image/jpeg
Size: 20246 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130420/8b0b961c/attachment.jpeg>
More information about the vtkusers
mailing list