| 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 | |
| 203 | void |
nothing calls this directly
no test coverage detected