VTK  9.1.0
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 =========================================================================*/
21#ifndef vtkAMRBaseParticlesReader_h
22#define vtkAMRBaseParticlesReader_h
23
24#include "vtkIOAMRModule.h" // For export macro
26
27class vtkInformation;
29class vtkIndent;
31class vtkPolyData;
34
36{
37public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
42
45 vtkGetMacro(Frequency, int);
46 vtkSetMacro(Frequency, int);
48
50
53 vtkGetMacro(Controller, vtkMultiProcessController*);
54 vtkSetMacro(Controller, vtkMultiProcessController*);
56
58
61 vtkSetMacro(FilterLocation, vtkTypeBool);
62 vtkGetMacro(FilterLocation, vtkTypeBool);
63 vtkBooleanMacro(FilterLocation, vtkTypeBool);
65
67
71 vtkGetObjectMacro(ParticleDataArraySelection, vtkDataArraySelection);
73
78
83 const char* GetParticleArrayName(int index);
84
86
89 int GetParticleArrayStatus(const char* name);
90 void SetParticleArrayStatus(const char* name, int status);
92
93 virtual void SetFileName(VTK_FILEPATH const char* fileName);
95
97
100 inline void SetMinLocation(const double minx, const double miny, const double minz)
101 {
102 this->MinLocation[0] = minx;
103 this->MinLocation[1] = miny;
104 this->MinLocation[2] = minz;
105 }
107
109
112 inline void SetMaxLocation(const double maxx, const double maxy, const double maxz)
113 {
114 this->MaxLocation[0] = maxx;
115 this->MaxLocation[1] = maxy;
116 this->MaxLocation[2] = maxz;
117 }
119
123 virtual int GetTotalNumberOfParticles() = 0;
124
125protected:
128
135 virtual void ReadMetaData() = 0;
136
141 virtual vtkPolyData* ReadParticles(const int blkIdx) = 0;
142
149 bool CheckLocation(const double x, const double y, const double z);
150
155
160 bool IsBlockMine(const int blkIdx);
161
169 int GetBlockProcessId(const int blkIdx);
170
176
178
184
191
196 virtual void SetupParticleDataSelections() = 0;
197
203 vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
204
206
210 vtkInformationVector* outputVector) override;
213
215
217 double MinLocation[3];
218 double MaxLocation[3];
219
222
225 char* FileName;
226
227private:
229 void operator=(const vtkAMRBaseParticlesReader&) = delete;
230};
231
232#endif /* vtkAMRBaseParticlesReader_h */
An abstract base class that implements all the common functionality for all particle readers.
void SetParticleArrayStatus(const char *name, int status)
Get/Set whether the particle array 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.
virtual void SetFileName(VTK_FILEPATH const char *fileName)
~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.
virtual vtkPolyData * ReadParticles(const int blkIdx)=0
Reads the particles corresponding to the block associated with the given supplied block index.
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
Standard Array selection variables & methods.
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.
const char * GetParticleArrayName(int index)
Get the particle array name of the array associated with the given index.
void Initialize()
Initializes the AMR Particles reader NOTE: must be called in the constructor of concrete classes.
int FillOutputPortInformation(int port, vtkInformation *info) override
Standard pipeline operations.
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.
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.
supports function callbacks
Store on/off settings for data arrays for a vtkSource.
a simple class to control print indentation
Definition: vtkIndent.h:113
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:73
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
@ 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
#define VTK_FILEPATH