0024331: CMake scripts improvements
[occt.git] / dox / user_guides / draw_test_harness.md
CommitLineData
72b7576f 1Draw Test Harness {#user_guides__test_harness}
2===============================
e5bd0d98 3
4@tableofcontents
72b7576f 5
e5bd0d98 6@section occt_draw_1 Introduction
72b7576f 7
8This manual explains how to use Draw, the test harness for Open CASCADE Technology (**OCCT**). It provides basic documentation on using Draw. For advanced information on Draw and its applications, see our offerings on our web site at <a href="http://www.opencascade.org/support/training">http://www.opencascade.org/support/training</a>
9
10Draw is a command interpreter based on TCL and a graphical system used to test and demonstrate Open CASCADE Technology modeling libraries.
11
12
e5bd0d98 13@subsection occt_draw_1_1 Overview
72b7576f 14
15Draw is a test harness for Open CASCADE Technology. It provides a flexible and easy to use means of testing and demonstrating the OCCT modeling libraries.
16
17Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes.
18
19Scripts may be written to customize Draw and perform tests. New types of objects and new commands may be added using the C++ programing language.
20
21Draw consists of:
22
23 * A command interpreter based on the TCL command language.
24 * A 3d graphic viewer based on the X system.
25 * A basic set of commands covering scripts, variables and graphics.
26 * A set of geometric commands allowing the user to create and modify curves and surfaces and to use OCCT geometry algorithms. This set of commands is optional.
27 * A set of topological commands allowing the user to create and modify BRep shapes and to use the OCCT topology algorithms.
28
29
30There is also a set of commands for each delivery unit in the modeling libraries:
31
e5bd0d98 32 * GEOMETRY,
33 * TOPOLOGY,
34 * ADVALGOS,
35 * GRAPHIC,
36 * PRESENTATION.
72b7576f 37
38
e5bd0d98 39@subsection occt_draw_1_2 Contents of this documentation
72b7576f 40
41This documentation describes:
42
43 * The command language.
44 * The basic set of commands.
45 * The graphical commands.
46 * The Geometry set of commands.
47 * The Topology set of commands.
48
49This document does not describe other sets of commands and does not explain how to extend Draw using C++.
50
51This document is a reference manual. It contains a full description of each command. All descriptions have the format illustrated below for the exit command.
72b7576f 52
e5bd0d98 53~~~~~
54exit
55~~~~~
72b7576f 56
57Terminates the Draw, TCL session. If the commands are read from a file using the source command, this will terminate the file.
58
e5bd0d98 59**Example:**
72b7576f 60
e5bd0d98 61~~~~~
72b7576f 62# this is a very short example
63exit
e5bd0d98 64~~~~~
72b7576f 65
66
e5bd0d98 67@subsection occt_draw_1_3 Getting started
72b7576f 68
69Install Draw and launch Emacs. Get a command line in Emacs using *Esc x *and key in *woksh*.
70
e5bd0d98 71All DRAW Test Harness can be activated in the common executable called **DRAWEXE**. They are grouped in toolkits and can be loaded at run-time thereby implementing dynamically loaded plug-ins. Thus, it is possible to work only with the required commands adding them dynamically without leaving the Test Harness session.
72b7576f 72
e5bd0d98 73Declaration of available plug-ins is done through the special resource file(s). The *pload* command loads the plug-in in accordance with the specified resource file and activates the commands implemented in the plug-in.
72b7576f 74
e5bd0d98 75@subsubsection occt_draw_1_3_1 Launching DRAW Test Harness
72b7576f 76
e5bd0d98 77Test Harness executable *DRAWEXE* is located in the <i>$CASROOT/<platform>/bin</i> directory (where <platform> is Win for Windows and Linux for Linux operating systems). Prior to launching it is important to make sure that the environment is correctly set-up (usually this is done automatically after the installation process on Windows or after launching specific scripts on Linux).
72b7576f 78
72b7576f 79
e5bd0d98 80@subsubsection occt_draw_1_3_2 Plug-in resource file
72b7576f 81
e5bd0d98 82Open CASCADE Technology is shipped with the DrawPlugin resource file located in the <i>$CASROOT/src/DrawResources</i> directory.
72b7576f 83
e5bd0d98 84The format of the file is compliant with standard Open CASCADE Technology resource files (see the *Resource_Manager.cdl* file for details).
72b7576f 85
86Each key defines a sequence of either further (nested) keys or a name of the dynamic library. Keys can be nested down to an arbitrary level. However, cyclic dependencies between the keys are not checked.
e5bd0d98 87
88**Example:** (excerpt from DrawPlugin):
72b7576f 89~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
dba69de2 90OCAF : VISUALIZATION, OCAFKERNEL
91VISUALIZATION : AISV
92OCAFKERNEL : DCAF
72b7576f 93
dba69de2 94DCAF : TKDCAF
95AISV : TKViewerTest
72b7576f 96~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97
e5bd0d98 98@subsubsection occt_draw_1_3_3 Activation of commands implemented in the plug-in
72b7576f 99
100To load a plug-in declared in the resource file and to activate the commands the following command must be used in Test Harness:
101
e5bd0d98 102~~~~~
103pload [-PluginFileName] [[Key1] [Key2]...]
104~~~~~
105
106, where:
72b7576f 107
e5bd0d98 108* *-PluginFileName* - defines the name of a plug-in resource file (prefix "-" is mandatory) described above.
72b7576f 109If this parameter is omitted then the default name DrawPlugin is used.
e5bd0d98 110* *Key…* - defines the key(s) enumerating plug-ins to be loaded. If no keys are specified then the key named *DEFAULT* is used (if there is no such key in the file then no plug-ins are loaded).
72b7576f 111
e5bd0d98 112According to the OCCT resource file management rules, to access the resource file the environment variable *CSF_PluginFileNameDefaults* (and optionally *CSF_PluginFileNameUserDefaults*) must be set and point to the directory storing the resource file. If it is omitted then the plug-in resource file will be searched in the <i>$CASROOT/src/DrawResources</i> directory.
72b7576f 113
e5bd0d98 114~~~~~
dba69de2 115Draw[] pload -DrawPlugin OCAF
e5bd0d98 116~~~~~
117This command will search the resource file *DrawPlugin* using variable *CSF_DrawPluginDefaults* (and *CSF_DrawPluginUserDefaults*) and will start with the OCAF key. Since the *DrawPlugin* is the file shipped with Open CASCADE Technology it will be found in the <i>$CASROOT/src/DrawResources</i> directory (unless this location is redefined by user's variables). The OCAF key will be recursively extracted into two toolkits/plug-ins: *TKDCAF* and *TKViewerTest* (e.g. on Windows they correspond to *TKDCAF.dll* and *TKViewerTest.dll*). Thus, commands implemented for Visualization and OCAF will be loaded and activated in Test Harness.
72b7576f 118
e5bd0d98 119~~~~~
dba69de2 120Draw[] pload (equivalent to pload -DrawPlugin DEFAULT).
e5bd0d98 121~~~~~
122This command will find the default DrawPlugin file and the DEFAULT key. The latter finally maps to the TKTopTest toolkit which implements basic modeling commands.
72b7576f 123
124
e5bd0d98 125@section occt_draw_2 The Command Language
72b7576f 126
e5bd0d98 127@subsection occt_draw_2_1 Overview
72b7576f 128
e5bd0d98 129The command language used in Draw is Tcl. Tcl documentation such as "TCL and the TK Toolkit" by John K. Ousterhout (Addison-Wesley) will prove useful if you intend to use Draw extensively.
72b7576f 130
131This chapter is designed to give you a short outline of both the TCL language and some extensions included in Draw. The following topics are covered:
132
133 * Syntax of the TCL language.
134 * Accessing variables in TCL and Draw.
135 * Control structures.
136 * Procedures.
137
e5bd0d98 138@subsection occt_draw_2_2 Syntax of TCL
72b7576f 139
140TCL is an interpreted command language, not a structured language like C, Pascal, LISP or Basic. It uses a shell similar to that of csh. TCL is, however, easier to use than csh because control structures and procedures are easier to define. As well, because TCL does not assign a process to each command, it is faster than csh.
141
142The basic program for TCL is a script. A script consists of one or more commands. Commands are separated by new lines or semicolons.
e5bd0d98 143
72b7576f 144~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
145set a 24
146set b 15
147set a 25; set b 15
148~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 149
72b7576f 150Each command consists of one or more *words*; the first word is the name of a command and additional words are arguments to that command.
151
152Words are separated by spaces or tabs. In the preceding example each of the four commands has three words. A command may contain any number of words and each word is a string of arbitrary length.
153
154The evaluation of a command by TCL is done in two steps. In the first step, the command is parsed and broken into words. Some substitutions are also performed. In the second step, the command procedure corresponding to the first word is called and the other words are interpreted as arguments. In the first step, there is only string manipulation, The words only acquire *meaning* in the second step by the command procedure.
155
156The following substitutions are performed by TCL:
157
e5bd0d98 158Variable substitution is triggered by the $ character (as with csh), the content of the variable is substitued; { } may be used as in csh to enclose the name of the variable.
159
160**Example:**
72b7576f 161~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
162# set a variable value
163set file documentation
164puts $file #to display file contents on the screen
165
166# a simple substitution, set psfile to documentation.ps
167set psfile $file.ps
168puts $psfile
169
170# another substitution, set pfile to documentationPS
171set pfile ${file}PS
172
173# a last one,
174# delete files NEWdocumentation and OLDdocumentation
175foreach prefix {NEW OLD} {rm $prefix$file}
176~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 177
178Command substitution is triggered by the [ ] characters. The brackets must enclose a valid script. The script is evaluated and the result is substituted.
179
72b7576f 180Compare command construction in csh.
181
e5bd0d98 182**Example:**
72b7576f 183~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
184set degree 30
185set pi 3.14159265
186# expr is a command evaluating a numeric expression
187set radian [expr $pi*$degree/180]
188~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 189
190Backslash substitution is triggered by the backslash character. It is used to insert special characters like $, [ , ] , etc. It is also useful to insert a new line, a backslash terminated line is continued on the following line.
191
72b7576f 192TCL uses two forms of *quoting* to prevent substitution and word breaking.
193
e5bd0d98 194Double quote *quoting* enables the definition of a string with space and tabs as a single word. Substitutions are still performed inside the inverted commas " ".
72b7576f 195
e5bd0d98 196**Example:**
72b7576f 197~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
198# set msg to ;the price is 12.00;
199set price 12.00
200set msg ;the price is $price;
201~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 202
203Braces *quoting* prevents all substitutions. Braces are also nested. The main use of braces is to defer evaluation when defining procedures and control structures. Braces are used for a clearer presentation of TCL scripts on several lines.
204
205**Example:**
72b7576f 206~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
207set x 0
208# this will loop for ever
209# because while argument is ;0 3;
210while ;$x 3; {set x [expr $x+1]}
211# this will terminate as expected because
212# while argument is {$x 3}
213while {$x 3} {set x [expr $x+1]}
214# this can be written also
215while {$x 3} {
216set x [expr $x+1]
217}
218# the following cannot be written
219# because while requires two arguments
220while {$x 3}
221{
222set x [expr $x+1]
223}
224~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 225
226Comments start with a \# character as the first non-blank character in a command. To add a comment at the end of the line, the comment must be preceded by a semi-colon to end the preceding command.
227
228**Example:**
72b7576f 229~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
230# This is a comment
231set a 1 # this is not a comment
232set b 1; # this is a comment
233~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 234
e5bd0d98 235The number of words is never changed by substitution when parsing in TCL. For example, the result of a substitution is always a single word. This is different from csh but convenient as the behavior of the parser is more predictable. It may sometimes be necessary to force a second round of parsing. **eval** accomplishes this: it accepts several arguments, concatenates them and executes the resulting script.
72b7576f 236
e5bd0d98 237
238**Example:**
72b7576f 239~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240# I want to delete two files
241
242set files ;foo bar;
243
244# this will fail because rm will receive only one argument
245# and complain that ;foo bar; does not exit
246
247exec rm $files
248
249# a second evaluation will do it
250~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
251
e5bd0d98 252@subsection occt_draw_2_3 Accessing variables in TCL and Draw
72b7576f 253
e5bd0d98 254TCL variables have only string values. Note that even numeric values are stored as string literals, and computations using the **expr** command start by parsing the strings. Draw, however, requires variables with other kinds of values such as curves, surfaces or topological shapes.
72b7576f 255
256TCL provides a mechanism to link user data to variables. Using this functionality, Draw defines its variables as TCL variables with associated data.
257
e5bd0d98 258The string value of a Draw variable is meaningless. It is usually set to the name of the variable itself. Consequently, preceding a Draw variable with a *$* does not change the result of a command. The content of a Draw variable is accessed using appropriate commands.
72b7576f 259
260There are many kinds of Draw variables, and new ones may be added with C++. Geometric and topological variables are described below.
261
e5bd0d98 262Draw numeric variables can be used within an expression anywhere a Draw command requires a numeric value. The **expr** command is useless in this case as the variables are stored not as strings but as floating point values.
72b7576f 263
e5bd0d98 264**Example:**
72b7576f 265~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
266# dset is used for numeric variables
267# pi is a predefined Draw variable
268dset angle pi/3 radius 10
269point p radius*cos(angle) radius*sin(angle) 0
270~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 271It is recommended that you use TCL variables only for strings and Draw for numerals. That way, you will avoid the **expr** command. As a rule, Geometry and Topology require numbers but no strings.
272
273@subsubsection occt_draw_2_3_1 set, unset
72b7576f 274
e5bd0d98 275Syntax:
72b7576f 276
e5bd0d98 277~~~~~
278set varname [value]
72b7576f 279unset varname [varname varname ...]
e5bd0d98 280~~~~~
281
282**set** assigns a string value to a variable. If the variable does not already exist, it is created.
72b7576f 283
e5bd0d98 284Without a value, **set** returns the content of the variable.
72b7576f 285
e5bd0d98 286**unset** deletes variables. It is is also used to delete Draw variables.
72b7576f 287
e5bd0d98 288**Example:**
72b7576f 289~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
e5bd0d98 290set a "Hello world"
291set b "Goodbye"
72b7576f 292set a
e5bd0d98 293== "Hello world"
72b7576f 294unset a b
295set a
296~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297
e5bd0d98 298**Note**, that the *set* command can set only one variable, unlike the *dset* command.
72b7576f 299
72b7576f 300
e5bd0d98 301@subsubsection occt_draw_2_3_2 dset, dval
72b7576f 302
e5bd0d98 303Syntax
72b7576f 304
e5bd0d98 305~~~~~
306dset var1 value1 vr2 value2 ...
72b7576f 307dval name
e5bd0d98 308~~~~~
72b7576f 309
e5bd0d98 310*dset* assigns values to Draw numeric variables. The argument can be any numeric expression including Draw numeric variables. Since all Draw commands expect a numeric expression, there is no need to use $ or *expr*. The *dset* command can assign several variables. If there is an odd number of arguments, the last variable will be assigned a value of 0. If the variable does not exist, it will be created.
72b7576f 311
e5bd0d98 312*dval* evaluates an expression containing Draw numeric variables and returns the result as a string, even in the case of a single variable. This is not used in Draw commands as these usually interpret the expression. It is used for basic TCL commands expecting strings.
313
314
315**Example:**
72b7576f 316~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
317# z is set to 0
318dset x 10 y 15 z
319== 0
320
321# no $ required for Draw commands
322point p x y z
323
324# *puts* prints a string
325puts ;x = [dval x], cos(x/pi) = [dval cos(x/pi)];
326== x = 10, cos(x/pi) = -0.99913874099467914
327~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 328
e5bd0d98 329**Note,** that in TCL, parentheses are not considered to be special characters. Do not forget to quote an expression if it contains spaces in order to avoid parsing different words. <i>(a + b)</i> is parsed as three words: <i>"(a + b)"</i> or <i>(a+b)</i> are correct.*
72b7576f 330
331
e5bd0d98 332@subsection occt_draw_2_4 lists
72b7576f 333
334TCL uses lists. A list is a string containing elements separated by spaces or tabs. If the string contains braces, the braced part accounts as one element.
335
336This allows you to insert lists within lists.
e5bd0d98 337
338**Example:**
72b7576f 339~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
340# a list of 3 strings
341;a b c;
342
343# a list of two strings the first is a list of 2
344;{a b} c;
345~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 346
e5bd0d98 347Many TCL commands return lists and **foreach** is a useful way to create loops on list elements.
348
349@subsubsection occt_draw_2_5 Control Structures
72b7576f 350
351TCL allows looping using control structures. The control structures are implemented by commands and their syntax is very similar to that of their C counterparts (**if**, **while**, **switch**, etc.). In this case, there are two main differences between TCL and C:
352
e5bd0d98 353* You use braces instead of parentheses to enclose conditions.
354* You do not start the script on the next line of your command.
355
356
357@subsubsection occt_draw_2_5_1 if
358
359Syntax
360
361~~~~~
362if condition script [elseif script .... else script]
363~~~~~
72b7576f 364
e5bd0d98 365**If** evaluates the condition and the script to see whether the condition is true.
72b7576f 366
72b7576f 367
72b7576f 368
e5bd0d98 369**Example:**
72b7576f 370~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
371if {$x 0} {
372puts ;positive;
373} elseif {$x == 0} {
374puts ;null;
375} else {
376puts ;negative;
377}
378~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
379
e5bd0d98 380@subsubsection occt_draw_2_5_2 while, for, foreach
72b7576f 381
e5bd0d98 382Syntax:
383
384
385~~~~~~
386while condition script
72b7576f 387for init condition reinit script
388foreach varname list script
e5bd0d98 389~~~~~
390
391The three loop structures are similar to their C or csh equivalent. It is important to use braces to delay evaluation. **foreach** will assign the elements of the list to the variable before evaluating the script. \
72b7576f 392
e5bd0d98 393**Example:**
72b7576f 394~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
395# while example
396dset x 1.1
397while {[dval x] 100} {
398 circle c 0 0 x
399 dset x x*x
400}
401# for example
402# incr var d, increments a variable of d (default 1)
403for {set i 0} {$i 10} {incr i} {
404 dset angle $i*pi/10
405 point p$i cos(angle0 sin(angle) 0
406}
407# foreach example
408foreach object {crapo tomson lucas} {display $object}
409~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 410
e5bd0d98 411@subsubsection occt_draw_2_5_3 break, continue
72b7576f 412
e5bd0d98 413Syntax:
72b7576f 414
e5bd0d98 415~~~~~
416break
72b7576f 417continue
e5bd0d98 418~~~~~
72b7576f 419
e5bd0d98 420Within loops, the **break** and **continue** commands have the same effect as in C.
72b7576f 421
e5bd0d98 422**break** interrupts the innermost loop and **continue** jumps to the next iteration.
423
424**Example:**
72b7576f 425~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
426# search the index for which t$i has value ;secret;
427for {set i 1} {$i = 100} {incr i} {
428 if {[set t$i] == ;secret;} break;
429}
430~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 431
e5bd0d98 432@subsection occt_draw_2_6 Procedures
433
434TCL can be extended by defining procedures using the **proc** command, which sets up a context of local variables, binds arguments and executes a TCL script.
72b7576f 435
436The only problematic aspect of procedures is that variables are strictly local, and as they are implicitly created when used, it may be difficult to detect errors.
437
e5bd0d98 438There are two means of accessing a variable outside the scope of the current procedures: **global** declares a global variable (a variable outside all procedures); **upvar** accesses a variable in the scope of the caller. Since arguments in TCL are always string values, the only way to pass Draw variables is by reference, i.e. passing the name of the variable and using the **upvar** command as in the following examples.
439
440As TCL is not a strongly typed language it is very difficult to detect programming errors and debugging can be tedious. TCL procedures are, of course, not designed for large scale software development but for testing and simple command or interactive writing.
72b7576f 441
72b7576f 442
e5bd0d98 443@subsubsection occt_draw_2_6_1 proc
72b7576f 444
e5bd0d98 445Syntax:
72b7576f 446
e5bd0d98 447~~~~~
448proc argumentlist script
449~~~~~
72b7576f 450
e5bd0d98 451**proc** defines a procedure. An argument may have a default value. It is then a list of the form {argument value}. The script is the body of the procedure.
72b7576f 452
e5bd0d98 453**return** gives a return value to the procedure.
454
455**Example:**
72b7576f 456~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
457# simple procedure
458proc hello {} {
459 puts ;hello world;
460}
461# procedure with arguments and default values
462proc distance {x1 y1 {x2 0} {y2 0}} {
463 set d [expr (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)]
464 return [expr sqrt(d)]
465}
466proc fact n {
467 if {$n == 0} {return 1} else {
468 return [expr n*[fact [expr n -1]]]
469 }
470}
471~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 472
473
e5bd0d98 474@subsubsection occt_draw_2_6_2 global, upvar
475
476Syntax:
72b7576f 477
e5bd0d98 478~~~~~
479global varname [varname ...]
72b7576f 480upvar varname localname [varname localname ...]
e5bd0d98 481~~~~~
72b7576f 482
72b7576f 483
e5bd0d98 484**global** accesses high level variables. Unlike C, global variables are not visible in procedures.
72b7576f 485
e5bd0d98 486**upvar** gives a local name to a variable in the caller scope. This is useful when an argument is the name of a variable instead of a value. This is a call by reference and is the only way to use Draw variables as arguments.
487
488**Note** that in the following examples the \$ character is always necessarily used to access the arguments.
489
490**Example:**
72b7576f 491~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
492# convert degree to radian
493# pi is a global variable
494proc deg2rad (degree} {
495 return [dval pi*$degree/2.]
496}
497# create line with a point and an angle
498proc linang {linename x y angle} {
499 upvar linename l
500 line l $x $y cos($angle) sin($angle)
501}
502~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
503
e5bd0d98 504@section occt_draw_3 Basic Commands
72b7576f 505
506This chapter describes all the commands defined in the basic Draw package. Some are TCL commands, but most of them have been formulated in Draw. These commands are found in all Draw applications. The commands are grouped into four sections:
507
508 * General commands, which are used for Draw and TCL management.
509 * Variable commands, which are used to manage Draw variables such as storing and dumping.
510 * Graphic commands, which are used to manage the graphic system, and so pertain to views.
511 * Variable display commands, which are used to manage the display of objects within given views.
512
e5bd0d98 513Note that Draw also features a GUI task bar providing an alternative way to give certain general, graphic and display commands
72b7576f 514
515
e5bd0d98 516@subsection occt_draw_3_1 General commands
72b7576f 517
e5bd0d98 518This section describes several useful commands:
72b7576f 519
e5bd0d98 520 * **help** to get information,
521 * **source** to eval a script from a file,
522 * **spy** to capture the commands in a file,
523 * **cpulimit** to limit the process cpu time,
524 * **wait** to waste some time,
525 * **chrono** to time commands.
72b7576f 526
e5bd0d98 527@subsubsection occt_draw_3_1_1 help
72b7576f 528
e5bd0d98 529Syntax:
72b7576f 530
e5bd0d98 531~~~~~
532help [command [helpstring group]]
533~~~~~
72b7576f 534
535Provides help or modifies the help information.
536
e5bd0d98 537**help** without arguments lists all groups and the commands in each group.
72b7576f 538
e5bd0d98 539Specifying the command returns its syntax and in some cases, information on the command, The joker \* is automatically added at the end so that all completing commands are returned as well.
540
541**Example:**
72b7576f 542~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
543# Gives help on all commands starting with *a*
544~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 545
72b7576f 546
e5bd0d98 547@subsubsection occt_draw_3_1_2 source
548
549Syntax:
550
551~~~~~
552source filename
553~~~~~
72b7576f 554Executes a file.
555
e5bd0d98 556The **exit** command will terminate the file.
72b7576f 557
e5bd0d98 558@subsubsection occt_draw_3_1_3 spy
72b7576f 559
e5bd0d98 560Syntax:
72b7576f 561
e5bd0d98 562~~~~~
563spy [filename]
564~~~~~
72b7576f 565
e5bd0d98 566Saves interactive commands in the file. If spying has already been performed, the current file is closed. **spy** without an argument closes the current file and stops spying. If a file already exists, the file is overwritten. Commands are not appended.
72b7576f 567
72b7576f 568If a command returns an error it is saved with a comment mark.
569
e5bd0d98 570The file created by **spy** can be executed with the **source** command.
571
572**Example:**
72b7576f 573~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
574# all commands will be saved in the file ;session;
575spy session
576# the file ;session; is closed and commands are not saved
577spy
578~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 579
580
72b7576f 581
e5bd0d98 582@subsubsection occt_draw_3_1_4 cpulimit
583
584Syntax:
72b7576f 585
e5bd0d98 586~~~~~
587cpulimit [nbseconds]
588~~~~~
589
590**cpulimit**limits a process after the number of seconds specified in nbseconds. It is used in tests to avoid infinite loops. **cpulimit** without arguments removes all existing limits.
591
592**Example:**
72b7576f 593~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
594#limit cpu to one hour
595cpulimit 3600
596~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
597
e5bd0d98 598@subsubsection occt_draw_3_1_5 wait
72b7576f 599
e5bd0d98 600Syntax:
601~~~~~
602wait [nbseconds]
603~~~~~
72b7576f 604Suspends execution for the number of seconds specified in *nbseconds*. The default value is ten (10) seconds. This is a useful command for a slide show.
605
e5bd0d98 606~~~~~
72b7576f 607# You have ten seconds ...
608wait
e5bd0d98 609~~~~~
72b7576f 610
e5bd0d98 611@subsubsection occt_draw_3_1_6 chrono
72b7576f 612
e5bd0d98 613Syntax:
72b7576f 614
e5bd0d98 615~~~~~
616chrono [ name start/stop/reset/show]
617~~~~~
72b7576f 618
e5bd0d98 619Without arguments, **chrono** activates Draw chronometers. The elapsed time ,cpu system and cpu user times for each command will be printed.
72b7576f 620
e5bd0d98 621With arguments, **chrono** is used to manage activated chronometers. You can perform the following actions with a chronometer.
72b7576f 622 * run the chronometer (start).
623 * stop the chronometer (stop).
624 * reset the chronometer to 0 (reset).
625 * display the current time (show).
626
e5bd0d98 627**Example:**
72b7576f 628~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
629chrono
630==Chronometers activated.
631ptorus t 20 5
632==Elapsed time: 0 Hours 0 Minutes 0.0318 Seconds
633==CPU user time: 0.01 seconds
634==CPU system time: 0 seconds
635~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
636
e5bd0d98 637@subsection occt_draw_3_2 Variable management commands
72b7576f 638
e5bd0d98 639@subsubsection occt_draw_3_2_1 isdraw, directory
72b7576f 640
e5bd0d98 641Syntax:
642~~~~~
643isdraw varname
72b7576f 644directory [pattern]
e5bd0d98 645~~~~~
646
647**isdraw** tests to see if a variable is a Draw variable. **isdraw** will return 1 if there is a Draw value attached to the variable.
72b7576f 648
e5bd0d98 649Use **directory** to return a list of all Draw global variables matching a pattern.
72b7576f 650
e5bd0d98 651**Example:**
72b7576f 652~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
653set a 1
654isdraw a
655=== 0
656
657dset a 1
658isdraw a
659=== 1
660
661circle c 0 0 1 0 5
662isdraw c
663=== 1
664
665# to destroy all Draw objects with name containing curve
666foreach var [directory *curve*] {unset $var}
667~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 668
669
e5bd0d98 670@subsubsection occt_draw_3_2_2 whatis, dump
72b7576f 671
e5bd0d98 672Syntax:
673
674~~~~~
675whatis varname [varname ...]
72b7576f 676dump varname [varname ...]
e5bd0d98 677~~~~~
72b7576f 678
e5bd0d98 679**whatis** returns short information about a Draw variable. This is usually the type name.
72b7576f 680
e5bd0d98 681**dump** returns a brief type description, the coordinates, and if need be, the parameters of a Draw variable.
72b7576f 682
e5bd0d98 683**Example:**
72b7576f 684~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
685circle c 0 0 1 0 5
686whatis c
687c is a 2d curve
688
689dump c
690
691***** Dump of c *****
692Circle
693Center :0, 0
694XAxis :1, 0
695YAxis :-0, 1
696Radius :5
697~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 698
699**Note** The behavior of *whatis* on other variables (not Draw) is not excellent.
72b7576f 700
701
e5bd0d98 702@subsubsection occt_draw_3_2_3 rename, copy
72b7576f 703
e5bd0d98 704Syntax:
705~~~~~
706rename varname tovarname [varname tovarname ...]
72b7576f 707copy varname tovarname [varname tovarname ...]
e5bd0d98 708~~~~~
72b7576f 709
e5bd0d98 710 * **rename** changes the name of a Draw variable. The original variable will no longer exist. Note that the content is not modified. Only the name is changed.
711 * **copy** creates a new variable with a copy of the content of an existing variable. The exact behavior of **copy** is type dependent; in the case of certain topological variables, the content may still be shared.
72b7576f 712
e5bd0d98 713**Example:**
72b7576f 714~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
715circle c1 0 0 1 0 5
716rename c1 c2
717
718# curves are copied, c2 will not be modified
719copy c2 c3
720~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
721
e5bd0d98 722@subsubsection occt_draw_3_2_4 datadir, save, restore
72b7576f 723
e5bd0d98 724Syntax:
725~~~~~
726datadir [directory]
72b7576f 727save variable [filename]
728restore filename [variablename]
e5bd0d98 729~~~~~
72b7576f 730
e5bd0d98 731 * **datadir** without arguments prints the path of the current data directory.
732 * **datadir** with an argument sets the data directory path. \
72b7576f 733
e5bd0d98 734If the path starts with a dot (.) only the last directory name will be changed in the path.
72b7576f 735
e5bd0d98 736 * **save** writes a file in the data directory with the content of a variable. By default the name of the file is the name of the variable. To give a different name use a second argument.
737 * **restore** reads the content of a file in the data directory in a local variable. By default, the name of the variable is the name of the file. To give a different name, use a second argument.
72b7576f 738
739The exact content of the file is type-dependent. They are usually ASCII files and so, architecture independent.
e5bd0d98 740
741**Example:**
72b7576f 742~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
743# note how TCL accesses shell environment variables
744# using $env()
745datadir
746==.
747
748datadir $env(WBCONTAINER)/data/default
749==/adv_20/BAG/data/default
750
751box b 10 20 30
752save b theBox
753==/adv_20/BAG/data/default/theBox
754
755# when TCL does not find a command it tries a shell command
756ls [datadir]
757== theBox
758
759restore theBox
760== theBox
761~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 762
e5bd0d98 763@subsection occt_draw_3_3 User defined commands
72b7576f 764
e5bd0d98 765*DrawTrSurf* provides commands to create and display a Draw **geometric** variable from a Geom_Geometry object and also get a Geom_Geometry object from a Draw geometric variable name.
72b7576f 766
e5bd0d98 767*DBRep* provides commands to create and display a Draw **topological** variable from a TopoDS_Shape object and also get a TopoDS_Shape object from a Draw topological variable name.
72b7576f 768
e5bd0d98 769@subsubsection occt_draw_3_3_1 set
770
771#### In *DrawTrSurf* package:
72b7576f 772
e5bd0d98 773~~~~~
72b7576f 774void Set(Standard_CString&amp; Name,const gp_Pnt&amp; G) ;
775void Set(Standard_CString&amp; Name,const gp_Pnt2d&amp; G) ;
776void Set(Standard_CString&amp; Name,
777const Handle(Geom_Geometry)&amp; G) ;
778void Set(Standard_CString&amp; Name,
779const Handle(Geom2d_Curve)&amp; C) ;
780void Set(Standard_CString&amp; Name,
781const Handle(Poly_Triangulation)&amp; T) ;
782void Set(Standard_CString&amp; Name,
783const Handle(Poly_Polygon3D)&amp; P) ;
784void Set(Standard_CString&amp; Name,
785const Handle(Poly_Polygon2D)&amp; P) ;
e5bd0d98 786~~~~~
72b7576f 787
e5bd0d98 788#### In *DBRep* package:
72b7576f 789
e5bd0d98 790~~~~~
72b7576f 791void Set(const Standard_CString Name,
792const TopoDS_Shape&amp; S) ;
e5bd0d98 793~~~~~
72b7576f 794
e5bd0d98 795Example of *DrawTrSurf*
72b7576f 796
e5bd0d98 797~~~~~
72b7576f 798Handle(Geom2d_Circle) C1 = new Geom2d_Circle
799(gce_MakeCirc2d (gp_Pnt2d(50,0,) 25));
800DrawTrSurf::Set(char*, C1);
e5bd0d98 801~~~~~
72b7576f 802
e5bd0d98 803Example of *DBRep*
72b7576f 804
e5bd0d98 805~~~~~
72b7576f 806TopoDS_Solid B;
807B = BRepPrimAPI_MakeBox (10,10,10);
808DBRep::Set(char*,B);
e5bd0d98 809~~~~~
72b7576f 810
e5bd0d98 811@subsubsection occt_draw_3_3_2 get
72b7576f 812
e5bd0d98 813#### In *DrawTrSurf* package:
814
815~~~~~
72b7576f 816Handle_Geom_Geometry Get(Standard_CString&amp; Name) ;
e5bd0d98 817~~~~~
72b7576f 818
e5bd0d98 819#### In *DBRep* package:
72b7576f 820
e5bd0d98 821~~~~~
72b7576f 822TopoDS_Shape Get(Standard_CString&amp; Name,
823const TopAbs_ShapeEnum Typ = TopAbs_SHAPE,
824const Standard_Boolean Complain
825= Standard_True) ;
e5bd0d98 826~~~~~
72b7576f 827
e5bd0d98 828Example of *DrawTrSurf*
829
830~~~~~
72b7576f 831Standard_Integer MyCommand
832(Draw_Interpretor&amp; theCommands,
833Standard_Integer argc, char** argv)
834{......
835// Creation of a Geom_Geometry from a Draw geometric
836// name
837Handle (Geom_Geometry) aGeom= DrawTrSurf::Get(argv[1]);
838}
e5bd0d98 839~~~~~
72b7576f 840
e5bd0d98 841Example of *DBRep*
72b7576f 842
e5bd0d98 843~~~~~
72b7576f 844Standard_Integer MyCommand
845(Draw_Interpretor&amp; theCommands,
846Standard_Integer argc, char** argv)
847{......
848// Creation of a TopoDS_Shape from a Draw topological
849// name
850TopoDS_Solid B = DBRep::Get(argv[1]);
851}
e5bd0d98 852~~~~~
72b7576f 853
e5bd0d98 854@section occt_draw_4 Graphic Commands
72b7576f 855
856Graphic commands are used to manage the Draw graphic system. Draw provides a 2d and a 3d viewer with up to 30 views. Views are numbered and the index of the view is displayed in the window’s title. Objects are displayed in all 2d views or in all 3d views, depending on their type. 2d objects can only be viewed in 2d views while 3d objects – only in 3d views correspondingly.
857
e5bd0d98 858@subsection occt_draw_4_1 Axonometric viewer
72b7576f 859
e5bd0d98 860@subsubsection occt_draw_4_1_1 view, delete
72b7576f 861
e5bd0d98 862Syntax:
863~~~~~
864view index type [X Y W H]
72b7576f 865delete [index]
e5bd0d98 866~~~~~
72b7576f 867
e5bd0d98 868**view** is the basic view creation command: it creates a new view with the given index. If a view with this index already exits, it is deleted. The view is created with default parameters and X Y W H are the position and dimensions of the window on the screen. Default values are 0, 0, 500, 500.
72b7576f 869
e5bd0d98 870As a rule it is far simpler either to use the procedures **axo**, **top**, **left** or to click on the desired view type in the menu under *Views* in the task bar..
72b7576f 871
e5bd0d98 872**delete** deletes a view. If no index is given, all the views are deleted.
72b7576f 873
874Type selects from the following range:
875
e5bd0d98 876 * *AXON* : Axonometric view
877 * *PERS* : Perspective view
878 * *+X+Y* : View on both axes (i.e. a top view), other codes are *-X+Y, +Y-Z*, etc.
879 * *-2D-* : 2d view
72b7576f 880
881The index, the type, the current zoom are displayed in the window title .
e5bd0d98 882
883**Example:**
72b7576f 884~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
885# this is the content of the mu4 procedure
886proc mu4 {} {
887delete
888view 1 +X+Z 320 20 400 400
889view 2 +X+Y 320 450 400 400
890view 3 +Y+Z 728 20 400 400
891view 4 AXON 728 450 400 400
892}
893~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 894
72b7576f 895See also: **axo, pers, top, bottom, left, right, front, back, mu4, v2d, av2d, smallview**
896
e5bd0d98 897@subsubsection occt_draw_4_1_2 axo, pers, top, ...
898
899Syntax:
72b7576f 900
e5bd0d98 901~~~~~
902axo
72b7576f 903pers
904...
905smallview type
e5bd0d98 906~~~~~
72b7576f 907
908All these commands are procedures used to define standard screen layout. They delete all existing views and create new ones. The layout usually complies with the European convention, i.e. a top view is under a front view.
909
e5bd0d98 910 * **axo** creates a large window axonometric view;
911 * **pers** creates a large window perspective view;
912 * **top**, **bottom**, **left**, **right**, **front**, **back** create a large window axis view;
913 * **mu4** creates four small window views: front, left, top and axo.
914 * **v2d** creates a large window 2d view.
915 * **av2d** creates two small window views, one 2d and one axo
916 * **smallview** creates a view at the bottom right of the screen of the given type.
72b7576f 917
918See also: **view**, **delete**
919
e5bd0d98 920@subsubsection occt_draw_4_1_3 mu, md, 2dmu, 2dmd, zoom, 2dzoom
72b7576f 921
e5bd0d98 922Syntax:
72b7576f 923
e5bd0d98 924~~~~~
925 mu [index] value
926 2dmu [index] value
927 zoom [index] value
928 wzoom
929~~~~~
72b7576f 930
e5bd0d98 931* **mu** (magnify up) increases the zoom in one or several views by a factor of 10%.
932* **md** (magnify down) decreases the zoom by the inverse factor. **2dmu** and **2dmd**
72b7576f 933perform the same on one or all 2d views.
e5bd0d98 934* **zoom** and **2dzoom** set the zoom factor to a value specified by you. The current zoom factor is always displayed in the window’s title bar. Zoom 20 represents a full screen view in a large window; zoom 10, a full screen view in a small one.
935* **wzoom** (window zoom) allows you to select the area you want to zoom in on with the mouse. You will be prompted to give two of the corners of the area that you want to magnify and the rectangle so defined will occupy the window of the view.
72b7576f 936
e5bd0d98 937**Example:**
72b7576f 938~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
e5bd0d98 939 # set a zoom of 2.5
940 zoom 2.5
72b7576f 941
e5bd0d98 942 # magnify by 10%
943 mu 1
72b7576f 944
e5bd0d98 945 # magnify by 20%
72b7576f 946~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
947See also: **fit**, **2dfit**
948
949
e5bd0d98 950@subsubsection occt_draw_4_14 pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr
72b7576f 951
dba69de2 952Syntax: pu [index]
72b7576f 953pd [index]
954
955The **p_ **commands are used to pan. **pu **and **pd **pan up and down respectively;**pl **and **pr **pan left and right respectively. Each time the view is displaced by 40 pixels.When no index is given, all views will pan in the direction specified.
956
e5bd0d98 957**Example:**
72b7576f 958~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
959# you have selected one anonometric view
960pu
961# or
962pu 1
963
964# you have selected an mu4 view; the object in the third
965# view will pan up
966pu 3
967~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
968See also: **fit**, **2dfit**
969
970
e5bd0d98 971@subsubsection occt_draw_4_1_5 fit, 2dfit
972
973Syntax:
72b7576f 974
e5bd0d98 975~~~~~
976fit [index]
72b7576f 9772dfit [index]
e5bd0d98 978~~~~~
72b7576f 979
e5bd0d98 980**fit** computes the best zoom and pans on the content of the view. The content of the view will be centered and fit the whole window.
72b7576f 981
982When fitting all views a unique zoom is computed for all the views. All views are on the same scale.
983
e5bd0d98 984**Example:**
72b7576f 985~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
986# fit only view 1
987fit 1
988# fit all 2d views
9892dfit
990~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
991See also: **zoom**, **mu**, **pu**
992
993
e5bd0d98 994@subsubsection occt_draw_4_1_6 u, d, l, r
72b7576f 995
e5bd0d98 996Syntax:
997
998~~~~~
999u [index]
72b7576f 1000d [index]
1001l [index]
1002r [index]
e5bd0d98 1003~~~~~
72b7576f 1004
e5bd0d98 1005**u**, **d**, **l**, **r** Rotate the object in view around its axis by five degrees up, down, left or right respectively. This command is restricted to axonometric and perspective views.
72b7576f 1006
e5bd0d98 1007**Example:**
72b7576f 1008~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1009# rotate the view up
1010u
1011~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1012
e5bd0d98 1013@subsubsection occt_draw_4_1_7 focal, fu, fd
72b7576f 1014
e5bd0d98 1015Syntax:
1016~~~~~
1017focal [f]
72b7576f 1018fu [index]
1019fd [index]
e5bd0d98 1020~~~~~
1021
1022* **focal** changes the vantage point in perspective views. A low f value increases the perspective effect; a high one give a perspective similar to that of an axonometric view. The default value is 500.
1023* **fu** and **fd** increase or decrease the focal value by 10%. **fd** makes the eye closer to the object.
72b7576f 1024
e5bd0d98 1025**Example:**
72b7576f 1026~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1027pers
1028repeat 10 fd
1029~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 1030
1031**Note**: Do not use a negative or null focal value.
72b7576f 1032
1033See also: **pers**
1034
e5bd0d98 1035@subsubsection occt_draw_4_1_8 color
1036
1037Syntax:
72b7576f 1038
e5bd0d98 1039~~~~~
1040color index name
1041~~~~~
72b7576f 1042
e5bd0d98 1043**color** sets the color to a value. The index of the *color* is a value between 0 and 15. The name is an X window color name. The list of these can be found in the file *rgb.txt* in the X library directory.
72b7576f 1044
e5bd0d98 1045The default values are: 0 White, 1 Red, 2 Green, 3 Blue, 4 Cyan, 5 Gold, 6 Magenta, 7 Marron, 8 Orange, 9 Pink, 10 Salmon, 11 Violet, 12 Yellow, 13 Khaki, 14 Coral.
72b7576f 1046
e5bd0d98 1047**Example:**
72b7576f 1048~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1049# change the value of blue
e5bd0d98 1050color 3 "navy blue"
72b7576f 1051~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1052
1053
e5bd0d98 1054**Note** that the color change will be visible on the next redraw of the views, for example, after *fit* or *mu*, etc.
1055
1056@subsubsection occt_draw_4_1_9 dtext
72b7576f 1057
e5bd0d98 1058Syntax:
1059~~~~~
1060dtext [x y [z]] string
1061~~~~~
72b7576f 1062
e5bd0d98 1063**dtext** displays a string in all 3d or 2d views. If no coordinates are given, a graphic selection is required. If two coordinates are given, the text is created in a 2d view at the position specified. With 3 coordinates, the text is created in a 3d view.
72b7576f 1064
1065The coordinates are real space coordinates.
1066
e5bd0d98 1067**Example:**
72b7576f 1068~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1069# mark the origins
1070dtext 0 0 bebop
1071dtext 0 0 0 bebop
1072~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1073
e5bd0d98 1074@subsubsection occt_draw_4_1_10 hardcopy, hcolor, xwd
72b7576f 1075
e5bd0d98 1076Syntax:
1077~~~~~
1078hardcopy [index]
72b7576f 1079hcolor index width gray
1080xwd [index] filename
e5bd0d98 1081~~~~~
72b7576f 1082
e5bd0d98 1083* **hardcopy** creates a postcript file called a4.ps in the current directory. This file contains the postscript description of the view index, and will allow you to print the view.
1084* **hcolor** lets you change the aspect of lines in the postscript file. It allows to specify a width and a gray level for one of the 16 colors. **width** is measured in points with default value as 1, **gray** is the gray level from 0 = black to 1 = white with default value as 0. All colors are bound to the default values at the beginning.
1085* **xwd** creates an X window xwd file from an active view. By default, the index is set to1. To visualize an xwd file, use the unix command **xwud**.
72b7576f 1086
e5bd0d98 1087**Example:**
72b7576f 1088~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1089# all blue lines (color 3)
1090# will be half-width and gray
1091hcolor 3 0.5
1092
1093# make a postscript file and print it
1094hardcopy
1095lpr a4.ps
1096
1097# make an xwd file and display it
1098xwd theview
1099xwud -in theview
1100~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 1101
1102**Note:** When more than one view is present, specify the index of the view.
1103
1104Only use a postscript printer to print postscript files.
72b7576f 1105
1106See also: **color**
1107
1108
e5bd0d98 1109@subsubsection occt_draw_4_1_11 wclick, pick
72b7576f 1110
e5bd0d98 1111Syntax:
1112~~~~~
1113wclick
72b7576f 1114pick index X Y Z b [nowait]
e5bd0d98 1115~~~~~
72b7576f 1116
e5bd0d98 1117**wclick** defers an event until the mouse button is clicked. The message <code>just click</code> is displayed.
72b7576f 1118
e5bd0d98 1119Use the **pick** command to get graphic input. The arguments must be names for variables where the results are stored.
72b7576f 1120 * index: index of the view where the input was made.
1121 * X,Y,Z: 3d coordinates in real world.
1122 * b: b is the mouse button 1,2 or 3.
1123
1124When there is an extra argument, its value is not used and the command does not wait for a click; the value of b may then be 0 if there has not been a click.
1125
1126This option is useful for tracking the pointer.
1127
e5bd0d98 1128**Note** that the results are stored in Draw numeric variables.
1129
1130**Example:**
72b7576f 1131~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1132# make a circle at mouse location
1133pick index x y z b
1134circle c x y z 0 0 1 1 0 0 0 30
1135
1136# make a dynamic circle at mouse location
1137# stop when a button is clicked
1138# (see the repaint command)
1139
1140dset b 0
1141while {[dval b] == 0} {
1142pick index x y z b nowait
1143circle c x y z 0 0 1 1 0 0 0 30
1144repaint
1145}
1146~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1147See also: **repaint**
1148
1149
e5bd0d98 1150Draw provides commands to manage the display of objects.
1151* **display**, **donly** are used to display,
1152* **erase**, **clear**, **2dclear** to erase.
1153* **autodisplay** command is used to check whether variables are displayed when created.
72b7576f 1154
e5bd0d98 1155The variable name "." (dot) has a special status in Draw. Any Draw command expecting a Draw object as argument can be passed a dot. The meaning of the dot is the following.
72b7576f 1156 * If the dot is an input argument, a graphic selection will be made. Instead of getting the object from a variable, Draw will ask you to select an object in a view.
1157 * If the dot is an output argument, an unnamed object will be created. Of course this makes sense only for graphic objects: if you create an unnamed number you will not be able to access it. This feature is used when you want to create objects for display only.
e5bd0d98 1158 * If you do not see what you expected while executing loops or sourcing files, use the **repaint** and **dflush** commands.
72b7576f 1159
e5bd0d98 1160**Example:**
72b7576f 1161~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1162# OK use dot to dump an object on the screen
1163dump .
1164
1165point . x y z
1166
1167#Not OK. display points on a curve c
1168# with dot no variables are created
1169for {set i 0} {$i = 10} {incr i} {
1170cvalue c $i/10 x y z
1171point . x y z
1172}
1173
1174# point p x y z
1175# would have displayed only one point
1176# because the precedent variable content is erased
1177
1178# point p$i x y z
1179# is an other solution, creating variables
1180# p0, p1, p2, ....
1181
1182# give a name to a graphic object
1183rename . x
1184~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1185
72b7576f 1186
e5bd0d98 1187@subsubsection occt_draw_4_1_12 autodisplay
72b7576f 1188
e5bd0d98 1189Syntax:
1190
1191~~~~~
1192autodisplay [0/1]
1193~~~~~
1194
1195By default, Draw automatically displays any graphic object as soon as it is created. This behavior known as autodisplay can be removed with the command **autodisplay**. Without arguments, **autodisplay** toggles the autodisplay mode. The command always returns the current mode.
1196
1197When **autodisplay** is off, using the dot return argument is ineffective.
1198
1199**Example:**
72b7576f 1200~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1201# c is displayed
1202circle c 0 0 1 0 5
1203
1204# toggle the mode
1205autodisplay
1206== 0
1207circle c 0 0 1 0 5
1208
1209# c is erased, but not displayed
1210display c
1211~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1212
e5bd0d98 1213@subsubsection occt_draw_4_1_13 display, donly
72b7576f 1214
e5bd0d98 1215Syntax:
1216~~~~~
1217display varname [varname ...]
72b7576f 1218donly varname [varname ...]
e5bd0d98 1219~~~~~
72b7576f 1220
e5bd0d98 1221* **display** makes objects visible.
1222* **donly** *display only* makes objects visible and erases all other objects. It is very useful to extract one object from a messy screen.
72b7576f 1223
e5bd0d98 1224**Example:**
72b7576f 1225~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
e5bd0d98 1226\# to see all objects
72b7576f 1227foreach var [directory] {display $var}
1228
e5bd0d98 1229\# to select two objects and erase the other ones
72b7576f 1230donly . .
1231~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1232
1233
e5bd0d98 1234@subsubsection occt_draw_4_1_14 erase, clear, 2dclear
1235
1236Syntax:
72b7576f 1237
e5bd0d98 1238~~~~~
1239erase [varname varname ...]
72b7576f 1240clear
12412dclear
e5bd0d98 1242~~~~~
72b7576f 1243
e5bd0d98 1244**erase** removes objects from all views. **erase** without arguments erases everything in 2d and 3d.
72b7576f 1245
e5bd0d98 1246**clear** erases only 3d objects and **2dclear** only 2d objects. **erase** without arguments is similar to **clear; 2dclear**.
1247
1248
1249**Example:**
72b7576f 1250~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1251# erase eveerything with a name starting with c_
1252foreach var [directory c_*] {erase $var}
1253
1254# clear 2d views
12552d clear
1256~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1257
e5bd0d98 1258@subsubsection occt_draw_4_1_15 repaint, dflush
72b7576f 1259
72b7576f 1260
e5bd0d98 1261Syntax:
1262
1263~~~~~
1264repaint
1265dflush
1266~~~~~
1267
1268* **repaint** forces repainting of views.
1269* **dflush** flushes the graphic buffers.
72b7576f 1270
1271These commands are useful within loops or in scripts.
1272
e5bd0d98 1273When an object is modified or erased, the whole view must be repainted. To avoid doing this too many times, Draw sets up a flag and delays the repaint to the end of the command in which the new prompt is issued. In a script, you may want to display the result of a change immediately. If the flag is raised, **repaint** will repaint the views and clear the flag.
1274
1275Graphic operations are buffered by Draw (and also by the X system). Usually the buffer is flushed at the end of a command and before graphic selection. If you want to flush the buffer from inside a script, use the **dflush** command.
72b7576f 1276
e5bd0d98 1277**Example:**
72b7576f 1278~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1279# See the example with the pick command
1280~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1281See also: **pick**
1282
e5bd0d98 1283@subsection occt_draw_4_2 AIS viewer – view commands
72b7576f 1284
72b7576f 1285
e5bd0d98 1286@subsubsection occt_draw_4_2_1 vinit
72b7576f 1287
e5bd0d98 1288Syntax:
1289~~~~~
1290vinit
1291~~~~~
72b7576f 1292Creates the 3D viewer window
1293
e5bd0d98 1294@subsubsection occt_draw_4_2_2 vhelp
72b7576f 1295
e5bd0d98 1296Syntax:
1297~~~~~
1298vhelp
1299~~~~~
72b7576f 1300Displays help in the 3D viewer window. The help consists in a list of hotkeys and their functionalities.
1301
e5bd0d98 1302@subsubsection occt_draw_4_2_3 vtop
72b7576f 1303
e5bd0d98 1304Syntax:
1305~~~~~
1306vtop
1307~~~~~
72b7576f 1308
1309Displays top view in the 3D viewer window.
e5bd0d98 1310
1311**Example:**
72b7576f 1312~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1313vinit
1314box b 10 10 10
1315vdisplay b
1316vfit
1317vtop
1318~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1319
e5bd0d98 1320@subsubsection occt_draw_4_2_4 vaxo
1321
1322Syntax:
1323~~~~~
1324vaxo
1325~~~~~
72b7576f 1326
1327Displays axonometric view in the 3D viewer window.
e5bd0d98 1328
1329**Example:**
72b7576f 1330~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1331vinit
1332box b 10 10 10
1333vdisplay b
1334vfit
1335vaxo
1336~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1337
e5bd0d98 1338@subsubsection occt_draw_4_2_5 vsetbg
72b7576f 1339
e5bd0d98 1340Syntax:
1341~~~~~
1342vsetbg imagefile [filltype]
1343~~~~~
72b7576f 1344
e5bd0d98 1345Loads image file as background. *filltype* must be NONE, CENTERED, TILED or STRETCH.
1346
1347**Example:**
1348~~~~~
72b7576f 1349vinit
1350vsetbg myimage.brep CENTERED
e5bd0d98 1351~~~~~
72b7576f 1352
e5bd0d98 1353@subsubsection occt_draw_4_2_6 vclear
72b7576f 1354
e5bd0d98 1355Syntax:
1356~~~~~
1357vclear
1358~~~~~
72b7576f 1359Removes all objects from the viewer.
1360
e5bd0d98 1361@subsubsection occt_draw_4_2_7 vrepaint
72b7576f 1362
e5bd0d98 1363Syntax:
1364~~~~~
1365vrepaint
1366~~~~~
72b7576f 1367Forcedly redisplays the shape in the 3D viewer window.
1368
e5bd0d98 1369@subsubsection occt_draw_4_2_8 vfit
72b7576f 1370
e5bd0d98 1371Syntax:
1372~~~~~
1373vfit
1374~~~~~
72b7576f 1375Automatic zoom/panning. Objects in the view are visualized to occupy the maximum surface.
1376
e5bd0d98 1377@subsubsection occt_draw_4_2_9 vzfit
72b7576f 1378
e5bd0d98 1379Syntax:
1380~~~~~
1381vzfit
1382~~~~~
72b7576f 1383
1384Automatic depth panning. Objects in the view are visualized to occupy the maximum 3d space.
1385
e5bd0d98 1386@subsubsection occt_draw_4_2_10 vreadpixel
72b7576f 1387
e5bd0d98 1388Syntax:
1389~~~~~
1390vreadpixel xPixel yPixel [{rgb|rgba|depth|hls|rgbf|rgbaf}=rgba] [name]
1391~~~~~
1392Read pixel value for active view.
72b7576f 1393
72b7576f 1394
e5bd0d98 1395@subsubsection occt_draw_4_2_11 vselect
1396
1397Syntax:
1398~~~~~
1399vselect x1 y1 [x2 y2 [x3 y3 ... xn yn]] [shift_selection = 0|1]
1400~~~~~
1401
1402Emulates different types of selection:
1403
1404 * single mouse click selection
1405 * selection with a rectangle having the upper left and bottom right corners in *(x1,y1)* and *(x2,y2)* respectively
1406 * selection with a polygon having the corners in pixel positions *(x1,y1), (x2,y2),…, (xn,yn)*
1407 * any of these selections if shift_selection is set to 1.
1408
1409@subsubsection occt_draw_4_2_12 vmoveto
1410
1411Syntax:
1412
1413~~~~~
1414vmoveto x y
1415~~~~~
1416Emulates cursor movement to pixel position (x,y).
1417
1418@subsubsection occt_draw_4_2_13 vviewparams
1419
1420Syntax:
1421~~~~~
1422vviewparams [scale center_X center_Y proj_X proj_Y proj_Z up_X up_Y up_Z at_X at_Y at_Z]
1423~~~~~
1424Gets or sets the current view characteristics.
1425
1426@subsubsection occt_draw_4_2_14 vchangeselected
1427
1428Syntax:
1429~~~~~
1430vchangeselected shape
1431~~~~~
1432Adds a shape to selection or removes one from it.
1433
1434@subsubsection occt_draw_4_2_15 vzclipping
1435
1436Syntax:
1437~~~~~
1438vzclipping [mode] [depth width]
1439~~~~~
1440Gets or sets ZClipping mode, width and depth, where
1441 - *mode = OFF|BACK|FRONT|SLICE*
1442 - *depth* is a real value from segment [0,1]
1443 - *width* is a real value from segment [0,1]
1444
1445@subsubsection occt_draw_4_2_16 vnbselected
1446
1447Syntax:
1448~~~~~
1449vnbselected
1450~~~~~
1451Returns the number of selected objects in the interactive context.
1452
1453@subsubsection occt_draw_4_2_17 vantialiasing
1454
1455Syntax:
1456~~~~~
1457valntialiasing 1|0
1458~~~~~
1459Sets antialiasing if the command is called with 1 or unsets otherwise.
1460
1461@subsubsection occt_draw_4_2_18 vpurgedisplay
1462
1463Syntax:
1464~~~~~
1465vpurgedisplay [CollectorToo = 0|1]
1466~~~~~
1467Removes structures which do not belong to objects displayed in neutral point.
1468
1469@subsubsection occt_draw_4_2_19 vhlr
1470
1471Syntax:
1472~~~~~
1473vhlr is_enabled={on|off}
1474~~~~~
1475Switches hidden line removal (computed) mode on/off.
1476
1477@subsubsection occt_draw_4_2_20 vhlrtype
1478
1479Syntax:
1480~~~~~
1481vhlrtype algo_type={algo|polyalgo} [shape_1 ... shape_n]
1482~~~~~
1483
1484Changes the type of HLR algorithm used for shapes.
1485If the algo_type is algo, the exact HLR algorithm is used, otherwise the polygonal algorithm is used for defined shapes.
1486
1487If no shape is specified through the command arguments, the given HLR algorithm_type is applied to all *AIS_Shape* isntances in the current context, and the command also changes the default HLR algorithm type.
1488
1489**Note** that this command works with instances of *AIS_Shape* or derived classes only, other interactive object types are ignored.
1490
1491
1492@subsection occt_draw_4_3 AIS viewer – display commands
1493
1494@subsubsection occt_draw_4_3_1 vdisplay
1495
1496Syntax:
1497vdisplay name1 [name2] … [name n]
72b7576f 1498
1499Displays named objects.
e5bd0d98 1500**Example:**
72b7576f 1501
1502vinit
1503box b 40 40 40 10 10 10
1504psphere s 20
1505vdisplay s b
1506vfit
1507
1508
e5bd0d98 1509@subsubsection occt_draw_4_32 vdonly
72b7576f 1510
dba69de2 1511Syntax: vdonly [name1] … [name n]
72b7576f 1512
1513Displays only selected or named objects. If there are no selected or named objects, nothing is done.
e5bd0d98 1514**Example:**
72b7576f 1515
1516vinit
1517box b 40 40 40 10 10 10
1518psphere s 20
1519vdonly b
1520vfit
e5bd0d98 1521@subsubsection occt_draw_4_33 vdisplayall
72b7576f 1522
dba69de2 1523Syntax: vdisplayall
72b7576f 1524
1525Displays all created objects.
e5bd0d98 1526**Example:**
72b7576f 1527
1528vinit
1529box b 40 40 40 10 10 10
1530psphere s 20
1531vdisplayall
1532vfit
e5bd0d98 1533@subsubsection occt_draw_4_34 verase
72b7576f 1534
dba69de2 1535Syntax: verase [name1] [name2] … [name n]
72b7576f 1536
1537Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
e5bd0d98 1538**Example:**
72b7576f 1539
1540vinit
1541box b1 40 40 40 10 10 10
1542box b2 -40 -40 -40 10 10 10
1543psphere s 20
1544vdisplayall
1545vfit
1546# erase only first box
1547verase b1
1548# erase second box and sphere
1549verase
e5bd0d98 1550@subsubsection occt_draw_4_35 veraseall
72b7576f 1551
dba69de2 1552Syntax: veraseall
72b7576f 1553
1554Erases all objects displayed in the viewer.
e5bd0d98 1555**Example:**
72b7576f 1556vinit
1557box b1 40 40 40 10 10 10
1558box b2 -40 -40 -40 10 10 10
1559psphere s 20
1560vdisplayall
1561vfit
1562# erase only first box
1563verase b1
1564# erase second box and sphere
1565verseall
1566
e5bd0d98 1567@subsubsection occt_draw_4_36 vsetdispmode
72b7576f 1568
dba69de2 1569Syntax: vsetdispmode [name] mode(0,1,2,3)
72b7576f 1570
1571Sets display mode for all, selected or named objects.
1572**mode** is **0** (**WireFrame**), **1** (**Shading**), **2** (**Quick HideLineremoval**), **3** (**Exact HideLineremoval**).
e5bd0d98 1573**Example:**
72b7576f 1574
1575vinit
1576box b 10 10 10
1577vdisplay b
1578vsetdispmode 1
1579vfit
e5bd0d98 1580@subsubsection occt_draw_4_37 vdisplaytype
72b7576f 1581
dba69de2 1582Syntax: vdisplaytype type
72b7576f 1583
1584Displays all objects of a given type.
1585Possible **type**s are **;Point;, ;Axis;, ;Trihedron;, ;PlaneTrihedron;, ;Line;, ;Circle;, ;Plane;, ;Shape;, ;ConnectedShape;, ;MultiConn.Shape;, ;ConnectedInter.;, ;MultiConn.;, ;Constraint; **and** ;Dimension; **(see **vtypes**).
1586
e5bd0d98 1587@subsubsection occt_draw_4_38 verasetype
72b7576f 1588
dba69de2 1589Syntax: verasetype type
72b7576f 1590
1591Erases all objects of a given type.
1592Possible** type**s are **;Point;, ;Axis;, ;Trihedron;, ;PlaneTrihedron;, ;Line;, ;Circle;, ;Plane;, ;Shape;, ;ConnectedShape;, ;MultiConn.Shape;, ;ConnectedInter.;, ;MultiConn.;, ;Constraint; **and **;Dimension; **(see **vtypes**).
1593
e5bd0d98 1594@subsubsection occt_draw_4_39 vtypes
72b7576f 1595
dba69de2 1596Syntax: vtypes
72b7576f 1597
1598Makes a list of known types and signatures in AIS.
1599
e5bd0d98 1600@subsubsection occt_draw_4_310 vsetcolor
72b7576f 1601
dba69de2 1602Syntax: vsetcolor [shapename] colorname
72b7576f 1603
1604Sets color for all, selected or named shapes.
e5bd0d98 1605Possible **colorname**s are: ;BLACK;, ;MATRAGRAY;, ;MATRABLUE;, ;ALICEBLUE;, ;ANTIQUEWHITE;, ;ANTIQUEWHITE1;, ;ANTIQUEWHITE2;, ;ANTIQUEWHITE3;, ;ANTIQUEWHITE4;, ;AQUAMARINE1;, ;AQUAMARINE2;, ;AQUAMARINE4;, ;AZURE;, ;AZURE2;, ;AZURE3;, ;AZURE4;, ;BEIGE;, ;BISQUE;, ;BISQUE2;, ;BISQUE3;, ;BISQUE4;, ;BLANCHEDALMOND;, ;BLUE1;, ;BLUE2;, ;BLUE3;, ;BLUE4;, ;BLUEVIOLET;, ;BROWN;, ;BROWN1;, ;BROWN2;, ;BROWN3;, ;BROWN4;, ;BURLYWOOD;, ;BURLYWOOD1;, ;BURLYWOOD2;, ;BURLYWOOD3;, ;BURLYWOOD4;, ;CADETBLUE;, ;CADETBLUE1;, ;CADETBLUE2;, ;CADETBLUE3;, ;CADETBLUE4;, ;CHARTREUSE;, ;CHARTREUSE1;, ;CHARTREUSE2;, ;CHARTREUSE3;, ;CHARTREUSE4;, ;CHOCOLATE;, ;CHOCOLATE1;, ;CHOCOLATE2;, ;CHOCOLATE3;, ;CHOCOLATE4;, ;CORAL;, ;CORAL1;, ;CORAL2;, ;CORAL3;, ;CORAL4;, ;CORNFLOWERBLUE;, ;CORNSILK1;, ;CORNSILK2;, ;CORNSILK3;, ;CORNSILK4;, ;CYAN1;, ;CYAN2;, ;CYAN3;, ;CYAN4;, ;DARKGOLDENROD;, ;DARKGOLDENROD1;, ;DARKGOLDENROD2;, ;DARKGOLDENROD3;, ;DARKGOLDENROD4;, ;DARKGREEN;, ;DARKKHAKI;, ;DARKOLIVEGREEN;, ;DARKOLIVEGREEN1;, ;DARKOLIVEGREEN2;, ;DARKOLIVEGREEN3;, ;DARKOLIVEGREEN4;, ;DARKORANGE;, ;DARKORANGE1;, ;DARKORANGE2;, ;DARKORANGE3;, ;DARKORANGE4;, ;DARKORCHID;, ;DARKORCHID1;, ;DARKORCHID2;, ;DARKORCHID3;, ;DARKORCHID4;, ;DARKSALMON;, ;DARKSEAGREEN;, ;DARKSEAGREEN1;, ;DARKSEAGREEN2;, ;DARKSEAGREEN3;, ;DARKSEAGREEN4;, ;DARKSLATEBLUE;, ;DARKSLATEGRAY1;, ;DARKSLATEGRAY2;, ;DARKSLATEGRAY3;, ;DARKSLATEGRAY4;, ;DARKSLATEGRAY;, ;DARKTURQUOISE;, ;DARKVIOLET;, ;DEEPPINK;, ;DEEPPINK2;, ;DEEPPINK3;, ;DEEPPINK4;, ;DEEPSKYBLUE1;, ;DEEPSKYBLUE2;, ;DEEPSKYBLUE3;, ;DEEPSKYBLUE4;, ;DODGERBLUE1;, ;DODGERBLUE2;, ;DODGERBLUE3;, ;DODGERBLUE4;, ;FIREBRICK;, ;FIREBRICK1;, ;FIREBRICK2;, ;FIREBRICK3;, ;FIREBRICK4;, ;FLORALWHITE;, ;FORESTGREEN;, ;GAINSBORO;, ;GHOSTWHITE;, ;GOLD;, ;GOLD1;, ;GOLD2;, ;GOLD3;, ;GOLD4;, ;GOLDENROD;, ;GOLDENROD1;, ;GOLDENROD2;, ;GOLDENROD3;, ;GOLDENROD4;, ;GRAY;, ;GRAY0;, ;GRAY1;, ;GRAY10;, ;GRAY11;, ;GRAY12;, ;GRAY13;, ;GRAY14;, ;GRAY15;, ;GRAY16;, ;GRAY17;, ;GRAY18;, ;GRAY19;, ;GRAY2;, ;GRAY20;, ;GRAY21;, ;GRAY22;, ;GRAY23;, ;GRAY24;, ;GRAY25;, ;GRAY26;, ;GRAY27;, ;GRAY28;, ;GRAY29;, ;GRAY3;, ;GRAY30;, ;GRAY31;, ;GRAY32;, ;GRAY33;, ;GRAY34;, ;GRAY35;, ;GRAY36;, ;GRAY37;, ;GRAY38;, ;GRAY39;, ;GRAY4;, ;GRAY40;, ;GRAY41;, ;GRAY42;, ;GRAY43;, ;GRAY44;, ;GRAY45;, ;GRAY46;, ;GRAY47;, ;GRAY48;, ;GRAY49;, ;GRAY5;, ;GRAY50;, ;GRAY51;, ;GRAY52;, ;GRAY53;, ;GRAY54;, ;GRAY55;, ;GRAY56;, ;GRAY57;, ;GRAY58;, ;GRAY59;, ;GRAY6;, ;GRAY60;, ;GRAY61;, ;GRAY62;, ;GRAY63;, ;GRAY64;, ;GRAY65;, ;GRAY66;, ;GRAY67;, ;GRAY68;, ;GRAY69;, ;GRAY7;, ;GRAY70;, ;GRAY71;, ;GRAY72;, ;GRAY73;, ;GRAY74;, ;GRAY75;, ;GRAY76;, ;GRAY77;, ;GRAY78;, ;GRAY79;, ;GRAY8;, ;GRAY80;, ;GRAY81;, ;GRAY82;, ;GRAY83;, ;GRAY85;, ;GRAY86;, ;GRAY87;, ;GRAY88;, ;GRAY89;, ;GRAY9;, ;GRAY90;, ;GRAY91;, ;GRAY92;, ;GRAY93;, ;GRAY94;, ;GRAY95;, ;GREEN;, ;GREEN1;, ;GREEN2;, ;GREEN3;, ;GREEN4;, ;GREENYELLOW;, ;GRAY97;, ;GRAY98;, ;GRAY99;, ;HONEYDEW;, ;HONEYDEW2;, ;HONEYDEW3;, ;HONEYDEW4;, ;HOTPINK;, ;HOTPINK1;, ;HOTPINK2;, ;HOTPINK3;, ;HOTPINK4;, ;INDIANRED;, ;INDIANRED1;, ;INDIANRED2;, ;INDIANRED3;, ;INDIANRED4;, ;IVORY;, ;IVORY2;, ;IVORY3;, ;IVORY4;, ;KHAKI;, ;KHAKI1;, ;KHAKI2;, ;KHAKI3;, ;KHAKI4;, ;LAVENDER;, ;LAVENDERBLUSH1;, ;LAVENDERBLUSH2;, ;LAVENDERBLUSH3;, ;LAVENDERBLUSH4;, ;LAWNGREEN;, ;LEMONCHIFFON1;, ;LEMONCHIFFON2;, ;LEMONCHIFFON3;, ;LEMONCHIFFON4;, ;LIGHTBLUE;, ;LIGHTBLUE1;, ;LIGHTBLUE2;, ;LIGHTBLUE3;, ;LIGHTBLUE4;, ;LIGHTCORAL;, ;LIGHTCYAN1;, ;LIGHTCYAN2;, ;LIGHTCYAN3;, ;LIGHTCYAN4;, ;LIGHTGOLDENROD;, ;LIGHTGOLDENROD1;, ;LIGHTGOLDENROD2;, ;LIGHTGOLDENROD3;, ;LIGHTGOLDENROD4;, ;LIGHTGOLDENRODYELLOW;, ;LIGHTGRAY;, ;LIGHTPINK;, ;LIGHTPINK1;, ;LIGHTPINK2;, ;LIGHTPINK3;, ;LIGHTPINK4;, ;LIGHTSALMON1;, ;LIGHTSALMON2;, ;LIGHTSALMON3;, ;LIGHTSALMON4;, ;LIGHTSEAGREEN;, ;LIGHTSKYBLUE;, ;LIGHTSKYBLUE1;, ;LIGHTSKYBLUE2;, ;LIGHTSKYBLUE3;, ;LIGHTSKYBLUE4;, ;LIGHTSLATEBLUE;, ;LIGHTSLATEGRAY;, ;LIGHTSTEELBLUE;, ;LIGHTSTEELBLUE1;, ;LIGHTSTEELBLUE2;, ;LIGHTSTEELBLUE3;, ;LIGHTSTEELBLUE4;, ;LIGHTYELLOW;, ;LIGHTYELLOW2;, ;LIGHTYELLOW3;, ;LIGHTYELLOW4;, ;LIMEGREEN;, ;LINEN;, ;MAGENTA1;, ;MAGENTA2;, ;MAGENTA3;, ;MAGENTA4;, ;MAROON;, ;MAROON1;, ;MAROON2;, ;MAROON3;, ;MAROON4;, ;MEDIUMAQUAMARINE;, ;MEDIUMORCHID;, ;MEDIUMORCHID1;, ;MEDIUMORCHID2;, ;MEDIUMORCHID3;, ;MEDIUMORCHID4;, ;MEDIUMPURPLE;, ;MEDIUMPURPLE1;, ;MEDIUMPURPLE2;, ;MEDIUMPURPLE3;, ;MEDIUMPURPLE4;, ;MEDIUMSEAGREEN;, ;MEDIUMSLATEBLUE;, ;MEDIUMSPRINGGREEN;, ;MEDIUMTURQUOISE;, ;MEDIUMVIOLETRED;, ;MIDNIGHTBLUE;, ;MINTCREAM;, ;MISTYROSE;, ;MISTYROSE2;, ;MISTYROSE3;, ;MISTYROSE4;, ;MOCCASIN;, ;NAVAJOWHITE1;, ;NAVAJOWHITE2;, ;NAVAJOWHITE3;, ;NAVAJOWHITE4;, ;NAVYBLUE;, ;OLDLACE;, ;OLIVEDRAB;, ;OLIVEDRAB1;, ;OLIVEDRAB2;, ;OLIVEDRAB3;, ;OLIVEDRAB4;, ;ORANGE;, ;ORANGE1;, ;ORANGE2;, ;ORANGE3;, ;ORANGE4;, ;ORANGERED;, ;ORANGERED1;, ;ORANGERED2;, ;ORANGERED3;, ;ORANGERED4;, ;ORCHID;, ;ORCHID1;, ;ORCHID2;, ;ORCHID3;, ;ORCHID4;, ;PALEGOLDENROD;, ;PALEGREEN;, ;PALEGREEN1;, ;PALEGREEN2;, ;PALEGREEN3;, ;PALEGREEN4;, ;PALETURQUOISE;, ;PALETURQUOISE1;, ;PALETURQUOISE2;, ;PALETURQUOISE3;, ;PALETURQUOISE4;, ;PALEVIOLETRED;, ;PALEVIOLETRED1;, ;PALEVIOLETRED2;, ;PALEVIOLETRED3;, ;PALEVIOLETRED4;, ;PAPAYAWHIP;, ;PEACHPUFF;, ;PEACHPUFF2;, ;PEACHPUFF3;, ;PEACHPUFF4;, ;PERU;, ;PINK;, ;PINK1;, ;PINK2;, ;PINK3;, ;PINK4;, ;PLUM;, ;PLUM1;, ;PLUM2;, ;PLUM3;, ;PLUM4;, ;POWDERBLUE;, ;PURPLE;, ;PURPLE1;, ;PURPLE2;, ;PURPLE3;, ;PURPLE4;, ;RED;, ;RED1;, ;RED2;, ;RED3;, ;RED4;, ;ROSYBROWN;, ;ROSYBROWN1;, ;ROSYBROWN2;, ;ROSYBROWN3;, ;ROSYBROWN4;, ;ROYALBLUE;, ;ROYALBLUE1;, ;ROYALBLUE2;, ;ROYALBLUE3;, ;ROYALBLUE4;, ;SADDLEBROWN;, ;SALMON;, ;SALMON1;, ;SALMON2;, ;SALMON3;, ;SALMON4;, ;SANDYBROWN;, ;SEAGREEN;, ;SEAGREEN1;, ;SEAGREEN2;, ;SEAGREEN3;, ;SEAGREEN4;, ;SEASHELL;, ;SEASHELL2;, ;SEASHELL3;, ;SEASHELL4;, ;BEET;, ;TEAL;, ;SIENNA;, ;SIENNA1;, ;SIENNA2;, ;SIENNA3;, ;SIENNA4;, ;SKYBLUE;, ;SKYBLUE1;, ;SKYBLUE2;, ;SKYBLUE3;, ;SKYBLUE4;, ;SLATEBLUE;, ;SLATEBLUE1;, ;SLATEBLUE2;, ;SLATEBLUE3;, ;SLATEBLUE4;, ;SLATEGRAY1;, ;SLATEGRAY2;, ;SLATEGRAY3;, ;SLATEGRAY4;, ;SLATEGRAY;, ;SNOW;, ;SNOW2;, ;SNOW3;, ;SNOW4;, ;SPRINGGREEN;, ;SPRINGGREEN2;, ;SPRINGGREEN3;, ;SPRINGGREEN4;, ;STEELBLUE;, ;STEELBLUE1;, ;STEELBLUE2;, ;STEELBLUE3;, ;STEELBLUE4;, ;TAN;, ;TAN1;, ;TAN2;, ;TAN3;, ;TAN4;, ;THISTLE;, ;THISTLE1;, ;THISTLE2;, ;THISTLE3;, ;THISTLE4;, ;TOMATO;, ;TOMATO1;, ;TOMATO2;, ;TOMATO3;, ;TOMATO4;, ;TURQUOISE;, ;TURQUOISE1;, ;TURQUOISE2;, ;TURQUOISE3;, ;TURQUOISE4;, ;VIOLET;, ;VIOLETRED;, ;VIOLETRED1;, ;VIOLETRED2;, ;VIOLETRED3;, ;VIOLETRED4;, ;WHEAT;, ;WHEAT1;, ;WHEAT2;, ;WHEAT3;, ;WHEAT4;, ;WHITE;, ;WHITESMOKE;, ;YELLOW;, ;YELLOW1;, ;YELLOW2;, ;YELLOW3;, ;YELLOW4; and ;YELLOWGREEN;**.
72b7576f 1606
1607
1608
e5bd0d98 1609@subsubsection occt_draw_4_311 vunsetcolor
72b7576f 1610
dba69de2 1611Syntax: vunsetcolor [shapename]
72b7576f 1612
1613Sets default color for all, selected or named shapes.
1614
e5bd0d98 1615@subsubsection occt_draw_4_312 vsettransparency
72b7576f 1616
dba69de2 1617Syntax: vsettransparency [shapename] coeficient
72b7576f 1618
1619Sets transparency for all selected or named shapes. The **Coefficient** may be between 0.0 (opaque) and 1.0 (fully transparent). Warning: at 1.0 the shape becomes invisible.
e5bd0d98 1620**Example:**
72b7576f 1621
1622vinit
1623box b 10 10 10
1624psphere s 20
1625vdisplay b s
1626vfit
1627vsetdispmode 1
1628vsettransparency b 0.5
1629
e5bd0d98 1630@subsubsection occt_draw_4_313 vunsettransparency
72b7576f 1631
dba69de2 1632Syntax: vunsettransparency [shapename]
72b7576f 1633
1634Sets default transparency (0.0) for all selected or named shapes.
1635
e5bd0d98 1636@subsubsection occt_draw_4_314 vsetmaterial
72b7576f 1637
dba69de2 1638Syntax: vsetmaterial [shapename] materialname
72b7576f 1639
1640Sets material for all selected or named shapes.
1641**materialname** is ***BRASS*, *BRONZE*, *COPPER*, *GOLD*, *PEWTER*, *PLASTER*, *PLASTIC*, *SILVER*, *STEEL*, *STONE*, *SHINY_PLASTIC*, *SATIN*, *METALIZED*, *NEON_GNC*, *CHROME*, *ALUMINIUM*, *OBSIDIAN*, *NEON_PHC*, *JADE*.**
e5bd0d98 1642**Example:**
72b7576f 1643
1644vinit
1645psphere s 20
1646vdisplay s
1647vfit
1648vsetdispmode 1
1649vsetmaterial s JADE
1650
e5bd0d98 1651@subsubsection occt_draw_4_315 vunsetmaterial
72b7576f 1652
dba69de2 1653Syntax: vunsetmaterial [shapename]
72b7576f 1654
1655Sets default material for all selected or named shapes.
1656
e5bd0d98 1657@subsubsection occt_draw_4_316 vsetwidth
72b7576f 1658
dba69de2 1659Syntax: vsetwidth [shapename] coeficient
72b7576f 1660
1661Sets width of the edges for all selected or named shapes.
1662The **Coefficient** may be between 0.0 and 10.0.
e5bd0d98 1663**Example:**
72b7576f 1664
1665vinit
1666box b 10 10 10
1667vdisplay b
1668vfit
1669vsetwidth b 5
1670
e5bd0d98 1671@subsubsection occt_draw_4_317 vunsetwidth
72b7576f 1672
dba69de2 1673Syntax: vunsetwidth [shapename]
72b7576f 1674
1675Sets default width of edges (0.0) for all selected or named shapes.
1676
e5bd0d98 1677@subsubsection occt_draw_4_318 vsetshading
72b7576f 1678
dba69de2 1679Syntax: vsetshading shapename [coefficient]
72b7576f 1680
1681Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
e5bd0d98 1682**Example:**
72b7576f 1683
1684vinit
1685psphere s 20
1686vdisplay s
1687vfit
1688vsetdispmode 1
1689vsetshading s 0.005
e5bd0d98 1690@subsubsection occt_draw_4_319 vunsetshading
72b7576f 1691
dba69de2 1692Syntax: vunsetshading [shapename]
72b7576f 1693
1694Sets default deflection coefficient (0.0008) that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
1695
e5bd0d98 1696@subsubsection occt_draw_4_320 vsetam
72b7576f 1697
dba69de2 1698Syntax: vsetam [shapename] mode
72b7576f 1699
1700Activates selection mode for all selected or named shapes.
1701**mode** is **0** for **shape** itself, **1** for **vertices**, **2** for **edges**, **3** for **wires**, **4** for **faces**, **5** for **shells**, **6** for **solids**, **7** for **compounds**.
e5bd0d98 1702**Example:**
72b7576f 1703
1704vinit
1705box b 10 10 10
1706vdisplay b
1707vfit
1708vsetam b 2
e5bd0d98 1709@subsubsection occt_draw_4_321 vunsetam
72b7576f 1710
dba69de2 1711Syntax: vunsetam
72b7576f 1712
1713Deactivates all selection modes for all shapes.
1714
e5bd0d98 1715@subsubsection occt_draw_4_322 vdump
72b7576f 1716
dba69de2 1717Syntax: vdump filename.{png|xwd|bmp}
72b7576f 1718
1719Extracts the contents of the viewer window to a png, XWD or BMP file.
1720
e5bd0d98 1721@subsubsection occt_draw_4_323 vdir
72b7576f 1722
dba69de2 1723Syntax: vdir
72b7576f 1724
1725Displays the list of displayed objects.
1726
e5bd0d98 1727@subsubsection occt_draw_4_324 vsub
72b7576f 1728
dba69de2 1729Syntax: vsub 0/1(on/off)[shapename]
72b7576f 1730
1731Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
e5bd0d98 1732**Example:**
72b7576f 1733
1734vinit
1735box b 10 10 10
1736psphere s 20
1737vdisplay b s
1738vfit
1739vsetdispmode 1
1740vsub b 1
1741
e5bd0d98 1742@subsubsection occt_draw_4_325 vardis
72b7576f 1743
dba69de2 1744Syntax: vardis
72b7576f 1745
1746Displays active areas (for each activated sensitive entity, one or several 2D bounding boxes are displayed, depending on the implementation of a particular entity).
1747
e5bd0d98 1748@subsubsection occt_draw_4_326 varera
72b7576f 1749
dba69de2 1750Syntax: varera
72b7576f 1751
1752Erases active areas.
1753
e5bd0d98 1754@subsubsection occt_draw_4_327 vsensdis
72b7576f 1755
dba69de2 1756Syntax: vsensdis
72b7576f 1757
1758Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes).
1759
1760Standard entity types are those defined in Select3D package:
1761 * sensitive box
1762 * sensitive face
1763 * sensitive curve
1764 * sensitive segment
1765 * sensitive circle
1766 * sensitive point
1767 * sensitive triangulation
1768 * sensitive triangle
1769Custom (application-defined) sensitive entity types are not processed by this command.
1770
e5bd0d98 1771@subsubsection occt_draw_4_328 vsensera
72b7576f 1772
dba69de2 1773Syntax: vsensera
72b7576f 1774
1775Erases active entities.
1776
e5bd0d98 1777@subsubsection occt_draw_4_329 vperf
72b7576f 1778
dba69de2 1779Syntax: vperf shapename 1/0 (Transformation/Loacation) 1/0 (Primitives sensibles ON/OFF)
72b7576f 1780
1781Tests the animation of an object along a predefined trajectory.
e5bd0d98 1782**Example:**
72b7576f 1783
1784vinit
1785box b 10 10 10
1786psphere s 20
1787vdisplay b s
1788vfit
1789vsetdispmode 0
1790vperf b 1 1
e5bd0d98 1791@subsubsection occt_draw_4_330 vr
72b7576f 1792
dba69de2 1793Syntax: vr filename
72b7576f 1794
1795Reads shape from BREP-format file and displays it in the viewer.
e5bd0d98 1796**Example:**
72b7576f 1797
1798vinit
1799vr myshape.brep
e5bd0d98 1800@subsubsection occt_draw_4_330331 vstate
72b7576f 1801
dba69de2 1802Syntax: vstate [name1] … [name n]
72b7576f 1803
1804Makes a list of the status (**Displayed** or **Not Displayed**) of some selected or named objects.
1805
1806
1807
e5bd0d98 1808@subsection occt_draw_4_3304 AIS viewer – object commands
72b7576f 1809
e5bd0d98 1810@subsubsection occt_draw_4_33041 vtrihedron
72b7576f 1811
dba69de2 1812Syntax: vtrihedron name [X0] [Y0] [Z0] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw]
72b7576f 1813
1814Creates a new AIS_Trihedron object. If no argument is set, the default trihedron (0XYZ) is created.
e5bd0d98 1815**Example:**
72b7576f 1816
1817vinit
1818vtrihedron tr
1819
e5bd0d98 1820@subsubsection occt_draw_4_33042 vplanetri
72b7576f 1821
dba69de2 1822Syntax: vplanetri name
72b7576f 1823
1824Creates a plane from a trihedron selection.
1825
1826
e5bd0d98 1827@subsubsection occt_draw_4_33043 vsize
72b7576f 1828
dba69de2 1829Syntax: vsize [name] [size]
72b7576f 1830
1831Changes the size of a named or selected trihedron. If the name is not defined: it affects the selected trihedrons otherwise nothing is done. If the value is not defined, it is set to 100 by default.
e5bd0d98 1832**Example:**
72b7576f 1833
1834vinit
1835vtrihedron tr1
1836vtrihedron tr2 0 0 0 1 0 0 1 0 0
1837vsize tr2 400
1838
e5bd0d98 1839@subsubsection occt_draw_4_33044 vaxis
72b7576f 1840
dba69de2 1841Syntax: vaxis name [Xa Ya Za Xb Yb Zb]
72b7576f 1842
dba69de2 1843Creates an axis. If the values are not defined, an axis is created by interactive selection of two vertices or one edge
e5bd0d98 1844**Example:**
72b7576f 1845
1846vinit
1847vtrihedron tr
1848vaxis axe1 0 0 0 1 0 0
1849
e5bd0d98 1850@subsubsection occt_draw_4_33045 vaxispara
72b7576f 1851
dba69de2 1852Syntax: vaxispara nom
72b7576f 1853
1854Creates an axis by interactive selection of an edge and a vertex.
1855
e5bd0d98 1856@subsubsection occt_draw_4_33046 vaxisortho
72b7576f 1857
dba69de2 1858Syntax: vaxisotrho name
72b7576f 1859
1860Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge.
1861
e5bd0d98 1862@subsubsection occt_draw_4_33047 vpoint
72b7576f 1863
dba69de2 1864Syntax: vpoint name [Xa Ya Za]
72b7576f 1865
1866Creates a point from coordinates. If the values are not defined, a point is created by interactive selection of a vertice or an edge (in the center of the edge).
e5bd0d98 1867**Example:**
72b7576f 1868
1869vinit
1870vpoint p 0 0 0
1871
e5bd0d98 1872@subsubsection occt_draw_4_33048 vplane
72b7576f 1873
dba69de2 1874Syntax: vplane name [AxisName] [PointName]
1875 vplane name [PointName] [PointName] [PointName]
1876 vplane name [PlaneName] [PointName]
72b7576f 1877
1878Creates a plane from named or interactively selected entities.
e5bd0d98 1879**Example:**
72b7576f 1880
1881vinit
1882vpoint p1 0 50 0
1883vaxis axe1 0 0 0 0 0 1
1884vtrihedron tr
1885vplane plane1 axe1 p1
1886
e5bd0d98 1887@subsubsection occt_draw_4_33049 vplanepara
72b7576f 1888
dba69de2 1889Syntax: vplanepara name
72b7576f 1890
1891Creates a plane from interactively selected vertex and face.
1892
e5bd0d98 1893@subsubsection occt_draw_4_330410 vplaneortho
72b7576f 1894
dba69de2 1895Syntax: vplaneortho name
72b7576f 1896
1897Creates a plane from interactive selected face and coplanar edge.
1898
e5bd0d98 1899@subsubsection occt_draw_4_330411 vline
72b7576f 1900
dba69de2 1901Syntax: vline name [PointName] [PointName]
1902 vline name [Xa Ya Za Xb Yb Zb]
72b7576f 1903
1904Creates a line from coordinates, named or interactively selected vertices.
e5bd0d98 1905**Example:**
72b7576f 1906
1907vinit
1908vtrihedron tr
1909vpoint p1 0 50 0
1910vpoint p2 50 0 0
1911vline line1 p1 p2
1912vline line2 0 0 0 50 0 1
1913
e5bd0d98 1914@subsubsection occt_draw_4_330412 vcircle
72b7576f 1915
dba69de2 1916Syntax: vcircle name [PointName PointName PointName IsFilled]
72b7576f 1917vcircle name [PlaneName PointName Radius IsFilled]
1918
1919Creates a circle from named or interactively selected entities. Parameter IsFilled is defined as 0 or 1.
e5bd0d98 1920**Example:**
72b7576f 1921
1922vinit
1923vtrihedron tr
1924vpoint p1 0 50 0
1925vpoint p2 50 0 0
1926vpoint p3 0 0 0
1927vcircle circle1 p1 p2 p3 1
1928
1929
e5bd0d98 1930@subsubsection occt_draw_4_330413 vtri2d
72b7576f 1931
dba69de2 1932Syntax: vtri2d name
72b7576f 1933
1934Creates a plane with a 2D trihedron from an interactively selected face.
1935
e5bd0d98 1936@subsubsection occt_draw_4_330414 vselmode
72b7576f 1937
dba69de2 1938Syntax: vselmode [object] mode On/Off
72b7576f 1939
1940Sets the selection mode for an object. If the object value is not defined, the selection mode is set for all displayed objects.
1941Value On is defined as 1 and Off – as 0.
e5bd0d98 1942**Example:**
72b7576f 1943
1944vinit
1945vpoint p1 0 0 0
1946vpoint p2 50 0 0
1947vpoint p3 25 40 0
1948vtriangle triangle1 p1 p2 p3
e5bd0d98 1949@subsubsection occt_draw_4_330415 vconnect, vconnectsh
72b7576f 1950
dba69de2 1951Syntax: vconnect name object Xo Yo Zo Xu Xv Xw Zu Zv Zw
1952 vconnectsh name shape Xo Yo Zo Xu Xv Xw Zu Zv Zw
72b7576f 1953
1954Creates and displays an object with input location connected to a named entity.
1955The difference between these two commands is that the object created by vconnect does not support the selection modes differrent from 0.
e5bd0d98 1956**Example:**
72b7576f 1957
1958Vinitvinit
1959vpoint p1 0 0 0
1960vpoint p2 50 0 0
1961vsegment segment p1 p2
1962restore CrankArm.brep obj
1963vdisplay obj
1964vconnectsh new obj 100100100 1 0 0 0 0 1
1965
1966
1967
e5bd0d98 1968@subsubsection occt_draw_4_330416 vtriangle
72b7576f 1969
dba69de2 1970Syntax: vtriangle name PointName PointName PointName
72b7576f 1971
1972Creates and displays a filled triangle from named points.
e5bd0d98 1973**Example:**
72b7576f 1974
1975vinit
1976vpoint p1 0 0 0
1977vpoint p2 50 0 0
1978vpoint p3 25 40 0
1979vtriangle triangle1 p1 p2 p3
1980
e5bd0d98 1981@subsubsection occt_draw_4_330417 vsegment
72b7576f 1982
dba69de2 1983Syntax: vsegment name PointName PointName
72b7576f 1984
1985Creates and displays a segment from named points.
e5bd0d98 1986**Example:**
72b7576f 1987
1988Vinit
1989vpoint p1 0 0 0
1990vpoint p2 50 0 0
1991vsegment segment p1 p2
1992
1993
1994**MeshVS **(Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.
1995
1996
1997
e5bd0d98 1998@subsection occt_draw_4_3305 AIS viewer – Mesh Visualization Service
72b7576f 1999
e5bd0d98 2000@subsubsection occt_draw_4_33051 meshfromstl
72b7576f 2001
dba69de2 2002Syntax: meshfromstl meshname file
72b7576f 2003
2004Creates a MeshVS_Mesh object based on STL file data. The object will be displayed immediately.
e5bd0d98 2005**Example:**
72b7576f 2006
2007meshfromstl mesh myfile.stl
2008
e5bd0d98 2009@subsubsection occt_draw_4_33052 meshdispmode
72b7576f 2010
dba69de2 2011Syntax: meshdispmode meshname displaymode
72b7576f 2012
2013Changes the display mode of object **meshname**. The **displaymode** is integer, which can be **1** (for wireframe), **2** (for shading mode) or **3** (for shrink mode).
e5bd0d98 2014**Example:**
72b7576f 2015
2016vinit
2017meshfromstl mesh myfile.stl
2018meshdispmode mesh 2
2019
e5bd0d98 2020@subsubsection occt_draw_4_33053 meshselmode
72b7576f 2021
dba69de2 2022Syntax: meshselmode meshname selectionmode
72b7576f 2023
2024Changes the selection mode of object **meshname**. The **selectionmode** is integer OR-combination of mode flags. The basic flags are the following:
2025**1** – node selection,
2026**2** – 0D elements (not suppored in STL)
2027**4** – links (not supported in STL)
2028**8** – faces
e5bd0d98 2029**Example:**
72b7576f 2030
2031vinit
2032meshfromstl mesh myfile.stl
2033meshselmode mesh 1
2034
e5bd0d98 2035@subsubsection occt_draw_4_33054 meshshadcolor
72b7576f 2036
dba69de2 2037Syntax: meshshadcolor meshname red green blue
72b7576f 2038
2039Changes the face interior color of object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
e5bd0d98 2040**Example:**
72b7576f 2041
2042vinit
2043meshfromstl mesh myfile.stl
2044meshshadcolormode mesh 0.5 0.5 0.5
2045
e5bd0d98 2046@subsubsection occt_draw_4_33055 meshlinkcolor
72b7576f 2047
dba69de2 2048Syntax: meshlinkcolor meshname red green blue
72b7576f 2049
2050Changes the color of face borders for object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
e5bd0d98 2051**Example:**
72b7576f 2052
2053vinit
2054meshfromstl mesh myfile.stl
2055meshlinkcolormode mesh 0.5 0.5 0.5
2056
e5bd0d98 2057@subsubsection occt_draw_4_33056 meshmat
72b7576f 2058
dba69de2 2059Syntax: meshmat meshname material
72b7576f 2060
2061Changes the material of object **meshname**. **material** is represented with an integer value as follows (equivalent to enumeration Graphic3d_NameOfMaterial):
2062**0 – BRASS,**
2063**1 – BRONZE,**
2064**2 - COPPER,**
2065**3 - GOLD,**
2066**4 - PEWTER,**
2067**5 - PLASTER,**
2068**6 - PLASTIC,**
2069**7 - SILVER,**
2070**8 - STEEL,**
2071**9 - STONE,**
2072**10 - SHINY_PLASTIC,**
2073**11 - SATIN,**
2074**12 - METALIZED,**
2075**13 - NEON_GNC,**
2076**14 - CHROME,**
2077**15 - ALUMINIUM,**
2078**16 - OBSIDIAN,**
2079**17 - NEON_PHC,**
2080**18 - JADE,**
2081**19 - DEFAULT,**
2082**20 - UserDefined**
e5bd0d98 2083**Example:**
72b7576f 2084
2085vinit
2086meshfromstl mesh myfile.stl
2087meshmat mesh JADE
2088
e5bd0d98 2089@subsubsection occt_draw_4_33057 meshshrcoef
72b7576f 2090
dba69de2 2091Syntax: meshshrcoef meshname shrinkcoefficient
72b7576f 2092
2093Changes the value of shrink coefficient used in the shrink mode. In the shrink mode the face is shown as a congruent part of a usual face, so that **shrinkcoefficient** controls the value of this part. The **shrinkcoefficient** is a positive real number.
e5bd0d98 2094**Example:**
72b7576f 2095
2096vinit
2097meshfromstl mesh myfile.stl
2098meshshrcoef mesh 0.05
2099
e5bd0d98 2100@subsubsection occt_draw_4_33058 meshshow
72b7576f 2101
dba69de2 2102Syntax: meshshow meshname
72b7576f 2103
2104Displays **meshname** in the viewer (if it is erased).
e5bd0d98 2105**Example:**
72b7576f 2106
2107vinit
2108meshfromstl mesh myfile.stl
2109meshshow mesh
2110
e5bd0d98 2111@subsubsection occt_draw_4_33059 meshhide
72b7576f 2112
dba69de2 2113Syntax: meshhide meshname
72b7576f 2114
2115Hides **meshname** in the viewer.
e5bd0d98 2116**Example:**
72b7576f 2117
2118vinit
2119meshfromstl mesh myfile.stl
2120meshhide mesh
2121
e5bd0d98 2122@subsubsection occt_draw_4_330510 meshhidesel
72b7576f 2123
dba69de2 2124Syntax: meshhidesel meshname
72b7576f 2125
2126Hides only selected entities. The other part of **meshname** remains visible.
2127
e5bd0d98 2128@subsubsection occt_draw_4_330511 meshshowsel
72b7576f 2129
dba69de2 2130Syntax: meshshowsel meshname
72b7576f 2131
2132Shows only selected entities. The other part of **meshname** becomes invisible.
2133
e5bd0d98 2134@subsubsection occt_draw_4_330512 meshshowall
72b7576f 2135
dba69de2 2136Syntax: meshshowall meshname
72b7576f 2137
2138Changes the state of all entities to visible for **meshname**.
2139
e5bd0d98 2140@subsubsection occt_draw_4_330513 meshdelete
72b7576f 2141
dba69de2 2142Syntax: meshdelete meshname
72b7576f 2143
2144Deletes MeshVS_Mesh object **meshname**.
e5bd0d98 2145**Example:**
72b7576f 2146
2147vinit
2148meshfromstl mesh myfile.stl
2149meshdelete mesh
2150
2151
2152
2153
e5bd0d98 2154@subsection occt_draw_4_3306 AIS viewer – 2D viewer – view commands
72b7576f 2155
e5bd0d98 2156@subsubsection occt_draw_4_33061 v2dinit
72b7576f 2157
dba69de2 2158Syntax: v2dinit
72b7576f 2159
2160**v2dinit **creates the 2D viewer window.
2161
e5bd0d98 2162@subsubsection occt_draw_4_33062 v2dsetbg
72b7576f 2163
dba69de2 2164Syntax: v2dsetbg imagefile [filletype]
72b7576f 2165
2166**v2dsetbg** loads **imagefile** as background. **filletype** is **NONE**, **CENTERED**, **TILED**, **STRETCH**.
e5bd0d98 2167**Example:**
72b7576f 2168
2169v2dinit
2170v2dsetbg myimage.brep CENTERED
2171
e5bd0d98 2172@subsubsection occt_draw_4_33063 v2dfit
72b7576f 2173
dba69de2 2174Syntax: v2dfit
72b7576f 2175
2176Fits all shapes to the size of the window.
2177
e5bd0d98 2178@subsubsection occt_draw_4_33064 v2drepaint
72b7576f 2179
dba69de2 2180Syntax: v2drepaint
72b7576f 2181
2182Forcedly repaints all shapes.
2183
e5bd0d98 2184@subsubsection occt_draw_4_33065 v2dclear
72b7576f 2185
dba69de2 2186Syntax: v2dclear
72b7576f 2187
2188Clears the 2D viewer window
2189
e5bd0d98 2190@subsubsection occt_draw_4_33066 v2dtext
72b7576f 2191
dba69de2 2192Syntax: v2dtext text x y [angle scale fontindex]
72b7576f 2193
2194Creates a new object with the name **text_i** (i – integer value) and displays **text** at the position** x**, **y.** The text can be displayed at a certain **angle**, on a certain **scale** and with a certain **fontindex**.
2195Default values are: **angle=0.0, scale=1.0, fontindex=0**.
e5bd0d98 2196**Example:**
72b7576f 2197
2198v2dinit
2199v2dtext *My text* 10 10
e5bd0d98 2200@subsubsection occt_draw_4_33067 v2dsettextcolor
72b7576f 2201
dba69de2 2202Syntax: v2dsettextcolor text_name colorindex
72b7576f 2203
2204Changes the color of **text_name** object (**name** must be an integer value).
e5bd0d98 2205**Example:**
72b7576f 2206
2207v2dinit
2208v2dtext *My text* 10 10
2209# Change color to red
2210v2dsettextcolor text_0 3
e5bd0d98 2211@subsubsection occt_draw_4_33068 v2dpick
72b7576f 2212
dba69de2 2213Syntax: v2dpick
72b7576f 2214
2215Displays mouse coordinates and color after clicking the mouse button in the 2D viewer window.
2216
2217
e5bd0d98 2218@subsubsection occt_draw_4_33069 v2dgrid
72b7576f 2219
dba69de2 2220Syntax: v2dgrid [type x y xstep ystep angle [drawmode]]
2221 v2dgrid [type x y radiusstep division angle [drawmode]]
72b7576f 2222
2223Loads a grid in the 2D viewer window.
2224**type** is **Rect** or **Circ**.
2225**drawmode** is **Lines**, **Points** or **None**.
e5bd0d98 2226**Example:**
72b7576f 2227
2228v2dinit
2229v2dgrid Circ 0 0 250 12 0 Lines
2230v2drmgrid
2231v2dgrid Rect 0 0 200 200 0 Lines
e5bd0d98 2232@subsubsection occt_draw_4_330610 v2rmgrid
72b7576f 2233
dba69de2 2234Syntax: v2rmgrid
72b7576f 2235
2236Unloads a grid from the window.
2237
e5bd0d98 2238@subsubsection occt_draw_4_330611 v2dpickgrid
72b7576f 2239
dba69de2 2240Syntax: v2dpickgrid [mouse_x mouse_y [grid_x grid_y]]
72b7576f 2241
2242Gets coordinates of a grid point near the mouse button click in the 2D viewer window and sets it to **grid_x**, **grid_y** variables.
2243
e5bd0d98 2244@subsubsection occt_draw_4_330612 v2dpsout
72b7576f 2245
dba69de2 2246Syntax: v2dpsout imagefile [scale colorspace]
2247 [width height [xcenter ycenter]]
72b7576f 2248
2249Exports **imagefile**. You can set its the scale, width, height and colorspace.
2250**colorspace** can be **RGB, BlackAndWhite, GreyScale**.
2251
e5bd0d98 2252@subsubsection occt_draw_4_330612613 v2ddir
72b7576f 2253
dba69de2 2254Syntax: v2ddir
72b7576f 2255
2256Makes aLlist of the displayed objects.
2257
2258
e5bd0d98 2259@subsection occt_draw_4_3306127 Ais viewer – 2D viewer – display commands
72b7576f 2260
e5bd0d98 2261@subsubsection occt_draw_4_33061271 v2ddisplay
72b7576f 2262
dba69de2 2263Syntax: v2ddisplay name [projection]
72b7576f 2264
2265Projection: origin_x origin_y origin_z normal_x normal_y normal_z dx_x dx_y dx_z.
2266
2267Displays named objects.
e5bd0d98 2268**Example:**
72b7576f 2269
2270v2dinit
2271box b 10 10 10
2272psphere s 20
2273v2ddisplay s
2274v2ddisplay b
2275v2dfit
e5bd0d98 2276@subsubsection occt_draw_4_33061272 v2ddonly
72b7576f 2277
dba69de2 2278Syntax: v2ddonly [name1] … [name n]
72b7576f 2279
2280Displays only selected or named objects. If there are no selected or named objects, nothing is done.
e5bd0d98 2281**Example:**
72b7576f 2282
2283v2dinit
2284box b 10 10 10
2285psphere s 20
2286v2ddisplay b
2287v2ddisplay s
2288v2ddonly s
2289v2dfit
e5bd0d98 2290@subsubsection occt_draw_4_33061273 v2ddisplayall
72b7576f 2291
dba69de2 2292Syntax: v2ddisplayall
72b7576f 2293
2294Displays all created objects.
e5bd0d98 2295**Example:**
72b7576f 2296
2297v2dinit
2298box b 10 10 10
2299psphere s 20
2300v2ddisplay b
2301v2ddisplay s
2302v2ddonly
2303v2ddisplayall
2304v2dfit
e5bd0d98 2305@subsubsection occt_draw_4_33061274 v2derase
72b7576f 2306
dba69de2 2307Syntax: v2derase name1 [name2] … [name n]
72b7576f 2308
2309Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
e5bd0d98 2310**Example:**
72b7576f 2311
2312v2dinit
2313box b 10 10 10
2314psphere s 20
2315v2ddisplay b
2316v2ddisplay s
2317v2derase b
2318v2dfit
e5bd0d98 2319@subsubsection occt_draw_4_33061275 v2deraseall
72b7576f 2320
dba69de2 2321Syntax: v2deraseall
72b7576f 2322
2323Erases all objects displayed in the viewer.
e5bd0d98 2324**Example:**
72b7576f 2325
2326v2dinit
2327box b 10 10 10
2328psphere s 20
2329v2ddisplay b
2330v2ddisplay s
2331v2deraseall
2332v2dfit
e5bd0d98 2333@subsubsection occt_draw_4_33061276 v2dsetcolor
72b7576f 2334
dba69de2 2335Syntax: v2dsetcolor [shapename] colorname
72b7576f 2336
2337Sets color for all, selected or named shapes.
2338Values of **colorname** see **vsetcolor**.
e5bd0d98 2339**Example:**
72b7576f 2340
2341v2dinit
2342box b 10 10 10
2343v2ddisplay b
2344v2ddisplay s
2345v2dsetcolor b RED
2346v2dfit
e5bd0d98 2347@subsubsection occt_draw_4_33061277 v2dunsetcolor
72b7576f 2348
dba69de2 2349Syntax: v2dunsetcolor [shapename]
72b7576f 2350
2351Sets default color for all, selected or named shapes.
e5bd0d98 2352**Example:**
72b7576f 2353
2354v2dinit
2355box b 10 10 10
2356v2ddisplay b
2357v2ddisplay s
2358v2dsetcolor RED
2359v2dunsetcolor b
2360v2dfit
e5bd0d98 2361@subsubsection occt_draw_4_33061278 v2dsetbgcolor
72b7576f 2362
dba69de2 2363Syntax: v2dsetbgcolor colorname
72b7576f 2364
2365Sets background color.
2366See **vsetcolor** for the values of **colorname.**.
e5bd0d98 2367**Example:**
72b7576f 2368
2369v2dinit
2370box b 10 10 10
2371v2ddisplay b
2372v2ddisplay s
2373v2dsetbgcolor RED
2374v2dfit
e5bd0d98 2375@subsubsection occt_draw_4_33061279 v2dsetwidth
72b7576f 2376
dba69de2 2377Syntax: v2dsetwidth [shapename] widthenum
72b7576f 2378
2379Set width of the edges for all, selected or named shapes.
2380**widthenum** may be one of: **THIN, MEDIUM, THICK, VERYTHICK**.
e5bd0d98 2381**Example:**
72b7576f 2382
2383v2dinit
2384box b 10 10 10
2385v2ddisplay b
2386v2ddisplay s
2387v2dsetwidth b THICK
2388v2dfit
e5bd0d98 2389@subsubsection occt_draw_4_330612710 v2dunsetwidth
72b7576f 2390
dba69de2 2391Syntax: vunsetwidth [shapename]
72b7576f 2392
2393Sets default width of the edges for all, selected or named shapes.
e5bd0d98 2394**Example:**
72b7576f 2395
2396v2dinit
2397box b 10 10 10
2398v2ddisplay b
2399v2ddisplay s
2400v2dsetwidth THICK
2401v2dunsetwidth b
2402v2dfit
2403
2404@section occt_2142243456_930384826 OCAF commands
2405
2406
2407This chapter contains a set of commands for Open CASCADE Technology Application Framework (OCAF).
2408
2409
2410@subsection occt_2142243456_9303848261 Application commands
2411
2412
2413@subsubsection occt_2142243456_93038482611 NewDocument
2414
dba69de2 2415Syntax: NewDocument docname [format]
72b7576f 2416
2417Creates a new **docname** document with MDTV-Standard or described format.
e5bd0d98 2418**Example:**
72b7576f 2419
2420# Create new document with default (MDTV-Standard) format
2421NewDocument D
2422
2423# Create new document with BinOcaf format
2424NewDocument D2 BinOcaf
2425
2426@subsubsection occt_2142243456_93038482612 IsInSession
2427
dba69de2 2428Syntax: IsInSession path
72b7576f 2429
2430**I**Returns **0**, if **path** document is managed by the application session, **1** – otherwise.
e5bd0d98 2431**Example:**
72b7576f 2432
2433IsInSession /myPath/myFile.std
2434
2435@subsubsection occt_2142243456_93038482613 ListDocuments
2436
dba69de2 2437Syntax: ListDocuments
72b7576f 2438
2439Makes a list of documents handled during the session of the application.
2440
2441
2442@subsubsection occt_2142243456_93038482614 Open
2443
dba69de2 2444Syntax: Open path docname
72b7576f 2445
2446Retrieves the document of file **docname** in the path **path**. Overwrites the document, if it is already in session.
e5bd0d98 2447**Example:**
72b7576f 2448
2449Open /myPath/myFile.std D
2450
2451@subsubsection occt_2142243456_93038482615 Close
2452
dba69de2 2453Syntax: Close docname
72b7576f 2454
2455Closes **docname** document. The document is no longer handled by the applicative session.
e5bd0d98 2456**Example:**
72b7576f 2457
2458Close D
2459
2460@subsubsection occt_2142243456_93038482616 Save
2461
dba69de2 2462Syntax: Save docname
72b7576f 2463
2464Saves **docname** active document.
e5bd0d98 2465**Example:**
72b7576f 2466
2467Save D
2468
2469@subsubsection occt_2142243456_93038482617 SaveAs
2470
dba69de2 2471Syntax: SaveAs docname path
72b7576f 2472
2473Saves the active document in the file **docname** in the path **path**. Overwrites the file if it already exists.
e5bd0d98 2474**Example:**
72b7576f 2475
2476SaveAs D /myPath/myFile.std
2477
2478@subsection occt_2142243456_9303848262 Basic commands
2479
2480
2481@subsubsection occt_2142243456_930384826521 Label
2482
dba69de2 2483Syntax: Label docname entry
72b7576f 2484
2485Creates the label expressed by **entry** if it does not exist.
e5bd0d98 2486**Example:**
72b7576f 2487
2488Label D 0:2
2489
2490@subsubsection occt_2142243456_930384826522 NewChild
2491
dba69de2 2492Syntax: NewChild docname [taggerlabel = Root label]
72b7576f 2493
2494Finds (or creates) a TagSource attribute located at father label of **taggerlabel** and makes a new child label.
e5bd0d98 2495**Example:**
72b7576f 2496
2497# Create new child of root label
2498NewChild D
2499
2500# Create new child of existing label
2501Label D 0:2
2502NewChild D 0:2
2503
2504@subsubsection occt_2142243456_930384826523 Children
2505
dba69de2 2506Syntax: Children docname label
72b7576f 2507
2508Returns the list of attributes of **label**.
e5bd0d98 2509**Example:**
72b7576f 2510
2511Children D 0:2
2512
2513@subsubsection occt_2142243456_930384826524 ForgetAll
2514
dba69de2 2515Syntax: ForgetAll docname label
72b7576f 2516
2517Forgets all attributes of the label.
e5bd0d98 2518**Example:**
72b7576f 2519
2520ForgetAll D 0:2
2521
2522@subsection occt_2142243456_93038482653 Application commands
2523
2524
2525@subsubsection occt_2142243456_930384826531 Main
2526
dba69de2 2527Syntax: Main docname
72b7576f 2528
2529Returns the main label of the framework.
e5bd0d98 2530**Example:**
72b7576f 2531
2532Main D
2533
2534@subsubsection occt_2142243456_930384826532 UndoLimit
2535
dba69de2 2536Syntax: UndoLimit docname [value=0]
72b7576f 2537
2538
2539Sets the limit on the number of Undo Delta stored. 0 will disable Undo on the document. A negative **value** means that there is no limit. Note that by default Undo is disabled. Enabling it will take effect with the next call to NewCommand. Of course, this limit is the same for Redo
e5bd0d98 2540**Example:**
72b7576f 2541
2542UndoLimit D 100
2543
2544@subsubsection occt_2142243456_930384826533 Undo
2545
dba69de2 2546Syntax: Undo docname [value=1]
72b7576f 2547
2548Undoes **value** steps.
e5bd0d98 2549**Example:**
72b7576f 2550
2551Undo D
2552
2553@subsubsection occt_2142243456_930384826534 Redo
2554
dba69de2 2555Syntax: Redo docname [value=1]
72b7576f 2556
2557Redoes **value** steps.
e5bd0d98 2558**Example:**
72b7576f 2559
2560Redo D
2561
2562@subsubsection occt_2142243456_930384826535 OpenCommand
2563
dba69de2 2564Syntax: OpenCommand docname
72b7576f 2565
2566Opens a new command transaction.
e5bd0d98 2567**Example:**
72b7576f 2568
2569OpenCommand D
2570
2571@subsubsection occt_2142243456_930384826536 CommitCommand
2572
dba69de2 2573Syntax: CommitCommand docname
72b7576f 2574
2575Commits the Command transaction.
e5bd0d98 2576**Example:**
72b7576f 2577
2578CommitCommand D
2579
2580@subsubsection occt_2142243456_930384826537 NewCommand
2581
dba69de2 2582Syntax: NewCommand docname
72b7576f 2583
2584This is a short-cut for Commit and Open transaction.
e5bd0d98 2585**Example:**
72b7576f 2586
2587NewCommand D
2588
2589@subsubsection occt_2142243456_930384826538 AbortCommand
2590
dba69de2 2591Syntax: AbortCommand docname
72b7576f 2592
2593Aborts the Command transaction.
e5bd0d98 2594**Example:**
72b7576f 2595
2596AbortCommand D
2597
2598@subsubsection occt_2142243456_930384826539 Copy
2599
dba69de2 2600Syntax: Copy docname entry Xdocname Xentry
72b7576f 2601
2602Copies the contents of **entry** to **Xentry**. No links are registred.
e5bd0d98 2603**Example:**
72b7576f 2604
2605Copy D1 0:2 D2 0:4
2606
2607@subsubsection occt_2142243456_9303848265310 UpdateLink
2608
dba69de2 2609Syntax: UpdateLink docname [entry]
72b7576f 2610
2611Updates external reference set at **entry**.
e5bd0d98 2612**Example:**
72b7576f 2613
2614UpdateLink D
2615
2616@subsubsection occt_2142243456_9303848265311 CopyWithLink
2617
dba69de2 2618Syntax: CopyWithLink docname entry Xdocname Xentry
72b7576f 2619
2620Aborts the Command transaction.
2621Copies the content of **entry** to **Xentry**. The link is registred with an Xlink attribute at ** Xentry** label.
e5bd0d98 2622**Example:**
72b7576f 2623
2624CopyWithLink D1 0:2 D2 0:4
2625
2626@subsubsection occt_2142243456_9303848265312 UpdateXLinks
2627
dba69de2 2628Syntax: UpdateXLinks docname entry
72b7576f 2629
2630Sets modifications on labels impacted by external references to the **entry**. The **document** becomes invalid and must be recomputed
e5bd0d98 2631**Example:**
72b7576f 2632
2633UpdateXLinks D 0:2
2634
2635@subsubsection occt_2142243456_9303848265313 DumpDocument
2636
dba69de2 2637Syntax: DumpDocument docname
72b7576f 2638
2639Displays parameters of **docname** document.
e5bd0d98 2640**Example:**
72b7576f 2641
2642DumpDocument D
2643
2644@subsection occt_2142243456_93038482654 Data Framework commands
2645
2646
2647@subsubsection occt_2142243456_930384826541 MakeDF
2648
dba69de2 2649Syntax: MakeDF dfname
72b7576f 2650
2651Creates a new data framework.
e5bd0d98 2652**Example:**
72b7576f 2653
2654MakeDF D
2655
2656@subsubsection occt_2142243456_930384826542 ClearDF
2657
dba69de2 2658Syntax: ClearDF dfname
72b7576f 2659
2660Clears a data framework.
e5bd0d98 2661**Example:**
72b7576f 2662
2663ClearDF D
2664
2665@subsubsection occt_2142243456_930384826543 CopyDF
2666
dba69de2 2667Syntax: CopyDF dfname1 entry1 [dfname2] entry2
72b7576f 2668
2669Copies a data framework.
e5bd0d98 2670**Example:**
72b7576f 2671
2672CopyDF D 0:2 0:4
2673
2674@subsubsection occt_2142243456_930384826544 CopyLabel
2675
dba69de2 2676Syntax: CopyLabel dfname fromlabel tolablel
72b7576f 2677
2678Copies a label.
e5bd0d98 2679**Example:**
72b7576f 2680
2681CopyLabel D1 0:2 0:4
2682
2683@subsubsection occt_2142243456_930384826545 MiniDumpDF
2684
dba69de2 2685Syntax: MiniDumpDF dfname
72b7576f 2686
2687Makes a mini-dump of a data framework.
e5bd0d98 2688**Example:**
72b7576f 2689
2690MiniDumpDF D
2691
2692@subsubsection occt_2142243456_930384826546 XDumpDF
2693
dba69de2 2694Syntax: XDumpDF dfname
72b7576f 2695
2696Makes an extended dump of a data framework.
e5bd0d98 2697**Example:**
72b7576f 2698
2699XDumpDF D
2700
2701@subsection occt_2142243456_93038482655 General attributes commands
2702
2703
2704@subsubsection occt_2142243456_930384826551 SetInteger
2705
dba69de2 2706Syntax: SetInteger dfname entry value
72b7576f 2707
2708Finds or creates an Integer attribute at **entry** label and sets **value**.
e5bd0d98 2709**Example:**
72b7576f 2710
2711SetInteger D 0:2 100
2712
2713@subsubsection occt_2142243456_930384826552 GetInteger
2714
dba69de2 2715Syntax: GetInteger dfname entry [drawname]
72b7576f 2716
2717Gets a value of an Integer attribute at **entry** label and sets it to **drawname** variable, if it is defined.
e5bd0d98 2718**Example:**
72b7576f 2719
2720GetInteger D 0:2 Int1
2721
2722@subsubsection occt_2142243456_930384826553 SetReal
2723
dba69de2 2724Syntax: SetReal dfname entry value
72b7576f 2725
2726Finds or creates a Real attribute at **entry** label and sets **value**.
e5bd0d98 2727**Example:**
72b7576f 2728
2729SetReal D 0:2 100.
2730
2731@subsubsection occt_2142243456_930384826554 GetReal
2732
dba69de2 2733Syntax: GetReal dfname entry [drawname]
72b7576f 2734
2735Gets a value of a Real attribute at **entry** label and sets it to **drawname** variable, if it is defined.
e5bd0d98 2736**Example:**
72b7576f 2737
2738GetReal D 0:2 Real1
2739
2740@subsubsection occt_2142243456_930384826555 SetIntArray
2741
dba69de2 2742Syntax: SetIntArray dfname entry lower upper value1 value2 …
72b7576f 2743
2744Finds or creates an IntegerArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
e5bd0d98 2745**Example:**
72b7576f 2746
2747SetIntArray D 0:2 1 4 100 200 300 400
2748
2749@subsubsection occt_2142243456_930384826556 GetIntArray
2750
dba69de2 2751Syntax: GetIntArray dfname entry
72b7576f 2752
2753Gets a value of an IntegerArray attribute at **entry** label.
e5bd0d98 2754**Example:**
72b7576f 2755
2756GetIntArray D 0:2
2757
2758@subsubsection occt_2142243456_930384826557 SetRealArray
2759
dba69de2 2760Syntax: SetRealArray dfname entry lower upper value1 value2 …
72b7576f 2761
2762Finds or creates a RealArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
e5bd0d98 2763**Example:**
72b7576f 2764
2765GetRealArray D 0:2 1 4 100. 200. 300. 400.
2766
2767@subsubsection occt_2142243456_930384826558 GetRealArray
2768
dba69de2 2769Syntax: GetRealArray dfname entry
72b7576f 2770
2771Gets a value of a RealArray attribute at **entry** label.
e5bd0d98 2772**Example:**
72b7576f 2773
2774GetRealArray D 0:2
2775
2776@subsubsection occt_2142243456_930384826559 SetComment
2777
dba69de2 2778Syntax: SetComment dfname entry value
72b7576f 2779
2780Finds or creates a Comment attribute at **entry** label and sets **value**.
e5bd0d98 2781**Example:**
72b7576f 2782
2783SetComment D 0:2 *My comment*
2784
2785@subsubsection occt_2142243456_9303848265510 GetComment
2786
dba69de2 2787Syntax: GetComment dfname entry
72b7576f 2788
2789Gets a value of a Comment attribute at **entry** label.
e5bd0d98 2790**Example:**
72b7576f 2791
2792GetComment D 0:2
2793
2794@subsubsection occt_2142243456_9303848265511 SetExtStringArray
2795
dba69de2 2796Syntax: SetExtStringArray dfname entry lower upper value1 value2 …
72b7576f 2797
2798Finds or creates an ExtStringArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
e5bd0d98 2799**Example:**