ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccPointPairRegistrationDlg Class Reference

#include <ecvPointPairRegistrationDlg.h>

Inheritance diagram for ccPointPairRegistrationDlg:
[legend]
Collaboration diagram for ccPointPairRegistrationDlg:
[legend]

Classes

struct  EntityContext
 Original cloud context. More...
 
struct  EntityContexts
 Set of contexts. More...
 

Public Member Functions

 ccPointPairRegistrationDlg (ccPickingHub *pickingHub, ecvMainAppInterface *app, QWidget *parent=nullptr)
 Default constructor. 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...
 
bool init (QWidget *win, const ccHObject::Container &alignedEntities, const ccHObject::Container *referenceEntities=nullptr)
 Inits dialog. More...
 
void clear ()
 Clears dialog. More...
 
void pause (bool state)
 Pauses the dialog. More...
 
bool addAlignedPoint (CCVector3d &P, ccHObject *entity=nullptr, bool shifted=true)
 Adds a point to the 'align' set. More...
 
bool addReferencePoint (CCVector3d &P, ccHObject *entity=nullptr, bool shifted=true)
 Adds a point to the 'reference' set. More...
 
void removeAlignedPoint (int index, bool autoRemoveDualPoint=true)
 Removes a point from the 'align' set. More...
 
void removeRefPoint (int index, bool autoRemoveDualPoint=true)
 Removes a point from the 'reference' set. More...
 
void updateRefMarkers (int index)
 
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 Slots

void showAlignedEntities (bool)
 Slot called to change aligned cloud visibility. More...
 
void showReferenceEntities (bool)
 Slot called to change reference cloud visibility. More...
 
void addManualAlignedPoint ()
 Slot called to add a manual point to the 'align' set. More...
 
void addManualRefPoint ()
 Slot called to add a manual point to the 'reference' set. More...
 
void unstackAligned ()
 Slot called to remove the last point on the 'align' stack. More...
 
void updateSphereMarks (ccHObject *obj, bool remove)
 
void updateAlignedMarkers (int index)
 
void unstackRef ()
 Slot called to remove the last point on the 'reference' stack. More...
 
void onDelButtonPushed ()
 Slot called when a "delete" button is pushed. More...
 
void updateAlignInfo ()
 Updates the registration info and buttons states. More...
 
void apply ()
 
void align ()
 
void reset ()
 
void cancel ()
 
void updateAllMarkers (float markerSize)
 
void label2DMove (int x, int y, int dx, int dy)
 
- 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

void zoomGlobalOnRegistrationEntities ()
 
void transformAlignedEntity (const ccGLMatrix &transMat, bool apply=true)
 
void onPointCountChanged ()
 Enables (or not) buttons depending on the number of points in both lists. More...
 
bool callHornRegistration (cloudViewer::PointProjectionTools::Transformation &trans, double &rms, bool autoUpdateTab)
 Calls Horn registration (cloudViewer::HornRegistrationTools) More...
 
void clearRMSColumns ()
 Clears the RMS rows. More...
 
void addPointToTable (QTableWidget *tableWidget, int rowIndex, const CCVector3d &P, QString pointLabel)
 Adds a point to one of the table (ref./aligned) More...
 
bool convertToSphereCenter (CCVector3d &P, ccHObject *entity, PointCoordinateType &sphereRadius)
 Converts a picked point to a sphere center (if necessary) More...
 
void resetTitle ()
 Resets the displayed title (3D view) More...
 
- Protected Member Functions inherited from ccOverlayDialog
bool eventFilter (QObject *obj, QEvent *e) override
 

Protected Attributes

EntityContexts m_alignedEntities
 Aligned entity. More...
 
ccPointCloud m_alignedPoints
 Aligned points set. More...
 
EntityContexts m_referenceEntities
 Reference entity (if any) More...
 
ccPointCloud m_refPoints
 Reference points set. More...
 
ccHObject m_refLabels
 
ccHObject m_alignedLabels
 
ccGLMatrix m_transMatHistory
 
bool m_paused
 Whether the dialog is paused or not. More...
 
ccPickingHub * m_pickingHub
 Picking hub. More...
 
ecvMainAppInterface * m_app
 Main application interface. 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...
 

Constructor & Destructor Documentation

◆ ccPointPairRegistrationDlg()

ccPointPairRegistrationDlg::ccPointPairRegistrationDlg ( ccPickingHub *  pickingHub,
ecvMainAppInterface *  app,
QWidget *  parent = nullptr 
)
explicit

Member Function Documentation

◆ addAlignedPoint()

◆ addManualAlignedPoint

◆ addManualRefPoint

◆ addPointToTable()

void ccPointPairRegistrationDlg::addPointToTable ( QTableWidget *  tableWidget,
int  rowIndex,
const CCVector3d &  P,
QString  pointLabel 
)
protected

Adds a point to one of the table (ref./aligned)

References CreateDeleteButton(), DEL_BUTTON_COL_INDEX, onDelButtonPushed(), Tuple3Tpl< Type >::u, and XYZ_COL_INDEX.

Referenced by addAlignedPoint(), and addReferencePoint().

◆ addReferencePoint()

◆ align

◆ apply

◆ callHornRegistration()

◆ cancel

◆ clear()

◆ clearRMSColumns()

void ccPointPairRegistrationDlg::clearRMSColumns ( )
protected

Clears the RMS rows.

References RMS_COL_INDEX.

Referenced by callHornRegistration().

◆ convertToSphereCenter()

bool ccPointPairRegistrationDlg::convertToSphereCenter ( CCVector3d &  P,
ccHObject *  entity,
PointCoordinateType &  sphereRadius 
)
protected

Converts a picked point to a sphere center (if necessary)

Parameters
Pinput point (may be converted to a sphere center)
entityassociated entity
sphereRadiusthe detected spherer radius (or -1 if no sphere)
Returns
whether the point can be used or not

References cloudViewer::BoundingBoxTpl< T >::add(), cloudViewer::BoundingBoxTpl< T >::clear(), ccGenericPointCloud::crop(), cloudViewer::GeometricalAnalysisTools::DetectSphereRobust(), Vector3Tpl< PointCoordinateType >::fromArray(), Vector3Tpl< double >::fromArray(), ccObject::isKindOf(), cloudViewer::GeometricalAnalysisTools::NoError, PC_ONE, CV_TYPES::POINT_CLOUD, CVLog::Print(), cloudViewer::ReferenceCloud::size(), Tuple3Tpl< Type >::u, and CVLog::Warning().

Referenced by addAlignedPoint(), and addReferencePoint().

◆ init()

◆ label2DMove

◆ linkWith()

bool ccPointPairRegistrationDlg::linkWith ( QWidget *  win)
overridevirtual

Links the overlay dialog with a MDI window.

Warning: link can't be modified while dialog is displayed/process is running!

Returns
success

Reimplemented from ccOverlayDialog.

References ccOverlayDialog::linkWith(), m_alignedEntities, m_referenceEntities, and ccPointPairRegistrationDlg::EntityContexts::restoreAll().

Referenced by init().

◆ onDelButtonPushed

void ccPointPairRegistrationDlg::onDelButtonPushed ( )
protectedslot

Slot called when a "delete" button is pushed.

References DEL_BUTTON_COL_INDEX, removeAlignedPoint(), and removeRefPoint().

Referenced by addPointToTable().

◆ onItemPicked()

◆ onPointCountChanged()

void ccPointPairRegistrationDlg::onPointCountChanged ( )
protected

◆ pause()

void ccPointPairRegistrationDlg::pause ( bool  state)

Pauses the dialog.

References m_paused.

Referenced by MainWindow::cancelPreviousPickingOperation().

◆ removeAlignedPoint()

◆ removeRefPoint()

◆ reset

◆ resetTitle()

void ccPointPairRegistrationDlg::resetTitle ( )
protected

◆ showAlignedEntities

◆ showReferenceEntities

◆ start()

bool ccPointPairRegistrationDlg::start ( )
overridevirtual

◆ stop()

void ccPointPairRegistrationDlg::stop ( bool  accepted)
overridevirtual

Stops process/dialog.

Automatically emits the 'processFinished' signal (with input state as argument).

Parameters
acceptedprocess/dialog result

Reimplemented from ccOverlayDialog.

References ecvDisplayTools::DisplayNewMessage(), label2DMove(), ecvDisplayTools::labelmove2D(), ecvDisplayTools::LOWER_LEFT_MESSAGE, m_pickingHub, ccPickingHub::removeListener(), ccOverlayDialog::stop(), ecvDisplayTools::TheInstance(), updateAlignInfo(), and ecvDisplayTools::UPPER_CENTER_MESSAGE.

Referenced by apply(), and cancel().

◆ transformAlignedEntity()

void ccPointPairRegistrationDlg::transformAlignedEntity ( const ccGLMatrix &  transMat,
bool  apply = true 
)
protected

◆ unstackAligned

void ccPointPairRegistrationDlg::unstackAligned ( )
protectedslot

◆ unstackRef

void ccPointPairRegistrationDlg::unstackRef ( )
protectedslot

◆ updateAlignedMarkers

◆ updateAlignInfo

◆ updateAllMarkers

void ccPointPairRegistrationDlg::updateAllMarkers ( float  markerSize)
protectedslot

◆ updateRefMarkers()

◆ updateSphereMarks

◆ zoomGlobalOnRegistrationEntities()

Member Data Documentation

◆ m_alignedEntities

◆ m_alignedLabels

◆ m_alignedPoints

◆ m_app

ecvMainAppInterface* ccPointPairRegistrationDlg::m_app
protected

Main application interface.

Referenced by transformAlignedEntity().

◆ m_paused

bool ccPointPairRegistrationDlg::m_paused
protected

Whether the dialog is paused or not.

Referenced by onItemPicked(), and pause().

◆ m_pickingHub

ccPickingHub* ccPointPairRegistrationDlg::m_pickingHub
protected

Picking hub.

Referenced by ccPointPairRegistrationDlg(), start(), and stop().

◆ m_referenceEntities

EntityContexts ccPointPairRegistrationDlg::m_referenceEntities
protected

◆ m_refLabels

◆ m_refPoints

◆ m_transMatHistory

ccGLMatrix ccPointPairRegistrationDlg::m_transMatHistory
protected

Referenced by align(), apply(), cancel(), and reset().


The documentation for this class was generated from the following files: