vtkExtractGeometry.h 3.55 KB
Newer Older
Will Schroeder's avatar
Will Schroeder committed
1 2
/*=========================================================================

Ken Martin's avatar
Ken Martin committed
3
  Program:   Visualization Toolkit
Ken Martin's avatar
Ken Martin committed
4
  Module:    vtkExtractGeometry.h
Will Schroeder's avatar
Will Schroeder committed
5

6
  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 8
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
Ken Martin's avatar
Ken Martin committed
9

10 11
     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
     PURPOSE.  See the above copyright notice for more information.
Will Schroeder's avatar
Will Schroeder committed
13 14

=========================================================================*/
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
/**
 * @class   vtkExtractGeometry
 * @brief   extract cells that lie either entirely inside or outside of a specified implicit function
 *
 *
 * vtkExtractGeometry extracts from its input dataset all cells that are either
 * completely inside or outside of a specified implicit function. Any type of
 * dataset can be input to this filter. On output the filter generates an
 * unstructured grid.
 *
 * To use this filter you must specify an implicit function. You must also
 * specify whethter to extract cells laying inside or outside of the implicit
 * function. (The inside of an implicit function is the negative values
 * region.) An option exists to extract cells that are neither inside or
 * outside (i.e., boundary).
 *
 * A more efficient version of this filter is available for vtkPolyData input.
 * See vtkExtractPolyDataGeometry.
 *
 * @sa
 * vtkExtractPolyDataGeometry vtkGeometryFilter vtkExtractVOI
*/
37

38 39
#ifndef vtkExtractGeometry_h
#define vtkExtractGeometry_h
Will Schroeder's avatar
Will Schroeder committed
40

41
#include "vtkFiltersExtractionModule.h" // For export macro
42
#include "vtkUnstructuredGridAlgorithm.h"
43 44

class vtkImplicitFunction;
Will Schroeder's avatar
Will Schroeder committed
45

46
class VTKFILTERSEXTRACTION_EXPORT vtkExtractGeometry : public vtkUnstructuredGridAlgorithm
Will Schroeder's avatar
Will Schroeder committed
47 48
{
public:
49
  vtkTypeMacro(vtkExtractGeometry,vtkUnstructuredGridAlgorithm);
50
  void PrintSelf(ostream& os, vtkIndent indent) override;
Will Schroeder's avatar
Will Schroeder committed
51

52 53 54
  /**
   * Construct object with ExtractInside turned on.
   */
55
  static vtkExtractGeometry *New();
Ken Martin's avatar
Ken Martin committed
56

57 58 59
  /**
   * Return the MTime taking into account changes to the implicit function
   */
60
  vtkMTimeType GetMTime() override;
Will Schroeder's avatar
Will Schroeder committed
61

62 63 64 65
  //@{
  /**
   * Specify the implicit function for inside/outside checks.
   */
66
  virtual void SetImplicitFunction(vtkImplicitFunction*);
Ken Martin's avatar
Ken Martin committed
67
  vtkGetObjectMacro(ImplicitFunction,vtkImplicitFunction);
68 69 70 71 72 73 74 75
  //@}

  //@{
  /**
   * Boolean controls whether to extract cells that are inside of implicit
   * function (ExtractInside == 1) or outside of implicit function
   * (ExtractInside == 0).
   */
Ken Martin's avatar
Ken Martin committed
76 77 78
  vtkSetMacro(ExtractInside,int);
  vtkGetMacro(ExtractInside,int);
  vtkBooleanMacro(ExtractInside,int);
79
  //@}
Will Schroeder's avatar
Will Schroeder committed
80

81 82 83 84 85
  //@{
  /**
   * Boolean controls whether to extract cells that are partially inside.
   * By default, ExtractBoundaryCells is off.
   */
86 87 88
  vtkSetMacro(ExtractBoundaryCells,int);
  vtkGetMacro(ExtractBoundaryCells,int);
  vtkBooleanMacro(ExtractBoundaryCells,int);
89 90 91
  vtkSetMacro(ExtractOnlyBoundaryCells,int);
  vtkGetMacro(ExtractOnlyBoundaryCells,int);
  vtkBooleanMacro(ExtractOnlyBoundaryCells,int);
92
  //@}
93

Will Schroeder's avatar
Will Schroeder committed
94
protected:
95
  vtkExtractGeometry(vtkImplicitFunction *f=nullptr);
96
  ~vtkExtractGeometry() override;
97

Will Schroeder's avatar
Will Schroeder committed
98
  // Usual data generation method
99
  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
100

101
  int FillInputPortInformation(int port, vtkInformation *info) override;
Will Schroeder's avatar
Will Schroeder committed
102

Ken Martin's avatar
Ken Martin committed
103
  vtkImplicitFunction *ImplicitFunction;
Will Schroeder's avatar
Will Schroeder committed
104
  int ExtractInside;
105
  int ExtractBoundaryCells;
106
  int ExtractOnlyBoundaryCells;
107

108
private:
109 110
  vtkExtractGeometry(const vtkExtractGeometry&) = delete;
  void operator=(const vtkExtractGeometry&) = delete;
Will Schroeder's avatar
Will Schroeder committed
111 112 113 114 115
};

#endif