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

Method end

apps/point_cloud_editor/src/selectionTransformTool.cpp:124–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void
125SelectionTransformTool::end (int x, int y, BitMask modifiers, BitMask buttons)
126{
127 if (!(buttons & LEFT))
128 return;
129
130 float scale = 1.0f / cloud_ptr_->getScalingFactor();
131 int dx = (x - x_);
132 int dy = (y - y_);
133 update(x, y, modifiers, buttons);
134 if (modifiers_ & CTRL)
135 {
136 std::shared_ptr<TransformCommand> c(new TransformCommand(selection_ptr_,
137 cloud_ptr_, transform_matrix_, (float) dx * translate_factor_ * scale,
138 (float) -dy * translate_factor_ * scale, 0.0f));
139 command_queue_ptr_->execute(c);
140 }
141 else if (modifiers_ & ALT)
142 {
143 std::shared_ptr<TransformCommand> c(new TransformCommand(selection_ptr_,
144 cloud_ptr_, transform_matrix_, 0.0f, 0.0f,
145 (float) dy * translate_factor_ * scale));
146 command_queue_ptr_->execute(c);
147 }
148 else
149 {
150 std::shared_ptr<TransformCommand> c(new TransformCommand(selection_ptr_,
151 cloud_ptr_, transform_matrix_, 0.0f, 0.0f, 0.0f));
152 command_queue_ptr_->execute(c);
153 }
154 setIdentity(transform_matrix_);
155 cloud_ptr_->setSelectionRotation(transform_matrix_);
156 cloud_ptr_->setSelectionTranslation(0.0f, 0.0f, 0.0f);
157}
158
159/*void
160SelectionTransformTool::getRotateMatrix (int dx, int dy,

Callers 1

findSelectionCenterMethod · 0.45

Calls 6

setIdentityFunction · 0.85
getScalingFactorMethod · 0.80
setSelectionRotationMethod · 0.80
updateFunction · 0.50
executeMethod · 0.45

Tested by

no test coverage detected