Medical Imaging Interaction Toolkit  2018.4.99-a3d2e8fb
Medical Imaging Interaction Toolkit
vtkPointSetSlicer.cxx
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 #include <algorithm>
13 #include <vector>
14 
15 #include "vtkPointSetSlicer.h"
16 
17 #include "vtkCellArray.h"
18 #include "vtkCellData.h"
19 #include "vtkCutter.h"
20 #include "vtkDataSet.h"
21 #include "vtkDoubleArray.h"
22 #include "vtkFloatArray.h"
23 #include "vtkGenericCell.h"
24 #include "vtkMergePoints.h"
25 #include "vtkObjectFactory.h"
26 #include "vtkPlane.h"
27 #include "vtkPointData.h"
28 #include "vtkPolyData.h"
29 
30 #include "vtkUnstructuredGrid.h"
31 
32 #include "vtkInformation.h"
33 #include "vtkInformationVector.h"
34 #include "vtkStreamingDemandDrivenPipeline.h"
35 
37 
38 // Construct with user-specified implicit function; initial value of 0.0; and
39 // generating cut scalars turned off.
41 {
42  this->SlicePlane = cf;
43  this->GenerateCutScalars = 0;
44  this->Locator = nullptr;
45 
46  this->Cutter = vtkCutter::New();
47  this->Cutter->GenerateValues(1, 0, 1);
48 }
49 
51 {
52  this->SetSlicePlane(nullptr);
53  if (this->Locator)
54  {
55  this->Locator->UnRegister(this);
56  this->Locator = nullptr;
57  }
58 
59  this->Cutter->Delete();
60 }
61 
62 void vtkPointSetSlicer::SetSlicePlane(vtkPlane *plane)
63 {
64  if (this->SlicePlane == plane)
65  {
66  return;
67  }
68  if (this->SlicePlane)
69  {
70  this->SlicePlane->UnRegister(this);
71  this->SlicePlane = nullptr;
72  }
73  if (plane)
74  {
75  plane->Register(this);
76  this->Cutter->SetCutFunction(plane);
77  }
78  this->SlicePlane = plane;
79  this->Modified();
80 }
81 
82 // Overload standard modified time function. If cut functions is modified,
83 // or contour values modified, then this object is modified as well.
85 {
86  vtkMTimeType mTime = this->Superclass::GetMTime();
87  vtkMTimeType time;
88 
89  if (this->SlicePlane != nullptr)
90  {
91  time = this->SlicePlane->GetMTime();
92  mTime = (time > mTime ? time : mTime);
93  }
94 
95  if (this->Locator != nullptr)
96  {
97  time = this->Locator->GetMTime();
98  mTime = (time > mTime ? time : mTime);
99  }
100 
101  return mTime;
102 }
103 
104 int vtkPointSetSlicer::RequestData(vtkInformation * /*request*/,
105  vtkInformationVector **inputVector,
106  vtkInformationVector *outputVector)
107 {
108  // get the info objects
109  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
110  vtkInformation *outInfo = outputVector->GetInformationObject(0);
111 
112  // get the input and ouptut
113  vtkDataSet *input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
114  vtkPolyData *output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
115 
116  vtkDebugMacro(<< "Executing cutter");
117 
118  if (!this->SlicePlane)
119  {
120  vtkErrorMacro("No slice plane specified");
121  return 0;
122  }
123 
124  if (input->GetNumberOfPoints() < 1)
125  {
126  return 1;
127  }
128 
129  if (input->GetDataObjectType() == VTK_STRUCTURED_POINTS || input->GetDataObjectType() == VTK_IMAGE_DATA)
130  {
131  if (input->GetCell(0) && input->GetCell(0)->GetCellDimension() >= 3)
132  {
133  // this->StructuredPointsCutter(input, output, request, inputVector, outputVector);
134  return 1;
135  }
136  }
137  if (input->GetDataObjectType() == VTK_STRUCTURED_GRID)
138  {
139  if (input->GetCell(0))
140  {
141  int dim = input->GetCell(0)->GetCellDimension();
142  // only do 3D structured grids (to be extended in the future)
143  if (dim >= 3)
144  {
145  // this->StructuredGridCutter(input, output);
146  return 1;
147  }
148  }
149  }
150  if (input->GetDataObjectType() == VTK_RECTILINEAR_GRID)
151  {
152  // this->RectilinearGridCutter(input, output);
153  return 1;
154  }
155 
156  if (input->GetDataObjectType() == VTK_UNSTRUCTURED_GRID)
157  {
158  vtkDebugMacro(<< "Executing Unstructured Grid Cutter");
159  this->UnstructuredGridCutter(input, output);
160  }
161  else
162  {
163  vtkDebugMacro(<< "Executing DataSet Cutter");
164  // this->DataSetCutter(input, output);
165  }
166 
167  return 1;
168 }
169 int vtkPointSetSlicer::RequestUpdateExtent(vtkInformation *, vtkInformationVector **inputVector, vtkInformationVector *)
170 {
171  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
172  inInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 1);
173  return 1;
174 }
176 {
177  info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet");
178  return 1;
179 }
180 
181 void vtkPointSetSlicer::UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
182 {
183  vtkIdType cellId, i;
184  vtkDoubleArray *cellScalars;
185  vtkCellArray *newVerts, *newLines, *newPolys;
186  vtkPoints *newPoints;
187  vtkDoubleArray *cutScalars;
188  double s;
189  vtkIdType estimatedSize, numCells = input->GetNumberOfCells();
190  vtkIdType numPts = input->GetNumberOfPoints();
191  vtkIdType cellArrayIt = 0;
192  int numCellPts;
193  vtkPointData *inPD, *outPD;
194  vtkCellData *inCD = input->GetCellData(), *outCD = output->GetCellData();
195  vtkIdList *cellIds;
196  int abortExecute = 0;
197 
198  double range[2];
199 
200  // Create objects to hold output of contour operation
201  //
202  estimatedSize = (vtkIdType)pow((double)numCells, .75);
203  estimatedSize = estimatedSize / 1024 * 1024; // multiple of 1024
204  if (estimatedSize < 1024)
205  {
206  estimatedSize = 1024;
207  }
208 
209  newPoints = vtkPoints::New();
210  newPoints->Allocate(estimatedSize, estimatedSize / 2);
211  newVerts = vtkCellArray::New();
212  newVerts->Allocate(estimatedSize, estimatedSize / 2);
213  newLines = vtkCellArray::New();
214  newLines->Allocate(estimatedSize, estimatedSize / 2);
215  newPolys = vtkCellArray::New();
216  newPolys->Allocate(estimatedSize, estimatedSize / 2);
217  cutScalars = vtkDoubleArray::New();
218  cutScalars->SetNumberOfTuples(numPts);
219 
220  // Interpolate data along edge. If generating cut scalars, do necessary setup
221  if (this->GenerateCutScalars)
222  {
223  inPD = vtkPointData::New();
224  inPD->ShallowCopy(input->GetPointData()); // copies original attributes
225  inPD->SetScalars(cutScalars);
226  }
227  else
228  {
229  inPD = input->GetPointData();
230  }
231  outPD = output->GetPointData();
232  outPD->InterpolateAllocate(inPD, estimatedSize, estimatedSize / 2);
233  outCD->CopyAllocate(inCD, estimatedSize, estimatedSize / 2);
234 
235  // locator used to merge potentially duplicate points
236  if (this->Locator == nullptr)
237  {
238  this->CreateDefaultLocator();
239  }
240  this->Locator->InitPointInsertion(newPoints, input->GetBounds());
241 
242  // Loop over all points evaluating scalar function at each point
243  //
244  for (i = 0; i < numPts; i++)
245  {
246  s = this->SlicePlane->FunctionValue(input->GetPoint(i));
247  cutScalars->SetComponent(i, 0, s);
248  }
249 
250  // Compute some information for progress methods
251  //
252  vtkIdType numCuts = numCells;
253  vtkIdType progressInterval = numCuts / 20 + 1;
254  int cut = 0;
255 
256  vtkUnstructuredGrid *grid = (vtkUnstructuredGrid *)input;
257  vtkIdType *cellArrayPtr = grid->GetCells()->GetPointer();
258  double *scalarArrayPtr = cutScalars->GetPointer(0);
259  double tempScalar;
260  cellScalars = cutScalars->NewInstance();
261  cellScalars->SetNumberOfComponents(cutScalars->GetNumberOfComponents());
262  cellScalars->Allocate(VTK_CELL_SIZE * cutScalars->GetNumberOfComponents());
263 
264  // Three passes over the cells to process lower dimensional cells first.
265  // For poly data output cells need to be added in the order:
266  // verts, lines and then polys, or cell data gets mixed up.
267  // A better solution is to have an unstructured grid output.
268  // I create a table that maps cell type to cell dimensionality,
269  // because I need a fast way to get cell dimensionality.
270  // This assumes GetCell is slow and GetCellType is fast.
271  // I do not like hard coding a list of cell types here,
272  // but I do not want to add GetCellDimension(vtkIdType cellId)
273  // to the vtkDataSet API. Since I anticipate that the output
274  // will change to vtkUnstructuredGrid. This temporary solution
275  // is acceptable.
276  //
277  int cellType;
278  unsigned char cellTypeDimensions[VTK_NUMBER_OF_CELL_TYPES];
279  vtkCutter::GetCellTypeDimensions(cellTypeDimensions);
280  int dimensionality;
281  // We skip 0d cells (points), because they cannot be cut (generate no data).
282  for (dimensionality = 1; dimensionality <= 3; ++dimensionality)
283  {
284  // Loop over all cells; get scalar values for all cell points
285  // and process each cell.
286  //
287  cellArrayIt = 0;
288  for (cellId = 0; cellId < numCells && !abortExecute; cellId++)
289  {
290  numCellPts = cellArrayPtr[cellArrayIt];
291  // I assume that "GetCellType" is fast.
292  cellType = input->GetCellType(cellId);
293  if (cellType >= VTK_NUMBER_OF_CELL_TYPES)
294  { // Protect against new cell types added.
295  vtkErrorMacro("Unknown cell type " << cellType);
296  cellArrayIt += 1 + numCellPts;
297  continue;
298  }
299  if (cellTypeDimensions[cellType] != dimensionality)
300  {
301  cellArrayIt += 1 + numCellPts;
302  continue;
303  }
304  cellArrayIt++;
305 
306  // find min and max values in scalar data
307  range[0] = scalarArrayPtr[cellArrayPtr[cellArrayIt]];
308  range[1] = scalarArrayPtr[cellArrayPtr[cellArrayIt]];
309  cellArrayIt++;
310 
311  for (i = 1; i < numCellPts; i++)
312  {
313  tempScalar = scalarArrayPtr[cellArrayPtr[cellArrayIt]];
314  cellArrayIt++;
315  if (tempScalar <= range[0])
316  {
317  range[0] = tempScalar;
318  } // if tempScalar <= min range value
319  if (tempScalar >= range[1])
320  {
321  range[1] = tempScalar;
322  } // if tempScalar >= max range value
323  } // for all points in this cell
324 
325  int needCell = 0;
326  if (0.0 >= range[0] && 0.0 <= range[1])
327  {
328  needCell = 1;
329  }
330 
331  if (needCell)
332  {
333  vtkCell *cell = input->GetCell(cellId);
334  cellIds = cell->GetPointIds();
335  cutScalars->GetTuples(cellIds, cellScalars);
336  // Loop over all contour values.
337  if (dimensionality == 3 && !(++cut % progressInterval))
338  {
339  vtkDebugMacro(<< "Cutting #" << cut);
340  this->UpdateProgress(static_cast<double>(cut) / numCuts);
341  abortExecute = this->GetAbortExecute();
342  }
343 
345  cell, cellScalars, this->Locator, newVerts, newLines, newPolys, inPD, outPD, inCD, cellId, outCD);
346  } // if need cell
347  } // for all cells
348  } // for all dimensions (1,2,3).
349 
350  // Update ourselves. Because we don't know upfront how many verts, lines,
351  // polys we've created, take care to reclaim memory.
352  //
353  cellScalars->Delete();
354  cutScalars->Delete();
355 
356  if (this->GenerateCutScalars)
357  {
358  inPD->Delete();
359  }
360 
361  output->SetPoints(newPoints);
362  newPoints->Delete();
363 
364  if (newVerts->GetNumberOfCells())
365  {
366  output->SetVerts(newVerts);
367  }
368  newVerts->Delete();
369 
370  if (newLines->GetNumberOfCells())
371  {
372  output->SetLines(newLines);
373  }
374  newLines->Delete();
375 
376  if (newPolys->GetNumberOfCells())
377  {
378  output->SetPolys(newPolys);
379  }
380  newPolys->Delete();
381 
382  this->Locator->Initialize(); // release any extra memory
383  output->Squeeze();
384 }
385 
387  vtkDataArray *cellScalars,
388  vtkPointLocator *locator,
389  vtkCellArray *verts,
390  vtkCellArray *lines,
391  vtkCellArray *polys,
392  vtkPointData *inPd,
393  vtkPointData *outPd,
394  vtkCellData *inCd,
395  vtkIdType cellId,
396  vtkCellData *outCd)
397 {
398  if (cell->GetCellType() == VTK_HEXAHEDRON)
399  {
400  static int CASE_MASK[8] = {1, 2, 4, 8, 16, 32, 64, 128};
401  POLY_CASES *polyCase;
402  EDGE_LIST *edge;
403  int i, j, index, *vert;
404  volatile int pnum;
405  int v1, v2, newCellId;
406  double t, x1[3], x2[3], x[3], deltaScalar;
407  vtkIdType offset = verts->GetNumberOfCells() + lines->GetNumberOfCells();
408 
409  // Build the case table
410  for (i = 0, index = 0; i < 8; i++)
411  {
412  if (cellScalars->GetComponent(i, 0) >= 0)
413  {
414  index |= CASE_MASK[i];
415  }
416  }
417 
418  polyCase = polyCases + index;
419  edge = polyCase->edges;
420 
421  // get the point number of the polygon
422  pnum = 0;
423  for (i = 0; i < 8; i++)
424  if (edge[i] > -1)
425  pnum++;
426  else
427  break;
428 
429  vtkIdType *pts = new vtkIdType[pnum];
430  for (i = 0; i < pnum; i++) // insert polygon
431  {
432  vert = edges[edge[i]];
433 
434  // calculate a preferred interpolation direction
435  deltaScalar = (cellScalars->GetComponent(vert[1], 0) - cellScalars->GetComponent(vert[0], 0));
436  if (deltaScalar > 0)
437  {
438  v1 = vert[0];
439  v2 = vert[1];
440  }
441  else
442  {
443  v1 = vert[1];
444  v2 = vert[0];
445  deltaScalar = -deltaScalar;
446  }
447 
448  // linear interpolation
449  t = (deltaScalar == 0.0 ? 0.0 : (-cellScalars->GetComponent(v1, 0)) / deltaScalar);
450 
451  cell->GetPoints()->GetPoint(v1, x1);
452  cell->GetPoints()->GetPoint(v2, x2);
453 
454  for (j = 0; j < 3; j++)
455  {
456  x[j] = x1[j] + t * (x2[j] - x1[j]);
457  }
458  if (locator->InsertUniquePoint(x, pts[i]))
459  {
460  if (outPd)
461  {
462  vtkIdType p1 = cell->GetPointIds()->GetId(v1);
463  vtkIdType p2 = cell->GetPointIds()->GetId(v2);
464  outPd->InterpolateEdge(inPd, pts[i], p1, p2, t);
465  }
466  }
467  }
468 
469  // check for degenerate polygon
470  std::vector<vtkIdType> pset;
471  for (i = 0; i < pnum; i++)
472  {
473  if (std::find(pset.begin(), pset.end(), pts[i]) == pset.end())
474  pset.push_back(pts[i]);
475  }
476 
477  if (pset.size() > 2)
478  {
479  i = 0;
480  for (std::vector<vtkIdType>::iterator iter = pset.begin(); iter != pset.end(); iter++)
481  {
482  pts[i] = *iter;
483  i++;
484  }
485  newCellId = offset + polys->InsertNextCell(pset.size(), pts);
486  outCd->CopyData(inCd, cellId, newCellId);
487  }
488  delete[] pts;
489  }
490  else
491  {
492  cell->Contour(0, cellScalars, locator, verts, lines, polys, inPd, outPd, inCd, cellId, outCd);
493  }
494 }
495 
496 // Specify a spatial locator for merging points. By default,
497 // an instance of vtkMergePoints is used.
498 void vtkPointSetSlicer::SetLocator(vtkPointLocator *locator)
499 {
500  if (this->Locator == locator)
501  {
502  return;
503  }
504  if (this->Locator)
505  {
506  this->Locator->UnRegister(this);
507  this->Locator = nullptr;
508  }
509  if (locator)
510  {
511  locator->Register(this);
512  }
513  this->Locator = locator;
514  this->Modified();
515 }
516 
518 {
519  if (this->Locator == nullptr)
520  {
521  this->Locator = vtkMergePoints::New();
522  this->Locator->Register(this);
523  this->Locator->Delete();
524  }
525 }
526 
527 void vtkPointSetSlicer::PrintSelf(std::ostream &os, vtkIndent indent)
528 {
529  this->Superclass::PrintSelf(os, indent);
530 
531  os << indent << "Slice Plane: " << this->SlicePlane << "\n";
532 
533  if (this->Locator)
534  {
535  os << indent << "Locator: " << this->Locator << "\n";
536  }
537  else
538  {
539  os << indent << "Locator: (none)\n";
540  }
541 
542  os << indent << "Generate Cut Scalars: " << (this->GenerateCutScalars ? "On\n" : "Off\n");
543 }
544 
545 int vtkPointSetSlicer::edges[12][2] = {
546  {0, 1}, {1, 2}, {3, 2}, {0, 3}, {4, 5}, {5, 6}, {7, 6}, {4, 7}, {0, 4}, {1, 5}, {2, 6}, {3, 7}};
547 
548 vtkPointSetSlicer::POLY_CASES vtkPointSetSlicer::polyCases[256] = {
549  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{0, 3, 8, -1, -1, -1, -1, -1}}, {{1, 0, 9, -1, -1, -1, -1, -1}},
550  {{1, 3, 8, 9, -1, -1, -1, -1}}, {{2, 1, 10, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
551  {{2, 0, 9, 10, -1, -1, -1, -1}}, {{2, 10, 9, 8, 3, -1, -1, -1}}, {{3, 2, 11, -1, -1, -1, -1, -1}},
552  {{0, 2, 11, 8, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{1, 9, 8, 11, 2, -1, -1, -1}},
553  {{3, 1, 10, 11, -1, -1, -1, -1}}, {{0, 8, 11, 10, 1, -1, -1, -1}}, {{3, 11, 10, 9, 0, -1, -1, -1}},
554  {{8, 9, 10, 11, -1, -1, -1, -1}}, {{4, 7, 8, -1, -1, -1, -1, -1}}, {{3, 7, 4, 0, -1, -1, -1, -1}},
555  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{9, 1, 3, 7, 4, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
556  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
557  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{11, 2, 0, 4, 7, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
558  {{1, 2, 11, 7, 4, 9, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
559  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{4, 7, 11, 10, 9, -1, -1, -1}}, {{5, 4, 9, -1, -1, -1, -1, -1}},
560  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{0, 4, 5, 1, -1, -1, -1, -1}}, {{8, 3, 1, 5, 4, -1, -1, -1}},
561  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{10, 2, 0, 4, 5, -1, -1, -1}},
562  {{2, 3, 8, 4, 5, 10, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
563  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
564  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{5, 4, 8, 11, 10, -1, -1, -1}},
565  {{5, 7, 8, 9, -1, -1, -1, -1}}, {{9, 5, 7, 3, 0, -1, -1, -1}}, {{8, 7, 5, 1, 0, -1, -1, -1}},
566  {{1, 3, 7, 5, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
567  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{2, 10, 5, 7, 3, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
568  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{2, 11, 7, 5, 1, -1, -1, -1}},
569  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
570  {{5, 7, 11, 10, -1, -1, -1, -1}}, {{6, 5, 10, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
571  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{1, 5, 6, 2, -1, -1, -1, -1}},
572  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{9, 0, 2, 6, 5, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
573  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
574  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{11, 3, 1, 5, 6, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
575  {{3, 0, 9, 5, 6, 11, -1, -1}}, {{6, 5, 9, 8, 11, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
576  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
577  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
578  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
579  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
580  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
581  {{6, 4, 9, 10, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{10, 6, 4, 0, 1, -1, -1, -1}},
582  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{9, 4, 6, 2, 1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
583  {{2, 0, 4, 6, -1, -1, -1, -1}}, {{3, 8, 4, 6, 2, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
584  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
585  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{3, 11, 6, 4, 0, -1, -1, -1}},
586  {{6, 4, 8, 11, -1, -1, -1, -1}}, {{6, 10, 9, 8, 7, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
587  {{6, 7, 8, 0, 1, 10, -1, -1}}, {{6, 10, 1, 3, 7, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
588  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{7, 8, 0, 2, 6, -1, -1, -1}}, {{2, 6, 7, 3, -1, -1, -1, -1}},
589  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
590  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
591  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{6, 7, 11, -1, -1, -1, -1, -1}}, {{7, 6, 11, -1, -1, -1, -1, -1}},
592  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
593  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
594  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{2, 6, 7, 3, -1, -1, -1, -1}}, {{8, 0, 2, 6, 7, -1, -1, -1}},
595  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{10, 1, 3, 7, 6, -1, -1, -1}},
596  {{0, 1, 10, 6, 7, 8, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{7, 6, 10, 9, 8, -1, -1, -1}},
597  {{4, 6, 11, 8, -1, -1, -1, -1}}, {{11, 6, 4, 0, 3, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
598  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
599  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{8, 4, 6, 2, 3, -1, -1, -1}},
600  {{0, 2, 6, 4, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{1, 9, 4, 6, 2, -1, -1, -1}},
601  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{1, 10, 6, 4, 0, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
602  {{4, 6, 10, 9, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
603  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
604  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
605  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
606  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
607  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{5, 9, 8, 11, 6, -1, -1, -1}},
608  {{5, 6, 11, 3, 0, 9, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{6, 11, 3, 1, 5, -1, -1, -1}},
609  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
610  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{5, 9, 0, 2, 6, -1, -1, -1}},
611  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{1, 5, 6, 2, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
612  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{5, 6, 10, -1, -1, -1, -1, -1}},
613  {{7, 5, 10, 11, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
614  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{11, 7, 5, 1, 2, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
615  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{10, 5, 7, 3, 2, -1, -1, -1}},
616  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
617  {{3, 1, 5, 7, -1, -1, -1, -1}}, {{0, 8, 7, 5, 1, -1, -1, -1}}, {{0, 9, 5, 7, 3, -1, -1, -1}},
618  {{7, 5, 9, 8, -1, -1, -1, -1}}, {{4, 8, 11, 10, 5, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
619  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
620  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
621  {{4, 5, 10, 2, 3, 8, -1, -1}}, {{5, 10, 2, 0, 4, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
622  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{4, 8, 3, 1, 5, -1, -1, -1}}, {{0, 4, 5, 1, -1, -1, -1, -1}},
623  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{4, 5, 9, -1, -1, -1, -1, -1}}, {{7, 11, 10, 9, 4, -1, -1, -1}},
624  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
625  {{7, 4, 9, 1, 2, 11, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{7, 11, 2, 0, 4, -1, -1, -1}},
626  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
627  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{4, 9, 1, 3, 7, -1, -1, -1}},
628  {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{3, 7, 4, 0, -1, -1, -1, -1}}, {{7, 4, 8, -1, -1, -1, -1, -1}},
629  {{10, 11, 8, 9, -1, -1, -1, -1}}, {{0, 3, 11, 10, 9, -1, -1, -1}}, {{1, 0, 8, 11, 10, -1, -1, -1}},
630  {{1, 3, 11, 10, -1, -1, -1, -1}}, {{2, 1, 9, 8, 11, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}},
631  {{2, 0, 8, 11, -1, -1, -1, -1}}, {{2, 3, 11, -1, -1, -1, -1, -1}}, {{3, 2, 10, 9, 8, -1, -1, -1}},
632  {{0, 2, 10, 9, -1, -1, -1, -1}}, {{-1, -1, -1, -1, -1, -1, -1, -1}}, {{1, 2, 10, -1, -1, -1, -1, -1}},
633  {{3, 1, 9, 8, -1, -1, -1, -1}}, {{0, 1, 9, -1, -1, -1, -1, -1}}, {{3, 0, 8, -1, -1, -1, -1, -1}},
634  {{-1, -1, -1, -1, -1, -1, -1, -1}}};
void PrintSelf(std::ostream &os, vtkIndent indent) override
virtual void SetSlicePlane(vtkPlane *)
vtkPointSetSlicer(vtkPlane *cf=nullptr)
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void ContourUnstructuredGridCell(vtkCell *cell, vtkDataArray *cellScalars, vtkPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd)
vtkPointLocator * Locator
static void info(const char *fmt,...)
Definition: svm.cpp:86
static Vector3D offset
~vtkPointSetSlicer() override
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
vtkStandardNewMacro(vtkPointSetSlicer)
void SetLocator(vtkPointLocator *locator)
int FillInputPortInformation(int port, vtkInformation *info) override
vtkMTimeType GetMTime() override