48b28a8644cdaec6352ed4b1a79bc21e9d13d10e
[occt.git] / src / Draw / Draw.cdl
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
9 -- under the terms of the GNU Lesser General Public 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 package Draw 
18
19         ---Purpose: MAQUETTE DESSIN MODELISATION
20
21 uses OSD, MMgt, TCollection, TColStd, gp, Message
22
23 is
24     exception Failure inherits Failure from Standard; 
25      
26     enumeration ColorKind is blanc,                 
27                             --white in english
28                              rouge,
29                             --red in english
30                              vert,
31                             --green in english
32                               bleu,
33                             --blue in english 
34                               cyan,
35                             -- same in english
36                               or,
37                             --gold in english 
38                               magenta,
39                             --same in english 
40                               marron,
41                             --brown in english
42                               orange,
43                             --same in english 
44                               rose,
45                             --pink in english 
46                               saumon,
47                             --salmon in english 
48                               violet,
49                             --same in english 
50                               jaune,
51                             --yellow in english 
52                               kaki,
53                             --DarkOliveGreen in english 
54                               corail;
55                             --Coral in english 
56                      
57     enumeration MarkerShape is
58         Square, Losange, X, Plus, Circle, CircleZoom;
59         
60         ---Purpose: Circle is not sensible to zoom, like 
61         --          other MarkerShape, contrarily to CircleZoom
62         
63
64
65     deferred class Drawable3D;
66     
67     deferred class Drawable2D;
68     
69     class Color;
70     
71     class Display;
72     
73     class Segment3D;
74     
75     class Segment2D;
76     
77     class Marker3D;
78     
79     class Marker2D;
80     
81     class Axis3D;
82     
83     class Axis2D;
84     
85     class Text3D;
86     
87     class Text2D;
88     
89     class Circle3D;
90     
91     class Circle2D;
92     
93     class Number;
94     
95     class Chronometer;
96     
97     class Grid;
98     
99     class Box;
100         ---Purpose: a 3d box
101     
102     class SequenceOfDrawable3D instantiates 
103         Sequence from TCollection (Drawable3D);
104         
105     class ProgressIndicator;
106
107     imported PInterp;
108         ---Purpose: typedef Tcl_Interp * Draw_PInterp;
109     
110     primitive CommandFunction;
111         ---Purpose: typedef Standard_Integer (*Draw_CommandFunction)
112         --          (Draw_Interpretor&, Standard_Integer, char**)
113     
114     class Interpretor;
115         ---Purpose: Encapsulate the Tcl interpretor to add commands.
116
117     class Printer;
118         ---Purpose: Implements a printer class to connect Message_Messenger 
119         --          tool to Draw_Interpretor output.
120
121     class VMap instantiates
122       DataMap from TCollection(Integer,
123                                Drawable3D from Draw,
124                                MapIntegerHasher from TColStd);    
125         
126     private class MapOfFunctions instantiates DataMap from TCollection(AsciiString from TCollection ,Function from OSD, AsciiString from TCollection);
127
128     class MapOfAsciiString instantiates IndexedMap from TCollection(AsciiString from TCollection,AsciiString from TCollection); 
129      
130     Load(theDI: out Interpretor from Draw; theKey, theResourceFileName: AsciiString from TCollection)  
131 --    returns Transient from Standard
132     raises Failure  from Draw;      
133      
134     Load(theDI: out Interpretor from Draw;
135          theKey, theResourceFileName: AsciiString from TCollection;
136          theDefaultsDirectory, theUserDefaultsDirectory: in out AsciiString from TCollection;
137          Verbose :  Boolean from Standard = Standard_False)  
138     raises Failure  from Draw;      
139
140     --
141     --  methods to handle variables
142     --  
143     
144     Set(Name : CString;  
145         D : Drawable3D from Draw; 
146         Disp : Boolean from Standard);
147        ---Purpose: Sets a variable. Display it if <Disp> is true.
148     
149     Set(Name : CString;  
150         D : Drawable3D from Draw);
151         ---Purpose: Sets a    variable,  a  null   handle    clear the
152         --          vartiable. Automatic display is context driven.
153         
154     Set(Name : CString;  
155         val : Real);
156         ---Purpose: Sets a numeric variable.
157     
158     Get(Name : in out CString;  
159         Complain : Boolean = Standard_True)
160         returns Drawable3D from Draw;
161         ---Purpose: Returns a variable  value.  Null if  the  variable
162         --          does not exist, a warning  is printed if  Complain
163         --          is True.
164         --          
165         --          The name "."   does a graphic  selection.   If the
166         --          selection is a variable <Name> is overwritten with
167         --          the name of the variable.
168         
169     Get(Name : CString;  
170         val : out Real)  
171         returns Boolean;
172         ---Purpose: Gets a   numeric  variable. Returns  True   if the
173         --          variable exist.
174
175     Set(Name : CString; val : CString);
176         ---Purpose: Sets a TCL sting variable
177         
178     Atof(Name : CString) returns Real;
179         ---Purpose: Converts numeric expression, that can involve DRAW
180         --          variables, to real value.
181     
182     Atoi(Name : CString) returns Integer;
183         ---Purpose: Converts numeric expression, that can involve DRAW
184         --          variables, to integer value. 
185         --          Implemented as cast of Atof() to integer.
186     
187     LastPick(view,X,Y,button : out Integer);
188         ---Purpose: Returns last graphic selection description.
189         
190     Repaint;
191         ---Purpose: Asks to repaint the screen after the current command.
192         
193     SetProgressBar(thePI: ProgressIndicator from Draw);
194         ---Purpose: sets progress indicator
195         
196     GetProgressBar returns ProgressIndicator from Draw;
197         ---Purpose: gets progress indicator
198
199
200     --
201     --  Draw Commands
202     --          
203
204     Commands(I : in out Interpretor from Draw);
205         ---Purpose: Defines all Draw commands
206
207     BasicCommands(I : in out Interpretor from Draw);
208         ---Purpose: Defines Draw basic commands
209
210     VariableCommands(I : in out Interpretor from Draw);
211         ---Purpose: Defines Draw variables handling commands.
212
213     GraphicCommands(I : in out Interpretor from Draw);
214         ---Purpose: Defines Draw variables handling commands.
215
216     PloadCommands(I : in out Interpretor from Draw);
217         ---Purpose: Defines Loads Draw plugins commands.
218
219     UnitCommands(I : in out Interpretor from Draw);
220         ---Purpose: Defines Draw unit commands
221
222 end Draw;