Medical Imaging Interaction Toolkit  2018.4.99-bd7b41ba
Medical Imaging Interaction Toolkit
vtkPointSetSlicer.h
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 
13 #ifndef _VTKPOINTSETSLICER_H_
14 #define _VTKPOINTSETSLICER_H_
15 
16 #include <iostream>
17 
18 #include "vtkVersion.h"
19 
20 class vtkCutter;
21 class vtkPlane;
22 class vtkPointLocator;
23 class vtkCell;
24 class vtkDataArray;
25 class vtkCellArray;
26 class vtkPointData;
27 class vtkCellData;
28 
29 #include "mitkCommon.h"
30 
31 #include "vtkPolyDataAlgorithm.h"
32 
33 class vtkPointSetSlicer : public vtkPolyDataAlgorithm
34 {
35 public:
36  vtkTypeMacro(vtkPointSetSlicer, vtkPolyDataAlgorithm);
37 
38  void PrintSelf(std::ostream &os, vtkIndent indent) override;
39 
40  // Description:
41  // Construct with user-specified implicit function; initial value of 0.0; and
42  // generating cut scalars turned off.
43  static vtkPointSetSlicer *New();
44 
45  // Description:
46  // Override GetMTime because we delegate to vtkContourValues and refer to
47  // vtkImplicitFunction.
48  vtkMTimeType GetMTime() override;
49 
50  // Description
51  // Specify the implicit function to perform the cutting.
52  virtual void SetSlicePlane(vtkPlane *);
53  vtkGetObjectMacro(SlicePlane, vtkPlane);
54 
55  // Description:
56  // If this flag is enabled, then the output scalar values will be
57  // interpolated from the implicit function values, and not the input scalar
58  // data.
62 
63  // Description:
64  // Specify a spatial locator for merging points. By default,
65  // an instance of vtkMergePoints is used.
66  void SetLocator(vtkPointLocator *locator);
67  vtkGetObjectMacro(Locator, vtkPointLocator);
68 
69  // Description:
70  // Create default locator. Used to create one when none is specified. The
71  // locator is used to merge coincident points.
72  void CreateDefaultLocator();
73 
74 protected:
75  vtkPointSetSlicer(vtkPlane *cf = nullptr);
76  ~vtkPointSetSlicer() override;
77 
78  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
79  int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
80  int FillInputPortInformation(int port, vtkInformation *info) override;
81 
82  void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output);
83 
84  void ContourUnstructuredGridCell(vtkCell *cell,
85  vtkDataArray *cellScalars,
86  vtkPointLocator *locator,
87  vtkCellArray *verts,
88  vtkCellArray *lines,
89  vtkCellArray *polys,
90  vtkPointData *inPd,
91  vtkPointData *outPd,
92  vtkCellData *inCd,
93  vtkIdType cellId,
94  vtkCellData *outCd);
95 
96  vtkPlane *SlicePlane;
97  vtkCutter *Cutter;
98 
99  vtkPointLocator *Locator;
101 
102 private:
103  vtkPointSetSlicer(const vtkPointSetSlicer &); // Not implemented.
104  void operator=(const vtkPointSetSlicer &); // Not implemented.
105 
106  static int edges[12][2];
107 
108  typedef int EDGE_LIST;
109  typedef struct
110  {
111  EDGE_LIST edges[8];
112  } POLY_CASES;
113 
114  static POLY_CASES polyCases[256];
115 };
116 
117 #endif /* _VTKPOINTSETSLICER_H_ */
void PrintSelf(std::ostream &os, vtkIndent indent) override
vtkGetObjectMacro(SlicePlane, vtkPlane)
virtual void SetSlicePlane(vtkPlane *)
vtkTypeMacro(vtkPointSetSlicer, vtkPolyDataAlgorithm)
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)
vtkGetMacro(GenerateCutScalars, int)
vtkPointLocator * Locator
static void info(const char *fmt,...)
Definition: svm.cpp:86
vtkBooleanMacro(GenerateCutScalars, int)
~vtkPointSetSlicer() override
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkSetMacro(GenerateCutScalars, int)
void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
static vtkPointSetSlicer * New()
void SetLocator(vtkPointLocator *locator)
int FillInputPortInformation(int port, vtkInformation *info) override
vtkMTimeType GetMTime() override