0025292: Face/Face intersection algorithm gives different results for different order...
[occt.git] / src / Extrema / Extrema_FuncExtCC.cdl
1 -- Created on: 1991-07-24
2 -- Created by: Michel CHAUVAT
3 -- Copyright (c) 1991-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 private generic class FuncExtCC from Extrema 
18 (Curve1    as any;
19  Tool1     as any;-- as ToolCurve(Curve1);
20  Curve2    as any;
21  Tool2     as any;-- as ToolCurve(Curve2);
22  POnC      as any;
23  Pnt       as any;
24  Vec       as any )
25  
26  
27 inherits FunctionSetWithDerivatives from math
28     ---Purpose: Function allows finding extrema of the distance between 2 curves.
29
30 uses    Vector            from math,
31         Matrix            from math,
32         SequenceOfReal    from TColStd
33
34 raises  OutOfRange from Standard
35
36 private class SeqPOnC instantiates Sequence from TCollection(POnC);
37
38 is
39
40     Create (thetol: Real = 1.0e-10) returns FuncExtCC;
41     ---Purpose:
42
43     Create (C1: Curve1; C2: Curve2; thetol: Real = 1.0e-10) returns FuncExtCC;
44     ---Purpose:
45
46     SetCurve (me: in out; theRank: Integer; C1: Curve1);
47     ---Purpose:
48
49     SetTolerance (me: in out; theTol: Real);
50     ---C++: inline
51     ---Purpose:
52
53     NbVariables (me) returns Integer is redefined;
54     ---C++: inline
55
56     NbEquations (me) returns Integer is redefined;
57     ---C++: inline
58
59     Value (me: in out; UV: Vector; F: out Vector) returns Boolean is redefined;
60         ---Purpose: Calculate Fi(U,V).
61
62     Derivatives (me: in out; UV: Vector; DF: out Matrix)
63         returns Boolean;
64         ---Purpose: Calculate Fi'(U,V).
65
66     Values (me: in out; UV: Vector; F: out Vector; DF: out Matrix)
67         returns Boolean;
68         ---Purpose: Calculate Fi(U,V) and Fi'(U,V).
69
70     GetStateNumber (me: in out) returns Integer
71         ---Purpose: Save the found extremum.
72         is redefined;
73
74     NbExt (me) returns Integer;
75         ---C++: inline
76         ---Purpose: Return the number of found extrema.
77
78     SquareDistance (me; N: Integer) returns Real
79         ---C++: inline
80         ---Purpose: Return the value of the Nth distance.
81         raises  OutOfRange;
82                 -- if N < 1 or N > NbExt(me).
83
84     Points (me; N: Integer; P1,P2: out POnC)
85         ---Purpose: Return the points of the Nth extreme distance.
86         raises  OutOfRange;
87                 -- if N < 1 or N > NbExt(me).
88
89     CurvePtr (me; theRank: Integer) returns Address;
90         ---C++: inline
91         ---Purpose: Returns a pointer to the curve specified in the constructor
92         --          or in SetCurve() method.
93
94     Tolerance (me) returns Real;
95         ---C++: inline
96         ---Purpose: Returns a tolerance specified in the constructor
97         --          or in SetTolerance() method.
98
99     SubIntervalInitialize(me: in out; theUfirst, theUlast: Vector);
100         ---Purpose: Determines of boundaries of subinterval for find of root.
101     
102     SearchOfTolerance(me: in out; C: Address from Standard) returns Real from Standard;
103         ---Purpose: Computes a Tol value. If 1st derivative of curve
104         --          |D1|<Tol, it is considered D1=0.      
105
106
107 fields
108     myC1    : Address from Standard;
109     myC2    : Address from Standard;
110     myTol   : Real;
111     myU     : Real;        
112     myV     : Real;        
113     myP1    : Pnt;   -- current point C1(U)
114     myP2    : Pnt;   -- current point C2(U)
115     myDu    : Vec;   -- current D1 C1(U)
116     myDv    : Vec;   -- current D1 C2(V)
117
118     mySqDist: SequenceOfReal from TColStd;
119     myPoints: SeqPOnC;
120
121     myTolC1,myTolC2: Real from Standard;  -- toolerance for derivate
122
123 --Supremum of search 1st non-zero derivative    
124     myMaxDerivOrderC1, myMaxDerivOrderC2: Integer from Standard;
125     
126 --boundaries of subinterval for find of root
127     myUinfium, myUsupremum: Real from Standard; -- C1 curve
128     myVinfium, myVsupremum: Real from Standard; -- C2 curve
129
130
131 end FuncExtCC;