[vtkusers] Polydata sometimes just shown after moving mousewheel

Bill Lorensen bill.lorensen at gmail.com
Sat Apr 20 11:23:05 EDT 2013


Try,
ResetCameraClippingRange()
on your renderer.


On Sat, Apr 20, 2013 at 11:08 AM, Marc Huber <marchuber.hft at gmx.de> wrote:

> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130420/1b57e333/attachment.htm>


More information about the vtkusers mailing list