py3dtiles.tileset.extension package

class py3dtiles.tileset.extension.BaseExtension(name: str)[source]

Bases: object

A base class to manage 3dtiles extension.

If an extension is added somewhere in a tileset, the user must add the name of the extension in the attribute extensions_used of the class TileSet. Also, if the support of an extension is necessary to display the tileset, the name must be added in the attribute extensions_required of the class TileSet.

classmethod from_dict(extension_dict: dict[str, Any]) BaseExtension[source]

Creates an instance of the default extension class BaseExtension. This instance will store all attributes in a single field.

Parameters:

extension_dict – a dict containing all attributes of the extension (keys and values).

Returns:

a BaseExtension instance.

to_dict() dict[str, Any][source]
Returns:

a dict containing all attributes of the extension (keys and values).

class py3dtiles.tileset.extension.BatchTableHierarchy[source]

Bases: BaseExtension

Batch Table Hierarchy (BTH) is a BaseExtension of a Batch Table.

add_class(class_name: str, property_names: list[str]) HierarchyClass[source]
classmethod from_dict(extension_dict: dict[str, Any]) BatchTableHierarchy[source]

Creates an instance of the default extension class BaseExtension. This instance will store all attributes in a single field.

Parameters:

extension_dict – a dict containing all attributes of the extension (keys and values).

Returns:

a BaseExtension instance.

get_instance_parent_indexes(instance: HierarchyInstance) list[int][source]
to_dict() dict[str, Any][source]
Returns:

a dict containing all attributes of the extension (keys and values).

py3dtiles.tileset.extension.create_extension(extension_key: str, extension_dict: dict[str, Any]) BaseExtension[source]

Creates an instance of the extension if it is registered. Else, creates an instance of BaseExtension storing all attributes in a single field.

Parameters:
  • extension_key – the name of the extension to create

  • extension_dict – a dict containing all attributes of the extension (keys and values).

Returns:

an extension.

py3dtiles.tileset.extension.is_extension_registered(extension_key: str) bool[source]

Checks if the extension is registered.

Parameters:

extension_key – the name of the extension as a string.

Returns:

a boolean.

py3dtiles.tileset.extension.register_extension(extension_key: str, extension_class: type[BaseExtension]) None[source]

Registers an extension by mapping the name of the extension with the corresponding class.

Parameters:
  • extension_key – the name of the extension as a string.

  • extension_class – the class of the extension.

Submodules