[vtkusers] Show whole volume under a slice

David Gobbi david.gobbi at gmail.com
Thu Feb 25 10:38:39 EST 2016


Don't do that, use a vtkPlaneCollection instead.

On Thu, Feb 25, 2016 at 8:31 AM, Lonni Besançon <lonni.besancon at gmail.com>
wrote:

> Ok thanks for the advice.
>
> So here is what I have tried:
>
>       /  vtkSmartPointer<vtkPlanes> planes =
> vtkSmartPointer<vtkPlanes>::New();
>         vtkSmartPointer<vtkPoints> origins =
> vtkSmartPointer<vtkPoints>::New();
>         origins->SetNumberOfPoints(1);
>         origins->InsertNextPoint(plane->GetOrigin());
>         vtkSmartPointer<vtkDoubleArray> normalsArray =
> vtkSmartPointer<vtkDoubleArray>::New();
>         normalsArray->SetNumberOfComponents(3);
>         normalsArray->SetNumberOfTuples(1);
>         normalsArray->SetComponent(0,0,plane->GetNormal()[0]);
>         normalsArray->SetComponent(0,1,plane->GetNormal()[1]);
>         normalsArray->SetComponent(0,2,plane->GetNormal()[2]);
>         planes->SetPoints(origins);
>         planes->SetNormals(normalsArray);
>         mainMapper->SetClippingPlanes(planes);/
>
> But this gives me a memory access error when reaching the last line.
> According to the debuger, the error is located in the for loop of the
> SetClippingPlanes() method which is in turn in the call to:
> /void vtkAbstractMapper::RemoveAllClippingPlanes(){if (
> this->ClippingPlanes
> ) //.../
>
> Would you happen to know what's wrong with what I've done there. I can't
> really understand where the error comes from
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160225/117da729/attachment.html>


More information about the vtkusers mailing list