TAMSVIZ
Visualization and annotation tool for ROS
frame.h
1 // TAMSVIZ
2 // (c) 2020 Philipp Ruppel
3 
4 #pragma once
5 
6 #include "mesh.h"
7 
8 #include "../core/transformer.h"
9 
11  Eigen::Affine3d _frame_pose = Eigen::Affine3d::Identity();
12 
13 protected:
14  void renderSyncRecursiveImpl(const RenderSyncContext &context,
15  Display *display, Frame &frame,
16  const Pose &transform);
17 
18 public:
19  const Eigen::Affine3d &framePose() const { return _frame_pose; }
20 };
21 
22 std::vector<std::string> FrameDisplay_listFrames(const Property &);
23 
24 template <class Base>
25 class GenericFrameDisplay : public Base, public FrameDisplayMixin {
26 
27 public:
28  virtual void renderSyncRecursive(const RenderSyncContext &context) override {
29  FrameDisplayMixin::renderSyncRecursiveImpl(context, this, frame(),
30  transform());
31  }
32  PROPERTY(Frame, frame);
33  PROPERTY(Pose, transform);
34  Eigen::Affine3d globalPose() const {
35  return framePose() * transform().toIsometry3d();
36  }
37 };
38 
39 class FrameDisplayBase : public GenericFrameDisplay<MeshDisplayBase> {
40 protected:
41  FrameDisplayBase() {}
42 };
43 DECLARE_TYPE(FrameDisplayBase, MeshDisplayBase);
44 
45 struct DisplayGroup : public GenericFrameDisplay<DisplayGroupBase> {};
46 DECLARE_TYPE(DisplayGroup, DisplayGroupBase);
Definition: document.h:83