0029311: Implementation of the Oriented Bounding Boxes (OBB) functionality
[occt.git] / dox / user_guides / draw_test_harness / draw_test_harness.md
CommitLineData
18006a0f 1Draw Test Harness {#occt_user_guides__test_harness}
72b7576f 2===============================
e5bd0d98 3
4@tableofcontents
72b7576f 5
e5bd0d98 6@section occt_draw_1 Introduction
72b7576f 7
18006a0f 8This manual explains how to use Draw, the test harness for Open CASCADE Technology (**OCCT**).
72b7576f 9Draw is a command interpreter based on TCL and a graphical system used to test and demonstrate Open CASCADE Technology modeling libraries.
10
e5bd0d98 11@subsection occt_draw_1_1 Overview
72b7576f 12
13Draw 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.
14
15Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes.
16
17Scripts may be written to customize Draw and perform tests. New types of objects and new commands may be added using the C++ programing language.
18
19Draw consists of:
20
21 * A command interpreter based on the TCL command language.
22 * A 3d graphic viewer based on the X system.
23 * A basic set of commands covering scripts, variables and graphics.
24 * 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.
25 * A set of topological commands allowing the user to create and modify BRep shapes and to use the OCCT topology algorithms.
26
27
28There is also a set of commands for each delivery unit in the modeling libraries:
29
e5bd0d98 30 * GEOMETRY,
31 * TOPOLOGY,
32 * ADVALGOS,
33 * GRAPHIC,
34 * PRESENTATION.
72b7576f 35
36
e5bd0d98 37@subsection occt_draw_1_2 Contents of this documentation
72b7576f 38
39This documentation describes:
40
41 * The command language.
42 * The basic set of commands.
43 * The graphical commands.
44 * The Geometry set of commands.
45 * The Topology set of commands.
472634fa 46 * OCAF commands.
47 * Data Exchange commands
48 * Shape Healing commands
72b7576f 49
50This 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 51
e5bd0d98 52~~~~~
53exit
54~~~~~
72b7576f 55
56Terminates the Draw, TCL session. If the commands are read from a file using the source command, this will terminate the file.
57
e5bd0d98 58**Example:**
72b7576f 59
e5bd0d98 60~~~~~
72b7576f 61# this is a very short example
62exit
e5bd0d98 63~~~~~
72b7576f 64
65
e5bd0d98 66@subsection occt_draw_1_3 Getting started
72b7576f 67
4ee1bdf4 68Install Draw and launch Emacs. Get a command line in Emacs using *Esc x* and key in *woksh*.
72b7576f 69
e5bd0d98 70All 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 71
e5bd0d98 72Declaration 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 73
e5bd0d98 74@subsubsection occt_draw_1_3_1 Launching DRAW Test Harness
72b7576f 75
3f812249 76Test 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 setup (usually this is done automatically after the installation process on Windows or after launching specific scripts on Linux).
72b7576f 77
72b7576f 78
e5bd0d98 79@subsubsection occt_draw_1_3_2 Plug-in resource file
72b7576f 80
e5bd0d98 81Open CASCADE Technology is shipped with the DrawPlugin resource file located in the <i>$CASROOT/src/DrawResources</i> directory.
72b7576f 82
04c2daa4 83The format of the file is compliant with standard Open CASCADE Technology resource files (see the *Resource_Manager.hxx* file for details).
72b7576f 84
85Each 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 86
87**Example:** (excerpt from DrawPlugin):
72b7576f 88~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
dba69de2 89OCAF : VISUALIZATION, OCAFKERNEL
90VISUALIZATION : AISV
91OCAFKERNEL : DCAF
72b7576f 92
dba69de2 93DCAF : TKDCAF
94AISV : TKViewerTest
72b7576f 95~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96
e5bd0d98 97@subsubsection occt_draw_1_3_3 Activation of commands implemented in the plug-in
72b7576f 98
99To load a plug-in declared in the resource file and to activate the commands the following command must be used in Test Harness:
100
e5bd0d98 101~~~~~
102pload [-PluginFileName] [[Key1] [Key2]...]
103~~~~~
104
bf62b306 105where:
72b7576f 106
3f812249 107* <i>-PluginFileName</i> -- defines the name of a plug-in resource file (prefix "-" is mandatory) described above. If this parameter is omitted then the default name *DrawPlugin* is used.
108* *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 109
e5bd0d98 110According 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 111
e5bd0d98 112~~~~~
dba69de2 113Draw[] pload -DrawPlugin OCAF
e5bd0d98 114~~~~~
115This 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 116
e5bd0d98 117~~~~~
dba69de2 118Draw[] pload (equivalent to pload -DrawPlugin DEFAULT).
e5bd0d98 119~~~~~
120This 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 121
122
e5bd0d98 123@section occt_draw_2 The Command Language
72b7576f 124
e5bd0d98 125@subsection occt_draw_2_1 Overview
72b7576f 126
e5bd0d98 127The 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 128
129This 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:
130
131 * Syntax of the TCL language.
132 * Accessing variables in TCL and Draw.
133 * Control structures.
134 * Procedures.
135
e5bd0d98 136@subsection occt_draw_2_2 Syntax of TCL
72b7576f 137
138TCL 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.
139
140The basic program for TCL is a script. A script consists of one or more commands. Commands are separated by new lines or semicolons.
e5bd0d98 141
72b7576f 142~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
143set a 24
144set b 15
145set a 25; set b 15
146~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 147
72b7576f 148Each command consists of one or more *words*; the first word is the name of a command and additional words are arguments to that command.
149
150Words 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.
151
152The 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.
153
154The following substitutions are performed by TCL:
155
e5bd0d98 156Variable 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.
157
158**Example:**
72b7576f 159~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
160# set a variable value
161set file documentation
162puts $file #to display file contents on the screen
163
164# a simple substitution, set psfile to documentation.ps
165set psfile $file.ps
166puts $psfile
167
168# another substitution, set pfile to documentationPS
169set pfile ${file}PS
170
171# a last one,
172# delete files NEWdocumentation and OLDdocumentation
173foreach prefix {NEW OLD} {rm $prefix$file}
174~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 175
176Command substitution is triggered by the [ ] characters. The brackets must enclose a valid script. The script is evaluated and the result is substituted.
177
72b7576f 178Compare command construction in csh.
179
e5bd0d98 180**Example:**
72b7576f 181~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
182set degree 30
183set pi 3.14159265
184# expr is a command evaluating a numeric expression
185set radian [expr $pi*$degree/180]
186~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 187
188Backslash 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.
189
72b7576f 190TCL uses two forms of *quoting* to prevent substitution and word breaking.
191
e5bd0d98 192Double 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 193
e5bd0d98 194**Example:**
72b7576f 195~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
196# set msg to ;the price is 12.00;
197set price 12.00
198set msg ;the price is $price;
199~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 200
201Braces *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.
202
203**Example:**
72b7576f 204~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
205set x 0
206# this will loop for ever
d5cdd12a 207# because while argument is ;0 < 3;
208while ;$x < 3; {set x [expr $x+1]}
72b7576f 209# this will terminate as expected because
d5cdd12a 210# while argument is {$x < 3}
211while {$x < 3} {set x [expr $x+1]}
72b7576f 212# this can be written also
d5cdd12a 213while {$x < 3} {
72b7576f 214set x [expr $x+1]
215}
216# the following cannot be written
217# because while requires two arguments
d5cdd12a 218while {$x < 3}
72b7576f 219{
220set x [expr $x+1]
221}
222~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 223
224Comments 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.
225
226**Example:**
72b7576f 227~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
228# This is a comment
229set a 1 # this is not a comment
230set b 1; # this is a comment
231~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 232
e5bd0d98 233The 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 234
e5bd0d98 235
236**Example:**
72b7576f 237~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238# I want to delete two files
239
240set files ;foo bar;
241
242# this will fail because rm will receive only one argument
243# and complain that ;foo bar; does not exit
244
245exec rm $files
246
247# a second evaluation will do it
248~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
249
e5bd0d98 250@subsection occt_draw_2_3 Accessing variables in TCL and Draw
72b7576f 251
e5bd0d98 252TCL 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 253
254TCL provides a mechanism to link user data to variables. Using this functionality, Draw defines its variables as TCL variables with associated data.
255
bf62b306 256The 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 <i>$</i> does not change the result of a command. The content of a Draw variable is accessed using appropriate commands.
72b7576f 257
258There are many kinds of Draw variables, and new ones may be added with C++. Geometric and topological variables are described below.
259
bf62b306 260Draw 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 261
e5bd0d98 262**Example:**
72b7576f 263~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
264# dset is used for numeric variables
265# pi is a predefined Draw variable
266dset angle pi/3 radius 10
267point p radius*cos(angle) radius*sin(angle) 0
268~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bf62b306 269It 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.
e5bd0d98 270
271@subsubsection occt_draw_2_3_1 set, unset
72b7576f 272
e5bd0d98 273Syntax:
72b7576f 274
e5bd0d98 275~~~~~
276set varname [value]
72b7576f 277unset varname [varname varname ...]
e5bd0d98 278~~~~~
279
bf62b306 280*set* assigns a string value to a variable. If the variable does not already exist, it is created.
72b7576f 281
bf62b306 282Without a value, *set* returns the content of the variable.
72b7576f 283
bf62b306 284*unset* deletes variables. It is is also used to delete Draw variables.
72b7576f 285
e5bd0d98 286**Example:**
72b7576f 287~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
e5bd0d98 288set a "Hello world"
289set b "Goodbye"
72b7576f 290set a
e5bd0d98 291== "Hello world"
72b7576f 292unset a b
293set a
294~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295
e5bd0d98 296**Note**, that the *set* command can set only one variable, unlike the *dset* command.
72b7576f 297
72b7576f 298
e5bd0d98 299@subsubsection occt_draw_2_3_2 dset, dval
72b7576f 300
e5bd0d98 301Syntax
72b7576f 302
e5bd0d98 303~~~~~
304dset var1 value1 vr2 value2 ...
72b7576f 305dval name
e5bd0d98 306~~~~~
72b7576f 307
e5bd0d98 308*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 309
e5bd0d98 310*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.
311
312
313**Example:**
72b7576f 314~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
315# z is set to 0
316dset x 10 y 15 z
317== 0
318
319# no $ required for Draw commands
320point p x y z
321
4ee1bdf4 322# "puts" prints a string
72b7576f 323puts ;x = [dval x], cos(x/pi) = [dval cos(x/pi)];
324== x = 10, cos(x/pi) = -0.99913874099467914
325~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 326
4ee1bdf4 327**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 328
472634fa 329@subsubsection occt_draw_2_3_3 del, dall
330
331Syntax:
332~~~~~
333del varname_pattern [varname_pattern ...]
334dall
335~~~~~
336
337*del* command does the same thing as *unset*, but it deletes the variables matched by the pattern.
338
339*dall* command deletes all variables in the session.
72b7576f 340
e5bd0d98 341@subsection occt_draw_2_4 lists
72b7576f 342
343TCL 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.
344
345This allows you to insert lists within lists.
e5bd0d98 346
347**Example:**
72b7576f 348~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
349# a list of 3 strings
350;a b c;
351
352# a list of two strings the first is a list of 2
353;{a b} c;
354~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 355
e5bd0d98 356Many TCL commands return lists and **foreach** is a useful way to create loops on list elements.
357
358@subsubsection occt_draw_2_5 Control Structures
72b7576f 359
360TCL 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:
361
e5bd0d98 362* You use braces instead of parentheses to enclose conditions.
363* You do not start the script on the next line of your command.
364
365
366@subsubsection occt_draw_2_5_1 if
367
368Syntax
369
370~~~~~
371if condition script [elseif script .... else script]
372~~~~~
72b7576f 373
e5bd0d98 374**If** evaluates the condition and the script to see whether the condition is true.
72b7576f 375
72b7576f 376
72b7576f 377
e5bd0d98 378**Example:**
72b7576f 379~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
d5cdd12a 380if {$x > 0} {
72b7576f 381puts ;positive;
382} elseif {$x == 0} {
383puts ;null;
384} else {
385puts ;negative;
386}
387~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
388
e5bd0d98 389@subsubsection occt_draw_2_5_2 while, for, foreach
72b7576f 390
e5bd0d98 391Syntax:
392
393
cdec5927 394~~~~~
e5bd0d98 395while condition script
72b7576f 396for init condition reinit script
397foreach varname list script
e5bd0d98 398~~~~~
399
400The 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 401
e5bd0d98 402**Example:**
72b7576f 403~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
404# while example
405dset x 1.1
d5cdd12a 406while {[dval x] < 100} {
72b7576f 407 circle c 0 0 x
408 dset x x*x
409}
410# for example
411# incr var d, increments a variable of d (default 1)
d5cdd12a 412for {set i 0} {$i < 10} {incr i} {
72b7576f 413 dset angle $i*pi/10
414 point p$i cos(angle0 sin(angle) 0
415}
416# foreach example
417foreach object {crapo tomson lucas} {display $object}
418~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 419
e5bd0d98 420@subsubsection occt_draw_2_5_3 break, continue
72b7576f 421
e5bd0d98 422Syntax:
72b7576f 423
e5bd0d98 424~~~~~
425break
72b7576f 426continue
e5bd0d98 427~~~~~
72b7576f 428
e5bd0d98 429Within loops, the **break** and **continue** commands have the same effect as in C.
72b7576f 430
e5bd0d98 431**break** interrupts the innermost loop and **continue** jumps to the next iteration.
432
433**Example:**
72b7576f 434~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
435# search the index for which t$i has value ;secret;
d5cdd12a 436for {set i 1} {$i <= 100} {incr i} {
72b7576f 437 if {[set t$i] == ;secret;} break;
438}
439~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 440
e5bd0d98 441@subsection occt_draw_2_6 Procedures
442
443TCL 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 444
445The 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.
446
e5bd0d98 447There 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.
448
449As 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 450
72b7576f 451
e5bd0d98 452@subsubsection occt_draw_2_6_1 proc
72b7576f 453
e5bd0d98 454Syntax:
72b7576f 455
e5bd0d98 456~~~~~
457proc argumentlist script
458~~~~~
72b7576f 459
e5bd0d98 460**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 461
e5bd0d98 462**return** gives a return value to the procedure.
463
464**Example:**
72b7576f 465~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
466# simple procedure
467proc hello {} {
468 puts ;hello world;
469}
470# procedure with arguments and default values
471proc distance {x1 y1 {x2 0} {y2 0}} {
472 set d [expr (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)]
473 return [expr sqrt(d)]
474}
475proc fact n {
476 if {$n == 0} {return 1} else {
477 return [expr n*[fact [expr n -1]]]
478 }
479}
480~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 481
482
e5bd0d98 483@subsubsection occt_draw_2_6_2 global, upvar
484
485Syntax:
72b7576f 486
e5bd0d98 487~~~~~
488global varname [varname ...]
72b7576f 489upvar varname localname [varname localname ...]
e5bd0d98 490~~~~~
72b7576f 491
72b7576f 492
e5bd0d98 493**global** accesses high level variables. Unlike C, global variables are not visible in procedures.
72b7576f 494
e5bd0d98 495**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.
496
497**Note** that in the following examples the \$ character is always necessarily used to access the arguments.
498
499**Example:**
72b7576f 500~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
501# convert degree to radian
502# pi is a global variable
503proc deg2rad (degree} {
504 return [dval pi*$degree/2.]
505}
506# create line with a point and an angle
507proc linang {linename x y angle} {
508 upvar linename l
509 line l $x $y cos($angle) sin($angle)
510}
511~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
512
e5bd0d98 513@section occt_draw_3 Basic Commands
72b7576f 514
515This 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:
516
517 * General commands, which are used for Draw and TCL management.
518 * Variable commands, which are used to manage Draw variables such as storing and dumping.
519 * Graphic commands, which are used to manage the graphic system, and so pertain to views.
520 * Variable display commands, which are used to manage the display of objects within given views.
521
e5bd0d98 522Note that Draw also features a GUI task bar providing an alternative way to give certain general, graphic and display commands
72b7576f 523
524
e5bd0d98 525@subsection occt_draw_3_1 General commands
72b7576f 526
e5bd0d98 527This section describes several useful commands:
72b7576f 528
e5bd0d98 529 * **help** to get information,
530 * **source** to eval a script from a file,
531 * **spy** to capture the commands in a file,
532 * **cpulimit** to limit the process cpu time,
533 * **wait** to waste some time,
534 * **chrono** to time commands.
72b7576f 535
e5bd0d98 536@subsubsection occt_draw_3_1_1 help
72b7576f 537
e5bd0d98 538Syntax:
72b7576f 539
e5bd0d98 540~~~~~
541help [command [helpstring group]]
542~~~~~
72b7576f 543
544Provides help or modifies the help information.
545
e5bd0d98 546**help** without arguments lists all groups and the commands in each group.
72b7576f 547
e5bd0d98 548Specifying 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.
549
550**Example:**
72b7576f 551~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
552# Gives help on all commands starting with *a*
553~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 554
72b7576f 555
e5bd0d98 556@subsubsection occt_draw_3_1_2 source
557
558Syntax:
559
560~~~~~
561source filename
562~~~~~
72b7576f 563Executes a file.
564
e5bd0d98 565The **exit** command will terminate the file.
72b7576f 566
e5bd0d98 567@subsubsection occt_draw_3_1_3 spy
72b7576f 568
e5bd0d98 569Syntax:
72b7576f 570
e5bd0d98 571~~~~~
572spy [filename]
573~~~~~
72b7576f 574
e5bd0d98 575Saves 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 576
72b7576f 577If a command returns an error it is saved with a comment mark.
578
e5bd0d98 579The file created by **spy** can be executed with the **source** command.
580
581**Example:**
72b7576f 582~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
583# all commands will be saved in the file ;session;
584spy session
585# the file ;session; is closed and commands are not saved
586spy
587~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 588
589
72b7576f 590
e5bd0d98 591@subsubsection occt_draw_3_1_4 cpulimit
592
593Syntax:
72b7576f 594
e5bd0d98 595~~~~~
596cpulimit [nbseconds]
597~~~~~
598
599**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.
600
601**Example:**
72b7576f 602~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
603#limit cpu to one hour
604cpulimit 3600
605~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
606
e5bd0d98 607@subsubsection occt_draw_3_1_5 wait
72b7576f 608
e5bd0d98 609Syntax:
610~~~~~
611wait [nbseconds]
612~~~~~
72b7576f 613Suspends 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.
614
e5bd0d98 615~~~~~
72b7576f 616# You have ten seconds ...
617wait
e5bd0d98 618~~~~~
72b7576f 619
e5bd0d98 620@subsubsection occt_draw_3_1_6 chrono
72b7576f 621
e5bd0d98 622Syntax:
72b7576f 623
e5bd0d98 624~~~~~
44fae8b1 625chrono [ name start/stop/reset/show/restart/[counter text]]
e5bd0d98 626~~~~~
72b7576f 627
e5bd0d98 628Without arguments, **chrono** activates Draw chronometers. The elapsed time ,cpu system and cpu user times for each command will be printed.
72b7576f 629
e5bd0d98 630With arguments, **chrono** is used to manage activated chronometers. You can perform the following actions with a chronometer.
72b7576f 631 * run the chronometer (start).
632 * stop the chronometer (stop).
633 * reset the chronometer to 0 (reset).
44fae8b1 634 * restart the chronometer (restart).
72b7576f 635 * display the current time (show).
44fae8b1 636 * display the current time with specified text (output example - *COUNTER text: N*), command <i>testdiff</i> will compare such outputs between two test runs (counter).
72b7576f 637
e5bd0d98 638**Example:**
72b7576f 639~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
640chrono
641==Chronometers activated.
642ptorus t 20 5
643==Elapsed time: 0 Hours 0 Minutes 0.0318 Seconds
644==CPU user time: 0.01 seconds
645==CPU system time: 0 seconds
646~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
647
e5bd0d98 648@subsection occt_draw_3_2 Variable management commands
72b7576f 649
e5bd0d98 650@subsubsection occt_draw_3_2_1 isdraw, directory
72b7576f 651
e5bd0d98 652Syntax:
653~~~~~
654isdraw varname
72b7576f 655directory [pattern]
e5bd0d98 656~~~~~
657
658**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 659
e5bd0d98 660Use **directory** to return a list of all Draw global variables matching a pattern.
72b7576f 661
e5bd0d98 662**Example:**
72b7576f 663~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
664set a 1
665isdraw a
666=== 0
667
668dset a 1
669isdraw a
670=== 1
671
672circle c 0 0 1 0 5
673isdraw c
674=== 1
675
676# to destroy all Draw objects with name containing curve
677foreach var [directory *curve*] {unset $var}
678~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 679
680
e5bd0d98 681@subsubsection occt_draw_3_2_2 whatis, dump
72b7576f 682
e5bd0d98 683Syntax:
684
685~~~~~
686whatis varname [varname ...]
72b7576f 687dump varname [varname ...]
e5bd0d98 688~~~~~
72b7576f 689
e5bd0d98 690**whatis** returns short information about a Draw variable. This is usually the type name.
72b7576f 691
e5bd0d98 692**dump** returns a brief type description, the coordinates, and if need be, the parameters of a Draw variable.
72b7576f 693
e5bd0d98 694**Example:**
72b7576f 695~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
696circle c 0 0 1 0 5
697whatis c
698c is a 2d curve
699
700dump c
701
702***** Dump of c *****
703Circle
704Center :0, 0
705XAxis :1, 0
706YAxis :-0, 1
707Radius :5
708~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 709
710**Note** The behavior of *whatis* on other variables (not Draw) is not excellent.
72b7576f 711
712
472634fa 713@subsubsection occt_draw_3_2_3 renamevar, copy
72b7576f 714
e5bd0d98 715Syntax:
716~~~~~
472634fa 717renamevar varname tovarname [varname tovarname ...]
72b7576f 718copy varname tovarname [varname tovarname ...]
e5bd0d98 719~~~~~
72b7576f 720
472634fa 721 * **renamevar** 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.
e5bd0d98 722 * **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 723
e5bd0d98 724**Example:**
72b7576f 725~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
726circle c1 0 0 1 0 5
472634fa 727renamevar c1 c2
72b7576f 728
729# curves are copied, c2 will not be modified
730copy c2 c3
731~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
732
e5bd0d98 733@subsubsection occt_draw_3_2_4 datadir, save, restore
72b7576f 734
e5bd0d98 735Syntax:
736~~~~~
737datadir [directory]
72b7576f 738save variable [filename]
739restore filename [variablename]
e5bd0d98 740~~~~~
72b7576f 741
e5bd0d98 742 * **datadir** without arguments prints the path of the current data directory.
743 * **datadir** with an argument sets the data directory path. \
72b7576f 744
e5bd0d98 745If the path starts with a dot (.) only the last directory name will be changed in the path.
72b7576f 746
e5bd0d98 747 * **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.
748 * **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 749
750The exact content of the file is type-dependent. They are usually ASCII files and so, architecture independent.
e5bd0d98 751
752**Example:**
72b7576f 753~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
754# note how TCL accesses shell environment variables
755# using $env()
756datadir
757==.
758
759datadir $env(WBCONTAINER)/data/default
760==/adv_20/BAG/data/default
761
762box b 10 20 30
763save b theBox
764==/adv_20/BAG/data/default/theBox
765
766# when TCL does not find a command it tries a shell command
767ls [datadir]
768== theBox
769
770restore theBox
771== theBox
772~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 773
e5bd0d98 774@subsection occt_draw_3_3 User defined commands
72b7576f 775
bf62b306 776*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 777
bf62b306 778*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 779
e5bd0d98 780@subsubsection occt_draw_3_3_1 set
781
782#### In *DrawTrSurf* package:
72b7576f 783
e5bd0d98 784~~~~~
bf62b306 785void Set(Standard_CString& Name,const gp_Pnt& G) ;
786void Set(Standard_CString& Name,const gp_Pnt2d& G) ;
787void Set(Standard_CString& Name,
788const Handle(Geom_Geometry)& G) ;
789void Set(Standard_CString& Name,
790const Handle(Geom2d_Curve)& C) ;
791void Set(Standard_CString& Name,
792const Handle(Poly_Triangulation)& T) ;
793void Set(Standard_CString& Name,
794const Handle(Poly_Polygon3D)& P) ;
795void Set(Standard_CString& Name,
796const Handle(Poly_Polygon2D)& P) ;
e5bd0d98 797~~~~~
72b7576f 798
e5bd0d98 799#### In *DBRep* package:
72b7576f 800
e5bd0d98 801~~~~~
72b7576f 802void Set(const Standard_CString Name,
bf62b306 803const TopoDS_Shape& S) ;
e5bd0d98 804~~~~~
72b7576f 805
e5bd0d98 806Example of *DrawTrSurf*
72b7576f 807
e5bd0d98 808~~~~~
72b7576f 809Handle(Geom2d_Circle) C1 = new Geom2d_Circle
810(gce_MakeCirc2d (gp_Pnt2d(50,0,) 25));
811DrawTrSurf::Set(char*, C1);
e5bd0d98 812~~~~~
72b7576f 813
e5bd0d98 814Example of *DBRep*
72b7576f 815
e5bd0d98 816~~~~~
72b7576f 817TopoDS_Solid B;
818B = BRepPrimAPI_MakeBox (10,10,10);
819DBRep::Set(char*,B);
e5bd0d98 820~~~~~
72b7576f 821
e5bd0d98 822@subsubsection occt_draw_3_3_2 get
72b7576f 823
e5bd0d98 824#### In *DrawTrSurf* package:
825
826~~~~~
bf62b306 827Handle_Geom_Geometry Get(Standard_CString& Name) ;
e5bd0d98 828~~~~~
72b7576f 829
e5bd0d98 830#### In *DBRep* package:
72b7576f 831
e5bd0d98 832~~~~~
bf62b306 833TopoDS_Shape Get(Standard_CString& Name,
72b7576f 834const TopAbs_ShapeEnum Typ = TopAbs_SHAPE,
835const Standard_Boolean Complain
836= Standard_True) ;
e5bd0d98 837~~~~~
72b7576f 838
e5bd0d98 839Example of *DrawTrSurf*
840
841~~~~~
72b7576f 842Standard_Integer MyCommand
bf62b306 843(Draw_Interpretor& theCommands,
72b7576f 844Standard_Integer argc, char** argv)
845{......
846// Creation of a Geom_Geometry from a Draw geometric
847// name
848Handle (Geom_Geometry) aGeom= DrawTrSurf::Get(argv[1]);
849}
e5bd0d98 850~~~~~
72b7576f 851
e5bd0d98 852Example of *DBRep*
72b7576f 853
e5bd0d98 854~~~~~
72b7576f 855Standard_Integer MyCommand
bf62b306 856(Draw_Interpretor& theCommands,
72b7576f 857Standard_Integer argc, char** argv)
858{......
859// Creation of a TopoDS_Shape from a Draw topological
860// name
861TopoDS_Solid B = DBRep::Get(argv[1]);
862}
e5bd0d98 863~~~~~
72b7576f 864
e5bd0d98 865@section occt_draw_4 Graphic Commands
72b7576f 866
3f812249 867Graphic 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.
72b7576f 868
e5bd0d98 869@subsection occt_draw_4_1 Axonometric viewer
72b7576f 870
e5bd0d98 871@subsubsection occt_draw_4_1_1 view, delete
72b7576f 872
e5bd0d98 873Syntax:
874~~~~~
875view index type [X Y W H]
72b7576f 876delete [index]
e5bd0d98 877~~~~~
72b7576f 878
e5bd0d98 879**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 880
e5bd0d98 881As 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 882
e5bd0d98 883**delete** deletes a view. If no index is given, all the views are deleted.
72b7576f 884
885Type selects from the following range:
886
e5bd0d98 887 * *AXON* : Axonometric view
888 * *PERS* : Perspective view
bf62b306 889 * <i>+X+Y</i> : View on both axes (i.e. a top view), other codes are <i>-X+Y</i>, <i>+Y-Z</i>, etc.
890 * <i>-2D-</i> : 2d view
72b7576f 891
892The index, the type, the current zoom are displayed in the window title .
e5bd0d98 893
894**Example:**
72b7576f 895~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
896# this is the content of the mu4 procedure
897proc mu4 {} {
898delete
899view 1 +X+Z 320 20 400 400
900view 2 +X+Y 320 450 400 400
901view 3 +Y+Z 728 20 400 400
902view 4 AXON 728 450 400 400
903}
904~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 905
72b7576f 906See also: **axo, pers, top, bottom, left, right, front, back, mu4, v2d, av2d, smallview**
907
e5bd0d98 908@subsubsection occt_draw_4_1_2 axo, pers, top, ...
909
910Syntax:
72b7576f 911
e5bd0d98 912~~~~~
913axo
72b7576f 914pers
915...
916smallview type
e5bd0d98 917~~~~~
72b7576f 918
919All 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.
920
e5bd0d98 921 * **axo** creates a large window axonometric view;
922 * **pers** creates a large window perspective view;
923 * **top**, **bottom**, **left**, **right**, **front**, **back** create a large window axis view;
924 * **mu4** creates four small window views: front, left, top and axo.
925 * **v2d** creates a large window 2d view.
926 * **av2d** creates two small window views, one 2d and one axo
927 * **smallview** creates a view at the bottom right of the screen of the given type.
72b7576f 928
929See also: **view**, **delete**
930
e5bd0d98 931@subsubsection occt_draw_4_1_3 mu, md, 2dmu, 2dmd, zoom, 2dzoom
72b7576f 932
e5bd0d98 933Syntax:
72b7576f 934
e5bd0d98 935~~~~~
936 mu [index] value
937 2dmu [index] value
938 zoom [index] value
939 wzoom
940~~~~~
72b7576f 941
e5bd0d98 942* **mu** (magnify up) increases the zoom in one or several views by a factor of 10%.
943* **md** (magnify down) decreases the zoom by the inverse factor. **2dmu** and **2dmd**
72b7576f 944perform the same on one or all 2d views.
e5bd0d98 945* **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.
946* **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 947
e5bd0d98 948**Example:**
72b7576f 949~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
e5bd0d98 950 # set a zoom of 2.5
951 zoom 2.5
72b7576f 952
e5bd0d98 953 # magnify by 10%
954 mu 1
72b7576f 955
e5bd0d98 956 # magnify by 20%
72b7576f 957~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
958See also: **fit**, **2dfit**
959
960
e5bd0d98 961@subsubsection occt_draw_4_14 pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr
72b7576f 962
bf62b306 963Syntax:
964
965~~~~~
966pu [index]
72b7576f 967pd [index]
bf62b306 968~~~~~
72b7576f 969
bf62b306 970The <i>p_</i> commands are used to pan. **pu** and **pd** pan up and down respectively; **pl** and **pr** pan to the left and to the right respectively. Each time the view is displaced by 40 pixels. When no index is given, all views will pan in the direction specified.
971~~~~~
972# you have selected one anonometric view
973pu
974# or
975pu 1
72b7576f 976
bf62b306 977# you have selected an mu4 view; the object in the third view will pan up
978pu 3
979~~~~~
72b7576f 980See also: **fit**, **2dfit**
981
982
e5bd0d98 983@subsubsection occt_draw_4_1_5 fit, 2dfit
984
985Syntax:
72b7576f 986
e5bd0d98 987~~~~~
988fit [index]
72b7576f 9892dfit [index]
e5bd0d98 990~~~~~
72b7576f 991
e5bd0d98 992**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 993
994When fitting all views a unique zoom is computed for all the views. All views are on the same scale.
995
e5bd0d98 996**Example:**
72b7576f 997~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
998# fit only view 1
999fit 1
1000# fit all 2d views
10012dfit
1002~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1003See also: **zoom**, **mu**, **pu**
1004
1005
e5bd0d98 1006@subsubsection occt_draw_4_1_6 u, d, l, r
72b7576f 1007
e5bd0d98 1008Syntax:
1009
1010~~~~~
1011u [index]
72b7576f 1012d [index]
1013l [index]
1014r [index]
e5bd0d98 1015~~~~~
72b7576f 1016
e5bd0d98 1017**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 1018
e5bd0d98 1019**Example:**
72b7576f 1020~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1021# rotate the view up
1022u
1023~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1024
e5bd0d98 1025@subsubsection occt_draw_4_1_7 focal, fu, fd
72b7576f 1026
e5bd0d98 1027Syntax:
1028~~~~~
1029focal [f]
72b7576f 1030fu [index]
1031fd [index]
e5bd0d98 1032~~~~~
1033
1034* **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.
1035* **fu** and **fd** increase or decrease the focal value by 10%. **fd** makes the eye closer to the object.
72b7576f 1036
e5bd0d98 1037**Example:**
72b7576f 1038~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1039pers
1040repeat 10 fd
1041~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 1042
1043**Note**: Do not use a negative or null focal value.
72b7576f 1044
1045See also: **pers**
1046
e5bd0d98 1047@subsubsection occt_draw_4_1_8 color
1048
1049Syntax:
72b7576f 1050
e5bd0d98 1051~~~~~
1052color index name
1053~~~~~
72b7576f 1054
e5bd0d98 1055**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 1056
e5bd0d98 1057The 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 1058
e5bd0d98 1059**Example:**
72b7576f 1060~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1061# change the value of blue
e5bd0d98 1062color 3 "navy blue"
72b7576f 1063~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1064
1065
e5bd0d98 1066**Note** that the color change will be visible on the next redraw of the views, for example, after *fit* or *mu*, etc.
1067
1068@subsubsection occt_draw_4_1_9 dtext
72b7576f 1069
e5bd0d98 1070Syntax:
1071~~~~~
1072dtext [x y [z]] string
1073~~~~~
72b7576f 1074
e5bd0d98 1075**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 1076
1077The coordinates are real space coordinates.
1078
e5bd0d98 1079**Example:**
72b7576f 1080~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1081# mark the origins
1082dtext 0 0 bebop
1083dtext 0 0 0 bebop
1084~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1085
e5bd0d98 1086@subsubsection occt_draw_4_1_10 hardcopy, hcolor, xwd
72b7576f 1087
e5bd0d98 1088Syntax:
1089~~~~~
1090hardcopy [index]
72b7576f 1091hcolor index width gray
1092xwd [index] filename
e5bd0d98 1093~~~~~
72b7576f 1094
e5bd0d98 1095* **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.
1096* **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.
1097* **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 1098
e5bd0d98 1099**Example:**
72b7576f 1100~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1101# all blue lines (color 3)
1102# will be half-width and gray
1103hcolor 3 0.5
1104
1105# make a postscript file and print it
1106hardcopy
1107lpr a4.ps
1108
1109# make an xwd file and display it
1110xwd theview
1111xwud -in theview
1112~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e5bd0d98 1113
1114**Note:** When more than one view is present, specify the index of the view.
1115
1116Only use a postscript printer to print postscript files.
72b7576f 1117
1118See also: **color**
1119
1120
e5bd0d98 1121@subsubsection occt_draw_4_1_11 wclick, pick
72b7576f 1122
e5bd0d98 1123Syntax:
1124~~~~~
1125wclick
72b7576f 1126pick index X Y Z b [nowait]
e5bd0d98 1127~~~~~
72b7576f 1128
e5bd0d98 1129**wclick** defers an event until the mouse button is clicked. The message <code>just click</code> is displayed.
72b7576f 1130
e5bd0d98 1131Use the **pick** command to get graphic input. The arguments must be names for variables where the results are stored.
72b7576f 1132 * index: index of the view where the input was made.
1133 * X,Y,Z: 3d coordinates in real world.
1134 * b: b is the mouse button 1,2 or 3.
1135
1136When 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.
1137
1138This option is useful for tracking the pointer.
1139
e5bd0d98 1140**Note** that the results are stored in Draw numeric variables.
1141
1142**Example:**
72b7576f 1143~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1144# make a circle at mouse location
1145pick index x y z b
1146circle c x y z 0 0 1 1 0 0 0 30
1147
1148# make a dynamic circle at mouse location
1149# stop when a button is clicked
1150# (see the repaint command)
1151
1152dset b 0
1153while {[dval b] == 0} {
1154pick index x y z b nowait
1155circle c x y z 0 0 1 1 0 0 0 30
1156repaint
1157}
1158~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1159See also: **repaint**
1160
1161
e5bd0d98 1162Draw provides commands to manage the display of objects.
1163* **display**, **donly** are used to display,
1164* **erase**, **clear**, **2dclear** to erase.
1165* **autodisplay** command is used to check whether variables are displayed when created.
72b7576f 1166
e5bd0d98 1167The 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 1168 * 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.
1169 * 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 1170 * If you do not see what you expected while executing loops or sourcing files, use the **repaint** and **dflush** commands.
72b7576f 1171
e5bd0d98 1172**Example:**
72b7576f 1173~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1174# OK use dot to dump an object on the screen
1175dump .
1176
1177point . x y z
1178
1179#Not OK. display points on a curve c
1180# with dot no variables are created
d5cdd12a 1181for {set i 0} {$i <= 10} {incr i} {
72b7576f 1182cvalue c $i/10 x y z
1183point . x y z
1184}
1185
1186# point p x y z
1187# would have displayed only one point
1188# because the precedent variable content is erased
1189
1190# point p$i x y z
1191# is an other solution, creating variables
1192# p0, p1, p2, ....
1193
1194# give a name to a graphic object
472634fa 1195renamevar . x
72b7576f 1196~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1197
72b7576f 1198
e5bd0d98 1199@subsubsection occt_draw_4_1_12 autodisplay
72b7576f 1200
e5bd0d98 1201Syntax:
1202
1203~~~~~
1204autodisplay [0/1]
1205~~~~~
1206
1207By 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.
1208
1209When **autodisplay** is off, using the dot return argument is ineffective.
1210
1211**Example:**
72b7576f 1212~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1213# c is displayed
1214circle c 0 0 1 0 5
1215
1216# toggle the mode
1217autodisplay
1218== 0
1219circle c 0 0 1 0 5
1220
1221# c is erased, but not displayed
1222display c
1223~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1224
e5bd0d98 1225@subsubsection occt_draw_4_1_13 display, donly
72b7576f 1226
e5bd0d98 1227Syntax:
1228~~~~~
1229display varname [varname ...]
72b7576f 1230donly varname [varname ...]
e5bd0d98 1231~~~~~
72b7576f 1232
e5bd0d98 1233* **display** makes objects visible.
1234* **donly** *display only* makes objects visible and erases all other objects. It is very useful to extract one object from a messy screen.
72b7576f 1235
e5bd0d98 1236**Example:**
72b7576f 1237~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
e5bd0d98 1238\# to see all objects
72b7576f 1239foreach var [directory] {display $var}
1240
e5bd0d98 1241\# to select two objects and erase the other ones
72b7576f 1242donly . .
1243~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1244
1245
e5bd0d98 1246@subsubsection occt_draw_4_1_14 erase, clear, 2dclear
1247
1248Syntax:
72b7576f 1249
e5bd0d98 1250~~~~~
1251erase [varname varname ...]
72b7576f 1252clear
12532dclear
e5bd0d98 1254~~~~~
72b7576f 1255
e5bd0d98 1256**erase** removes objects from all views. **erase** without arguments erases everything in 2d and 3d.
72b7576f 1257
e5bd0d98 1258**clear** erases only 3d objects and **2dclear** only 2d objects. **erase** without arguments is similar to **clear; 2dclear**.
1259
1260
1261**Example:**
72b7576f 1262~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1263# erase eveerything with a name starting with c_
1264foreach var [directory c_*] {erase $var}
1265
1266# clear 2d views
ca0f3082 12672dclear
72b7576f 1268~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1269
472634fa 1270@subsubsection occt_draw_4_1_14_1 disp, don, era
1271
1272These commands have the same meaning as correspondingly display, donly and erase, but with the difference that they evaluate the arguments using glob pattern rules. For example, to display all objects with names d_1, d_2, d_3, etc. it is enouth to run the command:
1273~~~~~{.cpp}
1274disp d_*
1275~~~~~
1276
e5bd0d98 1277@subsubsection occt_draw_4_1_15 repaint, dflush
72b7576f 1278
72b7576f 1279
e5bd0d98 1280Syntax:
1281
1282~~~~~
1283repaint
1284dflush
1285~~~~~
1286
1287* **repaint** forces repainting of views.
1288* **dflush** flushes the graphic buffers.
72b7576f 1289
1290These commands are useful within loops or in scripts.
1291
e5bd0d98 1292When 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.
1293
1294Graphic 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 1295
67d7f07f 1296See also: @ref occt_draw_4_1_11 "pick" command.
72b7576f 1297
3f812249 1298@subsection occt_draw_4_2 AIS viewer -- view commands
72b7576f 1299
e5bd0d98 1300@subsubsection occt_draw_4_2_1 vinit
72b7576f 1301
e5bd0d98 1302Syntax:
1303~~~~~
1304vinit
1305~~~~~
251a7984 1306Creates a new View window with the specified *view_name*.
1307By default the view is created in the viewer and in the graphic driver shared with the active view.
1308
1309~~~~
1310name = {driverName/viewerName/viewName | viewerName/viewName | viewName}
1311~~~~
1312
1313If *driverName* is not specified the driver will be shared with the active view.
1314If *viewerName* is not specified the viewer will be shared with the active view.
72b7576f 1315
e5bd0d98 1316@subsubsection occt_draw_4_2_2 vhelp
72b7576f 1317
e5bd0d98 1318Syntax:
1319~~~~~
1320vhelp
1321~~~~~
72b7576f 1322Displays help in the 3D viewer window. The help consists in a list of hotkeys and their functionalities.
1323
e5bd0d98 1324@subsubsection occt_draw_4_2_3 vtop
72b7576f 1325
e5bd0d98 1326Syntax:
1327~~~~~
1328vtop
1329~~~~~
72b7576f 1330
faea8b40 1331Displays top view in the 3D viewer window. Orientation +X+Y.
e5bd0d98 1332
1333**Example:**
72b7576f 1334~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1335vinit
1336box b 10 10 10
1337vdisplay b
1338vfit
1339vtop
1340~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1341
e5bd0d98 1342@subsubsection occt_draw_4_2_4 vaxo
1343
1344Syntax:
1345~~~~~
1346vaxo
1347~~~~~
72b7576f 1348
faea8b40 1349Displays axonometric view in the 3D viewer window. Orientation +X-Y+Z.
e5bd0d98 1350
1351**Example:**
72b7576f 1352~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1353vinit
1354box b 10 10 10
1355vdisplay b
1356vfit
1357vaxo
1358~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b7576f 1359
e5bd0d98 1360@subsubsection occt_draw_4_2_5 vsetbg
72b7576f 1361
e5bd0d98 1362Syntax:
1363~~~~~
1364vsetbg imagefile [filltype]
1365~~~~~
72b7576f 1366
e5bd0d98 1367Loads image file as background. *filltype* must be NONE, CENTERED, TILED or STRETCH.
1368
1369**Example:**
1370~~~~~
72b7576f 1371vinit
1372vsetbg myimage.brep CENTERED
e5bd0d98 1373~~~~~
72b7576f 1374
e5bd0d98 1375@subsubsection occt_draw_4_2_6 vclear
72b7576f 1376
e5bd0d98 1377Syntax:
1378~~~~~
1379vclear
1380~~~~~
72b7576f 1381Removes all objects from the viewer.
1382
e5bd0d98 1383@subsubsection occt_draw_4_2_7 vrepaint
72b7576f 1384
e5bd0d98 1385Syntax:
1386~~~~~
1387vrepaint
1388~~~~~
251a7984 1389Forcibly redisplays the shape in the 3D viewer window.
72b7576f 1390
e5bd0d98 1391@subsubsection occt_draw_4_2_8 vfit
72b7576f 1392
e5bd0d98 1393Syntax:
1394~~~~~
1395vfit
1396~~~~~
72b7576f 1397Automatic zoom/panning. Objects in the view are visualized to occupy the maximum surface.
1398
e5bd0d98 1399@subsubsection occt_draw_4_2_9 vzfit
72b7576f 1400
e5bd0d98 1401Syntax:
1402~~~~~
1403vzfit
1404~~~~~
72b7576f 1405
1406Automatic depth panning. Objects in the view are visualized to occupy the maximum 3d space.
1407
e5bd0d98 1408@subsubsection occt_draw_4_2_10 vreadpixel
72b7576f 1409
e5bd0d98 1410Syntax:
1411~~~~~
1412vreadpixel xPixel yPixel [{rgb|rgba|depth|hls|rgbf|rgbaf}=rgba] [name]
1413~~~~~
1414Read pixel value for active view.
72b7576f 1415
72b7576f 1416
e5bd0d98 1417@subsubsection occt_draw_4_2_11 vselect
1418
1419Syntax:
1420~~~~~
faea8b40 1421vselect x1 y1 [x2 y2 [x3 y3 ... xn yn]] [-allowoverlap 0|1] [shift_selection = 0|1]
e5bd0d98 1422~~~~~
1423
1424Emulates different types of selection:
1425
1426 * single mouse click selection
bf62b306 1427 * selection with a rectangle having the upper left and bottom right corners in <i>(x1,y1)</i> and <i>(x2,y2)</i> respectively
1428 * selection with a polygon having the corners in pixel positions <i>(x1,y1), (x2,y2),…, (xn,yn)</i>
251a7984 1429 * <i> -allowoverlap </i> manages overlap and inclusion detection in rectangular selection. If the flag is set to 1, both sensitives that were included completely and overlapped partially by defined rectangle will be detected, otherwise algorithm will chose only fully included sensitives. Default behavior is to detect only full inclusion.
e5bd0d98 1430 * any of these selections if shift_selection is set to 1.
1431
1432@subsubsection occt_draw_4_2_12 vmoveto
1433
1434Syntax:
1435
1436~~~~~
1437vmoveto x y
1438~~~~~
1439Emulates cursor movement to pixel position (x,y).
1440
1441@subsubsection occt_draw_4_2_13 vviewparams
1442
1443Syntax:
1444~~~~~
faea8b40 1445vviewparams [-scale [s]] [-eye [x y z]] [-at [x y z]] [-up [x y z]] [-proj [x y z]] [-center x y] [-size sx]
e5bd0d98 1446~~~~~
251a7984 1447Gets or sets the current view parameters.
faea8b40 1448* If called without arguments, all view parameters are printed.
1449* The options are:
251a7984 1450* -scale [s] : prints or sets the relative scale of viewport.
1451* -eye [x y z] : prints or sets the eye location.
1452* -at [x y z] : prints or sets the view center.
1453* -up [x y z] : prints or sets the up vector direction.
1454* -proj [x y z] : prints or sets the view direction.
1455* -center x y : sets the screen center location in pixels.
faea8b40 1456* -size [sx] : prints viewport projection width and height sizes or changes the size of its maximum dimension.
e5bd0d98 1457
1458@subsubsection occt_draw_4_2_14 vchangeselected
1459
1460Syntax:
1461~~~~~
1462vchangeselected shape
1463~~~~~
1464Adds a shape to selection or removes one from it.
1465
1466@subsubsection occt_draw_4_2_15 vzclipping
1467
1468Syntax:
1469~~~~~
1470vzclipping [mode] [depth width]
1471~~~~~
1472Gets or sets ZClipping mode, width and depth, where
1473 - *mode = OFF|BACK|FRONT|SLICE*
1474 - *depth* is a real value from segment [0,1]
1475 - *width* is a real value from segment [0,1]
1476
1477@subsubsection occt_draw_4_2_16 vnbselected
1478
1479Syntax:
1480~~~~~
1481vnbselected
1482~~~~~
1483Returns the number of selected objects in the interactive context.
1484
e5bd0d98 1485@subsubsection occt_draw_4_2_18 vpurgedisplay
1486
1487Syntax:
1488~~~~~
1489vpurgedisplay [CollectorToo = 0|1]
1490~~~~~
1491Removes structures which do not belong to objects displayed in neutral point.
1492
1493@subsubsection occt_draw_4_2_19 vhlr
1494
1495Syntax:
1496~~~~~
faea8b40 1497vhlr is_enabled={on|off} [show_hidden={1|0}]
e5bd0d98 1498~~~~~
faea8b40 1499Hidden line removal algorithm:
251a7984 1500 * <i>is_enabled</i> applies HLR algorithm.
1501 * <i>show_hidden</i> if equals to 1, hidden lines are drawn as dotted ones.
e5bd0d98 1502
1503@subsubsection occt_draw_4_2_20 vhlrtype
1504
1505Syntax:
1506~~~~~
1507vhlrtype algo_type={algo|polyalgo} [shape_1 ... shape_n]
1508~~~~~
1509
1510Changes the type of HLR algorithm used for shapes.
1511If the algo_type is algo, the exact HLR algorithm is used, otherwise the polygonal algorithm is used for defined shapes.
1512
bf62b306 1513If no shape is specified through the command arguments, the given HLR algorithm_type is applied to all *AIS_Shape* isntances in the current context, and the command also changes the default HLR algorithm type.
e5bd0d98 1514
1515**Note** that this command works with instances of *AIS_Shape* or derived classes only, other interactive object types are ignored.
1516
18006a0f 1517@subsubsection occt_draw_4_2_21 vcamera
1518
1519Syntax:
1520~~~~~
faea8b40 1521vcamera [-ortho] [-projtype]
1522 [-persp]
1523 [-fovy [Angle]] [-distance [Distance]]
1524 [-stereo] [-leftEye] [-rightEye]
1525 [-iod [Distance]] [-iodType [absolute|relative]]
1526 [-zfocus [Value]] [-zfocusType [absolute|relative]]
1527~~~~~
1528
251a7984 1529Manages camera parameters.
1530Prints the current value when the option is called without argument.
1531
faea8b40 1532Orthographic camera:
251a7984 1533 * -ortho -- activates orthographic projection.
1534
faea8b40 1535Perspective camera:
251a7984 1536 * -persp -- activated perspective projection (mono);
1537 * -fovy -- field of view in y axis, in degrees;
1538 * -distance -- distance of eye from the camera center.
1539
faea8b40 1540Stereoscopic camera:
251a7984 1541 * -stereo -- perspective projection (stereo);
1542 * -leftEye -- perspective projection (left eye);
1543 * -rightEye -- perspective projection (right eye);
1544 * -iod -- intraocular distance value;
1545 * -iodType -- distance type, absolute or relative;
1546 * -zfocus -- stereographic focus value;
1547 * -zfocusType -- focus type, absolute or relative.
18006a0f 1548
1549**Example:**
1550~~~~~
1551vinit
1552box b 10 10 10
1553vdisplay b
1554vfit
1555vcamera -persp
1556~~~~~
1557
1558@subsubsection occt_draw_4_2_22 vstereo
1559
1560Syntax:
1561~~~~~
faea8b40 1562vstereo [0|1] [-mode Mode] [-reverse {0|1}] [-anaglyph Filter]
18006a0f 1563~~~~~
1564
251a7984 1565Defines the stereo output mode. The following modes are available:
1566 * quadBuffer -- OpenGL QuadBuffer stereo, requires driver support. Should be called BEFORE *vinit*!
1567 * anaglyph -- Anaglyph glasses;
1568 * rowInterlaced -- row-interlaced display;
1569 * columnInterlaced -- column-interlaced display;
1570 * chessBoard -- chess-board output;
1571 * sideBySide -- horizontal pair;
1572 * overUnder -- vertical pair;
faea8b40 1573Available Anaglyph filters for -anaglyph:
251a7984 1574 * redCyan, redCyanSimple, yellowBlue, yellowBlueSimple, greenMagentaSimple.
18006a0f 1575
1576**Example:**
1577~~~~~
1578vinit
1579box b 10 10 10
1580vdisplay b
1581vstereo 1
1582vfit
1583vcamera -stereo -iod 1
1584vcamera -lefteye
1585vcamera -righteye
1586~~~~~
1587
1588@subsubsection occt_draw_4_2_23 vfrustumculling
1589
1590Syntax:
1591~~~~~
1592vfrustumculling [toEnable]
1593~~~~~
1594
1595Enables/disables objects clipping.
1596
e5bd0d98 1597
3f812249 1598@subsection occt_draw_4_3 AIS viewer -- display commands
e5bd0d98 1599
1600@subsubsection occt_draw_4_3_1 vdisplay
1601
bf62b306 1602Syntax:
1603~~~~~
faea8b40 1604vdisplay [-noupdate|-update] [-local] [-mutable] [-neutral]
1605 [-trsfPers {pan|zoom|rotate|trihedron|full|none}=none] [-trsfPersPos X Y [Z]] [-3d|-2d|-2dTopDown]
1606 [-dispMode mode] [-highMode mode]
1607 [-layer index] [-top|-topmost|-overlay|-underlay]
1608 [-redisplay]
1609 name1 [name2] ... [name n]
1610~~~~~
1611
1612Displays named objects.
251a7984 1613Option <i>-local</i> enables display of objects in the local selection context.
faea8b40 1614Local selection context will be opened if there is not any.
1615
1616* *noupdate* suppresses viewer redraw call.
251a7984 1617* *mutable* enables optimization for mutable objects.
1618* *neutral* draws objects in the main viewer.
1619* *layer* sets z-layer for objects. It can use <i>-overlay|-underlay|-top|-topmost</i> instead of <i>-layer index</i> for the default z-layers.
1620* *top* draws objects on top of main presentations but below the topmost level.
faea8b40 1621* *topmost* draws in overlay for 3D presentations with independent Depth.
1622* *overlay* draws objects in overlay for 2D presentations (On-Screen-Display).
1623* *underlay* draws objects in underlay for 2D presentations (On-Screen-Display).
1624* *selectable|-noselect* controls selection of objects.
251a7984 1625* *trsfPers* sets transform persistence flags. Flag *full* allows to pan, zoom and rotate.
faea8b40 1626* *trsfPersPos* sets an anchor point for transform persistence.
1627* *2d|-2dTopDown* displays object in screen coordinates.
1628* *dispmode* sets display mode for objects.
3f812249 1629* *highmode* sets highlight mode for objects.
faea8b40 1630* *redisplay* recomputes presentation of objects.
72b7576f 1631
668c2575 1632**Example:**
bf62b306 1633~~~~~
72b7576f 1634vinit
1635box b 40 40 40 10 10 10
1636psphere s 20
1637vdisplay s b
1638vfit
bf62b306 1639~~~~~
72b7576f 1640
668c2575 1641@subsubsection occt_draw_4_3_2 vdonly
72b7576f 1642
668c2575 1643Syntax:
1644~~~~~
faea8b40 1645vdonly [-noupdate|-update] [name1] ... [name n]
bf62b306 1646~~~~~
1647
72b7576f 1648Displays only selected or named objects. If there are no selected or named objects, nothing is done.
72b7576f 1649
668c2575 1650**Example:**
bf62b306 1651~~~~~
72b7576f 1652vinit
1653box b 40 40 40 10 10 10
1654psphere s 20
1655vdonly b
bf62b306 1656vfit
1657~~~~~
1658
668c2575 1659@subsubsection occt_draw_4_3_3 vdisplayall
72b7576f 1660
668c2575 1661Syntax:
bf62b306 1662~~~~~
faea8b40 1663vdisplayall [-local]
bf62b306 1664~~~~~
72b7576f 1665
faea8b40 1666Displays all erased interactive objects (see vdir and vstate).
251a7984 1667Option <i>-local</i> enables displaying objects in the local selection context.
668c2575 1668
1669**Example:**
bf62b306 1670~~~~~
72b7576f 1671vinit
1672box b 40 40 40 10 10 10
1673psphere s 20
1674vdisplayall
1675vfit
bf62b306 1676~~~~~
72b7576f 1677
668c2575 1678@subsubsection occt_draw_4_3_4 verase
1679
bf62b306 1680Syntax:
668c2575 1681~~~~~
bf62b306 1682verase [name1] [name2] … [name n]
1683~~~~~
72b7576f 1684
1685Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
72b7576f 1686
668c2575 1687**Example:**
1688~~~~~
72b7576f 1689vinit
1690box b1 40 40 40 10 10 10
1691box b2 -40 -40 -40 10 10 10
1692psphere s 20
1693vdisplayall
1694vfit
bf62b306 1695# erase only first box
72b7576f 1696verase b1
bf62b306 1697# erase second box and sphere
1698verase
1699~~~~~
72b7576f 1700
668c2575 1701@subsubsection occt_draw_4_3_5 veraseall
72b7576f 1702
668c2575 1703Syntax:
1704~~~~~
bf62b306 1705veraseall
1706~~~~~
668c2575 1707
bf62b306 1708Erases all objects displayed in the viewer.
668c2575 1709
bf62b306 1710**Example:**
1711~~~~~
72b7576f 1712vinit
1713box b1 40 40 40 10 10 10
1714box b2 -40 -40 -40 10 10 10
1715psphere s 20
1716vdisplayall
1717vfit
bf62b306 1718# erase only first box
72b7576f 1719verase b1
bf62b306 1720# erase second box and sphere
1721verseall
1722~~~~~
72b7576f 1723
668c2575 1724@subsubsection occt_draw_4_3_6 vsetdispmode
1725
1726Syntax:
668c2575 1727~~~~~
bf62b306 1728vsetdispmode [name] mode(0,1,2,3)
1729~~~~~
72b7576f 1730
bf62b306 1731Sets display mode for all, selected or named objects.
1732* *0* (*WireFrame*),
1733* *1* (*Shading*),
1734* *2* (*Quick HideLineremoval*),
1735* *3* (*Exact HideLineremoval*).
72b7576f 1736
e5bd0d98 1737**Example:**
668c2575 1738~~~~~
72b7576f 1739vinit
1740box b 10 10 10
1741vdisplay b
1742vsetdispmode 1
bf62b306 1743vfit
668c2575 1744~~~~~
bf62b306 1745
668c2575 1746@subsubsection occt_draw_4_3_7 vdisplaytype
1747
1748Syntax:
1749~~~~~
bf62b306 1750vdisplaytype type
1751~~~~~
668c2575 1752
bf62b306 1753Displays all objects of a given type.
1754The following types are possible: *Point*, *Axis*, *Trihedron*, *PlaneTrihedron*, *Line*, *Circle*, *Plane*, *Shape*, *ConnectedShape*, *MultiConn.Shape*, *ConnectedInter.*, *MultiConn.*, *Constraint* and *Dimension*.
668c2575 1755
1756@subsubsection occt_draw_4_3_8 verasetype
72b7576f 1757
bf62b306 1758Syntax:
1759~~~~~
1760verasetype type
1761~~~~~
72b7576f 1762
1763Erases all objects of a given type.
bf62b306 1764Possible type is *Point*, *Axis*, *Trihedron*, *PlaneTrihedron*, *Line*, *Circle*, *Plane*, *Shape*, *ConnectedShape*, *MultiConn.Shape*, *ConnectedInter.*, *MultiConn.*, *Constraint* and *Dimension*.
72b7576f 1765
bf62b306 1766@subsubsection occt_draw_4_3_9 vtypes
72b7576f 1767
bf62b306 1768Syntax:
1769~~~~~
1770vtypes
1771~~~~~
72b7576f 1772
bf62b306 1773Makes a list of known types and signatures in AIS.
72b7576f 1774
18006a0f 1775@subsubsection occt_draw_4_3_10 vaspects
72b7576f 1776
18006a0f 1777Syntax:
bf62b306 1778~~~~~
faea8b40 1779vaspects [-noupdate|-update] [name1 [name2 [...]] | -defaults]
1780 [-setVisibility 0|1]
1781 [-setColor ColorName] [-setcolor R G B] [-unsetColor]
1782 [-setMaterial MatName] [-unsetMaterial]
1783 [-setTransparency Transp] [-unsetTransparency]
1784 [-setWidth LineWidth] [-unsetWidth]
1785 [-setLineType {solid|dash|dot|dotDash}] [-unsetLineType]
1786 [-freeBoundary {off/on | 0/1}]
1787 [-setFreeBoundaryWidth Width] [-unsetFreeBoundaryWidth]
1788 [-setFreeBoundaryColor {ColorName | R G B}] [-unsetFreeBoundaryColor]
18006a0f 1789 [-subshapes subname1 [subname2 [...]]]
faea8b40 1790 [-isoontriangulation 0|1]
1791 [-setMaxParamValue {value}]
72b7576f 1792
18006a0f 1793~~~~~
72b7576f 1794
251a7984 1795Manages presentation properties of all, selected or named objects.
1796* *-subshapes* -- assigns presentation properties to the specified sub-shapes.
1797* *-defaults* -- assigns presentation properties to all objects that do not have their own specified properties and to all objects to be displayed in the future.
1798If *-defaults* option is used there should not be any names of objects and *-subshapes* specifier.
faea8b40 1799
18006a0f 1800Aliases:
1801~~~~~
faea8b40 1802vsetcolor [-noupdate|-update] [name] ColorName
72b7576f 1803
bf62b306 1804~~~~~
72b7576f 1805
72b7576f 1806
18006a0f 1807Manages presentation properties (color, material, transparency) of all objects, selected or named.
bf62b306 1808
18006a0f 1809**Color**. The *ColorName* can be: *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*.
1810~~~~~
1811vaspects [name] [-setcolor ColorName] [-setcolor R G B] [-unsetcolor]
1812vsetcolor [name] ColorName
1813vunsetcolor [name]
bf62b306 1814~~~~~
72b7576f 1815
18006a0f 1816**Transparency. The *Transp* may be between 0.0 (opaque) and 1.0 (fully transparent).
bf62b306 1817**Warning**: at 1.0 the shape becomes invisible.
bf62b306 1818~~~~~
18006a0f 1819vaspects [name] [-settransparency Transp] [-unsettransparency]
1820vsettransparency [name] Transp
1821vunsettransparency [name]
bf62b306 1822~~~~~
72b7576f 1823
18006a0f 1824**Material**. The *MatName* can be *BRASS*, *BRONZE*, *COPPER*, *GOLD*, *PEWTER*, *PLASTER*, *PLASTIC*, *SILVER*, *STEEL*, *STONE*, *SHINY_PLASTIC*, *SATIN*, *METALIZED*, *NEON_GNC*, *CHROME*, *ALUMINIUM*, *OBSIDIAN*, *NEON_PHC*, *JADE*, *WATER*, *GLASS*, *DIAMOND* or *CHARCOAL*.
1825~~~~~
1826vaspects [name] [-setmaterial MatName] [-unsetmaterial]
1827vsetmaterial [name] MatName
1828vunsetmaterial [name]
bf62b306 1829~~~~~
72b7576f 1830
18006a0f 1831**Line width**. Specifies width of the edges. The *LineWidth* may be between 0.0 and 10.0.
bf62b306 1832~~~~~
18006a0f 1833vaspects [name] [-setwidth LineWidth] [-unsetwidth]
1834vsetwidth [name] LineWidth
1835vunsetwidth [name]
bf62b306 1836~~~~~
72b7576f 1837
18006a0f 1838**Example:**
bf62b306 1839~~~~~
18006a0f 1840vinit
1841box b 10 10 10
1842vdisplay b
1843vfit
72b7576f 1844
18006a0f 1845vsetdispmode b 1
1846vaspects -setcolor red -settransparency 0.2
1847vrotate 10 10 10
bf62b306 1848~~~~~
72b7576f 1849
72b7576f 1850
72b7576f 1851
72b7576f 1852
72b7576f 1853
18006a0f 1854
1855@subsubsection occt_draw_4_3_11 vsetshading
72b7576f 1856
bf62b306 1857Syntax:
1858~~~~~
1859vsetshading shapename [coefficient]
1860~~~~~
72b7576f 1861
1862Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
72b7576f 1863
bf62b306 1864**Example:**
1865~~~~~
72b7576f 1866vinit
1867psphere s 20
1868vdisplay s
1869vfit
1870vsetdispmode 1
bf62b306 1871vsetshading s 0.005
1872~~~~~
1873
18006a0f 1874@subsubsection occt_draw_4_3_12 vunsetshading
72b7576f 1875
bf62b306 1876Syntax:
1877~~~~~
1878vunsetshading [shapename]
1879~~~~~
72b7576f 1880
faea8b40 1881Sets default deflection coefficient (0.0008) that defines the quality of the shape’s representation in the shading mode.
72b7576f 1882
18006a0f 1883@subsubsection occt_draw_4_3_13 vsetam
72b7576f 1884
bf62b306 1885Syntax:
1886~~~~~
1887vsetam [shapename] mode
1888~~~~~
1889
1890Activates selection mode for all selected or named shapes:
1891* *0* for *shape* itself,
1892* *1* (*vertices*),
1893* *2* (*edges*),
1894* *3* (*wires*),
1895* *4* (*faces*),
1896* *5* (*shells*),
1897* *6* (*solids*),
1898* *7* (*compounds*).
1899
e5bd0d98 1900**Example:**
bf62b306 1901~~~~~
72b7576f 1902vinit
1903box b 10 10 10
1904vdisplay b
1905vfit
bf62b306 1906vsetam b 2
1907~~~~~
1908
18006a0f 1909@subsubsection occt_draw_4_3_14 vunsetam
72b7576f 1910
bf62b306 1911Syntax:
1912~~~~~
1913vunsetam
1914~~~~~
72b7576f 1915
1916Deactivates all selection modes for all shapes.
1917
18006a0f 1918@subsubsection occt_draw_4_3_15 vdump
72b7576f 1919
bf62b306 1920Syntax:
1921~~~~~
faea8b40 1922vdump <filename>.{png|bmp|jpg|gif} [-width Width -height Height]
1923 [-buffer rgb|rgba|depth=rgb]
1924 [-stereo mono|left|right|blend|sideBySide|overUnder=mono]
1925
bf62b306 1926~~~~~
72b7576f 1927
18006a0f 1928Extracts the contents of the viewer window to a image file.
72b7576f 1929
18006a0f 1930@subsubsection occt_draw_4_3_16 vdir
72b7576f 1931
bf62b306 1932Syntax:
1933~~~~~
1934vdir
1935~~~~~
72b7576f 1936
1937Displays the list of displayed objects.
1938
18006a0f 1939@subsubsection occt_draw_4_3_17 vsub
72b7576f 1940
bf62b306 1941Syntax:
1942~~~~~
1943vsub 0/1(on/off)[shapename]
1944~~~~~
72b7576f 1945
bf62b306 1946Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
1947
e5bd0d98 1948**Example:**
bf62b306 1949~~~~~
72b7576f 1950vinit
1951box b 10 10 10
1952psphere s 20
1953vdisplay b s
1954vfit
1955vsetdispmode 1
bf62b306 1956vsub b 1
1957~~~~~
72b7576f 1958
18006a0f 1959@subsubsection occt_draw_4_3_20 vsensdis
72b7576f 1960
bf62b306 1961Syntax:
1962~~~~~
1963vsensdis
1964~~~~~
72b7576f 1965
1966Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes).
1967
1968Standard entity types are those defined in Select3D package:
1969 * sensitive box
1970 * sensitive face
1971 * sensitive curve
1972 * sensitive segment
1973 * sensitive circle
1974 * sensitive point
1975 * sensitive triangulation
1976 * sensitive triangle
1977Custom (application-defined) sensitive entity types are not processed by this command.
1978
18006a0f 1979@subsubsection occt_draw_4_3_21 vsensera
72b7576f 1980
bf62b306 1981Syntax:
1982~~~~~
1983vsensera
1984~~~~~
72b7576f 1985
1986Erases active entities.
1987
18006a0f 1988@subsubsection occt_draw_4_3_23 vr
72b7576f 1989
bf62b306 1990Syntax:
1991~~~~~
1992vr filename
1993~~~~~
72b7576f 1994
1995Reads shape from BREP-format file and displays it in the viewer.
72b7576f 1996
bf62b306 1997**Example:**
1998~~~~~
72b7576f 1999vinit
bf62b306 2000vr myshape.brep
2001~~~~~
2002
18006a0f 2003@subsubsection occt_draw_4_3_24 vstate
72b7576f 2004
bf62b306 2005Syntax:
2006~~~~~
faea8b40 2007vstate [-entities] [-hasSelected] [name1] ... [nameN]
bf62b306 2008~~~~~
72b7576f 2009
251a7984 2010Reports show/hidden state for selected or named objects:
3f812249 2011 * *entities* -- prints low-level information about detected entities;
2012 * *hasSelected* -- prints 1 if the context has a selected shape and 0 otherwise.
72b7576f 2013
18006a0f 2014@subsubsection occt_draw_4_3_25 vraytrace
2015
2016Syntax:
2017~~~~~
2018vraytrace [0/1]
2019~~~~~
2020
2021Turns on/off ray tracing renderer.
2022
2023@subsubsection occt_draw_4_3_26 vrenderparams
2024
2025Syntax:
2026~~~~~
faea8b40 2027vrenderparams [-rayTrace|-raster] [-rayDepth 0..10] [-shadows {on|off}]
2028 [-reflections {on|off}] [-fsaa {on|off}] [-gleam {on|off}]
2029 [-gi {on|off}] [-brng {on|off}] [-env {on|off}]
2030 [-shadin {color|flat|gouraud|phong}]
18006a0f 2031~~~~~
2032
2033Manages rendering parameters:
3f812249 2034* rayTrace -- Enables GPU ray-tracing
2035* raster -- Disables GPU ray-tracing
2036* rayDepth -- Defines maximum ray-tracing depth
2037* shadows -- Enables/disables shadows rendering
2038* reflections -- Enables/disables specular reflections
2039* fsaa -- Enables/disables adaptive anti-aliasing
2040* gleam -- Enables/disables transparency shadow effects
2041* gi -- Enables/disables global illumination effects
2042* brng -- Enables/disables blocked RNG (fast coherent PT)
2043* env -- Enables/disables environment map background
2044* shadingModel -- Controls shading model from enumeration color, flat, gouraud, phong
faea8b40 2045
251a7984 2046Unlike *vcaps*, these parameters dramatically change visual properties.
2047The command is intended to control presentation quality depending on hardware capabilities and performance.
18006a0f 2048
2049**Example:**
2050~~~~~
2051vinit
2052box b 10 10 10
2053vdisplay b
2054vfit
2055vraytrace 1
2056vrenderparams -shadows 1 -reflections 1 -fsaa 1
2057~~~~~
2058@subsubsection occt_draw_4_3_27 vshaderprog
2059
2060Syntax:
2061~~~~~
faea8b40 2062 'vshaderprog [name] pathToVertexShader pathToFragmentShader'
2063or 'vshaderprog [name] off' to disable GLSL program
2064or 'vshaderprog [name] phong' to enable per-pixel lighting calculations
18006a0f 2065~~~~~
2066
2067Enables rendering using a shader program.
2068
2069@subsubsection occt_draw_4_3_28 vsetcolorbg
2070
2071Syntax:
2072~~~~~
2073vsetcolorbg r g b
2074~~~~~
2075
2076Sets background color.
2077
2078**Example:**
2079~~~~~
2080vinit
2081vsetcolorbg 200 0 200
2082~~~~~
72b7576f 2083
3f812249 2084@subsection occt_draw_4_4 AIS viewer -- object commands
72b7576f 2085
bf62b306 2086@subsubsection occt_draw_4_4_1 vtrihedron
72b7576f 2087
bf62b306 2088Syntax:
2089~~~~~
bc001a40 2090vtrihedron name [-dispMode {wf|sh|wireframe|shading}]
2091 [-origin x y z ]
2092 [-zaxis u v w -xaxis u v w ]
2093 [-drawaxes {X|Y|Z|XY|YZ|XZ|XYZ}]
2094 [-hidelabels {on|off}]"
2095 [-label {XAxis|YAxis|ZAxis} value]"
2096 [-attribute {XAxisLength|YAxisLength|ZAxisLength
2097 |TubeRadiusPercent|ConeRadiusPercent"
2098 |ConeLengthPercent|OriginRadiusPercent"
2099 |ShadingNumberOfFacettes} value]"
2100 [-color {Origin|XAxis|YAxis|ZAxis|XOYAxis|YOZAxis"
2101 |XOZAxis|Whole} {r g b | colorName}]"
2102 [-textcolor {r g b | colorName}]"
2103 [-arrowscolor {r g b | colorName}]"
2104 [-priority {Origin|XAxis|YAxis|ZAxis|XArrow"
2105 |YArrow|ZArrow|XOYAxis|YOZAxis"
2106 |XOZAxis|Whole} value]
2107
bf62b306 2108~~~~~
72b7576f 2109
bc001a40 2110Creates a new *AIS_Trihedron* object or changes existing trihedron. If no argument is set, the default trihedron (0XYZ) is created.
2111
e5bd0d98 2112**Example:**
bf62b306 2113~~~~~
72b7576f 2114vinit
bc001a40 2115vtrihedron tr1
2116
2117vtrihedron t2 -dispmode shading -origin -200 -200 -300
2118vtrihedron t2 -color XAxis Quantity_NOC_RED
2119vtrihedron t2 -color YAxis Quantity_NOC_GREEN
2120vtrihedron t2 -color ZAxis|Origin Quantity_NOC_BLUE1
bf62b306 2121~~~~~
72b7576f 2122
bf62b306 2123@subsubsection occt_draw_4_4_2 vplanetri
72b7576f 2124
bf62b306 2125Syntax:
2126~~~~~
2127vplanetri name
2128~~~~~
72b7576f 2129
251a7984 2130Creates a plane from a trihedron selection. If no arguments are set, the default plane is created.
72b7576f 2131
2132
bf62b306 2133@subsubsection occt_draw_4_4_3 vsize
72b7576f 2134
bf62b306 2135Syntax:
2136~~~~~
2137vsize [name] [size]
2138~~~~~
72b7576f 2139
bf62b306 2140Changes 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.
2141
e5bd0d98 2142**Example:**
bf62b306 2143~~~~~
72b7576f 2144vinit
2145vtrihedron tr1
2146vtrihedron tr2 0 0 0 1 0 0 1 0 0
bf62b306 2147vsize tr2 400
2148~~~~~
72b7576f 2149
bf62b306 2150@subsubsection occt_draw_4_4_4 vaxis
72b7576f 2151
bf62b306 2152Syntax:
2153~~~~~
2154vaxis name [Xa Ya Za Xb Yb Zb]
2155~~~~~
72b7576f 2156
bf62b306 2157Creates an axis. If the values are not defined, an axis is created by interactive selection of two vertices or one edge
2158
e5bd0d98 2159**Example:**
bf62b306 2160~~~~~
72b7576f 2161vinit
2162vtrihedron tr
2163vaxis axe1 0 0 0 1 0 0
bf62b306 2164~~~~~
72b7576f 2165
bf62b306 2166@subsubsection occt_draw_4_4_5 vaxispara
72b7576f 2167
bf62b306 2168Syntax:
2169~~~~~
faea8b40 2170vaxispara name
bf62b306 2171~~~~~
72b7576f 2172
2173Creates an axis by interactive selection of an edge and a vertex.
2174
bf62b306 2175@subsubsection occt_draw_4_4_6 vaxisortho
72b7576f 2176
bf62b306 2177Syntax:
2178~~~~~
2179vaxisotrho name
2180~~~~~
72b7576f 2181
2182Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge.
2183
bf62b306 2184@subsubsection occt_draw_4_4_7 vpoint
72b7576f 2185
bf62b306 2186Syntax:
2187~~~~~
2188vpoint name [Xa Ya Za]
2189~~~~~
72b7576f 2190
2191Creates 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).
72b7576f 2192
bf62b306 2193**Example:**
2194~~~~~
72b7576f 2195vinit
2196vpoint p 0 0 0
bf62b306 2197~~~~~
72b7576f 2198
bf62b306 2199@subsubsection occt_draw_4_4_8 vplane
72b7576f 2200
bf62b306 2201Syntax:
2202~~~~~
2203vplane name [AxisName] [PointName]
2204vplane name [PointName] [PointName] [PointName]
2205vplane name [PlaneName] [PointName]
2206~~~~~
72b7576f 2207
bf62b306 2208Creates a plane from named or interactively selected entities.
faea8b40 2209TypeOfSensitivity:
3f812249 2210 * 0 -- Interior
2211 * 1 -- Boundary
faea8b40 2212
e5bd0d98 2213**Example:**
bf62b306 2214~~~~~
72b7576f 2215vinit
2216vpoint p1 0 50 0
2217vaxis axe1 0 0 0 0 0 1
2218vtrihedron tr
2219vplane plane1 axe1 p1
bf62b306 2220~~~~~
72b7576f 2221
bf62b306 2222@subsubsection occt_draw_4_4_9 vplanepara
72b7576f 2223
bf62b306 2224Syntax:
2225~~~~~
2226vplanepara name
2227~~~~~
72b7576f 2228
2229Creates a plane from interactively selected vertex and face.
2230
bf62b306 2231@subsubsection occt_draw_4_4_10 vplaneortho
72b7576f 2232
bf62b306 2233Syntax:
2234~~~~~
2235vplaneortho name
2236~~~~~
72b7576f 2237
2238Creates a plane from interactive selected face and coplanar edge.
2239
bf62b306 2240@subsubsection occt_draw_4_4_11 vline
72b7576f 2241
bf62b306 2242Syntax:
2243~~~~~
2244vline name [PointName] [PointName]
2245vline name [Xa Ya Za Xb Yb Zb]
2246~~~~~
72b7576f 2247
2248Creates a line from coordinates, named or interactively selected vertices.
72b7576f 2249
bf62b306 2250**Example:**
2251~~~~~
72b7576f 2252vinit
2253vtrihedron tr
2254vpoint p1 0 50 0
2255vpoint p2 50 0 0
2256vline line1 p1 p2
2257vline line2 0 0 0 50 0 1
bf62b306 2258~~~~~
72b7576f 2259
bf62b306 2260@subsubsection occt_draw_4_4_12 vcircle
72b7576f 2261
bf62b306 2262Syntax:
2263~~~~~
2264vcircle name [PointName PointName PointName IsFilled]
72b7576f 2265vcircle name [PlaneName PointName Radius IsFilled]
bf62b306 2266~~~~~
72b7576f 2267
bf62b306 2268Creates a circle from named or interactively selected entities. Parameter IsFilled is defined as 0 or 1.
2269
e5bd0d98 2270**Example:**
bf62b306 2271~~~~~
72b7576f 2272vinit
2273vtrihedron tr
2274vpoint p1 0 50 0
2275vpoint p2 50 0 0
2276vpoint p3 0 0 0
bf62b306 2277vcircle circle1 p1 p2 p3 1
2278~~~~~
72b7576f 2279
bf62b306 2280@subsubsection occt_draw_4_4_13 vtri2d
72b7576f 2281
bf62b306 2282Syntax:
2283~~~~~
2284vtri2d name
2285~~~~~
72b7576f 2286
2287Creates a plane with a 2D trihedron from an interactively selected face.
2288
bf62b306 2289@subsubsection occt_draw_4_4_14 vselmode
72b7576f 2290
bf62b306 2291Syntax:
2292~~~~~
faea8b40 2293vselmode [object] mode_number is_turned_on=(1|0)
bf62b306 2294~~~~~
72b7576f 2295
2296Sets the selection mode for an object. If the object value is not defined, the selection mode is set for all displayed objects.
251a7984 2297*Mode_number* is a non-negative integer encoding different interactive object classes.
faea8b40 2298For shapes the following *mode_number* values are allowed:
3f812249 2299 * 0 -- shape
2300 * 1 -- vertex
2301 * 2 -- edge
2302 * 3 -- wire
2303 * 4 -- face
2304 * 5 -- shell
2305 * 6 -- solid
2306 * 7 -- compsolid
2307 * 8 -- compound
faea8b40 2308*is_turned_on* is:
2309 * 1 if mode is to be switched on
2310 * 0 if mode is to be switched off
72b7576f 2311
bf62b306 2312**Example:**
2313~~~~~
72b7576f 2314vinit
2315vpoint p1 0 0 0
2316vpoint p2 50 0 0
2317vpoint p3 25 40 0
2318vtriangle triangle1 p1 p2 p3
bf62b306 2319~~~~~
2320
faea8b40 2321@subsubsection occt_draw_4_4_15 vconnect
72b7576f 2322
bf62b306 2323Syntax:
2324~~~~~
faea8b40 2325vconnect vconnect name Xo Yo Zo object1 object2 ... [color=NAME]
bf62b306 2326~~~~~
72b7576f 2327
251a7984 2328Creates *AIS_ConnectedInteractive* object from the input object and location and displays it.
72b7576f 2329
bf62b306 2330**Example:**
2331~~~~~
73ddbb9a 2332vinit
72b7576f 2333vpoint p1 0 0 0
2334vpoint p2 50 0 0
2335vsegment segment p1 p2
2336restore CrankArm.brep obj
2337vdisplay obj
faea8b40 2338vconnect new obj 100100100 1 0 0 0 0 1
bf62b306 2339~~~~~
72b7576f 2340
bf62b306 2341@subsubsection occt_draw_4_4_16 vtriangle
72b7576f 2342
bf62b306 2343Syntax:
2344~~~~~
2345vtriangle name PointName PointName PointName
2346~~~~~
72b7576f 2347
2348Creates and displays a filled triangle from named points.
72b7576f 2349
bf62b306 2350**Example:**
2351~~~~~
72b7576f 2352vinit
2353vpoint p1 0 0 0
2354vpoint p2 50 0 0
2355vpoint p3 25 40 0
bf62b306 2356vtriangle triangle1 p1 p2 p3
2357~~~~~
72b7576f 2358
bf62b306 2359@subsubsection occt_draw_4_4_17 vsegment
72b7576f 2360
bf62b306 2361Syntax:
2362~~~~~
2363vsegment name PointName PointName
2364~~~~~
72b7576f 2365
2366Creates and displays a segment from named points.
72b7576f 2367
bf62b306 2368**Example:**
2369~~~~~
72b7576f 2370Vinit
2371vpoint p1 0 0 0
2372vpoint p2 50 0 0
2373vsegment segment p1 p2
bf62b306 2374~~~~~
72b7576f 2375
18006a0f 2376@subsubsection occt_draw_4_4_18 vpointcloud
2377
2378Syntax:
2379~~~~~
faea8b40 2380vpointcloud name shape [-randColor] [-normals] [-noNormals]
18006a0f 2381~~~~~
2382
251a7984 2383Creates an interactive object for an arbitrary set of points from the triangulated shape.
faea8b40 2384Additional options:
251a7984 2385 * *randColor* -- generates a random color per point;
2386 * *normals* -- generates a normal per point (default);
2387 * *noNormals* -- does not generate a normal per point.
18006a0f 2388
2389~~~~~
faea8b40 2390vpointcloud name x y z r npts {surface|volume} [-randColor] [-normals] [-noNormals]
18006a0f 2391~~~~~
2392Creates an arbitrary set of points (npts) randomly distributed on a spheric surface or within a spheric volume (x y z r).
faea8b40 2393Additional options:
251a7984 2394 * *randColor* -- generates a random color per point;
2395 * *normals* -- generates a normal per point (default);
2396 * *noNormals* -- does not generate a normal per point.
18006a0f 2397
2398**Example:**
2399~~~~~
2400vinit
2401vpointcloud pc 0 0 0 100 100000 surface -randColor
2402vfit
2403~~~~~
2404
2405@subsubsection occt_draw_4_4_19 vclipplane
2406
2407Syntax:
2408~~~~~
3f812249 2409vclipplane maxplanes <view_name> -- gets plane limit for the view.
2410vclipplane create <plane_name> -- creates a new plane.
2411vclipplane delete <plane_name> -- deletes a plane.
2412vclipplane clone <source_plane> <plane_name> -- clones the plane definition.
2413vclipplane set/unset <plane_name> object <object list> -- sets/unsets the plane for an IO.
2414vclipplane set/unset <plane_name> view <view list> -- sets/unsets plane for a view.
2415vclipplane change <plane_name> on/off -- turns clipping on/off.
2416vclipplane change <plane_name> equation <a> <b> <c> <d> -- changes plane equation.
2417vclipplane change <plane_name> capping on/off -- turns capping on/off.
2418vclipplane change <plane_name> capping color <r> <g> <b> -- sets color.
2419vclipplane change <plane name> capping texname <texture> -- sets texture.
2420vclipplane change <plane_name> capping texscale <sx> <sy> -- sets texture scale.
2421vclipplane change <plane_name> capping texorigin <tx> <ty> -- sets texture origin.
2422vclipplane change <plane_name> capping texrotate <angle> -- sets texture rotation.
2423vclipplane change <plane_name> capping hatch on/off/<id> -- sets hatching mask.
18006a0f 2424~~~~~
2425
2426Manages clipping planes
2427
2428**Example:**
2429~~~~~
2430vinit
2431vclipplane create pln1
2432vclipplane change pln1 equation 1 0 0 -0.1
2433vclipplane set pln1 view Driver1/Viewer1/View1
2434box b 100 100 100
2435vdisplay b
2436vsetdispmode 1
2437vfit
2438vrotate 10 10 10
2439vselect 100 100
2440~~~~~
2441
2442@subsubsection occt_draw_4_4_20 vdimension
2443
2444Syntax:
2445~~~~~
2446vdimension name {-angle|-length|-radius|-diameter} -shapes shape1 [shape2 [shape3]]
2447 [-text 3d|2d wf|sh|wireframe|shading IntegerSize]
2448 [-label left|right|hcenter|hfit top|bottom|vcenter|vfit]
2449 [-arrow external|internal|fit] [{-arrowlength|-arlen} RealArrowLength]
2450 [{-arrowangle|-arangle} ArrowAngle(degrees)] [-plane xoy|yoz|zox]
73ddbb9a 2451 [-flyout FloatValue -extension FloatValue]
d5cdd12a 2452 [-autovalue] [-value CustomRealValue] [-textvalue CustomTextValue]
73ddbb9a 2453 [-dispunits DisplayUnitsString]
2454 [-modelunits ModelUnitsString] [-showunits | -hideunits]
18006a0f 2455~~~~~
2456
2457Builds angle, length, radius or diameter dimension interactive object **name**.
2458
2459**Attension:** length dimension can't be built without working plane.
2460
2461**Example:**
2462~~~~~
73ddbb9a 2463vinit
18006a0f 2464vpoint p1 0 0 0
2465vpoint p2 50 50 0
2466vdimension dim1 -length -plane xoy -shapes p1 p2
2467
2468vpoint p3 100 0 0
2469vdimension dim2 -angle -shapes p1 p2 p3
2470
2471vcircle circle p1 p2 p3 0
2472vdimension dim3 -radius -shapes circle
2473vfit
2474~~~~~
2475
2476@subsubsection occt_draw_4_4_21 vdimparam
2477
2478Syntax:
2479~~~~~
2480vdimparam name [-text 3d|2d wf|sh|wireframe|shading IntegerSize]
2481 [-label left|right|hcenter|hfit top|bottom|vcenter|vfit]
2482 [-arrow external|internal|fit]
2483 [{-arrowlength|-arlen} RealArrowLength]
2484 [{-arrowangle|-arangle} ArrowAngle(degrees)]
2485 [-plane xoy|yoz|zox]
2486 [-flyout FloatValue -extension FloatValue]
73ddbb9a 2487 [-autovalue]
2488 [-value CustomRealValue]
2489 [-textvalue CustomTextValue]
18006a0f 2490 [-dispunits DisplayUnitsString]
2491 [-modelunits ModelUnitsString]
2492 [-showunits | -hideunits]
2493~~~~~
2494
2495Sets parameters for angle, length, radius and diameter dimension **name**.
2496
2497**Example:**
2498~~~~~
73ddbb9a 2499vinit
18006a0f 2500vpoint p1 0 0 0
2501vpoint p2 50 50 0
2502vdimension dim1 -length -plane xoy -shapes p1 p2
2503vdimparam dim1 -flyout -15 -arrowlength 4 -showunits -value 10
73ddbb9a 2504vfit
2505vdimparam dim1 -textvalue "w_1"
2506vdimparam dim1 -autovalue
18006a0f 2507~~~~~
2508
948c552a 2509@subsubsection occt_draw_4_4_22 vangleparam
ee905e84 2510
2511Syntax:
2512~~~~~
2513vangleparam name [-type interior|exterior]
2514 [-showarrow first|second|both|none]
2515~~~~~
2516
2517Sets parameters for angle dimension **name**.
2518
2519**Example:**
2520~~~~~
2521vinit
2522vpoint p1 0 0 0
2523vpoint p2 10 0 0
2524vpoint p3 10 5 0
2525vdimension dim1 -angle -plane xoy -shapes p1 p2 p3
2526vfit
2527vangleparam dim1 -type exterior -showarrow first
2528~~~~~
2529
948c552a 2530@subsubsection occt_draw_4_4_23 vlengthparam
2531
2532Syntax:
2533~~~~~
2534vlengthparam name [-type interior|exterior]
2535 [-showarrow first|second|both|none]
2536~~~~~
2537
2538Sets parameters for length dimension **name**.
2539
2540**Example:**
2541~~~~~
2542vinit
2543vpoint p1 20 20 0
2544vpoint p2 80 80 0
2545vdimension dim1 -length -plane xoy -shapes p1 p2
2546vtop
2547vfit
2548vzoom 0.5
2549vlengthparam dim1 -direction ox
2550~~~~~
2551
2552@subsubsection occt_draw_4_4_24 vmovedim
18006a0f 2553
2554Syntax:
2555~~~~~
2556vmovedim [name] [x y z]
2557~~~~~
2558
2559Moves picked or named (if **name** parameter is defined) dimension
2560to picked mouse position or input point with coordinates **x**,**y**,**z**.
2561Text label of dimension **name** is moved to position, another parts of dimension
2562are adjusted.
2563
2564**Example:**
2565~~~~~
73ddbb9a 2566vinit
18006a0f 2567vpoint p1 0 0 0
2568vpoint p2 50 50 0
2569vdimension dim1 -length -plane xoy -shapes p1 p2
2570vmovedim dim1 -10 30 0
2571~~~~~
2572
2573
3f812249 2574@subsection occt_draw_4_5 AIS viewer -- Mesh Visualization Service
72b7576f 2575
bf62b306 2576**MeshVS** (Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.
72b7576f 2577
bf62b306 2578@subsubsection occt_draw_4_5_1 meshfromstl
72b7576f 2579
bf62b306 2580Syntax:
2581~~~~~
2582meshfromstl meshname file
2583~~~~~
2584
2585Creates a *MeshVS_Mesh* object based on STL file data. The object will be displayed immediately.
2586
2587**Example:**
2588~~~~~
2589meshfromstl mesh myfile.stl
2590~~~~~
72b7576f 2591
bf62b306 2592@subsubsection occt_draw_4_5_2 meshdispmode
72b7576f 2593
bf62b306 2594Syntax:
2595~~~~~
2596meshdispmode meshname displaymode
2597~~~~~
72b7576f 2598
bf62b306 2599Changes the display mode of object **meshname**. The **displaymode** is integer, which can be:
2600* *1* for *wireframe*,
2601* *2* for *shading* mode, or
2602* *3* for *shrink* mode.
72b7576f 2603
e5bd0d98 2604**Example:**
bf62b306 2605~~~~~
2606vinit
72b7576f 2607meshfromstl mesh myfile.stl
bf62b306 2608meshdispmode mesh 2
2609~~~~~
72b7576f 2610
bf62b306 2611@subsubsection occt_draw_4_5_3 meshselmode
72b7576f 2612
bf62b306 2613Syntax:
2614~~~~~
2615meshselmode meshname selectionmode
2616~~~~~
72b7576f 2617
bf62b306 2618Changes the selection mode of object **meshname**. The *selectionmode* is integer OR-combination of mode flags. The basic flags are the following:
3f812249 2619* *1* -- node selection;
2620* *2* -- 0D elements (not supported in STL);
2621* *4* -- links (not supported in STL);
2622* *8* -- faces.
bf62b306 2623
e5bd0d98 2624**Example:**
bf62b306 2625~~~~~
72b7576f 2626vinit
2627meshfromstl mesh myfile.stl
bf62b306 2628meshselmode mesh 1
2629~~~~~
72b7576f 2630
bf62b306 2631@subsubsection occt_draw_4_5_4 meshshadcolor
72b7576f 2632
bf62b306 2633Syntax:
2634~~~~~
2635meshshadcolor meshname red green blue
2636~~~~~
72b7576f 2637
ca0f3082 2638Changes the face interior color of object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
bf62b306 2639
e5bd0d98 2640**Example:**
bf62b306 2641~~~~~
72b7576f 2642vinit
2643meshfromstl mesh myfile.stl
bf62b306 2644meshshadcolormode mesh 0.5 0.5 0.5
2645~~~~~
72b7576f 2646
bf62b306 2647@subsubsection occt_draw_4_5_5 meshlinkcolor
72b7576f 2648
bf62b306 2649Syntax:
2650~~~~~
2651meshlinkcolor meshname red green blue
2652~~~~~
72b7576f 2653
bf62b306 2654Changes the color of face borders for object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
2655
e5bd0d98 2656**Example:**
bf62b306 2657~~~~~
72b7576f 2658vinit
2659meshfromstl mesh myfile.stl
bf62b306 2660meshlinkcolormode mesh 0.5 0.5 0.5
2661~~~~~
72b7576f 2662
bf62b306 2663@subsubsection occt_draw_4_5_6 meshmat
72b7576f 2664
bf62b306 2665Syntax:
2666~~~~~
2667meshmat meshname material
2668~~~~~
2669
2670Changes the material of object **meshname**.
2671
2672*material* is represented with an integer value as follows (equivalent to enumeration *Graphic3d_NameOfMaterial*):
3f812249 2673* *0 -- BRASS,*
2674* *1 -- BRONZE,*
2675* *2 -- COPPER,*
2676* *3 -- GOLD,*
2677* *4 -- PEWTER,*
2678* *5 -- PLASTER,*
2679* *6 -- PLASTIC,*
2680* *7 -- SILVER,*
2681* *8 -- STEEL,*
2682* *9 -- STONE,*
2683* *10 -- SHINY_PLASTIC,*
2684* *11 -- SATIN,*
2685* *12 -- METALIZED,*
2686* *13 -- NEON_GNC,*
2687* *14 -- CHROME,*
2688* *15 -- ALUMINIUM,*
2689* *16 -- OBSIDIAN,*
2690* *17 -- NEON_PHC,*
2691* *18 -- JADE,*
2692* *19 -- DEFAULT,*
2693* *20 -- UserDefined*
bf62b306 2694
e5bd0d98 2695**Example:**
bf62b306 2696~~~~~
72b7576f 2697vinit
2698meshfromstl mesh myfile.stl
2699meshmat mesh JADE
bf62b306 2700~~~~~
72b7576f 2701
bf62b306 2702@subsubsection occt_draw_4_5_7 meshshrcoef
72b7576f 2703
bf62b306 2704Syntax:
2705~~~~~
2706meshshrcoef meshname shrinkcoefficient
2707~~~~~
72b7576f 2708
bf62b306 2709Changes 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.
2710
e5bd0d98 2711**Example:**
bf62b306 2712~~~~~
72b7576f 2713vinit
2714meshfromstl mesh myfile.stl
bf62b306 2715meshshrcoef mesh 0.05
2716~~~~~
72b7576f 2717
bf62b306 2718@subsubsection occt_draw_4_5_8 meshshow
72b7576f 2719
bf62b306 2720Syntax:
2721~~~~~
2722meshshow meshname
2723~~~~~
72b7576f 2724
bf62b306 2725Displays **meshname** in the viewer (if it is erased).
2726
e5bd0d98 2727**Example:**
bf62b306 2728~~~~~
72b7576f 2729vinit
2730meshfromstl mesh myfile.stl
bf62b306 2731meshshow mesh
2732~~~~~
72b7576f 2733
bf62b306 2734@subsubsection occt_draw_4_5_9 meshhide
72b7576f 2735
bf62b306 2736Syntax:
2737~~~~~
2738meshhide meshname
2739~~~~~
72b7576f 2740
2741Hides **meshname** in the viewer.
72b7576f 2742
bf62b306 2743**Example:**
2744~~~~~
72b7576f 2745vinit
2746meshfromstl mesh myfile.stl
bf62b306 2747meshhide mesh
2748~~~~~
72b7576f 2749
bf62b306 2750@subsubsection occt_draw_4_5_10 meshhidesel
72b7576f 2751
bf62b306 2752Syntax:
2753~~~~~
2754meshhidesel meshname
2755~~~~~
72b7576f 2756
2757Hides only selected entities. The other part of **meshname** remains visible.
2758
bf62b306 2759@subsubsection occt_draw_4_5_11 meshshowsel
72b7576f 2760
bf62b306 2761Syntax:
2762~~~~~
2763meshshowsel meshname
2764~~~~~
72b7576f 2765
2766Shows only selected entities. The other part of **meshname** becomes invisible.
2767
bf62b306 2768@subsubsection occt_draw_4_5_12 meshshowall
72b7576f 2769
bf62b306 2770Syntax:
2771~~~~~
2772meshshowall meshname
2773~~~~~
72b7576f 2774
2775Changes the state of all entities to visible for **meshname**.
2776
bf62b306 2777@subsubsection occt_draw_4_5_13 meshdelete
72b7576f 2778
bf62b306 2779Syntax:
2780~~~~~
2781meshdelete meshname
2782~~~~~
72b7576f