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

// fixed logic problems

This commit is contained in:
dpasukhi
2023-05-28 20:11:07 +01:00
committed by oan
parent 514c451b3a
commit ccb708b8d3
11 changed files with 102 additions and 72 deletions

View File

@@ -43,33 +43,32 @@ XCAFAnimObjects_Transform::XCAFAnimObjects_Transform(const NCollection_Array1<NC
XCAFAnimObjects_Transform::XCAFAnimObjects_Transform(const NCollection_Array2<double>& theGeneralPresentation,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myTransformPresentation(1, theGeneralPresentation.RowLength())
myTransformPresentation(1, theGeneralPresentation.NbRows())
{
if (theGeneralPresentation.ColLength() != 16)
if (theGeneralPresentation.NbColumns() != 16)
{
Message::SendWarning() << "Warning: XCAFAnimObjects_Transform: Incorrect Mat4x4 general presentation";
return;
}
for (int aRowInd = 1; aRowInd <= theGeneralPresentation.RowLength(); aRowInd++)
for (int aRowInd = 1; aRowInd <= theGeneralPresentation.NbRows(); aRowInd++)
{
NCollection_Mat4<double> aTransform;
aTransform.SetRow(1, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 1),
aTransform.SetRow(0, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 1),
theGeneralPresentation.Value(aRowInd, 2),
theGeneralPresentation.Value(aRowInd, 3),
theGeneralPresentation.Value(aRowInd, 4)));
aTransform.SetRow(2, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 5),
aTransform.SetRow(1, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 5),
theGeneralPresentation.Value(aRowInd, 6),
theGeneralPresentation.Value(aRowInd, 7),
theGeneralPresentation.Value(aRowInd, 8)));
aTransform.SetRow(3, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 9),
aTransform.SetRow(2, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 9),
theGeneralPresentation.Value(aRowInd, 10),
theGeneralPresentation.Value(aRowInd, 11),
theGeneralPresentation.Value(aRowInd, 12)));
aTransform.SetRow(4, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 13),
aTransform.SetRow(3, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 13),
theGeneralPresentation.Value(aRowInd, 14),
theGeneralPresentation.Value(aRowInd, 15),
theGeneralPresentation.Value(aRowInd, 16)));
myTransformPresentation.SetValue(aRowInd, aTransform);
}
}
@@ -94,22 +93,22 @@ NCollection_Array2<double> XCAFAnimObjects_Transform::GeneralPresentation() cons
{
const NCollection_Mat4<double>& aTransform = myTransformPresentation.Value(aRowInd);
aRes.SetValue(aRowInd, 1, aTransform.GetValue(1, 1));
aRes.SetValue(aRowInd, 2, aTransform.GetValue(1, 2));
aRes.SetValue(aRowInd, 3, aTransform.GetValue(1, 3));
aRes.SetValue(aRowInd, 4, aTransform.GetValue(1, 4));
aRes.SetValue(aRowInd, 5, aTransform.GetValue(2, 1));
aRes.SetValue(aRowInd, 6, aTransform.GetValue(2, 2));
aRes.SetValue(aRowInd, 7, aTransform.GetValue(2, 3));
aRes.SetValue(aRowInd, 8, aTransform.GetValue(2, 4));
aRes.SetValue(aRowInd, 9, aTransform.GetValue(3, 1));
aRes.SetValue(aRowInd, 10, aTransform.GetValue(3, 2));
aRes.SetValue(aRowInd, 11, aTransform.GetValue(3, 3));
aRes.SetValue(aRowInd, 12, aTransform.GetValue(3, 4));
aRes.SetValue(aRowInd, 13, aTransform.GetValue(4, 1));
aRes.SetValue(aRowInd, 14, aTransform.GetValue(4, 2));
aRes.SetValue(aRowInd, 15, aTransform.GetValue(4, 3));
aRes.SetValue(aRowInd, 16, aTransform.GetValue(4, 4));
aRes.SetValue(aRowInd, 1, aTransform.GetValue(0, 0));
aRes.SetValue(aRowInd, 2, aTransform.GetValue(0, 1));
aRes.SetValue(aRowInd, 3, aTransform.GetValue(0, 2));
aRes.SetValue(aRowInd, 4, aTransform.GetValue(0, 3));
aRes.SetValue(aRowInd, 5, aTransform.GetValue(1, 0));
aRes.SetValue(aRowInd, 6, aTransform.GetValue(1, 1));
aRes.SetValue(aRowInd, 7, aTransform.GetValue(1, 2));
aRes.SetValue(aRowInd, 8, aTransform.GetValue(1, 3));
aRes.SetValue(aRowInd, 9, aTransform.GetValue(2, 0));
aRes.SetValue(aRowInd, 10, aTransform.GetValue(2, 1));
aRes.SetValue(aRowInd, 11, aTransform.GetValue(2, 2));
aRes.SetValue(aRowInd, 12, aTransform.GetValue(2, 3));
aRes.SetValue(aRowInd, 13, aTransform.GetValue(3, 0));
aRes.SetValue(aRowInd, 14, aTransform.GetValue(3, 1));
aRes.SetValue(aRowInd, 15, aTransform.GetValue(3, 2));
aRes.SetValue(aRowInd, 16, aTransform.GetValue(3, 3));
}
return aRes;
}