summaryrefslogtreecommitdiff
path: root/inc/ViewerTest.hxx
blob: 3ec9aec2b0f19c7da837021f36dd6f95c1f3240c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _ViewerTest_HeaderFile
#define _ViewerTest_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_MMgt_TShared_HeaderFile
#include <Handle_MMgt_TShared.hxx>
#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_TopTools_HArray1OfShape_HeaderFile
#include <Handle_TopTools_HArray1OfShape.hxx>
#endif
#ifndef _Handle_AIS_InteractiveObject_HeaderFile
#include <Handle_AIS_InteractiveObject.hxx>
#endif
#ifndef _AIS_KindOfInteractive_HeaderFile
#include <AIS_KindOfInteractive.hxx>
#endif
#ifndef _Handle_TColStd_HArray1OfTransient_HeaderFile
#include <Handle_TColStd_HArray1OfTransient.hxx>
#endif
#ifndef _Handle_V3d_Viewer_HeaderFile
#include <Handle_V3d_Viewer.hxx>
#endif
#ifndef _Handle_AIS_InteractiveContext_HeaderFile
#include <Handle_AIS_InteractiveContext.hxx>
#endif
#ifndef _NIS_InteractiveContext_HeaderFile
#include <NIS_InteractiveContext.hxx>
#endif
#ifndef _Handle_V3d_View_HeaderFile
#include <Handle_V3d_View.hxx>
#endif
#ifndef _Handle_ViewerTest_EventManager_HeaderFile
#include <Handle_ViewerTest_EventManager.hxx>
#endif
class Draw_Interpretor;
class MMgt_TShared;
class TopoDS_Shape;
class TopTools_HArray1OfShape;
class AIS_InteractiveObject;
class TColStd_HArray1OfTransient;
class V3d_Viewer;
class AIS_InteractiveContext;
class V3d_View;
class ViewerTest_EventManager;
class ViewerTest_Tool;
class ViewerTest_EventManager;
class ViewerTest_DoubleMapOfInteractiveAndName;
class ViewerTest_DoubleMapNodeOfDoubleMapOfInteractiveAndName;
class ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName;



class ViewerTest  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  //! Loads all Draw commands of  V2d & V3d. Used for plugin. <br>
  Standard_EXPORT   static  void Factory(Draw_Interpretor& theDI) ;
  
//!          implemented in ViewerTest_ViewerCommands.cxx <br>
  Standard_EXPORT   static  void ViewerInit(const Standard_Integer thePxLeft = 0,const Standard_Integer thePxTop = 0,const Standard_Integer thePxWidth = 0,const Standard_Integer thePxHeight = 0) ;
  //!  waits until a shape of type <aType> is picked in the AIS Viewer and returns it. <br>
//! if <aType> == TopAbs_Shape, any shape can be picked... <br>
//! MaxPick  is the Max number before exiting, if no pick is successfull <br>
  Standard_EXPORT   static  TopoDS_Shape PickShape(const TopAbs_ShapeEnum aType,const Standard_Integer MaxPick = 5) ;
  //! wait until the array is filled with picked shapes. <br>
//!          returns True if the array is filled. <br>
//!          exit if number of unsuccesfull picks =  <MaxPick> <br>
  Standard_EXPORT   static  Standard_Boolean PickShapes(const TopAbs_ShapeEnum aType,Handle(TopTools_HArray1OfShape)& thepicked,const Standard_Integer MaxPick = 5) ;
  //! waits until an interactive object of a given Type <br>
//!          and signature is picked (defaut values authorize <br>
//!          selection of any Interactive Object) <br>
//!          exit if number of unsuccesfull picks =  <MaxPick> <br>
  Standard_EXPORT   static  Handle_AIS_InteractiveObject PickObject(const AIS_KindOfInteractive Type = AIS_KOI_None,const Standard_Integer Signature = -1,const Standard_Integer MaxPick = 5) ;
  //! selection of several interactive objects. Number is given <br>
//!          by the size of <thepicked> <br>
//!          exit if number of unsuccesfull picks =  <MaxPick> <br>
  Standard_EXPORT   static  Standard_Boolean PickObjects(Handle(TColStd_HArray1OfTransient)& thepicked,const AIS_KindOfInteractive Type = AIS_KOI_None,const Standard_Integer Signature = -1,const Standard_Integer MaxPick = 5) ;
  
  Standard_EXPORT   static  void Commands(Draw_Interpretor& theCommands) ;
  
  Standard_EXPORT   static  void AviCommands(Draw_Interpretor& theCommands) ;
  
  Standard_EXPORT   static  void ViewerCommands(Draw_Interpretor& theCommands) ;
  
  Standard_EXPORT   static  void MyCommands(Draw_Interpretor& theCommands) ;
  
  Standard_EXPORT   static  void RelationCommands(Draw_Interpretor& theCommands) ;
  
  Standard_EXPORT   static  void ObjectCommands(Draw_Interpretor& theCommands) ;
  
  Standard_EXPORT   static  void FilletCommands(Draw_Interpretor& theCommands) ;
  
  Standard_EXPORT   static  void VoxelCommands(Draw_Interpretor& theCommands) ;
  
  Standard_EXPORT   static  void GetMousePosition(Standard_Integer& xpix,Standard_Integer& ypix) ;
  
  Standard_EXPORT   static  Handle_V3d_Viewer GetViewerFromContext() ;
  
  Standard_EXPORT   static  Handle_V3d_Viewer GetCollectorFromContext() ;
  
  Standard_EXPORT   static  Handle_AIS_InteractiveContext GetAISContext() ;
  
  Standard_EXPORT   static  NIS_InteractiveContext& GetNISContext() ;
  
  Standard_EXPORT   static  void SetAISContext(const Handle(AIS_InteractiveContext)& aContext) ;
  
  Standard_EXPORT   static  void SetNISContext(const NIS_InteractiveContext& aContext) ;
  
  Standard_EXPORT   static  Handle_V3d_View CurrentView() ;
  
  Standard_EXPORT   static  void CurrentView(const Handle(V3d_View)& aViou) ;
  
  Standard_EXPORT   static  void Clear() ;
  //!      puts  <aMgr>   as     current  eventmanager  (the <br>
//!          move,select,...will be applied to <aMgr> <br>
  Standard_EXPORT   static  void SetEventManager(const Handle(ViewerTest_EventManager)& aMgr) ;
  //! removes the last EventManager from the list. <br>
  Standard_EXPORT   static  void UnsetEventManager() ;
  //! clear the list of EventManagers and <br>
//!          sets the default EventManager as current <br>
  Standard_EXPORT   static  void ResetEventManager() ;
  
  Standard_EXPORT   static  Handle_ViewerTest_EventManager CurrentEventManager() ;
  
  Standard_EXPORT   static  void RemoveSelected() ;
  
  Standard_EXPORT   static  void StandardModeActivation(const Standard_Integer Mode) ;





protected:





private:

  //! Returns a window class that implements standard behavior of <br>
//!          all windows of the ViewerTest. This includes usual Open CASCADE <br>
//!          view conventions for mouse buttons (e.g. Ctrl+MB1 for zoom, <br>
//!          Ctrl+MB2 for pan, etc) and keyboard shortcuts. <br>
//!          This method is relevant for MS Windows only and respectively <br>
//!          returns WNT_WClass handle. <br>
  Standard_EXPORT   static const Handle_MMgt_TShared& WClass() ;



friend class ViewerTest_Tool;
friend class ViewerTest_EventManager;
friend class ViewerTest_DoubleMapOfInteractiveAndName;
friend class ViewerTest_DoubleMapNodeOfDoubleMapOfInteractiveAndName;
friend class ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName;

};





// other Inline functions and methods (like "C++: function call" methods)


#endif