VTK  9.7.1
vtkCesium3DTilesReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
17 #ifndef vtkCesium3DTilesReader_h
18 #define vtkCesium3DTilesReader_h
19 
20 #include "vtkIOCesium3DTilesModule.h" // For export macro
22 #include "vtkSmartPointer.h" // For vtkSmartPointer
23 #include <vtk_nlohmannjson.h> // For nlohmann::json
24 #include VTK_NLOHMANN_JSON(json.hpp)
25 
26 VTK_ABI_NAMESPACE_BEGIN
28 class vtkTransform;
29 class vtkGLTFReader;
30 
58 class VTKIOCESIUM3DTILES_EXPORT vtkCesium3DTilesReader
60 {
61 public:
62  static vtkCesium3DTilesReader* New();
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
67 
70  vtkSetFilePathMacro(FileName);
71  vtkGetFilePathMacro(FileName);
73 
75 
81  vtkSetMacro(Level, int);
82  vtkGetMacro(Level, int);
84 
88  virtual int CanReadFile(VTK_FILEPATH const char* name);
89 
94  vtkSmartPointer<vtkGLTFReader> GetTileReader(size_t index);
95 
96 protected:
98  ~vtkCesium3DTilesReader() override;
99 
104  void ReadTiles(vtkPartitionedDataSetCollection* pd, size_t numberOfRanks, size_t rank);
108  std::pair<size_t, size_t> ToLocalIndex(size_t globalIndex);
109 
110  char* FileName = nullptr;
111 
114 
115 private:
117  void operator=(const vtkCesium3DTilesReader&) = delete;
118 
119  int Level;
120  class Tileset;
121  friend class Tileset;
126  std::vector<std::shared_ptr<Tileset>> Tilesets;
127  std::map<std::string, size_t> FileNameToTilesetIndex;
131  std::vector<vtkSmartPointer<vtkGLTFReader>> TileReaders;
132 };
133 
134 VTK_ABI_NAMESPACE_END
135 #endif
composite dataset to encapsulates a dataset consisting of partitions.
Read a GLTF file.
Definition: vtkGLTFReader.h:73
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for subclasses to override to handle different pipeline requests.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:50
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
Reads a Cesium 3D Tiles tileset.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for subclasses to override to handle different pipeline requests.
a simple class to control print indentation
Definition: vtkIndent.h:28
Superclass for algorithms that produce vtkPartitionedDataSetCollectionAlgorithm.
#define VTK_FILEPATH
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
Composite dataset that groups datasets as a collection.