1 -- Created on: 1997-07-23
2 -- Created by: Henri JEANNIN
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.
38 ---Purpose: used to manage mouse event (move,select,shiftselect)
39 -- By default the events are transmitted to interactive context.
42 class DoubleMapOfInteractiveAndName instantiates DoubleMap
43 from TCollection ( Transient from Standard,
44 AsciiString from TCollection,
45 MapTransientHasher from TColStd,
46 AsciiString from TCollection);
49 -- ----------------------------------------------------------------------
51 -- ----------------------------------------------------------------------
53 Factory (theDI : out Interpretor from Draw);
54 ---Purpose: Loads all Draw commands of V2d & V3d. Used for plugin.
56 ---Category: Create the viewer....
58 ViewerInit ( thePxLeft, thePxTop : Integer from Standard = 0;
59 thePxWidth, thePxHeight : Integer from Standard = 0;
60 theViewName : CString from Standard = "";
61 theDisplayName : CString from Standard = "")
62 returns AsciiString from TCollection;
63 ---Purpose: Creates view with default or custom name
64 -- and add this name in map to manage muliple views
65 -- implemented in ViewerTest_ViewerCommands.cxx
67 ---Category: Manage the name of views
68 RemoveViewName (theName: AsciiString from TCollection);
70 InitViewName (theName: AsciiString from TCollection;
71 theView: View from V3d);
73 GetCurrentViewName returns AsciiString from TCollection;
75 ---Category: Delete the viewer....
76 RemoveView (theViewName : AsciiString from TCollection;
77 theToRemoveContext : Boolean from Standard = Standard_True);
78 ---Purpose: Removes view and clear all maps
79 -- with information about its resources if neccessary
81 ---Category: Delete the viewer....
82 RemoveView (theView : View from V3d;
83 theToRemoveContext : Boolean from Standard = Standard_True);
84 ---Purpose: Removes view and clear all maps
85 -- with information about its resources if neccessary
87 ---Category: Selection in the viewer....
89 WClass returns TShared from MMgt is private;
90 ---C++: return const &
91 ---Purpose: Returns a window class that implements standard behavior of
92 -- all windows of the ViewerTest. This includes usual Open CASCADE
93 -- view conventions for mouse buttons (e.g. Ctrl+MB1 for zoom,
94 -- Ctrl+MB2 for pan, etc) and keyboard shortcuts.
95 -- This method is relevant for MS Windows only and respectively
96 -- returns WNT_WClass handle.
98 PickShape (aType : ShapeEnum from TopAbs;
99 MaxPick : Integer from Standard = 5) returns Shape from TopoDS;
100 ---Purpose: waits until a shape of type <aType> is picked in the AIS Viewer and returns it.
101 -- if <aType> == TopAbs_Shape, any shape can be picked...
102 -- MaxPick is the Max number before exiting, if no pick is successfull
105 PickShapes (aType : ShapeEnum from TopAbs;
106 thepicked : in out HArray1OfShape from TopTools;
107 MaxPick : Integer from Standard = 5)
108 returns Boolean from Standard;
109 ---Purpose: wait until the array is filled with picked shapes.
110 -- returns True if the array is filled.
111 -- exit if number of unsuccesfull picks = <MaxPick>
113 PickObject(Type : KindOfInteractive from AIS = AIS_KOI_None;
114 Signature : Integer from Standard = -1;
115 MaxPick : Integer from Standard = 5)
116 returns InteractiveObject from AIS;
117 ---Purpose: waits until an interactive object of a given Type
118 -- and signature is picked (defaut values authorize
119 -- selection of any Interactive Object)
120 -- exit if number of unsuccesfull picks = <MaxPick>
122 PickObjects(thepicked : in out HArray1OfTransient from TColStd;
123 Type : KindOfInteractive from AIS = AIS_KOI_None;
124 Signature : Integer from Standard = -1;
125 MaxPick : Integer from Standard = 5)
126 returns Boolean from Standard;
127 ---Purpose: selection of several interactive objects. Number is given
128 -- by the size of <thepicked>
129 -- exit if number of unsuccesfull picks = <MaxPick>
132 Commands (theCommands : in out Interpretor from Draw);
133 AviCommands(theCommands :in out Interpretor from Draw);
134 ViewerCommands(theCommands :in out Interpretor from Draw);
135 MyCommands (theCommands : in out Interpretor from Draw); -- My Own Com-s
136 RelationCommands(theCommands :in out Interpretor from Draw);
137 ObjectCommands(theCommands :in out Interpretor from Draw);
138 FilletCommands(theCommands :in out Interpretor from Draw);
139 VoxelCommands(theCommands :in out Interpretor from Draw);
140 OpenGlCommands(theCommands :in out Interpretor from Draw);
142 GetMousePosition(xpix,ypix: out Integer from Standard);
144 GetViewerFromContext returns Viewer from V3d;
146 GetCollectorFromContext returns Viewer from V3d;
148 GetAISContext returns InteractiveContext from AIS;
149 ---C++: return const &
150 GetNISContext returns InteractiveContext from NIS;
153 SetAISContext (aContext: InteractiveContext from AIS);
155 SetNISContext (aContext: InteractiveContext from NIS);
157 CurrentView returns View from V3d;
158 ---C++: return const &
160 CurrentView (aViou:View from V3d);
164 ---Category: Change behaviour on move,select,... events.
166 SetEventManager (aMgr:EventManager from ViewerTest);
167 ---Purpose: puts <aMgr> as current eventmanager (the
168 -- move,select,...will be applied to <aMgr>
171 ---Purpose: removes the last EventManager from the list.
174 ---Purpose: clear the list of EventManagers and
175 -- sets the default EventManager as current
177 CurrentEventManager returns EventManager from ViewerTest;
180 ---Category: privateMethods...
185 StandardModeActivation(Mode : Integer from Standard);
187 GetColorFromName(name: CString from Standard)
188 returns NameOfColor from Quantity;
191 ---Purpose: redraws all defined views.
193 SplitParameter (theString : AsciiString from TCollection;
194 theName : out AsciiString from TCollection;
195 theValue : out AsciiString from TCollection)
196 returns Boolean from Standard;
197 ---Purpose: Splits "parameter=value" string into separate
198 -- parameter and value strings.
199 -- @return TRUE if the string matches pattern "<string>=<empty or string>"