Test for 0022778: Bug in BRepMesh
[occt.git] / src / Intf / Intf_InterferencePolygon3d.cdl
1 -- Created on: 1992-09-29
2 -- Created by: Didier PIFFAULT
3 -- Copyright (c) 1992-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
21
22
23 generic class InterferencePolygon3d from Intf 
24     (Polygon3d1 as any;
25      ToolPolygon3d1 as any;         -- as ToolPolygon(Pnt,Polygon3d1,Box)
26      Polygon3d2 as any;
27      ToolPolygon3d2 as any)         -- as ToolPolygon(Pnt,Polygon3d2,Box)
28     inherits Interference from Intf
29         
30         ---Purpose: Computes the  interference between two polygons  or the
31         --          self interference of a polygon in 3 dimensions .  In 3
32         --          dimensions the result can be  a common perpendicular ,
33         --          an  orthogonal  projection or  a  real  intersections.
34         --          There  are two  different  instantiation arguments  to
35         --          authorize an interference  between two  polygons  from
36         --          differents origin.  Ex :  to intersect a curve polygon
37         --          with an  algorithmic   curve   from numerical  walking
38         --          between two surfaces.
39
40 uses    Pnt from gp,
41         SectionPoint      from Intf,
42         SeqOfSectionPoint from Intf,
43         SectionLine       from Intf,
44         SeqOfSectionLine  from Intf
45
46 raises  OutOfRange from Standard
47
48
49 is
50 -- Interface :
51
52     Create          returns InterferencePolygon3d from Intf;
53     ---Purpose: Constructs an empty interference of 3d Polygon.
54
55
56     Create         (Obje1 : in Polygon3d1 ;Obje2 : in Polygon3d2) 
57                     returns InterferencePolygon3d from Intf;
58     ---Purpose: Constructs and computes an interference between two Polygons.
59
60
61     Create         (Obje : in Polygon3d1) 
62                     returns InterferencePolygon3d from Intf;
63     ---Purpose: Constructs and computes the self interference of a Polygon.
64
65
66     Perform        (me   : in out;
67                     Obje1 : in Polygon3d1 ;Obje2 : in Polygon3d2);
68     ---Purpose: Computes an interference between two Polygons.
69
70
71     Perform        (me   : in out;
72                     Obje : in Polygon3d1);
73     ---Purpose: Computes the auto interference of a Polygon.
74
75
76     NbResults      (me)
77                     returns Integer is static;
78     ---Purpose: Gives  the number  of common  Perpendiculars or orthogonal
79     --          projections between the two polygons.
80
81     ResultLine     (me;
82                     Index      : in Integer)
83                     returns SectionLine from Intf
84                     raises OutOfRange from Standard
85                     is static;
86     ---Purpose: Gives the  segment of address  <Index> in the interference
87     --          representing    the     perpendicular  or the   orthogonal
88     --          projection .
89     --          
90     ---C++: return const &
91
92
93     ResultValue    (me;
94                     Index      : in Integer)
95                     returns Real from Standard
96                     raises OutOfRange from Standard
97                     is static;
98     ---Purpose: Gives the distance between the two polygons 
99
100
101     MinimalDistance(me)
102                     returns Real from Standard
103                     is static;
104     ---Purpose: Gives   the distance  between  the  two  polygon3d at  the
105     --          perpendicular or projection of minimal length.
106
107
108     MinimalResult  (me)
109                     returns Integer from Standard
110                     is static;
111     ---Purpose: Give the  perpendicular or projection  of minimal  length.
112     --          WARNING : if there  are points of intersection the minimal
113     --          result is one of them and this function is unusuable.
114
115
116 -- Implementation :
117
118     Interference   (me         : in out;
119                     Obje1      : in Polygon3d1;
120                     Obje2      : in Polygon3d2)
121                     is private;
122
123     Interference   (me         : in out;
124                     Obje       : in Polygon3d1)
125                     is private;
126
127     CommonPerpen   (me         : in out;
128                     BegO : in Pnt from gp;
129                     EndO : in Pnt from gp;
130                     BegT : in Pnt from gp;
131                     EndT : in Pnt from gp)
132                     is private;
133     ---Purpose: Computes   the common  perpendicular   between the two
134     --          segments <BegO><EndO> and <BegT><EndT>.
135
136     Projections    (me         : in out;
137                     BegO : in Pnt from gp;
138                     EndO : in Pnt from gp;
139                     BegT : in Pnt from gp;
140                     EndT : in Pnt from gp)
141                     is private;
142     ---Purpose: Computes  the    different  orthogonal projections  between
143     --          segment <BegO><EndO> and  points <BegT>,<EndT> and segment
144     --          <BegT><EndT> and points <BegO>,<EndO>.
145
146
147 fields  IndexMin             : Integer from Standard;
148         MinimalDist          : Real from Standard;
149         iObje1, iObje2       : Integer from Standard;
150         beginOfNotClosedFirst: Boolean from Standard;
151         beginOfNotClosedSecon: Boolean from Standard;
152
153
154 end InterferencePolygon3d;