![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <PickPointsInteractor.h>


Public Member Functions | |
| PickPointsInteractor (rendering::CloudViewerScene *scene, rendering::Camera *camera) | |
| virtual | ~PickPointsInteractor () |
| void | SetPointSize (int px) |
| void | SetPickableGeometry (const std::vector< SceneWidget::PickableGeometry > &geometry) |
| void | SetNeedsRedraw () |
| void | SetOnPointsPicked (std::function< void(const std::map< std::string, std::vector< std::pair< size_t, Eigen::Vector3d >>> &, int)> f) |
| void | SetOnUIChanged (std::function< void(const std::vector< Eigen::Vector2i > &)>) |
| void | SetOnStartedPolygonPicking (std::function< void()> on_poly_pick) |
| Calls the provided function when polygon picking is initiated. More... | |
| void | DoPick () |
| void | ClearPick () |
| rendering::MatrixInteractorLogic & | GetMatrixInteractor () override |
| void | Mouse (const MouseEvent &e) override |
| void | Key (const KeyEvent &e) override |
Public Member Functions inherited from cloudViewer::visualization::gui::SceneWidget::MouseInteractor | |
| virtual | ~MouseInteractor ()=default |
| virtual bool | Tick (const TickEvent &e) |
Protected Member Functions | |
| void | OnPickImageDone (std::shared_ptr< geometry::Image > img) |
| rendering::MaterialRecord | MakeMaterial () |
Definition at line 35 of file PickPointsInteractor.h.
| cloudViewer::visualization::gui::PickPointsInteractor::PickPointsInteractor | ( | rendering::CloudViewerScene * | scene, |
| rendering::Camera * | camera | ||
| ) |
Definition at line 126 of file PickPointsInteractor.cpp.
References cloudViewer::visualization::rendering::CloudViewerScene::GetRenderer(), and SIZE_MAX.
|
virtual |
Definition at line 139 of file PickPointsInteractor.cpp.
| void cloudViewer::visualization::gui::PickPointsInteractor::ClearPick | ( | ) |
Definition at line 328 of file PickPointsInteractor.cpp.
References SetNeedsRedraw().
Referenced by Key().
| void cloudViewer::visualization::gui::PickPointsInteractor::DoPick | ( | ) |
Definition at line 305 of file PickPointsInteractor.cpp.
References cloudViewer::visualization::rendering::MatrixInteractorLogic::GetViewHeight(), cloudViewer::visualization::rendering::MatrixInteractorLogic::GetViewWidth(), OnPickImageDone(), and SetNeedsRedraw().
Referenced by Mouse().
|
overridevirtual |
Implements cloudViewer::visualization::gui::SceneWidget::MouseInteractor.
Definition at line 240 of file PickPointsInteractor.cpp.
|
overridevirtual |
Implements cloudViewer::visualization::gui::SceneWidget::MouseInteractor.
Definition at line 297 of file PickPointsInteractor.cpp.
References ClearPick(), cloudViewer::visualization::gui::KeyEvent::key, cloudViewer::visualization::gui::KEY_ESCAPE, cloudViewer::visualization::gui::KeyEvent::type, and cloudViewer::visualization::gui::KeyEvent::UP.
|
protected |
Definition at line 338 of file PickPointsInteractor.cpp.
References cloudViewer::visualization::rendering::MaterialRecord::point_size, cloudViewer::visualization::rendering::MaterialRecord::shader, and cloudViewer::visualization::rendering::MaterialRecord::sRGB_color.
Referenced by SetPickableGeometry(), and SetPointSize().
|
overridevirtual |
Implements cloudViewer::visualization::gui::SceneWidget::MouseInteractor.
Definition at line 263 of file PickPointsInteractor.cpp.
References cloudViewer::visualization::gui::ALT, cloudViewer::visualization::gui::MouseEvent::BUTTON_UP, DoPick(), cloudViewer::visualization::gui::MouseEvent::modifiers, cloudViewer::visualization::gui::MouseEvent::type, cloudViewer::visualization::gui::MouseEvent::x, and cloudViewer::visualization::gui::MouseEvent::y.
|
protected |
Definition at line 348 of file PickPointsInteractor.cpp.
References abs(), dist(), LogWarning, max(), min(), next, and cloudViewer::visualization::gui::SelectionIndexLookup::ObjectForIndex().
Referenced by DoPick().
| void cloudViewer::visualization::gui::PickPointsInteractor::SetNeedsRedraw | ( | ) |
Indicates that the selection scene must be redrawn and the picking pixels retrieved again before picking.
Definition at line 238 of file PickPointsInteractor.cpp.
Referenced by ClearPick(), DoPick(), and SetPickableGeometry().
| void cloudViewer::visualization::gui::PickPointsInteractor::SetOnPointsPicked | ( | std::function< void(const std::map< std::string, std::vector< std::pair< size_t, Eigen::Vector3d >>> &, int)> | f | ) |
Calls the provided function when points are picked: f(indices, key_modifiers)
Definition at line 244 of file PickPointsInteractor.cpp.
| void cloudViewer::visualization::gui::PickPointsInteractor::SetOnStartedPolygonPicking | ( | std::function< void()> | on_poly_pick | ) |
Calls the provided function when polygon picking is initiated.
Definition at line 258 of file PickPointsInteractor.cpp.
| void cloudViewer::visualization::gui::PickPointsInteractor::SetOnUIChanged | ( | std::function< void(const std::vector< Eigen::Vector2i > &)> | on_ui | ) |
Calls the provided function when a "UI" needs to be drawn. This is used for polygon picking to draw the polygon in progress. will be passed
Definition at line 253 of file PickPointsInteractor.cpp.
| void cloudViewer::visualization::gui::PickPointsInteractor::SetPickableGeometry | ( | const std::vector< SceneWidget::PickableGeometry > & | geometry | ) |
Sets the points that can be picked. Limited to 16 million or less points/vertices total. Geometry pointers will not be cached.
Definition at line 150 of file PickPointsInteractor.cpp.
References cloudViewer::visualization::gui::SelectionIndexLookup::Add(), cloudViewer::visualization::rendering::MaterialRecord::base_color, LogWarning, MakeMaterial(), SetNeedsRedraw(), cloudViewer::visualization::rendering::MaterialRecord::shader, and cloudViewer::visualization::rendering::MaterialRecord::sRGB_color.
| void cloudViewer::visualization::gui::PickPointsInteractor::SetPointSize | ( | int | px | ) |
Definition at line 141 of file PickPointsInteractor.cpp.
References MakeMaterial().