0024336: Content of OCCT documentation should be updated. Iter 2
[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
668c2575 1487If no shape is specified through the command arguments, the given HLR algorithm_type is applied to all *AIS_Shape* instances in the current context, and the command also changes the default HLR algorithm type.
e5bd0d98 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:
668c2575 1497~~~~~
e5bd0d98 1498vdisplay name1 [name2] … [name n]
668c2575 1499~~~~~
72b7576f 1500Displays named objects.
72b7576f 1501
668c2575 1502**Example:**
1503~~~~~
72b7576f 1504vinit
1505box b 40 40 40 10 10 10
1506psphere s 20
1507vdisplay s b
1508vfit
668c2575 1509~~~~~
72b7576f 1510
668c2575 1511@subsubsection occt_draw_4_3_2 vdonly
72b7576f 1512
668c2575 1513Syntax:
1514~~~~~
1515vdonly [name1] … [name n]
1516~~~~~
72b7576f 1517Displays only selected or named objects. If there are no selected or named objects, nothing is done.
72b7576f 1518
668c2575 1519**Example:**
1520~~~~~
72b7576f 1521vinit
1522box b 40 40 40 10 10 10
1523psphere s 20
1524vdonly b
1525vfit
668c2575 1526~~~~~
72b7576f 1527
668c2575 1528@subsubsection occt_draw_4_3_3 vdisplayall
72b7576f 1529
668c2575 1530Syntax:
1531~~~~~
1532vdisplayall
1533~~~~~
72b7576f 1534Displays all created objects.
72b7576f 1535
668c2575 1536
1537**Example:**
1538~~~~~
72b7576f 1539vinit
1540box b 40 40 40 10 10 10
1541psphere s 20
1542vdisplayall
1543vfit
668c2575 1544~~~~~
72b7576f 1545
668c2575 1546@subsubsection occt_draw_4_3_4 verase
1547
1548Syntax:
1549~~~~~
1550verase [name1] [name2] … [name n]
1551~~~~~
72b7576f 1552
1553Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
72b7576f 1554
668c2575 1555**Example:**
1556~~~~~
72b7576f 1557vinit
1558box b1 40 40 40 10 10 10
1559box b2 -40 -40 -40 10 10 10
1560psphere s 20
1561vdisplayall
1562vfit
668c2575 1563# erase only the first box
72b7576f 1564verase b1
668c2575 1565# erase the second box and sphere
72b7576f 1566verase
668c2575 1567~~~~~
72b7576f 1568
668c2575 1569@subsubsection occt_draw_4_3_5 veraseall
72b7576f 1570
668c2575 1571Syntax:
1572~~~~~
1573veraseall
1574~~~~~
72b7576f 1575Erases all objects displayed in the viewer.
668c2575 1576
e5bd0d98 1577**Example:**
668c2575 1578
1579~~~~~
72b7576f 1580vinit
1581box b1 40 40 40 10 10 10
1582box b2 -40 -40 -40 10 10 10
1583psphere s 20
1584vdisplayall
1585vfit
668c2575 1586# erase only the first box
72b7576f 1587verase b1
668c2575 1588# erase the second box and sphere
72b7576f 1589verseall
668c2575 1590~~~~~
72b7576f 1591
668c2575 1592@subsubsection occt_draw_4_3_6 vsetdispmode
1593
1594Syntax:
1595
1596~~~~~
1597vsetdispmode [name] mode(0,1,2,3)
1598~~~~~
72b7576f 1599
668c2575 1600Sets display mode for all, selected or named objects to the following values:
1601* **0** - WireFrame,
1602* **1** - Shading,
1603* **2** - Quick HideLineremoval,
1604* **3** - Exact HideLineremoval.
72b7576f 1605
e5bd0d98 1606**Example:**
72b7576f 1607
668c2575 1608~~~~~
72b7576f 1609vinit
1610box b 10 10 10
1611vdisplay b
1612vsetdispmode 1
1613vfit
668c2575 1614~~~~~
1615@subsubsection occt_draw_4_39 vtypes
72b7576f 1616
668c2575 1617Syntax: vtypes
72b7576f 1618
668c2575 1619Makes a list of known types and signatures in AIS.
72b7576f 1620
668c2575 1621@subsubsection occt_draw_4_3_7 vdisplaytype
1622
1623Syntax:
1624~~~~~
1625vdisplaytype type
1626~~~~~
1627
1628Displays all objects of a given type. The following types are possible: **Point, Axis, Trihedron, PlaneTrihedron, Line, Circle, Plane, Shape, ConnectedShape, MultiConn.Shape, ConnectedInter., MultiConn., Constraint** and **Dimension**.
1629
1630@subsubsection occt_draw_4_3_8 verasetype
72b7576f 1631
dba69de2 1632Syntax: verasetype type
72b7576f 1633
1634Erases all objects of a given type.
1635Possible** type**s are **;Point;, ;Axis;, ;Trihedron;, ;PlaneTrihedron;, ;Line;, ;Circle;, ;Plane;, ;Shape;, ;ConnectedShape;, ;MultiConn.Shape;, ;ConnectedInter.;, ;MultiConn.;, ;Constraint; **and **;Dimension; **(see **vtypes**).
1636
72b7576f 1637
72b7576f 1638
e5bd0d98 1639@subsubsection occt_draw_4_310 vsetcolor
72b7576f 1640
dba69de2 1641Syntax: vsetcolor [shapename] colorname
72b7576f 1642
1643Sets color for all, selected or named shapes.
e5bd0d98 1644Possible **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 1645
1646
1647
e5bd0d98 1648@subsubsection occt_draw_4_311 vunsetcolor
72b7576f 1649
dba69de2 1650Syntax: vunsetcolor [shapename]
72b7576f 1651
1652Sets default color for all, selected or named shapes.
1653
e5bd0d98 1654@subsubsection occt_draw_4_312 vsettransparency
72b7576f 1655
dba69de2 1656Syntax: vsettransparency [shapename] coeficient
72b7576f 1657
1658Sets 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 1659**Example:**
72b7576f 1660
1661vinit
1662box b 10 10 10
1663psphere s 20
1664vdisplay b s
1665vfit
1666vsetdispmode 1
1667vsettransparency b 0.5
1668
e5bd0d98 1669@subsubsection occt_draw_4_313 vunsettransparency
72b7576f 1670
dba69de2 1671Syntax: vunsettransparency [shapename]
72b7576f 1672
1673Sets default transparency (0.0) for all selected or named shapes.
1674
e5bd0d98 1675@subsubsection occt_draw_4_314 vsetmaterial
72b7576f 1676
dba69de2 1677Syntax: vsetmaterial [shapename] materialname
72b7576f 1678
1679Sets material for all selected or named shapes.
1680**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 1681**Example:**
72b7576f 1682
1683vinit
1684psphere s 20
1685vdisplay s
1686vfit
1687vsetdispmode 1
1688vsetmaterial s JADE
1689
e5bd0d98 1690@subsubsection occt_draw_4_315 vunsetmaterial
72b7576f 1691
dba69de2 1692Syntax: vunsetmaterial [shapename]
72b7576f 1693
1694Sets default material for all selected or named shapes.
1695
e5bd0d98 1696@subsubsection occt_draw_4_316 vsetwidth
72b7576f 1697
dba69de2 1698Syntax: vsetwidth [shapename] coeficient
72b7576f 1699
1700Sets width of the edges for all selected or named shapes.
1701The **Coefficient** may be between 0.0 and 10.0.
e5bd0d98 1702**Example:**
72b7576f 1703
1704vinit
1705box b 10 10 10
1706vdisplay b
1707vfit
1708vsetwidth b 5
1709
e5bd0d98 1710@subsubsection occt_draw_4_317 vunsetwidth
72b7576f 1711
dba69de2 1712Syntax: vunsetwidth [shapename]
72b7576f 1713
1714Sets default width of edges (0.0) for all selected or named shapes.
1715
e5bd0d98 1716@subsubsection occt_draw_4_318 vsetshading
72b7576f 1717
dba69de2 1718Syntax: vsetshading shapename [coefficient]
72b7576f 1719
1720Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
e5bd0d98 1721**Example:**
72b7576f 1722
1723vinit
1724psphere s 20
1725vdisplay s
1726vfit
1727vsetdispmode 1
1728vsetshading s 0.005
e5bd0d98 1729@subsubsection occt_draw_4_319 vunsetshading
72b7576f 1730
dba69de2 1731Syntax: vunsetshading [shapename]
72b7576f 1732
1733Sets default deflection coefficient (0.0008) that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
1734
e5bd0d98 1735@subsubsection occt_draw_4_320 vsetam
72b7576f 1736
dba69de2 1737Syntax: vsetam [shapename] mode
72b7576f 1738
1739Activates selection mode for all selected or named shapes.
1740**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 1741**Example:**
72b7576f 1742
1743vinit
1744box b 10 10 10
1745vdisplay b
1746vfit
1747vsetam b 2
e5bd0d98 1748@subsubsection occt_draw_4_321 vunsetam
72b7576f 1749
dba69de2 1750Syntax: vunsetam
72b7576f 1751
1752Deactivates all selection modes for all shapes.
1753
e5bd0d98 1754@subsubsection occt_draw_4_322 vdump
72b7576f 1755
dba69de2 1756Syntax: vdump filename.{png|xwd|bmp}
72b7576f 1757
1758Extracts the contents of the viewer window to a png, XWD or BMP file.
1759
e5bd0d98 1760@subsubsection occt_draw_4_323 vdir
72b7576f 1761
dba69de2 1762Syntax: vdir
72b7576f 1763
1764Displays the list of displayed objects.
1765
e5bd0d98 1766@subsubsection occt_draw_4_324 vsub
72b7576f 1767
dba69de2 1768Syntax: vsub 0/1(on/off)[shapename]
72b7576f 1769
1770Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
e5bd0d98 1771**Example:**
72b7576f 1772
1773vinit
1774box b 10 10 10
1775psphere s 20
1776vdisplay b s
1777vfit
1778vsetdispmode 1
1779vsub b 1
1780
e5bd0d98 1781@subsubsection occt_draw_4_325 vardis
72b7576f 1782
dba69de2 1783Syntax: vardis
72b7576f 1784
1785Displays active areas (for each activated sensitive entity, one or several 2D bounding boxes are displayed, depending on the implementation of a particular entity).
1786
e5bd0d98 1787@subsubsection occt_draw_4_326 varera
72b7576f 1788
dba69de2 1789Syntax: varera
72b7576f 1790
1791Erases active areas.
1792
e5bd0d98 1793@subsubsection occt_draw_4_327 vsensdis
72b7576f 1794
dba69de2 1795Syntax: vsensdis
72b7576f 1796
1797Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes).
1798
1799Standard entity types are those defined in Select3D package:
1800 * sensitive box
1801 * sensitive face
1802 * sensitive curve
1803 * sensitive segment
1804 * sensitive circle
1805 * sensitive point
1806 * sensitive triangulation
1807 * sensitive triangle
1808Custom (application-defined) sensitive entity types are not processed by this command.
1809
e5bd0d98 1810@subsubsection occt_draw_4_328 vsensera
72b7576f 1811
dba69de2 1812Syntax: vsensera
72b7576f 1813
1814Erases active entities.
1815
e5bd0d98 1816@subsubsection occt_draw_4_329 vperf
72b7576f 1817
dba69de2 1818Syntax: vperf shapename 1/0 (Transformation/Loacation) 1/0 (Primitives sensibles ON/OFF)
72b7576f 1819
1820Tests the animation of an object along a predefined trajectory.
e5bd0d98 1821**Example:**
72b7576f 1822
1823vinit
1824box b 10 10 10
1825psphere s 20
1826vdisplay b s
1827vfit
1828vsetdispmode 0
1829vperf b 1 1
e5bd0d98 1830@subsubsection occt_draw_4_330 vr
72b7576f 1831
dba69de2 1832Syntax: vr filename
72b7576f 1833
1834Reads shape from BREP-format file and displays it in the viewer.
e5bd0d98 1835**Example:**
72b7576f 1836
1837vinit
1838vr myshape.brep
e5bd0d98 1839@subsubsection occt_draw_4_330331 vstate
72b7576f 1840
dba69de2 1841Syntax: vstate [name1] … [name n]
72b7576f 1842
1843Makes a list of the status (**Displayed** or **Not Displayed**) of some selected or named objects.
1844
1845
1846
e5bd0d98 1847@subsection occt_draw_4_3304 AIS viewer – object commands
72b7576f 1848
e5bd0d98 1849@subsubsection occt_draw_4_33041 vtrihedron
72b7576f 1850
dba69de2 1851Syntax: vtrihedron name [X0] [Y0] [Z0] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw]
72b7576f 1852
1853Creates a new AIS_Trihedron object. If no argument is set, the default trihedron (0XYZ) is created.
e5bd0d98 1854**Example:**
72b7576f 1855
1856vinit
1857vtrihedron tr
1858
e5bd0d98 1859@subsubsection occt_draw_4_33042 vplanetri
72b7576f 1860
dba69de2 1861Syntax: vplanetri name
72b7576f 1862
1863Creates a plane from a trihedron selection.
1864
1865
e5bd0d98 1866@subsubsection occt_draw_4_33043 vsize
72b7576f 1867
dba69de2 1868Syntax: vsize [name] [size]
72b7576f 1869
1870Changes 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 1871**Example:**
72b7576f 1872
1873vinit
1874vtrihedron tr1
1875vtrihedron tr2 0 0 0 1 0 0 1 0 0
1876vsize tr2 400
1877
e5bd0d98 1878@subsubsection occt_draw_4_33044 vaxis
72b7576f 1879
dba69de2 1880Syntax: vaxis name [Xa Ya Za Xb Yb Zb]
72b7576f 1881
dba69de2 1882Creates an axis. If the values are not defined, an axis is created by interactive selection of two vertices or one edge
e5bd0d98 1883**Example:**
72b7576f 1884
1885vinit
1886vtrihedron tr
1887vaxis axe1 0 0 0 1 0 0
1888
e5bd0d98 1889@subsubsection occt_draw_4_33045 vaxispara
72b7576f 1890
dba69de2 1891Syntax: vaxispara nom
72b7576f 1892
1893Creates an axis by interactive selection of an edge and a vertex.
1894
e5bd0d98 1895@subsubsection occt_draw_4_33046 vaxisortho
72b7576f 1896
dba69de2 1897Syntax: vaxisotrho name
72b7576f 1898
1899Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge.
1900
e5bd0d98 1901@subsubsection occt_draw_4_33047 vpoint
72b7576f 1902
dba69de2 1903Syntax: vpoint name [Xa Ya Za]
72b7576f 1904
1905Creates 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 1906**Example:**
72b7576f 1907
1908vinit
1909vpoint p 0 0 0
1910
e5bd0d98 1911@subsubsection occt_draw_4_33048 vplane
72b7576f 1912
dba69de2 1913Syntax: vplane name [AxisName] [PointName]
1914 vplane name [PointName] [PointName] [PointName]
1915 vplane name [PlaneName] [PointName]
72b7576f 1916
1917Creates a plane from named or interactively selected entities.
e5bd0d98 1918**Example:**
72b7576f 1919
1920vinit
1921vpoint p1 0 50 0
1922vaxis axe1 0 0 0 0 0 1
1923vtrihedron tr
1924vplane plane1 axe1 p1
1925
e5bd0d98 1926@subsubsection occt_draw_4_33049 vplanepara
72b7576f 1927
dba69de2 1928Syntax: vplanepara name
72b7576f 1929
1930Creates a plane from interactively selected vertex and face.
1931
e5bd0d98 1932@subsubsection occt_draw_4_330410 vplaneortho
72b7576f 1933
dba69de2 1934Syntax: vplaneortho name
72b7576f 1935
1936Creates a plane from interactive selected face and coplanar edge.
1937
e5bd0d98 1938@subsubsection occt_draw_4_330411 vline
72b7576f 1939
dba69de2 1940Syntax: vline name [PointName] [PointName]
1941 vline name [Xa Ya Za Xb Yb Zb]
72b7576f 1942
1943Creates a line from coordinates, named or interactively selected vertices.
e5bd0d98 1944**Example:**
72b7576f 1945
1946vinit
1947vtrihedron tr
1948vpoint p1 0 50 0
1949vpoint p2 50 0 0
1950vline line1 p1 p2
1951vline line2 0 0 0 50 0 1
1952
e5bd0d98 1953@subsubsection occt_draw_4_330412 vcircle
72b7576f 1954
dba69de2 1955Syntax: vcircle name [PointName PointName PointName IsFilled]
72b7576f 1956vcircle name [PlaneName PointName Radius IsFilled]
1957
1958Creates a circle from named or interactively selected entities. Parameter IsFilled is defined as 0 or 1.
e5bd0d98 1959**Example:**
72b7576f 1960
1961vinit
1962vtrihedron tr
1963vpoint p1 0 50 0
1964vpoint p2 50 0 0
1965vpoint p3 0 0 0
1966vcircle circle1 p1 p2 p3 1
1967
1968
e5bd0d98 1969@subsubsection occt_draw_4_330413 vtri2d
72b7576f 1970
dba69de2 1971Syntax: vtri2d name
72b7576f 1972
1973Creates a plane with a 2D trihedron from an interactively selected face.
1974
e5bd0d98 1975@subsubsection occt_draw_4_330414 vselmode
72b7576f 1976
dba69de2 1977Syntax: vselmode [object] mode On/Off
72b7576f 1978
1979Sets the selection mode for an object. If the object value is not defined, the selection mode is set for all displayed objects.
1980Value On is defined as 1 and Off – as 0.
e5bd0d98 1981**Example:**
72b7576f 1982
1983vinit
1984vpoint p1 0 0 0
1985vpoint p2 50 0 0
1986vpoint p3 25 40 0
1987vtriangle triangle1 p1 p2 p3
e5bd0d98 1988@subsubsection occt_draw_4_330415 vconnect, vconnectsh
72b7576f 1989
dba69de2 1990Syntax: vconnect name object Xo Yo Zo Xu Xv Xw Zu Zv Zw
1991 vconnectsh name shape Xo Yo Zo Xu Xv Xw Zu Zv Zw
72b7576f 1992
1993Creates and displays an object with input location connected to a named entity.
1994The difference between these two commands is that the object created by vconnect does not support the selection modes differrent from 0.
e5bd0d98 1995**Example:**
72b7576f 1996
1997Vinitvinit
1998vpoint p1 0 0 0
1999vpoint p2 50 0 0
2000vsegment segment p1 p2
2001restore CrankArm.brep obj
2002vdisplay obj
2003vconnectsh new obj 100100100 1 0 0 0 0 1
2004
2005
2006
e5bd0d98 2007@subsubsection occt_draw_4_330416 vtriangle
72b7576f 2008
dba69de2 2009Syntax: vtriangle name PointName PointName PointName
72b7576f 2010
2011Creates and displays a filled triangle from named points.
e5bd0d98 2012**Example:**
72b7576f 2013
2014vinit
2015vpoint p1 0 0 0
2016vpoint p2 50 0 0
2017vpoint p3 25 40 0
2018vtriangle triangle1 p1 p2 p3
2019
e5bd0d98 2020@subsubsection occt_draw_4_330417 vsegment
72b7576f 2021
dba69de2 2022Syntax: vsegment name PointName PointName
72b7576f 2023
2024Creates and displays a segment from named points.
e5bd0d98 2025**Example:**
72b7576f 2026
2027Vinit
2028vpoint p1 0 0 0
2029vpoint p2 50 0 0
2030vsegment segment p1 p2
2031
2032
2033**MeshVS **(Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.
2034
2035
2036
e5bd0d98 2037@subsection occt_draw_4_3305 AIS viewer – Mesh Visualization Service
72b7576f 2038
e5bd0d98 2039@subsubsection occt_draw_4_33051 meshfromstl
72b7576f 2040
dba69de2 2041Syntax: meshfromstl meshname file
72b7576f 2042
2043Creates a MeshVS_Mesh object based on STL file data. The object will be displayed immediately.
e5bd0d98 2044**Example:**
72b7576f 2045
2046meshfromstl mesh myfile.stl
2047
e5bd0d98 2048@subsubsection occt_draw_4_33052 meshdispmode
72b7576f 2049
dba69de2 2050Syntax: meshdispmode meshname displaymode
72b7576f 2051
2052Changes 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 2053**Example:**
72b7576f 2054
2055vinit
2056meshfromstl mesh myfile.stl
2057meshdispmode mesh 2
2058
e5bd0d98 2059@subsubsection occt_draw_4_33053 meshselmode
72b7576f 2060
dba69de2 2061Syntax: meshselmode meshname selectionmode
72b7576f 2062
2063Changes the selection mode of object **meshname**. The **selectionmode** is integer OR-combination of mode flags. The basic flags are the following:
2064**1** – node selection,
2065**2** – 0D elements (not suppored in STL)
2066**4** – links (not supported in STL)
2067**8** – faces
e5bd0d98 2068**Example:**
72b7576f 2069
2070vinit
2071meshfromstl mesh myfile.stl
2072meshselmode mesh 1
2073
e5bd0d98 2074@subsubsection occt_draw_4_33054 meshshadcolor
72b7576f 2075
dba69de2 2076Syntax: meshshadcolor meshname red green blue
72b7576f 2077
2078Changes the face interior color of object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
e5bd0d98 2079**Example:**
72b7576f 2080
2081vinit
2082meshfromstl mesh myfile.stl
2083meshshadcolormode mesh 0.5 0.5 0.5
2084
e5bd0d98 2085@subsubsection occt_draw_4_33055 meshlinkcolor
72b7576f 2086
dba69de2 2087Syntax: meshlinkcolor meshname red green blue
72b7576f 2088
2089Changes the color of face borders for object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
e5bd0d98 2090**Example:**
72b7576f 2091
2092vinit
2093meshfromstl mesh myfile.stl
2094meshlinkcolormode mesh 0.5 0.5 0.5
2095
e5bd0d98 2096@subsubsection occt_draw_4_33056 meshmat
72b7576f 2097
dba69de2 2098Syntax: meshmat meshname material
72b7576f 2099
2100Changes the material of object **meshname**. **material** is represented with an integer value as follows (equivalent to enumeration Graphic3d_NameOfMaterial):
2101**0 – BRASS,**
2102**1 – BRONZE,**
2103**2 - COPPER,**
2104**3 - GOLD,**
2105**4 - PEWTER,**
2106**5 - PLASTER,**
2107**6 - PLASTIC,**
2108**7 - SILVER,**
2109**8 - STEEL,**
2110**9 - STONE,**
2111**10 - SHINY_PLASTIC,**
2112**11 - SATIN,**
2113**12 - METALIZED,**
2114**13 - NEON_GNC,**
2115**14 - CHROME,**
2116**15 - ALUMINIUM,**
2117**16 - OBSIDIAN,**
2118**17 - NEON_PHC,**
2119**18 - JADE,**
2120**19 - DEFAULT,**
2121**20 - UserDefined**
e5bd0d98 2122**Example:**
72b7576f 2123
2124vinit
2125meshfromstl mesh myfile.stl
2126meshmat mesh JADE
2127
e5bd0d98 2128@subsubsection occt_draw_4_33057 meshshrcoef
72b7576f 2129
dba69de2 2130Syntax: meshshrcoef meshname shrinkcoefficient
72b7576f 2131
2132Changes 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 2133**Example:**
72b7576f 2134
2135vinit
2136meshfromstl mesh myfile.stl
2137meshshrcoef mesh 0.05
2138
e5bd0d98 2139@subsubsection occt_draw_4_33058 meshshow
72b7576f 2140
dba69de2 2141Syntax: meshshow meshname
72b7576f 2142
2143Displays **meshname** in the viewer (if it is erased).
e5bd0d98 2144**Example:**
72b7576f 2145
2146vinit
2147meshfromstl mesh myfile.stl
2148meshshow mesh
2149
e5bd0d98 2150@subsubsection occt_draw_4_33059 meshhide
72b7576f 2151
dba69de2 2152Syntax: meshhide meshname
72b7576f 2153
2154Hides **meshname** in the viewer.
e5bd0d98 2155**Example:**
72b7576f 2156
2157vinit
2158meshfromstl mesh myfile.stl
2159meshhide mesh
2160
e5bd0d98 2161@subsubsection occt_draw_4_330510 meshhidesel
72b7576f 2162
dba69de2 2163Syntax: meshhidesel meshname
72b7576f 2164
2165Hides only selected entities. The other part of **meshname** remains visible.
2166
e5bd0d98 2167@subsubsection occt_draw_4_330511 meshshowsel
72b7576f 2168
dba69de2 2169Syntax: meshshowsel meshname
72b7576f 2170
2171Shows only selected entities. The other part of **meshname** becomes invisible.
2172
e5bd0d98 2173@subsubsection occt_draw_4_330512 meshshowall
72b7576f 2174
dba69de2 2175Syntax: meshshowall meshname
72b7576f 2176
2177Changes the state of all entities to visible for **meshname**.
2178
e5bd0d98 2179@subsubsection occt_draw_4_330513 meshdelete
72b7576f 2180
dba69de2 2181Syntax: meshdelete meshname
72b7576f 2182
2183Deletes MeshVS_Mesh object **meshname**.
e5bd0d98 2184**Example:**
72b7576f 2185
2186vinit
2187meshfromstl mesh myfile.stl
2188meshdelete mesh
2189
2190
2191
2192
e5bd0d98 2193@subsection occt_draw_4_3306 AIS viewer – 2D viewer – view commands
72b7576f 2194
e5bd0d98 2195@subsubsection occt_draw_4_33061 v2dinit
72b7576f 2196
dba69de2 2197Syntax: v2dinit
72b7576f 2198
2199**v2dinit **creates the 2D viewer window.
2200
e5bd0d98 2201@subsubsection occt_draw_4_33062 v2dsetbg
72b7576f 2202
dba69de2 2203Syntax: v2dsetbg imagefile [filletype]
72b7576f 2204
2205**v2dsetbg** loads **imagefile** as background. **filletype** is **NONE**, **CENTERED**, **TILED**, **STRETCH**.
e5bd0d98 2206**Example:**
72b7576f 2207
2208v2dinit
2209v2dsetbg myimage.brep CENTERED
2210
e5bd0d98 2211@subsubsection occt_draw_4_33063 v2dfit
72b7576f 2212
dba69de2 2213Syntax: v2dfit
72b7576f 2214
2215Fits all shapes to the size of the window.
2216
e5bd0d98 2217@subsubsection occt_draw_4_33064 v2drepaint
72b7576f 2218
dba69de2 2219Syntax: v2drepaint
72b7576f 2220
2221Forcedly repaints all shapes.
2222
e5bd0d98 2223@subsubsection occt_draw_4_33065 v2dclear
72b7576f 2224
dba69de2 2225Syntax: v2dclear
72b7576f 2226
2227Clears the 2D viewer window
2228
e5bd0d98 2229@subsubsection occt_draw_4_33066 v2dtext
72b7576f 2230
dba69de2 2231Syntax: v2dtext text x y [angle scale fontindex]
72b7576f 2232
2233Creates 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**.
2234Default values are: **angle=0.0, scale=1.0, fontindex=0**.
e5bd0d98 2235**Example:**
72b7576f 2236
2237v2dinit
2238v2dtext *My text* 10 10
e5bd0d98 2239@subsubsection occt_draw_4_33067 v2dsettextcolor
72b7576f 2240
dba69de2 2241Syntax: v2dsettextcolor text_name colorindex
72b7576f 2242
2243Changes the color of **text_name** object (**name** must be an integer value).
e5bd0d98 2244**Example:**
72b7576f 2245
2246v2dinit
2247v2dtext *My text* 10 10
2248# Change color to red
2249v2dsettextcolor text_0 3
e5bd0d98 2250@subsubsection occt_draw_4_33068 v2dpick
72b7576f 2251
dba69de2 2252Syntax: v2dpick
72b7576f 2253
2254Displays mouse coordinates and color after clicking the mouse button in the 2D viewer window.
2255
2256
e5bd0d98 2257@subsubsection occt_draw_4_33069 v2dgrid
72b7576f 2258
dba69de2 2259Syntax: v2dgrid [type x y xstep ystep angle [drawmode]]
2260 v2dgrid [type x y radiusstep division angle [drawmode]]
72b7576f 2261
2262Loads a grid in the 2D viewer window.
2263**type** is **Rect** or **Circ**.
2264**drawmode** is **Lines**, **Points** or **None**.
e5bd0d98 2265**Example:**
72b7576f 2266
2267v2dinit
2268v2dgrid Circ 0 0 250 12 0 Lines
2269v2drmgrid
2270v2dgrid Rect 0 0 200 200 0 Lines
e5bd0d98 2271@subsubsection occt_draw_4_330610 v2rmgrid
72b7576f 2272
dba69de2 2273Syntax: v2rmgrid
72b7576f 2274
2275Unloads a grid from the window.
2276
e5bd0d98 2277@subsubsection occt_draw_4_330611 v2dpickgrid
72b7576f 2278
dba69de2 2279Syntax: v2dpickgrid [mouse_x mouse_y [grid_x grid_y]]
72b7576f 2280
2281Gets coordinates of a grid point near the mouse button click in the 2D viewer window and sets it to **grid_x**, **grid_y** variables.
2282
e5bd0d98 2283@subsubsection occt_draw_4_330612 v2dpsout
72b7576f 2284
dba69de2 2285Syntax: v2dpsout imagefile [scale colorspace]
2286 [width height [xcenter ycenter]]
72b7576f 2287
2288Exports **imagefile**. You can set its the scale, width, height and colorspace.
2289**colorspace** can be **RGB, BlackAndWhite, GreyScale**.
2290
e5bd0d98 2291@subsubsection occt_draw_4_330612613 v2ddir
72b7576f 2292
dba69de2 2293Syntax: v2ddir
72b7576f 2294
2295Makes aLlist of the displayed objects.
2296
2297
e5bd0d98 2298@subsection occt_draw_4_3306127 Ais viewer – 2D viewer – display commands
72b7576f 2299
e5bd0d98 2300@subsubsection occt_draw_4_33061271 v2ddisplay
72b7576f 2301
dba69de2 2302Syntax: v2ddisplay name [projection]
72b7576f 2303
2304Projection: origin_x origin_y origin_z normal_x normal_y normal_z dx_x dx_y dx_z.
2305
2306Displays named objects.
e5bd0d98 2307**Example:**
72b7576f 2308
2309v2dinit
2310box b 10 10 10
2311psphere s 20
2312v2ddisplay s
2313v2ddisplay b
2314v2dfit
e5bd0d98 2315@subsubsection occt_draw_4_33061272 v2ddonly
72b7576f 2316
dba69de2 2317Syntax: v2ddonly [name1] … [name n]
72b7576f 2318
2319Displays only selected or named objects. If there are no selected or named objects, nothing is done.
e5bd0d98 2320**Example:**
72b7576f 2321
2322v2dinit
2323box b 10 10 10
2324psphere s 20
2325v2ddisplay b
2326v2ddisplay s
2327v2ddonly s
2328v2dfit
e5bd0d98 2329@subsubsection occt_draw_4_33061273 v2ddisplayall
72b7576f 2330
dba69de2 2331Syntax: v2ddisplayall
72b7576f 2332
2333Displays all created objects.
e5bd0d98 2334**Example:**
72b7576f 2335
2336v2dinit
2337box b 10 10 10
2338psphere s 20
2339v2ddisplay b
2340v2ddisplay s
2341v2ddonly
2342v2ddisplayall
2343v2dfit
e5bd0d98 2344@subsubsection occt_draw_4_33061274 v2derase
72b7576f 2345
dba69de2 2346Syntax: v2derase name1 [name2] … [name n]
72b7576f 2347
2348Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
e5bd0d98 2349**Example:**
72b7576f 2350
2351v2dinit
2352box b 10 10 10
2353psphere s 20
2354v2ddisplay b
2355v2ddisplay s
2356v2derase b
2357v2dfit
e5bd0d98 2358@subsubsection occt_draw_4_33061275 v2deraseall
72b7576f 2359
dba69de2 2360Syntax: v2deraseall
72b7576f 2361
2362Erases all objects displayed in the viewer.
e5bd0d98 2363**Example:**
72b7576f 2364
2365v2dinit
2366box b 10 10 10
2367psphere s 20
2368v2ddisplay b
2369v2ddisplay s
2370v2deraseall
2371v2dfit
e5bd0d98 2372@subsubsection occt_draw_4_33061276 v2dsetcolor
72b7576f 2373
dba69de2 2374Syntax: v2dsetcolor [shapename] colorname
72b7576f 2375
2376Sets color for all, selected or named shapes.
2377Values of **colorname** see **vsetcolor**.
e5bd0d98 2378**Example:**
72b7576f 2379
2380v2dinit
2381box b 10 10 10
2382v2ddisplay b
2383v2ddisplay s
2384v2dsetcolor b RED
2385v2dfit
e5bd0d98 2386@subsubsection occt_draw_4_33061277 v2dunsetcolor
72b7576f 2387
dba69de2 2388Syntax: v2dunsetcolor [shapename]
72b7576f 2389
2390Sets default color for all, selected or named shapes.
e5bd0d98 2391**Example:**
72b7576f 2392
2393v2dinit
2394box b 10 10 10
2395v2ddisplay b
2396v2ddisplay s
2397v2dsetcolor RED
2398v2dunsetcolor b
2399v2dfit
e5bd0d98 2400@subsubsection occt_draw_4_33061278 v2dsetbgcolor
72b7576f 2401
dba69de2 2402Syntax: v2dsetbgcolor colorname
72b7576f 2403
2404Sets background color.
2405See **vsetcolor** for the values of **colorname.**.
e5bd0d98 2406**Example:**
72b7576f 2407
2408v2dinit
2409box b 10 10 10
2410v2ddisplay b
2411v2ddisplay s
2412v2dsetbgcolor RED
2413v2dfit
e5bd0d98 2414@subsubsection occt_draw_4_33061279 v2dsetwidth
72b7576f 2415
dba69de2 2416Syntax: v2dsetwidth [shapename] widthenum
72b7576f 2417
2418Set width of the edges for all, selected or named shapes.
2419**widthenum** may be one of: **THIN, MEDIUM, THICK, VERYTHICK**.
e5bd0d98 2420**Example:**
72b7576f 2421
2422v2dinit
2423box b 10 10 10
2424v2ddisplay b
2425v2ddisplay s
2426v2dsetwidth b THICK
2427v2dfit
e5bd0d98 2428@subsubsection occt_draw_4_330612710 v2dunsetwidth
72b7576f 2429
dba69de2 2430Syntax: vunsetwidth [shapename]
72b7576f 2431
2432Sets default width of the edges for all, selected or named shapes.
e5bd0d98 2433**Example:**
72b7576f 2434
2435v2dinit
2436box b 10 10 10
2437v2ddisplay b
2438v2ddisplay s
2439v2dsetwidth THICK
2440v2dunsetwidth b
2441v2dfit
2442
2443@section occt_2142243456_930384826 OCAF commands
2444
2445
2446This chapter contains a set of commands for Open CASCADE Technology Application Framework (OCAF).
2447
2448
2449@subsection occt_2142243456_9303848261 Application commands
2450
2451
2452@subsubsection occt_2142243456_93038482611 NewDocument
2453
dba69de2 2454Syntax: NewDocument docname [format]
72b7576f 2455
2456Creates a new **docname** document with MDTV-Standard or described format.
e5bd0d98 2457**Example:**
72b7576f 2458
2459# Create new document with default (MDTV-Standard) format
2460NewDocument D
2461
2462# Create new document with BinOcaf format
2463NewDocument D2 BinOcaf
2464
2465@subsubsection occt_2142243456_93038482612 IsInSession
2466
dba69de2 2467Syntax: IsInSession path
72b7576f 2468
2469**I**Returns **0**, if **path** document is managed by the application session, **1** – otherwise.
e5bd0d98 2470**Example:**
72b7576f 2471
2472IsInSession /myPath/myFile.std
2473
2474@subsubsection occt_2142243456_93038482613 ListDocuments
2475
dba69de2 2476Syntax: ListDocuments
72b7576f 2477
2478Makes a list of documents handled during the session of the application.
2479
2480
2481@subsubsection occt_2142243456_93038482614 Open
2482
dba69de2 2483Syntax: Open path docname
72b7576f 2484
2485Retrieves the document of file **docname** in the path **path**. Overwrites the document, if it is already in session.
e5bd0d98 2486**Example:**
72b7576f 2487
2488Open /myPath/myFile.std D
2489
2490@subsubsection occt_2142243456_93038482615 Close
2491
dba69de2 2492Syntax: Close docname
72b7576f 2493
2494Closes **docname** document. The document is no longer handled by the applicative session.
e5bd0d98 2495**Example:**
72b7576f 2496
2497Close D
2498
2499@subsubsection occt_2142243456_93038482616 Save
2500
dba69de2 2501Syntax: Save docname
72b7576f 2502
2503Saves **docname** active document.
e5bd0d98 2504**Example:**
72b7576f 2505
2506Save D
2507
2508@subsubsection occt_2142243456_93038482617 SaveAs
2509
dba69de2 2510Syntax: SaveAs docname path
72b7576f 2511
2512Saves the active document in the file **docname** in the path **path**. Overwrites the file if it already exists.
e5bd0d98 2513**Example:**
72b7576f 2514
2515SaveAs D /myPath/myFile.std
2516
2517@subsection occt_2142243456_9303848262 Basic commands
2518
2519
2520@subsubsection occt_2142243456_930384826521 Label
2521
dba69de2 2522Syntax: Label docname entry
72b7576f 2523
2524Creates the label expressed by **entry** if it does not exist.
e5bd0d98 2525**Example:**
72b7576f 2526
2527Label D 0:2
2528
2529@subsubsection occt_2142243456_930384826522 NewChild
2530
dba69de2 2531Syntax: NewChild docname [taggerlabel = Root label]
72b7576f 2532
2533Finds (or creates) a TagSource attribute located at father label of **taggerlabel** and makes a new child label.
e5bd0d98 2534**Example:**
72b7576f 2535
2536# Create new child of root label
2537NewChild D
2538
2539# Create new child of existing label
2540Label D 0:2
2541NewChild D 0:2
2542
2543@subsubsection occt_2142243456_930384826523 Children
2544
dba69de2 2545Syntax: Children docname label
72b7576f 2546
2547Returns the list of attributes of **label**.
e5bd0d98 2548**Example:**
72b7576f 2549
2550Children D 0:2
2551
2552@subsubsection occt_2142243456_930384826524 ForgetAll
2553
dba69de2 2554Syntax: ForgetAll docname label
72b7576f 2555
2556Forgets all attributes of the label.
e5bd0d98 2557**Example:**
72b7576f 2558
2559ForgetAll D 0:2
2560
2561@subsection occt_2142243456_93038482653 Application commands
2562
2563
2564@subsubsection occt_2142243456_930384826531 Main
2565
dba69de2 2566Syntax: Main docname
72b7576f 2567
2568Returns the main label of the framework.
e5bd0d98 2569**Example:**
72b7576f 2570
2571Main D
2572
2573@subsubsection occt_2142243456_930384826532 UndoLimit
2574
dba69de2 2575Syntax: UndoLimit docname [value=0]
72b7576f 2576
2577
2578Sets 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 2579**Example:**
72b7576f 2580
2581UndoLimit D 100
2582
2583@subsubsection occt_2142243456_930384826533 Undo
2584
dba69de2 2585Syntax: Undo docname [value=1]
72b7576f 2586
2587Undoes **value** steps.
e5bd0d98 2588**Example:**
72b7576f 2589
2590Undo D
2591
2592@subsubsection occt_2142243456_930384826534 Redo
2593
dba69de2 2594Syntax: Redo docname [value=1]
72b7576f 2595
2596Redoes **value** steps.
e5bd0d98 2597**Example:**
72b7576f 2598
2599Redo D
2600
2601@subsubsection occt_2142243456_930384826535 OpenCommand
2602
dba69de2 2603Syntax: OpenCommand docname
72b7576f 2604
2605Opens a new command transaction.
e5bd0d98 2606**Example:**
72b7576f 2607
2608OpenCommand D
2609
2610@subsubsection occt_2142243456_930384826536 CommitCommand
2611
dba69de2 2612Syntax: CommitCommand docname
72b7576f 2613
2614Commits the Command transaction.
e5bd0d98 2615**Example:**
72b7576f 2616
2617CommitCommand D
2618
2619@subsubsection occt_2142243456_930384826537 NewCommand
2620
dba69de2 2621Syntax: NewCommand docname
72b7576f 2622
2623This is a short-cut for Commit and Open transaction.
e5bd0d98 2624**Example:**
72b7576f 2625
2626NewCommand D
2627
2628@subsubsection occt_2142243456_930384826538 AbortCommand
2629
dba69de2 2630Syntax: AbortCommand docname
72b7576f 2631
2632Aborts the Command transaction.
e5bd0d98 2633**Example:**
72b7576f 2634
2635AbortCommand D
2636
2637@subsubsection occt_2142243456_930384826539 Copy
2638
dba69de2 2639Syntax: Copy docname entry Xdocname Xentry
72b7576f 2640
2641Copies the contents of **entry** to **Xentry**. No links are registred.
e5bd0d98 2642**Example:**
72b7576f 2643
2644Copy D1 0:2 D2 0:4
2645
2646@subsubsection occt_2142243456_9303848265310 UpdateLink
2647
dba69de2 2648Syntax: UpdateLink docname [entry]
72b7576f 2649
2650Updates external reference set at **entry**.
e5bd0d98 2651**Example:**
72b7576f 2652
2653UpdateLink D
2654
2655@subsubsection occt_2142243456_9303848265311 CopyWithLink
2656
dba69de2 2657Syntax: CopyWithLink docname entry Xdocname Xentry
72b7576f 2658
2659Aborts the Command transaction.
2660Copies the content of **entry** to **Xentry**. The link is registred with an Xlink attribute at ** Xentry** label.
e5bd0d98 2661**Example:**
72b7576f 2662
2663CopyWithLink D1 0:2 D2 0:4
2664
2665@subsubsection occt_2142243456_9303848265312 UpdateXLinks
2666
dba69de2 2667Syntax: UpdateXLinks docname entry
72b7576f 2668
2669Sets modifications on labels impacted by external references to the **entry**. The **document** becomes invalid and must be recomputed
e5bd0d98 2670**Example:**
72b7576f 2671
2672UpdateXLinks D 0:2
2673
2674@subsubsection occt_2142243456_9303848265313 DumpDocument
2675
dba69de2 2676Syntax: DumpDocument docname
72b7576f 2677
2678Displays parameters of **docname** document.
e5bd0d98 2679**Example:**
72b7576f 2680
2681DumpDocument D
2682
2683@subsection occt_2142243456_93038482654 Data Framework commands
2684
2685
2686@subsubsection occt_2142243456_930384826541 MakeDF
2687
dba69de2 2688Syntax: MakeDF dfname
72b7576f 2689
2690Creates a new data framework.
e5bd0d98 2691**Example:**
72b7576f 2692
2693MakeDF D
2694
2695@subsubsection occt_2142243456_930384826542 ClearDF
2696
dba69de2 2697Syntax: ClearDF dfname
72b7576f 2698
2699Clears a data framework.
e5bd0d98 2700**Example:**
72b7576f 2701
2702ClearDF D
2703
2704@subsubsection occt_2142243456_930384826543 CopyDF
2705
dba69de2 2706Syntax: CopyDF dfname1 entry1 [dfname2] entry2
72b7576f 2707
2708Copies a data framework.
e5bd0d98 2709**Example:**
72b7576f 2710
2711CopyDF D 0:2 0:4
2712
2713@subsubsection occt_2142243456_930384826544 CopyLabel
2714
dba69de2 2715Syntax: CopyLabel dfname fromlabel tolablel
72b7576f 2716
2717Copies a label.
e5bd0d98 2718**Example:**
72b7576f 2719
2720CopyLabel D1 0:2 0:4
2721
2722@subsubsection occt_2142243456_930384826545 MiniDumpDF
2723
dba69de2 2724Syntax: MiniDumpDF dfname
72b7576f 2725
2726Makes a mini-dump of a data framework.
e5bd0d98 2727**Example:**
72b7576f 2728
2729MiniDumpDF D
2730
2731@subsubsection occt_2142243456_930384826546 XDumpDF
2732
dba69de2 2733Syntax: XDumpDF dfname
72b7576f 2734
2735Makes an extended dump of a data framework.
e5bd0d98 2736**Example:**
72b7576f 2737
2738XDumpDF D
2739
2740@subsection occt_2142243456_93038482655 General attributes commands
2741
2742
2743@subsubsection occt_2142243456_930384826551 SetInteger
2744
dba69de2 2745Syntax: SetInteger dfname entry value
72b7576f 2746
2747Finds or creates an Integer attribute at **entry** label and sets **value**.
e5bd0d98 2748**Example:**
72b7576f 2749
2750SetInteger D 0:2 100
2751
2752@subsubsection occt_2142243456_930384826552 GetInteger
2753
dba69de2 2754Syntax: GetInteger dfname entry [drawname]
72b7576f 2755
2756Gets a value of an Integer attribute at **entry** label and sets it to **drawname** variable, if it is defined.
e5bd0d98 2757**Example:**
72b7576f 2758
2759GetInteger D 0:2 Int1
2760
2761@subsubsection occt_2142243456_930384826553 SetReal
2762
dba69de2 2763Syntax: SetReal dfname entry value
72b7576f 2764
2765Finds or creates a Real attribute at **entry** label and sets **value**.
e5bd0d98 2766**Example:**
72b7576f 2767
2768SetReal D 0:2 100.
2769
2770@subsubsection occt_2142243456_930384826554 GetReal
2771
dba69de2 2772Syntax: GetReal dfname entry [drawname]
72b7576f 2773
2774Gets a value of a Real attribute at **entry** label and sets it to **drawname** variable, if it is defined.
e5bd0d98 2775**Example:**
72b7576f 2776
2777GetReal D 0:2 Real1
2778
2779@subsubsection occt_2142243456_930384826555 SetIntArray
2780
dba69de2 2781Syntax: SetIntArray dfname entry lower upper value1 value2 …
72b7576f 2782
2783Finds or creates an IntegerArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
e5bd0d98 2784**Example:**
72b7576f 2785
2786SetIntArray D 0:2 1 4 100 200 300 400
2787
2788@subsubsection occt_2142243456_930384826556 GetIntArray
2789
dba69de2 2790Syntax: GetIntArray dfname entry
72b7576f 2791
2792Gets a value of an IntegerArray attribute at **entry** label.
e5bd0d98 2793**Example:**
72b7576f 2794
2795GetIntArray D 0:2
2796
2797@subsubsection occt_2142243456_930384826557 SetRealArray
2798
dba69de2 2799Syntax: SetRealArray dfname entry lower upper value1 value2 …
72b7576f