0027067: Avoid use of virtual methods for implementation of destructors in legacy...
[occt.git] / src / TopOpeBRep / TopOpeBRep_EdgesIntersector.hxx
CommitLineData
42cf5bc1 1// Created on: 1994-10-13
2// Created by: Jean Yves LEBEY
3// Copyright (c) 1994-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 _TopOpeBRep_EdgesIntersector_HeaderFile
18#define _TopOpeBRep_EdgesIntersector_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <TopoDS_Face.hxx>
25#include <GeomAbs_SurfaceType.hxx>
26#include <Standard_Boolean.hxx>
27#include <IntRes2d_Domain.hxx>
28#include <TopoDS_Edge.hxx>
29#include <Geom2dAdaptor_Curve.hxx>
30#include <Standard_Real.hxx>
31#include <Geom2dInt_GInter.hxx>
32#include <IntRes2d_SequenceOfIntersectionPoint.hxx>
33#include <IntRes2d_SequenceOfIntersectionSegment.hxx>
34#include <Standard_Integer.hxx>
35#include <TopoDS_Vertex.hxx>
36#include <TopOpeBRep_SequenceOfPoint2d.hxx>
37#include <TopOpeBRep_P2Dstatus.hxx>
38#include <TopAbs_Orientation.hxx>
39#include <TopOpeBRepDS_Config.hxx>
40class BRepAdaptor_HSurface;
41class TopoDS_Shape;
42class Bnd_Box;
43class Geom2dAdaptor_Curve;
44class BRepAdaptor_Surface;
45class TCollection_AsciiString;
46class TopOpeBRep_Point2d;
47class IntRes2d_IntersectionSegment;
48class IntRes2d_IntersectionPoint;
49class TopOpeBRepDS_Transition;
50class gp_Pnt;
51
52
53//! Describes the intersection of two edges on the same surface
54class TopOpeBRep_EdgesIntersector
55{
56public:
57
58 DEFINE_STANDARD_ALLOC
59
60
61 Standard_EXPORT TopOpeBRep_EdgesIntersector();
62
e6f550da 63 Standard_EXPORT virtual ~TopOpeBRep_EdgesIntersector();
42cf5bc1 64
65 Standard_EXPORT void SetFaces (const TopoDS_Shape& F1, const TopoDS_Shape& F2);
66
67 Standard_EXPORT void SetFaces (const TopoDS_Shape& F1, const TopoDS_Shape& F2, const Bnd_Box& B1, const Bnd_Box& B2);
68
69 Standard_EXPORT void ForceTolerances (const Standard_Real Tol1, const Standard_Real Tol2);
70
71 Standard_EXPORT void Dimension (const Standard_Integer D);
72
73 //! set working space dimension D = 1 for E &|| W, 2 for E in F
74 Standard_EXPORT Standard_Integer Dimension() const;
75
76 Standard_EXPORT void Perform (const TopoDS_Shape& E1, const TopoDS_Shape& E2, const Standard_Boolean ReduceSegments = Standard_True);
77
78 Standard_EXPORT Standard_Boolean IsEmpty();
79
80 //! true if at least one intersection segment.
81 Standard_EXPORT Standard_Boolean HasSegment() const;
82
83 //! = mySameDomain.
84 Standard_EXPORT Standard_Boolean SameDomain() const;
85
86 Standard_EXPORT const TopoDS_Shape& Edge (const Standard_Integer Index) const;
87
88 Standard_EXPORT const Geom2dAdaptor_Curve& Curve (const Standard_Integer Index) const;
89
90 Standard_EXPORT const TopoDS_Shape& Face (const Standard_Integer Index) const;
91
92 Standard_EXPORT const BRepAdaptor_Surface& Surface (const Standard_Integer Index) const;
93
94 Standard_EXPORT Standard_Boolean SurfacesSameOriented() const;
95
96 Standard_EXPORT Standard_Boolean FacesSameOriented() const;
97
98 Standard_EXPORT Standard_Real ToleranceMax() const;
99
100 Standard_EXPORT void Tolerances (Standard_Real& tol1, Standard_Real& tol2) const;
101
102 Standard_EXPORT Standard_Real Tolerance2() const;
103
104 Standard_EXPORT Standard_Integer NbPoints() const;
105
106 Standard_EXPORT Standard_Integer NbSegments() const;
107
108 Standard_EXPORT void Dump (const TCollection_AsciiString& str, const Standard_Integer ie1 = 0, const Standard_Integer ie2 = 0);
109
110 Standard_EXPORT void InitPoint (const Standard_Boolean selectkeep = Standard_True);
111
112 Standard_EXPORT Standard_Boolean MorePoint() const;
113
114 Standard_EXPORT void NextPoint();
115
116 Standard_EXPORT const TopOpeBRep_SequenceOfPoint2d& Points() const;
117
118 Standard_EXPORT const TopOpeBRep_Point2d& Point() const;
119
120 Standard_EXPORT const TopOpeBRep_Point2d& Point (const Standard_Integer I) const;
121
122 Standard_EXPORT virtual Standard_Boolean ReduceSegment (TopOpeBRep_Point2d& P1, TopOpeBRep_Point2d& P2, TopOpeBRep_Point2d& Pn) const;
123
124 Standard_EXPORT TopOpeBRep_P2Dstatus Status1() const;
125
126
127
128
129protected:
130
131
132
133
134
135private:
136
137
138 Standard_EXPORT void Find();
139
140 //! process if current edges can be considered as SameDomain
141 Standard_EXPORT Standard_Boolean ComputeSameDomain();
142
143 //! set field mySameDomain to B and return B value
144 Standard_EXPORT Standard_Boolean SetSameDomain (const Standard_Boolean B);
145
146 Standard_EXPORT void MakePoints2d();
147
148 Standard_EXPORT void ReduceSegments();
149
150 Standard_EXPORT const IntRes2d_IntersectionSegment& Segment1() const;
151
152 Standard_EXPORT Standard_Boolean IsOpposite1() const;
153
154 Standard_EXPORT void InitPoint1();
155
156 Standard_EXPORT Standard_Boolean MorePoint1() const;
157
158 Standard_EXPORT void NextPoint1();
159
160 Standard_EXPORT const IntRes2d_IntersectionPoint& Point1() const;
161
162 Standard_EXPORT TopOpeBRepDS_Transition Transition1 (const Standard_Integer Index, const TopAbs_Orientation EO) const;
163
164 Standard_EXPORT Standard_Real Parameter1 (const Standard_Integer Index) const;
165
166 Standard_EXPORT Standard_Boolean IsVertex1 (const Standard_Integer Index);
167
168 Standard_EXPORT const TopoDS_Shape& Vertex1 (const Standard_Integer Index);
169
170 Standard_EXPORT gp_Pnt Value1() const;
171
172 Standard_EXPORT Standard_Boolean IsPointOfSegment1() const;
173
174 Standard_EXPORT Standard_Integer Index1() const;
175
176 //! geometric configuration of E1,E2 at current intersection point :
177 //! UNSHGEOMETRY if the edges do not share geometry.
178 //! SAMEORIENTED if the edges share geometry and are same oriented.
179 //! DIFFORIENTED if the edges share geometry and are not same oriented.
180 Standard_EXPORT TopOpeBRepDS_Config EdgesConfig1() const;
181
182
183 TopoDS_Face myFace1;
184 TopoDS_Face myFace2;
185 Handle(BRepAdaptor_HSurface) mySurface1;
186 Handle(BRepAdaptor_HSurface) mySurface2;
187 GeomAbs_SurfaceType mySurfaceType1;
188 GeomAbs_SurfaceType mySurfaceType2;
189 Standard_Boolean mySurfacesSameOriented;
190 Standard_Boolean myFacesSameOriented;
191 IntRes2d_Domain myDomain1;
192 IntRes2d_Domain myDomain2;
193 TopoDS_Edge myEdge1;
194 TopoDS_Edge myEdge2;
195 Geom2dAdaptor_Curve myCurve1;
196 Geom2dAdaptor_Curve myCurve2;
197 Standard_Real myTol1;
198 Standard_Real myTol2;
199 Standard_Boolean myTolForced;
200 Geom2dInt_GInter myIntersector;
201 IntRes2d_SequenceOfIntersectionPoint mylpnt;
202 IntRes2d_SequenceOfIntersectionSegment mylseg;
203 Standard_Integer myNbPoints;
204 Standard_Integer myNbSegments;
205 Standard_Integer myTrueNbPoints;
206 Standard_Integer myPointIndex;
207 Standard_Integer myIsVertexPointIndex;
208 Standard_Integer myIsVertexIndex;
209 Standard_Boolean myIsVertexValue;
210 TopoDS_Vertex myIsVertexVertex;
211 Standard_Integer myDimension;
212 Standard_Boolean myHasSegment;
213 Standard_Boolean mySameDomain;
214 Standard_Boolean myf1surf1F_sameoriented;
215 Standard_Boolean myf2surf1F_sameoriented;
216 TopOpeBRep_SequenceOfPoint2d mysp2d;
217 Standard_Integer myip2d;
218 Standard_Integer mynp2d;
219 Standard_Boolean myselectkeep;
220
221
222};
223
224
225
226
227
228
229
230#endif // _TopOpeBRep_EdgesIntersector_HeaderFile