e546d9890262aa115855a6ea3e90fa19d21f689f
[occt.git] / src / Draw / Draw.hxx
1 // Created on: 1991-04-24
2 // Created by: Arnaud BOUZY
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Draw_HeaderFile
18 #define _Draw_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Draw_Interpretor.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_CString.hxx>
27 #include <Standard_Real.hxx>
28 #include <Standard_Integer.hxx>
29 class TCollection_AsciiString;
30 class Draw_Drawable3D;
31 class Draw_ProgressIndicator;
32 class Draw_Drawable3D;
33 class Draw_Drawable2D;
34 class Draw_Color;
35 class Draw_Display;
36 class Draw_Segment3D;
37 class Draw_Segment2D;
38 class Draw_Marker3D;
39 class Draw_Marker2D;
40 class Draw_Axis3D;
41 class Draw_Axis2D;
42 class Draw_Text3D;
43 class Draw_Text2D;
44 class Draw_Circle3D;
45 class Draw_Circle2D;
46 class Draw_Number;
47 class Draw_Chronometer;
48 class Draw_Grid;
49 class Draw_Box;
50 class Draw_ProgressIndicator;
51 class Draw_Printer;
52
53
54 //! MAQUETTE DESSIN MODELISATION
55 class Draw 
56 {
57 public:
58
59   DEFINE_STANDARD_ALLOC
60
61   
62   Standard_EXPORT static void Load (Draw_Interpretor& theDI, const TCollection_AsciiString& theKey, const TCollection_AsciiString& theResourceFileName, TCollection_AsciiString& theDefaultsDirectory, TCollection_AsciiString& theUserDefaultsDirectory, const Standard_Boolean Verbose = Standard_False);
63   
64   //! Sets a variable. Display it if <Disp> is true.
65   Standard_EXPORT static void Set (const Standard_CString Name, const Handle(Draw_Drawable3D)& D, const Standard_Boolean Disp);
66   
67   //! Sets a    variable,  a  null   handle    clear the
68   //! vartiable. Automatic display is context driven.
69   Standard_EXPORT static void Set (const Standard_CString Name, const Handle(Draw_Drawable3D)& D);
70   
71   //! Sets a numeric variable.
72   Standard_EXPORT static void Set (const Standard_CString Name, const Standard_Real val);
73
74   //! Returns main DRAW interpretor.
75   Standard_EXPORT static Draw_Interpretor& GetInterpretor();
76   
77   //! Returns a variable  value.  Null if  the  variable
78   //! does not exist, a warning  is printed if  Complain
79   //! is True.
80   //!
81   //! The name "."   does a graphic  selection.   If the
82   //! selection is a variable <Name> is overwritten with
83   //! the name of the variable.
84   Standard_EXPORT static Handle(Draw_Drawable3D) Get (Standard_CString& Name, const Standard_Boolean Complain = Standard_True);
85   
86   //! Gets a   numeric  variable. Returns  True   if the
87   //! variable exist.
88   Standard_EXPORT static Standard_Boolean Get (const Standard_CString Name, Standard_Real& val);
89   
90   //! Sets a TCL sting variable
91   Standard_EXPORT static void Set (const Standard_CString Name, const Standard_CString val);
92   
93   //! Converts numeric expression, that can involve DRAW
94   //! variables, to real value.
95   Standard_EXPORT static Standard_Real Atof (const Standard_CString Name);
96   
97   //! Converts numeric expression, that can involve DRAW
98   //! variables, to integer value.
99   //! Implemented as cast of Atof() to integer.
100   Standard_EXPORT static Standard_Integer Atoi (const Standard_CString Name);
101   
102   //! Returns last graphic selection description.
103   Standard_EXPORT static void LastPick (Standard_Integer& view, Standard_Integer& X, Standard_Integer& Y, Standard_Integer& button);
104   
105   //! Asks to repaint the screen after the current command.
106   Standard_EXPORT static void Repaint();
107   
108   //! sets progress indicator
109   Standard_EXPORT static void SetProgressBar (const Handle(Draw_ProgressIndicator)& thePI);
110   
111   //! gets progress indicator
112   Standard_EXPORT static Handle(Draw_ProgressIndicator) GetProgressBar();
113   
114   //! Defines all Draw commands
115   Standard_EXPORT static void Commands (Draw_Interpretor& I);
116   
117   //! Defines Draw basic commands
118   Standard_EXPORT static void BasicCommands (Draw_Interpretor& I);
119   
120   //! Defines Draw variables handling commands.
121   Standard_EXPORT static void VariableCommands (Draw_Interpretor& I);
122   
123   //! Defines Draw variables handling commands.
124   Standard_EXPORT static void GraphicCommands (Draw_Interpretor& I);
125   
126   //! Defines Loads Draw plugins commands.
127   Standard_EXPORT static void PloadCommands (Draw_Interpretor& I);
128   
129   //! Defines Draw unit commands
130   Standard_EXPORT static void UnitCommands (Draw_Interpretor& I);
131
132
133
134
135 protected:
136
137
138
139
140
141 private:
142
143
144
145
146 friend class Draw_Drawable3D;
147 friend class Draw_Drawable2D;
148 friend class Draw_Color;
149 friend class Draw_Display;
150 friend class Draw_Segment3D;
151 friend class Draw_Segment2D;
152 friend class Draw_Marker3D;
153 friend class Draw_Marker2D;
154 friend class Draw_Axis3D;
155 friend class Draw_Axis2D;
156 friend class Draw_Text3D;
157 friend class Draw_Text2D;
158 friend class Draw_Circle3D;
159 friend class Draw_Circle2D;
160 friend class Draw_Number;
161 friend class Draw_Chronometer;
162 friend class Draw_Grid;
163 friend class Draw_Box;
164 friend class Draw_ProgressIndicator;
165 friend class Draw_Printer;
166
167 };
168
169
170
171
172
173
174
175 #endif // _Draw_HeaderFile