VTK  9.3.1
vtkAMRBaseParticlesReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
9 #ifndef vtkAMRBaseParticlesReader_h
10 #define vtkAMRBaseParticlesReader_h
11 
12 #include "vtkIOAMRModule.h" // For export macro
14 
15 VTK_ABI_NAMESPACE_BEGIN
16 class vtkInformation;
18 class vtkIndent;
20 class vtkPolyData;
22 class vtkCallbackCommand;
23 
25 {
26 public:
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
31 
34  vtkGetMacro(Frequency, int);
35  vtkSetMacro(Frequency, int);
37 
39 
42  vtkGetObjectMacro(Controller, vtkMultiProcessController);
43  virtual void SetController(vtkMultiProcessController*);
45 
47 
50  vtkSetMacro(FilterLocation, vtkTypeBool);
51  vtkGetMacro(FilterLocation, vtkTypeBool);
52  vtkBooleanMacro(FilterLocation, vtkTypeBool);
54 
56 
60  vtkGetObjectMacro(ParticleDataArraySelection, vtkDataArraySelection);
62 
66  int GetNumberOfParticleArrays();
67 
72  const char* GetParticleArrayName(int index);
73 
75 
78  int GetParticleArrayStatus(const char* name);
79  void SetParticleArrayStatus(const char* name, int status);
81 
82  virtual void SetFileName(VTK_FILEPATH const char* fileName);
83  vtkGetFilePathMacro(FileName);
84 
86 
89  inline void SetMinLocation(double minx, double miny, double minz)
90  {
91  this->MinLocation[0] = minx;
92  this->MinLocation[1] = miny;
93  this->MinLocation[2] = minz;
94  }
96 
98 
101  inline void SetMaxLocation(double maxx, double maxy, double maxz)
102  {
103  this->MaxLocation[0] = maxx;
104  this->MaxLocation[1] = maxy;
105  this->MaxLocation[2] = maxz;
106  }
108 
112  virtual int GetTotalNumberOfParticles() = 0;
113 
114 protected:
116  ~vtkAMRBaseParticlesReader() override;
117 
124  virtual void ReadMetaData() = 0;
125 
130  virtual vtkPolyData* ReadParticles(int blkIdx) = 0;
131 
138  bool CheckLocation(double x, double y, double z);
139 
143  bool IsParallel();
144 
149  bool IsBlockMine(int blkIdx);
150 
158  int GetBlockProcessId(int blkIdx);
159 
164  void Initialize();
165 
167 
173 
179  void InitializeParticleDataSelections();
180 
185  virtual void SetupParticleDataSelections() = 0;
186 
191  static void SelectionModifiedCallback(
192  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
193 
195 
198  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
199  vtkInformationVector* outputVector) override;
202 
204 
206  double MinLocation[3];
207  double MaxLocation[3];
208 
211 
214  char* FileName;
215 
216 private:
218  void operator=(const vtkAMRBaseParticlesReader&) = delete;
219 };
220 
221 VTK_ABI_NAMESPACE_END
222 #endif /* vtkAMRBaseParticlesReader_h */
abstract base class for most VTK objects
Definition: vtkObject.h:51
void SetMaxLocation(double maxx, double maxy, double maxz)
Sets the max location.
Store vtkAlgorithm input/output information.
void SetMinLocation(double minx, double miny, double minz)
Sets the min location.
vtkCallbackCommand * SelectionObserver
Standard Array selection variables & methods.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkMultiProcessController * Controller
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
An abstract base class that implements all the common functionality for all particle readers...
int vtkTypeBool
Definition: vtkABI.h:64
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkDataArraySelection * ParticleDataArraySelection
Standard Array selection variables & methods.
Store on/off settings for data arrays, etc.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_FILEPATH
Store zero or more vtkInformation instances.
Multiprocessing communication superclass.