VTK
vtkExtractUserDefinedPiece.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkExtractUserDefinedPiece.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*----------------------------------------------------------------------------
16  Copyright (c) Sandia Corporation
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
19 
35 #ifndef vtkExtractUserDefinedPiece_h
36 #define vtkExtractUserDefinedPiece_h
37 
38 #include "vtkFiltersParallelModule.h" // For export macro
40 
42 {
43 public:
46  virtual void PrintSelf(ostream& os, vtkIndent indent);
47 
48 //BTX
49  typedef int (*UserDefFunc)(vtkIdType cellID, vtkUnstructuredGrid *grid, void *constantData);
50 //ETX
51 
52  // Set the function used to identify the piece. The function should
53  // return 1 if the cell is in the piece, and 0 otherwise.
54  void SetPieceFunction(UserDefFunc func) {this->InPiece = func; this->Modified();}
55 
56  // Set constant data to be used by the piece identifying function.
57  void SetConstantData(void *data, int len);
58 
59  // Get constant data to be used by the piece identifying function.
60  // Return the length of the data buffer.
61  int GetConstantData(void **data);
62 
63  // The function should return 1 if the cell
64  // is in the piece, and 0 otherwise.
65 
66 protected:
67 
70 
72 
73  void ComputeCellTagsWithFunction(vtkIntArray *tags, vtkIdList *pointOwnership,
74  vtkUnstructuredGrid *input);
75 
76 private:
77  vtkExtractUserDefinedPiece(const vtkExtractUserDefinedPiece&); // Not implemented
78  void operator=(const vtkExtractUserDefinedPiece&); // Not implemented
79 
80  void *ConstantData;
81  int ConstantDataLen;
82 
83  UserDefFunc InPiece;
84 };
85 #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:275
#define VTKFILTERSPARALLEL_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:49
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
dataset represents arbitrary combinations of all possible cell types
virtual void Modified()
Return user specified piece with ghost cells.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Store zero or more vtkInformation instances.