-
Sergi Hernandez authored
Completed the feature to copy the whole structure and update the references.
Sergi Hernandez authoredCompleted the feature to copy the whole structure and update the references.
opendrive_road.h 1.62 KiB
#ifndef _OPENDRIVE_ROAD_H
#define _OPENDRIVE_ROAD_H
#ifdef _HAVE_XSD
#include "../src/xml/OpenDRIVE_1.4H.hxx"
#endif
#include "opendrive_road_segment.h"
#include "opendrive_road_node.h"
class COpendriveRoadSegment;
class COpendriveRoadNode;
class COpendriveRoad
{
friend class COpendriveRoadSegment;
friend class COpendriveRoadNode;
private:
std::vector<COpendriveRoadSegment *> segments;
std::vector<COpendriveRoadNode *> nodes;
double resolution;
double scale_factor;
double min_road_length;
protected:
COpendriveRoadSegment &operator[](std::string &key);
void link_segments(OpenDRIVE &open_drive);
unsigned int add_node(COpendriveRoadNode *node);
bool node_exists_at(const TOpendriveWorldPoint &pose);
COpendriveRoadNode* get_node_at(const TOpendriveWorldPoint &pose) const;
public:
COpendriveRoad();
COpendriveRoad(const COpendriveRoad& object);
void load(const std::string &filename);
void set_resolution(double res);
void set_scale_factor(double scale);
void set_min_road_length(double length);
double get_resolution(void) const;
double get_scale_factor(void) const;
double get_min_road_length(void) const;
unsigned int get_num_segments(void) const;
const COpendriveRoadSegment& get_segment(unsigned int index) const;
unsigned int get_num_nodes(void) const;
const COpendriveRoadNode& get_node(unsigned int index) const;
const COpendriveRoadSegment& operator[](std::size_t index);
void operator=(const COpendriveRoad& object);
friend std::ostream& operator<<(std::ostream& out, COpendriveRoad &road);
~COpendriveRoad();
};
#endif