7fd59977 |
1 | -- File: ViewerTest.cdl |
2 | -- Created: Wed Jul 23 14:11:55 1997 |
3 | -- Author: Henri JEANNIN |
4 | -- <hjn@entrax.paris3.matra-dtv.fr> |
5 | ---Copyright: Matra Datavision 1997 |
6 | |
7 | |
8 | |
9 | package ViewerTest |
10 | |
11 | ---Purpose: |
12 | |
13 | uses |
14 | Draw, |
15 | TCollection, |
16 | TColStd, |
17 | TopAbs, |
18 | TopTools, |
19 | TopoDS, |
20 | V3d, |
21 | AIS, |
22 | NIS, |
23 | MMgt |
24 | |
25 | is |
26 | |
27 | class Tool; |
28 | ---Purpose: to build a context and set a given context as current |
29 | -- for ViewerTest. |
30 | |
31 | |
32 | |
33 | class EventManager; |
34 | ---Purpose: used to manage mouse event (move,select,shiftselect) |
35 | -- By default the events are transmitted to interactive context. |
36 | |
37 | |
38 | class DoubleMapOfInteractiveAndName instantiates DoubleMap |
39 | from TCollection ( Transient from Standard, |
40 | AsciiString from TCollection, |
41 | MapTransientHasher from TColStd, |
42 | AsciiString from TCollection); |
43 | |
44 | |
45 | -- ---------------------------------------------------------------------- |
46 | -- Package methods |
47 | -- ---------------------------------------------------------------------- |
48 | |
49 | Factory (theDI : out Interpretor from Draw); |
50 | ---Purpose: Loads all Draw commands of V2d & V3d. Used for plugin. |
51 | |
52 | ---Category: Create the viewer.... |
53 | |
54 | ViewerInit ( thePxLeft, thePxTop : Integer from Standard = 0; |
55 | thePxWidth, thePxHeight : Integer from Standard = 0); |
56 | ---Purpose: |
57 | -- implemented in ViewerTest_ViewerCommands.cxx |
58 | |
59 | ---Category: Selection in the viewer.... |
60 | |
61 | |
62 | WClass returns TShared from MMgt is private; |
63 | ---C++: return const & |
64 | ---Purpose: Returns a window class that implements standard behavior of |
65 | -- all windows of the ViewerTest. This includes usual Open CASCADE |
66 | -- view conventions for mouse buttons (e.g. Ctrl+MB1 for zoom, |
67 | -- Ctrl+MB2 for pan, etc) and keyboard shortcuts. |
68 | -- This method is relevant for MS Windows only and respectively |
69 | -- returns WNT_WClass handle. |
70 | |
71 | PickShape (aType : ShapeEnum from TopAbs; |
72 | MaxPick : Integer from Standard = 5) returns Shape from TopoDS; |
73 | ---Purpose: waits until a shape of type <aType> is picked in the AIS Viewer and returns it. |
74 | -- if <aType> == TopAbs_Shape, any shape can be picked... |
75 | -- MaxPick is the Max number before exiting, if no pick is successfull |
76 | |
77 | |
78 | PickShapes (aType : ShapeEnum from TopAbs; |
79 | thepicked : in out HArray1OfShape from TopTools; |
80 | MaxPick : Integer from Standard = 5) |
81 | returns Boolean from Standard; |
82 | ---Purpose: wait until the array is filled with picked shapes. |
83 | -- returns True if the array is filled. |
84 | -- exit if number of unsuccesfull picks = <MaxPick> |
85 | |
86 | PickObject(Type : KindOfInteractive from AIS = AIS_KOI_None; |
87 | Signature : Integer from Standard = -1; |
88 | MaxPick : Integer from Standard = 5) |
89 | returns InteractiveObject from AIS; |
90 | ---Purpose: waits until an interactive object of a given Type |
91 | -- and signature is picked (defaut values authorize |
92 | -- selection of any Interactive Object) |
93 | -- exit if number of unsuccesfull picks = <MaxPick> |
94 | |
95 | PickObjects(thepicked : in out HArray1OfTransient from TColStd; |
96 | Type : KindOfInteractive from AIS = AIS_KOI_None; |
97 | Signature : Integer from Standard = -1; |
98 | MaxPick : Integer from Standard = 5) |
99 | returns Boolean from Standard; |
100 | ---Purpose: selection of several interactive objects. Number is given |
101 | -- by the size of <thepicked> |
102 | -- exit if number of unsuccesfull picks = <MaxPick> |
103 | |
104 | |
105 | Commands (theCommands : in out Interpretor from Draw); |
106 | AviCommands(theCommands :in out Interpretor from Draw); |
107 | ViewerCommands(theCommands :in out Interpretor from Draw); |
108 | MyCommands (theCommands : in out Interpretor from Draw); -- My Own Com-s |
109 | RelationCommands(theCommands :in out Interpretor from Draw); |
110 | ObjectCommands(theCommands :in out Interpretor from Draw); |
111 | FilletCommands(theCommands :in out Interpretor from Draw); |
112 | VoxelCommands(theCommands :in out Interpretor from Draw); |
113 | |
114 | GetMousePosition(xpix,ypix: out Integer from Standard); |
115 | |
116 | GetViewerFromContext returns Viewer from V3d; |
117 | |
118 | GetCollectorFromContext returns Viewer from V3d; |
119 | |
120 | GetAISContext returns InteractiveContext from AIS; |
121 | |
122 | GetNISContext returns InteractiveContext from NIS; |
123 | ---C++: return & |
124 | |
125 | SetAISContext (aContext: InteractiveContext from AIS); |
126 | |
127 | SetNISContext (aContext: InteractiveContext from NIS); |
128 | |
129 | CurrentView returns View from V3d; |
130 | |
131 | CurrentView (aViou:View from V3d); |
132 | |
133 | Clear ; |
134 | |
135 | ---Category: Change behaviour on move,select,... events. |
136 | |
137 | SetEventManager (aMgr:EventManager from ViewerTest); |
138 | ---Purpose: puts <aMgr> as current eventmanager (the |
139 | -- move,select,...will be applied to <aMgr> |
140 | |
141 | UnsetEventManager; |
142 | ---Purpose: removes the last EventManager from the list. |
143 | |
144 | ResetEventManager; |
145 | ---Purpose: clear the list of EventManagers and |
146 | -- sets the default EventManager as current |
147 | |
148 | CurrentEventManager returns EventManager from ViewerTest; |
149 | |
150 | |
151 | ---Category: privateMethods... |
152 | |
153 | |
154 | RemoveSelected; |
155 | |
156 | StandardModeActivation(Mode : Integer from Standard); |
157 | |
158 | |
159 | |
160 | end; |