b311480e |
1 | -- Created on: 2008-12-28 |
2 | -- Created by: Roman Lygin |
3 | -- Copyright (c) 2008-2012 OPEN CASCADE SAS |
4 | -- |
5 | -- The content of this file is subject to the Open CASCADE Technology Public |
6 | -- License Version 6.5 (the "License"). You may not use the content of this file |
7 | -- except in compliance with the License. Please obtain a copy of the License |
8 | -- at http://www.opencascade.org and read it completely before using this file. |
9 | -- |
10 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | -- |
13 | -- The Original Code and all software distributed under the License is |
14 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | -- Initial Developer hereby disclaims all such warranties, including without |
16 | -- limitation, any warranties of merchantability, fitness for a particular |
17 | -- purpose or non-infringement. Please see the License for the specific terms |
18 | -- and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | -- roman.lygin@gmail.com |
7fd59977 |
21 | |
22 | generic class CurveCache from Extrema |
23 | (Curve as any; -- Adaptor3d_Curve or Adaptor2d_Curve2d |
24 | Pnt as any; -- gp_Pnt or gp_Pnt2d |
25 | ArrayOfPnt as Transient from Standard) -- TColgp_HArray1OfPnt or TColgp_HArray1OfPnt2d |
26 | inherits Transient from Standard |
27 | |
28 | ---Purpose: |
29 | |
afed7fd7 |
30 | uses |
31 | Array1OfReal from TColStd, |
32 | HArray1OfReal from TColStd |
33 | |
7fd59977 |
34 | raises NotDone from StdFail |
35 | |
36 | is |
37 | |
38 | Create returns mutable CurveCache from Extrema; |
39 | |
40 | Create (theC: Curve; theUFirst, theULast: Real; theNbSamples: Integer; |
41 | theToCalculate: Boolean)returns mutable CurveCache from Extrema; |
42 | |
afed7fd7 |
43 | Create (theC: Curve; theUFirst, theULast: Real; |
44 | IntervalsCN: Array1OfReal from TColStd; |
45 | StartIndex, EndIndex: Integer; |
46 | Coeff: Real) |
47 | returns mutable CurveCache from Extrema; |
48 | |
7fd59977 |
49 | SetCurve (me: mutable; theC: Curve; theNbSamples: Integer; |
50 | theToCalculate: Boolean); |
51 | ---Purpose: Sets the \a theRank-th curve (1 or 2) and its parameters. |
52 | -- Caches sample points for further reuse in Perform(). |
53 | |
54 | SetCurve (me: mutable; theC: Curve; |
55 | theUFirst, theULast: Real; theNbSamples: Integer; theToCalculate: Boolean); |
56 | ---Purpose: |
57 | |
58 | SetRange (me: mutable; Uinf, Usup: Real; theToCalculate: Boolean); |
59 | ---Purpose: |
60 | |
61 | CalculatePoints (me: mutable); |
62 | ---Purpose: Calculates points along the curve and stores |
63 | -- them in internal array for further reuse in Perform(). |
64 | |
65 | IsValid (me) returns Boolean; |
66 | ---C++: inline |
67 | ---Purpose: Returns True if the points array has already been calculated |
68 | -- for specified curve and range |
69 | |
afed7fd7 |
70 | Parameters (me) returns HArray1OfReal from TColStd |
71 | raises NotDone from StdFail; |
72 | ---C++: inline |
73 | ---C++: return const & |
74 | ---Purpose: Raises StdFail_NotDone if points have not yet been calculated. |
75 | |
7fd59977 |
76 | Points (me) returns ArrayOfPnt |
77 | raises NotDone from StdFail; |
78 | ---C++: inline |
79 | ---C++: return const & |
80 | ---Purpose: Raises StdFail_NotDone if points have not yet been calculated. |
81 | |
82 | CurvePtr (me) returns Address from Standard; |
83 | ---C++: inline |
84 | ---Purpose: |
85 | |
86 | NbSamples (me) returns Integer; |
87 | ---C++: inline |
88 | ---Purpose: |
89 | |
90 | FirstParameter (me) returns Real; |
91 | ---C++: inline |
92 | ---Purpose: |
93 | |
94 | LastParameter (me) returns Real; |
95 | ---C++: inline |
96 | ---Purpose: |
97 | |
98 | TrimFirstParameter (me) returns Real; |
99 | ---C++: inline |
100 | ---Purpose: For bounded curves returns FirstParameter(), for unbounded - -1e-10. |
101 | |
102 | TrimLastParameter (me) returns Real; |
103 | ---C++: inline |
104 | ---Purpose: For bounded curves returns LastParameter(), for unbounded - 1e-10. |
105 | |
106 | fields |
107 | |
108 | myC : Address from Standard; |
109 | myFirst : Real; |
110 | myLast : Real; |
111 | myTrimFirst : Real; |
112 | myTrimLast : Real; |
113 | myNbSamples : Integer; |
afed7fd7 |
114 | myParamArray : HArray1OfReal from TColStd; |
7fd59977 |
115 | myPntArray : ArrayOfPnt; |
116 | myIsArrayValid: Boolean; |
117 | |
118 | end; |