VTK
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
29class vtkInformation;
31class vtkIndent;
33class vtkPolyData;
36
37class VTKIOAMR_EXPORT vtkAMRBaseParticlesReader :
39{
40public:
42 void PrintSelf(ostream &os, vtkIndent indent );
43
45
48 vtkGetMacro(Frequency,int);
49 vtkSetMacro(Frequency,int);
51
53
56 vtkGetMacro(Controller, vtkMultiProcessController* );
59
61
64 vtkSetMacro(FilterLocation,int);
65 vtkGetMacro(FilterLocation,int);
66 vtkBooleanMacro(FilterLocation,int);
68
69
71
75 vtkGetObjectMacro(ParticleDataArraySelection,vtkDataArraySelection);
77
82
87 const char* GetParticleArrayName( int index );
88
90
93 int GetParticleArrayStatus( const char* name );
94 void SetParticleArrayStatus( const char* name, int status );
96
97
98 virtual void SetFileName( const char *fileName );
100
102
105 inline void SetMinLocation(
106 const double minx, const double miny, const double minz )
107 {
108 this->MinLocation[ 0 ] = minx;
109 this->MinLocation[ 1 ] = miny;
110 this->MinLocation[ 2 ] = minz;
111 }
113
115
118 inline void SetMaxLocation(
119 const double maxx, const double maxy, const double maxz )
120 {
121 this->MaxLocation[ 0 ] = maxx;
122 this->MaxLocation[ 1 ] = maxy;
123 this->MaxLocation[ 2 ] = maxz;
124 }
126
130 virtual int GetTotalNumberOfParticles() = 0;
131
132protected:
135
142 virtual void ReadMetaData() = 0;
143
148 virtual vtkPolyData* ReadParticles( const int blkIdx ) = 0;
149
156 bool CheckLocation( const double x, const double y, const double z );
157
161 bool IsParallel( );
162
167 bool IsBlockMine( const int blkIdx );
168
176 int GetBlockProcessId( const int blkIdx );
177
183
185
191
198
203 virtual void SetupParticleDataSelections() = 0;
204
210 vtkObject *caller,unsigned long eid,void *clientdata,void *calldata );
211
213
216 virtual int RequestData( vtkInformation *request,
217 vtkInformationVector **inputVector,
218 vtkInformationVector *outputVector );
221
223
225 double MinLocation[3];
226 double MaxLocation[3];
227
230
233 char *FileName;
234
235private:
236 vtkAMRBaseParticlesReader( const vtkAMRBaseParticlesReader& ) VTK_DELETE_FUNCTION;
237 void operator=(const vtkAMRBaseParticlesReader& ) VTK_DELETE_FUNCTION;
238};
239
240#endif /* vtkAMRBaseParticlesReader_h */
An abstract base class that implements all the common functionality for all particle readers.
void SetParticleArrayStatus(const char *name, int status)
bool CheckLocation(const double x, const double y, const double z)
Filters particles by their location.
virtual ~vtkAMRBaseParticlesReader()
vtkMultiProcessController * Controller
bool IsParallel()
Determines whether this reader instance is running in parallel or not.
void InitializeParticleDataSelections()
Initializes the ParticleDataArraySelection object.
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
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.
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
void Initialize()
Initializes the AMR Particles reader NOTE: must be called in the constructor of concrete classes.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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 int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Standard pipeline operations.
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:40
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:60
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.