VTK  9.3.20240420
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
27VTK_ABI_NAMESPACE_BEGIN
28class VTKFILTERSPARALLEL_EXPORT vtkExtractUserDefinedPiece : public vtkExtractUnstructuredGridPiece
29{
30public:
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
55protected:
58
60
62 vtkIntArray* tags, vtkIdList* pointOwnership, vtkUnstructuredGrid* input);
63
64private:
66 void operator=(const vtkExtractUserDefinedPiece&) = delete;
67
68 void* ConstantData;
69 int ConstantDataLen;
70
71 UserDefFunc InPiece;
72};
73VTK_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.
int GetConstantData(void **data)
~vtkExtractUserDefinedPiece() override
static vtkExtractUserDefinedPiece * New()
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:133
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
virtual void Modified()
Update the modification time for this object.
dataset represents arbitrary combinations of all possible cell types
int vtkIdType
Definition vtkType.h:315