0024837: Visualization - revise design and implementation of connected Interactive...
[occt.git] / src / AIS / AIS_ConnectedInteractive.cdl
CommitLineData
b311480e 1-- Created on: 1997-01-08
2-- Created by: Robert COUBLANC
3-- Copyright (c) 1997-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
d5f74e42 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
973c2be1 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.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
b311480e 16
17class ConnectedInteractive from AIS inherits InteractiveObject from AIS
7fd59977 18
0717ddc1 19 ---Purpose: Creates an arbitrary located instance of another Interactive Object,
20 -- which serves as a reference.
7fd59977 21 -- This allows you to use the Connected Interactive
22 -- Object without having to recalculate presentation,
23 -- selection or graphic structure. These are deduced
24 -- from your reference object.
25 -- The relation between the connected interactive object
ac04d101 26 -- and its source is generally one of geometric transformation.
0717ddc1 27 -- AIS_ConnectedInteractive class supports selection mode 0 for any InteractiveObject and
28 -- all standard modes if its reference based on AIS_Shape.
29 -- Descendants may redefine ComputeSelection() though.
30 -- Also ConnectedInteractive will handle HLR if its reference based on AIS_Shape.
7fd59977 31
32uses
33 Location from TopLoc,
0717ddc1 34 Shape from TopoDS,
7fd59977 35 Transformation from Geom,
36 PresentationManager3d from PrsMgr,
7fd59977 37 Presentation from Prs3d,
38 TypeOfPresentation3d from PrsMgr,
39 Selection from SelectMgr,
40 Projector from Prs3d,
0717ddc1 41 KindOfInteractive from AIS,
42 Trsf from gp
7fd59977 43raises
44 NotImplemented from Standard
45
46is
47
48 Create (aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView)
6e33d3ce 49 returns ConnectedInteractive from AIS;
7fd59977 50 ---Purpose:
51 -- Disconnects the previous view and sets highlight
52 -- mode to 0. This highlights the wireframe presentation
53 -- aTypeOfPresentation3d.
54 -- Top_AllView deactivates hidden line removal.
55
56 Type(me) returns KindOfInteractive from AIS
57 is redefined virtual;
58 ---Purpose: Returns KOI_Object
59
60 Signature(me) returns Integer from Standard
61 is redefined virtual;
62 ---Purpose: Returns 1
63
64
65 Connect(me : mutable;
66 anotherIObj : InteractiveObject from AIS) is virtual;
67 ---Purpose: Establishes the connection between the Connected
0717ddc1 68 -- Interactive Object, anotherIobj, and its reference.
69
7fd59977 70
71 Connect(me:mutable;
72 anotherIobj: InteractiveObject from AIS;
0717ddc1 73 aLocation : Trsf from gp) is virtual;
74 ---Purpose: Establishes the connection between the Connected
75 -- Interactive Object, anotherIobj, and its reference.
76 -- Locates instance in aLocation.
7fd59977 77
78
79 HasConnection(me) returns Boolean from Standard;
80 ---C++: inline
81 ---Purpose:
82 -- Returns true if there is a connection established
83 -- between the presentation and its source reference.
84
85 ConnectedTo(me) returns any InteractiveObject from AIS;
86 ---C++: inline
87 ---C++: return const&
88 ---Purpose:
89 -- Returns the connection with the reference Interactive Object.
90
91
92 Disconnect(me:mutable);
93 ---Purpose: Clears the connection with a source reference. The
94 -- presentation will no longer be displayed.
95 -- Warning Must be done before deleting the presentation.
96
97 Compute(me : mutable;
98 aPresentationManager : PresentationManager3d from PrsMgr;
6e33d3ce 99 aPresentation : Presentation from Prs3d;
7fd59977 100 aMode : Integer from Standard = 0)
101 ---Level: Public
102 ---Purpose: Calculates the view aPresentation and its updates.
103 -- The latter are managed by aPresentationManager.
104 -- The display mode aMode is 0 by default.
105 -- this method is redefined virtual;
106 -- when the instance is connected to another
107 -- InteractiveObject,this method doesn't
108 -- compute anything, but just uses the
109 -- presentation of this last object, with
110 -- a transformation if there's one stored.
111 is redefined virtual private;
112
113 Compute(me : mutable;
114 aProjector : Projector from Prs3d;
115 aTrsf : Transformation from Geom;
6e33d3ce 116 aPresentation : Presentation from Prs3d)
0717ddc1 117 is redefined virtual private;
7fd59977 118 ---Purpose: Computes the presentation according to a point of view
119 -- given by <aProjector>.
120 -- To be Used when the associated degenerated Presentations
121 -- have been transformed by <aTrsf> which is not a Pure
122 -- Translation. The HLR Prs can't be deducted automatically
123 -- WARNING :<aTrsf> must be applied
124 -- to the object to display before computation !!!
125
126
127 Compute(me:mutable;
128 aProjector: Projector from Prs3d;
6e33d3ce 129 aPresentation: Presentation from Prs3d)
0717ddc1 130 is redefined virtual private;
131 ---Purpose: Computes the presentation according to a point of view
132 -- given by <aProjector>.
7fd59977 133
0717ddc1 134 ComputeSelection(me:mutable; theSelection : Selection from SelectMgr;
135 theMode : Integer) is redefined virtual private;
7fd59977 136 ---Level: Public
ac04d101
SA
137 ---Purpose: Generates sensitive entities by copying
138 -- them from myReference selection, creates and sets an entity
0717ddc1 139 -- owner for this entities and adds them to theSelection
140
141 computeSubShapeSelection (me:mutable; theSelection : Selection from SelectMgr;
142 theMode : Integer) is private;
143 ---Level: Public
144 ---Purpose: Generates sensitive entities by copying
145 -- them from myReference sub shapes selection, creates and sets an entity
146 -- owner for this entities and adds them to theSelection
7fd59977 147
148 AcceptShapeDecomposition(me) returns Boolean from Standard is
149 redefined virtual;
0717ddc1 150 ---C++: inline
151 ---Purpose: Informs the graphic context that the interactive Object
152 -- may be decomposed into sub-shapes for dynamic selection.
7fd59977 153
7fd59977 154
0717ddc1 155 updateShape(me:mutable;WithLocation:Boolean from Standard = Standard_True)
156 is static private;
157
158 Compute(me:mutable;
159 aProjector : Projector from Prs3d;
160 aPresentation: Presentation from Prs3d;
161 aShape : Shape from TopoDS)
162 is private;
163 ---Purpose: Computes the presentation according to a point of view
164 -- given by <aProjector>.
7fd59977 165
166fields
167
0717ddc1 168 myReference : InteractiveObject from AIS is protected; -- reference object
169 myShape : Shape from TopoDS; -- used for HLR
7fd59977 170
171end ConnectedInteractive;
172
173