0025616: Avoid Classes using "new" to allocate Instances but not defining a copy...
[occt.git] / src / ProjLib / ProjLib_CompProjectedCurve.cdl
1 -- Created on: 1997-09-22
2 -- Created by: Roman BORISOV
3 -- Copyright (c) 1997-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 class CompProjectedCurve from ProjLib inherits Curve2d  from   Adaptor2d
18     
19 uses
20     HSurface from Adaptor3d, 
21     HCurve   from Adaptor3d,  
22     HCurve2d   from Adaptor2d,
23     Pnt2d  from  gp, 
24     Vec2d  from  gp, 
25     Pnt  from  gp,
26     Array1OfReal   from  TColStd,  
27     HSequenceOfHSequenceOfPnt  from  ProjLib,
28     Shape  from  GeomAbs, 
29     HArray1OfBoolean  from  TColStd, 
30     HArray1OfReal  from  TColStd,
31     CurveType  from  GeomAbs
32
33 raises
34     
35     OutOfRange          from Standard,
36     NoSuchObject        from Standard,
37     DomainError         from Standard,
38     NotImplemented      from Standard
39     
40 is
41  
42     Create  returns  CompProjectedCurve; 
43      
44      
45     Create(S   : HSurface from Adaptor3d; 
46            C   : HCurve   from Adaptor3d; 
47            TolU,  TolV:  Real  from  Standard) 
48     returns CompProjectedCurve; 
49     ---Purpose: try to find all solutions 
50
51     Create(S   : HSurface from Adaptor3d; 
52            C   : HCurve   from Adaptor3d; 
53            TolU,  TolV,  MaxDist:  Real  from  Standard) 
54     returns CompProjectedCurve;  
55     ---Purpose: this constructor tries to optimize the search using the 
56     -- assamption that maximum distance between surface and curve less or 
57     -- equal then MaxDist. 
58     -- if MaxDist < 0 then algorithm works as above.
59         
60     Init(me:  in  out) 
61     ---Purpose : computes a set of projected point and determine the 
62     -- continuous parts of the projected  curves. The  points  
63     -- corresponding to a projection on the bounds of the surface are  
64     -- included  in this set of points.    
65     is  static; 
66     
67     Load(me : in out;S : HSurface from Adaptor3d)
68         ---Purpose: Changes the surface.
69     is static;
70     
71     Load(me : in out; C : HCurve from Adaptor3d)
72         ---Purpose: Changes the  curve.
73     is static; 
74
75     GetSurface(me) returns HSurface from Adaptor3d
76         ---C++: return const &
77     is static;
78
79     GetCurve(me) returns  HCurve from Adaptor3d 
80         ---C++: return const &
81     is static;
82    
83     GetTolerance(me;  TolU,  TolV:  in  out  Real) 
84     is  static;
85      --
86     --     Global methods - Apply to the whole curve.
87     --     
88     NbCurves (me) returns Integer  from  Standard
89     ---Purpose: returns the number of continuous part of the projected curve
90     is static;
91
92     Bounds(me; Index : in Integer from  Standard; 
93              Udeb,Ufin : out Real  from  Standard) 
94     --- Purpose : returns the bounds of the continuous part corresponding to Index
95     raises  NoSuchObject
96     is static; 
97     
98     IsSinglePnt(me; Index:  Integer;  P :  out  Pnt2d from gp )  returns  Boolean  from  Standard 
99     --- Purpose : returns  True  if  part  of  projection with  number  Index is  a  single  point  and  writes  its  coordinats in  P 
100     raises  NoSuchObject
101     is  static;
102  
103     IsUIso(me; Index:  Integer;  U :  out  Real from Standard)  returns  Boolean  from  Standard 
104     --- Purpose : returns  True  if  part  of  projection with  number  Index is  an  u-isoparametric curve  of  input  surface     
105     raises  NoSuchObject
106     is  static;
107  
108     IsVIso(me; Index:  Integer;  V :  out  Real from Standard)  returns  Boolean  from  Standard 
109     --- Purpose : returns  True  if  part  of  projection with  number  Index is  an  v-isoparametric curve  of  input  surface 
110     raises  NoSuchObject
111     is  static;
112
113
114     Value(me; U : Real from  Standard) returns Pnt2d  from gp
115     --- Purpose : Computes the point of parameter U on the curve.
116     is  redefined  static;
117     
118     D0 (me; U : Real from  Standard; P : out Pnt2d from gp)
119          --- Purpose : Computes the point of parameter U on the curve. 
120     raises  DomainError 
121     is  redefined  static;
122     
123     D1 (me; U : Real from  Standard; P : out Pnt2d from gp ; V : out Vec2d from gp)
124          --- Purpose : Computes the point of parameter U on the curve with its
125          --  first derivative.
126      raises 
127         DomainError from Standard
128         --- Purpose : Raised if the continuity of the current interval
129         --  is not C1.
130
131     is  redefined   static; 
132      
133     D2 (me; U : Real from  Standard; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
134         --- Purpose :
135         --  Returns the point P of parameter U, the first and second
136         --  derivatives V1 and V2.
137      raises 
138         DomainError from Standard
139         --- Purpose : Raised if the continuity of the current interval
140         --  is not C2.
141      is  redefined static; 
142       
143     DN (me; U : Real; N : Integer)   returns Vec2d from gp
144         --- Purpose :
145         --  The returned vector gives the value of the derivative for the 
146         --  order of derivation N.
147      raises  
148         OutOfRange from Standard,
149         --- Purpose : Raised if N < 1. 
150         NotImplemented  from  Standard  
151         --- Purpose : Raised if N > 2.
152
153     is redefined  static; 
154  
155     FirstParameter(me)  returns  Real 
156         ---Purpose: Returns  the  first  parameter of  the  curve  C 
157         --  which  has  a  projection  on  S. 
158     is  redefined  static; 
159      
160     LastParameter(me)  returns  Real 
161         ---Purpose: Returns  the  last  parameter of  the  curve  C 
162         --  which  has  a  projection  on  S. 
163     is redefined  static; 
164
165     NbIntervals(me; S : Shape from GeomAbs) returns Integer
166         ---Purpose: Returns  the number  of  intervals which  define   
167         --  an  S  continuous  part  of  the  projected  curve
168    is  redefined  static;
169  
170     Trim(me;FirstParam,LastParam,Tol  :  Real)  returns HCurve2d  from  Adaptor2d
171         ---Purpose: Returns    a  curve equivalent   of  <me>  between
172         --          parameters <First>  and <Last>. <Tol>  is used  to
173         --          test for 2d points confusion.
174       raises
175         OutOfRange from Standard
176         ---Purpose: If <First> >= <Last> 
177      is redefined static;
178
179         
180     Intervals(me; T : in out Array1OfReal from TColStd; 
181                   S : Shape from GeomAbs)
182         ---Purpose: Returns  the  parameters  corresponding  to
183         --          S  discontinuities.
184         --          
185         --          The array must provide  enough room to  accomodate
186         --          for the parameters. i.e. T.Length() > NbIntervals()
187    raises
188         OutOfRange from Standard 
189    is   redefined  static;
190  
191     BuildIntervals(me;  S : Shape from GeomAbs)
192     raises
193         OutOfRange from Standard 
194     is private;
195  
196     MaxDistance(me;  Index:  Integer)   
197         ---Purpose:  returns  the  maximum  distance  between   
198         --  curve  to  project  and  surface
199     returns  Real 
200     raises  NoSuchObject;
201
202 --  Methods  for  debugging 
203     GetSequence(me) returns  HSequenceOfHSequenceOfPnt  from  ProjLib 
204      ---C++: return const &
205     is static; 
206
207     GetType(me) returns CurveType from GeomAbs
208         ---Purpose: Returns  the  type of the   curve  in the  current
209         --          interval :   Line,   Circle,   Ellipse, Hyperbola,
210         --          Parabola, BezierCurve, BSplineCurve, OtherCurve.
211     is redefined  static;
212
213 fields
214
215   mySurface     :  HSurface                  from  Adaptor3d;
216   myCurve       :  HCurve                    from  Adaptor3d;
217   myNbCurves    :  Integer                   from  Standard;
218   mySequence    :  HSequenceOfHSequenceOfPnt from  ProjLib;
219   myTolU        :  Real                      from  Standard;
220   myTolV        :  Real                      from  Standard;
221   myMaxDist     :  Real                      from  Standard;
222   myUIso        :  HArray1OfBoolean          from  TColStd;
223   myVIso        :  HArray1OfBoolean          from  TColStd;
224   mySnglPnts    :  HArray1OfBoolean          from  TColStd;
225   myMaxDistance :  HArray1OfReal             from  TColStd;
226   myTabInt      :  HArray1OfReal             from  TColStd; -- this field should be mutable
227
228 end CompProjectedCurve;