Robot.h
Go to the documentation of this file.
1#pragma once
2
4
5#include "ElementOps.h"
6
7namespace armarx::viz
8{
9
10 class Robot : public ElementOps<Robot, data::ElementRobot>
11 {
12 public:
14
15 Robot&
16 file(std::string const& project, std::string const& filename)
17 {
18 data_->project = project;
19 data_->filename = filename;
20
21 return *this;
22 }
23
24 Robot&
25 file(const armarx::PackagePath& packagePath)
26 {
27 data_->project = packagePath.serialize().package;
28 data_->filename = packagePath.serialize().package + "/" + packagePath.serialize().path;
29
30 return *this;
31 }
32
33 Robot&
35 {
36 data_->drawStyle |= data::ModelDrawStyle::COLLISION;
37
38 return *this;
39 }
40
41 Robot&
43 {
44 data_->drawStyle &= ~data::ModelDrawStyle::COLLISION;
45
46 return *this;
47 }
48
49 Robot&
51 {
52 data_->drawStyle |= data::ModelDrawStyle::OVERRIDE_COLOR;
53
54 return color(c);
55 }
56
57 Robot&
59 {
60 data_->drawStyle &= ~data::ModelDrawStyle::OVERRIDE_COLOR;
61
62 return *this;
63 }
64
65 Robot&
66 joint(std::string const& name, float value)
67 {
68 data_->jointValues[name] = value;
69
70 return *this;
71 }
72
73 Robot&
74 joints(std::map<std::string, float> const& values)
75 {
76 data_->jointValues = values;
77
78 return *this;
79 }
80 };
81
82} // namespace armarx::viz
constexpr T c
data::PackagePath serialize() const
IceInternal::Handle< data::ElementRobot > data_
Definition ElementOps.h:315
ElementOps(std::string const &id)
Definition ElementOps.h:119
Robot & useFullModel()
Definition Robot.h:42
Robot & useOriginalColor()
Definition Robot.h:58
Robot & joints(std::map< std::string, float > const &values)
Definition Robot.h:74
Robot & useCollisionModel()
Definition Robot.h:34
Robot & file(const armarx::PackagePath &packagePath)
Definition Robot.h:25
Robot & joint(std::string const &name, float value)
Definition Robot.h:66
ElementOps(std::string const &id)
Definition ElementOps.h:119
Robot & file(std::string const &project, std::string const &filename)
Definition Robot.h:16
Robot & overrideColor(Color c)
Definition Robot.h:50
This file is part of ArmarX.