42cf5bc1 |
1 | // Created on: 1999-03-03 |
2 | // Created by: Fabrice SERVANT |
3 | // Copyright (c) 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 _IntPolyh_Intersection_HeaderFile |
18 | #define _IntPolyh_Intersection_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Boolean.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <IntPolyh_ArrayOfSectionLines.hxx> |
27 | #include <IntPolyh_ArrayOfTangentZones.hxx> |
28 | #include <TColStd_Array1OfReal.hxx> |
29 | #include <Standard_Real.hxx> |
30 | #include <IntPolyh_PMaillageAffinage.hxx> |
68b07699 |
31 | #include <IntPolyh_ListOfCouples.hxx> |
42cf5bc1 |
32 | class Adaptor3d_HSurface; |
33 | |
34 | |
35 | //! the main algorithm. Algorithm outputs are |
36 | //! lines and points like describe in the last |
37 | //! paragraph. The Algorithm provides direct access to |
38 | //! the elements of those lines and points. Other |
39 | //! classes of this package are for internal use and |
40 | //! only concern the algorithmic part. |
41 | class IntPolyh_Intersection |
42 | { |
43 | public: |
44 | |
45 | DEFINE_STANDARD_ALLOC |
46 | |
47 | |
48 | //! Constructor |
49 | Standard_EXPORT IntPolyh_Intersection(const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2); |
50 | |
51 | //! NbSU1 ... NbSV2 are used to compute the initial |
52 | //! samples of the iso parametric meshes on the |
53 | //! surfaces. |
54 | Standard_EXPORT IntPolyh_Intersection(const Handle(Adaptor3d_HSurface)& S1, const Standard_Integer NbSU1, const Standard_Integer NbSV1, const Handle(Adaptor3d_HSurface)& S2, const Standard_Integer NbSU2, const Standard_Integer NbSV2); |
55 | |
56 | //! D1, D2 are used to compute the initial |
57 | //! samples of the iso parametric meshes on the |
58 | //! surfaces. |
59 | Standard_EXPORT IntPolyh_Intersection(const Handle(Adaptor3d_HSurface)& S1, const TColStd_Array1OfReal& anUpars1, const TColStd_Array1OfReal& aVpars1, const Handle(Adaptor3d_HSurface)& S2, const TColStd_Array1OfReal& anUpars2, const TColStd_Array1OfReal& aVpars2); |
60 | |
61 | //! Compute the intersection. |
62 | Standard_EXPORT void Perform(); |
63 | |
64 | //! Compute the intersection. |
65 | Standard_EXPORT void Perform (const TColStd_Array1OfReal& Upars1, const TColStd_Array1OfReal& Vpars1, const TColStd_Array1OfReal& Upars2, const TColStd_Array1OfReal& Vpars2); |
66 | |
67 | Standard_EXPORT Standard_Boolean IsDone() const; |
68 | |
69 | Standard_EXPORT Standard_Integer NbSectionLines() const; |
70 | |
71 | Standard_EXPORT Standard_Integer NbPointsInLine (const Standard_Integer IndexLine) const; |
72 | |
73 | Standard_EXPORT void GetLinePoint (const Standard_Integer IndexLine, const Standard_Integer IndexPoint, Standard_Real& x, Standard_Real& y, Standard_Real& z, Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2, Standard_Real& incidence) const; |
74 | |
75 | Standard_EXPORT Standard_Integer NbTangentZones() const; |
76 | |
77 | Standard_EXPORT Standard_Integer NbPointsInTangentZone (const Standard_Integer IndexLine) const; |
78 | |
79 | Standard_EXPORT void GetTangentZonePoint (const Standard_Integer IndexLine, const Standard_Integer IndexPoint, Standard_Real& x, Standard_Real& y, Standard_Real& z, Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2) const; |
80 | |
81 | |
82 | |
83 | |
84 | protected: |
85 | |
86 | |
87 | |
88 | |
89 | |
90 | private: |
91 | |
92 | |
93 | //! Computes MaillageAffinage |
94 | Standard_EXPORT Standard_Boolean PerformMaillage (const Standard_Boolean isFirstFwd, const Standard_Boolean isSecondFwd, IntPolyh_PMaillageAffinage& MaillageS); |
95 | |
96 | //! The method PerformMaillage(..) is used to compute MaillageAffinage. It is |
97 | //! called four times (two times for each surface) for creation of inscribed |
98 | //! and circumscribed mesh for each surface. |
99 | Standard_EXPORT Standard_Boolean PerformMaillage (IntPolyh_PMaillageAffinage& MaillageS); |
100 | |
101 | //! Computes MaillageAffinage |
102 | Standard_EXPORT Standard_Boolean PerformMaillage (const Standard_Boolean isFirstFwd, const Standard_Boolean isSecondFwd, const TColStd_Array1OfReal& Upars1, const TColStd_Array1OfReal& Vpars1, const TColStd_Array1OfReal& Upars2, const TColStd_Array1OfReal& Vpars2, IntPolyh_PMaillageAffinage& MaillageS); |
103 | |
104 | //! The method PerformMaillage(..) is used to compute MaillageAffinage. It is |
105 | //! called four times (two times for each surface) for creation of inscribed |
106 | //! and circumscribed mesh for each surface. |
107 | Standard_EXPORT Standard_Boolean PerformMaillage (const TColStd_Array1OfReal& Upars1, const TColStd_Array1OfReal& Vpars1, const TColStd_Array1OfReal& Upars2, const TColStd_Array1OfReal& Vpars2, IntPolyh_PMaillageAffinage& MaillageS); |
108 | |
109 | //! This method analyzes arrays to find same couples. If some |
110 | //! are detected it leaves the couple in only one array |
111 | //! deleting from others. |
68b07699 |
112 | Standard_EXPORT void MergeCouples (IntPolyh_ListOfCouples& anArrayFF, IntPolyh_ListOfCouples& anArrayFR, IntPolyh_ListOfCouples& anArrayRF, IntPolyh_ListOfCouples& anArrayRR) const; |
42cf5bc1 |
113 | |
114 | //! Process default interference |
115 | Standard_EXPORT Standard_Boolean PerformStd (IntPolyh_PMaillageAffinage& MaillageS, Standard_Integer& NbCouples); |
116 | |
117 | //! Process advanced interference |
118 | Standard_EXPORT Standard_Boolean PerformAdv (IntPolyh_PMaillageAffinage& MaillageFF, IntPolyh_PMaillageAffinage& MaillageFR, IntPolyh_PMaillageAffinage& MaillageRF, IntPolyh_PMaillageAffinage& MaillageRR, Standard_Integer& NbCouples); |
119 | |
120 | //! Process default interference |
121 | Standard_EXPORT Standard_Boolean PerformStd (const TColStd_Array1OfReal& Upars1, const TColStd_Array1OfReal& Vpars1, const TColStd_Array1OfReal& Upars2, const TColStd_Array1OfReal& Vpars2, IntPolyh_PMaillageAffinage& MaillageS, Standard_Integer& NbCouples); |
122 | |
123 | //! Process advanced interference |
124 | Standard_EXPORT Standard_Boolean PerformAdv (const TColStd_Array1OfReal& Upars1, const TColStd_Array1OfReal& Vpars1, const TColStd_Array1OfReal& Upars2, const TColStd_Array1OfReal& Vpars2, IntPolyh_PMaillageAffinage& MaillageFF, IntPolyh_PMaillageAffinage& MaillageFR, IntPolyh_PMaillageAffinage& MaillageRF, IntPolyh_PMaillageAffinage& MaillageRR, Standard_Integer& NbCouples); |
125 | |
126 | |
127 | Standard_Boolean done; |
128 | Standard_Integer nbsectionlines; |
129 | Standard_Integer nbtangentzones; |
130 | IntPolyh_ArrayOfSectionLines TSectionLines; |
131 | IntPolyh_ArrayOfTangentZones TTangentZones; |
132 | Standard_Integer myNbSU1; |
133 | Standard_Integer myNbSV1; |
134 | Standard_Integer myNbSU2; |
135 | Standard_Integer myNbSV2; |
136 | Handle(Adaptor3d_HSurface) mySurf1; |
137 | Handle(Adaptor3d_HSurface) mySurf2; |
138 | |
139 | |
140 | }; |
141 | |
142 | |
143 | |
144 | |
145 | |
146 | |
147 | |
148 | #endif // _IntPolyh_Intersection_HeaderFile |