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 © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
|
|
|
Contributor Milad milad.aghamohamadnia@concordia.ca
|
|
|
|
Contributor Guille guille.gutierrezmorote@concordia.ca
|
|
|
|
"""
|
|
|
|
|
|
|
|
from typing import List
|
|
|
|
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
|
|
|
|
def shape(self) -> List[List[float]]:
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get the list of positions
|
2021-08-17 12:52:48 -04:00
|
|
|
:return: [[x, y, (z)]]
|
|
|
|
"""
|
|
|
|
return self._shape
|
|
|
|
|
|
|
|
@shape.setter
|
|
|
|
def shape(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set the list of positions
|
2021-08-17 12:52:48 -04:00
|
|
|
:param value: [[x, y, (z)]]
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._shape = [[float(i) for i in value]]
|