Loading [MathJax]/extensions/tex2jax.js
VTK  9.4.20250418
vtkBTSReader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) 2019-2023 Engys Ltd.
3// SPDX-License-Identifier: BSD-3-Clause
18#ifndef vtkBTSReader_h
19#define vtkBTSReader_h
20
21#include "vtkIOEngysModule.h" // For export macro
23#include "vtkSmartPointer.h" // For vtkSmartPointer
24
25VTK_ABI_NAMESPACE_BEGIN
26class vtkPolyData;
27class SolidNames;
29
30class VTKIOENGYS_EXPORT vtkBTSReader : public vtkPartitionedDataSetAlgorithm
31{
32public:
33 static vtkBTSReader* New();
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
38
44
46
51 virtual void SetStream(vtkResourceStream* stream);
54
56
60 const char* GetRegistrationName();
62
63protected:
65 ~vtkBTSReader() override;
66
68
69private:
71
74 bool Read(vtkPartitionedDataSet* output);
76
78
82 bool ReadHeader();
83 bool ReadSolidNames(int numberOfSolids, SolidNames& solidNames);
84 bool ReadSolid(vtkPolyData* polyData);
85 bool ReadPoints(vtkPolyData* polyData);
86 bool ReadFaces(vtkPolyData* polyData);
88
90
93 long Filesize();
95
97
100 void InitReadProgress(unsigned long fileSize);
101 void UpdateReadProgress(size_t bytes);
103
105
108 uint32_t ReadUint32Value();
109 bool ReadArray(void* ptr, size_t variableSize, size_t nVariables);
111
112 char* FileName = nullptr;
114
115 size_t ReadBytes = 0;
116 size_t FileSize = 1;
117 int PreviousPercentProgress = 0;
118 std::string RegistrationName;
119
120 vtkBTSReader(const vtkBTSReader&) = delete; // Not implemented.
121 void operator=(const vtkBTSReader&) = delete; // Not implemented.
122};
123
124VTK_ABI_NAMESPACE_END
125#endif
class to read bts files used by Engys software
vtkGetFilePathMacro(FileName)
Set/Get the filename (with path) for the bts file.
vtkSetFilePathMacro(FileName)
Set/Get the filename (with path) for the bts file.
~vtkBTSReader() override
virtual void SetStream(vtkResourceStream *stream)
Set/Get the stream from which to read the .bts file.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkBTSReader * New()
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Methods for subclasses to override to handle different pipeline requests.
const char * GetRegistrationName()
Get the registration name for display purposes, which is the file name without path or extension.
virtual vtkResourceStream * GetStream()
Set/Get the stream from which to read the .bts file.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce vtkPartitionedDataSetAlgorithm.
composite dataset to encapsulates a dataset consisting of partitions.
concrete dataset represents vertices, lines, polygons, and triangle strips
Abstract class used for custom streams.
Hold a reference to a vtkObjectBase instance.