code format

This commit is contained in:
2022-12-14 14:14:44 +03:00
parent 1dfca0aeab
commit cb944b62e4
85 changed files with 4451 additions and 3744 deletions

View File

@@ -1,19 +1,19 @@
/*
QGL Transform
Ivan Pelipenko peri4ko@yandex.ru
QGL Transform
Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GLTRANSFORM_H
@@ -26,10 +26,11 @@
class Transform {
friend QDataStream & operator >>(QDataStream & s, Transform & v);
friend QDataStream & operator>>(QDataStream & s, Transform & v);
public:
Transform();
Transform & operator =(const Transform & t);
Transform & operator=(const Transform & t);
float scale() const;
QVector3D scale3D() const;
@@ -45,7 +46,7 @@ public:
float rotationY() const;
float rotationZ() const;
void setScale(float s) {setScale(QVector3D(s, s, s));}
void setScale(float s) { setScale(QVector3D(s, s, s)); }
void setScale(const QVector3D & s);
void setScaleX(float s);
void setScaleY(float s);
@@ -62,17 +63,15 @@ public:
void setTranslationZ(float t);
void setMatrix(const QMatrix4x4 & matrix);
void setDirty(bool yes = true) {m_matrixDirty = yes;}
void setDirty(bool yes = true) { m_matrixDirty = yes; }
static QQuaternion fromAxisAndAngle(const QVector3D & axis, float angle);
static QQuaternion fromAxisAndAngle(float x, float y, float z, float angle);
static QQuaternion fromAxesAndAngles(const QVector3D & axis1, float angle1,
const QVector3D & axis2, float angle2);
static QQuaternion fromAxesAndAngles(const QVector3D & axis1, float angle1,
const QVector3D & axis2, float angle2,
const QVector3D & axis3, float angle3);
static QQuaternion fromAxesAndAngles(const QVector3D & axis1, float angle1, const QVector3D & axis2, float angle2);
static QQuaternion
fromAxesAndAngles(const QVector3D & axis1, float angle1, const QVector3D & axis2, float angle2, const QVector3D & axis3, float angle3);
static QQuaternion fromAxes(const QVector3D & xAxis, const QVector3D & yAxis, const QVector3D & zAxis);
static QVector3D fromDirection(QVector3D d, float pitch = 0.f);
@@ -91,14 +90,14 @@ protected:
mutable QMatrix4x4 m_matrix, m_matrixWT, m_matrixR, m_matrixS;
mutable bool m_matrixDirty;
};
inline QDataStream & operator <<(QDataStream & s, const Transform & v) {
s << v.matrix(); return s;
inline QDataStream & operator<<(QDataStream & s, const Transform & v) {
s << v.matrix();
return s;
}
inline QDataStream & operator >>(QDataStream & s, Transform & v) {
inline QDataStream & operator>>(QDataStream & s, Transform & v) {
QMatrix4x4 m;
s >> m;
v.setMatrix(m);