forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeometry_roles.cc
50 lines (38 loc) · 1.25 KB
/
geometry_roles.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "drake/geometry/geometry_roles.h"
#include <string>
namespace drake {
namespace geometry {
ProximityProperties::ProximityProperties(const GeometryProperties& other)
: GeometryProperties(other) {}
ProximityProperties::~ProximityProperties() = default;
PerceptionProperties::PerceptionProperties(const GeometryProperties& other)
: GeometryProperties(other) {}
PerceptionProperties::~PerceptionProperties() = default;
IllustrationProperties::IllustrationProperties(const GeometryProperties& other)
: GeometryProperties(other) {}
IllustrationProperties::~IllustrationProperties() = default;
std::string to_string(const Role& role) {
switch (role) {
case Role::kProximity:
return "proximity";
case Role::kPerception:
return "perception";
case Role::kIllustration:
return "illustration";
case Role::kUnassigned:
return "unassigned";
}
return "unknown";
}
std::ostream& operator<<(std::ostream& out, const Role& role) {
out << to_string(role);
return out;
}
IllustrationProperties MakePhongIllustrationProperties(
const Vector4<double>& diffuse) {
IllustrationProperties props;
props.AddProperty("phong", "diffuse", diffuse);
return props;
}
} // namespace geometry
} // namespace drake