-
Notifications
You must be signed in to change notification settings - Fork 11
Description
dhart/src/Python/dhart/spatialstructures/graph.py
Lines 160 to 166 in 7587a53
def AddEdgeToGraph( | |
self, | |
parent: Union[Tuple[float, float, float], NodeStruct, int], | |
child: Union[Tuple[float, float, float], NodeStruct, int], | |
cost: float, | |
cost_type: str = "" | |
) -> None: |
It's possible to pass in NodeStruct data structures as parent and child, yet there is no support for this in the native functions. The pipeline goes from the else statement in
dhart/src/Python/dhart/spatialstructures/graph.py
Lines 212 to 219 in 7587a53
if isinstance(parent, int) and isinstance(child, int): | |
spatial_structures_native_functions.C_AddEdgeFromNodeIDs( | |
self.graph_ptr, parent, child, cost, cost_type | |
) | |
else: | |
spatial_structures_native_functions.C_AddEdgeFromNodes( | |
self.graph_ptr, parent, child, cost, cost_type | |
) |
to
dhart/src/Python/dhart/spatialstructures/spatial_structures_native_functions.py
Lines 117 to 123 in 7587a53
def C_AddEdgeFromNodes( | |
graph_ptr: c_void_p, | |
parent: Tuple[float, float, float], | |
child: Tuple[float, float, float], | |
score: float, | |
cost_type: str, | |
) -> None: |
where the only allowed data type for the parent and child is Tuple[float,float,float]. This results in an error when calling
dhart/src/Python/dhart/spatialstructures/spatial_structures_native_functions.py
Lines 127 to 128 in 7587a53
parent_ptr = ConvertPointsToArray(parent) | |
child_ptr = ConvertPointsToArray(child) |
which relies on the parent and child being passed in by their xyz coordinates.