1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
18 #include <gp_Trsf.hxx>
19 #include <Precision.hxx>
20 #include <Vrml_MatrixTransform.hxx>
22 Vrml_MatrixTransform::Vrml_MatrixTransform()
24 // SetValues(me : in out;
25 // a11, a12, a13, a14,
26 // a21, a22, a23, a24,
27 // a31, a32, a33, a34 : Real;
28 // Tolang, TolDist : Real)
31 T.SetValues ( 1, 0, 0, 0,
39 Vrml_MatrixTransform::Vrml_MatrixTransform(const gp_Trsf& aMatrix)
44 void Vrml_MatrixTransform::SetMatrix(const gp_Trsf& aMatrix)
49 gp_Trsf Vrml_MatrixTransform::Matrix() const
54 Standard_OStream& Vrml_MatrixTransform::Print(Standard_OStream& anOStream) const
57 anOStream << "MatrixTransform {\n";
59 if ( Abs(myMatrix.Value(1,1) - 1) > 0.0000001 || Abs(myMatrix.Value(2,1) - 0) > 0.0000001 || Abs(myMatrix.Value(3,1) - 0) > 0.0000001 ||
60 Abs(myMatrix.Value(1,2) - 0) > 0.0000001 || Abs(myMatrix.Value(2,2) - 1) > 0.0000001 || Abs(myMatrix.Value(3,2) - 0) > 0.0000001 ||
61 Abs(myMatrix.Value(1,3) - 0) > 0.0000001 || Abs(myMatrix.Value(2,3) - 0) > 0.0000001 || Abs(myMatrix.Value(3,3) - 1) > 0.0000001 ||
62 Abs(myMatrix.Value(1,4) - 0) > 0.0000001 || Abs(myMatrix.Value(2,4) - 0) > 0.0000001 || Abs(myMatrix.Value(3,4) - 0) > 0.0000001 )
64 anOStream << " matrix\t";
66 for ( j = 1; j <=4; j++ )
68 for ( i = 1; i <=3; i++ )
70 // Value (me; Row, Col : Integer) returns Real
71 anOStream << myMatrix.Value(i,j) << ' ';
80 anOStream << myMatrix.ScaleFactor() << "\n";