0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / TopOpeBRep / TopOpeBRep_Point2d.lxx
CommitLineData
b311480e 1// Created on: 1998-10-29
2// Created by: Jean Yves LEBEY
3// Copyright (c) 1998-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
17#include <TopOpeBRep_define.hxx>
18
19//=======================================================================
20//function : SetPint
21//purpose :
22//=======================================================================
23inline void TopOpeBRep_Point2d::SetPint(const IntRes2d_IntersectionPoint& P)
24{
25 mypint = P;
26 myhaspint = Standard_True;
27}
28
29//=======================================================================
30//function : HasPint
31//purpose :
32//=======================================================================
33inline Standard_Boolean TopOpeBRep_Point2d::HasPint() const
34{
35 return myhaspint;
36}
37
38//=======================================================================
39//function : Pint
40//purpose :
41//=======================================================================
42inline const IntRes2d_IntersectionPoint& TopOpeBRep_Point2d::Pint() const
43{
9775fa61 44 if (!HasPint()) throw Standard_Failure("TopOpeBRep_Point2d::Pint");
7fd59977 45 return mypint;
46}
47
48//=======================================================================
49//function : SetIsVertex
50//purpose :
51//=======================================================================
52inline void TopOpeBRep_Point2d::SetIsVertex(const Standard_Integer Index,const Standard_Boolean B)
53{
54 if (Index == 1) myisvertex1 = B;
55 else if (Index == 2) myisvertex2 = B;
9775fa61 56 else throw Standard_Failure("TopOpeBRep_Point2d::SetIsVertex");
7fd59977 57}
58
59//=======================================================================
60//function : IsVertex
61//purpose :
62//=======================================================================
63inline Standard_Boolean TopOpeBRep_Point2d::IsVertex(const Standard_Integer Index) const
64{
65 if (Index == 1) return myisvertex1;
66 else if (Index == 2) return myisvertex2;
9775fa61 67 else throw Standard_Failure("TopOpeBRep_Point2d::IsVertex");
7fd59977 68}
69
70//=======================================================================
71//function : SetVertex
72//purpose :
73//=======================================================================
74inline void TopOpeBRep_Point2d::SetVertex(const Standard_Integer Index,const TopoDS_Vertex& V)
75{
76 if (Index == 1) {myvertex1 = V; myisvertex1 = Standard_True;}
77 else if (Index == 2) {myvertex2 = V; myisvertex2 = Standard_True;}
9775fa61 78 else throw Standard_Failure("TopOpeBRep_Point2d::SetVertex");
7fd59977 79}
80
81//=======================================================================
82//function : SetTransition
83//purpose :
84//=======================================================================
85inline void TopOpeBRep_Point2d::SetTransition(const Standard_Integer Index,const TopOpeBRepDS_Transition& T)
86{
87 if (Index == 1) mytransition1 = T;
88 else if (Index == 2) mytransition2 = T;
9775fa61 89 else throw Standard_Failure("TopOpeBRep_Point2d::SetTransition");
7fd59977 90}
91
92//=======================================================================
93//function : SetParameter
94//purpose :
95//=======================================================================
96inline void TopOpeBRep_Point2d::SetParameter(const Standard_Integer Index,const Standard_Real P)
97{
98 if (Index == 1) myparameter1 = P;
99 else if (Index == 2) myparameter2 = P;
9775fa61 100 else throw Standard_Failure("TopOpeBRep_Point2d::SetParameter");
7fd59977 101}
102
103//=======================================================================
104//function : Parameter
105//purpose :
106//=======================================================================
107inline Standard_Real TopOpeBRep_Point2d::Parameter(const Standard_Integer Index) const
108{
109 if (Index == 1) return myparameter1;
110 else if (Index == 2) return myparameter2;
9775fa61 111 else throw Standard_Failure("TopOpeBRep_Point2d::Parameter");
7fd59977 112}
113
114//=======================================================================
115//function : SetIsPointOfSegment
116//purpose :
117//=======================================================================
118inline void TopOpeBRep_Point2d::SetIsPointOfSegment(const Standard_Boolean B)
119{
120 myispointofsegment = B;
121}
122
123//=======================================================================
124//function : IsPointOfSegment
125//purpose :
126//=======================================================================
127inline Standard_Boolean TopOpeBRep_Point2d::IsPointOfSegment() const
128{
129 return myispointofsegment;
130}
131
132//=======================================================================
133//function : SetSegmentAncestors
134//purpose :
135//=======================================================================
136inline void TopOpeBRep_Point2d::SetSegmentAncestors(const Standard_Integer IP1,const Standard_Integer IP2)
137{
138 myips1 = IP1;
139 myips2 = IP2;
140 myhasancestors = (myips1 != 0 && myips2 != 0);
141 if (myhasancestors) mystatus = TopOpeBRep_P2DNEW;
142}
143
144//=======================================================================
145//function : SegmentAncestors
146//purpose :
147//=======================================================================
148inline Standard_Boolean TopOpeBRep_Point2d::SegmentAncestors(Standard_Integer& IP1,Standard_Integer& IP2) const
149{
150 IP1 = myips1;
151 IP2 = myips2;
152 return myhasancestors;
153}
154
155//=======================================================================
156//function : SetStatus
157//purpose :
158//=======================================================================
159inline void TopOpeBRep_Point2d::SetStatus(const TopOpeBRep_P2Dstatus I)
160{
161 mystatus = I;
162}
163
164//=======================================================================
165//function : Status
166//purpose :
167//=======================================================================
168inline TopOpeBRep_P2Dstatus TopOpeBRep_Point2d::Status() const
169{
170 return mystatus;
171}
172
173//=======================================================================
174//function : SetIndex
175//purpose :
176//=======================================================================
177inline void TopOpeBRep_Point2d::SetIndex(const Standard_Integer I)
178{
179 myindex = I;
180}
181
182//=======================================================================
183//function : Index
184//purpose :
185//=======================================================================
186inline Standard_Integer TopOpeBRep_Point2d::Index() const
187{
188 return myindex;
189}
190
191//=======================================================================
192//function : SetValue
193//purpose :
194//=======================================================================
195inline void TopOpeBRep_Point2d::SetValue(const gp_Pnt& P)
196{
197 mypnt = P;
198}
199
200//=======================================================================
201//function : Value
202//purpose :
203//=======================================================================
204inline const gp_Pnt& TopOpeBRep_Point2d::Value() const
205{
206 return mypnt;
207}
208
209//=======================================================================
210//function : SetValue2d
211//purpose :
212//=======================================================================
213inline void TopOpeBRep_Point2d::SetValue2d(const gp_Pnt2d& P)
214{
215 mypnt2d = P;
216}
217
218//=======================================================================
219//function : Value2d
220//purpose :
221//=======================================================================
222inline const gp_Pnt2d& TopOpeBRep_Point2d::Value2d() const
223{
224 return mypnt2d;
225}
226
227//=======================================================================
228//function : SetKeep
229//purpose :
230//=======================================================================
231inline void TopOpeBRep_Point2d::SetKeep(const Standard_Boolean B)
232{
233 mykeep = B;
234}
235
236//=======================================================================
237//function : Keep
238//purpose :
239//=======================================================================
240inline Standard_Boolean TopOpeBRep_Point2d::Keep() const
241{
242 return mykeep;
243}
244
245//=======================================================================
246//function : SetEdgesConfig
247//purpose :
248//=======================================================================
249inline void TopOpeBRep_Point2d::SetEdgesConfig(const TopOpeBRepDS_Config B)
250{
251 myedgesconfig = B;
252}
253
254//=======================================================================
255//function : EdgesConfig
256//purpose :
257//=======================================================================
258inline TopOpeBRepDS_Config TopOpeBRep_Point2d::EdgesConfig() const
259{
260 return myedgesconfig;
261}
262
263//=======================================================================
264//function : SetTolerance
265//purpose :
266//=======================================================================
267inline void TopOpeBRep_Point2d::SetTolerance(const Standard_Real t)
268{
269 mytolerance = t;
270}
271
272//=======================================================================
273//function : Tolerance
274//purpose :
275//=======================================================================
276inline Standard_Real TopOpeBRep_Point2d::Tolerance() const
277{
278 return mytolerance;
279}
280
281//=======================================================================
282//function : SetHctxff2d
283//purpose :
284//=======================================================================
285inline void TopOpeBRep_Point2d::SetHctxff2d(const Handle(TopOpeBRep_Hctxff2d)& h)
286{
287 myctxff2d = h;
288}
289
290//=======================================================================
291//function : Hctxff2d
292//purpose :
293//=======================================================================
294inline Handle(TopOpeBRep_Hctxff2d) TopOpeBRep_Point2d::Hctxff2d() const
295{
296 return myctxff2d;
297}
298
299//=======================================================================
300//function : SetHctxee2d
301//purpose :
302//=======================================================================
303inline void TopOpeBRep_Point2d::SetHctxee2d(const Handle(TopOpeBRep_Hctxee2d)& h)
304{
305 myctxee2d = h;
306}
307
308//=======================================================================
309//function : Hctxee2d
310//purpose :
311//=======================================================================
312inline Handle(TopOpeBRep_Hctxee2d) TopOpeBRep_Point2d::Hctxee2d() const
313{
314 return myctxee2d;
315}
316