VTK  9.7.1
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 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkPolyData;
27 class SolidNames;
28 class vtkResourceStream;
29 
30 class VTKIOENGYS_EXPORT vtkBTSReader : public vtkPartitionedDataSetAlgorithm
31 {
32 public:
33  static vtkBTSReader* New();
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
38 
41  vtkSetFilePathMacro(FileName);
42  vtkGetFilePathMacro(FileName);
44 
46 
51  virtual void SetStream(vtkResourceStream* stream);
52  virtual vtkResourceStream* GetStream();
54 
56 
60  const char* GetRegistrationName();
62 
63 protected:
64  vtkBTSReader();
65  ~vtkBTSReader() override;
66 
68 
69 private:
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 
124 VTK_ABI_NAMESPACE_END
125 #endif
composite dataset to encapsulates a dataset consisting of partitions.
Superclass for algorithms that produce vtkPartitionedDataSetAlgorithm.
Abstract class used for custom streams.
Store vtkAlgorithm input/output information.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for subclasses to override to handle different pipeline requests.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
class to read bts files used by Engys software
Definition: vtkBTSReader.h:30