1 Draw Test Harness {#occt_user_guides__test_harness}
2 ===============================
6 @section occt_draw_1 Introduction
8 This manual explains how to use Draw, the test harness for Open CASCADE Technology (**OCCT**).
9 Draw is a command interpreter based on TCL and a graphical system used to test and demonstrate Open CASCADE Technology modeling libraries.
11 @subsection occt_draw_1_1 Overview
13 Draw 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.
15 Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes.
17 Scripts may be written to customize Draw and perform tests. New types of objects and new commands may be added using the C++ programing language.
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.
28 There is also a set of commands for each delivery unit in the modeling libraries:
37 @subsection occt_draw_1_2 Contents of this documentation
39 This documentation describes:
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.
47 * Data Exchange commands
48 * Shape Healing commands
50 This document is a reference manual. It contains a full description of each command. All descriptions have the format illustrated below for the exit command.
56 Terminates the Draw, TCL session. If the commands are read from a file using the source command, this will terminate the file.
61 # this is a very short example
66 @subsection occt_draw_1_3 Getting started
68 Install Draw and launch Emacs. Get a command line in Emacs using *Esc x* and key in *woksh*.
70 All 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.
72 Declaration 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.
74 @subsubsection occt_draw_1_3_1 Launching DRAW Test Harness
76 Test 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).
79 @subsubsection occt_draw_1_3_2 Plug-in resource file
81 Open CASCADE Technology is shipped with the DrawPlugin resource file located in the <i>$CASROOT/src/DrawResources</i> directory.
83 The format of the file is compliant with standard Open CASCADE Technology resource files (see the *Resource_Manager.hxx* file for details).
85 Each 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.
87 **Example:** (excerpt from DrawPlugin):
88 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
89 OCAF : VISUALIZATION, OCAFKERNEL
95 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97 @subsubsection occt_draw_1_3_3 Activation of commands implemented in the plug-in
99 To load a plug-in declared in the resource file and to activate the commands the following command must be used in Test Harness:
102 pload [-PluginFileName] [[Key1] [Key2]...]
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).
110 According 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.
113 Draw[] pload -DrawPlugin OCAF
115 This 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.
118 Draw[] pload (equivalent to pload -DrawPlugin DEFAULT).
120 This command will find the default DrawPlugin file and the DEFAULT key. The latter finally maps to the TKTopTest toolkit which implements basic modeling commands.
123 @section occt_draw_2 The Command Language
125 @subsection occt_draw_2_1 Overview
127 The 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.
129 This 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:
131 * Syntax of the TCL language.
132 * Accessing variables in TCL and Draw.
133 * Control structures.
136 @subsection occt_draw_2_2 Syntax of TCL
138 TCL 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.
140 The basic program for TCL is a script. A script consists of one or more commands. Commands are separated by new lines or semicolons.
142 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
146 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
148 Each command consists of one or more *words*; the first word is the name of a command and additional words are arguments to that command.
150 Words 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.
152 The 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.
154 The following substitutions are performed by TCL:
156 Variable substitution is triggered by the $ character (as with csh), the content of the variable is substitued; { } may be used as in csh to enclose the name of the variable.
159 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
160 # set a variable value
161 set file documentation
162 puts $file #to display file contents on the screen
164 # a simple substitution, set psfile to documentation.ps
168 # another substitution, set pfile to documentationPS
172 # delete files NEWdocumentation and OLDdocumentation
173 foreach prefix {NEW OLD} {rm $prefix$file}
174 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176 Command substitution is triggered by the [ ] characters. The brackets must enclose a valid script. The script is evaluated and the result is substituted.
178 Compare command construction in csh.
181 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
184 # expr is a command evaluating a numeric expression
185 set radian [expr $pi*$degree/180]
186 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
188 Backslash 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.
190 TCL uses two forms of *quoting* to prevent substitution and word breaking.
192 Double quote *quoting* enables the definition of a string with space and tabs as a single word. Substitutions are still performed inside the inverted commas " ".
195 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
196 # set msg to ;the price is 12.00;
198 set msg ;the price is $price;
199 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
201 Braces *quoting* prevents all substitutions. Braces are also nested. The main use of braces is to defer evaluation when defining procedures and control structures. Braces are used for a clearer presentation of TCL scripts on several lines.
204 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
206 # this will loop for ever
207 # because while argument is ;0 < 3;
208 while ;$x < 3; {set x [expr $x+1]}
209 # this will terminate as expected because
210 # while argument is {$x < 3}
211 while {$x < 3} {set x [expr $x+1]}
212 # this can be written also
216 # the following cannot be written
217 # because while requires two arguments
222 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
224 Comments start with a \# character as the first non-blank character in a command. To add a comment at the end of the line, the comment must be preceded by a semi-colon to end the preceding command.
227 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
229 set a 1 # this is not a comment
230 set b 1; # this is a comment
231 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
233 The 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.
237 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238 # I want to delete two files
242 # this will fail because rm will receive only one argument
243 # and complain that ;foo bar; does not exit
247 # a second evaluation will do it
248 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
250 @subsection occt_draw_2_3 Accessing variables in TCL and Draw
252 TCL 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.
254 TCL provides a mechanism to link user data to variables. Using this functionality, Draw defines its variables as TCL variables with associated data.
256 The 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.
258 There are many kinds of Draw variables, and new ones may be added with C++. Geometric and topological variables are described below.
260 Draw 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.
263 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
264 # dset is used for numeric variables
265 # pi is a predefined Draw variable
266 dset angle pi/3 radius 10
267 point p radius*cos(angle) radius*sin(angle) 0
268 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
269 It 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.
271 @subsubsection occt_draw_2_3_1 set, unset
277 unset varname [varname varname ...]
280 *set* assigns a string value to a variable. If the variable does not already exist, it is created.
282 Without a value, *set* returns the content of the variable.
284 *unset* deletes variables. It is is also used to delete Draw variables.
287 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
294 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
296 **Note**, that the *set* command can set only one variable, unlike the *dset* command.
299 @subsubsection occt_draw_2_3_2 dset, dval
304 dset var1 value1 vr2 value2 ...
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.
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.
314 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
319 # no $ required for Draw commands
322 # "puts" prints a string
323 puts ;x = [dval x], cos(x/pi) = [dval cos(x/pi)];
324 == x = 10, cos(x/pi) = -0.99913874099467914
325 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
329 @subsubsection occt_draw_2_3_3 del, dall
333 del varname_pattern [varname_pattern ...]
337 *del* command does the same thing as *unset*, but it deletes the variables matched by the pattern.
339 *dall* command deletes all variables in the session.
341 @subsection occt_draw_2_4 lists
343 TCL 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.
345 This allows you to insert lists within lists.
348 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
349 # a list of 3 strings
352 # a list of two strings the first is a list of 2
354 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
356 Many TCL commands return lists and **foreach** is a useful way to create loops on list elements.
358 @subsubsection occt_draw_2_5 Control Structures
360 TCL 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:
362 * You use braces instead of parentheses to enclose conditions.
363 * You do not start the script on the next line of your command.
366 @subsubsection occt_draw_2_5_1 if
371 if condition script [elseif script .... else script]
374 **If** evaluates the condition and the script to see whether the condition is true.
379 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
387 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
389 @subsubsection occt_draw_2_5_2 while, for, foreach
395 while condition script
396 for init condition reinit script
397 foreach varname list script
400 The 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. \
403 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
406 while {[dval x] < 100} {
411 # incr var d, increments a variable of d (default 1)
412 for {set i 0} {$i < 10} {incr i} {
414 point p$i cos(angle0 sin(angle) 0
417 foreach object {crapo tomson lucas} {display $object}
418 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
420 @subsubsection occt_draw_2_5_3 break, continue
429 Within loops, the **break** and **continue** commands have the same effect as in C.
431 **break** interrupts the innermost loop and **continue** jumps to the next iteration.
434 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
435 # search the index for which t$i has value ;secret;
436 for {set i 1} {$i <= 100} {incr i} {
437 if {[set t$i] == ;secret;} break;
439 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
441 @subsection occt_draw_2_6 Procedures
443 TCL 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.
445 The 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.
447 There 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.
449 As 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.
452 @subsubsection occt_draw_2_6_1 proc
457 proc argumentlist script
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.
462 **return** gives a return value to the procedure.
465 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
470 # procedure with arguments and default values
471 proc distance {x1 y1 {x2 0} {y2 0}} {
472 set d [expr (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)]
473 return [expr sqrt(d)]
476 if {$n == 0} {return 1} else {
477 return [expr n*[fact [expr n -1]]]
480 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
483 @subsubsection occt_draw_2_6_2 global, upvar
488 global varname [varname ...]
489 upvar varname localname [varname localname ...]
493 **global** accesses high level variables. Unlike C, global variables are not visible in procedures.
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.
497 **Note** that in the following examples the \$ character is always necessarily used to access the arguments.
500 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
501 # convert degree to radian
502 # pi is a global variable
503 proc deg2rad (degree} {
504 return [dval pi*$degree/2.]
506 # create line with a point and an angle
507 proc linang {linename x y angle} {
509 line l $x $y cos($angle) sin($angle)
511 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
513 @section occt_draw_3 Basic Commands
515 This 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:
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.
522 Note that Draw also features a GUI task bar providing an alternative way to give certain general, graphic and display commands
525 @subsection occt_draw_3_1 General commands
527 This section describes several useful commands:
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.
536 @subsubsection occt_draw_3_1_1 help
541 help [command [helpstring group]]
544 Provides help or modifies the help information.
546 **help** without arguments lists all groups and the commands in each group.
548 Specifying 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.
551 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
552 # Gives help on all commands starting with *a*
553 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
556 @subsubsection occt_draw_3_1_2 source
565 The **exit** command will terminate the file.
567 @subsubsection occt_draw_3_1_3 spy
575 Saves 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.
577 If a command returns an error it is saved with a comment mark.
579 The file created by **spy** can be executed with the **source** command.
582 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
583 # all commands will be saved in the file ;session;
585 # the file ;session; is closed and commands are not saved
587 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
591 @subsubsection occt_draw_3_1_4 cpulimit
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.
602 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
603 #limit cpu to one hour
605 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
607 @subsubsection occt_draw_3_1_5 wait
613 Suspends 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.
616 # You have ten seconds ...
620 @subsubsection occt_draw_3_1_6 chrono
625 chrono [ name start/stop/reset/show/restart/[counter text]]
628 Without arguments, **chrono** activates Draw chronometers. The elapsed time ,cpu system and cpu user times for each command will be printed.
630 With arguments, **chrono** is used to manage activated chronometers. You can perform the following actions with a chronometer.
631 * run the chronometer (start).
632 * stop the chronometer (stop).
633 * reset the chronometer to 0 (reset).
634 * restart the chronometer (restart).
635 * display the current time (show).
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).
639 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
641 ==Chronometers activated.
643 ==Elapsed time: 0 Hours 0 Minutes 0.0318 Seconds
644 ==CPU user time: 0.01 seconds
645 ==CPU system time: 0 seconds
646 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
648 @subsection occt_draw_3_2 Variable management commands
650 @subsubsection occt_draw_3_2_1 isdraw, directory
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.
660 Use **directory** to return a list of all Draw global variables matching a pattern.
663 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
676 # to destroy all Draw objects with name containing curve
677 foreach var [directory *curve*] {unset $var}
678 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
681 @subsubsection occt_draw_3_2_2 whatis, dump
686 whatis varname [varname ...]
687 dump varname [varname ...]
690 **whatis** returns short information about a Draw variable. This is usually the type name.
692 **dump** returns a brief type description, the coordinates, and if need be, the parameters of a Draw variable.
695 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
702 ***** Dump of c *****
708 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
710 **Note** The behavior of *whatis* on other variables (not Draw) is not excellent.
713 @subsubsection occt_draw_3_2_3 renamevar, copy
717 renamevar varname tovarname [varname tovarname ...]
718 copy varname tovarname [varname tovarname ...]
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.
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.
725 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
729 # curves are copied, c2 will not be modified
731 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
733 @subsubsection occt_draw_3_2_4 datadir, save, restore
738 save variable [filename]
739 restore filename [variablename]
742 * **datadir** without arguments prints the path of the current data directory.
743 * **datadir** with an argument sets the data directory path. \
745 If the path starts with a dot (.) only the last directory name will be changed in the path.
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.
750 The exact content of the file is type-dependent. They are usually ASCII files and so, architecture independent.
753 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
754 # note how TCL accesses shell environment variables
759 datadir $env(WBCONTAINER)/data/default
760 ==/adv_20/BAG/data/default
764 ==/adv_20/BAG/data/default/theBox
766 # when TCL does not find a command it tries a shell command
772 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
774 @subsection occt_draw_3_3 User defined commands
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.
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.
780 @subsubsection occt_draw_3_3_1 set
782 #### In *DrawTrSurf* package:
785 void Set(Standard_CString& Name,const gp_Pnt& G) ;
786 void Set(Standard_CString& Name,const gp_Pnt2d& G) ;
787 void Set(Standard_CString& Name,
788 const Handle(Geom_Geometry)& G) ;
789 void Set(Standard_CString& Name,
790 const Handle(Geom2d_Curve)& C) ;
791 void Set(Standard_CString& Name,
792 const Handle(Poly_Triangulation)& T) ;
793 void Set(Standard_CString& Name,
794 const Handle(Poly_Polygon3D)& P) ;
795 void Set(Standard_CString& Name,
796 const Handle(Poly_Polygon2D)& P) ;
799 #### In *DBRep* package:
802 void Set(const Standard_CString Name,
803 const TopoDS_Shape& S) ;
806 Example of *DrawTrSurf*
809 Handle(Geom2d_Circle) C1 = new Geom2d_Circle
810 (gce_MakeCirc2d (gp_Pnt2d(50,0,) 25));
811 DrawTrSurf::Set(char*, C1);
818 B = BRepPrimAPI_MakeBox (10,10,10);
822 @subsubsection occt_draw_3_3_2 get
824 #### In *DrawTrSurf* package:
827 Handle_Geom_Geometry Get(Standard_CString& Name) ;
830 #### In *DBRep* package:
833 TopoDS_Shape Get(Standard_CString& Name,
834 const TopAbs_ShapeEnum Typ = TopAbs_SHAPE,
835 const Standard_Boolean Complain
839 Example of *DrawTrSurf*
842 Standard_Integer MyCommand
843 (Draw_Interpretor& theCommands,
844 Standard_Integer argc, char** argv)
846 // Creation of a Geom_Geometry from a Draw geometric
848 Handle (Geom_Geometry) aGeom= DrawTrSurf::Get(argv[1]);
855 Standard_Integer MyCommand
856 (Draw_Interpretor& theCommands,
857 Standard_Integer argc, char** argv)
859 // Creation of a TopoDS_Shape from a Draw topological
861 TopoDS_Solid B = DBRep::Get(argv[1]);
865 @section occt_draw_4 Graphic Commands
867 Graphic 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.
869 @subsection occt_draw_4_1 Axonometric viewer
871 @subsubsection occt_draw_4_1_1 view, delete
875 view index type [X Y W H]
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.
881 As 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..
883 **delete** deletes a view. If no index is given, all the views are deleted.
885 Type selects from the following range:
887 * *AXON* : Axonometric view
888 * *PERS* : Perspective view
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
892 The index, the type, the current zoom are displayed in the window title .
895 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
896 # this is the content of the mu4 procedure
899 view 1 +X+Z 320 20 400 400
900 view 2 +X+Y 320 450 400 400
901 view 3 +Y+Z 728 20 400 400
902 view 4 AXON 728 450 400 400
904 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
906 See also: **axo, pers, top, bottom, left, right, front, back, mu4, v2d, av2d, smallview**
908 @subsubsection occt_draw_4_1_2 axo, pers, top, ...
919 All 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.
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.
929 See also: **view**, **delete**
931 @subsubsection occt_draw_4_1_3 mu, md, 2dmu, 2dmd, zoom, 2dzoom
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**
944 perform the same on one or all 2d views.
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.
949 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
957 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
958 See also: **fit**, **2dfit**
961 @subsubsection occt_draw_4_14 pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr
970 The <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.
972 # you have selected one anonometric view
977 # you have selected an mu4 view; the object in the third view will pan up
980 See also: **fit**, **2dfit**
983 @subsubsection occt_draw_4_1_5 fit, 2dfit
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.
994 When fitting all views a unique zoom is computed for all the views. All views are on the same scale.
997 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1002 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1003 See also: **zoom**, **mu**, **pu**
1006 @subsubsection occt_draw_4_1_6 u, d, l, r
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.
1020 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1021 # rotate the view up
1023 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1025 @subsubsection occt_draw_4_1_7 focal, fu, fd
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.
1038 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1041 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1043 **Note**: Do not use a negative or null focal value.
1047 @subsubsection occt_draw_4_1_8 color
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.
1057 The 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.
1060 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1061 # change the value of blue
1063 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1066 **Note** that the color change will be visible on the next redraw of the views, for example, after *fit* or *mu*, etc.
1068 @subsubsection occt_draw_4_1_9 dtext
1072 dtext [x y [z]] string
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.
1077 The coordinates are real space coordinates.
1080 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1084 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1086 @subsubsection occt_draw_4_1_10 hardcopy, hcolor, xwd
1091 hcolor index width gray
1092 xwd [index] filename
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**.
1100 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1101 # all blue lines (color 3)
1102 # will be half-width and gray
1105 # make a postscript file and print it
1109 # make an xwd file and display it
1112 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1114 **Note:** When more than one view is present, specify the index of the view.
1116 Only use a postscript printer to print postscript files.
1121 @subsubsection occt_draw_4_1_11 wclick, pick
1126 pick index X Y Z b [nowait]
1129 **wclick** defers an event until the mouse button is clicked. The message <code>just click</code> is displayed.
1131 Use the **pick** command to get graphic input. The arguments must be names for variables where the results are stored.
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.
1136 When 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.
1138 This option is useful for tracking the pointer.
1140 **Note** that the results are stored in Draw numeric variables.
1143 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1144 # make a circle at mouse location
1146 circle c x y z 0 0 1 1 0 0 0 30
1148 # make a dynamic circle at mouse location
1149 # stop when a button is clicked
1150 # (see the repaint command)
1153 while {[dval b] == 0} {
1154 pick index x y z b nowait
1155 circle c x y z 0 0 1 1 0 0 0 30
1158 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1159 See also: **repaint**
1162 Draw 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.
1167 The 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.
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.
1170 * If you do not see what you expected while executing loops or sourcing files, use the **repaint** and **dflush** commands.
1173 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1174 # OK use dot to dump an object on the screen
1179 #Not OK. display points on a curve c
1180 # with dot no variables are created
1181 for {set i 0} {$i <= 10} {incr i} {
1182 cvalue c $i/10 x y z
1187 # would have displayed only one point
1188 # because the precedent variable content is erased
1191 # is an other solution, creating variables
1194 # give a name to a graphic object
1196 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1199 @subsubsection occt_draw_4_1_12 autodisplay
1207 By 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.
1209 When **autodisplay** is off, using the dot return argument is ineffective.
1212 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1221 # c is erased, but not displayed
1223 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1225 @subsubsection occt_draw_4_1_13 display, donly
1229 display varname [varname ...]
1230 donly varname [varname ...]
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.
1237 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1238 \# to see all objects
1239 foreach var [directory] {display $var}
1241 \# to select two objects and erase the other ones
1243 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1246 @subsubsection occt_draw_4_1_14 erase, clear, 2dclear
1251 erase [varname varname ...]
1256 **erase** removes objects from all views. **erase** without arguments erases everything in 2d and 3d.
1258 **clear** erases only 3d objects and **2dclear** only 2d objects. **erase** without arguments is similar to **clear; 2dclear**.
1262 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1263 # erase eveerything with a name starting with c_
1264 foreach var [directory c_*] {erase $var}
1268 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1270 @subsubsection occt_draw_4_1_14_1 disp, don, era
1272 These 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:
1277 @subsubsection occt_draw_4_1_15 repaint, dflush
1287 * **repaint** forces repainting of views.
1288 * **dflush** flushes the graphic buffers.
1290 These commands are useful within loops or in scripts.
1292 When 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.
1294 Graphic 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.
1296 See also: @ref occt_draw_4_1_11 "pick" command.
1298 @subsection occt_draw_4_2 AIS viewer -- view commands
1300 @subsubsection occt_draw_4_2_1 vinit
1306 Creates a new View window with the specified *view_name*.
1307 By default the view is created in the viewer and in the graphic driver shared with the active view.
1310 name = {driverName/viewerName/viewName | viewerName/viewName | viewName}
1313 If *driverName* is not specified the driver will be shared with the active view.
1314 If *viewerName* is not specified the viewer will be shared with the active view.
1316 @subsubsection occt_draw_4_2_2 vhelp
1322 Displays help in the 3D viewer window. The help consists in a list of hotkeys and their functionalities.
1324 @subsubsection occt_draw_4_2_3 vtop
1331 Displays top view in the 3D viewer window. Orientation +X+Y.
1334 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1340 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1342 @subsubsection occt_draw_4_2_4 vaxo
1349 Displays axonometric view in the 3D viewer window. Orientation +X-Y+Z.
1352 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1358 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1360 @subsubsection occt_draw_4_2_5 vsetbg
1364 vsetbg imagefile [filltype]
1367 Loads image file as background. *filltype* must be NONE, CENTERED, TILED or STRETCH.
1372 vsetbg myimage.brep CENTERED
1375 @subsubsection occt_draw_4_2_6 vclear
1381 Removes all objects from the viewer.
1383 @subsubsection occt_draw_4_2_7 vrepaint
1389 Forcibly redisplays the shape in the 3D viewer window.
1391 @subsubsection occt_draw_4_2_8 vfit
1397 Automatic zoom/panning. Objects in the view are visualized to occupy the maximum surface.
1399 @subsubsection occt_draw_4_2_9 vzfit
1406 Automatic depth panning. Objects in the view are visualized to occupy the maximum 3d space.
1408 @subsubsection occt_draw_4_2_10 vreadpixel
1412 vreadpixel xPixel yPixel [{rgb|rgba|depth|hls|rgbf|rgbaf}=rgba] [name]
1414 Read pixel value for active view.
1417 @subsubsection occt_draw_4_2_11 vselect
1421 vselect x1 y1 [x2 y2 [x3 y3 ... xn yn]] [-allowoverlap 0|1] [shift_selection = 0|1]
1424 Emulates different types of selection:
1426 * single mouse click selection
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>
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.
1430 * any of these selections if shift_selection is set to 1.
1432 @subsubsection occt_draw_4_2_12 vmoveto
1439 Emulates cursor movement to pixel position (x,y).
1441 @subsubsection occt_draw_4_2_13 vviewparams
1445 vviewparams [-scale [s]] [-eye [x y z]] [-at [x y z]] [-up [x y z]] [-proj [x y z]] [-center x y] [-size sx]
1447 Gets or sets the current view parameters.
1448 * If called without arguments, all view parameters are printed.
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.
1456 * -size [sx] : prints viewport projection width and height sizes or changes the size of its maximum dimension.
1458 @subsubsection occt_draw_4_2_14 vchangeselected
1462 vchangeselected shape
1464 Adds a shape to selection or removes one from it.
1466 @subsubsection occt_draw_4_2_15 vzclipping
1470 vzclipping [mode] [depth width]
1472 Gets 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]
1477 @subsubsection occt_draw_4_2_16 vnbselected
1483 Returns the number of selected objects in the interactive context.
1485 @subsubsection occt_draw_4_2_18 vpurgedisplay
1489 vpurgedisplay [CollectorToo = 0|1]
1491 Removes structures which do not belong to objects displayed in neutral point.
1493 @subsubsection occt_draw_4_2_19 vhlr
1497 vhlr is_enabled={on|off} [show_hidden={1|0}]
1499 Hidden line removal algorithm:
1500 * <i>is_enabled</i> applies HLR algorithm.
1501 * <i>show_hidden</i> if equals to 1, hidden lines are drawn as dotted ones.
1503 @subsubsection occt_draw_4_2_20 vhlrtype
1507 vhlrtype algo_type={algo|polyalgo} [shape_1 ... shape_n]
1510 Changes the type of HLR algorithm used for shapes.
1511 If the algo_type is algo, the exact HLR algorithm is used, otherwise the polygonal algorithm is used for defined shapes.
1513 If 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.
1515 **Note** that this command works with instances of *AIS_Shape* or derived classes only, other interactive object types are ignored.
1517 @subsubsection occt_draw_4_2_21 vcamera
1521 vcamera [-ortho] [-projtype]
1523 [-fovy [Angle]] [-distance [Distance]]
1524 [-stereo] [-leftEye] [-rightEye]
1525 [-iod [Distance]] [-iodType [absolute|relative]]
1526 [-zfocus [Value]] [-zfocusType [absolute|relative]]
1529 Manages camera parameters.
1530 Prints the current value when the option is called without argument.
1532 Orthographic camera:
1533 * -ortho -- activates orthographic projection.
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.
1540 Stereoscopic camera:
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.
1558 @subsubsection occt_draw_4_2_22 vstereo
1562 vstereo [0|1] [-mode Mode] [-reverse {0|1}] [-anaglyph Filter]
1565 Defines 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;
1573 Available Anaglyph filters for -anaglyph:
1574 * redCyan, redCyanSimple, yellowBlue, yellowBlueSimple, greenMagentaSimple.
1583 vcamera -stereo -iod 1
1588 @subsubsection occt_draw_4_2_23 vfrustumculling
1592 vfrustumculling [toEnable]
1595 Enables/disables objects clipping.
1598 @subsection occt_draw_4_3 AIS viewer -- display commands
1600 @subsubsection occt_draw_4_3_1 vdisplay
1604 vdisplay [-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]
1609 name1 [name2] ... [name n]
1612 Displays named objects.
1613 Option <i>-local</i> enables display of objects in the local selection context.
1614 Local selection context will be opened if there is not any.
1616 * *noupdate* suppresses viewer redraw call.
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.
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.
1625 * *trsfPers* sets transform persistence flags. Flag *full* allows to pan, zoom and rotate.
1626 * *trsfPersPos* sets an anchor point for transform persistence.
1627 * *2d|-2dTopDown* displays object in screen coordinates.
1628 * *dispmode* sets display mode for objects.
1629 * *highmode* sets highlight mode for objects.
1630 * *redisplay* recomputes presentation of objects.
1635 box b 40 40 40 10 10 10
1641 @subsubsection occt_draw_4_3_2 vdonly
1645 vdonly [-noupdate|-update] [name1] ... [name n]
1648 Displays only selected or named objects. If there are no selected or named objects, nothing is done.
1653 box b 40 40 40 10 10 10
1659 @subsubsection occt_draw_4_3_3 vdisplayall
1663 vdisplayall [-local]
1666 Displays all erased interactive objects (see vdir and vstate).
1667 Option <i>-local</i> enables displaying objects in the local selection context.
1672 box b 40 40 40 10 10 10
1678 @subsubsection occt_draw_4_3_4 verase
1682 verase [name1] [name2] … [name n]
1685 Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
1690 box b1 40 40 40 10 10 10
1691 box b2 -40 -40 -40 10 10 10
1695 # erase only first box
1697 # erase second box and sphere
1701 @subsubsection occt_draw_4_3_5 veraseall
1708 Erases all objects displayed in the viewer.
1713 box b1 40 40 40 10 10 10
1714 box b2 -40 -40 -40 10 10 10
1718 # erase only first box
1720 # erase second box and sphere
1724 @subsubsection occt_draw_4_3_6 vsetdispmode
1728 vsetdispmode [name] mode(0,1,2,3)
1731 Sets display mode for all, selected or named objects.
1732 * *0* (*WireFrame*),
1734 * *2* (*Quick HideLineremoval*),
1735 * *3* (*Exact HideLineremoval*).
1746 @subsubsection occt_draw_4_3_7 vdisplaytype
1753 Displays all objects of a given type.
1754 The following types are possible: *Point*, *Axis*, *Trihedron*, *PlaneTrihedron*, *Line*, *Circle*, *Plane*, *Shape*, *ConnectedShape*, *MultiConn.Shape*, *ConnectedInter.*, *MultiConn.*, *Constraint* and *Dimension*.
1756 @subsubsection occt_draw_4_3_8 verasetype
1763 Erases all objects of a given type.
1764 Possible type is *Point*, *Axis*, *Trihedron*, *PlaneTrihedron*, *Line*, *Circle*, *Plane*, *Shape*, *ConnectedShape*, *MultiConn.Shape*, *ConnectedInter.*, *MultiConn.*, *Constraint* and *Dimension*.
1766 @subsubsection occt_draw_4_3_9 vtypes
1773 Makes a list of known types and signatures in AIS.
1775 @subsubsection occt_draw_4_3_10 vaspects
1779 vaspects [-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]
1789 [-subshapes subname1 [subname2 [...]]]
1790 [-isoontriangulation 0|1]
1791 [-setMaxParamValue {value}]
1795 Manages 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.
1798 If *-defaults* option is used there should not be any names of objects and *-subshapes* specifier.
1802 vsetcolor [-noupdate|-update] [name] ColorName
1807 Manages presentation properties (color, material, transparency) of all objects, selected or named.
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*.
1811 vaspects [name] [-setcolor ColorName] [-setcolor R G B] [-unsetcolor]
1812 vsetcolor [name] ColorName
1816 **Transparency. The *Transp* may be between 0.0 (opaque) and 1.0 (fully transparent).
1817 **Warning**: at 1.0 the shape becomes invisible.
1819 vaspects [name] [-settransparency Transp] [-unsettransparency]
1820 vsettransparency [name] Transp
1821 vunsettransparency [name]
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*.
1826 vaspects [name] [-setmaterial MatName] [-unsetmaterial]
1827 vsetmaterial [name] MatName
1828 vunsetmaterial [name]
1831 **Line width**. Specifies width of the edges. The *LineWidth* may be between 0.0 and 10.0.
1833 vaspects [name] [-setwidth LineWidth] [-unsetwidth]
1834 vsetwidth [name] LineWidth
1846 vaspects -setcolor red -settransparency 0.2
1855 @subsubsection occt_draw_4_3_11 vsetshading
1859 vsetshading shapename [coefficient]
1862 Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
1874 @subsubsection occt_draw_4_3_12 vunsetshading
1878 vunsetshading [shapename]
1881 Sets default deflection coefficient (0.0008) that defines the quality of the shape’s representation in the shading mode.
1883 @subsubsection occt_draw_4_3_13 vsetam
1887 vsetam [shapename] mode
1890 Activates selection mode for all selected or named shapes:
1891 * *0* for *shape* itself,
1898 * *7* (*compounds*).
1909 @subsubsection occt_draw_4_3_14 vunsetam
1916 Deactivates all selection modes for all shapes.
1918 @subsubsection occt_draw_4_3_15 vdump
1922 vdump <filename>.{png|bmp|jpg|gif} [-width Width -height Height]
1923 [-buffer rgb|rgba|depth=rgb]
1924 [-stereo mono|left|right|blend|sideBySide|overUnder=mono]
1928 Extracts the contents of the viewer window to a image file.
1930 @subsubsection occt_draw_4_3_16 vdir
1937 Displays the list of displayed objects.
1939 @subsubsection occt_draw_4_3_17 vsub
1943 vsub 0/1(on/off)[shapename]
1946 Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
1959 @subsubsection occt_draw_4_3_20 vsensdis
1966 Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes).
1968 Standard entity types are those defined in Select3D package:
1975 * sensitive triangulation
1976 * sensitive triangle
1977 Custom (application-defined) sensitive entity types are not processed by this command.
1979 @subsubsection occt_draw_4_3_21 vsensera
1986 Erases active entities.
1988 @subsubsection occt_draw_4_3_23 vr
1995 Reads shape from BREP-format file and displays it in the viewer.
2003 @subsubsection occt_draw_4_3_24 vstate
2007 vstate [-entities] [-hasSelected] [name1] ... [nameN]
2010 Reports show/hidden state for selected or named objects:
2011 * *entities* -- prints low-level information about detected entities;
2012 * *hasSelected* -- prints 1 if the context has a selected shape and 0 otherwise.
2014 @subsubsection occt_draw_4_3_25 vraytrace
2021 Turns on/off ray tracing renderer.
2023 @subsubsection occt_draw_4_3_26 vrenderparams
2027 vrenderparams [-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}]
2033 Manages rendering parameters:
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
2046 Unlike *vcaps*, these parameters dramatically change visual properties.
2047 The command is intended to control presentation quality depending on hardware capabilities and performance.
2056 vrenderparams -shadows 1 -reflections 1 -fsaa 1
2058 @subsubsection occt_draw_4_3_27 vshaderprog
2062 'vshaderprog [name] pathToVertexShader pathToFragmentShader'
2063 or 'vshaderprog [name] off' to disable GLSL program
2064 or 'vshaderprog [name] phong' to enable per-pixel lighting calculations
2067 Enables rendering using a shader program.
2069 @subsubsection occt_draw_4_3_28 vsetcolorbg
2076 Sets background color.
2081 vsetcolorbg 200 0 200
2084 @subsection occt_draw_4_4 AIS viewer -- object commands
2086 @subsubsection occt_draw_4_4_1 vtrihedron
2090 vtrihedron name [-dispMode {wf|sh|wireframe|shading}]
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]
2110 Creates a new *AIS_Trihedron* object or changes existing trihedron. If no argument is set, the default trihedron (0XYZ) is created.
2117 vtrihedron t2 -dispmode shading -origin -200 -200 -300
2118 vtrihedron t2 -color XAxis Quantity_NOC_RED
2119 vtrihedron t2 -color YAxis Quantity_NOC_GREEN
2120 vtrihedron t2 -color ZAxis|Origin Quantity_NOC_BLUE1
2123 @subsubsection occt_draw_4_4_2 vplanetri
2130 Creates a plane from a trihedron selection. If no arguments are set, the default plane is created.
2133 @subsubsection occt_draw_4_4_3 vsize
2140 Changes 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.
2146 vtrihedron tr2 0 0 0 1 0 0 1 0 0
2150 @subsubsection occt_draw_4_4_4 vaxis
2154 vaxis name [Xa Ya Za Xb Yb Zb]
2157 Creates an axis. If the values are not defined, an axis is created by interactive selection of two vertices or one edge
2163 vaxis axe1 0 0 0 1 0 0
2166 @subsubsection occt_draw_4_4_5 vaxispara
2173 Creates an axis by interactive selection of an edge and a vertex.
2175 @subsubsection occt_draw_4_4_6 vaxisortho
2182 Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge.
2184 @subsubsection occt_draw_4_4_7 vpoint
2188 vpoint name [Xa Ya Za]
2191 Creates 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).
2199 @subsubsection occt_draw_4_4_8 vplane
2203 vplane name [AxisName] [PointName]
2204 vplane name [PointName] [PointName] [PointName]
2205 vplane name [PlaneName] [PointName]
2208 Creates a plane from named or interactively selected entities.
2217 vaxis axe1 0 0 0 0 0 1
2219 vplane plane1 axe1 p1
2222 @subsubsection occt_draw_4_4_9 vplanepara
2229 Creates a plane from interactively selected vertex and face.
2231 @subsubsection occt_draw_4_4_10 vplaneortho
2238 Creates a plane from interactive selected face and coplanar edge.
2240 @subsubsection occt_draw_4_4_11 vline
2244 vline name [PointName] [PointName]
2245 vline name [Xa Ya Za Xb Yb Zb]
2248 Creates a line from coordinates, named or interactively selected vertices.
2257 vline line2 0 0 0 50 0 1
2260 @subsubsection occt_draw_4_4_12 vcircle
2264 vcircle name [PointName PointName PointName IsFilled]
2265 vcircle name [PlaneName PointName Radius IsFilled]
2268 Creates a circle from named or interactively selected entities. Parameter IsFilled is defined as 0 or 1.
2277 vcircle circle1 p1 p2 p3 1
2280 @subsubsection occt_draw_4_4_13 vtri2d
2287 Creates a plane with a 2D trihedron from an interactively selected face.
2289 @subsubsection occt_draw_4_4_14 vselmode
2293 vselmode [object] mode_number is_turned_on=(1|0)
2296 Sets the selection mode for an object. If the object value is not defined, the selection mode is set for all displayed objects.
2297 *Mode_number* is a non-negative integer encoding different interactive object classes.
2298 For shapes the following *mode_number* values are allowed:
2309 * 1 if mode is to be switched on
2310 * 0 if mode is to be switched off
2318 vtriangle triangle1 p1 p2 p3
2321 @subsubsection occt_draw_4_4_15 vconnect
2325 vconnect vconnect name Xo Yo Zo object1 object2 ... [color=NAME]
2328 Creates *AIS_ConnectedInteractive* object from the input object and location and displays it.
2335 vsegment segment p1 p2
2336 restore CrankArm.brep obj
2338 vconnect new obj 100100100 1 0 0 0 0 1
2341 @subsubsection occt_draw_4_4_16 vtriangle
2345 vtriangle name PointName PointName PointName
2348 Creates and displays a filled triangle from named points.
2356 vtriangle triangle1 p1 p2 p3
2359 @subsubsection occt_draw_4_4_17 vsegment
2363 vsegment name PointName PointName
2366 Creates and displays a segment from named points.
2373 vsegment segment p1 p2
2376 @subsubsection occt_draw_4_4_18 vpointcloud
2380 vpointcloud name shape [-randColor] [-normals] [-noNormals]
2383 Creates an interactive object for an arbitrary set of points from the triangulated shape.
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.
2390 vpointcloud name x y z r npts {surface|volume} [-randColor] [-normals] [-noNormals]
2392 Creates an arbitrary set of points (npts) randomly distributed on a spheric surface or within a spheric volume (x y z r).
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.
2401 vpointcloud pc 0 0 0 100 100000 surface -randColor
2405 @subsubsection occt_draw_4_4_19 vclipplane
2409 vclipplane maxplanes <view_name> -- gets plane limit for the view.
2410 vclipplane create <plane_name> -- creates a new plane.
2411 vclipplane delete <plane_name> -- deletes a plane.
2412 vclipplane clone <source_plane> <plane_name> -- clones the plane definition.
2413 vclipplane set/unset <plane_name> object <object list> -- sets/unsets the plane for an IO.
2414 vclipplane set/unset <plane_name> view <view list> -- sets/unsets plane for a view.
2415 vclipplane change <plane_name> on/off -- turns clipping on/off.
2416 vclipplane change <plane_name> equation <a> <b> <c> <d> -- changes plane equation.
2417 vclipplane change <plane_name> capping on/off -- turns capping on/off.
2418 vclipplane change <plane_name> capping color <r> <g> <b> -- sets color.
2419 vclipplane change <plane name> capping texname <texture> -- sets texture.
2420 vclipplane change <plane_name> capping texscale <sx> <sy> -- sets texture scale.
2421 vclipplane change <plane_name> capping texorigin <tx> <ty> -- sets texture origin.
2422 vclipplane change <plane_name> capping texrotate <angle> -- sets texture rotation.
2423 vclipplane change <plane_name> capping hatch on/off/<id> -- sets hatching mask.
2426 Manages clipping planes
2431 vclipplane create pln1
2432 vclipplane change pln1 equation 1 0 0 -0.1
2433 vclipplane set pln1 view Driver1/Viewer1/View1
2442 @subsubsection occt_draw_4_4_20 vdimension
2446 vdimension 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]
2451 [-flyout FloatValue -extension FloatValue]
2452 [-autovalue] [-value CustomRealValue] [-textvalue CustomTextValue]
2453 [-dispunits DisplayUnitsString]
2454 [-modelunits ModelUnitsString] [-showunits | -hideunits]
2457 Builds angle, length, radius or diameter dimension interactive object **name**.
2459 **Attension:** length dimension can't be built without working plane.
2466 vdimension dim1 -length -plane xoy -shapes p1 p2
2469 vdimension dim2 -angle -shapes p1 p2 p3
2471 vcircle circle p1 p2 p3 0
2472 vdimension dim3 -radius -shapes circle
2476 @subsubsection occt_draw_4_4_21 vdimparam
2480 vdimparam 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]
2488 [-value CustomRealValue]
2489 [-textvalue CustomTextValue]
2490 [-dispunits DisplayUnitsString]
2491 [-modelunits ModelUnitsString]
2492 [-showunits | -hideunits]
2495 Sets parameters for angle, length, radius and diameter dimension **name**.
2502 vdimension dim1 -length -plane xoy -shapes p1 p2
2503 vdimparam dim1 -flyout -15 -arrowlength 4 -showunits -value 10
2505 vdimparam dim1 -textvalue "w_1"
2506 vdimparam dim1 -autovalue
2509 @subsubsection occt_draw_4_4_22 vdimangleparam
2513 vangleparam name [-type interior|exterior]
2514 [-showarrow first|second|both|none]
2517 Sets parameters for angle dimension **name**.
2525 vdimension dim1 -angle -plane xoy -shapes p1 p2 p3
2527 vangleparam dim1 -type exterior -showarrow first
2530 @subsubsection occt_draw_4_4_23 vmovedim
2534 vmovedim [name] [x y z]
2537 Moves picked or named (if **name** parameter is defined) dimension
2538 to picked mouse position or input point with coordinates **x**,**y**,**z**.
2539 Text label of dimension **name** is moved to position, another parts of dimension
2547 vdimension dim1 -length -plane xoy -shapes p1 p2
2548 vmovedim dim1 -10 30 0
2552 @subsection occt_draw_4_5 AIS viewer -- Mesh Visualization Service
2554 **MeshVS** (Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.
2556 @subsubsection occt_draw_4_5_1 meshfromstl
2560 meshfromstl meshname file
2563 Creates a *MeshVS_Mesh* object based on STL file data. The object will be displayed immediately.
2567 meshfromstl mesh myfile.stl
2570 @subsubsection occt_draw_4_5_2 meshdispmode
2574 meshdispmode meshname displaymode
2577 Changes the display mode of object **meshname**. The **displaymode** is integer, which can be:
2578 * *1* for *wireframe*,
2579 * *2* for *shading* mode, or
2580 * *3* for *shrink* mode.
2585 meshfromstl mesh myfile.stl
2589 @subsubsection occt_draw_4_5_3 meshselmode
2593 meshselmode meshname selectionmode
2596 Changes the selection mode of object **meshname**. The *selectionmode* is integer OR-combination of mode flags. The basic flags are the following:
2597 * *1* -- node selection;
2598 * *2* -- 0D elements (not supported in STL);
2599 * *4* -- links (not supported in STL);
2605 meshfromstl mesh myfile.stl
2609 @subsubsection occt_draw_4_5_4 meshshadcolor
2613 meshshadcolor meshname red green blue
2616 Changes the face interior color of object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
2621 meshfromstl mesh myfile.stl
2622 meshshadcolormode mesh 0.5 0.5 0.5
2625 @subsubsection occt_draw_4_5_5 meshlinkcolor
2629 meshlinkcolor meshname red green blue
2632 Changes the color of face borders for object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
2637 meshfromstl mesh myfile.stl
2638 meshlinkcolormode mesh 0.5 0.5 0.5
2641 @subsubsection occt_draw_4_5_6 meshmat
2645 meshmat meshname material
2648 Changes the material of object **meshname**.
2650 *material* is represented with an integer value as follows (equivalent to enumeration *Graphic3d_NameOfMaterial*):
2661 * *10 -- SHINY_PLASTIC,*
2663 * *12 -- METALIZED,*
2666 * *15 -- ALUMINIUM,*
2671 * *20 -- UserDefined*
2676 meshfromstl mesh myfile.stl
2680 @subsubsection occt_draw_4_5_7 meshshrcoef
2684 meshshrcoef meshname shrinkcoefficient
2687 Changes 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.
2692 meshfromstl mesh myfile.stl
2693 meshshrcoef mesh 0.05
2696 @subsubsection occt_draw_4_5_8 meshshow
2703 Displays **meshname** in the viewer (if it is erased).
2708 meshfromstl mesh myfile.stl
2712 @subsubsection occt_draw_4_5_9 meshhide
2719 Hides **meshname** in the viewer.
2724 meshfromstl mesh myfile.stl
2728 @subsubsection occt_draw_4_5_10 meshhidesel
2732 meshhidesel meshname
2735 Hides only selected entities. The other part of **meshname** remains visible.
2737 @subsubsection occt_draw_4_5_11 meshshowsel
2741 meshshowsel meshname
2744 Shows only selected entities. The other part of **meshname** becomes invisible.
2746 @subsubsection occt_draw_4_5_12 meshshowall
2750 meshshowall meshname
2753 Changes the state of all entities to visible for **meshname**.
2755 @subsubsection occt_draw_4_5_13 meshdelete
2762 Deletes MeshVS_Mesh object **meshname**.
2767 meshfromstl mesh myfile.stl
2771 @subsection occt_draw_4_6 VIS Viewer commands
2773 A specific plugin with alias *VIS* should be loaded to have access to VIS functionality in DRAW Test Harness:
2779 @subsubsection occt_draw_4_6_1 ivtkinit
2786 Creates a window for VTK viewer.
2788 @figure{/user_guides/draw_test_harness/images/draw_image001.png}
2790 @subsubsection occt_draw_4_6_2 ivtkdisplay
2794 ivtkdisplay name1 [name2] …[name n]
2797 Displays named objects.
2807 @figure{/user_guides/draw_test_harness/images/draw_image002.png}
2809 @subsubsection occt_draw_4_6_3 ivtkerase
2813 ivtkerase [name1] [name2] … [name n]
2816 Erases named objects. If no arguments are passed, erases all displayed objects.
2829 # erase only the cylinder
2831 # erase the sphere and the cone
2835 @subsubsection occt_draw_4_6_4 ivtkfit
2842 Automatic zoom/panning.
2844 @subsubsection occt_draw_4_6_5 ivtkdispmode
2848 ivtksetdispmode [name] {0|1}
2851 Sets display mode for a named object. If no arguments are passed, sets the given display mode for all displayed objects
2852 The possible modes are: 0 (WireFrame) and 1 (Shading).
2861 # set shading mode for the cone
2865 @figure{/user_guides/draw_test_harness/images/draw_image003.png}
2867 @subsubsection occt_draw_4_6_6 ivtksetselmode
2871 ivtksetselmode [name] mode {0|1}
2874 Sets selection mode for a named object. If no arguments are passed, sets the given selection mode for all the displayed objects.
2879 # load a shape from file
2880 restore CrankArm.brep a
2881 # display the loaded shape
2883 # set the face selection mode
2884 ivtksetselmode a 4 1
2887 @figure{/user_guides/draw_test_harness/images/draw_image004.png}
2889 @subsubsection occt_draw_4_6_7 ivtkmoveto
2896 Imitates mouse cursor moving to point with the given display coordinates **x**,**y**.
2906 @subsubsection occt_draw_4_6_8 ivtkselect
2913 Imitates mouse cursor moving to point with the given display coordinates and performs selection at this point.
2923 @subsubsection occt_draw_4_6_9 ivtkdump
2927 ivtkdump *filename* [buffer={rgb|rgba|depth}] [width height] [stereoproj={L|R}]
2930 Dumps the contents of VTK viewer to image. It supports:
2931 * dumping in different raster graphics formats: PNG, BMP, JPEG, TIFF or PNM.
2932 * dumping of different buffers: RGB, RGBA or depth buffer.
2933 * defining of image sizes (width and height in pixels).
2934 * dumping of stereo projections (left or right).
2941 ivtkdump D:/ConeSnapshot.png rgb 768 768
2944 @subsubsection occt_draw_4_6_10 ivtkbgcolor
2949 ivtkbgcolor r g b [r2 g2 b2]
2952 Sets uniform background color or gradient background if second triple of parameters is set. Color parameters r,g,b have to be chosen in the interval [0..255].
2957 ivtkbgcolor 200 220 250
2960 @figure{/user_guides/draw_test_harness/images/draw_image005.png}
2963 ivtkbgcolor 10 30 80 255 255 255
2966 @figure{/user_guides/draw_test_harness/images/draw_image006.png}
2969 @section occt_draw_5 OCAF commands
2972 This chapter contains a set of commands for Open CASCADE Technology Application Framework (OCAF).
2975 @subsection occt_draw_5_1 Application commands
2978 @subsubsection occt_draw_5_1_1 NewDocument
2982 NewDocument docname [format]
2985 Creates a new **docname** document with MDTV-Standard or described format.
2989 # Create new document with default (MDTV-Standard) format
2992 # Create new document with BinOcaf format
2993 NewDocument D2 BinOcaf
2996 @subsubsection occt_draw_5_1_2 IsInSession
3003 Returns *0*, if **path** document is managed by the application session, *1* -- otherwise.
3007 IsInSession /myPath/myFile.std
3010 @subsubsection occt_draw_5_1_3 ListDocuments
3017 Makes a list of documents handled during the session of the application.
3020 @subsubsection occt_draw_5_1_4 Open
3024 Open path docname [-stream]
3027 Retrieves the document of file **docname** in the path **path**. Overwrites the document, if it is already in session.
3029 option <i>-stream</i> activates usage of alternative interface of OCAF persistence working with C++ streams instead of file names.
3033 Open /myPath/myFile.std D
3036 @subsubsection occt_draw_5_1_5 Close
3043 Closes **docname** document. The document is no longer handled by the applicative session.
3050 @subsubsection occt_draw_5_1_6 Save
3057 Saves **docname** active document.
3064 @subsubsection occt_draw_5_1_7 SaveAs
3068 SaveAs docname path [-stream]
3071 Saves the active document in the file **docname** in the path **path**. Overwrites the file if it already exists.
3073 option <i>-stream</i> activates usage of alternative interface of OCAF persistence working with C++ streams instead of file names.
3077 SaveAs D /myPath/myFile.std
3080 @subsection occt_draw_5_2 Basic commands
3082 @subsubsection occt_draw_5_2_1 Label
3090 Creates the label expressed by <i>\<entry\></i> if it does not exist.
3097 @subsubsection occt_draw_5_2_2 NewChild
3102 NewChild docname [taggerlabel = Root label]
3104 Finds (or creates) a *TagSource* attribute located at father label of <i>\<taggerlabel\></i> and makes a new child label.
3108 # Create new child of root label
3111 # Create new child of existing label
3116 @subsubsection occt_draw_5_2_3 Children
3120 Children docname label
3122 Returns the list of attributes of label.
3129 @subsubsection occt_draw_5_2_4 ForgetAll
3133 ForgetAll docname label
3135 Forgets all attributes of the label.
3143 @subsubsection occt_draw_5_3 Application commands
3145 @subsubsection occt_draw_5_3_1 Main
3152 Returns the main label of the framework.
3159 @subsubsection occt_draw_5_3_2 UndoLimit
3163 UndoLimit docname [value=0]
3167 Sets the limit on the number of Undo Delta stored. **0** will disable Undo on the document. A negative *value* means that there is no limit. Note that by default Undo is disabled. Enabling it will take effect with the next call to *NewCommand*. Of course, this limit is the same for Redo
3174 @subsubsection occt_draw_5_3_3 Undo
3178 Undo docname [value=1]
3181 Undoes **value** steps.
3188 @subsubsection occt_draw_5_3_4 Redo
3192 Redo docname [value=1]
3195 Redoes **value** steps.
3202 @subsubsection occt_draw_5_3_5 OpenCommand
3209 Opens a new command transaction.
3216 @subsubsection occt_draw_5_3_6 CommitCommand
3220 CommitCommand docname
3223 Commits the Command transaction.
3230 @subsubsection occt_draw_5_3_7 NewCommand
3237 This is a shortcut for Commit and Open transaction.
3244 @subsubsection occt_draw_5_3_8 AbortCommand
3248 AbortCommand docname
3251 Aborts the Command transaction.
3258 @subsubsection occt_draw_5_3_9 Copy
3262 Copy docname entry Xdocname Xentry
3265 Copies the contents of *entry* to *Xentry*. No links are registered.
3272 @subsubsection occt_draw_5_3_10 UpdateLink
3276 UpdateLink docname [entry]
3279 Updates external reference set at *entry*.
3286 @subsubsection occt_draw_5_3_11 CopyWithLink
3290 CopyWithLink docname entry Xdocname Xentry
3293 Aborts the Command transaction.
3294 Copies the content of *entry* to *Xentry*. The link is registered with an *Xlink* attribute at *Xentry* label.
3298 CopyWithLink D1 0:2 D2 0:4
3301 @subsubsection occt_draw_5_3_12 UpdateXLinks
3305 UpdateXLinks docname entry
3308 Sets modifications on labels impacted by external references to the *entry*. The *document* becomes invalid and must be recomputed
3315 @subsubsection occt_draw_5_3_13 DumpDocument
3319 DumpDocument docname
3322 Displays parameters of *docname* document.
3330 @subsection occt_draw_5_4 Data Framework commands
3333 @subsubsection occt_draw_5_4_1 MakeDF
3340 Creates a new data framework.
3347 @subsubsection occt_draw_5_4_2 ClearDF
3354 Clears a data framework.
3361 @subsubsection occt_draw_5_4_3 CopyDF
3365 CopyDF dfname1 entry1 [dfname2] entry2
3368 Copies a data framework.
3375 @subsubsection occt_draw_5_4_4 CopyLabel
3379 CopyLabel dfname fromlabel tolablel
3386 CopyLabel D1 0:2 0:4
3389 @subsubsection occt_draw_5_4_5 MiniDumpDF
3396 Makes a mini-dump of a data framework.
3403 @subsubsection occt_draw_5_4_6 XDumpDF
3410 Makes an extended dump of a data framework.
3417 @subsection occt_draw_5_5 General attributes commands
3420 @subsubsection occt_draw_5_5_1 SetInteger
3424 SetInteger dfname entry value
3427 Finds or creates an Integer attribute at *entry* label and sets *value*.
3431 SetInteger D 0:2 100
3434 @subsubsection occt_draw_5_5_2 GetInteger
3438 GetInteger dfname entry [drawname]
3441 Gets a value of an Integer attribute at *entry* label and sets it to *drawname* variable, if it is defined.
3445 GetInteger D 0:2 Int1
3448 @subsubsection occt_draw_5_5_3 SetReal
3452 SetReal dfname entry value
3455 Finds or creates a Real attribute at *entry* label and sets *value*.
3462 @subsubsection occt_draw_5_5_4 GetReal
3466 GetReal dfname entry [drawname]
3469 Gets a value of a Real attribute at *entry* label and sets it to *drawname* variable, if it is defined.
3476 @subsubsection occt_draw_5_5_5 SetIntArray
3480 SetIntArray dfname entry lower upper value1 value2 …
3483 Finds or creates an IntegerArray attribute at *entry* label with lower and upper bounds and sets **value1*, *value2*...
3487 SetIntArray D 0:2 1 4 100 200 300 400
3490 @subsubsection occt_draw_5_5_6 GetIntArray
3494 GetIntArray dfname entry
3497 Gets a value of an *IntegerArray* attribute at *entry* label.
3504 @subsubsection occt_draw_5_5_7 SetRealArray
3508 SetRealArray dfname entry lower upper value1 value2 …
3511 Finds or creates a RealArray attribute at *entry* label with lower and upper bounds and sets *value1*, *value2*…
3515 GetRealArray D 0:2 1 4 100. 200. 300. 400.
3518 @subsubsection occt_draw_5_5_8 GetRealArray
3522 GetRealArray dfname entry
3525 Gets a value of a RealArray attribute at *entry* label.
3532 @subsubsection occt_draw_5_5_9 SetComment
3536 SetComment dfname entry value
3539 Finds or creates a Comment attribute at *entry* label and sets *value*.
3543 SetComment D 0:2 "My comment"
3546 @subsubsection occt_draw_5_5_10 GetComment
3550 GetComment dfname entry
3553 Gets a value of a Comment attribute at *entry* label.
3560 @subsubsection occt_draw_5_5_11 SetExtStringArray
3564 SetExtStringArray dfname entry lower upper value1 value2 …
3567 Finds or creates an *ExtStringArray* attribute at *entry* label with lower and upper bounds and sets *value1*, *value2*…
3571 SetExtStringArray D 0:2 1 3 *string1* *string2* *string3*
3574 @subsubsection occt_draw_5_5_12 GetExtStringArray
3578 GetExtStringArray dfname entry
3581 Gets a value of an ExtStringArray attribute at *entry* label.
3585 GetExtStringArray D 0:2
3588 @subsubsection occt_draw_5_5_13 SetName
3592 SetName dfname entry value
3595 Finds or creates a Name attribute at *entry* label and sets *value*.
3599 SetName D 0:2 *My name*
3602 @subsubsection occt_draw_5_5_14 GetName
3606 GetName dfname entry
3609 Gets a value of a Name attribute at *entry* label.
3616 @subsubsection occt_draw_5_5_15 SetReference
3620 SetReference dfname entry reference
3623 Creates a Reference attribute at *entry* label and sets *reference*.
3627 SetReference D 0:2 0:4
3630 @subsubsection occt_draw_5_5_16 GetReference
3634 GetReference dfname entry
3637 Gets a value of a Reference attribute at *entry* label.
3644 @subsubsection occt_draw_5_5_17 SetUAttribute
3648 SetUAttribute dfname entry localGUID
3651 Creates a UAttribute attribute at *entry* label with *localGUID*.
3655 set localGUID "c73bd076-22ee-11d2-acde-080009dc4422"
3656 SetUAttribute D 0:2 ${localGUID}
3659 @subsubsection occt_draw_5_5_18 GetUAttribute
3663 GetUAttribute dfname entry loacalGUID
3666 Finds a *UAttribute* at *entry* label with *localGUID*.
3670 set localGUID "c73bd076-22ee-11d2-acde-080009dc4422"
3671 GetUAttribute D 0:2 ${localGUID}
3674 @subsubsection occt_draw_5_5_19 SetFunction
3678 SetFunction dfname entry ID failure
3681 Finds or creates a *Function* attribute at *entry* label with driver ID and *failure* index.
3685 set ID "c73bd076-22ee-11d2-acde-080009dc4422"
3686 SetFunction D 0:2 ${ID} 1
3689 @subsubsection occt_draw_5_5_20 GetFunction
3693 GetFunction dfname entry ID failure
3696 Finds a Function attribute at *entry* label and sets driver ID to *ID* variable and failure index to *failure* variable.
3700 GetFunction D 0:2 ID failure
3703 @subsubsection occt_draw_5_5_21 NewShape
3707 NewShape dfname entry [shape]
3710 Finds or creates a Shape attribute at *entry* label. Creates or updates the associated *NamedShape* attribute by *shape* if *shape* is defined.
3718 @subsubsection occt_draw_5_5_22 SetShape
3722 SetShape dfname entry shape
3725 Creates or updates a *NamedShape* attribute at *entry* label by *shape*.
3733 @subsubsection occt_draw_5_5_23 GetShape
3737 GetShape2 dfname entry shape
3740 Sets a shape from NamedShape attribute associated with *entry* label to *shape* draw variable.
3747 @subsection occt_draw_5_6 Geometric attributes commands
3750 @subsubsection occt_draw_5_6_1 SetPoint
3754 SetPoint dfname entry point
3757 Finds or creates a Point attribute at *entry* label and sets *point* as generated in the associated *NamedShape* attribute.
3765 @subsubsection occt_draw_5_6_2 GetPoint
3769 GetPoint dfname entry [drawname]
3772 Gets a vertex from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined.
3779 @subsubsection occt_draw_5_6_3 SetAxis
3783 SetAxis dfname entry axis
3786 Finds or creates an Axis attribute at *entry* label and sets *axis* as generated in the associated *NamedShape* attribute.
3790 line l 10 20 30 100 200 300
3794 @subsubsection occt_draw_5_6_4 GetAxis
3798 GetAxis dfname entry [drawname]
3801 Gets a line from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined.
3808 @subsubsection occt_draw_5_6_5 SetPlane
3812 SetPlane dfname entry plane
3815 Finds or creates a Plane attribute at *entry* label and sets *plane* as generated in the associated *NamedShape* attribute.
3819 plane pl 10 20 30 -1 0 0
3823 @subsubsection occt_draw_5_6_6 GetPlane
3827 GetPlane dfname entry [drawname]
3830 Gets a plane from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined.
3837 @subsubsection occt_draw_5_6_7 SetGeometry
3841 SetGeometry dfname entry [type] [shape]
3844 Creates a Geometry attribute at *entry* label and sets *type* and *shape* as generated in the associated *NamedShape* attribute if they are defined. *type* must be one of the following: *any, pnt, lin, cir, ell, spl, pln, cyl*.
3849 SetGeometry D 0:2 pnt p
3852 @subsubsection occt_draw_5_6_8 GetGeometryType
3856 GetGeometryType dfname entry
3859 Gets a geometry type from Geometry attribute at *entry* label.
3863 GetGeometryType D 0:2
3866 @subsubsection occt_draw_5_6_9 SetConstraint
3870 SetConstraint dfname entry keyword geometrie [geometrie …]
3871 SetConstraint dfname entry "plane" geometrie
3872 SetConstraint dfname entry "value" value
3875 1. Creates a Constraint attribute at *entry* label and sets *keyword* constraint between geometry(ies).
3876 *keyword* must be one of the following:
3877 *rad, dia, minr, majr, tan, par, perp, concentric, equal, dist, angle, eqrad, symm, midp, eqdist, fix, rigid,* or *from, axis, mate, alignf, aligna, axesa, facesa, round, offset*
3878 2. Sets plane for the existing constraint.
3879 3. Sets value for the existing constraint.
3883 SetConstraint D 0:2 "value" 5
3886 @subsubsection occt_draw_5_6_10 GetConstraint
3890 GetConstraint dfname entry
3893 Dumps a Constraint attribute at *entry* label
3900 @subsubsection occt_draw_5_6_11 SetVariable
3904 SetVariable dfname entry isconstant(0/1) units
3907 Creates a Variable attribute at *entry* label and sets *isconstant* flag and *units* as a string.
3911 SetVariable D 0:2 1 "mm"
3914 @subsubsection occt_draw_5_6_12 GetVariable
3918 GetVariable dfname entry isconstant units
3921 Gets an *isconstant* flag and units of a Variable attribute at *entry* label.
3925 GetVariable D 0:2 isconstant units
3926 puts "IsConstant=${isconstant}"
3927 puts "Units=${units}"
3930 @subsection occt_draw_5_7 Tree attributes commands
3933 @subsubsection occt_draw_5_7_1 RootNode
3937 RootNode dfname treenodeentry [ID]
3940 Returns the ultimate father of *TreeNode* attribute identified by its *treenodeentry* and its *ID* (or default ID, if *ID* is not defined).
3943 @subsubsection occt_draw_5_7_2 SetNode
3947 SetNode dfname treenodeentry [ID]
3950 Creates a *TreeNode* attribute on the *treenodeentry* label with its tree *ID* (or assigns a default ID, if the *ID* is not defined).
3953 @subsubsection occt_draw_5_7_3 AppendNode
3957 AppendNode dfname fatherentry childentry [fatherID]
3961 Inserts a *TreeNode* attribute with its tree *fatherID* (or default ID, if *fatherID* is not defined) on *childentry* as last child of *fatherentry*.
3966 @subsubsection occt_draw_5_7_4 PrependNode
3970 PrependNode dfname fatherentry childentry [fatherID]
3974 Inserts a *TreeNode* attribute with its tree *fatherID* (or default ID, if *fatherID* is not defined) on *childentry* as first child of *fatherentry*.
3977 @subsubsection occt_draw_5_7_5 InsertNodeBefore
3981 InsertNodeBefore dfname treenodeentry beforetreenode [ID]
3984 Inserts a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) *beforetreenode* before *treenodeentry*.
3987 @subsubsection occt_draw_5_7_6 InsertNodeAfter
3991 InsertNodeAfter dfname treenodeentry aftertreenode [ID]
3994 Inserts a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) *aftertreenode* after *treenodeentry*.
3997 @subsubsection occt_draw_5_7_7 DetachNode
4001 DetachNode dfname treenodeentry [ID]
4004 Removes a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) from *treenodeentry*.
4007 @subsubsection occt_draw_5_7_8 ChildNodeIterate
4011 ChildNodeIterate dfname treenodeentry alllevels(0/1) [ID]
4015 Iterates on the tree of *TreeNode* attributes with tree *ID* (or default ID, if *ID* is not defined). If *alllevels* is set to *1* it explores not only the first, but all the sub Step levels.
4031 AppendNode D 0:2 0:4
4032 AppendNode D 0:2 0:5
4033 PrependNode D 0:4 0:3
4034 PrependNode D 0:4 0:8
4035 PrependNode D 0:4 0:9
4037 InsertNodeBefore D 0:5 0:6
4038 InsertNodeAfter D 0:4 0:7
4044 ChildNodeIterate D 0:2 1
4054 # List only first levels
4055 ChildNodeIterate D 0:2 1
4063 @subsubsection occt_draw_5_7_9 InitChildNodeIterator
4067 InitChildNodeIterator dfname treenodeentry alllevels(0/1) [ID]
4071 Initializes the iteration on the tree of *TreeNode* attributes with tree *ID* (or default ID, if *ID* is not defined). If *alllevels* is set to *1* it explores not only the first, but also all sub Step levels.
4075 InitChildNodeIterate D 0:5 1
4077 for {set i 1} {$i < 100} {incr i} {
4078 if {[ChildNodeMore] == *TRUE*} {
4079 puts *Tree node = [ChildNodeValue]*
4084 puts "aChildNumber=$aChildNumber"
4087 @subsubsection occt_draw_5_7_10 ChildNodeMore
4094 Returns TRUE if there is a current item in the iteration.
4097 @subsubsection occt_draw_5_7_11 ChildNodeNext
4104 Moves to the next Item.
4107 @subsubsection occt_draw_5_7_12 ChildNodeValue
4114 Returns the current treenode of *ChildNodeIterator*.
4117 @subsubsection occt_draw_5_7_13 ChildNodeNextBrother
4121 ChildNodeNextBrother
4124 Moves to the next *Brother*. If there is none, goes up. This method is interesting only with *allLevels* behavior.
4127 @subsection occt_draw_5_8 Standard presentation commands
4130 @subsubsection occt_draw_5_8_1 AISInitViewer
4134 AISInitViewer docname
4137 Creates and sets *AISViewer* attribute at root label, creates AIS viewer window.
4144 @subsubsection occt_draw_5_8_2 AISRepaint
4151 Updates the AIS viewer window.
4158 @subsubsection occt_draw_5_8_3 AISDisplay
4162 AISDisplay docname entry [not_update]
4165 Displays a presantation of *AISobject* from *entry* label in AIS viewer. If *not_update* is not defined then *AISobject* is recomputed and all visualization settings are applied.
4172 @subsubsection occt_draw_5_8_4 AISUpdate
4176 AISUpdate docname entry
4179 Recomputes a presentation of *AISobject* from *entry* label and applies the visualization setting in AIS viewer.
4186 @subsubsection occt_draw_5_8_5 AISErase
4190 AISErase docname entry
4193 Erases *AISobject* of *entry* label in AIS viewer.
4200 @subsubsection occt_draw_5_8_6 AISRemove
4204 AISRemove docname entry
4207 Erases *AISobject* of *entry* label in AIS viewer, then *AISobject* is removed from *AIS_InteractiveContext*.
4214 @subsubsection occt_draw_5_8_7 AISSet