VTK  9.5.20250615
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
26VTK_ABI_NAMESPACE_BEGIN
28class vtkTransform;
29class vtkGLTFReader;
30
58class VTKIOCESIUM3DTILES_EXPORT vtkCesium3DTilesReader
60{
61public:
64 void PrintSelf(ostream& os, vtkIndent indent) override;
65
67
73
75
81 vtkSetMacro(Level, int);
82 vtkGetMacro(Level, int);
84
88 virtual int CanReadFile(VTK_FILEPATH const char* name);
89
95
96protected:
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
115private:
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
134VTK_ABI_NAMESPACE_END
135#endif
Reads a Cesium 3D Tiles tileset.
virtual int CanReadFile(const char *name)
Returns true if it can read the json file (it is a 3D Tiles tileset), false otherwise.
~vtkCesium3DTilesReader() override
vtkSetFilePathMacro(FileName)
Set/Get the name of the file from which to read points.
static vtkCesium3DTilesReader * New()
void ReadTiles(vtkPartitionedDataSetCollection *pd, size_t numberOfRanks, size_t rank)
Read tiles and add them to 'pd' for given this->Level and numberOfRanks/rank combination.
std::pair< size_t, size_t > ToLocalIndex(size_t globalIndex)
Converts globalIndex to (tilesetIndex, tileIndex) pair.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGetFilePathMacro(FileName)
Set/Get the name of the file from which to read points.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Methods for subclasses to override to handle different pipeline requests.
vtkSmartPointer< vtkGLTFReader > GetTileReader(size_t index)
Return the vtkGLTFReader used to read the tile.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Methods for subclasses to override to handle different pipeline requests.
Read a GLTF 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 vtkPartitionedDataSetCollectionAlgorithm.
Composite dataset that groups datasets as a collection.
composite dataset to encapsulates a dataset consisting of partitions.
Hold a reference to a vtkObjectBase instance.
describes linear transformations via a 4x4 matrix
#define VTK_FILEPATH