Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _VTKPOINTSETSLICER_H_
18 #define _VTKPOINTSETSLICER_H_
19 
20 #include <iostream>
21 
22 #include "vtkVersion.h"
23 
24 class vtkCutter;
25 class vtkPlane;
26 class vtkPointLocator;
27 class vtkCell;
28 class vtkDataArray;
29 class vtkCellArray;
30 class vtkPointData;
31 class vtkCellData;
32 
33 #include "mitkCommon.h"
34 
35 #include "vtkPolyDataAlgorithm.h"
36 
37 class vtkPointSetSlicer : public vtkPolyDataAlgorithm
38 {
39 public:
40  vtkTypeMacro(vtkPointSetSlicer, vtkPolyDataAlgorithm);
41 
42  void PrintSelf(std::ostream &os, vtkIndent indent) override;
43 
44  // Description:
45  // Construct with user-specified implicit function; initial value of 0.0; and
46  // generating cut scalars turned off.
47  static vtkPointSetSlicer *New();
48 
49  // Description:
50  // Override GetMTime because we delegate to vtkContourValues and refer to
51  // vtkImplicitFunction.
52  unsigned long GetMTime() override;
53 
54  // Description
55  // Specify the implicit function to perform the cutting.
56  virtual void SetSlicePlane(vtkPlane *);
57  vtkGetObjectMacro(SlicePlane, vtkPlane);
58 
59  // Description:
60  // If this flag is enabled, then the output scalar values will be
61  // interpolated from the implicit function values, and not the input scalar
62  // data.
66 
67  // Description:
68  // Specify a spatial locator for merging points. By default,
69  // an instance of vtkMergePoints is used.
70  void SetLocator(vtkPointLocator *locator);
71  vtkGetObjectMacro(Locator, vtkPointLocator);
72 
73  // Description:
74  // Create default locator. Used to create one when none is specified. The
75  // locator is used to merge coincident points.
76  void CreateDefaultLocator();
77 
78 protected:
79  vtkPointSetSlicer(vtkPlane *cf = 0);
81 
82  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
83  virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
84  virtual int FillInputPortInformation(int port, vtkInformation *info) override;
85 
86  void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output);
87 
88  void ContourUnstructuredGridCell(vtkCell *cell,
89  vtkDataArray *cellScalars,
90  vtkPointLocator *locator,
91  vtkCellArray *verts,
92  vtkCellArray *lines,
93  vtkCellArray *polys,
94  vtkPointData *inPd,
95  vtkPointData *outPd,
96  vtkCellData *inCd,
97  vtkIdType cellId,
98  vtkCellData *outCd);
99 
100  vtkPlane *SlicePlane;
101  vtkCutter *Cutter;
102 
103  vtkPointLocator *Locator;
105 
106 private:
107  vtkPointSetSlicer(const vtkPointSetSlicer &); // Not implemented.
108  void operator=(const vtkPointSetSlicer &); // Not implemented.
109 
110  static int edges[12][2];
111 
112  typedef int EDGE_LIST;
113  typedef struct
114  {
115  EDGE_LIST edges[8];
116  } POLY_CASES;
117 
118  static POLY_CASES polyCases[256];
119 };
120 
121 #endif /* _VTKPOINTSETSLICER_H_ */
void PrintSelf(std::ostream &os, vtkIndent indent) override
vtkGetObjectMacro(SlicePlane, vtkPlane)
virtual void SetSlicePlane(vtkPlane *)
vtkTypeMacro(vtkPointSetSlicer, vtkPolyDataAlgorithm)
virtual 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:100
vtkBooleanMacro(GenerateCutScalars, int)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkSetMacro(GenerateCutScalars, int)
unsigned long GetMTime() override
vtkPointSetSlicer(vtkPlane *cf=0)
void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
static vtkPointSetSlicer * New()
void SetLocator(vtkPointLocator *locator)
virtual int FillInputPortInformation(int port, vtkInformation *info) override