1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 // JCV 30/08/90 Modif passage version C++ 2.0 sur Sun
16 // JCV 1/10/90 Changement de nom du package vgeom -> gp
17 // JCV 4/10/90 codage sur la forme de la transformation shape,Scaling,negative
18 // JCV 10/12/90 Modif introduction des classes Mat et XYZ dans gp
20 #define No_Standard_OutOfRange
22 #include <gp_Trsf.hxx>
28 #include <gp_GTrsf.hxx>
31 #include <gp_Quaternion.hxx>
32 #include <gp_Trsf2d.hxx>
35 #include <Standard_ConstructionError.hxx>
36 #include <Standard_OutOfRange.hxx>
37 #include <Standard_Dump.hxx>
39 //=======================================================================
41 //purpose : Constructor from 2d
42 //=======================================================================
43 gp_Trsf::gp_Trsf (const gp_Trsf2d& T) :
44 scale(T.ScaleFactor()),
46 loc(T.TranslationPart().X(),T.TranslationPart().Y(), 0.0)
48 const gp_Mat2d& M = T.HVectorialPart();
54 if (shape == gp_Ax1Mirror)
61 //=======================================================================
62 //function : SetMirror
64 //=======================================================================
66 void gp_Trsf::SetMirror (const gp_Ax1& A1)
70 loc = A1.Location().XYZ();
71 matrix.SetDot(A1.Direction().XYZ());
73 matrix.SetDiagonal (matrix.Value (1,1) + 1,
74 matrix.Value (2,2) + 1,
75 matrix.Value (3,3) + 1);
77 loc.Multiply (matrix);
78 loc.Add (A1.Location().XYZ());
82 //=======================================================================
83 //function : SetMirror
85 //=======================================================================
87 void gp_Trsf::SetMirror (const gp_Ax2& A2)
91 loc = A2.Location().XYZ();
92 matrix.SetDot(A2.Direction().XYZ());
94 matrix.SetDiagonal (matrix.Value (1,1) - 1,
95 matrix.Value (2,2) - 1,
96 matrix.Value (3,3) - 1);
98 loc.Multiply (matrix);
99 loc.Add (A2.Location().XYZ());
102 //=======================================================================
103 //function : SetRotation
105 //=======================================================================
107 void gp_Trsf::SetRotation (const gp_Ax1& A1,
108 const Standard_Real Ang)
112 loc = A1.Location().XYZ();
113 matrix.SetRotation (A1.Direction().XYZ(), Ang);
115 loc.Multiply (matrix);
116 loc.Add (A1.Location().XYZ());
119 //=======================================================================
120 //function : SetRotation
122 //=======================================================================
124 void gp_Trsf::SetRotation (const gp_Quaternion& R)
128 loc.SetCoord (0., 0., 0.);
129 matrix = R.GetMatrix();
132 //=======================================================================
133 //function : SetRotationPart
135 //=======================================================================
136 void gp_Trsf::SetRotationPart (const gp_Quaternion& theR)
138 const bool hasRotation = !theR.IsEqual (gp_Quaternion());
141 matrix = theR.GetMatrix();
145 matrix.SetIdentity();
171 case gp_CompoundTrsf:
176 shape = gp_CompoundTrsf;
183 //=======================================================================
184 //function : SetScale
186 //=======================================================================
188 void gp_Trsf::SetScale (const gp_Pnt& P, const Standard_Real S)
193 Standard_Real As = scale;
194 if (As < 0) As = - As;
195 Standard_ConstructionError_Raise_if
196 (As <= gp::Resolution(),"gp_Trsf::SetScaleFactor");
197 matrix.SetIdentity ();
201 //=======================================================================
202 //function : SetTransformation
204 //=======================================================================
206 void gp_Trsf::SetTransformation (const gp_Ax3& FromA1,
209 shape = gp_CompoundTrsf;
211 // matrix from XOY ToA2 :
212 matrix.SetRows (ToA2.XDirection().XYZ(),
213 ToA2.YDirection().XYZ(),
214 ToA2. Direction().XYZ());
215 loc = ToA2.Location().XYZ();
216 loc.Multiply (matrix);
219 // matrix FromA1 to XOY :
220 const gp_XYZ& xDir = FromA1.XDirection().XYZ();
221 const gp_XYZ& yDir = FromA1.YDirection().XYZ();
222 const gp_XYZ& zDir = FromA1.Direction().XYZ();
224 gp_Mat MA1 (xDir, yDir, zDir);
225 gp_XYZ MA1loc = FromA1.Location().XYZ();
227 // matrix * MA1 => FromA1 ToA2 :
228 MA1loc.Multiply (matrix);
230 matrix.Multiply (MA1);
233 void gp_Trsf::SetTransformation (const gp_Ax3& A3)
235 shape = gp_CompoundTrsf;
237 matrix.SetRows (A3.XDirection().XYZ(),
238 A3.YDirection().XYZ(),
239 A3. Direction().XYZ());
240 loc = A3.Location().XYZ();
241 loc.Multiply (matrix);
245 //=======================================================================
246 //function : SetTransformation
248 //=======================================================================
250 void gp_Trsf::SetTransformation (const gp_Quaternion& R, const gp_Vec& T)
252 shape = gp_CompoundTrsf;
255 matrix = R.GetMatrix();
258 //=======================================================================
259 //function : SetDisplacement
261 //=======================================================================
263 void gp_Trsf::SetDisplacement (const gp_Ax3& FromA1,
266 shape = gp_CompoundTrsf;
268 // matrix from ToA2 to XOY :
269 matrix.SetCol (1, ToA2.XDirection().XYZ());
270 matrix.SetCol (2, ToA2.YDirection().XYZ());
271 matrix.SetCol (3, ToA2.Direction().XYZ());
272 loc = ToA2.Location().XYZ();
273 // matrix XOY to FromA1 :
274 const gp_XYZ& xDir = FromA1.XDirection().XYZ();
275 const gp_XYZ& yDir = FromA1.YDirection().XYZ();
276 const gp_XYZ& zDir = FromA1.Direction().XYZ();
277 gp_Mat MA1 (xDir, yDir, zDir);
279 gp_XYZ MA1loc = FromA1.Location().XYZ();
280 MA1loc.Multiply (MA1);
283 MA1loc.Multiply (matrix);
285 matrix.Multiply (MA1);
288 //=======================================================================
289 //function : SetTranslationPart
291 //=======================================================================
293 void gp_Trsf::SetTranslationPart (const gp_Vec& V) {
296 const Standard_Boolean locnull = (loc.SquareModulus() < gp::Resolution());
301 if (!locnull) shape = gp_Translation;
304 case gp_Translation :
305 if (locnull) shape = gp_Identity;
313 case gp_CompoundTrsf :
316 shape = gp_CompoundTrsf;
322 //=======================================================================
323 //function : SetScaleFactor
325 //=======================================================================
327 void gp_Trsf::SetScaleFactor (const Standard_Real S)
329 Standard_Real As = S;
330 if (As < 0) As = - As;
331 Standard_ConstructionError_Raise_if
332 (As <= gp::Resolution(),"gp_Trsf::SetScaleFactor");
335 if (As < 0) As = - As;
336 Standard_Boolean unit = As <= gp::Resolution(); // = (scale == 1)
338 if (As < 0) As = - As;
339 Standard_Boolean munit = As <= gp::Resolution(); // = (scale == -1)
343 case gp_Translation :
344 if (!unit) shape = gp_Scale;
345 if (munit) shape = gp_PntMirror;
348 if (!unit) shape = gp_CompoundTrsf;
353 if (!munit) shape = gp_Scale;
354 if (unit) shape = gp_Identity;
357 if (unit) shape = gp_Identity;
358 if (munit) shape = gp_PntMirror;
360 case gp_CompoundTrsf :
367 //=======================================================================
368 //function : SetValues
370 // 06-01-1998 modified by PMN : On utilise TolDist pour evaluer si les coeffs
371 // sont nuls : c'est toujours mieux que gp::Resolution !
372 //=======================================================================
374 void gp_Trsf::SetValues(const Standard_Real a11,
375 const Standard_Real a12,
376 const Standard_Real a13,
377 const Standard_Real a14,
378 const Standard_Real a21,
379 const Standard_Real a22,
380 const Standard_Real a23,
381 const Standard_Real a24,
382 const Standard_Real a31,
383 const Standard_Real a32,
384 const Standard_Real a33,
385 const Standard_Real a34)
387 gp_XYZ col1(a11,a21,a31);
388 gp_XYZ col2(a12,a22,a32);
389 gp_XYZ col3(a13,a23,a33);
390 gp_XYZ col4(a14,a24,a34);
391 // compute the determinant
392 gp_Mat M(col1,col2,col3);
393 Standard_Real s = M.Determinant();
394 Standard_Real As = s;
395 if (As < 0) As = - As;
396 Standard_ConstructionError_Raise_if
397 (As < gp::Resolution(),"gp_Trsf::SetValues, null determinant");
405 shape = gp_CompoundTrsf;
413 //=======================================================================
414 //function : GetRotation
416 //=======================================================================
418 gp_Quaternion gp_Trsf::GetRotation () const
420 return gp_Quaternion (matrix);
423 //=======================================================================
424 //function : VectorialPart
426 //=======================================================================
428 gp_Mat gp_Trsf::VectorialPart () const
430 if (scale == 1.0) return matrix;
432 if (shape == gp_Scale || shape == gp_PntMirror)
433 M.SetDiagonal(scale*M.Value(1,1),
441 //=======================================================================
444 //=======================================================================
446 void gp_Trsf::Invert()
449 // X' = scale * R * X + T => X = (R / scale) * ( X' - T)
451 // Pour les gp_Trsf puisque le scale est extrait de la gp_Matrice R
452 // on a toujours determinant (R) = 1 et R-1 = R transposee.
453 if (shape == gp_Identity) { }
454 else if (shape == gp_Translation || shape == gp_PntMirror) loc.Reverse();
455 else if (shape == gp_Scale) {
456 Standard_ConstructionError_Raise_if (Abs(scale) <= gp::Resolution(), "gp_Trsf::Invert() - transformation has zero scale");
458 loc.Multiply (-scale);
461 Standard_ConstructionError_Raise_if (Abs(scale) <= gp::Resolution(), "gp_Trsf::Invert() - transformation has zero scale");
464 loc.Multiply (matrix);
465 loc.Multiply (-scale);
469 //=======================================================================
470 //function : Multiply
472 //=======================================================================
474 void gp_Trsf::Multiply(const gp_Trsf& T)
476 if (T.shape == gp_Identity) { }
477 else if (shape == gp_Identity) {
483 else if (shape == gp_Rotation && T.shape == gp_Rotation) {
484 if (T.loc.X() != 0.0 || T.loc.Y() != 0.0 || T.loc.Z() != 0.0) {
485 loc.Add (T.loc.Multiplied (matrix));
487 matrix.Multiply(T.matrix);
489 else if (shape == gp_Translation && T.shape == gp_Translation) {
492 else if (shape == gp_Scale && T.shape == gp_Scale) {
493 loc.Add (T.loc.Multiplied(scale));
494 scale = scale * T.scale;
496 else if (shape == gp_PntMirror && T.shape == gp_PntMirror) {
498 shape = gp_Translation;
499 loc.Add (T.loc.Reversed());
501 else if (shape == gp_Ax1Mirror && T.shape == gp_Ax1Mirror) {
503 loc.Add (T.loc.Multiplied (matrix));
504 matrix.Multiply(T.matrix);
506 else if ((shape == gp_CompoundTrsf || shape == gp_Rotation ||
507 shape == gp_Ax1Mirror || shape == gp_Ax2Mirror)
508 && T.shape == gp_Translation) {
510 Tloc.Multiply(matrix);
511 if (scale != 1.0) { Tloc.Multiply(scale); }
514 else if ((shape == gp_Scale || shape == gp_PntMirror)
515 && T.shape == gp_Translation) {
517 Tloc.Multiply (scale);
520 else if (shape == gp_Translation &&
521 (T.shape == gp_CompoundTrsf || T.shape == gp_Rotation ||
522 T.shape == gp_Ax1Mirror || T.shape == gp_Ax2Mirror)) {
523 shape = gp_CompoundTrsf;
528 else if (shape == gp_Translation &&
529 (T.shape == gp_Scale || T.shape == gp_PntMirror)) {
534 else if ((shape == gp_PntMirror || shape == gp_Scale) &&
535 (T.shape == gp_PntMirror || T.shape == gp_Scale)) {
536 shape = gp_CompoundTrsf;
538 Tloc.Multiply (scale);
540 scale = scale * T.scale;
542 else if ((shape == gp_CompoundTrsf || shape == gp_Rotation ||
543 shape == gp_Ax1Mirror || shape == gp_Ax2Mirror)
544 && (T.shape == gp_Scale || T.shape == gp_PntMirror)) {
545 shape = gp_CompoundTrsf;
549 Tloc.Multiply(matrix);
552 Tloc.Multiply (matrix);
553 Tloc.Multiply (scale);
554 scale = scale * T.scale;
558 else if ((T.shape == gp_CompoundTrsf || T.shape == gp_Rotation ||
559 T.shape == gp_Ax1Mirror || T.shape == gp_Ax2Mirror)
560 && (shape == gp_Scale || shape == gp_PntMirror)) {
561 shape = gp_CompoundTrsf;
563 Tloc.Multiply(scale);
565 scale = scale * T.scale;
569 shape = gp_CompoundTrsf;
571 Tloc.Multiply (matrix);
573 Tloc.Multiply (scale);
574 scale = scale * T.scale;
576 else { scale = T.scale; }
578 matrix.Multiply(T.matrix);
582 //=======================================================================
585 //=======================================================================
587 void gp_Trsf::Power (const Standard_Integer N)
589 if (shape == gp_Identity) { }
594 matrix.SetIdentity();
595 loc = gp_XYZ (0.0, 0.0, 0.0);
598 else if (N == -1) { Invert(); }
600 if (N < 0) { Invert(); }
601 if (shape == gp_Translation) {
602 Standard_Integer Npower = N;
603 if (Npower < 0) Npower = - Npower;
605 gp_XYZ Temploc = loc;
607 if (IsOdd(Npower)) loc.Add (Temploc);
608 if (Npower == 1) break;
609 Temploc.Add (Temploc);
613 else if (shape == gp_Scale) {
614 Standard_Integer Npower = N;
615 if (Npower < 0) Npower = - Npower;
617 gp_XYZ Temploc = loc;
618 Standard_Real Tempscale = scale;
621 loc.Add (Temploc.Multiplied(scale));
622 scale = scale * Tempscale;
624 if (Npower == 1) break;
625 Temploc.Add (Temploc.Multiplied(Tempscale));
626 Tempscale = Tempscale * Tempscale;
630 else if (shape == gp_Rotation) {
631 Standard_Integer Npower = N;
632 if (Npower < 0) Npower = - Npower;
634 gp_Mat Tempmatrix (matrix);
635 if (loc.X() == 0.0 && loc.Y() == 0.0 && loc.Z() == 0.0) {
637 if (IsOdd(Npower)) matrix.Multiply (Tempmatrix);
638 if (Npower == 1) break;
639 Tempmatrix.Multiply (Tempmatrix);
644 gp_XYZ Temploc = loc;
647 loc.Add (Temploc.Multiplied (matrix));
648 matrix.Multiply (Tempmatrix);
650 if (Npower == 1) break;
651 Temploc.Add (Temploc.Multiplied (Tempmatrix));
652 Tempmatrix.Multiply (Tempmatrix);
657 else if (shape == gp_PntMirror || shape == gp_Ax1Mirror ||
658 shape == gp_Ax2Mirror) {
662 matrix.SetIdentity ();
669 shape = gp_CompoundTrsf;
670 Standard_Integer Npower = N;
671 if (Npower < 0) Npower = - Npower;
673 gp_XYZ Temploc = loc;
674 Standard_Real Tempscale = scale;
675 gp_Mat Tempmatrix (matrix);
678 loc.Add ((Temploc.Multiplied (matrix)).Multiplied (scale));
679 scale = scale * Tempscale;
680 matrix.Multiply (Tempmatrix);
682 if (Npower == 1) break;
683 Tempscale = Tempscale * Tempscale;
684 Temploc.Add ( (Temploc.Multiplied (Tempmatrix)).Multiplied
687 Tempmatrix.Multiply (Tempmatrix);
695 //=======================================================================
696 //function : PreMultiply
698 //=======================================================================
700 void gp_Trsf::PreMultiply (const gp_Trsf& T)
702 if (T.shape == gp_Identity) { }
703 else if (shape == gp_Identity) {
709 else if (shape == gp_Rotation && T.shape == gp_Rotation) {
710 loc.Multiply (T.matrix);
712 matrix.PreMultiply(T.matrix);
714 else if (shape == gp_Translation && T.shape == gp_Translation) {
717 else if (shape == gp_Scale && T.shape == gp_Scale) {
718 loc.Multiply (T.scale);
720 scale = scale * T.scale;
722 else if (shape == gp_PntMirror && T.shape == gp_PntMirror) {
724 shape = gp_Translation;
728 else if (shape == gp_Ax1Mirror && T.shape == gp_Ax1Mirror) {
730 loc.Multiply (T.matrix);
732 matrix.PreMultiply(T.matrix);
734 else if ((shape == gp_CompoundTrsf || shape == gp_Rotation ||
735 shape == gp_Ax1Mirror || shape == gp_Ax2Mirror)
736 && T.shape == gp_Translation) {
739 else if ((shape == gp_Scale || shape == gp_PntMirror)
740 && T.shape == gp_Translation) {
743 else if (shape == gp_Translation &&
744 (T.shape == gp_CompoundTrsf || T.shape == gp_Rotation
745 || T.shape == gp_Ax1Mirror || T.shape == gp_Ax2Mirror)) {
746 shape = gp_CompoundTrsf;
748 if (T.scale == 1.0) loc.Multiply (T.matrix);
751 loc.Multiply (matrix);
752 loc.Multiply (scale);
756 else if ((T.shape == gp_Scale || T.shape == gp_PntMirror)
757 && shape == gp_Translation) {
758 loc.Multiply (T.scale);
763 else if ((shape == gp_PntMirror || shape == gp_Scale) &&
764 (T.shape == gp_PntMirror || T.shape == gp_Scale)) {
765 shape = gp_CompoundTrsf;
766 loc.Multiply (T.scale);
768 scale = scale * T.scale;
770 else if ((shape == gp_CompoundTrsf || shape == gp_Rotation ||
771 shape == gp_Ax1Mirror || shape == gp_Ax2Mirror)
772 && (T.shape == gp_Scale || T.shape == gp_PntMirror)) {
773 shape = gp_CompoundTrsf;
774 loc.Multiply (T.scale);
776 scale = scale * T.scale;
778 else if ((T.shape == gp_CompoundTrsf || T.shape == gp_Rotation ||
779 T.shape == gp_Ax1Mirror || T.shape == gp_Ax2Mirror)
780 && (shape == gp_Scale || shape == gp_PntMirror)) {
781 shape = gp_CompoundTrsf;
783 if (T.scale == 1.0) loc.Multiply (T.matrix);
785 loc.Multiply (matrix);
786 loc.Multiply (T.scale);
787 scale = T.scale * scale;
792 shape = gp_CompoundTrsf;
793 loc.Multiply (T.matrix);
794 if (T.scale != 1.0) {
795 loc.Multiply (T.scale); scale = scale * T.scale;
798 matrix.PreMultiply(T.matrix);
802 //=======================================================================
803 //function : GetRotation
804 //purpose : algorithm from A.Korn, M.Korn, "Mathematical Handbook for
805 // scientists and Engineers" McGraw-Hill, 1961, ch.14.10-2.
806 //=======================================================================
808 Standard_Boolean gp_Trsf::GetRotation (gp_XYZ& theAxis,
809 Standard_Real& theAngle) const
811 gp_Quaternion Q = GetRotation();
813 Q.GetVectorAndAngle (aVec, theAngle);
814 theAxis = aVec.XYZ();
815 return Standard_True;
818 //=======================================================================
819 //function : Orthogonalize
822 // Orthogonalization is not equivalent transformation. Therefore,
823 // transformation with source matrix and with orthogonalized matrix can
824 // lead to different results for one shape. Consequently, source matrix must
825 // be close to orthogonalized matrix for reducing these differences.
826 //=======================================================================
827 void gp_Trsf::Orthogonalize()
829 //Matrix M is called orthogonal if and only if
830 // M*Transpose(M) == E
831 //where E is identity matrix.
833 //Set of all rows (as of all columns) of matrix M (for gp_Trsf class) is
834 //orthonormal basis. If this condition is not satisfied then the basis can be
835 //orthonormalized in accordance with below described algorithm.
837 //In 3D-space, we have the linear span of three basis vectors: V1, V2 and V3.
838 //Correspond orthonormalized basis is formed by vectors Vn1, Vn2 and Vn3.
841 // Vn_{i}*Vn_{j} = (i == j)? 1 : 0.
843 //The algorithm includes following steps:
845 //1. Normalize V1 vector:
851 //After multiplication two parts of this equation by V1n,
852 //we will have following equation:
853 // 0=V2*V1n-m <==> m=V2*V1n.
856 // V2n=V2-(V2*V1n)*V1n.
859 // V3n=V3-m1*V1n-m2*V2n.
861 //After multiplication two parts of this equation by V1n,
862 //we will have following equation:
863 // 0=V3*V1n-m1 <==> m1=V3*V1n.
865 //After multiplication two parts of main equation by V2n,
866 //we will have following equation:
867 // 0=V3*V2n-m2 <==> m2=V3*V2n.
870 // V3n=V3-(V3*V1n)*V1n-(V3*V2n)*V2n.
874 gp_XYZ aV1 = aTM.Column(1);
875 gp_XYZ aV2 = aTM.Column(2);
876 gp_XYZ aV3 = aTM.Column(3);
880 aV2 -= aV1*(aV2.Dot(aV1));
883 aV3 -= aV1*(aV3.Dot(aV1)) + aV2*(aV3.Dot(aV2));
886 aTM.SetCols(aV1, aV2, aV3);
894 aV2 -= aV1*(aV2.Dot(aV1));
897 aV3 -= aV1*(aV3.Dot(aV1)) + aV2*(aV3.Dot(aV2));
900 aTM.SetRows(aV1, aV2, aV3);
905 //=======================================================================
906 //function : DumpJson
908 //=======================================================================
909 void gp_Trsf::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
911 OCCT_DUMP_VECTOR_CLASS (theOStream, "Location", 3, loc.X(), loc.Y(), loc.Z())
912 OCCT_DUMP_VECTOR_CLASS (theOStream, "Matrix", 9, matrix.Value(1, 1), matrix.Value(1, 2), matrix.Value(1, 3),
913 matrix.Value(2, 1), matrix.Value(2, 2), matrix.Value(2, 3),
914 matrix.Value(3, 1), matrix.Value(3, 2), matrix.Value(3, 3))
915 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, shape)
916 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, scale)
919 //=======================================================================
920 //function : InitFromJson
922 //=======================================================================
923 Standard_Boolean gp_Trsf::InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
925 Standard_Integer aPos = theStreamPos;
926 TCollection_AsciiString aStreamStr = Standard_Dump::Text (theSStream);
929 OCCT_INIT_VECTOR_CLASS (aStreamStr, "Location", aPos, 3,
930 &anXYZLoc.ChangeCoord (1), &anXYZLoc.ChangeCoord (2), &anXYZLoc.ChangeCoord (3))
931 SetTranslation (anXYZLoc);
933 Standard_Real mymatrix[3][3];
934 OCCT_INIT_VECTOR_CLASS (aStreamStr, "Matrix", aPos, 9, &mymatrix[0][0], &mymatrix[0][1], &mymatrix[0][2],
935 &mymatrix[1][0], &mymatrix[1][1], &mymatrix[1][2],
936 &mymatrix[2][0], &mymatrix[2][1], &mymatrix[2][2])
937 for (int i = 0; i < 3; i++)
939 for (int j = 0; j < 3; j++)
941 matrix.SetValue (i + 1, j + 1, mymatrix[i][j]);
945 Standard_Real ashape;
946 OCCT_INIT_FIELD_VALUE_INTEGER (aStreamStr, aPos, ashape);
947 shape = (gp_TrsfForm)((Standard_Integer)ashape);
949 OCCT_INIT_FIELD_VALUE_REAL (aStreamStr, aPos, scale);
952 return Standard_True;