summaryrefslogtreecommitdiff
path: root/src/Vrml/Vrml_Rotation.cxx
blob: 05f27e5d86551688e89aaa76f2d80152239032ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <Vrml_Rotation.ixx>

Vrml_Rotation::Vrml_Rotation()
{
  Vrml_SFRotation tmpR(0,0,1,0);
  myRotation = tmpR;
}

Vrml_Rotation::Vrml_Rotation(const Vrml_SFRotation& aRotation)
{
  myRotation = aRotation;
}

 void Vrml_Rotation::SetRotation(const Vrml_SFRotation& aRotation) 
{
  myRotation = aRotation;
}

 Vrml_SFRotation Vrml_Rotation::Rotation() const
{
  return myRotation;
}

 Standard_OStream& Vrml_Rotation::Print(Standard_OStream& anOStream) const
{
 anOStream  << "Rotation {" << endl;

 if ( Abs(myRotation.RotationX() - 0) > 0.0001 || 
     Abs(myRotation.RotationY() - 0) > 0.0001 || 
     Abs(myRotation.RotationZ() - 1) > 0.0001 ||
     Abs(myRotation.Angle() - 0) > 0.0001 ) 
   {
    anOStream  << "    rotation" << '\t';
    anOStream << myRotation.RotationX() << ' ' << myRotation.RotationY() << ' ';
    anOStream << myRotation.RotationZ() << ' ' << myRotation.Angle() << endl;
   }

 anOStream  << '}' << endl;
 return anOStream;
}