35 class VSGXCHANGE_DECLSPEC Tiles3D :
public vsg::Inherit<vsg::ReaderWriter, Tiles3D>
40 vsg::ref_ptr<vsg::Object> read(
const vsg::Path&, vsg::ref_ptr<const vsg::Options>)
const override;
41 vsg::ref_ptr<vsg::Object> read(std::istream&, vsg::ref_ptr<const vsg::Options>)
const override;
42 vsg::ref_ptr<vsg::Object> read(
const uint8_t* ptr,
size_t size, vsg::ref_ptr<const vsg::Options> options = {})
const override;
44 vsg::ref_ptr<vsg::Object> read_json(std::istream&, vsg::ref_ptr<const vsg::Options>,
const vsg::Path& filename = {})
const;
45 vsg::ref_ptr<vsg::Object> read_b3dm(std::istream&, vsg::ref_ptr<const vsg::Options>,
const vsg::Path& filename = {})
const;
46 vsg::ref_ptr<vsg::Object> read_cmpt(std::istream&, vsg::ref_ptr<const vsg::Options>,
const vsg::Path& filename = {})
const;
47 vsg::ref_ptr<vsg::Object> read_i3dm(std::istream&, vsg::ref_ptr<const vsg::Options>,
const vsg::Path& filename = {})
const;
48 vsg::ref_ptr<vsg::Object> read_pnts(std::istream&, vsg::ref_ptr<const vsg::Options>,
const vsg::Path& filename = {})
const;
49 vsg::ref_ptr<vsg::Object> read_tiles(
const vsg::Path& filename, vsg::ref_ptr<const vsg::Options> options)
const;
51 vsg::Logger::Level level = vsg::Logger::LOGGER_WARN;
53 bool supportedExtension(
const vsg::Path& ext)
const;
55 bool getFeatures(Features& features)
const override;
57 static constexpr const char* report =
"report";
62 bool readOptions(vsg::Options& options, vsg::CommandLine& arguments)
const override;
66 struct VSGXCHANGE_DECLSPEC
BoundingVolume :
public vsg::Inherit<gltf::ExtensionsExtras, BoundingVolume>
68 vsg::ValuesSchema<double> box;
69 vsg::ValuesSchema<double> region;
70 vsg::ValuesSchema<double> sphere;
72 void read_array(vsg::JSONParser& parser,
const std::string_view& property)
override;
74 void report(vsg::LogOutput& output);
78 struct VSGXCHANGE_DECLSPEC
Content :
public vsg::Inherit<gltf::ExtensionsExtras, Content>
80 vsg::ref_ptr<BoundingVolume> boundingVolume;
84 vsg::ref_ptr<vsg::Object> object;
86 void read_object(vsg::JSONParser& parser,
const std::string_view& property)
override;
87 void read_string(vsg::JSONParser& parser,
const std::string_view& property)
override;
89 void report(vsg::LogOutput& output);
93 struct VSGXCHANGE_DECLSPEC
Tile :
public vsg::Inherit<gltf::ExtensionsExtras, Tile>
95 vsg::ref_ptr<BoundingVolume> boundingVolume;
96 vsg::ref_ptr<BoundingVolume> viewerRequestVolume;
97 double geometricError = 0.0;
99 vsg::ValuesSchema<double> transform;
100 vsg::ObjectsSchema<Tile> children;
101 vsg::ref_ptr<Content> content;
103 void read_array(vsg::JSONParser& parser,
const std::string_view& property)
override;
104 void read_object(vsg::JSONParser& parser,
const std::string_view& property)
override;
105 void read_number(vsg::JSONParser& parser,
const std::string_view& property, std::istream& input)
override;
106 void read_string(vsg::JSONParser& parser,
const std::string_view& property)
override;
108 void report(vsg::LogOutput& output);
112 struct VSGXCHANGE_DECLSPEC
PropertyRange :
public vsg::Inherit<gltf::ExtensionsExtras, PropertyRange>
114 double minimum = 0.0;
115 double maximum = 0.0;
117 void read_number(vsg::JSONParser& parser,
const std::string_view& property, std::istream& input)
override;
120 struct VSGXCHANGE_DECLSPEC
Properties :
public vsg::Inherit<gltf::ExtensionsExtras, Properties>
122 std::map<std::string, PropertyRange> properties;
124 void read_object(vsg::JSONParser& parser,
const std::string_view& property_name)
override;
126 void report(vsg::LogOutput& output);
130 struct VSGXCHANGE_DECLSPEC
Asset :
public vsg::Inherit<gltf::ExtensionsExtras, Asset>
133 std::string tilesetVersion;
135 std::map<std::string, std::string> strings;
136 std::map<std::string, double> numbers;
138 void read_string(vsg::JSONParser& parser,
const std::string_view& property)
override;
139 void read_number(vsg::JSONParser& parser,
const std::string_view& property, std::istream& input)
override;
140 void report(vsg::LogOutput& output);
144 struct VSGXCHANGE_DECLSPEC
Tileset :
public vsg::Inherit<gltf::ExtensionsExtras, Tileset>
146 vsg::ref_ptr<Asset> asset;
147 vsg::ref_ptr<Properties> properties;
148 vsg::ref_ptr<Tile> root;
149 double geometricError = 0.0;
150 vsg::StringsSchema extensionsUsed;
151 vsg::StringsSchema extensionsRequired;
153 void read_array(vsg::JSONParser& parser,
const std::string_view& property)
override;
154 void read_object(vsg::JSONParser& parser,
const std::string_view& property)
override;
155 void read_number(vsg::JSONParser& parser,
const std::string_view& property, std::istream& input)
override;
157 void report(vsg::LogOutput& output);
159 virtual void resolveURIs(vsg::ref_ptr<const vsg::Options> options);
164 struct ArraySchema :
public Inherit<vsg::JSONParser::Schema, ArraySchema<T>>
166 const uint32_t invalidOffset = std::numeric_limits<uint32_t>::max();
167 uint32_t byteOffset = invalidOffset;
168 std::vector<T> values;
170 void read_number(vsg::JSONParser&, std::istream& input)
override
174 values.push_back(value);
177 void read_number(vsg::JSONParser& parser,
const std::string_view& property, std::istream& input)
override
179 if (property ==
"byteOffset")
185 void assign(vsg::ubyteArray& binary, uint32_t count)
187 if (!values.empty() || byteOffset == invalidOffset)
return;
189 T* ptr =
reinterpret_cast<T*
>(binary.data() + byteOffset);
190 for (uint32_t i = 0; i < count; ++i)
192 values.push_back(*(ptr++));
196 explicit operator bool()
const noexcept {
return !values.empty(); }
199 struct VSGXCHANGE_DECLSPEC
b3dm_FeatureTable :
public vsg::Inherit<gltf::ExtensionsExtras, b3dm_FeatureTable>
202 vsg::ref_ptr<vsg::ubyteArray> binary;
204 uint32_t BATCH_LENGTH = 0;
206 void read_array(vsg::JSONParser& parser,
const std::string_view& property)
override;
207 void read_object(vsg::JSONParser& parser,
const std::string_view& property)
override;
208 void read_number(vsg::JSONParser& parser,
const std::string_view& property, std::istream& input)
override;
212 void report(vsg::LogOutput& output);
217 struct VSGXCHANGE_DECLSPEC
Batch :
public vsg::Inherit<vsg::JSONtoMetaDataSchema, Batch>
219 uint32_t byteOffset = 0;
220 std::string componentType;
226 void read_number(vsg::JSONParser& parser, std::istream& input)
override;
229 void read_string(vsg::JSONParser& parser,
const std::string_view& property)
override;
230 void read_number(vsg::JSONParser& parser,
const std::string_view& property, std::istream& input)
override;
233 struct VSGXCHANGE_DECLSPEC
BatchTable :
public vsg::Inherit<gltf::ExtensionsExtras, BatchTable>
235 std::map<std::string, vsg::ref_ptr<Batch>> batches;
238 vsg::ref_ptr<vsg::ubyteArray> binary;
240 void read_array(vsg::JSONParser& parser,
const std::string_view& property)
override;
241 void read_object(vsg::JSONParser& parser,
const std::string_view& property)
override;
245 void report(vsg::LogOutput& output);
249 struct VSGXCHANGE_DECLSPEC
i3dm_FeatureTable :
public vsg::Inherit<gltf::ExtensionsExtras, i3dm_FeatureTable>
252 vsg::ref_ptr<vsg::ubyteArray> binary;
266 uint32_t INSTANCES_LENGTH = 0;
270 bool EAST_NORTH_UP =
false;
272 void read_array(vsg::JSONParser& parser,
const std::string_view& property)
override;
273 void read_object(vsg::JSONParser& parser,
const std::string_view& property)
override;
274 void read_number(vsg::JSONParser& parser,
const std::string_view& property, std::istream& input)
override;
275 void read_bool(vsg::JSONParser& parser,
const std::string_view& property,
bool value)
override;
279 void report(vsg::LogOutput& output);
283 class VSGXCHANGE_DECLSPEC SceneGraphBuilder :
public vsg::Inherit<vsg::Object, SceneGraphBuilder>
288 vsg::ref_ptr<vsg::Options> options;
289 vsg::ref_ptr<vsg::ShaderSet> shaderSet;
290 vsg::ref_ptr<vsg::SharedObjects> sharedObjects;
291 vsg::ref_ptr<vsg::OperationThreads> operationThreads;
293 vsg::ref_ptr<vsg::EllipsoidModel> ellipsoidModel = vsg::EllipsoidModel::create();
294 vsg::CoordinateConvention source_coordinateConvention = vsg::CoordinateConvention::Y_UP;
295 double pixelErrorToScreenHeightRatio = 0.016;
296 uint32_t preLoadLevel = 1;
298 virtual void assignResourceHints(vsg::ref_ptr<vsg::Node> node);
300 virtual vsg::dmat4 createMatrix(
const std::vector<double>& values);
301 virtual vsg::dsphere createBound(vsg::ref_ptr<BoundingVolume> boundingVolume);
302 virtual vsg::ref_ptr<vsg::Node> readTileChildren(vsg::ref_ptr<Tiles3D::Tile> tile, uint32_t level,
const std::string& inherited_refine);
303 virtual vsg::ref_ptr<vsg::Node> createTile(vsg::ref_ptr<Tiles3D::Tile> tile, uint32_t level,
const std::string& inherited_refine);
304 virtual vsg::ref_ptr<vsg::Object> createSceneGraph(vsg::ref_ptr<Tiles3D::Tileset> tileset, vsg::ref_ptr<const vsg::Options> in_options);
bool readOptions(vsg::Options &options, vsg::CommandLine &arguments) const override
uint, sets the SceneGraphBuilder::preLoadLevel values to control what LOD level are pre loaded when r...
https://github.com/CesiumGS/3d-tiles/blob/1.0/specification/schema/tile.content.schema....
Definition 3DTiles.h:79