25 #include <openbeam/types.h>
27 #if OPENBEAM_HAS_CAIRO
28 #include <cairomm/context.h>
29 #include <cairomm/surface.h>
30 #include <cairommconfig.h>
39 template <
class CAIROCR>
40 void drawLocalScaledSegments(
41 CAIROCR& cr,
const TRotationTrans3D& node_pose,
const double scale,
42 const std::vector<TPoint3D>& seq_points_local)
44 const Matrix33& node_rot = node_pose.r.getRot();
47 const size_t nPts = seq_points_local.size();
48 std::vector<TPoint3D> seq_points_global;
49 if (node_pose.r.isIdentity())
51 seq_points_global = seq_points_local;
52 for (
size_t k = 0; k < nPts; k++)
55 seq_points_global[k] += node_pose.t;
57 seq_points_global[k] =
58 node_pose.t + scale * seq_points_global[k];
62 seq_points_global.resize(nPts);
63 for (
size_t k = 0; k < nPts; k++)
66 for (
int l = 0; l < 3; l++)
67 seq_points_global[k][l] =
69 scale * (node_rot.coeff(l, 0) * seq_points_local[k].x +
70 node_rot.coeff(l, 1) * seq_points_local[k].y +
71 node_rot.coeff(l, 2) * seq_points_local[k].z);
76 for (
size_t k = 0; k < nPts; k++)
78 const double xx = seq_points_global[k].x;
79 const double yy = seq_points_global[k].y;
90 void computeOrientationFromTwoPoints(
91 const TPoint3D& t1,
const TPoint3D& t2,
const num_t rotation_around_x,