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