MCPcopy Create free account
hub / github.com/Kitware/VTK / CutAndClip

Method CutAndClip

Interaction/Widgets/vtkResliceCursorPolyDataAlgorithm.cxx:262–288  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

260
261//------------------------------------------------------------------------------
262void vtkResliceCursorPolyDataAlgorithm ::CutAndClip(vtkPolyData* input, vtkPolyData* output)
263{
264 this->ClipWithBox->SetClipFunction(this->Box);
265 this->ClipWithBox->GenerateClipScalarsOff();
266 this->ClipWithBox->GenerateClippedOutputOff();
267 this->Box->SetBounds(this->ResliceCursor->GetImage()->GetBounds());
268
269 double s[3];
270 this->ResliceCursor->GetImage()->GetSpacing(s);
271 const double smax = std::max({ s[0], s[1], s[2] });
272 this->ExtrusionFilter1->SetScaleFactor(smax);
273 this->ExtrusionFilter2->SetScaleFactor(smax);
274
275 this->ClipWithBox->SetInputData(input);
276 this->ClipWithBox->Update();
277 this->ExtrusionFilter1->SetInputData(input);
278
279 double normal[3];
280 this->ResliceCursor->GetPlane(this->ReslicePlaneNormal)->GetNormal(normal);
281 this->ExtrusionFilter1->SetVector(normal);
282 this->ExtrusionFilter2->SetVector(-normal[0], -normal[1], -normal[2]);
283 // std::cout << normal[0] << " " << normal[1] << " " << normal[2] << std::endl;
284
285 this->ExtrusionFilter2->Update();
286
287 output->DeepCopy(this->ExtrusionFilter2->GetOutput());
288}
289
290//------------------------------------------------------------------------------
291vtkMTimeType vtkResliceCursorPolyDataAlgorithm::GetMTime()

Callers 1

RequestDataMethod · 0.80

Calls 12

SetScaleFactorMethod · 0.80
maxFunction · 0.50
SetBoundsMethod · 0.45
GetBoundsMethod · 0.45
GetImageMethod · 0.45
GetSpacingMethod · 0.45
SetInputDataMethod · 0.45
UpdateMethod · 0.45
GetNormalMethod · 0.45
GetPlaneMethod · 0.45
DeepCopyMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected