0024927: Getting rid of "Persistent" functionality -- Code
[occt.git] / src / PBRep / PBRep_TEdge.cxx
1 // Created on: 1993-07-26
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <PBRep_TEdge.ixx>
18
19 static const Standard_Integer ParameterMask       = 1;
20 static const Standard_Integer RangeMask           = 2;
21 static const Standard_Integer DegeneratedMask     = 4;
22
23 //=======================================================================
24 //function : PBRep_TEdge
25 //purpose  : 
26 //=======================================================================
27
28 PBRep_TEdge::PBRep_TEdge() : 
29     myTolerance(0.),
30     myFlags(0)
31 {
32 }
33
34 //=======================================================================
35 //function : Tolerance
36 //purpose  : 
37 //=======================================================================
38
39 Standard_Real  PBRep_TEdge::Tolerance()const 
40 {
41   return myTolerance;
42 }
43
44
45 //=======================================================================
46 //function : Tolerance
47 //purpose  : 
48 //=======================================================================
49
50 void  PBRep_TEdge::Tolerance(const Standard_Real T)
51 {
52   myTolerance = T;
53 }
54
55
56 //=======================================================================
57 //function : SameParameter
58 //purpose  : 
59 //=======================================================================
60
61 Standard_Boolean  PBRep_TEdge::SameParameter()const 
62 {
63   return myFlags & ParameterMask;
64 }
65
66
67 //=======================================================================
68 //function : SameParameter
69 //purpose  : 
70 //=======================================================================
71
72 void  PBRep_TEdge::SameParameter(const Standard_Boolean S)
73 {
74   if (S) myFlags |= ParameterMask;
75   else   myFlags &= ~ParameterMask;
76 }
77
78
79 //=======================================================================
80 //function : SameRange
81 //purpose  : 
82 //=======================================================================
83
84  Standard_Boolean  PBRep_TEdge::SameRange()const 
85 {
86   return myFlags & RangeMask;
87 }
88
89
90 //=======================================================================
91 //function : SameRange
92 //purpose  : 
93 //=======================================================================
94
95  void  PBRep_TEdge::SameRange(const Standard_Boolean S)
96 {
97   if (S) myFlags |= RangeMask;
98   else   myFlags &= ~RangeMask;
99 }
100
101 //=======================================================================
102 //function : Degenerated
103 //purpose  : 
104 //=======================================================================
105
106 Standard_Boolean  PBRep_TEdge::Degenerated()const 
107 {
108   return myFlags & DegeneratedMask;
109 }
110
111
112 //=======================================================================
113 //function : Degenerated
114 //purpose  : 
115 //=======================================================================
116
117 void  PBRep_TEdge::Degenerated(const Standard_Boolean S)
118 {
119   if (S) myFlags |= DegeneratedMask; 
120   else   myFlags &= ~DegeneratedMask;
121 }
122
123
124 //=======================================================================
125 //function : Curves
126 //purpose  : 
127 //=======================================================================
128
129 Handle(PBRep_CurveRepresentation)  PBRep_TEdge::Curves()const 
130 {
131   return myCurves;
132 }
133
134
135 //=======================================================================
136 //function : Curves
137 //purpose  : 
138 //=======================================================================
139
140 void  PBRep_TEdge::Curves(const Handle(PBRep_CurveRepresentation)& C)
141 {
142   myCurves = C;
143 }
144
145