VTK  9.0.1
vtkAMRBaseParticlesReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRBaseParticlesReader.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  =========================================================================*/
23 #ifndef vtkAMRBaseParticlesReader_h
24 #define vtkAMRBaseParticlesReader_h
25 
26 #include "vtkIOAMRModule.h" // For export macro
28 
29 class vtkInformation;
31 class vtkIndent;
33 class vtkPolyData;
35 class vtkCallbackCommand;
36 
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
47  vtkGetMacro(Frequency, int);
48  vtkSetMacro(Frequency, int);
50 
52 
55  vtkGetMacro(Controller, vtkMultiProcessController*);
56  vtkSetMacro(Controller, vtkMultiProcessController*);
58 
60 
63  vtkSetMacro(FilterLocation, vtkTypeBool);
64  vtkGetMacro(FilterLocation, vtkTypeBool);
65  vtkBooleanMacro(FilterLocation, vtkTypeBool);
67 
69 
73  vtkGetObjectMacro(ParticleDataArraySelection, vtkDataArraySelection);
75 
80 
85  const char* GetParticleArrayName(int index);
86 
88 
91  int GetParticleArrayStatus(const char* name);
92  void SetParticleArrayStatus(const char* name, int status);
94 
95  virtual void SetFileName(const char* fileName);
96  vtkGetStringMacro(FileName);
97 
99 
102  inline void SetMinLocation(const double minx, const double miny, const double minz)
103  {
104  this->MinLocation[0] = minx;
105  this->MinLocation[1] = miny;
106  this->MinLocation[2] = minz;
107  }
109 
111 
114  inline void SetMaxLocation(const double maxx, const double maxy, const double maxz)
115  {
116  this->MaxLocation[0] = maxx;
117  this->MaxLocation[1] = maxy;
118  this->MaxLocation[2] = maxz;
119  }
121 
125  virtual int GetTotalNumberOfParticles() = 0;
126 
127 protected:
130 
137  virtual void ReadMetaData() = 0;
138 
143  virtual vtkPolyData* ReadParticles(const int blkIdx) = 0;
144 
151  bool CheckLocation(const double x, const double y, const double z);
152 
156  bool IsParallel();
157 
162  bool IsBlockMine(const int blkIdx);
163 
171  int GetBlockProcessId(const int blkIdx);
172 
177  void Initialize();
178 
180 
186 
193 
198  virtual void SetupParticleDataSelections() = 0;
199 
205  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
206 
208 
211  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
212  vtkInformationVector* outputVector) override;
215 
217 
219  double MinLocation[3];
220  double MaxLocation[3];
221 
224 
227  char* FileName;
228 
229 private:
231  void operator=(const vtkAMRBaseParticlesReader&) = delete;
232 };
233 
234 #endif /* vtkAMRBaseParticlesReader_h */
An abstract base class that implements all the common functionality for all particle readers.
const char * GetParticleArrayName(int index)
Get the particle array name of the array associated with the given index.
void SetParticleArrayStatus(const char *name, int status)
bool CheckLocation(const double x, const double y, const double z)
Filters particles by their location.
vtkMultiProcessController * Controller
bool IsParallel()
Determines whether this reader instance is running in parallel or not.
~vtkAMRBaseParticlesReader() override
void InitializeParticleDataSelections()
Initializes the ParticleDataArraySelection object.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetNumberOfParticleArrays()
Get the number of particles arrays available in the input.
virtual void ReadMetaData()=0
Reads the metadata, e.g., the number of blocks in the file.
void SetMaxLocation(const double maxx, const double maxy, const double maxz)
Sets the max location.
vtkCallbackCommand * SelectionObserver
void SetMinLocation(const double minx, const double miny, const double minz)
Sets the min location.
int GetParticleArrayStatus(const char *name)
Get/Set whether the particle array status.
bool IsBlockMine(const int blkIdx)
Determines if the block associated with the given block index belongs to the process that executes th...
int GetBlockProcessId(const int blkIdx)
Given the block index, this method determines the process Id.
void Initialize()
Initializes the AMR Particles reader NOTE: must be called in the constructor of concrete classes.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Standard pipeline operations.
static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
Call-back registered with the SelectionObserver for selecting/deselecting particles.
virtual vtkPolyData * ReadParticles(const int blkIdx)=0
Reads the particles corresponding to the block associated with the given supplied block index.
vtkDataArraySelection * ParticleDataArraySelection
Standard Array selection variables & methods.
virtual void SetupParticleDataSelections()=0
Sets up the ParticleDataArraySelection.
virtual int GetTotalNumberOfParticles()=0
Returns the total number of particles.
virtual void SetFileName(const char *fileName)
supports function callbacks
Store on/off settings for data arrays for a vtkSource.
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Multiprocessing communication superclass.
abstract base class for most VTK objects
Definition: vtkObject.h:63
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ name
Definition: vtkX3D.h:225
@ index
Definition: vtkX3D.h:252
int vtkTypeBool
Definition: vtkABI.h:69