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_EdgeLoop.hxx> |
17 | #include <StepShape_OrientedEdge.hxx> |
18 | #include <StepShape_OrientedPath.hxx> |
19 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
20 | |
92efcf78 |
21 | IMPLEMENT_STANDARD_RTTIEXT(StepShape_OrientedPath,StepShape_Path) |
22 | |
7fd59977 |
23 | StepShape_OrientedPath::StepShape_OrientedPath () {} |
24 | |
7fd59977 |
25 | void StepShape_OrientedPath::Init( |
26 | const Handle(TCollection_HAsciiString)& aName, |
27 | const Handle(StepShape_EdgeLoop)& aPathElement, |
28 | const Standard_Boolean aOrientation) |
29 | { |
30 | // --- classe own fields --- |
31 | pathElement = aPathElement; |
32 | orientation = aOrientation; |
33 | // --- classe inherited fields --- |
34 | Handle(StepShape_HArray1OfOrientedEdge) aEdgeList; |
35 | aEdgeList.Nullify(); |
36 | StepShape_Path::Init(aName, aEdgeList); |
37 | } |
38 | |
39 | |
40 | void StepShape_OrientedPath::SetPathElement(const Handle(StepShape_EdgeLoop)& aPathElement) |
41 | { |
42 | pathElement = aPathElement; |
43 | } |
44 | |
45 | Handle(StepShape_EdgeLoop) StepShape_OrientedPath::PathElement() const |
46 | { |
47 | return pathElement; |
48 | } |
49 | |
50 | void StepShape_OrientedPath::SetOrientation(const Standard_Boolean aOrientation) |
51 | { |
52 | orientation = aOrientation; |
53 | } |
54 | |
55 | Standard_Boolean StepShape_OrientedPath::Orientation() const |
56 | { |
57 | return orientation; |
58 | } |
59 | |
35e08fe8 |
60 | void StepShape_OrientedPath::SetEdgeList(const Handle(StepShape_HArray1OfOrientedEdge)& /*aEdgeList*/) |
7fd59977 |
61 | { |
62 | // WARNING : the field is redefined. |
63 | // field set up forbidden. |
04232180 |
64 | std::cout << "Field is redefined, SetUp Forbidden" << std::endl; |
7fd59977 |
65 | } |
66 | |
67 | Handle(StepShape_HArray1OfOrientedEdge) StepShape_OrientedPath::EdgeList() const |
68 | { |
69 | // WARNING : the field is redefined. |
70 | // method body is not yet automaticly wrote |
71 | if (orientation) |
72 | return pathElement->EdgeList(); |
73 | else { |
74 | // on devrait creer un nouveau tableau d'oriented edge classe dans |
75 | // l'ordre inverse - on fera plus tard |
76 | return pathElement->EdgeList(); |
77 | } |
78 | } |
79 | |
80 | Handle(StepShape_OrientedEdge) StepShape_OrientedPath::EdgeListValue(const Standard_Integer num) const |
81 | { |
82 | // WARNING : the field is redefined. |
83 | // method body is not yet automaticly wrote |
84 | if (orientation) |
85 | return pathElement->EdgeListValue(num); |
86 | else { |
87 | Standard_Integer nbEdges = pathElement->NbEdgeList(); |
88 | return pathElement->EdgeListValue(nbEdges - num +1); |
89 | } |
90 | } |
91 | |
92 | Standard_Integer StepShape_OrientedPath::NbEdgeList () const |
93 | { |
94 | // WARNING : the field is redefined. |
95 | // method body is not yet automaticly wrote |
96 | return pathElement->NbEdgeList(); |
97 | } |