[vtkusers] scale vtkPlaneWidget

Anka Kochanowska pluszcz at gmail.com
Mon Mar 3 10:17:53 EST 2014


Because Prop3D is 0, try to set it first.
Anka



On Mon, Mar 3, 2014 at 9:43 AM, Agata Krasoń <agatakrason at gmail.com> wrote:

> Hi,
>
> I have  question concerning vtkPlaneWidget.
> I need to scale vtkPlaneWidget.
> I can not scalling well these widget.
> *planeWidget->GetProp3D()->SetScale(scale, scale, scale);*
> It doesn't work well.
> I always received an exception :
> TestImagePlaneWidget.exe: 0xC0000005: Access violation reading location
> 0x00000000.
>
> Could You help me please ?
>
> Tested  program :
>
> int main ( int argc, char *argv[] )
> {
>   vtkSmartPointer<vtkSphereSource> sphereSource =
> vtkSmartPointer<vtkSphereSource>::New();
>   vtkSmartPointer<vtkPolyDataMapper> mapper =
> vtkSmartPointer<vtkPolyDataMapper>::New();
>   mapper->SetInputConnection(sphereSource->GetOutputPort());
>   vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
>   actor->SetMapper(mapper);
>
>   // Visualization
>   vtkSmartPointer<vtkRenderer> renderer =
> vtkSmartPointer<vtkRenderer>::New();
>   vtkSmartPointer<vtkRenderWindow> renderWindow
> =vtkSmartPointer<vtkRenderWindow>::New();
>   renderWindow->AddRenderer(renderer);
>   vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
> vtkSmartPointer<vtkRenderWindowInteractor>::New();
>   renderWindowInteractor->SetRenderWindow(renderWindow);
>
>   vtkSmartPointer<vtkSplineWidget2> splineWidget =
> vtkSmartPointer<vtkSplineWidget2>::New();
>   splineWidget->SetInteractor(renderWindowInteractor);
>
>   vtkSmartPointer<vtkImagePlaneWidget> planeWidget =
> vtkSmartPointer<vtkImagePlaneWidget>::New();
>   planeWidget->SetInteractor(renderWindowInteractor);
>  /* double iso_scale[3] = {1,1,0};
>   double p1[3] = {0,0,0};
>   double p2[3] = {0,100,0};*/
>   double scale = 10;
>   //planeWidget->GetPoint1(p1);
>   //planeWidget->GetPoint2(p2);
> *  planeWidget->GetProp3D()->SetScale(scale, scale, scale);  // ? *
>
>  // planeWidget->GetProp3D()->SetScale(iso_scale);
>
>   renderer->AddActor(actor);
>   renderer->ResetCamera();
>   planeWidget->On();
>   splineWidget->On();
>   renderer->SetBackground(.3, .6, .3);
>   renderWindow->Render();
>   renderWindowInteractor->Start();
>
>   return EXIT_SUCCESS;
> }
>
>
> I would appreciate for any help please :)
>
> Agatte
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140303/678a4392/attachment.html>


More information about the vtkusers mailing list