22 Ui::GraphicalTransformationDlg(),
23 m_toTransform(
"transformed") {
26 connect(pauseButton, &QAbstractButton::toggled,
this,
28 connect(okButton, &QAbstractButton::clicked,
this,
30 connect(razButton, &QAbstractButton::clicked,
this,
32 connect(cancelButton, &QAbstractButton::clicked,
this,
41 connect(this->rotComboBox,
42 static_cast<void (QComboBox::*)(
int)
>(
43 &QComboBox::currentIndexChanged),
45 connect(this->TxCheckBox, &QCheckBox::toggled,
this,
47 connect(this->TyCheckBox, &QCheckBox::toggled,
this,
49 connect(this->TzCheckBox, &QCheckBox::toggled,
this,
51 connect(this->scaleCheckBox, &QCheckBox::toggled,
this,
53 connect(this->shearCheckBox, &QCheckBox::toggled,
this,
62 pauseButton->toggle();
70 cancelButton->click();
100 switch (rotComboBox->currentIndex()) {
103 ecvGenericTransformTool::RotationMode::R_XYZ);
123 flag += TxCheckBox->isChecked() * 1;
124 flag += TyCheckBox->isChecked() * 2;
125 flag += TzCheckBox->isChecked() * 3;
129 ecvGenericTransformTool::TranslationMOde::T_NONE);
133 ecvGenericTransformTool::TranslationMOde::T_X);
137 ecvGenericTransformTool::TranslationMOde::T_Y);
140 if (TzCheckBox->isChecked()) {
142 ecvGenericTransformTool::TranslationMOde::T_Z);
145 ecvGenericTransformTool::TranslationMOde::T_XY);
150 ecvGenericTransformTool::TranslationMOde::T_XZ);
154 ecvGenericTransformTool::TranslationMOde::T_ZY);
158 ecvGenericTransformTool::TranslationMOde::T_XYZ);
172 "Transformation [PAUSED]",
176 "Unpause to transform again",
182 "[Rotation/Translation mode]",
192 pauseButton->blockSignals(
true);
193 pauseButton->setChecked(state);
194 pauseButton->blockSignals(
false);
214 if (!entity)
return false;
219 "transform entity '%1' cause it's locked!")
227 CVLog::Warning(QString(
"[Graphical Transformation Tool] Entity '%1' "
228 "can't be modified as it is part of a mesh "
229 "group. You should 'clone' it first.")
237 for (
unsigned i = 0; i < n;) {
257 QString(
"[Graphical Transformation Tool] Can't transform "
258 "entity '%1' cause it's not supported now!")
290 if (childNum == 0)
return false;
306 pause(this->pauseButton->isChecked());
335 QString(
"[ccGraphicalTransformationTool::reset] transformation "
336 "tool has not been initialized!"));
381 QString(
"[ccGraphicalTransformationTool::apply] transformation "
382 "tool has not been initialized!"));
389 if (this->scaleCheckBox->isChecked() || this->shearCheckBox->isChecked()) {
401 #define NORMALIZE_TRANSFORMATION_MATRIX_WITH_EULER
402 #ifdef NORMALIZE_TRANSFORMATION_MATRIX_WITH_EULER
408 double phi_rad, theta_rad, psi_rad;
416 "[GraphicalTransformationTool] Final transformation (before "
437 ccGLMatrixd idTrans = finalRotation * finalRotationT;
439 idTrans.
data()[0] * idTrans.
data()[5] * idTrans.
data()[10];
485 CVLog::Print(
"[GraphicalTransformationTool] Applied transformation:");
490 float phi_rad, theta_rad, psi_rad;
492 correctedFinalTrans.
getParameters(phi_rad, theta_rad, psi_rad, t3D);
Vector3Tpl< PointCoordinateType > CCVector3
Default 3D Vector.
static bool PrintDebug(const char *format,...)
Same as Print, but works only in Debug mode.
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
static bool Print(const char *format,...)
Prints out a formatted message in console.
ccHObjectContext removeObjectTemporarilyFromDBTree(ccHObject *obj) override
Removes object temporarily from DB tree.
static MainWindow * TheInstance()
Returns the unique instance of this object.
void addToDB(const QStringList &filenames, QString fileFilter=QString(), bool displayDialog=true)
void putObjectBackIntoDBTree(ccHObject *obj, const ccHObjectContext &context) override
Adds back object to DB tree.
virtual void setRedraw(bool state)
Sets entity redraw mode.
virtual void resetGLTransformation()
Resets associated GL transformation.
virtual void setGLTransformation(const ccGLMatrix &trans)
Associates entity with a GL transformation (rotation + translation)
QString toString(int precision=12, QChar separator=' ') const
Returns matrix as a string.
ccGLMatrixTpl< T > transposed() const
Returns transposed matrix.
T * data()
Returns a pointer to internal data.
void setTranslation(const Vector3Tpl< float > &Tr)
Sets translation (float version)
void initFromParameters(T alpha_rad, const Vector3Tpl< T > &axis3D, const Vector3Tpl< T > &t3D)
Inits transformation from a rotation axis, an angle and a translation.
void getParameters(T &alpha_rad, Vector3Tpl< T > &axis3D, Vector3Tpl< T > &t3D) const
Float version of ccGLMatrixTpl.
Double version of ccGLMatrixTpl.
Hierarchical CLOUDVIEWER Object.
void detachChild(ccHObject *child)
Detaches a specific child.
bool isAncestorOf(const ccHObject *anObject) const
Returns true if the current object is an ancestor of the specified one.
void applyGLTransformation_recursive(const ccGLMatrix *trans=nullptr)
Applies the active OpenGL transformation to the entity (recursive)
unsigned getChildrenNumber() const
Returns the number of children.
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
void setRedrawFlagRecursive(bool redraw=false)
ccHObject * getParent() const
Returns parent object.
void detachAllChildren()
Removes a specific child.
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
ccHObject * getChild(unsigned childPos) const
Returns the ith child.
void transformTriNormals(const ccGLMatrix &trans)
Transforms the mesh per-triangle normals.
bool hasTriNormals() const override
Returns whether the mesh has per-triangle normals.
virtual bool isLocked() const
Returns whether the object is locked or not.
virtual QString getName() const
Returns object name.
virtual unsigned getUniqueID() const
Returns object unique ID.
bool isA(CV_CLASS_ENUM type) const
virtual void setEnabled(bool state)
Sets the "enabled" property.
bool isKindOf(CV_CLASS_ENUM type) const
Generic overlay dialog interface.
void shortcutTriggered(int key)
Signal emitted when an overridden key shortcut is pressed.
virtual void stop(bool accepted)
Stops process/dialog.
virtual bool start()
Starts process.
bool m_processing
Running/processing state.
virtual bool linkWith(QWidget *win)
Links the overlay dialog with a MDI window.
void addOverridenShortcut(Qt::Key key)
Backup "context" for an object.