0026431: Can't cut a sphere from a cylinder
[occt.git] / src / GeomInt / GeomInt_IntSS.lxx
CommitLineData
b311480e 1// Created on: 1995-01-27
2// Created by: Jacques GOUSSARD
3// Copyright (c) 1995-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 <IntPatch_Point.hxx>
4e14c88f 18#include <Geom_Surface.hxx>
7fd59977 19
20
21//=======================================================================
22//function : GeomInt_IntSS
23//purpose :
24//=======================================================================
b311480e 25inline GeomInt_IntSS::GeomInt_IntSS ()
7fd59977 26 : myNbrestr(0),
27 myTolReached2d(0.0),
28 myTolReached3d(0.0),
29 myTolCheck(0.0000001),
30 myTolAngCheck(0.3)
31{}
32
33//=======================================================================
34//function : GeomInt_IntSS
35//purpose :
36//=======================================================================
37 inline GeomInt_IntSS::GeomInt_IntSS (const Handle(Geom_Surface)& S1,
38 const Handle(Geom_Surface)& S2,
39 const Standard_Real Tol,
40 const Standard_Boolean Approx,
41 const Standard_Boolean ApproxS1,
42 const Standard_Boolean ApproxS2)
43 : myNbrestr(0),
44 myTolReached2d(0.0),
45 myTolReached3d(0.0),
46 myTolCheck(0.0000001),
47 myTolAngCheck(0.3)
48{
49 Perform(S1,S2,Tol,Approx,ApproxS1,ApproxS2);
50}
51
52//=======================================================================
53//function : Perform
54//purpose : Intersection of Adapted surfaces
55//=======================================================================
56 inline void GeomInt_IntSS::Perform(const Handle(GeomAdaptor_HSurface)& HS1,
57 const Handle(GeomAdaptor_HSurface)& HS2,
58 const Standard_Real Tol,
59 const Standard_Boolean Approx,
60 const Standard_Boolean ApproxS1,
61 const Standard_Boolean ApproxS2)
62{
63 myHS1 = HS1;
64 myHS2 = HS2;
65 InternalPerform(Tol,Approx,ApproxS1,ApproxS2,Standard_False,0.,0.,0.,0.);
66}
67
68//=======================================================================
69//function : Perform
70//purpose : Intersection of Adapted surfaces with a Starting Point
71//=======================================================================
72 inline void GeomInt_IntSS::Perform(const Handle(GeomAdaptor_HSurface)& HS1,
73 const Handle(GeomAdaptor_HSurface)& HS2,
74 const Standard_Real Tol,
75 const Standard_Real U1, const Standard_Real V1,
76 const Standard_Real U2, const Standard_Real V2,
77 const Standard_Boolean Approx,
78 const Standard_Boolean ApproxS1,
79 const Standard_Boolean ApproxS2)
80{
81 myHS1 = HS1;
82 myHS2 = HS2;
83 InternalPerform(Tol,Approx,ApproxS1,ApproxS2,Standard_True,U1,V1,U2,V2);
84}
85
86//=======================================================================
87//function : IsDone
88//purpose :
89//=======================================================================
90 inline Standard_Boolean GeomInt_IntSS::IsDone () const
91{
92 return myIntersector.IsDone();
93}
94
95//=======================================================================
96//function : TolReached2d
97//purpose :
98//=======================================================================
99 inline Standard_Real GeomInt_IntSS::TolReached2d () const
100{
101 return myTolReached2d;
102}
103
104//=======================================================================
105//function : TolReached3d
106//purpose :
107//=======================================================================
108 inline Standard_Real GeomInt_IntSS::TolReached3d () const
109{
110 return myTolReached3d;
111}
112
113//=======================================================================
114//function : NbLines
115//purpose :
116//=======================================================================
117 inline Standard_Integer GeomInt_IntSS::NbLines () const
118{
119 return sline.Length()-myNbrestr;
120}
121
122//=======================================================================
123//function : NbBoundaries
124//purpose :
125//=======================================================================
126 inline Standard_Integer GeomInt_IntSS::NbBoundaries () const
127{
128 StdFail_NotDone_Raise_if(!myIntersector.IsDone(),"");
129 return myNbrestr;
130}
131
132//=======================================================================
133//function : NbPoints
134//purpose :
135//=======================================================================
136 inline Standard_Integer GeomInt_IntSS::NbPoints () const
137{
138 return myIntersector.NbPnts();
139}
140
141//=======================================================================
142//function : Point
143//purpose :
144//=======================================================================
145 inline gp_Pnt GeomInt_IntSS::Point (const Standard_Integer Index) const
146{
147 return myIntersector.Point(Index).Value();
148}