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
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.
17 #ifndef _Draw_HeaderFile
18 #define _Draw_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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;
47 class Draw_Chronometer;
50 class Draw_ProgressIndicator;
54 //! MAQUETTE DESSIN MODELISATION
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);
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);
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);
71 //! Sets a numeric variable.
72 Standard_EXPORT static void Set (const Standard_CString Name, const Standard_Real val);
74 //! Returns main DRAW interpretor.
75 Standard_EXPORT static Draw_Interpretor& GetInterpretor();
77 //! Returns a variable value.
78 //! The name "." does a graphic selection; in this case theName will be is overwritten with the name of the variable.
79 static Handle(Draw_Drawable3D) Get (Standard_CString& theName) { return getDrawable (theName, Standard_True); }
81 //! Returns a variable value.
82 static Handle(Draw_Drawable3D) GetExisting (const Standard_CString& theName)
84 Standard_CString aName = theName;
85 return getDrawable (aName, Standard_False);
88 //! Gets a numeric variable. Returns True if the
90 Standard_EXPORT static Standard_Boolean Get (const Standard_CString Name, Standard_Real& val);
92 //! Sets a TCL sting variable
93 Standard_EXPORT static void Set (const Standard_CString Name, const Standard_CString val);
95 //! Converts numeric expression, that can involve DRAW
96 //! variables, to real value.
97 Standard_EXPORT static Standard_Real Atof (const Standard_CString Name);
99 //! Converts numeric expression, that can involve DRAW
100 //! variables, to integer value.
101 //! Implemented as cast of Atof() to integer.
102 Standard_EXPORT static Standard_Integer Atoi (const Standard_CString Name);
104 //! Returns last graphic selection description.
105 Standard_EXPORT static void LastPick (Standard_Integer& view, Standard_Integer& X, Standard_Integer& Y, Standard_Integer& button);
107 //! Asks to repaint the screen after the current command.
108 Standard_EXPORT static void Repaint();
110 //! sets progress indicator
111 Standard_EXPORT static void SetProgressBar (const Handle(Draw_ProgressIndicator)& thePI);
113 //! gets progress indicator
114 Standard_EXPORT static Handle(Draw_ProgressIndicator) GetProgressBar();
116 //! Defines all Draw commands
117 Standard_EXPORT static void Commands (Draw_Interpretor& I);
119 //! Defines Draw basic commands
120 Standard_EXPORT static void BasicCommands (Draw_Interpretor& I);
122 //! Defines Draw variables handling commands.
123 Standard_EXPORT static void VariableCommands (Draw_Interpretor& I);
125 //! Defines Draw variables handling commands.
126 Standard_EXPORT static void GraphicCommands (Draw_Interpretor& I);
128 //! Defines Loads Draw plugins commands.
129 Standard_EXPORT static void PloadCommands (Draw_Interpretor& I);
131 //! Defines Draw unit commands
132 Standard_EXPORT static void UnitCommands (Draw_Interpretor& I);
136 //! Returns a variable value.
137 //! @param theName [in] [out] variable name, or "." to activate picking
138 //! @param theToAllowPick [in] when TRUE, "." name will activate picking
139 Standard_EXPORT static Handle(Draw_Drawable3D) getDrawable (Standard_CString& theName,
140 Standard_Boolean theToAllowPick);
144 friend class Draw_Drawable3D;
145 friend class Draw_Drawable2D;
146 friend class Draw_Color;
147 friend class Draw_Display;
148 friend class Draw_Segment3D;
149 friend class Draw_Segment2D;
150 friend class Draw_Marker3D;
151 friend class Draw_Marker2D;
152 friend class Draw_Axis3D;
153 friend class Draw_Axis2D;
154 friend class Draw_Text3D;
155 friend class Draw_Text2D;
156 friend class Draw_Circle3D;
157 friend class Draw_Circle2D;
158 friend class Draw_Number;
159 friend class Draw_Chronometer;
160 friend class Draw_Grid;
161 friend class Draw_Box;
162 friend class Draw_ProgressIndicator;
163 friend class Draw_Printer;
173 #endif // _Draw_HeaderFile