opendrive_geometry.h 1.64 KB
Newer Older
1
2
3
4
5
#ifndef _OPENDRIVE_GEOMETRY_H
#define _OPENDRIVE_GEOMETRY_H

#include "opendrive_common.h"
#ifdef _HAVE_XSD
6
#include "xml/OpenDRIVE_1.4H.hxx"
7
8
9
10
11
12
#endif

#include <iostream>

class COpendriveGeometry
{
13
  friend class COpendriveRoadNode;
14
15
  private:
  protected:
16
17
    COpendriveGeometry();
    COpendriveGeometry(const COpendriveGeometry &object);
18
    void load(const planView::geometry_type &geometry_info);
19
    double scale_factor;
20
21
    double min_s; ///< Starting track coordenate "s" for the geometry.
    double max_s; ///< Ending track coordenate "s" for the geometry.
22
23
    TOpendriveWorldPose pose;
    virtual bool transform_local_pose(TOpendriveTrackPose &track,TOpendriveLocalPose &local) const = 0;
24
25
    virtual void print(std::ostream &out);
    virtual void load_params(const planView::geometry_type &geometry_info) = 0;
26
27
    virtual std::string get_name(void)=0;
    void set_scale_factor(double scale);
28
    void set_start_pose(TOpendriveWorldPose &pose);
Sergi Hernandez's avatar
Sergi Hernandez committed
29
30
    void set_max_s(double s);
    void set_min_s(double s);
31
32
  public:
    virtual COpendriveGeometry *clone(void) = 0;
33
34
    bool get_local_pose(TOpendriveTrackPose &track,TOpendriveLocalPose &local) const;
    bool get_world_pose(TOpendriveTrackPose &track,TOpendriveWorldPose &world) const;
35
36
    bool in_range(double s) const;
    double get_length(void) const;
37
    virtual void get_curvature(double &start,double &end)=0;
Sergi Hernandez's avatar
Sergi Hernandez committed
38
39
    double get_max_s(void) const;
    double get_min_s(void) const;
40
    TOpendriveWorldPose get_start_pose(void) const;
41
42
43
44
45
46
    void operator=(const COpendriveGeometry &object);
    friend std::ostream& operator<<(std::ostream& out, COpendriveGeometry &geom);
    virtual ~COpendriveGeometry();
};

#endif