1 -- Created on: 1997-01-08
2 -- Created by: Robert COUBLANC
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class ConnectedInteractive from AIS inherits InteractiveObject from AIS
19 ---Purpose: Defines an Interactive Object through a connection to
20 -- another Interactive Object, which serves as a
21 -- reference, and which is located elsewhere in the viewer.
22 -- This allows you to use the Connected Interactive
23 -- Object without having to recalculate presentation,
24 -- selection or graphic structure. These are deduced
25 -- from your reference object.
26 -- The relation between the connected interactive object
27 -- and its source is generally one of geometric transformation.
28 -- AIS_ConnectedInteractive class doesn't support selection
29 -- modes different from 0. Descendants should redefine ComputeSelection()
30 -- method in order to handle other selection modes and generate connected
31 -- sensitive entities properly. Refer to AIS_ConnectedShape class
32 -- for exisiting implementation of a connected interactive object
33 -- for AIS_Shape that supports all standard sub-shape selection modes.
35 -- An Interactive entity which is view (or projector)
36 -- dependent requires recalculation of views in hidden
37 -- parts mode depending on the position of the
38 -- projector in each view. You should derive the entity's
39 -- inheritance from ConnectedInteractive and redefine
40 -- its compute method to enable this type of calculation.
44 Transformation from Geom,
45 PresentationManager3d from PrsMgr,
46 Presentation from Prs3d,
47 TypeOfPresentation3d from PrsMgr,
48 Selection from SelectMgr,
50 KindOfInteractive from AIS
52 NotImplemented from Standard
56 Create (aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView)
57 returns mutable ConnectedInteractive from AIS;
59 -- Disconnects the previous view and sets highlight
60 -- mode to 0. This highlights the wireframe presentation
61 -- aTypeOfPresentation3d.
62 -- Top_AllView deactivates hidden line removal.
64 Type(me) returns KindOfInteractive from AIS
66 ---Purpose: Returns KOI_Object
68 Signature(me) returns Integer from Standard
74 anotherIObj : InteractiveObject from AIS) is virtual;
75 ---Purpose: Establishes the connection between the Connected
76 -- Interactive Object, anotherIobj, and its reference
77 -- entity. If a previous connection with an Interactive
78 -- Object already exists, it is removed by Disconnect.
79 -- The second syntax also initiates the location of the
80 -- Connected Interactive Object.
83 anotherIobj: InteractiveObject from AIS;
84 aLocation : Location from TopLoc) is virtual;
88 HasConnection(me) returns Boolean from Standard;
91 -- Returns true if there is a connection established
92 -- between the presentation and its source reference.
94 ConnectedTo(me) returns any InteractiveObject from AIS;
98 -- Returns the connection with the reference Interactive Object.
101 Disconnect(me:mutable);
102 ---Purpose: Clears the connection with a source reference. The
103 -- presentation will no longer be displayed.
104 -- Warning Must be done before deleting the presentation.
106 Compute(me : mutable;
107 aPresentationManager : PresentationManager3d from PrsMgr;
108 aPresentation : mutable Presentation from Prs3d;
109 aMode : Integer from Standard = 0)
111 ---Purpose: Calculates the view aPresentation and its updates.
112 -- The latter are managed by aPresentationManager.
113 -- The display mode aMode is 0 by default.
114 -- this method is redefined virtual;
115 -- when the instance is connected to another
116 -- InteractiveObject,this method doesn't
117 -- compute anything, but just uses the
118 -- presentation of this last object, with
119 -- a transformation if there's one stored.
120 is redefined virtual private;
122 Compute(me : mutable;
123 aProjector : Projector from Prs3d;
124 aTrsf : Transformation from Geom;
125 aPresentation : mutable Presentation from Prs3d)
127 ---Purpose: Computes the presentation according to a point of view
128 -- given by <aProjector>.
129 -- To be Used when the associated degenerated Presentations
130 -- have been transformed by <aTrsf> which is not a Pure
131 -- Translation. The HLR Prs can't be deducted automatically
132 -- WARNING :<aTrsf> must be applied
133 -- to the object to display before computation !!!
137 aProjector: Projector from Prs3d;
138 aPresentation: mutable Presentation from Prs3d)
141 ComputeSelection(me:mutable; aSelection :mutable Selection from SelectMgr;
142 aMode : Integer) is redefined virtual private;
144 ---Purpose: Generates sensitive entities by copying
145 -- them from myReference selection, creates and sets an entity
146 -- owner for this entities and adds them to aSelection
148 AcceptShapeDecomposition(me) returns Boolean from Standard is
153 UpdateLocation(me:mutable) is redefined virtual;
155 UpdateLocation(me:mutable;aSel:Selection from SelectMgr) is redefined virtual;
156 ---Purpose: For this class, the location effect is treated in the
157 -- compute & computeSelection methods. So the
158 -- UpdateLocation Methods are redefined to do nothing else
160 -- UpdateLocation(me:mutable;P : mutable Presentation from Prs3d) is redefined virtual;
164 myReference : InteractiveObject from AIS is protected;
165 ---Purpose: To have the time to Disconnect below, the old is kept for a while.
166 myOldReference : InteractiveObject from AIS is protected;
168 end ConnectedInteractive;