7fd59977 |
1 | -- File: AIS_ConnectedInteractive.cdl |
2 | -- Created: Wed Jan 8 13:33:22 1997 |
3 | -- Author: Robert COUBLANC |
4 | -- <rob@robox.paris1.matra-dtv.fr> |
5 | ---Copyright: Matra Datavision 1997 |
6 | |
7 | |
8 | class ConnectedInteractive from AIS inherits InteractiveObject from AIS |
9 | |
10 | ---Purpose: Defines an Interactive Object through a connection to |
11 | -- another Interactive Object, which serves as a |
12 | -- reference, and which is located elsewhere in the viewer. |
13 | -- This allows you to use the Connected Interactive |
14 | -- Object without having to recalculate presentation, |
15 | -- selection or graphic structure. These are deduced |
16 | -- from your reference object. |
17 | -- The relation between the connected interactive object |
18 | -- and its source is generally one of geometric transformation. |
19 | -- Warning |
20 | -- An Interactive entity which is view (or projector) |
21 | -- dependent requires recalculation of views in hidden |
22 | -- parts mode depending on the position of the |
23 | -- projector in each view. You should derive the entity's |
24 | -- inheritance from ConnectedInteractive and redefine |
25 | -- its compute method to enable this type of calculation. |
26 | |
27 | uses |
28 | Location from TopLoc, |
29 | Transformation from Geom, |
30 | PresentationManager3d from PrsMgr, |
31 | GraphicObject from Graphic2d, |
32 | PresentationManager2d from PrsMgr, |
33 | Presentation from Prs3d, |
34 | TypeOfPresentation3d from PrsMgr, |
35 | Selection from SelectMgr, |
36 | Projector from Prs3d, |
37 | KindOfInteractive from AIS |
38 | raises |
39 | NotImplemented from Standard |
40 | |
41 | is |
42 | |
43 | Create (aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView) |
44 | returns mutable ConnectedInteractive from AIS; |
45 | ---Purpose: |
46 | -- Disconnects the previous view and sets highlight |
47 | -- mode to 0. This highlights the wireframe presentation |
48 | -- aTypeOfPresentation3d. |
49 | -- Top_AllView deactivates hidden line removal. |
50 | |
51 | Type(me) returns KindOfInteractive from AIS |
52 | is redefined virtual; |
53 | ---Purpose: Returns KOI_Object |
54 | |
55 | Signature(me) returns Integer from Standard |
56 | is redefined virtual; |
57 | ---Purpose: Returns 1 |
58 | |
59 | |
60 | Connect(me : mutable; |
61 | anotherIObj : InteractiveObject from AIS) is virtual; |
62 | ---Purpose: Establishes the connection between the Connected |
63 | -- Interactive Object, anotherIobj, and its reference |
64 | -- entity. If a previous connection with an Interactive |
65 | -- Object already exists, it is removed by Disconnect. |
66 | -- The second syntax also initiates the location of the |
67 | -- Connected Interactive Object. |
68 | |
69 | Connect(me:mutable; |
70 | anotherIobj: InteractiveObject from AIS; |
71 | aLocation : Location from TopLoc) is virtual; |
72 | ---Purpose: |
73 | |
74 | |
75 | HasConnection(me) returns Boolean from Standard; |
76 | ---C++: inline |
77 | ---Purpose: |
78 | -- Returns true if there is a connection established |
79 | -- between the presentation and its source reference. |
80 | |
81 | ConnectedTo(me) returns any InteractiveObject from AIS; |
82 | ---C++: inline |
83 | ---C++: return const& |
84 | ---Purpose: |
85 | -- Returns the connection with the reference Interactive Object. |
86 | |
87 | |
88 | Disconnect(me:mutable); |
89 | ---Purpose: Clears the connection with a source reference. The |
90 | -- presentation will no longer be displayed. |
91 | -- Warning Must be done before deleting the presentation. |
92 | |
93 | Compute(me : mutable; |
94 | aPresentationManager : PresentationManager3d from PrsMgr; |
95 | aPresentation : mutable Presentation from Prs3d; |
96 | aMode : Integer from Standard = 0) |
97 | ---Level: Public |
98 | ---Purpose: Calculates the view aPresentation and its updates. |
99 | -- The latter are managed by aPresentationManager. |
100 | -- The display mode aMode is 0 by default. |
101 | -- this method is redefined virtual; |
102 | -- when the instance is connected to another |
103 | -- InteractiveObject,this method doesn't |
104 | -- compute anything, but just uses the |
105 | -- presentation of this last object, with |
106 | -- a transformation if there's one stored. |
107 | is redefined virtual private; |
108 | |
109 | Compute(me : mutable; |
110 | aProjector : Projector from Prs3d; |
111 | aTrsf : Transformation from Geom; |
112 | aPresentation : mutable Presentation from Prs3d) |
113 | is redefined; |
114 | ---Purpose: Computes the presentation according to a point of view |
115 | -- given by <aProjector>. |
116 | -- To be Used when the associated degenerated Presentations |
117 | -- have been transformed by <aTrsf> which is not a Pure |
118 | -- Translation. The HLR Prs can't be deducted automatically |
119 | -- WARNING :<aTrsf> must be applied |
120 | -- to the object to display before computation !!! |
121 | |
122 | |
123 | Compute(me:mutable; |
124 | aProjector: Projector from Prs3d; |
125 | aPresentation: mutable Presentation from Prs3d) |
126 | is redefined; |
127 | |
128 | Compute(me:mutable; |
129 | aPresentationManager: PresentationManager2d from PrsMgr; |
130 | aPresentation: mutable GraphicObject from Graphic2d; |
131 | aMode: Integer from Standard = 0) |
132 | ---Level: Internal |
133 | ---Purpose: this method should fill the presentation according to the |
134 | -- enumerated mode of the application and to the display parameter |
135 | -- of the application. |
136 | |
137 | raises NotImplemented from Standard |
138 | is redefined; |
139 | |
140 | ComputeSelection(me:mutable; aSelection :mutable Selection from SelectMgr; |
141 | aMode : Integer) is redefined virtual private; |
142 | ---Level: Public |
143 | ---Purpose: Recovers and calculates any sensitive primitive, |
144 | -- aSelection, available in Shape mode, specified by |
145 | -- aMode. As a rule, these are sensitive faces. |
146 | -- This method is defined as virtual. This enables you to |
147 | -- implement it in the creation of a new class of |
148 | -- Interactive Object. You need to do this and in so |
149 | -- doing, redefine this method, if you create a class |
150 | -- which enriches the list of signatures and types. |
151 | |
152 | AcceptShapeDecomposition(me) returns Boolean from Standard is |
153 | redefined virtual; |
154 | ---C++: inline |
155 | |
156 | |
157 | UpdateLocation(me:mutable) is redefined virtual; |
158 | |
159 | UpdateLocation(me:mutable;aSel:Selection from SelectMgr) is redefined virtual; |
160 | ---Purpose: For this class, the location effect is treated in the |
161 | -- compute & computeSelection methods. So the |
162 | -- UpdateLocation Methods are redefined to do nothing else |
163 | |
164 | -- UpdateLocation(me:mutable;P : mutable Presentation from Prs3d) is redefined virtual; |
165 | |
166 | fields |
167 | |
168 | myReference : InteractiveObject from AIS is protected; |
169 | ---Purpose: To have the time to Disconnect below, the old is kept for a while. |
170 | myOldReference : InteractiveObject from AIS is protected; |
171 | |
172 | end ConnectedInteractive; |
173 | |
174 | |