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 <Vrml_ShapeHints.hxx> |
7fd59977 |
16 | |
b311480e |
17 | Vrml_ShapeHints::Vrml_ShapeHints(const Vrml_VertexOrdering aVertexOrdering, |
7fd59977 |
18 | const Vrml_ShapeType aShapeType, |
19 | const Vrml_FaceType aFaceType, |
20 | const Standard_Real aAngle) |
21 | { |
22 | myVertexOrdering = aVertexOrdering; |
23 | myShapeType = aShapeType; |
24 | myFaceType = aFaceType; |
25 | myAngle = aAngle; |
26 | } |
27 | |
28 | void Vrml_ShapeHints::SetVertexOrdering(const Vrml_VertexOrdering aVertexOrdering) |
29 | { |
30 | myVertexOrdering = aVertexOrdering; |
31 | } |
32 | |
33 | Vrml_VertexOrdering Vrml_ShapeHints::VertexOrdering() const |
34 | { |
35 | return myVertexOrdering; |
36 | } |
37 | |
38 | void Vrml_ShapeHints::SetShapeType(const Vrml_ShapeType aShapeType) |
39 | { |
40 | myShapeType = aShapeType; |
41 | } |
42 | |
43 | Vrml_ShapeType Vrml_ShapeHints::ShapeType() const |
44 | { |
45 | return myShapeType; |
46 | } |
47 | |
48 | void Vrml_ShapeHints::SetFaceType(const Vrml_FaceType aFaceType) |
49 | { |
50 | myFaceType = aFaceType; |
51 | } |
52 | |
53 | Vrml_FaceType Vrml_ShapeHints::FaceType() const |
54 | { |
55 | return myFaceType; |
56 | } |
57 | |
58 | void Vrml_ShapeHints::SetAngle(const Standard_Real aAngle) |
59 | { |
60 | myAngle = aAngle; |
61 | } |
62 | |
63 | Standard_Real Vrml_ShapeHints::Angle() const |
64 | { |
65 | return myAngle; |
66 | } |
67 | |
68 | Standard_OStream& Vrml_ShapeHints::Print(Standard_OStream& anOStream) const |
69 | { |
586db386 |
70 | anOStream << "ShapeHints {\n"; |
7fd59977 |
71 | |
72 | switch ( myVertexOrdering ) |
73 | { |
586db386 |
74 | case Vrml_UNKNOWN_ORDERING: break; // anOStream << " vertexOrdering\tUNKNOWN_ORDERING"; |
75 | case Vrml_CLOCKWISE: anOStream << " vertexOrdering\tCLOCKWISE\n"; break; |
76 | case Vrml_COUNTERCLOCKWISE: anOStream << " vertexOrdering\tCOUNTERCLOCKWISE\n"; break; |
7fd59977 |
77 | } |
78 | |
79 | switch ( myShapeType ) |
80 | { |
586db386 |
81 | case Vrml_UNKNOWN_SHAPE_TYPE: break; //anOStream << " shapeType\t\tUNKNOWN_SHAPE_TYPE"; |
82 | case Vrml_SOLID: anOStream << " shapeType\t\tSOLID\n"; break; |
7fd59977 |
83 | } |
84 | |
85 | switch ( myFaceType ) |
86 | { |
586db386 |
87 | case Vrml_UNKNOWN_FACE_TYPE: anOStream << " faceType\t\tUNKNOWN_FACE_TYPE\n"; break; |
88 | case Vrml_CONVEX: break; //anOStream << " faceType\t\tCONVEX"; |
7fd59977 |
89 | } |
90 | |
91 | if ( Abs(myAngle - 0.5) > 0.0001 ) |
92 | { |
586db386 |
93 | anOStream << " creaseAngle\t\t" << myAngle << "\n"; |
7fd59977 |
94 | } |
586db386 |
95 | anOStream << "}\n"; |
7fd59977 |
96 | return anOStream; |
97 | } |
98 | |