Lane Tree to follow a lane along its driving direction.
The lane tree starts at a given lane and follows the driving direction, branching whenever there is a lane split.
|
DW_API_PUBLIC dwStatus | dwMapsLaneTree_create (const dwMapsLane *lane, float32_t limit, dwMapsLaneTreeLimit limitType, bool doLaneChanges, bool forward, bool relativeToDrivingDirection, dwMapsLaneTreeHandle_t laneTree) |
| Create a lane tree starting at a given lane. More...
|
|
DW_API_PUBLIC dwStatus | dwMapsLaneTree_get (dwMapsLaneTreeNode **root, dwMapsLaneTreeNodeBuffer *laneTreeNodes, dwConstMapsLaneTreeHandle_t laneTree) |
| Get the created lane tree. More...
|
|
DW_API_PUBLIC dwStatus | dwMapsLaneTree_getLaneCount (uint32_t *laneCount, dwConstMapsLaneTreeHandle_t laneTree) |
| Get total number of lanes in the lane tree. More...
|
|
DW_API_PUBLIC dwStatus | dwMapsLaneTree_getLaneListToLeaf (dwMapsLaneBuffer *laneBuffer, uint32_t leafIndex, dwConstMapsLaneTreeHandle_t laneTree) |
| Get the list of lanes that connect the root lane to a leaf. More...
|
|
DW_API_PUBLIC dwStatus | dwMapsLaneTree_getLanes (dwMapsLaneBuffer *laneBuffer, dwConstMapsLaneTreeHandle_t laneTree) |
| Get all lanes in lane tree. More...
|
|
DW_API_PUBLIC dwStatus | dwMapsLaneTree_getLeafCount (uint32_t *leafCount, dwConstMapsLaneTreeHandle_t laneTree) |
| dwMapsLaneTree_getLeafCount More...
|
|
DW_API_PUBLIC dwStatus | dwMapsLaneTree_initialize (dwMapsLaneTreeHandle_t *laneTreeHandle, uint32_t maxLaneCount, dwConstMapHandle_t map) |
| Creates a lane tree object that allows to create a tree of connected lanes. More...
|
|
DW_API_PUBLIC dwStatus | dwMapsLaneTree_release (dwMapsLaneTreeHandle_t laneTreeHandle) |
| Release lane tree handle. More...
|
|
◆ dwMapsLaneTreeNode
struct dwMapsLaneTreeNode |
◆ dwMapsLaneTreeNodeBuffer
struct dwMapsLaneTreeNodeBuffer |
Data Fields |
dwMapsLaneTreeNode * |
buffer |
pointer to node buffer |
uint32_t |
maxSize |
maximum number of nodes that fit into the buffer |
uint32_t |
size |
current number of valid nodes in the buffer |
◆ dwConstMapsLaneTreeHandle_t
◆ dwMapsLaneTreeHandle_t
◆ dwMapsLaneTreeLimit
Enum to select the lane tree limit type.
The tree can be grown by distance or lane traversal time.
Enumerator |
---|
DW_MAPS_LANE_TREE_LIMIT_DISTANCE | |
DW_MAPS_LANE_TREE_LIMIT_TIME | |
Definition at line 2188 of file Maps.h.
◆ dwMapsLaneTree_create()
Create a lane tree starting at a given lane.
Follow connected lanes until the limit (distance or traversal time) is reached.
- Parameters
-
[in] | lane | Lane to start the lane tree. |
[in] | limit | Limit at which to stop following the lane. It only starts counting after the the input lane, to ensure that the lanes in the leaf nodes are at least the given limit (distance or time) away. |
[in] | limitType | Distance or lane traversal time. |
[in] | doLaneChanges | If true, also lanes that are reachable through a lane change are followed. |
[in] | forward | Whether to grow the lane tree forward or backward from given lane. |
[in] | relativeToDrivingDirection | Defines what the 'forward' parameter refers to. If true, it is relative to the driving direction of the lane. This only works if the lane has a unique driving direction. It fails if it is DW_MAPS_DIRECTION_NONE or DW_MAPS_DIRECTION_BOTH. If false, 'forward' refers to the geometry direction of the polylines and uses 'next' connections when 'forward' is true, 'previous' connections if it is false. |
[in] | laneTree | Lane tree object that runs the tree creation and stores the result. |
- Returns
- DW_SUCCESS Successfully created a lane tree at the given lane.
DW_BAD_CAST Could not successfully cast handle to lane tree object. DW_BUFFER_FULL Not enough space reserved in lane tree object. Increase maxLaneCount.
◆ dwMapsLaneTree_get()
Get the created lane tree.
This function returns the root of the created lane tree. The tree can be traversed by following the parent and children pointers.
- Parameters
-
[out] | root | Root node of the the tree. |
[in,out] | laneTreeNodes | Buffer to return all tree nodes. |
[in] | laneTree | Lane tree object containing the previosly created tree. |
- Returns
- DW_SUCCESS Successfully returned the lane tree nodes. DW_INVALID_ARGUMENT root or laneTreeNodes is nullptr. DW_BAD_CAST Could not successfully cast handle to lane tree object. DW_BUFFER_FULL Provided laneTreeNodes buffer not big enough.
◆ dwMapsLaneTree_getLaneCount()
Get total number of lanes in the lane tree.
- Parameters
-
[out] | laneCount | Lane count. |
[in] | laneTree | Lane tree object containing the previosly created tree. |
- Returns
- DW_SUCCESS Successfully returned number of lanes in tree. DW_INVALID_ARGUMENT root or laneCount is nullptr. DW_BAD_CAST Could not successfully cast handle to lane tree object.
◆ dwMapsLaneTree_getLaneListToLeaf()
Get the list of lanes that connect the root lane to a leaf.
This is a helper function to iterate all leaves and create a connected list of lanes for each leaf.
- Parameters
-
[in,out] | laneBuffer | Buffer to return the lane list. |
[in] | leafIndex | Index of the leaf to be reached by the lane list. |
[in] | laneTree | Lane tree object containing the previosly created tree. |
- Returns
- DW_SUCCESS Successfully returned list of lanes to a leaf. DW_INVALID_ARGUMENT root or laneBuffer is nullptr. DW_BAD_CAST Could not successfully cast handle to lane tree object. DW_BUFFER_FULL Provided laneBuffer not big enough.
◆ dwMapsLaneTree_getLanes()
Get all lanes in lane tree.
This function returns the set of lanes in the lane tree in undefined order.
- Parameters
-
[in,out] | laneBuffer | Buffer to return the set of lanes in the tree. |
[in] | laneTree | Lane tree object containing the previosly created tree. |
- Returns
- DW_SUCCESS Successfully returned list of lanes in tree. DW_INVALID_ARGUMENT laneBuffer is nullptr. DW_BAD_CAST Could not successfully cast handle to lane tree object. DW_BUFFER_FULL Provided laneBuffer not big enough.
◆ dwMapsLaneTree_getLeafCount()
dwMapsLaneTree_getLeafCount
- Parameters
-
[out] | leafCount | Number of leaf nodes in the lane tree. |
[in] | laneTree | Lane tree object containing the previosly created tree. |
- Returns
- DW_SUCCESS Successfully returned the number of leaf nodes. DW_INVALID_ARGUMENT leafCount is nullptr. DW_BAD_CAST Could not successfully cast handle to lane tree object.
◆ dwMapsLaneTree_initialize()
Creates a lane tree object that allows to create a tree of connected lanes.
- Parameters
-
[out] | laneTreeHandle | lane tree handle to be initialized |
[in] | maxLaneCount | allocate space for given maximum number of lanes. |
[in] | map | map |
- Returns
- DW_SUCCESS Map tracker handle is successfully initialized.
DW_INVALID_ARGUMENT laneTreeHandle is nullptr.
◆ dwMapsLaneTree_release()
Release lane tree handle.
- Parameters
-
[in,out] | laneTreeHandle | lane tree handle to be released |
- Returns
- DW_SUCCESS Successfully released lane tree object and handle.
DW_BAD_CAST Could not successfully cast handle to lane tree object.