Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
opSimulation
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reinhard Biegel
opSimulation
Commits
4e86a8b9
Commit
4e86a8b9
authored
3 years ago
by
Uwe Woessner
Browse files
Options
Downloads
Patches
Plain Diff
all of this has already been defined in globalDefinitions.h
parent
2427eb3e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gui/common/pcm/PCM_Data/pcm_definitions.h
+3
-114
3 additions, 114 deletions
gui/common/pcm/PCM_Data/pcm_definitions.h
with
3 additions
and
114 deletions
gui/common/pcm/PCM_Data/pcm_definitions.h
+
3
−
114
View file @
4e86a8b9
...
...
@@ -20,122 +20,11 @@
#include
<string>
#include
<tuple>
#include
<vector>
#include
<array>
#include
"common/globalDefinitions.h"
//-----------------------------------------------------------------------------
//! Agent type classification
//-----------------------------------------------------------------------------
enum
class
AgentVehicleType
{
NONE
=
-
2
,
Undefined
=
-
1
,
Car
=
0
,
Pedestrian
,
Motorbike
,
Bicycle
,
Truck
};
static
constexpr
std
::
array
<
const
char
*
,
5
>
AgentVehicleTypeMapping
{
"car"
,
"pedestrian"
,
"motorbike"
,
"bicycle"
,
"truck"
};
//// convert a vehicle type name to VehicleType enum
inline
AgentVehicleType
GetAgentVehicleType
(
const
std
::
string
&
strVehicleType
)
{
if
(
0
==
strVehicleType
.
compare
(
"car"
))
{
return
AgentVehicleType
::
Car
;
}
else
if
(
0
==
strVehicleType
.
compare
(
"pedestrian"
))
{
return
AgentVehicleType
::
Pedestrian
;
}
else
if
(
0
==
strVehicleType
.
compare
(
"motorbike"
))
{
return
AgentVehicleType
::
Motorbike
;
}
else
if
(
0
==
strVehicleType
.
compare
(
"bicycle"
))
{
return
AgentVehicleType
::
Bicycle
;
}
else
if
(
0
==
strVehicleType
.
compare
(
"truck"
))
{
return
AgentVehicleType
::
Truck
;
}
return
AgentVehicleType
::
Undefined
;
}
//// convert a AgentVehicleType to VehicleType string
inline
std
::
string
GetAgentVehicleTypeStr
(
const
AgentVehicleType
&
vehicleType
)
{
int
vehicleTypeCode
=
static_cast
<
int
>
(
vehicleType
);
std
::
string
resultString
;
if
(
vehicleTypeCode
<
0
)
{
resultString
=
"unknown type"
;
}
else
{
resultString
=
AgentVehicleTypeMapping
[
static_cast
<
size_t
>
(
vehicleType
)];
}
return
resultString
;
}
//// convert a string of type code to VehicleType string
inline
std
::
string
GetAgentVehicleTypeStr
(
const
int
vehicleTypeCode
)
{
std
::
string
resultString
;
switch
(
vehicleTypeCode
)
{
case
-
2
:
resultString
=
GetAgentVehicleTypeStr
(
AgentVehicleType
::
NONE
);
break
;
case
-
1
:
resultString
=
GetAgentVehicleTypeStr
(
AgentVehicleType
::
Undefined
);
break
;
case
0
:
resultString
=
GetAgentVehicleTypeStr
(
AgentVehicleType
::
Car
);
break
;
case
1
:
resultString
=
GetAgentVehicleTypeStr
(
AgentVehicleType
::
Pedestrian
);
break
;
case
2
:
resultString
=
GetAgentVehicleTypeStr
(
AgentVehicleType
::
Motorbike
);
break
;
case
3
:
resultString
=
GetAgentVehicleTypeStr
(
AgentVehicleType
::
Bicycle
);
break
;
case
4
:
resultString
=
GetAgentVehicleTypeStr
(
AgentVehicleType
::
Truck
);
break
;
default:
resultString
=
"unknown type"
;
}
return
resultString
;
}
//! Enum of potential types of marks.
enum
class
MarkType
{
NONE
,
CONTINUOUS
,
INTERRUPTED_LONG
,
INTERRUPTED_SHORT
,
ROADSIDE
,
NumberOfMarkTypes
};
//! Enum of potential types of objects.
enum
class
ObjectType
{
NONE
,
OBJECT
,
VIEWOBJECT
,
NumberOfObjectTypes
};
// already defined in globalDefinitions.h
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment