mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024288: Provide flipping text for AIS_Dimensions
- OpenGl_Flipper class added to provide text flipping. - Added Graphic3d_Mat4, OpenGl_Mat4 definitions for use with TKOpenGl matrix types. - Added flipping parameters for dimensions with 3D text labels at AIS_Dimension class. - Test cases.
This commit is contained in:
@@ -16,11 +16,6 @@
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License
|
||||
//
|
||||
// The code was inspired by "sView" project by
|
||||
// Kirill GAVRILOV: https://github.com/gkv311/sview.
|
||||
// Files: StGLMatrix.hxx, StGLMatrix.cxx.
|
||||
// Copyright (c) 2010-2013 Kirill Gavrilov <kirill@sview.ru>
|
||||
|
||||
#ifndef _NCollection_Mat4_HeaderFile
|
||||
#define _NCollection_Mat4_HeaderFile
|
||||
@@ -210,9 +205,10 @@ public:
|
||||
}
|
||||
|
||||
//! Raw access to the data (for OpenGL exchange).
|
||||
const Element_t* GetData() const { return myMat; }
|
||||
operator const Element_t*() const { return myMat; }
|
||||
operator Element_t*() { return myMat; }
|
||||
const Element_t* GetData() const { return myMat; }
|
||||
Element_t* ChangeData() { return myMat; }
|
||||
operator const Element_t*() const { return myMat; }
|
||||
operator Element_t*() { return myMat; }
|
||||
|
||||
//! Multiply by the vector (M * V).
|
||||
//! @param theVec [in] the vector to multiply.
|
||||
@@ -267,7 +263,7 @@ public:
|
||||
//! @return result of multiplication.
|
||||
NCollection_Mat4 operator* (const NCollection_Mat4& theMat) const
|
||||
{
|
||||
return Mutiplied (theMat);
|
||||
return Multiplied (theMat);
|
||||
}
|
||||
|
||||
//! Compute matrix multiplication product.
|
||||
@@ -325,6 +321,24 @@ public:
|
||||
this->Multiply (aTempMat);
|
||||
}
|
||||
|
||||
//! Transpose the matrix.
|
||||
//! @return transposed copy of the matrix.
|
||||
NCollection_Mat4 Transposed() const
|
||||
{
|
||||
NCollection_Mat4 aTempMat;
|
||||
aTempMat.SetRow (0, GetColumn (0));
|
||||
aTempMat.SetRow (1, GetColumn (1));
|
||||
aTempMat.SetRow (2, GetColumn (2));
|
||||
aTempMat.SetRow (3, GetColumn (3));
|
||||
return aTempMat;
|
||||
}
|
||||
|
||||
//! Transpose the matrix.
|
||||
void Transpose()
|
||||
{
|
||||
*this = Transposed();
|
||||
}
|
||||
|
||||
//! Compute inverted matrix.
|
||||
//! @param theOutMx [out] the inverted matrix.
|
||||
//! @return true if reversion success.
|
||||
@@ -421,4 +435,4 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#endif // _NCollection_Matrix_H__
|
||||
#endif // _NCollection_Mat4_HeaderFile
|
||||
|
@@ -91,10 +91,11 @@ public:
|
||||
//! Alias to 2nd component as Y coordinate in XY.
|
||||
Element_t& y() { return v[1]; }
|
||||
|
||||
//! Raw access to the data (to simplify OpenGL exchange).
|
||||
const Element_t* GetData() const { return v; }
|
||||
operator const Element_t*() const { return v; }
|
||||
operator Element_t*() { return v; }
|
||||
//! Raw access to the data (for OpenGL exchange).
|
||||
const Element_t* GetData() const { return v; }
|
||||
Element_t* ChangeData() { return v; }
|
||||
operator const Element_t*() const { return v; }
|
||||
operator Element_t*() { return v; }
|
||||
|
||||
//! Compute per-component summary.
|
||||
NCollection_Vec2& operator+= (const NCollection_Vec2& theAdd)
|
||||
|
@@ -147,9 +147,10 @@ public:
|
||||
}
|
||||
|
||||
//! Raw access to the data (for OpenGL exchange).
|
||||
const Element_t* GetData() const { return v; }
|
||||
operator const Element_t*() const { return v; }
|
||||
operator Element_t*() { return v; }
|
||||
const Element_t* GetData() const { return v; }
|
||||
Element_t* ChangeData() { return v; }
|
||||
operator const Element_t*() const { return v; }
|
||||
operator Element_t*() { return v; }
|
||||
|
||||
//! Compute per-component summary.
|
||||
NCollection_Vec3& operator+= (const NCollection_Vec3& theAdd)
|
||||
|
@@ -193,9 +193,10 @@ public:
|
||||
}
|
||||
|
||||
//! Raw access to the data (for OpenGL exchange).
|
||||
const Element_t* GetData() const { return v; }
|
||||
operator const Element_t*() const { return v; }
|
||||
operator Element_t*() { return v; }
|
||||
const Element_t* GetData() const { return v; }
|
||||
Element_t* ChangeData() { return v; }
|
||||
operator const Element_t*() const { return v; }
|
||||
operator Element_t*() { return v; }
|
||||
|
||||
//! Compute per-component summary.
|
||||
NCollection_Vec4& operator+= (const NCollection_Vec4& theAdd)
|
||||
|
Reference in New Issue
Block a user