0024047: Exception in TPrsStd_AISPresentation during destruction of TDocStd_Document
[occt.git] / src / AIS / AIS_TangentRelation.cdl
1 -- Created on: 1996-12-05
2 -- Created by: Jean-Pierre COMBE/Odile Olivier
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22 class TangentRelation from AIS inherits Relation from AIS
23         ---Purpose: A framework to display tangency constraints between
24         -- two or more Interactive Objects of the datum type.
25         -- The datums are normally faces or edges.
26 uses Shape                 from TopoDS,
27      Presentation          from Prs3d,
28      PresentationManager3d from PrsMgr,
29      Selection             from SelectMgr,
30      Pnt                   from gp,
31      Dir                   from gp,
32      Projector             from Prs3d,
33      Transformation        from Geom,
34      Plane                 from Geom
35
36 is
37     Create (aFShape     : Shape          from TopoDS;
38             aSShape     : Shape          from TopoDS;
39             aPlane      : Plane          from Geom;
40             anExternRef : Integer        from Standard = 0)
41             ---Purpose:  TwoFacesTangent or TwoEdgesTangent relation
42     returns mutable TangentRelation from AIS;
43         ---Purpose: Constructs an object to display tangency constraints.
44         -- This object is defined by the first shape aFShape, the
45         -- second shape aSShape, the plane aPlane and the index anExternRef.
46         -- aPlane serves as an optional axis.
47         -- anExternRef set to 0 indicates that there is no relation.
48     
49     ExternRef(me: mutable) returns Integer from Standard 
50     is static;
51         ---Purpose: Returns the external reference for tangency.
52         -- The values are as follows:
53         -- -   0 - there is no connection;
54         -- -   1 - there is a connection to the first shape;
55         -- -   2 - there is a connection to the second shape.
56         --   This reference is defined at construction time.
57     
58     SetExternRef(me: mutable;aRef : Integer from Standard)
59     is static;
60         ---Purpose: Sets the external reference for tangency, aRef.
61         -- The values are as follows:
62         -- -   0 - there is no connection;
63         -- -   1 - there is a connection to the first shape;
64         -- -   2 - there is a connection to the second shape.
65         -- This reference is initially defined at construction time.    
66
67     Compute(me            : mutable;
68             aPresentationManager: PresentationManager3d from PrsMgr;
69             aPresentation : mutable Presentation from Prs3d;
70             aMode         : Integer from Standard= 0) 
71     is redefined static private;
72     
73     Compute(me:mutable;
74                 aProjector: Projector from Prs3d;
75                 aPresentation: mutable Presentation from Prs3d)
76     is redefined static private;
77
78     Compute(me            : mutable;
79             aProjector    : Projector from Prs3d;
80             aTrsf         : Transformation from Geom;
81             aPresentation : mutable Presentation from Prs3d)
82     is redefined;
83         ---Purpose: computes the presentation according to a point of view
84         --          given by <aProjector>. 
85         --          To be Used when the associated degenerated Presentations 
86         --          have been transformed by <aTrsf> which is not a Pure
87         --          Translation. The HLR Prs can't be deducted automatically
88         --          WARNING :<aTrsf> must be applied
89         --           to the object to display before computation  !!!
90
91 -- Methods from SelectableObject
92
93     ComputeSelection(me         : mutable;
94                      aSelection : mutable Selection from SelectMgr;
95                      aMode      : Integer from Standard)is private;
96
97
98 --
99 --     Computation private methods
100 --
101
102     ComputeTwoFacesTangent(me: mutable;
103                            aPresentation : mutable Presentation from Prs3d)
104     is private;
105     
106     ComputeTwoEdgesTangent(me: mutable;
107                            aPresentation : mutable Presentation from Prs3d)
108     is private;
109     
110
111 fields
112
113     myAttach      : Pnt   from gp;
114     myDir         : Dir   from gp;
115     myLength      : Real  from Standard;
116     myExternRef   : Integer from Standard;  ---purpose: (0  no attachment,1  attachment with first shape, 2  attachment with second shape)
117     
118 end TangentRelation;
119