b311480e |
1 | -- Created on: 1994-10-13 |
2 | -- Created by: Jean Yves LEBEY |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | class EdgesIntersector from TopOpeBRep |
23 | |
24 | uses |
25 | |
26 | Pnt from gp, |
27 | Orientation from TopAbs, |
28 | Shape from TopoDS, |
29 | Face from TopoDS, |
30 | Edge from TopoDS, |
31 | Vertex from TopoDS, |
32 | Transition from TopOpeBRepDS, |
33 | Config from TopOpeBRepDS, |
34 | Curve from Geom2dAdaptor, |
35 | Domain from IntRes2d, |
36 | IntersectionPoint from IntRes2d, |
37 | IntersectionSegment from IntRes2d, |
38 | Transition from IntRes2d, |
39 | GInter from Geom2dInt, |
40 | SequenceOfIntersectionPoint from IntRes2d, |
41 | SequenceOfIntersectionSegment from IntRes2d, |
42 | P2Dstatus from TopOpeBRep, |
43 | Point2d from TopOpeBRep, |
44 | SequenceOfPoint2d from TopOpeBRep, |
45 | SurfaceType from GeomAbs, |
46 | Surface from BRepAdaptor, |
47 | HSurface from BRepAdaptor, |
48 | AsciiString from TCollection, |
49 | Box from Bnd |
50 | |
51 | is |
52 | |
53 | Create returns EdgesIntersector from TopOpeBRep; |
54 | |
55 | Delete(me:out) is virtual; |
56 | ---C++: alias "Standard_EXPORT virtual ~TopOpeBRep_EdgesIntersector(){Delete() ; }" |
57 | |
58 | SetFaces(me : in out; F1,F2 : Shape); |
59 | SetFaces(me : in out; F1,F2 : Shape;B1,B2 : Box from Bnd); |
60 | |
61 | ForceTolerances(me : in out; Tol1,Tol2 : Real); -- Set myTol1,myTol2 |
62 | Dimension(me : in out; D:Integer); |
63 | Dimension(me) returns Integer; |
64 | |
65 | ---Purpose: set working space dimension D = 1 for E &|| W, 2 for E in F |
66 | Perform(me : in out; E1,E2 : Shape; |
67 | ReduceSegments : Boolean = Standard_True); |
68 | |
69 | IsEmpty(me : in out) returns Boolean; |
70 | HasSegment(me) returns Boolean; ---Purpose: true if at least one intersection segment. |
71 | SameDomain(me) returns Boolean; ---Purpose: = mySameDomain. |
72 | Edge(me; Index : Integer) returns Shape; ---C++: return const & |
73 | Curve(me; Index : Integer) returns Curve from Geom2dAdaptor; ---C++: return const & |
74 | Face(me; Index : Integer) returns Shape; ---C++: return const & |
75 | Surface(me; Index : Integer) returns Surface from BRepAdaptor; ---C++: return const & |
76 | SurfacesSameOriented(me) returns Boolean; |
77 | FacesSameOriented(me) returns Boolean; |
78 | |
79 | ToleranceMax(me) returns Real; |
80 | Tolerances(me;tol1,tol2 : out Real); -- = myTol1,myTol2 |
81 | Tolerance2(me) returns Real; -- = myTol2 |
82 | NbPoints(me) returns Integer; -- = nyNbPoints |
83 | NbSegments(me) returns Integer; -- = myNbSegments |
84 | Dump(me:in out;str:AsciiString from TCollection;ie1:Integer = 0;ie2:Integer = 0); |
85 | |
86 | -- Intersection points |
87 | InitPoint(me : in out; selectkeep : Boolean = Standard_True); |
88 | MorePoint(me) returns Boolean; |
89 | NextPoint(me : in out); |
90 | Find(me : in out) is private; |
91 | Points(me) returns SequenceOfPoint2d from TopOpeBRep;---C++: return const & |
92 | Point(me) returns Point2d from TopOpeBRep;---C++: return const & |
93 | Point(me;I:Integer) returns Point2d from TopOpeBRep;---C++: return const & |
94 | |
95 | -- ------- |
96 | -- private |
97 | -- ------- |
98 | |
99 | ComputeSameDomain(me : in out) returns Boolean is private; |
100 | ---Purpose: process if current edges can be considered as SameDomain |
101 | SetSameDomain(me : in out; B : Boolean) returns Boolean is private; |
102 | ---Purpose: set field mySameDomain to B and return B value |
103 | MakePoints2d(me:in out) is private; |
104 | ReduceSegments(me:in out) is private; |
105 | ReduceSegment(me;P1,P2:out Point2d;Pn:out Point2d) returns Boolean is virtual; |
106 | |
107 | Segment1(me) returns IntersectionSegment from IntRes2d is private; ---C++: return const & |
108 | IsOpposite1(me) returns Boolean is private; |
109 | InitPoint1(me : in out) is private; |
110 | MorePoint1(me) returns Boolean is private; |
111 | NextPoint1(me : in out) is private; |
112 | Point1(me) returns IntersectionPoint from IntRes2d is private;---C++: return const & |
113 | Status1(me) returns P2Dstatus from TopOpeBRep; |
114 | Transition1(me; Index : Integer; EO : Orientation) returns Transition from TopOpeBRepDS is private; |
115 | Parameter1(me; Index : Integer) returns Real is private; |
116 | IsVertex1(me : in out; Index : Integer) returns Boolean is private; |
117 | Vertex1(me : in out; Index : Integer) returns Shape is private;---C++ : return const & |
118 | Value1(me) returns Pnt from gp is private; |
119 | IsPointOfSegment1(me) returns Boolean is private; |
120 | Index1(me) returns Integer is private; |
121 | EdgesConfig1(me) returns Config from TopOpeBRepDS is private; |
122 | ---Purpose: geometric configuration of E1,E2 at current intersection point : |
123 | -- UNSHGEOMETRY if the edges do not share geometry. |
124 | -- SAMEORIENTED if the edges share geometry and are same oriented. |
125 | -- DIFFORIENTED if the edges share geometry and are not same oriented. |
126 | |
127 | |
128 | fields |
129 | |
130 | myFace1 : Face from TopoDS; |
131 | myFace2 : Face from TopoDS; |
132 | mySurface1 : HSurface from BRepAdaptor; |
133 | mySurface2 : HSurface from BRepAdaptor; |
134 | mySurfaceType1 : SurfaceType from GeomAbs; |
135 | mySurfaceType2 : SurfaceType from GeomAbs; |
136 | mySurfacesSameOriented : Boolean; |
137 | myFacesSameOriented : Boolean; |
138 | myDomain1 : Domain from IntRes2d; |
139 | myDomain2 : Domain from IntRes2d; |
140 | |
141 | myEdge1 : Edge from TopoDS; |
142 | myEdge2 : Edge from TopoDS; |
143 | myCurve1 : Curve from Geom2dAdaptor; |
144 | myCurve2 : Curve from Geom2dAdaptor; |
145 | |
146 | myTol1 : Real; |
147 | myTol2 : Real; |
148 | myTolForced : Boolean; |
149 | myIntersector : GInter from Geom2dInt; |
150 | |
151 | mylpnt : SequenceOfIntersectionPoint from IntRes2d; |
152 | mylseg : SequenceOfIntersectionSegment from IntRes2d; |
153 | |
154 | myNbPoints : Integer; -- myIntersector.NbPoints() |
155 | myNbSegments : Integer; -- myIntersector.Segments() |
156 | |
157 | myTrueNbPoints : Integer; -- myNbPoints + (2*myNbSegments) |
158 | myPointIndex : Integer; -- [1..myTrueNbPoints] |
159 | |
160 | -- IsVertex() private fields |
161 | myIsVertexPointIndex : Integer; |
162 | myIsVertexIndex : Integer; -- value = 0,1,2 |
163 | myIsVertexValue : Boolean; |
164 | myIsVertexVertex : Vertex from TopoDS; |
165 | |
166 | myDimension : Integer; |
167 | |
168 | -- tangent edges |
169 | myHasSegment : Boolean; |
170 | mySameDomain : Boolean; |
171 | |
172 | myf1surf1F_sameoriented : Boolean; |
173 | myf2surf1F_sameoriented : Boolean; |
174 | |
175 | mysp2d : SequenceOfPoint2d from TopOpeBRep; |
176 | myip2d, mynp2d : Integer; |
177 | myselectkeep : Boolean; |
178 | |
179 | end EdgesIntersector from TopOpeBRep; |