API Documentation
Loading...
Searching...
No Matches
StreetInfo.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/Model.h>
3namespace NDEVR
4{
5 /**--------------------------------------------------------------------------------------------------
6 \brief A Model which contains information about the name of a street, road, highway, etc.
7 **/
8 class StreetName : public Model
9 {
10 public:
11 StreetName(const Model& model)
12 : Model(model)
13 {
14
15 if (!isOfType(TypeName()))
16 {
17 //setup model for first time
19 }
20 }
21 void set(const String& type)
22 {
24 }
29 static constexpr const char* ValidRegex() { return "*."; } // TODO
30 static constexpr const char* TypeName() { return "street_name"; }
31 };
32 /**--------------------------------------------------------------------------------------------------
33 \brief Used to describe the type of surface for a StreetInfo object.
34 **/
35 class SurfaceType : public Model
36 {
37 public:
38 SurfaceType(const Model& model)
39 : Model(model)
40 {
41
42 if (!isOfType(TypeName()))
43 {
44 //setup model for first time
46 }
47 }
48 void set(const String& type)
49 {
51 }
56 static constexpr const char* ValidRegex() { return "sad"; } // TODO
57 static constexpr const char* TypeName() { return "surface_type"; }
58 };
59 /**--------------------------------------------------------------------------------------------------
60 \brief Used to describe the condition of a surface for a StreetInfo object.
61 **/
62 class SurfaceCondition : public Model
63 {
64 public:
65 SurfaceCondition(const Model& model)
66 : Model(model)
67 {
68
69 if (!isOfType(TypeName()))
70 {
71 //setup model for first time
73 }
74 }
75 void set(const String& condition)
76 {
78 }
83 static constexpr const char* ValidRegex() { return "sad";/*TODO*/ }
84 static constexpr const char* TypeName() { return "surface_condition"; }
85
86 };
87 /**--------------------------------------------------------------------------------------------------
88 \brief Used to describe the speed limit of a road and used with StreetInfo object.
89 **/
90 class SpeedLimit : public Model
91 {
92 public:
93 SpeedLimit(const Model& model)
94 : Model(model)
95 {
96 if (!isOfType(TypeName()))
97 {
98 //setup model for first time
100 }
101 }
102 void set(const String& speed_limit)
103 {
105 }
110 static constexpr const char* TypeName() { return "speed_limit"; }
111 };
112 /**--------------------------------------------------------------------------------------------------
113 \brief Stores all information relating to a road or street.
114 **/
115 class StreetInfo : public Model
116 {
117 public:
118 StreetInfo(const Model& model)
119 : Model(model)
120 {
121 if (!isOfType(TypeName()))
122 {
123 //setup model for first time
126 }
127 }
129 {
130 return StreetName(getChild(0));
131 }
133 {
134 return SurfaceType(getChild(1));
135 }
141 {
142 return SpeedLimit(getChild(3));
143 }
144
145 static constexpr const char* TypeName() { return "street_info"; }
146 };
147}
t_type getProperty(DesignProperty property) const
Definition DesignObject.h:256
void setProperty(DesignProperty property, const t_type &value)
Definition DesignObject.h:177
@ e_uncompressed_data
Definition DesignObject.h:127
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
void createChildren(uint04 child_size)
Model getChild(uint04 child) const
void setModelProperty(ModelProperty property, const t_type &value)
Definition Model.h:141
bool isOfType(const String &type) const
@ e_type
Definition Model.h:104
Used to describe the speed limit of a road and used with StreetInfo object.
Definition StreetInfo.h:91
String get() const
Definition StreetInfo.h:106
void set(const String &speed_limit)
Definition StreetInfo.h:102
SpeedLimit(const Model &model)
Definition StreetInfo.h:93
static constexpr const char * TypeName()
Definition StreetInfo.h:110
Stores all information relating to a road or street.
Definition StreetInfo.h:116
StreetName streetName()
Definition StreetInfo.h:128
StreetInfo(const Model &model)
Definition StreetInfo.h:118
SpeedLimit speedLimit()
Definition StreetInfo.h:140
SurfaceType surfaceType()
Definition StreetInfo.h:132
SurfaceCondition surfaceCondition()
Definition StreetInfo.h:136
static constexpr const char * TypeName()
Definition StreetInfo.h:145
A Model which contains information about the name of a street, road, highway, etc.
Definition StreetInfo.h:9
void set(const String &type)
Definition StreetInfo.h:21
StreetName(const Model &model)
Definition StreetInfo.h:11
String get() const
Definition StreetInfo.h:25
static constexpr const char * ValidRegex()
Definition StreetInfo.h:29
static constexpr const char * TypeName()
Definition StreetInfo.h:30
The core String class for the NDEVR API.
Definition String.h:69
Used to describe the condition of a surface for a StreetInfo object.
Definition StreetInfo.h:63
void set(const String &condition)
Definition StreetInfo.h:75
SurfaceCondition(const Model &model)
Definition StreetInfo.h:65
String get() const
Definition StreetInfo.h:79
static constexpr const char * ValidRegex()
Definition StreetInfo.h:83
static constexpr const char * TypeName()
Definition StreetInfo.h:84
Used to describe the type of surface for a StreetInfo object.
Definition StreetInfo.h:36
void set(const String &type)
Definition StreetInfo.h:48
String get() const
Definition StreetInfo.h:52
SurfaceType(const Model &model)
Definition StreetInfo.h:38
static constexpr const char * ValidRegex()
Definition StreetInfo.h:56
static constexpr const char * TypeName()
Definition StreetInfo.h:57
Definition ACIColor.h:37