1 -- Created on: 1997-07-23
2 -- Created by: Henri JEANNIN
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
43 ---Purpose: to build a context and set a given context as current
49 ---Purpose: used to manage mouse event (move,select,shiftselect)
50 -- By default the events are transmitted to interactive context.
53 class DoubleMapOfInteractiveAndName instantiates DoubleMap
54 from TCollection ( Transient from Standard,
55 AsciiString from TCollection,
56 MapTransientHasher from TColStd,
57 AsciiString from TCollection);
60 -- ----------------------------------------------------------------------
62 -- ----------------------------------------------------------------------
64 Factory (theDI : out Interpretor from Draw);
65 ---Purpose: Loads all Draw commands of V2d & V3d. Used for plugin.
67 ---Category: Create the viewer....
69 ViewerInit ( thePxLeft, thePxTop : Integer from Standard = 0;
70 thePxWidth, thePxHeight : Integer from Standard = 0);
72 -- implemented in ViewerTest_ViewerCommands.cxx
74 ---Category: Selection in the viewer....
77 WClass returns TShared from MMgt is private;
78 ---C++: return const &
79 ---Purpose: Returns a window class that implements standard behavior of
80 -- all windows of the ViewerTest. This includes usual Open CASCADE
81 -- view conventions for mouse buttons (e.g. Ctrl+MB1 for zoom,
82 -- Ctrl+MB2 for pan, etc) and keyboard shortcuts.
83 -- This method is relevant for MS Windows only and respectively
84 -- returns WNT_WClass handle.
86 PickShape (aType : ShapeEnum from TopAbs;
87 MaxPick : Integer from Standard = 5) returns Shape from TopoDS;
88 ---Purpose: waits until a shape of type <aType> is picked in the AIS Viewer and returns it.
89 -- if <aType> == TopAbs_Shape, any shape can be picked...
90 -- MaxPick is the Max number before exiting, if no pick is successfull
93 PickShapes (aType : ShapeEnum from TopAbs;
94 thepicked : in out HArray1OfShape from TopTools;
95 MaxPick : Integer from Standard = 5)
96 returns Boolean from Standard;
97 ---Purpose: wait until the array is filled with picked shapes.
98 -- returns True if the array is filled.
99 -- exit if number of unsuccesfull picks = <MaxPick>
101 PickObject(Type : KindOfInteractive from AIS = AIS_KOI_None;
102 Signature : Integer from Standard = -1;
103 MaxPick : Integer from Standard = 5)
104 returns InteractiveObject from AIS;
105 ---Purpose: waits until an interactive object of a given Type
106 -- and signature is picked (defaut values authorize
107 -- selection of any Interactive Object)
108 -- exit if number of unsuccesfull picks = <MaxPick>
110 PickObjects(thepicked : in out HArray1OfTransient from TColStd;
111 Type : KindOfInteractive from AIS = AIS_KOI_None;
112 Signature : Integer from Standard = -1;
113 MaxPick : Integer from Standard = 5)
114 returns Boolean from Standard;
115 ---Purpose: selection of several interactive objects. Number is given
116 -- by the size of <thepicked>
117 -- exit if number of unsuccesfull picks = <MaxPick>
120 Commands (theCommands : in out Interpretor from Draw);
121 AviCommands(theCommands :in out Interpretor from Draw);
122 ViewerCommands(theCommands :in out Interpretor from Draw);
123 MyCommands (theCommands : in out Interpretor from Draw); -- My Own Com-s
124 RelationCommands(theCommands :in out Interpretor from Draw);
125 ObjectCommands(theCommands :in out Interpretor from Draw);
126 FilletCommands(theCommands :in out Interpretor from Draw);
127 VoxelCommands(theCommands :in out Interpretor from Draw);
128 OpenGlCommands(theCommands :in out Interpretor from Draw);
130 GetMousePosition(xpix,ypix: out Integer from Standard);
132 GetViewerFromContext returns Viewer from V3d;
134 GetCollectorFromContext returns Viewer from V3d;
136 GetAISContext returns InteractiveContext from AIS;
138 GetNISContext returns InteractiveContext from NIS;
141 SetAISContext (aContext: InteractiveContext from AIS);
143 SetNISContext (aContext: InteractiveContext from NIS);
145 CurrentView returns View from V3d;
147 CurrentView (aViou:View from V3d);
151 ---Category: Change behaviour on move,select,... events.
153 SetEventManager (aMgr:EventManager from ViewerTest);
154 ---Purpose: puts <aMgr> as current eventmanager (the
155 -- move,select,...will be applied to <aMgr>
158 ---Purpose: removes the last EventManager from the list.
161 ---Purpose: clear the list of EventManagers and
162 -- sets the default EventManager as current
164 CurrentEventManager returns EventManager from ViewerTest;
167 ---Category: privateMethods...
172 StandardModeActivation(Mode : Integer from Standard);