![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Dialog/interactor to graphically pick a list of points. More...
#include <ecvPointListPickingDlg.h>


Public Member Functions | |
| ccPointListPickingDlg (ccPickingHub *pickingHub, QWidget *parent) | |
| Default constructor. More... | |
| void | linkWithCloud (ccPointCloud *cloud) |
| Associates dialog with cloud. More... | |
Public Member Functions inherited from ccPointPickingGenericInterface | |
| ccPointPickingGenericInterface (ccPickingHub *pickingHub, QWidget *parent=nullptr) | |
| Default constructor. More... | |
| ~ccPointPickingGenericInterface () override=default | |
| Destructor. More... | |
| bool | linkWith (QWidget *win) override |
| Links the overlay dialog with a MDI window. More... | |
| bool | start () override |
| Starts process. More... | |
| void | stop (bool state) override |
| Stops process/dialog. More... | |
| void | onItemPicked (const PickedItem &pi) override |
| Inherited from ccPickingListener. More... | |
Public Member Functions inherited from ccOverlayDialog | |
| ccOverlayDialog (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::FramelessWindowHint|Qt::Tool) | |
| Default constructor. More... | |
| ~ccOverlayDialog () override | |
| Destructor. More... | |
| void | reject () override |
| void | addOverridenShortcut (Qt::Key key) |
| bool | started () const |
| Returns whether the tool is currently started or not. More... | |
Public Member Functions inherited from ccPickingListener | |
| virtual | ~ccPickingListener ()=default |
Protected Types | |
| enum | ExportFormat { PLP_ASCII_EXPORT_XYZ , PLP_ASCII_EXPORT_IXYZ , PLP_ASCII_EXPORT_GXYZ , PLP_ASCII_EXPORT_LXYZ } |
| Export format. More... | |
Protected Slots | |
| void | applyAndExit () |
| Applies changes and exit. More... | |
| void | cancelAndExit () |
| Cancels process and exit. More... | |
| void | exportToNewCloud () |
| Exports list to a new cloud. More... | |
| void | exportToNewPolyline () |
| Exports list to a polyline. More... | |
| void | removeLastEntry () |
| Removes last inserted point from list. More... | |
| void | exportToASCII_xyz () |
| Exports list to an 'xyz' ASCII file. More... | |
| void | exportToASCII_ixyz () |
| Exports list to an 'ixyz' ASCII file. More... | |
| void | exportToASCII_gxyz () |
| Exports list to an 'gxyz' ASCII file. More... | |
| void | exportToASCII_lxyz () |
| Exports list to an 'lxyz' ASCII file. More... | |
| void | markerSizeChanged (int) |
| Redraw window when marker size changes. More... | |
| void | startIndexChanged (int) |
| Redraw window when starting index changes. More... | |
| void | updateList () |
| Updates point list widget. More... | |
Protected Slots inherited from ccOverlayDialog | |
| virtual void | onLinkedWindowDeletion (QObject *object=nullptr) |
| Slot called when the linked window is deleted (calls 'onClose') More... | |
Protected Member Functions | |
| virtual void | processPickedPoint (ccPointCloud *cloud, unsigned pointIndex, int x, int y) override |
| Generic method to process picked points. More... | |
| unsigned | getPickedPoints (std::vector< cc2DLabel * > &pickedPoints) |
| Gets current (visible) picked points from the associated cloud. More... | |
| void | clearLastLabel (ccHObject *lastVisibleLabel) |
| void | removeEntity (ccHObject *lastVisibleLabel) |
| void | exportToASCII (ExportFormat format) |
| Exports list to an ASCII file. More... | |
Protected Member Functions inherited from ccOverlayDialog | |
| bool | eventFilter (QObject *obj, QEvent *e) override |
Protected Attributes | |
| ccPointCloud * | m_associatedCloud |
| Associated cloud. More... | |
| unsigned | m_lastPreviousID |
| Last existing label unique ID on load. More... | |
| ccHObject * | m_orderedLabelsContainer |
| Ordered labels container. More... | |
| ccHObject::Container | m_toBeDeleted |
| ccHObject::Container | m_toBeAdded |
Protected Attributes inherited from ccPointPickingGenericInterface | |
| ccPickingHub * | m_pickingHub |
| Picking hub. More... | |
Protected Attributes inherited from ccOverlayDialog | |
| QWidget * | m_associatedWin |
| Associated (MDI) window. More... | |
| bool | m_processing |
| Running/processing state. More... | |
| QList< int > | m_overriddenKeys |
| Overridden keys. More... | |
Additional Inherited Members | |
Signals inherited from ccOverlayDialog | |
| void | processFinished (bool accepted) |
| Signal emitted when process is finished. More... | |
| void | shortcutTriggered (int key) |
| Signal emitted when an overridden key shortcut is pressed. More... | |
| void | shown () |
| Signal emitted when a 'show' event is detected. More... | |
Dialog/interactor to graphically pick a list of points.
Options let the user export the list to an ASCII file, a new cloud, a polyline, etc.
Definition at line 25 of file ecvPointListPickingDlg.h.
|
protected |
Export format.
See exportToASCII.
| Enumerator | |
|---|---|
| PLP_ASCII_EXPORT_XYZ | |
| PLP_ASCII_EXPORT_IXYZ | |
| PLP_ASCII_EXPORT_GXYZ | |
| PLP_ASCII_EXPORT_LXYZ | |
Definition at line 89 of file ecvPointListPickingDlg.h.
|
explicit |
Default constructor.
Definition at line 44 of file ecvPointListPickingDlg.cpp.
References applyAndExit(), cancelAndExit(), exportToASCII_gxyz(), exportToASCII_ixyz(), exportToASCII_lxyz(), exportToASCII_xyz(), exportToNewCloud(), exportToNewPolyline(), markerSizeChanged(), removeLastEntry(), s_pickedPointsStartIndex, s_showGlobalCoordsCheckBoxChecked, startIndexChanged(), and updateList().
|
protectedslot |
Applies changes and exit.
Definition at line 274 of file ecvPointListPickingDlg.cpp.
References MainWindow::db(), m_associatedCloud, m_orderedLabelsContainer, m_toBeAdded, m_toBeDeleted, ccDBRoot::removeElements(), ccPointPickingGenericInterface::stop(), MainWindow::TheInstance(), and updateList().
Referenced by ccPointListPickingDlg().
|
protectedslot |
Cancels process and exit.
Definition at line 166 of file ecvPointListPickingDlg.cpp.
References MainWindow::db(), ccHObject::getChildrenNumber(), m_associatedCloud, m_orderedLabelsContainer, m_toBeAdded, m_toBeDeleted, ccDBRoot::removeElement(), ccDBRoot::removeElements(), ccObject::setEnabled(), ccPointPickingGenericInterface::stop(), MainWindow::TheInstance(), ccHObjectCaster::To2DLabel(), cc2DLabel::updateLabel(), and updateList().
Referenced by ccPointListPickingDlg().
|
protected |
Definition at line 327 of file ecvPointListPickingDlg.cpp.
References MainWindow::db(), ccHObject::getParent(), ccHObject::removeDependencyWith(), ccDBRoot::removeElement(), removeEntity(), and MainWindow::TheInstance().
Referenced by removeLastEntry().
|
protected |
Exports list to an ASCII file.
Definition at line 370 of file ecvPointListPickingDlg.cpp.
References cc2DLabel::PickedPoint::cloud, count, CVLog::Error(), filename, format, AsciiFilter::GetFileFilter(), ccShiftedObject::getGlobalScale(), ccShiftedObject::getGlobalShift(), getPickedPoints(), cloudViewer::GenericIndexedCloud::getPoint(), cc2DLabel::PickedPoint::index, m_associatedCloud, max(), Vector3Tpl< Type >::norm2(), PLP_ASCII_EXPORT_GXYZ, PLP_ASCII_EXPORT_IXYZ, PLP_ASCII_EXPORT_LXYZ, CVLog::Print(), size, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by exportToASCII_gxyz(), exportToASCII_ixyz(), exportToASCII_lxyz(), and exportToASCII_xyz().
|
inlineprotectedslot |
Exports list to an 'gxyz' ASCII file.
Definition at line 58 of file ecvPointListPickingDlg.h.
References exportToASCII(), and PLP_ASCII_EXPORT_GXYZ.
Referenced by ccPointListPickingDlg().
|
inlineprotectedslot |
Exports list to an 'ixyz' ASCII file.
Definition at line 54 of file ecvPointListPickingDlg.h.
References exportToASCII(), and PLP_ASCII_EXPORT_IXYZ.
Referenced by ccPointListPickingDlg().
|
inlineprotectedslot |
Exports list to an 'lxyz' ASCII file.
Definition at line 62 of file ecvPointListPickingDlg.h.
References exportToASCII(), and PLP_ASCII_EXPORT_LXYZ.
Referenced by ccPointListPickingDlg().
|
inlineprotectedslot |
Exports list to an 'xyz' ASCII file.
Definition at line 50 of file ecvPointListPickingDlg.h.
References exportToASCII(), and PLP_ASCII_EXPORT_XYZ.
Referenced by ccPointListPickingDlg().
|
protectedslot |
Exports list to a new cloud.
Definition at line 208 of file ecvPointListPickingDlg.cpp.
References cloudViewer::PointCloudTpl< T >::addPoint(), MainWindow::addToDB(), cc2DLabel::PickedPoint::cloud, count, CVLog::Error(), ccShiftedObject::getGlobalScale(), ccShiftedObject::getGlobalShift(), getPickedPoints(), cloudViewer::GenericIndexedCloud::getPoint(), cc2DLabel::PickedPoint::index, m_associatedCloud, ccPointCloud::reserve(), ccShiftedObject::setGlobalScale(), ccShiftedObject::setGlobalShift(), ccObject::setName(), and MainWindow::TheInstance().
Referenced by ccPointListPickingDlg().
|
protectedslot |
Exports list to a polyline.
Definition at line 240 of file ecvPointListPickingDlg.cpp.
References ccHObject::addChild(), cloudViewer::PointCloudTpl< T >::addPoint(), cloudViewer::ReferenceCloud::addPointIndex(), MainWindow::addToDB(), cc2DLabel::PickedPoint::cloud, count, CVLog::Error(), ccShiftedObject::getGlobalScale(), ccShiftedObject::getGlobalShift(), getPickedPoints(), cloudViewer::GenericIndexedCloud::getPoint(), cc2DLabel::PickedPoint::index, m_associatedCloud, cloudViewer::ReferenceCloud::reserve(), ccPointCloud::reserve(), ccObject::setEnabled(), ccPolyline::setGlobalScale(), ccPolyline::setGlobalShift(), ccDrawableObject::setVisible(), and MainWindow::TheInstance().
Referenced by ccPointListPickingDlg().
|
protected |
Gets current (visible) picked points from the associated cloud.
Definition at line 103 of file ecvPointListPickingDlg.cpp.
References count, CVLog::Error(), ccHObject::filterChildren(), ccDrawableObject::isVisible(), CV_TYPES::LABEL_2D, m_orderedLabelsContainer, and cc2DLabel::size().
Referenced by exportToASCII(), exportToNewCloud(), exportToNewPolyline(), linkWithCloud(), removeLastEntry(), and updateList().
| void ccPointListPickingDlg::linkWithCloud | ( | ccPointCloud * | cloud | ) |
Associates dialog with cloud.
Definition at line 134 of file ecvPointListPickingDlg.cpp.
References count, ccHObject::filterChildren(), getPickedPoints(), CV_TYPES::HIERARCHY_OBJECT, ccShiftedObject::isShifted(), m_associatedCloud, m_lastPreviousID, m_orderedLabelsContainer, max(), s_pickedPointContainerName, and updateList().
|
protectedslot |
Redraw window when marker size changes.
Definition at line 357 of file ecvPointListPickingDlg.cpp.
References ecvDisplayTools::GetDisplayParameters(), ecvGui::ParamStruct::labelMarkerSize, ecvDisplayTools::RedrawDisplay(), ecvDisplayTools::SetDisplayParameters(), and size.
Referenced by ccPointListPickingDlg().
|
overrideprotectedvirtual |
Generic method to process picked points.
| cloud | picked point cloud |
| pointIndex | point index in cloud |
| x | picked pixel X position |
| y | picked pixel Y position |
Implements ccPointPickingGenericInterface.
Definition at line 504 of file ecvPointListPickingDlg.cpp.
References ccHObject::addChild(), cc2DLabel::addPickedPoint(), MainWindow::addToDB(), ecvGui::ParamStruct::displayedNumPrecision, cc2DLabel::displayPointLegend(), ccHObject::getChildrenNumber(), ecvDisplayTools::GetCurrentScreen(), ecvDisplayTools::GetDisplayParameters(), cloudViewer::PointCloudTpl< T >::getPoint(), ecvDisplayTools::GetScreenSize(), m_associatedCloud, m_orderedLabelsContainer, m_toBeAdded, s_pickedPointContainerName, cc2DLabel::setCollapsed(), cc2DLabel::setDisplayedIn2D(), cc2DLabel::setPosition(), ccDrawableObject::setVisible(), size, MainWindow::TheInstance(), cc2DLabel::updateLabel(), updateList(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
|
protected |
Definition at line 339 of file ecvPointListPickingDlg.cpp.
References ccObject::setEnabled(), ccHObjectCaster::To2DLabel(), and cc2DLabel::updateLabel().
Referenced by clearLastLabel().
|
protectedslot |
Removes last inserted point from list.
Definition at line 291 of file ecvPointListPickingDlg.cpp.
References clearLastLabel(), count, ccHObject::detachChild(), getPickedPoints(), ccObject::getUniqueID(), m_associatedCloud, m_lastPreviousID, m_orderedLabelsContainer, m_toBeAdded, m_toBeDeleted, and updateList().
Referenced by ccPointListPickingDlg().
|
protectedslot |
Redraw window when starting index changes.
Definition at line 347 of file ecvPointListPickingDlg.cpp.
References s_pickedPointsStartIndex, and updateList().
Referenced by ccPointListPickingDlg().
|
protectedslot |
Updates point list widget.
Definition at line 451 of file ecvPointListPickingDlg.cpp.
References cc2DLabel::PickedPoint::cloud, count, ecvGui::ParamStruct::displayedNumPrecision, Vector3Tpl< double >::fromArray(), ecvDisplayTools::GetCurrentScreen(), ecvDisplayTools::GetDisplayParameters(), getPickedPoints(), cloudViewer::GenericIndexedCloud::getPoint(), cc2DLabel::PickedPoint::index, m_lastPreviousID, s_defaultLabelBaseName, ccShiftedObject::toGlobal3d(), and Tuple3Tpl< Type >::u.
Referenced by applyAndExit(), cancelAndExit(), ccPointListPickingDlg(), linkWithCloud(), processPickedPoint(), removeLastEntry(), and startIndexChanged().
|
protected |
Associated cloud.
Definition at line 100 of file ecvPointListPickingDlg.h.
Referenced by applyAndExit(), cancelAndExit(), exportToASCII(), exportToNewCloud(), exportToNewPolyline(), linkWithCloud(), processPickedPoint(), and removeLastEntry().
|
protected |
Last existing label unique ID on load.
Definition at line 103 of file ecvPointListPickingDlg.h.
Referenced by linkWithCloud(), removeLastEntry(), and updateList().
|
protected |
Ordered labels container.
Definition at line 105 of file ecvPointListPickingDlg.h.
Referenced by applyAndExit(), cancelAndExit(), getPickedPoints(), linkWithCloud(), processPickedPoint(), and removeLastEntry().
|
protected |
New picked points that the user has selected (for proper "cancel" mechanism)
Definition at line 111 of file ecvPointListPickingDlg.h.
Referenced by applyAndExit(), cancelAndExit(), processPickedPoint(), and removeLastEntry().
|
protected |
Existing picked points that the user wants to delete (for proper "cancel" mechanism)
Definition at line 108 of file ecvPointListPickingDlg.h.
Referenced by applyAndExit(), cancelAndExit(), and removeLastEntry().