1c646a60b302208143dcc0c452acf42784c0b381
[occt.git] / src / AIS / AIS_MidPointRelation.cdl
1 -- Created on: 2000-10-20
2 -- Created by: Julia DOROVSKIKH
3 -- Copyright (c) 2000-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
20
21 class MidPointRelation from AIS inherits Relation from AIS
22
23         ---Purpose: presentation of equal distance to point myMidPoint
24
25 uses
26     ExtendedString        from TCollection,
27     Projector             from Prs3d,
28     Presentation          from Prs3d,
29     PresentationManager2d from PrsMgr,
30     PresentationManager3d from PrsMgr,
31     Selection             from SelectMgr,
32     GraphicObject         from Graphic2d,
33     Dir                   from gp,
34     Pnt                   from gp,
35     Lin                   from gp,
36     Circ                  from gp,
37     Elips                 from gp,
38     Plane                 from Geom,
39     Transformation        from Geom,
40     Shape                 from TopoDS
41
42 is
43     Create(aSymmTool   : Shape from TopoDS;
44            FirstShape  : Shape from TopoDS;
45            SecondShape : Shape from TopoDS;
46            aPlane      : Plane from Geom)
47     returns mutable MidPointRelation from AIS;
48
49     IsMovable(me) returns Boolean from Standard 
50     ---C++: inline       
51     is redefined;        
52
53     SetTool(me: mutable; aMidPointTool : Shape from TopoDS);
54     ---C++: inline
55
56     GetTool(me)
57     ---C++: inline
58     ---C++: return const &
59     returns Shape from TopoDS;
60
61 -- Methods from PresentableObject
62     Compute(me: mutable;
63             aPresentationManager: PresentationManager3d from PrsMgr;
64             aPresentation       : mutable Presentation from Prs3d;
65             aMode               : Integer from Standard= 0) 
66     is redefined static private;
67
68     Compute(me: mutable;
69             aProjector   : Projector from Prs3d;
70             aPresentation: mutable Presentation from Prs3d)
71     is redefined static private;     
72
73     Compute(me: mutable;
74             aPresentationManager: PresentationManager2d from PrsMgr;
75             aPresentation       : mutable GraphicObject from Graphic2d;
76             aMode               : Integer from Standard = 0)
77     is redefined static private;        
78
79     Compute(me: mutable;
80             aProjector    : Projector from Prs3d;
81             aTrsf         : Transformation from Geom;
82             aPresentation : mutable Presentation from Prs3d)
83     is redefined;
84     ---Purpose: Computes the presentation according to a point of view
85     --          given by <aProjector>. 
86     --          To be Used when the associated degenerated Presentations 
87     --          have been transformed by <aTrsf> which is not a Pure
88     --          Translation. The HLR Prs can't be deducted automatically
89     --          WARNING :<aTrsf> must be applied
90     --           to the object to display before computation  !!!
91
92 -- Methods from SelectableObject
93     ComputeSelection(me         : mutable;
94                      aSelection : mutable Selection from SelectMgr;
95                      aMode      : Integer from Standard)is private;
96
97 -- Computation private methods
98     ComputeFaceFromPnt(me: mutable; aprs : mutable Presentation from Prs3d; first : Boolean from Standard)
99     is private;
100
101     ComputeEdgeFromPnt(me: mutable; aprs : mutable Presentation from Prs3d; first : Boolean from Standard)
102     is private;
103
104     ComputeVertexFromPnt(me: mutable; aprs : mutable Presentation from Prs3d; first : Boolean from Standard)
105     is private;
106
107    
108     ComputePointsOnLine(me: mutable; aLin : Lin from gp;
109                                      first : Boolean from Standard)
110     is private;
111
112     ComputePointsOnLine(me: mutable; pnt1,pnt2 : Pnt from gp;
113                                      first : Boolean from Standard)
114     is private;
115
116     ComputePointsOnCirc(me: mutable; aCirc : Circ from gp; pnt1,pnt2 : Pnt from gp;
117                                      first : Boolean from Standard)
118     is private;
119
120     ComputePointsOnElips(me: mutable; anEll : Elips from gp; pnt1,pnt2 : Pnt from gp;
121                                       first : Boolean from Standard)
122     is private;
123     ---Purpose: ComputePointsOn... methods set myFAttach, myFirstPnt and myLastPnt
124     -- from the following initial data: curve, end points, myMidPoint.
125     -- End points (pnt1 & pnt2) and curve define the trimmed curve.
126     -- If end points are equal, curve is not trimmed (line - special case).
127     -- 
128     --     .------. pnt2
129     --    /        \
130     --   .  circle  . myLastPnt
131     --   |          |
132     --   . pnt1     . myFAttach
133     --    \   arc  /          . myMidPoint
134     --     .______. myFirstPnt
135 fields
136     myTool     : Shape from TopoDS;
137     myMidPoint : Pnt   from gp; -- point of symmetry
138
139     myFAttach  : Pnt   from gp; -- position on myFShape to be connected with myMidPoint by segment
140     myFirstPnt1 : Pnt   from gp; -- points on myFShape,
141     myFirstPnt2 : Pnt   from gp; -- defining a segment of it to be drawn
142
143     mySAttach  : Pnt   from gp; -- position on mySShape to be connected with myMidPoint by segment
144     mySecondPnt1  : Pnt   from gp; -- points on mySShape,
145     mySecondPnt2  : Pnt   from gp; -- defining a segment of it to be drawn
146
147 end MidPointRelation;