Base: apply clang format

This commit is contained in:
wmayer
2023-11-10 18:27:44 +01:00
committed by WandererFan
parent bb333d9a74
commit 985def3416
154 changed files with 11874 additions and 9872 deletions

View File

@@ -36,7 +36,7 @@ bool ViewProjMethod::isValid() const
/*! Calculate the composed projection matrix which is a product of
* projection matrix multiplied with input transformation matrix.
*/
Matrix4D ViewProjMethod::getComposedProjectionMatrix () const
Matrix4D ViewProjMethod::getComposedProjectionMatrix() const
{
Matrix4D mat = getProjectionMatrix();
@@ -77,8 +77,8 @@ void ViewProjMethod::transformInput(const Base::Vector3d& src, Base::Vector3d& d
//-----------------------------------------------------------------------------
ViewProjMatrix::ViewProjMatrix (const Matrix4D &rclMtx)
: _clMtx(rclMtx)
ViewProjMatrix::ViewProjMatrix(const Matrix4D& rclMtx)
: _clMtx(rclMtx)
{
double m30 = _clMtx[3][0];
double m31 = _clMtx[3][1];
@@ -101,7 +101,7 @@ ViewProjMatrix::ViewProjMatrix (const Matrix4D &rclMtx)
_clMtxInv.inverseGauss();
}
Matrix4D ViewProjMatrix::getProjectionMatrix () const
Matrix4D ViewProjMatrix::getProjectionMatrix() const
{
// Return the same matrix as passed to the constructor
Matrix4D mat(_clMtx);
@@ -120,9 +120,8 @@ void perspectiveTransform(const Base::Matrix4D& mat, Vec& pnt)
double m31 = mat[3][1];
double m32 = mat[3][2];
double m33 = mat[3][3];
double w = (static_cast<double>(pnt.x) * m30 +
static_cast<double>(pnt.y) * m31 +
static_cast<double>(pnt.z) * m32 + m33);
double w = (static_cast<double>(pnt.x) * m30 + static_cast<double>(pnt.y) * m31
+ static_cast<double>(pnt.z) * m32 + m33);
mat.multVec(pnt, pnt);
pnt /= static_cast<typename Vec::num_type>(w);
@@ -137,7 +136,7 @@ Vector3f ViewProjMatrix::operator()(const Vector3f& inp) const
if (!isOrthographic) {
dst = src;
perspectiveTransform<Vector3f>(_clMtx, dst);
dst.Set(0.5f*dst.x+0.5f, 0.5f*dst.y+0.5f, 0.5f*dst.z+0.5f);
dst.Set(0.5f * dst.x + 0.5f, 0.5f * dst.y + 0.5f, 0.5f * dst.z + 0.5f);
}
else {
_clMtx.multVec(src, dst);
@@ -155,7 +154,7 @@ Vector3d ViewProjMatrix::operator()(const Vector3d& inp) const
if (!isOrthographic) {
dst = src;
perspectiveTransform<Vector3d>(_clMtx, dst);
dst.Set(0.5*dst.x+0.5, 0.5*dst.y+0.5, 0.5*dst.z+0.5);
dst.Set(0.5 * dst.x + 0.5, 0.5 * dst.y + 0.5, 0.5 * dst.z + 0.5);
}
else {
_clMtx.multVec(src, dst);
@@ -164,11 +163,11 @@ Vector3d ViewProjMatrix::operator()(const Vector3d& inp) const
return dst;
}
Vector3f ViewProjMatrix::inverse (const Vector3f& src) const
Vector3f ViewProjMatrix::inverse(const Vector3f& src) const
{
Vector3f dst;
if (!isOrthographic) {
dst.Set(2.0f*src.x-1.0f, 2.0f*src.y-1.0f, 2.0f*src.z-1.0f);
dst.Set(2.0f * src.x - 1.0f, 2.0f * src.y - 1.0f, 2.0f * src.z - 1.0f);
perspectiveTransform<Vector3f>(_clMtxInv, dst);
}
else {
@@ -178,11 +177,11 @@ Vector3f ViewProjMatrix::inverse (const Vector3f& src) const
return dst;
}
Vector3d ViewProjMatrix::inverse (const Vector3d& src) const
Vector3d ViewProjMatrix::inverse(const Vector3d& src) const
{
Vector3d dst;
if (!isOrthographic) {
dst.Set(2.0*src.x-1.0, 2.0*src.y-1.0, 2.0*src.z-1.0);
dst.Set(2.0 * src.x - 1.0, 2.0 * src.y - 1.0, 2.0 * src.z - 1.0);
perspectiveTransform<Vector3d>(_clMtxInv, dst);
}
else {
@@ -194,34 +193,34 @@ Vector3d ViewProjMatrix::inverse (const Vector3d& src) const
// ----------------------------------------------------------------------------
ViewOrthoProjMatrix::ViewOrthoProjMatrix (const Matrix4D &rclMtx)
ViewOrthoProjMatrix::ViewOrthoProjMatrix(const Matrix4D& rclMtx)
: _clMtx(rclMtx)
, _clMtxInv(rclMtx)
{
_clMtxInv = _clMtx;
_clMtxInv.inverse();
}
Matrix4D ViewOrthoProjMatrix::getProjectionMatrix () const
Matrix4D ViewOrthoProjMatrix::getProjectionMatrix() const
{
return _clMtx;
}
Vector3f ViewOrthoProjMatrix::operator()(const Vector3f &rclPt) const
Vector3f ViewOrthoProjMatrix::operator()(const Vector3f& rclPt) const
{
return Vector3f(_clMtx * rclPt);
}
Vector3d ViewOrthoProjMatrix::operator()(const Vector3d &rclPt) const
Vector3d ViewOrthoProjMatrix::operator()(const Vector3d& rclPt) const
{
return Vector3d(_clMtx * rclPt);
}
Vector3f ViewOrthoProjMatrix::inverse (const Vector3f &rclPt) const
Vector3f ViewOrthoProjMatrix::inverse(const Vector3f& rclPt) const
{
return Vector3f(_clMtxInv * rclPt);
}
Vector3d ViewOrthoProjMatrix::inverse (const Vector3d &rclPt) const
Vector3d ViewOrthoProjMatrix::inverse(const Vector3d& rclPt) const
{
return Vector3d(_clMtxInv * rclPt);
}