Warnings on vc14 were eliminated
[occt.git] / src / Vrml / Vrml_OrthographicCamera.cxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 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
973c2be1 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.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
42cf5bc1 14
15#include <gp_Vec.hxx>
16#include <Vrml_OrthographicCamera.hxx>
17#include <Vrml_SFRotation.hxx>
7fd59977 18
19Vrml_OrthographicCamera::Vrml_OrthographicCamera():
20 myFocalDistance(5),
21 myHeight(2)
22{
23
24 gp_Vec tmpVec(0,0,1);
25 myPosition = tmpVec;
26
27 Vrml_SFRotation tmpSFR(0,0,1,0);
28 myOrientation = tmpSFR;
29}
30
31Vrml_OrthographicCamera::Vrml_OrthographicCamera( const gp_Vec& aPosition,
32 const Vrml_SFRotation& aOrientation,
33 const Standard_Real aFocalDistance,
34 const Standard_Real aHeight)
35{
36 myPosition = aPosition;
37 myOrientation = aOrientation;
38 myFocalDistance = aFocalDistance;
39 myHeight = aHeight;
40}
41
42void Vrml_OrthographicCamera::SetPosition(const gp_Vec& aPosition)
43{
44 myPosition = aPosition;
45}
46
47gp_Vec Vrml_OrthographicCamera::Position() const
48{
49 return myPosition;
50}
51
52void Vrml_OrthographicCamera::SetOrientation(const Vrml_SFRotation& aOrientation)
53{
54 myOrientation = aOrientation;
55}
56
57Vrml_SFRotation Vrml_OrthographicCamera::Orientation() const
58{
59 return myOrientation;
60}
61
62void Vrml_OrthographicCamera::SetFocalDistance(const Standard_Real aFocalDistance)
63{
64 myFocalDistance = aFocalDistance;
65}
66
67Standard_Real Vrml_OrthographicCamera::FocalDistance() const
68{
69 return myFocalDistance;
70}
71
72void Vrml_OrthographicCamera::SetHeight(const Standard_Real aHeight)
73{
74 myHeight = aHeight;
75}
76
77Standard_Real Vrml_OrthographicCamera::Height() const
78{
79 return myHeight;
80}
81
82Standard_OStream& Vrml_OrthographicCamera::Print(Standard_OStream& anOStream) const
83{
586db386 84 anOStream << "OrthographicCamera {\n";
7fd59977 85 if ( Abs(myPosition.X() - 0) > 0.0001 ||
86 Abs(myPosition.Y() - 0) > 0.0001 ||
87 Abs(myPosition.Z() - 1) > 0.0001 )
88 {
586db386 89 anOStream << " position\t\t";
90 anOStream << myPosition.X() << " " << myPosition.Y() << " " << myPosition.Z() << "\n";
7fd59977 91 }
92
93 if ( Abs(myOrientation.RotationX() - 0) > 0.0001 ||
94 Abs(myOrientation.RotationY() - 0) > 0.0001 ||
95 Abs(myOrientation.RotationZ() - 1) > 0.0001 ||
96 Abs(myOrientation.Angle() - 0) > 0.0001 )
97 {
586db386 98 anOStream << " orientation\t\t";
99 anOStream << myOrientation.RotationX() << " " << myOrientation.RotationY() << " ";
100 anOStream << myOrientation.RotationZ() << " " << myOrientation.Angle() << "\n";
7fd59977 101 }
102
103 if ( Abs(myFocalDistance - 5) > 0.0001 )
104 {
586db386 105 anOStream << " focalDistance\t";
106 anOStream << myFocalDistance << "\n";
7fd59977 107 }
108 if ( Abs(myHeight - 2) > 0.0001 )
109 {
586db386 110 anOStream << " height\t\t";
111 anOStream << myHeight << "\n";
7fd59977 112 }
586db386 113 anOStream << "}\n";
7fd59977 114 return anOStream;
115}