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

Dialog for selection of cloud center. More...

#include <ecvShiftAndScaleCloudDlg.h>

Inheritance diagram for ecvShiftAndScaleCloudDlg:
Collaboration diagram for ecvShiftAndScaleCloudDlg:

Public Member Functions

 ecvShiftAndScaleCloudDlg (const CCVector3d &Pg, double Dg=0, QWidget *parent=0)
 Default constructor. More...
 
 ecvShiftAndScaleCloudDlg (const CCVector3d &Pl, double Dl, const CCVector3d &Pg, double Dg, QWidget *parent=0)
 Reverse mode constructor. More...
 
void setShiftFieldsPrecision (int precision)
 Sets the Shift fields (X, Y and Z) precision (default should be 2) More...
 
virtual ~ecvShiftAndScaleCloudDlg ()
 Destructor. More...
 
CCVector3d getShift () const
 Returns shift. More...
 
double getScale () const
 Returns scale. More...
 
bool applyAll () const
 Whether shift should be applied to all files. More...
 
bool cancelled () const
 Whether the user has clicked on the cancel button or not. More...
 
void showScaleItems (bool state)
 Whether to show dialog items related to scale. More...
 
void showApplyAllButton (bool state)
 Whether to show the 'Apply all' button or not. More...
 
void showApplyButton (bool state)
 Whether to show the 'Apply' button or not. More...
 
void showNoButton (bool state)
 Whether to show the 'No' button or not. More...
 
void showCancelButton (bool state)
 Whether to show the 'Cancel' button or not. More...
 
void showWarning (bool state)
 Whether to show or not the warning about non pertinent shift information. More...
 
void showTitle (bool state)
 Whether to show or not the title. More...
 
void showKeepGlobalPosCheckbox (bool state)
 Whether to show or not the 'Keep global position' checkbox. More...
 
bool keepGlobalPos () const
 Returns whether the global position should be preserved or not. More...
 
void setKeepGlobalPos (bool state)
 Sets whether the global position should be preserved or not. More...
 
void showPreserveShiftOnSave (bool state)
 Whether to show or not the 'Preserve shift on save' checkbox. More...
 
bool preserveShiftOnSave () const
 Returns whether the global shift should be preserved or not. More...
 
void setPreserveShiftOnSave (bool state)
 Sets whether the global shift should be preserved or not. More...
 
int addShiftInfo (const ecvGlobalShiftManager::ShiftInfo &info)
 Adds shift info to the combox. More...
 
int addShiftInfo (const std::vector< ecvGlobalShiftManager::ShiftInfo > &info)
 Adds shift info to the combox. More...
 
bool getInfo (size_t index, ecvGlobalShiftManager::ShiftInfo &info) const
 Returns a given input info. More...
 
size_t infoCount () const
 Returns the number of info currently stored. More...
 
void setCurrentProfile (int index)
 Sets the current combo-box entry (profile) More...
 
bool addFileInfo ()
 Adds information from default file (if any) More...
 

Static Public Member Functions

static void SetLastInfo (const CCVector3d &shift, double scale)
 Sets the last shift and scale information. More...
 

Protected Slots

void onLoadIndexChanged (int)
 Slot called when the 'loadComboBox' index changes. More...
 
void onGlobalPosCheckBoxToggled (bool)
 Slot called when the 'Keep global position' checkbox is toggled. More...
 
void onClick (QAbstractButton *button)
 Analyzes the clicked button. More...
 
void updateGlobalAndLocalSystems ()
 Updates info on the global and local coordinate systems. More...
 
void displayMoreInfo ()
 Displays more info about global shift mechanism. More...
 

Protected Member Functions

void init ()
 Initialization routine. More...
 
void setShift (const CCVector3d &shift)
 Sets displayed shift. More...
 
void setScale (double scale)
 Sets displayed scale. More...
 
void updateLocalSystem ()
 Updates info on the local coordinate system. More...
 
void updateGlobalSystem ()
 Updates info on the global coordinate system. More...
 
bool loadInfoFromFile (QString filename)
 Tries to load ShiftInfo data from a (text) file. More...
 

Protected Attributes

Ui_GlobalShiftAndScaleDlg * m_ui
 Associated UI. More...
 
bool m_applyAll
 Whether shift should be applied to all files. More...
 
bool m_cancel
 Whether the user has clicked on Cancel or not. More...
 
std::vector< ecvGlobalShiftManager::ShiftInfom_defaultInfos
 Default infos (typically loaded from the global_shift_list.txt' file) More...
 
int m_activeInfoIndex
 Active info entry index. More...
 
CCVector3d m_originalPoint
 Original coordinate system point. More...
 
double m_originalDiagonal
 Original coordinate system diagonal. More...
 
CCVector3d m_localPoint
 Local coordinate system point (reversed mode only) More...
 
double m_localDiagonal
 Local coordinate system diagonal (reversed mode only) More...
 
bool m_reversedMode
 Whether the reverse mode is active or not. More...
 

Detailed Description

Dialog for selection of cloud center.

Definition at line 24 of file ecvShiftAndScaleCloudDlg.h.

Constructor & Destructor Documentation

◆ ecvShiftAndScaleCloudDlg() [1/2]

ecvShiftAndScaleCloudDlg::ecvShiftAndScaleCloudDlg ( const CCVector3d Pg,
double  Dg = 0,
QWidget *  parent = 0 
)

Default constructor.

Parameters
Pga point expressed in the original coordinate system
Dgbounding box diagonal in the original coordinate system (or <= 0 to ignore)
parentparent widget

Definition at line 38 of file ecvShiftAndScaleCloudDlg.cpp.

References init(), m_originalDiagonal, showCancelButton(), showKeepGlobalPosCheckbox(), showPreserveShiftOnSave(), showScaleItems(), and showWarning().

◆ ecvShiftAndScaleCloudDlg() [2/2]

ecvShiftAndScaleCloudDlg::ecvShiftAndScaleCloudDlg ( const CCVector3d Pl,
double  Dl,
const CCVector3d Pg,
double  Dg,
QWidget *  parent = 0 
)

Reverse mode constructor.

Parameters
Pla point expressed in the local coordinate system
Dlbounding box diagonal in the local coordinate system
Pga point expressed in the original coordinate system
Dgbounding box diagonal in the original coordinate system
parentparent widget

Definition at line 60 of file ecvShiftAndScaleCloudDlg.cpp.

References init(), m_localDiagonal, m_originalDiagonal, m_ui, onGlobalPosCheckBoxToggled(), showCancelButton(), showKeepGlobalPosCheckbox(), showPreserveShiftOnSave(), showScaleItems(), showTitle(), and showWarning().

◆ ~ecvShiftAndScaleCloudDlg()

ecvShiftAndScaleCloudDlg::~ecvShiftAndScaleCloudDlg ( )
virtual

Destructor.

Definition at line 88 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Member Function Documentation

◆ addFileInfo()

bool ecvShiftAndScaleCloudDlg::addFileInfo ( )

Adds information from default file (if any)

Definition at line 145 of file ecvShiftAndScaleCloudDlg.cpp.

References loadInfoFromFile(), and s_defaultGlobalShiftListFilename().

Referenced by ecvGlobalShiftManager::Handle().

◆ addShiftInfo() [1/2]

int ecvShiftAndScaleCloudDlg::addShiftInfo ( const ecvGlobalShiftManager::ShiftInfo info)

Adds shift info to the combox.

Parameters
infoshift info
Returns
index in combo-box

Definition at line 418 of file ecvShiftAndScaleCloudDlg.cpp.

References m_defaultInfos, and m_ui.

Referenced by addShiftInfo(), and ecvGlobalShiftManager::Handle().

◆ addShiftInfo() [2/2]

int ecvShiftAndScaleCloudDlg::addShiftInfo ( const std::vector< ecvGlobalShiftManager::ShiftInfo > &  info)

Adds shift info to the combox.

Parameters
infoshift info
Returns
index in combo-box

Definition at line 433 of file ecvShiftAndScaleCloudDlg.cpp.

References addShiftInfo(), and m_defaultInfos.

◆ applyAll()

bool ecvShiftAndScaleCloudDlg::applyAll ( ) const
inline

Whether shift should be applied to all files.

Definition at line 63 of file ecvShiftAndScaleCloudDlg.h.

Referenced by ecvGlobalShiftManager::Handle().

◆ cancelled()

bool ecvShiftAndScaleCloudDlg::cancelled ( ) const
inline

Whether the user has clicked on the cancel button or not.

Definition at line 66 of file ecvShiftAndScaleCloudDlg.h.

◆ displayMoreInfo

void ecvShiftAndScaleCloudDlg::displayMoreInfo ( )
protectedslot

Displays more info about global shift mechanism.

Definition at line 137 of file ecvShiftAndScaleCloudDlg.cpp.

Referenced by init().

◆ getInfo()

bool ecvShiftAndScaleCloudDlg::getInfo ( size_t  index,
ecvGlobalShiftManager::ShiftInfo info 
) const

Returns a given input info.

Definition at line 403 of file ecvShiftAndScaleCloudDlg.cpp.

References m_defaultInfos.

Referenced by ecvGlobalShiftManager::Handle().

◆ getScale()

double ecvShiftAndScaleCloudDlg::getScale ( ) const

Returns scale.

Definition at line 323 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvGlobalShiftManager::Handle(), updateGlobalSystem(), and updateLocalSystem().

◆ getShift()

CCVector3d ecvShiftAndScaleCloudDlg::getShift ( ) const

Returns shift.

Definition at line 314 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvGlobalShiftManager::Handle(), updateGlobalSystem(), and updateLocalSystem().

◆ infoCount()

size_t ecvShiftAndScaleCloudDlg::infoCount ( ) const
inline

Returns the number of info currently stored.

Definition at line 116 of file ecvShiftAndScaleCloudDlg.h.

Referenced by ecvGlobalShiftManager::Handle().

◆ init()

void ecvShiftAndScaleCloudDlg::init ( )
protected

◆ keepGlobalPos()

bool ecvShiftAndScaleCloudDlg::keepGlobalPos ( ) const

Returns whether the global position should be preserved or not.

Definition at line 373 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by updateGlobalSystem(), and updateLocalSystem().

◆ loadInfoFromFile()

bool ecvShiftAndScaleCloudDlg::loadInfoFromFile ( QString  filename)
protected

Tries to load ShiftInfo data from a (text) file.

Data is stored in m_defaultInfos.

Parameters
filenamefilename
Returns
success

Definition at line 151 of file ecvShiftAndScaleCloudDlg.cpp.

References filename, m_defaultInfos, m_ui, name, ecvGlobalShiftManager::ShiftInfo::name, ecvGlobalShiftManager::ShiftInfo::scale, ecvGlobalShiftManager::ShiftInfo::shift, QtCompat::SkipEmptyParts, CVLog::Warning(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by addFileInfo().

◆ onClick

void ecvShiftAndScaleCloudDlg::onClick ( QAbstractButton *  button)
protectedslot

Analyzes the clicked button.

Definition at line 390 of file ecvShiftAndScaleCloudDlg.cpp.

References m_applyAll, m_cancel, and m_ui.

Referenced by init().

◆ onGlobalPosCheckBoxToggled

void ecvShiftAndScaleCloudDlg::onGlobalPosCheckBoxToggled ( bool  state)
protectedslot

Slot called when the 'Keep global position' checkbox is toggled.

Definition at line 381 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui, updateGlobalSystem(), and updateLocalSystem().

Referenced by ecvShiftAndScaleCloudDlg(), and init().

◆ onLoadIndexChanged

void ecvShiftAndScaleCloudDlg::onLoadIndexChanged ( int  index)
protectedslot

Slot called when the 'loadComboBox' index changes.

Definition at line 396 of file ecvShiftAndScaleCloudDlg.cpp.

References m_defaultInfos, m_ui, setScale(), and setShift().

Referenced by init().

◆ preserveShiftOnSave()

bool ecvShiftAndScaleCloudDlg::preserveShiftOnSave ( ) const

Returns whether the global shift should be preserved or not.

Definition at line 365 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvGlobalShiftManager::Handle().

◆ setCurrentProfile()

void ecvShiftAndScaleCloudDlg::setCurrentProfile ( int  index)

Sets the current combo-box entry (profile)

Definition at line 412 of file ecvShiftAndScaleCloudDlg.cpp.

References m_defaultInfos, and m_ui.

Referenced by ecvGlobalShiftManager::Handle().

◆ setKeepGlobalPos()

void ecvShiftAndScaleCloudDlg::setKeepGlobalPos ( bool  state)

Sets whether the global position should be preserved or not.

Definition at line 377 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

◆ SetLastInfo()

static void ecvShiftAndScaleCloudDlg::SetLastInfo ( const CCVector3d shift,
double  scale 
)
static

Sets the last shift and scale information.

◆ setPreserveShiftOnSave()

void ecvShiftAndScaleCloudDlg::setPreserveShiftOnSave ( bool  state)

Sets whether the global shift should be preserved or not.

Definition at line 369 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvGlobalShiftManager::Handle().

◆ setScale()

void ecvShiftAndScaleCloudDlg::setScale ( double  scale)
protected

Sets displayed scale.

Definition at line 319 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by onLoadIndexChanged().

◆ setShift()

void ecvShiftAndScaleCloudDlg::setShift ( const CCVector3d shift)
protected

Sets displayed shift.

Definition at line 308 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by onLoadIndexChanged().

◆ setShiftFieldsPrecision()

void ecvShiftAndScaleCloudDlg::setShiftFieldsPrecision ( int  precision)

Sets the Shift fields (X, Y and Z) precision (default should be 2)

Definition at line 95 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

◆ showApplyAllButton()

void ecvShiftAndScaleCloudDlg::showApplyAllButton ( bool  state)

Whether to show the 'Apply all' button or not.

Definition at line 333 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvGlobalShiftManager::Handle().

◆ showApplyButton()

void ecvShiftAndScaleCloudDlg::showApplyButton ( bool  state)

Whether to show the 'Apply' button or not.

Definition at line 337 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

◆ showCancelButton()

void ecvShiftAndScaleCloudDlg::showCancelButton ( bool  state)

Whether to show the 'Cancel' button or not.

Definition at line 345 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvShiftAndScaleCloudDlg().

◆ showKeepGlobalPosCheckbox()

void ecvShiftAndScaleCloudDlg::showKeepGlobalPosCheckbox ( bool  state)

Whether to show or not the 'Keep global position' checkbox.

Definition at line 357 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvShiftAndScaleCloudDlg().

◆ showNoButton()

void ecvShiftAndScaleCloudDlg::showNoButton ( bool  state)

Whether to show the 'No' button or not.

Definition at line 341 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

◆ showPreserveShiftOnSave()

void ecvShiftAndScaleCloudDlg::showPreserveShiftOnSave ( bool  state)

Whether to show or not the 'Preserve shift on save' checkbox.

Definition at line 361 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvShiftAndScaleCloudDlg(), and ecvGlobalShiftManager::Handle().

◆ showScaleItems()

void ecvShiftAndScaleCloudDlg::showScaleItems ( bool  state)

Whether to show dialog items related to scale.

Definition at line 327 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvShiftAndScaleCloudDlg(), and ecvGlobalShiftManager::Handle().

◆ showTitle()

void ecvShiftAndScaleCloudDlg::showTitle ( bool  state)

Whether to show or not the title.

Definition at line 353 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvShiftAndScaleCloudDlg(), and ecvGlobalShiftManager::Handle().

◆ showWarning()

void ecvShiftAndScaleCloudDlg::showWarning ( bool  state)

Whether to show or not the warning about non pertinent shift information.

Definition at line 349 of file ecvShiftAndScaleCloudDlg.cpp.

References m_ui.

Referenced by ecvShiftAndScaleCloudDlg(), and ecvGlobalShiftManager::Handle().

◆ updateGlobalAndLocalSystems

void ecvShiftAndScaleCloudDlg::updateGlobalAndLocalSystems ( )
protectedslot

Updates info on the global and local coordinate systems.

Definition at line 228 of file ecvShiftAndScaleCloudDlg.cpp.

References updateGlobalSystem(), and updateLocalSystem().

Referenced by init().

◆ updateGlobalSystem()

void ecvShiftAndScaleCloudDlg::updateGlobalSystem ( )
protected

◆ updateLocalSystem()

Member Data Documentation

◆ m_activeInfoIndex

int ecvShiftAndScaleCloudDlg::m_activeInfoIndex
protected

Active info entry index.

Definition at line 173 of file ecvShiftAndScaleCloudDlg.h.

◆ m_applyAll

bool ecvShiftAndScaleCloudDlg::m_applyAll
protected

Whether shift should be applied to all files.

Definition at line 166 of file ecvShiftAndScaleCloudDlg.h.

Referenced by onClick().

◆ m_cancel

bool ecvShiftAndScaleCloudDlg::m_cancel
protected

Whether the user has clicked on Cancel or not.

Definition at line 168 of file ecvShiftAndScaleCloudDlg.h.

Referenced by onClick().

◆ m_defaultInfos

std::vector<ecvGlobalShiftManager::ShiftInfo> ecvShiftAndScaleCloudDlg::m_defaultInfos
protected

Default infos (typically loaded from the global_shift_list.txt' file)

Definition at line 171 of file ecvShiftAndScaleCloudDlg.h.

Referenced by addShiftInfo(), getInfo(), loadInfoFromFile(), onLoadIndexChanged(), and setCurrentProfile().

◆ m_localDiagonal

double ecvShiftAndScaleCloudDlg::m_localDiagonal
protected

Local coordinate system diagonal (reversed mode only)

Definition at line 182 of file ecvShiftAndScaleCloudDlg.h.

Referenced by ecvShiftAndScaleCloudDlg(), updateGlobalSystem(), and updateLocalSystem().

◆ m_localPoint

CCVector3d ecvShiftAndScaleCloudDlg::m_localPoint
protected

Local coordinate system point (reversed mode only)

Definition at line 180 of file ecvShiftAndScaleCloudDlg.h.

Referenced by updateGlobalSystem(), and updateLocalSystem().

◆ m_originalDiagonal

double ecvShiftAndScaleCloudDlg::m_originalDiagonal
protected

Original coordinate system diagonal.

Definition at line 178 of file ecvShiftAndScaleCloudDlg.h.

Referenced by ecvShiftAndScaleCloudDlg(), updateGlobalSystem(), and updateLocalSystem().

◆ m_originalPoint

CCVector3d ecvShiftAndScaleCloudDlg::m_originalPoint
protected

Original coordinate system point.

Definition at line 176 of file ecvShiftAndScaleCloudDlg.h.

Referenced by updateGlobalSystem(), and updateLocalSystem().

◆ m_reversedMode

bool ecvShiftAndScaleCloudDlg::m_reversedMode
protected

Whether the reverse mode is active or not.

Definition at line 185 of file ecvShiftAndScaleCloudDlg.h.

Referenced by updateGlobalSystem(), and updateLocalSystem().

◆ m_ui


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