Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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_ */
vtkPointSetSlicer
Definition: vtkPointSetSlicer.h:33
vtkPointSetSlicer::GenerateCutScalars
int GenerateCutScalars
Definition: vtkPointSetSlicer.h:100
vtkPointSetSlicer::vtkBooleanMacro
vtkBooleanMacro(GenerateCutScalars, int)
vtkPointSetSlicer::CreateDefaultLocator
void CreateDefaultLocator()
vtkPointSetSlicer::PrintSelf
void PrintSelf(std::ostream &os, vtkIndent indent) override
vtkPointSetSlicer::Locator
vtkPointLocator * Locator
Definition: vtkPointSetSlicer.h:99
vtkPointSetSlicer::SetSlicePlane
virtual void SetSlicePlane(vtkPlane *)
vtkPointSetSlicer::SetLocator
void SetLocator(vtkPointLocator *locator)
vtkPointSetSlicer::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkPointSetSlicer::vtkGetObjectMacro
vtkGetObjectMacro(SlicePlane, vtkPlane)
vtkPointSetSlicer::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
vtkPointSetSlicer::vtkSetMacro
vtkSetMacro(GenerateCutScalars, int)
vtkPointSetSlicer::vtkTypeMacro
vtkTypeMacro(vtkPointSetSlicer, vtkPolyDataAlgorithm)
vtkPointSetSlicer::Cutter
vtkCutter * Cutter
Definition: vtkPointSetSlicer.h:97
vtkPointSetSlicer::GetMTime
vtkMTimeType GetMTime() override
vtkPointSetSlicer::SlicePlane
vtkPlane * SlicePlane
Definition: vtkPointSetSlicer.h:96
vtkPointSetSlicer::~vtkPointSetSlicer
~vtkPointSetSlicer() override
mitkCommon.h
vtkPointSetSlicer::ContourUnstructuredGridCell
void ContourUnstructuredGridCell(vtkCell *cell, vtkDataArray *cellScalars, vtkPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd)
vtkPointSetSlicer::UnstructuredGridCutter
void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
vtkPointSetSlicer::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkPointSetSlicer::vtkGetMacro
vtkGetMacro(GenerateCutScalars, int)
vtkPointSetSlicer::New
static vtkPointSetSlicer * New()
vtkPointSetSlicer::vtkPointSetSlicer
vtkPointSetSlicer(vtkPlane *cf=nullptr)