14 #include <QMdiSubWindow>
22 m_activeWindow(nullptr),
24 m_autoEnableOnActivatedWindow(true),
38 QWidget* window = (mdiSubWindow ? mdiSubWindow->widget() :
nullptr);
95 std::set<ccPickingListener*> listeners =
m_listeners;
99 l->onItemPicked(item);
107 bool autoStartPicking ,
121 "[ccPickingHub::addListener] Exclusive listener "
122 "already registered: stop the other tool relying on "
123 "point picking first");
126 }
else if (exclusive)
131 "[ccPickingHub::addListener] Attempt to register an "
132 "exclusive listener while other listeners are already "
140 "[ccPickingHub::addListener] Other listeners are "
141 "already registered with a different picking mode");
149 }
catch (
const std::bad_alloc&) {
158 if (autoStartPicking) {
166 bool autoStopPickingIfLast ) {
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Hierarchical CLOUDVIEWER Object.
void processPickedItem(ccHObject *, unsigned, int, int, const CCVector3 &)
std::set< ccPickingListener * > m_listeners
Listeners.
bool m_exclusive
Exclusive mode.
void togglePickingMode(bool state)
Manual start / stop of the picking mode on the active window.
bool m_autoEnableOnActivatedWindow
Automatically enables the picking mechanism on activated GL windows.
ccPickingHub(ecvMainAppInterface *app, QObject *parent=nullptr)
Default constructor.
void removeListener(ccPickingListener *listener, bool autoStopPickingIfLast=true)
Removes a listener.
ecvDisplayTools::PICKING_MODE m_pickingMode
Default picking mode.
void onActiveWindowDeleted(QObject *)
bool addListener(ccPickingListener *listener, bool exclusive=false, bool autoStartPicking=true, ecvDisplayTools::PICKING_MODE mode=ecvDisplayTools::POINT_OR_TRIANGLE_PICKING)
Adds a listener.
QWidget * m_activeWindow
Active window.
void onActiveWindowChanged(QMdiSubWindow *)
Point/triangle picking listener interface.
Main application interface (for plugins)