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.
15 #include <gp_Vec2d.hxx>
16 #include <Vrml_Texture2Transform.hxx>
18 Vrml_Texture2Transform::Vrml_Texture2Transform()
21 myTranslation = tmpVec;
27 myScaleFactor = tmpVec;
30 Vrml_Texture2Transform::Vrml_Texture2Transform(const gp_Vec2d& aTranslation,
31 const Standard_Real aRotation,
32 const gp_Vec2d& aScaleFactor,
33 const gp_Vec2d& aCenter)
35 myTranslation = aTranslation;
36 myRotation = aRotation;
37 myScaleFactor = aScaleFactor;
41 void Vrml_Texture2Transform::SetTranslation(const gp_Vec2d& aTranslation)
43 myTranslation = aTranslation;
46 gp_Vec2d Vrml_Texture2Transform::Translation() const
51 void Vrml_Texture2Transform::SetRotation(const Standard_Real aRotation)
53 myRotation = aRotation;
56 Standard_Real Vrml_Texture2Transform::Rotation() const
61 void Vrml_Texture2Transform::SetScaleFactor(const gp_Vec2d& aScaleFactor)
63 myScaleFactor = aScaleFactor;
66 gp_Vec2d Vrml_Texture2Transform::ScaleFactor() const
71 void Vrml_Texture2Transform::SetCenter(const gp_Vec2d& aCenter)
76 gp_Vec2d Vrml_Texture2Transform::Center() const
81 Standard_OStream& Vrml_Texture2Transform::Print(Standard_OStream& anOStream) const
83 anOStream << "Texture2Transform {\n";
85 if ( Abs(myTranslation.X() - 0) > 0.0001 || Abs(myTranslation.Y() - 0) > 0.0001 )
87 anOStream << " translation\t";
88 anOStream << myTranslation.X() << " " << myTranslation.Y() << "\n";
91 if ( Abs(myRotation - 0) > 0.0001 )
93 anOStream << " rotation\t";
94 anOStream << myRotation << "\n";
97 if ( Abs(myScaleFactor.X() - 0) > 0.0001 || Abs(myScaleFactor.Y() - 0) > 0.0001 )
99 anOStream << " scaleFactor\t";
100 anOStream << myScaleFactor.X() << " " << myScaleFactor.Y() << "\n";
103 if ( Abs(myCenter.X() - 0) > 0.0001 || Abs(myCenter.Y() - 0) > 0.0001 )
105 anOStream << " center\t";
106 anOStream << myCenter.X() << " " << myCenter.Y() << "\n";