VTK  9.1.0
vtkParticleReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkParticleReader.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=========================================================================*/
43#ifndef vtkParticleReader_h
44#define vtkParticleReader_h
45
46#include "vtkIOGeometryModule.h" // For export macro
48
49#define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
50#define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
51
52class VTKIOGEOMETRY_EXPORT vtkParticleReader : public vtkPolyDataAlgorithm
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
60
66
68
88
90
94 vtkSetMacro(SwapBytes, vtkTypeBool);
95 vtkTypeBool GetSwapBytes() { return this->SwapBytes; }
96 vtkBooleanMacro(SwapBytes, vtkTypeBool);
98
100
103 vtkSetMacro(HasScalar, vtkTypeBool);
104 vtkGetMacro(HasScalar, vtkTypeBool);
105 vtkBooleanMacro(HasScalar, vtkTypeBool);
107
109
118 vtkSetClampMacro(FileType, int, FILE_TYPE_IS_UNKNOWN, FILE_TYPE_IS_BINARY);
119 vtkGetMacro(FileType, int);
120 void SetFileTypeToUnknown() { this->SetFileType(FILE_TYPE_IS_UNKNOWN); }
121 void SetFileTypeToText() { this->SetFileType(FILE_TYPE_IS_TEXT); }
122 void SetFileTypeToBinary() { this->SetFileType(FILE_TYPE_IS_BINARY); }
124
126
131 vtkSetClampMacro(DataType, int, VTK_FLOAT, VTK_DOUBLE);
132 vtkGetMacro(DataType, int);
133 void SetDataTypeToFloat() { this->SetDataType(VTK_FLOAT); }
134 void SetDataTypeToDouble() { this->SetDataType(VTK_DOUBLE); }
136
137protected:
140
141 void OpenFile();
142
143 char* FileName;
144 istream* File;
145
148
150
163
165
172
184
188 void DoProgressUpdate(size_t& bytesRead, size_t& fileLength);
189
198 {
199 FILE_TYPE_IS_UNKNOWN = 0,
201 FILE_TYPE_IS_BINARY
202 };
203
213
217 size_t Alliquot;
221 size_t Count;
222
225
226private:
227 vtkParticleReader(const vtkParticleReader&) = delete;
228 void operator=(const vtkParticleReader&) = delete;
229};
230
231#endif
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Read ASCII or binary particle data and (optionally) one scalar value associated with each particle.
void SetDataByteOrder(int)
These methods should be used instead of the SwapBytes methods.
size_t Count
Count of the number of alliquots processed.
size_t Alliquot
Set an alliquot of bytes.
int ProduceOutputFromBinaryFileDouble(vtkInformationVector *outputVector)
This reader assumes that the file is binary and consists of floating point values by default.
int GetDataByteOrder()
These methods should be used instead of the SwapBytes methods.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
const char * GetDataByteOrderAsString()
These methods should be used instead of the SwapBytes methods.
vtkTypeBool GetSwapBytes()
Set/Get the byte swapping to explicitly swap the bytes of a file.
int ProduceOutputFromTextFileDouble(vtkInformationVector *outputVector)
The format that will be read if the file is a text file is: x, y, z, s (where s is some scalar value ...
void SetFileTypeToText()
Get/Set the file type.
vtkGetFilePathMacro(FileName)
Specify file name.
int FileType
Used to decide which reader should be used.
vtkSetFilePathMacro(FileName)
Specify file name.
int ProduceOutputFromTextFileFloat(vtkInformationVector *outputVector)
The format that will be read if the file is a text file is: x, y, z, s (where s is some scalar value ...
int DetermineFileType()
Determine the type of file based on an analysis of its contents.
FILE_TYPE
Enumerate the supported file types.
void SetDataByteOrderToLittleEndian()
These methods should be used instead of the SwapBytes methods.
void SetDataTypeToDouble()
Get/Set the data type.
void SetFileTypeToBinary()
Get/Set the file type.
void DoProgressUpdate(size_t &bytesRead, size_t &fileLength)
Update of the progress.
void SetDataTypeToFloat()
Get/Set the data type.
~vtkParticleReader() override
int DataType
Used to specify the data type.
int ProduceOutputFromBinaryFileFloat(vtkInformationVector *outputVector)
This reader assumes that the file is binary and consists of floating point values by default.
void SetFileTypeToUnknown()
Get/Set the file type.
void SetDataByteOrderToBigEndian()
These methods should be used instead of the SwapBytes methods.
static vtkParticleReader * New()
Superclass for algorithms that produce only polydata as output.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DOUBLE
Definition: vtkType.h:55
#define VTK_FLOAT
Definition: vtkType.h:54