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 | |
7fd59977 |
14 | |
42cf5bc1 |
15 | #include <Standard_Type.hxx> |
16 | #include <StepShape_Edge.hxx> |
17 | #include <StepShape_OrientedEdge.hxx> |
18 | #include <StepShape_Vertex.hxx> |
19 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
20 | |
92efcf78 |
21 | IMPLEMENT_STANDARD_RTTIEXT(StepShape_OrientedEdge,StepShape_Edge) |
22 | |
7fd59977 |
23 | StepShape_OrientedEdge::StepShape_OrientedEdge () {} |
24 | |
25 | |
26 | void StepShape_OrientedEdge::Init( |
27 | const Handle(TCollection_HAsciiString)& aName, |
28 | const Handle(StepShape_Edge)& aEdgeElement, |
29 | const Standard_Boolean aOrientation) |
30 | { |
31 | // --- classe own fields --- |
32 | edgeElement = aEdgeElement; |
33 | orientation = aOrientation; |
34 | // --- classe inherited fields --- |
35 | Handle(StepShape_Vertex) aEdgeStart; |
36 | aEdgeStart.Nullify(); |
37 | Handle(StepShape_Vertex) aEdgeEnd; |
38 | aEdgeEnd.Nullify(); |
39 | StepShape_Edge::Init(aName, aEdgeStart, aEdgeEnd); |
40 | } |
41 | |
42 | |
43 | void StepShape_OrientedEdge::SetEdgeElement(const Handle(StepShape_Edge)& aEdgeElement) |
44 | { |
45 | edgeElement = aEdgeElement; |
46 | } |
47 | |
48 | Handle(StepShape_Edge) StepShape_OrientedEdge::EdgeElement() const |
49 | { |
50 | return edgeElement; |
51 | } |
52 | |
53 | void StepShape_OrientedEdge::SetOrientation(const Standard_Boolean aOrientation) |
54 | { |
55 | orientation = aOrientation; |
56 | } |
57 | |
58 | Standard_Boolean StepShape_OrientedEdge::Orientation() const |
59 | { |
60 | return orientation; |
61 | } |
62 | |
63 | void StepShape_OrientedEdge::SetEdgeStart(const Handle(StepShape_Vertex)& /*aEdgeStart*/) |
64 | { |
65 | // WARNING : the field is redefined. |
66 | // field set up forbidden. |
04232180 |
67 | std::cout << "Field is redefined, SetUp Forbidden" << std::endl; |
7fd59977 |
68 | } |
69 | |
70 | Handle(StepShape_Vertex) StepShape_OrientedEdge::EdgeStart() const |
71 | { |
72 | // WARNING : the field is redefined. |
73 | // method body is not yet automaticly wrote |
d18c1ac0 |
74 | if (edgeElement.IsNull()) |
75 | return NULL; |
7fd59977 |
76 | if (Orientation()) { |
77 | return edgeElement->EdgeStart(); |
78 | } |
79 | else { |
80 | return edgeElement->EdgeEnd(); |
81 | } |
82 | } |
83 | |
84 | void StepShape_OrientedEdge::SetEdgeEnd(const Handle(StepShape_Vertex)& /*aEdgeEnd*/) |
85 | { |
86 | // WARNING : the field is redefined. |
87 | // field set up forbidden. |
04232180 |
88 | std::cout << "Field is redefined, SetUp Forbidden" << std::endl; |
7fd59977 |
89 | } |
90 | |
91 | Handle(StepShape_Vertex) StepShape_OrientedEdge::EdgeEnd() const |
92 | { |
93 | // WARNING : the field is redefined. |
94 | // method body is not yet automaticly wrote |
d18c1ac0 |
95 | if (edgeElement.IsNull()) |
96 | return NULL; |
7fd59977 |
97 | if (Orientation()) { |
98 | return edgeElement->EdgeEnd(); |
99 | } |
100 | else { |
101 | return edgeElement->EdgeStart(); |
102 | } |
103 | } |