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

Method Execute

outofcore/tools/outofcore_viewer.cpp:148–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146 }
147
148 void
149 Execute (vtkObject *caller, unsigned long vtkNotUsed(eventId), void* vtkNotUsed(callData)) override
150 {
151 vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::SafeDownCast (caller);
152 vtkRenderer *renderer = interactor->FindPokedRenderer (interactor->GetEventPosition ()[0],
153 interactor->GetEventPosition ()[1]);
154
155 std::string key (interactor->GetKeySym ());
156 bool shift_down = interactor->GetShiftKey();
157
158 std::cout << "Key Pressed: " << key << std::endl;
159
160 Scene *scene = Scene::instance ();
161 OutofcoreCloud *cloud = dynamic_cast<OutofcoreCloud*> (scene->getObjectByName ("my_octree"));
162
163 if (key == "Up" || key == "Down")
164 {
165 if (key == "Up" && cloud)
166 {
167 if (shift_down)
168 {
169 cloud->increaseLodPixelThreshold();
170 }
171 else
172 {
173 cloud->setDisplayDepth (cloud->getDisplayDepth () + 1);
174 }
175 }
176 else if (key == "Down" && cloud)
177 {
178 if (shift_down)
179 {
180 cloud->decreaseLodPixelThreshold();
181 }
182 else
183 {
184 cloud->setDisplayDepth (cloud->getDisplayDepth () - 1);
185 }
186 }
187 }
188
189 if (key == "o")
190 {
191 cloud->setDisplayVoxels(1-static_cast<int> (cloud->getDisplayVoxels()));
192 }
193
194 if (key == "Escape")
195 {
196 Eigen::Vector3d min (cloud->getBoundingBoxMin ());
197 Eigen::Vector3d max (cloud->getBoundingBoxMax ());
198 renderer->ResetCamera (min.x (), max.x (), min.y (), max.y (), min.z (), max.z ());
199 }
200 }
201};
202
203void

Callers

nothing calls this directly

Calls 10

getObjectByNameMethod · 0.80
setDisplayDepthMethod · 0.80
getDisplayDepthMethod · 0.80
setDisplayVoxelsMethod · 0.80
getDisplayVoxelsMethod · 0.80
getBoundingBoxMinMethod · 0.80
getBoundingBoxMaxMethod · 0.80
xMethod · 0.45

Tested by

no test coverage detected