b311480e |
1 | // Created on: 1993-07-06 |
2 | // Created by: Remi LEQUETTE |
3 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <BRep_CurveOn2Surfaces.hxx> |
19 | #include <BRep_CurveRepresentation.hxx> |
20 | #include <Geom_Surface.hxx> |
21 | #include <gp_Pnt.hxx> |
22 | #include <Standard_NullObject.hxx> |
23 | #include <Standard_Type.hxx> |
24 | #include <TopLoc_Location.hxx> |
7fd59977 |
25 | |
92efcf78 |
26 | IMPLEMENT_STANDARD_RTTIEXT(BRep_CurveOn2Surfaces,BRep_CurveRepresentation) |
27 | |
7fd59977 |
28 | //======================================================================= |
29 | //function : BRep_CurveOn2Surfaces |
30 | //purpose : |
31 | //======================================================================= |
7fd59977 |
32 | BRep_CurveOn2Surfaces::BRep_CurveOn2Surfaces(const Handle(Geom_Surface)& S1, |
33 | const Handle(Geom_Surface)& S2, |
34 | const TopLoc_Location& L1, |
35 | const TopLoc_Location& L2, |
36 | const GeomAbs_Shape C) : |
37 | BRep_CurveRepresentation(L1), |
38 | mySurface(S1), |
39 | mySurface2(S2), |
40 | myLocation2(L2), |
41 | myContinuity(C) |
42 | { |
43 | } |
44 | |
45 | //======================================================================= |
46 | //function : D0 |
47 | //purpose : |
48 | //======================================================================= |
49 | |
50 | void BRep_CurveOn2Surfaces::D0(const Standard_Real , gp_Pnt& )const |
51 | { |
9775fa61 |
52 | throw Standard_NullObject("BRep_CurveOn2Surfaces::D0"); |
7fd59977 |
53 | } |
54 | |
55 | |
56 | //======================================================================= |
57 | //function : IsRegularity |
58 | //purpose : |
59 | //======================================================================= |
60 | |
61 | Standard_Boolean BRep_CurveOn2Surfaces::IsRegularity()const |
62 | { |
63 | return Standard_True; |
64 | } |
65 | |
66 | |
67 | //======================================================================= |
68 | //function : IsRegularity |
69 | //purpose : |
70 | //======================================================================= |
71 | |
72 | Standard_Boolean BRep_CurveOn2Surfaces::IsRegularity |
857ffd5e |
73 | (const Handle(Geom_Surface)& S1, |
74 | const Handle(Geom_Surface)& S2, |
7fd59977 |
75 | const TopLoc_Location& L1, |
76 | const TopLoc_Location& L2)const |
77 | { |
78 | return ((mySurface == S1 && mySurface2 == S2 && |
79 | myLocation == L1 && myLocation2 == L2) || |
80 | (mySurface == S2 && mySurface2 == S1 && |
81 | myLocation == L2 && myLocation2 == L1)); |
82 | } |
83 | |
84 | |
85 | //======================================================================= |
86 | //function : Surface |
87 | //purpose : |
88 | //======================================================================= |
89 | |
90 | const Handle(Geom_Surface)& BRep_CurveOn2Surfaces::Surface()const |
91 | { |
92 | return mySurface; |
93 | } |
94 | |
95 | //======================================================================= |
96 | //function : Surface2 |
97 | //purpose : |
98 | //======================================================================= |
99 | |
100 | const Handle(Geom_Surface)& BRep_CurveOn2Surfaces::Surface2()const |
101 | { |
102 | return mySurface2; |
103 | } |
104 | |
105 | |
106 | //======================================================================= |
107 | //function : Location2 |
108 | //purpose : |
109 | //======================================================================= |
110 | |
111 | const TopLoc_Location& BRep_CurveOn2Surfaces::Location2()const |
112 | { |
113 | return myLocation2; |
114 | } |
115 | |
116 | //======================================================================= |
117 | //function : Continuity |
118 | //purpose : |
119 | //======================================================================= |
120 | |
121 | const GeomAbs_Shape& BRep_CurveOn2Surfaces::Continuity()const |
122 | { |
123 | return myContinuity; |
124 | } |
125 | |
126 | //======================================================================= |
127 | //function : Continuity |
128 | //purpose : |
129 | //======================================================================= |
130 | |
131 | void BRep_CurveOn2Surfaces::Continuity(const GeomAbs_Shape C) |
132 | { |
133 | myContinuity = C; |
134 | } |
135 | |
136 | |
137 | //======================================================================= |
138 | //function : Copy |
139 | //purpose : |
140 | //======================================================================= |
141 | |
142 | Handle(BRep_CurveRepresentation) BRep_CurveOn2Surfaces::Copy() const |
143 | { |
144 | Handle(BRep_CurveOn2Surfaces) C = new |
145 | BRep_CurveOn2Surfaces(Surface(),Surface2(), |
146 | Location(),Location2(), |
147 | myContinuity); |
148 | return C; |
149 | } |
bc73b006 |
150 | |
151 | //======================================================================= |
152 | //function : DumpJson |
153 | //purpose : |
154 | //======================================================================= |
155 | void BRep_CurveOn2Surfaces::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const |
156 | { |
157 | OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream) |
158 | |
159 | OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_CurveRepresentation) |
160 | |
161 | OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface.get()) |
162 | OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface2.get()) |
163 | OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLocation2) |
164 | |
165 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContinuity) |
166 | } |