47 std::vector<const IPhysicalObject *> objectsCopy;
51 for (
auto object : objectsCopy) {
52 const ShapeBase *shape =
object->getShape();
53 const Coord& position =
object->getPosition();
54 const Quaternion& orientation =
object->getOrientation();
55 const RotationMatrix rotation(orientation.toEulerAngles());
57 const Cuboid *cuboid =
dynamic_cast<const Cuboid *
>(shape);
59 std::vector<std::vector<Coord>> faces;
64 const Sphere *sphere =
dynamic_cast<const Sphere *
>(shape);
66 double radius = sphere->getRadius();
67 cOvalFigure *figure =
new cOvalFigure(
"sphere");
68 figure->setTooltip(
"This oval represents a physical object");
69 figure->setAssociatedObject(
const_cast<cObject *
>(check_and_cast<const cObject *>(
object)));
70 figure->setFilled(
true);
72 figure->setBounds(cFigure::Rectangle(center.x - radius, center.y - radius, radius * 2, radius * 2));
73 figure->setLineWidth(object->getLineWidth());
74 figure->setLineColor(object->getLineColor());
75 figure->setFillColor(object->getFillColor());
76 figure->setLineOpacity(object->getOpacity());
77 figure->setFillOpacity(object->getOpacity());
78 figure->setZoomLineWidth(
false);
79 std::string objectTags(
"physical_object ");
80 if (object->getTags())
81 objectTags +=
object->getTags();
82 figure->setTags((objectTags +
" " +
tags).c_str());
86 const Prism *prism =
dynamic_cast<const Prism *
>(shape);
88 std::vector<std::vector<Coord>> faces;
93 const Polyhedron *polyhedron =
dynamic_cast<const Polyhedron *
>(shape);
95 std::vector<std::vector<Coord>> faces;
100 const char *name = check_and_cast<const cObject *>(
object)->getName();
102 cLabelFigure *nameFigure =
new cLabelFigure(
"objectName");
104 nameFigure->setTags((std::string(
"physical_object object_name label ") +
tags).c_str());
105 nameFigure->setText(name);