MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / update

Method update

apps/point_cloud_editor/src/cloudTransformTool.cpp:67–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void
68CloudTransformTool::update (int x, int y, BitMask modifiers, BitMask buttons)
69{
70 if (!cloud_ptr_)
71 return;
72 if (!(buttons & LEFT))
73 return;
74
75 float transform[MATRIX_SIZE];
76
77 int dx = (x - x_);
78 int dy = (y - y_);
79 if (dx == 0 && dy == 0)
80 return;
81 trackball_.update(x, y);
82 if (modifiers & CTRL)
83 getTranslateMatrix(dx, dy, transform);
84 else if (modifiers & ALT)
85 getZTranslateMatrix(dy, transform);
86 else if (modifiers & SHFT)
87 getScaleMatrix(dy, transform);
88 else
89 trackball_.getRotationMatrix(transform);
90
91 cloud_ptr_ -> multMatrix(transform);
92
93 x_ = x;
94 y_ = y;
95}
96
97void
98CloudTransformTool::getTranslateMatrix (int dx, int dy, float* matrix)

Callers

nothing calls this directly

Calls 2

getRotationMatrixMethod · 0.80
multMatrixMethod · 0.80

Tested by

no test coverage detected