35 #ifndef __vtkPlaneCutter_h
36 #define __vtkPlaneCutter_h
38 #include "vtkCutter.h"
39 #include "vtkInformation.h"
40 #include "vtkInformationVector.h"
54 vtkInformation *request,
55 vtkInformationVector **inputVector,
56 vtkInformationVector *outputVector)
58 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
61 vtkDataSet *input = vtkDataSet::SafeDownCast(
62 inInfo->Get(vtkDataObject::DATA_OBJECT()));
64 if (!this->CutFunction)
66 vtkErrorMacro(
"No cut function specified");
70 if ( input->GetNumberOfPoints() < 1 )
76 input->GetBounds( bounds );
82 pt[k++][2] = bounds[4];
86 pt[k++][2] = bounds[4];
90 pt[k++][2] = bounds[4];
94 pt[k++][2] = bounds[4];
98 pt[k++][2] = bounds[5];
100 pt[k][0] = bounds[1];
101 pt[k][1] = bounds[2];
102 pt[k++][2] = bounds[5];
104 pt[k][0] = bounds[0];
105 pt[k][1] = bounds[3];
106 pt[k++][2] = bounds[5];
108 pt[k][0] = bounds[1];
109 pt[k][1] = bounds[3];
110 pt[k++][2] = bounds[5];
112 bool sign0 = ( this->CutFunction->FunctionValue( pt[0] ) > 0. );
113 bool intersect =
false;
115 for(
unsigned int i = 1; ( i < 8 ) && ( !intersect ); i++ )
117 bool sign = ( this->CutFunction->FunctionValue( pt[i] ) >= 0. );
126 return vtkCutter::RequestData( request, inputVector, outputVector );
vtkPlaneCutter(vtkImplicitFunction *cf=NULL)
vtkTypeMacro(vtkPlaneCutter, vtkCutter)
vtkStandardNewMacro(vtkPlaneCutter)
static vtkPlaneCutter * New()
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void operator=(const vtkPlaneCutter &)
virtual ~vtkPlaneCutter()