- class CityObject(dtcc.Object)[source]
Represents a generic object in a city.
Public members¶
- from_proto(pb: Object | bytes)[source]
Initialize CityObject from a protobuf representation.
- CityObject(id: str = <factory>, attributes: dict = <factory>, ...)
Initialize self. See help(type(self)) for accurate signature.
- __repr__()
Return repr(self).
- __eq__(other)
Return self==value.
- 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.
- 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.