7fd59977 |
1 | -- File: ShapeAnalysis_TransferPrameters.cdl |
2 | -- Created: Mon Jun 21 09:44:37 1999 |
3 | -- Author: Galina KULIKOVA |
4 | -- <gka@nnov.matra-dtv.fr> |
5 | ---Copyright: Matra Datavision 1999 |
6 | |
7 | |
8 | class TransferParameters from ShapeAnalysis inherits TShared from MMgt |
9 | |
10 | ---Purpose: This tool is used for transferring parameters |
11 | -- from 3d curve of the edge to pcurve and vice versa. |
12 | -- |
13 | -- Default behaviour is to trsnafer parameters with help |
14 | -- of linear transformation: |
15 | -- |
16 | -- T2d = myShift + myScale * T3d |
17 | -- where |
18 | -- myScale = ( Last2d - First2d ) / ( Last3d - First3d ) |
19 | -- myShift = First2d - First3d * myScale |
20 | -- [First3d, Last3d] and [First2d, Last2d] are ranges of |
21 | -- edge on curve and pcurve |
22 | -- |
23 | -- This behaviour can be redefined in derived classes, for example, |
24 | -- using projection. |
25 | |
26 | uses |
27 | Edge from TopoDS, |
28 | Face from TopoDS, |
29 | HSequenceOfReal from TColStd, |
30 | HArray1OfReal from TColStd |
31 | |
32 | is |
33 | Create returns mutable TransferParameters from ShapeAnalysis; |
34 | ---Purpose: Creates empty tool with myShift = 0 and myScale = 1 |
35 | |
36 | Create(E : Edge from TopoDS; F : Face from TopoDS) |
37 | returns mutable TransferParameters from ShapeAnalysis; |
38 | ---Purpose: Creates a tool and initializes it with edge and face |
39 | |
40 | Init(me : mutable;E : Edge from TopoDS; F : Face from TopoDS ) is virtual; |
41 | ---Purpose: Initialize a tool with edge and face |
42 | |
43 | SetMaxTolerance(me:mutable; maxtol: Real); |
44 | ---Purpose: Sets maximal tolerance to use linear recomputation of |
45 | -- parameters. |
46 | |
47 | Perform(me : mutable; Params: HSequenceOfReal from TColStd; To2d : Boolean) |
48 | returns HSequenceOfReal from TColStd is virtual; |
49 | ---Purpose: Transfers parameters given by sequence Params from 3d curve |
50 | -- to pcurve (if To2d is True) or back (if To2d is False) |
51 | |
52 | Perform(me : mutable;Param : Real; To2d : Boolean) returns Real from Standard is virtual; |
53 | ---Purpose: Transfers parameter given by sequence Params from 3d curve |
54 | -- to pcurve (if To2d is True) or back (if To2d is False) |
55 | |
56 | TransferRange(me: mutable; newEdge : in out Edge from TopoDS; prevPar,currPar : Real; |
57 | To2d : Boolean) is virtual; |
58 | ---Purpose:Recomputes range of curves from NewEdge. |
59 | -- If Is2d equals True parameters are recomputed by curve2d else by curve3d. |
60 | |
61 | IsSameRange (me) returns Boolean is virtual; |
62 | ---Purpose: Returns True if 3d curve of edge and pcurve are SameRange |
63 | -- (in default implementation, if myScale == 1 and myShift == 0) |
64 | |
65 | fields |
66 | |
67 | myShift : Real; |
68 | myScale : Real; |
69 | myFirst : Real is protected; |
70 | myLast : Real is protected; |
71 | myFirst2d : Real; |
72 | myLast2d : Real; |
73 | myEdge : Edge from TopoDS is protected; |
74 | myFace : Face from TopoDS; |
75 | myMaxTolerance: Real is protected; |
76 | |
77 | end TransferParameters; |