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 <TCollection_AsciiString.hxx> |
17 | #include <Vrml_WWWInline.hxx> |
7fd59977 |
18 | |
19 | Vrml_WWWInline::Vrml_WWWInline() |
20 | { |
21 | myName = ""; |
22 | gp_Vec tmpVec(0,0,0); |
23 | myBboxSize = tmpVec; |
24 | myBboxCenter = tmpVec; |
25 | } |
26 | |
27 | Vrml_WWWInline::Vrml_WWWInline(const TCollection_AsciiString& aName, |
28 | const gp_Vec& aBboxSize, |
29 | const gp_Vec& aBboxCenter) |
30 | { |
31 | myName = aName; |
32 | myBboxSize = aBboxSize; |
33 | myBboxCenter = aBboxCenter; |
34 | } |
35 | |
36 | void Vrml_WWWInline::SetName(const TCollection_AsciiString& aName) |
37 | { |
38 | myName = aName; |
39 | } |
40 | |
41 | TCollection_AsciiString Vrml_WWWInline::Name() const |
42 | { |
43 | return myName; |
44 | } |
45 | |
46 | void Vrml_WWWInline::SetBboxSize(const gp_Vec& aBboxSize) |
47 | { |
48 | myBboxSize = aBboxSize; |
49 | } |
50 | |
51 | gp_Vec Vrml_WWWInline::BboxSize() const |
52 | { |
53 | return myBboxSize; |
54 | } |
55 | |
56 | void Vrml_WWWInline::SetBboxCenter(const gp_Vec& aBboxCenter) |
57 | { |
58 | myBboxCenter = aBboxCenter; |
59 | } |
60 | |
61 | gp_Vec Vrml_WWWInline::BboxCenter() const |
62 | { |
63 | return myBboxCenter; |
64 | } |
65 | |
66 | Standard_OStream& Vrml_WWWInline::Print(Standard_OStream& anOStream) const |
67 | { |
586db386 |
68 | anOStream << "WWWInline {\n"; |
7fd59977 |
69 | |
70 | if ( !(myName.IsEqual ("") ) ) |
71 | { |
586db386 |
72 | anOStream << " name\t"; |
73 | anOStream << '"' << myName << '"' << "\n"; |
7fd59977 |
74 | } |
75 | |
76 | if ( Abs(myBboxSize.X() - 0) > 0.0001 || |
77 | Abs(myBboxSize.Y() - 0) > 0.0001 || |
78 | Abs(myBboxSize.Z() - 0) > 0.0001 ) |
79 | { |
586db386 |
80 | anOStream << " bboxSize\t"; |
81 | anOStream << myBboxSize.X() << " " << myBboxSize.Y() << " " << myBboxSize.Z() << "\n"; |
7fd59977 |
82 | } |
83 | |
84 | if ( Abs(myBboxCenter.X() - 0) > 0.0001 || |
85 | Abs(myBboxCenter.Y() - 0) > 0.0001 || |
86 | Abs(myBboxCenter.Z() - 0) > 0.0001 ) |
87 | { |
586db386 |
88 | anOStream << " bboxCenter\t"; |
89 | anOStream << myBboxCenter.X() << " " << myBboxCenter.Y() << " " << myBboxCenter.Z() << "\n"; |
7fd59977 |
90 | } |
91 | |
586db386 |
92 | anOStream << "}\n"; |
7fd59977 |
93 | return anOStream; |
94 | } |