2021-06-03 11:23:09 -04:00
|
|
|
"""
|
|
|
|
BuildingsCluster module
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2022-04-08 09:35:33 -04:00
|
|
|
Copyright © 2022 Concordia CERC group
|
|
|
|
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
2021-06-03 11:23:09 -04:00
|
|
|
"""
|
|
|
|
|
2021-06-09 14:23:45 -04:00
|
|
|
from typing import List, TypeVar
|
|
|
|
|
2023-01-24 10:51:50 -05:00
|
|
|
from hub.city_model_structure.city_objects_cluster import CityObjectsCluster
|
2021-08-26 09:19:38 -04:00
|
|
|
|
2021-06-09 14:23:45 -04:00
|
|
|
CityObject = TypeVar('CityObject')
|
2021-06-03 11:23:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
class BuildingsCluster(CityObjectsCluster):
|
|
|
|
"""
|
|
|
|
BuildingsCluster(CityObjectsCluster) class
|
|
|
|
"""
|
|
|
|
def __init__(self, name, city_objects):
|
|
|
|
self._cluster_type = 'buildings'
|
|
|
|
super().__init__(name, self._cluster_type, city_objects)
|
|
|
|
self._name = name
|
|
|
|
self._city_objects = city_objects
|
|
|
|
|
|
|
|
@property
|
|
|
|
def type(self):
|
2021-06-09 14:23:45 -04:00
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get cluster type
|
2021-06-09 14:23:45 -04:00
|
|
|
:return: str
|
|
|
|
"""
|
2021-06-03 11:23:09 -04:00
|
|
|
return self._cluster_type
|
|
|
|
|
|
|
|
@property
|
2021-06-09 14:23:45 -04:00
|
|
|
def city_objects(self) -> List[CityObject]:
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get the list of city objects conforming the cluster
|
2021-06-09 14:23:45 -04:00
|
|
|
:return: [CityObject]
|
|
|
|
"""
|
2021-06-03 11:23:09 -04:00
|
|
|
return self._city_objects
|