1// Created on: 1995-01-27
2// Created by: Jacques GOUSSARD
3// Copyright (c) 1995-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 <IntPatch_Point.hxx>
18#include <Geom_Surface.hxx>
19
20
21//=======================================================================
22//function : GeomInt_IntSS
23//purpose  :
24//=======================================================================
25inline GeomInt_IntSS::GeomInt_IntSS ()
26 : myNbrestr(0),
27   myTolReached2d(0.0),
28   myTolReached3d(0.0),
29   myTolCheck(1.e-7),
30   myTolAngCheck(1.e-6)
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(1.e-7),
47   myTolAngCheck(1.e-6)
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(), "GeomInt_IntSS::NbBoundaries() - no result");
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}
149