hub/city_model_structure/transport/walkway_node.py

38 lines
986 B
Python
Raw Normal View History

2021-08-17 12:52:48 -04:00
"""
2021-08-17 13:30:51 -04:00
Walkway node module
2021-08-17 12:52:48 -04:00
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
2021-08-17 12:52:48 -04:00
Contributor Milad milad.aghamohamadnia@concordia.ca
Contributor Guille guille.gutierrezmorote@concordia.ca
"""
2021-09-14 13:46:48 -04:00
from typing import List, Union
2021-08-17 12:52:48 -04:00
from city_model_structure.transport.traffic_node import TrafficNode
class WalkwayNode(TrafficNode):
"""
2021-08-17 13:30:51 -04:00
WalkwayNode class
2021-08-17 12:52:48 -04:00
"""
def __init__(self, name, coordinates, edges=None, shape=None):
2021-08-17 13:30:51 -04:00
super().__init__(name, coordinates, edges=edges, node_type='WalkwayNode')
2021-08-17 12:52:48 -04:00
self._shape = shape
@property
2021-09-14 13:46:48 -04:00
def shape(self) -> Union[None, List[List[float]]]:
2021-08-17 12:52:48 -04:00
"""
Get the list of positions
2021-09-14 13:46:48 -04:00
:return: None or [[x, y, (z)]]
2021-08-17 12:52:48 -04:00
"""
return self._shape
@shape.setter
def shape(self, value):
"""
Set the list of positions
2021-08-17 12:52:48 -04:00
:param value: [[x, y, (z)]]
"""
2021-09-14 13:46:48 -04:00
if value is not None:
self._shape = [[float(i) for i in value]]