[vtkusers] VTK without the V(isualization)

Brian Davis bitminer at gmail.com
Sat Apr 8 12:16:43 EDT 2017


Yes I can use vtk without visualization objects.  The workaround I found to
this was not even to use the boxWidget or any other vtk object, but rather
go low level and:

clipFunc->SetBounds( bounds )

where

bounds is

double bounds[6];

which is just calc in code

            double z_cen = (bounds[5] - bounds[4]) / 2.0;
            double z_spc = (bounds[5] - bounds[4]) / 512.0;
            bounds[4] = z_cen;
            bounds[5] = z_cen + z_spc;

Then check of boxWidget exists (then rendering is active else non render
pipeline is active)


    void clip(void){

        if (boxWidget.Get()){

            if (boxWidget->GetEnabled() != 1) return;

            boxWidget->GetPlanes(clipFunc);
            clipper->Update();
            surface->DeepCopy(clipper->GetOutput());
            clippedSurface->DeepCopy(clipper->GetClippedOutput());
            cutter->Update();
            cutLines->DeepCopy(cutter->GetOutput());
            boxWidget->Off();
            //boxWidget->EnabledOff();
        }
        else{

            //box->GetPlanes(clipFunc);
            clipFunc->SetBounds(bounds);


            clipper->Update();
            surface->DeepCopy(clipper->GetOutput());
            clippedSurface->DeepCopy(clipper->GetClippedOutput());
            cutter->Update();
            cutLines->DeepCopy(cutter->GetOutput());
        }


    }

Thanks to those that responded.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170408/893bec75/attachment.html>


More information about the vtkusers mailing list