VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
41 class VTKFILTERSPARALLEL_EXPORT vtkExtractUserDefinedPiece : public vtkExtractUnstructuredGridPiece
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 
71  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
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()
void SetPieceFunction(UserDefFunc func)
void PrintSelf(ostream &os, vtkIndent indent)
Return user specified piece with ghost cells.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)