1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0031548: Visualization, SelectBasics_PickResult - include surface normal into picking details

SelectMgr_SortCriterion::Normal, SelectBasics_PickResult::SurfaceNormal() - added new property.
SelectMgr_RectangularFrustum::Overlaps() for triangle sets new normal property.
gp_GTrsf::GetMat4() - added conversion into NCollection_Mat4 similar to gp_Trsf::GetMat4().
This commit is contained in:
kgv
2020-05-05 01:23:41 +03:00
committed by bugmaster
parent 23fe70ec52
commit 2615c2d705
6 changed files with 85 additions and 22 deletions

View File

@@ -244,28 +244,44 @@ public:
gp_Trsf Trsf() const;
//! Convert transformation to 4x4 matrix.
template<class T>
void GetMat4 (NCollection_Mat4<T>& theMat) const
{
if (shape == gp_Identity)
{
theMat.InitIdentity();
return;
}
theMat.SetValue (0, 0, static_cast<T> (Value (1, 1)));
theMat.SetValue (0, 1, static_cast<T> (Value (1, 2)));
theMat.SetValue (0, 2, static_cast<T> (Value (1, 3)));
theMat.SetValue (0, 3, static_cast<T> (Value (1, 4)));
theMat.SetValue (1, 0, static_cast<T> (Value (2, 1)));
theMat.SetValue (1, 1, static_cast<T> (Value (2, 2)));
theMat.SetValue (1, 2, static_cast<T> (Value (2, 3)));
theMat.SetValue (1, 3, static_cast<T> (Value (2, 4)));
theMat.SetValue (2, 0, static_cast<T> (Value (3, 1)));
theMat.SetValue (2, 1, static_cast<T> (Value (3, 2)));
theMat.SetValue (2, 2, static_cast<T> (Value (3, 3)));
theMat.SetValue (2, 3, static_cast<T> (Value (3, 4)));
theMat.SetValue (3, 0, static_cast<T> (0));
theMat.SetValue (3, 1, static_cast<T> (0));
theMat.SetValue (3, 2, static_cast<T> (0));
theMat.SetValue (3, 3, static_cast<T> (1));
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
private:
gp_Mat matrix;
gp_XYZ loc;
gp_TrsfForm shape;
Standard_Real scale;
};