vtkPlanes is empty when using GetPlanes

Hi. I am trying to use vtkBoxWidget2 to clip an unstructured grid. Within my vtkBoxCallback, I initiate the planes variable and then grab the planes from the vtkBoxRepresentation.

However, the planes variable is always empty, and I have no idea why. So when I then do m_actor->GetMapper()->SetClippingPlanes(planes), my actor just disappears because the planes variable is just empty with just zeros.

When debugging, I can clearly see that the vtkBoxRepresentation has the right planes in there.

But when grabbing them, the planes variable is empty.

Does anyone know why this is?

Thanks a lot!

Incase this helps others in the future, I had not set SetInsideOut to true (1). Setting this prior to getting the planes works perfectly.

Here is the code:

namespace {

    class vtkBoxCallback : public vtkCommand
            static vtkBoxCallback* New()
                return new vtkBoxCallback;

            vtkSmartPointer<vtkActor> m_actor;

            void SetActor(vtkSmartPointer<vtkActor> actor)
                m_actor = actor;

            virtual void Execute(vtkObject* caller, unsigned long, void*)
                vtkSmartPointer<vtkBoxWidget2> boxWidget =

                vtkNew<vtkPlanes> planes;

                vtkSmartPointer<vtkBoxRepresentation> boxRep =





    }; // vtkBoxCallback

} // namespace

thanks my issue has been fixed.