42cf5bc1 |
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 | #ifndef _GeomInt_IntSS_HeaderFile |
18 | #define _GeomInt_IntSS_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <IntPatch_Intersection.hxx> |
25 | #include <GeomInt_LineConstructor.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <TColGeom_SequenceOfCurve.hxx> |
28 | #include <TColGeom2d_SequenceOfCurve.hxx> |
29 | #include <Standard_Real.hxx> |
30 | #include <Standard_Boolean.hxx> |
31 | #include <gp_Pnt.hxx> |
32 | #include <GeomInt_VectorOfReal.hxx> |
33 | class GeomAdaptor_HSurface; |
34 | class StdFail_NotDone; |
35 | class Standard_OutOfRange; |
36 | class Geom_Surface; |
37 | class Geom_Curve; |
38 | class Geom2d_Curve; |
39 | class gp_Pnt2d; |
40 | class IntPatch_RLine; |
41 | class Bnd_Box2d; |
42 | class Adaptor3d_TopolTool; |
4e14c88f |
43 | class IntPatch_WLine; |
42cf5bc1 |
44 | |
45 | |
46 | |
47 | class GeomInt_IntSS |
48 | { |
49 | public: |
50 | |
51 | DEFINE_STANDARD_ALLOC |
52 | |
53 | |
54 | GeomInt_IntSS(); |
55 | |
56 | //! performs general intersection of two surfaces just now |
57 | GeomInt_IntSS(const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False); |
58 | |
59 | //! general intersection of two surfaces |
60 | Standard_EXPORT void Perform (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False); |
61 | |
62 | //! intersection of adapted surfaces |
63 | void Perform (const Handle(GeomAdaptor_HSurface)& HS1, const Handle(GeomAdaptor_HSurface)& HS2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False); |
64 | |
65 | //! general intersection using a starting point |
66 | Standard_EXPORT void Perform (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False); |
67 | |
68 | //! intersection of adapted surfaces using a starting point |
69 | void Perform (const Handle(GeomAdaptor_HSurface)& HS1, const Handle(GeomAdaptor_HSurface)& HS2, const Standard_Real Tol, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False); |
70 | |
71 | Standard_Boolean IsDone() const; |
72 | |
73 | Standard_Real TolReached3d() const; |
74 | |
75 | Standard_Real TolReached2d() const; |
76 | |
77 | Standard_Integer NbLines() const; |
78 | |
79 | Standard_EXPORT const Handle(Geom_Curve)& Line (const Standard_Integer Index) const; |
80 | |
81 | Standard_EXPORT Standard_Boolean HasLineOnS1 (const Standard_Integer Index) const; |
82 | |
83 | Standard_EXPORT const Handle(Geom2d_Curve)& LineOnS1 (const Standard_Integer Index) const; |
84 | |
85 | Standard_EXPORT Standard_Boolean HasLineOnS2 (const Standard_Integer Index) const; |
86 | |
87 | Standard_EXPORT const Handle(Geom2d_Curve)& LineOnS2 (const Standard_Integer Index) const; |
88 | |
89 | Standard_Integer NbBoundaries() const; |
90 | |
91 | Standard_EXPORT const Handle(Geom_Curve)& Boundary (const Standard_Integer Index) const; |
92 | |
93 | Standard_Integer NbPoints() const; |
94 | |
95 | gp_Pnt Point (const Standard_Integer Index) const; |
96 | |
97 | Standard_EXPORT gp_Pnt2d Pnt2d (const Standard_Integer Index, const Standard_Boolean OnFirst) const; |
98 | |
99 | Standard_EXPORT void SetTolFixTangents (const Standard_Real aTolCheck, const Standard_Real aTolAngCheck); |
100 | |
101 | Standard_EXPORT void TolFixTangents (Standard_Real& aTolCheck, Standard_Real& aTolAngCheck); |
102 | |
103 | //! converts RLine to Geom(2d)_Curve. |
104 | Standard_EXPORT static void TreatRLine (const Handle(IntPatch_RLine)& theRL, const Handle(GeomAdaptor_HSurface)& theHS1, const Handle(GeomAdaptor_HSurface)& theHS2, Handle(Geom_Curve)& theC3d, Handle(Geom2d_Curve)& theC2d1, Handle(Geom2d_Curve)& theC2d2, Standard_Real& theTolReached); |
105 | |
106 | //! creates 2D-curve on given surface from given 3D-curve |
107 | Standard_EXPORT static void BuildPCurves (const Standard_Real f, const Standard_Real l, Standard_Real& Tol, const Handle(Geom_Surface)& S, const Handle(Geom_Curve)& C, Handle(Geom2d_Curve)& C2d); |
108 | |
109 | //! puts into theArrayOfParameters the parameters of intersection |
110 | //! points of given theC2d1 and theC2d2 curves with the boundaries |
111 | //! of the source surface. |
112 | Standard_EXPORT static void TrimILineOnSurfBoundaries (const Handle(Geom2d_Curve)& theC2d1, const Handle(Geom2d_Curve)& theC2d2, const Bnd_Box2d& theBound1, const Bnd_Box2d& theBound2, GeomInt_VectorOfReal& theArrayOfParameters); |
113 | |
4e14c88f |
114 | Standard_EXPORT static Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL, const Standard_Integer ideb, const Standard_Integer ifin); |
42cf5bc1 |
115 | |
4e14c88f |
116 | Standard_EXPORT static Handle(Geom2d_BSplineCurve) MakeBSpline2d(const Handle(IntPatch_WLine)& theWLine, const Standard_Integer ideb, const Standard_Integer ifin, const Standard_Boolean onFirst); |
42cf5bc1 |
117 | |
118 | |
119 | protected: |
120 | |
121 | |
122 | Standard_EXPORT void InternalPerform (const Standard_Real Tol, const Standard_Boolean Approx, const Standard_Boolean ApproxS1, const Standard_Boolean ApproxS2, const Standard_Boolean useStart, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2); |
123 | |
124 | Standard_EXPORT void MakeCurve (const Standard_Integer Ind, const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_TopolTool)& D2, const Standard_Real Tol, const Standard_Boolean Approx, const Standard_Boolean Approx1, const Standard_Boolean Approx2); |
125 | |
126 | |
127 | |
128 | |
129 | private: |
130 | |
131 | |
132 | |
133 | IntPatch_Intersection myIntersector; |
134 | GeomInt_LineConstructor myLConstruct; |
135 | Handle(GeomAdaptor_HSurface) myHS1; |
136 | Handle(GeomAdaptor_HSurface) myHS2; |
137 | Standard_Integer myNbrestr; |
138 | TColGeom_SequenceOfCurve sline; |
139 | TColGeom2d_SequenceOfCurve slineS1; |
140 | TColGeom2d_SequenceOfCurve slineS2; |
141 | Standard_Real myTolReached2d; |
142 | Standard_Real myTolReached3d; |
143 | Standard_Real myTolCheck; |
144 | Standard_Real myTolAngCheck; |
145 | |
146 | |
147 | }; |
148 | |
149 | |
150 | #include <GeomInt_IntSS.lxx> |
151 | |
152 | |
153 | |
154 | |
155 | |
156 | #endif // _GeomInt_IntSS_HeaderFile |