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,
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
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
VTKFILTERSPARALLEL_EXPORT
#define VTKFILTERSPARALLEL_EXPORT
Definition: vtkFiltersParallelModule.h:15
vtkExtractUserDefinedPiece::~vtkExtractUserDefinedPiece
~vtkExtractUserDefinedPiece()
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkExtractUserDefinedPiece
Return user specified piece with ghost cells.
Definition: vtkExtractUserDefinedPiece.h:42
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkExtractUserDefinedPiece::New
static vtkExtractUserDefinedPiece * New()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject::Modified
virtual void Modified()
vtkExtractUserDefinedPiece::SetPieceFunction
void SetPieceFunction(UserDefFunc func)
Definition: vtkExtractUserDefinedPiece.h:54
vtkgl::func
GLenum func
Definition: vtkgl.h:11980
vtkgl::input
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
vtkFiltersParallelModule.h
vtkExtractUserDefinedPiece::ComputeCellTagsWithFunction
void ComputeCellTagsWithFunction(vtkIntArray *tags, vtkIdList *pointOwnership, vtkUnstructuredGrid *input)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:53
vtkExtractUserDefinedPiece::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkExtractUnstructuredGridPiece
Return specified piece, including specified number of ghost levels.
Definition: vtkExtractUnstructuredGridPiece.h:33
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkExtractUnstructuredGridPiece.h
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkExtractUserDefinedPiece::vtkExtractUserDefinedPiece
vtkExtractUserDefinedPiece()
vtkExtractUserDefinedPiece::GetConstantData
int GetConstantData(void **data)
vtkExtractUserDefinedPiece::SetConstantData
void SetConstantData(void *data, int len)
vtkgl::len
GLenum GLsizei len
Definition: vtkgl.h:13010
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:82
vtkExtractUserDefinedPiece::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
int
int
Definition: vtkVectorOperators.h:164