- class Object(dtcc_model.model.Model)[source]
Base class for all object classes.
Object classes represent city objects such as buildings, roads, and trees. Each object has a unique identifier (.id) and a set of attributes (.attributes). Objects may also have children.
The geometry of an object may have different representations, e.g., in different levels of detail (LOD). The geometries of an Object are stored in a dictionary, where the keys identify the type of representation, e.g., “lod0”, “lod1”, etc.
Public members¶
- property num_children
Return number of child objects.
- property lod0
Return LOD0 geometry.
- property lod1
Return LOD0 geometry.
- property lod2
Return LOD0 geometry.
- property lod3
Return LOD0 geometry.
- property mesh
Return LOD0 geometry.
- property volume_mesh
Return LOD0 geometry.
- property point_cloud
Return POINT_CLOUD geometry.
- property raster
Return RASTER geometry.
- property bounds
Return BOUNDS geometry.
- add_children(children)[source]
Adds a list of children objects.
- add_geometry(geometry: Geometry, geometry_type: GeometryType | str)[source]
Add geometry to object.
- get_children(child_type)[source]
- set_child_attributues(child_type, attribute, values)[source]
-
get_child_attributes(child_type, attribute, default=
None
)[source]
- flatten_geometry(geom_type: GeometryType)[source]
Returns a single geometry of the specified type, merging all the geometries of the children.
-
calculate_bounds(lod=
None
)[source] Calculate the bounding box of the object.
- defined_geometries()[source]
Return a list of the types of geometries defined on this object.
- defined_attributes()[source]
Return a list of the attributes defined on this object.
- from_proto(pb: Object | bytes)[source]
Initialize Object from a protobuf representation.
- Object(id: str = <factory>, attributes: dict = <factory>, ...)
Initialize self. See help(type(self)) for accurate signature.
- __repr__()
Return repr(self).
- __eq__(other)
Return self==value.
- view()
View a generic object in 3D with a GLFW window.
- id : str
- attributes : dict
- children : dict
- geometry : dict
- to_json() str
Return a JSON representation of the object.
- copy(**kwargs)
Return a copy of the object.
-
classmethod add_methods(module, name=
None
) Adds methods from a module or function to the class.
-
classmethod print_methods(verbose=
False
) Print the methods that have been added to the class.