7fd59977 |
1 | -- File: Polygon2dGen.cdl |
2 | -- Created: Mon Oct 19 11:51:16 1992 |
3 | -- Author: Laurent BUCHARD |
7fd59977 |
4 | ---Copyright: Matra Datavision 1992 |
5 | |
6 | |
7 | generic class Polygon2dGen from IntCurve ( |
8 | TheCurve as any; |
9 | TheCurveTool as any) -- as CurveTool from IntCurve(TheCurve) |
10 | |
11 | ---Purpose: Describe a polyline as a topology to compute the |
12 | -- interference beetween two polylines 2 dimension. |
7fd59977 |
13 | |
14 | ---Level: Internal |
15 | |
9530af27 |
16 | inherits Polygon2d from Intf |
17 | |
7fd59977 |
18 | uses Pnt2d from gp, |
19 | Box2d from Bnd, |
20 | Array1OfPnt2d from TColgp, |
9530af27 |
21 | Array1OfReal from TColStd, |
22 | Array1OfInteger from TColStd, |
23 | Domain from IntRes2d |
7fd59977 |
24 | |
25 | raises OutOfRange from Standard |
26 | |
7fd59977 |
27 | is |
28 | |
29 | Create (Curve : TheCurve; |
30 | NbPnt : Integer from Standard; |
31 | Domain : Domain from IntRes2d; |
32 | Tol : Real from Standard) |
33 | |
34 | ---Purpose: Compute a polygon on the domain of the curve. |
35 | |
36 | |
37 | returns Polygon2dGen from IntCurve; |
38 | |
39 | Create (Curve : TheCurve; |
40 | NbPnt : Integer from Standard; |
41 | Domain : Domain from IntRes2d; |
42 | Tol : Real from Standard; |
43 | OtherBox : Box2d from Bnd) |
44 | |
45 | ---Purpose: Compute a polygon on the domain of the |
46 | -- curve. parameters of the begin and |
47 | -- end of the curve (and its polygon) are |
48 | -- adjusted to lie in the OtherBox. |
49 | |
50 | returns Polygon2dGen from IntCurve; |
51 | |
52 | |
53 | ComputeWithBox(me : in out; |
54 | Curve : TheCurve; |
55 | OtherBox : Box2d from Bnd) |
56 | |
57 | ---Purpose: The current polygon is modified if most |
58 | -- of the points of the polygon are are |
59 | -- outside the box <OtherBox>. In this |
60 | -- situation, bounds are computed to build |
61 | -- a polygon inside or near the OtherBox. |
62 | is static; |
63 | |
7fd59977 |
64 | DeflectionOverEstimation(me) |
65 | returns Real from Standard |
66 | ---C++: inline |
9530af27 |
67 | is redefined virtual; |
7fd59977 |
68 | |
69 | SetDeflectionOverEstimation(me: in out; x:Real from Standard) |
70 | ---C++: inline |
71 | is static; |
72 | |
73 | Closed (me : in out; clos : Boolean from Standard) |
74 | ---C++: inline |
75 | is static; |
76 | |
7fd59977 |
77 | NbSegments (me) |
78 | returns Integer |
79 | ---C++: inline |
9530af27 |
80 | is redefined virtual; |
7fd59977 |
81 | ---Purpose: Give the number of Segments in the polyline. |
9530af27 |
82 | |
83 | Segment (me; theIndex : in Integer from Standard; |
84 | theBegin, theEnd : in out Pnt2d from gp) |
85 | raises OutOfRange from Standard is redefined virtual; |
86 | ---Purpose: Returns the points of the segment <Index> in the Polygon. |
7fd59977 |
87 | |
88 | -- Implementation : |
89 | |
90 | |
91 | InfParameter(me) |
92 | |
93 | ---Purpose: Returns the parameter (On the curve) |
94 | -- of the first point of the Polygon |
95 | |
96 | returns Real from Standard |
97 | ---C++: inline |
98 | is static; |
99 | |
100 | SupParameter(me) |
101 | |
102 | ---Purpose: Returns the parameter (On the curve) |
103 | -- of the last point of the Polygon |
104 | |
105 | returns Real from Standard |
106 | ---C++: inline |
107 | is static; |
108 | |
109 | |
110 | AutoIntersectionIsPossible(me) |
111 | returns Boolean from Standard |
112 | is static; |
113 | |
114 | ApproxParamOnCurve(me; |
115 | Index : in Integer from Standard; |
116 | ParamOnLine : in Real from Standard) |
117 | |
118 | returns Real from Standard |
119 | |
120 | raises OutOfRange from Standard |
121 | is static; |
122 | |
123 | ---Purpose: Give an approximation of the parameter on the curve |
124 | -- according to the discretization of the Curve. |
125 | |
126 | |
127 | CalculRegion (me; |
128 | x : Real from Standard ; |
129 | y : Real from Standard ; |
130 | x1 : Real from Standard ; |
131 | x2 : Real from Standard ; |
132 | y1 : Real from Standard ; |
133 | y2 : Real from Standard ) |
134 | returns Integer from Standard ; |
135 | ---C++: inline |
136 | |
137 | Dump (me) |
138 | is static; |
139 | |
140 | |
9530af27 |
141 | fields TheDeflection : Real from Standard; |
7fd59977 |
142 | NbPntIn : Integer from Standard; |
9530af27 |
143 | TheMaxNbPoints: Integer from Standard; |
7fd59977 |
144 | ThePnts : Array1OfPnt2d from TColgp; |
9530af27 |
145 | TheParams : Array1OfReal from TColStd; |
146 | TheIndex : Array1OfInteger from TColStd; |
147 | ClosedPolygon : Boolean from Standard; |
148 | |
7fd59977 |
149 | --- To compute an approximate parameter on the Curve |
150 | -- |
151 | Binf : Real from Standard; |
152 | Bsup : Real from Standard; |
7fd59977 |
153 | |
154 | end Polygon2dGen; |