0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / StepShape / StepShape_OrientedEdge.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
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 21IMPLEMENT_STANDARD_RTTIEXT(StepShape_OrientedEdge,StepShape_Edge)
22
7fd59977 23StepShape_OrientedEdge::StepShape_OrientedEdge () {}
24
25
26void 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
43void StepShape_OrientedEdge::SetEdgeElement(const Handle(StepShape_Edge)& aEdgeElement)
44{
45 edgeElement = aEdgeElement;
46}
47
48Handle(StepShape_Edge) StepShape_OrientedEdge::EdgeElement() const
49{
50 return edgeElement;
51}
52
53void StepShape_OrientedEdge::SetOrientation(const Standard_Boolean aOrientation)
54{
55 orientation = aOrientation;
56}
57
58Standard_Boolean StepShape_OrientedEdge::Orientation() const
59{
60 return orientation;
61}
62
63void 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
70Handle(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
84void 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
91Handle(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}