opendrive_road_node.h 2.18 KB
Newer Older
1
2
3
4
5
6
#ifndef _OPENDRIVE_ROAD_NODE_H
#define _OPENDRIVE_ROAD_NODE_H

#include <vector>
#include "opendrive_link.h"
#include "opendrive_lane.h"
7
#include "opendrive_road_segment.h"
8

9
class COpendriveLane;
10
class COpendriveRoadSegment;
11

12
13
class COpendriveRoadNode
{
14
15
  friend class COpendriveLane;
  friend class COpendriveRoadSegment;
16
  friend class COpendriveRoad;
17
18
19
20
21
  private:
    std::vector<COpendriveLink *> links;
    double resolution;
    double scale_factor;
    TOpendriveWorldPoint start_point;
22
23
    std::vector<COpendriveLane *> lanes;
    std::vector<COpendriveGeometry *> geometries;
24
25
    COpendriveRoadSegment *parent_segment;
    unsigned int index;
26
  protected:
27
28
    COpendriveRoadNode();
    COpendriveRoadNode(const COpendriveRoadNode &object);
29
    void load(const planView::geometry_type &geom_info,COpendriveLane *lane);
30
    void add_link(COpendriveRoadNode *node,opendrive_mark_t mark);
31
32
    void set_resolution(double res);
    void set_scale_factor(double scale);
33
34
    void set_index(unsigned int index);
    void set_parent_segment(COpendriveRoadSegment *segment);
35
    void add_lane(const planView::geometry_type &geom_info,COpendriveLane *lane);
36
37
38
    void update_references(std::map<COpendriveRoadNode *,COpendriveRoadNode *> refs);
    void update_references(std::map<COpendriveRoadSegment *,COpendriveRoadSegment *> refs);
    void update_references(std::map<COpendriveLane *,COpendriveLane *> refs);
39
  public:
40
41
    double get_resolution(void) const;
    double get_scale_factor(void) const;
42
43
    unsigned int get_index(void) const;
    const COpendriveRoadSegment& get_parent_segment(void) const;
44
45
46
    TOpendriveWorldPoint get_start_pose(void) const;
    unsigned int get_num_links(void) const;
    const COpendriveLink &get_link(unsigned int index) const;
47
48
49
50
    unsigned int get_num_lanes(void) const; 
    const COpendriveLane &get_lane(unsigned int index) const;
    unsigned int get_num_geometries(void) const;
    const COpendriveGeometry &get_geometry(unsigned int index) const;
51
    double get_closest_point(double x, double y,double heading,TOpendriveWorldPoint &closest_point,double angle_tol=0.1);
52
53
54
55
56
    friend std::ostream& operator<<(std::ostream& out, COpendriveRoadNode &node);
    ~COpendriveRoadNode();
};

#endif