VTK  9.3.0
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:
58 
60 
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.
Return user specified piece with ghost cells.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkExtractUserDefinedPiece * New()
int GetConstantData(void **data)
~vtkExtractUserDefinedPiece() override
void SetPieceFunction(UserDefFunc func)
void SetConstantData(void *data, int len)
void ComputeCellTagsWithFunction(vtkIntArray *tags, vtkIdList *pointOwnership, vtkUnstructuredGrid *input)
list of point or cell ids
Definition: vtkIdList.h:32
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:44
virtual void Modified()
Update the modification time for this object.
dataset represents arbitrary combinations of all possible cell types
@ data
Definition: vtkX3D.h:315
int vtkIdType
Definition: vtkType.h:315