b311480e |
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 | |
7fd59977 |
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 | PresentationManager2d from PrsMgr, |
35 | GraphicObject from Graphic2d, |
36 | Plane from Geom |
37 | |
38 | is |
39 | Create (aFShape : Shape from TopoDS; |
40 | aSShape : Shape from TopoDS; |
41 | aPlane : Plane from Geom; |
42 | anExternRef : Integer from Standard = 0) |
43 | ---Purpose: TwoFacesTangent or TwoEdgesTangent relation |
44 | returns mutable TangentRelation from AIS; |
45 | ---Purpose: Constructs an object to display tangency constraints. |
46 | -- This object is defined by the first shape aFShape, the |
47 | -- second shape aSShape, the plane aPlane and the index anExternRef. |
48 | -- aPlane serves as an optional axis. |
49 | -- anExternRef set to 0 indicates that there is no relation. |
50 | |
51 | ExternRef(me: mutable) returns Integer from Standard |
52 | is static; |
53 | ---Purpose: Returns the external reference for tangency. |
54 | -- The values are as follows: |
55 | -- - 0 - there is no connection; |
56 | -- - 1 - there is a connection to the first shape; |
57 | -- - 2 - there is a connection to the second shape. |
58 | -- This reference is defined at construction time. |
59 | |
60 | SetExternRef(me: mutable;aRef : Integer from Standard) |
61 | is static; |
62 | ---Purpose: Sets the external reference for tangency, aRef. |
63 | -- The values are as follows: |
64 | -- - 0 - there is no connection; |
65 | -- - 1 - there is a connection to the first shape; |
66 | -- - 2 - there is a connection to the second shape. |
67 | -- This reference is initially defined at construction time. |
68 | |
69 | Compute(me : mutable; |
70 | aPresentationManager: PresentationManager3d from PrsMgr; |
71 | aPresentation : mutable Presentation from Prs3d; |
72 | aMode : Integer from Standard= 0) |
73 | is redefined static private; |
74 | |
75 | Compute(me:mutable; |
76 | aProjector: Projector from Prs3d; |
77 | aPresentation: mutable Presentation from Prs3d) |
78 | is redefined static private; |
79 | |
80 | Compute(me:mutable; |
81 | aPresentationManager: PresentationManager2d from PrsMgr; |
82 | aPresentation: mutable GraphicObject from Graphic2d; |
83 | aMode: Integer from Standard = 0) |
84 | is redefined static private; |
85 | |
86 | Compute(me : mutable; |
87 | aProjector : Projector from Prs3d; |
88 | aTrsf : Transformation from Geom; |
89 | aPresentation : mutable Presentation from Prs3d) |
90 | is redefined; |
91 | ---Purpose: computes the presentation according to a point of view |
92 | -- given by <aProjector>. |
93 | -- To be Used when the associated degenerated Presentations |
94 | -- have been transformed by <aTrsf> which is not a Pure |
95 | -- Translation. The HLR Prs can't be deducted automatically |
96 | -- WARNING :<aTrsf> must be applied |
97 | -- to the object to display before computation !!! |
98 | |
99 | -- Methods from SelectableObject |
100 | |
101 | ComputeSelection(me : mutable; |
102 | aSelection : mutable Selection from SelectMgr; |
103 | aMode : Integer from Standard)is private; |
104 | |
105 | |
106 | -- |
107 | -- Computation private methods |
108 | -- |
109 | |
110 | ComputeTwoFacesTangent(me: mutable; |
111 | aPresentation : mutable Presentation from Prs3d) |
112 | is private; |
113 | |
114 | ComputeTwoEdgesTangent(me: mutable; |
115 | aPresentation : mutable Presentation from Prs3d) |
116 | is private; |
117 | |
118 | |
119 | fields |
120 | |
121 | myAttach : Pnt from gp; |
122 | myDir : Dir from gp; |
123 | myLength : Real from Standard; |
124 | myExternRef : Integer from Standard; ---purpose: (0 no attachment,1 attachment with first shape, 2 attachment with second shape) |
125 | |
126 | end TangentRelation; |
127 | |