vtkmClip.h 2.63 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//=============================================================================
//
//  Copyright (c) Kitware, Inc.
//  All rights reserved.
//  See LICENSE.txt for details.
//
//  This software is distributed WITHOUT ANY WARRANTY; without even
//  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
//  PURPOSE.  See the above copyright notice for more information.
//
//  Copyright 2012 Sandia Corporation.
//  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
//  the U.S. Government retains certain rights in this software.
//
//=============================================================================
David C. Lonie's avatar
David C. Lonie committed
16
17
18
/**
 * @class vtkmClip
 * @brief Clip a dataset using the accelerated vtk-m Clip filter.
19
20
21
22
 *
 * Clip a dataset using either a given value or by using an vtkImplicitFunction
 * Currently the supported implicit functions are Box, Plane, and Sphere.
 *
David C. Lonie's avatar
David C. Lonie committed
23
24
25
26
27
28
 */

#ifndef vtkmClip_h
#define vtkmClip_h

#include "vtkAcceleratorsVTKmModule.h" // For export macro
29
30
#include "vtkUnstructuredGridAlgorithm.h"
#include "vtkmlib/ImplicitFunctionConverter.h" // For ImplicitFunctionConverter
David C. Lonie's avatar
David C. Lonie committed
31

32
33
34
35
36
#include <memory> // For std::shared_ptr

class vtkImplicitFunction;

class VTKACCELERATORSVTKM_EXPORT vtkmClip : public vtkUnstructuredGridAlgorithm
David C. Lonie's avatar
David C. Lonie committed
37
38
39
{
public:
  static vtkmClip* New();
40
  vtkTypeMacro(vtkmClip, vtkUnstructuredGridAlgorithm)
41
  void PrintSelf(ostream &os, vtkIndent indent) override;
David C. Lonie's avatar
David C. Lonie committed
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

  /**
   * The scalar value to use when clipping the dataset. Values greater than
   * ClipValue are preserved in the output dataset. Default is 0.
   */
  vtkGetMacro(ClipValue, double)
  vtkSetMacro(ClipValue, double)

  /**
   * If true, all input point data arrays will be mapped onto the output
   * dataset. Default is true.
   */
  vtkGetMacro(ComputeScalars, bool)
  vtkSetMacro(ComputeScalars, bool)

57
58
59
60
61
62
63
64
  /**
   * Set the implicit function with which to perform the clipping. If set,
   * \c ClipValue is ignored and the clipping is performed using the implicit
   * function.
   */
  void SetClipFunction(vtkImplicitFunction *);
  vtkGetObjectMacro(ClipFunction, vtkImplicitFunction);

65
  vtkMTimeType GetMTime() override;
66

David C. Lonie's avatar
David C. Lonie committed
67
68
69
70
71
protected:
  vtkmClip();
  ~vtkmClip();

  int RequestData(vtkInformation*, vtkInformationVector**,
72
                  vtkInformationVector*) override;
David C. Lonie's avatar
David C. Lonie committed
73

74
  int FillInputPortInformation(int port, vtkInformation* info) override;
David C. Lonie's avatar
David C. Lonie committed
75
76
77
78

  double ClipValue;
  bool ComputeScalars;

79
80
81
  vtkImplicitFunction *ClipFunction;
  tovtkm::ImplicitFunctionConverter ClipFunctionConverter;

David C. Lonie's avatar
David C. Lonie committed
82
83
84
85
86
87
88
private:
  vtkmClip(const vtkmClip&) VTK_DELETE_FUNCTION;
  void operator=(const vtkmClip&) VTK_DELETE_FUNCTION;
};

#endif // vtkmClip_h
// VTK-HeaderTest-Exclude: vtkmClip.h