VTK  9.3.1
vtkExtractUserDefinedPiece.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
21 #ifndef vtkExtractUserDefinedPiece_h
22 #define vtkExtractUserDefinedPiece_h
23 
25 #include "vtkFiltersParallelModule.h" // For export macro
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class VTKFILTERSPARALLEL_EXPORT vtkExtractUserDefinedPiece : public vtkExtractUnstructuredGridPiece
29 {
30 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
35  typedef int (*UserDefFunc)(vtkIdType cellID, vtkUnstructuredGrid* grid, void* constantData);
36 
37  // Set the function used to identify the piece. The function should
38  // return 1 if the cell is in the piece, and 0 otherwise.
39  void SetPieceFunction(UserDefFunc func)
40  {
41  this->InPiece = func;
42  this->Modified();
43  }
44 
45  // Set constant data to be used by the piece identifying function.
46  void SetConstantData(void* data, int len);
47 
48  // Get constant data to be used by the piece identifying function.
49  // Return the length of the data buffer.
50  int GetConstantData(void** data);
51 
52  // The function should return 1 if the cell
53  // is in the piece, and 0 otherwise.
54 
55 protected:
57  ~vtkExtractUserDefinedPiece() override;
58 
60 
61  void ComputeCellTagsWithFunction(
62  vtkIntArray* tags, vtkIdList* pointOwnership, vtkUnstructuredGrid* input);
63 
64 private:
66  void operator=(const vtkExtractUserDefinedPiece&) = delete;
67 
68  void* ConstantData;
69  int ConstantDataLen;
70 
71  UserDefFunc InPiece;
72 };
73 VTK_ABI_NAMESPACE_END
74 #endif
Return specified piece, including specified number of ghost levels.
static vtkExtractUnstructuredGridPiece * New()
Store vtkAlgorithm input/output information.
void SetPieceFunction(UserDefFunc func)
int vtkIdType
Definition: vtkType.h:315
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:34
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:22
dataset represents arbitrary combinations of all possible cell types
virtual void Modified()
Update the modification time for this object.
Return user specified piece with ghost cells.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
Store zero or more vtkInformation instances.