CDL guide finalized.
Brep WP added
Added white-papers and 2 dev guides in the generated documentation structure.
White-papers + 2 developer guides + Draw UG finalized.
Visualization guide finalized.
Fixes for bugs 24205, 23737 and 24021
user_guides/tobj/tobj.md
user_guides/shape_healing/shape_healing.md
user_guides/draw_test_harness.md
+user_guides/brep_wp/brep_wp.md
+user_guides/ocaf_functionmechanism_wp/ocaf_functionmechanism_wp.md
+user_guides/ocaf_tree_wp/ocaf_tree_wp.md
+user_guides/ocaf_wp/ocaf_wp.md
+user_guides/voxels_wp/voxels_wp.md
dev_guides/dev_guides.md
dev_guides/contribution/coding_rules.md
dev_guides/tests/tests.md
dev_guides/documentation/documentation.md
dev_guides/wok/wok.md
+dev_guides/contribution_workflow/contribution_workflow.md
+dev_guides/git_guide/git_guide.md
+
dev_guides/building/building.md
dev_guides/building/3rdparty/3rdparty_windows.md
Please note that CDL is considered as obsolete and is to be removed in one of future releases of OCCT.
-@section occt_1819379591_354121062 CDL and Application Architecture
+@section occt_cdl_1 CDL and Application Architecture
CDL is the component definition language of the Open CASCADE Technology (**OCCT**) programming platform. Some components, which CDL allows you to create, are specific to OCCT application architecture. These and other components, which you can define using CDL include the following:
* Schema
* Executable
* Client.
+
A **class** is the fundamental software component in object-oriented development. Because of a very large number of resources used in large-scale applications, the **class** itself is too small to be used as a basic management unit.
-So, while the class is the basic data component defined in CDL, this language also provides a way to group classes, **enumerations**, and **exceptions **together – the **package**. A package groups together a number of classes, which have semantic links. For example, a geometry package would contain Point, Line, and Circle classes. A package can also contain enumerations, exceptions, and package methods. In practice, a class name is prefixed with the name of its package e.g. Geom_Circle.
+So, while the class is the basic data component defined in CDL, this language also provides a way to group classes, **enumerations**, and **exceptions** together – the **package**. A package groups together a number of classes, which have semantic links. For example, a geometry package would contain Point, Line, and Circle classes. A package can also contain enumerations, exceptions, and package methods. In practice, a class name is prefixed with the name of its package e.g. *Geom_Circle*.
Using the services described in the **packages**, you can construct an **executable**. You can also group together services provided by **packages**.
To save data in a file, you need to define persistent classes. Then, you group these classes in a schema, which provides the necessary read/write tools.
- @image html /dev_guides/cdl/images/cdl_image003.png
- @image latex /dev_guides/cdl/images/cdl_image003.png
-
-Figure 1. Building an Open CASCADE Technology application
-@section occt_1819379591_986437237 2. Introduction to CDL
-@subsection occt_1819379591_98643723721 Purposes of the Language
+@image html /dev_guides/cdl/images/cdl_image003.png "Building an Open CASCADE Technology application"
+@image latex /dev_guides/cdl/images/cdl_image003.png "Building an Open CASCADE Technology application"
+
+@section occt_cdl_2 Introduction to CDL
+@subsection occt_cdl_2_1 Purposes of the Language
+
You can use CDL to **define** **data** in the Open CASCADE Technology environment. CDL allows you to define various kinds of data types supporting the application architecture and development methodology, which you envision. CDL is neither an analysis formalism (e.g. Booch methodology) nor a data manipulation language (e.g. C++).
You use CDL in the **design** **phase** of a development process to define a set of software components which best model the concepts stated in the application specification.
- @image html /dev_guides/cdl/images/cdl_image004.png
- @image latex /dev_guides/cdl/images/cdl_image004.png
+@image html /dev_guides/cdl/images/cdl_image004.png "The Development Process"
+@image latex /dev_guides/cdl/images/cdl_image004.png "The Development Process"
-Figure 2. The Development Process
-From a structural point of view, CDL is an object-oriented language. It is centered on the notion of the **class **- a data type, which represents an elementary concept. CDL offers various means of organizing classes, mostly under the fundamental form of **packages**. A package contains a set of classes, which share some semantic relationship. This greatly simplifies your task of managing individual classes when confronted with a very large number of them.
+From a structural point of view, CDL is an object-oriented language. It is centered on the notion of the **class** - a data type, which represents an elementary concept. CDL offers various means of organizing classes, mostly under the fundamental form of **packages**. A package contains a set of classes, which share some semantic relationship. This greatly simplifies your task of managing individual classes when confronted with a very large number of them.
-Once you have defined the classes and packages using CDL, you can implement their **methods **- i.e., their functionality - in one of the data manipulation languages supported by the OCCT environment (currently C++).
+Once you have defined the classes and packages using CDL, you can implement their **methods** - i.e., their functionality - in one of the data manipulation languages supported by the OCCT environment (currently C++).
Even though you can describe classes directly in C++ and save them as header files (.hxx), to do so would forfeit all the advantages of using CDL. These are:
* Precise, complete, and easy-to-read description of the software components.
* Creation of a link with the database; object persistence forms part of the predefined environment of the language.
* Multi-language access to the services of an application engine – a specific architectural form created using the CDL tools, which serves as the motor of an application.
-@subsection occt_1819379591_98643723722 Overview of CDL
+
+@subsection occt_cdl_2_2 Overview of CDL
-CDL is an object-oriented language. In other words, it structures a system around data types rather than around the actions carried out on them. In this context, an **object **is an **instance **of a data type, and its definition determines how you can use it. Each data type is implemented by one or more classes, which make up the basic elements of the system.
-@subsubsection occt_1819379591_986437237221 Classes
+CDL is an object-oriented language. In other words, it structures a system around data types rather than around the actions carried out on them. In this context, an **object** is an **instance** of a data type, and its definition determines how you can use it. Each data type is implemented by one or more classes, which make up the basic elements of the system.
-A class is an implementation of a **data type**. It defines its **behavior **and its **representation**.
+@subsubsection occt_cdl_2_2_1 Classes
-The behavior of a class is its programming interface - the services offered by its **methods**. The representation of a class is its data structure - the **fields**,** **which store its data.
+A class is an implementation of a **data type**. It defines its **behavior** and its **representation**.
-Every object is an **instance **of its class. For example, the object *p *of the data type *Point *is an instance of the class Point.
+The behavior of a class is its programming interface - the services offered by its **methods**. The representation of a class is its data structure - the **fields**, which store its data.
+
+Every object is an **instance** of its class. For example, the object *p* of the data type *Point* is an instance of the class *Point*.
The class Point could be defined as in the example below:
@code
class Point from GeomPack
-@endcode
-@code
---Purpose: represents a point in 3D space.
-@endcode
-@code
is
-@endcode
-@code
Create returns Point;
-@endcode
-@code
fields
-@endcode
-@code
x, y, z : Real;
-@endcode
-@code
end Point;
@endcode
* one starting with the keywords **is**
* one starting with the keyword **fields**.
-The first section contains a list of methods available to the clients of the class. The second section defines the way in which instances are represented. Once this class has been compiled you could **instantiate **its data type in a C++ test program as in the example below:
+The first section contains a list of methods available to the clients of the class. The second section defines the way in which instances are represented. Once this class has been compiled you could **instantiate** its data type in a C++ test program as in the example below:
@code
GeomPack_Point p;
@endcode
-@subsubsection occt_1819379591_986437237222 Categories of Types
-You declare the variables of a **data manipulation language **as being of certain data types. These fall into two categories:
+
+@subsubsection occt_cdl_2_2_2 Categories of Types
+
+You declare the variables of a **data manipulation language** as being of certain data types. These fall into two categories:
* Data types manipulated by handle (or reference)
* Data types manipulated by value
- @image html /dev_guides/cdl/images/cdl_image005.png
- @image latex /dev_guides/cdl/images/cdl_image005.png
-
-Figure 3. Manipulation of data types
-
+ @image html /dev_guides/cdl/images/cdl_image005.png "Manipulation of data types"
+ @image latex /dev_guides/cdl/images/cdl_image005.png "Manipulation of data types"
As seen above, you implement data types using classes. However, classes not only define their data representation and methods available for their instances, but they also define how the instances will be manipulated:
* A data type manipulated by value contains the instance itself.
* A data type manipulated by handle contains a reference to the instance.
-The most obvious examples of data types manipulated by value are the predefined **primitive types**: Boolean, Character, Integer, Real ...
+The most obvious examples of data types manipulated by value are the predefined **primitive types**: Boolean, Character, Integer, Real...
A variable of a data type manipulated by handle, which is not attached to an object, is said to be **null**. To reference an object, you need to instantiate the class with one of its constructors. This is done in C++ as in the following syntax:
+~~~~~
+Handle(myClass) m = new myClass;
+~~~~~
-@subsubsection occt_1819379591_986437237223 Persistence
+@subsubsection occt_cdl_2_2_3 Persistence
-An object is called **persistent **if it can be permanently stored. In other words, you can use the object again at a later date, both in the application, which created it, and in another application.
+An object is called **persistent** if it can be permanently stored. In other words, you can use the object again at a later date, both in the application, which created it, and in another application.
-In order to make an object persistent, you need to declare it in CDL as inheriting from the **Persistent** class, or to have one of its parent classes inheriting from the **Persistent **class.
+In order to make an object persistent, you need to declare it in CDL as inheriting from the **Persistent** class, or to have one of its parent classes inheriting from the *Persistent* class.
-Note that the classes inheriting from the Persistent class are handled by reference.
+Note that the classes inheriting from the *Persistent* class are handled by reference.
**Example**
+~~~~~
+class Watch inherits Persistent
+~~~~~
-In this example, building the application, you add the Watch class to the corresponding schema of data types.
-If, running the application, you instantiate an object of the Watch class, you have the possibility of storing it in a file.
-You cannot store objects instantiated from classes, which inherit from the **Storable** class. However, you can store them as fields of an object, which inherits from Persistent.
+In this example, building the application, you add the *Watch* class to the corresponding schema of data types.
+If, running the application, you instantiate an object of the *Watch* class, you have the possibility of storing it in a file.
+You cannot store objects instantiated from classes, which inherit from the *Storable* class. However, you can store them as fields of an object, which inherits from *Persistent*.
Note that the objects inheriting from Storable are handled by value.
-**Example**
+**Example**
+~~~~~
If
class WatchSpring inherits Storable
//then this could be stored as a field of a Watch
name : ConstructorName;
powersource : WatchSpring;
end;
+~~~~~
+@subsubsection occt_cdl_2_2_4 Packages
-@subsubsection occt_1819379591_986437237224 Packages
+In large-scale long-term development the task of marshalling potentially thousands of classes is likely to quickly prove unmanageable. CDL introduces the notion of **package** of classes containing a set of classes, which have some semantic or syntactic relationship. For example, all classes representing a particular set of electronic components might make up a package called Diode.
-In large-scale long-term development the task of marshalling potentially thousands of classes is likely to quickly prove unmanageable. CDL introduces the notion of **package **of classes containing a set of classes, which have some semantic or syntactic relationship. For example, all classes representing a particular set of electronic components might make up a package called Diode.
+As the package name prefixes the class name when implementing such class (in C++ for example), classes belonging to different packages can have the same name. For example, two packages, one dealing with finance and the other dealing with aircraft maneuvers, might both contain a class called *Bank*, without any possibility of confusion.
-As the package name prefixes the class name when implementing such class (in C++ for example), classes belonging to different packages can have the same name. For example, two packages, one dealing with finance and the other dealing with aircraft maneuvers, might both contain a class called Bank, without any possibility of confusion.
**Example**
-
+~~~~~
Finance_Bank
Attitude_Bank
+~~~~~
-
-@subsubsection occt_1819379591_986437237225 Inheritance
+@subsubsection occt_cdl_2_2_5 Inheritance
The purpose of inheritance is to reduce development workload. The inheritance mechanisms allow you to declare a new class as already containing the characteristics of an existing class. This new class can then be rapidly specialized for a task at hand. This eliminates the necessity of developing each component “from scratch”.
-For example, having already developed a class BankAccount, you can quickly specialize new classes - SavingsAccount, LongTermDepositAccount, MoneyMarketAccount, RevolvingCreditAccount, etc..
+For example, having already developed a class *BankAccount*, you can quickly specialize new classes - *SavingsAccount, LongTermDepositAccount, MoneyMarketAccount, RevolvingCreditAccount*, etc..
-As a consequence, when two or more classes inherit from a parent (or ancestor) class, all these classes surely inherit the behavior of their parent (or ancestor). For example, if the parent class BankAccount contains the method Print that tells it to print itself out, then all its descendent classes offer the same service.
+As a consequence, when two or more classes inherit from a parent (or ancestor) class, all these classes surely inherit the behavior of their parent (or ancestor). For example, if the parent class *BankAccount* contains the method *Print* that tells it to print itself out, then all its descendent classes offer the same service.
One way of ensuring the use of inheritance is to declare classes at the top of a hierarchy as being **deferred**. In such classes, the inherited methods are not implemented. This forces you to create a new class used to redefine the methods. In this way, you guarantee a certain minimum common behavior among descendent classes.
-**Example**
+**Example**
+~~~~~
deferred class BankAccount inherits Persistent
is
.......
name : AccountHolderName;
balance : CreditBalance;
end;
+~~~~~
-
-@subsubsection occt_1819379591_986437237226 Genericity
+@subsubsection occt_cdl_2_2_6 Genericity
You will often wish to model a certain type of behavior as a class. For example, you will need a list modeled as a class.
-In order to be able to list different objects, the class **List **must be able to accept different data types as parameters. This is where genericity comes in: you first declare a list declared as the generic class **List**, willing to accept any data type (or only a particular set of acceptable data types). Then, when you want to make a list of a certain type of object, you instantiate the class **List **with the appropriate data type.
+In order to be able to list different objects, the class *List* must be able to accept different data types as parameters. This is where genericity comes in: you first declare a list declared as the generic class *List*, willing to accept any data type (or only a particular set of acceptable data types). Then, when you want to make a list of a certain type of object, you instantiate the class *List* with the appropriate data type.
+
**Example**
+~~~~~
generic class NewList (Item)
inherits OldList
is
.....
end ;
+~~~~~
Items may be of any type, an Integer or a Real for example.
When defining the package, add the following line:
**Example**
-
+~~~~~
class NewListOfInteger instantiates
NewList (Integer);
+~~~~~
-
-@subsubsection occt_1819379591_986437237227 Exceptions
+@subsubsection occt_cdl_2_2_7 Exceptions
The behavior of any object is implemented by methods, which you define in its class declaration. The definition of these methods includes not only their signature (their programming interface) but also their domain of validity.
In CDL, this domain is expressed by **exceptions**. Exceptions are raised under various error conditions. This mechanism is a safeguard of software quality.
-@subsubsection occt_1819379591_986437237228 Completeness
+
+@subsubsection occt_cdl_2_2_8 Completeness
You use CDL to define data types. Such definitions are not considered complete unless they contain the required amount of structured commentary.
Completeness is regarded as an essential component of long-term viability of a software component.
-@subsection occt_1819379591_98643723723 Lexical Conventions
-@subsubsection occt_1819379591_986437237231 Syntax notation
+@subsection occt_cdl_2_3 Lexical Conventions
+@subsubsection occt_cdl_2_3_1 Syntax notation
In this manual, CDL declarations are described using a simple variant of the Backus-Naur formalism. Note the following:
- * Italicized words, which may also be hyphenated, denote syntactical categories, for example:
-
-*declaration-of-a-non-generic-class*
-
- * Keywords appear in bold type:
-
-**class**
-
- * Brackets enclose optional elements:
-
-identifier [**from **package-name]
-
- * Curly braces enclose repeated elements. The element may appear zero or many times:
-
-integer ::= digit{digit}
-
+ * Italicized words, which may also be hyphenated, denote syntactical categories, for example *declaration-of-a-non-generic-class* ;
+ * Keywords appear in bold type: **class** ;
+ * Brackets enclose optional elements:
+~~~~~
+ identifier [from package-name]
+~~~~~
+ * Curly braces enclose repeated elements. The element may appear zero or many times:
+~~~~~
+ integer ::= digit{digit}
+~~~~~
* Vertical bars separate alternatives:
-
-passing-method ::= [**in**] | **out **| **in out**
-
+~~~~~
+passing-method ::= <b>[in] | out | in out </b>
+~~~~~
* Two apostrophes enclose a character or a string of characters, which must appear:
-
+~~~~~
exponent ::= ’E’[’+’]integer | ’E-’ integer
-
-NOTE
-So as to introduce ideas progressively, the examples presented in this manual may be incomplete, and thus not compilable by the CDL compiler.
+~~~~~
+**NOTE** To introduce the ideas progressively, the examples presented in this manual may be incomplete, and thus not compilable by the CDL compiler.
-@subsubsection occt_1819379591_986437237232 Lexical elements
+@subsubsection occt_cdl_2_3_2 Lexical elements
A CDL source is composed of text from one or more compiled units. The text of each compiled unit is a string of separate lexical elements: **identifiers**, **keywords**, **constants**, and **separators**. The separators (blank spaces, end of line, format characters) are ignored by the CDL compiler, but these are often necessary for separating identifiers, keywords, and constants.
-@subsubsection occt_1819379591_986437237233 Comments
+@subsubsection occt_cdl_2_3_3 Comments
With CDL, you cannot use the expression of all useful information about a development unit. In particular, certain information is more easily expressed in natural language. You can add such information to the CDL description of a data type.
Rubrics and free comments are to be differentiated:
-**Free comments **are preceded by the characters “--” (two hyphens), and they terminate at the end of the line in which they appear.
+**Free comments** are preceded by the characters “--” (two hyphens), and they terminate at the end of the line in which they appear.
**Example**
-
+~~~~~
--This is a comment
+~~~~~
-Unlike rubrics, free comments can appear before or after any lexical element. The first written character of the comment itself *must not *be a hyphen. If a hyphen is necessary make sure it is preceded by a blank.
+Unlike rubrics, free comments can appear before or after any lexical element. The first written character of the comment itself *must not* be a hyphen. If a hyphen is necessary make sure it is preceded by a blank.
**Example**
-
+~~~~~
-- -List item
+~~~~~
+**Rubrics** are various types of comments attached to CDL components. A rubric is a comment made up of three hyphens, name of the rubric (without any intermediary space) and then a colon and a space. It is terminated by the beginning of the following rubric, or by the end of the commentary.
-**Rubrics **are various types of comments attached to CDL components. A rubric is a comment made up of three hyphens, name of the rubric (without any intermediary space) and then a colon and a space. It is terminated by the beginning of the following rubric, or by the end of the commentary.
**Example**
-
+~~~~~
---Purpose:This is an example of a
--rubric composed of a
--comment which extends to
--four lines.
+~~~~~
The different categories of rubrics and the form of their content do not depend on the Component Description Language, but on the tool for which it is intended.
* Executables
* Clients
-@subsubsection occt_1819379591_986437237234 Identifiers
+@subsubsection occt_cdl_2_3_4 Identifiers
An identifier is an arbitrary chain of characters, either letters or digits, but it must begin with a letter.
The underscore “_” is considered to be a letter as long as it doesn’t appear at the beginning or the end of an identifier.
+
Capital and small letters are not equivalent (i.e. AB, Ab, aB, ab are four different identifiers).
-@subsubsection occt_1819379591_986437237235 Keywords
+@subsubsection occt_cdl_2_3_5 Keywords
The following is a list of keywords.
-alias any as asynchronous
-class client deferred end
-enumeration exception executable external
-fields friends from generic
-immutable imported inherits instantiates
-is library like me
-mutable myclass out package
-pointer primitive private protected
-raises redefined returns schema
-static to uses virtual
+* alias
+* any
+* as
+* asynchronous
+* class
+* client
+* deferred
+* end
+* enumeration
+* exception
+* executable
+* external
+* fields
+* friends
+* from
+* generic
+* immutable
+* imported
+* inherits
+* instantiates
+* is
+* library
+* like
+* me
+* mutable
+* myclass
+* out
+* package
+* pointer
+* primitive
+* private
+* protected
+* raises
+* redefined
+* returns
+* schema
+* static
+* to
+* uses
+* virtual
In a CDL file, the following characters are used as punctuation:
; : , = ( ) [ ] ‘ “
-@subsubsection occt_1819379591_986437237236 Constants
+@subsubsection occt_cdl_2_3_6 Constants
There are three categories of constants:
* Literal
* Named
-***Numeric Constants***
+#### Numeric Constants
There are two types of numeric constants: integer and real.
-An **integer **constant consists of a string of digits, which may or may not be preceded by a sign. Integer constants express whole numbers.
-**Examples**
-1995 0 -273 +78
+An **integer** constant consists of a string of digits, which may or may not be preceded by a sign. Integer constants express whole numbers.
-A **real **constant may or may not be preceded by a sign, and consists of an integral part followed by a decimal point and a fractional part (either one or both parts may be null, but both parts must always be present). It may also be followed by the letter E to indicate that the following figures represent the exponent (also optionally signed).
**Examples**
+~~~~~
+1995 0 -273 +78
+~~~~~
+A **real** constant may or may not be preceded by a sign, and consists of an integral part followed by a decimal point and a fractional part (either one or both parts may be null, but both parts must always be present). It may also be followed by the letter E to indicate that the following figures represent the exponent (also optionally signed).
+**Examples**
+~~~~~
5.0 0.0 -0.8E+3 5.67E-12
-
-***Literal Constants***
+~~~~~
+#### Literal Constants
Literal constants include individual characters and strings of characters.
-An **individual character **constant is a single printable character enclosed by two apostrophes. (See the definition of the class Character in the Standard Package).
-**Examples**
+An **individual character** constant is a single printable character enclosed by two apostrophes. (See the definition of the class Character in the Standard Package).
+**Examples**
+~~~~~
‘B’ ‘y’ ‘&’ ‘*’ ‘’’ ‘‘
+~~~~~
+A **string** constant is composed of printable characters enclosed by quotation marks.
-A **string **constant is composed of printable characters enclosed by quotation marks.
**Examples**
-
+~~~~~
’’G’’ ’’jjjj’’ ’’This is a character string, isn’t it?’’
+~~~~~
+The **quotation mark** can itself appear within a character string as long as it is preceded by a backslash.
-The **quotation mark **can itself appear within a character string as long as it is preceded by a backslash.
**Examples**
-
+~~~~~
’’This film was originally called \’’Gone with the Tide\’’.’’
+~~~~~
-***Named Constants***
+#### Named Constants
Named constants are sub-divided into two categories: Booleans and enumerations.
-**Booleans **can be of two types: True or False.
-
-An **enumeration **constant is an identifier, which appears in the description of an enumeration.
-
-@section occt_1819379591_1718435309 3. Software Components
+**Booleans** can be of two types: True or False.
+An **enumeration** constant is an identifier, which appears in the description of an enumeration.
+@section occt_cdl_3 Software Components
-@subsection occt_1819379591_171843530931 Predefined Resources
-@subsubsection occt_1819379591_1718435309311 Primitive types
+@subsection occt_cdl_3_1 Predefined Resources
+@subsubsection occt_cdl_3_1_1 Primitive types
Primitive types are predefined in the language and they are **manipulated by value**.
Four of these primitives are known to the schema of the database because they inherit from the class **Storable**. In other words, they can be used in the implementation of persistent objects, either when contained in entities declared within the methods of the object, or when they form part of the internal representation of the object.
-The primitives inheriting from Storable are the following:
+The primitives inheriting from **Storable** are the following:
-**Boolean **Is used to represent logical data. It has only two values:
-*True *and *False*.
-**Byte **8-bit number.
-**Character **Designates any ASCII character.
-**ExtCharacter **Is an extended character.
-**Integer **Is an integer number.
-**Real **Denotes a real number (i.e. one with a whole and a fractional part, either of which may be null).
-**ShortReal **Real with a smaller choice of values and memory size.
+* **Boolean** Is used to represent logical data. It has only two values: *True* and *False*.
+* **Byte** 8-bit number.
+* **Character** Designates any ASCII character.
+* **ExtCharacter** Is an extended character.
+* **Integer** Is an integer number.
+* **Real** Denotes a real number (i.e. one with a whole and a fractional part, either of which may be null).
+* **ShortReal** Real with a smaller choice of values and memory size.
There are also non-storable primitives. They are:
-**CString **Is used for literal constants.
-**ExtString **Is an extended string.
-**Address **Represents a byte address of undetermined size.
+* **CString** Is used for literal constants.
+* **ExtString** Is an extended string.
+* **Address** Represents a byte address of undetermined size.
The services offered by each of these types are described in the Standard Package.
-@subsubsection occt_1819379591_1718435309312 Manipulating types by reference (by handle)
+@subsubsection occt_cdl_3_1_2 Manipulating types by reference (by handle)
Two types are manipulated by handle:
- * Types defined using classes inheriting from the **Persistent **class are storable in a file.
-
- * Types defined using classes inheriting from the **Transient **class.
+ * Types defined using classes inheriting from the **Persistent** class are storable in a file.
+ * Types defined using classes inheriting from the **Transient** class.
+
These types are not storable as such in a file.
-@image html /dev_guides/cdl/images/cdl_image006.png
-@image latex /dev_guides/cdl/images/cdl_image006.png
+@image html /dev_guides/cdl/images/cdl_image006.png "Manipulation of a data type by reference"
+@image latex /dev_guides/cdl/images/cdl_image006.png "Manipulation of a data type by reference"
-Figure 4. Manipulation of a data type by reference
-
-@subsubsection occt_1819379591_1718435309313 Manipulating types by value
+@subsubsection occt_cdl_3_1_3 Manipulating types by value
Types, which are manipulated by value, behave in a more direct fashion than those manipulated by handle. As a consequence, they can be expected to perform operations faster, but they cannot be stored independently in a file.
You can store types known to the schema (i.e. either primitives or inheriting from Storable) and manipulated by value inside a persistent object as part of the representation. This is the only way for you to store objects “manipulated by value” in a file.
- @image html /dev_guides/cdl/images/cdl_image007.png
- @image latex /dev_guides/cdl/images/cdl_image007.png
-
-Figure 5. Manipulation of a data type by value
+@image html /dev_guides/cdl/images/cdl_image007.png "Manipulation of a data type by value"
+@image latex /dev_guides/cdl/images/cdl_image007.png "Manipulation of a data type by value"
+
Three types are manipulated by value:
* Primitive types
* Enumerated types
* Types defined by classes not inheriting from Persistent or Transient, whether directly or not
-@subsubsection occt_1819379591_1718435309314 Summary of properties
+@subsubsection occt_cdl_3_1_4 Summary of properties
-**Figure 6. Summary of the relationship for the various data**
-**types between how they are handled and their storability.**
+Here is a summary of how various data types are handled and their storability:
+
+| | Manipulated by handle | Manipulated by value |
+| :---- | :---- | :---- |
+| storable | Persistent | Primitive, Storable (storable if nested in a persistent class) |
+| temporary | Transient | Other |
-@subsection occt_1819379591_171843530932 Classes
-@subsubsection occt_1819379591_1718435309321 Class declaration
+
+
+@subsection occt_cdl_3_2 Classes
+
+@subsubsection occt_cdl_3_2_1 Class declaration
The class is the main system for creating data types under CDL. By analyzing any CDL-based software, you find that classes are the modular units that make up packages. When you describe a new class, you introduce a new data type.
Whatever the category of the described type (manipulated by value, Storable or not, manipulated by handle, Persistent or not) the structure of the class definition remains the same. The syntax below illustrates it:
-**Example**
+~~~~~
-- declaration-of-a-simple-class ::=
class class-name from package-name
[uses data-type { ’,’ data-type } ]
[{member-method}]
[declaration-of-fields]
[declaration-of-friends]
-
+~~~~~
Class name becomes a new data type, which you can use inside its own definition. Other types appearing in the definition must either be primitive types, previously declared classes, exceptions, or enumerations.
-Apart from the types defined in the Standard Package, which are **implicitly visible **everywhere, you need to declare the data types after the keyword **uses**. This concerns both the class behavior and its internal representation.
+Apart from the types defined in the Standard Package, which are **implicitly visible** everywhere, you need to declare the data types after the keyword **uses**. This concerns both the class behavior and its internal representation.
-**Exceptions **are declared after the word **raises**.
-**Example**
+**Exceptions** are declared after the word **raises**.
+**Example**
+~~~~~
class Line from GeomPack
usesPoint, Direction, Transformation
raisesNullDirection, IdenticalPoints
-- NullDirection and Identical-
-- -Points exceptions.
end Line;
+~~~~~
The elements, which make up the definition of a class, are divided into four parts:
-
* the behavior
* the invariants
* the internal representation
* the friend methods and friend classes.
- @image html /dev_guides/cdl/images/cdl_image009.png
- @image latex /dev_guides/cdl/images/cdl_image009.png
-
-**Figure 7. Contents of a class**
-*** a deferred class does not have to contain a constructor**
-
+ @image html /dev_guides/cdl/images/cdl_image009.png "Contents of a class"
+ @image latex /dev_guides/cdl/images/cdl_image009.png "Contents of a class"
-@subsubsection occt_1819379591_1718435309322 Categories of classes
+@subsubsection occt_cdl_3_2_2 Categories of classes
Classes fall into three categories:
-
* Ordinary classes
* Deferred classes
* Generic classes
-<h4>Deferred classes</h4>
+#### Deferred classes
-The principal characteristic of a **deferred class **is that you cannot instantiate it. Its purpose is to provide you with a given behavior shared by a hierarchy of classes and dependent on the implementation of the descendents. This allows you to guarantee a certain base of inherited behavior common to all classes based on a particular deferred class. Deferred classes are declared as in the following syntax:
-**Example**
+The principal characteristic of a **deferred class** is that you cannot instantiate it. Its purpose is to provide a given behavior shared by a hierarchy of classes and dependent on the implementation of the descendents. This allows guaranteeing a certain base of inherited behavior common to all classes based on a particular deferred class. Deferred classes are declared as in the following syntax:
--- declaration-of-a-deferred-class ::=
-deferred class class-name
+~~~~~
+-- declaration-of-a-deferred-class ::= deferred class class-name
[inherits class-name {’,’ class-name}]
[uses data-type {’,’ data-type}]
[raises exception-name {’,’ exception-name}]
-is class-definition
-end [class-name]’;’
-
+ is class-definition
+ end [class-name]’;’
+~~~~~
+Please, note that a deferred class does not have to contain a constructor
<h4>Generic classes</h4>
-The principal characteristic of a **generic class **is that it offers you a set of functional behavior allowing you to manipulate other data types. To instantiate a generic class you need to pass a data type in argument. Generic classes are declared as in the following syntax:
-**Example**
+The principal characteristic of a **generic class** is that it offers a set of functional behavior to manipulate other data types. To instantiate a generic class you need to pass a data type in argument. Generic classes are declared as in the following syntax:
--- declaration-of-a-generic-class ::=
-[deferred] generic class class-name ’(’generic-type
-{’,’ generic-type}’)’
+~~~~~
+-- declaration-of-a-generic-class ::= [deferred] generic class class-name ’(’generic-type {’,’generic-type}’)’
[inheritsclass-name {’,’ class-name}]
[usesdata-type {’,’ data-type}]
[raisesexception-name {’,’ exception-name}]
[{[visibility] declaration-of-a-class}]
-is class-definition
-end [class-name]’;’
+ is class-definition
+ end [class-name]’;’
generic-type ::= identifier as type-constraint
identifier ::= letter{[underscore]alphanumeric}
-type-constraint ::= any | class-name [’(’data-type {’,’
-data-type}’)’]
+type-constraint ::= any | class-name [’(’data-type {’,’ data-type}’)’]
+~~~~~
+@subsection occt_cdl_3_3 Packages
-@subsection occt_1819379591_171843530933 Packages
+@subsubsection occt_cdl_3_3_1 Package declaration
-@subsubsection occt_1819379591_1718435309331 Package declaration
+**Packages** are used to group classes, which have some logical coherence. For example, the Standard Package groups together all the predefined resources of the language. In its simplest form, a package contains the declaration of all data types, which it introduces. You may also use a package to offer public methods and hide its internal classes by declaring them private.
- **Packages** are used to group classes, which have some logical coherence. For example, the Standard Package groups together all the predefined resources of the language. In its simplest form, a package contains the declaration of all data types, which it introduces. You may also use a package to offer public methods and hide its internal classes by declaring them private.
-** **
**Example**
--- package-declaration ::=
-**package **package-name
-[**uses **package-name {’,’ package-name}]
-**is **package-definition
-**end **[package-name]’;’
--- package-name ::=
-identifier
+~~~~~
+-- package-declaration ::= package package-name
+ [uses package-name {’,’ package-name}]
+ is package-definition
+ end [package-name]’;’
+-- package-name ::= identifier
-- package-definition ::=
-[{type-declaration}]
-[{package-method}]
+ [{type-declaration}]
+ [{package-method}]
-- type-declaration ::=
-[**private**] declaration-of-an-enumeration |
-[**private**] declaration-of-a-class |
-declaration-of-an-exception
--- package-method ::=
-identifier [simple-formal-part][returned-type
--declaration]
+ [private] declaration-of-an-enumeration | [private] declaration-of-a-class | declaration-of-an-exception
+-- package-method ::= identifier [simple-formal-part][returned-type -declaration]
[error-declaration]
-[***is private***]’;’
-
-The data types described in a package *may *include one or more of the following data types:
+[is private]’;’
+~~~~~
+The data types described in a package *may* include one or more of the following data types:
* Enumerations
* Object classes
* Exceptions
* Pointers to other object classes.
-Inside a package, two data types *cannot *have the same name.
+Inside a package, two data types *cannot* have the same name.
You declare data types before using them in the definition of other data types.
-When two classes are **mutually recursive**, one of the two *must *be first declared in an incomplete fashion.
+When two classes are **mutually recursive**, one of the two must be first declared in an incomplete fashion.
-Grouped behind the keyword **uses **are the names of all the packages containing definitions of classes of which the newly introduced data types are clients.
+Grouped behind the keyword **uses** are the names of all the packages containing definitions of classes of which the newly introduced data types are clients.
-The methods you declare in a package do not belong to any particular class. **Package methods ***must *carry a name different from the data types contained in the package. Like any other method, they can be overloaded. With the exception of the keyword **me **and the visibility (a package method can *only *be either public or private) package methods are described in the same way as **instance methods**.
+The methods you declare in a package do not belong to any particular class. **Package methods** must carry a name different from the data types contained in the package. Like any other method, they can be overloaded. With the exception of the keyword **me** and the visibility (a package method can *only* be either public or private) package methods are described in the same way as **instance methods**.
-@image html /dev_guides/cdl/images/cdl_image010.png
-@image latex /dev_guides/cdl/images/cdl_image010.png
-Figure 8. Contents of a package
+@image html /dev_guides/cdl/images/cdl_image010.png "Contents of a package"
+@image latex /dev_guides/cdl/images/cdl_image010.png "Contents of a package"
-The example of the package below includes some of the basic data structures:
-**Example**
+The example of the package below includes some of the basic data structures:
+
+~~~~~
package Collection
-uses
-Standard
-is
+ uses
+ Standard
+ is
exception NoSuchObject inherits Failure;
exception NoMoreObject inherits Failure;
generic class SingleList;
generic class Set;
end Collection;
+~~~~~
-Note that the class Set is declared after the declarations of the NoSuchObject and NoMoreObject exceptions and the SingleList class of which Set is a client. In the same way, the classes Failure, Persistent, and the exception NoSuchObject are defined before they are used. They are defined in the Standard package, which appears after the keyword **uses**.
+Note that the class *Set* is declared after the declarations of the *NoSuchObject* and *NoMoreObject* exceptions and the *SingleList* class of which Set is a client. In the same way, the classes *Failure*, *Persistent*, and the exception *NoSuchObject* are defined before they are used. They are defined in the *Standard* package, which appears after the keyword **uses**.
-@subsubsection occt_1819379591_1718435309332 Name space
+@subsubsection occt_cdl_3_3_2 Name space
-The **name space **or **scope **of a class extends from the beginning of its declaration up to the end of the package in which it appears.
+The **name space** or **scope** of a class extends from the beginning of its declaration up to the end of the package in which it appears.
-Sometimes, two classes, which come from separate packages, are both visible to a third package and carry the same name. For example, there might be two different classes both called “Window” in a screen generator package and in an architectural package. As a client of a data type, you can find yourself in the position of having to remove the ambiguity over the origin of this type; you do this by means of the keyword **from**.
-**Example**
+Sometimes, two classes, which come from separate packages, are both visible to a third package and carry the same name. For example, there might be two different classes both called “Window” in a screen generator package and in an architectural package. As a client of a data type, you can find yourself in the position of having to remove the ambiguity over the origin of this type; you do this by means of the keyword **from**.
+
--- class-name ::=
-identifier [**from **package-name]
--- exception-name ::=
-identifier [**from **package-name]
--- enumeration-name ::=
-identifier [**from **package-name]
+~~~~~
+-- class-name ::= identifier [from package-name]
+-- exception-name ::= identifier [from package-name]
+-- enumeration-name ::= identifier [from package-name]
+~~~~~
-You can use the keyword **from **everywhere the name of a class, exception, or enumeration appears. As a consequence, as a client of the class “Window” you could write wherever necessary:
-**Example**
+You can use the keyword **from** everywhere the name of a class, exception, or enumeration appears. As a consequence, as a client of the class “Window” you could write wherever necessary:
+~~~~~
Window from ScreenGenerator
-- or
Window from ArchitecturalFeatures
+~~~~~
-NOTES
-***Within the description of a package the keyword *****from**** *must be used when referencing any data type that is not defined in this package.***
+**Note** that within the description of a package the keyword **from** must be used when referencing any data type that is not defined in this package.
Here is a further example:
-**Example**
+~~~~~
class Line from Geom
uses
-Point from Geom2d,
-Point from Geom3d
+ Point from Geom2d,
+ Point from Geom3d
is
--- class definition using
--- Point from AppropriatePackage
--- wherever Point appears
+ -- class definition using Point from AppropriatePackage wherever Point appears
end;
+~~~~~
-
-@subsubsection occt_1819379591_1718435309333 Declaration of classes
+@subsubsection occt_cdl_3_3_3 Declaration of classes
You cannot describe a package in one single file. You need to describe it in different units and send them separately to the CDL compiler. Each compilation unit can contain the declaration of a class or of a package. When you describe a class in a unit different than that, which describes its package, you need to specify which package the class belongs to. You do this using the keyword **from**.
-If the **from **clause appears in the **uses **clause of the package, it does not need to be repeated elsewhere.
+If the **from** clause appears in the **uses** clause of the package, it does not need to be repeated elsewhere.
The following example takes the package “Collection” which was presented above, but this time it is divided into three compilation units.
-**Example**
+~~~~~
-- First compilation unit, the package “Collection” :
package Collection
-uses
-Standard
-is
+ uses
+ Standard
+ is
exception NoMoreObject inherits Failure from Standard;
exception NoSuchObject inherits Failure from Standard;
generic class SingleList;
-- Second compilation unit, the class “SingleList” :
generic class SingleList from Collection (Item as
Storable)
-inherits
-Persistent from Standard
-raises
-NoSuchObject from Collection
-is
--- definition of the SingleList class
-end SingleList;
+ inherits
+ Persistent from Standard
+ raises
+ NoSuchObject from Collection
+ is
+ -- definition of the SingleList class
+ end SingleList;
-- Third compilation unit, the class “Set” :
generic class Set from Collection (Item as Storable)
- inherits
-Persistent from Standard;
-raises
-NoSuchObject from Collection,
-NoMoreObject from Collection
-private class Node instantiates SingleList
-from Collection (Item);
--- etc....
+ inherits
+ Persistent from Standard;
+ raises
+ NoSuchObject from Collection,
+ NoMoreObject from Collection
+ private class Node instantiates SingleList
+ from Collection (Item);
end Set;
-
+~~~~~
NOTE
-It is not explicitly stated that the “Node” class belongs to the “Collection” package. In fact any nested class necessarily belongs to the package of the class, which encompasses it.
+It is not explicitly stated that the *Node* class belongs to the *Collection* package. In fact any nested class necessarily belongs to the package of the class, which encompasses it.
+
+Note that a package can hide certain classes (just as it can hide methods) by declaring them **private**. To make a class private, you prefix its description with the keyword **private**. In the example of the *Collection* package, the *SingleList* class serves only to implement the *Set* class. It is recommended to make it private. You write this as in the following syntax:
-Note that a package can hide certain classes (just as it can hide methods) by declaring them **private**. To make a class private, you prefix its description with the keyword **private**. In the example of the “Collection” package, the “SingleList” class serves only to implement the “Set” class. It is recommended to make it private. You write this as in the following syntax:
-**Example**
+**Example**
+~~~~~
package Collection
-uses
-Standard
-is
+ uses
+ Standard
+ is
generic class Set, Node, Iterator;
private generic class SingleList;
exception NoMoreObject inherits Failure from Standard;
end Collection;
+~~~~~
+@subsection occt_cdl_3_4 Other Data Types
-@subsection occt_1819379591_171843530934 Other Data Types
-
-These are:
-
+The other data types are:
* Enumerations
* Imports
* Aliases
* Exceptions
* Pointers
-@subsubsection occt_1819379591_1718435309341 Enumerations
+@subsubsection occt_cdl_3_4_1 Enumerations
-The **enumerated types **are the second type, which is manipulated by value. Unlike the primitive types they are extensible because they are defined by the user under the form of enumerations. An enumeration is an ordered sequence of named whole constant values called enumeration constants.
-**Example**
+The **enumerated types** are the second type, which is manipulated by value. Unlike the primitive types they are extensible because they are defined by the user under the form of enumerations. An enumeration is an ordered sequence of named whole constant values called enumeration constants.
+**Example**
+~~~~~
declaration-of-an-enumeration ::=
-**numeration **enumeration-name
-**is **identifier {’,’ identifier}
-[**end **[enumeration-name]]’;’
+enumeration enumeration-name
+is identifier {’,’ identifier}
+[end [enumeration-name]]’;’
enumeration-name ::= identifier
-
+~~~~~
The declaration of an enumeration creates an enumerated type. An object of this type can successively take the value of any one of the constants cited in the list.
-**Example**
+**Example**
+~~~~~
enumeration MagnitudeSign is Negative, Null, Positive;
+~~~~~
-
-Inside a package, two enumeration constants cannot have the same name, even if they belong to different enumerated types.
+Inside a package, two enumeration constants cannot have the same name, even if they belong to different enumerated types.
+
**Example**
-
+~~~~~
enumeration Cars is
-Honda,
-Ford,
-Volkswagen,
-Renault
+ Honda,
+ Ford,
+ Volkswagen,
+ Renault
end;
enumeration AmericanPresidents is
-Nixon,
-Reagan,
-Ford, -- Error: ‘Ford’ already defined
-Carter
+ Nixon,
+ Reagan,
+ Ford, -- Error: ‘Ford’ already defined
+ Carter
end;
+~~~~~
+@subsubsection occt_cdl_3_4_2 Imports
-@subsubsection occt_1819379591_1718435309342 Imports
-
-An **imported type **is one of which which has not been defined in CDL. It is up to the supplier of this data type to ensure compatibility with the CDL language by providing services which allow CDL to recognize the imported data type.
+An **imported type** is one of which which has not been defined in CDL. It is up to the supplier of this data type to ensure compatibility with the CDL language by providing services which allow CDL to recognize the imported data type.
The CDL syntax for declaring an imported type is:
-
-declaration-of-an-imported-type::=
-[**private**] **imported **typename ;
-**Example**
-
--- You can define an imported type as follows:
--- In the MyPack.cdl file, you declare the imported
-type:
--- package MyPack
-....
-imported MyImport;
-....
-end Mypack;
--- In the MyPack_MyImport.hxx file, you write the
-following
--- C++ code:
+~~~~~
+declaration-of-an-imported-type::=[private] imported typename ;
+~~~~~
+
+Let us try to define an imported type:
+
+* In the *MyPack.cdl* file, you declare the imported type:
+~~~~~
+package MyPack
+ ....
+ imported MyImport;
+ ....
+ end Mypack;
+~~~~~
+* In the *MyPack_MyImport.hxx* file, you write the following C++ code:
+~~~~~
#ifndef _MyPack_MyImport_HeaderFile
#define _MyPack_MyImport_HeaderFile
#include Standard_Type.hxx
typedef unsigned long MyPack_MyImport;
extern const Handle(Standard_Type)& TYPE
(MyPack_MyImport);
--- In the MyPack_MyImport.cxx file, you write the
-following
--- C++ code:
+~~~~~
+* In the *MyPack_MyImport.cxx* file, you write the following C++ code:
+~~~~~
#ifndef _MyPack_MyImport_HeaderFile
#include MyPack_MyImport.hxx
#endif
const Handle(Standard_Type)& TYPE (MyPack_MyImport)
-
{
-static Handle(Standard_Type) _aType =
-new Standard_Type (“MyPack_MyImport”,sizeof
-(MyPack_MyImport))
- return _aType;
-}
+ static Handle(Standard_Type) _aType =
+ new Standard_Type (“MyPack_MyImport”,sizeof
+ (MyPack_MyImport))
+ return _aType;
+ }
+~~~~~
-Then, add the names of these two files (MyPack_MyImport.hxx, MyPack_MyImport.cxx) to a file called FILES in the src subdirectory of the package. If the file does not exist you must create it.
+Then, add the names of these two files <i>(MyPack_MyImport.hxx, MyPack_MyImport.cxx)</i> to a file called FILES in the src subdirectory of the package. If the file does not exist you must create it.
-@subsubsection occt_1819379591_1718435309343 Aliases
+@subsubsection occt_cdl_3_4_3 Aliases
-An **alias **is an extra name for a type, which is already known. It is declared as in the following syntax:
+An **alias** is an extra name for a type, which is already known. It is declared as in the following syntax:
-declaration-of-an-alias::=
-[**private**] **alias **type1 **is **type2 [**from **apackage] ;
-**Example**
+~~~~~
+declaration-of-an-alias::= [private] alias type1 is type2 [from apackage] ;
+~~~~~
+**Example**
+~~~~~
alias Mass is Real;
---Purpose:
-- Defined as a quantity of matter.
-- Gives rise to the inertial and
-- gravitational properties of a body.
-- It is measured in kilograms.
+~~~~~
-Having defined *Mass *as a type of *Real*, you can use either *Mass *or *Real *to type an argument when defining a method.
+Having defined *Mass* as a type of *Real*, you can use either *Mass* or *Real* to type an argument when defining a method.
-@subsubsection occt_1819379591_1718435309344 Exceptions
+@subsubsection occt_cdl_3_4_4 Exceptions
In the model recommended by CDL, the principal characteristic of errors is that they are treated in a different place from the place where they appear. In other words, the methods recovering and those raising a given exception are written independently from each other.
Subsequently this poses the problem of communication between the two programs. The principle adopted consists in viewing the exception as both a class and an object. The exception class (by means of one of its instances) is used to take control of an exception, which has been raised.
-Consequently, error conditions are defined by means of **classes of exceptions**. Exception classes are arranged hierarchically so as to be able to recover them in groups. They are all descendents of a single root class called “Failure”, and it is at the level of this class that the behavior linked to the raising of exceptions is implemented.
-
-declaration-of-an-exception ::=
-**exception **exception-name **inherits **exception-name
+Consequently, error conditions are defined by means of **classes of exceptions**. Exception classes are arranged hierarchically so as to be able to recover them in groups. They are all descendents of a single root class called *Failure*, and it is at the level of this class that the behavior linked to the raising of exceptions is implemented.
+~~~~~
+declaration-of-an-exception ::=exception exception-name inherits exception-name
+~~~~~
-All exceptions share identical behavior, that of the class “Failure”. Here are some examples of exception classes:
+All exceptions share identical behavior, that of the class *Failure*. Here are some examples of exception classes:
+~~~~~
exception NumericError inherits Failure;
exception Overflow inherits NumericError;
exception Underflow inherits NumericError;
+~~~~~
-The use of exceptions as a means to interrupt the normal execution of one program and then take control of another one depends on the programming language used to implement the methods. See the following chapter <a href="#Defing_Software_Components">“Defining the Software Components”</a> on page 32.
+The use of exceptions as a means to interrupt the normal execution of one program and then take control of another one depends on the programming language used to implement the methods. See the following chapter <a href="#occt_cdl_4">“Defining the Software Components”</a> on page 32.
-@subsection occt_1819379591_171843530935 Schemas
+@subsection occt_cdl_3_5 Schemas
-The purpose of a **schema **is to list persistent data types, which will be stored in files by the application. A schema groups together persistent packages. A persistent package is one, which contains at least one persistent class.
+The purpose of a **schema** is to list persistent data types, which will be stored in files by the application. A schema groups together persistent packages. A persistent package is one, which contains at least one persistent class.
+~~~~~
declaration-of-a-schema ::=
-**schema **SchemaName
+schema SchemaName
is
-{**package **PackageName;}
-{**class **ClassName;}
-**end**;
-**Example**
-
+{package PackageName;}
+{class ClassName;}
+end;
+~~~~~
+
+For example
+~~~~~
schema Bicycle
---Purpose: Defines the Bicycle schema.
is
package FrameComponents;
package WheelComponents;
end;
+~~~~~
-***NOTE***
-Note that it is unnecessary to specify all the dependencies of the packages. It is sufficient to specify the highest level ones. The others on which they depend are automatically supplied.
-@subsection occt_1819379591_171843530936 Executables
-The purpose of an **executable **is to make an executable program without a front-end. It can be used to test more than one package at a time. An executable is written in a .cdl file as a set of packages.
-**Example**
+**Note** that it is unnecessary to specify all the dependencies of the packages. It is sufficient to specify the highest level ones. The others on which they depend are automatically supplied.
+@subsection occt_cdl_3_6 Executables
+
+The purpose of an **executable** is to make an executable program without a front-end. It can be used to test more than one package at a time. An executable is written in a .cdl file as a set of packages.
+**Example**
+~~~~~
definition-of-an-executable ::=
-executable ExecutableName
-is
+ executable ExecutableName
+ is
{
executable ExecutablePart
-[uses [Identifier as external]
-[{’,’ Identifier as external}]
-[UnitName as library]
-[{’,’ UnitName as library}]
-is
-{FileName [as C++|c|fortran|object];}
+ [uses [Identifier as external]
+ [{’,’ Identifier as external}]
+ [UnitName as library]
+ [{’,’ UnitName as library}]
+ is
+ {FileName [as C++|c|fortran|object];}
+ end;
+ }
end;
-}
-end;
-**Example**
+~~~~~
+**Example**
+~~~~~
executable MyExecUnit
----Purpose:
--- Describes the executable MyExecUnit
-is
-executable myexec
--- the binary file
-uses
-Tcl_Lib as external
-is
-myexec;
--- the C++ file
-end;
--- several binaries can be specified in one .cdl file.
-executable myex2
-is
-myex2;
+ ---Purpose:
+ -- Describes the executable MyExecUnit
+ is
+ executable myexec
+ -- the binary file
+ uses
+ Tcl_Lib as external
+ is
+ myexec;
+ -- the C++ file
+ end;
+ -- several binaries can be specified in one .cdl file.
+ executable myex2
+ is
+ myex2;
end;
end;
+~~~~~
-@section occt_1819379591_1972310108 4. Defining the Software Components
+@section occt_cdl_4 Defining the Software Components
-@subsection occt_1819379591_197231010841 Behavior
+@subsection occt_cdl_4_1 Behavior
-The behavior of an object class is defined by a list of **methods, **which are either **functions **or **procedures**. Functions return an object, whereas procedures only communicate by passing arguments. In both cases, when the transmitted object is an instance manipulated by a handle, its identifier is passed. There are three categories of methods:
+The behavior of an object class is defined by a list of **methods**, which are either **functions** or **procedures**. Functions return an object, whereas procedures only communicate by passing arguments. In both cases, when the transmitted object is an instance manipulated by a handle, its identifier is passed. There are three categories of methods:
-**Object constructor **Creates an instance of the described class. A class will have one or more object constructors with various arguments or none.
+* **Object constructor** Creates an instance of the described class. A class will have one or more object constructors with various arguments or none.
+* **Instance method** Operates on the instance which owns it.
+* **Class method** Does not work on individual instances, only on the class itself.
-**Instance method **Operates on the instance which owns it.
+@subsubsection occt_cdl_4_11 Object Constructors
-**Class method **Does not work on individual instances, only on the class itself.
-
-@subsubsection occt_1819379591_1972310108411 Object Constructors
-
-A constructor is a function, which allows the **creation of instances **of the class it describes.
-**Example**
+A constructor is a function, which allows the **creation of instances** of the class it describes.
+~~~~~
constructor-declaration ::=
-Create [ simple-formal-part ] declaration-ofconstructed-
-type
+Create [ simple-formal-part ] declaration-ofconstructed-type
[ exception-declarations ]
simple-formal-part ::=
’(’ initialization-parameter {’;’ initialization parameter}’)’
identifier {’,’ identifier} ’:’ parameter-access datatype
[ ’=’ initial-value ]
parameter-access ::=
-**mutable **| [ **immutable **]
+mutable | [ immutable ]
initial_value ::=
numeric-constant | literal-constant | named-constant
declaration-of-constructed-type ::=
-**returns **[ **mutable **] class-name
+returns [ mutable ] class-name
+~~~~~
-The name of the constructors is fixed: “Create”. The object returned by a constructor is always of the type of the described class. If that type is manipulated by a handle, you *must *declare it as **mutable**, in which case the content of the instance it references is accessible for further modification.
+The name of the constructors is fixed: “Create”. The object returned by a constructor is always of the type of the described class. If that type is manipulated by a handle, you *must* declare it as **mutable**, in which case the content of the instance it references is accessible for further modification.
For example, the constructor of the class “Point”
-**Example**
-
+~~~~~
Create (X, Y, Z : Real)
returns mutable Point;
+~~~~~
-With the exception of the types predefined by the language, all types of initialization parameters *must *appear in the **uses **clause of the class of which the constructor is a member.
+With the exception of the types predefined by the language, all types of initialization parameters *must* appear in the **uses** clause of the class of which the constructor is a member.
-When an initialization parameter is of a type which is manipulated by a handle, an access right *must *be associated with it so as to express if the internal representation of the referenced object is modifiable (**mutable**) or not (**immutable**). The default option is **immutable**. For example, the constructor of the persistent class “Line”.
-**Example**
+When an initialization parameter is of a type which is manipulated by a handle, an access right *must* be associated with it so as to express if the internal representation of the referenced object is modifiable (**mutable**) or not (**immutable**). The default option is **immutable**. Let, for example, take the constructor of the persistent class “Line”.
+~~~~~
Create (P : mutable Point; D : mutable Direction)
returns mutable Line;
+~~~~~
In the above example “P” and “D” must be mutable because the constructor stores them in the internal representation of the created line, which is mutable itself. An alternative would be to accept immutable initialization parameters and then copy them into the constructor in a mutable form.
-The parameters of a native type can have a default value: this is expressed by assigning a constant of the same type to the parameter concerned. Parameters, which have a default value, may not be present when the call to the constructor is made, in which case they take the value specified in the declaration. For this reason, they must all be grouped at the end of the list. For example, the constructor of the persistent class “Vector”.
-**Example**
+The parameters of a native type can have a default value: this is expressed by assigning a constant of the same type to the parameter concerned. Parameters, which have a default value, may not be present when the call to the constructor is made, in which case they take the value specified in the declaration. For this reason, they must all be grouped at the end of the list. Let, for example, take the constructor of the persistent class “Vector”.
+~~~~~
Create (D : mutable Direction; M : Real = 1.0)
returns mutable Vector;
+~~~~~
A class can have many constructors (in this case, you say they are **overloaded**) provided that they differ in their syntax and that the presence of parameters having default values does not create ambiguities.
-The restrictions on their use are expressed by a list of **exceptions **against which each constructor is protected.
+The restrictions on their use are expressed by a list of **exceptions** against which each constructor is protected.
Each class must have at least one constructor to be able to create objects of its type.
-@subsubsection occt_1819379591_1972310108412 Instance Methods
+
+@subsubsection occt_cdl_4_1_2 Instance Methods
An instance method is a function or procedure, which applies to any instance of the class, which describes it.
-**Example**
-declaration-of-an-instance-method ::=
-identifier formal-part-of-instance-method
+**Example**
+~~~~~
+declaration-of-an-instance-method ::= identifier formal-part-of-instance-method
[ declaration-of-returned-type ]
[ exception-declaration ]
-formal-part-of-instance-method ::=
- ’(’ me [’:’ passing-mode parameter-access ] {’;’
-parameter}’)’
-parameter ::=
-identifier {’,’ identifier} ’:’ passing-mode
+formal-part-of-instance-method ::= ’(’ me [’:’ passing-mode parameter-access ] {’;’ parameter}’)’
+parameter ::= identifier {’,’ identifier} ’:’ passing-mode
parameter-access
data-type [ ’=’ initial-value ]
-passing-mode ::=
-[ in ] | out | in out
-parameter-access ::=
-mutable | [immutable]
-declaration-of-returned-type ::=
-returns return-access data-type
-return-access ::=
-mutable |[ immutable ]| any
+passing-mode ::= [ in ] | out | in out
+parameter-access ::= mutable | [immutable]
+declaration-of-returned-type ::= returns return-access data-type
+return-access ::= mutable |[ immutable ]| any
+~~~~~
-The name **me **denotes the object to which the method is applied: you call this the “principal object” of the method. The passing mode expresses whether the direct content of the principal object or a parameter is either:
+The name **me** denotes the object to which the method is applied: you call this the “principal object” of the method. The passing mode expresses whether the direct content of the principal object or a parameter is either:
* read
* created and returned
* read then updated and returned by the method.
-Remember that the direct content of an argument of a type which is manipulated by value contains the internal representation of the object itself. Thus, when the argument is of this type, **out **and **in out **mean that the content of the object will undergo a modification. When the method is a function (as is the case for constructors), all the arguments must be **in **(read). This is the default mode.
+Remember that the direct content of an argument of a type which is manipulated by value contains the internal representation of the object itself. Thus, when the argument is of this type, **out** and **in out** mean that the content of the object will undergo a modification. When the method is a function (as is the case for constructors), all the arguments must be **in** (read). This is the default mode.
-In case of an argument of a type manipulated by a handle, the direct content being an object identifier, the passing mode addresses itself to the handle, and no longer to the internal representation of the object, the modification of which is controlled by the access right. An argument of this type declared **mutable **may see its internal representation modified. If declared **immutable**, it is protected. When a parameter is both **in out **and **mutable**, the identifiers passed and returned denote two distinct modifiable objects.
+In case of an argument of a type manipulated by a handle, the direct content being an object identifier, the passing mode addresses itself to the handle, and no longer to the internal representation of the object, the modification of which is controlled by the access right. An argument of this type declared **mutable** may see its internal representation modified. If declared **immutable**, it is protected. When a parameter is both **in out** and **mutable**, the identifiers passed and returned denote two distinct modifiable objects.
When the returned object is manipulated by a handle it can be declared modifiable or not, or indeterminate (**any**). To return an object with an indeterminate access right means that the method transmits the identifier without changing its state and that the method has no right to alter the access right. This functionality is particularly useful in the case of collections; temporarily storing an object in a structure and unable to modify its state.
-With the exception of the types predefined by the language, all types of parameters and returned objects, whether manipulated by a handle or by value, *must *appear in the **uses **clause of the class of which the method is a member.
-As is the case for constructors, some parameters can have a default value, provided that they are of primitive or enumerated type. They are passed in the **in **mode, and they are found at the end of the list of arguments.
+With the exception of the types predefined by the language, all types of parameters and returned objects, whether manipulated by a handle or by value, *must* appear in the **uses** clause of the class of which the method is a member.
+As is the case for constructors, some parameters can have a default value, provided that they are of primitive or enumerated type. They are passed in the **in** mode, and they are found at the end of the list of arguments.
Overloading of instance methods and use of exceptions and post-conditions is allowed and respects the same rules than constructors.
Note the overloading of “Coord” in the following example of instance methods associated with the persistent class “Point”:
-**Example**
+~~~~~
Coord (me; X, Y, Z : out Real);
---Purpose: returns the coordinates of me
Distance (me; P : Point) returns Real
---Purpose: returns the distance to a point
+~~~~~
-In all these cases, **me **is implicitly an object of type Point. Only “SetCoord” is able to modify the internal representation of a point.
+In all these cases, **me** is implicitly an object of type *Point*. Only “SetCoord” is able to modify the internal representation of a point.
-@subsubsection occt_1819379591_1972310108413 Class Methods
+@subsubsection occt_cdl_4_1_3 Class Methods
A class method is a function or procedure relative to the class it describes, but does not apply to a particular instance of the class.
-declaration-of-a-class-method ::=
-identifier formal-part-of-class-method
+~~~~~
+declaration-of-a-class-method ::= identifier formal-part-of-class-method
[ declaration-of-returned-type ]
[ exception-declaration ]
-formal-part-of-class-method ::=
-’(’ **myclass **{’;’ parameter}’)’
+formal-part-of-class-method ::= ’(’ myclass {’;’ parameter}’)’
+~~~~~
+
+The first parameter **myclass** indicates that the method does not apply to a previously created instance, but to the class itself. The rest of the syntax is identical to that of the instance methods. In particular, access rights (**mutable**, **immutable**, **any**) and the argument passing mode (**in**, **out**, **in out**) must remain unchanged. With the exception of the types predefined by the language, all types of parameters must appear in the **uses** clause of the class of which the method is a member. Overloading of class methods and the use of exceptions and post-conditions is allowed, and it follows the same rules as for constructors and instance methods.
-The first parameter **myclass **indicates that the method does not apply to a previously created instance, but to the class itself. The rest of the syntax is identical to that of the instance methods. In particular, access rights (**mutable**, **immutable**, **any**) and the argument passing mode (**in**, **out**, **in out**) must remain unchanged. With the exception of the types predefined by the language, all types of parameters must appear in the **uses **clause of the class of which the method is a member. Overloading of class methods and the use of exceptions and post-conditions is allowed, and it follows the same rules as for constructors and instance methods.
Examples of class methods associated with the class “Real”:
-**Example**
+~~~~~
First (myclass) returns Real;
---Purpose: returns lower limit of reals
Last (myclass) returns Real;
---Purpose: returns upper limit of reals
+~~~~~
-
-@subsubsection occt_1819379591_1972310108414 Package Methods
+@subsubsection occt_cdl_4_1_4 Package Methods
Package methods are methods which are members of a package. They are frequently used for library or application initialization, or for offering an application programming interface to the sources to the package. They are sometimes methods used for development purposes but which are not made available to final end-users of the package.
-package-method ::=
-identifier [simple-formal-part][returned-type-declaration]
+~~~~~
+package-method ::= identifier [simple-formal-part][returned-type-declaration]
[exception-declaration]
-[**is private**]’;’
-
+[is private]’;’
+~~~~~
-@subsubsection occt_1819379591_1972310108415 Sensitivity to Overloading
+@subsubsection occt_cdl_4_1_5 Sensitivity to Overloading
When there is more than one method of a class, several methods share the same name but have different syntax, you say the method is overloaded.
-In order that the methods can be considered distinct, they must differ either in the number of parameters, or one of their parameters must be of a different type. In particular, you *cannot *overload a method if you merely modify it as follows:
+In order that the methods can be considered distinct, they must differ either in the number of parameters, or one of their parameters must be of a different type. In particular, you *cannot* overload a method if you merely modify it as follows:
* The type of the returned object when the method behaves as a function
- * The name or the mode of passing a parameter
-(**in**, **out**, or **in out**)
- * The mutability of passed objects
-(**mutable**, **immutable**, **any**)
+ * The name or the mode of passing a parameter (**in**, **out**, or **in out**)
+ * The mutability of passed objects (**mutable**, **immutable**, **any**)
* Default value of a parameter.
-@subsection occt_1819379591_197231010842 Internal Representation
+
+@subsection occt_cdl_4_2 Internal Representation
-Each object contains its own state in a private space in the memory. This state consists of a set of **fields**,** **which include or reference other objects.
-**Example**
+Each object contains its own state in a private space in the memory. This state consists of a set of **fields**, which include or reference other objects.
-declaration-of-the-internal-representation-of-a-class
-::=
-**fields **field {field}
-field ::=
-identifier {’,’ identifier} ’:’ data-type [’[’integer
-{’,’integer}’]’]’;’
+**Example**
+~~~~~
+declaration-of-the-internal-representation-of-a-class ::= fields field {field}
+field ::= identifier {’,’ identifier} ’:’ data-type [’[’integer {’,’integer}’]’]’;’
+~~~~~
A copy of all the defined fields exists locally in each instance of the class. This group of fields will be initialized by the class constructors when the object is instantiated.
-Fields *must not *have the same name as any method of the class in which they appear. When the field type is followed by a list of integer constants between square brackets, the data will take the form of a multi-dimensional array containing objects of this type.
+Fields *must not* have the same name as any method of the class in which they appear. When the field type is followed by a list of integer constants between square brackets, the data will take the form of a multi-dimensional array containing objects of this type.
The following example shows two equivalent ways of describing three fields of the “Real” type:
-**Example**
+**Example**
+~~~~~
fields
x, y, z: Real;
coord: Real[3];
+~~~~~
+
Depending on their type, Object fields have one of the two forms. When the field is of the “manipulated by handle” type, it corresponds to an identifier. In this case, the contents of the object can be shared by other objects or by a handle in a program. When the field is of a “manipulated by value” type, it contains the value of the object. In this case you say the object is **embedded**.
-@subsection occt_1819379591_197231010843 Exceptions
+@subsection occt_cdl_4_3 Exceptions
Exceptions describe exceptional situations, which can arise during the execution of a method. With the raising of an exception, the normal course of program execution is interrupted. The actions carried out in response to this situation are called treatment of exception.
-
-exception-treatment ::= **raises **exception-name {’,’
-exception-name}
-
-Each exception name corresponds to a class of exceptions previously defined as being susceptible to being raised by the method under which it appears. Exception classes must all appear in the **raises **clause of the class of which the method is a member. The class of exceptions is analogous to the class of objects described in this manual.
+~~~~~
+exception-treatment ::= raises exception-name {’,’ exception-name}
+~~~~~
+Each exception name corresponds to a class of exceptions previously defined as being susceptible to being raised by the method under which it appears. Exception classes must all appear in the **raises** clause of the class of which the method is a member. The class of exceptions is analogous to the class of objects described in this manual.
Take for example the method which returns the x, y, or z coordinate of a point.
-**Example**
+~~~~~
Coord (me; i : Integer) returns Real
---Purpose:
-- Returns the abscissa (i=1)
-- of me.
raises OutOfRange;
-- if i is not equal to 1, 2, or 3.
+~~~~~
-Instance methods are likely to raise certain exceptions called **systematic exceptions **which do not have to appear. They are:
-
-**NullObject **Raised when the principal object does not exist.
-**ImmutableObject **Raised when a method tries to modify an immutable principal object.
+Instance methods are likely to raise certain exceptions called **systematic exceptions** which do not have to appear. They are:
-**TypeMismatch **Raised if an argument typed by association is of an unsuitable type.
+* *NullObject* - raised when the principal object does not exist.
+* *ImmutableObject* - raised when a method tries to modify an immutable principal object.
+* *TypeMismatch* - raised if an argument typed by association is of an unsuitable type.
These exceptions are described in the Standard Package (System Toolkits).
-@subsection occt_1819379591_197231010844 Inheritance
+@subsection occt_cdl_4_4 Inheritance
-@subsubsection occt_1819379591_1972310108441 Overview
+@subsubsection occt_cdl_4_4_1 Overview
The notion of inheritance comes from a development strategy according to which you begin by modeling data in the most general fashion. Then you specialize it more and more so as to correspond to more and more precise cases.
-For example, to develop a basic geometry, you can first of all consider the group of geometric objects, and then differentiate the points, vectors, and curves. You can specialize the latter into conic sections, and then decompose them into circles, ellipses, and hyperbolae. Then, the class of conics is considered as a sub-class of curves, and a super-class of circles.
+For example, to develop a basic geometry, you can first of all consider the group of geometric objects, and then differentiate the points, vectors, and curves. You can specialize the latter into conic sections, and then decompose them into circles, ellipses, and hyperbolas. Then, the class of conics is considered as a sub-class of curves, and a super-class of circles.
A sub-class has at least the behavior of its super-classes. Thus, a circle could be viewed as a conic, a curve, or even as a geometric object. In each case, the applicable methods belong to the level where you view the class. In this case, you say that the sub-class inherits the behavior from its super-classes.
-**Example**
-declaration-of-a-sub-class ::=
-**class **class-name
-**inherits **class-name
-[**uses **data-type {’,’ data-type}]
-[**raises **exception-name {’,’ exception-name}]
-**is **class-definition
-**end **[class-name]’;’
-A class cannot inherit one of its descendent classes; nor can it inherit a native type. All the classes of a system can be described in a non-cyclic diagram called the **inheritance graph**.
+**Example**
+~~~~~
+declaration-of-a-sub-class ::= class class-name
+inherits class-name
+[uses data-type {’,’ data-type}]
+[raises exception-name {’,’ exception-name}]
+is class-definition
+end [class-name]’;’
+~~~~~
-The definition of a sub-class is identical to that of a simple class. Note that a super-class *must not *appear in the **uses **clause of the sub-class, even if it appears in the definition of the sub-class. The behavior of a sub-class includes as a minimum all instance methods and protected methods of its super-classes.
+A class cannot inherit one of its descendent classes; nor can it inherit a native type. All the classes of a system can be described in a non-cyclic diagram called the **inheritance graph**.
-NOTE
-Note that constructors and class methods are never inherited.
+The definition of a sub-class is identical to that of a simple class. Note that a super-class must not appear in the **uses** clause of the sub-class, even if it appears in the definition of the sub-class. The behavior of a sub-class includes as a minimum all instance methods and protected methods of its super-classes.
+**Note** that constructors and class methods are never inherited.
-@subsubsection occt_1819379591_1972310108442 Redefining methods
+@subsubsection occt_cdl_4_4_2 Redefining methods
Certain inherited methods can be redefined.
+
**Example**
-declaration-of-a-redefined-method ::=
-identifier formal-part-of-instance-method [returnedtype-
-declaration]
+~~~~~
+declaration-of-a-redefined-method ::= identifier formal-part-of-instance-method [returnedtype- declaration]
[declaration-of-exceptions]
-** is redefined **[visibility]’;’
+is redefined [visibility]’;’
+~~~~~
A redefined method must conform to the syntax described in the super-class where it appears. The exceptions contained in the super-class can be renewed, and others may be added as long as they inherit from an ancestor class.
-The **redefined **attribute can be applied neither to a constructor, nor to a class method, since neither of them can be inherited. If the redefined method is private or protected, the visibility must be exactly repeated in the redefinition. For further details on visibility, refer to <a href="#Visibility">“Visibility”</a> on page 48.
-**Example**
+The redefined attribute can be applied neither to a constructor, nor to a class method, since neither of them can be inherited. If the redefined method is private or protected, the visibility must be exactly repeated in the redefinition. For further details on visibility, refer to <a href="#occt_cdl_4_6"> Visibility </a> section.
+
+**Example**
+~~~~~
SquareDistance (me; P : Point) returns Real
is redefined private;
+~~~~~
With regards to the internal representation, all fields defined in the super-classes are, by default, inherited, but they can also be redefined.
-@subsubsection occt_1819379591_1972310108443 Non-redefinable methods
+@subsubsection occt_cdl_4_4_3 Non-redefinable methods
-Instance methods, which are declared virtual are redefinable in descendent classes, and you can force this redefinition by making a method **deferred**. For more details, see the next section.
+Instance methods, which are declared virtual are redefinable in descendent classes, and you can force this redefinition by making a method **deferred**. For more details, see the next section.
+
**Example**
-declaration-of-a-non-redefinable-method ::=
-identifier formal-part-of-instance-method [returnedtype-
-declaration]
+~~~~~
+declaration-of-a-non-redefinable-method ::= identifier formal-part-of-instance-method [returnedtype- declaration]
[declaration-of-exceptions]
-** is virtual **[visibility]’;’
+ is virtual [visibility]’;’
+~~~~~
-All methods are static by default. To enable redefinition in all the child classes, add “**is virtual;**“ when declaring the method.
+All methods are static by default. To enable redefinition in all the child classes, add **is virtual** when declaring the method.
You must also be able to forbid redefinition. A redefinable method can become non-redefinable if you declare: **is redefined static**.
-@subsubsection occt_1819379591_1972310108444 Deferred Classes and Methods
+@subsubsection occt_cdl_4_4_4 Deferred Classes and Methods
The presence of certain classes in the inheritance graph can be justified purely by their ability to force certain behavior on other classes, in other words, to make other classes provide various services.
The CDL language allows you to describe a class, which introduces methods without implementing them, so as to force its descendent classes to define them. These are called **deferred classes**; the non-implemented methods are also termed **deferred methods**.
-**Example**
-declaration-of-a-deferred-class ::=
-**deferred class **class-name
- [**inherits **class-name
-[**uses **data-type {’,’ data-type}]
-[**raises **exception-name {’,’ exception-name}]
-**is **class-definition
-**end **[class-name]’;’
-declaration-of-a-deferred-method ::=
-identifier formal-part-of-instance-method [returnedtype-
-declaration]
+
+**Example**
+~~~~~
+declaration-of-a-deferred-class ::= deferred class class-name
+[inherits class-name [uses data-type {’,’ data-type}]
+[raises exception-name {’,’ exception-name}]
+is class-definition
+end [class-name]’;’
+declaration-of-a-deferred-method ::= identifier formal-part-of-instance-method [returnedtype- declaration]
[declaration-of-exceptions]
-**is deferred **[visibility]’;’
+is deferred [visibility]’;’
+~~~~~
Only instance methods can be deferred.
It is sufficient for a class to contain one deferred method for it to be a deferred class. It can contain any number of deferred methods (or none).
-A deferred class may still have an internal representation but one or more **non-** **protected **constructors would be necessary to initialize them. The constructors must be visible in the sub-classes.
+A deferred class may still have an internal representation but one or more **non-protected** constructors would be necessary to initialize them. The constructors must be visible in the sub-classes.
-The constructors of a deferred class are called **Initialize **(not **Create**). They are **protected **by default, and do not return any object. You cannot create an object of a deferred class type.
-For example, consider the class “Point”, and its declaration as deferred.
-**Example**
+The constructors of a deferred class are called **Initialize** (not **Create**). They are **protected** by default, and do not return any object. You cannot create an object of a deferred class type.
+For example, consider the class *Point*, and its declaration as deferred.
+**Example**
+~~~~~
deferred class Point inherits Geometry is
Initialize;
---Purpose: Initializes the point.
Distance (me; P : Point) returns Real;
---Purpose: Returns the distance from the point P
end Point;
+~~~~~
-Notice that the function “Distance” is not deferred. Although this class contains no representation, this method is programmable by calling “Coord”.
+Notice that the function *Distance* is not deferred. Although this class contains no representation, this method is programmable by calling *Coord*.
-In a sub-class of a deferred class, all deferred methods, which have been inherited, *must *be implemented, then redeclared (the attribute **redefined **is useless for this purpose), unless the sub-class is itself deferred.
+In a sub-class of a deferred class, all deferred methods, which have been inherited, must be implemented, then redeclared (the attribute **redefined** is useless for this purpose), unless the sub-class is itself deferred.
A non-deferred method can be redefined as a deferred one, in which case it will be declared as follows: **is redefined deferred**.
-The notion of deferred class is very useful. The advantage of introducing it, as was previously shown in the deferred class “Point”, is that the corresponding resources will be available even before being implemented. Later, you can add different representations to Point (for example, spherical or Cartesian coordinates) without having to modify client programs.
+The notion of deferred class is very useful. The advantage of introducing it, as was previously shown in the deferred class *Point*, is that the corresponding resources will be available even before being implemented. Later, you can add different representations to Point (for example, spherical or Cartesian coordinates) without having to modify client programs.
Thanks to the possibility of redefining methods, this approach does not have any negative impact on performance: a method implemented at the level of a deferred class can be reprogrammed in one of its sub-classes while taking into account the data representation.
-@subsubsection occt_1819379591_1972310108445 Declaration by Association
-
-At the heart of a class hierarchy, object identifiers are compatible in the ascendant sense. Since the Conic class is descended from the Curve class, an identifier of type Curve can reference an object of type Conic (remember that the behavior of Curve is applicable to Conic). In other words, you can assign a reference to a Conic to an identifier of type Curve, but *not *vice versa.
-For example, once the classes have been compiled you could write a C++ test program in which you instantiate a Conic but reference it with a handle to a Curve:
+@subsubsection occt_cdl_4_4_5 Declaration by Association
-**Example**
+At the heart of a class hierarchy, object identifiers are compatible in the ascendant sense. Since the *Conic* class is descended from the *Curve* class, an identifier of type *Curve* can reference an object of type *Conic* (remember that the behavior of *Curve* is applicable to *Conic*). In other words, you can assign a reference to a *Conic* to an identifier of type *Curve*, but not vice versa.
+For example, once the classes have been compiled you could write a C++ test program in which you instantiate a Conic but reference it with a handle to a Curve:
+~~~~~
Handle(Curve) c = new Conic
+~~~~~
+This same rule applies to parameters of methods; that is to say, you can call a method with identifiers corresponding to a sub-type of that specified in its declaration. To illustrate this, let us go back to the “Distance” method of the “Point” class:
-This same rule applies to parameters of methods; that is to say, you can call a method with identifiers corresponding to a sub-type of that specified in its declaration. To illustrate this, you go back to the “Distance” method of the “Point” class:
-**Example**
-
+~~~~~
Distance (me; P : point) returns Real;
-
+~~~~~
Conforming to the rule of type compatibility, you could make a call to the method “Distance” with reference to an object from a class descended from “Point”. Consequently, if “SphericPoint” is a sub-class of “Point” and therefore inherits this method, it will be possible to calculate the distance between two “SphericPoint”, or between a “SphericPoint” and a “Point”, without having to redefine the method.
On the other hand, sometimes you may want to force two parameters to be exactly of the same type, and thus not apply the rule of type compatibility. To do this, you need to associate the type of the concerned parameters in the method declaration.
-**Example**
-
-association-typing ::=
-**like **associated-parameter
-associated-parameter ::=
-**me **| identifier
+~~~~~
+association-typing ::= like associated-parameter
+associated-parameter ::= me | identifier
+~~~~~
-NOTE
-***Note that identifier is the name of a parameter, which appears***
-***first in the formal part of the declaration of the method.***
+Note that identifier is the name of a parameter, which appears first in the formal part of the declaration of the method.
You can use this technique, which consists in declaring by association, to declare a method that will exchange the content of two objects, or a method, which copies another object:
-**Example**
+~~~~~
Swap (me : mutable; With : mutable like me);
DeepCopy (me) returns mutable like me;
+~~~~~
-Make sure *not *to write the Swap method as in the syntax below:
+Make sure not to write the Swap method as in the syntax below:
-**Example**
+~~~~~
Swap (me : mutable; With : mutable Point);
+~~~~~
+
+In this case **me** may be a CartesianPoint or a SphericalPoint, while *With* can only be a Point.
-In this case **me **may be a CartesianPoint or a SphericalPoint, while “With” can only be a Point.
-@subsubsection occt_1819379591_1972310108446 Redefinition of Fields
+@subsubsection occt_cdl_4_4_6 Redefinition of Fields
The creation of a hierarchy of classes should be viewed as a means to specialize their behavior, (e.g. a circle is more specialized than a conic section). The more you specialize the object classes, the more it is justified to call into question the inherited fields in order to obtain greater optimization. So, in the description of the internal representation of a sub-class, it is possible not to inherit all of the fields of the super-classes. You then say the fields have been redefined.
-**Example**
-redefinition-of-the-representation-of-a-class ::=
-**redefined **redefinition-of-a-field {’,’ redefinition-of-a-
+~~~~~
+redefinition-of-the-representation-of-a-class ::= redefined redefinition-of-a-field {’,’ redefinition-of-a-
field}’,’
-redefinition-of-a-field ::=
-[field-name] **from **[**class**] class-name
+redefinition-of-a-field ::= [field-name] from [class] class-name
+~~~~~
-Redefinition of fields can *only *be done in classes manipulated by a handle.
+Redefinition of fields can only be done in classes manipulated by a handle.
This declaration appears at the beginning of the definition of the internal representation of the sub-class, which breaks the field inheritance. The non-inherited fields are all those which come from the class specified behind the rubric **from**.
-@subsection occt_1819379591_197231010845 Genericity
+@subsection occt_cdl_4_5 Genericity
-@subsubsection occt_1819379591_1972310108451 Overview
+@subsubsection occt_cdl_4_5_1 Overview
Inheritance is a powerful mechanism for extending a system, but it does not always allow you to avoid code duplication, particularly in the case where two classes differ only in the type of objects they manipulate (you certainly encounter this phenomenon in all basic structures). In such cases, it is convenient to send arbitrary parameters representing types to a class. Such a class is called a **generic class**. Its parameters are the generic types of the class.
Generic classes are implemented in two steps. You first declare the generic class to establish the model, and then instantiate this class by giving information about the generic types.
-@subsubsection occt_1819379591_1972310108452 Declaration of a Generic Class
+@subsubsection occt_cdl_4_5_2 Declaration of a Generic Class
The syntax is as follows:
-**Example**
-declaration-of-a-generic-class ::=
-[**deferred**] **generic class **class-name ’(’generic-type
-{’,’generic-type}’)’
-[**inherits **class-name
-[**uses **data-type {’,’ data-type}]
-[**raises **exception-name {’,’ exception-name}]
-**is **class-definition
-**end **[class-name]’;’
-generic-type ::=
-identifier **as **type-constraint
-type-constraint ::=
-**any **| class-name [’(’data-type {’,’data-type}’)’]
+~~~~~
+declaration-of-a-generic-class ::= [deferred] generic class class-name ’(’generic-type {’,’generic-type}’)’
+[inherits class-name
+[uses data-type {’,’ data-type}]
+[raises exception-name {’,’ exception-name}]
+ is class-definition
+ end [class-name]’;’
+generic-type ::= identifier as type-constraint
+type-constraint ::= any | class-name [’(’data-type {’,’data-type}’)’]
+~~~~~
The names of generic types become new types, which are usable in the definition of a class, both in its behavior (methods) and its representation (fields). The generic type is only visible inside the generic class introducing it. As a result, it is possible to have another generic class using the same generic type within the same package.
+
When you specify the type constraint under the form of a class name, you impose a minimum set of behavior on the manipulated object.
This shows that the generic type has as a minimum the services defined in the class. This can be any kind of a previously defined class, including another generic class, in which case you state exactly with what types they are instantiated.
A generic class can be a deferred class. A generic class can also accept a deferred class as its argument. In both these cases any class instantiated from it will also be deferred. The resulting class can then be inherited by another class.
-Below is a partial example of a generic class: a persistent singly linked list.
-**Example**
-
+Below is a partial example of a generic class: a persistent singly linked list.
+
+~~~~~
generic class SingleList (Item as Storable)
-inherits Persistent
-raises NoSuchObject
-is
-Create returns mutable SingleList;
+ inherits Persistent
+ raises NoSuchObject
+ is
+ Create returns mutable SingleList;
---Purpose: Creates an empty list
-IsEmpty (me) returns Boolean;
- ---Purpose: Returns true if the list me is empty
-SwapTail (me : mutable; S : in out mutable
-SingleList)
- ---Purpose: Exchanges the tail of list me with S
--- Exception NoSuchObject raised when me is
-empty
-raises NoSuchObject;
- Value (me) returns Item
- ---Purpose: Returns first element of the list me
--- Exception NoSuchObject raised when me is
-empty
-raises NoSuchObject;
- Tail (me) returns mutable SingleList
----Purpose: Returns the tail of the list me
--- Exception NoSuchObject raised when me is
-empty
-raises NoSuchObject;
- fields
-Data : Item;
- Next : SingleList;
- end SingleList;
+ IsEmpty (me) returns Boolean;
+ ---Purpose: Returns true if the list me is empty
+ SwapTail (me : mutable; S : in out mutable
+ SingleList)
+ ---Purpose: Exchanges the tail of list me with S
+ -- Exception NoSuchObject raised when me is empty
+ raises NoSuchObject;
+ Value (me) returns Item
+ ---Purpose: Returns first element of the list me
+ -- Exception NoSuchObject raised when me is empty
+ raises NoSuchObject;
+ Tail (me) returns mutable SingleList
+ ---Purpose: Returns the tail of the list me
+ -- Exception NoSuchObject raised when me is empty
+ raises NoSuchObject;
+ fields
+ Data : Item;
+ Next : SingleList;
+ end SingleList;
+~~~~~
Even though no object of the type “SingleList” IS created, the class contains a constructor. This class constitutes a model, which will be recopied at instantiation time to create a new class which will generate objects. The constructor will then be required.
-**Example**
+**Example**
+~~~~~
generic class Sequence(Item as any, Node as
SingleList(Item))
inherits Object
. . .
end Sequence
+~~~~~
-In the above example, there are two generic types: Item & Node. The first imposes no restriction. The second must at least have available the services of the class SingleList instantiated with the type with which Sequence will itself be instantiated.
+In the above example, there are two generic types: *Item* and *Node*. The first imposes no restriction. The second must at least have available the services of the class *SingleList* instantiated with the type with which *Sequence* will itself be instantiated.
-In the **incomplete declaration of a generic class**, the keyword **generic **must appear.
-**Example**
+In the incomplete declaration of a generic class, the keyword **generic** must appear.
+**Example**
+~~~~~
generic class SingleList;
generic class Sequence;
-@subsubsection occt_1819379591_1972310108453 Instantiation of a Generic Class
+~~~~~
+
+@subsubsection occt_cdl_4_5_3 Instantiation of a Generic Class
The syntax is as follows:
-**Example**
-instantiation-of-a-generic-class ::=
-[**deferred**] **class **class-name
-** instantiates **class-name ’(’data-type {’,’
-data-type}’);’
+~~~~~
+instantiation-of-a-generic-class ::= [deferred] class class-name
+ instantiates class-name ’(’data-type {’,’ data-type}’);’
+~~~~~
Instantiation is said to be **static**. In other words, it must take place before any use can be made of the type of the instantiated class. Each data type is associated term by term with those declared at the definition of the generic class. These latter ones, when they are not of the type **any**, restrict instantiation to those classes, which have a behavior at least equal to that of the class specified in the type constraint, including constructors. Note that this is not guaranteed by inheritance itself.
-For example, let’s instantiate the class “Sequence” for the type “Point”:
-**Example**
+For example, let’s instantiate the class *Sequence* for the type *Point*:
+~~~~~
class SingleListOfPoint instantiates SingleList(Point);
class Sequence instantiates
-Sequence(Point,SingleListOfPoint);
+ Sequence(Point,SingleListOfPoint);
+~~~~~
-The instantiation of a generic deferred class is a deferred class (the **deferred **attribute must be present during instantiation). An instantiated class cannot be declared in an incomplete fashion.
+The instantiation of a generic deferred class is a deferred class (the **deferred** attribute must be present during instantiation). An instantiated class cannot be declared in an incomplete fashion.
-@subsubsection occt_1819379591_1972310108454 Nested Generic Classes
+@subsubsection occt_cdl_4_5_4 Nested Generic Classes
+
+It often happens that many classes are linked by a common generic type. This is the case when a base structure provides an iterator, for example, in the class *Graph*. A graph is made up of arcs, which join together the nodes, which reference objects of any type. This type is generic both for the graph and for the node. In this context, it is necessary to make sure that the group of linked generic classes is indeed instantiated for the same type of object. So as to group the instantiation, CDL allows the declaration of certain classes to be nested.
-It often happens that many classes are linked by a common generic type. This is the case when a base structure provides an iterator, for example, in the class “Graph”. A graph is made up of arcs, which join together the nodes, which reference objects of any type. This type is generic both for the graph and for the node. In this context, it is necessary to make sure that the group of linked generic classes is indeed instantiated for the same type of object. So as to group the instantiation, CDL allows the declaration of certain classes to be nested.
**Example**
-declaration-of-a-generic-class ::=
- [**deferred**] **generic class **class-name ’(’generic-
-type{’,’generic-type}’)’
- [**inherits **class-name {’,’ class-name}]
- [**uses **data-type {’,’ data-type}]
- [**raises **exception-name {’,’ exception-name}]
+~~~~~
+declaration-of-a-generic-class ::= [deferred] generic class class-name ’(’generic-type{’,’generic-type}’)’
+ [inherits class-name {’,’ class-name}]
+ [uses data-type {’,’ data-type}]
+ [raises exception-name {’,’ exception-name}]
[{[visibility] class-declaration}]
-** is **class-definition
-**end **[class-name]’;’
- class-declaration ::=
- incomplete-declaration-of-a-class |
- declaration-of-a-non-generic-class |
- instantiation-of-a-generic-class
+ is class-definition
+end [class-name]’;’
+ class-declaration ::= incomplete-declaration-of-a-class | declaration-of-a-non-generic-class | instantiation-of-a-generic-class
+~~~~~
-**Nested classes**, even though they are described as non-generic classes, are generic by construction, being inside the class of which they are a part. As a consequence, the generic types introduced by the **encompassing class **can be used in the definition of the nested class. This is true even if the generic type is only used in a nested class. The generic types still* must *appear as an argument of the encompassing class. All other types used by a nested class *must *appear in its **uses **or **raises **clauses, just as if it were an independent class.
+**Nested classes**, even though they are described as non-generic classes, are generic by construction, being inside the class of which they are a part. As a consequence, the generic types introduced by the **encompassing class** can be used in the definition of the nested class. This is true even if the generic type is only used in a nested class. The generic types still must appear as an argument of the encompassing class. All other types used by a nested class must appear in its **uses** or **raises** clauses, just as if it were an independent class.
-Nested classes are, by default, **public**. In other words, they can be used by the clients of the encompassing class. On the other hand, when one of the nested classes is declared **private **or **protected**, this class *must not *appear in any of the public methods of the other classes. It cannot be used in a protected field because then it could be used in a sub-class, which implies it would not be private.
+Nested classes are, by default, **public**. In other words, they can be used by the clients of the encompassing class. On the other hand, when one of the nested classes is declared **private** or **protected**, this class must not appear in any of the public methods of the other classes. It cannot be used in a protected field because then it could be used in a sub-class, which implies it would not be private.
The following example shows how to write the Set class with its iterator.
-**Example**
+~~~~~
generic class Set (Item as Storable)
-inherits Persistent
-private class Node instantiates SingleList (Item);
-class Iterator
- uses Set, Node
- raises NoSuchObject, NoMoreObject
- is
- Create (S : Set) returns mutable Iterator;
----Purpose: Creates an iterator on the group S
- More (me) returns Boolean;
----Purpose: Returns true if there are still elements
- -- to explore
- Next (me) raises NoMoreObject;
----Purpose: Passes to the following element
- Value (me) returns any Item raises NoSuchObject;
----Purpose: Returns the current element
- fields
- Current : Node;
-end Iterator;
-is
- Create returns mutable Set;
----Purpose: Creates an empty group
- IsEmpty (me) returns Boolean;
----Purpose: Returns true if the group is empty
- Add (me : mutable; T : Item);
----Purpose: Adds an item to the group me
- Remove (me : mutable; T : item) raises
-NoSuchObject;
----Purpose: Removes an item from the group me
- etc.
- fields
- Head : Node;
-end Set;
-
-Note that in their fields, both “Set” and “Iterator” are clients of another class, “Node”. This last can be effectively declared **private **for it only appears in fields which are themselves private.
+ inherits Persistent
+ private class Node instantiates SingleList (Item);
+ class Iterator
+ uses Set, Node
+ raises NoSuchObject, NoMoreObject
+ is
+ Create (S : Set) returns mutable Iterator;
+ ---Purpose: Creates an iterator on the group S
+ More (me) returns Boolean;
+ ---Purpose: Returns true if there are still elements
+ -- to explore
+ Next (me) raises NoMoreObject;
+ ---Purpose: Passes to the following element
+ Value (me) returns any Item raises NoSuchObject;
+ ---Purpose: Returns the current element
+ fields
+ Current : Node;
+ end Iterator;
+ is
+ Create returns mutable Set;
+ ---Purpose: Creates an empty group
+ IsEmpty (me) returns Boolean;
+ ---Purpose: Returns true if the group is empty
+ Add (me : mutable; T : Item);
+ ---Purpose: Adds an item to the group me
+ Remove (me : mutable; T : item) raises
+ NoSuchObject;
+ ---Purpose: Removes an item from the group me
+ etc.
+ fields
+ Head : Node;
+ end Set;
+~~~~~
+
+Note that in their fields, both “Set” and “Iterator” are clients of another class, “Node”. This last can be effectively declared **private** for it only appears in fields which are themselves private.
The instantiation of a generic class containing nested classes remains unchanged. The same declaration is used to instantiate the encompassing class and the nested classes. These latter will have their name suffixed by the name supplied at instantiation, separated by “Of”. For example, you instantiate the class “Set” described above for the type “Point” as follows:
-**Example**
+~~~~~
class SetOfPoint instantiates Set(Point);
-
+~~~~~
In doing so, you implicitly describe the classes “NodeOfSetOfPoint” and “IteratorOfSetOfPoint”, which are respectively the result of the concatenation of “Node” and “Iterator” with “Of” then “SetOfPoint”.
-Note that in the incomplete declaration of an encompassing class, all the names of the nested classes *must *appear behind that of the encompassing class.
+Note that in the incomplete declaration of an encompassing class, all the names of the nested classes *must* appear behind that of the encompassing class.
-incomplete-declaration-of-a-generic-class ::=
-[**deferred**] **generic **class-name {’,’ class-name};
+~~~~~
+incomplete-declaration-of-a-generic-class ::= [deferred] generic class-name {’,’ class-name};
+~~~~~
For example, an incomplete declaration of the above class “Set” would be as in the example below:
-**Example**
+~~~~~
generic class Set, Node, Iterator;
+~~~~~
Only the encompassing class can be deferred. In the above example only the class “Set” can be deferred.
-@subsection occt_1819379591_197231010846 Visibility
+@subsection occt_cdl_4_6 Visibility
-@subsubsection occt_1819379591_1972310108461 Overview
+@subsubsection occt_cdl_4_6_1 Overview
A field, method, class, or package method is only available for use if it is **visible**.
Each of these components has a default visibility, which can be explicitly modified during class or package declaration. The three possible states of visibility are:
-
* Public
* Private
* Protected
-@subsubsection occt_1819379591_1972310108462 Visibility of Fields
+@subsubsection occt_cdl_4_6_2 Visibility of Fields
-A field is **private**. It can never be public - this would destroy the whole concept of data encapsulation. The attribute **private **is redundant when it is applied to a field. This means that a field is only visible to methods within its own class.
-A field can be declared **protected **which means that it becomes visible in subclasses of its own class. Its contents can be modified by methods in subclasses.
+A field is **private**. It can never be public - this would destroy the whole concept of data encapsulation. The attribute **private** is redundant when it is applied to a field. This means that a field is only visible to methods within its own class.
+A field can be declared **protected**, which means that it becomes visible in subclasses of its own class. Its contents can be modified by methods in subclasses.
-field ::=
-identifier {’,’ identifier} ’:’ data-type
+~~~~~
+field ::= identifier {’,’ identifier} ’:’ data-type
[’[’integer{’,’integer}’]’]
-[**is protected**]’;’
-Example
+[is protected]’;’
+~~~~~
+
+**Example**
+~~~~~
fields
Phi, Delta, Gamma : AngularMomenta [3]
is protected ;
+~~~~~
+@subsubsection occt_cdl_4_6_3 Visibility of Methods
-@subsubsection occt_1819379591_1972310108463 Visibility of Methods
+Methods act on fields. Only methods belonging to a class can act on the fields of the class; this stems from the principle of object encapsulation. Methods can be characterized in three ways: by default, methods are **public**. Methods can be declared **private** or **protected** to restrict their usage.
-Methods act on fields. Only methods belonging to a class can act on the fields of the class; this stems from the principle of object encapsulation. Methods can be characterized in three ways: by default, methods are **public**. Methods can be declared **private **or **protected **to restrict their usage.
-
-**Public methods **Are the default and are generally the most common. They describe the behavior of a class or a package, and they are callable by any part of a program.
-
-**Private methods **Exist only for the internal structuring of their class or their package. Private class methods can only be called by methods belonging to the same class. Private package methods can only be called by all methods belonging to the same package and its classes.
-
-**Protected methods **Are private methods, which are also callable from the interior of descendent classes.
+* **Public** methods are the default and generally the most common. They describe the behavior of a class or a package, and they are callable by any part of a program.
+* **Private** methods exist only for the internal structuring of their class or their package. Private class methods can only be called by methods belonging to the same class. Private package methods can only be called by all methods belonging to the same package and its classes.
+* **Protected** methods are private methods, which are also callable from the interior of descendent classes.
If you want to restrict the usage of a method, you associate with it a visibility as follows :
+~~~~~
+-- declaration-of-the-visibility ::= is visibility
+visibility ::= private | protected
+~~~~~
--- declaration-of-the-visibility ::=
-**is **visibility
-visibility ::= **private **| **protected**
-
-The declaration of the visibility of a method appears at the end of its definition, before the final semi-colon. The attribute **private **indicates that the method will only be visible to the behavior of the class of which the method is a member; **protected **will propagate the visibility among the sub-classes of this class.
+The declaration of the visibility of a method appears at the end of its definition, before the final semi-colon. The attribute **private** indicates that the method will only be visible to the behavior of the class of which the method is a member; **protected** will propagate the visibility among the sub-classes of this class.
For example, add to the class “Line” an internal method allowing the calculation of the perpendicular distance to the power of two, from the line to a point.
-**Example**
+~~~~~
SquareDistance (me; P : Point) returns Real
-@subsubsection occt_1819379591_1972310108464 Visibility of Classes, Exceptions, & Enumerations
+is private;
+~~~~~
+
+@subsubsection occt_cdl_4_6_4 Visibility of Classes, Exceptions and Enumerations
-The visibility of a class is the facility to be able to use this class in the definition of another class. The visibility of a class extends from the beginning of its declaration up to the end of the package in which it appears. You have seen that the keyword **uses **allows extension of this visibility to other packages.
+The visibility of a class is the facility to be able to use this class in the definition of another class. The visibility of a class extends from the beginning of its declaration up to the end of the package in which it appears. You have seen that the keyword **uses** allows extension of this visibility to other packages.
-As was explained in the section on “<a href="#Name_Space">Name Space</a>”, any ambiguity, which arises from having two classes with the same name coming from different packages, is dealt with by the use of the keyword **from**.
+As was explained in the section on “<a href="#occt_cdl_3_3_2">Name Space</a>”, any ambiguity, which arises from having two classes with the same name coming from different packages, is dealt with by the use of the keyword **from**.
-A class declared **private **is only available within its own package.
+A class declared **private** is only available within its own package.
-@subsubsection occt_1819379591_1972310108465 Friend Classes & Methods
+@subsubsection occt_cdl_4_6_5 Friend Classes and Methods
-In certain cases, methods need to have direct access to the private or protected parts of classes of which they are clients. Such a method is called a **friend **of the class, which is accessed. For example, you declare a method to be a friend when a service can only be obtained via the use of another non-descendent class, or perhaps when this will help to improve performance.
+In certain cases, methods need to have direct access to the private or protected parts of classes of which they are clients. Such a method is called a **friend** of the class, which is accessed. For example, you declare a method to be a friend when a service can only be obtained via the use of another non-descendent class, or perhaps when this will help to improve performance.
Classes can also be declared friends of other classes. In this case all the methods of the friend class will have access to the fields and methods of the host class. The right is **not reciprocal**.
Friend classes or methods are declared inside the class, which reveals its private and protected data or methods to them. This helps in managing the continuing evolution of a class, helping to recognize and to avoid the creation of side effects.
-**Example**
-declaration-of-friends ::=
-**friends **friend {’,’friend}
- friend ::=
- identifier **from **[**class**] class-name [formal-part] |
-**Defining the Software Components 67**
-identifier **from **[**package**] package-name [formal-part] |
-** class**] class-name
- formal-part ::=
- simple-formal-part |
- formal-part-of-instance-method |
- formal-part-of-class-method
+**Example**
+~~~~~
+declaration-of-friends ::= friends friend {’,’friend}
+ friend ::= identifier from [class] class-name [formal-part] |
+-- Defining the Software Components 67
+identifier from [package] package-name [formal-part] | class] class-name
+ formal-part ::= simple-formal-part | formal-part-of-instance-method | formal-part-of-class-method
+~~~~~
-The formal part *must *be presented if the method contains one; thus this can be overloaded without necessarily propagating the friend relationship among its homonyms. The keyword **class **allows you to avoid certain ambiguities. For example, it removes any confusion between “method M from class C” and “method M from package P”.
+The formal part must be present if the method contains one; thus this can be overloaded without necessarily propagating the friend relationship among its homonyms. The keyword **class** allows you to avoid certain ambiguities. For example, it removes any confusion between “method M from class C” and “method M from package P”.
As an example, take a method, which calculates the perpendicular distance between a line and a point. Suppose this method needs to access the fields of the point. In the class “Point” you would write:
-**Example**
+~~~~~
friends Distance from Line (me; P : Point)
+~~~~~
-A method can be a friend to many classes. The class to which the method belongs does *not *need to appear in the **uses **clause of other classes of which it is a friend.
-
- @image html /dev_guides/cdl/images/cdl_image011.png
- @image latex /dev_guides/cdl/images/cdl_image011.png
+A method can be a friend to many classes. The class to which the method belongs does not need to appear in the **uses** clause of other classes of which it is a friend.
When the methods of a class are all friends of another class, you can establish the friendship at the level of the class.
-Figure 9. Visibility of various components
-@section occt_1819379591_858765726 Appendix A. Syntax Summary
+
+| | Public | Private | Protected |
+| :---- | :---- | :---- | :----- |
+| Field | Does not exist | **Default** - Visible to methods in its own class and in friend classes | Visible to methods in its own class, sub-classes and friend classes |
+| Method | **Default** - Callable anywhere | Callable by methods in its own class and in friend classes | Callable by methods in its own class, sub-classes and friend classes |
+| Class | **Default** - Visible everywhere with the use of **from** rubric | Visible to classes in its own package | Does not exist |
+| Package method | **Default** - Callable everywhere with the use of **from** rubric | Visible to classes in its own package | Does not exist |
+| Nested Class | **Default** - Visible to the clients of the encompassing class | Visible to the encompassing class and other classes nested in the encompassing class | Does not exist |
+@section occt_cdl_5 Appendix A. Syntax Summary
-This summary of the CDL syntax will aid in the comprehension of the language, but does *not *constitute an exact definition thereof. In particular, the grammar described here accepts a super-set of CDL constructors semantically validated.
-(1) capital ::=
-’A’ | ’B’ | ’C’ | ’D’ | ’E’ | ’F’ | ’G’ | ’H’ |
-’I’ | ’J’ | ’K’ | ’L’ | ’M’ | ’N’ |
-’O’ | ’P’ | ’Q’ | ’R’ | ’S’ | ’T’ | ’U’ | ’V’ |
-’W’ | ’X’ | ’Y’ | ’Z’
+This summary of the CDL syntax will aid in the comprehension of the language, but does *not* constitute an exact definition thereof. In particular, the grammar described here accepts a super-set of CDL constructors semantically validated.
-(2) non-capital ::=
-’a’ | ’b’ | ’c’ | ’d’ | ’e’ | ’f’ | ’g’ | ’h’ |
-’i’ | ’j’ | ’k’ | ’l’ | ’m’ | ’n’ |
-’o’ | ’p’ | ’q’ | ’r’ | ’s’ | ’t’ | ’u’ | ’v’ |
-’w’ | ’x’ | ’y’ | ’z’
+(1) capital ::= ’A’ | ’B’ | ’C’ | ’D’ | ’E’ | ’F’ | ’G’ | ’H’ | ’I’ | ’J’ | ’K’ | ’L’ | ’M’ | ’N’ |
+’O’ | ’P’ | ’Q’ | ’R’ | ’S’ | ’T’ | ’U’ | ’V’ | ’W’ | ’X’ | ’Y’ | ’Z’
-(3) digit ::=
-’0’ | ’1’ | ’2’ | ’3’ | ’4’ | ’5’ | ’6’ | ’7’ |
-’8’ | ’9’
+(2) non-capital ::= ’a’ | ’b’ | ’c’ | ’d’ | ’e’ | ’f’ | ’g’ | ’h’ | ’i’ | ’j’ | ’k’ | ’l’ | ’m’ | ’n’ |
+’o’ | ’p’ | ’q’ | ’r’ | ’s’ | ’t’ | ’u’ | ’v’ | ’w’ | ’x’ | ’y’ | ’z’
-(4) underscore ::=
-’_’
+(3) digit ::= ’0’ | ’1’ | ’2’ | ’3’ | ’4’ | ’5’ | ’6’ | ’7’ | ’8’ | ’9’
-(5) special character ::=
-’ ’ | ’!’ | ’”’ | ’#’ | ’$’ | ’%’ | ’&’ | ’’’ |
-’(’ | ’)’ | ’*’ | ’+’ | ’,’ | ’-’ |
-’.’ | ’/’ | ’:’ | ’;’ | ’’ | ’=’ | ’’ | ’?’ |
-’@’ | ’[’ | ’\’ | ’]’ | ’^’ | ’‘’ |
-’{’ | ’|’ | ’}’ | ’~’
+(4) underscore ::= ’_’
-(6) printable character::=
-capitals | non-capitals | digits | underscore |
-special characters
+(5) special character ::= ’ ’ | ’!’ | ’”’ | ’#’ | ’$’ | ’%’ | ’&’ | ’’’ | ’(’ | ’)’ | ’*’ | ’+’ | ’,’ | ’-’ | ’.’ | ’/’ | ’:’ | ’;’ | ’’ | ’=’ | ’’ | ’?’ | ’@’ | ’[’ | ’\’ | ’]’ | ’^’ | ’‘’ | ’{’ | ’|’ | ’}’ | ’~’
-(7) letter ::=
-capital | non-capital
+(6) printable character::= capitals | non-capitals | digits | underscore | special characters
-(8) alphanumeric ::=
-letter | digit
+(7) letter ::= capital | non-capital
-(9) identifier ::=
-letter{[underscore]alphanumeric}
+(8) alphanumeric ::= letter | digit
-(10) integer ::=
-digit{digit}
+(9) identifier ::= letter{[underscore]alphanumeric}
-(11) exponent ::=
-’E’[’+’]integer | ’E-’integer
+(10) integer ::= digit{digit}
-(12) numeric-constant ::=
-[’+’]integer ’.’ integer[exponent] | ’-’integer
-’.’ integer[exponent]
+(11) exponent ::= ’E’[’+’]integer | ’E-’integer
+(12) numeric-constant ::= [’+’]integer ’.’ integer[exponent] | ’-’integer ’.’ integer[exponent]
-(13) literal-constant ::=
-’’’printable character’’’ | ’~’{printable
+
+(13) literal-constant ::= ’’’printable character’’’ | ’~’{printable
character}’~’
-(14) package-name ::=
-identifier
+(14) package-name ::= identifier
+
+(15) enumeration-name ::= identifier [**from** package-name]
+
+(16) class-name ::= identifier [**from** package-name]
-(15) enumeration-name ::=
-identifier [**from**** **package-name]
+(17) exception-name ::= identifier [**from** package-name]
-(16) class-name ::=
-identifier [**from**** **package-name]
+(18) constructor-name ::= ’Create’ | ’Initialize’
-(17) exception-name ::=
-identifier [**from**** **package-name]
+(19) primitive-type ::= ’Boolean’ | ’Character’ | ’Integer’ | ’Real’
-(18) constructor-name ::=
-’Create’ | ’Initialize’
+(20) data-type ::= enumeration-name | class-name | exception-name | primitive-type
-(19) primitive-type ::=
-’Boolean’ | ’Character’ | ’Integer’ | ’Real’
+(21) passed-type ::= data-type | **like me** | **like** identifier
-(20) data-type ::=
-enumeration-name | class-name | exception-name
-| primitive-type
+(22) passing-mode ::= [**in**] | **out** | **in out**
-(21) passed-type ::=
-data-type | **like me**** **| **like**** **identifier
+(23) parameter-access ::= **mutable** | [**immutable**]
-(22) passing-mode ::=
-[**in**] | **out**** **| **in out**
+(23A) return-access ::= **mutable** | [**immutable**]| **any**
-(23) parameter-access ::=
-**mutable**** **| [**immutable**]
+(24) value ::= numeric-constant | literal-constant | identifier
-(23A) return-access ::=
-**mutable**** **| [**immutable**]| **any**
+(25) parameter ::= identifier {’,’ identifier} ’:’ passing-mode access-right passed-type [’=’ value]
-(24) value ::=
-numeric-constant | literal-constant |
-identifier
+(26) simple-formal-part ::= ’(’parameter {’;’ parameter}’)’
-(25) parameter ::=
-identifier {’,’ identifier} ’:’ passing-mode
-access-right passed-type [’=’ value]
+(27) formal-part-of-instance-method ::= ’(’ **me** [’:’ passing-mode access-right] {’;’ parameter}’)’
-(26) simple-formal-part ::=
-’(’parameter {’;’ parameter}’)’
+(28) formal-part-of-class-method ::= ’(’ **myclass** {’;’ parameter}’)’
-(27) formal-part-of-instance-method ::=
-’(’**me**** **[’:’ passing-mode access-right] {’;’
-parameter}’)’
+(29) visibility ::= **private** | **protected**
-(28) formal-part-of-class-method ::=
-’(’**myclass**** **{’;’ parameter}’)’
+(30) redefinition ::= **static** | **deferred**
-(29) visibility ::=
-**private**** **| **protected**
-(30) redefinition ::=
-**static**** **| **deferred**
-(31) definition-level ::=
-redefinition |** ****redefined**** **[redefinition]
+(31) definition-level ::= redefinition | **redefined** [redefinition]
-(32) declaration-of-constructed-type ::=
-**returns**** **[**mutable**] class-name
+(32) declaration-of-constructed-type ::= **returns** [**mutable**] class-name
-(33) declaration-of-returned-type ::=
-**returns**** **return-access passed-type
+(33) declaration-of-returned-type ::= **returns** return-access passed-type
-(34) declaration-of-errors ::=
-**raises**** **exception-name {’,’ exception-name}
+(34) declaration-of-errors ::= **raises** exception-name {’,’ exception-name}
-(35) declaration-of-visibility ::=
-**is**** **visibility
+(35) declaration-of-visibility ::= **is** visibility
-(36) declaration-of-attributes-of-instance-method ::=
-**is**** **visibility | **is **definition-of-level
-[visibility]
+(36) declaration-of-attributes-of-instance-method ::= **is** visibility | **is** definition-of-level [visibility]
-(37) constructor ::=
-constructor-name [simple-formal-part]
+(37) constructor ::= constructor-name [simple-formal-part]
[declaration-of-constructed-type]
[declaration-of-errors]
[declaration-of-visibility]’;’
-(38) instance-method ::=
-identifier formal-part-of-instance-method
+(38) instance-method ::= identifier formal-part-of-instance-method
[declaration of returned type]
[declaration-of-errors]
[declaration-of-attributes-of-instancemethod]’;’
-(39) class-method ::=
-identifier formal-part-of-the-class-method
+(39) class-method ::= identifier formal-part-of-the-class-method
[declaration of returned type]
[declaration-of-errors]
[declaration-of-visibility]’;’
-(40) package-method ::=
-identifier [simple-formal-part]
+(40) package-method ::= identifier [simple-formal-part]
[declaration-of-returned-type]
[declaration-of-errors]
[**is private**]’;’
-(41) member-method ::=
-constructor | instance-method | class-method
+(41) member-method ::= constructor | instance-method | class-method
-(42) formal-part ::=
-simple-formal-part |
-formal-part-of-instance-method|
-formal-part-of-class-method
+(42) formal-part ::= simple-formal-part | formal-part-of-instance-method| formal-part-of-class-method
-(43) friend ::=
-identifier **from**** **[**class**] class-name [formal-part]
-|
-identifier **from**** **[**package**] package-name [formal-
-part] |
+(43) friend ::= identifier **from** [**class**] class-name [formal-part]
+| identifier **from** [**package**] package-name [formal-part] |
[**class**] class-name
-(44) field ::=
-identifier {’,’ identifier} ’:’ data-type
+(44) field ::= identifier {’,’ identifier} ’:’ data-type
[’[’integer {’,’ integer}’]’]
[**is protected**]’;’
-45) redefinition-of-field ::=
-[field-name] **from**** **[**class**] class-name
+45) redefinition-of-field ::= [field-name] **from** [**class**] class-name
-(46) declaration-of-fields ::=
-**fields**** **[**redefined**** **redefinition-of-field {’,’
-redefinition-of-field}’;’]
+(46) declaration-of-fields ::= **fields** [**redefined** redefinition-of-field {’,’ redefinition-of-field}’;’]
field {field}
-(47) declaration-of-an-alias::=
-[**private**] **alias**** **class-name1 **is**** **class-name2 [**from**
-package-name]
+(47) declaration-of-an-alias::= [**private**] **alias** class-name1 **is** class-name2 [**from** package-name]
-(48) declaration-of-friends ::=
-**friends**** **friend {’,’ friend}
+(48) declaration-of-friends ::= **friends** friend {’,’ friend}
-(49) class-definition ::=
-[{member-method}]
+(49) class-definition ::= [{member-method}]
[declaration-of-fields]
[declaration-of-friends]
-(50) declaration-of-an-exception ::=
-**exception**** **exception-name
-**inherits**** **exception-name
+(50) declaration-of-an-exception ::= **exception** exception-name **inherits** exception-name
-(51) declaration-of-an-enumeration ::=
-**enumeration**** **enumeration-name
-**is**** **identifier {’,’ identifier}
-[**end**** **[enumeration-name]]’;’
+(51) declaration-of-an-enumeration ::= **enumeration** enumeration-name
+**is** identifier {’,’ identifier}
+[**end** [enumeration-name]]’;’
(52) incomplete-declaration-of-a-non-generic-class ::=
-[**deferred**] **class**** **class-name’;’
+[**deferred**] **class** class-name’;’
(53) incomplete-declaration-of-a-generic-class ::=
-[**deferred**] **generic class**** **class-name {’,’ class-name}’;’
+[**deferred**] **generic class** class-name {’,’ class-name}’;’
(54) declaration-of-a-non-generic-class ::=
-[**deferred**] **class**** **class-name
-[**inherits**** **class-name
-[**uses**** **data-type {’,’ data-type}]
-[**raises**** **exception-name {’,’ exception-name}]
-** is **definition-of-a-class
-**end **[class-name]’;’
-
-(55) type-constraint ::=
-**any**** **| class-name [’(’data-type {’,’ data-type}’)’]
-
-(56) generic-type ::=
-identifier **as**** **type-constraint
-@section occt_1819379591_2139552861 Appendix B.
-
-
-
-@subsection occt_1819379591_213955286151 Comparison of CDL & C++ Syntax for Data Types manipulated by Handle and by Value
-
- @image html /dev_guides/cdl/images/cdl_image012.png
- @image latex /dev_guides/cdl/images/cdl_image012.png
-
\ No newline at end of file
+[**deferred**] **class** class-name
+[**inherits** class-name
+[**uses** data-type {’,’ data-type}]
+[**raises** exception-name {’,’ exception-name}]
+**is** definition-of-a-class
+**end** [class-name]’;’
+
+(55) type-constraint ::= **any** | class-name [’(’data-type {’,’ data-type}’)’]
+
+(56) generic-type ::= identifier **as** type-constraint
+
+(57) declaration-of-a-generic-class ::=
+[**deferred**] **generic class** class-name ’(’generic-type
+{’,’ generic-type}’)’
+[**inherits** class-name
+[**uses** data-type {’,’ data-type}]
+[**raises** exception-name {’,’ exception-name}]
+[{[visibility] declaration-of-a-class}]
+**is** class-definition
+**end** [class-name]’;’
+
+(58) instantiation-of-a-generic-class::=
+[**deferred**] **class** class-name
+**instantiates** class-name ’(’data-type
+{’,’ data-type}’);’
+
+(59) declaration-of-a-class::=
+incomplete-declaration-of-a-non-generic-class
+|
+incomplete-declaration-of-a-generic-class |
+declaration-of-a-non-generic-class |
+declaration-of-a-generic-class |
+instantiation-of-a-generic-class
+
+(60) type-declaration ::=
+[private] declaration-of-an-enumeration | [**private**] class-declaration | declaration-of-an-exception
+
+(61) package-definition ::=
+[{type-declaration}]
+[{package-method}]
+
+(62) package-declaration ::= **package** package-name
+[**uses** package-name {’,’ package-name}]
+ **is** package-definition
+**end** [package-name]’;’
+
+(63) executable-declaration ::=
+ **executable** executable-name
+ **is**
+ {
+ **executable** executable-part
+[**uses** [identifier **as external**]
+ [{’,’ identifier **as external**}]
+ [unit-name **as library**]
+ [{’,’ unit-name **as library**}]
+ **is**
+ {file-name [as C++|c|fortran|object];}
+ **end** ’;’
+ }
+ **end** ’;’
+
+(64) schema-declaration ::=
+ **schema** schema-name
+ **is**
+[{**package** package-name ’;’ }]
+[{**class** class-name ’;’ }]
+**end** ’;’
+
+
+
+
+
+@section occt_cdl_6 Appendix B Comparison of CDL and C++
+
+## Syntax for Data Types manipulated by Handle and by Value in CDL
+
+| | Handle | Value |
+| :---- | :---- | :---- |
+| Permanent | Persistent | Storable |
+| Temporary | Transient | Any |
+| Reading | Immutable | In |
+| Writing | Mutable | Out |
+| Read/Write | Mutable | In out |
+| Return | Not specified : any | Without copy: --C++ return const& |
+
+## Syntax for Data Types manipulated by Handle and by Value in C++
+
+| | Handle | Value |
+| :---- | :---- | :--- |
+| C++ Declaration | Handle(PGeom_Point) p1; | gp_Pnt p2; |
+| C++ Constructor | p1 = newPGeom_Point(p2); | p2(0.,0.,0.); |
+| C++ Method | x=p1 -> XCoord(); | x=p2.XCoord(); |
+
+
+
+
\ No newline at end of file
--- /dev/null
+Contribution Workflow {#dev_guides_contribution_workflow}
+====================================
+@tableofcontents
+
+@section occt_contribution_workflow_1 Introduction
+
+The purpose of this document is to describe standard workflow for processing contributions to certified version of OCCT.
+
+@subsection occt_contribution_workflow_1_1 Use of issue tracker system
+
+Each contribution should have corresponding issue (bug, or feature, or integration request)
+registered in the MantisBT issue tracker system accessible by URL
+http://tracker.dev.opencascade.org.
+The issue is processed further according to the described workflow.
+
+@subsection occt_contribution_workflow_1_2 Access Levels
+
+ Access level defines the permissions of the user to view,
+ register and modify issues in a Mantis bugtracker.
+ The correspondence of access level and user permissions
+ is defined in accordance with the table below.
+
+| Access level | Granted to | Permissions | Can set statuses |
+|:------------- | :--------- | :-------------- | :----------------------- |
+| Viewer | Everyone (anonymous access) | View public issues only | No |
+| Reporter | Users registered on dev.opencascade.com | View, report, and comment issues | New, Resolved |
+| Updater | Users of dev.opencascade.com in publicly visible projects | View and comment issues | New, Resolved |
+| Developer | OCC developers and external contributors who signed the CLA | View, report, modify, and handle issues | New, Assigned, Resolved, Reviewed |
+| Tester | OCC engineer devoted to certification testing | View, report, modify, and handle issues | Assigned, Tested |
+| Manager | Person responsible for a project or OCCT component | View, report, modify, and handle issues | New, Resolved, Reviewed, Tested, Closed |
+
+According to his access level, the user can participate in the issue handling process under different roles, as described below.
+
+@section occt_contribution_workflow_2 Typical workflow for an issue
+
+@subsection occt_contribution_workflow_2_1 General scheme
+
+@image html OCCT_ContributionWorkflow_V3_image001.png "Standard life cycle of an issue"
+@image latex OCCT_ContributionWorkflow_V3_image001.png "Standard life cycle of an issue"
+
+@subsection occt_contribution_workflow_2_2 Issue registration
+
+An issue is registered in Mantis bugtracker by the Reporter with definition of the necessary attributes.
+The definition of the following attributes is obligatory:
+
+ * **Category** - indicates component of OCCT to which the issue relates. If in doubt, assign OCCT:Foundation Classes.
+ * **Reproducibility**
+ * **Severity**
+ * **Priority**
+ * **Profile** - allows defining the platform on which the problem was detected from the list of predefined platforms. If a platform is absent in the list of predefined platforms it is possible to use Or Fill In option to define the platform manually.
+ * **Platform**
+ * **OS**
+ * **OS Version**
+ * **Products Version** - defines the version of Open CASCADE on which the problem has been detected.
+ * **Summary** - a short, one sentence description of the issue. It has a limit of 128 characters. It should be informative and useful for the developers. It is advisable to avoid vague or misleading phrases, such as "it doesn't work" or "it crashed". It is not allowed to mention the issue originator, and in particular the customer, in the name of the registered issue.
+ * **Description** - should contain a detailed definition of the nature of the registered issue depending on its type. For a bug it is required to submit a detailed description of the incorrect behavior, including the indication of the cause of the problem (if possible at this stage) or any inputs from the originator. For a feature or integration request it is recommended to describe the proposed feature in details (as possible at that stage), including the changes required for its implementation and the main features of the new functionality. Filling the bug description is obligatory.
+ * **Steps To Reproduce** - in this field it is possible to describe in detail how to reproduce the issue. This field considerably helps to find the cause of the problem, to eliminate it and to create the test case.
+ * *Upload File* field allows attaching the shapes, scripts or modified source files of OCCT. It is recommended to attach a prototype test case in form of a Tcl script for DRAW, using either existing DRAW commands, or a C++ code which can be organized in DRAW commands, as well as sample shapes or other input data (if applicable), immediately after the issue registration.
+
+ The newly registered issue gets status **NEW** and is assigned to the developer responsible for the OCCT component indicated in the Category field (Maintainer).
+
+@subsection occt_contribution_workflow_2_3 Assigning the issue
+
+ The description of the new issue is checked by the **Maintainer** and if it is feasible,
+ he may assign the issue to a **Developer**. Alternatively, any user with **Developer** access level
+ or higher can assign the issue to himself if he wants to provide a solution.
+
+ The recommended way to handle contributions is that the **Reporter** assigns the issue to himself and provides a solution.
+
+ The **Maintainer, Technical Project Manager,** or **Bugmaster** can close or reassign the issue
+ (in **FEEDBACK** state) to the **Reporter** after it has been registered, if its description does not contain sufficient details to reproduce the bug or explain the purpose of the new feature.
+ That decision shall be documented in the comments to the issue in the Bugtracker.
+
+ The assigned issue should have state **ASSIGNED**.
+
+@subsection occt_contribution_workflow_2_4 Resolving the issue
+
+ The **Developer** responsible for the issue assigned to him provides a solution
+ as a change on the version of OCCT indicated in the issue attributes, or the last development version.
+
+ The modified sources should be submitted for review and testing to the dedicated branch of the official OCCT Git repository:
+
+ * Branch should be created for the issue with name composed of letters ‘CR’ followed by issue ID number (without leading zeroes).
+ Optional suffix can be added to the branch name after issue ID,
+ e.g. to distinguish between several version of the fix.
+ * The branch should be based on recent version of the master branch
+ (not later than commit tagged as last OCCT release).
+ * The first line of the first commit message should contain
+ the Summary of the issue (starting with its ID followed by colon, e.g. "0022943: Bug TDataXtd_PatternStd").
+ The consequent lines should contain a description of the changes made.
+ If more than one commit has been made, the commit messages should contain description of the changes made.
+ * The amount of the code affected by the change should be limited
+ to only the changes required for the bug fix or improvement.
+ Change of layout or re-formatting of the existing code is allowed
+ only in the parts where meaningful changes related to the issue have been made.
+ * The name of the branch where the fix is submitted should be given
+ in the note to the Mantis issue
+ (providing the direct link to relevant branch view in GitWeb is encouraged).
+ * The description of the changes made should be put to the field
+ "Additional information and documentation updates" of the Mantis issue.
+
+ In some cases (if Git is not accessible for the contributor),
+ external contributions can be submitted as patch (diff) files or sources
+ attached to the Mantis issue, with indication of OCCT version on which the fix is made.
+ Such contributions should be put to Git for processing by someone else,
+ and hence they have less priority in processing than the ones submitted directly through Git.
+
+ The issue for which solution is provided should be switched to **RESOLVED** state
+ and assigned to the developer who is expected to make a code review
+ (the **Reviewer**; by default, can be set to the **Maintainer** of the component).
+
+@subsection occt_contribution_workflow_2_5 Code review
+
+ The **Reviewer** analyzes the proposed solution for applicability in accordance with OCCT Code reviewing rules and examines all changes in the sources to detect obvious and possible errors, misprints, conformity to coding style.
+
+ * If Reviewer detects some problems, he can either:
+ * Fix these issues and provide new solution, reassigning the issue (in **RESOLVED** state) to the **Developer**, who then becomes a **Reviewer**.
+ Possible disagreements should be resolved through discussion, which is done normally within issue notes (or on the OCCT developer’s forum if necessary).
+ * Reassign the issue back to the **Developer**, providing detailed list of remarks. The issue then gets status **ASSIGNED** and a new solution should be provided.
+ * If Reviewer does not detect any problems, he changes status to **REVIEWED**.
+
+@subsection occt_contribution_workflow_2_6 Testing
+
+ The issues that are in **REVIEWED** state are subject of certification (non-regression) testing.
+ The issue is assigned to OCC **Tester** when he starts processing it.
+ The results of tests are checked by the **Tester**:
+ * If the **Tester** detects build problems or regressions, he changes the status to **ASSIGNED** and reassigns the issue to the **Developer** with a detailed description of the problem. The **Developer** should produce a new solution.
+ * If the **Tester** does not detect build problems or regressions, he changes the status to **TESTED** for further integration.
+
+@subsection occt_contribution_workflow_2_7 Integration of a solution
+
+ Before integration into the master branch of the repository the **Integrator** checks the following conditions:
+ * the change has been reviewed;
+ * the change has been tested without regressions (or with regressions treated properly);
+ * the test case has been created for this issue (when applicable), and the change has been rechecked on this test case;
+ * "Additional information and documentation updates" field is filled by the developer;
+ * the change does not conflict with other changes integrated previously.
+
+ If the result of check is successful the Integrator integrates solution
+ into the master branch of the repository. Each change is integrated into the master branch
+ as a single commit without preserving the history of changes made in the branch
+ (by rebase, squashing all intermediate commits), however, preserving the author when possible.
+ This is done to have the master branch history plain and clean.
+ The following picture illustrates the process:
+
+@image html OCCT_ContributionWorkflow_V3_image002.jpg "Integration of several branches"
+@image latex OCCT_ContributionWorkflow_V3_image002.jpg "Integration of several branches"
+
+ The new master branch is tested against possible regressions that might appear due to interference between separate changes. When the tests are Ok, the new master is pushed to the official repository
+ and the original branches are removed from it.
+ The issue status is set then to **VERIFIED** and is assigned to the **Reporter** so that he could check the fix as-integrated.
+
+@subsection occt_contribution_workflow_2_8 Closing a bug
+
+ The **Bugmaster** closes the issue after regular OCCT Release provided that the issue status is **VERIFIED** and that issue was really solved in that release, by rechecking the corresponding test case. The final issue state is **CLOSED**.
+
+@subsection occt_contribution_workflow_2_9 Reopening a bug
+
+ If a regression is detected, the **Bugmaster** may reopen and reassign the **CLOSED** issue to the appropriate developer with comprehensive comments about the reason of reopening. The issue then becomes **ASSIGNED** again.
+
+@section occt_contribution_workflow_3 Appendix
+
+@subsection occt_contribution_workflow_3_1 Issue attributes
+
+@subsubsection occt_contribution_workflow_3_1_1 Severity
+
+ Severity shows at which extent the issue affects the product.
+ The list of used severities is given in the table below in the descending order.
+
+ | Severity | Description | Weight for Bug Score |
+ | :---------- | :------------------------------------------------ | :------------------: |
+ | crash | Crash of the application or OS, loss of data | 5 |
+ | block | Regression corresponding to the previously delivered official version. Impossible operation of a function on any data with no work-around. Missing function previously requested in software requirements specification. Destroyed data. | 4 |
+ | major | Impossible operation of a function with existing work-around. Incorrect operation of a function on a particular dataset. Impossible operation of a function after intentional input of incorrect data. Incorrect behavior of a function after intentional input of incorrect data. | 3 |
+ | minor | Incorrect behavior of a function corresponding to the description in software requirements specification. Insufficient performance of a function. | 2 |
+ | tweak | Ergonomic inconvenience, need of light updates. | 1 |
+ | text | Inconsistence of program code to the Coding Standard. Errors in source text (e.g. unnecessary variable declarations, missing comments, grammatical errors in user manuals). | 1 |
+ | trivial | Cosmetic bugs. | 1 |
+ | feature | Bug fix, new feature, improvement that requires workload estimation and validation. | 1 |
+ | integration request | Requested integration of an existing feature into the product. | 0 |
+ | Just a question | A question to be processed, without need of any changes in the product. | 0 |
+
+@subsubsection occt_contribution_workflow_3_1_2 Statuses of issues
+
+ The bug statuses that can be applied to the issues are listed in the table below.
+
+ | Status | Description |
+ | :------------------- | :----------------------------------------- |
+ | New | New just registered issue. Testing case should be created by Reporter. |
+ | Feedback | The issue requires more information; the original posters should pay attention. |
+ | Assigned | Assigned to a developer. |
+ | Resolved + a resolution | The issue has been fixed, and now is waiting for revision. |
+ |Revised + a resolution | The issue has been revised, and now is waiting for testing. |
+ | Tested | The fix has been internally tested by the tester with success on the full non-regression database or its part and a test case has been created for this issue. |
+ | Verified | The fix has been integrated into the master of the corresponding repository |
+ | Closed | The fix has been integrated to the master. The corresponding test case has been executed successfully. The issue is no longer reproduced. |
+
+@subsubsection occt_contribution_workflow_3_1_3 Resolutions
+
+ **Resolution** is set when the bug is resolved. "Reopen" resolution is added automatically when the bug is reopened.
+
+ | Resolution | Description |
+ |:--------------------- | :--------------------------------------------------------------------------- |
+ | Open | The issue is being processed. |
+ | Fixed | The issue has been successfully fixed. |
+ | Reopened | The bug has been reopened because of insufficient fix or regression. |
+ | | Unable to reproduceThe bug is not reproduced. |
+ | Not fixable | The bug cannot be fixed because it is a bug of third party software, or because it requires more workload than it can be allowed. |
+ | Duplicate | The bug for the same issue already exists in the tracker. |
+ | Not a bug | It is a normal behavior in accordance with the specification of the product |
+ | No change required | The issue didn’t require any change of the product, such as a question issue |
+ | Suspended | This resolution is set for Acknowledged status only. It means that the issue is waiting for fix until a special administrative decision is taken (e.g. a budget is not yet set in accordance with the contract) |
+ | Documentation updated | The issue was a normal behavior of the product, but the actions of the user were wrong. The specification and the user manual have been updated to reflect this issue. |
+ | Won’t fix | An administrative/contractual decision has been taken to not fix the bug |
+
+@subsection occt_contribution_workflow_3_2 Update and evolution of documentation
+
+ The documentation on Open CASCADE Technology currently exists in three forms:
+
+ * OCCT Technical Documentation generated automatically with Doxygen tool on the basis of comments in CDL or HXX files.
+ * User’s Reference Documentation on OCCT packages and Products supplied in the form of PDF User’s guides
+ * OCCT Release Documentation supplied in the form of Release Notes with each release.
+
+ It is strictly required to properly report the improvements and changes introduced in OCCT in all three forms of Documentation.
+
+@subsubsection occt_contribution_workflow_3_2_1 Maintenance of CDL files
+
+ Every developer providing a contribution to the source code of OCC
+ should make a relevant change in the corresponding header file, including CDL.
+
+ Making the appropriate comments is mandatory in the following cases:
+
+ * Development of a new package / class / method / enumeration;
+ * Modification of an existing package / class / method / enumeration that changes its behavior;
+ * Modification / new development impacts at other packages / classes / methods / enumerations, the documentation which of should be modified correspondingly.
+
+ The only case when the comments may be not required is introducing
+ a modification that does not change the existing behavior in any noticeable way
+ or brings the behavior in accordance with the existing description.
+
+ CDL description must be in good English, containing as much relevant
+ information and as clear as possible. If the developer is unable to properly formulate
+ his ideas in English or suspects that his description can be misunderstood,
+ he should address to the Documentation Engineer for language assistance.
+ Such action is completely subject to the discretion of the developer; however,
+ the Documentation Engineer can require that the developer should provide a relevant
+ technical documentation and reopen a bug until all documentation satisfies the requirements above.
+
+@subsubsection occt_contribution_workflow_3_2_2 Maintenance of the User’s Reference Documentation
+
+ The User’s Reference Documentation is distributed among a number of User’s Guides,
+ each describing a certain module of OCCT.
+ The User's Guides do not cover the entire functionality of OCCT;
+ however, they describe most widely used and important packages.
+
+ In most aspects the User's Guides present the information that is contained in CDL descriptions for methods, classes, etc., only from a different point of view. Thus, it is required that any developer who implements a new or modifies an existing package / class / method / enumeration and adds a description of new development or changes in the corresponding CDL file should also check if this class package / class / method / enumeration or the package / class, to which the added class / method belongs is already described in the documentation and update the User’s Reference Documentation correspondingly.
+
+3.2.3. Preparation of the Release Documentation
+
+ Before changing the bug Status to RESOLVED, the developer should provide a description of the implemented work using the "Additional information and documentation updates" field of Mantis bugtracker.
+
+ This description is used for the Release Documentation and has the following purposes:
+
+ * to inform the OCCT users about the main features and improvements implemented in the platform in the release;
+ * to give a complete and useable list of changes introduced into the OCCT since the latest version.
+
+ The changes should be described from the user’s viewpoint so that the text
+ could be comprehensible even for beginners having a very vague idea about OCCT.
+ If the developer is unable to properly formulate his ideas in English or suspects
+ that his description can be misunderstood, he should address to the Documentation Engineer
+ for language assistance. Such action is completely subject to the discretion of the developer;
+ however, the Documentation Engineer can require that the developer
+ should provide a relevant technical documentation and reopen a bug
+ until all documentation satisfies the requirements.
+
+ **Note**, that it is required to single out the changes in the OCCT behavior as compared to the previous versions and especially the changes to be considered when porting from the previous version of OCCT.
+
+For example:
+* If global macros XXX() was used in the code of your application, revise it for direct use of the argument stream object.
+* You might need to revise the code related to text display in 3d viewer to take into account new approach of using system fonts via XXX library.
+
+ The **Documentation Engineer** is responsible for preparation of the version Release Notes
+ and update of the User’s Guides. If the **Documentation Engineer** considers that the description currently provided by the **Developer** is somehow inadequate or unsatisfactory he can demand the **Developer** to rewrite the documentation with the **Documentation Engineer’s** assistance.
* @subpage dev_guides__coding_rules "Coding Rules"
* Contribution Workflow
* Guide to installing and using Git for OCCT development
-* @subpage dev_guides__tests "Automatic Testing system"
+ @subpage dev_guides__tests "Automatic Testing system"
Two other documents provide details on obsolete technologies used by OCCT,
to be removed in future releases:
--- /dev/null
+Guide to installing and using Git for OCCT development {#dev_guides_git_guide}
+=================================
+
+@tableofcontents
+
+@section occt_gitguide_1 Overview
+
+@subsection occt_gitguide_1_1 Purpose
+
+ The purpose of this document is to provide a practical introduction to Git
+ to OCCT developers who are not familiar with this tool
+ and to facilitate the use of the official OCCT Git repository for code contribution to OCCT.
+
+ Reading this document does not exempt from the need to learn Git concepts and tools.
+ Please consult a book or manual describing Git to get acquainted with this tool.
+ Many good books on Git can be found at http://git-scm.com/documentation
+
+ For the experienced Git users it can be enough to read sections 1 and 3
+ of this document to start working with the repository.
+
+ Please make sure to get familiar with the Contribution Workflow document
+ that describes how Git is used for processing contributions to OCCT.
+
+ This and related documents are available at the Resources page
+ of the OCCT development portal at http://dev.opencascade.org/index.php?q=home/resources.
+
+@subsection occt_gitguide_1_2 Git URL
+
+ URL of the official OCCT source code Git repository (accessed by SSH protocol) is:
+
+ gitolite@git.dev.opencascade.org:occt
+
+ or
+
+ ssh://gitolite@git.opencascade.org/occt.git
+
+@subsection occt_gitguide_1_3 Content
+
+The official repository contains:
+
+ * The current certified version of OCCT: the "master" branch. This branch is updated by the Bugmaster only. Official OCCT releases are marked by tags.
+ * Topic branches created by contributors to submit changes for review / testing or for collaborative development. The topic branches should be named by the pattern "CR12345" where 12345 is the ID of the relevant issue registered in Mantis (without leading zeroes), and "CR" stands for "Change Request". The name can have an additional postfix used if more than one branch was created for the same issue.
+ * Occasionally topic branches with non-standard names can be created by the Bugmaster for special needs.
+
+@subsection occt_gitguide_1_4 Short rules of use
+
+ The name specified in the user.name field in Git configuration should correspond
+ to your login name on the OCCT development portal.
+ This is important to clearly identify the authorship of commits.
+ (The full real name can be used as well; in this case add the login username in parentheses.)
+
+ By default, contributors are allowed to push branches only with the names starting with CR
+ (followed by the relevant Mantis issue ID).
+ Possibility to work with other branches can be enabled by the Bugmaster on request.
+
+ The branch is created by the developer in his local repository when the development of a contribution starts.
+ The branch for new developments is to be created from the current master.
+ The branch for integration of patches or developments based on an obsolete version
+ is created from a relevant tag or commit. The branch should be pushed to the official repo
+ only when sharing with other people (for collaborative work or review / testing) is needed.
+
+ Rebasing the local branch to the current master is encouraged before the first submission
+ to the official repository. If rebasing was needed after the branch is pushed to the official repo,
+ the rebased branch should have a different name (use suffix).
+
+ Integration of contributions that have passed certification testing is made exclusively by the Bugmaster.
+ Normally this is made by rebasing the contribution branch on the current master
+ and squashing it into a single commit. This is made to have the master branch history plain and clean,
+ following the general rule “one issue – one commit”.
+ The description of the commit integrated to the master branch is taken from the Mantis issue
+ (ID, 'Summary', followed by the information from 'Documentation' field if present).
+
+ In special cases when it is important to save the commits history in the branch
+ (e.g. in case of a long-term development integration) it can be integrated by merge (no fast-forward).
+
+ The authorship of the contribution is respected by preserving the Author field of the commit when integrating.
+ Branches are removed from the official repository when integrated to the master.
+ The Bugmaster can also remove branches which have no commits during one-month period.
+
+ The Bugmaster may ask the developer (normally the one who produced the contribution)
+ to rebase a branch on the current master, in the case if merge conflicts appear during integration.
+
+@subsection occt_gitguide_1_5 Version of Git
+
+ The repository is tested to work with Git 1.7.6 to 1.7.9.
+ Please do not use versions below 1.7.1 as they are known to cause troubles.
+
+@section occt_gitguide_2 Installing Tools for Work with Git
+
+@subsection occt_gitguide_2_1 Windows platform
+
+ Installation of Git for Windows (provided by MSysGit project) is required.
+
+ In addition, it is recommended to install TortoiseGit to work with Git on Windows.
+ If you do not install TortoiseGit or any other GUI tool,
+ you can use GitGui and Gitk GUI tools delivered with Git and available on all platforms.
+
+@subsubsection occt_gitguide_2_1_1 Installation of Git for Windows
+
+ Download Git for Windows distributive from http://code.google.com/p/msysgit/downloads/list.
+ During the installation:
+
+ * Select Windows Explorer integration options:
+ * Git Bash Here
+ * Git GUI Here
+
+@image html OCCT_GitGuide_V2_image001.png
+@image latex OCCT_GitGuide_V2_image001.png
+
+ * To avoid a mess in your PATH, we recommend selecting ‘Run Git from Windows Prompt’ in the environment settings dialog:
+
+@image html OCCT_GitGuide_V2_image002.png
+@image latex OCCT_GitGuide_V2_image002.png
+
+ * In "Configuring the line ending conversions" dialog, select "Checkout Windows-style, commit Unix style endings".
+
+@image html OCCT_GitGuide_V2_image003.png
+@image latex OCCT_GitGuide_V2_image003.png
+
+ Note that by default Git user interface is localized to the system default language.
+ If you prefer to work with the English interface, remove or rename .msg localization file
+ in subdirectories *share/git-gui/lib/msgs* and *share/gitk/lib/msgs* of the Git installation directory.
+
+ Before the first commit to the OCCT repository, make sure that your User Name in the Git configuration file (file *.gitconfig* in the $HOME directory) is equal to your username on the OCCT development portal.
+
+@subsubsection occt_gitguide_2_1_2 Installation and configuration of TortoiseGit
+
+ Download TortoiseGit distributive from http://code.google.com/p/tortoisegit/downloads/list.
+ Launch the installation.
+
+ * Select your SSH client. Choose OpenSSH if you prefer to use command-line tools
+ for SSH keys generation, or TortoisePLink if you prefer to use GUI tool (PuttyGen, see 3.2):
+
+@image html OCCT_GitGuide_V2_image004.png
+@image latex OCCT_GitGuide_V2_image004.png
+
+ * Complete the installation.
+
+@image html OCCT_GitGuide_V2_image005.png
+@image latex OCCT_GitGuide_V2_image005.png
+
+ TortoiseGit integrates to Windows Explorer, thus it is possible to use popup menu in Windows Explorer to access its functionality:
+
+ Note that if you have installed MSysGit or have Git installed in non-default path,
+ on the first time you use TortoiseGit you may get the message demanding to define path to Git.
+ In such case, click on **Set MSysGit path** button and add the path to git.exe
+ and path to MigGW libraries in the Settings dialog.
+
+ * After the installation select Start -> Programs -> TortoiseGit Settings to configure TortoiseGit.
+
+ Select Git->Config to add your user name and Email address to the local .gitconfig file
+
+ @image html OCCT_GitGuide_V2_image006.png
+ @image latex OCCT_GitGuide_V2_image006.png
+
+@subsection occt_gitguide_2_2 Linux platform
+
+ We assume that Linux users have Git already installed and available in the PATH.
+
+ Make sure to configure Git so that the user name is equal to your username
+ on the OCCT development portal, and set SafeCrLf option to true:
+
+~~~~~
+ > git config --global user.name "Your User Name"
+ > git config --global user.email your@mail.address
+ > git config --global your@mail.address
+~~~~~
+
+@section occt_gitguide_3 Getting access to the repository
+
+@subsection occt_gitguide_3_1 Prerequisites
+
+ Access to the repository is granted to the users who have signed the Contributor License Agreement.
+
+ The repository is accessed by SSH protocol, thus you need to register your public SSH key
+ on the development portal to get access to the repository.
+
+ SSH keys are used for secure authentication of the user when accessing the Git server.
+ Private key is the one stored on the user workstation (optionally encrypted).
+ Open (or public) key is stored in the user account page on the web site.
+ When Git client accesses the remote repository through SSH,
+ it uses this key pair to identify the user and acquire relevant access rights.
+
+ Normally when you have Git installed, you should have also SSH client available.
+ On Unix/Linux it is installed by default in the system.
+ On Windows it is typical to have several SSH clients installed;
+ in particular they are included with Cygwin, Git, TortoiseGit.
+
+ It is highly recommended to use the tools that come
+ with the chosen Git client for generation of SSH keys.
+ Using incompatible tools (e.g. ssh-keygen.exe from Cygwin for code generation,
+ and TortoiseGit GUI with a default Putty client for connection to server)
+ may lead to authentication problems.
+
+@subsection occt_gitguide_3_2 How to generate a key
+
+@subsubsection occt_gitguide_3_2_1 Generating key with Putty
+
+ Use this option if you have installed TortoiseGit (or other GUI Git client on Windows)
+ and have chosen “TortoisePLink” (or other Putty client) as SSH client during installation.
+
+ To generate the key with this client, run Puttygen (e.g. from Start menu -> TortoiseGit -> Puttygen),
+ then click Generate and move mouse cursor over the blank area until the key is generated.
+
+@image html OCCT_GitGuide_V2_image007.png "Putty key generator"
+@image latex OCCT_GitGuide_V2_image007.png "Putty key generator"
+
+ After the key is generated, you will see GUI controls to define the public key comment
+ and / or specify the password for the private key protection.
+ When done, save both the public and the private key to the files of your choice
+ (make sure to store your private key in a secure place!).
+
+ Copy the public key as shown by Puttygen to the clipboard to add it in your account.
+ Do not copy the Putty public key file content -- it is formatted in a way not suitable for the web site.
+
+@subsubsection occt_gitguide_3_2_2 Generating key with command-line tools
+
+ Use this option if you work on Linux or if you have chosen “OpenSSH” as SSH client
+ during installation of TortoiseGit (or other Windows tool).
+
+ Make sure that you have *ssh* and *ssh-keygen* commands in the path.
+ On Windows, you might need to start 'Git Bash' command prompt window provided by Git for Windows.
+
+ Use the following command to generate SSH keys:
+~~~~~
+ > ssh-keygen -t rsa -C "your@mail.address"
+~~~~~
+
+ The last argument is an optional comment, which can be included with the public key and used to distinguish between different keys (if you have many). The common practice is to put here your mail address or workstation name.
+
+ The command will ask you where to store the keys. It is recommended to accept the default path *$HOME/.ssh/id_rsa*. Just press Enter for that. You will be warned if a key is already present in the specified file; you can either overwrite it by the new one, or stop generation and use the old key.
+
+ If you want to be on the safe side, enter password to encrypt the private key. You will be asked to enter this password each time you use that key (e.g. access a remote Git repository), unless you use the tool that caches the key (like TortoiseGit). If you do not want to bother, enter an empty string.
+
+ On Windows, make sure to note the complete path to the generated files (the location of your $HOME might be not obvious). Two key files will be created in the specified location (by default in $HOME/.ssh/):
+
+ * *id_rsa* - private key
+ * id_rsa.pub - public key
+
+ The content of the public key file (one text line) is the key to be added to the user account on the site (see below).
+
+@subsubsection occt_gitguide_3_2_3 Generating key with Git GUI
+
+ GitGUI (standard GUI interface included with Git) provides the option
+ to either generate the SSH key (if not present yet) or show the existing one.
+ Click Help/Show SSH key and copy the public key content for adding to the user account page (see below).
+
+@subsection occt_gitguide_3_3 Adding public key in your account
+
+ Log in on the portal http://dev.opencascade.org and click on 'My account' link to the right.
+ If you have a Contributor status, you will see 'SSH keys' tab to the right.
+ Click on that tab, then click 'Add a public key', and paste the text of the public key
+ (see above sections on how to generate the key) into the text box.
+ Click "Save" to input the key to the system.
+
+ Note that a user can have several SSH keys.
+ You can distinguish between these keys by the Title field ID; by default it is taken from SSH key comment.
+ It is typical to use your e-mail address or workstation name for this field; no restrictions are set by the portal.
+
+@image html OCCT_GitGuide_V2_image008.png
+@image latex OCCT_GitGuide_V2_image008.png
+
+ Please note that some time (5-10 min) is needed for the system
+ to update the configuration after the new key is added.
+ After that time, you can try accessing Git.
+
+@section occt_gitguide_4 WORK WITH REPOSITORY: DEVELOPER OPERATIONS
+
+@subsection occt_gitguide_4_1 General workflow
+
+ To start working with OCCT source repository, you need to create its clone in your local system.
+ This cloned repository will manage your working copy of the sources
+ and provide you the means to exchange code between your clone and the origin.
+
+ In most cases it is sufficient to have one clone of the repository;
+ your working copy will be updated automatically by Git when you switch branches.
+
+ The typical development cycle for an issue is as follows:
+
+ * Create a new branch for your development, basing on the selected version of the sources
+ (usually the current master) and switch your working copy to it
+ * Develop and test your change. Note that for the first time, and after any changes
+ made in CDL files you will have to re-generate build scripts or Visual Studio projects using WOK.
+ * Do as many commits in your branch as you feel convenient;
+ the general recommendation is to commit every stable state (even incomplete), to record the history of your development.
+ * Push your branch to the repository when your development is complete or when you need to share it with other people (e.g. for review)
+ * Before the first push, rebase your local branch on the latest master;
+ consider collapsing the history in one commit unless you think the history of your commits is interesting for others.
+ Make sure to provide a good commit message.
+ * Do not amend the commits that have been already pushed in the remote repository,
+ If you need to rebase your branch, commit the rebased branch under a different name, and remove the old branch.
+
+ You can switch to another branch at any moment
+ (unless you have some uncommitted changes in the working copy)
+ and return back to the branch when necessary (e.g. to take into account review remarks).
+ Note that only the sources that are different between the switched branches will be modified,
+ thus required recompilation should be reasonably small in most cases.
+
+@subsection occt_gitguide_4_2 Cloning official repository
+
+ Clone the official OCCT repository in one of following ways:
+
+ * From command line by command:
+
+~~~~~
+ > git clone gitolite@git.dev.opencascade.org:occt <path>
+~~~~~
+
+ where <i><path></i> is the path to the new folder which will be created for the repository.
+
+ * In TortoiseGit: right-click in the Explorer window, then choose "Git Clone":
+
+@image html OCCT_GitGuide_V2_image009.png
+@image latex OCCT_GitGuide_V2_image009.png
+
+ If you have chosen Putty as SSH client during TortoiseGit installation, check the “Load Putty Key” option and specify the location of the private key file saved by PuttyGen (see 3.2.1). This shall be done for the first time only.
+
+ Note that on the first connection to the repository server you may be requested to enter a password for your private SSH key; further you can get a message that the authenticity of the host cannot be established and will be asked if you want to continue connecting or not:
+
+@image html OCCT_GitGuide_V2_image010.png
+@image latex OCCT_GitGuide_V2_image010.png
+
+ Choose “Yes” to continue. Then the host’s key will be stored in $HOME/.ssh/known_hosts file.
+
+@subsection occt_gitguide_4_3 Branch creation
+
+ You need to create a branch when you are going to start development of a new change,
+ apply a patch, etc. It is recommended to fetch updates from the remote repository
+ before this operation, to make sure you work with the up-to-date version.
+
+ Create a branch from the current master branch unless you need to base your development on a particular version or revision.
+
+In the console:
+
+~~~~~
+ > git checkout -b CR12345 origin/master
+~~~~~
+
+In TortoiseGit:
+ * Go to the local copy of the repository.
+ * Right-click in the Explorer window, then choose "Git Create Branch".
+
+@image html OCCT_GitGuide_V2_image011.png
+@image latex OCCT_GitGuide_V2_image011.png
+
+ * Select “Base On” Branch remotes/origin/master
+
+@image html OCCT_GitGuide_V2_image012.png
+@image latex OCCT_GitGuide_V2_image012.png
+
+ Check option ‘Switch to new branch’ if you are going to start working with the newly created branch immediately.
+
+@subsection occt_gitguide_4_4 Branch switching
+
+ If you need to switch to another branch, use Git command checkout for that.
+ In the console:
+
+~~~~~
+ > git checkout CR12345
+~~~~~
+
+ In TortoiseGit: right-click, TortoiseGit -> Checkout/switch
+
+@image html OCCT_GitGuide_V2_image013.png
+@image latex OCCT_GitGuide_V2_image013.png
+
+ Note that in order to work with the branch locally you need to set option
+ “Create new branch” when you checkout the branch from the remote repository for the first time.
+ Option “Track” stores association between the local branch and the original branch in a remote repository.
+
+@subsection occt_gitguide_4_5 Committing branch changes
+
+ Commit your changes locally as soon as a stable status of the work is reached.
+ Make sure to review carefully the committed changes beforehand to avoid unintentional commit of a wrong code.
+
+ * In the console:
+
+~~~~~
+ > git diff
+ …
+ > git commit -a -m "Write meaningful commit message here"
+~~~~~
+
+ Option –a tells the command to automatically include (stage) files
+ that have been modified or deleted, but it will omit the new files that might have been added by you.
+ To commit such new files, you must add (stage) them before commit command.
+
+ To find new unstaged files and them to commit, use commands:
+
+~~~~~
+ > git status -s
+ ?? file1.hxx
+ ?? file2.cxx
+ > git add file1.hxx file2.cxx
+~~~~~
+
+ * In TortoiseGit: right-click, choose “Git Commit -> CR…”:
+
+@image html OCCT_GitGuide_V2_image014.png
+@image latex OCCT_GitGuide_V2_image014.png
+
+ Unstaged files will be shown if you check the option ‘Show Unversioned Files’.
+ Double-clock on each modified file to see the changes to be committed (as a difference vs. the base version).
+
+@subsection occt_gitguide_4_6 Pushing branch to the remote repository
+
+ When the code developed in your local branch is ready for review,
+ or you need to share it with others, push your local changes to the remote repository.
+
+ * In the console:
+
+~~~~~
+ > git push "origin" CR12345:CR12345
+~~~~~
+
+ * In TortoiseGit: right-click, TortoiseGit -> Push
+
+@image html OCCT_GitGuide_V2_image015.png
+@image latex OCCT_GitGuide_V2_image015.png
+
+Note that Git will forbid pushing a branch if the corresponding remote branch already exists and has some changes, which are not in the history of your local branch. This may happen in different situations:
+ * You have amended the last commit which is already in the remote repository.
+ If you are sure that nobody else uses your branch, push again with ‘force’ option.
+ * You have rebased your branch, so that now it is completely different
+ from the branch in the remote repository. In this case, push it under a different name (add a suffix):
+
+@image html OCCT_GitGuide_V2_image016.png
+@image latex OCCT_GitGuide_V2_image016.png
+
+ Then remove the original remote branch so that other people recognize that it has been replaced by the new one. For that, select TortoiseGit -> Push again, then select an empty line for your local branch name,
+ and enter the name of the branch to be removed in ‘Remote’ field:
+
+@image html OCCT_GitGuide_V2_image017.png
+@image latex OCCT_GitGuide_V2_image017.png
+
+ * The other developer has committed some changes in the remote branch.
+ In this case, pull changes from the remote repository to have them merged
+ with your version, and push your branch after it is successfully merged.
+
+@subsection occt_gitguide_4_7 Synchronizing with remote repository
+
+ Maintain your repository synchronized with the remote one and clean unnecessary stuff regularly.
+ Use Git command fetch with option prune to get update of all branches
+ from the remote repository and to clean your local repository from the remote branches that have been deleted.
+
+ * In the console:
+
+~~~~~
+ > git fetch --prune
+~~~~~
+
+ * In TortoiseGit:
+
+@image html OCCT_GitGuide_V2_image018.png
+@image latex OCCT_GitGuide_V2_image018.png
+
+ If some changes have been made to the branch you are working with in the remote repository,
+ use Git command pull to get the remote changes and merge them with your local branch.
+ This operation is required in particular to update your local master branch when the remote master changes.
+
+ * In console:
+~~~~~
+ > git pull
+~~~~~
+ * In TortoiseGit:
+
+@image html OCCT_GitGuide_V2_image019.png
+@image latex OCCT_GitGuide_V2_image019.png
+
+ Note that the local branches of your repository are the primary place
+ where your changes are stored until they get integrated to the official version
+ of OCCT (master branch). The branches submitted to official repository
+ are for collaborative work, review, and integration;
+ that repository should not be used for long-term storage of incomplete changes.
+
+Remove the local branches that you do not need any more. Note that you cannot delete the current branch, thus you need to switch to another one (e.g. master) if the branch you are going to delete is the current one.
+
+ * In the console:
+~~~~~
+ > git branch -d CR12345
+~~~~~
+
+ * In TortoiseGit: right-click, select TortoiseGit -> Show log
+
+@image html OCCT_GitGuide_V2_image020.png
+@image latex OCCT_GitGuide_V2_image020.png
+
+ Select “All branches” to view all branches.
+ Right-click on the branch you want to delete and select Delete… menu item corresponding to this branch.
+
+ Note that the log view in TortoiseGit is a convenient tool
+ to visualize and manage branches; it provides short-cuts to many functions described above.
+
+@subsection occt_gitguide_4_8 Applying a fix made on older version of OCCT
+
+ If you have a fix made on a previous version of OCCT,
+ perform the following sequence of operations to prepare it
+ for testing and integration to the current development version.
+
+ * Identify the version of OCCT on which the fix has been made.
+ In most cases, this will be an OCCT release, e.g. OCCT 6.7.0.;
+ then just find a tag or a commit corresponding to this version in the Git history log of the master branch.
+ * Create a branch basing on this tag or commit. In TortoiseGit history log: right-click on the base commit, then select **Create branch at this version**.
+
+@image html OCCT_GitGuide_V2_image021.png
+@image latex OCCT_GitGuide_V2_image021.png
+
+ Check option **Switch to the new branch** to start working within the new branch immediately, or switch to it separately afterwards.
+
+ * Put your fix in the working copy, build and check that it works, then commit to the branch.
+ * Rebase the branch on the current master.
+
+ In TortoiseGit: right-click on the working directory,
+ then choose TortoiseGit->Rebase; then select *remotes/origin/master* as UpStream revision, and click **Start**:
+
+@image html OCCT_GitGuide_V2_image022.png
+@image latex OCCT_GitGuide_V2_image022.png
+
+ Note that you can get some conflicts during rebase.
+ To resolve the conflicts double-click on each conflicted file
+ (highlighted by red in the file list) to open visual merge tool.
+ Switch between conflicting fragments by red arrows, and for each one
+ decide if the code of one or both conflicting versions is to be taken.
+ Use the toolbar.
+
+@subsection occt_gitguide_4_9 Rebasing with history clean-up
+
+ At some moments you might need to rebase your branch on the latest version of the master.
+
+ We recommend rebasing before the first submission of the branch
+ for review or when the master has diverged substantially from your branch.
+
+ Rebasing is a good occasion to clean-up the history of commits in the branch.
+ Consider collapsing (squashing, in terms of Git) the history of your branch
+ into a single commit unless you deem that having separate commits is important
+ for your future work with the branch or its code reviewing.
+ Git also allows you to change the order of commits, edit commit contents and messages, etc.
+
+ Here is the sequence of actions to rebase your branch into a single commit:
+
+ * Switch to your branch (e.g. “CR12345”)
+ * In TortoiseGit history log, select a branch to rebase on (usually remotes/origin/master)
+ and in the context menu choose **Rebase “CR12345” onto this**.
+ * In the Rebase dialog, check **Squash All**.
+
+@image html OCCT_GitGuide_V2_image023.png
+@image latex OCCT_GitGuide_V2_image023.png
+
+ **Note** that you can also change the order of commits and define for each commit
+ whether it should be kept (“pick”), edited, or just skipped.
+
+ * Click **Start**.
+ * The process will stop if a conflict is detected.
+ In such case, find files with status ‘Conflicted’ in the list (marked by red),
+ and double-click on them to resolve the conflict.
+ When all conflicts are resolved, click ‘Continue’.
+
+@image html OCCT_GitGuide_V2_image024.png
+@image latex OCCT_GitGuide_V2_image024.png
+
+ * At the end of the process, edit the final commit message (it should start from the issue ID and a description from Mantis in the first line, followed by a summary of actual changes), and click **Commit**.
+
+@image html OCCT_GitGuide_V2_image025.png
+@image latex OCCT_GitGuide_V2_image025.png
+
+@section occt_gitguide_5 Work with repository: Reviewer operations
+
+@subsection occt_gitguide_5_1 Review branch changes using GitWeb
+
+ The changes made in the branch can be reviewed without direct access to Git, using GitWeb interface:
+
+ * Open GitWeb in your web browser: http://git.dev.opencascade.org/gitweb/?p=occt.git
+ * Locate the branch you want to review among heads (click ‘…’ at the bottom of the page to see the full list).
+ * Click log (or shortlog) to see the history of the branch.
+
+ **Note** that the branch can contain more than one commit, and you need to distinguish commits
+ that belong to that branch (those to be reviewed) from the commits
+ corresponding to the previous state of the master branch.
+ Normally the first commit in the list that starts from the ID
+ of the other issue indicates the branching point;
+ commits above it are the ones to be reviewed.
+
+ * Click *commitdiff* on each log entry to review the changes (highlighted with color format).
+
+@subsection occt_gitguide_5_2 Review branch changes with TortoiseGit
+
+ Use of TortoiseGit is recommended for convenient code review:
+
+ * Fetch the changes from the remote repository as described in 4.7;
+ * Right-click on the repository, choose TortoiseGit -> Show log;
+ * Locate the remote branch you need to review;
+ * To review commits one-by-one, select each commit in the log.
+ The list of changed files is shown at the bottom of the window;
+ double-click on the file will open visual compare tool.
+ * To review all changes made in the branch at once, or to compare
+ two arbitrary revisions, select the corresponding commits in the log
+ (e.g. the last commit in the branch and the branching point),
+ right-click for the context menu, and choose **Compare revisions**.
+
+@image html OCCT_GitGuide_V2_image026.png
+@image latex OCCT_GitGuide_V2_image026.png
+
**On Linux:**
-1. If OCCT was built by Code::Blocks * use $CASROOT/draw_cbp.sh file to launch DRAWEXE executable;
-2. If OCCT was built by Automake * use $CASROOT/draw_amk.sh file to launch DRAWEXE executable;
+1. If OCCT was built by Code::Blocks use <i>$CASROOT/draw_cbp.sh</i> file to launch *DRAWEXE* executable;
+2. If OCCT was built by Automake use <i>$CASROOT/draw_amk.sh</i> file to launch *DRAWEXE* executable;
Draw[1]> prompt appears in the command window
-Type pload ALL
+Type *pload ALL*
**On Windows:**
Launch Draw executable from Open CASCADE Technology\\Test Harness\\Draw Test Harness
-item of the Start\\Programs menu or Use $CASROOT\\draw.bat file to launch DRAWEXE executable.
+item of the Start\\Programs menu or Use <i>$CASROOT\\draw.bat</i> file to launch *DRAWEXE* executable.
Draw[1]> prompt appears in the command window
**Creating your first geometric objects**
-1. In the command window, type axo to create an axonometric view
-2. Type box b -10 -10 -10 20 20 20 to create a cube b of size 20,
- parallel to the X Y Z axis and centered on the origin.
- The cube will be displayed in the axonometric view in wireframe mode
-3. Type fit to fill the viewer with the cube
-4. Type pcylinder c 2 30 to create a cylinder c of radius 2 and height 30.
- The cylinder will be displayed in addition to the cube
+1. In the command window, type *axo* to create an axonometric view
+2. Type *box b -10 -10 -10 20 20 20* to create a cube *b* of size 20, parallel to the X Y Z axis and centered on the origin. The cube will be displayed in the axonometric view in wireframe mode.
+3. Type *fit* to fill the viewer with the cube
+4. Type *pcylinder c 2 30* to create a cylinder *c* of radius 2 and height 30. The cylinder will be displayed in addition to the cube
**Manipulating the view**
-1. Type clear to erase the view
-2. Type donly c to display the cylinder only
-3. Type donly b to display the cube only
-4. Type hlr hlr b to display the cube in the hidden line removal mode
+1. Type *clear* to erase the view
+2. Type *donly c* to display the cylinder only
+3. Type *donly b* to display the cube only
+4. Type *hlr hlr b* to display the cube in the hidden line removal mode
**Running demonstration files**
-1. Type cd ../.. to return to the root directory
-2. Type cd src/DrawResources to reach the DrawResources directory
-3. Type source "Available Demo File" to run the demonstration provided with Open CASCADE
-4. The following demonstration files are available:
+1. Type *cd ../..* to return to the root directory
+2. Type *cd samples/tcl* to reach the *DrawResources* directory
+3. Type *source <demo_file>* to run the demonstration file provided with Open CASCADE. The following demonstration files are available:
+ * bottle.tcl
+ * challenge.tcl
* DataExchangeDemo.tcl
* ModelingDemo.tcl
- * OCAFDemo.tcl
* VisualizationDemo.tcl
**Getting Help**
-1. Type help to see all available commands
-2. Type help command-name to find out the arguments for a given command
+1. Type *help* to see all available commands
+2. Type *help <command_name>* to find out the arguments for a given command
@subsection OCCT_OVW_SECTION_7_3 Programming Samples
--- /dev/null
+ BRep Format Description {#occt_brep_format}
+========================
+
+@tableofcontents
+
+@section occt_brep_format_1 Introduction
+
+ BREP format is used to store 3D models and allows to store a model which consists
+ of vertices, edges, wires, faces, shells, solids, compsolids, compounds, edge triangulations,
+ face triangulations, polylines on triangulations, space location and orientation.
+ Any set of such models may be stored as a single model which is a compound of the models.
+
+ The format is described in an order which is convenient for understanding
+ rather than in the order the format parts follow each other.
+ BNF-like definitions are used in this document.
+ Most of the chapters contain BREP format descriptions in the following order:
+
+ * format file fragment to illustrate the part;
+ * BNF-like definition of the part;
+ * detailed description of the part.
+
+@section occt_brep_format_2 Format Common Structure
+
+ ASCII encoding is used to read/write BREP format from/to file. The format data are stored in a file as text data.
+
+ BREP format uses the following BNF terms:
+
+ * <\n>;
+ * <_\n>;
+ * <_>;
+ * <flag>;
+ * <int>;
+ * <real>;
+ * <2D point>;
+ * <3D point>;
+ * <2D direction>;
+ * <3D direction>;
+ * <+>;
+
+ * \n is the operating-system-dependent ASCII character sequence which separates ASCII text strings in the operating system used.
+ * _\n = " "* \n;
+ * _ = " "+;
+ * _ is a not empty sequence of space characters with ASCII code 21h.
+ * flag = "0" | "1";
+ * int is an integer number from @image html brep_wp_image003.gif to @image html brep_wp_image004.gif which is written in denary system.
+ * real is a real from @image html brep_wp_image005.gif to @image html brep_wp_image006.gif
+ which is written in decimal or E form with base 10.
+
+ The point is used as a delimiter of the integer and fractional parts.
+
+ * 2D point = real _ real;
+ * 3D point = real (_ real) ^ 2;
+ * 2D direction is a 2D point @image html brep_wp_image007.gif so that @image html brep_wp_image008.gif.
+ * 3D direction is a 3D point @image html brep_wp_image009.gif so that @image html brep_wp_image010.gif.
+ + is an arithmetic operation of addition.
+
+ The format consists of the following sections:
+
+ * content type;
+ * version;
+ * locations;
+ * geometry;
+ * shapes.
+
+ content type = "DBRep_DrawableShape" _\n _\n;
+ content type have other values [1].
+
+ version = ("CASCADE Topology V1, (c) Matra-Datavision" | "CASCADE Topology V2, (c) Matra-Datavision") _\n;
+
+ The difference of the versions is described in the document.
+
+ Sections <locations>, <geometry> and <shapes> are described below in separate chapters of the document.
+
+@section occt_brep_format_3 Section locations
+
+**Example**
+
+@verbatim
+ Locations 3
+ 1
+ 0 0 1 0
+ 1 0 0 0
+ 0 1 0 0
+ 1
+ 1 0 0 4
+ 0 1 0 5
+ 0 0 1 6
+ 2 1 1 2 1 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ locations = location header _\n location records;
+ location header = "Locations" _ location record count;
+ location record count = int;
+ location records = location record ^ location record count;
+ location record = location record 1 | location record 2;
+ location record 1 = "1" _\n location data 1;
+ location record 2 = "2" _ location data 2;
+ location data 1 = ((_ real) ^ 4 _\n) ^ 3;
+ location data 2 = (int _ int _)* "0" _\n;
+@endverbatim
+
+****Description****
+
+*location data 1* is interpreted as a 3 x 4 matrix @image html brep_wp_image011.gif
+which describes transformation of 3 dimensional space and satisfies the following constraints:
+
+ * @image html brep_wp_image012.gif where @image html brep_wp_image013.gif where @image html brep_wp_image014.gif;
+ * @image html brep_wp_image015.gif where @image html brep_wp_image016.gif.
+
+The transformation transforms a point
+
+@image html brep_wp_image017.gif
+
+to another point
+
+@image html brep_wp_image018.gif
+
+by the rule:
+
+@image html brep_wp_image019.gif.
+@image html brep_wp_image020.gif
+
+may be a composition of matrices for the following elementary transformations:
+
+ * parallel translation – @image html brep_wp_image021.gif;
+ * rotation around an axis with a direction @image html brep_wp_image022.gif by an angle @image html brep_wp_image023.gif –
+
+@image html brep_wp_image024.gif;
+
+ * scaling – @image html brep_wp_image025.gif where @image html brep_wp_image026.gif;
+ * central symmetry – @image html brep_wp_image027.gif;
+ * axis symmetry – @image html brep_wp_image028.gif;
+ * plane symmetry – @image html brep_wp_image029.gif.
+
+*location data 2* is interpreted as a composition of locations raised to a power and placed above this location data 2 in the section locations. location data 2 is a sequence @image html brep_wp_image030.gif of @image html brep_wp_image031.gif integer pairs @image html brep_wp_image032.gif (@image html brep_wp_image033.gif). flag 0 is the indicator of the sequence end. The sequence is interpreted as a composition @image html brep_wp_image034.gif where @image html brep_wp_image035.gif is a location from @image html brep_wp_image036.gif-th location record in the section locations. location record numbering starts from1.
+
+
+@section occt_brep_format_4 Section geometry
+
+@verbatim
+ geometry =
+ 2D curves
+ 3D curves
+ 3D polygons
+ polygons on triangulations
+ surfaces
+ triangulations;
+@endverbatim
+
+@subsection occt_brep_format_4_1 Subsection 3D curves
+
+**Example**
+
+@verbatim
+ Curves 13
+ 1 0 0 0 0 0 1
+ 1 0 0 3 -0 1 0
+ 1 0 2 0 0 0 1
+ 1 0 0 0 -0 1 0
+ 1 1 0 0 0 0 1
+ 1 1 0 3 0 1 0
+ 1 1 2 0 0 0 1
+ 1 1 0 0 -0 1 0
+ 1 0 0 0 1 0 -0
+ 1 0 0 3 1 0 -0
+ 1 0 2 0 1 0 -0
+ 1 0 2 3 1 0 -0
+ 1 1 0 0 1 0 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D curves = 3D curve header _\n 3D curve records;
+
+ 3D curve header = "Curves" _ 3D curve count;
+
+ 3D curve count = int;
+
+ 3D curve records = 3D curve record ^ 3D curve count;
+
+ 3D curve record =
+ 3D curve record 1 |
+ 3D curve record 2 |
+ 3D curve record 3 |
+ 3D curve record 4 |
+ 3D curve record 5 |
+ 3D curve record 6 |
+ 3D curve record 7 |
+ 3D curve record 8 |
+ 3D curve record 9;
+
+
+@subsubsection occt_brep_format_4_1_1 3D curve record 1 – Line
+
+**Example**
+
+@verbatim
+ 1 1 0 3 0 1 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D curve record 1 = "1" _ 3D point _ 3D direction _\n;
+@endverbatim
+
+**Description**
+
+3D curve record 1 describes a line. The line data consist of a 3D point @image html brep_wp_image037.gif and a 3D direction @image html brep_wp_image038.gif. The line passes through the point @image html brep_wp_image037.gif, has the direction @image html brep_wp_image038.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image039.gif, @image html brep_wp_image040.gif.
+
+The **Example** record is interpreted as a line which passes through a point @image html brep_wp_image041.gif, has a direction @image html brep_wp_image042.gif and is defined by the following parametric equation: @image html brep_wp_image043.gif.
+
+
+@subsubsection occt_brep_format_4_1_2 3D curve record 2 – Circle
+
+**Example**
+
+@verbatim
+ 2 1 2 3 0 0 1 1 0 -0 -0 1 0 4
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D curve record 2 = "2" _ 3D circle center _ 3D circle N _ 3D circle Dx _ 3D circle Dy _ 3D circle radius _\n;
+
+ 3D circle center = 3D point;
+
+ 3D circle N = 3D direction;
+
+ 3D circle Dx = 3D direction;
+
+ 3D circle Dy = 3D direction;
+
+ 3D circle radius = real;
+@endverbatim
+
+**Description**
+
+3D curve record 2 describes a circle. The circle data consist of a 3D point @image html brep_wp_image037.gif, pairwise orthogonal 3D directions @image html brep_wp_image044.gif, @image html brep_wp_image045.gif and @image html brep_wp_image046.gif and a non-negative real @image html brep_wp_image047.gif. The circle has a center @image html brep_wp_image037.gif and is located in a plane with a normal @image html brep_wp_image044.gif. The circle has a radius @image html brep_wp_image047.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image048.gif, @image html brep_wp_image049.gif.
+
+The example record is interpreted as a circle which has its center @image html brep_wp_image050.gif, is located in plane with a normal @image html brep_wp_image051.gif. Directions for the circle are @image html brep_wp_image052.gif and @image html brep_wp_image053.gif. The circle has a radius @image html brep_wp_image054.gif and is defined by the following parametric equation: @image html brep_wp_image055.gif.
+
+
+@subsubsection occt_brep_format_4_1_3 3D curve record 3 – Ellipse
+
+**Example**
+
+@verbatim
+ 3 1 2 3 0 0 1 1 0 -0 -0 1 0 5 4
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D curve record 3 = "3" _ 3D ellipse center _ 3D ellipse N _ 3D ellipse Dmaj _ 3D ellipse Dmin _ 3D ellipse Rmaj _ 3D ellipse Rmin _\n;
+
+ 3D ellipse center = 3D point;
+
+ 3D ellipse N = 3D direction;
+
+ 3D ellipse Dmaj = 3D direction;
+
+ 3D ellipse Dmin = 3D direction;
+
+ 3D ellipse Rmaj = real;
+
+ 3D ellipse Rmin = real;
+@endverbatim
+
+**Description**
+
+3D curve record 3 describes an ellipse. The ellipse data consist of a 3D point @image html brep_wp_image037.gif, pairwise orthogonal 3D directions @image html brep_wp_image044.gif, @image html brep_wp_image056.gif and @image html brep_wp_image057.gif and non-negative reals @image html brep_wp_image058.gif and @image html brep_wp_image059.gif so that @image html brep_wp_image060.gif. The ellipse has its center @image html brep_wp_image037.gif, is located in plane with the normal @image html brep_wp_image044.gif, has major and minor axis directions @image html brep_wp_image056.gif and @image html brep_wp_image057.gif, major and minor radii @image html brep_wp_image058.gif and @image html brep_wp_image059.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image061.gif, @image html brep_wp_image049.gif.
+
+The example record is interpreted as an ellipse which has its center @image html brep_wp_image050.gif, is located in plane with a normal @image html brep_wp_image051.gif, has major and minor axis directions @image html brep_wp_image062.gif and @image html brep_wp_image063.gif, major and minor radii @image html brep_wp_image064.gif and @image html brep_wp_image065.gif and is defined by the following parametric equation: @image html brep_wp_image066.gif.
+
+
+@subsubsection occt_brep_format_4_1_4 3D curve record 4 – Parabola
+
+**Example**
+
+@verbatim
+ 4 1 2 3 0 0 1 1 0 -0 -0 1 0 16
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D curve record 4 = "4" _ 3D parabola origin _ 3D parabola N _ 3D parabola Dx _ 3D parabola Dy _ 3D parabola focal length _\n;
+
+ 3D parabola origin = 3D point;
+
+ 3D parabola N = 3D direction;
+
+ 3D parabola Dx = 3D direction;
+
+ 3D parabola Dy = 3D direction;
+
+ 3D parabola focal length = real;
+@endverbatim
+
+**Description**
+
+3D curve record 4 describes a parabola. The parabola data consist of a 3D point @image html brep_wp_image037.gif, pairwise orthogonal 3D directions @image html brep_wp_image044.gif, @image html brep_wp_image045.gif and @image html brep_wp_image046.gif and a non-negative real @image html brep_wp_image067.gif. The parabola is located in plane which passes through the point @image html brep_wp_image037.gif and has the normal @image html brep_wp_image044.gif. The parabola has a focus length @image html brep_wp_image067.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image068.gif, @image html brep_wp_image069.gif Ü @image html brep_wp_image070.gif;
+
+@image html brep_wp_image071.gif, @image html brep_wp_image069.gif Ü @image html brep_wp_image072.gif (degenerated case).
+
+The example record is interpreted as a parabola in plane which passes through a point @image html brep_wp_image073.gif and has a normal @image html brep_wp_image074.gif. Directions for the parabola are @image html brep_wp_image075.gif and @image html brep_wp_image076.gif. The parabola has a focus length @image html brep_wp_image077.gif and is defined by the following parametric equation: @image html brep_wp_image078.gif.
+
+
+@subsubsection occt_brep_format_4_1_5 3D curve record 5 – Hyperbola
+
+**Example**
+
+@verbatim
+ 5 1 2 3 0 0 1 1 0 -0 -0 1 0 5 4
+@verbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D curve record 5 = "5" _ 3D hyperbola origin _ 3D hyperbola N _ 3D hyperbola Dx _ 3D hyperbola Dy _ 3D hyperbola Kx _ 3D hyperbola Ky _\n;
+
+ 3D hyperbola origin = 3D point;
+
+ 3D hyperbola N = 3D direction;
+
+ 3D hyperbola Dx = 3D direction;
+
+ 3D hyperbola Dy = 3D direction;
+
+ 3D hyperbola Kx = real;
+
+ 3D hyperbola Ky = real;
+@endverbatim
+
+Descripton
+
+3D curve record 5 describes a hyperbola. The hyperbola data consist of a 3D point @image html brep_wp_image037.gif, pairwise orthogonal 3D directions @image html brep_wp_image044.gif, @image html brep_wp_image045.gif and @image html brep_wp_image046.gif and non-negative reals @image html brep_wp_image079.gif and @image html brep_wp_image080.gif. The hyperbola is located in plane which passes through the point @image html brep_wp_image037.gif and has the normal @image html brep_wp_image044.gif. The hyperbola is defined by the following parametric equation:
+
+@image html brep_wp_image081.gif, @image html brep_wp_image069.gif.
+
+The example record is interpreted as a hyperbola in plane which passes through a point @image html brep_wp_image073.gif and has a normal @image html brep_wp_image074.gif. Other hyperbola data are @image html brep_wp_image075.gif, @image html brep_wp_image076.gif, @image html brep_wp_image082.gif and @image html brep_wp_image083.gif. The hyperbola is defined by the following parametric equation: @image html brep_wp_image084.gif.
+
+
+@subsubsection occt_brep_format_4_1_6 3D curve record 6 – Bezier Curve
+
+**Example**
+
+@verbatim
+ 6 1 2 0 1 0 4 1 -2 0 5 2 3 0 6
+@verbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D curve record 6 = "6" _ 3D Bezier rational flag _ 3D Bezier degree 3D Bezier weight poles _\n;
+
+ 3D Bezier rational flag = flag;
+
+ 3D Bezier degree = int;
+
+ 3D Bezier weight poles = (_ 3D Bezier weight pole) ^ (3D Bezier degree + "1");
+
+ 3D Bezier weight pole = 3D point [_ real];
+@verbatim
+
+**Description**
+
+3D curve record 6 describes a Bezier curve. The curve data consist of a rational flag @image html brep_wp_image047.gif, a degree @image html brep_wp_image085.gif and weight poles.
+
+The weight poles are @image html brep_wp_image086.gif 3D points @image html brep_wp_image087.gif if the flag @image html brep_wp_image047.gif is 0. The weight poles are @image html brep_wp_image086.gif pairs @image html brep_wp_image088.gif if flag @image html brep_wp_image047.gif is 1. Here @image html brep_wp_image089.gif is a 3D point and @image html brep_wp_image090.gif is a positive real (@image html brep_wp_image091.gif). @image html brep_wp_image092.gif (@image html brep_wp_image093.gif) if the flag @image html brep_wp_image047.gif is 0.
+
+The Bezier curve is defined by the following parametric equation:
+
+@image html brep_wp_image094.gif, @image html brep_wp_image095.gif
+
+where @image html brep_wp_image096.gif.
+
+The example record is interpreted as a Bezier curve with a rational flag @image html brep_wp_image097.gif, degree @image html brep_wp_image098.gif and weight poles @image html brep_wp_image099.gif, @image html brep_wp_image100.gif, @image html brep_wp_image101.gif, @image html brep_wp_image102.gif and @image html brep_wp_image103.gif, @image html brep_wp_image104.gif. The Bezier curve is defined by the following parametric equation:
+
+@image html brep_wp_image105.gif.
+
+
+@subsubsection occt_brep_format_4_1_7 3D curve record 7 – B-spline Curve
+
+**Example**
+
+@verbatim
+ 7 1 0 1 3 5 0 1 0 4 1 -2 0 5 2 3 0 6
+ 0 1 0.25 1 0.5 1 0.75 1 1 1
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D curve record 7 = "7" _ 3D B-spline rational flag _ "0" _ 3D B-spline degree _ 3D B-spline pole count _ 3D B-spline multiplicity knot count 3D B-spline weight poles _\n 3D B-spline multiplicity knots _\n;
+
+ 3D B-spline rational flag = flag;
+
+ 3D B-spline degree = int;
+
+ 3D B-spline pole count = int;
+
+ 3D B-spline multiplicity knot count = int;
+
+ 3D B-spline weight poles = (_ 3D B-spline weight pole) ^ 3D B-spline pole count;
+
+ 3D B-spline weight pole = 3D point [_ real];
+
+ 3D B-spline multiplicity knots =
+ (_ 3D B-spline multiplicity knot) ^ 3D B-spline multiplicity knot count;
+
+ 3D B-spline multiplicity knot = real _ int;
+@endverbatim
+
+**Description**
+
+3D curve record 7 describes a B-spline curve. The curve data consist of a rational flag @image html brep_wp_image047.gif, a degree @image html brep_wp_image085.gif, pole count @image html brep_wp_image106.gif, multiplicity knot count @image html brep_wp_image107.gif, weight poles and multiplicity knots.
+
+The weight poles are @image html brep_wp_image108.gif 3D points @image html brep_wp_image109.gif if the flag @image html brep_wp_image047.gif is 0. The weight poles are @image html brep_wp_image108.gif pairs @image html brep_wp_image110.gif if the flag @image html brep_wp_image047.gif is 1. Here @image html brep_wp_image089.gif is a 3D point and @image html brep_wp_image090.gif is a positive real (@image html brep_wp_image111.gif). @image html brep_wp_image092.gif (@image html brep_wp_image111.gif) if the flag @image html brep_wp_image047.gif is 0.
+
+The multiplicity knots are @image html brep_wp_image107.gif pairs @image html brep_wp_image112.gif. Here @image html brep_wp_image113.gif is a knot with a multiplicity @image html brep_wp_image114.gif (@image html brep_wp_image115.gif) so that
+
+@image html brep_wp_image116.gif (@image html brep_wp_image117.gif),
+@image html brep_wp_image118.gif, @image html brep_wp_image119.gif, @image html brep_wp_image120.gif (@image html brep_wp_image121.gif), @image html brep_wp_image122.gif.
+
+The B-spline curve is defined by the following parametric equation:
+
+@image html brep_wp_image123.gif, @image html brep_wp_image124.gif
+
+where functions @image html brep_wp_image125.gif have the following recursion definition by @image html brep_wp_image126.gif
+
+@image html brep_wp_image127.gif, @image html brep_wp_image128.gif (@image html brep_wp_image129.gif)
+
+where
+
+@image html brep_wp_image130.gif (@image html brep_wp_image131.gif, @image html brep_wp_image132.gif).
+
+The example record is interpreted as a B-spline curve with a rational flag @image html brep_wp_image097.gif, a degree @image html brep_wp_image133.gif, pole count @image html brep_wp_image134.gif, multiplicity knot count @image html brep_wp_image135.gif, weight poles @image html brep_wp_image136.gif, @image html brep_wp_image137.gif, @image html brep_wp_image138.gif, @image html brep_wp_image139.gif and @image html brep_wp_image140.gif, @image html brep_wp_image141.gif, multiplicity knots @image html brep_wp_image142.gif, @image html brep_wp_image143.gif, @image html brep_wp_image144.gif, @image html brep_wp_image145.gif, @image html brep_wp_image146.gif, @image html brep_wp_image147.gif, @image html brep_wp_image148.gif, @image html brep_wp_image149.gif and @image html brep_wp_image150.gif, @image html brep_wp_image151.gif. The B-spline curve is defined by the following parametric equation:
+
+@image html brep_wp_image152.gif.
+
+
+@subsubsection occt_brep_format_4_1_8 3D curve record 8 – Trimmed Curve
+
+**Example**
+
+@verbatim
+ 8 4 -5
+ 1 1 2 3 1 0 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D curve record 8 = "8" _ 3D trimmed curve u min _ 3D trimmed curve u max _\n 3D curve record;
+
+ 3D trimmed curve u min = real;
+
+ 3D trimmed curve u max = real;
+@endverbatim
+
+**Description**
+
+3D curve record 8 describes a trimmed curve. The trimmed curve data consist of reals @image html brep_wp_image153.gif and @image html brep_wp_image154.gif and 3D curve record so that @image html brep_wp_image155.gif. The trimmed curve is a restriction of the base curve @image html brep_wp_image156.gif described in the record to the segment @image html brep_wp_image157.gif. The trimmed curve is defined by the following parametric equation:
+
+@image html brep_wp_image158.gif, @image html brep_wp_image159.gif.
+
+The example record is interpreted as a trimmed curve with @image html brep_wp_image160.gif and @image html brep_wp_image161.gif for the base curve @image html brep_wp_image162.gif. The trimmed curve is defined by the following parametric equation: @image html brep_wp_image163.gif, @image html brep_wp_image164.gif.
+
+
+@subsubsection occt_brep_format_4_1_9 3D curve record 9 – Offset Curve
+
+**Example**
+
+@verbatim
+ 9 2
+ 0 1 0
+ 1 1 2 3 1 0 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D curve record 9 = "9" _ 3D offset curve distance _\n
+ 3D offset curve direction _\n
+ 3D curve record;
+
+ 3D offset curve distance = real;
+
+ 3D offset curve direction = 3D direction;
+@endverbatim
+
+**Description**
+
+3D curve record 9 describes an offset curve. The offset curve data consist of a distance @image html brep_wp_image165.gif, a 3D direction @image html brep_wp_image038.gif and a 3D curve record. The offset curve is the result of offsetting the base curve @image html brep_wp_image156.gif described in the record to the distance @image html brep_wp_image165.gif along the vector @image html brep_wp_image166.gif. The offset curve is defined by the following parametric equation:
+
+@image html brep_wp_image167.gif, @image html brep_wp_image168.gif.
+
+The example record is interpreted as an offset curve with a distance @image html brep_wp_image169.gif, direction @image html brep_wp_image170.gif, base curve @image html brep_wp_image162.gif and defined by the following parametric equation: @image html brep_wp_image171.gif.
+
+@subsection occt_brep_format_4_2 Subsection surfaces
+
+**Example**
+
+@verbatim
+ Surfaces 6
+ 1 0 0 0 1 0 -0 0 0 1 0 -1 0
+ 1 0 0 0 -0 1 0 0 0 1 1 0 -0
+ 1 0 0 3 0 0 1 1 0 -0 -0 1 0
+ 1 0 2 0 -0 1 0 0 0 1 1 0 -0
+ 1 0 0 0 0 0 1 1 0 -0 -0 1 0
+ 1 1 0 0 1 0 -0 0 0 1 0 -1 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ surfaces = surface header _\n surface records;
+
+ surface header = "Surfaces" _ surface count;
+
+ surface records = surface record ^ surface count;
+
+ surface record =
+ surface record 1 |
+ surface record 2 |
+ surface record 3 |
+ surface record 4 |
+ surface record 5 |
+ surface record 6 |
+ surface record 7 |
+ surface record 8 |
+ surface record 9 |
+ surface record 10 |
+ surface record 11;
+@verbatim
+
+@subsubsection occt_brep_format_4_2_1 surface record 1 – Plane
+
+**Example**
+
+@verbatim
+ 1 0 0 3 0 0 1 1 0 -0 -0 1 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+surface record 1 = "1" _ 3D point (_ 3D direction) ^ 3 _\n;
+@endverbatim
+
+**Description**
+
+surface record 1 describes a plane. The plane data consist of a 3D point @image html brep_wp_image037.gif and pairwise orthogonal 3D directions @image html brep_wp_image044.gif, @image html brep_wp_image172.gif and @image html brep_wp_image173.gif. The plane passes through the point @image html brep_wp_image037.gif, has the normal @image html brep_wp_image174.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image175.gif, @image html brep_wp_image176.gif.
+
+The example record is interpreted as a plane which passes through a point @image html brep_wp_image177.gif, has a normal @image html brep_wp_image074.gif and is defined by the following parametric equation: @image html brep_wp_image178.gif.
+
+
+@subsubsection occt_brep_format_4_2_2 surface record 2 – Cylinder
+
+**Example**
+
+@verbatim
+ 2 1 2 3 0 0 1 1 0 -0 -0 1 0 4
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ surface record 2 = "2" _ 3D point (_ 3D direction) ^ 3 _ real _\n;
+@endverbatim
+
+**Description**
+
+surface record 2 describes a cylinder. The cylinder data consist of a 3D point @image html brep_wp_image037.gif, pairwise orthogonal 3D directions @image html brep_wp_image173.gif, @image html brep_wp_image045.gif and @image html brep_wp_image046.gif and a non-negative real @image html brep_wp_image047.gif. The cylinder axis passes through the point @image html brep_wp_image037.gif and has the direction @image html brep_wp_image173.gif. The cylinder has the radius @image html brep_wp_image179.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image180.gif, @image html brep_wp_image181.gif.
+
+The example record is interpreted as a cylinder which axis passes through a point @image html brep_wp_image073.gif and has a direction @image html brep_wp_image182.gif. Directions for the cylinder are @image html brep_wp_image075.gif and @image html brep_wp_image076.gif. The cylinder has a radius @image html brep_wp_image054.gif and is defined by the following parametric equation: @image html brep_wp_image183.gif.
+
+
+@subsubsection occt_brep_format_4_2_3 surface record 3 – Cone
+
+**Example**
+
+@verbatim
+ 3 1 2 3 0 0 1 1 0 -0 -0 1 0 4
+ 0.75
+@endverbatim
+
+
+**BNF-like Definition**
+
+@verbatim
+ surface record 3 = "3" _ 3D point (_ 3D direction) ^ 3 (_ real) ^ 2 _\n;
+@endverbatim
+
+**Description**
+
+surface record 3 describes a cone. The cone data consist of a 3D point @image html brep_wp_image037.gif, pairwise orthogonal 3D directions @image html brep_wp_image184.gif, @image html brep_wp_image045.gif and @image html brep_wp_image046.gif, a non-negative real @image html brep_wp_image047.gif and a real @image html brep_wp_image185.gif. The cone axis passes through the point @image html brep_wp_image037.gif and has the direction @image html brep_wp_image184.gif. The plane which passes through the point @image html brep_wp_image037.gif and is parallel to directions @image html brep_wp_image045.gif and @image html brep_wp_image046.gif is the cone referenced plane. The cone section by the plane is a circle with the radius @image html brep_wp_image047.gif. The direction from the point @image html brep_wp_image037.gif to the cone apex is @image html brep_wp_image186.gif. The cone has a half-angle @image html brep_wp_image187.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image188.gif, @image html brep_wp_image189.gif.
+
+The example record is interpreted as a cone with an axis which passes through a point @image html brep_wp_image073.gif and has a direction @image html brep_wp_image190.gif. Other cone data are @image html brep_wp_image075.gif, @image html brep_wp_image076.gif, @image html brep_wp_image191.gif and @image html brep_wp_image192.gif. The cone is defined by the following parametric equation:
+@image html brep_wp_image193.gif.
+
+
+@subsubsection occt_brep_format_4_2_4 surface record 4 – Sphere
+
+**Example**
+
+@verbatim
+ 4 1 2 3 0 0 1 1 0 -0 -0 1 0 4
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ surface record 4 = "4" _ 3D point (_ 3D direction) ^ 3 _ real _\n;
+@endverbatim
+
+**Description**
+
+surface record 4 describes a sphere. The sphere data consist of a 3D point @image html brep_wp_image037.gif, pairwise orthogonal 3D directions @image html brep_wp_image184.gif, @image html brep_wp_image045.gif and @image html brep_wp_image046.gif and a non-negative real @image html brep_wp_image047.gif. The sphere has the center @image html brep_wp_image194.gif, radius @image html brep_wp_image179.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image195.gif, @image html brep_wp_image196.gif.
+
+The example record is interpreted as a sphere with its center @image html brep_wp_image073.gif. Directions for the sphere are @image html brep_wp_image190.gif, @image html brep_wp_image075.gif and @image html brep_wp_image076.gif. The sphere has a radius @image html brep_wp_image191.gif and is defined by the following parametric equation:
+@image html brep_wp_image197.gif.
+
+
+@subsubsection occt_brep_format_4_2_5 surface record 5 – Torus
+
+**Example**
+
+@verbatim
+ 5 1 2 3 0 0 1 1 0 -0 -0 1 0 8 4
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ surface record 5 = "5" _ 3D point (_ 3D direction) ^ 3 (_ real) ^ 2 _\n;
+@endverbatim
+
+**Description**
+
+surface record 5 describes a torus. The torus data consist of a 3D point @image html brep_wp_image037.gif, pairwise orthogonal 3D directions @image html brep_wp_image184.gif, @image html brep_wp_image045.gif and @image html brep_wp_image046.gif and non-negative reals @image html brep_wp_image198.gif and @image html brep_wp_image199.gif. The torus axis passes through the point @image html brep_wp_image037.gif and has the direction @image html brep_wp_image184.gif. @image html brep_wp_image198.gif is the distance from the torus circle center to the axis. The torus circle has the radius @image html brep_wp_image199.gif. The torus is defined by the following parametric equation:
+
+@image html brep_wp_image200.gif, @image html brep_wp_image201.gif.
+
+The example record is interpreted as a torus with an axis which passes through a point @image html brep_wp_image073.gif and has a direction @image html brep_wp_image190.gif. @image html brep_wp_image075.gif, @image html brep_wp_image076.gif, @image html brep_wp_image202.gif and @image html brep_wp_image203.gif for the torus. The torus is defined by the following parametric equation:
+@image html brep_wp_image204.gif.
+
+
+@subsubsection occt_brep_format_4_2_6 surface record 6 – Linear Extrusion
+
+**Example**
+
+@verbatim
+ 6 0 0.6 0.8
+ 2 1 2 3 0 0 1 1 0 -0 -0 1 0 4
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ surface record 6 = "6" _ 3D direction _\n 3D curve record;
+@endverbatim
+
+**Description**
+
+surface record 6 describes a linear extrusion surface. The surface data consist of a 3D direction @image html brep_wp_image173.gif and a 3D curve record. The linear extrusion surface has the direction @image html brep_wp_image173.gif, the base curve @image html brep_wp_image205.gif described in the record and is defined by the following parametric equation:
+
+@image html brep_wp_image206.gif, @image html brep_wp_image207.gif.
+
+The example record is interpreted as a linear extrusion surface with a direction @image html brep_wp_image208.gif. The base curve is a circle for the surface. The surface is defined by the following parametric equation: @image html brep_wp_image209.gif, @image html brep_wp_image189.gif.
+
+
+@subsubsection occt_brep_format_4_2_7 surface record 7 – Revolution Surface
+
+**Example**
+
+@verbatim
+ 7 -4 0 3 0 1 0
+ 2 1 2 3 0 0 1 1 0 -0 -0 1 0 4
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ surface record 7 = "7" _ 3D point _ 3D direction _\n 3D curve record;
+@endverbatim
+
+**Description**
+
+surface record 7 describes a revolution surface. The surface data consist of a 3D point @image html brep_wp_image037.gif, a 3D direction @image html brep_wp_image038.gif and a 3D curve record. The surface axis passes through the point @image html brep_wp_image037.gif and has the direction @image html brep_wp_image038.gif. The base curve @image html brep_wp_image210.gif described by the record and the axis are coplanar. The surface is defined by the following parametric equation:
+
+@image html brep_wp_image211.gif, @image html brep_wp_image212.gif
+
+where @image html brep_wp_image213.gif, @image html brep_wp_image214.gif.
+
+The example record is interpreted as a revolution surface with an axis which passes through a point @image html brep_wp_image215.gif and has a direction @image html brep_wp_image170.gif. The base curve is a circle for the surface. The surface is defined by the following parametric equation:
+@image html brep_wp_image216.gif, @image html brep_wp_image201.gif where @image html brep_wp_image217.gif, @image html brep_wp_image218.gif.
+
+
+@subsubsection occt_brep_format_4_2_8 surface record 8 – Bezier Surface
+
+**Example**
+
+@verbatim
+ 8 1 1 2 1 0 0 1 7 1 0 -4 10
+ 0 1 -2 8 1 1 5 11
+ 0 2 3 9 1 2 6 12
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ surface record 8 = "8" _ Bezier surface u rational flag _ Bezier surface v rational flag _ Bezier surface u degree _ Bezier surface v degree _ Bezier surface weight poles;
+
+ Bezier surface u rational flag = flag;
+
+ Bezier surface v rational flag = flag;
+
+ Bezier surface u degree = int;
+
+ Bezier surface v degree = int;
+
+ Bezier surface weight poles =
+ (Bezier surface weight pole group _\n) ^ (Bezier surface u degree + "1");
+
+ Bezier surface weight pole group = Bezier surface weight pole
+ (_ Bezier surface weight pole) ^ Bezier surface v degree;
+
+ Bezier surface weight pole = 3D point [_ real];
+ @endverbatim
+
+**Description**
+
+surface record 8 describes a Bezier surface. The surface data consist of a u rational flag @image html brep_wp_image219.gif, v rational flag @image html brep_wp_image220.gif, u degree @image html brep_wp_image221.gif, v degree @image html brep_wp_image222.gif and weight poles.
+
+The weight poles are @image html brep_wp_image223.gif 3D points @image html brep_wp_image224.gif (@image html brep_wp_image225.gif) if @image html brep_wp_image226.gif. The weight poles are @image html brep_wp_image223.gif pairs @image html brep_wp_image227.gif (@image html brep_wp_image225.gif) if @image html brep_wp_image228.gif. Here @image html brep_wp_image224.gif is a 3D point and @image html brep_wp_image229.gif is a positive real (@image html brep_wp_image225.gif). @image html brep_wp_image230.gif (@image html brep_wp_image225.gif) if @image html brep_wp_image226.gif.
+
+The Bezier surface is defined by the following parametric equation:
+
+@image html brep_wp_image231.gif, @image html brep_wp_image232.gif
+
+where @image html brep_wp_image096.gif.
+
+The example record is interpreted as a Bezier surface with a u rational flag @image html brep_wp_image233.gif, v rational flag @image html brep_wp_image234.gif, u degree @image html brep_wp_image235.gif, v degree @image html brep_wp_image236.gif, weight poles @image html brep_wp_image237.gif, @image html brep_wp_image238.gif, @image html brep_wp_image239.gif, @image html brep_wp_image240.gif, @image html brep_wp_image241.gif, @image html brep_wp_image242.gif, @image html brep_wp_image243.gif, @image html brep_wp_image244.gif, @image html brep_wp_image245.gif, @image html brep_wp_image246.gif and @image html brep_wp_image247.gif, @image html brep_wp_image248.gif. The surface is defined by the following parametric equation:
+
+@image html brep_wp_image249.gif
+
+
+@subsubsection occt_brep_format_4_2_9 surface record 9 – B-spline Surface
+
+**Example**
+
+@verbatim
+ 9 1 1 0 0 1 1 3 2 5 4 0 0 1 7 1 0 -4 10
+ 0 1 -2 8 1 1 5 11
+ 0 2 3 9 1 2 6 12
+
+ 0 1
+ 0.25 1
+ 0.5 1
+ 0.75 1
+ 1 1
+
+ 0 1
+ 0.3 1
+ 0.7 1
+ 1 1
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ surface record 9 = "9" _ B-spline surface u rational flag _ B-spline surface v rational flag _ "0" _ "0" _ B-spline surface u degree _ B-spline surface v degree _ B-spline surface u pole count _ B-spline surface v pole count _ B-spline surface u multiplicity knot count _ B-spline surface v multiplicity knot count _ B-spline surface weight poles _\n B-spline surface u multiplicity knots _\n B-spline surface v multiplicity knots;
+
+ B-spline surface u rational flag = flag;
+
+ B-spline surface v rational flag = flag;
+
+ B-spline surface u degree = int;
+
+ B-spline surface v degree = int;
+
+ B-spline surface u pole count = int;
+
+ B-spline surface v pole count = int;
+
+ B-spline surface u multiplicity knot count = int;
+
+ B-spline surface v multiplicity knot count = int;
+
+ B-spline surface weight poles =
+ (B-spline surface weight pole group _\n) ^ B-spline surface u pole count;
+
+ B-spline surface weight pole group =
+ (B-spline surface weight pole _) ^ B-spline surface v pole count;
+
+ B-spline surface weight pole = 3D point [_ real];
+
+ B-spline surface u multiplicity knots =
+ (B-spline surface u multiplicity knot _\n) ^ B-spline surface u multiplicity knot count;
+
+ B-spline surface u multiplicity knot = real _ int;
+
+ B-spline surface v multiplicity knots =
+ (B-spline surface v multiplicity knot _\n) ^ B-spline surface v multiplicity knot count;
+
+ B-spline surface v multiplicity knot = real _ int;
+@endverbatim
+
+**Description**
+
+surface record 9 describes a B-spline surface. The surface data consist of a u rational flag @image html brep_wp_image219.gif, v rational flag @image html brep_wp_image220.gif, u degree @image html brep_wp_image221.gif, v degree @image html brep_wp_image222.gif, u pole count @image html brep_wp_image250.gif, v pole count @image html brep_wp_image251.gif, u multiplicity knot count @image html brep_wp_image252.gif, v multiplicity knot count @image html brep_wp_image253.gif, weight poles, u multiplicity knots, v multiplicity knots.
+
+The weight poles are @image html brep_wp_image254.gif 3D points @image html brep_wp_image224.gif (@image html brep_wp_image255.gif) if @image html brep_wp_image226.gif. The weight poles are @image html brep_wp_image254.gif pairs @image html brep_wp_image227.gif (@image html brep_wp_image255.gif) if @image html brep_wp_image228.gif. Here @image html brep_wp_image224.gif is a 3D point and @image html brep_wp_image229.gif is a positive real (@image html brep_wp_image255.gif). @image html brep_wp_image230.gif (@image html brep_wp_image255.gif) if @image html brep_wp_image226.gif.
+
+The u multiplicity knots are @image html brep_wp_image252.gif pairs @image html brep_wp_image256.gif. Here @image html brep_wp_image113.gif is a knot with multiplicity @image html brep_wp_image114.gif (@image html brep_wp_image257.gif) so that
+
+@image html brep_wp_image116.gif (@image html brep_wp_image258.gif),
+@image html brep_wp_image259.gif, @image html brep_wp_image260.gif, @image html brep_wp_image261.gif (@image html brep_wp_image262.gif), @image html brep_wp_image263.gif.
+
+The v multiplicity knots are @image html brep_wp_image253.gif pairs @image html brep_wp_image264.gif. Here @image html brep_wp_image265.gif is a knot with multiplicity @image html brep_wp_image266.gif (@image html brep_wp_image267.gif) so that
+
+@image html brep_wp_image268.gif (@image html brep_wp_image269.gif),
+@image html brep_wp_image270.gif, @image html brep_wp_image271.gif, @image html brep_wp_image272.gif (@image html brep_wp_image273.gif), @image html brep_wp_image274.gif.
+
+The B-spline surface is defined by the following parametric equation:
+
+@image html brep_wp_image275.gif, @image html brep_wp_image276.gif
+
+where functions @image html brep_wp_image277.gif and @image html brep_wp_image278.gif have the following recursion definition by @image html brep_wp_image279.gif
+
+@image html brep_wp_image127.gif, @image html brep_wp_image128.gif (@image html brep_wp_image280.gif);
+
+@image html brep_wp_image281.gif, @image html brep_wp_image282.gif (@image html brep_wp_image283.gif);
+where
+
+@image html brep_wp_image284.gif (@image html brep_wp_image285.gif,@image html brep_wp_image286.gif),
+
+@image html brep_wp_image287.gif (@image html brep_wp_image288.gif,@image html brep_wp_image289.gif).
+
+The example record is interpreted as a B-spline surface with a u rational flag @image html brep_wp_image233.gif, v rational flag @image html brep_wp_image234.gif, u degree @image html brep_wp_image290.gif, v degree @image html brep_wp_image236.gif, u pole count @image html brep_wp_image291.gif, v pole count @image html brep_wp_image292.gif, u multiplicity knot count @image html brep_wp_image293.gif, v multiplicity knot count @image html brep_wp_image294.gif, weight poles @image html brep_wp_image295.gif, @image html brep_wp_image296.gif, @image html brep_wp_image297.gif, @image html brep_wp_image298.gif, @image html brep_wp_image299.gif, @image html brep_wp_image300.gif, @image html brep_wp_image301.gif, @image html brep_wp_image302.gif, @image html brep_wp_image303.gif, @image html brep_wp_image304.gif and @image html brep_wp_image305.gif, @image html brep_wp_image306.gif, u multiplicity knots @image html brep_wp_image142.gif, @image html brep_wp_image143.gif, @image html brep_wp_image144.gif, @image html brep_wp_image145.gif, @image html brep_wp_image146.gif, @image html brep_wp_image147.gif, @image html brep_wp_image148.gif, @image html brep_wp_image149.gif and @image html brep_wp_image150.gif, @image html brep_wp_image151.gif, v multiplicity knots @image html brep_wp_image307.gif, @image html brep_wp_image308.gif, @image html brep_wp_image309.gif, @image html brep_wp_image310.gif, @image html brep_wp_image311.gif, @image html brep_wp_image312.gif and @image html brep_wp_image313.gif, @image html brep_wp_image314.gif. The B-spline surface is defined by the following parametric equation:
+
+@image html brep_wp_image315.gif
+
+
+@subsubsection occt_brep_format_4_2_10 surface record 10 – Rectangular Trim Surface
+
+**Example**
+
+@verbatim
+ 10 -1 2 -3 4
+ 1 1 2 3 0 0 1 1 0 -0 -0 1 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ surface record 10 = "10" _ trim surface u min _ trim surface u max _ trim surface v min _ trim surface v max _\n surface record;
+
+ trim surface u min = real;
+
+ trim surface u max = real;
+
+ trim surface v min = real;
+
+ trim surface v max = real;
+@verbatim
+
+**Description**
+
+surface record 10 describes a rectangular trim surface. The surface data consist of reals @image html brep_wp_image153.gif, @image html brep_wp_image154.gif, @image html brep_wp_image316.gif and @image html brep_wp_image317.gif and a surface record so that @image html brep_wp_image155.gif and @image html brep_wp_image318.gif. The rectangular trim surface is a restriction of the base surface @image html brep_wp_image156.gif described in the record to the set @image html brep_wp_image319.gif. The rectangular trim surface is defined by the following parametric equation:
+
+@image html brep_wp_image320.gif, @image html brep_wp_image321.gif.
+
+The example record is interpreted as a rectangular trim surface to the set @image html brep_wp_image322.gif for the base surface @image html brep_wp_image323.gif. The rectangular trim surface is defined by the following parametric equation: @image html brep_wp_image324.gif, @image html brep_wp_image325.gif.
+
+
+@subsubsection occt_brep_format_4_2_11 surface record 11 – Offset Surface
+
+**Example**
+
+@verbatim
+ 11 -2
+ 1 1 2 3 0 0 1 1 0 -0 -0 1 0
+@verbatim
+
+**BNF-like Definition**
+
+@verbatim
+ surface record 11 = "11" _ surface record distance _\n surface record;
+
+ surface record distance = real;
+@verbatim
+
+**Description**
+
+surface record 11 describes an offset surface.
+The offset surface data consist of a distance @image html brep_wp_image165.gif and a surface record. The offset surface is the result of offsetting the base surface @image html brep_wp_image326.gif described in the record to the distance @image html brep_wp_image165.gif along the normal @image html brep_wp_image044.gif of surface @image html brep_wp_image156.gif. The offset surface is defined by the following parametric equation:
+
+@image html brep_wp_image327.gif, @image html brep_wp_image328.gif.
+
+@image html brep_wp_image329.gif
+if @image html brep_wp_image330.gif.
+
+The example record is interpreted as an offset surface with a distance @image html brep_wp_image331.gif and base surface @image html brep_wp_image323.gif. The offset surface is defined by the following parametric equation: @image html brep_wp_image332.gif.
+
+
+@subsection occt_brep_format_4_3 Subsection 2D curves
+
+**Example**
+
+@verbatim
+ Curve2ds 24
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 3 0 0 -1
+ 1 0 0 0 1
+ 1 0 -2 1 0
+ 1 0 0 1 0
+ 1 0 0 0 -1
+ 1 0 0 0 1
+ 1 0 0 1 0
+ 1 0 1 1 0
+ 1 3 0 0 -1
+ 1 1 0 0 1
+ 1 0 -2 1 0
+ 1 0 1 1 0
+ 1 0 0 0 -1
+ 1 1 0 0 1
+ 1 0 0 0 1
+ 1 0 0 1 0
+ 1 3 0 0 1
+ 1 0 0 1 0
+ 1 0 0 0 1
+ 1 0 2 1 0
+ 1 3 0 0 1
+ 1 0 2 1 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 2D curves = 2D curve header _\n 2D curve records;
+
+ 2D curve header = "Curve2ds" _ 2D curve count;
+
+ 2D curve count = int;
+
+ 2D curve records = 2D curve record ^ 2D curve count;
+
+ 2D curve record =
+ 2D curve record 1 |
+ 2D curve record 2 |
+ 2D curve record 3 |
+ 2D curve record 4 |
+ 2D curve record 5 |
+ 2D curve record 6 |
+ 2D curve record 7 |
+ 2D curve record 8 |
+ 2D curve record 9;
+@endverbatim
+
+@subsubsection occt_brep_format_4_3_1 2D curve record 1 – Line
+
+**Example**
+
+@verbatim
+ 1 3 0 0 -1
+@verbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 2D curve record 1 = "1" _ 2D point _ 2D direction _\n;
+@endverbatim
+
+**Description**
+
+2D curve record 1 describes a line. The line data consist of a 2D point @image html brep_wp_image037.gif and a 2D direction @image html brep_wp_image038.gif. The line passes through the point @image html brep_wp_image037.gif, has the direction @image html brep_wp_image038.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image333.gif, @image html brep_wp_image069.gif.
+
+The example record is interpreted as a line which passes through a point@image html brep_wp_image334.gif, has a direction @image html brep_wp_image335.gif and is defined by the following parametric equation: @image html brep_wp_image336.gif.
+
+
+@subsubsection occt_brep_format_4_3_2 2D curve record 2 – Circle
+
+**Example**
+
+@verbatim
+ 2 1 2 1 0 -0 1 3
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 2D curve record 2 = "2" _ 2D circle center _ 2D circle Dx _ 2D circle Dy _ 2D circle radius _\n;
+
+ 2D circle center = 2D point;
+
+ 2D circle Dx = 2D direction;
+
+ 2D circle Dy = 2D direction;
+
+ 2D circle radius = real;
+@endverbatim
+
+**Description**
+
+2D curve record 2 describes a circle. The circle data consist of a 2D point @image html brep_wp_image037.gif, orthogonal 2D directions @image html brep_wp_image045.gif and @image html brep_wp_image046.gif and a non-negative real @image html brep_wp_image047.gif. The circle has a center @image html brep_wp_image037.gif. The circle plane is parallel to directions @image html brep_wp_image045.gif and @image html brep_wp_image046.gif. The circle has a radius @image html brep_wp_image047.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image337.gif, @image html brep_wp_image338.gif.
+
+The example record is interpreted as a circle which has a center @image html brep_wp_image339.gif. The circle plane is parallel to directions @image html brep_wp_image340.gif and @image html brep_wp_image341.gif. The circle has a radius @image html brep_wp_image342.gif and is defined by the following parametric equation: @image html brep_wp_image343.gif.
+
+
+@subsubsection occt_brep_format_4_3_3 2D curve record 3 – Ellipse
+
+**Example**
+
+@verbatim
+ 3 1 2 1 0 -0 1 4 3
+@verbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 2D curve record 3 = "3" _ 2D ellipse center _ 2D ellipse Dmaj _ 2D ellipse Dmin _ 2D ellipse Rmaj _ 2D ellipse Rmin _\n;
+
+ 2D ellipse center = 2D point;
+
+ 2D ellipse Dmaj = 2D direction;
+
+ 2D ellipse Dmin = 2D direction;
+
+ 2D ellipse Rmaj = real;
+
+ 2D ellipse Rmin = real;
+@endverbatim
+
+**Description**
+
+2D curve record 3 describes an ellipse. The ellipse data are 2D point @image html brep_wp_image037.gif, orthogonal 2D directions @image html brep_wp_image056.gif and @image html brep_wp_image057.gif and non-negative reals @image html brep_wp_image344.gif and @image html brep_wp_image345.gif that @image html brep_wp_image346.gif. The ellipse has a center @image html brep_wp_image037.gif, major and minor axis directions @image html brep_wp_image056.gif and @image html brep_wp_image057.gif, major and minor radii @image html brep_wp_image058.gif and @image html brep_wp_image345.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image347.gif, @image html brep_wp_image338.gif.
+
+The example record is interpreted as an ellipse which has a center @image html brep_wp_image339.gif, major and minor axis directions @image html brep_wp_image348.gif and @image html brep_wp_image349.gif, major and minor radii @image html brep_wp_image350.gif and @image html brep_wp_image351.gif and is defined by the following parametric equation: @image html brep_wp_image352.gif.
+
+
+@subsubsection occt_brep_format_4_3_4 2D curve record 4 – Parabola
+
+**Example**
+
+@verbatim
+ 4 1 2 1 0 -0 1 16
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 2D curve record 4 = "4" _ 2D parabola origin _ 2D parabola Dx _ 2D parabola Dy _ 2D parabola focal length _\n;
+
+ 2D parabola origin = 2D point;
+
+ 2D parabola Dx = 2D direction;
+
+ 2D parabola Dy = 2D direction;
+
+ 2D parabola focal length = real;
+@endverbatim
+
+**Description**
+
+2D curve record 4 describes a parabola. The parabola data consist of a 2D point @image html brep_wp_image037.gif, orthogonal 2D directions @image html brep_wp_image045.gif and @image html brep_wp_image046.gif and a non-negative real @image html brep_wp_image067.gif. The parabola coordinate system has its origin @image html brep_wp_image037.gif and axis directions @image html brep_wp_image045.gif and @image html brep_wp_image046.gif. The parabola has a focus length @image html brep_wp_image067.gif and is defined by the following parametric equation:
+
+@image html brep_wp_image068.gif, @image html brep_wp_image069.gif Ü @image html brep_wp_image070.gif;
+
+@image html brep_wp_image071.gif, @image html brep_wp_image069.gif Ü @image html brep_wp_image072.gif (degenerated case).
+
+The example record is interpreted as a parabola in plane which passes through a point @image html brep_wp_image339.gif and is parallel to directions @image html brep_wp_image340.gif and @image html brep_wp_image341.gif. The parabola has a focus length @image html brep_wp_image077.gif and is defined by the following parametric equation: @image html brep_wp_image353.gif.
+
+
+@subsubsection occt_brep_format_4_3_5 2D curve record 5 – Hyperbola
+
+**Example**
+
+5 1 2 1 0 -0 1 3 4
+
+
+**BNF-like Definition**
+
+@verbatim
+ 2D curve record 5 = "5" _ 2D hyperbola origin _ 2D hyperbola Dx _ 2D hyperbola Dy _ 2D hyperbola Kx _ 2D hyperbola Ky _\n;
+
+ 2D hyperbola origin = 2D point;
+
+ 2D hyperbola Dx = 2D direction;
+
+ 2D hyperbola Dy = 2D direction;
+
+ 2D hyperbola Kx = real;
+
+ 2D hyperbola Ky = real;
+@endverbatim
+
+**Description**
+
+2D curve record 5 describes a hyperbola. The hyperbola data consist of a 2D point @image html brep_wp_image037.gif, orthogonal 2D directions @image html brep_wp_image045.gif and @image html brep_wp_image046.gif and non-negative reals @image html brep_wp_image079.gif and @image html brep_wp_image080.gif. The hyperbola coordinate system has origin @image html brep_wp_image037.gif and axis directions @image html brep_wp_image045.gif and @image html brep_wp_image046.gif. The hyperbola is defined by the following parametric equation:
+
+@image html brep_wp_image081.gif, @image html brep_wp_image069.gif.
+
+The example record is interpreted as a hyperbola with coordinate system which has origin @image html brep_wp_image339.gif and axis directions @image html brep_wp_image354.gif and @image html brep_wp_image341.gif. Other data for the hyperbola are @image html brep_wp_image082.gif and @image html brep_wp_image083.gif. The hyperbola is defined by the following parametric equation: @image html brep_wp_image355.gif.
+
+
+@subsubsection occt_brep_format_4_3_6 2D curve record 6 – Bezier Curve
+
+**Example**
+
+@verbatim
+6 1 2 0 1 4 1 -2 5 2 3 6
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+2D curve record 6 = "6" _ 2D Bezier rational flag _ 2D Bezier degree 2D Bezier weight poles _\n;
+
+2D Bezier rational flag = flag;
+
+2D Bezier degree = int;
+
+2D Bezier weight poles = (_ 2D Bezier weight pole) ^ (2D Bezier degree + "1");
+
+2D Bezier weight pole = 2D point [_ real];
+@endverbatim
+
+**Description**
+
+2D curve record 6 describes a Bezier curve. The curve data consist of a rational flag @image html brep_wp_image047.gif, a degree @image html brep_wp_image085.gif and weight poles.
+
+The weight poles are @image html brep_wp_image086.gif 2D points @image html brep_wp_image087.gif if the flag @image html brep_wp_image047.gif is 0. The weight poles are @image html brep_wp_image086.gif pairs @image html brep_wp_image088.gif if the flag @image html brep_wp_image047.gif is 1. Here @image html brep_wp_image089.gif is a 2D point and @image html brep_wp_image090.gif is a positive real (@image html brep_wp_image093.gif). @image html brep_wp_image092.gif (@image html brep_wp_image093.gif) if the flag @image html brep_wp_image047.gif is 0.
+
+The Bezier curve is defined by the following parametric equation:
+
+@image html brep_wp_image094.gif, @image html brep_wp_image095.gif
+
+where @image html brep_wp_image096.gif.
+
+The example record is interpreted as a Bezier curve with a rational flag @image html brep_wp_image097.gif, a degree @image html brep_wp_image098.gif and weight poles @image html brep_wp_image356.gif, @image html brep_wp_image100.gif, @image html brep_wp_image357.gif, @image html brep_wp_image102.gif and @image html brep_wp_image358.gif, @image html brep_wp_image104.gif. The Bezier curve is defined by the following parametric equation:
+
+@image html brep_wp_image359.gif.
+
+
+@subsubsection occt_brep_format_4_3_7 2D curve record 7 – B-spline Curve
+
+**Example**
+
+@verbatim
+7 1 0 1 3 5 0 1 4 1 -2 5 2 3 6
+ 0 1 0.25 1 0.5 1 0.75 1 1 1
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 2D curve record 7 = "7" _ 2D B-spline rational flag _ "0" _ 2D B-spline degree _ 2D B-spline pole count _ 2D B-spline multiplicity knot count 2D B-spline weight poles _\n 2D B-spline multiplicity knots _\n;
+
+ 2D B-spline rational flag = flag;
+
+ 2D B-spline degree = int;
+
+ 2D B-spline pole count = int;
+
+ 2D B-spline multiplicity knot count = int;
+
+ 2D B-spline weight poles = 2D B-spline weight pole ^ 2D B-spline pole count;
+
+ 2D B-spline weight pole = _ 2D point [_ real];
+
+ 2D B-spline multiplicity knots =
+ 2D B-spline multiplicity knot ^ 2D B-spline multiplicity knot count;
+
+ 2D B-spline multiplicity knot = _ real _ int;
+@endverbatim
+
+**Description**
+
+2D curve record 7 describes a B-spline curve. The curve data consist of a rational flag @image html brep_wp_image047.gif, a degree @image html brep_wp_image085.gif, a pole count @image html brep_wp_image106.gif, a multiplicity knot count @image html brep_wp_image107.gif, weight poles and multiplicity knots.
+
+The weight poles are @image html brep_wp_image108.gif 2D points @image html brep_wp_image109.gif if the flag @image html brep_wp_image047.gif is 0. The weight poles are @image html brep_wp_image108.gif pairs @image html brep_wp_image110.gif if the flag @image html brep_wp_image047.gif is 1. Here @image html brep_wp_image089.gif is a 2D point and @image html brep_wp_image090.gif is a positive real (@image html brep_wp_image111.gif). @image html brep_wp_image092.gif (@image html brep_wp_image111.gif) if the flag @image html brep_wp_image047.gif is 0.
+
+The multiplicity knots are @image html brep_wp_image107.gif pairs @image html brep_wp_image112.gif. Here @image html brep_wp_image113.gif is a knot with multiplicity @image html brep_wp_image114.gif (@image html brep_wp_image115.gif) so that
+
+@image html brep_wp_image360.gif (@image html brep_wp_image361.gif),
+@image html brep_wp_image362.gif, @image html brep_wp_image363.gif, @image html brep_wp_image364.gif (@image html brep_wp_image365.gif), @image html brep_wp_image366.gif.
+
+The B-spline curve is defined by the following parametric equation:
+
+@image html brep_wp_image367.gif, @image html brep_wp_image368.gif
+
+where functions @image html brep_wp_image125.gif have the following recursion definition by @image html brep_wp_image126.gif
+
+@image html brep_wp_image127.gif, @image html brep_wp_image128.gif (@image html brep_wp_image129.gif)
+
+where
+
+@image html brep_wp_image284.gif (@image html brep_wp_image369.gif,@image html brep_wp_image286.gif).
+
+The example record is interpreted as a B-spline curve with a rational flag @image html brep_wp_image097.gif, a degree @image html brep_wp_image133.gif, a pole count @image html brep_wp_image134.gif, a multiplicity knot count @image html brep_wp_image135.gif, weight poles @image html brep_wp_image370.gif, @image html brep_wp_image137.gif, @image html brep_wp_image371.gif, @image html brep_wp_image139.gif and @image html brep_wp_image372.gif, @image html brep_wp_image141.gif and multiplicity knots @image html brep_wp_image373.gif, @image html brep_wp_image374.gif, @image html brep_wp_image375.gif, @image html brep_wp_image376.gif, @image html brep_wp_image377.gif, @image html brep_wp_image378.gif, @image html brep_wp_image379.gif, @image html brep_wp_image380.gif and @image html brep_wp_image381.gif, @image html brep_wp_image382.gif. The B-spline curve is defined by the following parametric equation:
+
+@image html brep_wp_image383.gif.
+
+
+@subsubsection occt_brep_format_4_3_8 2D curve record 8 – Trimmed Curve
+
+**Example**
+
+@verbatim
+ 8 -4 5
+ 1 1 2 1 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 2D curve record 8 = "8" _ 2D trimmed curve u min _ 2D trimmed curve u max _\n 2D curve record;
+
+ 2D trimmed curve u min = real;
+
+ 2D trimmed curve u max = real;
+@endverbatim
+
+**Description**
+
+2D curve record 8 describes a trimmed curve. The trimmed curve data consist of reals @image html brep_wp_image153.gif and @image html brep_wp_image154.gif and a 2D curve record so that @image html brep_wp_image155.gif. The trimmed curve is a restriction of the base curve @image html brep_wp_image326.gif described in the record to the segment @image html brep_wp_image157.gif. The trimmed curve is defined by the following parametric equation:
+
+@image html brep_wp_image158.gif, @image html brep_wp_image159.gif.
+
+The example record is interpreted as a trimmed curve with @image html brep_wp_image160.gif, @image html brep_wp_image161.gif and base curve @image html brep_wp_image384.gif. The trimmed curve is defined by the following parametric equation: @image html brep_wp_image385.gif, @image html brep_wp_image164.gif.
+
+
+@subsubsection occt_brep_format_4_3_9 2D curve record 9 – Offset Curve
+
+**Example**
+
+@verbatim
+ 9 2
+ 1 1 2 1 0
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+2D curve record 9 = "9" _ 2D offset curve distance _\n 2D curve record;
+
+2D offset curve distance = real;
+@endverbatim
+
+**Description**
+
+2D curve record 9 describes an offset curve. The offset curve data consist of a distance @image html brep_wp_image165.gif and a 2D curve record. The offset curve is the result of offsetting the base curve @image html brep_wp_image156.gif described in the record to the distance @image html brep_wp_image165.gif along the vector @image html brep_wp_image386.gif where @image html brep_wp_image387.gif. The offset curve is defined by the following parametric equation:
+
+@image html brep_wp_image388.gif, @image html brep_wp_image168.gif.
+
+The example record is interpreted as an offset curve with a distance
+@image html brep_wp_image169.gif and base curve @image html brep_wp_image384.gif and
+is defined by the following parametric equation: @image html brep_wp_image389.gif.
+
+@subsection occt_brep_format_4_4 Subsection 3D polygons
+
+**Example**
+
+@verbatim
+ Polygon3D 1
+ 2 1
+ 0.1
+ 1 0 0 2 0 0
+ 0 1
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ 3D polygons = 3D polygon header _\n 3D polygon records;
+
+ 3D polygon header = "Polygon3D" _ 3D polygon record count;
+
+ 3D polygon records = 3D polygon record ^ 3D polygon record count;
+
+ 3D polygon record =
+ 3D polygon node count _ 3D polygon flag of parameter presence _\n
+ 3D polygon deflection _\n
+ 3D polygon nodes _\n
+ [3D polygon parameters _\n];
+
+ 3D polygon node count = int;
+
+ 3D polygon flag of parameter presence = flag;
+
+ 3D polygon deflection = real;
+
+ 3D polygon nodes = (3D polygon node _) ^ 3D polygon node count;
+
+ 3D polygon node = 3D point;
+
+ 3D polygon u parameters = (3D polygon u parameter _) ^ 3D polygon node count;
+
+ 3D polygon u parameter = real;
+@endverbatim
+
+**Description**
+
+3D polygon record describes a 3D polyline @image html brep_wp_image390.gif which approximates a 3D curve @image html brep_wp_image205.gif. The polyline data consist of a node count @image html brep_wp_image391.gif, a parameter presence flag @image html brep_wp_image392.gif, a deflection @image html brep_wp_image393.gif, nodes @image html brep_wp_image394.gif (@image html brep_wp_image395.gif) and parameters @image html brep_wp_image113.gif (@image html brep_wp_image395.gif). The parameters are present only if@image html brep_wp_image396.gif. The polyline @image html brep_wp_image390.gif passes through the nodes. The deflection @image html brep_wp_image165.gif describes the deflection of polyline @image html brep_wp_image390.gif from the curve @image html brep_wp_image205.gif:
+
+@image html brep_wp_image397.gif.
+
+The parameter @image html brep_wp_image113.gif (@image html brep_wp_image395.gif) is the parameter of the node @image html brep_wp_image394.gif on the curve @image html brep_wp_image205.gif:
+
+@image html brep_wp_image398.gif.
+
+The example record describes a polyline from @image html brep_wp_image098.gif nodes with a parameter presence flag @image html brep_wp_image396.gif, a deflection @image html brep_wp_image399.gif, nodes @image html brep_wp_image400.gif and @image html brep_wp_image401.gif and parameters @image html brep_wp_image142.gif and @image html brep_wp_image402.gif.
+
+
+@subsection occt_brep_format_4_5 Subsection triangulations
+
+**Example**
+
+@verbatim
+ Triangulations 6
+ 4 2 1 0
+ 0 0 0 0 0 3 0 2 3 0 2 0 0 0 3 0 3 -2 0 -2 2 4 3 2 1 4
+ 4 2 1 0
+ 0 0 0 1 0 0 1 0 3 0 0 3 0 0 0 1 3 1 3 0 3 2 1 3 1 4
+ 4 2 1 0
+ 0 0 3 0 2 3 1 2 3 1 0 3 0 0 0 2 1 2 1 0 3 2 1 3 1 4
+ 4 2 1 0
+ 0 2 0 1 2 0 1 2 3 0 2 3 0 0 0 1 3 1 3 0 3 2 1 3 1 4
+ 4 2 1 0
+ 0 0 0 0 2 0 1 2 0 1 0 0 0 0 0 2 1 2 1 0 3 2 1 3 1 4
+ 4 2 1 0
+ 1 0 0 1 0 3 1 2 3 1 2 0 0 0 3 0 3 -2 0 -2 2 4 3 2 1 4
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ triangulations = triangulation header _\n triangulation records;
+
+ triangulation header = "Triangulations" _ triangulation count;
+
+ triangulation records = triangulation record ^ triangulation count;
+
+ triangulation record = triangulation node count _ triangulation triangle count _ triangulation parameter presence flag _ triangulation deflection _\n triangulation nodes [_ triangulation u v parameters] _ triangulation triangles _\n;
+
+ triangulation node count = int;
+
+ triangulation triangle count = int;
+
+ triangulation parameter presence flag = flag;
+
+ triangulation deflection = real;
+
+ triangulation nodes = (triangulation node _) ^ triangulation node count;
+
+ triangulation node = 3D point;
+
+ triangulation u v parameters = (triangulation u v parameter pair _) ^ triangulation node count;
+
+ triangulation u v parameter pair = real _ real;
+
+ triangulation triangles = (triangulation triangle _) ^ triangulation triangle count;
+
+ triangulation triangle = int _ int _ int.
+@endverbatim
+
+**Description**
+
+triangulation record describes a triangulation @image html brep_wp_image403.gif which approximates a surface @image html brep_wp_image404.gif. The triangulation data consist of a node count @image html brep_wp_image405.gif, a triangle count @image html brep_wp_image406.gif, a parameter presence flag @image html brep_wp_image392.gif, a deflection @image html brep_wp_image393.gif, nodes @image html brep_wp_image394.gif (@image html brep_wp_image395.gif), parameter pairs @image html brep_wp_image407.gif (@image html brep_wp_image395.gif), triangles @image html brep_wp_image408.gif (@image html brep_wp_image131.gif, @image html brep_wp_image409.gif (@image html brep_wp_image410.gif)). The parameters are present only if @image html brep_wp_image396.gif. The deflection describes the triangulation deflection from the surface:
+
+@image html brep_wp_image411.gif.
+
+The parameter pair @image html brep_wp_image407.gif (@image html brep_wp_image395.gif) describes the parameters of node @image html brep_wp_image394.gif on the surface:
+
+@image html brep_wp_image412.gif.
+
+The triangle @image html brep_wp_image408.gif (@image html brep_wp_image131.gif) is interpreted as a triangle of nodes @image html brep_wp_image413.gif, @image html brep_wp_image414.gif and @image html brep_wp_image415.gif with circular traversal of the nodes in the order @image html brep_wp_image413.gif, @image html brep_wp_image414.gif and @image html brep_wp_image415.gif. From any side of the triangulation @image html brep_wp_image403.gif all its triangles have the same direction of the node circular traversal: either clockwise or counterclockwise.
+
+Triangulation record
+
+@verbatim
+ 4 2 1 0
+ 0 0 0 0 0 3 0 2 3 0 2 0 0 0 3 0 3 -2 0 -2 2 4 3 2 1 4
+@endverbatim
+
+describes a triangulation with @image html brep_wp_image416.gif nodes, @image html brep_wp_image417.gif triangles, parameter presence flag @image html brep_wp_image396.gif, deflection @image html brep_wp_image418.gif, nodes @image html brep_wp_image419.gif, @image html brep_wp_image420.gif, @image html brep_wp_image421.gif and @image html brep_wp_image422.gif, parameters @image html brep_wp_image423.gif, @image html brep_wp_image424.gif, @image html brep_wp_image425.gif and @image html brep_wp_image426.gif, and triangles @image html brep_wp_image427.gif and @image html brep_wp_image428.gif. From the point @image html brep_wp_image429.gif (@image html brep_wp_image430.gif) the triangles have clockwise (counterclockwise) direction of the node circular traversal.
+
+
+@subsection occt_brep_format_4_6 Subsection polygons on triangulations
+
+**Example**
+
+@verbatim
+ PolygonOnTriangulations 24
+ 2 1 2
+ p 0.1 1 0 3
+ 2 1 4
+ p 0.1 1 0 3
+ 2 2 3
+ p 0.1 1 0 2
+ 2 1 2
+ p 0.1 1 0 2
+ 2 4 3
+ p 0.1 1 0 3
+ 2 1 4
+ p 0.1 1 0 3
+ 2 1 4
+ p 0.1 1 0 2
+ 2 1 2
+ p 0.1 1 0 2
+ 2 1 2
+ p 0.1 1 0 3
+ 2 2 3
+ p 0.1 1 0 3
+ 2 2 3
+ p 0.1 1 0 2
+ 2 4 3
+ p 0.1 1 0 2
+ 2 4 3
+ p 0.1 1 0 3
+ 2 2 3
+ p 0.1 1 0 3
+ 2 1 4
+ p 0.1 1 0 2
+ 2 4 3
+ p 0.1 1 0 2
+ 2 1 2
+ p 0.1 1 0 1
+ 2 1 4
+ p 0.1 1 0 1
+ 2 4 3
+ p 0.1 1 0 1
+ 2 1 4
+ p 0.1 1 0 1
+ 2 1 2
+ p 0.1 1 0 1
+ 2 2 3
+ p 0.1 1 0 1
+ 2 4 3
+ p 0.1 1 0 1
+ 2 2 3
+ p 0.1 1 0 1
+@endverbatim
+
+**BNF-like Definition**
+
+@verbatim
+ polygons on triangulations = polygons on triangulations header _\n
+ polygons on triangulations records;
+
+ polygons on triangulations header =
+ "PolygonOnTriangulations" _ polygons on triangulations record count;
+
+ polygons on triangulations record count = int;
+
+ polygons on triangulations records =
+ polygons on triangulations record ^ polygons on triangulations record count;
+
+ polygons on triangulations record =
+ polygons on triangulations node count _ polygons on triangulations node numbers _\n
+ "p" _ polygons on triangulations deflection _
+ polygons on triangulations parameter presence flag
+ [_ polygons on triangulations u parameters] _\n;
+
+ polygons on triangulations node count = int;
+
+ polygons on triangulations node numbers =
+ polygons on triangulations node number ^ polygons on triangulations node count;
+
+ polygons on triangulations node number = int;
+
+ polygons on triangulations deflection = real;
+
+ polygons on triangulations parameter presence flag = flag;
+
+ polygons on triangulations u parameters =
+ (polygons on triangulations u parameter _) ^ polygons on triangulations node count;
+
+ polygons on triangulations u parameter = real;
+@endverbatim
+
+**Description**
+
+polygons on triangulations describes a polyline @image html brep_wp_image390.gif on a triangulation which approximates a curve @image html brep_wp_image205.gif. The polyline data consist of a node count @image html brep_wp_image391.gif, node numbers @image html brep_wp_image431.gif, deflection @image html brep_wp_image393.gif, a parameter presence flag @image html brep_wp_image392.gif and parameters @image html brep_wp_image432.gif (@image html brep_wp_image395.gif). The parameters are present only if @image html brep_wp_image396.gif. The deflection @image html brep_wp_image165.gif describes the deflection of polyline @image html brep_wp_image390.gif from the curve @image html brep_wp_image205.gif:
+
+@image html brep_wp_image397.gif.
+
+Parameter @image html brep_wp_image113.gif (@image html brep_wp_image395.gif) is @image html brep_wp_image433.gif-th node @image html brep_wp_image434.gif parameter on curve @image html brep_wp_image205.gif.
+
+
+@subsection occt_brep_format_4_7 Geometric Sense of a Curve
+
+Geometric sense of curve @image html brep_wp_image210.gif described above is determined by the direction of parameter @image html brep_wp_image435.gif increasing.
+
+
+@section occt_brep_format_5 Section shapes
+
+An example of section shapes and a whole *.brep file are given in chapter 7 "Appendix".
+
+
+**BNF-like Definition**
+
+@verbatim
+ shapes = shape header _\n shape records _\n shape final record;
+
+ shape header = "TShapes" _ shape count;
+
+ shape count = int;
+
+ shape records = shape record ^ shape count;
+
+ shape record = shape subrecord _\n shape flag word _\n shape subshapes _\n;
+
+ shape flag word = flag ^ 7;
+
+ shape subshapes = (shape subshape _)* "*";
+
+ shape subshape =
+ shape subshape orientation shape subshape number _ shape location number;
+
+ shape subshape orientation = "+" | "-" | "i" | "e";
+
+ shape subshape number = int;
+
+ shape location number = int;
+
+ shape final record = shape subshape;
+
+ shape subrecord =
+ ("Ve" _\n vertex data _\n) |
+ ("Ed" _\n edge data _\n) |
+ ("Wi" _\n _\n) |
+ ("Fa" _\n face data) |
+ ("Sh" _\n _\n) |
+ ("So" _\n _\n) |
+ ("CS" _\n _\n) |
+ ("Co" _\n _\n);
+@endverbatim
+
+**Description**
+
+shape flag word @image html brep_wp_image436.gif flags @image html brep_wp_image437.gif
+(@image html brep_wp_image438.gif) are interpreted as shape flags in the following way:
+
+ * @image html brep_wp_image439.gif – free;
+ * @image html brep_wp_image440.gif – modified;
+ * @image html brep_wp_image441.gif – IGNORED (version * / checked (version * ;
+ * @image html brep_wp_image442.gif – orientable;
+ * @image html brep_wp_image443.gif – closed;
+ * @image html brep_wp_image444.gif – infinite;
+ * @image html brep_wp_image445.gif – convex.
+
+The flags are used in a special way [1].
+
+shape subshape orientation is interpreted in the following way:
+
+ * + – forward;
+ * - – reversed;
+ * i – internal;
+ * e – external.
+
+shape subshape orientation is used in a special way [1].
+
+shape subshape number is the number of a shape record which is located in this section above the shape subshape number. shape record numbering is backward and starts from 1.
+
+shape subrecord types are interpreted in the following way:
+
+ * "Ve" – vertex;
+ * "Ed" – edge;
+ * "Wi" – wire;
+ * "Fa" – face;
+ * "Sh" – shell;
+ * "So" – solid;
+ * "CS" – compsolid;
+ * "Co" – compound.
+
+shape final record determines the orientation and location for the whole model.
+
+@subsection occt_brep_format_5_1 Common Terms
+
+The terms below are used by vertex data, edge data and face data.
+
+
+**BNF-like Definition**
+
+@verbatim
+ location number = int;
+
+ 3D curve number = int;
+
+ surface number = int;
+
+ 2D curve number = int;
+
+ 3D polygon number = int;
+
+ triangulation number = int;
+
+ polygon on triangulation number = int;
+
+ curve parameter minimal and maximal values = real _ real;
+
+ curve values for parameter minimal and maximal values =
+ real _ real _ real _ real;
+@endverbatim
+
+**Description**
+
+location number is the number of location record from section locations. location record numbering starts from 1. location number 0 is interpreted as the identity location.
+
+3D curve number is the number of a 3D curve record from subsection 3D curves of section geometry. 3D curve record numbering starts from 1.
+
+surface number is the number of a surface record from subsection surfaces of section geometry. surface record numbering starts from 1.
+
+2D curve number is the number of a 2D curve record from subsection 2D curves of section geometry. 2D curve record numbering starts from 1.
+
+3D polygon number is the number of a 3D polygon record from subsection 3D polygons of section geometry. 3D polygon record numbering starts from 1.
+
+triangulation number is the number of a triangulation record from subsection triangulations of section geometry. triangulation record numbering starts from 1.
+
+polygon on triangulation number is the number of a polygons on triangulations record from subsection polygons on triangulations of section geometry.
+polygons on triangulations record numbering starts from 1.
+
+curve parameter minimal and maximal values @image html brep_wp_image446.gif and @image html brep_wp_image447.gif are the curve parameter@image html brep_wp_image448.gif bounds: @image html brep_wp_image449.gif.
+
+curve values for parameter minimal and maximal values @image html brep_wp_image446.gif and @image html brep_wp_image447.gif are real pairs @image html brep_wp_image450.gif and @image html brep_wp_image451.gif that @image html brep_wp_image452.gif and @image html brep_wp_image453.gif where @image html brep_wp_image205.gif is a parametric equation of the curve.
+
+
+@subsection occt_brep_format_5_2 vertex data
+
+**BNF-like Definition**
+
+@verbatim
+ vertex data = vertex data tolerance _\n vertex data 3D representation _\n vertex data representations;
+
+ vertex data tolerance = real;
+
+ vertex data 3D representation = 3D point;
+
+ vertex data representations = (vertex data representation _\n)* "0 0";
+
+ vertex data representation = vertex data representation u parameter _
+ vertex data representation data _ location number;
+
+ vertex data representation u parameter = real;
+
+ vertex data representation data =
+ ("1" _ vertex data representation data * |
+ ("2" _ vertex data representation data * |
+ ("3" _ vertex data representation data * ;
+
+ vertex data representation data 1 = 3D curve number;
+
+ vertex data representation data 2 = 2D curve number _ surface number;
+
+ vertex data representation data 3 =
+ vertex data representation v parameter _ surface number;
+
+ vertex data representation v parameter = real;
+@endverbatim
+
+**Description**
+
+The usage of vertex data representation u parameter @image html brep_wp_image448.gif is described below.
+
+vertex data representation data 1 and parameter @image html brep_wp_image448.gif describe the position of the vertex @image html brep_wp_image454.gif on a 3D curve @image html brep_wp_image205.gif. Parameter @image html brep_wp_image448.gif is a parameter of the vertex @image html brep_wp_image454.gif on the curve @image html brep_wp_image205.gif: @image html brep_wp_image455.gif.
+
+vertex data representation data 2 and parameter @image html brep_wp_image448.gif describe the position of the vertex @image html brep_wp_image454.gif on a 2D curve @image html brep_wp_image205.gif which is located on a surface. Parameter @image html brep_wp_image448.gif is a parameter of the vertex @image html brep_wp_image454.gif on the curve @image html brep_wp_image205.gif: @image html brep_wp_image455.gif.
+
+vertex data representation data 3 and parameter @image html brep_wp_image435.gif describe the position of the vertex @image html brep_wp_image454.gif on a surface @image html brep_wp_image404.gif through vertex data representation v parameter @image html brep_wp_image456.gif: @image html brep_wp_image457.gif.
+
+vertex data tolerance @image html brep_wp_image458.gif describes the maximum distance from the vertex @image html brep_wp_image454.gif to the set @image html brep_wp_image459.gif* *of vertex @image html brep_wp_image454.gif representations:
+
+@image html brep_wp_image460.gif.
+
+
+@subsection occt_brep_format_5_3 edge data
+
+**BNF-like Definition**
+
+@verbatim
+ edge data = _ edge data tolerance _ edge data same parameter flag _ edge data same range flag _ edge data degenerated flag _\n edge data representations;
+
+ edge data tolerance = real;
+
+ edge data same parameter flag = flag;
+
+ edge data same range flag = flag;
+
+ edge data degenerated flag = flag;
+
+ edge data representations = (edge data representation _\n)* "0";
+
+ edge data representation =
+ "1" _ edge data representation data 1
+ "2" _ edge data representation data 2
+ "3" _ edge data representation data 3
+ "4" _ edge data representation data 4
+ "5" _ edge data representation data 5
+ "6" _ edge data representation data 6
+ "7" _ edge data representation data 7;
+
+ edge data representation data 1 = 3D curve number _ location number _
+ curve parameter minimal and maximal values;
+
+ edge data representation data 2 = 2D curve number _ surface number _ location number _ curve parameter minimal and maximal values
+ [_\n curve values for parameter minimal and maximal values];
+
+ edge data representation data 3 = (2D curve number _) ^ 2 continuity order _ surface number _ location number _ curve parameter minimal and maximal values \n curve values for parameter minimal and maximal values];
+
+ continuity order = "C0" | "C1" | "C2" | "C3" | "CN" | "G1" | "G2".
+
+ edge data representation data 4 =
+ continuity order (_ surface number _ location number) ^ 2;
+
+ edge data representation data 5 = 3D polygon number _ location number;
+
+ edge data representation data 6 =
+ polygon on triangulation number _ triangulation number _ location number;
+
+ edge data representation data 7 = (polygon on triangulation number _) ^ 2 triangulation number _ location number;
+@endverbatim
+
+**Description**
+
+Flags edge data same parameter flag, edge data same range flag and edge data degenerated flag are used in a special way [1].
+
+edge data representation data 1 describes a 3D curve.
+
+edge data representation data 2 describes a 2D curve on a surface.
+curve values for parameter minimal and maximal values are used only in version 2.
+
+edge data representation data 3 describes a 2D curve on a closed surface.
+curve values for parameter minimal and maximal values are used only in version 2.
+
+edge data representation data 5 describes a 3D polyline.
+
+edge data representation data 6 describes a polyline on a triangulation.
+
+edge data tolerance @image html brep_wp_image458.gif describes the maximum distance from the edge @image html brep_wp_image461.gif to the set @image html brep_wp_image459.gif of edge @image html brep_wp_image461.gif representations:
+
+@image html brep_wp_image462.gif.
+
+
+@subsection occt_brep_format_5_4 face data
+
+**BNF-like Definition**
+
+@verbatim
+ face data = face data natural restriction flag _ face data tolerance _ surface number _ location number \n ["2" _ triangulation number];
+
+ face data natural restriction flag = flag;
+
+ face data tolerance = real;
+@endverbatim
+
+**Description**
+
+face data describes a surface @image html brep_wp_image404.gif of face @image html brep_wp_image463.gif and a triangulation @image html brep_wp_image403.gif of face @image html brep_wp_image463.gif. The surface @image html brep_wp_image404.gif may be empty: surface number = 0.
+
+face data tolerance @image html brep_wp_image458.gif describes the maximum distance from the face @image html brep_wp_image463.gif to the surface @image html brep_wp_image404.gif:
+
+@image html brep_wp_image464.gif.
+
+ Flag face data natural restriction flag is used in a special way [1].
+
+@section occt_brep_format_6 References
+
+ The format is part of Open CASCADE Technology (OCCT).
+ Some data fields of the format have additional values which are used in OCCT.
+ Some data fields of the format are specific for OCCT.
+
+@section occt_brep_format_7 Appendix
+
+ This chapter contains a *.brep file example.
+
+@verbatim
+ DBRep_DrawableShape
+
+ CASCADE Topology V1, (c) Matra-Datavision
+ Locations 3
+ 1
+ 0 0 1 0
+ 1 0 0 0
+ 0 1 0 0
+ 1
+ 1 0 0 4
+ 0 1 0 5
+ 0 0 1 6
+ 2 1 1 2 1 0
+ Curve2ds 24
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 3 0 0 -1
+ 1 0 0 0 1
+ 1 0 -2 1 0
+ 1 0 0 1 0
+ 1 0 0 0 -1
+ 1 0 0 0 1
+ 1 0 0 1 0
+ 1 0 1 1 0
+ 1 3 0 0 -1
+ 1 1 0 0 1
+ 1 0 -2 1 0
+ 1 0 1 1 0
+ 1 0 0 0 -1
+ 1 1 0 0 1
+ 1 0 0 0 1
+ 1 0 0 1 0
+ 1 3 0 0 1
+ 1 0 0 1 0
+ 1 0 0 0 1
+ 1 0 2 1 0
+ 1 3 0 0 1
+ 1 0 2 1 0
+ Curves 13
+ 1 0 0 0 0 0 1
+ 1 0 0 3 -0 1 0
+ 1 0 2 0 0 0 1
+ 1 0 0 0 -0 1 0
+ 1 1 0 0 0 0 1
+ 1 1 0 3 0 1 0
+ 1 1 2 0 0 0 1
+ 1 1 0 0 -0 1 0
+ 1 0 0 0 1 0 -0
+ 1 0 0 3 1 0 -0
+ 1 0 2 0 1 0 -0
+ 1 0 2 3 1 0 -0
+ 1 1 0 0 1 0 0
+ Polygon3D 1
+ 2 1
+ 0.1
+ 1 0 0 2 0 0
+ 0 1
+ PolygonOnTriangulations 24
+ 2 1 2
+ p 0.1 1 0 3
+ 2 1 4
+ p 0.1 1 0 3
+ 2 2 3
+ p 0.1 1 0 2
+ 2 1 2
+ p 0.1 1 0 2
+ 2 4 3
+ p 0.1 1 0 3
+ 2 1 4
+ p 0.1 1 0 3
+ 2 1 4
+ p 0.1 1 0 2
+ 2 1 2
+ p 0.1 1 0 2
+ 2 1 2
+ p 0.1 1 0 3
+ 2 2 3
+ p 0.1 1 0 3
+ 2 2 3
+ p 0.1 1 0 2
+ 2 4 3
+ p 0.1 1 0 2
+ 2 4 3
+ p 0.1 1 0 3
+ 2 2 3
+ p 0.1 1 0 3
+ 2 1 4
+ p 0.1 1 0 2
+ 2 4 3
+ p 0.1 1 0 2
+ 2 1 2
+ p 0.1 1 0 1
+ 2 1 4
+ p 0.1 1 0 1
+ 2 4 3
+ p 0.1 1 0 1
+ 2 1 4
+ p 0.1 1 0 1
+ 2 1 2
+ p 0.1 1 0 1
+ 2 2 3
+ p 0.1 1 0 1
+ 2 4 3
+ p 0.1 1 0 1
+ 2 2 3
+ p 0.1 1 0 1
+ Surfaces 6
+ 1 0 0 0 1 0 -0 0 0 1 0 -1 0
+ 1 0 0 0 -0 1 0 0 0 1 1 0 -0
+ 1 0 0 3 0 0 1 1 0 -0 -0 1 0
+ 1 0 2 0 -0 1 0 0 0 1 1 0 -0
+ 1 0 0 0 0 0 1 1 0 -0 -0 1 0
+ 1 1 0 0 1 0 -0 0 0 1 0 -1 0
+ Triangulations 6
+ 4 2 1 0
+ 0 0 0 0 0 3 0 2 3 0 2 0 0 0 3 0 3 -2 0 -2 2 4 3 2 1 4
+ 4 2 1 0
+ 0 0 0 1 0 0 1 0 3 0 0 3 0 0 0 1 3 1 3 0 3 2 1 3 1 4
+ 4 2 1 0
+ 0 0 3 0 2 3 1 2 3 1 0 3 0 0 0 2 1 2 1 0 3 2 1 3 1 4
+ 4 2 1 0
+ 0 2 0 1 2 0 1 2 3 0 2 3 0 0 0 1 3 1 3 0 3 2 1 3 1 4
+ 4 2 1 0
+ 0 0 0 0 2 0 1 2 0 1 0 0 0 0 0 2 1 2 1 0 3 2 1 3 1 4
+ 4 2 1 0
+ 1 0 0 1 0 3 1 2 3 1 2 0 0 0 3 0 3 -2 0 -2 2 4 3 2 1 4
+
+ TShapes 39
+ Ve
+ 1e-007
+ 0 0 3
+ 0 0
+
+ 0101101
+ *
+ Ve
+ 1e-007
+ 0 0 0
+ 0 0
+
+ 0101101
+ *
+ Ed
+ 1e-007 1 1 0
+ 1 1 0 0 3
+ 2 1 1 0 0 3
+ 2 2 2 0 0 3
+ 6 1 1 0
+ 6 2 2 0
+ 0
+
+ 0101000
+ -39 0 +38 0 *
+ Ve
+ 1e-007
+ 0 2 3
+ 0 0
+
+ 0101101
+ *
+ Ed
+ 1e-007 1 1 0
+ 1 2 0 0 2
+ 2 3 1 0 0 2
+ 2 4 3 0 0 2
+ 6 3 1 0
+ 6 4 3 0
+ 0
+
+ 0101000
+ -36 0 +39 0 *
+ Ve
+ 1e-007
+ 0 2 0
+ 0 0
+
+ 0101101
+ *
+ Ed
+ 1e-007 1 1 0
+ 1 3 0 0 3
+ 2 5 1 0 0 3
+ 2 6 4 0 0 3
+ 6 5 1 0
+ 6 6 4 0
+ 0
+
+ 0101000
+ -36 0 +34 0 *
+ Ed
+ 1e-007 1 1 0
+ 1 4 0 0 2
+ 2 7 1 0 0 2
+ 2 8 5 0 0 2
+ 6 7 1 0
+ 6 8 5 0
+ 0
+
+ 0101000
+ -34 0 +38 0 *
+ Wi
+
+ 0101000
+ -37 0 -35 0 +33 0 +32 0 *
+ Fa
+ 0 1e-007 1 0
+ 2 1
+ 0101000
+ +31 0 *
+ Ve
+ 1e-007
+ 1 0 3
+ 0 0
+
+ 0101101
+ *
+ Ve
+ 1e-007
+ 1 0 0
+ 0 0
+
+ 0101101
+ *
+ Ed
+ 1e-007 1 1 0
+ 1 5 0 0 3
+ 2 9 6 0 0 3
+ 2 10 2 0 0 3
+ 6 9 6 0
+ 6 10 2 0
+ 0
+
+ 0101000
+ -29 0 +28 0 *
+ Ve
+ 1e-007
+ 1 2 3
+ 0 0
+
+ 0101101
+ *
+ Ed
+ 1e-007 1 1 0
+ 1 6 0 0 2
+ 2 11 6 0 0 2
+ 2 12 3 0 0 2
+ 6 11 6 0
+ 6 12 3 0
+ 0
+
+ 0101000
+ -26 0 +29 0 *
+ Ve
+ 1e-007
+ 1 2 0
+ 0 0
+
+ 0101101
+ *
+ Ed
+ 1e-007 1 1 0
+ 1 7 0 0 3
+ 2 13 6 0 0 3
+ 2 14 4 0 0 3
+ 6 13 6 0
+ 6 14 4 0
+ 0
+
+ 0101000
+ -26 0 +24 0 *
+ Ed
+ 1e-007 1 1 0
+ 1 8 0 0 2
+ 2 15 6 0 0 2
+ 2 16 5 0 0 2
+ 6 15 6 0
+ 6 16 5 0
+ 0
+
+ 0101000
+ -24 0 +28 0 *
+ Wi
+
+ 0101000
+ -27 0 -25 0 +23 0 +22 0 *
+ Fa
+ 0 1e-007 6 0
+ 2 6
+ 0101000
+ +21 0 *
+ Ed
+ 1e-007 1 1 0
+ 1 9 0 0 1
+ 2 17 2 0 0 1
+ 2 18 5 0 0 1
+ 6 17 2 0
+ 6 18 5 0
+ 0
+
+ 0101000
+ -28 0 +38 0 *
+ Ed
+ 1e-007 1 1 0
+ 1 10 0 0 1
+ 2 19 2 0 0 1
+ 2 20 3 0 0 1
+ 6 19 2 0
+ 6 20 3 0
+ 0
+
+ 0101000
+ -29 0 +39 0 *
+ Wi
+
+ 0101000
+ -19 0 -27 0 +18 0 +37 0 *
+ Fa
+ 0 1e-007 2 0
+ 2 2
+ 0101000
+ +17 0 *
+ Ed
+ 1e-007 1 1 0
+ 1 11 0 0 1
+ 2 21 4 0 0 1
+ 2 22 5 0 0 1
+ 6 21 4 0
+ 6 22 5 0
+ 0
+
+ 0101000
+ -24 0 +34 0 *
+ Ed
+ 1e-007 1 1 0
+ 1 12 0 0 1
+ 2 23 4 0 0 1
+ 2 24 3 0 0 1
+ 6 23 4 0
+ 6 24 3 0
+ 0
+
+ 0101000
+ -26 0 +36 0 *
+ Wi
+
+ 0101000
+ -15 0 -23 0 +14 0 +33 0 *
+ Fa
+ 0 1e-007 4 0
+ 2 4
+ 0101000
+ +13 0 *
+ Wi
+
+ 0101000
+ -32 0 -15 0 +22 0 +19 0 *
+ Fa
+ 0 1e-007 5 0
+ 2 5
+ 0101000
+ +11 0 *
+ Wi
+
+ 0101000
+ -35 0 -14 0 +25 0 +18 0 *
+ Fa
+ 0 1e-007 3 0
+ 2 3
+ 0101000
+ +9 0 *
+ Sh
+
+ 0101100
+ -30 0 +20 0 -16 0 +12 0 -10 0 +8 0 *
+ So
+
+ 0100000
+ +7 0 *
+ CS
+
+ 0101000
+ +6 3 *
+ Ve
+ 1e-007
+ 1 0 0
+ 0 0
+
+ 0101101
+ *
+ Ve
+ 1e-007
+ 2 0 0
+ 0 0
+
+ 0101101
+ *
+ Ed
+ 1e-007 1 1 0
+ 1 13 0 0 1
+ 5 1 0
+ 0
+
+ 0101000
+ +4 0 -3 0 *
+ Co
+
+ 1100000
+ +5 0 +2 0 *
+
+ +1 0
+ 0
+@endverbatim
\ No newline at end of file
pload [-PluginFileName] [[Key1] [Key2]...]
~~~~~
-, where:
+where:
-* *-PluginFileName* - 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.
+* <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.
* *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).
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.
TCL provides a mechanism to link user data to variables. Using this functionality, Draw defines its variables as TCL variables with associated data.
-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 *$* does not change the result of a command. The content of a Draw variable is accessed using appropriate commands.
+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.
There are many kinds of Draw variables, and new ones may be added with C++. Geometric and topological variables are described below.
-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.
+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.
**Example:**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
dset angle pi/3 radius 10
point p radius*cos(angle) radius*sin(angle) 0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-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.
+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.
@subsubsection occt_draw_2_3_1 set, unset
unset varname [varname varname ...]
~~~~~
-**set** assigns a string value to a variable. If the variable does not already exist, it is created.
+*set* assigns a string value to a variable. If the variable does not already exist, it is created.
-Without a value, **set** returns the content of the variable.
+Without a value, *set* returns the content of the variable.
-**unset** deletes variables. It is is also used to delete Draw variables.
+*unset* deletes variables. It is is also used to delete Draw variables.
**Example:**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
@subsection occt_draw_3_3 User defined commands
-*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.
+*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.
-*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.
+*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.
@subsubsection occt_draw_3_3_1 set
#### In *DrawTrSurf* package:
~~~~~
-void Set(Standard_CString& Name,const gp_Pnt& G) ;
-void Set(Standard_CString& Name,const gp_Pnt2d& G) ;
-void Set(Standard_CString& Name,
-const Handle(Geom_Geometry)& G) ;
-void Set(Standard_CString& Name,
-const Handle(Geom2d_Curve)& C) ;
-void Set(Standard_CString& Name,
-const Handle(Poly_Triangulation)& T) ;
-void Set(Standard_CString& Name,
-const Handle(Poly_Polygon3D)& P) ;
-void Set(Standard_CString& Name,
-const Handle(Poly_Polygon2D)& P) ;
+void Set(Standard_CString& Name,const gp_Pnt& G) ;
+void Set(Standard_CString& Name,const gp_Pnt2d& G) ;
+void Set(Standard_CString& Name,
+const Handle(Geom_Geometry)& G) ;
+void Set(Standard_CString& Name,
+const Handle(Geom2d_Curve)& C) ;
+void Set(Standard_CString& Name,
+const Handle(Poly_Triangulation)& T) ;
+void Set(Standard_CString& Name,
+const Handle(Poly_Polygon3D)& P) ;
+void Set(Standard_CString& Name,
+const Handle(Poly_Polygon2D)& P) ;
~~~~~
#### In *DBRep* package:
~~~~~
void Set(const Standard_CString Name,
-const TopoDS_Shape& S) ;
+const TopoDS_Shape& S) ;
~~~~~
Example of *DrawTrSurf*
#### In *DrawTrSurf* package:
~~~~~
-Handle_Geom_Geometry Get(Standard_CString& Name) ;
+Handle_Geom_Geometry Get(Standard_CString& Name) ;
~~~~~
#### In *DBRep* package:
~~~~~
-TopoDS_Shape Get(Standard_CString& Name,
+TopoDS_Shape Get(Standard_CString& Name,
const TopAbs_ShapeEnum Typ = TopAbs_SHAPE,
const Standard_Boolean Complain
= Standard_True) ;
~~~~~
Standard_Integer MyCommand
-(Draw_Interpretor& theCommands,
+(Draw_Interpretor& theCommands,
Standard_Integer argc, char** argv)
{......
// Creation of a Geom_Geometry from a Draw geometric
~~~~~
Standard_Integer MyCommand
-(Draw_Interpretor& theCommands,
+(Draw_Interpretor& theCommands,
Standard_Integer argc, char** argv)
{......
// Creation of a TopoDS_Shape from a Draw topological
* *AXON* : Axonometric view
* *PERS* : Perspective view
- * *+X+Y* : View on both axes (i.e. a top view), other codes are *-X+Y, +Y-Z*, etc.
- * *-2D-* : 2d view
+ * <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.
+ * <i>-2D-</i> : 2d view
The index, the type, the current zoom are displayed in the window title .
@subsubsection occt_draw_4_14 pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr
-Syntax: pu [index]
+Syntax:
+
+~~~~~
+pu [index]
pd [index]
+~~~~~
-The **p_ **commands are used to pan. **pu **and **pd **pan up and down respectively;**pl **and **pr **pan left and right respectively. Each time the view is displaced by 40 pixels.When no index is given, all views will pan in the direction specified.
+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.
+~~~~~
+# you have selected one anonometric view
+pu
+# or
+pu 1
-**Example:**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# you have selected one anonometric view
-pu
-# or
-pu 1
-
-# you have selected an mu4 view; the object in the third
-# view will pan up
-pu 3
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# you have selected an mu4 view; the object in the third view will pan up
+pu 3
+~~~~~
See also: **fit**, **2dfit**
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.
-**Example:**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# See the example with the pick command
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-See also: **pick**
+See also: <a href="#occt_draw_4_1_11">pick</a> command.
@subsection occt_draw_4_2 AIS viewer – view commands
-
@subsubsection occt_draw_4_2_1 vinit
Syntax:
Emulates different types of selection:
* single mouse click selection
- * selection with a rectangle having the upper left and bottom right corners in *(x1,y1)* and *(x2,y2)* respectively
- * selection with a polygon having the corners in pixel positions *(x1,y1), (x2,y2),…, (xn,yn)*
+ * selection with a rectangle having the upper left and bottom right corners in <i>(x1,y1)</i> and <i>(x2,y2)</i> respectively
+ * selection with a polygon having the corners in pixel positions <i>(x1,y1), (x2,y2),…, (xn,yn)</i>
* any of these selections if shift_selection is set to 1.
@subsubsection occt_draw_4_2_12 vmoveto
Changes the type of HLR algorithm used for shapes.
If the algo_type is algo, the exact HLR algorithm is used, otherwise the polygonal algorithm is used for defined shapes.
-If no shape is specified through the command arguments, the given HLR algorithm_type is applied to all *AIS_Shape* instances in the current context, and the command also changes the default HLR algorithm type.
+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.
**Note** that this command works with instances of *AIS_Shape* or derived classes only, other interactive object types are ignored.
@subsubsection occt_draw_4_3_1 vdisplay
-Syntax:
-~~~~~
+Syntax:
+~~~~~
vdisplay name1 [name2] … [name n]
~~~~~
+
Displays named objects.
**Example:**
-~~~~~
+~~~~~
vinit
box b 40 40 40 10 10 10
psphere s 20
vdisplay s b
vfit
-~~~~~
+~~~~~
@subsubsection occt_draw_4_3_2 vdonly
Syntax:
~~~~~
-vdonly [name1] … [name n]
-~~~~~
+vdonly [name1] … [name n]
+~~~~~
+
Displays only selected or named objects. If there are no selected or named objects, nothing is done.
**Example:**
-~~~~~
+~~~~~
vinit
box b 40 40 40 10 10 10
psphere s 20
vdonly b
-vfit
-~~~~~
-
+vfit
+~~~~~
+
@subsubsection occt_draw_4_3_3 vdisplayall
Syntax:
-~~~~~
+~~~~~
vdisplayall
-~~~~~
-Displays all created objects.
+~~~~~
+Displays all created objects.
**Example:**
-~~~~~
+~~~~~
vinit
box b 40 40 40 10 10 10
psphere s 20
vdisplayall
vfit
-~~~~~
+~~~~~
@subsubsection occt_draw_4_3_4 verase
-Syntax:
-~~~~~
-verase [name1] [name2] … [name n]
+Syntax:
~~~~~
+verase [name1] [name2] … [name n]
+~~~~~
Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
psphere s 20
vdisplayall
vfit
-# erase only the first box
+# erase only first box
verase b1
-# erase the second box and sphere
-verase
-~~~~~
+# erase second box and sphere
+verase
+~~~~~
@subsubsection occt_draw_4_3_5 veraseall
Syntax:
~~~~~
-veraseall
-~~~~~
-Erases all objects displayed in the viewer.
+veraseall
+~~~~~
-**Example:**
+Erases all objects displayed in the viewer.
-~~~~~
+**Example:**
+~~~~~
vinit
box b1 40 40 40 10 10 10
box b2 -40 -40 -40 10 10 10
psphere s 20
vdisplayall
vfit
-# erase only the first box
+# erase only first box
verase b1
-# erase the second box and sphere
-verseall
-~~~~~
+# erase second box and sphere
+verseall
+~~~~~
@subsubsection occt_draw_4_3_6 vsetdispmode
Syntax:
-
-~~~~~
-vsetdispmode [name] mode(0,1,2,3)
~~~~~
+vsetdispmode [name] mode(0,1,2,3)
+~~~~~
-Sets display mode for all, selected or named objects to the following values:
-* **0** - WireFrame,
-* **1** - Shading,
-* **2** - Quick HideLineremoval,
-* **3** - Exact HideLineremoval.
+Sets display mode for all, selected or named objects.
+* *0* (*WireFrame*),
+* *1* (*Shading*),
+* *2* (*Quick HideLineremoval*),
+* *3* (*Exact HideLineremoval*).
**Example:**
-
~~~~~
vinit
box b 10 10 10
vdisplay b
vsetdispmode 1
-vfit
+vfit
~~~~~
-@subsubsection occt_draw_4_39 vtypes
-
-Syntax: vtypes
-
-Makes a list of known types and signatures in AIS.
-
+
@subsubsection occt_draw_4_3_7 vdisplaytype
Syntax:
~~~~~
-vdisplaytype type
-~~~~~
+vdisplaytype type
+~~~~~
-Displays all objects of a given type. The following types are possible: **Point, Axis, Trihedron, PlaneTrihedron, Line, Circle, Plane, Shape, ConnectedShape, MultiConn.Shape, ConnectedInter., MultiConn., Constraint** and **Dimension**.
+Displays all objects of a given type.
+The following types are possible: *Point*, *Axis*, *Trihedron*, *PlaneTrihedron*, *Line*, *Circle*, *Plane*, *Shape*, *ConnectedShape*, *MultiConn.Shape*, *ConnectedInter.*, *MultiConn.*, *Constraint* and *Dimension*.
@subsubsection occt_draw_4_3_8 verasetype
-Syntax: verasetype type
+Syntax:
+~~~~~
+verasetype type
+~~~~~
Erases all objects of a given type.
-Possible** type**s are **;Point;, ;Axis;, ;Trihedron;, ;PlaneTrihedron;, ;Line;, ;Circle;, ;Plane;, ;Shape;, ;ConnectedShape;, ;MultiConn.Shape;, ;ConnectedInter.;, ;MultiConn.;, ;Constraint; **and **;Dimension; **(see **vtypes**).
+Possible type is *Point*, *Axis*, *Trihedron*, *PlaneTrihedron*, *Line*, *Circle*, *Plane*, *Shape*, *ConnectedShape*, *MultiConn.Shape*, *ConnectedInter.*, *MultiConn.*, *Constraint* and *Dimension*.
+@subsubsection occt_draw_4_3_9 vtypes
+Syntax:
+~~~~~
+vtypes
+~~~~~
-@subsubsection occt_draw_4_310 vsetcolor
-
-Syntax: vsetcolor [shapename] colorname
+Makes a list of known types and signatures in AIS.
-Sets color for all, selected or named shapes.
-Possible **colorname**s are: ;BLACK;, ;MATRAGRAY;, ;MATRABLUE;, ;ALICEBLUE;, ;ANTIQUEWHITE;, ;ANTIQUEWHITE1;, ;ANTIQUEWHITE2;, ;ANTIQUEWHITE3;, ;ANTIQUEWHITE4;, ;AQUAMARINE1;, ;AQUAMARINE2;, ;AQUAMARINE4;, ;AZURE;, ;AZURE2;, ;AZURE3;, ;AZURE4;, ;BEIGE;, ;BISQUE;, ;BISQUE2;, ;BISQUE3;, ;BISQUE4;, ;BLANCHEDALMOND;, ;BLUE1;, ;BLUE2;, ;BLUE3;, ;BLUE4;, ;BLUEVIOLET;, ;BROWN;, ;BROWN1;, ;BROWN2;, ;BROWN3;, ;BROWN4;, ;BURLYWOOD;, ;BURLYWOOD1;, ;BURLYWOOD2;, ;BURLYWOOD3;, ;BURLYWOOD4;, ;CADETBLUE;, ;CADETBLUE1;, ;CADETBLUE2;, ;CADETBLUE3;, ;CADETBLUE4;, ;CHARTREUSE;, ;CHARTREUSE1;, ;CHARTREUSE2;, ;CHARTREUSE3;, ;CHARTREUSE4;, ;CHOCOLATE;, ;CHOCOLATE1;, ;CHOCOLATE2;, ;CHOCOLATE3;, ;CHOCOLATE4;, ;CORAL;, ;CORAL1;, ;CORAL2;, ;CORAL3;, ;CORAL4;, ;CORNFLOWERBLUE;, ;CORNSILK1;, ;CORNSILK2;, ;CORNSILK3;, ;CORNSILK4;, ;CYAN1;, ;CYAN2;, ;CYAN3;, ;CYAN4;, ;DARKGOLDENROD;, ;DARKGOLDENROD1;, ;DARKGOLDENROD2;, ;DARKGOLDENROD3;, ;DARKGOLDENROD4;, ;DARKGREEN;, ;DARKKHAKI;, ;DARKOLIVEGREEN;, ;DARKOLIVEGREEN1;, ;DARKOLIVEGREEN2;, ;DARKOLIVEGREEN3;, ;DARKOLIVEGREEN4;, ;DARKORANGE;, ;DARKORANGE1;, ;DARKORANGE2;, ;DARKORANGE3;, ;DARKORANGE4;, ;DARKORCHID;, ;DARKORCHID1;, ;DARKORCHID2;, ;DARKORCHID3;, ;DARKORCHID4;, ;DARKSALMON;, ;DARKSEAGREEN;, ;DARKSEAGREEN1;, ;DARKSEAGREEN2;, ;DARKSEAGREEN3;, ;DARKSEAGREEN4;, ;DARKSLATEBLUE;, ;DARKSLATEGRAY1;, ;DARKSLATEGRAY2;, ;DARKSLATEGRAY3;, ;DARKSLATEGRAY4;, ;DARKSLATEGRAY;, ;DARKTURQUOISE;, ;DARKVIOLET;, ;DEEPPINK;, ;DEEPPINK2;, ;DEEPPINK3;, ;DEEPPINK4;, ;DEEPSKYBLUE1;, ;DEEPSKYBLUE2;, ;DEEPSKYBLUE3;, ;DEEPSKYBLUE4;, ;DODGERBLUE1;, ;DODGERBLUE2;, ;DODGERBLUE3;, ;DODGERBLUE4;, ;FIREBRICK;, ;FIREBRICK1;, ;FIREBRICK2;, ;FIREBRICK3;, ;FIREBRICK4;, ;FLORALWHITE;, ;FORESTGREEN;, ;GAINSBORO;, ;GHOSTWHITE;, ;GOLD;, ;GOLD1;, ;GOLD2;, ;GOLD3;, ;GOLD4;, ;GOLDENROD;, ;GOLDENROD1;, ;GOLDENROD2;, ;GOLDENROD3;, ;GOLDENROD4;, ;GRAY;, ;GRAY0;, ;GRAY1;, ;GRAY10;, ;GRAY11;, ;GRAY12;, ;GRAY13;, ;GRAY14;, ;GRAY15;, ;GRAY16;, ;GRAY17;, ;GRAY18;, ;GRAY19;, ;GRAY2;, ;GRAY20;, ;GRAY21;, ;GRAY22;, ;GRAY23;, ;GRAY24;, ;GRAY25;, ;GRAY26;, ;GRAY27;, ;GRAY28;, ;GRAY29;, ;GRAY3;, ;GRAY30;, ;GRAY31;, ;GRAY32;, ;GRAY33;, ;GRAY34;, ;GRAY35;, ;GRAY36;, ;GRAY37;, ;GRAY38;, ;GRAY39;, ;GRAY4;, ;GRAY40;, ;GRAY41;, ;GRAY42;, ;GRAY43;, ;GRAY44;, ;GRAY45;, ;GRAY46;, ;GRAY47;, ;GRAY48;, ;GRAY49;, ;GRAY5;, ;GRAY50;, ;GRAY51;, ;GRAY52;, ;GRAY53;, ;GRAY54;, ;GRAY55;, ;GRAY56;, ;GRAY57;, ;GRAY58;, ;GRAY59;, ;GRAY6;, ;GRAY60;, ;GRAY61;, ;GRAY62;, ;GRAY63;, ;GRAY64;, ;GRAY65;, ;GRAY66;, ;GRAY67;, ;GRAY68;, ;GRAY69;, ;GRAY7;, ;GRAY70;, ;GRAY71;, ;GRAY72;, ;GRAY73;, ;GRAY74;, ;GRAY75;, ;GRAY76;, ;GRAY77;, ;GRAY78;, ;GRAY79;, ;GRAY8;, ;GRAY80;, ;GRAY81;, ;GRAY82;, ;GRAY83;, ;GRAY85;, ;GRAY86;, ;GRAY87;, ;GRAY88;, ;GRAY89;, ;GRAY9;, ;GRAY90;, ;GRAY91;, ;GRAY92;, ;GRAY93;, ;GRAY94;, ;GRAY95;, ;GREEN;, ;GREEN1;, ;GREEN2;, ;GREEN3;, ;GREEN4;, ;GREENYELLOW;, ;GRAY97;, ;GRAY98;, ;GRAY99;, ;HONEYDEW;, ;HONEYDEW2;, ;HONEYDEW3;, ;HONEYDEW4;, ;HOTPINK;, ;HOTPINK1;, ;HOTPINK2;, ;HOTPINK3;, ;HOTPINK4;, ;INDIANRED;, ;INDIANRED1;, ;INDIANRED2;, ;INDIANRED3;, ;INDIANRED4;, ;IVORY;, ;IVORY2;, ;IVORY3;, ;IVORY4;, ;KHAKI;, ;KHAKI1;, ;KHAKI2;, ;KHAKI3;, ;KHAKI4;, ;LAVENDER;, ;LAVENDERBLUSH1;, ;LAVENDERBLUSH2;, ;LAVENDERBLUSH3;, ;LAVENDERBLUSH4;, ;LAWNGREEN;, ;LEMONCHIFFON1;, ;LEMONCHIFFON2;, ;LEMONCHIFFON3;, ;LEMONCHIFFON4;, ;LIGHTBLUE;, ;LIGHTBLUE1;, ;LIGHTBLUE2;, ;LIGHTBLUE3;, ;LIGHTBLUE4;, ;LIGHTCORAL;, ;LIGHTCYAN1;, ;LIGHTCYAN2;, ;LIGHTCYAN3;, ;LIGHTCYAN4;, ;LIGHTGOLDENROD;, ;LIGHTGOLDENROD1;, ;LIGHTGOLDENROD2;, ;LIGHTGOLDENROD3;, ;LIGHTGOLDENROD4;, ;LIGHTGOLDENRODYELLOW;, ;LIGHTGRAY;, ;LIGHTPINK;, ;LIGHTPINK1;, ;LIGHTPINK2;, ;LIGHTPINK3;, ;LIGHTPINK4;, ;LIGHTSALMON1;, ;LIGHTSALMON2;, ;LIGHTSALMON3;, ;LIGHTSALMON4;, ;LIGHTSEAGREEN;, ;LIGHTSKYBLUE;, ;LIGHTSKYBLUE1;, ;LIGHTSKYBLUE2;, ;LIGHTSKYBLUE3;, ;LIGHTSKYBLUE4;, ;LIGHTSLATEBLUE;, ;LIGHTSLATEGRAY;, ;LIGHTSTEELBLUE;, ;LIGHTSTEELBLUE1;, ;LIGHTSTEELBLUE2;, ;LIGHTSTEELBLUE3;, ;LIGHTSTEELBLUE4;, ;LIGHTYELLOW;, ;LIGHTYELLOW2;, ;LIGHTYELLOW3;, ;LIGHTYELLOW4;, ;LIMEGREEN;, ;LINEN;, ;MAGENTA1;, ;MAGENTA2;, ;MAGENTA3;, ;MAGENTA4;, ;MAROON;, ;MAROON1;, ;MAROON2;, ;MAROON3;, ;MAROON4;, ;MEDIUMAQUAMARINE;, ;MEDIUMORCHID;, ;MEDIUMORCHID1;, ;MEDIUMORCHID2;, ;MEDIUMORCHID3;, ;MEDIUMORCHID4;, ;MEDIUMPURPLE;, ;MEDIUMPURPLE1;, ;MEDIUMPURPLE2;, ;MEDIUMPURPLE3;, ;MEDIUMPURPLE4;, ;MEDIUMSEAGREEN;, ;MEDIUMSLATEBLUE;, ;MEDIUMSPRINGGREEN;, ;MEDIUMTURQUOISE;, ;MEDIUMVIOLETRED;, ;MIDNIGHTBLUE;, ;MINTCREAM;, ;MISTYROSE;, ;MISTYROSE2;, ;MISTYROSE3;, ;MISTYROSE4;, ;MOCCASIN;, ;NAVAJOWHITE1;, ;NAVAJOWHITE2;, ;NAVAJOWHITE3;, ;NAVAJOWHITE4;, ;NAVYBLUE;, ;OLDLACE;, ;OLIVEDRAB;, ;OLIVEDRAB1;, ;OLIVEDRAB2;, ;OLIVEDRAB3;, ;OLIVEDRAB4;, ;ORANGE;, ;ORANGE1;, ;ORANGE2;, ;ORANGE3;, ;ORANGE4;, ;ORANGERED;, ;ORANGERED1;, ;ORANGERED2;, ;ORANGERED3;, ;ORANGERED4;, ;ORCHID;, ;ORCHID1;, ;ORCHID2;, ;ORCHID3;, ;ORCHID4;, ;PALEGOLDENROD;, ;PALEGREEN;, ;PALEGREEN1;, ;PALEGREEN2;, ;PALEGREEN3;, ;PALEGREEN4;, ;PALETURQUOISE;, ;PALETURQUOISE1;, ;PALETURQUOISE2;, ;PALETURQUOISE3;, ;PALETURQUOISE4;, ;PALEVIOLETRED;, ;PALEVIOLETRED1;, ;PALEVIOLETRED2;, ;PALEVIOLETRED3;, ;PALEVIOLETRED4;, ;PAPAYAWHIP;, ;PEACHPUFF;, ;PEACHPUFF2;, ;PEACHPUFF3;, ;PEACHPUFF4;, ;PERU;, ;PINK;, ;PINK1;, ;PINK2;, ;PINK3;, ;PINK4;, ;PLUM;, ;PLUM1;, ;PLUM2;, ;PLUM3;, ;PLUM4;, ;POWDERBLUE;, ;PURPLE;, ;PURPLE1;, ;PURPLE2;, ;PURPLE3;, ;PURPLE4;, ;RED;, ;RED1;, ;RED2;, ;RED3;, ;RED4;, ;ROSYBROWN;, ;ROSYBROWN1;, ;ROSYBROWN2;, ;ROSYBROWN3;, ;ROSYBROWN4;, ;ROYALBLUE;, ;ROYALBLUE1;, ;ROYALBLUE2;, ;ROYALBLUE3;, ;ROYALBLUE4;, ;SADDLEBROWN;, ;SALMON;, ;SALMON1;, ;SALMON2;, ;SALMON3;, ;SALMON4;, ;SANDYBROWN;, ;SEAGREEN;, ;SEAGREEN1;, ;SEAGREEN2;, ;SEAGREEN3;, ;SEAGREEN4;, ;SEASHELL;, ;SEASHELL2;, ;SEASHELL3;, ;SEASHELL4;, ;BEET;, ;TEAL;, ;SIENNA;, ;SIENNA1;, ;SIENNA2;, ;SIENNA3;, ;SIENNA4;, ;SKYBLUE;, ;SKYBLUE1;, ;SKYBLUE2;, ;SKYBLUE3;, ;SKYBLUE4;, ;SLATEBLUE;, ;SLATEBLUE1;, ;SLATEBLUE2;, ;SLATEBLUE3;, ;SLATEBLUE4;, ;SLATEGRAY1;, ;SLATEGRAY2;, ;SLATEGRAY3;, ;SLATEGRAY4;, ;SLATEGRAY;, ;SNOW;, ;SNOW2;, ;SNOW3;, ;SNOW4;, ;SPRINGGREEN;, ;SPRINGGREEN2;, ;SPRINGGREEN3;, ;SPRINGGREEN4;, ;STEELBLUE;, ;STEELBLUE1;, ;STEELBLUE2;, ;STEELBLUE3;, ;STEELBLUE4;, ;TAN;, ;TAN1;, ;TAN2;, ;TAN3;, ;TAN4;, ;THISTLE;, ;THISTLE1;, ;THISTLE2;, ;THISTLE3;, ;THISTLE4;, ;TOMATO;, ;TOMATO1;, ;TOMATO2;, ;TOMATO3;, ;TOMATO4;, ;TURQUOISE;, ;TURQUOISE1;, ;TURQUOISE2;, ;TURQUOISE3;, ;TURQUOISE4;, ;VIOLET;, ;VIOLETRED;, ;VIOLETRED1;, ;VIOLETRED2;, ;VIOLETRED3;, ;VIOLETRED4;, ;WHEAT;, ;WHEAT1;, ;WHEAT2;, ;WHEAT3;, ;WHEAT4;, ;WHITE;, ;WHITESMOKE;, ;YELLOW;, ;YELLOW1;, ;YELLOW2;, ;YELLOW3;, ;YELLOW4; and ;YELLOWGREEN;**.
+@subsubsection occt_draw_4_3_10 vsetcolor
+Syntax:
+~~~~~
+vsetcolor [shapename] colorname
+~~~~~
+Sets color for all, selected or named shapes.
+Possible *colorname* is: *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*.
-@subsubsection occt_draw_4_311 vunsetcolor
+@subsubsection occt_draw_4_3_11 vunsetcolor
-Syntax: vunsetcolor [shapename]
+Syntax:
+~~~~~
+vunsetcolor [shapename]
+~~~~~
Sets default color for all, selected or named shapes.
-@subsubsection occt_draw_4_312 vsettransparency
+@subsubsection occt_draw_4_3_12 vsettransparency
+
+Syntax:
+~~~~~
+vsettransparency [shapename] coeficient
+~~~~~
-Syntax: vsettransparency [shapename] coeficient
+Sets transparency for all selected or named shapes. The *coefficient* may be between 0.0 (opaque) and 1.0 (fully transparent).
-Sets transparency for all selected or named shapes. The **Coefficient** may be between 0.0 (opaque) and 1.0 (fully transparent). Warning: at 1.0 the shape becomes invisible.
+**Warning**: at 1.0 the shape becomes invisible.
+
**Example:**
-
+~~~~~
vinit
box b 10 10 10
psphere s 20
vdisplay b s
vfit
vsetdispmode 1
-vsettransparency b 0.5
+vsettransparency b 0.5
+~~~~~
-@subsubsection occt_draw_4_313 vunsettransparency
+@subsubsection occt_draw_4_3_13 vunsettransparency
-Syntax: vunsettransparency [shapename]
+Syntax:
+~~~~~
+vunsettransparency [shapename]
+~~~~~
Sets default transparency (0.0) for all selected or named shapes.
-@subsubsection occt_draw_4_314 vsetmaterial
+@subsubsection occt_draw_4_3_14 vsetmaterial
-Syntax: vsetmaterial [shapename] materialname
+Syntax:
+~~~~~
+vsetmaterial [shapename] materialname
+~~~~~
Sets material for all selected or named shapes.
-**materialname** is ***BRASS*, *BRONZE*, *COPPER*, *GOLD*, *PEWTER*, *PLASTER*, *PLASTIC*, *SILVER*, *STEEL*, *STONE*, *SHINY_PLASTIC*, *SATIN*, *METALIZED*, *NEON_GNC*, *CHROME*, *ALUMINIUM*, *OBSIDIAN*, *NEON_PHC*, *JADE*.**
-**Example:**
+**materialname** can be *BRASS*, *BRONZE*, *COPPER*, *GOLD*, *PEWTER*, *PLASTER*, *PLASTIC*, *SILVER*, *STEEL*, *STONE*, *SHINY_PLASTIC*, *SATIN*, *METALIZED*, *NEON_GNC*, *CHROME*, *ALUMINIUM*, *OBSIDIAN*, *NEON_PHC* or *JADE*.
+
+**Example:**
+~~~~~
vinit
psphere s 20
vdisplay s
vfit
vsetdispmode 1
vsetmaterial s JADE
+~~~~~
-@subsubsection occt_draw_4_315 vunsetmaterial
+@subsubsection occt_draw_4_3_15 vunsetmaterial
-Syntax: vunsetmaterial [shapename]
+Syntax:
+~~~~~
+vunsetmaterial [shapename]
+~~~~~
Sets default material for all selected or named shapes.
-@subsubsection occt_draw_4_316 vsetwidth
+@subsubsection occt_draw_4_3_16 vsetwidth
-Syntax: vsetwidth [shapename] coeficient
+Syntax:
+~~~~~
+vsetwidth [shapename] coeficient
+~~~~~
Sets width of the edges for all selected or named shapes.
-The **Coefficient** may be between 0.0 and 10.0.
+The *coefficient* may be between 0.0 and 10.0.
+
**Example:**
-
+~~~~~
vinit
box b 10 10 10
vdisplay b
vfit
-vsetwidth b 5
+vsetwidth b 5
+~~~~~
-@subsubsection occt_draw_4_317 vunsetwidth
+@subsubsection occt_draw_4_3_17 vunsetwidth
-Syntax: vunsetwidth [shapename]
+Syntax:
+~~~~~
+vunsetwidth [shapename]
+~~~~~
Sets default width of edges (0.0) for all selected or named shapes.
-@subsubsection occt_draw_4_318 vsetshading
+@subsubsection occt_draw_4_3_18 vsetshading
-Syntax: vsetshading shapename [coefficient]
+Syntax:
+~~~~~
+vsetshading shapename [coefficient]
+~~~~~
Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
-**Example:**
+**Example:**
+~~~~~
vinit
psphere s 20
vdisplay s
vfit
vsetdispmode 1
-vsetshading s 0.005
-@subsubsection occt_draw_4_319 vunsetshading
+vsetshading s 0.005
+~~~~~
+
+@subsubsection occt_draw_4_3_19 vunsetshading
-Syntax: vunsetshading [shapename]
+Syntax:
+~~~~~
+vunsetshading [shapename]
+~~~~~
Sets default deflection coefficient (0.0008) that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
-@subsubsection occt_draw_4_320 vsetam
-
-Syntax: vsetam [shapename] mode
+@subsubsection occt_draw_4_3_20 vsetam
-Activates selection mode for all selected or named shapes.
-**mode** is **0** for **shape** itself, **1** for **vertices**, **2** for **edges**, **3** for **wires**, **4** for **faces**, **5** for **shells**, **6** for **solids**, **7** for **compounds**.
+Syntax:
+~~~~~
+vsetam [shapename] mode
+~~~~~
+
+Activates selection mode for all selected or named shapes:
+* *0* for *shape* itself,
+* *1* (*vertices*),
+* *2* (*edges*),
+* *3* (*wires*),
+* *4* (*faces*),
+* *5* (*shells*),
+* *6* (*solids*),
+* *7* (*compounds*).
+
**Example:**
-
+~~~~~
vinit
box b 10 10 10
vdisplay b
vfit
-vsetam b 2
-@subsubsection occt_draw_4_321 vunsetam
+vsetam b 2
+~~~~~
+
+@subsubsection occt_draw_4_3_21 vunsetam
-Syntax: vunsetam
+Syntax:
+~~~~~
+vunsetam
+~~~~~
Deactivates all selection modes for all shapes.
-@subsubsection occt_draw_4_322 vdump
+@subsubsection occt_draw_4_3_22 vdump
-Syntax: vdump filename.{png|xwd|bmp}
+Syntax:
+~~~~~
+vdump <filename>.{png|xwd|bmp}
+~~~~~
Extracts the contents of the viewer window to a png, XWD or BMP file.
-@subsubsection occt_draw_4_323 vdir
+@subsubsection occt_draw_4_3_23 vdir
-Syntax: vdir
+Syntax:
+~~~~~
+vdir
+~~~~~
Displays the list of displayed objects.
-@subsubsection occt_draw_4_324 vsub
+@subsubsection occt_draw_4_3_24 vsub
-Syntax: vsub 0/1(on/off)[shapename]
+Syntax:
+~~~~~
+vsub 0/1(on/off)[shapename]
+~~~~~
-Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
+Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
+
**Example:**
-
+~~~~~
vinit
box b 10 10 10
psphere s 20
vdisplay b s
vfit
vsetdispmode 1
-vsub b 1
+vsub b 1
+~~~~~
-@subsubsection occt_draw_4_325 vardis
+@subsubsection occt_draw_4_3_25 vardis
-Syntax: vardis
+Syntax:
+~~~~~
+vardis
+~~~~~
Displays active areas (for each activated sensitive entity, one or several 2D bounding boxes are displayed, depending on the implementation of a particular entity).
-@subsubsection occt_draw_4_326 varera
+@subsubsection occt_draw_4_3_26 varera
-Syntax: varera
+Syntax:
+~~~~~
+varera
+~~~~~
Erases active areas.
-@subsubsection occt_draw_4_327 vsensdis
+@subsubsection occt_draw_4_3_27 vsensdis
-Syntax: vsensdis
+Syntax:
+~~~~~
+vsensdis
+~~~~~
Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes).
* sensitive triangle
Custom (application-defined) sensitive entity types are not processed by this command.
-@subsubsection occt_draw_4_328 vsensera
+@subsubsection occt_draw_4_3_28 vsensera
-Syntax: vsensera
+Syntax:
+~~~~~
+vsensera
+~~~~~
Erases active entities.
-@subsubsection occt_draw_4_329 vperf
+@subsubsection occt_draw_4_3_29 vperf
-Syntax: vperf shapename 1/0 (Transformation/Loacation) 1/0 (Primitives sensibles ON/OFF)
+Syntax:
+~~~~~
+vperf shapename 1/0 (Transformation/Loacation) 1/0 (Primitives sensibles ON/OFF)
+~~~~~
Tests the animation of an object along a predefined trajectory.
-**Example:**
+**Example:**
+~~~~~
vinit
box b 10 10 10
psphere s 20
vdisplay b s
vfit
vsetdispmode 0
-vperf b 1 1
-@subsubsection occt_draw_4_330 vr
+vperf b 1 1
+~~~~~
+
+@subsubsection occt_draw_4_3_30 vr
-Syntax: vr filename
+Syntax:
+~~~~~
+vr filename
+~~~~~
Reads shape from BREP-format file and displays it in the viewer.
-**Example:**
+**Example:**
+~~~~~
vinit
-vr myshape.brep
-@subsubsection occt_draw_4_330331 vstate
+vr myshape.brep
+~~~~~
+
+@subsubsection occt_draw_4_3_31 vstate
-Syntax: vstate [name1] … [name n]
+Syntax:
+~~~~~
+vstate [name1] … [name n]
+~~~~~
Makes a list of the status (**Displayed** or **Not Displayed**) of some selected or named objects.
+@subsection occt_draw_4_4 AIS viewer – object commands
-@subsection occt_draw_4_3304 AIS viewer – object commands
+@subsubsection occt_draw_4_4_1 vtrihedron
-@subsubsection occt_draw_4_33041 vtrihedron
-
-Syntax: vtrihedron name [X0] [Y0] [Z0] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw]
+Syntax:
+~~~~~
+vtrihedron name [X0] [Y0] [Z0] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw]
+~~~~~
-Creates a new AIS_Trihedron object. If no argument is set, the default trihedron (0XYZ) is created.
+Creates a new *AIS_Trihedron* object. If no argument is set, the default trihedron (0XYZ) is created.
+
**Example:**
-
+~~~~~
vinit
-vtrihedron tr
+vtrihedron tr
+~~~~~
-@subsubsection occt_draw_4_33042 vplanetri
+@subsubsection occt_draw_4_4_2 vplanetri
-Syntax: vplanetri name
+Syntax:
+~~~~~
+vplanetri name
+~~~~~
Creates a plane from a trihedron selection.
-@subsubsection occt_draw_4_33043 vsize
+@subsubsection occt_draw_4_4_3 vsize
-Syntax: vsize [name] [size]
+Syntax:
+~~~~~
+vsize [name] [size]
+~~~~~
-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.
+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.
+
**Example:**
-
+~~~~~
vinit
vtrihedron tr1
vtrihedron tr2 0 0 0 1 0 0 1 0 0
-vsize tr2 400
+vsize tr2 400
+~~~~~
-@subsubsection occt_draw_4_33044 vaxis
+@subsubsection occt_draw_4_4_4 vaxis
-Syntax: vaxis name [Xa Ya Za Xb Yb Zb]
+Syntax:
+~~~~~
+vaxis name [Xa Ya Za Xb Yb Zb]
+~~~~~
-Creates an axis. If the values are not defined, an axis is created by interactive selection of two vertices or one edge
+Creates an axis. If the values are not defined, an axis is created by interactive selection of two vertices or one edge
+
**Example:**
-
+~~~~~
vinit
vtrihedron tr
vaxis axe1 0 0 0 1 0 0
+~~~~~
-@subsubsection occt_draw_4_33045 vaxispara
+@subsubsection occt_draw_4_4_5 vaxispara
-Syntax: vaxispara nom
+Syntax:
+~~~~~
+vaxispara nom
+~~~~~
Creates an axis by interactive selection of an edge and a vertex.
-@subsubsection occt_draw_4_33046 vaxisortho
+@subsubsection occt_draw_4_4_6 vaxisortho
-Syntax: vaxisotrho name
+Syntax:
+~~~~~
+vaxisotrho name
+~~~~~
Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge.
-@subsubsection occt_draw_4_33047 vpoint
+@subsubsection occt_draw_4_4_7 vpoint
-Syntax: vpoint name [Xa Ya Za]
+Syntax:
+~~~~~
+vpoint name [Xa Ya Za]
+~~~~~
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).
-**Example:**
+**Example:**
+~~~~~
vinit
vpoint p 0 0 0
+~~~~~
-@subsubsection occt_draw_4_33048 vplane
+@subsubsection occt_draw_4_4_8 vplane
-Syntax: vplane name [AxisName] [PointName]
- vplane name [PointName] [PointName] [PointName]
- vplane name [PlaneName] [PointName]
+Syntax:
+~~~~~
+vplane name [AxisName] [PointName]
+vplane name [PointName] [PointName] [PointName]
+vplane name [PlaneName] [PointName]
+~~~~~
-Creates a plane from named or interactively selected entities.
+Creates a plane from named or interactively selected entities.
+
**Example:**
-
+~~~~~
vinit
vpoint p1 0 50 0
vaxis axe1 0 0 0 0 0 1
vtrihedron tr
vplane plane1 axe1 p1
+~~~~~
-@subsubsection occt_draw_4_33049 vplanepara
+@subsubsection occt_draw_4_4_9 vplanepara
-Syntax: vplanepara name
+Syntax:
+~~~~~
+vplanepara name
+~~~~~
Creates a plane from interactively selected vertex and face.
-@subsubsection occt_draw_4_330410 vplaneortho
+@subsubsection occt_draw_4_4_10 vplaneortho
-Syntax: vplaneortho name
+Syntax:
+~~~~~
+vplaneortho name
+~~~~~
Creates a plane from interactive selected face and coplanar edge.
-@subsubsection occt_draw_4_330411 vline
+@subsubsection occt_draw_4_4_11 vline
-Syntax: vline name [PointName] [PointName]
- vline name [Xa Ya Za Xb Yb Zb]
+Syntax:
+~~~~~
+vline name [PointName] [PointName]
+vline name [Xa Ya Za Xb Yb Zb]
+~~~~~
Creates a line from coordinates, named or interactively selected vertices.
-**Example:**
+**Example:**
+~~~~~
vinit
vtrihedron tr
vpoint p1 0 50 0
vpoint p2 50 0 0
vline line1 p1 p2
vline line2 0 0 0 50 0 1
+~~~~~
-@subsubsection occt_draw_4_330412 vcircle
+@subsubsection occt_draw_4_4_12 vcircle
-Syntax: vcircle name [PointName PointName PointName IsFilled]
+Syntax:
+~~~~~
+vcircle name [PointName PointName PointName IsFilled]
vcircle name [PlaneName PointName Radius IsFilled]
+~~~~~
-Creates a circle from named or interactively selected entities. Parameter IsFilled is defined as 0 or 1.
+Creates a circle from named or interactively selected entities. Parameter IsFilled is defined as 0 or 1.
+
**Example:**
-
+~~~~~
vinit
vtrihedron tr
vpoint p1 0 50 0
vpoint p2 50 0 0
vpoint p3 0 0 0
-vcircle circle1 p1 p2 p3 1
+vcircle circle1 p1 p2 p3 1
+~~~~~
+@subsubsection occt_draw_4_4_13 vtri2d
-@subsubsection occt_draw_4_330413 vtri2d
-
-Syntax: vtri2d name
+Syntax:
+~~~~~
+vtri2d name
+~~~~~
Creates a plane with a 2D trihedron from an interactively selected face.
-@subsubsection occt_draw_4_330414 vselmode
+@subsubsection occt_draw_4_4_14 vselmode
-Syntax: vselmode [object] mode On/Off
+Syntax:
+~~~~~
+vselmode [object] mode On/Off
+~~~~~
Sets the selection mode for an object. If the object value is not defined, the selection mode is set for all displayed objects.
-Value On is defined as 1 and Off – as 0.
-**Example:**
+Value *On* is defined as 1 and *Off* – as 0.
+**Example:**
+~~~~~
vinit
vpoint p1 0 0 0
vpoint p2 50 0 0
vpoint p3 25 40 0
vtriangle triangle1 p1 p2 p3
-@subsubsection occt_draw_4_330415 vconnect, vconnectsh
+~~~~~
+
+@subsubsection occt_draw_4_4_15 vconnect, vconnectsh
-Syntax: vconnect name object Xo Yo Zo Xu Xv Xw Zu Zv Zw
- vconnectsh name shape Xo Yo Zo Xu Xv Xw Zu Zv Zw
+Syntax:
+~~~~~
+vconnect name object Xo Yo Zo Xu Xv Xw Zu Zv Zw
+vconnectsh name shape Xo Yo Zo Xu Xv Xw Zu Zv Zw
+~~~~~
Creates and displays an object with input location connected to a named entity.
-The difference between these two commands is that the object created by vconnect does not support the selection modes differrent from 0.
-**Example:**
+The difference between these two commands is that the object created by *vconnect* does not support the selection modes different from 0.
+**Example:**
+~~~~~
Vinitvinit
vpoint p1 0 0 0
vpoint p2 50 0 0
vsegment segment p1 p2
restore CrankArm.brep obj
vdisplay obj
-vconnectsh new obj 100100100 1 0 0 0 0 1
-
+vconnectsh new obj 100100100 1 0 0 0 0 1
+~~~~~
+@subsubsection occt_draw_4_4_16 vtriangle
-@subsubsection occt_draw_4_330416 vtriangle
-
-Syntax: vtriangle name PointName PointName PointName
+Syntax:
+~~~~~
+vtriangle name PointName PointName PointName
+~~~~~
Creates and displays a filled triangle from named points.
-**Example:**
+**Example:**
+~~~~~
vinit
vpoint p1 0 0 0
vpoint p2 50 0 0
vpoint p3 25 40 0
-vtriangle triangle1 p1 p2 p3
+vtriangle triangle1 p1 p2 p3
+~~~~~
-@subsubsection occt_draw_4_330417 vsegment
+@subsubsection occt_draw_4_4_17 vsegment
-Syntax: vsegment name PointName PointName
+Syntax:
+~~~~~
+vsegment name PointName PointName
+~~~~~
Creates and displays a segment from named points.
-**Example:**
+**Example:**
+~~~~~
Vinit
vpoint p1 0 0 0
vpoint p2 50 0 0
vsegment segment p1 p2
+~~~~~
+@subsection occt_draw_4_5 AIS viewer – Mesh Visualization Service
-**MeshVS **(Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.
+**MeshVS** (Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.
+@subsubsection occt_draw_4_5_1 meshfromstl
+Syntax:
+~~~~~
+meshfromstl meshname file
+~~~~~
+
+Creates a *MeshVS_Mesh* object based on STL file data. The object will be displayed immediately.
+
+**Example:**
+~~~~~
+meshfromstl mesh myfile.stl
+~~~~~
-@subsection occt_draw_4_3305 AIS viewer – Mesh Visualization Service
+@subsubsection occt_draw_4_5_2 meshdispmode
-@subsubsection occt_draw_4_33051 meshfromstl
+Syntax:
+~~~~~
+meshdispmode meshname displaymode
+~~~~~
-Syntax: meshfromstl meshname file
+Changes the display mode of object **meshname**. The **displaymode** is integer, which can be:
+* *1* for *wireframe*,
+* *2* for *shading* mode, or
+* *3* for *shrink* mode.
-Creates a MeshVS_Mesh object based on STL file data. The object will be displayed immediately.
**Example:**
-
+~~~~~
+vinit
meshfromstl mesh myfile.stl
+meshdispmode mesh 2
+~~~~~
-@subsubsection occt_draw_4_33052 meshdispmode
+@subsubsection occt_draw_4_5_3 meshselmode
-Syntax: meshdispmode meshname displaymode
+Syntax:
+~~~~~
+meshselmode meshname selectionmode
+~~~~~
-Changes the display mode of object **meshname**. The **displaymode** is integer, which can be **1** (for wireframe), **2** (for shading mode) or **3** (for shrink mode).
+Changes the selection mode of object **meshname**. The *selectionmode* is integer OR-combination of mode flags. The basic flags are the following:
+* *1* – node selection;
+* *2* – 0D elements (not supported in STL);
+* *4* – links (not supported in STL);
+* *8* – faces.
+
**Example:**
-
+~~~~~
vinit
meshfromstl mesh myfile.stl
-meshdispmode mesh 2
+meshselmode mesh 1
+~~~~~
-@subsubsection occt_draw_4_33053 meshselmode
+@subsubsection occt_draw_4_5_4 meshshadcolor
-Syntax: meshselmode meshname selectionmode
+Syntax:
+~~~~~
+meshshadcolor meshname red green blue
+~~~~~
-Changes the selection mode of object **meshname**. The **selectionmode** is integer OR-combination of mode flags. The basic flags are the following:
-**1** – node selection,
-**2** – 0D elements (not suppored in STL)
-**4** – links (not supported in STL)
-**8** – faces
+Changes the face interior color of object **meshname**. The *red*, *green** and *blue* are real values between *0* and *1*.
+
**Example:**
-
+~~~~~
vinit
meshfromstl mesh myfile.stl
-meshselmode mesh 1
+meshshadcolormode mesh 0.5 0.5 0.5
+~~~~~
-@subsubsection occt_draw_4_33054 meshshadcolor
+@subsubsection occt_draw_4_5_5 meshlinkcolor
-Syntax: meshshadcolor meshname red green blue
+Syntax:
+~~~~~
+meshlinkcolor meshname red green blue
+~~~~~
-Changes the face interior color of object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
+Changes the color of face borders for object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
+
**Example:**
-
+~~~~~
vinit
meshfromstl mesh myfile.stl
-meshshadcolormode mesh 0.5 0.5 0.5
-
-@subsubsection occt_draw_4_33055 meshlinkcolor
+meshlinkcolormode mesh 0.5 0.5 0.5
+~~~~~
-Syntax: meshlinkcolor meshname red green blue
+@subsubsection occt_draw_4_5_6 meshmat
-Changes the color of face borders for object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
+Syntax:
+~~~~~
+meshmat meshname material
+~~~~~
+
+Changes the material of object **meshname**.
+
+*material* is represented with an integer value as follows (equivalent to enumeration *Graphic3d_NameOfMaterial*):
+* *0 – BRASS,*
+* *1 – BRONZE,*
+* *2 - COPPER,*
+* *3 - GOLD,*
+* *4 - PEWTER,*
+* *5 - PLASTER,*
+* *6 - PLASTIC,*
+* *7 - SILVER,*
+* *8 - STEEL,*
+* *9 - STONE,*
+* *10 - SHINY_PLASTIC,*
+* *11 - SATIN,*
+* *12 - METALIZED,*
+* *13 - NEON_GNC,*
+* *14 - CHROME,*
+* *15 - ALUMINIUM,*
+* *16 - OBSIDIAN,*
+* *17 - NEON_PHC,*
+* *18 - JADE,*
+* *19 - DEFAULT,*
+* *20 - UserDefined*
+
**Example:**
-
-vinit
-meshfromstl mesh myfile.stl
-meshlinkcolormode mesh 0.5 0.5 0.5
-
-@subsubsection occt_draw_4_33056 meshmat
-
-Syntax: meshmat meshname material
-
-Changes the material of object **meshname**. **material** is represented with an integer value as follows (equivalent to enumeration Graphic3d_NameOfMaterial):
-**0 – BRASS,**
-**1 – BRONZE,**
-**2 - COPPER,**
-**3 - GOLD,**
-**4 - PEWTER,**
-**5 - PLASTER,**
-**6 - PLASTIC,**
-**7 - SILVER,**
-**8 - STEEL,**
-**9 - STONE,**
-**10 - SHINY_PLASTIC,**
-**11 - SATIN,**
-**12 - METALIZED,**
-**13 - NEON_GNC,**
-**14 - CHROME,**
-**15 - ALUMINIUM,**
-**16 - OBSIDIAN,**
-**17 - NEON_PHC,**
-**18 - JADE,**
-**19 - DEFAULT,**
-**20 - UserDefined**
-**Example:**
-
+~~~~~
vinit
meshfromstl mesh myfile.stl
meshmat mesh JADE
+~~~~~
-@subsubsection occt_draw_4_33057 meshshrcoef
+@subsubsection occt_draw_4_5_7 meshshrcoef
-Syntax: meshshrcoef meshname shrinkcoefficient
+Syntax:
+~~~~~
+meshshrcoef meshname shrinkcoefficient
+~~~~~
-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.
+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.
+
**Example:**
-
+~~~~~
vinit
meshfromstl mesh myfile.stl
-meshshrcoef mesh 0.05
+meshshrcoef mesh 0.05
+~~~~~
-@subsubsection occt_draw_4_33058 meshshow
+@subsubsection occt_draw_4_5_8 meshshow
-Syntax: meshshow meshname
+Syntax:
+~~~~~
+meshshow meshname
+~~~~~
-Displays **meshname** in the viewer (if it is erased).
+Displays **meshname** in the viewer (if it is erased).
+
**Example:**
-
+~~~~~
vinit
meshfromstl mesh myfile.stl
-meshshow mesh
+meshshow mesh
+~~~~~
-@subsubsection occt_draw_4_33059 meshhide
+@subsubsection occt_draw_4_5_9 meshhide
-Syntax: meshhide meshname
+Syntax:
+~~~~~
+meshhide meshname
+~~~~~
Hides **meshname** in the viewer.
-**Example:**
+**Example:**
+~~~~~
vinit
meshfromstl mesh myfile.stl
-meshhide mesh
+meshhide mesh
+~~~~~
-@subsubsection occt_draw_4_330510 meshhidesel
+@subsubsection occt_draw_4_5_10 meshhidesel
-Syntax: meshhidesel meshname
+Syntax:
+~~~~~
+meshhidesel meshname
+~~~~~
Hides only selected entities. The other part of **meshname** remains visible.
-@subsubsection occt_draw_4_330511 meshshowsel
+@subsubsection occt_draw_4_5_11 meshshowsel
-Syntax: meshshowsel meshname
+Syntax:
+~~~~~
+meshshowsel meshname
+~~~~~
Shows only selected entities. The other part of **meshname** becomes invisible.
-@subsubsection occt_draw_4_330512 meshshowall
+@subsubsection occt_draw_4_5_12 meshshowall
-Syntax: meshshowall meshname
+Syntax:
+~~~~~
+meshshowall meshname
+~~~~~
Changes the state of all entities to visible for **meshname**.
-@subsubsection occt_draw_4_330513 meshdelete
+@subsubsection occt_draw_4_5_13 meshdelete
-Syntax: meshdelete meshname
+Syntax:
+~~~~~
+meshdelete meshname
+~~~~~
Deletes MeshVS_Mesh object **meshname**.
-**Example:**
+**Example:**
+~~~~~
vinit
meshfromstl mesh myfile.stl
meshdelete mesh
+~~~~~
-
-
-
-@subsection occt_draw_4_3306 AIS viewer – 2D viewer – view commands
-
-@subsubsection occt_draw_4_33061 v2dinit
-
-Syntax: v2dinit
-
-**v2dinit **creates the 2D viewer window.
-
-@subsubsection occt_draw_4_33062 v2dsetbg
-
-Syntax: v2dsetbg imagefile [filletype]
-
-**v2dsetbg** loads **imagefile** as background. **filletype** is **NONE**, **CENTERED**, **TILED**, **STRETCH**.
-**Example:**
-
-v2dinit
-v2dsetbg myimage.brep CENTERED
-
-@subsubsection occt_draw_4_33063 v2dfit
-
-Syntax: v2dfit
-
-Fits all shapes to the size of the window.
-
-@subsubsection occt_draw_4_33064 v2drepaint
-
-Syntax: v2drepaint
-
-Forcedly repaints all shapes.
-
-@subsubsection occt_draw_4_33065 v2dclear
-
-Syntax: v2dclear
-
-Clears the 2D viewer window
-
-@subsubsection occt_draw_4_33066 v2dtext
-
-Syntax: v2dtext text x y [angle scale fontindex]
-
-Creates a new object with the name **text_i** (i – integer value) and displays **text** at the position** x**, **y.** The text can be displayed at a certain **angle**, on a certain **scale** and with a certain **fontindex**.
-Default values are: **angle=0.0, scale=1.0, fontindex=0**.
-**Example:**
-
-v2dinit
-v2dtext *My text* 10 10
-@subsubsection occt_draw_4_33067 v2dsettextcolor
-
-Syntax: v2dsettextcolor text_name colorindex
-
-Changes the color of **text_name** object (**name** must be an integer value).
-**Example:**
-
-v2dinit
-v2dtext *My text* 10 10
-# Change color to red
-v2dsettextcolor text_0 3
-@subsubsection occt_draw_4_33068 v2dpick
-
-Syntax: v2dpick
-
-Displays mouse coordinates and color after clicking the mouse button in the 2D viewer window.
-
-
-@subsubsection occt_draw_4_33069 v2dgrid
-
-Syntax: v2dgrid [type x y xstep ystep angle [drawmode]]
- v2dgrid [type x y radiusstep division angle [drawmode]]
-
-Loads a grid in the 2D viewer window.
-**type** is **Rect** or **Circ**.
-**drawmode** is **Lines**, **Points** or **None**.
-**Example:**
-
-v2dinit
-v2dgrid Circ 0 0 250 12 0 Lines
-v2drmgrid
-v2dgrid Rect 0 0 200 200 0 Lines
-@subsubsection occt_draw_4_330610 v2rmgrid
-
-Syntax: v2rmgrid
-
-Unloads a grid from the window.
-
-@subsubsection occt_draw_4_330611 v2dpickgrid
-
-Syntax: v2dpickgrid [mouse_x mouse_y [grid_x grid_y]]
-
-Gets coordinates of a grid point near the mouse button click in the 2D viewer window and sets it to **grid_x**, **grid_y** variables.
-
-@subsubsection occt_draw_4_330612 v2dpsout
-
-Syntax: v2dpsout imagefile [scale colorspace]
- [width height [xcenter ycenter]]
-
-Exports **imagefile**. You can set its the scale, width, height and colorspace.
-**colorspace** can be **RGB, BlackAndWhite, GreyScale**.
-
-@subsubsection occt_draw_4_330612613 v2ddir
-
-Syntax: v2ddir
-
-Makes aLlist of the displayed objects.
-
-
-@subsection occt_draw_4_3306127 Ais viewer – 2D viewer – display commands
-
-@subsubsection occt_draw_4_33061271 v2ddisplay
-
-Syntax: v2ddisplay name [projection]
-
-Projection: origin_x origin_y origin_z normal_x normal_y normal_z dx_x dx_y dx_z.
-
-Displays named objects.
-**Example:**
-
-v2dinit
-box b 10 10 10
-psphere s 20
-v2ddisplay s
-v2ddisplay b
-v2dfit
-@subsubsection occt_draw_4_33061272 v2ddonly
-
-Syntax: v2ddonly [name1] … [name n]
-
-Displays only selected or named objects. If there are no selected or named objects, nothing is done.
-**Example:**
-
-v2dinit
-box b 10 10 10
-psphere s 20
-v2ddisplay b
-v2ddisplay s
-v2ddonly s
-v2dfit
-@subsubsection occt_draw_4_33061273 v2ddisplayall
-
-Syntax: v2ddisplayall
-
-Displays all created objects.
-**Example:**
-
-v2dinit
-box b 10 10 10
-psphere s 20
-v2ddisplay b
-v2ddisplay s
-v2ddonly
-v2ddisplayall
-v2dfit
-@subsubsection occt_draw_4_33061274 v2derase
-
-Syntax: v2derase name1 [name2] … [name n]
-
-Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
-**Example:**
-
-v2dinit
-box b 10 10 10
-psphere s 20
-v2ddisplay b
-v2ddisplay s
-v2derase b
-v2dfit
-@subsubsection occt_draw_4_33061275 v2deraseall
-
-Syntax: v2deraseall
-
-Erases all objects displayed in the viewer.
-**Example:**
-
-v2dinit
-box b 10 10 10
-psphere s 20
-v2ddisplay b
-v2ddisplay s
-v2deraseall
-v2dfit
-@subsubsection occt_draw_4_33061276 v2dsetcolor
-
-Syntax: v2dsetcolor [shapename] colorname
-
-Sets color for all, selected or named shapes.
-Values of **colorname** see **vsetcolor**.
-**Example:**
-
-v2dinit
-box b 10 10 10
-v2ddisplay b
-v2ddisplay s
-v2dsetcolor b RED
-v2dfit
-@subsubsection occt_draw_4_33061277 v2dunsetcolor
-
-Syntax: v2dunsetcolor [shapename]
-
-Sets default color for all, selected or named shapes.
-**Example:**
-
-v2dinit
-box b 10 10 10
-v2ddisplay b
-v2ddisplay s
-v2dsetcolor RED
-v2dunsetcolor b
-v2dfit
-@subsubsection occt_draw_4_33061278 v2dsetbgcolor
-
-Syntax: v2dsetbgcolor colorname
-
-Sets background color.
-See **vsetcolor** for the values of **colorname.**.
-**Example:**
-
-v2dinit
-box b 10 10 10
-v2ddisplay b
-v2ddisplay s
-v2dsetbgcolor RED
-v2dfit
-@subsubsection occt_draw_4_33061279 v2dsetwidth
-
-Syntax: v2dsetwidth [shapename] widthenum
-
-Set width of the edges for all, selected or named shapes.
-**widthenum** may be one of: **THIN, MEDIUM, THICK, VERYTHICK**.
-**Example:**
-
-v2dinit
-box b 10 10 10
-v2ddisplay b
-v2ddisplay s
-v2dsetwidth b THICK
-v2dfit
-@subsubsection occt_draw_4_330612710 v2dunsetwidth
-
-Syntax: vunsetwidth [shapename]
-
-Sets default width of the edges for all, selected or named shapes.
-**Example:**
-
-v2dinit
-box b 10 10 10
-v2ddisplay b
-v2ddisplay s
-v2dsetwidth THICK
-v2dunsetwidth b
-v2dfit
-
-@section occt_2142243456_930384826 OCAF commands
+@section occt_draw_5 OCAF commands
This chapter contains a set of commands for Open CASCADE Technology Application Framework (OCAF).
-@subsection occt_2142243456_9303848261 Application commands
+@subsection occt_draw_5_1 Application commands
-@subsubsection occt_2142243456_93038482611 NewDocument
+@subsubsection occt_draw_5_1_1 NewDocument
-Syntax: NewDocument docname [format]
+Syntax:
+~~~~~
+NewDocument docname [format]
+~~~~~
Creates a new **docname** document with MDTV-Standard or described format.
-**Example:**
+**Example:**
+~~~~~
# Create new document with default (MDTV-Standard) format
NewDocument D
# Create new document with BinOcaf format
NewDocument D2 BinOcaf
+~~~~~
-@subsubsection occt_2142243456_93038482612 IsInSession
+@subsubsection occt_draw_5_1_2 IsInSession
-Syntax: IsInSession path
+Syntax:
+~~~~~
+IsInSession path
+~~~~~
-**I**Returns **0**, if **path** document is managed by the application session, **1** – otherwise.
-**Example:**
+Returns *0*, if **path** document is managed by the application session, *1* – otherwise.
+**Example:**
+~~~~~
IsInSession /myPath/myFile.std
+~~~~~
-@subsubsection occt_2142243456_93038482613 ListDocuments
+@subsubsection occt_draw_5_1_3 ListDocuments
-Syntax: ListDocuments
+Syntax:
+~~~~~
+ListDocuments
+~~~~~
Makes a list of documents handled during the session of the application.
-@subsubsection occt_2142243456_93038482614 Open
+@subsubsection occt_draw_5_1_4 Open
-Syntax: Open path docname
+Syntax:
+~~~~~
+Open path docname
+~~~~~
Retrieves the document of file **docname** in the path **path**. Overwrites the document, if it is already in session.
-**Example:**
-Open /myPath/myFile.std D
+**Example:**
+~~~~~
+Open /myPath/myFile.std D
+~~~~~
-@subsubsection occt_2142243456_93038482615 Close
+@subsubsection occt_draw_5_1_5 Close
-Syntax: Close docname
+Syntax:
+~~~~~
+Close docname
+~~~~~
Closes **docname** document. The document is no longer handled by the applicative session.
-**Example:**
+**Example:**
+~~~~~
Close D
+~~~~~
-@subsubsection occt_2142243456_93038482616 Save
+@subsubsection occt_draw_5_1_6 Save
-Syntax: Save docname
+Syntax:
+~~~~~
+Save docname
+~~~~~
Saves **docname** active document.
-**Example:**
+**Example:**
+~~~~~
Save D
+~~~~~
-@subsubsection occt_2142243456_93038482617 SaveAs
+@subsubsection occt_draw_5_1_7 SaveAs
-Syntax: SaveAs docname path
+Syntax:
+~~~~~
+SaveAs docname path
+~~~~~
Saves the active document in the file **docname** in the path **path**. Overwrites the file if it already exists.
-**Example:**
-
-SaveAs D /myPath/myFile.std
-
-@subsection occt_2142243456_9303848262 Basic commands
+**Example:**
+~~~~~
+SaveAs D /myPath/myFile.std
+~~~~~
-@subsubsection occt_2142243456_930384826521 Label
+@subsection occt_draw_5_2 Basic commands
-Syntax: Label docname entry
+@subsubsection occt_draw_5_2_1 Label
-Creates the label expressed by **entry** if it does not exist.
-**Example:**
+Syntax:
-Label D 0:2
+~~~~~
+Label docname entry
+~~~~~
-@subsubsection occt_2142243456_930384826522 NewChild
+Creates the label expressed by <i><entry></i> if it does not exist.
-Syntax: NewChild docname [taggerlabel = Root label]
+Example
+~~~~~
+Label D 0:2
+~~~~~
-Finds (or creates) a TagSource attribute located at father label of **taggerlabel** and makes a new child label.
-**Example:**
+@subsubsection occt_draw_5_2_2 NewChild
-# Create new child of root label
-NewChild D
+Syntax:
-# Create new child of existing label
-Label D 0:2
-NewChild D 0:2
+~~~~~
+NewChild docname [taggerlabel = Root label]
+~~~~~
+Finds (or creates) a *TagSource* attribute located at father label of <i><taggerlabel></i> and makes a new child label.
-@subsubsection occt_2142243456_930384826523 Children
+Example
+~~~~~
+# Create new child of root label
+NewChild D
-Syntax: Children docname label
+# Create new child of existing label
+Label D 0:2
+NewChild D 0:2
+~~~~~
-Returns the list of attributes of **label**.
-**Example:**
+@subsubsection occt_draw_5_2_3 Children
-Children D 0:2
+Syntax:
+~~~~~
+Children docname label
+~~~~~
+Returns the list of attributes of label.
-@subsubsection occt_2142243456_930384826524 ForgetAll
+Example
+~~~~~
+Children D 0:2
+~~~~~
-Syntax: ForgetAll docname label
+@subsubsection occt_draw_5_2_4 ForgetAll
-Forgets all attributes of the label.
-**Example:**
+Syntax:
+~~~~~
+ForgetAll docname label
+~~~~~
+Forgets all attributes of the label.
-ForgetAll D 0:2
+Example
+~~~~~
+ForgetAll D 0:2
+~~~~~
-@subsection occt_2142243456_93038482653 Application commands
+@subsubsection occt_draw_5_3 Application commands
-@subsubsection occt_2142243456_930384826531 Main
+@subsubsection occt_draw_5_3_1 Main
-Syntax: Main docname
+Syntax:
+~~~~~
+Main docname
+~~~~~
Returns the main label of the framework.
-**Example:**
+**Example:**
+~~~~~
Main D
+~~~~~
-@subsubsection occt_2142243456_930384826532 UndoLimit
+@subsubsection occt_draw_5_3_2 UndoLimit
-Syntax: UndoLimit docname [value=0]
+Syntax:
+~~~~~
+UndoLimit docname [value=0]
+~~~~~
-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
-**Example:**
+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
+**Example:**
+~~~~~
UndoLimit D 100
+~~~~~
-@subsubsection occt_2142243456_930384826533 Undo
+@subsubsection occt_draw_5_3_3 Undo
-Syntax: Undo docname [value=1]
+Syntax:
+~~~~~
+Undo docname [value=1]
+~~~~~
Undoes **value** steps.
-**Example:**
+**Example:**
+~~~~~
Undo D
+~~~~~
-@subsubsection occt_2142243456_930384826534 Redo
+@subsubsection occt_draw_5_3_4 Redo
-Syntax: Redo docname [value=1]
+Syntax:
+~~~~~
+Redo docname [value=1]
+~~~~~
-Redoes **value** steps.
+Redoes **value** steps.
+
**Example:**
-
+~~~~~
Redo D
+~~~~~
-@subsubsection occt_2142243456_930384826535 OpenCommand
+@subsubsection occt_draw_5_3_5 OpenCommand
-Syntax: OpenCommand docname
+Syntax:
+~~~~~
+OpenCommand docname
+~~~~~
Opens a new command transaction.
-**Example:**
-OpenCommand D
+**Example:**
+~~~~~
+OpenCommand D
+~~~~~
-@subsubsection occt_2142243456_930384826536 CommitCommand
+@subsubsection occt_draw_5_3_6 CommitCommand
-Syntax: CommitCommand docname
+Syntax:
+~~~~~
+CommitCommand docname
+~~~~~
Commits the Command transaction.
-**Example:**
-CommitCommand D
+**Example:**
+~~~~~
+CommitCommand D
+~~~~~
-@subsubsection occt_2142243456_930384826537 NewCommand
+@subsubsection occt_draw_5_3_7 NewCommand
-Syntax: NewCommand docname
+Syntax:
+~~~~~
+NewCommand docname
+~~~~~
This is a short-cut for Commit and Open transaction.
-**Example:**
+**Example:**
+~~~~~
NewCommand D
+~~~~~
-@subsubsection occt_2142243456_930384826538 AbortCommand
+@subsubsection occt_draw_5_3_8 AbortCommand
-Syntax: AbortCommand docname
+Syntax:
+~~~~~
+AbortCommand docname
+~~~~~
Aborts the Command transaction.
-**Example:**
+**Example:**
+~~~~~
AbortCommand D
+~~~~~
+
+@subsubsection occt_draw_5_3_9 Copy
-@subsubsection occt_2142243456_930384826539 Copy
+Syntax:
+~~~~~
+Copy docname entry Xdocname Xentry
+~~~~~
-Syntax: Copy docname entry Xdocname Xentry
+Copies the contents of *entry* to *Xentry*. No links are registered.
-Copies the contents of **entry** to **Xentry**. No links are registred.
**Example:**
-
+~~~~~
Copy D1 0:2 D2 0:4
+~~~~~
-@subsubsection occt_2142243456_9303848265310 UpdateLink
+@subsubsection occt_draw_5_3_10 UpdateLink
-Syntax: UpdateLink docname [entry]
+Syntax:
+~~~~~
+UpdateLink docname [entry]
+~~~~~
-Updates external reference set at **entry**.
-**Example:**
+Updates external reference set at *entry*.
+**Example:**
+~~~~~
UpdateLink D
+~~~~~
-@subsubsection occt_2142243456_9303848265311 CopyWithLink
+@subsubsection occt_draw_5_3_11 CopyWithLink
-Syntax: CopyWithLink docname entry Xdocname Xentry
+Syntax:
+~~~~~
+CopyWithLink docname entry Xdocname Xentry
+~~~~~
Aborts the Command transaction.
-Copies the content of **entry** to **Xentry**. The link is registred with an Xlink attribute at ** Xentry** label.
+Copies the content of *entry* to *Xentry*. The link is registered with an *Xlink* attribute at *Xentry* label.
+
**Example:**
+~~~~~
+CopyWithLink D1 0:2 D2 0:4
+~~~~~
-CopyWithLink D1 0:2 D2 0:4
+@subsubsection occt_draw_5_3_12 UpdateXLinks
-@subsubsection occt_2142243456_9303848265312 UpdateXLinks
+Syntax:
+~~~~~
+UpdateXLinks docname entry
+~~~~~
-Syntax: UpdateXLinks docname entry
+Sets modifications on labels impacted by external references to the *entry*. The *document* becomes invalid and must be recomputed
-Sets modifications on labels impacted by external references to the **entry**. The **document** becomes invalid and must be recomputed
**Example:**
-
+~~~~~
UpdateXLinks D 0:2
+~~~~~
-@subsubsection occt_2142243456_9303848265313 DumpDocument
+@subsubsection occt_draw_5_3_13 DumpDocument
-Syntax: DumpDocument docname
+Syntax:
+~~~~~
+DumpDocument docname
+~~~~~
-Displays parameters of **docname** document.
-**Example:**
+Displays parameters of *docname* document.
+**Example:**
+~~~~~
DumpDocument D
+~~~~~
+
-@subsection occt_2142243456_93038482654 Data Framework commands
+@subsection occt_draw_5_4 Data Framework commands
-@subsubsection occt_2142243456_930384826541 MakeDF
+@subsubsection occt_draw_5_4_1 MakeDF
-Syntax: MakeDF dfname
+Syntax:
+~~~~~
+MakeDF dfname
+~~~~~
Creates a new data framework.
-**Example:**
+**Example:**
+~~~~~
MakeDF D
+~~~~~
-@subsubsection occt_2142243456_930384826542 ClearDF
+@subsubsection occt_draw_5_4_2 ClearDF
-Syntax: ClearDF dfname
+Syntax:
+~~~~~
+ClearDF dfname
+~~~~~
Clears a data framework.
-**Example:**
+**Example:**
+~~~~~
ClearDF D
+~~~~~
-@subsubsection occt_2142243456_930384826543 CopyDF
+@subsubsection occt_draw_5_4_3 CopyDF
-Syntax: CopyDF dfname1 entry1 [dfname2] entry2
+Syntax:
+~~~~~
+CopyDF dfname1 entry1 [dfname2] entry2
+~~~~~
Copies a data framework.
-**Example:**
+**Example:**
+~~~~~
CopyDF D 0:2 0:4
+~~~~~
-@subsubsection occt_2142243456_930384826544 CopyLabel
+@subsubsection occt_draw_5_4_4 CopyLabel
-Syntax: CopyLabel dfname fromlabel tolablel
+Syntax:
+~~~~~
+CopyLabel dfname fromlabel tolablel
+~~~~~
Copies a label.
-**Example:**
+**Example:**
+~~~~~
CopyLabel D1 0:2 0:4
+~~~~~
-@subsubsection occt_2142243456_930384826545 MiniDumpDF
+@subsubsection occt_draw_5_4_5 MiniDumpDF
-Syntax: MiniDumpDF dfname
+Syntax:
+~~~~~
+MiniDumpDF dfname
+~~~~~
Makes a mini-dump of a data framework.
-**Example:**
+**Example:**
+~~~~~
MiniDumpDF D
+~~~~~
-@subsubsection occt_2142243456_930384826546 XDumpDF
+@subsubsection occt_draw_5_4_6 XDumpDF
-Syntax: XDumpDF dfname
+Syntax:
+~~~~~
+XDumpDF dfname
+~~~~~
Makes an extended dump of a data framework.
+
**Example:**
+~~~~~
+XDumpDF D
+~~~~~
-XDumpDF D
+@subsection occt_draw_5_5 General attributes commands
-@subsection occt_2142243456_93038482655 General attributes commands
+@subsubsection occt_draw_5_5_1 SetInteger
-@subsubsection occt_2142243456_930384826551 SetInteger
+Syntax:
+~~~~~
+SetInteger dfname entry value
+~~~~~
-Syntax: SetInteger dfname entry value
+Finds or creates an Integer attribute at *entry* label and sets *value*.
-Finds or creates an Integer attribute at **entry** label and sets **value**.
**Example:**
-
+~~~~~
SetInteger D 0:2 100
+~~~~~
+
+@subsubsection occt_draw_5_5_2 GetInteger
-@subsubsection occt_2142243456_930384826552 GetInteger
+Syntax:
+~~~~~
+GetInteger dfname entry [drawname]
+~~~~~
-Syntax: GetInteger dfname entry [drawname]
+Gets a value of an Integer attribute at *entry* label and sets it to *drawname* variable, if it is defined.
-Gets a value of an Integer attribute at **entry** label and sets it to **drawname** variable, if it is defined.
**Example:**
-
+~~~~~
GetInteger D 0:2 Int1
+~~~~~
-@subsubsection occt_2142243456_930384826553 SetReal
+@subsubsection occt_draw_5_5_3 SetReal
-Syntax: SetReal dfname entry value
+Syntax:
+~~~~~
+SetReal dfname entry value
+~~~~~
-Finds or creates a Real attribute at **entry** label and sets **value**.
-**Example:**
+Finds or creates a Real attribute at *entry* label and sets *value*.
+**Example:**
+~~~~~
SetReal D 0:2 100.
+~~~~~
-@subsubsection occt_2142243456_930384826554 GetReal
+@subsubsection occt_draw_5_5_4 GetReal
-Syntax: GetReal dfname entry [drawname]
+Syntax:
+~~~~~
+GetReal dfname entry [drawname]
+~~~~~
-Gets a value of a Real attribute at **entry** label and sets it to **drawname** variable, if it is defined.
-**Example:**
+Gets a value of a Real attribute at *entry* label and sets it to *drawname* variable, if it is defined.
+**Example:**
+~~~~~
GetReal D 0:2 Real1
+~~~~~
-@subsubsection occt_2142243456_930384826555 SetIntArray
+@subsubsection occt_draw_5_5_5 SetIntArray
+
+Syntax:
+~~~~~
+SetIntArray dfname entry lower upper value1 value2 …
+~~~~~
-Syntax: SetIntArray dfname entry lower upper value1 value2 …
+Finds or creates an IntegerArray attribute at *entry* label with lower and upper bounds and sets **value1*, *value2*...
-Finds or creates an IntegerArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
**Example:**
+~~~~~
+SetIntArray D 0:2 1 4 100 200 300 400
+~~~~~
-SetIntArray D 0:2 1 4 100 200 300 400
+@subsubsection occt_draw_5_5_6 GetIntArray
-@subsubsection occt_2142243456_930384826556 GetIntArray
+Syntax:
+~~~~~
+GetIntArray dfname entry
+~~~~~
-Syntax: GetIntArray dfname entry
+Gets a value of an *IntegerArray* attribute at *entry* label.
-Gets a value of an IntegerArray attribute at **entry** label.
**Example:**
+~~~~~
+GetIntArray D 0:2
+~~~~~
-GetIntArray D 0:2
+@subsubsection occt_draw_5_5_7 SetRealArray
-@subsubsection occt_2142243456_930384826557 SetRealArray
+Syntax:
+~~~~~
+SetRealArray dfname entry lower upper value1 value2 …
+~~~~~
-Syntax: SetRealArray dfname entry lower upper value1 value2 …
+Finds or creates a RealArray attribute at *entry* label with lower and upper bounds and sets *value1*, *value2*…
-Finds or creates a RealArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
**Example:**
-
+~~~~~
GetRealArray D 0:2 1 4 100. 200. 300. 400.
+~~~~~
+
+@subsubsection occt_draw_5_5_8 GetRealArray
-@subsubsection occt_2142243456_930384826558 GetRealArray
+Syntax:
+~~~~~
+GetRealArray dfname entry
+~~~~~
-Syntax: GetRealArray dfname entry
+Gets a value of a RealArray attribute at *entry* label.
-Gets a value of a RealArray attribute at **entry** label.
**Example:**
-
+~~~~~
GetRealArray D 0:2
+~~~~~
-@subsubsection occt_2142243456_930384826559 SetComment
+@subsubsection occt_draw_5_5_9 SetComment
-Syntax: SetComment dfname entry value
+Syntax:
+~~~~~
+SetComment dfname entry value
+~~~~~
+
+Finds or creates a Comment attribute at *entry* label and sets *value*.
-Finds or creates a Comment attribute at **entry** label and sets **value**.
**Example:**
+~~~~~
+SetComment D 0:2 "My comment"
+~~~~~
-SetComment D 0:2 *My comment*
+@subsubsection occt_draw_5_5_10 GetComment
-@subsubsection occt_2142243456_9303848265510 GetComment
+Syntax:
+~~~~~
+GetComment dfname entry
+~~~~~
-Syntax: GetComment dfname entry
+Gets a value of a Comment attribute at *entry* label.
-Gets a value of a Comment attribute at **entry** label.
**Example:**
+~~~~~
+GetComment D 0:2
+~~~~~
-GetComment D 0:2
+@subsubsection occt_draw_5_5_11 SetExtStringArray
-@subsubsection occt_2142243456_9303848265511 SetExtStringArray
+Syntax:
+~~~~~
+SetExtStringArray dfname entry lower upper value1 value2 …
+~~~~~
-Syntax: SetExtStringArray dfname entry lower upper value1 value2 …
+Finds or creates an *ExtStringArray* attribute at *entry* label with lower and upper bounds and sets *value1*, *value2*…
-Finds or creates an ExtStringArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
**Example:**
+~~~~~
+SetExtStringArray D 0:2 1 3 *string1* *string2* *string3*
+~~~~~
-SetExtStringArray D 0:2 1 3 *string1* *string2* *string3*
+@subsubsection occt_draw_5_5_12 GetExtStringArray
-@subsubsection occt_2142243456_9303848265512 GetExtStringArray
+Syntax:
+~~~~~
+GetExtStringArray dfname entry
+~~~~~
-Syntax: GetExtStringArray dfname entry
+Gets a value of an ExtStringArray attribute at *entry* label.
-Gets a value of an ExtStringArray attribute at **entry** label.
**Example:**
-
+~~~~~
GetExtStringArray D 0:2
+~~~~~
-@subsubsection occt_2142243456_9303848265513 SetName
+@subsubsection occt_draw_5_5_13 SetName
-Syntax: SetName dfname entry value
+Syntax:
+~~~~~
+SetName dfname entry value
+~~~~~
-Finds or creates a Name attribute at **entry** label and set **value**.
-**Example:**
+Finds or creates a Name attribute at *entry* label and sets *value*.
+**Example:**
+~~~~~
SetName D 0:2 *My name*
+~~~~~
+
+@subsubsection occt_draw_5_5_14 GetName
-@subsubsection occt_2142243456_9303848265514 GetName
+Syntax:
+~~~~~
+GetName dfname entry
+~~~~~
-Syntax: GetName dfname entry
+Gets a value of a Name attribute at *entry* label.
-Gets a value of a Name attribute at **entry** label.
**Example:**
-
+~~~~~
GetName D 0:2
+~~~~~
-@subsubsection occt_2142243456_9303848265515 SetReference
+@subsubsection occt_draw_5_5_15 SetReference
-Syntax: SetReference dfname entry reference
+Syntax:
+~~~~~
+SetReference dfname entry reference
+~~~~~
-Creates a Reference attribute at **entry** label and sets **reference**.
-**Example:**
+Creates a Reference attribute at *entry* label and sets *reference*.
+**Example:**
+~~~~~
SetReference D 0:2 0:4
+~~~~~
-@subsubsection occt_2142243456_9303848265516 GetReference
+@subsubsection occt_draw_5_5_16 GetReference
+
+Syntax:
+~~~~~
+GetReference dfname entry
+~~~~~
-Syntax: GetReference dfname entry
+Gets a value of a Reference attribute at *entry* label.
-Gets a value of a Reference attribute at **entry** label.
**Example:**
-
+~~~~~
GetReference D 0:2
+~~~~~
-@subsubsection occt_2142243456_9303848265517 SetUAttribute
+@subsubsection occt_draw_5_5_17 SetUAttribute
-Syntax: SetUAttribute dfname entry localGUID
+Syntax:
+~~~~~
+SetUAttribute dfname entry localGUID
+~~~~~
-Creates a UAttribute attribute at **entry** label with **localGUID**.
-**Example:**
+Creates a UAttribute attribute at *entry* label with *localGUID*.
-set localGUID *c73bd076-22ee-11d2-acde-080009dc4422*
+**Example:**
+~~~~~
+set localGUID "c73bd076-22ee-11d2-acde-080009dc4422"
SetUAttribute D 0:2 ${localGUID}
+~~~~~
-@subsubsection occt_2142243456_9303848265518 GetUAttribute
+@subsubsection occt_draw_5_5_18 GetUAttribute
-Syntax: GetUAttribute dfname entry loacalGUID
+Syntax:
+~~~~~
+GetUAttribute dfname entry loacalGUID
+~~~~~
-Finds a UAttribute at **entry** label with **localGUID**.
-**Example:**
+Finds a *UAttribute* at *entry* label with *localGUID*.
-set localGUID *c73bd076-22ee-11d2-acde-080009dc4422*
+**Example:**
+~~~~~
+set localGUID "c73bd076-22ee-11d2-acde-080009dc4422"
GetUAttribute D 0:2 ${localGUID}
+~~~~~
-@subsubsection occt_2142243456_9303848265519 SetFunction
+@subsubsection occt_draw_5_5_19 SetFunction
-Syntax: SetFunction dfname entry ID failure
+Syntax:
+~~~~~
+SetFunction dfname entry ID failure
+~~~~~
-Finds or creates a Function attribute at **entry** label with driver ID and **failure** index.
-**Example:**
+Finds or creates a *Function* attribute at *entry* label with driver ID and *failure* index.
-set ID *c73bd076-22ee-11d2-acde-080009dc4422*
+**Example:**
+~~~~~
+set ID "c73bd076-22ee-11d2-acde-080009dc4422"
SetFunction D 0:2 ${ID} 1
+~~~~~
+
+@subsubsection occt_draw_5_5_20 GetFunction
-@subsubsection occt_2142243456_9303848265520 GetFunction
+Syntax:
+~~~~~
+GetFunction dfname entry ID failure
+~~~~~
-Syntax: GetFunction dfname entry ID failure
+Finds a Function attribute at *entry* label and sets driver ID to *ID* variable and failure index to *failure* variable.
-Finds a Function attribute at **entry** label and sets driver ID to **ID** variable and failure index to **failure** variable.
**Example:**
-
+~~~~~
GetFunction D 0:2 ID failure
+~~~~~
-@subsubsection occt_2142243456_9303848265521 NewShape
+@subsubsection occt_draw_5_5_21 NewShape
-Syntax: NewShape dfname entry [shape]
+Syntax:
+~~~~~
+NewShape dfname entry [shape]
+~~~~~
+Finds or creates a Shape attribute at *entry* label. Creates or updates the associated *NamedShape* attribute by *shape* if *shape* is defined.
-Finds or creates a Shape attribute at **entry** label. Creates or updates the associated NamedShape attribute by **shape** if **shape** is defined.
**Example:**
-
+~~~~~
box b 10 10 10
NewShape D 0:2 b
+~~~~~
-@subsubsection occt_2142243456_9303848265522 SetShape
+@subsubsection occt_draw_5_5_22 SetShape
-Syntax: SetShape dfname entry shape
+Syntax:
+~~~~~
+SetShape dfname entry shape
+~~~~~
-Creates or updates a NamedShape attribute at **entry** label by **shape**.
-**Example:**
+Creates or updates a *NamedShape* attribute at *entry* label by *shape*.
+**Example:**
+~~~~~
box b 10 10 10
SetShape D 0:2 b
+~~~~~
-@subsubsection occt_2142243456_9303848265523 GetShape
+@subsubsection occt_draw_5_5_23 GetShape
-Syntax: GetShape2 dfname entry shape
+Syntax:
+~~~~~
+GetShape2 dfname entry shape
+~~~~~
-Sets a shape from NamedShape attribute associated with **entry** label to **shape** draw variable.
-**Example:**
+Sets a shape from NamedShape attribute associated with *entry* label to *shape* draw variable.
+**Example:**
+~~~~~
GetShape2 D 0:2 b
+~~~~~
-@subsection occt_2142243456_93038482656 Geometric attributes commands
+@subsection occt_draw_5_6 Geometric attributes commands
-@subsubsection occt_2142243456_930384826561 SetPoint
+@subsubsection occt_draw_5_6_1 SetPoint
-Syntax: SetPoint dfname entry point
+Syntax:
+~~~~~
+SetPoint dfname entry point
+~~~~~
-Finds or creates a Point attribute at **entry** label and sets **point** as generated in the associated NamedShape attribute.
-**Example:**
+Finds or creates a Point attribute at *entry* label and sets *point* as generated in the associated *NamedShape* attribute.
+**Example:**
+~~~~~
point p 10 10 10
SetPoint D 0:2 p
+~~~~~
-@subsubsection occt_2142243456_930384826562 GetPoint
+@subsubsection occt_draw_5_6_2 GetPoint
-Syntax: GetPoint dfname entry [drawname]
+Syntax:
+~~~~~
+GetPoint dfname entry [drawname]
+~~~~~
-Gets a vertex from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
-**Example:**
+Gets a vertex from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined.
+**Example:**
+~~~~~
GetPoint D 0:2 p
+~~~~~
-@subsubsection occt_2142243456_930384826563 SetAxis
+@subsubsection occt_draw_5_6_3 SetAxis
+
+Syntax:
+~~~~~
+SetAxis dfname entry axis
+~~~~~
-Syntax: SetAxis dfname entry axis
+Finds or creates an Axis attribute at *entry* label and sets *axis* as generated in the associated *NamedShape* attribute.
-Finds or creates an Axis attribute at **entry** label and sets **axis** as generated in the associated NamedShape attribute.
**Example:**
-
+~~~~~
line l 10 20 30 100 200 300
SetAxis D 0:2 l
+~~~~~
-@subsubsection occt_2142243456_930384826564 GetAxis
+@subsubsection occt_draw_5_6_4 GetAxis
-Syntax: GetAxis dfname entry [drawname]
+Syntax:
+~~~~~
+GetAxis dfname entry [drawname]
+~~~~~
-Gets a line from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
-**Example:**
+Gets a line from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined.
+**Example:**
+~~~~~
GetAxis D 0:2 l
+~~~~~
-@subsubsection occt_2142243456_930384826565 SetPlane
+@subsubsection occt_draw_5_6_5 SetPlane
+
+Syntax:
+~~~~~
+SetPlane dfname entry plane
+~~~~~
-Syntax: SetPlane dfname entry plane
+Finds or creates a Plane attribute at *entry* label and sets *plane* as generated in the associated *NamedShape* attribute.
-Finds or creates a Plane attribute at **entry** label and sets **plane** as generated in the associated NamedShape attribute.
**Example:**
-
+~~~~~
plane pl 10 20 30 –1 0 0
SetPlane D 0:2 pl
+~~~~~
-@subsubsection occt_2142243456_930384826566 GetPlane
+@subsubsection occt_draw_5_6_6 GetPlane
-Syntax: GetPlane dfname entry [drawname]
+Syntax:
+~~~~~
+GetPlane dfname entry [drawname]
+~~~~~
-Gets a plane from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
-**Example:**
+Gets a plane from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined.
+**Example:**
+~~~~~
GetPlane D 0:2 pl
+~~~~~
-@subsubsection occt_2142243456_930384826567 SetGeometry
+@subsubsection occt_draw_5_6_7 SetGeometry
-Syntax: SetGeometry dfname entry [type] [shape]
+Syntax:
+~~~~~
+SetGeometry dfname entry [type] [shape]
+~~~~~
+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*.
-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**.
**Example:**
-
+~~~~~
point p 10 10 10
SetGeometry D 0:2 pnt p
+~~~~~
-@subsubsection occt_2142243456_930384826568 GetGeometryType
+@subsubsection occt_draw_5_6_8 GetGeometryType
-Syntax: GetGeometryType dfname entry
+Syntax:
+~~~~~
+GetGeometryType dfname entry
+~~~~~
-Gets a geometry type from Geometry attribute at **entry** label.
-**Example:**
+Gets a geometry type from Geometry attribute at *entry* label.
+**Example:**
+~~~~~
GetGeometryType D 0:2
+~~~~~
-@subsubsection occt_2142243456_930384826569 SetConstraint
-
-Syntax: SetConstraint dfname entry keyword geometrie [geometrie …]
- SetConstraint dfname entry *plane* geometrie
- SetConstraint dfname entry *value* value
+@subsubsection occt_draw_5_6_9 SetConstraint
-1. Creates a Constraint attribute at **entry** label and sets **keyword** constraint between geometry(ies).
-**keyword** must be one of the following:
-**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**
+Syntax:
+~~~~~
+SetConstraint dfname entry keyword geometrie [geometrie …]
+SetConstraint dfname entry "plane" geometrie
+SetConstraint dfname entry "value" value
+~~~~~
+1. Creates a Constraint attribute at *entry* label and sets *keyword* constraint between geometry(ies).
+*keyword* must be one of the following:
+*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*
2. Sets plane for the existing constraint.
-
3. Sets value for the existing constraint.
+
**Example:**
+~~~~~
+SetConstraint D 0:2 "value" 5
+~~~~~
-SetConstraint D 0:2 *value* 5
+@subsubsection occt_draw_5_6_10 GetConstraint
-@subsubsection occt_2142243456_9303848265610 GetConstraint
+Syntax:
+~~~~~
+GetConstraint dfname entry
+~~~~~
-Syntax: GetConstraint dfname entry
+Dumps a Constraint attribute at *entry* label
-Dumps a Constraint attribute at **entry** label
**Example:**
-
+~~~~~
GetConstraint D 0:2
+~~~~~
+
+@subsubsection occt_draw_5_6_11 SetVariable
-@subsubsection occt_2142243456_9303848265611 SetVariable
+Syntax:
+~~~~~
+SetVariable dfname entry isconstant(0/1) units
+~~~~~
-Syntax: SetVariable dfname entry isconstant(0/1) units
+Creates a Variable attribute at *entry* label and sets *isconstant* flag and *units* as a string.
-Creates a Variable attribute at **entry** label and sets **isconstant** flag and **units** as a string.
**Example:**
+~~~~~
+SetVariable D 0:2 1 "mm"
+~~~~~
-SetVariable D 0:2 1 *mm*
+@subsubsection occt_draw_5_6_12 GetVariable
-@subsubsection occt_2142243456_9303848265612 GetVariable
+Syntax:
+~~~~~
+GetVariable dfname entry isconstant units
+~~~~~
-Syntax: GetVariable dfname entry isconstant units
+Gets an *isconstant* flag and units of a Variable attribute at *entry* label.
-Gets an **isconstant** flag and **units** of a Variable attribute at **entry** label.
**Example:**
-
+~~~~~
GetVariable D 0:2 isconstant units
-puts *IsConstant=${isconstant}*
-puts *Units=${units}*
-
+puts "IsConstant=${isconstant}"
+puts "Units=${units}"
+~~~~~
-@subsection occt_2142243456_93038482657 Tree attributes commands
+@subsection occt_draw_5_7 Tree attributes commands
-@subsubsection occt_2142243456_930384826571 RootNode
+@subsubsection occt_draw_5_7_1 RootNode
-Syntax: RootNode dfname treenodeentry [ID]
+Syntax:
+~~~~~
+RootNode dfname treenodeentry [ID]
+~~~~~
-Returns ultimate father of TreeNode attribute identified by its **treenodeentry** and its **ID** (or default ID, if **ID** is not defined).
+Returns the ultimate father of *TreeNode* attribute identified by its *treenodeentry* and its *ID* (or default ID, if *ID* is not defined).
-@subsubsection occt_2142243456_930384826572 SetNode
+@subsubsection occt_draw_5_7_2 SetNode
-Syntax: SetNode dfname treenodeentry [ID]
+Syntax:
+~~~~~
+SetNode dfname treenodeentry [ID]
+~~~~~
-Creates a TreeNode attribute on the **treenodeentry** label with its tree **ID** (or assigns a default ID, if the **ID** is not defined).
+Creates a *TreeNode* attribute on the *treenodeentry* label with its tree *ID* (or assigns a default ID, if the *ID* is not defined).
-@subsubsection occt_2142243456_930384826573 AppendNode
+@subsubsection occt_draw_5_7_3 AppendNode
-Syntax: AppendNode dfname fatherentry childentry [fatherID]
+Syntax:
+~~~~~
+AppendNode dfname fatherentry childentry [fatherID]
+~~~~~
-Inserts a TreeNode attribute with its tree **fatherID** (or default ID, if **fatherID** is not defined) on **childentry** as last child of **fatherentry**.
+Inserts a *TreeNode* attribute with its tree *fatherID* (or default ID, if *fatherID* is not defined) on *childentry* as last child of *fatherentry*.
-@subsubsection occt_2142243456_930384826574 PrependNode
+@subsubsection occt_draw_5_7_4 PrependNode
-Syntax: PrependNode dfname fatherentry childentry [fatherID]
+Syntax:
+~~~~~
+PrependNode dfname fatherentry childentry [fatherID]
+~~~~~
-Inserts a TreeNode attribute with its tree **fatherID** (or default ID, if **fatherID** is not defined) on **childentry** as first child of **fatherentry**.
+Inserts a *TreeNode* attribute with its tree *fatherID* (or default ID, if *fatherID* is not defined) on *childentry* as first child of *fatherentry*.
-@subsubsection occt_2142243456_930384826575 InsertNodeBefore
+@subsubsection occt_draw_5_7_5 InsertNodeBefore
-Syntax: InsertNodeBefore dfname treenodeentry beforetreenode [ID]
+Syntax:
+~~~~~
+InsertNodeBefore dfname treenodeentry beforetreenode [ID]
+~~~~~
-Inserts a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) **beforetreenode** before **treenodeentry**.
+Inserts a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) *beforetreenode* before *treenodeentry*.
-@subsubsection occt_2142243456_930384826576 InsertNodeAfter
+@subsubsection occt_draw_5_7_6 InsertNodeAfter
-Syntax: InsertNodeAfter dfname treenodeentry aftertreenode [ID]
+Syntax:
+~~~~~
+InsertNodeAfter dfname treenodeentry aftertreenode [ID]
+~~~~~
-Inserts a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) **aftertreenode** after **treenodeentry**.
+Inserts a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) *aftertreenode* after *treenodeentry*.
-@subsubsection occt_2142243456_930384826577 DetachNode
+@subsubsection occt_draw_5_7_7 DetachNode
-Syntax: DetachNode dfname treenodeentry [ID]
+Syntax:
+~~~~~
+DetachNode dfname treenodeentry [ID]
+~~~~~
-Removes a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) from **treenodeentry**.
+Removes a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) from *treenodeentry*.
-@subsubsection occt_2142243456_930384826578 ChildNodeIterate
+@subsubsection occt_draw_5_7_8 ChildNodeIterate
-Syntax: ChildNodeIterate dfname treenodeentry alllevels(0/1) [ID]
+Syntax:
+~~~~~
+ChildNodeIterate dfname treenodeentry alllevels(0/1) [ID]
+~~~~~
-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.
+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.
+
**Example:**
-
+~~~~~
Label D 0:2
Label D 0:3
Label D 0:4
==0:7
==0:6
==0:5
+~~~~~
+
+@subsubsection occt_draw_5_7_9 InitChildNodeIterator
-@subsubsection occt_2142243456_930384826579 InitChildNodeIterator
+Syntax:
+~~~~~
+InitChildNodeIterator dfname treenodeentry alllevels(0/1) [ID]
+~~~~~
-Syntax: InitChildNodeIterator dfname treenodeentry alllevels(0/1) [ID]
+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.
-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.
**Example:**
-
+~~~~~
InitChildNodeIterate D 0:5 1
set aChildNumber 0
for {set i 1} {$i 100} {incr i} {
ChildNodeNext
}
}
-puts *aChildNumber=$aChildNumber*
+puts "aChildNumber=$aChildNumber"
+~~~~~
-@subsubsection occt_2142243456_9303848265710 ChildNodeMore
+@subsubsection occt_draw_5_7_10 ChildNodeMore
-Syntax: ChildNodeMore
+Syntax:
+~~~~~
+ChildNodeMore
+~~~~~
Returns TRUE if there is a current item in the iteration.
-@subsubsection occt_2142243456_9303848265711 ChildNodeNext
+@subsubsection occt_draw_5_7_11 ChildNodeNext
-Syntax: ChildNodeNext
+Syntax:
+~~~~~
+ChildNodeNext
+~~~~~
Moves to the next Item.
-@subsubsection occt_2142243456_9303848265712 ChildNodeValue
+@subsubsection occt_draw_5_7_12 ChildNodeValue
+
+Syntax:
+~~~~~
+ChildNodeValue
+~~~~~
-Syntax: ChildNodeValue
+Returns the current treenode of *ChildNodeIterator*.
-Returns the current treenode of ChildNodeIterator.
+@subsubsection occt_draw_5_7_13 ChildNodeNextBrother
-@subsubsection occt_2142243456_9303848265713 ChildNodeNextBrother
+Syntax:
+~~~~~
+ChildNodeNextBrother
+~~~~~
-Syntax: ChildNodeNextBrother
+Moves to the next *Brother*. If there is none, goes up. This method is interesting only with *allLevels* behavior.
-Moves to the next Brother. If there is none, goes up. This method is interesting only with ;allLevels; behavior.
+@subsection occt_draw_5_8 Standard presentation commands
-@subsection occt_2142243456_93038482658 Standard presentation commands
+@subsubsection occt_draw_5_8_1 AISInitViewer
-@subsubsection occt_2142243456_930384826581 AISInitViewer
+Syntax:
+~~~~~
+AISInitViewer docname
+~~~~~
-Syntax: AISInitViewer docname
+Creates and sets *AISViewer* attribute at root label, creates AIS viewer window.
-Creates and sets AISViewer attribute at root label, creates AIS viewer window.
**Example:**
-
+~~~~~
AISInitViewer D
+~~~~~
-@subsubsection occt_2142243456_930384826582 AISRepaint
+@subsubsection occt_draw_5_8_2 AISRepaint
-Syntax: AISRepaint docname
+Syntax:
+~~~~~
+AISRepaint docname
+~~~~~
Updates the AIS viewer window.
-**Example:**
+**Example:**
+~~~~~
AISRepaint D
+~~~~~
-@subsubsection occt_2142243456_930384826583 AISDisplay
+@subsubsection occt_draw_5_8_3 AISDisplay
-Syntax: AISDisplay docname entry [not_update]
+Syntax:
+~~~~~
+AISDisplay docname entry [not_update]
+~~~~~
+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.
-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.
**Example:**
-
+~~~~~
AISDisplay D 0:5
+~~~~~
-@subsubsection occt_2142243456_930384826584 AISUpdate
+@subsubsection occt_draw_5_8_4 AISUpdate
-Syntax: AISUpdate docname entry
+Syntax:
+~~~~~
+AISUpdate docname entry
+~~~~~
-Recomputes a presantation of AISobject from **entry** label and applies the visualization setting in AIS viewer.
-**Example:**
+Recomputes a presentation of *AISobject* from *entry* label and applies the visualization setting in AIS viewer.
+**Example:**
+~~~~~
AISUpdate D 0:5
+~~~~~
-@subsubsection occt_2142243456_930384826585 AISErase
+@subsubsection occt_draw_5_8_5 AISErase
+
+Syntax:
+~~~~~
+AISErase docname entry
+~~~~~
-Syntax: AISErase docname entry
+Erases *AISobject* of *entry* label in AIS viewer.
-Erases AISobject of **entry** label in AIS viewer.
**Example:**
-
+~~~~~
AISErase D 0:5
+~~~~~
-@subsubsection occt_2142243456_930384826586 AISRemove
+@subsubsection occt_draw_5_8_6 AISRemove
-Syntax: AISRemove docname entry
+Syntax:
+~~~~~
+AISRemove docname entry
+~~~~~
-Erases AISobject of **entry** label in AIS viewer, then AISobject is removed from AIS_InteractiveContext.
-**Example:**
+Erases *AISobject* of *entry* label in AIS viewer, then *AISobject* is removed from *AIS_InteractiveContext*.
+**Example:**
+~~~~~
AISRemove D 0:5
+~~~~~
-@subsubsection occt_2142243456_930384826587 AISSet
+@subsubsection occt_draw_5_8_7 AISSet
-Syntax: AISSet docname entry ID
+Syntax:
+~~~~~
+AISSet docname entry ID
+~~~~~
+Creates *AISPresentation* attribute at *entry* label and sets as driver ID. ID must be one of the following: *A* (*axis*), *C* (*constraint*), *NS* (*namedshape*), *G* (*geometry*), *PL* (*plane*), *PT* (*point*).
-Creates AISPresentation attribute at **entry** label and sets as driver ID. ID must be one of the following: **A** (axis), **C** (constraint), **NS** (namedshape), **G** (geometry), **PL** (plane), **PT** (point).
**Example:**
-
+~~~~~
AISSet D 0:5 NS
+~~~~~
-@subsubsection occt_2142243456_930384826588 AISDriver
+@subsubsection occt_draw_5_8_8 AISDriver
-Syntax: AISDriver docname entry [ID]
+Syntax:
+~~~~~
+AISDriver docname entry [ID]
+~~~~~
+Returns DriverGUID stored in *AISPresentation* attribute of an *entry* label or sets a new one. ID must be one of the following: *A* (*axis*), *C* (*constraint*), *NS* (*namedshape*), *G* (*geometry*), *PL* (*plane*), *PT* (*point*).
-Returns DriverGUID stored in AISPresentation attribute of an **entry** label or sets a new one. ID must be one of the following: **A** (axis), **C** (constraint), **NS** (namedshape), **G** (geometry), **PL** (plane), **PT** (point).
**Example:**
-
+~~~~~
# Get Driver GUID
AISDriver D 0:5
+~~~~~
-@subsubsection occt_2142243456_930384826589 AISUnset
+@subsubsection occt_draw_5_8_9 AISUnset
-Syntax: AISUnset docname entry
+Syntax:
+~~~~~
+AISUnset docname entry
+~~~~~
-Deletes AISPresentation attribute (if it exists) of an **entry** label.
-**Example:**
+Deletes *AISPresentation* attribute (if it exists) of an *entry* label.
+**Example:**
+~~~~~
AISUnset D 0:5
+~~~~~
-@subsubsection occt_2142243456_9303848265810 AISTransparency
+@subsubsection occt_draw_5_8_10 AISTransparency
+
+Syntax:
+~~~~~
+AISTransparency docname entry [transparency]
+~~~~~
-Syntax: AISTransparency docname entry [transparency]
+Sets (if *transparency* is defined) or gets the value of transparency for *AISPresentation* attribute of an *entry* label.
-Sets (if **transparency** is defined) or gets the value of transparency for AISPresentation attribute of an **entry** label.
**Example:**
-
+~~~~~
AISTransparency D 0:5 0.5
+~~~~~
-@subsubsection occt_2142243456_9303848265811 AISHasOwnTransparency
+@subsubsection occt_draw_5_8_11 AISHasOwnTransparency
-Syntax: AISHasOwnTransparency docname entry
+Syntax:
+~~~~~
+AISHasOwnTransparency docname entry
+~~~~~
-Tests AISPresentation attribute of an **entry** label by own transparency.
-**Example:**
+Tests *AISPresentation* attribute of an *entry* label by own transparency.
+**Example:**
+~~~~~
AISHasOwnTransparency D 0:5
+~~~~~
-@subsubsection occt_2142243456_9303848265812 AISMaterial
+@subsubsection occt_draw_5_8_12 AISMaterial
-Syntax: AISMaterial docname entry [material]
+Syntax:
+~~~~~
+AISMaterial docname entry [material]
+~~~~~
+Sets (if *material* is defined) or gets the value of transparency for *AISPresentation* attribute of an *entry* label. *material* is integer from 0 to 20 (see <a href="#occt_draw_4_5_6">meshmat</a> command).
-Sets (if **material** is defined) or gets the value of transparency for AISPresentation attribute of an **entry** label. **material** is integer from 0 to 20 (see **meshmat**).
**Example:**
-
+~~~~~
AISMaterial D 0:5 5
+~~~~~
+
+@subsubsection occt_draw_5_8_13 AISHasOwnMaterial
-@subsubsection occt_2142243456_9303848265813 AISHasOwnMaterial
+Syntax:
+~~~~~
+AISHasOwnMaterial docname entry
+~~~~~
-Syntax: AISHasOwnMaterial docname entry
+Tests *AISPresentation* attribute of an *entry* label by own material.
-Tests AISPresentation attribute of an **entry** label by own material.
**Example:**
-
+~~~~~
AISHasOwnMaterial D 0:5
+~~~~~
-@subsubsection occt_2142243456_9303848265814 AISColor
+@subsubsection occt_draw_5_8_14 AISColor
-Syntax: AISColor docname entry [color]
+Syntax:
+~~~~~
+AISColor docname entry [color]
+~~~~~
-Sets (if **color** is defined) or gets value of color for AISPresentation attribute of an **entry** label. **color** is integer from 0 to 516 (see color names in **vsetcolor**).
-**Example:**
+Sets (if *color* is defined) or gets value of color for *AISPresentation* attribute of an *entry* label. *color* is integer from 0 to 516 (see color names in *vsetcolor*).
+**Example:**
+~~~~~
AISColor D 0:5 25
+~~~~~
+
+@subsubsection occt_draw_5_8_15 AISHasOwnColor
-@subsubsection occt_2142243456_9303848265815 AISHasOwnColor
+Syntax:
+~~~~~
+AISHasOwnColor docname entry
+~~~~~
-Syntax: AISHasOwnColor docname entry
+Tests *AISPresentation* attribute of an *entry* label by own color.
-Tests AISPresentation attribute of an **entry** label by own color.
**Example:**
-
+~~~~~
AISHasOwnColor D 0:5
+~~~~~
+@section occt_draw_6 Geometry commands
-@section occt_2142243456_1101404852 Geometry commands
-
-@subsection occt_2142243456_110140485261 Overview
+@subsection occt_draw_6_1 Overview
-Draw provides a set of commands to test geometry libraries. These commands are found in the TGEOMETRY executable, or in any Draw executable which includes GeometryTest commands.
+Draw provides a set of commands to test geometry libraries. These commands are found in the TGEOMETRY executable, or in any Draw executable which includes *GeometryTest* commands.
In the context of Geometry, Draw includes the following types of variable:
* 2d and 3d points
- * The 2d curve, which corresponds to *Curve *in *Geom2d*.
- * The 3d curve and surface, which correspond to *Curve *and *Surface *in *Geom *<a href="#_ftn2">[2]</a>.
+ * The 2d curve, which corresponds to *Curve* in *Geom2d*.
+ * The 3d curve and surface, which correspond to *Curve* and *Surface* in <a href="user_guides__modeling_data.html#occt_modat_1">Geom package</a>.
-Draw geometric variables never share data; the **copy **command will always make a complete copy of the content of the variable.
+Draw geometric variables never share data; the *copy* command will always make a complete copy of the content of the variable.
The following topics are covered in the nine sections of this chapter:
* **Constraints** concerns construction of 2d circles and lines by constraints such as tangency.
* **Display** describes commands to control the display of curves and surfaces.
-Where possible, the commands have been made broad in application, i.e. they apply to 2d curves, 3d curves and surfaces. For instance, the **circle **command may create a 2d or a 3d circle depending on the number of arguments given.
+Where possible, the commands have been made broad in application, i.e. they apply to 2d curves, 3d curves and surfaces. For instance, the *circle* command may create a 2d or a 3d circle depending on the number of arguments given.
-Likewise, the **translate **command will process points, curves or surfaces, depending on argument type. You may not always find the specific command you are looking for in the section where you expect it to be. In that case, look in another section. The **trim **command, for example, is described in the surface section. It can, nonetheless, be used with curves as well.
+Likewise, the *translate* command will process points, curves or surfaces, depending on argument type. You may not always find the specific command you are looking for in the section where you expect it to be. In that case, look in another section. The *trim* command, for example, is described in the surface section. It can, nonetheless, be used with curves as well.
-@subsection occt_2142243456_110140485262 Curve creation
+@subsection occt_draw_6_2 Curve creation
This section deals with both points and curves. Types of curves are:
* Analytical curves such as lines, circles, ellipses, parabolas, and hyperbolas.
* Polar curves such as bezier curves and bspline curves.
- * Trimmed curves and offset curves made from other curves with the **trim **and **offset **commands. Because they are used on both curves and surfaces, the **trim** and **offset** commands are described in the *surface creation *section.
- * NURBS can be created from other curves using **convert **in the *Surface Creation *section.
- * Curves can be created from the isoparametric lines of surfaces by the **uiso **and **viso **commands.
- * 3d curves can be created from 2d curves and vice versa using the **to3d **and **to2d **commands. The **project **command computes a 2d curve on a 3d surface.
+ * Trimmed curves and offset curves made from other curves with the *trim* and *offset* commands. Because they are used on both curves and surfaces, the *trim* and *offset* commands are described in the *surface creation* section.
+ * NURBS can be created from other curves using *convert* in the *Surface Creation* section.
+ * Curves can be created from the isoparametric lines of surfaces by the *uiso* and *viso* commands.
+ * 3d curves can be created from 2d curves and vice versa using the *to3d* and *to2d* commands. The *project* command computes a 2d curve on a 3d surface.
Curves are displayed with an arrow showing the last parameter.
-@subsubsection occt_2142243456_1101404852621 point
+@subsubsection occt_draw_6_2_1 point
- @verbatim
- Syntax: point name x y [z]
- @endverbatim
+Syntax:
+~~~~~
+point name x y [z]
+~~~~~
-**point** creates a 2d or 3d point, depending on the number of arguments. **Example:**
+Creates a 2d or 3d point, depending on the number of arguments.
- @verbatim
- # 2d point
- point p1 1 2
+**Example:**
+~~~~~
+# 2d point
+point p1 1 2
- # 3d point
- point p2 10 20 -5
- @endverbatim
+# 3d point
+point p2 10 20 -5
+~~~~~
-@subsubsection occt_2142243456_1101404852622 line
+@subsubsection occt_draw_6_2_2 line
+
+Syntax:
+~~~~~
+line name x y [z] dx dy [dz]
+~~~~~
- @verbatim
- Syntax: line name x y [z] dx dy [dz]
- @endverbatim
-**line** creates a 2d or 3d line. x y z are the coordinates of the line’s point of origin; dx, dy, dz give the direction vector.
+Creates a 2d or 3d line. *x y z* are the coordinates of the line’s point of origin; *dx, dy, dz* give the direction vector.
-A 2d line will be represented asl x y dx dy, and a 3d line asl x y z dx dy dz. A line is parameterized along its length starting from the point of origin along the direction vector. The direction vector is normalized and must not be null. Lines are infinite, even though their representation is not. **Example:**
+A 2d line will be represented as *x y dx dy*, and a 3d line as *x y z dx dy dz* . A line is parameterized along its length starting from the point of origin along the direction vector. The direction vector is normalized and must not be null. Lines are infinite, even though their representation is not.
- @verbatim
- # a 2d line at 45 degrees of the X axis
- line l 2 0 1 1
+**Example:**
+~~~~~
+# a 2d line at 45 degrees of the X axis
+line l 2 0 1 1
- # a 3d line through the point 10 0 0 and parallel to Z
- line l 10 0 0 0 0 1
- @endverbatim
+# a 3d line through the point 10 0 0 and parallel to Z
+line l 10 0 0 0 0 1
+~~~~~
-@subsubsection occt_2142243456_1101404852623 circle
+@subsubsection occt_draw_6_2_3 circle
-Syntax: circle name x y [z [dx dy dz]] [ux uy [uz]] radius
+Syntax:
+~~~~~
+circle name x y [z [dx dy dz]] [ux uy [uz]] radius
+~~~~~
-**circle **creates a 2d or a 3d circle.
+Creates a 2d or a 3d circle.
-In 2d, x, y are the coordinates of the center and ux, uy define the vector towards the point of origin of the parameters. By default, this direction is (1,0). The X Axis of the local coordinate system defines the origin of the parameters of the circle. Use another vector than the x axis to change the origin of parameters.
+In 2d, *x, y* are the coordinates of the center and *ux, uy* define the vector towards the point of origin of the parameters. By default, this direction is (1,0). The X Axis of the local coordinate system defines the origin of the parameters of the circle. Use another vector than the x axis to change the origin of parameters.
-In 3d, x, y, z are the coordinates of the center; dx, dy, dz give the vector normal to the plane of the circle. By default, this vector is (0,0,1) i.e. the Z axis (it must not be null). ux, uy, uz is the direction of the origin; if not given, a default direction will be computed. This vector must neither be null nor parallel to dx, dy, dz.
+In 3d, *x, y, z* are the coordinates of the center; *dx, dy, dz* give the vector normal to the plane of the circle. By default, this vector is (0,0,1) i.e. the Z axis (it must not be null). *ux, uy, uz* is the direction of the origin; if not given, a default direction will be computed. This vector must neither be null nor parallel to *dx, dy, dz*.
The circle is parameterized by the angle in [0,2*pi] starting from the origin and. Note that the specification of origin direction and plane is the same for all analytical curves and surfaces.
**Example:**
-
+~~~~~
# A 2d circle of radius 5 centered at 10,-2
circle c1 10 -2 5
# full 3d circle, axis X, origin on Z
circle c5 10 20 -5 1 0 0 0 0 1 17
+~~~~~
+@subsubsection occt_draw_6_2_4 ellipse
-@subsubsection occt_2142243456_1101404852624 ellipse
+Syntax:
+~~~~~
+ellipse name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius
+~~~~~
-Syntax: ellipse name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius **ellipse **creates a 2d or 3d ellipse. In a 2d ellipse, the first two arguments define the center; in a 3d ellipse, the first three. The axis system is given by *firstradius*, the major radius, and *secondradius*, the minor radius. The parameter range of the ellipse is [0,2.*pi] starting from the X axis and going towards the Y axis. The Draw ellipse is parameterized by an angle:
+Creates a 2d or 3d ellipse. In a 2d ellipse, the first two arguments define the center; in a 3d ellipse, the first three. The axis system is given by *firstradius*, the major radius, and *secondradius*, the minor radius. The parameter range of the ellipse is [0,2.*pi] starting from the X axis and going towards the Y axis. The Draw ellipse is parameterized by an angle:
+~~~~~
P(u) = O + firstradius*cos(u)*Xdir + secondradius*sin(u)*Ydir
-
+~~~~~
where:
- * P is the point of parameter u,
- * O, Xdir and Ydir are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system.
+ * P is the point of parameter *u*,
+ * *O, Xdir* and *Ydir* are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system.
+
**Example:**
-
+~~~~~
# default 2d ellipse
ellipse e1 10 5 20 10
# 3d ellipse in the X,Z plane with axis 1, 0 ,1
ellipse e4 0 0 0 0 1 0 1 0 1 25 5
+~~~~~
-See also: **circle**
-@subsubsection occt_2142243456_1101404852625 hyperbola
+@subsubsection occt_draw_6_2_5 hyperbola
-Syntax: hyperbola name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius
+Syntax:
+~~~~~
+hyperbola name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius
+~~~~~
-**hyperbola **creates a 2d or 3d conic. The first arguments define the center. The axis system is given by *firstradius*, the major radius, and *secondradius*, the minor radius. Note that the hyperbola has only one branch, that in the X direction.
+Creates a 2d or 3d conic. The first arguments define the center. The axis system is given by *firstradius*, the major radius, and *secondradius*, the minor radius. Note that the hyperbola has only one branch, that in the X direction.
The Draw hyperbola is parameterized as follows:
-
+~~~~~
P(U) = O + firstradius*Cosh(U)*XDir + secondradius*Sinh(U)*YDir
-
+~~~~~
where:
- * P is the point of parameter U,
- * O, XDir and YDir are respectively the origin, *X Direction* and *Y
+ * *P* is the point of parameter *U*,
+ * *O, XDir* and *YDir* are respectively the origin, *X Direction* and *YDirection* of its local coordinate system.
-Direction* of its local coordinate system.
**Example:**
-
+~~~~~
# default 2d hyperbola, with asymptotes 1,1 -1,1
hyperbola h1 0 0 30 30
# 3d hyperbola, in the XY plane
hyperbola h3 0 0 0 50 50
+~~~~~
-See also: **circle**
-
-
-@subsubsection occt_2142243456_1101404852626 parabola
+@subsubsection occt_draw_6_2_6 parabola
-Syntax: parabola name x y [z [dx dy dz]] [ux uy [uz]] FocalLength
+Syntax:
+~~~~~
+parabola name x y [z [dx dy dz]] [ux uy [uz]] FocalLength
+~~~~~
-**parabola **creates a 2d or 3d parabola. in the axis system defined by the first arguments.The origin is the apex of the parabola.
+Creates a 2d or 3d parabola. in the axis system defined by the first arguments. The origin is the apex of the parabola.
-The Geom_Parabola parabola is parameterized as follows:
+The *Geom_Parabola* is parameterized as follows:
+~~~~~
P(u) = O + u*u/(4.*F)*XDir + u*YDir
+~~~~~
where:
- * P is the point of parameter u,
- * O, XDir and YDir are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system,
- * F is the focal length of the parabola.
-**Example:**
+ * *P* is the point of parameter *u*,
+ * *O, XDir* and *YDir* are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system,
+ * *F* is the focal length of the parabola.
+**Example:**
+~~~~~
# 2d parabola
parabola p1 0 0 50
# 3d parabola in the Y-Z plane, convexity +Z
parabola p3 0 0 0 1 0 0 0 0 1 50
+~~~~~
-See also: **circle**
-
+@subsubsection occt_draw_6_2_7 beziercurve, dbeziercurve
-@subsubsection occt_2142243456_1101404852627 beziercurve, dbeziercurve
+Syntax:
+~~~~~
+beziercurve name nbpole pole, [weight]
+2dbeziercurve name nbpole pole, [weight]
+~~~~~
-Syntax: beziercurve name nbpole pole, [weight]
-2dbeziercurve name nbpole pole, [weight]
+Creates a 3d rational or non-rational Bezier curve. Give the number of poles (control points,) and the coordinates of the poles *(x1 y1 z1 [w1] x2 y2 z2 [w2])*. The degree will be *nbpoles-1*. To create a rational curve, give weights with the poles. You must give weights for all poles or for none. If the weights of all the poles are equal, the curve is polynomial, and therefore non-rational.
-**beziercurve **creates a 3d rational or non-rational Bezier curve. Give the number of poles (control points,) and the coordinates of the poles (x1 y1 z1 [w1] x2 y2 z2 [w2]). The degree will be nbpoles-1. To create a rational curve, give weights with the poles. You must give weights for all poles or for none. If the weights of all the poles are equal, the curve is polynomial, and therefore non-rational.
**Example:**
-
+~~~~~
# a rational 2d bezier curve (arc of circle)
2dbeziercurve ci 3 0 0 1 10 0 sqrt(2.)/2. 10 10 1
# a 3d bezier curve, not rational
beziercurve cc 4 0 0 0 10 0 0 10 0 10 10 10 10
+~~~~~
+@subsubsection occt_draw_6_2_8 bsplinecurve, dbsplinecurve, pbsplinecurve, dpbsplinecurve
-@subsubsection occt_2142243456_1101404852628 bsplinecurve, dbsplinecurve, pbsplinecurve, dpbsplinecurve
+Syntax:
+~~~~~
+bsplinecurve name degree nbknots knot, umult pole, weight 2dbsplinecurve name degree nbknots knot, umult pole, weight pbsplinecurve name degree nbknots knot, umult pole, weight(periodic)
-Syntax: bsplinecurve name degree nbknots knot, umult pole, weight 2dbsplinecurve name degree nbknots knot, umult pole, weight pbsplinecurve name degree nbknots knot, umult pole, weight(periodic)
2dpbsplinecurve name degree nbknots knot, umult pole, weight (periodic)
+~~~~~
-**bsplinecurve **creates 2d or 3d bspline curves; the **pbsplinecurve **and **2dpbsplinecurve **commands create periodic bspline curves.
+Creates 2d or 3d bspline curves; the **pbsplinecurve** and **2dpbsplinecurve** commands create periodic bspline curves.
A bspline curve is defined by its degree, its periodic or non-periodic nature, a table of knots and a table of poles (i.e. control points). Consequently, specify the degree, the number of knots, and for each knot, the multiplicity, for each pole, the weight. In the syntax above, the commas link the adjacent arguments which they fall between: knot and multiplicities, pole and weight.
* For a non periodic curve: Sum of multiplicities - degree + 1
* For a periodic curve: Sum of multiplicities - last multiplicity
-**Example:**
+**Example:**
+~~~~~
# a bspline curve with 4 poles and 3 knots
bsplinecurve bc 2 3 0 3 1 1 2 3 \
10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1
-0.25 h/6 1 \
-0.5 -h/3 0.5 \
0 -h/3 1
+~~~~~
-<h4>NOTE</h4>
-*You can create the **NURBS **subset of bspline curves and*
-*surfaces by trimming analytical curves and surfaces and*
-*executing the command *convert*; see below.*
+**Note** that you can create the **NURBS** subset of bspline curves and surfaces by trimming analytical curves and surfaces and executing the command *convert*.
-@subsubsection occt_2142243456_1101404852629 uiso, viso
+@subsubsection occt_draw_6_2_9 uiso, viso
-Syntax: uiso name surface u
+Syntax:
+~~~~~
+uiso name surface u
viso name surface u
+~~~~~
-Use these commands to create a U or V isoparametric curve from a surface.
-**Example:**
+Creates a U or V isoparametric curve from a surface.
+**Example:**
+~~~~~
# create a cylinder and extract iso curves
cylinder c 10
uiso c1 c pi/6
viso c2 c
+~~~~~
-*NOTE*
-*Cannot be done from offset surfaces.*
+**Note** that this cannot be done from offset surfaces.
-@subsubsection occt_2142243456_11014048526210 tod, tod
+@subsubsection occt_draw_6_2_10 tod, tod
-Syntax: to3d name curve2d [plane]
+Syntax:
+~~~~~
+to3d name curve2d [plane]
to2d name curve3d [plane]
+~~~~~
-The **to3d **and **to2d **commands are used to create respectively a 3d curve from a 2d curve and a 2d curve from a 3d curve. The transformation uses a planar surface to define the XY plane in 3d (by default this plane is the default OXYplane). **to3d **always gives a correct result, but as **to2d **is not a projection, it may surprise you. It is always correct if the curve is planar and parallel to the plane of projection. The points defining the curve are projected on the plane. A circle, however, will remain a circle and will not be changed to an ellipse.
-**Example:**
+Create respectively a 3d curve from a 2d curve and a 2d curve from a 3d curve. The transformation uses a planar surface to define the XY plane in 3d (by default this plane is the default OXYplane). **to3d** always gives a correct result, but as **to2d** is not a projection, it may surprise you. It is always correct if the curve is planar and parallel to the plane of projection. The points defining the curve are projected on the plane. A circle, however, will remain a circle and will not be changed to an ellipse.
+**Example:**
+~~~~~
# the following commands
circle c 0 0 5
plane p -2 1 0 1 2 3
# will create the same circle as
circle c -2 1 0 1 2 3 5
+~~~~~
See also: **project**
-@subsubsection occt_2142243456_11014048526211 project
+@subsubsection occt_draw_6_2_11 project
+
+Syntax:
+~~~~~
+project name curve3d surface
+~~~~~
-Syntax: project name curve3d surface
+Computes a 2d curve in the parametric space of a surface corresponding to a 3d curve. This can only be used on analytical surfaces.
-**project **computes a 2d curve in the parametric space of a surface corresponding to a 3d curve. This can only be used on analytical surfaces.
-**Example:**
+If we, for example, intersect a cylinder and a plane and project the resulting ellipse on the cylinder, this will create a 2d sinusoid-like bspline.
-# intersect a cylinder and a plane
-# and project the resulting ellipse on the cylinder
-# this will create a 2d sinusoid-like bspline
+~~~~~
cylinder c 5
plane p 0 0 0 0 1 1
intersect i c p
project i2d i c
+~~~~~
-@subsection occt_2142243456_110140485263 Surface creation
-
-Types of surfaces are:
+@subsection occt_draw_6_3 Surface creation
- * Analytical surfaces: plane, cylinder, cone, sphere, torus.
- * Polar surfaces: bezier surfaces, bspline surfaces
- * Trimmed and Offset surfaces; see **trim**, **trimu**, **trimv**, **offset**.
- * Surfaces produced by Revolution and Extrusion, created from curves with the **revsurf **and **extsurf**.
+The following types of surfaces exist:
+ * Analytical surfaces: plane, cylinder, cone, sphere, torus;
+ * Polar surfaces: bezier surfaces, bspline surfaces;
+ * Trimmed and Offset surfaces;
+ * Surfaces produced by Revolution and Extrusion, created from curves with the *revsurf* and *extsurf*;
* NURBS surfaces.
Surfaces are displayed with isoparametric lines. To show the parameterization, a small parametric line with a length 1/10 of V is displayed at 1/10 of U.
+@subsubsection occt_draw_6_3_1 plane
+
+Syntax:
+~~~~~
+plane name [x y z [dx dy dz [ux uy uz]]]
+~~~~~
+
+Creates an infinite plane.
-@subsubsection occt_2142243456_1101404852631 plane
+A plane is the same as a 3d coordinate system, *x,y,z* is the origin, *dx, dy, dz* is the Z direction and *ux, uy, uz* is the X direction.
-Syntax: plane name [x y z [dx dy dz [ux uy uz]]]
+The plane is perpendicular to Z and X is the U parameter. *dx,dy,dz* and *ux,uy,uz* must not be null or collinear. *ux,uy,uz* will be modified to be orthogonal to *dx,dy,dz*.
-Uses this command to create an infinite plane. A plane is the same as a 3d coordinate system, x,y,z is the origin, dx, dy, dz is the Z direction and ux, uy, uz is the X direction. The plane is perpendicular to Z and X is the U parameter. dx,dy,dz and ux,uy,uz must not be null and not colinear. ux,uy,uz will be modified to be orthogonal to dx,dy,dz. There are default values for the coordinate system. If no arguments are given, the global system (0,0,0), (0,0,1), (1,0,0). If only the origin is given, the axes are those given by default(0,0,1), (1,0,0). If the origin and the Z axis are given, the X axis is generated perpendicular to the Z axis. Note that this definition will be used for all analytical surfaces.
-**Example:**
+There are default values for the coordinate system. If no arguments are given, the global system (0,0,0), (0,0,1), (1,0,0). If only the origin is given, the axes are those given by default(0,0,1), (1,0,0). If the origin and the Z axis are given, the X axis is generated perpendicular to the Z axis.
+
+Note that this definition will be used for all analytical surfaces.
+**Example:**
+~~~~~
# a plane through the point 10,0,0 perpendicular to X
# with U direction on Y
plane p1 10 0 0 1 0 0 0 1 0
# an horixontal plane with origin 10, -20, -5
plane p2 10 -20 -5
+~~~~~
+@subsubsection occt_draw_6_3_2 cylinder
-@subsubsection occt_2142243456_1101404852632 cylinder
-
-Syntax: cylinder name [x y z [dx dy dz [ux uy uz]]] radius
+Syntax:
+~~~~~
+cylinder name [x y z [dx dy dz [ux uy uz]]] radius
+~~~~~
A cylinder is defined by a coordinate system, and a radius. The surface generated is an infinite cylinder with the Z axis as the axis. The U parameter is the angle starting from X going in the Y direction.
-See also: **plane**
-**Example:**
+**Example:**
+~~~~~
# a cylinder on the default Z axis, radius 10
cylinder c1 10
dset lo pi/3. la pi/4.
cylinder c3 0 0 0 cos(la)*cos(lo) cos(la)*sin(lo)
sin(la) 10
+~~~~~
+@subsubsection occt_draw_6_3_3 cone
-@subsubsection occt_2142243456_1101404852633 cone
-
-Syntax: cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius
-
+Syntax:
+~~~~~
+cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius
+~~~~~
Creates a cone in the infinite coordinate system along the Z-axis. The radius is that of the circle at the intersection of the cone and the XY plane. The semi-angle is the angle formed by the cone relative to the axis; it should be between –90 and 90. If the radius is 0, the vertex is the origin.
-See also: **plane**
-**Example:**
+**Example:**
+~~~~~
# a cone at 45 degrees at the origin on Z
cone c1 45 0
# a cone on axis Z with radius r1 at z1 and r2 at z2
cone c2 0 0 z1 180.*atan2(r2-r1,z2-z1)/pi r1
+~~~~~
-@subsubsection occt_2142243456_1101404852634 sphere
+@subsubsection occt_draw_6_3_4 sphere
-Syntax: sphere name [x y z [dx dy dz [ux uy uz]]] radius
+Syntax:
+~~~~~
+sphere name [x y z [dx dy dz [ux uy uz]]] radius
+~~~~~
-Creates a sphere in the local coordinate system defined in the **plane **command. The sphere is centered at the origin. To parameterize the sphere, u is the angle from X to Y, between o and 2*pi. v is the angle in the half-circle at angle u in the plane containing the Z axis. v is between -pi/2 and pi/2. The poles are the points Z = +/- radius; their parameters are u,+/-pi/2 for any u in 0,2*pi.
-**Example:**
+Creates a sphere in the local coordinate system defined in the **plane** command. The sphere is centered at the origin.
+
+To parameterize the sphere, *u* is the angle from X to Y, between 0 and 2*pi. *v* is the angle in the half-circle at angle *u* in the plane containing the Z axis. *v* is between -pi/2 and pi/2. The poles are the points Z = +/- radius; their parameters are u,+/-pi/2 for any u in 0,2*pi.
+
+**Example:**
+~~~~~
# a sphere at the origin
sphere s1 10
# a sphere at 10 10 10, with poles on the axis 1,1,1
sphere s2 10 10 10 1 1 1 10
+~~~~~
-See also: **plane**
-
+@subsubsection occt_draw_6_3_5 torus
-@subsubsection occt_2142243456_1101404852635 torus
+Syntax:
+~~~~~
+torus name [x y z [dx dy dz [ux uy uz]]] major minor
+~~~~~
-Syntax: torus name [x y z [dx dy dz [ux uy uz]]] major minor
+Creates a torus in the local coordinate system with the given major and minor radii. *Z* is the axis for the major radius. The major radius may be lower in value than the minor radius.
-Creates a torus in the local coordinate system with the given major and minor radii. Z is the axis for the major radius. The major radius may be lower in value than the minor radius.
+To parameterize a torus, *u* is the angle from X to Y; *v* is the angle in the plane at angle *u* from the XY plane to Z. *u* and *v* are in 0,2*pi.
-To parameterize a torus, u is the angle from X to Y; v is the angle in the plane at angle u from the XY plane to Z. u and v are in 0,2*pi.
**Example:**
-
+~~~~~
# a torus at the origin
torus t1 20 5
# a torus in another coordinate system
torus t2 10 5 -2 2 1 0 20 5
-
-See also: **plane**
+~~~~~
-@subsubsection occt_2142243456_1101404852636 beziersurf
+@subsubsection occt_draw_6_3_6 beziersurf
-Syntax: beziersurf name nbupoles nbvolpes pole, [weight]
+Syntax:
+~~~~~
+beziersurf name nbupoles nbvolpes pole, [weight]
+~~~~~
Use this command to create a bezier surface, rational or non-rational. First give the numbers of poles in the u and v directions.
-Then give the poles in the following order: pole(1, 1), pole(nbupoles, 1), pole(1, nbvpoles) and pole(nbupoles, nbvpoles).
+Then give the poles in the following order: *pole(1, 1), pole(nbupoles, 1), pole(1, nbvpoles)* and *pole(nbupoles, nbvpoles)*.
Weights may be omitted, but if you give one weight you must give all of them.
-**Example:**
+**Example:**
+~~~~~
# a non-rational degree 2,3 surface
beziersurf s 3 4 \
0 0 0 10 0 5 20 0 0 \
0 10 2 10 10 3 20 10 2 \
0 20 10 10 20 20 20 20 10 \
0 30 0 10 30 0 20 30 0
+~~~~~
-See also: **beziercurve**
-
-@subsubsection occt_2142243456_1101404852637 bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf
+@subsubsection occt_draw_6_3_7 bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf
-Syntax: bsplinesurf name udegree nbuknots uknot umult ... nbvknot vknot
+Syntax:
+~~~~~
+bsplinesurf name udegree nbuknots uknot umult ... nbvknot vknot
vmult ... x y z w ...
upbsplinesurf ...
vpbsplinesurf ...
uvpbsplinesurf ...
+~~~~~
-**bsplinesurf **generates bspline surfaces. **upbsplinesurf **creates a bspline surface periodic in u; **vpbsplinesurf **creates one periodic in v; and **uvpbsplinesurf **creates one periodic in uv.
+* **bsplinesurf** generates bspline surfaces;
+* **upbsplinesurf** creates a bspline surface periodic in u;
+* **vpbsplinesurf** creates one periodic in v;
+* **uvpbsplinesurf** creates one periodic in uv.
-The syntax is similar to the **bsplinecurve **command. First give the degree in u and the knots in u with their multiplicities, then do the same in v. The poles follow. The number of poles is the product of the number in u and the number in v. See **bsplinecurve **to compute the number of poles, the poles are first given in U as in the beziersurf command. You must give weights if the surface is rational.
-**Example:**
+The syntax is similar to the *bsplinecurve* command. First give the degree in u and the knots in u with their multiplicities, then do the same in v. The poles follow. The number of poles is the product of the number in u and the number in v.
+
+See *bsplinecurve* to compute the number of poles, the poles are first given in U as in the *beziersurf* command. You must give weights if the surface is rational.
+**Example:**
+~~~~~
# create a bspline surface of degree 1 2
# with two knots in U and three in V
bsplinesurf s \
0 10 2 1 10 10 3 1 \
0 20 10 1 10 20 20 1 \
0 30 0 1 10 30 0 1
-
-See also: **bsplinecurve**, **beziersurf**, **convert**
+~~~~~
-@subsubsection occt_2142243456_1101404852638 trim, trimu, trimv
+@subsubsection occt_draw_6_3_8 trim, trimu, trimv
-Syntax: trim newname name [u1 u2 [v1 v2]]
+Syntax:
+~~~~~
+trim newname name [u1 u2 [v1 v2]]
trimu newname name
trimv newname name
+~~~~~
-The **trim **commands create trimmed curves or trimmed surfaces. Note that trimmed curves and surfaces are classes of the *Geom *package. The **trim **command creates either a new trimmed curve from a curve or a new trimmed surface in u and v from a surface. **trimu **creates a u-trimmed surface, and **trimv **a v-trimmed surface. After an initial trim, a second execution with no parameters given recreates the basis curve. The curves can be either 2d or 3d. If the trimming parameters decrease and if the curve or surface is not periodic, the direction is reversed.
-<h4>NOTE</h4>
-*Note that a trimmed curve or surface contains a copy of the*
-*basis geometry: modifying that will not modify the trimmed*
-*geometry. Trimming trimmed geometry will not create*
-*multiple levels of trimming. The basis geometry will be used.*
-**Example:**
+The **trim** commands create trimmed curves or trimmed surfaces. Note that trimmed curves and surfaces are classes of the *Geom* package.
+* *trim* creates either a new trimmed curve from a curve or a new trimmed surface in u and v from a surface.
+* *trimu* creates a u-trimmed surface,
+* *trimv* creates a v-trimmed surface.
+After an initial trim, a second execution with no parameters given recreates the basis curve. The curves can be either 2d or 3d. If the trimming parameters decrease and if the curve or surface is not periodic, the direction is reversed.
+
+**Note** that a trimmed curve or surface contains a copy of the basis geometry: modifying that will not modify the trimmed geometry. Trimming trimmed geometry will not create multiple levels of trimming. The basis geometry will be used.
+
+**Example:**
+~~~~~
# create a 3d circle
circle c 0 0 0 10
# trim an infinite cylinder
cylinder cy 10
trimv cy cy 0 50
+~~~~~
-See also: **reverse**
-
-
-@subsubsection occt_2142243456_1101404852639 offset
+@subsubsection occt_draw_6_3_9 offset
-Syntax: offset name basename distance [dx dy dz]
+Syntax:
+~~~~~
+offset name basename distance [dx dy dz]
+~~~~~
Creates offset curves or surfaces at a given distance from a basis curve or surface. Offset curves and surfaces are classes from the *Geom *package.
-The curve can be a 2d or a 3d curve. To compute the offsets for a 3d curve, you must also give a vector dx,dy,dz. For a planar curve, this vector is usually the normal to the plane containing the curve.
+The curve can be a 2d or a 3d curve. To compute the offsets for a 3d curve, you must also give a vector *dx,dy,dz*. For a planar curve, this vector is usually the normal to the plane containing the curve.
The offset curve or surface copies the basic geometry, which can be modified later.
-**Example:**
+**Example:**
+~~~~~
# graphic demonstration that the outline of a torus
# is the offset of an ellipse
smallview +X+Y
ellipse e 0 0 0 50 50*sin(angle)
# note that the distance can be negative
offset l1 e 20 0 0 1
-@subsubsection occt_2142243456_11014048526310 revsurf
+~~~~~
-Syntax: revsurf name curvename x y z dx dy dz
+@subsubsection occt_draw_6_3_10 revsurf
-Creates a surface of revolution from a 3d curve. A surface of revolution or revolved surface is obtained by rotating a curve (called the *meridian*) through a complete revolution about an axis (referred to as the *axis of revolution*). The curve and the axis must be in the same plane (the *reference plane* of the surface). Give the point of origin x,y,z and the vector dx,dy,dz to define the axis of revolution. To parameterize a surface of revolution: u is the angle of rotation around the axis. Its origin is given by the position of the meridian on the surface. v is the parameter of the meridian.
-**Example:**
+Syntax:
+~~~~~
+revsurf name curvename x y z dx dy dz
+~~~~~
+Creates a surface of revolution from a 3d curve.
+
+A surface of revolution or revolved surface is obtained by rotating a curve (called the *meridian*) through a complete revolution about an axis (referred to as the *axis of revolution*). The curve and the axis must be in the same plane (the *reference plane* of the surface). Give the point of origin x,y,z and the vector dx,dy,dz to define the axis of revolution.
+
+To parameterize a surface of revolution: u is the angle of rotation around the axis. Its origin is given by the position of the meridian on the surface. v is the parameter of the meridian.
+
+**Example:**
+~~~~~
# another way of creating a torus like surface
circle c 50 0 0 20
revsurf s c 0 0 0 0 1 0
+~~~~~
+
+@subsubsection occt_draw_6_3*11 extsurf
+
+Syntax:
+~~~~~
+extsurf newname curvename dx dy dz
+~~~~~
+Creates a surface of linear extrusion from a 3d curve. The basis curve is swept in a given direction,the *direction of extrusion* defined by a vector.
-@subsubsection occt_2142243456_11014048526311 extsurf
+In the syntax, *dx,dy,dz* gives the direction of extrusion.
-Syntax: extsurf newname curvename dx dy dz
+To parameterize a surface of extrusion: *u* is the parameter along the extruded curve; the *v* parameter is along the direction of extrusion.
-Use the **extsurf **command to create a surface of linear extrusion from a 3d curve. The basis curve is swept in a given direction,the *direction of extrusion* defined by a vector. In the syntax, dx,dy,dz gives the direction of extrusion. To parameterize a surface of extrusion: u is the parameter along the extruded curve; the v parameter is along the direction of extrusion.
**Example:**
-
+~~~~~
# an elliptic cylinder
ellipse e 0 0 0 10 5
extsurf s e 0 0 1
# to make it finite
trimv s s 0 10
+~~~~~
+@subsubsection occt_draw_6_3_12 convert
-@subsubsection occt_2142243456_11014048526312 convert
-
-Syntax: convert newname name
+Syntax:
+~~~~~
+convert newname name
+~~~~~
-**convert **creates a 2d or 3d NURBS curve or a NURBS surface from any 2d curve, 3d curve or surface. In other words, conics, beziers and bsplines are turned into NURBS. Offsets are not processed.
+Creates a 2d or 3d NURBS curve or a NURBS surface from any 2d curve, 3d curve or surface. In other words, conics, beziers and bsplines are turned into NURBS. Offsets are not processed.
+
**Example:**
-
+~~~~~
# turn a 2d arc of a circle into a 2d NURBS
circle c 0 0 5
trim c c 0 pi/3
plane p
trim p p -1 1 -1 1
convert p1 p
+~~~~~
-<h4>NOTE</h4>
-*Offset curves and surfaces are not treated by this command.*
-
-
+**Note** that offset curves and surfaces are not processed by this command.
-@subsection occt_2142243456_110140485264 Curve and surface modifications
+@subsection occt_draw_6_4 Curve and surface modifications
Draw provides commands to modify curves and surfaces, some of them are general, others restricted to bezier curves or bsplines.
+@subsubsection occt_draw_6_4_1 reverse, ureverse, vreverse
-@subsubsection occt_2142243456_1101404852641 reverse, ureverse, vreverse
-
-
-Syntax: reverse curvename
+Syntax:
+~~~~~
+reverse curvename
ureverse surfacename
vreverse surfacename
+~~~~~
-The **reverse **command reverses the parameterization and inverses the orientation of a 2d or 3d curve. Note that the geometry is modified. To keep the curve or the surface, you must copy it before modification.
+The **reverse** command reverses the parameterization and inverses the orientation of a 2d or 3d curve. Note that the geometry is modified. To keep the curve or the surface, you must copy it before modification.
-**ureverse **or **vreverse **reverse the u or v parameter of a surface. Note that the new parameters of the curve may change according to the type of curve. For instance, they will change sign on a line or stay 0,1 on a bezier.
+**ureverse** or **vreverse** reverse the u or v parameter of a surface. Note that the new parameters of the curve may change according to the type of curve. For instance, they will change sign on a line or stay 0,1 on a bezier.
Reversing a parameter on an analytical surface may create an indirect coordinate system.
-**Example:**
+**Example:**
+~~~~~
# reverse a trimmed 2d circle
circle c 0 0 5
trim c c pi/4 pi/2
# dumping c will show that it is now trimmed between
# 3*pi/2 and 7*pi/4 i.e. 2*pi-pi/2 and 2*pi-pi/4
+~~~~~
+@subsubsection occt_draw_6_4_2 exchuv
-@subsubsection occt_2142243456_1101404852642 exchuv
-
-Syntax: exchuv surfacename
+Syntax:
+~~~~~
+exchuv surfacename
+~~~~~
For a bezier or bspline surface this command exchanges the u and v parameters.
-**Example:**
+**Example:**
+~~~~~
# exchanging u and v on a spline (made from a cylinder)
cylinder c 5
trimv c c 0 10
convert c1 c
exchuv c1
+~~~~~
+@subsubsection occt_draw_6_4_3 segment, segsur
-@subsubsection occt_2142243456_1101404852643 segment, segsur
-
-Syntax: segment curve Ufirst Ulast
+Syntax:
+~~~~~
+segment curve Ufirst Ulast
segsur surface Ufirst Ulast Vfirst Vlast
+~~~~~
-**segment **and **segsur **segment a bezier curve and a bspline curve or surface respectively. These commands modify the curve to restrict it between the new parameters: the starting point of the modified curve, Ufirst, and the end point, Ulast. Ufirst is less than Ulast.
+**segment** and **segsur** segment a bezier curve and a bspline curve or surface respectively.
-This command must not be confused with **trim **which creates new geometry.
+These commands modify the curve to restrict it between the new parameters: *Ufirst*, the starting point of the modified curve, and *Ulast*, the end point. *Ufirst* is less than *Ulast*.
-**Example:**
+This command must not be confused with **trim** which creates a new geometry.
+**Example:**
+~~~~~
# segment a bezier curve in half
beziercurve c 3 0 0 0 10 0 0 10 10 0
segment c ufirst ulast
+~~~~~
+@subsubsection occt_draw_6_4_4 iincudeg, incvdeg
-@subsubsection occt_2142243456_1101404852644 iincudeg, incvdeg
-
-Syntax: incudeg surfacename newdegree
+Syntax:
+~~~~~
+incudeg surfacename newdegree
incvdeg surfacename newdegree
+~~~~~
-**incudeg **and **incvdeg **increase the degree in the U or V parameter of a bezier or bspline surface.
+**incudeg** and **incvdeg** increase the degree in the U or V parameter of a bezier or bspline surface.
+
**Example:**
-
+~~~~~
# make a planar bspline and increase the degree to 2 3
plane p
trim p p -1 1 -1 1
convert p1 p
incudeg p1 2
incvdeg p1 3
+~~~~~
-<h4>NOTE</h4>
-*The geometry is modified.*
+**Note** that the geometry is modified.
-@subsubsection occt_2142243456_1101404852645 cmovep, movep, movecolp, moverowp
+@subsubsection occt_draw_6_4_5 cmovep, movep, movecolp, moverowp
-Syntax: cmovep curve index dx dy [dz]
+Syntax:
+~~~~~
+cmovep curve index dx dy [dz]
movep surface uindex vindex dx dy dz
movecolp surface uindex dx dy dz
moverowp surface vindex dx dy dz
+~~~~~
-**move **methods translate poles of a bezier curve, a bspline curve or a bspline surface. **cmovep **and **movep **translate one pole with a given index.
+**move** methods translate poles of a bezier curve, a bspline curve or a bspline surface.
+* **cmovep** and **movep** translate one pole with a given index.
+* **movecolp** and **moverowp** translate a whole column (expressed by the *uindex*) or row (expressed by the *vindex*) of poles.
-**movecolp **and **moverowp **translate a whole column (expressed by the uindex) or row (expressed by the vindex) of poles.
**Example:**
-
+~~~~~
# start with a plane
# transform to bspline, raise degree and add relief
plane p
movecolp p1 2 0 0 5
moverowp p1 2 0 0 5
movep p1 2 2 0 0 5
+~~~~~
+@subsubsection occt_draw_6_4_6 insertpole, rempole, remcolpole, remrowpole
-@subsubsection occt_2142243456_1101404852646 insertpole, rempole, remcolpole, remrowpole
-
-Syntax: insertpole curvename index x y [z] [weight]
+Syntax:
+~~~~~
+insertpole curvename index x y [z] [weight]
rempole curvename index
remcolpole surfacename index
-remrowpole surfacename index
+remrowpole surfacename index
+~~~~~
-**insertpole **inserts a new pole into a 2d or 3d bezier curve. You may add a weight for the pole. The default value for the weight is 1. The pole is added at the position after that of the index pole. Use an index 0 to insert the new pole before the first one already existing in your drawing.
+**insertpole** inserts a new pole into a 2d or 3d bezier curve. You may add a weight for the pole. The default value for the weight is 1. The pole is added at the position after that of the index pole. Use an index 0 to insert the new pole before the first one already existing in your drawing.
-**rempole **removes a pole from a 2d or 3d bezier curve. Leave at least two poles in the curves.
+**rempole** removes a pole from a 2d or 3d bezier curve. Leave at least two poles in the curves.
-**remcolpole **and **remrowpole **remove a column or a row of poles from a bezier surface. A column is in the v direction and a row in the u direction The resulting degree must be at least 1; i.e there will be two rows and two columns left.
-**Example:**
+**remcolpole** and **remrowpole** remove a column or a row of poles from a bezier surface. A column is in the v direction and a row in the u direction The resulting degree must be at least 1; i.e there will be two rows and two columns left.
+**Example:**
+~~~~~
# start with a segment, insert a pole at end
# then remove the central pole
beziercurve c 2 0 0 0 10 0 0
insertpole c 2 10 10 0
rempole c 2
+~~~~~
+@subsubsection occt_draw_6_4_7 insertknot, insertuknot, insertvknot
-@subsubsection occt_2142243456_1101404852647 insertknot, insertuknot, insertvknot
-
-Syntax: insertknot name knot [mult = 1] [knot mult ...]
+Syntax:
+~~~~~
+insertknot name knot [mult = 1] [knot mult ...]
insertuknot surfacename knot mult
insertvknot surfacename knot mult
+~~~~~
-**insertknot **inserts knots in the knot sequence of a bspline curve. You must give a knot value and a target multiplicity. The default multiplicity is 1. If there is already a knot with the given value and a multiplicity lower than the target one, its multiplicity will be raised. **insertuknot **and **insertvknot **insert knots in a surface.
-
-
+**insertknot** inserts knots in the knot sequence of a bspline curve. You must give a knot value and a target multiplicity. The default multiplicity is 1. If there is already a knot with the given value and a multiplicity lower than the target one, its multiplicity will be raised.
+**insertuknot** and **insertvknot** insert knots in a surface.
**Example:**
-
+~~~~~
# create a cylindrical surface and insert a knot
cylinder c 10
trim c c 0 pi/2 0 10
convert c1 c
insertuknot c1 pi/4 1
+~~~~~
-@subsubsection occt_2142243456_1101404852648 remknot, remuknot, remvknot
+@subsubsection occt_draw_6_4_8 remknot, remuknot, remvknot
-Syntax: remknot index [mult] [tol]
+Syntax:
+~~~~~
+remknot index [mult] [tol]
remuknot index [mult] [tol]
remvknot index [mult] [tol]
+~~~~~
-**remknot **removes a knot from the knot sequence of a curve or a surface. Give the index of the knot and optionally, the target multiplicity. If the target multiplicity is not 0, the multiplicity of the knot will be lowered. As the curve may be modified, you are allowed to set a tolerance to control the process. If the tolerance is low, the knot will only be removed if the curve will not be modified.
+**remknot** removes a knot from the knot sequence of a curve or a surface. Give the index of the knot and optionally, the target multiplicity. If the target multiplicity is not 0, the multiplicity of the knot will be lowered. As the curve may be modified, you are allowed to set a tolerance to control the process. If the tolerance is low, the knot will only be removed if the curve will not be modified.
By default, if no tolerance is given, the knot will always be removed.
-**Example:**
+**Example:**
+~~~~~
# bspline circle, remove a knot
circle c 0 0 5
convert c1 c
incd c1 5
remknot c1 2
+~~~~~
-*NOTE*
-*Curves or Surfaces may be modified.*
+**Note** that Curves or Surfaces may be modified.
-@subsubsection occt_2142243456_1101404852649 setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic
+@subsubsection occt_draw_6_4_9 setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic
-Syntax: setperiodic curve
+Syntax:
+~~~~~
+setperiodic curve
setnotperiodic curve
setuperiodic surface
setunotperiodic surface
setvperiodic surface
-setvnotperiodic surface
+setvnotperiodic surface
+~~~~~
-**setperiodic **turns a bspline curve into a periodic bspline curve; the knot vector stays the same and excess poles are truncated. The curve may be modified if it has not been closed. **setnotperiodic **removes the periodicity of a periodic curve. The pole table mau be modified. Note that knots are added at the beginning and the end of the knot vector and the multiplicities are knots set to degree+1 at the start and the end.
+**setperiodic** turns a bspline curve into a periodic bspline curve; the knot vector stays the same and excess poles are truncated. The curve may be modified if it has not been closed. **setnotperiodic** removes the periodicity of a periodic curve. The pole table mau be modified. Note that knots are added at the beginning and the end of the knot vector and the multiplicities are knots set to degree+1 at the start and the end.
-**setuperiodic **and **setvperiodic **make the u or the v parameter of bspline surfaces periodic; **setunotperiodic**, and **setvnotperiodic **remove periodicity from the u or the v parameter of bspline surfaces.
-**Example:**
+**setuperiodic** and **setvperiodic** make the u or the v parameter of bspline surfaces periodic; **setunotperiodic**, and **setvnotperiodic** remove periodicity from the u or the v parameter of bspline surfaces.
+**Example:**
+~~~~~
# a circle deperiodicized
circle c 0 0 5
convert c1 c
setnotperiodic c1
-@subsubsection occt_2142243456_11014048526410 setorigin, setuorigin, setvorigin
+~~~~~
-Syntax: setorigin curvename index
+@subsubsection occt_draw_6_4_10 setorigin, setuorigin, setvorigin
+
+Syntax:
+~~~~~
+setorigin curvename index
setuorigin surfacename index
setuorigin surfacename index
+~~~~~
-These commands change the origin of the parameters on periodic curves or surfaces. The new origin must be an existing knot. To set an origin other than an existing knot, you must first insert one with the **insertknot **command.
-**Example:**
+These commands change the origin of the parameters on periodic curves or surfaces. The new origin must be an existing knot. To set an origin other than an existing knot, you must first insert one with the *insertknot* command.
+**Example:**
+~~~~~
# a torus with new U and V origins
torus t 20 5
convert t1 t
setuorigin t1 2
-setvorigin t1 2
+setvorigin t1 2
+~~~~~
-@subsection occt_2142243456_110140485265 Transformations
+@subsection occt_draw_6_5 Transformations
Draw provides commands to apply linear transformations to geometric objects: they include translation, rotation, mirroring and scaling.
-@subsubsection occt_2142243456_1101404852651 translate, dtranslate
+@subsubsection occt_draw_6_5_1 translate, dtranslate
-Syntax: translate name [names ...] dx dy dz
+Syntax:
+~~~~~
+translate name [names ...] dx dy dz
2dtranslate name [names ...] dx dy
+~~~~~
-The **Translate **command translates 3d points, curves and surfaces along a vector dx,dy,dz. You can translate more than one object with the same command.
+The **Translate** command translates 3d points, curves and surfaces along a vector *dx,dy,dz*. You can translate more than one object with the same command.
-For 2d points or curves, use the **2dtranslate **command.
-**Example:**
+For 2d points or curves, use the **2dtranslate** command.
+**Example:**
+~~~~~
# 3d tranlation
point p 10 20 30
circle c 10 20 30 5
torus t 10 20 30 5 2
-translate p c t 0 0 15
+translate p c t 0 0 15
+~~~~~
+
*NOTE*
*Objects are modified by this command.*
-@subsubsection occt_2142243456_1101404852652 rotate, drotate
+@subsubsection occt_draw_6_5_2 rotate, 2drotate
+
+Syntax:
+~~~~~
+rotate name [name ...] x y z dx dy dz angle
+2drotate name [name ...] x y angle
+~~~~~
-Syntax: rotate name [name ...] x y z dx dy dz angle
-2drotate name [name ...] x y angle
-The **rotate **command rotates a 3d point curve or surface. You must give an axis of rotation with a point x,y,z, a vector dx,dy,dz, and an angle in degrees.
+The **rotate** command rotates a 3d point curve or surface. You must give an axis of rotation with a point *x,y,z*, a vector *dx,dy,dz* and an angle in degrees.
For a 2d rotation, you need only give the center point and the angle. In 2d or 3d, the angle can be negative.
-**Example:**
+**Example:**
+~~~~~
# make a helix of circles. create a scripte file with
this code and execute it using **source**.
circle c0 10 0 0 3
translate c$i 0 0 3
rotate c$i 0 0 0 0 0 1 36
}
+~~~~~
-@subsubsection occt_2142243456_1101404852653 pmirror, lmirror, smirror, dpmirror, dlmirror
+@subsubsection occt_draw_6_5_3 pmirror, lmirror, smirror, dpmirror, dlmirror
-Syntax: pmirror name [names ...] x y z
+Syntax:
+~~~~~
+pmirror name [names ...] x y z
lmirror name [names ...] x y z dx dy dz
smirror name [names ...] x y z dx dy dz
2dpmirror name [names ...] x y
2dlmirror name [names ...] x y dx dy
+~~~~~
The mirror commands perform a mirror transformation of 2d or 3d geometry.
-**pmirror **is the point mirror, mirroring 3d curves and surfaces about a point of symmetry. **lmirror **is the line mirror commamd, mirroring 3d curves and surfaces about an axis of symmetry. **smirror **is the surface mirror, mirroring 3d curves and surfaces about a plane of symmetry. In the last case, the plane of symmetry is perpendicular to dx,dy,dz.
+* **pmirror** is the point mirror, mirroring 3d curves and surfaces about a point of symmetry.
+* **lmirror** is the line mirror commamd, mirroring 3d curves and surfaces about an axis of symmetry.
+* **smirror** is the surface mirror, mirroring 3d curves and surfaces about a plane of symmetry. In the last case, the plane of symmetry is perpendicular to dx,dy,dz.
+* **2dpmirror** is the point mirror in 2D.
+* **2dlmirror** is the axis symmetry mirror in 2D.
-In 2d, only **2dpmirror**, point symmetry mirroring, and **2dlmirror**, axis symmetry mirroring, are available.
**Example:**
-
+~~~~~
# build 3 images of a torus
torus t 10 10 10 1 2 3 5 1
copy t t1
lmirror t2 0 0 0 1 0 0
copy t t3
smirror t3 0 0 0 1 0 0
+~~~~~
-@subsubsection occt_2142243456_1101404852654 pscale, dpscale
+@subsubsection occt_draw_6_5_4 pscale, dpscale
-Syntax: pscale name [name ...] x y z s
+Syntax:
+~~~~~
+pscale name [name ...] x y z s
2dpscale name [name ...] x y s
-The **pscale **and **2dpscale **commands transform an object by point scaling. You must give the center and the scaling factor. Because other scalings modify the type of the object, they are not provided. For example, a sphere may be transformed into an ellipsoid. Using a scaling factor of -1 is similar to using **pmirror**.
-**Example:**
+~~~~~
+The **pscale** and **2dpscale** commands transform an object by point scaling. You must give the center and the scaling factor. Because other scalings modify the type of the object, they are not provided. For example, a sphere may be transformed into an ellipsoid. Using a scaling factor of -1 is similar to using **pmirror**.
+
+
+**Example:**
+~~~~~
# double the size of a sphere
sphere s 0 0 0 10
pscale s 0 0 0 2
+~~~~~
-@subsection occt_2142243456_110140485266 Curve and surface analysis
+@subsection occt_draw_6_6 Curve and surface analysis
-**Draw **provides methods to compute information about curves and surfaces:
+**Draw** provides methods to compute information about curves and surfaces:
- * **coord **to find the coordinates of a point.
- * **cvalue **and **2dcvalue **to compute points and derivatives on curves.
- * **svalue **to compute points and derivatives on a surface.
- * **localprop **and **minmaxcurandif **to compute the curvature on a curve.
- * **parameters **to compute (u,v) values for a point on a surface.
- * **proj **and **2dproj **to project a point on a curve or a surface.
- * **surface_radius **to compute the curvature on a surface.
+ * **coord** to find the coordinates of a point.
+ * **cvalue** and **2dcvalue** to compute points and derivatives on curves.
+ * **svalue** to compute points and derivatives on a surface.
+ * **localprop** and **minmaxcurandif** to compute the curvature on a curve.
+ * **parameters** to compute (u,v) values for a point on a surface.
+ * **proj** and **2dproj** to project a point on a curve or a surface.
+ * **surface_radius** to compute the curvature on a surface.
-@subsubsection occt_2142243456_1101404852661 coord
+@subsubsection occt_draw_6_6_1 coord
-Syntax: coord P x y [z]
+Syntax:
+~~~~~
+coord P x y [z]
+~~~~~
-The **coord **command will set the coordinates of the point P. x, y (and optionally z)
-**Example:**
+Sets the x, y (and optionally z) coordinates of the point P.
+**Example:**
+~~~~~
# translate a point
point p 10 5 5
translate p 5 0 0
coord p x y z
# x value is 15
-See also: **point**
-@subsubsection occt_2142243456_1101404852662 cvalue, dcvalue
+~~~~~
+
-Syntax: cvalue curve U x y z [d1x d1y d1z [d2x d2y d2z]]
+@subsubsection occt_draw_6_6_2 cvalue, 2dcvalue
+
+Syntax:
+~~~~~
+cvalue curve U x y z [d1x d1y d1z [d2x d2y d2z]]
2dcvalue curve U x y [d1x d1y [d2x d2y]]
+~~~~~
+
+For a curve at a given parameter, and depending on the number of arguments, **cvalue** computes the coordinates in *x,y,z*, the first derivative in *d1x,d1y,d1z* and the second derivative in *d2x,d2y,d2z*.
-For a curve at a given parameter, and depending on the number of arguments, **cvalue **computes: the coordinates in x,y,z, the first derivative in d1x,d1y,d1z and the second derivative in d2x,d2y,d2z.
**Example:**
-# on a bezier curve at parameter 0
-# the point is the first pole
-# the derivative is the vector first to second pole
-# multiplied by the degree
-# the second derivative is the difference
-# first to second pole, second to third pole
-# multipied by degree * degree-1
+Let on a bezier curve at parameter 0 the point is the first pole; the first derivative is the vector to the second pole multiplied by the degree; the second derivative is the difference first to the second pole, second to the third pole multipied by *degree-1* :
+
+~~~~~
2dbeziercurve c 4 0 0 1 1 2 1 3 0
2dcvalue c 0 x y d1x d1y d2x d2y
# values of x y d1x d1y d2x d2y
# are 0 0 3 3 0 -6
+~~~~~
+@subsubsection occt_draw_6_6_3 svalue
-@subsubsection occt_2142243456_1101404852663 svalue
+Syntax:
+~~~~~
+svalue surfname U v x y z [dux duy duz dvx dvy dvz [d2ux d2uy d2uz d2vx d2vy d2vz d2uvx d2uvy d2uvz]]
+~~~~~
-Syntax: svalue surfname U v x y z [dux duy duz dvx dvy dvz [d2ux d2uy d2uz d2vx d2vy d2vz d2uvx d2uvy d2uvz]]
+Computes points and derivatives on a surface for a pair of parameter values. The result depends on the number of arguments. You can compute the first and the second derivatives.
-**svalue **computes points and derivatives on a surface for a pair of parameter values. The result depends on the number of arguments. You can compute first and second derivatives.
**Example:**
-
+~~~~~
# display points on a sphere
sphere s 10
for {dset t 0} {[dval t] = 1} {dset t t+0.01} {
svalue s t*2*pi t*pi-pi/2 x y z
point . x y z
}
+~~~~~
+@subsubsection occt_draw_6_6_4 localprop, minmaxcurandinf
-@subsubsection occt_2142243456_1101404852664 localprop, minmaxcurandinf
+Syntax:
+~~~~~
+localprop curvename U
+minmaxcurandinf curve
+~~~~~
-Syntax: localprop curvename U
-minmaxcurandinf curve
+**localprop** computes the curvature of a curve.
+**minmaxcurandinf** computes and prints the parameters of the points where the curvature is minimum and maximum on a 2d curve.
-The **localprop **command computes the curvature of a curve.
-**minmaxcurandinf **computes and prints the parameters of the points where the curvature is minimum and maximum on a 2d curve.
**Example:**
-
+~~~~~
# show curvature at the center of a bezier curve
beziercurve c 3 0 0 0 10 2 0 20 0 0
localprop c 0.5
== Curvature : 0.02
+~~~~~
-See also: **surface_radius**
-
+@subsubsection occt_draw_6_6_5 parameters
-@subsubsection occt_2142243456_1101404852665 parameters
+Syntax:
+~~~~~
+parameters surf/curve x y z U [V]
+~~~~~
-Syntax: parameters surf/curve x y z U [V]
+Returns the parameters on the surface of the 3d point *x,y,z* in variables *u* and *v*. This command may only be used on analytical surfaces: plane, cylinder, cone, sphere and torus.
-The **parameters **command returns the parameters on the surface of the 3d point x,y,z in variables u and v . This command may only be used on analytical surfaces: plane, cylinder, cone, sphere and torus.
**Example:**
-
+~~~~~
# Compute parameters on a plane
plane p 0 0 10 1 1 0
parameters p 5 5 5 u v
# the values of u and v are : 0 5
+~~~~~
+@subsubsection occt_draw_6_6_6 proj, dproj
-@subsubsection occt_2142243456_1101404852666 proj, dproj
-
-Syntax: proj name x y z
+Syntax:
+~~~~~
+proj name x y z
2dproj name xy
+~~~~~
-Use **proj **to project a point on a 3d curve or a surface and **2dproj **for a 2d curve.
+Use **proj** to project a point on a 3d curve or a surface and **2dproj** for a 2d curve.
+
+The command will compute and display all points in the projection. The lines joining the point to the projections are created with the names *ext_1, ext_2, ... *
-The command will compute and display all points in the projection. The lines joining the point to the projections are created with the names ext_1, ext_2, ...
**Example:**
-# project point on a torus
+Let us project a point on a torus
+
+~~~~~
torus t 20 5
proj t 30 10 7
== ext_1 ext_2 ext_3 ext_4
+~~~~~
+@subsubsection occt_draw_6_6_7 surface_radius
-@subsubsection occt_2142243456_1101404852667 surface_radius
+Syntax:
+~~~~~
+surface_radius surface u v [c1 c2]
+~~~~~
-Syntax: surface_radius surface u v [c1 c2]
+Computes the main curvatures of a surface at parameters *(u,v)*. If there are extra arguments, their curvatures are stored in variables *c1* and *c2*.
-The **surface_radius **command computes the main curvatures of a surface at parameters (u,v). If there are extra arguments, their curvatures are stored in variables c1 and c2.
**Example:**
-# computes curvatures of a cylinder
+Let us compute curvatures of a cylinder:
+
+~~~~~
cylinder c 5
surface_radius c pi 3 c1 c2
== Min Radius of Curvature : -5
== Min Radius of Curvature : infinite
+~~~~~
+@subsection occt_draw_6_7 Intersections
-@subsection occt_2142243456_110140485267 Intersections
-
-The **intersect **command computes intersections of surfaces; the **2dintersect **command, intersections of 2d curves.
+* **intersect** computes intersections of surfaces;
+* **2dintersect** computes intersections of 2d curves.
+@subsubsection occt_draw_6_7_1 intersect
-@subsubsection occt_2142243456_1101404852671 intersect
+Syntax:
+~~~~~
+intersect name surface1 surface2
+~~~~~
-Syntax: intersect name surface1 surface2
+Intersects two surfaces; if there is one intersection curve it will be named *name*, if there are more than one they will be named *name_1*, *name_2*, ...
-The **intersect **command intersects two surfaces. If there is one intersection curve it will be named ;name;, if there are more than one they will be named ;name_1;, ;name_2;, ...
**Example:**
-
+~~~~~
# create an ellipse
cone c 45 0
plane p 0 0 40 0 1 5
intersect e c p
+~~~~~
+@subsubsection occt_draw_6_7_2 dintersect
-@subsubsection occt_2142243456_1101404852672 dintersect
+Syntax:
+~~~~~
+2dintersect curve1 curve2
+~~~~~
-Syntax: 2dintersect curve1 curve2
+Displays the intersection points between two 2d curves.
-**2dintersect **displays the intersection points between two 2d curves.
**Example:**
-
+~~~~~
# intersect two 2d ellipses
ellipse e1 0 0 5 2
ellipse e2 0 0 0 1 5 2
2dintersect e1 e2
-@subsection occt_2142243456_110140485268 Approximations
+~~~~~
+
+@subsection occt_draw_6_8 Approximations
Draw provides command to create curves and surfaces by approximation.
-**2dapprox **fits a curve through 2d points, **appro **fits a curve through 3d points, **surfapp **and **grilapp **fits a surface through 3d points, **2dinterpolate **may be used to interpolate a curve.
+* **2dapprox** fits a curve through 2d points;
+* **appro** fits a curve through 3d points;
+* **surfapp** and **grilapp** fit a surface through 3d points;
+* **2dinterpolate** interpolates a curve.
-@subsubsection occt_2142243456_1101404852681 appro, dapprox
+@subsubsection occt_draw_6_8_1 appro, dapprox
-Syntax: appro result nbpoint [curve]
-2dapprox result nbpoint [curve / x1 y1 x2 y2]
+Syntax:
+~~~~~
+appro result nbpoint [curve]
+2dapprox result nbpoint [curve / x1 y1 x2 y2]
+~~~~~
These commands fit a curve through a set of points. First give the number of points, then choose one of the three ways available to get the points. If you have no arguments, click on the points. If you have a curve argument or a list of points, the command launches computation of the points on the curve.
+
**Example:**
-# pick points and they will be fitted
-2dapprox c 10
+Let us pick points and they will be fitted
+~~~~~
+2dapprox c 10
+~~~~~
-@subsubsection occt_2142243456_1101404852682 surfapp, grilapp
+@subsubsection occt_draw_6_8_2 surfapp, grilapp
-Syntax: surfapp name nbupoints nbvpoints x y z ....
+Syntax:
+~~~~~
+surfapp name nbupoints nbvpoints x y z ....
grilapp name nbupoints nbvpoints xo dx yo dy z11 z12 ...
+~~~~~
-**surfapp **fits a surface through an array of u and v points, nbupoints*nbvpoints.
+* **surfapp** fits a surface through an array of u and v points, nbupoints*nbvpoints.
+* **grilapp** has the same function, but the x,y coordinates of the points are on a grid starting at x0,y0 with steps dx,dy.
-**grilapp **has the same function, but the x,y coordinates of the points are on a grid starting at x0,y0 with steps dx,dy.
**Example:**
-
+~~~~~
# a surface using the same data as in the beziersurf
example sect 4.4
surfapp s 3 4 \
0 10 2 10 10 3 20 10 2 \
0 20 10 10 20 20 20 20 10 \
0 30 0 10 30 0 20 30 0
+~~~~~
+@subsection occt_draw_6_9 Constraints
+* **cirtang** constructs 2d circles tangent to curves;
+* **lintan** constructs 2d lines tangent to curves.
+@subsubsection occt_draw_6_9_1 cirtang
-@subsection occt_2142243456_110140485269 Constraints
-
-The **cirtang **command is used to construct 2d circles tangent to curves and **lintan **to construct 2d lines tangent to curves.
-
-
-@subsubsection occt_2142243456_1101404852691 cirtang
+Syntax:
+~~~~~
+cirtang cname curve/point/radius curve/point/radius curve/point/radius
+~~~~~
-Syntax: cirtang cname curve/point/radius curve/point/radius curve/point/radius
+Builds all circles satisfying the three constraints which are either a curve (the circle must be tangent to that curve), a point (the circle must pass through that point), or a radius for the circle. Only one constraint can be a radius. The solutions will be stored in variables *name_1*, *name_2*, etc.
-The **cirtang **command will build all circles satisfying the three constraints which are either a curve (the circle must be tangent to that curve), a point (the circle must pass through that point), or a radius for the circle. Only one constraint can be a radius. The solutions will be stored in variables *name_1*, *name_2*, etc.
**Example:**
-
+~~~~~
# a point, a line and a radius. 2 solutions
point p 0 0
line 1 10 0 -1 1
cirtang c p 1 4
== c_1 c_2
+~~~~~
+@subsubsection occt_draw_6_9_2 lintan
-@subsubsection occt_2142243456_1101404852692 lintan
+Syntax:
+~~~~~
+lintan name curve curve [angle]
+~~~~~
-Syntax: lintan name curve curve [angle]
+Builds all 2d lines tangent to two curves. If the third angle argument is given the second curve must be a line and **lintan** will build all lines tangent to the first curve and forming the given angle with the line. The angle is given in degrees. The solutions are named *name_1*, *name_2*, etc.
-The **lintan **command will build all 2d lines tangent to two curves. If a third angle argument is given the second curve must be a line and **lintan **will build all lines tangent to the first curve and forming the given angle with the line. The angle is given in degrees. The solutions are named name_1, name_2, etc.
**Example:**
-
+~~~~~
# lines tangent to 2 circles, 4 solutions
circle c1 -10 0 10
circle c2 10 0 5
circle c1 -10 0 1
line l 2 0 1 1
lintan l1 c1 l 15
+~~~~~
-
-
-
-@subsection occt_2142243456_1101404852610 Display
+@subsection occt_draw_6_10 Display
Draw provides commands to control the display of geometric objects. Some display parameters are used for all objects, others are valid for surfaces only, some for bezier and bspline only, and others for bspline only.
-On curves and surfaces, you can control the mode of representation with the **dmode **command. You can control the parameters for the mode with the **defle **command and the **discr **command, which control deflection and discretization respectively.
+On curves and surfaces, you can control the mode of representation with the **dmode** command. You can control the parameters for the mode with the **defle** command and the **discr** command, which control deflection and discretization respectively.
-On surfaces, you can control the number of isoparametric curves displayed on the surface with the **nbiso **commands.
+On surfaces, you can control the number of isoparametric curves displayed on the surface with the **nbiso** command.
-On bezier and bspline curve and surface you can toggle the display of the control points with the **clpoles **and **shpoles **commands.
+On bezier and bspline curve and surface you can toggle the display of the control points with the **clpoles** and **shpoles** commands.
-On bspline curves and surfaces you can toggle the display of the knots with the **shknots **and **clknots **commands.
+On bspline curves and surfaces you can toggle the display of the knots with the **shknots** and **clknots** commands.
-@subsubsection occt_2142243456_11014048526101 dmod, discr, defle
+@subsubsection occt_draw_6_10_1 dmod, discr, defle
-Syntax: dmode name [name ...] u/d
+Syntax:
+~~~~~
+dmode name [name ...] u/d
discr name [name ...] nbintervals
defle name [name ...] deflection
+~~~~~
-**dmode **allows you to choose the display mode for a curve or a surface.
+**dmod** command allows choosing the display mode for a curve or a surface.
-In mode ;u;, or *uniform deflection*, the points are computed to keep the polygon at a distance lower than the deflection of the geometry. The deflection is set with the **defle **command. This mode involves intensive use of computational power.
+In mode *u*, or *uniform deflection*, the points are computed to keep the polygon at a distance lower than the deflection of the geometry. The deflection is set with the *defle* command. This mode involves intensive use of computational power.
-In ;d;, or discretization mode, a fixed number of points is computed. This number is set with the **discr **command. This is the default mode. On a bspline, the fixed number of points is computed for each span of the curve. (A span is the interval between two knots).
+In *d*, or discretization mode, a fixed number of points is computed. This number is set with the *discr* command. This is the default mode. On a bspline, the fixed number of points is computed for each span of the curve. (A span is the interval between two knots).
If the curve or the isolines seem to present too many angles, you can either increase the discretization or lower the deflection, depending on the mode. This will increase the number of points.
-**Example:**
+**Example:**
+~~~~~
# increment the number of points on a big circle
circle c 0 0 50 50
discr 100
# change the mode
dmode c u
+~~~~~
+@subsubsection occt_draw_6_10_2 nbiso
-@subsubsection occt_2142243456_11014048526102 nbiso
+Syntax:
+~~~~~
+nbiso name [names...] nuiso nviso
+~~~~~
-Syntax: nbiso name [names...] nuiso nviso
+Changes the number of isoparametric curves displayed on a surface in the U and V directions. On a bspline surface, isoparametric curves are displayed by default at knot values. Use *nbiso* to turn this feature off.
-**nbiso **changes the number of isoparametric curves displayed on a surface in the U and V directions. On a bspline surface, isoparametric curves are displayed by default at knot values. Use **nbiso **to turn this feature off.
**Example:**
-# display 35 meridians and 15 parallels on a spere
+Let us display 35 meridians and 15 parallels on a sphere:
+~~~~~
sphere s 20
nbiso s 35 15
+~~~~~
+@subsubsection occt_draw_6_10_3 clpoles, shpoles
-@subsubsection occt_2142243456_11014048526103 clpoles, shpoles
-
-Syntax: clpoles name
+Syntax:
+~~~~~
+clpoles name
shpoles name
+~~~~~
+
+On bezier and bspline curves and surfaces, the control polygon is displayed by default: *clpoles* erases it and *shpoles* restores it.
-On bezier and bspline curves and surfaces, the control polygon is displayed by default: **clpoles **erases it and **shpoles **restores it.
**Example:**
-# make a bezier curve and erase the poles
+Let us make a bezier curve and erase the poles
+
+~~~~~
beziercurve c 3 0 0 0 10 0 0 10 10 0
clpoles c
+~~~~~
+@subsubsection occt_draw_6_10_4 clknots, shknots
-@subsubsection occt_2142243456_11014048526104 clknots, shknots
-
-Syntax: clknots name
+Syntax:
+~~~~~
+clknots name
shknots name
+~~~~~
-By default, knots on a bspline curve or surface are displayed with markers at the points with parametric value equal to the knots. **clknots **removes them and **shknots **restores them.
-**Example:**
+By default, knots on a bspline curve or surface are displayed with markers at the points with parametric value equal to the knots. *clknots* removes them and *shknots* restores them.
+**Example:**
+~~~~~
# hide the knots on a bspline curve
bsplinecurve bc 2 3 0 3 1 1 2 3 \
10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1
-clknots bc
-@section occt_2142243456_1869436669 Topology commands
-
-
-
-
-
-
+clknots bc
+~~~~~
+
+@section occt_draw_7 Topology commands
Draw provides a set of commands to test OCCT Topology libraries. The Draw commands are found in the DRAWEXE executable or in any executable including the BRepTest commands.
Topology defines the relationship between simple geometric entities, which can thus be linked together to represent complex shapes. The type of variable used by Topology in Draw is the shape variable.
-The different topological shapes<a href="#_ftn3">[3]</a> include:
+The <a href="user_guides__modeling_data.html#occt_modat_5">different topological shapes</a> include:
- * COMPOUND: A group of any type of topological object.
- * COMPSOLID: A set of solids connected by their faces. This expands the notions of WIRE and SHELL to solids.
- * SOLID: A part of space limited by shells. It is three dimensional.
- * SHELL: A set of faces connected by their edges. A shell can be open or closed.
- * FACE: In 2d, a plane; in 3d, part of a surface. Its geometry is constrained (trimmed) by contours. It is two dimensional.
- * WIRE: A set of edges connected by their vertices. It can be open or closed depending on whether the edges are linked or not.
- * EDGE: A topological element corresponding to a restrained curve. An edge is generally limited by vertices. It has one dimension.
- * VERTEX: A topological element corresponding to a point. It has a zero dimension.
+ * **COMPOUND**: A group of any type of topological object.
+ * **COMPSOLID**: A set of solids connected by their faces. This expands the notions of WIRE and SHELL to solids.
+ * **SOLID**: A part of space limited by shells. It is three dimensional.
+ * **SHELL**: A set of faces connected by their edges. A shell can be open or closed.
+ * **FACE**: In 2d, a plane; in 3d, part of a surface. Its geometry is constrained (trimmed) by contours. It is two dimensional.
+ * **WIRE**: A set of edges connected by their vertices. It can be open or closed depending on whether the edges are linked or not.
+ * **EDGE**: A topological element corresponding to a restrained curve. An edge is generally limited by vertices. It has one dimension.
+ * **VERTEX**: A topological element corresponding to a point. It has a zero dimension.
-Shapes are usually shared. **copy **will create a new shape which shares its representation with the original. Nonetheless, two shapes sharing the same topology can be moved independently (see the section on **transformation**).
+Shapes are usually shared. **copy** will create a new shape which shares its representation with the original. Nonetheless, two shapes sharing the same topology can be moved independently (see the section on **transformation**).
The following topics are covered in the eight sections of this chapter:
* Analysis of shapes.
-
-@subsection occt_2142243456_186943666971 Basic topology
+@subsection occt_draw_7_1 Basic topology
The set of basic commands allows simple operations on shapes, or step-by-step construction of objects. These commands are useful for analysis of shape structure and include:
- * **isos **and **discretisation **to control display of shape faces by isoparametric curves .
- * **orientation**, **complement **and **invert **to modify topological attributes such as orientation.
- * **explode**, **exwire **and **nbshapes **to analyze the structure of a shape.
- * **emptycopy**, **add**, **compound **to create shapes by stepwise construction.
+ * **isos** and **discretisation** to control display of shape faces by isoparametric curves .
+ * **orientation**, **complement** and **invert** to modify topological attributes such as orientation.
+ * **explode**, **exwire** and **nbshapes** to analyze the structure of a shape.
+ * **emptycopy**, **add**, **compound** to create shapes by stepwise construction.
In Draw, shapes are displayed using isoparametric curves. There is color coding for the edges:
* a yellow edge is a shared edge, which belongs to at least two faces.
-@subsubsection occt_2142243456_1869436669711 isos, discretisation
+@subsubsection occt_draw_7_1_1 isos, discretisation
+
+Syntax:
+~~~~~
+isos [name ...][nbisos]
+discretisation nbpoints
+~~~~~
+
+Determines or changes the number of isoparametric curves on shapes.
-Syntax: isos [name ...][nbisos]
-discretisation nbpoints
-**isos **determines or changes the number of isoparametric curves on shapes.
+The same number is used for the u and v directions. With no arguments, *isos* prints the current default value. To determine, the number of isos for a shape, give it name as the first argument.
-The same number is used for the u and v directions. With no arguments, **isos **prints the current default value. To determine, the number of isos for a shape, give it name as the first argument.
+*discretisation* changes the default number of points used to display the curves. The default value is 30.
-**discretisation **changes the default number of points used to display the curves. The default value is 30.
**Example:**
-
+~~~~~
# Display only the edges (the wireframe)
isos 0
+~~~~~
-<h4>NOTE</h4>
-Don’t confuse *isos* and *discretisation* with the geometric
-*commands *nbisos* and *discr*.*
+**Warning**: don’t confuse *isos* and *discretisation* with the geometric commands *nbisos* and *discr*.
-@subsubsection occt_2142243456_1869436669712 orientation, complement, invert, normals, range
+@subsubsection occt_draw_7_1_2 orientation, complement, invert, normals, range
-Syntax: orientation name [name ...] F/R/E/I
+Syntax:
+~~~~~
+orientation name [name ...] F/R/E/I
complement name [name ...]
invert name
normals s (length = 10), disp normals
range name value value
+~~~~~
-**orientation **assigns the orientation of shapes - simple and complex - to one of the following four values: FORWARD, REVERSED, INTERNAL, EXTERNAL.
-
-**complement **changes the current orientation of shapes to its complement, FORWARD - REVERSED, INTERNAL - EXTERNAL.
-
-**invert **creates a new shape which is a copy of the original with the orientation all subshapes reversed. For example, it may be useful to reverse the normals of a solid.
-
-**normals **returns the assignment of colors to orientation values.
-
-**range **defines the length of a selected edge by defining the values of a starting point and an end point.
+* **orientation** assigns the orientation of shapes - simple and complex - to one of the following four values: *FORWARD, REVERSED, INTERNAL, EXTERNAL*.
+* **complement** changes the current orientation of shapes to its complement, *FORWARD - REVERSED, INTERNAL - EXTERNAL*.
+* **invert** creates a new shape which is a copy of the original with the orientation all subshapes reversed. For example, it may be useful to reverse the normals of a solid.
+* *normals** returns the assignment of colors to orientation values.
+* **range** defines the length of a selected edge by defining the values of a starting point and an end point.
+
**Example:**
-
-# invert normals of a box
+~~~~~
+# to invert normals of a box
box b 10 20 30
normals b 5
invert b
# to define the length of the edge as starting from 0
and finishing at 1
range e 0 1
+~~~~~
+@subsubsection occt_draw_7_1_3 explode, exwire, nbshapes
-@subsubsection occt_2142243456_1869436669713 explode, exwire, nbshapes
-
-Syntax: explode name [C/So/Sh/F/W/E/V]
+Syntax:
+~~~~~
+explode name [C/So/Sh/F/W/E/V]
exwire name
nbshapes name
+~~~~~
-**explode **extracts subshapes from an entity. The subshapes will be named *name_1*, *name_2*, ... Note that they are not copied but shared with the original.
+**explode** extracts subshapes from an entity. The subshapes will be named *name_1*, *name_2*, ... Note that they are not copied but shared with the original.
-With name only, **explode **will extract the first sublevel of shapes: the shells of a solid or the edges of a wire, for example. With one argument, **explode **will extract all subshapes of that type: *C *for compounds, *So *for solids, *Sh *for shells, *F *for faces, *W *for wires, *E *for edges, *V *for vertices.
+With name only, **explode** will extract the first sublevel of shapes: the shells of a solid or the edges of a wire, for example. With one argument, **explode** will extract all subshapes of that type: *C* for compounds, *So* for solids, *Sh* for shells, *F* for faces, *W* for wires, *E* for edges, *V* for vertices.
-**exwire **is a special case of **explode **for wires, which extracts the edges in an ordered way,if possible. Each edge, for example, is connected to the following one by a vertex.
+**exwire** is a special case of **explode** for wires, which extracts the edges in an ordered way, if possible. Each edge, for example, is connected to the following one by a vertex.
-**nbshapes **counts the number of shapes of each type in an entity.
-**Example:**
+**nbshapes** counts the number of shapes of each type in an entity.
+**Example:**
+~~~~~
# on a box
box b 10 20 30
COMPSOLID : 0
COMPOUND : 0
SHAPE : 34
+~~~~~
+@subsubsection occt_draw_7_1_4 emptycopy, add, compound
-@subsubsection occt_2142243456_1869436669714 emptycopy, add, compound
-
-Syntax: emptycopy [newname] name
+Syntax:
+~~~~~
+emptycopy [newname] name
add name toname
compound [name ...] compoundname
+~~~~~
-**emptycopy **returns an empty shape with the same orientation, location, and geometry as the target shape, but with no sub-shapes. If the newname argument is not given, the new shape is stored with the same name. This command is used to modify a frozen shape. A frozen shape is a shape used by another one. To modify it, you must emptycopy it. Its subshape may be reinserted with the **add **command.
-
-**add **inserts shape C into shape S. Verify that C and S reference compatible types of objects:
+**emptycopy** returns an empty shape with the same orientation, location, and geometry as the target shape, but with no sub-shapes. If the newname argument is not given, the new shape is stored with the same name. This command is used to modify a frozen shape. A frozen shape is a shape used by another one. To modify it, you must emptycopy it. Its subshape may be reinserted with the **add** command.
- * Any *Shape *can be added to a *Compound*.
- * Only a *Solid *can be added to a *CompSolid*.
- * Only a *Shell*, an *Edge *or a *Vertex *can be added into a *Solid*.
- * Only a *Face *can be added to a *Shell*.
- * Only a *Wire *and *Vertex *can be added in a *Solid*.
- * Only an *Edge *can be added to a *Wire*.
- * Only a *Vertex *can be added to an *Edge*.
+**add** inserts shape *C* into shape *S*. Verify that *C* and *S* reference compatible types of objects:
+ * Any *Shape* can be added to a *Compound*.
+ * Only a *Solid* can be added to a *CompSolid*.
+ * Only a *Shell* can *Edge* or a *Vertex* can be added into a *Solid*.
+ * Only a *Face* can be added to a *Shell*.
+ * Only a *Wire* and *Vertex* can be added in a *Solid*.
+ * Only an *Edge* can be added to a *Wire*.
+ * Only a *Vertex* can be added to an *Edge*.
* Nothing can be added to a *Vertex*.
-Care should be taken using **emptycopy **and **add**.
+**emptycopy** and **add** should be used with care.
-On the other hand, **compound **is a safe way to achieve a similar result. It creates a compound from shapes. If no shapes are given, the compound is empty.
-**Example:**
+On the other hand, **compound** is a safe way to achieve a similar result. It creates a compound from shapes. If no shapes are given, the compound is empty.
+**Example:**
+~~~~~
# a compound with three boxes
box b1 0 0 0 1 1 1
box b2 3 0 0 1 1 1
box b3 6 0 0 1 1 1
compound b1 b2 b3 c
+~~~~~
+@subsubsection occt_draw_7_1_5 checkshape
-@subsubsection occt_2142243456_1869436669715 checkshape
-
-Syntax: checkshape [-top] shape [result] [-short]
+Syntax:
+~~~~~
+checkshape [-top] shape [result] [-short]
+~~~~~
Where:
-*-top* – check only topological validity of a shape.
-*shape *– the only required parameter which represents the name of the shape to check.
-*result* – optional parameter which is the prefix of the output shape names.
-*-short* – short description of check.
+* *top* – optional parameter, which allows checking only topological validity of a shape.
+* *shape*– the only required parameter which represents the name of the shape to check.
+* *result* – optional parameter which is the prefix of the output shape names.
+* *short* – a short description of the check.
+**checkshape** examines the selected object for topological and geometric coherence. The object should be a three dimensional shape.
-**checkshape **examines the selected object for topological and geometric coherence. The object should be a three dimensional shape.
**Example:**
-
+~~~~~
# checkshape returns a comment valid or invalid
box b1 0 0 0 1 1 1
checkshape b1
# returns the comment
this shape seems to be valid
+~~~~~
-<h4>NOTE</h4>
-*This test is performed using the tolerance set in the algorithm.*
-
-
-
+**Note** that this test is performed using the tolerance set in the algorithm.
-@subsection occt_2142243456_186943666972 Curve and surface topology
+@subsection occt_draw_7_2 Curve and surface topology
This group of commands is used to create topology from shapes and to extract shapes from geometry.
- * To create vertices, use the **vertex **command.
- * To create edges use, the **edge**, **mkedge **commands.
- * To create wires, use the **wire**, **polyline**, **polyvertex **commands.
- * To create faces, use the **mkplane**, **mkface **commands.
- * To extract the geometry from edges or faces, use the **mkcurve **and **mkface **commands.
- * To extract the 2d curves from edges or faces, use the **pcurve **command.
+ * To create vertices, use the **vertex** command.
+ * To create edges use, the **edge**, **mkedge** commands.
+ * To create wires, use the **wire**, **polyline**, **polyvertex** commands.
+ * To create faces, use the **mkplane**, **mkface** commands.
+ * To extract the geometry from edges or faces, use the **mkcurve** and **mkface** commands.
+ * To extract the 2d curves from edges or faces, use the **pcurve** command.
-@subsubsection occt_2142243456_1869436669721 vertex
+@subsubsection occt_draw_7_2_1 vertex
-Syntax: vertex name [x y z / p edge]
+Syntax:
+~~~~~
+vertex name [x y z / p edge]
+~~~~~
Creates a vertex at either a 3d location x,y,z or the point at parameter p on an edge.
-**Example:**
+**Example:**
+~~~~~
vertex v1 10 20 30
+~~~~~
+@subsubsection occt_draw_7_2_2 edge, mkedge, uisoedge, visoedge
-@subsubsection occt_2142243456_1869436669722 edge, mkedge, uisoedge, visoedge
-
-Syntax: edge name vertex1 vertex2
+Syntax:
+~~~~~
+edge name vertex1 vertex2
mkedge edge curve [surface] [pfirst plast] [vfirst [pfirst] vlast [plast]]
uisoedge edge face u v1 v2
visoedge edge face v u1 u2
+~~~~~
-**edge **creates a straight line edge between two vertices.
+* **edge** creates a straight line edge between two vertices.
+* **mkedge** generates edges from curves<.Two parameters can be given for the vertices: the first and last parameters of the curve are given by default. Vertices can also be given with their parameters, this option allows blocking the creation of new vertices. If the parameters of the vertices are not given, they are computed by projection on the curve. Instead of a 3d curve, a 2d curve and a surface can be given.
-**mkedge **generates edges from curves<a href="#_ftn4">[4]</a>.Two parameters can be given for the vertices: the first and last parameters of the curve are given by default. Vertices can also be given with their parameters, this option allows you to block the creation of new vertices. If the parameters of the vertices are not given, they are computed by projection on the curve. Instead of a 3d curve, a 2d curve and a surface can be given.
**Example:**
-
+~~~~~
# straight line edge
vertex v1 10 0 0
vertex v2 10 10 0
# The trimming is removed by mkedge
trim c c 0 pi/2
mkedge e2 c
+~~~~~
-**visoedge **and **uisoedge **are commands that generate a uiso parameter edge
-or a viso parameter edge.
+* **visoedge** and **uisoedge** are commands that generate a *uiso* parameter edge or a *viso* parameter edge.
**Example:**
-
+~~~~~
# to create an edge between v1 and v2 at point u
# to create the example plane
plane p
# to create the edge in the plane at the u axis point
0.5, and between the v axis points v=0.2 and v =0.8
uisoedge e p 0.5 0.20 0.8
+~~~~~
+@subsubsection occt_draw_7_2_3 wire, polyline, polyvertex
-@subsubsection occt_2142243456_1869436669723 wire, polyline, polyvertex
-
-Syntax: wire wirename e1/w1 [e2/w2 ...]
+Syntax:
+~~~~~
+wire wirename e1/w1 [e2/w2 ...]
polyline name x1 y1 z1 x2 y2 z2 ...
polyvertex name v1 v2 ...
+~~~~~
-**wire **creates a wire from edges or wires. The order of the elements should ensure that the wire is connected, and vertex locations will be compared to detect connection. If the vertices are different, new edges will be created to ensure topological connectivity. The original edge may be copied in the new one.
+**wire** creates a wire from edges or wires. The order of the elements should ensure that the wire is connected, and vertex locations will be compared to detect connection. If the vertices are different, new edges will be created to ensure topological connectivity. The original edge may be copied in the new one.
-**polyline **creates a polygonal wire from point coordinates. To make a closed wire, you should give the first point again at the end of the argument list.
+**polyline** creates a polygonal wire from point coordinates. To make a closed wire, you should give the first point again at the end of the argument list.
-**polyvertex **creates a polygonal wire from vertices.
-**Example:**
+**polyvertex** creates a polygonal wire from vertices.
+**Example:**
+~~~~~
# create two polygonal wires
# glue them and define as a single wire
polyline w1 0 0 0 10 0 0 10 10 0
polyline w2 10 10 0 0 10 0 0 0 0
wire w w1 w2
+~~~~~
+@subsubsection occt_draw_7_2_4 profile
-@subsubsection occt_2142243456_1869436669724 profile
+Syntax
+~~~~~
+profile name [code values] [code values] ...
+~~~~~
-Syntax profile name [code values] [code values] ...
-**Code** **Values ** **Action**
-O X Y Z Sets the origin of the plane
-P DX DY DZ UX UY UZ Sets the normal and X of the plane
-F X Y Sets the first point
-X DX Translates a point along X
-Y DY Translates a point along Y
-L DL Translates a point along direction
-XX X Sets point X coordinate
-YY Y Sets point Y coordinate
-T DX DY Translates a point
-TT X Y Sets a point
-R Angle Rotates direction
-RR Angle Sets direction
-D DX DY Sets direction
-IX X Intersects with vertical
-IY Y Intersects with horizontal
-C Radius Angle Arc of circle tangent to direction
+**profile** builds a profile in a plane using a moving point and direction. By default, the profile is closed and a face is created. The original point is 0 0, and direction is 1 0 situated in the XY plane.
-<h5>Suffix</h5>
-No suffix Makes a closed face
-W Make a closed wire
-WW Make an open wire
+| **Code** | **Values ** | **Action** |
+| :------------ | :------------- | :---------------- |
+| O | X Y Z | Sets the origin of the plane |
+| P | DX DY DZ UX UY UZ | Sets the normal and X of the plane |
+| F | X Y | Sets the first point |
+| X | DX | Translates a point along X |
+| Y | DY | Translates a point along Y |
+| L | DL | Translates a point along direction |
+| XX | X | Sets point X coordinate |
+| YY | Y | Sets point Y coordinate |
+| T | DX DY | Translates a point |
+| TT | X Y | Sets a point |
+| R | Angle | Rotates direction |
+| RR | Angle | Sets direction |
+| D | DX DY | Sets direction |
+| IX | X | Intersects with vertical |
+| IY | Y | Intersects with horizontal |
+| C | Radius Angle | Arc of circle tangent to direction |
-**profile **builds a profile in a plane using a moving point and direction. By default, the profile is closed and a face is created. The original point is 0 0, and direction is 1 0 situated in the XY plane.
Codes and values are used to define the next point or change the direction. When the profile changes from a straight line to a curve, a tangent is created. All angles are in degrees and can be negative.
The point [code values] can be repeated any number of times and in any order to create the profile contour.
-The profile shape definition is the suffix; no suffix produces a face, **w **is a closed wire, **ww **is an open wire.
+| Suffix | Action |
+| :----- | :----- |
+| No suffix | Makes a closed face |
+| W | Make a closed wire |
+| WW | Make an open wire |
+
+The profile shape definition is the suffix; no suffix produces a face, *w* is a closed wire, *ww* is an open wire.
Code letters are not case-sensitive.
-**Example:**
+**Example:**
+~~~~~
# to create a trianglular plane using a vertex at the
origin, in the xy plane
profile p O 0 0 0 X 1 Y 0 x 1 y 1
-**Example:**
+~~~~~
+**Example:**
+~~~~~
# to create a contour using the different code
possibilities
# to create the plane with the same contour
profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 r 90 ix -0.3
+~~~~~
+@subsubsection occt_draw_7_2_5 bsplineprof
-@subsubsection occt_2142243456_1869436669725 bsplineprof
-
-Syntax: bsplineprof name [S face] [W WW]
+Syntax:
+~~~~~
+bsplineprof name [S face] [W WW]
+~~~~~
-for an edge : digitizes ... mouse button 2
-to end profile : mouse button 3
+* for an edge : <digitizes> ... <mouse button 2>
+* to end profile : <mouse button 3>
-Build a profile in the XY plane from digitizes
-By default the profile is closed and a face is built.
+Builds a profile in the XY plane from digitizes. By default the profile is closed and a face is built.
-W Make a closed wire
-WW Make an open wires
+**bsplineprof** creates a 2d profile from bspline curves using the mouse as the input. *MB1* creates the points, *MB2* finishes the current curve and starts the next curve, *MB3* closes the profile.
-**bsplineprof **creates a 2d profile from bspline curves using the mouse as the input. MB1 creates the points, MB2 finishes the current curve and starts the next curve, MB3 closes the profile.
+The profile shape definition is the suffix; no suffix produces a face, **w** is a closed wire, **ww** is an open wire.
-The profile shape definition is the suffix; no suffix produces a face, **w **is a closed wire, **ww **is an open wire.
**Example:**
-
+~~~~~
#to view the xy plane
top
#to create a 2d curve with the mouse
==
# click mb1 to create the second curve
# click mb3 to create the face
+~~~~~
+@subsubsection occt_draw_7_2_6 mkoffset
-@subsubsection occt_2142243456_1869436669726 mkoffset
+Syntax:
+~~~~~
+mkoffset result face/compound of wires nboffset stepoffset
+~~~~~
-Syntax: mkoffset result face/compound of wires nboffset stepoffset
+**mkoffset** creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurences is not limited.
-**mkoffset **creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurences is not limited.
+The offset distance defines the spacing and the positioning of the occurences.
-The offset distance defines the spacing and the positionning of the occurences.
**Example:**
-
+~~~~~
#Create a box and select a face
box b 1 2 3
explode b f
value of
0.4
mkoffset r b_1 1 -0.4
+~~~~~
-NOTE
-*The mkoffset command must be used with prudence, angular contours produce offset contours with fillets. Interior parallel contours can produce more than one wire, normally these are refused. In the following example, any increase in the offset value is refused*
-**Example:**
+**Note** that *mkoffset* command must be used with prudence, as angular contours produce offset contours with fillets. Interior parallel contours can produce more than one wire, normally these are refused. In the following example, any increase in the offset value is refused.
+**Example:**
+~~~~~
# to create the example contour
profile p F 0 0 x 2 y 4 tt 1 1 tt 0 4 w
# to create an incoherent interior offset
BRepFill_TrimEdgeTool: incoherent intersection
# to create two incoherent wires
mkoffset r p 1 -0.50
+~~~~~
+@subsubsection occt_draw_7_2_7 mkplane, mkface
-@subsubsection occt_2142243456_1869436669727 mkplane, mkface
-
-Syntax: mkplane name wire
+Syntax:
+~~~~~
+mkplane name wire
mkface name surface [ufirst ulast vfirst vlast]
+~~~~~
-**mkplane **generates a face from a planar wire. The planar surface will be constructed with an orientation which keeps the face inside the wire.
+**mkplane** generates a face from a planar wire. The planar surface will be constructed with an orientation which keeps the face inside the wire.
-**mkface **generates a face from a surface. Parameter values can be given to trim a rectangular area. The default boundaries are those of the surface.
-**Example:**
+**mkface** generates a face from a surface. Parameter values can be given to trim a rectangular area. The default boundaries are those of the surface.
+**Example:**
+~~~~~
# make a polygonal face
polyline f 0 0 0 20 0 0 20 10 0 10 10 0 10 20 0 0 20 0 0 0 0
mkplane f f
cylinder g 10
trim g g -pi/3 pi/2 0 15
mkface g g
+~~~~~
+@subsubsection occt_draw_7_2_8 mkcurve, mksurface
-@subsubsection occt_2142243456_1869436669728 mkcurve, mksurface
-
-Syntax: mkcurve curve edge
+Syntax:
+~~~~~
+mkcurve curve edge
mksurface name face
+~~~~~
-**mkcurve **creates a 3d curve from an edge. The curve will be trimmed to the edge boundaries.
+**mkcurve** creates a 3d curve from an edge. The curve will be trimmed to the edge boundaries.
-**mksurface **creates a surface from a face. The surface will not be trimmed.
-**Example:**
+**mksurface** creates a surface from a face. The surface will not be trimmed.
+**Example:**
+~~~~~
# make a line
vertex v1 0 0 0
vertex v2 10 0 0
edge e v1 v2
+~~~~~
+@subsubsection occt_draw_7_2_9 pcurve
+
+Syntax:
-@subsubsection occt_2142243456_1869436669729 pcurve
+~~~~~
+pcurve [name edgename] facename
+~~~~~
-Syntax: pcurve [name edgename] facename
+Extracts the 2d curve of an edge on a face. If only the face is specified, the command extracts all the curves and colors them according to their orientation. This is useful in checking to see if the edges in a face are correctly oriented, i.e. they turn counter-clockwise. To make curves visible, use a fitted 2d view.
-**pcurve **extracts the 2d curve of an edge on a face. If only the face is specified, the command extracts all the curves and colors them according to their orientation. This is useful in checking to see if the edges in a face are correctly oriented, i.e. they turn counterclockwise. To make curves visible, use a fitted 2d view.
**Example:**
-
+~~~~~
# view the pcurves of a face
plane p
trim p p -1 1 -1 1
av2d; # a 2d view
pcurve p
2dfit
+~~~~~
+@subsubsection occt_draw_7_2_10 chfi2d
-@subsubsection occt_2142243456_18694366697210 chfid
-
-Syntax: chfi2d result face [edge1 edge2 (F radius/CDD d1 d2/CDA d ang) ....
+Syntax:
+~~~~~
+chfi2d result face [edge1 edge2 (F radius/CDD d1 d2/CDA d ang) ....
+~~~~~
-chfi2d creates chamfers and fillets on 2D objects. Select t:wo adjacent edges and:
+Creates chamfers and fillets on 2D objects. Select two adjacent edges and:
* a radius value
* two respective distance values
* a distance value and an angle
**Example:**
-# to create a 2d fillet
+Let us create a 2d fillet:
+
+~~~~~
top
profile p x 2 y 2 x -2
chfi2d cfr p . . F 0.3
#select an edge
==Pick an object
#select an edge
-**Example:**
+~~~~~
-# to create a 2d chamfer using two distances
+Let us create a 2d chamfer using two distances:
+
+~~~~~
profile p x 2 y 2 x -2
chfi2d cfr p . . CDD 0.3 0.6
==Pick an object
#select an edge
==Pick an object
#select an edge
-**Example:**
+~~~~~
+
+Let us create a 2d chamfer using a defined distance and angle
-# to create a 2d chamfer using a defined distance and
-angle
+~~~~~
top
profile p x 2 y 2 x -2
chfi2d cfr p . . CDA 0.3 75
#select an edge
==Pick an object
#select an edge
+~~~~~
+@subsubsection occt_draw_7_2_11 nproject
-@subsubsection occt_2142243456_18694366697211 nproject
-
-Syntax: nproject pj e1 e2 e3 ... surf -g -d [dmax] [Tol
+Syntax:
+~~~~~
+nproject pj e1 e2 e3 ... surf -g -d [dmax] [Tol
[continuity [maxdeg [maxseg]]]
+~~~~~
-**nproject **creates a shape projection which is normal to the target surface.
-**Example:**
+Creates a shape projection which is normal to the target surface.
+**Example:**
+~~~~~
# create a curved surface
line l 0 0 0 1 0 0
trim l l 0 2
donly p e
# create the normal projection of the shape(circle)
nproject r e p
+~~~~~
-
-@subsection occt_2142243456_186943666973 Primitives
+@subsection occt_draw_7_3 Primitives
Primitive commands make it possible to create simple shapes. They include:
- * **box **and **wedge **commands.
- * **pcylinder**, **pcone**, **psphere**, **ptorus **commands.
- * **halfspace **command
+ * **box** and **wedge** commands.
+ * **pcylinder**, **pcone**, **psphere**, **ptorus** commands.
+ * **halfspace** command
-@subsubsection occt_2142243456_1869436669731 box, wedge
+@subsubsection occt_draw_7_3_1 box, wedge
-Syntax: box name [x y z] dx dy dz
+Syntax:
+~~~~~
+box name [x y z] dx dy dz
wedge name dx dy dz ltx / xmin zmin xmax xmax
+~~~~~
-**box **creates a box parallel to the axes with dimensions dx,dy,dz. x,y,z is the corner of the box. It is the default origin.
+**box** creates a box parallel to the axes with dimensions *dx,dy,dz*. *x,y,z* is the corner of the box. It is the default origin.
-**wedge **creates a box with five faces called a wedge. One face is in the OXZ plane, and has dimensions dx,dz while the other face is in the plane y = dy. This face either has dimensions ltx, dz or is bounded by xmin,zmin,xmax,zmax.
+**wedge** creates a box with five faces called a wedge. One face is in the OXZ plane, and has dimensions *dx,dz* while the other face is in the plane *y = dy*. This face either has dimensions *ltx, dz* or is bounded by *xmin,zmin,xmax,zmax*.
-The other faces are defined between these faces. The face in the y=yd plane may be degenerated into a line if ltx = 0, or a point if xmin = xmax and ymin = ymax. In these cases, the line and the point both have 5 faces each. To position the wedge use the **ttranslate **and **trotate **commands.
-**Example:**
+The other faces are defined between these faces. The face in the *y=yd* plane may be degenerated into a line if *ltx = 0*, or a point if *xmin = xmax* and *ymin = ymax*. In these cases, the line and the point both have 5 faces each. To position the wedge use the *ttranslate* and *trotate* commands.
+**Example:**
+~~~~~
# a box at the origin
box b1 10 20 30
# a pyramid
wedge w3 20 20 20 10 10 10 10
+~~~~~
+@subsubsection occt_draw_7_3_2 pcylinder, pcone, psphere, ptorus
-@subsubsection occt_2142243456_1869436669732 pcylinder, pcone, psphere, ptorus
-
-Syntax: pcylinder name [plane] radius height [angle]
+Syntax:
+~~~~~
+pcylinder name [plane] radius height [angle]
pcone name [plane] radius1 radius2 height [angle]
pcone name [plane] radius1 radius2 height [angle]
psphere name [plane] radius1 [angle1 angle2] [angle]
ptorus name [plane] radius1 radius2 [angle1 angle2] [angle]
+~~~~~
-All these commands create solid blocks in the default coordinate system, using the Z axis as the axis of revolution and the X axis as the origin of the angles. To use another system, translate and rotate the resulting solid or use a plane as first argument to specify a coordinate system. All primitives have an optional last argument which is an angle expreesed in degrees and located on the Z axis, starting from the X axis. The default angle is 360.
+All these commands create solid blocks in the default coordinate system, using the Z axis as the axis of revolution and the X axis as the origin of the angles. To use another system, translate and rotate the resulting solid or use a plane as first argument to specify a coordinate system. All primitives have an optional last argument which is an angle expressed in degrees and located on the Z axis, starting from the X axis. The default angle is 360.
-**pcylinder **creates a cylindrical block with the given radius and height.
+**pcylinder** creates a cylindrical block with the given radius and height.
-**pcone **creates a truncated cone of the given height with radius1 in the plane z = 0 and radius2 in the plane z = height. Neither radius can be negative, but one of them can be null.
+**pcone** creates a truncated cone of the given height with radius1 in the plane z = 0 and radius2 in the plane z = height. Neither radius can be negative, but one of them can be null.
-**psphere **creates a solid sphere centered on the origin. If two angles, *angle1 *and *angle2, *are given, the solid will be limited by two planes at latitude *angle1 *and *angle2*. The angles must be increasing and in the range -90,90.
+**psphere** creates a solid sphere centered on the origin. If two angles, *angle1* and *angle2*, are given, the solid will be limited by two planes at latitude *angle1* and *angle2*. The angles must be increasing and in the range -90,90.
-**ptorus **creates a solid torus with the given radii, centered on the origin, which is a point along the z axis. If two angles increasing in degree in the range 0 – 360 are given, the solid will be bounded by two planar surfaces at those positions on the circle.
-**Example:**
+**ptorus** creates a solid torus with the given radii, centered on the origin, which is a point along the z axis. If two angles increasing in degree in the range 0 – 360 are given, the solid will be bounded by two planar surfaces at those positions on the circle.
+**Example:**
+~~~~~
# a can shape
pcylinder cy 5 10
# half torus
ptorus to 20 5 0 90
-@subsubsection occt_2142243456_1869436669733 halfspace
+~~~~~
-Syntax: halfspace result face/shell x y z
+@subsubsection occt_draw_7_3_3 halfspace
-**halfspace **creates an infinite solid volume based on a face in a defined direction. This volume can be used to perform the boolean operation of cutting a solid by a face or plane.
-**Example:**
+Syntax:
+~~~~~
+halfspace result face/shell x y z
+~~~~~
+**halfspace** creates an infinite solid volume based on a face in a defined direction. This volume can be used to perform the boolean operation of cutting a solid by a face or plane.
+
+**Example:**
+~~~~~
box b 0 0 0 1 2 3
explode b f
==b_1 b_2 b_3 b_4 b_5 b_6
halfspace hr b_3 0.5 0.5 0.5
+~~~~~
-
-@subsection occt_2142243456_186943666974 Sweeping
+@subsection occt_draw_7_4 Sweeping
Sweeping creates shapes by sweeping out a shape along a defined path:
- * **prism **sweeps along a direction.
- * **revol **sweeps around an axis.
- * **pipe **sweeps along a wire.
- * **mksweep **and **buildsweep **are commands to create sweeps by defining the arguments and algorithms.
- * **thrusections **creates a sweep from wire in different planes.
+ * **prism** sweeps along a direction.
+ * **revol** sweeps around an axis.
+ * **pipe** sweeps along a wire.
+ * **mksweep** and **buildsweep** are commands to create sweeps by defining the arguments and algorithms.
+ * **thrusections** creates a sweep from wire in different planes.
+
+@subsubsection occt_draw_7_4_1 prism
-@subsubsection occt_2142243456_1869436669741 prism
+Syntax:
+~~~~~
+prism result base dx dy dz [Copy | Inf | SemiInf]
+~~~~~
-Syntax: prism result base dx dy dz [Copy | Inf | SemiInf]
+Creates a new shape by sweeping a shape in a direction. Any shape can be swept: a vertex gives an edge; an edge gives a face; and a face gives a solid.
-**prism **creates a new shape by sweeping a shape in a direction. Any shape can be swept: a vertex gives an edge; an edge gives a face; and a face gives a solid.
+The shape is swept along the vector *dx dy dz*. The original shape will be shared in the result unless *Copy* is specified. If *Inf* is specified the prism is infinite in both directions. If *SemiInf* is specified the prism is infinite in the *dx,dy,dz* direction, and the length of the vector has no importance.
-The shape is swept along the vector dx dy dz. The original shape will be shared in the result unless *Copy *is specified. If *Inf *is specified the prism is infinite in both directions. If *SemiInf *is specified the prism is infinite in the dx,dy,dz direction, and the length of the vector has no importance.
**Example:**
-
+~~~~~
# sweep a planar face to make a solid
polyline f 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 0 0 0
mkplane f f
+~~~~~
+@subsubsection occt_draw_7_4_2 revol
-@subsubsection occt_2142243456_1869436669742 revol
+Syntax:
+~~~~~
+revol result base x y z dx dy dz angle [Copy]
+~~~~~
-Syntax: revol result base x y z dx dy dz angle [Copy]
+Creates a new shape by sweeping a base shape through an angle along the axis *x,y,z dx,dy,dz*. As with the prism command, the shape can be of any type and is not shared if *Copy* is specified.
-**revol **creates a new shape by sweeping a base shape through an angle along the axis x,y,z dx,dy,dz. As with the prism command, the shape can be of any type and is not shared if *Copy *is specified.
**Example:**
-
+~~~~~
# shell by wire rotation
polyline w 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0
revol s w 20 0 0 0 1 0 90
+~~~~~
+@subsubsection occt_draw_7_4_3 pipe
-@subsubsection occt_2142243456_1869436669743 pipe
+Syntax:
+~~~~~
+pipe name wire_spine Profile
+~~~~~
-Syntax: pipe name wire_spine Profile
+Creates a new shape by sweeping a shape known as the profile along a wire known as the spine.
-**pipe **creates a new shape by sweeping a shape known as the profile along a wire known as the spine.
**Example:**
-
+~~~~~
# sweep a circle along a bezier curve to make a solid
pipe
wire profile profile
mkplane profile profile
pipe p spine profile
+~~~~~
+@subsubsection occt_draw_7_4_4 mksweep, addsweep, setsweep, deletesweep, buildsweep, simulsweep
-@subsubsection occt_2142243456_1869436669744 mksweep, deletesweep, buildsweep, simulsweep
-
-Syntax: mksweep wire
-addsweep wire[vertex][-M][-C] [auxiilaryshapedeletesweep wire
+Syntax:
+~~~~~
+mksweep wire
+addsweep wire[vertex][-M][-C] [auxiilaryshape]
+deletesweep wire
setsweep options [arg1 [arg2 [...]]]
-
-options are :
-
--FR : Tangent and Normal are defined by a Frenet trihedron
--CF : Tangent is given by Frenet,
-the Normal is computed to minimize the torsion
--DX Surf : Tangent and Normal are given by Darboux trihedron,
-Surf must be a shell or a face
--CN dx dy dz : BiNormal is given by dx dy dz
--FX Tx Ty TZ [Nx Ny Nz] : Tangent and Normal are fixed
--G guide 0|1(AC
simulsweep r [n] [option]
buildsweep [r] [option] [Tol]
+~~~~~
-These commands are used to create a shape from wires. One wire is designated as the contour that defines the direction; it is called the spine. At least one other wire is used to define the the sweep profile.
-
-**mksweep **initializes the sweep creation and defines the wire to be used as the spine.
-
-**addsweep **defines the wire to be used as the profile.
-
-**deletesweep **cancels the choice of profile wire, without leaving the mksweep mode. You can re-select a profile wire.
-
-**setsweep **commands the algorithms used for the construction of the sweep.
+options are :
+ * *-FR* : Tangent and Normal are defined by a Frenet trihedron
+ * *-CF* : Tangent is given by Frenet, the Normal is computed to minimize the torsion
+ * *-DX Surf* : Tangent and Normal are given by Darboux trihedron, surf must be a shell or a face
+ * *-CN dx dy dz* : BiNormal is given by *dx dy dz*
+ * *-FX Tx Ty TZ [Nx Ny Nz]* : Tangent and Normal are fixed
+ * *-G guide*
-**simulsweep **can be used to create a preview of the shape. [n] is the number of sections that are used to simulate the sweep.
+These commands are used to create a shape from wires. One wire is designated as the contour that defines the direction; it is called the spine. At least one other wire is used to define the the sweep profile.
+* **mksweep** initializes the sweep creation and defines the wire to be used as the spine.
+* **addsweep** defines the wire to be used as the profile.
+* **deletesweep** cancels the choice of profile wire, without leaving the mksweep mode. You can re-select a profile wire.
+* **setsweep** commands the algorithms used for the construction of the sweep.
+* **simulsweep** can be used to create a preview of the shape. [n] is the number of sections that are used to simulate the sweep.
+* **buildsweep** creates the sweep using the arguments defined by all the commands.
-**buildsweep **creates the sweep using the arguments defined by all the commands.
**Example:**
-
+~~~~~
#create a sweep based on a semi-circular wire using the
Frenet algorithm
#create a circular figure
addsweep w -R
# to simulate the sweep with a visual approximation
simulsweep w 3
+~~~~~
+@subsubsection occt_draw_7_4_5 thrusections
-@subsubsection occt_2142243456_1869436669745 thrusections
+Syntax:
+~~~~~
+thrusections [-N] result issolid isruled wire1 wire2 [..wire..]
+~~~~~
-Syntax: thrusections [-N] result issolid isruled wire1 wire2 [..wire..]
+**thrusections** creates a shape using wires that are positioned in different planes. Each wire selected must have the same number of edges and vertices.
+A bezier curve is generated between the vertices of each wire. The option *[-N]* means that no check is made on wires for direction.
-**thrusections **creates a shape using wires that are positioned in different planes. Each wire selected must have the same number of edges and vertices.
-A bezier curve is generated between the vertices of each wire. The option [-N] means no check is made on wires for direction.
**Example:**
-
+~~~~~
#create three wires in three planes
polyline w1 0 0 0 5 0 0 5 5 0 2 3 0
polyline w2 0 1 3 4 1 3 4 4 3 1 3 3
==thrusections th issolid isruled w1 w2 w3
Tolerances obtenues -- 3d : 0
-- 2d : 0
+~~~~~
+@subsection occt_draw_7_5 Topological transformation
+Transformations are applications of matrices. When the transformation is nondeforming, such as translation or rotation, the object is not copied. The topology localcoordinate system feature is used. The copy can be enforced with the **tcopy** command.
-
-@subsection occt_2142243456_186943666975 Topological transformation
-
-Transformations are applications of matrices. When the transformation is nondeforming, such as translation or rotation, the object is not copied. The topology localcoordinate system feature is used. The copy can be enforced with the **tcopy **command.
-
- * **tcopy **makes a copy of the structure of a shape.
- * **ttranslate**, **trotate**, **tmove**, **reset **move a shape.
- * **tmirror**, **tscale **always modify the shape.
+ * **tcopy** makes a copy of the structure of a shape.
+ * **ttranslate**, **trotate**, **tmove**, **reset** move a shape.
+ * **tmirror**, **tscale** always modify the shape.
-@subsubsection occt_2142243456_1869436669751 tcopy
+@subsubsection occt_draw_7_5_1 tcopy
-Syntax: tcopy name toname [name toname ...]
+Syntax:
+~~~~~
+tcopy name toname [name toname ...]
+~~~~~
Copies the structure of one shape, including the geometry, into another, newer shape.
-**Example:**
+**Example:**
+~~~~~
# create an edge from a curve and copy it
beziercurve c 3 0 0 0 10 0 0 20 10 0
mkedge e1 c
tcopy e1 e2
ttranslate e2 0 5 0
# now modify the curve, only e1 and e2 will be modified
+~~~~~
-@subsubsection occt_2142243456_1869436669752 tmove, treset
+@subsubsection occt_draw_7_5_2 tmove, treset
-Syntax: tmove name [name ...] shape
+Syntax:
+~~~~~
+tmove name [name ...] shape
reset name [name ...]
+~~~~~
-**tmove **and **reset **modify the location, or the local coordinate system of a shape.
+**tmove** and **reset** modify the location, or the local coordinate system of a shape.
-**tmove **applies the location of a given shape to other shapes. **reset **restores one or several shapes it to its or their original coordinate system(s).
-**Example:**
+**tmove** applies the location of a given shape to other shapes. **reset** restores one or several shapes it to its or their original coordinate system(s).
+**Example:**
+~~~~~
# create two boxes
box b1 10 10 10
box b2 20 0 0 10 10 10
tmove b2 b1
# return to original positions
reset b1 b2
+~~~~~
+@subsubsection occt_draw_7_5_3 ttranslate, trotate
-@subsubsection occt_2142243456_1869436669753 ttranslate, trotate
-
-Syntax: ttranslate [name ...] dx dy dz
+Syntax:
+~~~~~
+ttranslate [name ...] dx dy dz
trotate [name ...] x y z dx dy dz angle
+~~~~~
-**ttranslate **translates a set of shapes by a given vector, and **trotate **rotates them by a given angle around an axis. Both commands only modify the location of the shape.
-When creating multiple shapes, the same location is used for all the shapes. (See toto.tcl example below. Note that the code of this file can also be directly executed in interactive mode.)
+**ttranslate** translates a set of shapes by a given vector, and **trotate** rotates them by a given angle around an axis. Both commands only modify the location of the shape.
+When creating multiple shapes, the same location is used for all the shapes. (See *toto.tcl* example below. Note that the code of this file can also be directly executed in interactive mode.)
Locations are very economic in the data structure because multiple occurences of an object share the topological description.
+
**Example:**
+~~~~~
# make rotated copies of a sphere in between two cylinders
# create a file source toto.tcl
# toto.tcl code:
# call the source file for multiple copies
source toto.tcl
+~~~~~
+@subsubsection occt_draw_7_5_4 tmirror, tscale
-@subsubsection occt_2142243456_1869436669754 tmirror, tscale
-
-Syntax: tmirror name x y z dx dy dz
+Syntax:
+~~~~~
+tmirror name x y z dx dy dz
tscale name x y z scale
+~~~~~
-**tmirror **makes a mirror copy of a shape about a plane x,y,z dx,dy,dz. **Tscale **applies a central homotopic mapping to a shape.
-**Example:**
+* **tmirror** makes a mirror copy of a shape about a plane x,y,z dx,dy,dz.
+
+* **Tscale** applies a central homotopic mapping to a shape.
+**Example:**
+~~~~~
# mirror a portion of cylinder about the YZ plane
pcylinder c1 10 10 270
copy c1 c2
tmirror c2 15 0 0 1 0 0
# and scale it
tscale c1 0 0 0 0.5
+~~~~~
+@subsection occt_draw_7_6 Old Topological operations
-@subsection occt_2142243456_186943666976 Old Topological operations
-
-
-
- * **fuse**, **cut**, **common **are boolean operations.
- * **section**, **psection **compute sections.
- * **sewing **joins two or more shapes.
+ * **fuse**, **cut**, **common** are boolean operations.
+ * **section**, **psection** compute sections.
+ * **sewing** joins two or more shapes.
-@subsubsection occt_2142243456_1869436669761 fuse, cut, common
+@subsubsection occt_draw_7_6_1 fuse, cut, common
-Syntax: fuse name shape1 shape2
+Syntax:
+~~~~~
+fuse name shape1 shape2
cut name shape1 shape2
common name shape1 shape2
+~~~~~
-**fuse **creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact.
+**fuse** creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact.
-**cut **creates a new shape which contains all parts of the second shape but only the first shape without the intersection of the two shapes.
+**cut** creates a new shape which contains all parts of the second shape but only the first shape without the intersection of the two shapes.
-**common **creates a new shape which contains only what is in common between the two original shapes in their intersection.
-**Example:**
+**common** creates a new shape which contains only what is in common between the two original shapes in their intersection.
+**Example:**
+~~~~~
# all four boolean operations on a box and a cylinder
box b 0 -10 5 20 20 10
common s4 b c
ttranslate s4 0 -40 0
+~~~~~
+@subsubsection occt_draw_7_6_2 section, psection
-@subsubsection occt_2142243456_1869436669762 section, psection
-
-Syntax: section result shape1 shape2
+Syntax:
+~~~~~
+section result shape1 shape2
psection name shape plane
+~~~~~
-**section **creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
+**section** creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
-**psection **creates a planar section consisting of the edges for the intersection curves on the faces of a shape and a plane.
-**Example:**
+**psection** creates a planar section consisting of the edges for the intersection curves on the faces of a shape and a plane.
+**Example:**
+~~~~~
# section line between a cylinder and a box
pcylinder c 10 20
box b 0 0 5 15 15 15
pcone c 10 30 30
plane p 0 0 15 1 1 2
psection s c p
+~~~~~
+@subsubsection occt_draw_7_6_3 sewing
-@subsubsection occt_2142243456_1869436669763 sewing
-
-Syntax: sewing result [tolerance] shape1 shape2 ...
+Syntax:
+~~~~~
+sewing result [tolerance] shape1 shape2 ...
+~~~~~
-**Sewing **joins shapes by connecting their adjacent or near adjacent edges. Adjacency can be redefined by modifying the tolerance value.
+**Sewing** joins shapes by connecting their adjacent or near adjacent edges. Adjacency can be redefined by modifying the tolerance value.
**Example:**
-
+~~~~~
# create two adjacent boxes
box b 0 0 0 1 2 3
box b2 0 2 0 1 2 3
sewing sr b b2
-whatis sr
-sr is a shape COMPOUND FORWARD Free Modified
-
-
-@subsection occt_2142243456_186943666977 New Topological operations
-
-
-The new algorithm of Boolean operations avoids a large number of weak points and limitations presented in the old boolean operation algorithm.
-
-
-@subsubsection occt_2142243456_1869436669771 bop, bopfuse, bopcut, boptuc, bopcommon,
+whatis sr
+sr is a shape COMPOUND FORWARD Free Modified
+~~~~~
-**bop** defines **shape1** and **shape2** subject to ulterior Boolean operations
+@subsection occt_draw_7_7 New Topological operations
-**bopfuse **creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact.
-**bopcut **creates a new shape which contains all parts of the second shape but only the first shape without the intersection of the two shapes.
+The new algorithm of Boolean operations avoids a large number of weak points and limitations presented in the old boolean operation algorithm.
-**boptuc **is a reverced** bopcut**.
-**bopcommon **creates a new shape which contains only whatever is in common between the two original shapes in their intersection.
+@subsubsection occt_draw_7_7_1 bop, bopfuse, bopcut, boptuc, bopcommon,
+* **bop** defines *shape1* and *shape2* subject to ulterior Boolean operations
+* **bopfuse** creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact.
+* **bopcut** creates a new shape which contains all parts of the second shape but only the first shape without the intersection of the two shapes.
+* **boptuc** is a reverced **bopcut**.
+* **bopcommon** creates a new shape which contains only whatever is in common between the two original shapes in their intersection.
-Syntax: bop shape1 shape2
+Syntax:
+~~~~~
+bop shape1 shape2
bopcommon result
bopfuse result
bopcut result
boptuc result
+~~~~~
These commands have short variants:
+~~~~~
bcommon result shape1 shape2
bfuse result shape1 shape2
bcut result shape1 shape2
+~~~~~
+
+**bop** fills data structure (DS) of boolean operation for *shape1* and *shape2*.
+**bopcommon, bopfuse, bopcut, boptuc** commands are used after **bop** command. After one **bop** command it is possible to call several commands from the list above. For example:
+
+~~~~~
+bop S1 S2
+bopfuse R
+~~~~~
-**bop** fills data structure (DS) of boolean operation for **shape1** and **shape2**.
-**bopcommon, bopfuse, bopcut, boptuc **commands used after **bop** command. After one **bop** command it is possible to call several commands from the list above. For example: **bop** S1 S2; **bopfuse** R.
**Example:**
-# all four boolean operations on a box and a cylinder
+Let us produce all four boolean operations on a box and a cylinder:
+~~~~~
box b 0 -10 5 20 20 10
pcylinder c 5 20
bopcommon s4
ttranslate s4 0 -40 0
+~~~~~
+Now use short variants of the commands:
-Short variants of commands:
-
+~~~~~
bfuse s11 b c
ttranslate s11 40 0 100
bcommon s14 b c
ttranslate s14 0 -40 100
+~~~~~
-@subsubsection occt_2142243456_1869436669772 bopsection
-
-**bopsection **creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
-
+@subsubsection occt_draw_7_7_2 bopsection
-Syntax: bop shape1 shape2
+Syntax:
+~~~~~
+bop shape1 shape2
bopsection result
+~~~~~
-
-
-Short variant:
-
+* **bopsection** creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
+* **bop** fills data structure (DS) of boolean operation for *shape1* and *shape2*.
+* **bopsection** command used after **bop** command.
+
+Short variant syntax:
+~~~~~
bsection result shape1 shape2 [-2d/-2d1/-2s2] [-a]
+~~~~~
-
-**bop** fills data structure (DS) of boolean operation for **shape1** and **shape2**.
-**bopsection** command used after **bop** command.
-
-**-2d** - PCurves are computed on both parts.
-**-2d1** - PCurves are computed on first part.
-**-2d2 **- PCurves are computed on second part.
-**-a** - geometries built are approximated.
-
+* <i>-2d</i> - PCurves are computed on both parts.
+* <i>-2d1</i> - PCurves are computed on first part.
+* <i>-2d2</i> - PCurves are computed on second part.
+* <i>-a</i> - built geometries are approximated.
**Example:**
-# section line between a cylinder and a box
+Let us build a section line between a cylinder and a box
+~~~~~
pcylinder c 10 20
box b 0 0 5 15 15 15
trotate b 0 0 0 1 1 1 20
bopsection s
# Short variant:
bsection s2 b c
+~~~~~
+@subsubsection occt_draw_7_7_3 bopcheck, bopargshape
-@subsubsection occt_2142243456_1869436669773 bopcheck, bopargshape
-
-Syntax: bopcheck shape
+Syntax:
+~~~~~
+bopcheck shape
bopargcheck shape1 [[shape2] [-F/O/C/T/S/U] [/R|F|T|V|E|I|P]] [#BF]
-
+~~~~~
**bopcheck** checks a shape for self-interference.
**bopargcheck** checks the validity of argument(s) for boolean operations.
--Boolean Operation
- **F** (fuse)
- **O** (common)
- **C** (cut)
- **T** (cut21)
- **S** (section)
- **U** (unknown)
-By default a section is made.
-
- /Test Options
- **R** (disable small edges (shrank range) test)
- **F** (disable faces verification test)
- **T** (disable tangent faces searching test)
- **V** (disable test possibility to merge vertices)
- **E** (disable test possibility to merge edges)
- **I** (disable self-interference test)
- **P** (disable shape type test)
-By default all options are enabled.
-
- #Additional Test Options
- **B** (stop test on first faulty found); default OFF
- **F** (full output for faulty shapes);
-**By **default the output is made in a short format.
-
- NOTE: Boolean Operation and Test Options are used only for a couple of argument shapes, except for **I** and **P** options that are always used to test a couple of shapes as well as a single shape.
+* Boolean Operation - (by default a section is made) :
+ * **F** (fuse)
+ * **O** (common)
+ * **C** (cut)
+ * **T** (cut21)
+ * **S** (section)
+ * **U** (unknown)
+* Test Options - (by default all options are enabled) :
+ * **R** (disable small edges (shrank range) test)
+ * **F** (disable faces verification test)
+ * **T** (disable tangent faces searching test)
+ * **V** (disable test possibility to merge vertices)
+ * **E** (disable test possibility to merge edges)
+ * **I** (disable self-interference test)
+ * **P** (disable shape type test)
+* Additional Test Options :
+ * **B** (stop test on first faulty found) - by default it is off;
+ * **F** (full output for faulty shapes) - by default the output is made in a short format.
+
+**Note** that Boolean Operation and Test Options are used only for a couple of argument shapes, except for <b>I</b> and <b>P</b> options that are always used to test a couple of shapes as well as a single shape.
**Example:**
-
+~~~~~
# checks a shape on self-interference
box b1 0 0 0 1 1 1
bopcheck b1
# checks the validity of argument for boolean cut operations
box b2 0 0 0 10 10 10
bopargcheck b1 b2 -C
+~~~~~
-
-@subsection occt_2142243456_186943666978 Drafting and blending
+@subsection occt_draw_7_8 Drafting and blending
Drafting is creation of a new shape by tilting faces through an angle.
Blending is the creation of a new shape by rounding edges to create a fillet.
- * Use the **depouille **command for drafting.
- * Use the **chamf **command to add a chamfer to an edge
- * Use the **blend **command for simple blending.
- * Use **fubl **for a fusion + blending operation.
- * Use **buildevol**, **mkevol**, **updatevol **to realize varying radius blending.
+ * Use the **depouille** command for drafting.
+ * Use the **chamf** command to add a chamfer to an edge
+ * Use the **blend** command for simple blending.
+ * Use **fubl** for a fusion + blending operation.
+ * Use **buildevol**, **mkevol**, **updatevol** to realize varying radius blending.
-@subsubsection occt_2142243456_1869436669781 depouille
+@subsubsection occt_draw_7_8_1 depouille
-Syntax: dep result shape dirx diry dirz face angle x y x dx dy dz [face angle...]
+Syntax:
+~~~~~
+dep result shape dirx diry dirz face angle x y x dx dy dz [face angle...]
+~~~~~
-**depouille **creates a new shape by drafting one or more faces of a shape.
+Creates a new shape by drafting one or more faces of a shape.
Identify the shape(s) to be drafted, the drafting direction, and the face(s) with an angle and an axis of rotation for each face. You can use dot syntax to identify the faces.
+
**Example:**
+~~~~~
# draft a face of a box
box b 10 10 10
explode b f
== b_1 b_2 b_3 b_4 b_5 b_6
dep a b 0 0 1 b_2 10 0 10 0 1 0 5
+~~~~~
+@subsubsection occt_draw_7_8_2 chamf
-@subsubsection occt_2142243456_1869436669782 chamf
-
-Syntax: chamf newname shape edge face S dist
+Syntax:
+~~~~~
+chamf newname shape edge face S dist
chamf newname shape edge face dist1 dist2
chamf newname shape edge face A dist angle
+~~~~~
-**chamf **creates a chamfer along the edge between faces using:
+Creates a chamfer along the edge between faces using:
* a equal distances from the edge
* the edge, a face and distance, a second distance
* the edge, a reference face and an angle
Use the dot syntax to select the faces and edges.
-**Example:**
-# to create a chamfer based on equal distances from the
-edge (45 degree angle)
+**Examples:**
+
+Let us create a chamfer based on equal distances from the edge (45 degree angle):
+~~~~~
# create a box
box b 1 2 3
chamf ch b . . S 0.5
# select an edge
==Pick an object
# select an adjacent face
-**Example:**
+~~~~~
-# to create a chamfer based on different distances from
-the selected edge
+Let us create a chamfer based on different distances from the selected edge:
+~~~~~
box b 1 2 3
chamf ch b . . 0.3 0.4
==Pick an object
# select an edge
==Pick an object
-# select an adjacent face
-**Example:**
-
-# to create a chamfer based on a distance from the edge
-and an angle
+# select an adjacent face
+~~~~~
+
+Let us create a chamfer based on a distance from the edge and an angle:
+
+~~~~~
box b 1 2 3
chamf ch b . . A 0.4 30
==Pick an object
# select an edge
==Pick an object
# select an adjacent face
+~~~~~
+@subsubsection occt_draw_7_8_3 blend
-@subsubsection occt_2142243456_1869436669783 blend
+Syntax:
+~~~~~
+blend result object rad1 ed1 rad2 ed2 ... [R/Q/P]
+~~~~~
-Syntax: blend result object rad1 ed1 rad2 ed2 ... [R/Q/P]
+Creates a new shape by filleting the edges of an existing shape. The edge must be inside the shape. You may use the dot syntax. Note that the blend is propagated to the edges of tangential planar, cylindrical or conical faces.
-**blend **creates a new shape by filleting the edges of an existing shape. The edge must be inside the shape. You may use the dot syntax. Note that the blend is propagated to the edges of tangential planar, cylindrical or conical faces.
**Example:**
-
+~~~~~
# blend a box, click on an edge
box b 20 20 20
blend b b 2 .
==- FilDS 0s
==- Reconstruction 0.06s
==- SetRegul 0s
+~~~~~
+@subsubsection occt_draw_7_8_4 fubl
-@subsubsection occt_2142243456_1869436669784 fubl
+Syntax:
+~~~~~
+fubl name shape1 shape2 radius
+~~~~~
+
+Creates a boolean fusion of two shapes and then blends (fillets) the intersection edges using the given radius.
-Syntax: fubl name shape1 shape2 radius
-** **
-**fubl **creates a boolean fusion of two shapes and then blends (fillets) the intersection edges using the given radius.
**Example:**
-
+~~~~~
# fuse-blend two boxes
box b1 20 20 5
copy b1 b2
ttranslate b2 -10 10 3
fubl a b1 b2 1
-See also: **fuse**, **blend**
+~~~~~
-@subsubsection occt_2142243456_1869436669785 mkevol, updatevol, buildevol
+@subsubsection occt_draw_7_8_5 mkevol, updatevol, buildevol
-Syntax: mkevol result object (then use updatevol) [R/Q/P]
+Syntax:
+~~~~~
+mkevol result object (then use updatevol) [R/Q/P]
updatevol edge u1 radius1 [u2 radius2 ...]
buildevol
+~~~~~
These three commands work together to create fillets with evolving radii.
-**mkevol **allows you to specify the shape and the name of the result. It returns the tolerances of the fillet.
+* **mkevol** allows specifying the shape and the name of the result. It returns the tolerances of the fillet.
+* **updatevol** allows describing the filleted edges you want to create. For each edge, you give a set of coordinates: parameter and radius and the command prompts you to pick the edge of the shape which you want to modify. The parameters will be calculated along the edges and the radius function applied to the whole edge.
+* **buildevol** produces the result described previously in **mkevol** and **updatevol**.
-**updatevol **allows you to describe the filleted edges you want to create. For each edge, you give a set of coordinates: parameter and radius and the command prompts you to pick the edge of the shape which you want to modify. The parameters will be calculated along the edges and the radius function applied to the whole edge.
-
-**buildevol **produces the result described previously in **mkevol **and **updatevol**.
**Example:**
-
+~~~~~
# makes an evolved radius on a box
box b 10 10 10
mkevol b b
==- FilDS 0.01s
==- Reconstruction 0.04s
==- SetRegul 0s
+~~~~~
-
-@subsection occt_2142243456_186943666979 Topological analysis
+@subsection occt_draw_7_9 Topological analysis
Analysis of shapes includes commands to compute length, area, volumes and inertial properties.
- * Use **lprops**, **sprops**, **vprops **to compute integral properties.
- * Use **bounding **to display the bounding box of a shape.
- * Use **distmini **to calculate the minimum distance between two shapes.
-
+ * Use **lprops**, **sprops**, **vprops** to compute integral properties.
+ * Use **bounding** to display the bounding box of a shape.
+ * Use **distmini** to calculate the minimum distance between two shapes.
+@subsubsection occt_draw_7_9_1 lprops, sprops, vprops
-@subsubsection occt_2142243456_1869436669791 lprops, sprops, vprops
-
-Syntax: lprops shape
+Syntax:
+~~~~~
+lprops shape
sprops shape
vprops shape
+~~~~~
-**lprops **computes the mass properties of all edges in the shape with a linear density of 1, **sprops **of all faces with a surface density of 1 and **vprops **of all solids with a density of 1.
+* **lprops** computes the mass properties of all edges in the shape with a linear density of 1;
+* **sprops** of all faces with a surface density of 1;
+* **vprops** of all solids with a density of 1.
All three commands print the mass, the coordinates of the center of gravity, the matrix of inertia and the moments. Mass is either the length, the area or the volume. The center and the main axis of inertia are displayed.
-**Example:**
+**Example:**
+~~~~~
# volume of a cylinder
pcylinder c 10 20
vprops c
IX = 366519.141446336
IY = 366519.141444962
I.Z = 314159.265357595
+~~~~~
+@subsubsection occt_draw_7_9_2 bounding
-@subsubsection occt_2142243456_1869436669792 bounding
-
-Syntax: bounding shape
+Syntax:
+~~~~~
+bounding shape
+~~~~~
Displays the bounding box of a shape. The bounding box is a cuboid created with faces parallel to the x, y, and z planes. The command returns the dimension values of the the box, *xmin ymin zmin xmax ymax zmax.*
-**Example:**
+**Example:**
+~~~~~
# bounding box of a torus
ptorus t 20 5
bounding t
5.0000001000000003
==27.059805107309852 27.059805107309852
5.0000001000000003
+~~~~~
+@subsubsection occt_draw_7_9_3 distmini
-@subsubsection occt_2142243456_1869436669793 distmini
+Syntax:
+~~~~~
+distmini name Shape1 Shape2
+~~~~~
-Syntax: distmini name Shape1 Shape2
+Calculates the minimum distance between two shapes. The calculation returns the number of solutions, If more than one solution exists. The options are displayed in the viewer(red) and the results are listed in the shell window. The *distmini* lines are considered as shapes which have a value v.
-**distmini **calculates the minimum distance between two shapes. The calculation returns the number of solutions, If more than one solution exists. The options are displayed in the viewer(red) and the results are listed in the shell window. The distmini lines are considered as shapes which have a value v.
**Example:**
-
+~~~~~
box b 0 0 0 10 20 30
box b2 30 30 0 10 20 30
distmini d1 b b2
==X=30 Y=30 Z=0
==d1_val d1 d12
+~~~~~
-
-
-
-@subsection occt_2142243456_1869436669710 Surface creation
+@subsection occt_draw_7_10 Surface creation
Surface creation commands include surfaces created from boundaries and from spaces between shapes.
+ * **gplate** creates a surface from a boundary definition.
+ * **filling** creates a surface from a group of surfaces.
- * gplate creates a surface from a boundary definition.
- * filling creates a surface from a group of surfaces.
-
+@subsubsection occt_draw_7_10_1 gplate,
-@subsubsection occt_2142243456_18694366697101 gplate,
+Syntax:
+~~~~~
+gplate result nbrcurfront nbrpntconst [SurfInit] [edge 0] [edge tang (1:G1;2:G2) surf]...[point] [u v tang (1:G1;2:G2) surf] ...
+~~~~~
-Syntax: gplate result nbrcurfront nbrpntconst [SurfInit] [edge 0] [edge tang (1:G1;2:G2) surf]...[point] [u v tang (1:G1;2:G2) surf] ...
+Creates a surface from a defined boundary. The boundary can be defined using edges, points, or other surfaces.
-**gplate **creates a surface from a defined boundary. The boundary can be defined using edges, points, or other surfaces.
**Example:**
-
+~~~~~
plane p
trim p p -1 3 -1 3
mkface p p
Approximation results
Approximation error : 0.000422195884750181
Criterium error : 3.43709808053967e-05
+~~~~~
-@subsubsection occt_2142243456_18694366697102 filling, fillingparam
+@subsubsection occt_draw_7_10_2 filling, fillingparam
-Syntax: filling result nbB nbC nbP [SurfInit] [edge][face]order...
+Syntax:
+~~~~~
+filling result nbB nbC nbP [SurfInit] [edge][face]order...
edge[face]order... point/u v face order...
+~~~~~
-**filling **creates a surface between borders. It uses the **gplate **algorithm but creates a surface that is tangential to the adjacent surfaces. The result is a smooth continuous surface based on the G1 criterion.
+Creates a surface between borders. This command uses the **gplate** algorithm but creates a surface that is tangential to the adjacent surfaces. The result is a smooth continuous surface based on the G1 criterion.
To define the surface border:
The surface can pass through other points. These are defined after the border definition.
-You can use the **fillingparam **command to access the filling parameters.
+You can use the *fillingparam* command to access the filling parameters.
The options are:
--l : to list current values
-
--i : to set default values
+ * <i>-l</i> : to list current values
+ * <i>-i</i> : to set default values
+ * <i>-rdeg nbPonC nbIt anis </i> : to set filling options
+ * <i>-c t2d t3d tang tcur </i> : to set tolerances
+ * <i>-a maxdeg maxseg </i> : Approximation option
--r deg nbPonC nbIt anis : to set filling options
-
--c t2d t3d tang tcur : to set tolerances
-
--a maxdeg maxseg : Approximation option
**Example:**
-
+~~~~~
# to create four curved survaces and a point
plane p
trim p p -1 3 -1 3
MaxDeg = 8
MaxSegments = 9
+~~~~~
-
-
-@subsection occt_2142243456_1869436669711 Complex Topology
+@subsection occt_draw_7_11 Complex Topology
Complex topology is the group of commands that modify the topology of shapes. This includes feature modeling.
-@subsubsection occt_2142243456_18694366697111 offsetshape, offsetcompshape
+@subsubsection occt_draw_7_11_1 offsetshape, offsetcompshape
-Syntax: offsetshape r shape offset [tol] [face ...]
+Syntax:
+~~~~~
+offsetshape r shape offset [tol] [face ...]
offsetcompshape r shape offset [face ...]
+~~~~~
-**offsetshape **and **offsetcompshape **assigns a thickness to the edges of a shape. The **offset **value can be negative or positive. This value defines the thickness and direction of the resulting shape. Each face can be removed to create a hollow object.
-
-The resulting shape is based on a calculation of intersections. In case of simple shapes such as a box, only the adjacent intersections are required and you can use the **offsetshape **command.
+**offsetshape** and **offsetcompshape** assign a thickness to the edges of a shape. The *offset* value can be negative or positive. This value defines the thickness and direction of the resulting shape. Each face can be removed to create a hollow object.
-In case of complex shapes, where intersections can occur from non-adjacent edges and faces, use the **offsetcompshape **command. **comp **indicates complete and requires more time to calculate the result.
+The resulting shape is based on a calculation of intersections. In case of simple shapes such as a box, only the adjacent intersections are required and you can use the **offsetshape** command.
+In case of complex shapes, where intersections can occur from non-adjacent edges and faces, use the **offsetcompshape** command. **comp** indicates complete and requires more time to calculate the result.
The opening between the object interior and exterior is defined by the argument face or faces.
-**Example:**
-
-box b1 10 20 30
-explode b1 f
-== b1_1 b1_2 b1_3 b1_4 b1_5 b1_6
-offsetcompshape r b1 -1 b1_3
-
-Syntax: offsetparameter tolerance intersection(c/p) join(a/i)
-offsetload shape offset [face1 face2 …]
-offsetonface face1 offset1 face2 offset2 …
-offsetperform result
-
-**offsetparameter** sets the values of parameters and options for the following command **offsetload**:
- * *tolerance* defines the coincidence tolerance criterion for generated shapes;
- * *intersection* defines the mode of intersection: *c* means complete intersection, *p* means partial intersection;
- * *join* defines the mode of connecting new adjacent faces: *a* means GeomAbs_Arc, *i* means GeomAbs_Intersection.
-
-**offsetload** loads shape, offset value and, if necessary, a set of faces to remove from the shape. These data are later used by command **offsetperform**.
-**offsetonface** indicates the faces of shape (loaded earlier by command **offsetload**) that should be shifted with special offset value. This command is optional. **Warning:** this command should be called only after **offsetload** and it takes effect only if parameter join = GeomAbs_Intersection.
-**offsetperform** performs the result of 3d-offset algorithm using the data loaded by previous commands.
**Example:**
-
+~~~~~
box b1 10 20 30
explode b1 f
== b1_1 b1_2 b1_3 b1_4 b1_5 b1_6
-offsetparameter 1e-7 p i
-offsetload b1 2 b1_1 b1_2
-offsetonface b1_3 5
-offsetperform result
-
-
+offsetcompshape r b1 -1 b1_3
+~~~~~
-@subsubsection occt_2142243456_18694366697112 featprism, featdprism, featrevol, featlf, featrf
+@subsubsection occt_draw_7_11_2 featprism, featdprism, featrevol, featlf, featrf
-Syntax: featprism shape element skface Dirx Diry Dirz Fuse(0/1/2) Modify(0/1)
+Syntax:
+~~~~~
+featprism shape element skface Dirx Diry Dirz Fuse(0/1/2) Modify(0/1)
featdprism shape face skface angle Fuse(0/1/2) Modify(0/1)
featrevol shape element skface Ox Oy Oz Dx Dy Dz Fuse(0/1/2) Modify(0/1)
featlf shape wire plane DirX DirY DirZ DirX DirY DirZ Fuse(0/1/2) Modify(0/1)
featrf shape wire plane X Y Z DirX DirY DirZ Size Size Fuse(0/1/2) Modify(0/1)
featperform prism/revol/pipe/dprism/lf result [[Ffrom] Funtil]
featperformval prism/revol/dprism/lf result value
+~~~~~
-**featprism **loads the arguments for a prism with contiguous sides normal to the face.
+**featprism** loads the arguments for a prism with contiguous sides normal to the face.
-**featdprism **loads the arguments for a prism which is created in a direction normal to the face and includes a draft angle.
+**featdprism** loads the arguments for a prism which is created in a direction normal to the face and includes a draft angle.
-**featrevol **loads the arguments for a prism with a circular evolution.
+**featrevol** loads the arguments for a prism with a circular evolution.
-**featlf **loads the arguments for a linear rib or slot. This feature uses planar faces and a wire as a guideline.
+**featlf** loads the arguments for a linear rib or slot. This feature uses planar faces and a wire as a guideline.
-**featrf **loads the arguments for a rib or slot with a curved surface. This feature uses a circular face and a wire as a guideline.
+**featrf** loads the arguments for a rib or slot with a curved surface. This feature uses a circular face and a wire as a guideline.
-**featperform **loads the arguments to create the feature.
+**featperform** loads the arguments to create the feature.
-**featperformval **uses the defined arguments to create a feature with a limiting value.
+**featperformval** uses the defined arguments to create a feature with a limiting value.
All the features are created from a set of arguments which are defined when you initialize the feature context. Negative values can be used to create depressions.
-**Example:**
-# to create a feature prism with a draft angle and a
-normal direction
+**Examples:**
+
+Let us create a feature prism with a draft angle and a normal direction :
+
+~~~~~
# create a box with a wire contour on the upper face
box b 1 1 1
profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5
featperformval dprism r 1
==BRepFeat_MakeDPrism::Perform(Height)
BRepFeat_Form::GlobalPerform ()
-Gluer
-still Gluer
-Gluer result
+ Gluer
+ still Gluer
+ Gluer result
+~~~~~
-# to create a feature prism with circular direction
+Let us create a feature prism with circular direction :
+
+~~~~~
# create a box with a wire contour on the upper face
box b 1 1 1
profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5
featperformval revol r 45
==BRepFeat_MakeRevol::Perform(Angle)
BRepFeat_Form::GlobalPerform ()
-Gluer
-still Gluer
-Gluer result
+ Gluer
+ still Gluer
+ Gluer result
+~~~~~
+
-# to create a slot using the linear feature
+Let us create a slot using the linear feature :
+
+~~~~~
#create the base model using the multi viewer
mu4
profile p x 5 y 1 x -3 y -0.5 x -1.5 y 0.5 x 0.5 y 4 x -1 y -5
# loads the linear feature arguments
featlf pr w pl 0 0 0.3 0 0 0 0 1
featperform lf result
+~~~~~
+
+Let us create a rib using the revolution feature :
-# to create a rib using the revolution feature
+~~~~~
#create the base model using the multi viewer
mu4
pcylinder c1 3 5
# loads the revolution feature arguments
featrf c1 w pl 0 0 0 0 0 1 0.3 0.3 1 1
featperform rf result
+~~~~~
+@subsubsection occt_draw_7_11_3 draft
-@subsubsection occt_2142243456_18694366697113 draft
-
-Syntax: draft result shape dirx diry dirz angle shape/surf/length [-IN/-OUT] [Ri/Ro] [-Internal]
+Syntax:
+~~~~~
+draft result shape dirx diry dirz angle shape/surf/length [-IN/-OUT] [Ri/Ro] [-Internal]
+~~~~~
-**draft **computes a draft angle surface from a wire. The surface is determined by the draft direction, the inclination of the draft surface, a draft angle, and a limiting distance.
+Computes a draft angle surface from a wire. The surface is determined by the draft direction, the inclination of the draft surface, a draft angle, and a limiting distance.
* The draft angle is measured in radians.
* The draft direction is determined by the argument -INTERNAL
- * The argument Ri/Ro deftermines wether the corner edges of the
-
-draft surface are angular or rounded.
-
+ * The argument Ri/Ro deftermines wether the corner edges of the draft surfaces are angular or rounded.
* Arguments that can be used to define the surface distance are:
- * length, a defined distance
- * shape, until the surface contacts a shape
- * surface, until the surface contacts a surface.
+ * length, a defined distance
+ * shape, until the surface contacts a shape
+ * surface, until the surface contacts a surface.
-<h4>NOTE</h4>
-*The original aim of adding a draft angle to a shape is to*
-*produce a shape which can be removed easily from a mould.*
-*The Examples below use larger angles than are used normally*
-*and the calculation results returned are not indicated.*
+**Note** that the original aim of adding a draft angle to a shape is to produce a shape which can be removed easily from a mould. The Examples below use larger angles than are used normally and the calculation results returned are not indicated.
**Example:**
-
+~~~~~
# to create a simple profile
profile p F 0 0 x 2 y 4 tt 0 4 w
# creates a draft with rounded angles
profile p F 0 0 x 2 y 4 tt 1 1.5 tt 0 4 w
# creates a draft with rounded external angles
draft res p 0 0 1 3 1 -Ro
+~~~~~
+@subsubsection occt_draw_7_11_4 deform
-@subsubsection occt_2142243456_18694366697114 deform, nurbsconvert
-
-Syntax: deform newname name CoeffX CoeffY CoeffZ
-
-**deform **modifies the shape using the x, y, and z coefficients. You can reduce or magnify the shape in the x,y, and z directions.
-
-Syntax nurbsconvert result name [result name]
+Syntax:
+~~~~~
+deform newname name CoeffX CoeffY CoeffZ
+~~~~~
-**nurbsconvert **changes the NURBS curve definition of a shape to a Bspline curve definition. This conversion is required for assymetric deformation and prepares the arguments for other commands such as **deform. **The conversion can be necessary when transferring shape data to other applications.
+Modifies the shape using the x, y, and z coefficients. You can reduce or magnify the shape in the x,y, and z directions.
+
**Example:**
-
+~~~~~
pcylinder c 20 20
deform a c 1 3 5
# the conversion to bspline is followed by the
deformation
+~~~~~
+
+@subsubsection occt_draw_7_11_5 nurbsconvert
+Syntax:
+
+~~~~~
+nurbsconvert result name [result name]
+~~~~~
-@subsection occt_2142243456_1869436669712 Texture Mapping to a Shape
+Changes the NURBS curve definition of a shape to a Bspline curve definition. This conversion is required for assymetric deformation and prepares the arguments for other commands such as **deform**. The conversion can be necessary when transferring shape data to other applications.
+
+
+@subsection occt_draw_7_12 Texture Mapping to a Shape
Texture mapping allows you to map textures on a shape. Textures are texture image files and several are predefined. You can control the number of occurrences of the texture on a face, the position of a texture and the scale factor of the texture.
-@subsubsection occt_2142243456_18694366697121 vtexture
+@subsubsection occt_draw_7_12_1 vtexture
-Syntax vtexture NameOfShape TextureFile
+Syntax:
+~~~~~
+vtexture NameOfShape TextureFile
vtexture NameOfShape
vtexture NameOfShape ?
vtexture NameOfShape IdOfTexture
+~~~~~
-**TextureFile **identifies the file containing the texture you want. The same syntax without **TextureFile **disables texture mapping. The question-mark ***?* **lists available textures. **IdOfTexture **allows you to apply predefined textures.
+**TextureFile** identifies the file containing the texture you want. The same syntax without **TextureFile** disables texture mapping. The question-mark <b>?</b> lists available textures. **IdOfTexture** allows applying predefined textures.
-@subsubsection occt_2142243456_18694366697122 vtexscale
+@subsubsection occt_draw_7_12_2 vtexscale
-Syntax: vtexscale NameOfShape ScaleU ScaleV
+Syntax:
+~~~~~
+vtexscale NameOfShape ScaleU ScaleV
vtexscale NameOfShape ScaleUV
vtexscale NameOfShape
+~~~~~
-**ScaleU **and **Scale V **allow you to scale the texture according to the U and V parameters individually, while **ScaleUV **applies the same scale to both parameters. The same syntax without **ScaleU**, **ScaleV **or **ScaleUV **disables texture scaling.
+*ScaleU* and *Scale V* allow scaling the texture according to the U and V parameters individually, while *ScaleUV* applies the same scale to both parameters.
-@subsubsection occt_2142243456_18694366697123 vtexorigin
+The syntax without *ScaleU*, *ScaleV* or *ScaleUV* disables texture scaling.
-Syntax vtexorigin NameOfShape UOrigin VOrigin
+@subsubsection occt_draw_7_12_3 vtexorigin
+
+Syntax:
+~~~~~
+vtexorigin NameOfShape UOrigin VOrigin
vtexorigin NameOfShape UVOrigin
vtexorigin NameOfShape
+~~~~~
+
+*UOrigin* and *VOrigin* allow placing the texture according to the U and V parameters individually, while *UVOrigin* applies the same position value to both parameters.
-**UOrigin **and **VOrigin **allow you to place the texture according to the U and V parameters individually while **UVOrigin **applies the same position value to both parameters. The same syntax without **UOrigin**, **VOrigin **or **UVOrigin **disables origin positioning.
+The syntax without *UOrigin*, *VOrigin* or *UVOrigin* disables origin positioning.
-@subsubsection occt_2142243456_18694366697124 vtexrepeat
+@subsubsection occt_draw_7_12_4 vtexrepeat
-Syntax vtexrepeat NameOfShape URepeat VRepeat
+Syntax:
+~~~~~
+vtexrepeat NameOfShape URepeat VRepeat
vtexrepeat NameOfShape UVRepeat
vtexrepeat NameOfShape
+~~~~~
-**URepeat **and **VRepeat **allow you to repeat the texture along the U and V parameters individually while **UVRepeat **applies the same number of repetitions for both parameters. The same syntax without **URepeat**, **VRepeat **or **UVRepeat **disables texture repetition.
+*URepeat* and *VRepeat* allow repeating the texture along the U and V parameters individually, while *UVRepeat* applies the same number of repetitions for both parameters.
-@subsubsection occt_2142243456_18694366697125 vtexdefault
+The same syntax without *URepeat*, *VRepeat* or *UVRepeat* disables texture repetition.
-Syntax vtexdefault NameOfShape
+@subsubsection occt_draw_7_12_5 vtexdefault
+
+Syntax:
+~~~~~
+vtexdefault NameOfShape
+~~~~~
-**Vtexdefault **sets or resets the texture mapping default parameters.
+*Vtexdefault* sets or resets the texture mapping default parameters.
The defaults are:
-URepeat = VRepeat = 1 = no repetition
-UOrigin = VOrigin = 1 = origin set at (0,0)
-UScale = VScale = 1 = texture covers 100% of the face
-@section occt_2142243456_1866931135 Data Exchange commands
-
+ * *URepeat = VRepeat = 1* no repetition
+ * *UOrigin = VOrigin = 1* origin set at (0,0)
+ * *UScale = VScale = 1* texture covers 100% of the face
-@subsection occt_2142243456_186693113581 General
+@section occt_draw_8 Data Exchange commands
This paragraph presents some general information about Data Exchange (DE) operations.
DE commands are intended for translation files of various formats (IGES,STEP) into OCCT shapes with their attributes (colors, layers etc.)
-This files include a number of entities. Each entity has its own number in the file which we call label and denote as # for a STEP file and D for an IGES file. Each file has entities called roots (one or more). A full description of such entities is contained in the Users’s Guide for a corresponding format.
+This files include a number of entities. Each entity has its own number in the file which we call label and denote as # for a STEP file and D for an IGES file. Each file has entities called roots (one or more). A full description of such entities is contained in the Users' Guides
+* for <a href="user_guides__step.html#occt_step_1">STEP format</a> and
+* for <a href="user_guides__iges.html#occt_iges_1">IGES format</a>.
-Each Draw session has an interface model – some structure for keeping various information.
-First step of translation – loading information from a file into a model.
-Second step – creation of an OpenCASCADE shape from this model.
-Each entity from file has its own number in the model (num).
-During the translation a map of correspondences between labels(from file) and numbers (from model) is created.
-The model and the mentioned map are used for working with most of DE commands.
+Each Draw session has an interface model, which is a structure for keeping various information.
-@subsection occt_2142243456_186693113582 IGES commands
+The first step of translation is loading information from a file into a model.
+The second step is creation of an OpenCASCADE shape from this model.
-These commands are used during the translation of IGES models.
+Each entity from a file has its own number in the model (num). During the translation a map of correspondences between labels(from file) and numbers (from model) is created.
+The model and the map are used for working with most of DE commands.
-@subsubsection occt_2142243456_1866931135821 igesread
+@subsection occt_draw_8_1 IGES commands
-Syntax: igesread file_name result_shape_name [selection]
+@subsubsection occt_draw_8_1_1 igesread
+
+Syntax:
+~~~~~
+igesread <file_name> <result_shape_name> [<selection>]
+~~~~~
+
+Reads an IGES file to an OCCT shape. This command will interactively ask the user to select a set of entities to be converted.
-Read an IGES file to an OCCT shape.
-This command will interactively ask the user to select a set of entities to be converted:
+
+| N | Mode | Description |
+| :-- | :-- | :---------- |
+| 0 | End | finish conversion and exit igesbrep |
+| 1 | Visible roots | convert only visible roots |
+| 2 | All roots | convert all roots |
+| 3 | One entity | convert entity with number provided by the user |
+| 4 | Selection | convert only entities contained in selection |
After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes (e.g., one shape per root or one shape for all the entities). It is also possible to save loaded shapes in files, and to cancel loading.
-The second parameter of this command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was ‘s’, they will be s_1, ... s_N.
-selection specifies the scope of selected entities in the model, it is xst-transferrable-roots by default. More about selection see in the *IGES FORMAT User’s Guide*.
-If we use symbol * as selection all roots will be translated.
-**Example:**
+The second parameter of this command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was *s*, they will be *s_1, ... s_N*.
+
+<i><selection></i> specifies the scope of selected entities in the model, by default it is *xst-transferrable-roots*. If we use symbol <i>*</i> as <i><selection></i> all roots will be translated.
+
+See also the detailed description of <a href="user_guides__iges.html#occt_iges_2_3_4">Selecting IGES entities</a>.
+
+**Example:**
+~~~~~
# translation all roots from file
igesread /disk01/files/model.igs a *
+~~~~~
-@subsubsection occt_2142243456_1866931135822 tplosttrim
+@subsubsection occt_draw_8_1_2 tplosttrim
-Syntax: tplosttrim [IGES_type]
+Syntax:
+~~~~~
+tplosttrim [<IGES_type>]
+~~~~~
Sometimes the trimming contours of IGES faces (i.e., entity 141 for 143, 142 for 144) can be lost during translation due to fails. This command gives us a number of lost trims and the number of corresponding IGES entities.
It outputs the rank and numbers of faces that lost their trims and their numbers for each type (143, 144, 510) and their total number. If a face lost several of its trims it is output only once.
-Optional parameter IGES_type can be TrimmedSurface, BoundedSurface or Face to specify the only type of IGES faces.
-**Example:**
+Optional parameter <i><IGES_type></i> can be *0TrimmedSurface, BoundedSurface* or *Face* to specify the only type of IGES faces.
+**Example:**
+~~~~~
tplosttrim TrimmedSurface
+~~~~~
-@subsubsection occt_2142243456_1866931135823 brepiges
+@subsubsection occt_draw_8_1_3 brepiges
-Syntax: brepiges shape_name filename.igs
+Syntax:
+~~~~~
+brepiges <shape_name> <filename.igs>
+~~~~~
Writes an OCCT shape to an IGES file.
+
**Example:**
-
+~~~~~
# write shape with name aa to IGES file
brepiges aa /disk1/tmp/aaa.igs
== unit (write) : MM
== Now, to write a file, command : writeall filename
== Output on file : /disk1/tmp/aaa.igs
== Write OK
+~~~~~
-
-
-@subsection occt_2142243456_186693113583 STEP commands
+@subsection occt_draw_8_2 STEP commands
These commands are used during the translation of STEP models.
-@subsubsection occt_2142243456_1866931135831 stepread
+@subsubsection occt_draw_8_2_1 stepread
-Syntax: stepread file_name result_shape_name [selection]
+Syntax:
+~~~~~
+stepread file_name result_shape_name [selection]
+~~~~~
Read a STEP file to an OCCT shape.
This command will interactively ask the user to select a set of entities to be converted:
+| N | Mode | Description |
+| :---- | :---- | :---- |
+| 0 | End | Finish transfer and exit stepread |
+| 1 | root with rank 1 | Transfer first root |
+| 2 | root by its rank | Transfer root specified by its rank |
+| 3 | One entity | Transfer entity with a number provided by the user |
+| 4 | Selection | Transfer only entities contained in selection |
After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes.
-The second parameter of this command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was ‘s’, they will be s_1, ... s_N.
-selection specifies the scope of selected entities in the model. More about selection see in the *STEP FORMAT User’s Guide*.
-If as selection we use symbol * all roots will be translated.
-**Example:**
+The second parameter of this command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was *s*, they will be *s_1, ... s_N*.
+<i><selection></i> specifies the scope of selected entities in the model. If we use symbol <i>*</i> as <i><selection></i> all roots will be translated.
+See also the detailed description of <a href="user_guides__step.html#occt_step_2_3_6">Selecting STEP entities</a>.
+
+**Example:**
+~~~~~
# translation all roots from file
stepread /disk01/files/model.stp a *
+~~~~~
+
+@subsubsection occt_draw_8_2_2 stepwrite
+
+Syntax:
+~~~~~
+stepwrite mode shape_name file_name
+~~~~~
-@subsubsection occt_2142243456_1866931135832 stepwrite
+Writes an OCCT shape to a STEP file.
-Syntax: stepwrite mode shape_name file_name
+The following modes are available :
+ * *a* - as is – mode is selected automatically depending on the type & geometry of the shape;
+ * *m* - *manifold_solid_brep* or *brep_with_voids*
+ * *f* - *faceted_brep*
+ * *w* - *geometric_curve_set*
+ * *s* - *shell_based_surface_model*
+
+For further information see <a href="#user_guides__step.html#occt_step_6_5">Writing a STEP file</a>.
-Writes an OCCT shape to a STEP file.
-The available modes are the following:
- 0 or ‘a’ - ;as is; mode – mode is selected automatically depending on type & geometry of the shape
- 1 or ‘m’ - manifold_solid_brep or brep_with_voids
- 2 or ‘f’ - faceted_brep
- 3 or ‘w’ - geometric_curve_set
- 4 or ‘s’ - shell_based_surface_model
-For further information see ;STEP FORMAT User’s Guide ;.
**Example:**
-# write shape with name a to STEP file with mode 0
+Let us write shape *a* to a STEP file in mode *0*.
+
+~~~~~
stepwrite 0 a /disk1/tmp/aaa.igs
+~~~~~
+@subsection occt_draw_8_3 General commands
-@subsection occt_2142243456_186693113584 General commands
+These are auxilary commands used for the analysis of result of translation of IGES and STEP files.
-These commands are auxilary commands. Most of them are used for the analysis of result of translation of IGES and STEP files.
+@subsubsection occt_draw_8_3_1 count
-@subsubsection occt_2142243456_1866931135841 count
+Syntax:
+~~~~~
+count <counter> [<selection>]
+~~~~~
-Syntax: count counter [selection]
+Calculates statistics on the entities in the model and outputs a count of entities.
-Is used to calculate statistics on the entities in the model.
-Gives us a count of entities.
-The optional selection argument, if specified, defines a subset of entities, which are to be taken into account. The first argument should be one of the currently defined counters (for example):
+The optional selection argument, if specified, defines a subset of entities, which are to be taken into account. The first argument should be one of the currently defined counters.
-**Example:**
+| Counter | Operation |
+| :-------- | :-------- |
+| xst-types | Calculates how many entities of each OCCT type exist |
+| step214-types | Calculates how many entities of each STEP type exist |
+**Example:**
+~~~~~
count xst-types
+~~~~~
+
+@subsubsection occt_draw_8_3_2 data
-@subsubsection occt_2142243456_1866931135842 data
+Syntax:
+~~~~~
+data <symbol>
+~~~~~
-Syntax: data symbol
+Obtains general statistics on the loaded data.
+The information printed by this command depends on the symbol specified.
-Is used to obtain general statistics on the loaded data.
-Information printed by this command depends on the symbol specified:
**Example:**
-
+~~~~~
# print full information about warnings and fails
data c
+~~~~~
+
+| Symbol | Output |
+| :------ | :------ |
+| g | Prints the information contained in the header of the file |
+| c or f | Prints messages generated during the loading of the STEP file (when the procedure of the integrity of the loaded data check is performed) and the resulting statistics (f works only with fail messages while c with both fail and warning messages) |
+| t | The same as c or f, with a list of failed or warned entities |
+| m or l | The same as t but also prints a status for each entity |
+| e | Lists all entities of the model with their numbers, types, validity status etc. |
+| R | The same as e but lists only root entities |
+
-@subsubsection occt_2142243456_1866931135843 elabel
-Syntax: elabel num
+@subsubsection occt_draw_8_3_3 elabel
+
+Syntax:
+~~~~~
+elabel <num>
+~~~~~
Entities in the IGES and STEP files are numbered in the succeeding order. An entity can be identified either by its number or by its label. Label is the letter ‘#'(for STEP, for IGES use ‘D’) followed by the rank. This command gives us a label for an entity with a known number.
-**Example:**
+**Example:**
+~~~~~
elabel 84
+~~~~~
-@subsubsection occt_2142243456_1866931135844 entity
+@subsubsection occt_draw_8_3_4 entity
-Syntax: entity #(D)_or_num level_of_information
+Syntax:
+~~~~~
+entity <#(D)>_or_<num> <level_of_information>
+~~~~~
The content of an IGES or STEP entity can be obtained by using this command.
Entity can be determined by its number or label.
-level_of_information has range [0-6]. You can get more information about this level using this command without parameters.
-**Example:**
+<i><level_of_information></i> has range [0-6]. You can get more information about this level using this command without parameters.
+**Example:**
+~~~~~
# full information for STEP entity with label 84
entity #84 6
+~~~~~
-@subsubsection occt_2142243456_1866931135845 enum
+@subsubsection occt_draw_8_3_5 enum
-Syntax: enum #(D)
+Syntax:
+~~~~~
+enum <#(D)>
+~~~~~
Prints a number for the entity with a given label.
-**Example:**
+**Example:**
+~~~~~
# give a number for IGES entity with label 21
enum D21
+~~~~~
-@subsubsection occt_2142243456_1866931135846 estatus
+@subsubsection occt_draw_8_3_6 estatus
-Syntax: estatus #(D)_or_num
+Syntax:
+~~~~~
+estatus <#(D)>_or_<num>
+~~~~~
The list of entities referenced by a given entity and the list of entities referencing to it can be obtained by this command.
-**Example:**
+**Example:**
+~~~~~
estatus #315
+~~~~~
+
+@subsubsection occt_draw_8_3_7 fromshape
-@subsubsection occt_2142243456_1866931135847 fromshape
+Syntax:
+~~~~~
+fromshape <shape_name>
+~~~~~
-Syntax: fromshape shape_name
+Gives the number of an IGES or STEP entity corresponding to an OCCT shape. If no corresponding entity can be found and if OCCT shape is a compound the command explodes it to subshapes and try to find corresponding entities for them.
-Gives us the number of an IGES or STEP entity corresponding to an OCCT shape. If no corresponding entity can be found and if OCCT shape is a compound the command explodes it to subshapes and try to find corresponding entities for them.
**Example:**
-
+~~~~~
fromshape a_1_23
+~~~~~
-@subsubsection occt_2142243456_1866931135848 givecount
+@subsubsection occt_draw_8_3_8 givecount
-Syntax: givecount selection_name [selection_name]
+Syntax:
+~~~~~
+givecount <selection_name> [<selection_name>]
+~~~~~
-**Example:**
+Prints a number of loaded entities defined by the selection argument.
+Possible values of <selection_name> you can find in the “IGES FORMAT Users’s Guide”.
+
+**Example:**
+~~~~~
givecount xst-model-roots
+~~~~~
-@subsubsection occt_2142243456_1866931135849 givelist
+@subsubsection occt_draw_8_3_9 givelist
-Syntax: givelist selection_name
+Syntax:
+~~~~~
+givelist <selection_name>
+~~~~~
Prints a list of a subset of loaded entities defined by the selection argument:
+| Selection | Description |
+| :------- | :----------- |
+| xst-model-all | all entities of the model |
+| xst-model-roots | all roots |
+| xst-pointed | (Interactively) pointed entities (not used in DRAW) |
+| xst-transferrable-all | all transferable (recognized) entities |
+| xst-transferrable-roots | Transferable roots |
-**Example:**
+**Example:**
+~~~~~
# give a list of all entities of the model
givelist xst-model-all
+~~~~~
-@subsubsection occt_2142243456_18669311358410 listcount
+@subsubsection occt_draw_8_3_10 listcount
-Syntax: listcount counter [selection ...]
+Syntax: listcount <counter> [<selection> ...]
Prints a list of entities per each type matching the criteria defined by arguments.
-Optional selection argument, if specified, defines a subset of entities, which are to be taken into account. Argument counter should be one of the currently defined counters:
+Optional <i><selection></i> argument, if specified, defines a subset of entities, which are to be taken into account. Argument <i><counter></i> should be one of the currently defined counters:
-**Example:**
+| Counter | Operation |
+| :----- | :------ |
+| xst-types | Calculates how many entities of each OCCT type exist |
+| iges-types | Calculates how many entities of each IGES type and form exist |
+| iges-levels | Calculates how many entities lie in different IGES levels |
+**Example:**
+~~~~~
listcount xst-types
+~~~~~
-@subsubsection occt_2142243456_18669311358411 listitems
+@subsubsection occt_draw_8_3_11 listitems
-Syntax: listitems
+Syntax:
+~~~~~
+listitems
+~~~~~
This command prints a list of objects (counters, selections etc.) defined in the current session.
-**Example:**
-listitems
-@subsubsection occt_2142243456_18669311358412 listtypes
+@subsubsection occt_draw_8_3_12 listtypes
-Syntax: listtypes [selection_name ...]
+Syntax:
+~~~~~
+listtypes [<selection_name> ...]
+~~~~~
Gives a list of entity types which were encountered in the last loaded file (with a number of entities of each type). The list can be shown not for all entities but for a subset of them. This subset is defined by an optional selection argument.
-**Example:**
-# full list of all entities with thier counts
-listtypes
-@subsubsection occt_2142243456_18669311358413 newmodel
+@subsubsection occt_draw_8_3_13 newmodel
-Syntax: newmodel
+Syntax:
+~~~~~
+newmodel
+~~~~~
Clears the current model.
-**Example:**
-newmodel
-@subsubsection occt_2142243456_18669311358414 param
+@subsubsection occt_draw_8_3_14 param
-Syntax: param [parameter] [value]
+Syntax:
+~~~~~
+param [<parameter>] [<value>]
+~~~~~
This command is used to manage translation parameters.
-Command without arguments gives us a full list of parameters with current values.
-Command with parameter (without value) gives us the current value of this parameter and all possible values for it. Command with value sets this new value to parameter.
-For more information about translation parameters see the corresponding User’s Guide.
+Command without arguments gives a full list of parameters with current values.
+Command with <i><parameter></i> (without <i><value></i>) gives us the current value of this parameter and all possible values for it. Command with <i><value></i> sets this new value to <i><parameter></i>.
+
**Example:**
-# info about possible schemes for writing STEP file
+Let us get the information about possible schemes for writing STEP file :
+
+~~~~~
param write.step.schema
+~~~~~
-@subsubsection occt_2142243456_18669311358415 sumcount
+@subsubsection occt_draw_8_3_15 sumcount
-Syntax: sumcount counter [selection ...]
+Syntax:
+~~~~~
+sumcount <counter> [<selection> ...]
+~~~~~
Prints only a number of entities per each type matching the criteria defined by arguments.
-**Example:**
+**Example:**
+~~~~~
sumcount xst-types
+~~~~~
-@subsubsection occt_2142243456_18669311358416 tpclear
+@subsubsection occt_draw_8_3_16 tpclear
-Syntax: tpclear
+Syntax:
+~~~~~
+tpclear
+~~~~~
Clears the map of correspondences between IGES or STEP entities and OCCT shapes.
-**Example:**
-tpclear
-@subsubsection occt_2142243456_18669311358417 tpdraw
-Syntax: tpdraw #(D)_or_num
+@subsubsection occt_draw_8_3_17 tpdraw
-**Example:**
+Syntax:
+~~~~~
+tpdraw <#(D)>_or_<num>
+~~~~~
+**Example:**
+~~~~~
tpdraw 57
+~~~~~
-@subsubsection occt_2142243456_18669311358418 tpent
+@subsubsection occt_draw_8_3_18 tpent
+
+Syntax:
+~~~~~
+tpent <#(D)>_or_<num>
+~~~~~
-Syntax: tpent #(D)_or_num
+Get information about the result of translation of the given IGES or STEP entity.
**Example:**
+~~~~~
+tpent \#23
+~~~~~
+
+@subsubsection occt_draw_8_3_19 tpstat
+
+Syntax:
+~~~~~
+tpstat [*|?]<symbol> [<selection>]
+~~~~~
-tpent #23
-@subsubsection occt_2142243456_18669311358419 tpstat
+Provides all statistics on the last transfer, including a list of transferred entities with mapping from IGES or STEP to OCCT types, as well as fail and warning messages. The parameter <i><symbol></i> defines what information will be printed:
-Syntax: tpstat [*|?]symbol [selection]
+* *g* - General statistics (a list of results and messages)
+* *c* - Count of all warning and fail messages
+* *C* - List of all warning and fail messages
+* *f* - Count of all fail messages
+* *F* - List of all fail messages
+* *n* - List of all transferred roots
+* *s* - The same, with types of source entity and the type of result
+* *b* - The same, with messages
+* *t* - Count of roots for geometrical types
+* *r* - Count of roots for topological types
+* *l* - The same, with the type of the source entity
-Gives all statistics on the last transfer, including the list of transferred entities with mapping from IGES or STEP to OCCT types, as well as fail and warning messages. The parameter *symbol *defines what information will be printed:
+The sign \* before parameters *n, s, b, t, r* makes it work on all entities (not only on roots).
+The sign ? before *n, s, b, t* limits the scope of information to invalid entities.
-The sign ‘*’ before the parameters **n**, **s**, **b**, **t**, **r** makes it work on all entities (not only on roots). The sign ‘?’ before **n**, **s**, **b**, **t** limits the scope of information to invalid entities.
-Optional argument selection can limit the action of the command with a selected subset of entities.
-**Example:**
+Optional argument \<selection\> can limit the action of the command to the selection, not to all entities.
+To get help, run this command without arguments.
+
+**Example:**
+~~~~~
# translation ratio on IGES faces
tpstat *l iges-faces
+~~~~~
-@subsubsection occt_2142243456_18669311358420 xload
+@subsubsection occt_draw_8_3_20 xload
-Syntax: xload file_name
+Syntax:
+~~~~~
+xload <file_name>
+~~~~~
This command loads an IGES or STEP file into memory (i.e. to fill the model with data from the file) without creation of an OCCT shape.
-**Example:**
+**Example:**
+~~~~~
xload /disk1/tmp/aaa.stp
+~~~~~
-
-@subsection occt_2142243456_186693113585 Overview of XDE commands
+@subsection occt_draw_8_4 Overview of XDE commands
These commands are used for translation of IGES and STEP files into an XCAF document (special document is inherited from CAF document and is intended for Extended Data Exchange (XDE) ) and working with it. XDE translation allows reading and writing of shapes with additional attributes – colors, layers etc. All commands can be divided into the following groups:
- * **XDE translation commands**
- * **XDE general commands**
- * **XDE shape’s commands**
- * **XDE color’s commands**
- * **XDE layer’s commands**
- * **XDE property’s commands**
+ * XDE translation commands
+ * XDE general commands
+ * XDE shape’s commands
+ * XDE color’s commands
+ * XDE layer’s commands
+ * XDE property’s commands
+Reminding: All operations of translation are performed with parameters managed by command <a href="#occt_draw_8_3_14">the command *param*</a>.
+@subsubsection occt_draw_8_4_1 ReadIges
-@subsection occt_2142243456_186693113586 XDE translation commands
-
-Reminding: All operations of translation are performed with parameters managed by command param (see above)
-
-@subsubsection occt_2142243456_1866931135861 ReadIges
-
-Syntax: ReadIges document file_name
+Syntax:
+~~~~~
+ReadIges document file_name
+~~~~~
Reads information from an IGES file to an XCAF document.
-**Example:**
+**Example:**
+~~~~~
ReadIges D /disk1/tmp/aaa.igs
-== Document saved with name D
+==> Document saved with name D
+~~~~~
-@subsubsection occt_2142243456_1866931135862 ReadStep
+@subsubsection occt_draw_8_4_2 ReadStep
-Syntax: ReadStep document file_name
+Syntax:
+~~~~~
+ReadStep <document> <file_name>
+~~~~~
Reads information from a STEP file to an XCAF document.
-**Example:**
+**Example:**
+~~~~~
ReadStep D /disk1/tmp/aaa.stp
== Document saved with name D
+~~~~~
-@subsubsection occt_2142243456_1866931135863 WriteIges
+@subsubsection occt_draw_8_4_3 WriteIges
-Syntax: WriteIges document file_name
+Syntax:
+~~~~~
+WriteIges <document> <file_name>
+~~~~~
**Example:**
-
+~~~~~
WriteIges D /disk1/tmp/aaa.igs
+~~~~~
-@subsubsection occt_2142243456_1866931135864 WriteStep
+@subsubsection occt_draw_8_4_4 WriteStep
-Syntax: WriteStep document file_name
+Syntax:
+~~~~~
+WriteStep <document> <file_name>
+~~~~~
Writes information from an XCAF document to a STEP file.
-**Example:**
+**Example:**
+~~~~~
WriteStep D /disk1/tmp/aaa.stp
+~~~~~
-@subsubsection occt_2142243456_1866931135865 XFileCur
+@subsubsection occt_draw_8_4_5 XFileCur
-Syntax: XFileCur
+Syntax:
+~~~~~
+XFileCur
+~~~~~
Returns the name of file which is set as the current one in the Draw session.
-**Example:**
+**Example:**
+~~~~~
XFileCur
== *as1-ct-203.stp*
+~~~~~
-@subsubsection occt_2142243456_1866931135866 XFileList
+@subsubsection occt_draw_8_4_6 XFileList
-Syntax: XFileList
+Syntax:
+~~~~~
+XFileList
+~~~~~
Returns a list all files that were transferred by the last transfer. This command is meant (assigned) for the assemble step file.
-**Example:**
+**Example:**
+~~~~~
XFileList
-== *as1-ct-Bolt.stp*
-== *as1-ct-L-Bracktet.stp*
-== *as1-ct-LBA.stp*
-== *as1-ct-NBA.stp*
-== …
+==> *as1-ct-Bolt.stp*
+==> *as1-ct-L-Bracktet.stp*
+==> *as1-ct-LBA.stp*
+==> *as1-ct-NBA.stp*
+==> …
+~~~~~
-@subsubsection occt_2142243456_1866931135867 XFileSet
+@subsubsection occt_draw_8_4_7 XFileSet
-Syntax: XFileSet filename
+Syntax:
+~~~~~
+XFileSet <filename>
+~~~~~
Sets the current file taking it from the components list of the assemble file.
-**Example:**
+**Example:**
+~~~~~
XFileSet as1-ct-NBA.stp
+~~~~~
-@subsubsection occt_2142243456_1866931135868 XFromShape
+@subsubsection occt_draw_8_4_8 XFromShape
-Syntax: XFromShape shape
+Syntax:
+~~~~~
+XFromShape <shape>
+~~~~~
-This command is similar to command *fromshape* (see above) but gives additional information about the name of file. It is useful in the case when a shape was translated from several files.
-**Example:**
+This command is similar to <a href="#occt_draw_8_3_7">the command *fromshape*</a>, but gives additional information about the file name. It is useful if a shape was translated from several files.
+**Example:**
+~~~~~
XFromShape a
-== Shape a: imported from entity 217:#26 in file as1-ct-Nut.stp
-
+==> Shape a: imported from entity 217:#26 in file as1-ct-Nut.stp
+~~~~~
-@subsection occt_2142243456_186693113587 XDE general commands
+@subsection occt_draw_8_5 XDE general commands
-@subsubsection occt_2142243456_1866931135871 XNewDoc
+@subsubsection occt_draw_8_5_1 XNewDoc
-Syntax: XNewDoc document
+Syntax:
+~~~~~
+XNewDoc <document>
+~~~~~
Creates a new XCAF document.
-**Example:**
+**Example:**
+~~~~~
XNewDoc D
+~~~~~
-@subsubsection occt_2142243456_1866931135872 XShow
+@subsubsection occt_draw_8_5_2 XShow
-Syntax: XShow document [ label1 … ]
+Syntax:
+~~~~~
+XShow <document> [ <label1> … ]
+~~~~~
Shows a shape from a given label in the 3D viewer. If the label is not given – shows all shapes from the document.
-**Example:**
+**Example:**
+~~~~~
# show shape from label 0:1:1:4 from document D
XShow D 0:1:1:4
+~~~~~
-@subsubsection occt_2142243456_1866931135873 XStat
+@subsubsection occt_draw_8_5_3 XStat
-Syntax: XStat document
+Syntax:
+~~~~~
+XStat <document>
+~~~~~
Prints common information from an XCAF document.
-**Example:**
+**Example:**
+~~~~~
XStat D
-==Statistis of shapes in the document:
-==level N 0 : 9
-==level N 1 : 18
-==level N 2 : 5
-==Total number of labels for shapes in the document = 32
-==Number of labels with name = 27
-==Number of labels with color link = 3
+==>Statistis of shapes in the document:
+==>level N 0 : 9
+==>level N 1 : 18
+==>level N 2 : 5
+==>Total number of labels for shapes in the document = 32
+==>Number of labels with name = 27
+==>Number of labels with color link = 3
==Number of labels with layer link = 0
-==Statistis of Props in the document:
-==Number of Centroid Props = 5
-==Number of Volume Props = 5
-==Number of Area Props = 5
-==Number of colors = 4
-==BLUE1 RED YELLOW BLUE2
-==Number of layers = 0
+==>Statistis of Props in the document:
+==>Number of Centroid Props = 5
+==>Number of Volume Props = 5
+==>Number of Area Props = 5
+==>Number of colors = 4
+==>BLUE1 RED YELLOW BLUE2
+==>Number of layers = 0
+~~~~~
-@subsubsection occt_2142243456_1866931135874 XWdump
+@subsubsection occt_draw_8_5_4 XWdump
-Syntax: XWdump document filename
+Syntax:
+~~~~~
+XWdump <document> <filename>
+~~~~~
Saves the contents of the viewer window as an image (XWD, png or BMP file).
-filename must have a corresponding extention.
-**Example:**
+<i><filename></i> must have a corresponding extention.
+**Example:**
+~~~~~
XWdump D /disk1/tmp/image.png
+~~~~~
-@subsubsection occt_2142243456_1866931135875 Xdump
+@subsubsection occt_draw_8_5_5 Xdump
-Syntax: Xdump document [int deep {0|1}]
+Syntax:
+~~~~~
+Xdump <document> [int deep {0|1}]
+~~~~~
Prints information about the tree structure of the document. If parameter 1 is given, then the tree is printed with a link to shapes.
-**Example:**
+**Example:**
+~~~~~
Xdump D 1
-== ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448)
-== ASSEMBLY 0:1:1:2 NUT(0xe82151e8)
-== ASSEMBLY 0:1:1:3 BOLT(0xe829b000)
-== ASSEMBLY 0:1:1:4 PLATE(0xe8387780)
-== ASSEMBLY 0:1:1:5 ROD(0xe8475418)
-== ASSEMBLY 0:1:1:6 AS1(0xe8476968)
-== ASSEMBLY 0:1:1:7 L-BRACKET-ASSEMBLY(0xe8476230)
-== ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448)
-== ASSEMBLY 0:1:1:8 NUT-BOLT-ASSEMBLY(0xe8475ec0)
-== ASSEMBLY 0:1:1:2 NUT(0xe82151e8)
-== ASSEMBLY 0:1:1:3 BOLT(0xe829b000)
+==> ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448)
+==> ASSEMBLY 0:1:1:2 NUT(0xe82151e8)
+==> ASSEMBLY 0:1:1:3 BOLT(0xe829b000)
+==> ASSEMBLY 0:1:1:4 PLATE(0xe8387780)
+==> ASSEMBLY 0:1:1:5 ROD(0xe8475418)
+==> ASSEMBLY 0:1:1:6 AS1(0xe8476968)
+==> ASSEMBLY 0:1:1:7 L-BRACKET-ASSEMBLY(0xe8476230)
+==> ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448)
+==> ASSEMBLY 0:1:1:8 NUT-BOLT-ASSEMBLY(0xe8475ec0)
+==> ASSEMBLY 0:1:1:2 NUT(0xe82151e8)
+==> ASSEMBLY 0:1:1:3 BOLT(0xe829b000)
etc.
+~~~~~
+@subsection occt_draw_8_6 XDE shape commands
-@subsection occt_2142243456_186693113588 XDE shape’s commands
-
-@subsubsection occt_2142243456_1866931135881 XAddComponent
+@subsubsection occt_draw_8_6_1 XAddComponent
-Syntax: XAddComponent document label shape
+Syntax:
+~~~~~
+XAddComponent <document> <label> <shape>
+~~~~~
Adds a component shape to assembly.
+
**Example:**
-# Add shape b as component shape to assembly shape from
-# label 0:1:1:1
+Let us add shape b as component shape to assembly shape from label *0:1:1:1*
+
+~~~~~
XAddComponent D 0:1:1:1 b
+~~~~~
-@subsubsection occt_2142243456_1866931135882 XAddShape
+@subsubsection occt_draw_8_6_2 XAddShape
-Syntax: XAddShape document shape [makeassembly=1]
+Syntax:
+~~~~~
+XAddShape <document> <shape> [makeassembly=1]
+~~~~~
Adds a shape (or an assembly) to a document. If this shape already exists in the document, then prints the label which points to it. By default, a new shape is added as an assembly (i.e. last parameter 1), otherwise it is necessary to pass 0 as the last parameter.
-**Example:**
+**Example:**
+~~~~~
# add shape b to document D
XAddShape D b 0
== 0:1:1:10
# if pointed shape is compound and last parameter in
# XAddShape command is used by default (1), then for
# each subshapes new label is created
+~~~~~
-@subsubsection occt_2142243456_1866931135883 XFindComponent
+@subsubsection occt_draw_8_6_3 XFindComponent
-Syntax: XFindComponent document shape
+Syntax:
+~~~~~
+XFindComponent <document> <shape>
+~~~~~
Prints a sequence of labels of the assembly path.
-**Example:**
+**Example:**
+~~~~~
XFindComponent D b
+~~~~~
-@subsubsection occt_2142243456_1866931135884 XFindShape
+@subsubsection occt_draw_8_6_4 XFindShape
-Syntax: XFindShape document shape
+Syntax:
+~~~~~
+XFindShape <document> <shape>
+~~~~~
Finds and prints a label with an indicated top-level shape.
-**Example:**
+**Example:**
+~~~~~
XFindShape D a
+~~~~~
-@subsubsection occt_2142243456_1866931135885 XGetFreeShapes
+@subsubsection occt_draw_8_6_5 XGetFreeShapes
-Syntax: XGetFreeShapes document [shape_prefix]
+Syntax:
+~~~~~
+XGetFreeShapes <document> [shape_prefix]
+~~~~~
Print labels or create DRAW shapes for all free shapes in the document.
-If [shape_prefix] is absent – prints labels, else – creates DRAW shapes with names
-[shape_prefix]_num (i.e. for example: there are 3 free shapes and [shape_prefix] = a therefore shapes will be created with names a_1, a_2 and a_3).
-Note: a free shape is a shape to which no other shape refers to.
-**Example:**
+If *shape_prefix* is absent – prints labels, else – creates DRAW shapes with names
+<i>shape_prefix</i>_num (i.e. for example: there are 3 free shapes and *shape_prefix* = a therefore shapes will be created with names a_1, a_2 and a_3).
+**Note**: a free shape is a shape to which no other shape refers to.
+
+**Example:**
+~~~~~
XGetFreeShapes D
== 0:1:1:6 0:1:1:10 0:1:1:12 0:1:1:13
XGetFreeShapes D sh
== sh_1 sh_2 sh_3 sh_4
+~~~~~
-@subsubsection occt_2142243456_1866931135886 XGetOneShape
+@subsubsection occt_draw_8_6_6 XGetOneShape
-Syntax: XGetOneShape shape document
+Syntax:
+~~~~~
+XGetOneShape <shape> <document>
+~~~~~
Creates one DRAW shape for all free shapes from a document.
-**Example:**
+**Example:**
+~~~~~
XGetOneShape a D
+~~~~~
-@subsubsection occt_2142243456_1866931135887 XGetReferredShape
+@subsubsection occt_draw_8_6_7 XGetReferredShape
-Syntax: XGetReferredShape document label
+Syntax:
+~~~~~
+XGetReferredShape <document> <label>
+~~~~~
Prints a label that contains a top-level shape that corresponds to a shape at a given label.
-**Example:**
+**Example:**
+~~~~~
XGetReferredShape D 0:1:1:1:1
+~~~~~
-@subsubsection occt_2142243456_1866931135888 XGetShape
+@subsubsection occt_draw_8_6_8 XGetShape
-Syntax: XGetShape result document label
+Syntax:
+~~~~~
+XGetShape <result> <document> <label>
+~~~~~
Puts a shape from the indicated label in document to result.
-**Example:**
+**Example:**
+~~~~~
XGetShape b D 0:1:1:3
+~~~~~
-@subsubsection occt_2142243456_1866931135889 XGetTopLevelShapes
+@subsubsection occt_draw_8_6_9 XGetTopLevelShapes
-Syntax: XGetTopLevelShapes document
+Syntax:
+~~~~~
+XGetTopLevelShapes <document>
+~~~~~
Prints labels that contain top-level shapes.
-**Example:**
+**Example:**
+~~~~~
XGetTopLevelShapes D
== 0:1:1:1 0:1:1:2 0:1:1:3 0:1:1:4 0:1:1:5 0:1:1:6 0:1:1:7
0:1:1:8 0:1:1:9
+~~~~~
-@subsubsection occt_2142243456_18669311358810 XLabelInfo
+@subsubsection occt_draw_8_6_10 XLabelInfo
-Syntax: XLabelInfo document label
+Syntax:
+~~~~~
+XLabelInfo <document> <label>
+~~~~~
Prints information about a shape, stored at an indicated label.
+
**Example:**
-
+~~~~~
XLabelInfo D 0:1:1:6
-== There are TopLevel Shape. There are an Assembly. This Shape don’t used.
+==> There are TopLevel shapes. There is an Assembly. This Shape is not used.
+~~~~~
-@subsubsection occt_2142243456_18669311358811 XNewShape
+@subsubsection occt_draw_8_6_11 XNewShape
-Syntax: XNewShape document
+Syntax:
+~~~~~
+XNewShape <document>
+~~~~~
Creates a new empty top-level shape.
-**Example:**
+**Example:**
+~~~~~
XNewShape D
+~~~~~
-@subsubsection occt_2142243456_18669311358812 XRemoveComponent
+@subsubsection occt_draw_8_6_12 XRemoveComponent
-Syntax: XRemoveComponent document label
+Syntax:
+~~~~~
+XRemoveComponent <document> <label>
+~~~~~
Removes a component from the components label.
-**Example:**
+**Example:**
+~~~~~
XRemoveComponent D 0:1:1:1:1
+~~~~~
-@subsubsection occt_2142243456_18669311358813 XRemoveShape
+@subsubsection occt_draw_8_6_13 XRemoveShape
-Syntax: XRemoveShape document label
+Syntax:
+~~~~~
+XRemoveShape <document> <label>
+~~~~~
Removes a shape from a document (by it’s label).
-**Example:**
+**Example:**
+~~~~~
XRemoveShape D 0:1:1:2
+~~~~~
-@subsubsection occt_2142243456_18669311358814 XSetShape
+@subsubsection occt_draw_8_6_14 XSetShape
-Syntax: XSetShape document label shape
+Syntax:
+~~~~~
+XSetShape <document> <label> <shape>
+~~~~~
Sets a shape at the indicated label.
-**Example:**
+**Example:**
+~~~~~
XSetShape D 0:1:1:3 b
+~~~~~
-@subsection occt_2142243456_186693113589 XDE color’s commands
+@subsection occt_draw_8_7_ XDE color commands
-@subsubsection occt_2142243456_1866931135891 XAddColor
+@subsubsection occt_draw_8_7_1 XAddColor
-Syntax: XAddColor document R G B
+Syntax:
+~~~~~
+XAddColor <document> <R> <G> <B>
+~~~~~
Adds color in document to the color table. Parameters R,G,B are real.
-**Example:**
+**Example:**
+~~~~~
XAddColor D 0.5 0.25 0.25
+~~~~~
-@subsubsection occt_2142243456_1866931135892 XFindColor
+@subsubsection occt_draw_8_7_2 XFindColor
-Syntax: XFindColor document R G B
+Syntax:
+~~~~~
+XFindColor <document> <R> <G> <B>
+~~~~~
Finds a label where the indicated color is situated.
-**Example:**
+**Example:**
+~~~~~
XFindColor D 0.25 0.25 0.5
-== 0:1:2:2
+==> 0:1:2:2
+~~~~~
-@subsubsection occt_2142243456_1866931135893 XGetAllColors
+@subsubsection occt_draw_8_7_3 XGetAllColors
-Syntax: XGetAllColors document
+Syntax:
+~~~~~
+XGetAllColors <document>
+~~~~~
Prints all colors that are defined in the document.
-**Example:**
+**Example:**
+~~~~~
XGetAllColors D
-== RED DARKORANGE BLUE1 GREEN YELLOW3
+==> RED DARKORANGE BLUE1 GREEN YELLOW3
+~~~~~
-@subsubsection occt_2142243456_1866931135894 XGetColor
+@subsubsection occt_draw_8_7_4 XGetColor
-Syntax: XGetColor document label
+Syntax:
+~~~~~
+XGetColor <document> <label>
+~~~~~
Returns a color defined at the indicated label from the color table.
-**Example:**
+**Example:**
+~~~~~
XGetColor D 0:1:2:3
== BLUE1
+~~~~~
-@subsubsection occt_2142243456_1866931135895 XGetObjVisibility
+@subsubsection occt_draw_8_7_5 XGetObjVisibility
-Syntax: XGetObjVisibility document {label|shape}
+Syntax:
+~~~~~
+XGetObjVisibility <document> {<label>|<shape>}
+~~~~~
Returns the visibility of a shape.
-**Example:**
+**Example:**
+~~~~~
XGetObjVisibility D 0:1:1:4
+~~~~~
-@subsubsection occt_2142243456_1866931135896 XGetShapeColor
+@subsubsection occt_draw_8_7_6 XGetShapeColor
-Syntax: XGetShapeColor document label colortype(s|c)
+Syntax:
+~~~~~
+XGetShapeColor <document> <label> <colortype(s|c)>
+~~~~~
-Returns the color defined by label. If colortype=’s’ – returns surface color, else – returns curve color.
-**Example:**
+Returns the color defined by label. If <i>colortype</i>=’s’ – returns surface color, else – returns curve color.
+**Example:**
+~~~~~
XGetShapeColor D 0:1:1:4 c
+~~~~~
-@subsubsection occt_2142243456_1866931135897 XRemoveColor
+@subsubsection occt_draw_8_7_7 XRemoveColor
-Syntax: XRemoveColor document label
+Syntax:
+~~~~~
+XRemoveColor <document> <label>
+~~~~~
Removes a color from the color table in a document.
-**Example:**
+**Example:**
+~~~~~
XRemoveColor D 0:1:2:1
+~~~~~
-@subsubsection occt_2142243456_1866931135898 XSetColor
+@subsubsection occt_draw_8_7_8 XSetColor
-Syntax: XSetColor document {label|shape} R G B
+Syntax:
+~~~~~
+XSetColor <document> {<label>|<shape>} <R> <G> <B>
+~~~~~
Sets an RGB color to a shape given by label.
-**Example:**
+**Example:**
+~~~~~
XsetColor D 0:1:1:4 0.5 0.5 0.
+~~~~~
-@subsubsection occt_2142243456_1866931135899 XSetObjVisibility
+@subsubsection occt_draw_8_7_9 XSetObjVisibility
-Syntax: XSetObjVisibility document {label|shape} {0|1}
+Syntax:
+~~~~~
+XSetObjVisibility <document> {<label>|<shape>} {0|1}
+~~~~~
Sets the visibility of a shape.
-**Example:**
+**Example:**
+~~~~~
# set shape from label 0:1:1:4 as invisible
XSetObjVisibility D 0:1:1:4 0
+~~~~~
-@subsubsection occt_2142243456_18669311358910 XUnsetColor
+@subsubsection occt_draw_8_7_10 XUnsetColor
-Syntax: XUnsetColor document {label|shape} colortype
+Syntax:
+~~~~~
+XUnsetColor <document> {<label>|<shape>} <colortype>
+~~~~~
-Unset a color given??? type (‘s’ or ‘c’) for the indicated shape.
-**Example:**
+Unset a color given type (‘s’ or ‘c’) for the indicated shape.
+**Example:**
+~~~~~
XUnsetColor D 0:1:1:4 s
+~~~~~
+
+@subsection occt_draw_8_8_ XDE layer commands
-@subsection occt_2142243456_1866931135810 XDE layer’s commands
+@subsubsection occt_draw_8_8_1 XAddLayer
-@subsubsection occt_2142243456_18669311358101 XAddLayer
+Syntax:
+~~~~~
+XAddLayer <document> <layer>
+~~~~~
-Syntax: XAddLayer document layer
+Adds a new layer in an XCAF document.
-Adds a new layer in an XCAF document. layer - name of new layer (string).
**Example:**
-
+~~~~~
XAddLayer D layer2
+~~~~~
-@subsubsection occt_2142243456_18669311358102 XFindLayer
+@subsubsection occt_draw_8_8_2 XFindLayer
-Syntax: XFindLayer document layer
+Syntax:
+~~~~~
+XFindLayer <document> <layer>
+~~~~~
Prints a label where a layer is situated.
-**Example:**
+**Example:**
+~~~~~
XFindLayer D Bolt
== 0:1:3:2
+~~~~~
-@subsubsection occt_2142243456_18669311358103 XGetAllLayers
+@subsubsection occt_draw_8_8_3 XGetAllLayers
-Syntax: XGetAllLayers document
+Syntax:
+~~~~~
+XGetAllLayers <document>
+~~~~~
Prints all layers in an XCAF document.
-**Example:**
+**Example:**
+~~~~~
XGetAllLayers D
== *0:1:1:3* *Bolt* *0:1:1:9*
+~~~~~
-@subsubsection occt_2142243456_18669311358104 XGetLayers
+@subsubsection occt_draw_8_8_4 XGetLayers
-Syntax: XGetLayers document {shape|label}
+Syntax:
+~~~~~
+XGetLayers <document> {<shape>|<label>}
+~~~~~
Returns names of layers, which are pointed to by links of an indicated shape.
-**Example:**
+**Example:**
+~~~~~
XGetLayers D 0:1:1:3
== *bolt* *123*
+~~~~~
-@subsubsection occt_2142243456_18669311358105 XGetOneLayer
+@subsubsection occt_draw_8_8_5 XGetOneLayer
-Syntax: XGetOneLayer document label
+Syntax:
+~~~~~
+XGetOneLayer <document> <label>
+~~~~~
Prints the name of a layer at a given label.
-**Example:**
+**Example:**
+~~~~~
XGetOneLayer D 0:1:3:2
+~~~~~
-@subsubsection occt_2142243456_18669311358106 XIsVisible
+@subsubsection occt_draw_8_8_6 XIsVisible
-Syntax: XIsVisible document {label|layer}
+Syntax:
+~~~~~
+XIsVisible <document> {<label>|<layer>}
+~~~~~
Returns 1 if the indicated layer is visible, else returns 0.
-**Example:**
+**Example:**
+~~~~~
XIsVisible D 0:1:3:1
+~~~~~
-@subsubsection occt_2142243456_18669311358107 XRemoveAllLayers
+@subsubsection occt_draw_8_8_7 XRemoveAllLayers
-Syntax: XRemoveAllLayers document
+Syntax:
+~~~~~
+XRemoveAllLayers <document>
+~~~~~
Removes all layers from an XCAF document.
-**Example:**
+**Example:**
+~~~~~
XRemoveAllLayers D
+~~~~~
-@subsubsection occt_2142243456_18669311358108 XRemoveLayer
+@subsubsection occt_draw_8_8_8 XRemoveLayer
-Syntax: XRemoveLayer document {label|layer}
+Syntax:
+~~~~~
+XRemoveLayer <document> {<label>|<layer>}
+~~~~~
Removes the indicated layer from an XCAF document.
-**Example:**
+**Example:**
+~~~~~
XRemoveLayer D layer2
+~~~~~
-@subsubsection occt_2142243456_18669311358109 XSetLayer
+@subsubsection occt_draw_8_8_9 XSetLayer
-Syntax: XSetLayer document {shape|label} layer
- [shape_in_one_layer {0|1}]
+Syntax:
+~~~~~
+XSetLayer XSetLayer <document> {<shape>|<label>} <layer> [shape_in_one_layer {0|1}]
+~~~~~
+
Sets a reference between a shape and a layer (adds a layer if it is necessary).
-Parameter shape_in_one_layer shows whether a shape could be in a number of layers or only in one (0 by default).
-**Example:**
+Parameter <i><shape_in_one_layer></i> shows whether a shape could be in a number of layers or only in one (0 by default).
+**Example:**
+~~~~~
XSetLayer D 0:1:1:2 layer2
+~~~~~
-@subsubsection occt_2142243456_186693113581010 XSetVisibility
+@subsubsection occt_draw_8_8_10 XSetVisibility
-Syntax: XSetVisibility document {label|layer} isvisible {0|1}
+Syntax:
+~~~~~
+XSetVisibility <document> {<label>|<layer>} <isvisible {0|1}>
+~~~~~
Sets the visibility of a layer.
-**Example:**
+**Example:**
+~~~~~
# set layer at label 0:1:3:2 as invisible
XSetVisibility D 0:1:3:2 0
+~~~~~
-@subsubsection occt_2142243456_186693113581011 XUnSetAllLayers
+@subsubsection occt_draw_8_8_11 XUnSetAllLayers
-Syntax: XUnSetAllLayers document {label|shape}
+Syntax:
+~~~~~
+XUnSetAllLayers <document> {<label>|<shape>}
+~~~~~
Unsets a shape from all layers.
-**Example:**
+**Example:**
+~~~~~
XUnSetAllLayers D 0:1:1:2
+~~~~~
-@subsubsection occt_2142243456_186693113581012 XUnSetLayer
+@subsubsection occt_draw_8_8_12 XUnSetLayer
-Syntax: XUnSetLayer document {label|shape} layer
+Syntax:
+~~~~~
+XUnSetLayer <document> {<label>|<shape>} <layer>
+~~~~~
Unsets a shape from the indicated layer.
-**Example:**
+**Example:**
+~~~~~
XUnSetLayer D 0:1:1:2 layer1
+~~~~~
+@subsection occt_draw_8_9 XDE property commands
-@subsection occt_2142243456_1866931135811 XDE property’s commands
+@subsubsection occt_draw_8_9_1 XCheckProps
-@subsubsection occt_2142243456_18669311358111 XCheckProps
+Syntax:
+~~~~~
+XCheckProps <document> [ {0|deflection} [<shape>|<label>] ]
+~~~~~
-Syntax: XCheckProps document [ {0|deflection} [shape|label] ]
+Gets properties for a given shape (*volume*, *area* and <i>centroid</i>) and compares them with the results after internal calculations. If the second parameter is 0, the standard OCCT tool is used for the computation of properties. If the second parameter is not 0, it is processed as a deflection. If the deflection is positive the computation is done by triangulations, if it is negative – meshing is forced.
-Gets properties for a given shape (volume, area and centroid) and compares them with the results after internal calculations. If the second parameter is 0, the standard OCCT tool is used for the computation of properties. If the second parameter is not 0, it is treated as a deflection. If the deflection is positive the computation is done by triangulations, if it is negative – meshing is forced.
**Example:**
-
+~~~~~
# check properties for shapes at label 0:1:1:1 from
# document using standard Open CASCADE Technology tools
XCheckProps D 0 0:1:1:1
== Area defect: -0.0 ( 0%)
== Volume defect: 0.0 ( 0%)
== CG defect: dX=-0.000, dY=0.000, dZ=0.000
+~~~~~
-@subsubsection occt_2142243456_18669311358112 XGetArea
+@subsubsection occt_draw_8_9_2 XGetArea
-Syntax: XGetArea document {shape|label}
+Syntax:
+~~~~~
+XGetArea <document> {<shape>|<label>}
+~~~~~
Returns the area of a given shape.
-**Example:**
+**Example:**
+~~~~~
XGetArea D 0:1:1:1
== 24628.31815094999
+~~~~~
-@subsubsection occt_2142243456_18669311358113 XGetCentroid
+@subsubsection occt_draw_8_9_3 XGetCentroid
-Syntax: XGetCentroid document {shape|label}
+Syntax:
+~~~~~
+XGetCentroid <document> {<shape>|<label>}
+~~~~~
Returns the center of gravity coordinates of a given shape.
-**Example:**
+**Example:**
+~~~~~
XGetCentroid D 0:1:1:1
+~~~~~
-@subsubsection occt_2142243456_18669311358114 XGetVolume
+@subsubsection occt_draw_8_9_4 XGetVolume
-Syntax: XGetVolume document {shape|label}
+Syntax:
+~~~~~
+XGetVolume <document> {<shape>|<label>}
+~~~~~
Returns the volume of a given shape.
-**Example:**
+**Example:**
+~~~~~
XGetVolume D 0:1:1:1
+~~~~~
-@subsubsection occt_2142243456_18669311358115 XSetArea
+@subsubsection occt_draw_8_9_5 XSetArea
-Syntax: XSetArea document {shape|label} area
+Syntax:
+~~~~~
+XSetArea <document> {<shape>|<label>} <area>
+~~~~~
Sets new area to attribute list ??? given shape.
-**Example:**
+**Example:**
+~~~~~
XSetArea D 0:1:1:1 2233.99
+~~~~~
-@subsubsection occt_2142243456_18669311358116 XSetCentroid
+@subsubsection occt_draw_8_9_6 XSetCentroid
+
+Syntax:
+~~~~~
+XSetCentroid <document> {<shape>|<label>} <x> <y> <z>
+~~~~~
-Syntax: XSetCentroid document {shape|label} x y z
+Sets new center of gravity to the attribute list given shape.
-Sets new center of gravity to the attribute list ??? given shape.
**Example:**
-
+~~~~~
XSetCentroid D 0:1:1:1 0. 0. 100.
+~~~~~
-@subsubsection occt_2142243456_18669311358117 XSetMaterial
+@subsubsection occt_draw_8_9_7 XSetMaterial
-Syntax: XSetMaterial document {shape|label} name
- density(g/cu sm)
+Syntax:
+~~~~~
+XSetMaterial <document> {<shape>|<label>} <name> <density(g/cu sm)>
+~~~~~
-Adds a new label with material into the material table in a document, and adds a link to this material to the attribute list of agiven shape or a given label. The last parameter sets the density of a pointed material.
-**Example:**
+Adds a new label with material into the material table in a document, and adds a link to this material to the attribute list of a given shape or a given label. The last parameter sets the density of a pointed material.
+**Example:**
+~~~~~
XSetMaterial D 0:1:1:1 Titanium 8899.77
+~~~~~
-@subsubsection occt_2142243456_18669311358118 XSetVolume
+@subsubsection occt_draw_8_9_8 XSetVolume
-Syntax: XSetVolume document {shape|label} volume
+Syntax:
+~~~~~
+XSetVolume <document> {<shape>|<label>} <volume>
+~~~~~
Sets new volume to the attribute list ??? given shape.
-**Example:**
+**Example:**
+~~~~~
XSetVolume D 0:1:1:1 444555.33
+~~~~~
-@subsubsection occt_2142243456_18669311358119 XShapeMassProps
+@subsubsection occt_draw_8_9_9 XShapeMassProps
-Syntax: XShapeMassProps document [ deflection [{shape|label}] ]
+Syntax:
+~~~~~
+XShapeMassProps <document> [ <deflection> [{<shape>|<label>}] ]
+~~~~~
Computes and returns real mass and real center of gravity for a given shape or for all shapes in a document. The second parameter is used for calculation of the volume and CG(center of gravity). If it is 0, then the standard CASCADE tool (geometry) is used for computation, otherwise - by triangulations with a given deflection.
-**Example:**
+**Example:**
+~~~~~
XShapeMassProps D
== Shape from label : 0:1:1:1
== Mass = 193.71681469282299
20.20271885211281,Z = 49.999999385313245
== Shape from label : 0:1:1:2 not have a mass
etc.
+~~~~~
-@subsubsection occt_2142243456_186693113581110 XShapeVolume
+@subsubsection occt_draw_8_9_10 XShapeVolume
-Syntax: XShapeVolume shape deflection
+Syntax:
+~~~~~
+XShapeVolume <shape> <deflection>
+~~~~~
Calculates the real volume of a pointed shape with a given deflection.
-**Example:**
+**Example:**
+~~~~~
XShapeVolume a 0
+~~~~~
-@section occt_2142243456_1672096717 Shape Healing commands
+@section occt_draw_9 Shape Healing commands
-@subsection occt_2142243456_16720967171 General commands
+@subsection occt_draw_9_1 General commands
-@subsubsection occt_2142243456_1672096717111 bsplres
+@subsubsection occt_draw_9_1_1 bsplres
-Syntax: bsplres result shape tol3d tol2d reqdegree reqnbsegments continuity3d continuity2d PriorDeg RationalConvert
+Syntax:
+~~~~~
+bsplres <result> <shape> <tol3d> <tol2d< <reqdegree> <reqnbsegments> <continuity3d> <continuity2d> <PriorDeg> <RationalConvert>
+~~~~~
-Performs approximations of a given shape (BSpline curves and surfaces or other surfaces) to BSpline with given required parameters. The specified continuity can be reduced if the approximation with a specified continuity was not done successfully. Results are put into the shape, which is given as a parameter result. For a more detailed description see the ShapeHealing User’s Guide (operator: BSplineRestriction).
+Performs approximations of a given shape (BSpline curves and surfaces or other surfaces) to BSpline with given required parameters. The specified continuity can be reduced if the approximation with a specified continuity was not done successfully. Results are put into the shape, which is given as a parameter result. For a more detailed description see the ShapeHealing User’s Guide (operator: **BSplineRestriction**).
-@subsubsection occt_2142243456_1672096717112 checkfclass2d
+@subsubsection occt_draw_9_1_2 checkfclass2d
-Syntax: checkfclass2d face ucoord vcoord
+Syntax:
+~~~~~
+checkfclass2d <face> <ucoord> <vcoord>
+~~~~~
Shows where a point which is given by coordinates is located in relation to a given face – outbound, inside or at the bounds.
-**Example:**
+**Example:**
+~~~~~
checkfclass2d f 10.5 1.1
== Point is OUT
+~~~~~
-@subsubsection occt_2142243456_1672096717113 checkoverlapedges
+@subsubsection occt_draw_9_1_3 checkoverlapedges
+
+Syntax:
+~~~~~
+checkoverlapedges <edge1> <edge2> [<toler> <domaindist>]
+~~~~~
-Syntax: checkoverlapedges edge1 edge2 [toler domaindist]
+Checks the overlapping of two given edges. If the distance between two edges is less than the given value of tolerance then edges are overlapped. Parameter <domaindist> sets length of part of edges on which edges are overlapped.
-Checks the overlapping of two given edges. If the distance between two edges is less than the given value of tolerance then edges are overlapped. Parameter domaindist sets length of part of edges on which edges are overlapped.
**Example:**
-
+~~~~~
checkoverlapedges e1 e2
+~~~~~
-@subsubsection occt_2142243456_1672096717114 comtol
+@subsubsection occt_draw_9_1_4 comtol
-Syntax: comptol shape [nbpoints] [prefix]
+Syntax:
+~~~~~
+comptol <shape> [nbpoints] [prefix]
+~~~~~
Compares the real value of tolerance on curves with the value calculated by standard (using 23 points). The maximal value of deviation of 3d curve from pcurve at given simple points is taken as a real value (371 is by default). Command returns the maximal, minimal and average value of tolerance for all edges and difference between real values and set values. Edges with the maximal value of tolerance and relation will be saved if the ‘prefix’ parameter is given.
+
**Example:**
-
+~~~~~
comptol h 871 t
-== Edges tolerance computed by 871 points:
-== MAX=8.0001130696523449e-008 AVG=6.349346868091096e-009
- MIN=0
-== Relation real tolerance / tolerance set in edge
-== MAX=0.80001130696523448 AVG=0.06349345591805905 MIN=0
-== Edge with max tolerance saved to t_edge_tol
-== Concerned faces saved to shapes t_1, t_2
-
+==> Edges tolerance computed by 871 points:
+==> MAX=8.0001130696523449e-008 AVG=6.349346868091096e-009 MIN=0
+==> Relation real tolerance / tolerance set in edge
+==> MAX=0.80001130696523448 AVG=0.06349345591805905 MIN=0
+==> Edge with max tolerance saved to t_edge_tol
+==> Concerned faces saved to shapes t_1, t_2
+~~~~~
-@subsubsection occt_2142243456_1672096717115 convtorevol
+@subsubsection occt_draw_9_1_5 convtorevol
-Syntax: convtorevol result shape
+Syntax:
+~~~~~
+convtorevol <result> <shape>
+~~~~~
Converts all elementary surfaces of a given shape into surfaces of revolution.
-Results are put into the shape, which is given as theresult parameter.
-**Example:**
+Results are put into the shape, which is given as the <i><result></i> parameter.
+**Example:**
+~~~~~
convtorevol r a
+~~~~~
-@subsubsection occt_2142243456_1672096717116 directfaces
+@subsubsection occt_draw_9_1_6 directfaces
-Syntax: directfaces result shape
+Syntax:
+~~~~~
+directfaces <result> <shape>
+~~~~~
Converts indirect surfaces and returns the results into the shape, which is given as the result parameter.
-**Example:**
+**Example:**
+~~~~~
directfaces r a
+~~~~~
-@subsubsection occt_2142243456_1672096717117 expshape
+@subsubsection occt_draw_9_1_7 expshape
-Syntax: expshape shape maxdegree maxseg
+Syntax:
+~~~~~
+expshape <shape> <maxdegree> <maxseg>
+~~~~~
Gives statistics for a given shape. This test command is working with Bezier and BSpline entities.
-**Example:**
+**Example:**
+~~~~~
expshape a 10 10
-== Number of Rational Bspline curves 128
-== Number of Rational Bspline pcurves 48
+==> Number of Rational Bspline curves 128
+==> Number of Rational Bspline pcurves 48
+~~~~~
-@subsubsection occt_2142243456_1672096717118 fixsmall
+@subsubsection occt_draw_9_1_8 fixsmall
-Syntax: fixsmall result shape [toler=1.]
+Syntax:
+~~~~~
+fixsmall <result> <shape> [<toler>=1.]
+~~~~~
Fixes small edges in given shape by merging adjacent edges with agiven tolerance. Results are put into the shape, which is given as the result parameter.
-**Example:**
+**Example:**
+~~~~~
fixsmall r a 0.1
+~~~~~
-@subsubsection occt_2142243456_1672096717119 fixsmalledges
+@subsubsection occt_draw_9_1_9 fixsmalledges
+
+Syntax:
+~~~~~
+fixsmalledges <result> <shape> [<toler> <mode> <maxangle>]
+~~~~~
-Syntax: fixsmalledges result shape [toler mode maxangle]
+Searches at least one small edge at a given shape. If such edges have been found, then small edges are merged with a given tolerance. If parameter <i><mode></i> is equal to *Standard_True* (can be given any values, except 2), then small edges, which can not be merged, are removed, otherwise they are to be kept (*Standard_False* is used by default). Parameter <i><maxangle></i> sets a maximum possible angle for merging two adjacent edges, by default no limit angle is applied (-1). Results are put into the shape, which is given as parameter result.
-Searches at least one small edge at a given shape. If such edges have been found, then small edges are merged with a given tolerance. If parameter mode is equal to Standard_True (can be given any values, except 2), then small edges, which can not be merged, are removed, otherwise they are to be kept (Standard_False is used by default). Parameter maxangle sets a maximum possible angle for merging two adjacent edges, by default no limit angle is applied (-1).Results are put into the shape, which is given as parameter result.
**Example:**
-
+~~~~~
fixsmalledges r a 0.1 1
+~~~~~
+
+@subsubsection occt_draw_9_1_10 fixshape
-@subsubsection occt_2142243456_16720967171110 fixshape
-
-Syntax: fixshape result shape [preci [maxpreci]] [{switches}]
-
-Performs fixes of all sub-shapes (such as Solids, Shells, Faces, Wires and Edges) of a given shape. Parameter preci sets a basic precision value, maxpreci sets the maximal allowed tolerance. Results are put into the shape, which is given as parameter result.
-{switches} allows to tune parameters of ShapeFix
-The following syntax is used: symbolparameter
-- symbol may be - to set parameter off, + to set on or * to set default
-- parameters are identified by letters:
-l - FixLackingMode
-o - FixOrientationMode
-h - FixShiftedMode
-m - FixMissingSeamMode
-d - FixDegeneratedMode
-s - FixSmallMode
-i - FixSelfIntersectionMode
-n - FixNotchedEdgesMode
+Syntax:
+~~~~~
+fixshape <result> <shape> [<preci> [<maxpreci>]] [{switches}]
+~~~~~
+
+Performs fixes of all sub-shapes (such as *Solids*, *Shells*, *Faces*, *Wires* and *Edges*) of a given shape. Parameter <i><preci></i> sets a basic precision value, <i><maxpreci></i> sets the maximal allowed tolerance. Results are put into the shape, which is given as parameter result. <b>{switches}</b> allows to tune parameters of ShapeFix
+
+The following syntax is used:
+* <i><symbol></i> may be
+ * "-" to set parameter off,
+ * "+" to set on or
+ * "*" to set default
+* <i><parameter></i> is identified by letters:
+ * l - FixLackingMode
+ * o - FixOrientationMode
+ * h - FixShiftedMode
+ * m - FixMissingSeamMode
+ * d - FixDegeneratedMode
+ * s - FixSmallMode
+ * i - FixSelfIntersectionMode
+ * n - FixNotchedEdgesMode
For enhanced message output, use switch '+?'
-**Example:**
+**Example:**
+~~~~~
fixshape r a 0.001
+~~~~~
-@subsubsection occt_2142243456_16720967171111 fixwgaps
+@subsubsection occt_draw_9_1_11 fixwgaps
-Syntax: fixwgaps result shape [toler=0]
+Syntax:
+~~~~~
+fixwgaps <result> <shape> [<toler>=0]
+~~~~~
Fixes gaps between ends of curves of adjacent edges (both 3d and pcurves) in wires in a given shape with a given tolerance. Results are put into the shape, which is given as parameter result.
-**Example:**
+**Example:**
+~~~~~
fixwgaps r a
+~~~~~
+
+@subsubsection occt_draw_9_1_12 offsetcurve, offset2dcurve
-@subsubsection occt_2142243456_16720967171112 offsetcurve, offset2dcurve
+Syntax:
+~~~~~
+offsetcurve <result> <curve> <offset> <direction(as point)>
+offset2dcurve <result> <curve> <offset>
+~~~~~
-Syntax: offsetcurve result curve offset direction(as point)
- offset2dcurve result curve offset
+**offsetcurve** works with the curve in 3d space, **offset2dcurve** in 2d space.
-Both commands are intended to create a new offset curve by copying the given curve to distance, given by parameter offset. Parameter direction defines direction of the offset curve. It is created as a point. For correct work of these commands the direction of normal of the offset curve must be perpendicular to the plane, the basis curve is located there. Results are put into the curve, which is given as parameter result. **offsetcurve **works with the curve in 3d space, **offset2dcurve **in 2d space accordingly.
-**Example:**
+Both commands are intended to create a new offset curve by copying the given curve to distance, given by parameter <i><offset></i>. Parameter <i><direction></i> defines direction of the offset curve. It is created as a point. For correct work of these commands the direction of normal of the offset curve must be perpendicular to the plane, the basis curve is located there. Results are put into the curve, which is given as parameter <i><result></i>.
+**Example:**
+~~~~~
point pp 10 10 10
offsetcurve r c 20 pp
+~~~~~
+
+@subsubsection occt_draw_9_1_13 projcurve
-@subsubsection occt_2142243456_16720967171113 projcurve
+Syntax:
+~~~~~
+projcurve <edge>|<curve3d>|<curve3d first last> <X> <Y> <Z>
+~~~~~
-Syntax: projcurve edge|curve3d|curve3d first last X Y Z
+**projcurve** returns the projection of a given point on a given curve. The curve may be defined by three ways: by giving the edge name, giving the 3D curve and by giving the unlimited curve and limiting it by pointing its start and finish values.
-**projcurve **returns the projection of a given point on a given curve. The curve may be defined by three ways: by giving the edge name, giving the 3D curve and by giving the unlimited curve and limiting it by pointing its start and finish values.
**Example:**
-
+~~~~~
projcurve k_1 0 1 5
==Edge k_1 Params from 0 to 1.3
==Precision (BRepBuilderAPI) : 9.9999999999999995e-008 ==Projection : 0 1 5
==Result : 0 1.1000000000000001 0
==Param = -0.20000000000000001 Gap = 5.0009999000199947
+~~~~~
+@subsubsection occt_draw_9_1_14 projface
-@subsubsection occt_2142243456_16720967171114 projface
-
-Syntax: projface face X Y [Z]
+Syntax:
+~~~~~
+projface <face> <X> <Y> [<Z>]
+~~~~~
Returns the projection of a given point to a given face in 2d or 3d space. If two coordinates (2d space) are given then returns coordinates projection of this point in 3d space and vice versa.
-**Example:**
+**Example:**
+~~~~~
projface a_1 10.0 0.0
== Point UV U = 10 V = 0
== = proj X = -116 Y = -45 Z = 0
+~~~~~
-@subsubsection occt_2142243456_16720967171115 scaleshape
+@subsubsection occt_draw_9_1_15 scaleshape
-Syntax: scaleshape result shape scale
+Syntax:
+~~~~~
+scaleshape <result> <shape> <scale>
+~~~~~
-**Example:**
+Returns a new shape, which is the result of scaling of a given shape with a coefficient equal to the parameter <i><scale></i>. Tolerance is calculated for the new shape as well.
+**Example:**
+~~~~~
scaleshape r a_1 0.8
+~~~~~
-@subsubsection occt_2142243456_16720967171116 settolerance
+@subsubsection occt_draw_9_1_16 settolerance
+
+Syntax:
+~~~~~
+settolerance <shape> [<mode>=v-e-w-f-a] <val>(fix value) or
+ <tolmin> <tolmax>
+~~~~~
-Syntax: settolerance shape [mode=v-e-w-f-a] val(fix value) or
- tolmin tolmax
+Sets new values of tolerance for a given shape. If the second parameter <i>mode</i> is given, then the tolerance value is set only for these sub shapes.
-Sets new values of tolerance for a given shape. If the given second parameter (mode) is given, then the atolerance value is set only for these sub shapes.
**Example:**
-
+~~~~~
settolerance a 0.001
+~~~~~
-@subsubsection occt_2142243456_16720967171117 splitface
+@subsubsection occt_draw_9_1_17 splitface
-Syntax: splitface result face [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]
+Syntax:
+~~~~~
+splitface <result> <face> [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]
+~~~~~
-Splits a given face in parametric space and puts the result into the given parameter result.
+Splits a given face in parametric space and puts the result into the given parameter <i><result></i>.
Returns the status of split face.
-**Example:**
+**Example:**
+~~~~~
# split face f by parameter u = 5
splitface r f u 5
-== Splitting by U: ,5
-== Status: DONE1
+==> Splitting by U: ,5
+==> Status: DONE1
+~~~~~
-@subsubsection occt_2142243456_16720967171118 statshape
+@subsubsection occt_draw_9_1_18 statshape
-Syntax: statshape shape [particul]
+Syntax:
+~~~~~
+statshape <shape> [particul]
+~~~~~
-Returns the number of sub-shapes, which compose the given shape. For example, the number of solids, number of faces etc. It also returns the number of geometrical objects or sub-shapes with a specified type, example, number of free faces, number of C0 surfaces. The last parameter becomes out of date.
-**Example:**
+Returns the number of sub-shapes, which compose the given shape. For example, the number of solids, number of faces etc. It also returns the number of geometrical objects or sub-shapes with a specified type, example, number of free faces, number of C0
+surfaces. The last parameter becomes out of date.
-statshape a
-== Count Item
-== ----- ----
-== 402 Edge (oriented)
-== 402 Edge (Shared)
-== 74 Face
-== 74 Face (Free)
-== 804 Vertex (Oriented)
-== 402 Vertex (Shared)
-== 78 Wire
-== 4 Face with more than one wire
-== 34 bspsur: BSplineSurface
-
-@subsubsection occt_2142243456_16720967171119 tolerance
-
-Syntax: tolerance shape [mode:D v e f c] [tolmin tolmax:real]
-
-Returns tolerance (maximal, avg and minimal values) of all given shapes and tolerance of their Faces, Edges and Vertices. If parameter tolmin or tolmax or both of them are given, then sub-shapes are returned as a result of analys of this shape, which satisfy the given tolerances. If a particular value of entity (all shapes (D) (v) vertices (e) edges (f) faces (c) combined (faces)) is given as the second parameter then only this group will be analyzed for tolerance.
**Example:**
+~~~~~
+statshape a
+==> Count Item
+==> ----- ----
+==> 402 Edge (oriented)
+==> 402 Edge (Shared)
+==> 74 Face
+==> 74 Face (Free)
+==> 804 Vertex (Oriented)
+==> 402 Vertex (Shared)
+==> 78 Wire
+==> 4 Face with more than one wire
+==> 34 bspsur: BSplineSurface
+~~~~~
+
+@subsubsection occt_draw_9_1_19 tolerance
+
+Syntax:
+~~~~~
+tolerance <shape> [<mode>:D v e f c] [<tolmin> <tolmax>:real]
+~~~~~
+Returns tolerance (maximal, avg and minimal values) of all given shapes and tolerance of their *Faces*, *Edges* and *Vertices*. If parameter <i><tolmin></i> or <i><tolmax></i> or both of them are given, then sub-shapes are returned as a result of analys of this shape, which satisfy the given tolerances. If a particular value of entity ((**D**)all shapes (**v**) *vertices* (**e**) *edges* (**f**) *faces* (**c**) *combined* (*faces*)) is given as the second parameter then only this group will be analyzed for tolerance.
+
+**Example:**
+~~~~~
tolerance a
-== Tolerance MAX=0.31512672416608001 AVG=0.14901359484722074 MIN=9.9999999999999995e-08
-== FACE : MAX=9.9999999999999995e-08 AVG=9.9999999999999995e-08 MIN=9.9999999999999995e-08
-== EDGE : MAX=0.31512672416608001 AVG=0.098691334511810405 MIN=9.9999999999999995e-08
-== VERTEX : MAX=0.31512672416608001 AVG=0.189076074499648 MIN=9.9999999999999995e-08
+==> Tolerance MAX=0.31512672416608001 AVG=0.14901359484722074 MIN=9.9999999999999995e-08
+==> FACE : MAX=9.9999999999999995e-08 AVG=9.9999999999999995e-08 MIN=9.9999999999999995e-08
+==> EDGE : MAX=0.31512672416608001 AVG=0.098691334511810405 MIN=9.9999999999999995e-08
+==> VERTEX : MAX=0.31512672416608001 AVG=0.189076074499648 MIN=9.9999999999999995e-08
tolerance a v 0.1 0.001
-== Analysing Vertices gives 6 Shapes between tol1=0.10000000000000001 and tol2=0.001 , named tol_1 to tol_6
-
+==> Analysing Vertices gives 6 Shapes between tol1=0.10000000000000001 and tol2=0.001 , named tol_1 to tol_6
+~~~~~
-@subsection occt_2142243456_16720967172 Convertion commands
-More detailed information about using here classes can be found into Shape Healing documentation. All this commands are created for testing.
+@subsection occt_draw_9_2 Conversion commands
-@subsubsection occt_2142243456_1672096717121 DT_ClosedSplit
+@subsubsection occt_draw_9_2_1 DT_ClosedSplit
-Syntax: DT_ClosedSplit result shape
+Syntax:
+~~~~~
+DT_ClosedSplit <result> <shape>
+~~~~~
Divides all closed faces in the shape (for example cone) and returns result of given shape into shape, which is given as parameter result. Number of faces in resulting shapes will be increased.
Note: Closed face – it’s face with one or more seam.
-**Example:**
+**Example:**
+~~~~~
DT_ClosetSplit r a
+~~~~~
-@subsubsection occt_2142243456_1672096717122 DT_ShapeConvert, DT_ShapeConvertRev
+@subsubsection occt_draw_9_2_2 DT_ShapeConvert, DT_ShapeConvertRev
-Syntax: DT_ShapeConvert result shape convert2d convert3d
- DT_ShapeConvertRev result shape convert2d convert3d
+Syntax:
+~~~~~
+DT_ShapeConvert <result> <shape> <convert2d> <convert3d>
+DT_ShapeConvertRev <result> <shape> <convert2d> <convert3d>
+~~~~~
+
+Both commands are intended for the conversion of 3D, 2D curves to Bezier curves and surfaces to Bezier based surfaces. Parameters convert2d and convert3d take on a value 0 or 1. If the given value is 1, then the conversion will be performed, otherwise it will not be performed. The results are put into the shape, which is given as parameter Result. Command *DT_ShapeConvertRev* differs from *DT_ShapeConvert* by converting all elementary surfaces into surfaces of revolution first.
-Both commands are intended for the conversion of 3D, 2D curves to Bezier curves and surfaces to Bezier based surfaces. Parameters convert2d and convert3d take on a value 0 or 1. If the given value is 1, then the conversion will be performed, otherwise it will not be performed. The results are put into the shape, which is given as parameter Result. Command **DT_ShapeConvertRev **differs from **DT_ShapeConvert **by converting all elementary surfaces into surfaces of revolution first.
**Example:**
-
+~~~~~
DT_ShapeConvert r a 1 1
== Status: DONE1
+~~~~~
+
+@subsubsection occt_draw_9_2_3 DT_ShapeDivide
-@subsubsection occt_2142243456_1672096717123 DT_ShapeDivide
+Syntax:
+~~~~~
+DT_ShapeDivide <result> <shape> <tol>
+~~~~~
-Syntax: DT_ShapeDivide result shape tol
+Divides the shape with C1 criterion and returns the result of geometry conversion of a given shape into the shape, which is given as parameter result. This command illustrates how class *ShapeUpgrade_ShapeDivideContinuity* works. This class allows to convert geometry with a continuity less than the specified continuity to geometry with target continuity. If conversion is not possible then the geometrical object is split into several ones, which satisfy the given tolerance. It also returns the status shape splitting:
+ * OK : no splitting was done
+ * Done1 : Some edges were split
+ * Done2 : Surface was split
+ * Fail1 : Some errors occurred
-Divides the shape with C1 criterion and returns the result of geometry conversion of a given shape into the shape, which is given as parameter result. This command illustrates how class ShapeUpgrade_ShapeDivideContinuity works. This class allows to convert geometry with a continuity less than the specified continuity to geometry with target continuity. If conversion is not possible then the geometrical object is split into several ones, which satisfy the given tolerance. It also returns the status shape splitting:
-OK : no splitting was done
-Done1 : Some edges were split
-Done2 : Surface was split
-Fail1 : Some errors occurred
**Example:**
-
+~~~~~
DT_ShapeDivide r a 0.001
== Status: OK
+~~~~~
-@subsubsection occt_2142243456_1672096717124 DT_SplitAngle
+@subsubsection occt_draw_9_2_4 DT_SplitAngle
+
+Syntax:
+~~~~~
+DT_SplitAngle <result> <shape> [MaxAngle=95]
+~~~~~
-Syntax: DT_SplitAngle result shape [MaxAngle=95]
+Works with all revolved surfaces, like cylinders, surfaces of revolution, etc. This command divides given revolved surfaces into segments so that each resulting segment covers not more than the given *MaxAngle* degrees and puts the result of splitting into the shape, which is given as parameter result. Values of returned status are given above.
+This command illustrates how class *ShapeUpgrade_ShapeDivideAngle* works.
-Works with all revolved surfaces, like cylinders, surfaces of revolution etc. This command divides given revolved surfaces into segments so that each resulting segment covers not more than the given MaxAngle degrees and puts the result of splitting into the shape, which is given as parameter result. Values of returned status are given above.
-This command illustrates how class ShapeUpgrade_ShapeDivideAngle works.
**Example:**
-
+~~~~~
DT_SplitAngle r a
== Status: DONE2
+~~~~~
-@subsubsection occt_2142243456_1672096717125 DT_SplitCurve
+@subsubsection occt_draw_9_2_5 DT_SplitCurve
-Syntax: DT_SplitCurve curve tol split(0|1)
+Syntax:
+~~~~~
+DT_SplitCurve <curve> <tol> <split(0|1)>
+~~~~~
Divides the 3d curve with C1 criterion and returns the result of splitting of the given curve into a new curve. If the curve had been divided by segments, then each segment is put to an individual result. This command can correct a given curve at a knot with the given tolerance, if it is impossible, then the given surface is split at that knot. If the last parameter is 1, then 5 knots are added at the given curve, and its surface is split by segments, but this will be performed not for all parametric spaces.
-**Example:**
+**Example:**
+~~~~~
DT_SplitCurve r c
+~~~~~
-@subsubsection occt_2142243456_1672096717126 DT_SplitCurve2d
+@subsubsection occt_draw_9_2_6 DT_SplitCurve2d
-Syntax: DT_SplitCurve2d Curve Tol Split(0/1)
+Syntax:
+~~~~~
+DT_SplitCurve2d Curve Tol Split(0/1)
+~~~~~
-Works just as DT_SplitCurve (see above), only with 2d curve.
-**Example:**
+Works just as **DT_SplitCurve** (see above), only with 2d curve.
+**Example:**
+~~~~~
DT_SplitCurve2d r c
+~~~~~
-@subsubsection occt_2142243456_1672096717127 DT_SplitSurface
+@subsubsection occt_draw_9_2_7 DT_SplitSurface
-Syntax: DT_SplitSurface result Surface|GridSurf tol split(0|1)
+Syntax:
+~~~~~
+DT_SplitSurface <result> <Surface|GridSurf> <tol> <split(0|1)>
+~~~~~
Divides surface with C1 criterion and returns the result of splitting of a given surface into surface, which is given as parameter result. If the surface has been divided into segments, then each segment is put to an individual result. This command can correct a given C0 surface at a knot with a given tolerance, if it is impossible, then the given surface is split at that knot. If the last parameter is 1, then 5 knots are added to the given surface, and its surface is split by segments, but this will be performed not for all parametric spaces.
+
**Example:**
-
+~~~~~
~~~~~
# split surface with name "su"
DT_SplitSurface res su 0.1 1
-== single surf
-== appel a SplitSurface::Init
-== appel a SplitSurface::Build
-== appel a SplitSurface::GlobalU/VKnots
-== nb GlobalU;nb GlobalV=7 2 0 1 2 3 4 5 6.2831853072 0 1
-== appel a Surfaces
-== transfert resultat
-== res1_1_1 res1_2_1 res1_3_1 res1_4_1 res1_5_1 res1_6_1
+==> single surf
+==> appel a SplitSurface::Init
+==> appel a SplitSurface::Build
+==> appel a SplitSurface::GlobalU/VKnots
+==> nb GlobalU;nb GlobalV=7 2 0 1 2 3 4 5 6.2831853072 0 1
+==> appel a Surfaces
+==> transfert resultat
+==> res1_1_1 res1_2_1 res1_3_1 res1_4_1 res1_5_1 res1_6_1
+~~~~~
~~~~~
-@subsubsection occt_2142243456_1672096717128 DT_ToBspl
+@subsubsection occt_draw_9_2_8 DT_ToBspl
-Syntax: DT_ToBspl result shape
+Syntax:
+~~~~~
+DT_ToBspl <result> <shape>
+~~~~~
Converts a surface of linear extrusion, revolution and offset surfaces into BSpline surfaces. Returns the result into the shape, which is given as parameter result.
+
**Example:**
-
+~~~~~
DT_ToBspl res sh
== error = 5.20375663162094e-08 spans = 10
== Surface is aproximated with continuity 2
+~~~~~
-@section occt_draw_commands_perf Performance evaluation commands
+@section occt_draw_10 Performance evaluation commands
-@subsection occt_draw_commands_perf_vdrawsphere VDrawSphere
+@subsection occt_draw_10_1 VDrawSphere
-Syntax: vdrawsphere shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToEnableVBO=1] [NumberOfViewerUpdate=1] [ToShowEdges=0]
+Syntax:
+~~~~~
+vdrawsphere shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToEnableVBO=1] [NumberOfViewerUpdate=1] [ToShowEdges=0]
+~~~~~
Calculates and displays in a given number of steps a sphere with given coordinates, radius and fineness. Returns the information about the properties of the sphere, the time and the amount of memory required to build it.
This command can be used for visualization performance evaluation instead of the outdated Visualization Performance Meter.
-**Example:**
-
-vdrawsphere s 200 1 1 1 500 1 == Compute Triangulation... == NumberOfPoints: 39602 == NumberOfTriangles: 79200 == Amount of memory required for PolyTriangulation without Normals: 2 Mb == Amount of memory for colors: 0 Mb == Amount of memory for PolyConnect: 1 Mb == Amount of graphic card memory required: 2 Mb == Number of scene redrawings: 1 == CPU user time: 15.6000999999998950 msec == CPU system time: 0.0000000000000000 msec == CPU average time of scene redrawing: 15.6000999999998950 msec
+**Example:**
+~~~~~
+vdrawsphere s 200 1 1 1 500 1
+== Compute Triangulation...
+== NumberOfPoints: 39602
+== NumberOfTriangles: 79200
+== Amount of memory required for PolyTriangulation without Normals: 2 Mb
+== Amount of memory for colors: 0 Mb
+== Amount of memory for PolyConnect: 1 Mb
+== Amount of graphic card memory required: 2 Mb
+== Number of scene redrawings: 1
+== CPU user time: 15.6000999999998950 msec
+== CPU system time: 0.0000000000000000 msec
+== CPU average time of scene redrawing: 15.6000999999998950 msec
+~~~~~
-@section occt_2142243456_713659999 Extending Test Harness with custom commands
+@section occt_draw_11 Extending Test Harness with custom commands
The following chapters explain how to extend Test Harness with custom commands and how to activate them using a plug-in mechanism.
-@subsection occt_2142243456_7136599991 Custom command implementation
+@subsection occt_draw_11_1 Custom command implementation
Custom command implementation has not undergone any changes since the introduction of the plug-in mechanism. The syntax of every command should still be like in the following example.
-**Example:**
+**Example:**
~~~~~
-static Standard_Integer myadvcurve(Draw_Interpretor& di,
-Standard_Integer n,
-char** a)
+static Standard_Integer myadvcurve(Draw_Interpretor& di, Standard_Integer n, char** a)
{
...
}
For examples of existing commands refer to Open CASCADE Technology (e.g. GeomliteTest.cxx).
-@subsection occt_2142243456_7136599992 Registration of commands in Test Harness
+@subsection occt_draw_11_2 Registration of commands in Test Harness
To become available in the Test Harness the custom command must be registered in it. This should be done as follows.
-**Example:**
+**Example:**
~~~~~
-void MyPack::CurveCommands(Draw_Interpretor& theCommands)
+void MyPack::CurveCommands(Draw_Interpretor& theCommands)
{
...
-char* g = ;Advanced curves creation;;
-
+char* g = "Advanced curves creation";
- theCommands.Add ( ;myadvcurve;, ;myadvcurve name p1 p2 p3 –
- Creates my advanced curve from points;,
-__FILE__, myadvcurve, g);
+theCommands.Add ( "myadvcurve", "myadvcurve name p1 p2 p3 – Creates my advanced curve from points",
+ __FILE__, myadvcurve, g );
...
}
~~~~~
-@subsection occt_2142243456_7136599993 Creating a toolkit (library) as a plug-in
+@subsection occt_draw_11_3 Creating a toolkit (library) as a plug-in
-All custom commands are compiled and linked into a dynamic library (.dll on Windows, or .so on Unix/Linux). To make Test Harness recognize it as a plug-in it must respect certain conventions. Namely, it must export function PLUGINFACTORY() accepting the Test Harness interpreter object (Draw_Interpretor). This function will be called when the library is dynamically loaded during the Test Harness session.
-This exported function PLUGINFACTORY() must be implemented only once per library.
-For convenience the DPLUGIN macro (defined in the Draw_PluginMacro.hxx file) has been provided. It implements the PLUGINFACTORY() function as a call to the Package::Factory() method and accepts Package as an argument. Respectively, this Package::Factory() method must be implemented in the library and activate all implemented commands.
-**Example:**
+All custom commands are compiled and linked into a dynamic library (.dll on Windows, or .so on Unix/Linux). To make Test Harness recognize it as a plug-in it must respect certain conventions. Namely, it must export function *PLUGINFACTORY()* accepting the Test Harness interpreter object (*Draw_Interpretor*). This function will be called when the library is dynamically loaded during the Test Harness session.
-#include Draw_PluginMacro.hxx
+This exported function *PLUGINFACTORY()* must be implemented only once per library.
-void MyPack::Factory(Draw_Interpretor& theDI)
-{
-...
-//
-MyPack::CurveCommands(theDI);
-...
-}
+For convenience the *DPLUGIN* macro (defined in the *Draw_PluginMacro.hxx* file) has been provided. It implements the *PLUGINFACTORY()* function as a call to the *Package::Factory()* method and accepts *Package* as an argument. Respectively, this *Package::Factory()* method must be implemented in the library and activate all implemented commands.
-// Declare entry point PLUGINFACTORY
-DPLUGIN(MyPack)
+**Example:**
+~~~~~
+#include <Draw_PluginMacro.hxx>
+
+void MyPack::Factory(Draw_Interpretor& theDI)
+{
+...
+//
+MyPack::CurveCommands(theDI);
+...
+}
+// Declare entry point PLUGINFACTORY
+DPLUGIN(MyPack)
+~~~~~
-@subsection occt_2142243456_7136599994 Creation of the plug-in resource file
+@subsection occt_draw_11_4 Creation of the plug-in resource file
-As mentioned above, the plug-in resource file must be compliant with Open CASCADE Technology requirements (see Resource_Manager.cdl file for details). In particular, it should contain keys separated from their values by a colon (;:;).
+As mentioned above, the plug-in resource file must be compliant with Open CASCADE Technology requirements (see *Resource_Manager.cdl* file for details). In particular, it should contain keys separated from their values by a colon (;:;).
For every created plug-in there must be a key. For better readability and comprehension it is recommended to have some meaningful name.
Thus, the resource file must contain a line mapping this name (key) to the library name. The latter should be without file extension (.dll on Windows, .so on Unix/Linux) and without the ;lib; prefix on Unix/Linux.
For several plug-ins one resource file can be created. In such case, keys denoting plug-ins can be combined into groups, these groups - into their groups and so on (thereby creating some hierarchy). Any new parent key must have its value as a sequence of child keys separated by spaces, tabs or commas. Keys should form a tree without cyclic dependencies.
-**Examples** (file MyDrawPlugin):
+**Examples** (file MyDrawPlugin):
+~~~~~
! Hierarchy of plug-ins
ALL : ADVMODELING, MESHING
DEFAULT : MESHING
ADVSURF : TKMyAdvSurf
ADVCURV : TKMyAdvCurv
MESHING : TKMyMesh
+~~~~~
-
-For other examples of the plug-in resource file refer to the *;Plug-in resource file;* chapter above or to the $CASROOT/src/DrawPlugin file shipped with Open CASCADE Technology.
+For other examples of the plug-in resource file refer to the <a href="#occt_draw_1_3_2">Plug-in resource file</a> chapter above or to the <i>$CASROOT/src/DrawPlugin</i> file shipped with Open CASCADE Technology.
-@subsection occt_2142243456_7136599995 Dynamic loading and activation
+@subsection occt_draw_11_5 Dynamic loading and activation
-Loading a plug-in and activating its commands is described in the *;Activation of the commands implemented in the plug-in;* chapter.
+Loading a plug-in and activating its commands is described in the <a href="#occt_draw_1_3_3">Activation of the commands implemented in the plug-in</a> chapter.
The procedure consists in defining the system variables and using the pload commands in the Test Harness session.
**Example:**
-
~~~~
- Draw[] set env(CSF_MyDrawPluginDefaults) /users/test
+Draw[]> set env(CSF_MyDrawPluginDefaults) /users/test
+Draw[]> pload -MyDrawPlugin ALL
~~~~
* 2: use 3D for 142 entities and 2D for 141 entities,
* 3: both representations are equally preferred.
* *2DUse_Preferred (2)* : the 2D is used to rebuild the 3D in case of their inconsistency,
-* *2DUse_Forced (-2)*: the 2D is always used to rebuild the 3D (even if 2D is present in the file),
+* *2DUse_Forced (-2)*: the 2D is always used to rebuild the 3D (even if 3D is present in the file),
* *3DUse_Preferred (3)*: the 3D is used to rebuild the 2D in case of their inconsistency,
* *3DUse_Forced (-3)*: the 3D is always used to rebuild the 2D (even if 2D is present in the file),
--- /dev/null
+OCAF Function Mechanism {#occt_ocaf_functionmechanism_wp}
+========================
+
+@tableofcontents
+
+@section occt_ocaf_functionmechanism_wp_1 Introduction
+
+ This guide describes the usage of the Function Mechanism of Open CASCADE Application Framework on a simple example.
+ This example represents a "nail" composed by a cone and two cylinders of different radius and height:
+
+@image html ocaf_functionmechanism_wp_image003.png "A nail"
+@image latex ocaf_functionmechanism_wp_image003.png " A nail"
+
+ These three objects (a cone and two cylinders) are independent,
+ but the Function Mechanism makes them connected to each other and representing one object – a nail.
+ The object "nail" has the following parameters:
+
+ * The position of the nail is defined by the apex point of the cone.
+ The cylinders are built on the cone and therefore they depend on the position of the cone.
+ In this way we define a dependency of the cylinders on the cone.
+ * The height of the nail is defined by the height of the cone.
+ Let’s consider that the long cylinder has 3 heights of the cone
+ and the header cylinder has a half of the height of the cone.
+ * The radius of the nail is defined by the radius of the cone.
+ The radius of the long cylinder coincides with this value.
+ Let’s consider that the header cylinder has one and a half radiuses of the cone.
+
+ So, the cylinders depend on the cone and the cone parameters define the size of the nail.
+
+ It means that re-positioning the cone (changing its apex point) moves the nail,
+ the change of the radius of the cone produces a thinner or thicker nail,
+ and the change of the height of the cone shortens or prolongates the nail.
+ It is suggested to examine the programming steps needed to create a 3D parametric model of the "nail".
+ This guide describes in detail usage of the Function Mechanism.
+ Other aspects, such as the data model and the interfaces are mentioned in brief.
+
+@section occt_ocaf_functionmechanism_wp_2 Step 1: Data Tree
+
+ The first step consists in model data allocation in the OCAF tree.
+ In other words, it is necessary to decide where to put the data.
+
+ In this case, the data can be organized into a simple tree
+ using references for definition of dependent parameters:
+
+* Nail
+ * Cone
+ + Position (x,y,z)
+ + Radius
+ + Height
+ * Cylinder (stem)
+ + Position = "Cone" position translated for "Cone" height along Z;
+ + Radius = "Cone" radius;
+ + Height = "Cone" height multiplied by 3;
+ * Cylinder (head)
+ + Position = "Long cylinder" position translated for "Long cylinder" height along Z;
+ + Radius = "Long cylinder" radius multiplied by 1.5;
+ + Height = "Cone" height divided by 2.
+
+ The "nail" object has three sub-leaves in the tree: the cone and two cylinders.
+
+ The cone object is independent.
+
+ The long cylinder representing a "stem" of the nail refers to the corresponding parameters
+ of the cone to define its own data (position, radius and height). It means that the long cylinder depends on the cone.
+
+ The parameters of the head cylinder may be expressed through the cone parameters
+ only or through the cone and the long cylinder parameters.
+ It is suggested to express the position and the radius of the head cylinder
+ through the position and the radius of the long cylinder, and the height
+ of the head cylinder through the height of the cone.
+ It means that the head cylinder depends on the cone and the long cylinder.
+
+@section occt_ocaf_functionmechanism_wp_3 Step 2: Interfaces
+
+ The interfaces of the data model are responsible for dynamic creation
+ of the data tree of the represented at the previous step, data modification and deletion.
+
+ The interface called *INail* should contain the methods for creation
+ of the data tree for the nail, setting and getting of its parameters, computation, visualization and removal.
+
+@subsection occt_ocaf_functionmechanism_wp_3_1 Creation of the nail
+
+ This method of the interface creates a data tree for the nail at a given leaf of OCAF data tree.
+
+ It creates three sub-leaves for the cone and two cylinders and allocates the necessary data (references at the sub-leaves of the long and the head cylinders).
+
+ It sets the default values of position, radius and height of the nail.
+
+ The nail has the following user parameters:
+ * The position – coincides with the position of the cone
+ * The radius of the stem part of the nail – coincides with the radius of the cone
+ * The height of the nail – a sum of heights of the cone and both cylinders
+
+ The values of the position and the radius of the nail are defined for the cone object data.
+ The height of the cone is recomputed as 2 * heights of nail and divided by 9.
+
+@subsection occt_ocaf_functionmechanism_wp_3_2 Computation
+
+ The Function Mechanism is responsible for re-computation of the nail.
+ It will be described in detail later in this document.
+
+ A data leaf consists of the reference to the location of the real data
+ and a real value defining a coefficient of multiplication of the referenced data.
+
+ For example, the height of the long cylinder is defined as a reference to the height of the cone
+ with coefficient 3. The data leaf of the height of the long cylinder
+ should contain two attributes: a reference to the height of cone and a real value equal to 3.
+
+@subsection occt_ocaf_functionmechanism_wp_3_3 Visualization
+
+ The shape resulting of the nail function can be displayed using the standard OCAF visualization mechanism.
+
+@subsection occt_ocaf_functionmechanism_wp_3_4 Removal of the nail
+
+To automatically erase the nail from the viewer and the data tree it is enough to clean the nail leaf from attributes.
+
+@section occt_ocaf_functionmechanism_wp_4 Step 3: Functions
+
+ The nail is defined by four functions: the cone, the two cylinders and the nail function.
+ The function of the cone is independent. The functions of the cylinders depend on the cone function.
+ The nail function depends on the results of all functions:
+
+@image html ocaf_functionmechanism_wp_image005.png "Picture 3. A graph of dependencies between functions"
+@image latex ocaf_functionmechanism_wp_image005.png "Picture 3. A graph of dependencies between functions"
+
+ Computation of the model starts with the cone function, then the long cylinder,
+ after that the header cylinder and, finally, the result is generated by the nail function at the end of function chain.
+
+ The Function Mechanism of Open CASCADE Technology creates this graph of dependencies
+ and allows iterating it following the dependencies.
+ The only thing the Function Mechanism requires from its user
+ is the implementation of pure virtual methods of *TFunction_Driver*:
+
+ * <i>::Arguments()</i> – returns a list of arguments for the function
+ * <i>::Results()</i> – returns a list of results of the function
+
+ These methods give the Function Mechanism the information on the location of arguments
+ and results of the function and allow building a graph of functions.
+ The class *TFunction_Iterator* iterates the functions of the graph in the execution order.
+
+ The pure virtual method *TFunction_Driver::Execute()* calculating the function should be overridden.
+
+ The method <i>::MustExecute()</i> calls the method <i>::Arguments()</i> of the function driver
+ and ideally this information (knowledge of modification of arguments of the function) is enough
+ to make a decision whether the function should be executed or not. Therefore, this method usually shouldn’t be overridden.
+
+ The cone and cylinder functions differ only in geometrical construction algorithms.
+ Other parameters are the same (position, radius and height).
+
+ It means that it is possible to create a base class – function driver for the three functions,
+ and two descendent classes producing: a cone or a cylinder.
+
+ For the base function driver the methods <i>::Arguments()</i> and <i>::Results()</i> will be overridden.
+ Two descendent function drivers responsible for creation of a cone and a cylinder will override only the method <i>::Execute()</i>.
+
+ The method <i>::Arguments()</i> of the function driver of the nail returns the results of the functions located under it in the tree of leaves. The method <i>::Execute()</i> just collects the results of the functions and makes one shape – a nail.
+
+ This way the data model using the Function Mechanism is ready for usage. Do not forget to introduce the function drivers for a function driver table with the help of *TFunction_DriverTable* class.
+
+@section occt_ocaf_functionmechanism_wp_5 Appendix 1
+
+ This appendix gives an example of the code for iteration and execution of functions.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+
+ // The scope of functions is defined.
+ Handle(TFunction_Scope) scope = TFunction_Scope::Set( anyLabel );
+
+ // The information on modifications in the model is received.
+ TFunction_Logbook& log = scope-GetLogbook();
+
+ // The iterator is iInitialized by the scope of functions.
+ TFunction_Iterator iterator( anyLabel );
+ Iterator.SetUsageOfExecutionOrder( true );
+
+ // The function is iterated, its dependency is checked on the modified data and executed if necessary.
+ for (; iterator.more(); iterator.Next())
+ {
+ // The function iterator may return a list of current functions for execution.
+ // It might be useful for multi-threaded execution of functions.
+ const TDF_LabelList& currentFunctions = iterator.Current();
+
+ //The list of current functions is iterated.
+ TDF_ListIteratorOfLabelList currentterator( currentFucntions );
+ for (; currentIterator.More(); currentIterator.Next())
+ {
+ // An interface for the function is created.
+ TFunction_IFunction interface( currentIterator.Value() );
+
+ // The function driver is retrieved.
+ Handle(TFunction_Driver) driver = interface.GetDriver();
+
+ // The dependency of the function on the modified data is checked.
+ If (driver-MustExecute( log ))
+ {
+ // The function is executed.
+ int ret = driver-Execute( log );
+ if ( ret )
+ return false;
+ } // end if check on modification
+ } // end of iteration of current functions
+ } // end of iteration of functions.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@section occt_ocaf_functionmechanism_wp_6 Appendix 2
+
+ This appendix gives an example of the code for a cylinder function driver. In order to make the things clearer, the methods <i>::Arguments()</i> and <i>::Results()</i> from the base class are also mentioned.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+
+ // A virtual method ::Arguments() returns a list of arguments of the function.
+ CylinderDriver::Arguments( TDF_LabelList& args )
+ {
+ // The direct arguments, located at sub-leaves of the fucntion, are collected (see picture 2).
+ TDF_ChildIterator cIterator( Label(), false );
+ for (; cIterator.More(); cIterator.Next() )
+ {
+ // Direct argument.
+ TDF_Label sublabel = cIterator.Value();
+ Args.Append( sublabel );
+
+ // The references to the external data are checked.
+ Handle(TDF_Reference) ref;
+ If ( sublabel.FindAttribute( TDF_Reference::GetID(), ref ) )
+ {
+ args.Append( ref-Get() );
+ }
+ }
+
+ // A virtual method ::Results() returns a list of result leaves.
+ CylinderDriver::Results( TDF_LabelList& res )
+ {
+ // The result is kept at the function label.
+ Res.Append( Label() );
+ }
+
+ // Execution of the function driver.
+ Int CylinderDriver::Execute( TFunction_Logbook& log )
+ {
+ // Position of the cylinder – position of the first function (cone)
+ //is elevated along Z for height values of all previous functions.
+ gp_Ax2 axes = …. // out of the scope of this guide.
+ // The radius value is retrieved.
+ // It is located at second child sub-leaf (see the picture 2).
+ TDF_Label radiusLabel = Label().FindChild( 2 );
+
+ // The multiplicator of the radius ()is retrieved.
+ Handle(TDataStd_Real) radiusValue;
+ radiusLabel.FindAttribute( TDataStd_Real::GetID(), radiusValue);
+
+ // The reference to the radius is retrieved.
+ Handle(TDF_Reference) refRadius;
+ RadiusLabel.FindAttribute( TDF_Reference::GetID(), refRadius );
+
+ // The radius value is calculated.
+ double radius = 0.0;
+
+ if ( refRadius.IsNull() )
+ {
+ radius = radiusValue-Get();
+ }
+ else
+ {
+ // The referenced radius value is retrieved.
+ Handle(TDataStd_Real) referencedRadiusValue;
+ RefRadius-Get().FindAttribute(TDataStd_Real::GetID() ,referencedRadiusValue );
+ radius = referencedRadiusValue-Get() * radiusValue-Get();
+ }
+
+ // The height value is retrieved.
+ double height = … // similar code to taking the radius value.
+
+ // The cylinder is created.
+ TopoDS_Shape cylinder = BRepPrimAPI_MakeCylinder(axes, radius, height);
+
+ // The result (cylinder) is set
+ TNaming_Builder builder( Label() );
+ Builder.Generated( cylinder );
+
+ // The modification of the result leaf is saved in the log.
+ log.SetImpacted( Label() );
+
+ return 0;
+ }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\ No newline at end of file
--- /dev/null
+ Distribution of Data Through OCAF Tree {#occt_ocaf_tree_wp}
+=======================================
+@tableofcontents
+
+@section occt_ocaf_tree_wp_1 Introduction
+
+ Open CASCADE Application Framework (OCAF) represents a set of classes for Rapid Application Development.
+ OCAF helps to implement such functions as undo and redo, copy, cut and paste, storage and retrieval of documents, and many others.
+
+ OCAF is based on a notion of label-attribute. The labels form a tree.
+ The attributes are attached to the labels and store user data in the OCAF document.
+
+This document describes how data should be stored in the OCAF document and considers the following issues:
+
+ * Should we choose standard attributes or is it better to create new ones?
+ * How can we optimize data allocation to make it easy to use and efficient for memory usage and application speed?
+
+In particular, the document describes an example of using standard OCAF attributes and creating new OCAF attributes. It is assumed that the reader is already familiar with some OCAF basics.
+
+
+@section occt_ocaf_tree_wp_2 Description
+
+ When you start to design an application based on OCAF,
+ usually you need to choose between standard and newly-created attributes
+ to be used for allocation of data in the OCAF document.
+ Before giving an answer to this question, let’s overview standard OCAF attributes.
+
+ All basic data types are represented in OCAF as special attributes:
+ * Integer,
+ * Double,
+ * String,
+ * Array of integer values,
+ * Array of double values,
+ * Array of string values,
+ * Topological shapes.
+
+ An attentive reader might have noticed that there is no Boolean type.
+ This is because the Integer type is usually used instead.
+
+ So, we have an opportunity to describe any model by means of standard OCAF attributes.
+ But will this description be efficient for memory, speed, and, at the same time, convenient to use?
+ It depends on a particular model.
+
+ OCAF has one restriction: only one attribute type may be allocated to one label.
+ It is necessary to take into account the design of the application data tree.
+ For example, if a label should possess several double values,
+ it is necessary to distribute them through several child sub-labels or use an array of double values.
+
+ Let’s consider several boundary implementations of the same model in OCAF tree
+ and analyse the advantages and disadvantages of each approach.
+
+@section occt_ocaf_tree_wp_3 Comparison and analysis of approaches
+
+ Below are described two different model implementations:
+ one is based on standard OCAF attributes and the other is based
+ on the creation of a new attribute possessing all data of the model.
+
+ A load is distributed through the shape. The measurements are taken at particular points defined by (x, y and z) co-ordinates. The load is represented as a projection onto X, Y and Z axes of the local co-ordinate system at each point of measurement. A matrix of transformation is needed
+ to convert the local co-ordinate system to the global one, but this is optional.
+
+ So, we have 15 double values at each point of measurement.
+ If the number of such points is 100 000, for example, it means
+ that we have to store 1 500 000 double values in the OCAF document.
+
+ The first approach consists in using standard OCAF attributes.
+ Besides, there are several variants of how the standard attributes may be used:
+ * Allocation of all 1 500 000 double values as one array of double values attached to one label;
+ * Allocation of values of one measure of load (15 values) as one array of double values and attachment of one point of measure to one label;
+ * Allocation of each point of measure as an array of 3 double values attached to one label, the projection of load onto the local co-ordinate system axes as another array of 3 double values attached to a sub-label, and the matrix of projection (9 values) as the third array also attached to a sub-label.
+
+ Certainly, other variants are also possible.
+
+@image html ocaf_tree_wp_image003.png "Allocation of all data as one array of double values"
+@image latex ocaf_tree_wp_image003.png "Allocation of all data as one array of double values"
+
+ The first approach to allocation of all data represented as one array of double values
+ saves initial memory and is easy to implement.
+ But access to the data is difficult because the values are stored in a flat array.
+ It will be necessary to implement a class with several methods giving access
+ to particular fields like the measurement points, loads and so on.
+
+ If the values may be edited in the application,
+ it means that the whole array will be backed-up on each edition.
+ The memory usage will increase very fast!
+ So, this approach may be considered only in case of non-editable data.
+
+ Let’s consider the allocation of data of each measurement point per label (the second case).
+ In this case we create 100 000 labels – one label for each measurement point
+ and attach an array of double values to these labels:
+
+@image html ocaf_tree_wp_image004.png "Allocation of data of each measurement point as arrays of double values"
+@image latex ocaf_tree_wp_image004.png "Allocation of data of each measurement point as arrays of double values"
+
+ Now edition of data is safer as far as memory usage is concerned.
+ Change of value for one measurement point (any value: point co-ordinates, load, and so on)
+ backs-up only one small array of double values.
+ But this structure (tree) requires more memory space (additional labels and attributes).
+
+ Besides, access to the values is still difficult and it is necessary
+ to have a class with methods of access to the array fields.
+
+ The third case of allocation of data through OCAF tree is represented below:
+
+@image html ocaf_tree_wp_image005.png "Allocation of data into separate arrays of double values"
+@image latex ocaf_tree_wp_image005.png "Allocation of data into separate arrays of double values"
+
+ In this case sub-labels are involved and we can easily access the values of each measurement point,
+ load or matrix. We don’t need an interface class with methods of access to the data
+ (if it exists, it would help to use the data structure, but this is optional).
+
+ On the one hand, this approach requires more memory for allocation of the attributes (arrays of double values).
+ On the other hand, it saves memory during the edition of data
+ by backing-up only the small array containing the modified data.
+ So, if the data is fully modifiable, this approach is more preferable.
+
+ Before making a conclusion, let’s consider the same model implemented through a newly created OCAF attribute.
+
+ For example, we might allocate all data belonging to one measurement point as one OCAF attribute.
+ In this case we implement the third variant of using the standard attributes (see picture 3),
+ but we use less memory (because we use only one attribute instead of three):
+
+@image html ocaf_tree_wp_image006.png "Allocation of data into newly created OCAF attribute"
+@image latex ocaf_tree_wp_image006.png "Allocation of data into newly created OCAF attribute"
+
+ The second variant of using standard OCAF attributes still has drawbacks:
+ when data is edited, OCAF backs-up all values of the measurement point.
+
+ Let’s imagine that we have some non-editable data.
+ It would be better for us to allocate this data separately from editable data.
+ Back-up will not affect non-editable data and memory will not increase so much during data edition.
+
+@section occt_ocaf_tree_wp_4 Conclusion
+
+ When deciding which variant of data model implementation to choose,
+ it is necessary to take into account the application response time,
+ memory allocation and memory usage in transactions.
+
+ Most of the models may be implemented using only standard OCAF attributes.
+ Some other models need special treatment and require implementation of new OCAF attributes.
--- /dev/null
+OCAF White-Paper {#ocaf_wp}
+========================
+ @tableofcontents
+
+@section ocaf_wp_1 What is OCAF ?
+
+@subsection ocaf_wp_1_1 Purpose of OCAF
+
+ The Open CASCADE Application Framework (OCAF) is an easy-to-use platform for rapidly developing
+ sophisticated domain-specific design applications.
+ A typical application developed using OCAF deals with two or three-dimensional (2D or 3D) geometric modeling
+ in trade-specific Computer Aided Design (CAD) systems, manufacturing or analysis applications,
+ simulation applications or illustration tools.
+
+ Developing a design application requires addressing many technical aspects.
+ In particular, given the functional specification of your application, you must at least:
+
+ * Design the architecture of the application — definition of the software components and the way they cooperate
+ * Define the data model able to support the functionality required — a design application operates on data maintained during the whole end-user working session
+ * Structure the software in order to
+ * synchronize the display with the data — commands modifying objects must update the views
+ * support generalized undo-redo commands — this feature has to be taken into account very early in the design process
+ * Implement the function for saving the data — if the application has a long life cycle, the compatibility of data between versions of the application has to be addressed
+ * Build the application user interface
+
+ By providing architectural guidance and ready-to-use solutions to these issues,
+ OCAF helps you to develop your application significantly faster: you concentrate on the application's functionality.
+
+@subsection ocaf_wp_1_2 Overview of the Architecture
+
+ OCAF provides you with an object-oriented Application-Document-Attribute model.
+ This consists of C++ class libraries. The main class, Application, is an abstract class
+ in charge of handling documents during the working session. Services provided by this class include:
+ * Creating new documents
+ * Saving documents and opening them
+ * Initializing document views
+
+ The document, implemented by the concrete class Document, is the container for the application data.
+ Its main purpose is to centralize notifications of data editing in order to provide Undo-Redo.
+ Each document is saved in a single flat ASCII file defined by its format and extension (a ready-to-use format is provided with OCAF).
+
+ Application data are attributes, that is, instances of classes derived from the *Attribute* abstract class,
+ organized according to the OCAF Data Framework.
+ The OCAF Data Framework references aggregations of attributes using persistent identifiers in a single hierarchy (the Data Framework is described <a href="#ocaf_wp_2">in the next chapter</a>). A wide range of attributes come with OCAF, including:
+
+ * Primitive attributes such as *Integer, Real, Name* and *Comment*;
+ * Shape attribute containing the geometry of the whole model or elements of it;
+ * Other geometric attributes such as Datums (points, axis and plane) and Constraints (*tangent-to, at-a-given-distance, from-a-given-angle, concentric,* etc.)
+ * Modeling step and Function attributes — the purpose of these attributes is to rebuild objects after they have been modified (parameterization of models)
+ * Visualization attributes — these attributes allow data to be visualized in a 2D or 3D viewer
+ * User attributes, that is, attributes typed by the application
+ * In addition, application-specific data can be added by defining new attribute classes;
+ naturally, this changes the standard file format. The only functions that have to be implemented are:
+ * Copying the attribute
+ * Converting it from and to its persistent homolog (persistence is briefly presented in the paragraph <a href="#ocaf_wp_2_3">Persistent Data Storage</a>)
+
+@image html ocaf_wp_image003.png "The Application-Document-Attribute model "
+@image latex ocaf_wp_image003.png "The Application-Document-Attribute model "
+
+OCAF uses other modules of Open CASCADE Technology — the Shape attribute is implemented with the geometry supported by the <a href="#user_guides__modeling_data">Modeling Data</a> module and the viewer is the one provided with the <a href="#user_guides__visualization">Visualization</a> module. Modeling functions can be implemented using the <a href="#user_guides__modeling_algos">Modeling Algorithms</a> module.
+
+@subsection ocaf_wp_1_3 Getting Started
+
+ At the beginning of your development, you first define an application class by inheriting from the Application abstract class.
+ You only have to create and determine the resources of the application
+ for specifying the format of your documents (you generally use the standard one) and their file extension.
+
+ Then, you design the application data model by organizing attributes you choose among those provided with OCAF.
+ You can specialize these attributes using the User attribute. For example, if you need a reflection coefficient,
+ you aggregate a User attribute identified as a reflection coefficient
+ with a Real attribute containing the value of the coefficient (as such, you don't define a new class).
+
+ If you need application specific data not provided with OCAF, for example,
+ to incorporate a finite element model in the data structure,
+ you define a new attribute class containing the mesh,
+ and you include its persistent homolog in a new file format.
+
+ Once you have implemented the commands which create and modify the data structure
+ according to your specification, OCAF provides you, without any additional programming:
+
+ * Persistent reference to any data, including geometric elements — several documents can be linked with such reference;
+ * Document-View association;
+ * Ready-to-use functions such as :
+ * Undo-redo;
+ * Save and open application data.
+
+ Finally, you develop the application's graphical user interface using the toolkit of your choice, for example:
+ * KDE Qt or GNOME GTK+ on Linux;
+ * Microsoft Foundation Classes (MFC) on Windows Motif on Sun;
+ * Other commercial products such as Ilog Views.
+
+ You can also implement the user interface in the Java language using
+ the Swing-based Java Application Desktop component (JAD) provided with OCAF.
+
+@subsection ocaf_wp_1_4 Benefits of OCAF
+
+ As you use the architecture provided by OCAF, the design of your application is made easy:
+ the application developer concentrates on the functionality
+ instead of the underlying mechanisms required to support this functionality.
+
+ Also, thanks to the coupling with the other Open CASCADE Technology modules,
+ your application can rapidly be prototyped. In addition, the final application
+ can be developed by industrializing the prototype — you don't need to restart the development from scratch.
+
+ Last but not least, you base your application on an Open Source component:
+ this guarantees the long-term usefulness of your development.
+
+@section ocaf_wp_2 A Look Inside OCAF
+
+@subsection ocaf_wp_2_1 The Design of OCAF
+
+@subsubsection ocaf_wp_2_1_1 Reference-key model
+
+ In most existing geometric modeling systems, the data are topology driven.
+ They usually use a boundary representation (BRep), where geometric models
+ are defined by a collection of faces, edges and vertices,
+ to which application data are attached. Examples of data include:
+
+ * a color;
+ * a material;
+ * information that a particular edge is blended.
+
+ When the geometric model is parameterized, that is, when you can change
+ the value of parameters used to build the model (the radius of a blend, the thickness of a rib, etc.),
+ the geometry is highly subject to change.
+ In order to maintain the attachment of application data, the geometry must be distinguished from other data.
+
+ In OCAF, the data are reference-key driven. It is a uniform model in which reference-keys
+ are the persistent identification of data. All *accessible </b>*data, including the geometry,
+ are implemented as attributes attached to reference-keys.
+ The geometry becomes the value of the Shape attribute, just as a number is the value
+ of the Integer and Real attributes and a string that of the Name attribute.
+
+ On a single reference-key, many attributes can be aggregated;
+ the application can ask at runtime which attributes are available.
+ For example, to associate a texture to a face in a geometric model,
+ both the face and the texture are attached to the same reference-key.
+
+@image html ocaf_wp_image004.png "Figure 2. Topology driven versus reference-key driven approaches"
+@image latex ocaf_wp_image004.png "Figure 2. Topology driven versus reference-key driven approaches"
+
+@subsubsection ocaf_wp_2_1_2 Topological naming
+
+ Reference-keys can be created in two ways:
+
+ * At programming time, by the application
+ * At runtime, by the end-user of the application (providing that you include this capability in the application)
+
+ As an application developer, you generate reference-keys in order to give semantics to the data.
+ For example, a function building a prism may create three reference-keys:
+ one for the base of the prism, a second for the lateral faces and a third for the top face.
+ This makes up a semantic built-in the application's prism feature.
+ On the other hand, in a command allowing the end-user to set a texture to a face he/she selects,
+ you must create a reference-key to the selected face
+ if it has not previously been referenced in any feature
+ (as in the case of one of the lateral faces of the prism).
+
+ When you create a reference-key to selected topological elements (faces, edges or vertices),
+ OCAF attaches to the reference-key information defining the selected topology — the Naming attribute.
+ For example, it may be the faces to which a selected edge is common to.
+ This information, as well as information about the evolution of the topology at each modeling step
+ (the modified, updated and deleted faces), is used by the naming algorithm to maintain the topology
+ attached to the reference-key. As such, on a parametrized model,
+ after modifying the value of a parameter, the reference-keys still address the appropriate faces,
+ even if their geometry has changed.
+ Consequently, you change the size of the cube shown in the figure 2 above,
+ the user texture stay attached to the right face.
+
+ <b>Note</b> As Topological naming is based on the reference-key and attributes such as Naming
+ (selection information) and Shape (topology evolution information),
+ OCAF is not coupled to the underlying modeling libraries.
+ The only modeling services required by OCAF are the following:
+
+ * Each algorithm must provide information about the evolution of the topology
+ (the list of faces modified, updated and deleted by the algorithm)
+ * Exploration of the geometric model must be available
+ (a 3D model is made of faces bounded by close wires,
+ themselves composed by a sequence of edges connected by their vertices)
+
+ Currently, OCAF uses the Open CASCADE Technology modeling libraries.
+
+@subsubsection ocaf_wp_2_1_3 Aggregation of attributes
+
+ To design an OCAF-based data model, the application developer is encouraged to aggregate
+ ready-to-use attributes instead of defining new attributes by inheriting from an abstract root class.
+ There are two major advantages in using aggregation rather than inheritance:
+
+ * As you don't implement data by defining new classes, the format of saved data
+ provided with OCAF doesn't change; so you don't have to write the Save and Open functions
+ * The application can query the data at runtime if a particular attribute is available
+
+@subsubsection ocaf_wp_2_1_4 Summary
+
+ * OCAF is based on a uniform reference-key model in which:
+ * Reference-keys provide persistent identification of data;
+ * Data, including geometry, are implemented as attributes attached to reference-keys;
+ * Topological naming maintains the selected geometry attached to reference-keys in parametrized models ;
+ * In many applications, the data format provided with OCAF doesn't need to be extended;
+ * OCAF is not coupled to the underlying modeling libraries.
+
+@subsection ocaf_wp_2_2 The Data Framework
+
+@subsubsection ocaf_wp_2_2_1 Data structure
+
+ The OCAF Data Framework is the Open CASCADE Technology realization
+ of the reference-key model presented in the previous paragraph.
+ It implements the reference-key as label objects,
+ organized in a tree structure characterized by the following features:
+
+ * A document contains only one tree of labels
+ * Each label has a tag expressed as an integer value unique at its level in the tree
+ * A label is identified by a string — the entry — built by concatenation of tags from the root of the tree, for example [0:1:2:1]
+ * Attributes are of a type identified by a universal unique identifier (GUID)
+ * Attributes are attached to labels; a label may refer to many attributes as long as each has a different GUID
+
+ As such, each piece of data has a unique persistent address made up of the document path,
+ its entry and the GUID of its class.
+
+ In the image the application for designing coffee machines first allocates
+ a label for the machine unit. It then adds sub-labels for the main features
+ (glass coffee pot, water receptacle and filter) which it refines as needed
+ (handle and reservoir of the coffee pot and spout of the reservoir).
+
+ You now attach technical data describing the handle — its geometry and color —
+ and the reservoir — its geometry and material.
+ Later on, you can modify the handle's geometry without changing its color —
+ both remain attached to the same label.
+
+@image html ocaf_wp_image005.png "Figure 3. The data structure of the coffee machine"
+@image latex ocaf_wp_image005.png "Figure 3. The data structure of the coffee machine"
+
+ The nesting of labels is key to OCAF. This allows a label to have its own structure
+ with its local addressing scheme which can be reused in a more complex structure.
+ Take, for example, the coffee machine. Given that the coffee pot's handle has a label of tag [1],
+ the entry for the handle in the context of the coffee pot only (without the machine unit) is [0:1:1].
+ If you now model a coffee machine with two coffee pots, one at the label [1],
+ the second at the label [4] in the machine unit,
+ the handle of the first pot would have the entry [0:1:1:1]
+ whereas the handle of the second pot would be [0:1:4:1].
+ This way, we avoid any confusion between coffee pot handles.
+
+@subsubsection ocaf_wp_2_2_2 Compound documents
+
+ As the identification of data is persistent, one document can reference data contained in another document,
+ the referencing and referenced documents being saved in two separate files.
+
+ Lets look at the coffee machine application again. The coffee pot can be placed in one document.
+ The coffee machine document then includes an *occurrence </b>*— a positioned copy — of the coffee pot.
+ This occurrence is defined by an XLink attribute (the external Link)
+ which references the coffee pot of the first document
+ (the XLink contains the relative path of the coffee pot document and the entry of the coffee pot data [0:1] ).
+
+@image html ocaf_wp_image006.png "The coffee machine compound document"
+@image latex ocaf_wp_image006.png "The coffee machine compound document"
+
+ In this context, the end-user of the coffee machine application can open the coffee pot document,
+ modify the geometry of, for example, the reservoir, and overwrite the document without worrying
+ about the impact of the modification in the coffee machine document.
+ To deal with this situation, OCAF provides a service which allows the application to check
+ whether a document is up-to-date. This service is based on a modification counter included in each document:
+ when an external link is created, a copy of the referenced document counter is associated to the XLink
+ in the referencing document. Providing that each modification of the referenced document increments its own counter,
+ we can detect that the referencing document has to be updated by comparing the two counters
+ (an update function importing the data referenced by an XLink into the referencing document is also provided).
+
+
+@subsubsection ocaf_wp_2_2_3 Transaction mechanism
+
+ The Data Framework also provides a transaction mechanism inspired from database management systems:
+ the data are modified within a transaction which is terminated either by a Commit
+ if the modifications are validated or by an Abort if the modifications are abandoned —
+ the data are then restored to the state it was in prior to the transaction.
+ This mechanism is extremely useful for:
+
+ * Securing editing operations (if an error occurs, the transaction is abandoned and the structure retains its integrity)
+ * Simplifying the implementation of the Cancel function (when the end-user begins a command,
+ the application may launch a transaction and operate directly in the data structure;
+ abandoning the action causes the transaction to Abort)
+ * Executing Undo (at commit time, the modifications are recorded in order to be able to restore the data to their previous state)
+
+ The transaction mechanism consists simply of managing a backup copy of attributes.
+ During a transaction, attributes are copied before their first modification.
+ If the transaction is validated, the copy is destroyed.
+ If the transaction is abandoned, the attribute is restored to its initial value
+ (when attributes are added or deleted, the operation is simply reversed).
+
+ Transactions are document-centered, that is, the application starts a transaction on a document.
+ So, modifying a referenced document and updating one of its referencing documents requires
+ two transactions, even if both operations are done in the same working session.
+
+@subsection 2.3 Persistent Data Storage
+
+ In OCAF, persistence, that is, the mechanism used to save a document in a file,
+ is based on an explicit formal description of the data saved.
+
+ When you open a document, the application reads the corresponding file
+ and first creates a memory representation of it.
+ This representation is then converted to the application data model —
+ the OCAF-based data structure the application operates on.
+ The file's memory representation consists of objects defined by classes known as persistent.
+ The persistent classes needed by an application to save its documents make the application's data schema.
+ This schema defines the way the data are organized in the file — the format of the data.
+ In other words, the file is simply an ASCII dump of the persistent data defined by the schema,
+ the persistent data being created from the application data model during the save process.
+
+ Only canonical information is saved. As a matter of fact,
+ the application data model usually contains additional data to optimize processing.
+ For example, the persistent Bézier curve is defined by its poles, whereas
+ its data model equivalent also contains coefficients used to compute a point at a given parameter.
+ The additional data is calculated when the document is opened.
+
+ The major advantages of this approach are the following:
+
+ * Providing that the data format is published, files created by OCAF-based applications
+ can be read without needing a runtime of the application (openness)
+ * Although the persistence approach makes the data format more stable,
+ OCAF provides a framework for managing compatibility of data between versions of the application —
+ modification of the data format is supported through the versioning of schema.
+
+ OCAF includes a ready-to-use schema suitable for most applications.
+ However, it can be extended if needed. For that, the only things you have to do are:
+
+ * To define the additional persistent attributes
+ * To implement the functions converting these persistent attribute to and from the application data model.
+
+Applications using compound documents extensively (saving data in many files linked together) should implement data management services. As a matter of fact, it's out the scope of OCAF to provide functions such as:
+* Version and configuration management of compound documents;
+* Querying a referenced document for its referencing documents.
+
+In order to ease the delegation of document management to a data management application, OCAF encapsulates the file management functions in a driver (the meta-data driver). You have to implement this driver for your application to communicate with the data management system of your choice.
+
+
A list of these objects defined in the current session can be printed in DRAW by command *Draw:> listitems*.
-Command *Draw:> givelist <selection_name>* prints a list of a subset of loaded entities defined by the selection argument:
+Command *Draw:> givelist <selection_name>* prints a list of a subset of loaded entities defined by the <i><selection></i> argument:
* *xst-model-all* all entities of the model;
* *xst-model-roots* all roots;
@subsubsection occt_step_6_4_2 Estimating the results of reading STEP
All the following commands are available only after data is converted into OCCT shapes (i.e. after command 214read).
-Command *Draw:> tpstat [*|?]\<symbol\> [\<selection\>]* is provided to get all statistics on the last transfer, including a list of transferred entities with mapping from STEP to OCCT types, as well as fail and warning messages. The parameter symbol defines what information will be printed:
+Command *Draw:> tpstat [*|?]\<symbol\> [\<selection\>]* is provided to get all statistics on the last transfer, including a list of transferred entities with mapping from STEP to OCCT types, as well as fail and warning messages. The parameter <i><symbol></i> defines what information will be printed:
* *g* - General statistics (a list of results and messages)
* *c* - Count of all warning and fail messages
Draw:> stepwrite <mode> \<shape_name\> [<file_name>]
~~~~~
-The available modes are following:
- * *a* - as is;
- * *m* - manifold_solid_brep or brep_with_voids
- * *f* - faceted_brep
- * *w* - geometric_curve_set
- * *s* - shell_based_surface_model
+The following modes are available :
+ * *a* - as is - the mode is selected automatically depending on the type & geometry of the shape;
+ * *m* - *manifold_solid_brep* or *brep_with_voids*
+ * *f* - *faceted_brep*
+ * *w* - *geometric_curve_set*
+ * *s* - *shell_based_surface_model*
After a successful translation, if file_name parameter is not specified, the procedure asks you whether to write a STEP model in the file or not:
~~~~~
* @subpage user_guides__foundation_classes "Foundation Classes"
* @subpage user_guides__modeling_data "Modeling Data"
- * BRep File Format
+ * @subpage occt_brep_format "BREP format description"
* @subpage user_guides__modeling_algos "Modeling Algorithms"
* @subpage user_guides__shape_healing "Shape Healing"
* @subpage user_guides__visualization "Visualization"
- * Voxel package
+ * @subpage occt_voxels_wp "Voxels"
* Data Exchange
* @subpage user_guides__iges "IGES translator"
* @subpage user_guides__step "STEP translator"
* @subpage user_guides__xde "Extended Data Exchange (XDE)"
* @subpage user_guides__ocaf "Open CASCADE Application Framework (OCAF)"
- * OCAF Whitepaper
- * OCAF Function Mechanism
- * OCAF Tree
+ * @subpage ocaf_wp "Application Framework White Paper"
+ * @subpage occt_ocaf_functionmechanism_wp "OCAF Function Mechanism"
+ * @subpage occt_ocaf_tree_wp "Distribution of Data through OCAF Tree"
* @subpage user_guides__tobj "TObj package"
* @subpage user_guides__test_harness "DRAW Test Harness"
\ No newline at end of file
-Visualization {#user_guides__visualization}
-===================
-
-@tableofcontents
-
-@section occt_1621831385_591811643 Introduction
+Visualization {#user_guides__visualization}
+========================
+@tableofcontents
+@section occt_visu_1 Introduction
-This manual explains how to use Open CASCADE Technology Visualization. It provides basic documentation on setting up and using Visualization. For advanced information on Visualization and its applications, see our offerings on our web site
-(Training and E-Learning) at <a href="http://www.opencascade.org/support/training/">http://www.opencascade.org/support/training/</a>
+This manual provides basic documentation on setting up and using Visualization. For advanced information on Visualization and its applications, see our offerings on our web site (Training and E-Learning) at http://www.opencascade.org/support/training/
-Visualization in Open CASCADE Technology is based on the separation of:
- * on the one hand - the data which stores the geometry and topology of the entities you want to display and select, and
- * on the other hand - its *presentation* (what you see when an object is displayed in a scene) and *selection* (possibility to choose the whole object or its sub-parts interactively in order to apply some application-defined operations to the selected entities).
+Visualization in Open CASCADE Technology is based on the separation of:
+ * on the one hand - the data which stores the geometry and topology of the entities you want to display and select, and
+ * on the other hand - its **presentation** (what you see when an object is displayed in a scene) and **selection** (possibility to choose the whole object or its sub-parts interactively to apply application-defined operations to the selected entities).
-@subsection occt_1621831385_5918116431 Open CASCADE Technology Visualization and the Organization of this guide
+@subsection occt_visu_1_1 Open CASCADE Technology Visualization and the Organization of this guide
-Presentations are managed through the Presentation component, and selection through the Selection component.
+Presentations are managed through the Presentation component, and selection through the Selection component.
-To make management of these functionalities in 3D more intuitive and consequently, more transparent, **Application Interactive Services** have been created. **AIS** use the notion of the *interactive object*, a displayable and selectable entity, which represents an element from the application data. As a result, in 3D, you, the user, have no need to be familiar with any functions underlying AIS unless you want to create your own interactive objects or selection filters.
+To make management of these functionalities in 3D more intuitive and consequently, more transparent, *Application Interactive Services* have been created. *AIS* uses the notion of the *interactive object*, a displayable and selectable entity, which represents an element from the application data. As a result, in 3D, you, the user, have no need to be familiar with any functions underlying AIS unless you want to create your own interactive objects or selection filters.
-If, however, you require types of interactive objects and filters other than those provided, you will need to know the mechanics of presentable and selectable objects, specifically how to implement their virtual functions. To do this requires familiarity with such fundamental concepts as the sensitive primitive and the presentable object.
+If, however, you require types of interactive objects and filters other than those provided, you will need to know the mechanics of presentable and selectable objects, specifically how to implement their virtual functions. To do this requires familiarity with such fundamental concepts as the sensitive primitive and the presentable object.
-The packages used to display 3D objects are the following:
+The packages used to display 3D objects are the following:
* AIS
* StdPrs
* Prs3d
* V3d
* Graphic3d
-If you are concerned with 2D visualization, you must familiarize yourself with the fundamental concepts of presentation as outlined in the section on this subject in chapter 1, Fundamental Concepts. In brief, the packages used to display 2D objects are the following:
- * AIS2D
- * Prs2d
- * PrsMgr
- * V2d
- * Graphic2d.
-
-Figure 1 below presents a schematic overview of the relations between the key concepts and packages in visualization. AIS stands for both AIS and AIS2D packages. Naturally, *Geometry & Topology* is just an example of application data that can be handled by AIS, and application-specific interactive objects can deal with any kind of data.
+If you are concerned with 2D visualization, you must familiarize yourself with the fundamental concepts of presentation as outlined in the section on this subject in chapter Fundamental Concepts. In brief, the packages used to display 3D objects are applicable for visualization of 2D objects too.
-@image html /user_guides/visualization/images/visualization_image003.png
-@image latex /user_guides/visualization/images/visualization_image003.png
-**Figure 1. Key concepts and packages in visualization**
+The figure below presents a schematic overview of the relations between the key concepts and packages in visualization. Naturally, "Geometry & Topology" is just an example of application data that can be handled by *AIS*, and application-specific interactive objects can deal with any kind of data.
-To answer different needs of CASCADE users, this user’s guide offers the following three paths in reading it.
-
- * If the 3D services proposed in AIS meet your requirements, you need only read chapter 3, *AIS: Application Interactive Services*.
-
- * If the services provided do not satisfy your requirements - if for example, you need a selection filter on another type of entity - you should read chapter 2 *Fundamental Concepts*, chapter 3 *AIS: Application Interactive Services*, and possibly chapters 4 and 5 *3D Presentations *and *3D Resources*. You may want to begin with the chapter presenting AIS.
+@image html visualization_image003.png "Key concepts and packages in visualization"
+@image latex visualization_image003.png "Key concepts and packages in visualization"
- * If your display will be in 2D, you should read chapter 1 *Fundamental Concepts*, chapter 6 *2D Presentations* and chapter 7 *2D Resources*.
+To answer different needs of CASCADE users, this user’s guide offers the following three paths in reading it.
+
+ * If the 3D services proposed in AIS meet your requirements, you need only read chapter 3 <a href="#occt_visu_3">AIS: Application Interactive Services</a>.
+ * If you need more detail, for example, a selection filter on another type of entity - you should read chapter 2 <a href="#occt_visu_2">Fundamental Concepts</a>, chapter 3 <a href="#occt_visu_3">AIS: Application Interactive Services</a>, and possibly chapters 4 and 5 <a href="#occt_visu_4">3D Presentations</a> and <a href="#occt_visu_5">3D Resources</a>. You may want to begin with the chapter presenting AIS.
-
-@section occt_1621831385_1633708282 Fundamental Concepts
+@section occt_visu_2 Fundamental Concepts
-@subsection occt_1621831385_16337082821 Presentation
+@subsection occt_visu_2_1 Presentation
-In Open CASCADE Technology, presentation services are separated from the data, which they represent, which is generated by applicative algorithms. This division allows you to modify a geometric or topological algorithm and its resulting objects without modifying the visualization services.
+In Open CASCADE Technology, presentation services are separated from the data, which they represent, which is generated by applicative algorithms. This division allows you to modify a geometric or topological algorithm and its resulting objects without modifying the visualization services.
-@subsubsection occt_1621831385_163370828211 Key difference in implementation of 2D and 3D visualization
-Current implementation of 3D visualization services is based on OpenGL.
-2D visualization packages use native window system API (Win32 GDI API on Windows, Xlib API on Unix and Linux).
-@subsubsection occt_1621831385_163370828212 Structure of the Presentation
+@subsubsection occt_visu_2_1_1 Structure of the Presentation
-Displaying an object on the screen involves three kinds of entity:
- * a presentable object, the *AIS_InteractiveObject *
+Displaying an object on the screen involves three kinds of entities:
+ * a presentable object, the *AIS_InteractiveObject*
* a viewer
* an interactive context, the *AIS_InteractiveContext*.
<h4>The presentable object </h4>
-The purpose of a presentable object is to provide the graphical representation of an object in the form of Graphic2d or Graphic3d structure. On the first display request, it creates this structure by calling the appropriate algorithm and retaining this framework for further display.
-Standard presentation algorithms are provided in the StdPrs and Prs3d packages. You can, however, write specific presentation algorithms of your own, provided that they create presentations made of structures from the Graphic2d or Graphic3d packages. You can also create several presentations of a single presentable object: one for each visualization mode supported by your application.
-Each object to be presented individually must be presentable or associated with a presentable object.
-
-<h4>The viewer </h4>
-The viewer allows you to interactively manipulate views of the object. When you zoom, translate or rotate a view, the viewer operates on the graphic structure created by the presentable object and not on the data model of the application. Creating Graphic2d and Graphic3d structures in your presentation algorithms allows you to use the 2D and 3D viewers provided in Open CASCADE Technology.
-
-<h4>The Interactive Context </h4>
-(see chapter 2, AIS: Application Interactive Services) The interactive context controls the entire presentation process from a common high-level API. When the application requests the display of an object, the interactive context requests the graphic structure from the presentable object and sends it to the viewer for displaying.
-
-<h4>Presentation packages </h4>
-Presentation involves at least the AIS, AIS2D, PrsMgr, StdPrs, V3d and V2d packages. Additional packages such as Prs3d, Prs2d, Graphic3d and Graphic2d may be used if you need to implement your own presentation algorithms.
-
-<h4>AIS and AIS2D</h4>
-See chapter 2, **AIS: Application Interactive Services **The *AIS* package provides all classes to implement interactive objects (presentable and selectable 2D or 3D entities).
-
-<h4>PrsMgr </h4>
-The *PrsMgr* package provides all the classes needed to implement the presentation process: the *Presentation* and *PresentableObject* abstract classes and the *PresentationManager2d* and *PresentationManager3d* concrete classes.
-
-<h4>StdPrs </h4>
-The *StdPrs* package provides ready-to-use standard presentation algorithms of points, curves and shapes of the geometry and topology toolkits.
-
-<h4>V2d and V3d </h4>
-The *V2d* and *V3d* packages provide the services supported by the 2D and 3D viewers.
+The purpose of a presentable object is to provide the graphical representation of an object in the form of *Graphic3d* structure. On the first display request, it creates this structure by calling the appropriate algorithm and retaining this framework for further display.
-<h4>Prs3d and Prs2d</h4>
-The *Prs3d* package provides some generic presentation algorithms such as wireframe, shading and hidden line removal associated with a Drawer class which controls the attributes of the presentation to be created in terms of color, line type, thickness, and so on.
+Standard presentation algorithms are provided in the *StdPrs* and *Prs3d* packages. You can, however, write specific presentation algorithms of your own, provided that they create presentations made of structures from the *Graphic3d* packages. You can also create several presentations of a single presentable object: one for each visualization mode supported by your application.
-<h4>Graphic2d and Graphic3d </h4>
-The *Graphic2d* and *Graphic3d* packages provide resources to create 2D and 3D graphic structures (please refer to chapters on 3D Resources and 2D Resources for more information).
+Each object to be presented individually must be presentable or associated with a presentable object.
+<h4>The viewer </h4>
+The viewer allows interactively manipulating views of the object. When you zoom, translate or rotate a view, the viewer operates on the graphic structure created by the presentable object and not on the data model of the application. Creating Graphic3d structures in your presentation algorithms allows you to use the 3D viewers provided in Open CASCADE Technology for 3D visualisation.
-@subsubsection occt_1621831385_163370828213 A Basic Example: How to display a 3D object
-<h4>Example </h4>
+<h4>The Interactive Context </h4>
+The interactive context controls the entire presentation process from a common high-level API. When the application requests the display of an object, the interactive context requests the graphic structure from the presentable object and sends it to the viewer for displaying.
-Void Standard_Real dx = ...; //Parameters Void Standard_Real dy = ...; //to build a wedge Void Standard_Real dz = ...; Void Standard_Real ltx = ...;
+@subsubsection occt_visu_2_1_2 Presentation packages
-Handle(V3d_Viewer)aViewer = ...; Handle(AIS_InteractiveContext)aContext; aContext = new AIS_InteractiveContext(aViewer);
-BRepPrimAPI_MakeWedge w(dx, dy, dz, ltx); TopoDS_Solid & = w.Solid(); Handle(AIS_Shape) anAis = new AIS_Shape(S); //creation of the presentable object aContext - Display(anAis); //Display the presentable object in the 3d viewer.
+Presentation involves at least the *AIS, PrsMgr, StdPrs* and *V3d* packages. Additional packages such as *Prs3d* and *Graphic3d* may be used if you need to implement your own presentation algorithms.
+* *AIS* package provides all classes to implement interactive objects (presentable and selectable entities).
+* *PrsMgr* package provides all the classes needed to implement the presentation process: the *Presentation* and *PresentableObject* abstract classes and *PresentationManager3d* concrete class.
+* *StdPrs* package provides ready-to-use standard presentation algorithms of points, curves and shapes of the geometry and topology toolkits.
+* *V3d* package provides the services supported by the 3D viewer.
+* *Prs3d* package provides some generic presentation algorithms such as wireframe, shading and hidden line removal associated with a Drawer class which controls the attributes of the presentation to be created in terms of color, line type, thickness, and so on.
+* *Graphic3d* package provides resources to create 3D graphic structures.
-The shape is created using the *BRepPrimAPI_MakeWedge* command. An AIS_Shape is then created from the shape. When calling the *Display *command, the interactive context calls the Compute method of the presentable object to calculate the presentation data and transfer it to the viewer. See Figure 2 below.
+@subsubsection occt_visu_2_1_3 A Basic Example: How to display a 3D object
-** **
+~~~~~
+Void Standard_Real dx = ...; //Parameters
+Void Standard_Real dy = ...; //to build a wedge
+Void Standard_Real dz = ...;
+Void Standard_Real ltx = ...;
+
+Handle(V3d_Viewer)aViewer = ...;
+Handle(AIS_InteractiveContext)aContext;
+aContext = new AIS_InteractiveContext(aViewer);
+
+BRepPrimAPI_MakeWedge w(dx, dy, dz, ltx);
+TopoDS_Solid & = w.Solid();
+Handle(AIS_Shape) anAis = new AIS_Shape(S);
+//creation of the presentable object
+aContext - Display(anAis);
+//Display the presentable object in the 3d viewer.
+~~~~~
+The shape is created using the *BRepPrimAPI_MakeWedge* command. An *AIS_Shape* is then created from the shape. When calling the *Display* command, the interactive context calls the Compute method of the presentable object to calculate the presentation data and transfer it to the viewer. See figure below.
+@image html visualization_image004.png "Processes involved in displaying a presentable shape"
+@image latex visualization_image004.png "Processes involved in displaying a presentable shape"
+@subsection occt_visu_2_2 Selection
+Objects that may be selected graphically, are displayed as sets of sensitive primitives, which provide sensitive zones in 2D graphic space. These zones are sorted according to their position on the screen when starting the selection process.
+
+@image html visualization_image006.png "A model"
+@image latex visualization_image006.png "A model"
+The position of the mouse is also associated with a sensitive zone. When moving within the window where objects are displayed, the areas touched by the zone of the mouse are analyzed. The owners of these areas are then highlighted or signaled by other means such as the name of the object highlighted in a list. That way, you are informed of the identity of the detected element.
+@image html visualization_image007.png "Modeling faces with sensitive primitives"
+@image latex visualization_image007.png "Modeling faces with sensitive primitives"
-@image html /user_guides/visualization/images/visualization_image004.png
-@image latex /user_guides/visualization/images/visualization_image004.png
+@image html visualization_image008.png "In a dynamic selection, each sensitive polygon is represented by its bounding rectangle"
+@image latex visualization_image008.png "In a dynamic selection, each sensitive polygon is represented by its bounding rectangle"
-@image html /user_guides/visualization/images/visualization_image005.png
-@image latex /user_guides/visualization/images/visualization_image005.png
-**Figure 2. Processes involved in displaying a presentable shape**
+@image html visualization_image009.png "Reference to the sensitive primitive, then to the owner"
+@image latex visualization_image009.png "Reference to the sensitive primitive, then to the owner"
-@subsection occt_1621831385_16337082822 Selection
-This chapter deals with the process used for selecting entities, which are displayed in the 2D space of the selection view.
-@subsubsection occt_1621831385_163370828221 The Selection Principle
+@subsubsection occt_visu_2_2_1 The Sensitive Primitive
-Objects that may be selected graphically, are displayed as sets of sensitive primitives, which provide sensitive zones in 2D graphic space. These zones are sorted according to their position on the screen when starting the selection process.
-The position of the mouse is also associated with a sensitive zone. When moving within the window where objects are displayed, the areas touched by the zone of the mouse are analyzed. The owners of these areas are then highlighted or signaled by other means such as the name of the object highlighted in a list. That way, you are informed of the identity of the element detected.
+The sensitive primitive along with the entity owner allows defining what can be made selectable, and providing the link between the applicative object and the sensitive zones defined by the 2D bounding boxes. To be dynamically selectable, an object has to be represented either as a sensitive primitive or a set of them, e.g. 2D boxes that will be included in a sorting algorithm.
-@image html /user_guides/visualization/images/visualization_image006.png
-@image latex /user_guides/visualization/images/visualization_image006.png
-**Figure 3. A model **
+The use of 2D boxes allows a pre-selection of the detected entities. After pre-selection, the algorithm checks which sensitive primitives are actually detected. When detected, the primitives provide their owners’ identity.
-@image html /user_guides/visualization/images/visualization_image007.png
-@image latex /user_guides/visualization/images/visualization_image007.png
-**Figure 4. Modeling faces with sensitive primitives **
+@image html visualization_image010.png "Example of sensitive primitives"
+@image latex visualization_image010.png "Example of sensitive primitives"
-@image html /user_guides/visualization/images/visualization_image008.png
-@image latex /user_guides/visualization/images/visualization_image008.png
-**Figure 5. In a dynamic selection, each sensitive polygon is represented by its bounding rectangle**
+In the example, the sensitive line segment proposes a bounding box to the selector. During selection, positions 1 and 2 of the mouse detect the box but after sorting, only position 2 retains the line segment as selected by the algorithm.
-@image html /user_guides/visualization/images/visualization_image009.png
-@image latex /user_guides/visualization/images/visualization_image009.png
-Figure 6. Reference to the sensitive primitive, then to the owner
+When the Box associated with the position of the mouse intersects the Box of a sensitive primitive, the owner of the sensitive primitive is called and its presentation is highlighted.
-@subsubsection occt_1621831385_163370828222 The Sensitive Primitive
+The notion of sensitive primitive is important for the developer when defining his own classes of sensitive primitives for the chosen selection modes. The classes must contain *Areas* and *Matches* functions.
-The sensitive primitive - along with the entity owner - allow you to define what can be made selectable, and in so doing, provide the link between the applicative object and the sensitive zones defined by the 2D bounding boxes. For an object to be dynamically selectable, it has to be represented either as a sensitive primitive or a set of them. These give 2D boxes that will be included in a sorting algorithm.
-The use of 2D boxes allows a pre-selection of the detected entities. After pre-selection, the algorithm checks which sensitive primitives are actually detected. When detected, the primitives provide their owners’ identity.
-<h4>Example </h4>
+The former provides the list of 2D sensitive boxes representing the sensitive primitive at pre-selection and the latter determines if the detection of the primitive by the 2D boxes is valid.
-The sensitive line segment below proposes a bounding box to the selector. During selection, positions 1 and 2 of the mouse detect the box but after sorting, only position 2 retains the line segment as selected by the algorithm.
-@image html /user_guides/visualization/images/visualization_image010.png
-@image latex /user_guides/visualization/images/visualization_image010.png
-**Figure 7. Example of sensitive primitives **
+@subsubsection occt_visu_2_2_2 Dynamic Selection
-When the 2D box associated with the position of the mouse intersects the 2D box of a sensitive primitive, the owner of the sensitive primitive is called and its presentation is highlighted.
-The notion of sensitive primitive is important for the developer when defining his own classes of sensitive primitives for the chosen selection modes. The classes must contain *Areas* and *Matches* functions. The former provides the list of 2D sensitive boxes representing the sensitive primitive at pre-selection and the latter determines if the detection of the primitive by the 2D boxes is valid.
-@subsubsection occt_1621831385_163370828223 The Principles of Dynamic Selection
+Dynamic selection causes objects in a view to be automatically highlighted
+as the mouse cursor moves over them. This allows the user to be certain that the picked object
+ is the correct one. Dynamic Selection is based on the following two concepts:
-Dynamic selection causes objects in a view to be automatically highlighted as the mouse cursor moves over them. This allows the user to be certain that the picked object is the correct one. Dynamic Selection is based on the following two concepts:
- * a Selectable Object (see *AIS_InteractiveObject*)
- * an Interactive Context
+ * a Selectable Object (*AIS_InteractiveObject*)
+ * an Interactive Context
+
+<h4>Selectable Object</h4>
-<h4>Selectable Object </h4>
-A selectable object presents a given number of selection modes which can be redefined, and which will be activated or deactivated in the selection manager’s selectors.
+A selectable object presents a given number of selection modes which can be redefined, and which will be activated or deactivated in the selection manager’s selectors.
-*The term, selection mode of a selectable object, can refer to the selection mode of the object itself or to that of one of its parts.*
+Note that the selection mode of a selectable object, can refer to the selection mode of the object itself or to the selection mode of its part.
-For each selection mode, a *SelectMgr_Selection* object class is included in the selectable object. (Each selection mode establishes a priority of selection for each class of selectable object defined.)
+For each selection mode, a *SelectMgr_Selection* object class is included in the selectable object. (Each selection mode establishes a priority of selection for each class of selectable object defined.)
-The notion of SELECTION is comparable to the notion of DISPLAY. Just as a display contains a set of graphic primitives that allow display of the entity in a specific display mode, a SELECTION contains a set of sensitive primitives, which allow detection of the entities they are associated with.
+The notion of **Selection** is comparable to the notion of **Display**. Just as a display contains a set of graphic primitives that allow display of the entity in a specific display mode, a **Selection** contains a set of sensitive primitives, which allow detection of the entities they are associated with.
<h4>Interactive Context</h4>
-See chapter 2, AIS: Application Interactive Services, Section 2.4
-The interactive context is used to manage both selectable objects and selection processes.
+The interactive context is used to manage both selectable objects and selection processes.
-Selection modes may be activated or de-activated for given selectable objects. Information is then provided about the status of activated/de-activated selection modes for a given object in a given selector.
-<h4>Example </h4>
+Selection modes may be activated or de-activated for given selectable objects. Information is then provided about the status of activated/de-activated selection modes for a given object in a given selector.
-Let’s consider the 3D selectable shape object, which corresponds to a topological shape.
+See also <a href="#occt_visu_3">AIS: Application Interactive Services</a>.
-For this class, seven selection modes can be defined:
+Let us consider, for example, a 3D selectable shape object, which corresponds to a topological shape.
-mode 0 - selection of the shape itself
-mode 1 - selection of vertices
-mode 2 - selection of edges
-mode 3 - selection of wires
-mode 4 - selection of faces
-mode 5 - selection of shells
-mode 6 - selection of solids
-mode 7 - selection of compounds
+For this class, seven selection modes can be defined:
+* mode 0 - selection of the shape itself
+* mode 1 - selection of vertices
+* mode 2 - selection of edges
+* mode 3 - selection of wires
+* mode 4 - selection of faces
+* mode 5 - selection of shells
+* mode 6 - selection of solids
+* mode 7 - selection of compsolids
+* mode 8 - selection of compounds
-Selection 2 includes the sensitive primitives that model all the edges of the shape. Each of these primitives contains a reference to the edge it represents.
+Selection 2 includes the sensitive primitives that model all the edges of the shape. Each of these primitives contains a reference to the edge it represents.
-The selections may be calculated before any activation and are graph independent as long as they are not activated in a given selector. Activation of selection mode 3 in a selector associated with a view V leads to the projection of the 3D sensitive primitives contained in the selection; then the 2D areas which represent the 2D bounding boxes of these primitives are provided to the sorting process of the selector containing all the detectable areas.
+The selections may be calculated before any activation and are graph independent as long as they are not activated in a given selector. Activation of selection mode 3 in a selector associated with a view V leads to the projection of the 3D sensitive primitives contained in the selection; then the 2D areas which represent the 2D bounding boxes of these primitives are provided to the sorting process of the selector containing all the detectable areas.
To deactivate selection mode 3 remove all those 2D areas.
-*Selection Packages *
-The selection packages are the following: *SelectBasics*, *SelectMgr*, *Select2D*, *Select3D*, *StdSelect*.
+@subsubsection occt_visu_2_2_3 Selection Packages
-*SelectBasics *
-The *SelectBasics* package contains the basic classes of the selection:
- * the main definition of a sensitive primitive: *SensitiveEntity *
- * the definition of a sensitive primitive owner: *EntityOwner *
- * the algorithm used for sorting sensitive boxes: *SortAlgo *
+The following selection packages exist : *SelectBasics*, *SelectMgr*, *Select3D*, *StdSelect*.
-*EntityOwner* is used to establish a link from *SensitiveEntity* to application-level objects. For example, *SelectMgr_EntityOwner* (see below) class holds a pointer to corresponding *SelectableObject*.
+*SelectBasics* package contains the basic classes of the selection:
+ * the main definition of a sensitive primitive: *SensitiveEntity*
+ * the definition of a sensitive primitive owner: *EntityOwner*
+ * the algorithm used for sorting sensitive boxes: *SortAlgo*
-*SelectMgr *
-The *SelectMgr* package is used to manage the whole dynamic selection process. It contains the *SelectableObject**, Entity Owner containing a link to its SelectableObject,* *Selection*, *SelectionManager*, and *ViewSelector* classes.
-There are also implementations of *ViewerSelector* interface for 2D and 3D selection: *ViewerSelector2d* and *ViewerSelector3d*, respectively.
+*EntityOwner* is used to establish a link from *SensitiveEntity* to application-level objects. For example, *SelectMgr_EntityOwner* (see below) class holds a pointer to corresponding *SelectableObject*.
-*Select2D *
-The *Select2D* package contains the basic classes of 2D sensitive primitives such as Points, Segments, and Circles, which inherit from *SensitiveEntity* from *SelectBasics* and used to represent 2D selectable objects from a dynamic selection viewpoint.
+*SelectMgr* package is used to manage the whole dynamic selection process. It contains the *SelectableObject*, Entity Owner containing a link to its SelectableObject,* *Selection*, *SelectionManager*, and *ViewSelector* classes.
+There are also implementations of *ViewerSelector* interface for 3D selection in *StdSelect* package: *ViewerSelector3d*.
-*Select3D *
-The *Select3D* package contains all 3D standard sensitive primitives such as point, curve and face. All these classes inherit from 3D *SensitiveEntry* from *SelectBasics* with an additional method, which allows recovery of the bounding boxes in the 2D graphic selection space, if required. This package also includes the 3D-2D projector.
+*Select3D* package contains all 3D standard sensitive primitives such as point, curve and face. All these classes inherit from 3D *SensitiveEntry* from *SelectBasics* with an additional method, which allows recovery of the bounding boxes in the 2D graphic selection space, if required. This package also includes the 3D-2D projector.
-*StdSelect *
-The *StdSelect* package provides standard uses of the classes described above and main tools used to prevent the developer from redefining the selection objects. In particular, *StdSelect* includes standard means for selection of topological objects (shapes).
+*StdSelect* package provides standard uses of the classes described above and main tools used to prevent the developer from redefining the selection objects. In particular, *StdSelect* includes standard means for selection of topological objects (shapes).
-@subsubsection occt_1621831385_163370828224 Methodology
+@subsubsection occt_visu_2_2_4 How to use dynamic selection
-Several operations must be performed prior to using dynamic selection:
-**1. **Implement specific sensitive primitives if those defined in Select2D and Select3D are not sufficient. These primitives must inherit from *SensitiveEntity* from *SelectBasics* or from a suitable Select3D sensitive entity class when a projection from 3D to 2D is necessary.
-**2. **Define all the owner types, which will be used, and the classes of selectable objects, i.e. the number of possible selection modes for these objects and the calculation of the decomposition of the object into sensitive primitives of all the primitives describing this mode. It is possible to define only one default selection mode for a selectable object if this object is to be selectable in a unique way.
-**3. **Install the process, which provides the user with the identity of the owner of the detected entities in the selection loop.
+Several operations must be performed prior to using dynamic selection:
+1. Implement specific sensitive primitives if those defined in Select3D are not sufficient. These primitives must inherit from *SensitiveEntity* from *SelectBasics* or from a suitable Select3D sensitive entity class when a projection from 3D to 2D is necessary.
+2. Define all the owner types, which will be used, and the classes of selectable objects, i.e. the number of possible selection modes for these objects and the calculation of the decomposition of the object into sensitive primitives of all the primitives describing this mode. It is possible to define only one default selection mode for a selectable object if this object is to be selectable in a unique way.
+3. Install the process, which provides the user with the identity of the owner of the detected entities in the selection loop.
-When all these steps have been carried out, follow the procedure below:
-**1. **Create an interactive context.
-**2. **Create the selectable objects and calculate their various possible selections.
-**3. **Load these selectable objects in the interactive context. The objects may be common to all the selectors, i.e. they will be seen by all the selectors in the selection manager, or local to one selector or more.
-**4. **Activate or deactivate the objects’ selection modes in the selector(s). When activating a selection mode in a selector for a given object, the manager sends the order to make the sensitive primitives in this selector selectable. If the primitives are to projected from 3D to 2D, the selector calls the specific method used to carry out this projection.
+When all these steps have been carried out, follow the procedure below:
+1. Create an interactive context.
+2. Create the selectable objects and calculate their various possible selections.
+3. Load these selectable objects in the interactive context. The objects may be common to all the selectors, i.e. they will be seen by all the selectors in the selection manager, or local to one selector or more.
+4. Activate or deactivate the objects’ selection modes in the selector(s). When activating a selection mode in a selector for a given object, the manager sends the order to make the sensitive primitives in this selector selectable. If the primitives are to projected from 3D to 2D, the selector calls the specific method used to carry out this projection.
-At this stage, the selection of selectable entities in the selectors is available.
-The selection loop informs constantly the selectors with the position of the mouse and questions them about the detected entities.
+At this stage, the selection of selectable entities in the selectors is available.
+The selection loop informs constantly the selectors with the position of the mouse and questions them about the detected entities.
+Let us suppose that you create an application that displays houses in a viewer of the V3d package and you want to select houses or parts of these houses (windows, doors, etc.) in the graphic window.
+You define a selectable object called *House* and propose four possible selection modes for this object:
+1. selection of the house itself;
+2. selection of the rooms
+3. selection of the walls
+4. selection of the doors.
-@subsubsection occt_1621831385_163370828225 Example of Use
+You have to write the method, which calculates the four selections above, i.e. the sensitive primitives which are activated when the mode is.
+You must define the class *Owner* specific to your application. This class will contain the reference to the house element it represents: wall, door or room. It inherits from *EntityOwner* from *SelectMgr*.
+For example, let us consider a house with the following representation:
-Let’s suppose you are creating an application that displays houses in a viewer of the V3d package and you want to select houses or parts of these houses (windows, doors, etc.) in the graphic window.
-You define a selectable object called *House* and propose four possible selection modes for this object:
-**1 -** selection of the house itself
-**2 -** selection of the rooms
-**3 -** selection of the walls
-**4 - **selection of the doors.
+@image html visualization_image011.png "Selection of rooms in a house"
+@image latex visualization_image011.png "Selection of rooms in a house"
-You have to write the method, which calculates the four selections above, i.e. the sensitive primitives which are activated when the mode is.
-You must define the class *Owner* specific to your application. This class will contain the reference to the house element it represents: wall, door or room. It inherits from *EntityOwner* from *SelectMgr*.
-For example, let’s consider a house with the following representation:
-@image html /user_guides/visualization/images/visualization_image011.png
-@image latex /user_guides/visualization/images/visualization_image011.png
-**Figure 8. Selection of the rooms of a house**
+To build the selection, which corresponds to the mode "selection of the rooms"
+(selection 2 in the list of selection modes), use the following procedure:
-To build the selection, which corresponds to the mode *selection of the rooms* (selection 2 in the list of selection modes) use the following procedure:
-<h4>Example </h4>
+~~~~~
Void House::ComputeSelection
-(Const Handle(SelectMgr_Selection)& Sel,
- const Standard_Integer mode {
- switch(mode){ case 0: //Selection of the rooms { for(Standard_Integer i = 1; i = myNbRooms; i++) { //for every room, create an instance of the owner
- //along with the given room and its name. Handle(RoomOwner) aRoomOwner = new RoomOwner (Room(i), NameRoom(i)); //Room() returns a room and NameRoom() returns its name.
-Handle(Select3d_SensitiveBox) aSensitiveBox;
-aSensitiveBox = new Select3d_SensitiveBox
-(aRoomOwner, Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
- Sel - Add(aSensitiveBox); } break; Case 1: ... //Selection of the doors } //Switch
-) // ComputeSelection
-
-
-@image html /user_guides/visualization/images/visualization_image012.png
-@image latex /user_guides/visualization/images/visualization_image012.png
-**Figure 9. Activated sensitive boxes corresponding to selection mode 0 (selection of the rooms)**
-
-@image html /user_guides/visualization/images/visualization_image013.png
-@image latex /user_guides/visualization/images/visualization_image013.png
-
-@image html /user_guides/visualization/images/visualization_image014.png
-@image latex /user_guides/visualization/images/visualization_image014.png
-**Figure 11. Activated sensitive polygons corresponding to selection mode 1.**
-
-**(selection of the doors)**
-@image html /user_guides/visualization/images/visualization_image015.png
-@image latex /user_guides/visualization/images/visualization_image015.png
-
-**Figure 12. Sensitive rectangles in the selector during dynamic selection in view 2**
-@section occt_1621831385_810308609 AIS: Application Interactive Services
-Application Interactive Services (**AIS**) offers a set of general services beyond those offered by basic Selection and Presentation packages such as **PrsMgr**, **SelectMgr** and **StdSelect**. These allow you to manage presentations and dynamic selection in a viewer simply and transparently. To use these services optimally, you should know various rules and conventions. Section I provides an overview of the important classes which you need to manipulate AIS well. Sections 2 and 3 explain in detail how to use them and how to implement them, as well as the rules and conventions to respect. The annexes offer various standard Interactive Objects in AIS, an example of an implementation of AIS and a reminder of how to manage presentation and selection.
-
-@subsection occt_1621831385_8103086091 Overview
+ (Const Handle(SelectMgr_Selection)& Sel,
+ const Standard_Integer mode {
+ switch(mode){ case 0: //Selection of the rooms
+ { for(Standard_Integer i = 1; i = myNbRooms; i++) { //for every room, create an instance of the owner, the given room and its name.
+ Handle(RoomOwner) aRoomOwner = new RoomOwner (Room(i), NameRoom(i)); //Room() returns a room and NameRoom() returns its name.
+ Handle(Select3d_SensitiveBox) aSensitiveBox;
+ aSensitiveBox = new Select3d_SensitiveBox
+ (aRoomOwner, Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
+ Sel - Add(aSensitiveBox); } break; Case 1: ... //Selection of the doors } //Switch
+) // ComputeSelection
+~~~~~
-@subsubsection occt_1621831385_81030860911 Interactive Context/Local Context
-<h4>AIS_InteractiveContext </h4>
-The central entity, which pilots visualizations and selections, is the Interactive Context. It is linked to a main viewer (and if need be, a trash bin viewer.) It has two operating modes: the Neutral Point and the local visualization and selection context. The neutral point, which is the default mode, allows you to easily visualize and select interactive objects, which have been loaded into the context. Opening Local Contexts allows you to prepare and use a temporary selection environment without disturbing the neutral point. A set of functions allows you to choose the interactive objects, which you want to act on, the selection modes, which you want to activate, and the temporary visualizations, which you will execute. When the operation is finished, you close the current local context and return to the state in which you were before opening it (neutral point or previous local context).
+@image html visualization_image012.png "Activated sensitive boxes corresponding to selection mode 0 (selection of rooms)"
+@image latex visualization_image012.png "Activated sensitive boxes corresponding to selection mode 0 (selection of rooms)"
-@subsubsection occt_1621831385_81030860912 The Interactive Object
+@image html visualization_image013.png "Activated sensitive rectangles in the selector during dynamic selection in view 1"
+@image latex visualization_image013.png "Activated sensitive rectangles in the selector during dynamic selection in view 1"
-<h4>AIS_InteractiveObject</h4>
-Entities, which are visualized and selected, are Interactive Objects. You can use classes of standard interactive objects for which all necessary functions have already been programmed, or you can implement your own classes of interactive objects, by respecting a certain number of rules and conventions described below.
+@image html visualization_image014.png "Activated sensitive polygons corresponding to selection mode 1 (selection of doors)"
+@image latex visualization_image014.png "Activated sensitive polygons corresponding to selection mode 1 (selection of doors)"
-@subsubsection occt_1621831385_81030860913 Graphic Attributes Manager or *Drawer*
+@image html visualization_image015.png "Sensitive rectangles in the selector during dynamic selection in view 2"
+@image latex visualization_image015.png "Sensitive rectangles in the selector during dynamic selection in view 2"
-@image html /user_guides/visualization/images/visualization_image016.png
-@image latex /user_guides/visualization/images/visualization_image016.png
-An Interactive Object can have a certain number of graphic attributes specific to it (such as visualization mode, color and material) By the same token, the Interactive Context has a drawer which is valid by default for the objects it controls. When an interactive object is visualized, the required graphic attributes are first taken from its own Drawer if it has the ones required, or from the context drawer if it does not have them.
+@section occt_visu_3 Application Interactive Services
+@subsection occt_visu_3_1 Introduction
-@subsubsection occt_1621831385_81030860914 Selection Filters
+Application Interactive Services allow managing presentations and dynamic selection in a viewer in a simple and transparent manner.
-@image html /user_guides/visualization/images/visualization_image017.png
-@image latex /user_guides/visualization/images/visualization_image017.png
+The central entity for management of visualization and selections is the **Interactive Context**. It is connected to the main viewer (and if need be, the trash bin viewer). It has two operating modes: the Neutral Point and the local visualization and selection context.
-An important need in selection is the filtering of entities, which you want to select. Consequently there are FILTER entities, which allow you to refine the dynamic detection context, which you want to put into effect. Some of these filters can be used at the Neutral Point, others only in an open local context. A user will be able to program his own filters and load them into the interactive context.
+The neutral point, which is the default mode, allows easily visualizing and selecting interactive objects loaded into the context.
-@subsection occt_1621831385_8103086092 Rules and Conventions Governing Interactive Objects
- An interactive object is a *virtual* entity, which can be presented and selected. It can also have its own visualization aspects such as color, material, and mode of visualization. In order to create and manipulate the interactive objects with ease, you must know the rules and conventions, which have been established. Several *virtual* functions must be implemented for these objects to have the behavior expected of them. A certain number of standard interactive objects, which respect the rules and conventions described below, have been implemented in AIS. The current list of them can be found in ANNEX I. The services that concern manipulation of presentations, selection and graphic attributes will be treated separately.
+**Local Contexts** can be opened to prepare and use a temporary selection environment without disturbing
+the neutral point. It is possible to choose the interactive objects, which you want to act on, the selection modes, which you want to activate, and the temporary visualizations, which you will execute.
+When the operation is finished, you close the current local context and return to the state
+in which you were before opening it (neutral point or previous local context).
-@subsubsection occt_1621831385_81030860921 Presentations:
+**Interactive Objects** are the entities, which are visualized and selected. You can use classes of standard interactive objects for which all necessary functions have already been programmed, or you can implement your own classes of interactive objects, by respecting a certain number of rules and conventions described below.
-@image html /user_guides/visualization/images/visualization_image018.png
-@image latex /user_guides/visualization/images/visualization_image018.png
-*Conventions *
- * Either in 2D or in 3D, an interactive object can have as many presentations as its creator wants to give it.
- * 3D presentations are managed by PresentationManager3D; 2D presentations by PresentationManager2D. As this is transparent in AIS, the user does not have to worry about it.
- * A presentation is identified by an index and by the reference to the Presentation Manager which it depends on.
- * By convention, the default mode of representation for the Interactive Object has index 0.
+@image html visualization_image016.png
+@image latex visualization_image016.png
-*Virtual functions *
+An Interactive Object is a "virtual" entity, which can be presented and selected. An Interactive Object can have a certain number of specific graphic attributes, such as visualization mode, color and material.
-Calculation of different presentations of an interactive object is done in the *Compute *functions inheriting from *PrsMgr_ PresentableObject::Compute *functions. They are automatically called by *PresentationManager* at a visualization or an update request.
+When an Interactive Object is visualized, the required graphic attributes are taken from its own **Drawer** if it has the required custom attributes or otherwise from the context drawer.
-If you are creating your own type of interactive object, you must implement the Compute function in one of the following ways:
+@image html visualization_image017.png
+@image latex visualization_image017.png
- * **For 2D: **
-<h4>Example </h4>
+It can be necessary to filter the entities to be selected. Consequently there are **Filter** entities, which allow refining the dynamic detection context. Some of these filters can be used at the Neutral Point, others only in an open local context. It is possible to program custom filters and load them into the interactive context.
-void PackageName_ClassName::Compute
-(const Handle(PrsMgr_PresentationManager2d)&
-aPresentationManager,
- const Handle(Graphic2d_GraphicObject)& aGraphicObject,
- const Standard_Integer aMode = 0);
- * **For 3D: **
-<h4>Example </h4>
+@subsection occt_visu_3_2 Interactive objects
-void PackageName_ClassName::Compute
-(const Handle(PrsMgr_PresentationManager3d)&
-aPresentationManager,
- const Handle(Prs3d_Presentation)& aPresentation,
- const Standard_Integer aMode = 0);
+@subsubsection occt_visu_3_2_1 Presentations
- * **For hidden line removal (HLR) mode in 3D (*): **
-<h4>Example </h4>
+An interactive object can have as many presentations as its creator wants to give it.
-void PackageName_ClassName::Compute
-(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation);
+3D presentations are managed by PresentationManager3D. As this is transparent in AIS, the user does not have to worry about it.
+A presentation is identified by an index and by the reference to the Presentation Manager which it depends on.
-*WARNING (*) *
-As its call is automatically ordered by a view, this function requires explanation; the view has two states: degenerate mode (normal mode) and non-degenerate mode (Hidden line mode). When the latter is active, the view looks for all presentations displayed in normal mode, which have been signaled as accepting hidden line mode. An internal mechanism allows us to call the interactive object’s own *Compute*, that is, projector, function. How do you declare that such and such a presentation will accept an *equivalent* in hidden line mode? By convention, it is the Interactive Object, which accepts or rejects the representation of hidden-line mode. You can make this declaration in one of two ways, either initially by using one of the values of the enumeration PrsMgr_TypeOfPresentation:
- * PrsMgr_TOP_AllView,
- * PrsMgr_TOP_ProjectorDependant
+By convention, the default mode of representation for the Interactive Object has index 0.
-or later on, by using the function:
- * * PrsMgr_PresentableObject::SetTypeOfPresentation
+@image html visualization_image018.png
+@image latex visualization_image018.png
-@subsubsection occt_1621831385_81030860922 Important Specifics of AIS:
+Calculation of different presentations of an interactive object is done by the *Compute* functions inheriting from *PrsMgr_ PresentableObject::Compute* functions. They are automatically called by *PresentationManager* at a visualization or an update request.
-There are four types of interactive object in AIS:
- * the *construction element* or Datum,
- * the Relation (dimensions and constraints)
- * the Object
- * the None type (when the object is of an unknown type).
+If you are creating your own type of interactive object, you must implement the Compute function in one of the following ways:
-Inside these categories, additional characterization is available by means of a signature (an index.) By default, the interactive object has a NONE type and a signature of 0 (equivalent to NONE.) If you want to give a particular type and signature to your interactive object, you must redefine two virtual functions:
+#### For 3D:
- * AIS_InteractiveObject::Type
- * AIS_InteractiveObject::Signature.
-
+~~~~~
+void PackageName_ClassName::Compute
+ (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
+ const Handle(Prs3d_Presentation)& aPresentation,
+ const Standard_Integer aMode = 0);
+~~~~~
-<h4>WARNING </h4>
-Some signatures have already been used by *standard* objects delivered in AIS. (see the list of standard objects, Annex I.)
+#### For hidden line removal (HLR) mode in 3D:
+~~~~~
+void PackageName_ClassName::Compute
+ (const Handle(Prs3d_Projector)& aProjector,
+ const Handle(Prs3d_Presentation)& aPresentation);
+~~~~~
-As will be seen below, the interactive context can have a default mode of representation for the set of interactive objects. This mode may not be accepted by a given class of objects. Consequently, a virtual function allowing you to get information about this class must be implemented:
- * AIS_InteractiveObject::AcceptDisplayMode.
+@subsubsection occt_visu_3_2_2 Hidden Line Removal
-<h5>Services You Should Know </h5>
-Display Mode: An object can have its own display mode, which is different from that proposed by the interactive context. The functions to use are:
- * AIS_InteractiveContext::SetDisplayMode
- * AIS_InteractiveContext::UnsetDisplayMode.
+The view can have two states: the normal mode or the computed mode (Hidden Line Removal mode). When the latter is active, the view looks for all presentations displayed in the normal mode, which have been signalled as accepting HLR mode. An internal mechanism allows calling the interactive object’s own *Compute*, that is projector function.
-Hilight Mode: At dynamic detection, the presentation echoed by the Interactive Context, is by default the presentation already on the screen. You can always specify the display mode used for highlighting purposes (so called highlight mode), which is valid no matter what the active representation of the object. It makes no difference whether this choice is temporary or definitive. To do this, you use the following functions:
- * AIS_InteractiveObject::SetHilightMode
- * AIS_InteractiveObject::UnSetHilightMode
+By convention, the Interactive Object accepts or rejects the representation of HLR mode. It is possible to make this declaration in one of two ways:
-Note that the same presentation (and consequently the same highlight mode) is used for highlighting *detected* objects and for highlighting *selected* objects, the latter being drawn with a special *selection color *(refer to the section related to *Interactive Context* services).
+* Initially by using one of the values of the enumeration *PrsMgr_TypeOfPresentation*:
+ * *PrsMgr_TOP_AllView*,
+ * *PrsMgr_TOP_ProjectorDependant*
-An example: For a shape - whether it is visualized in wireframe presentation or with shading - you want to systematically highlight the wireframe presentation. Consequently, you set the highlight mode to *0 *in the constructor of the interactive object. You mustn’t forget to effect the implementation of this representation mode in the *Compute* functions.
+* Later by using the function *PrsMgr_PresentableObject::SetTypeOfPresentation*
-Infinite Status: If you don’t want an object to be affected by a FitAll view, you must declare it infinite; you can cancel its *infinite* status in the same way.
- * AIS_InteractiveObject::SetInfiniteState
- * AIS_InteractiveObject::IsInfinite
-<h4>Example </h4>
+*AIS_Shape* class is an example of an interactive object that supports HLR representation. It supports two types of the HLR algorithm:
+* the polygonal algorithm based on the shape’s triangulation;
+* the exact algorithm that works with the shape’s real geometry.
-Let’s take the case of a class called IShape, representing an interactive object
-myPk_IShape::myPK_IShape
-(const TopoDS_Shape& SH, PrsMgr_TypeOfPresentation aType):
+The type of the HLR algorithm is stored in *AIS_Drawer* of the shape. It is a value of the *Prs3d_TypeOfHLR* enumeration and can be set to:
+ * *Prs3d_TOH_PolyAlgo* for a polygonal algorithm;
+ * *Prs3d_TOH_Algo* for an exact algorithm;
+ * *Prs3d_TOH_NotSet* if the type of algorithm is not set for the given interactive object instance.
-AIS_InteractiveObject(aType), myShape(SH), myDrwr(new AIS_Drawer()) {
-SetHilightMode(0);
-}
-void myPk_IShape::Compute
-(const Handle(PrsMgr_PresentationManager3d) & PM, const Handle(Prs3d_Presentation)& P, const Standard_Integer TheMode)
-{
-switch (TheMode){
+The type of the HLR algorithm used for *AIS_Shape* can be changed by calling the *AIS_Shape::SetTypeOfHLR()* method.
-case 0:
-StdPrs_WFDeflectionShape::Add (P,myShape,myDrwr);
-//algo for calculation of wireframe presentation break;
+The current HLR algorithm type can be obtained using *AIS_Shape::TypeOfHLR()* method is to be used.
-case 1:
-StdPrs_ShadedShape::Add (P,myShape,myDrwr); //algo for calculation of shading presentation. break;
-}
-}
-void myPk_IsShape::Compute
-(const Handle(Prs3d_Projector)& Prj,
-const Handle(Prs3d_Presentation) P)
-{
-StdPrs_HLRPolyShape::Add(P,myShape,myDrwr);
-//Cas-cade hidden line mode calculation algorithm
-}
+These methods get the value from the drawer of *AIS_Shape*. If the HLR algorithm type in the *AIS_Drawer* is set to *Prs3d_TOH_NotSet*, the *AIS_Drawer* gets the value from the default drawer of *AIS_InteractiveContext*.
+So it is possible to change the default HLR algorithm used by all newly displayed interactive objects. The value of the HLR algorithm type stored in the context drawer can be *Prs3d_TOH_Algo* or *Prs3d_TOH_PolyAlgo*. The polygonal algorithm is the default one.
+@subsubsection occt_visu_3_2_3 Presentation modes
-@subsection occt_1621831385_8103086093 Selections
-@subsubsection occt_1621831385_81030860931 Conventions
+There are four types of interactive objects in AIS:
+ * the "construction element" or Datum,
+ * the Relation (dimensions and constraints)
+ * the Object
+ * the None type (when the object is of an unknown type).
-An interactive object can have an indefinite number of modes of selection, each representing a *decomposition* into sensitive primitives; each primitive has an Owner (*SelectMgr_EntityOwner*) which allows us to identify the exact entity which has been detected (see ANNEX II).
+Inside these categories, additional characterization is available by means of a signature (an index.) By default, the interactive object has a NONE type and a signature of 0 (equivalent to NONE.) If you want to give a particular type and signature to your interactive object, you must redefine two virtual functions:
+ * *AIS_InteractiveObject::Type*
+ * *AIS_InteractiveObject::Signature*.
-The set of sensitive primitives, which correspond to a given mode, is stocked in a SELECTION (*SelectMgr_Selection*).
+**Note** that some signatures are already used by "standard" objects provided in AIS (see the <a href="#occt_visu_3_5">list of Standard Interactive Object Classes</a>).
-Each Selection mode is identified by an index. By Convention, the default selection mode that allows us to grasp the Interactive object in its entirety is mode *0*.
+The interactive context can have a default mode of representation for the set of interactive objects. This mode may not be accepted by a given class of objects.
-@subsubsection occt_1621831385_81030860932 Virtual functions
+Consequently, to get information about this class it is necessary to use virtual function *AIS_InteractiveObject::AcceptDisplayMode*.
-The calculation of Selection primitives (or sensitive primitives) is done by the intermediary of a virtual function, *ComputeSelection*. This should be implemented for each type of interactive object on which you want to make different type selections using the following function:
+#### Display Mode
- * AIS_ConnectedInteractive::ComputeSelection
+The functions *AIS_InteractiveContext::SetDisplayMode* and *AIS_InteractiveContext::UnsetDisplayMode* allow setting a custom display mode for an objects, which can be different from that proposed by the interactive context.
-A detailed explanation of the mechanism and the manner of implementing this function has been given in ANNEX II.
+#### Highlight Mode
-Moreover, just as the most frequently manipulated entity is TopoDS_Shape, the most used Interactive Object is AIS_Shape. You will see below that activation functions for standard selection modes are proposed in the Interactive context (selection by vertex, by edges etc.). To create new classes of interactive object with the same behavior as AIS_Shape - such as vertices and edges - you must redefine the virtual function:
+At dynamic detection, the presentation echoed by the Interactive Context, is by default the presentation already on the screen.
- * AIS_ConnectedInteractive::AcceptShapeDecomposition.
+The functions *AIS_InteractiveObject::SetHilightMode* and *AIS_InteractiveObject::UnSetHilightMode* allow specifying the display mode used for highlighting (so called highlight mode), which is valid independently from the active representation of the object. It makes no difference whether this choice is temporary or definitive.
+Note that the same presentation (and consequently the same highlight mode) is used for highlighting *detected* objects and for highlighting *selected* objects, the latter being drawn with a special *selection color* (refer to the section related to *Interactive Context* services).
+For example, you want to systematically highlight the wireframe presentation of a shape - non regarding if it is visualized in wireframe presentation or with shading. Thus, you set the highlight mode to *0* in the constructor of the interactive object. Do not forget to implement this representation mode in the *Compute* functions.
-@subsubsection occt_1621831385_81030860933 Other Services
-You can change the default selection mode index of an Interactive Object. For instance, you can:
- * check to see if there is a selection mode
- * check the current selection mode
- * set a selection mode
- * unset a selection mode.
- The following functions are concerned:
+#### Infinite Status
+If you don’t want an object to be affected by a *FitAll* view, you must declare it infinite; you can cancel its "infinite" status using *AIS_InteractiveObject::SetInfiniteState* and *AIS_InteractiveObject::IsInfinite* functions.
- * AIS_InteractiveObject::HasSelectionMode
- * AIS_InteractiveObject::SelectionMode
- * AIS_InteractiveContext::SetSelectionMode
- * AIS_InteractiveContext::UnsetSelectionMode
+Let us take for example the class called *IShape* representing an interactive object :
-These functions are only of interest if you decide that the *0* mode adopted by convention will not do. In the same way, you can temporarily change the priority of certain interactive objects for selection of 0 mode. You could do this to make it easier to detect them graphically. You can:
- * check to see if there is a selection priority setting for the owner
- * check the current priority
- * set a priority
- * unset the priority.
+~~~~~
+myPk_IShape::myPK_IShape
+ (const TopoDS_Shape& SH, PrsMgr_TypeOfPresentation aType):
+ AIS_InteractiveObject(aType), myShape(SH), myDrwr(new AIS_Drawer()) {SetHilightMode(0);}
+void myPk_IShape::Compute
+ (const Handle(PrsMgr_PresentationManager3d) & PM,
+ const Handle(Prs3d_Presentation)& P,
+ const Standard_Integer TheMode)
+{
+ switch (TheMode){
+ case 0:
+ StdPrs_WFDeflectionShape::Add (P,myShape,myDrwr); //algo for calculation of wireframe presentation break;
+ case 1:
+ StdPrs_ShadedShape::Add (P,myShape,myDrwr); //algo for calculation of shading presentation.
+ break;
+ }
+}
+void myPk_IsShape::Compute
+ (const Handle(Prs3d_Projector)& Prj,
+ const Handle(Prs3d_Presentation) P)
+{
+ StdPrs_HLRPolyShape::Add(P,myShape,myDrwr);
+ //Hidden line mode calculation algorithm
+}
+~~~~~
-To do this, you use the following functions:
- * AIS_InteractiveObject::HasSelectionPriority
- * AIS_InteractiveObject::SelectionPriority
- * AIS_InteractiveObject::SetSelectionPriority
- * AIS_InteractiveObject::UnsetSelectionPriority
+@subsubsection occt_visu_3_2_4 Selection
+An interactive object can have an indefinite number of selection modes, each representing a "decomposition" into sensitive primitives; each primitive has an Owner (*SelectMgr_EntityOwner*) which allows identifying the exact entity which has been detected (see <a href="#occt_visu_3_6"> Dynamic Selection</a> chapter).
+The set of sensitive primitives, which correspond to a given mode, is stocked in a SELECTION (*SelectMgr_Selection*).
-@subsection occt_1621831385_8103086094 Graphic attributes of an interactive object
+Each Selection mode is identified by an index. By Convention, the default selection mode that allows us to grasp the Interactive object in its entirety is mode *0*.
-Keep in mind the following points concerning graphic attributes:
- * Each interactive object can have its own visualization attributes.
- * The set of graphic attributes of an interactive object is stocked in an *AIS_Drawer*, which is only a *Prs3d_Drawer* with the possibility of a link to another drawer
- * By default, the interactive object takes the graphic attributes of the context in which it is visualized (visualization mode, deflection values for the calculation of presentations, number of isoparameters, color, type of line, material, etc.)
- * In the *AIS_InteractiveObject* abstract class, several standard attributes have been privileged. These include: color, thickness of line, material, and transparency. Consequently, a certain number of virtual functions, which allow us to act on these attributes, have been proposed. Each new class of interactive object can redefine these functions in order to bring about the changes it should produce in the behavior of the class.
+The calculation of Selection primitives (or sensitive primitives) is done by the intermediary of a virtual function, *ComputeSelection*. This should be implemented for each type of interactive object on which you want to make different type selections using the function *AIS_ConnectedInteractive::ComputeSelection*.
+A detailed explanation of the mechanism and the manner of implementing this function has been given in <a href="#occt_visu_3_6"> Dynamic Selection</a> chapter.
-@image html /user_guides/visualization/images/visualization_image019.png
-@image latex /user_guides/visualization/images/visualization_image019.png
-**Figure 13. Redefinition of virtual functions for changes in AIS_Point **
+Moreover, just as the most frequently manipulated entity is *TopoDS_Shape*, the most used Interactive Object is *AIS_Shape*. You will see below activation functions for standard selection modes are proposed in the Interactive context (selection by vertex, by edges etc). To create new classes of interactive object with the same behavior as *AIS_Shape* - such as vertices and edges - you must redefine the virtual function *AIS_ConnectedInteractive::AcceptShapeDecomposition*.
-@image html /user_guides/visualization/images/visualization_image020.png
-@image latex /user_guides/visualization/images/visualization_image020.png
-**Figure 14. **Redefinition** of virtual functions for changes in AIS_Shape.**
+You can change the default selection mode index of an Interactive Object using the following functions:
+ * *AIS_InteractiveObject::HasSelectionMode* checks if there is a selection mode;
+ * *AIS_InteractiveObject::SelectionMode* check the current selection mode;
+ * *AIS_InteractiveContext::SetSelectionMode* sets a selection mode;
+ * *AIS_InteractiveContext::UnsetSelectionMode* unsets a selection mode.
+
+These functions can be useful if you decide that the *0* mode used by default will not do. In the same way, you can temporarily change the priority of certain interactive objects for selection of 0 mode to facilitate detecting them graphically using the following functions:
+ * *AIS_InteractiveObject::HasSelectionPriority* checks if there is a selection priority setting for the owner;
+ * *AIS_InteractiveObject::SelectionPriority* checks the current priority;
+ * *AIS_InteractiveObject::SetSelectionPriority* sets a priority;
+ * *AIS_InteractiveObject::UnsetSelectionPriority* unsets the priority.
+
+
+@subsubsection occt_visu_3_2_5 Graphic attributes
-The virtual functions concerned here allow you to provide settings for:
- * color
- * width
- * material
- * transparency
+Keep in mind the following points concerning graphic attributes:
+ * Each interactive object can have its own visualization attributes.
+ * The set of graphic attributes of an interactive object is stocked in an *AIS_Drawer*, which is only a *Prs3d_Drawer* with the possibility of a link to another drawer
+ * By default, the interactive object takes the graphic attributes of the context in which it is visualized (visualization mode, deflection values for the calculation of presentations, number of isoparameters, color, type of line, material, etc.)
+ * In the *AIS_InteractiveObject* abstract class, standard attributes including color, line thickness, material, and transparency have been privileged. Consequently, there is a certain number of virtual functions, which allow acting on these attributes. Each new class of interactive object can redefine these functions and change the behavior of the class.
-The functions concerned are the following:
- * AIS_InteractiveObject::UnsetColor
- * AIS_InteractiveObject::SetWidth
- * AIS_InteractiveObject::UnsetWidth
- * AIS_InteractiveObject::SetMaterial (const Graphic3d_NameOfPhysicalMaterial & aName)
- * AIS_InteractiveObject::SetMaterial (const Graphic3d_MaterialAspect & aMat)
- * AIS_InteractiveObject::UnsetMaterial
- * AIS_InteractiveObject::SetTransparency
- * AIS_InteractiveObject::UnsetTransparency
+@image html visualization_image019.png "Figure 13. Redefinition of virtual functions for changes in AIS_Point"
+@image latex visualization_image019.png "Figure 13. Redefinition of virtual functions for changes in AIS_Point"
-For other types of attribute, it is appropriate to change the Drawer of the object directly using:
+@image html visualization_image020.png "Figure 14. Redefinition of virtual functions for changes in AIS_Shape."
+@image latex visualization_image020.png "Figure 14. Redefinition of virtual functions for changes in AIS_Shape."
- * AIS_InteractiveObject::SetAttributes
- * AIS_InteractiveObject::UnsetAttributes
+The following virtual functions provide settings for color, width, material and transparency:
+ * *AIS_InteractiveObject::UnsetColor*
+ * *AIS_InteractiveObject::SetWidth*
+ * *AIS_InteractiveObject::UnsetWidth*
+ * *AIS_InteractiveObject::SetMaterial (const Graphic3d_NameOfPhysicalMaterial & aName)*
+ * *AIS_InteractiveObject::SetMaterial (const Graphic3d_MaterialAspect & aMat)*
+ * *AIS_InteractiveObject::UnsetMaterial*
+ * *AIS_InteractiveObject::SetTransparency*
+ * *AIS_InteractiveObject::UnsetTransparency*
+For other types of attribute, it is appropriate to change the Drawer of the object directly using:
+ * *AIS_InteractiveObject::SetAttributes*
+ * *AIS_InteractiveObject::UnsetAttributes*
-@subsubsection occt_1621831385_81030860941 Manipulation of Attributes
+It is important to know which functions may imply the recalculation of presentations of the object.
-Some of these functions may imply the recalculation of presentations of the object. It is important to know which ones. If an interactive object’s presentation mode is to be updated, a flag from *PrsMgr_PresentableObject* indicates this. The mode should be updated using the functions *Display* and *Redisplay* in *AIS_InteractiveContext*.
+If the presentation mode of an interactive object is to be updated, a flag from *PrsMgr_PresentableObject* indicates this.
-@subsection occt_1621831385_8103086095 Complementary Services - Precautions
+The mode can be updated using the functions *Display* and *Redisplay* in *AIS_InteractiveContext*.
-@subsubsection occt_1621831385_81030860951 Changing an interactive object’s location
+@subsubsection occt_visu_3_2_6 Complementary Services
-When using complementary services for interactive objects, pay special attention to the following cases:
-Functions allowing us to temporarily *move* the representation and selection of Interactive Objects in a view without recalculation.
- * AIS_InteractiveContext::SetLocation
- * AIS_InteractiveContext::ResetLocation
- * AIS_InteractiveContext::HasLocation
- * AIS_InteractiveContext::Location
+When you use complementary services for interactive objects, pay special attention to the cases mentioned below.
-How you link applicative entities to interactive objects.
+#### Change the location of an interactive object
+The following functions allow temporarily "moving" the representation and selection of Interactive Objects in a view without recalculation.
+ * *AIS_InteractiveContext::SetLocation*
+ * *AIS_InteractiveContext::ResetLocation*
+ * *AIS_InteractiveContext::HasLocation*
+ * *AIS_InteractiveContext::Location*
+
+#### Connect an interactive object to an applicative entity
-@subsubsection occt_1621831385_810308609552 Connecting an interactive object to an applicative entity
+Each Interactive Object has functions that allow attributing it an *Owner* in form of a *Transient*.
+ * *AIS_InteractiveObject::SetOwner*
+ * *AIS_InteractiveObject::HasOwner*
+ * *AIS_InteractiveObject::Owner*
-Each Interactive Object has functions that allow us to attribute it an Owner in the form of a Transient.
- * AIS_InteractiveObject::SetOwner
- * AIS_InteractiveObject::HasOwner
- * AIS_InteractiveObject::Owner
+An interactive object can therefore be associated or not with an applicative entity, without affecting its behavior.
-An interactive object can therefore be associated with an applicative entity or not, without this affecting its behavior.
+#### Resolving coincident topology
-@subsubsection occt_1621831385_810308609553 Resolving coincident topology
+Due to the fact that the accuracy of three-dimensional graphics coordinates has a finite resolution the elements of topological objects can coincide producing the effect of "popping" some elements one over another.
-Due to the fact that the accuracy of three-dimensional graphics coordinates has a finite resolution the elements of topological objects can coincide producing the effect of *popping* some elements one over another.
+To the problem when the elements of two or more Interactive Objects are coincident you can apply the polygon offset. It is a sort of graphics computational offset, or depth buffer offset, that allows you to arrange elements (by modifying their depth value) without changing their coordinates. The graphical elements that accept this kind of offsets are solid polygons or displayed as boundary lines and points. The polygons could be displayed as lines or points by setting the appropriate interior style.
-To avoid such kind of a problem when the elements of two or more InteractiveObjects are coincident you can apply the polygon offset. It is a sort of graphics computational offset, or depth buffer offset, that allows you to arrange elements (by modifying their depth value) without changing their coordinates. The graphical elements that accept this kind of offsets are solid polygons or displayed as boundary lines and points. The polygons could be displayed as lines or points by setting the appropriate interior style.
+The method *AIS_InteractiveObject::SetPolygonOffsets (const Standard_Integer aMode, const Standard_Real aFactor, const Standard_Real aUnits)* allows setting up the polygon offsets.
-The following method allows you to set up the polygon offsets:
- * void AIS_InteractiveObject::SetPolygonOffsets
-(const Standard_Integer aMode,
- const Standard_Real aFactor,
- const Standard_Real aUnits)
-The parameter aMode can contain various combinations of Aspect_PolygonOffsetMode enumeration elements. The enumeration has the following elements:
- * Aspect_POM_None
- * Aspect_POM_Off
+The parameter *aMode* can contain various combinations of *Aspect_PolygonOffsetMode* enumeration elements:
+ * *Aspect_POM_None*
+ * *Aspect_POM_Off*
* Aspect_POM_Fill
* Aspect_POM_Line
* Aspect_POM_Point
* Aspect_POM_All
-The combination of these elements defines the polygon display modes that will use the given offsets. You can switch off the polygon offsets by passing the Aspect_POM_Off. Passing Aspect_POM_None allows you to change the aFactor and aUnits values without changing the mode. If aMode is different from Aspect_POM_Off, the aFactor and aUnits arguments are used by the graphics renderer to calculate the depth offset value:
- offset = aFactor * m + aUnits * r,
- where m – maximum depth slope for the polygons currently being displayed, r – minimum depth resolution (implementation-specific)
-
-Negative offset values move polygons closer to the viewer while positive values shift polygons away.
-
-**WARNING**
-This method has a side effect – it creates its own shading aspect if not yet created, so it is better to set up the object shading aspect first.
-
-You can use the following functions to obtain the current settings for polygon offsets:
- * void AIS_InteractiveObject::PolygonOffsets
-(Standard_Integer &aMode,
- Standard_Real &aFactor,
- Standard_Real &aUnits)
- * Standard_Boolean
-AIS_InteractiveObject::HasPolygonOffsets()
-
-The same operation could be performed for the interactive object known by the AIS_InteractiveContext with the following methods:
- * void AIS_InteractiveContext::SetPolygonOffsets
-(const Handle(AIS_InteractiveObject) &anObj,
- const Standard_Integer aMode,
- const Standard_Real aFactor,
- const Standard_Real aUnits)
- * void AIS_InteractiveContext::PolygonOffsets
-(const Handle(AIS_InteractiveObject) &anObj,
- Standard_Integer &aMode,
- Standard_Real &aFactor,
- Standard_Real &aUnits)
- * Standard_Boolean AIS_InteractiveContext::HasPolygonOffsets
-(const Handle(AIS_InteractiveObject) &anObj)
-
-@subsection occt_1621831385_8103086096 The Interactive Context
-
-@subsubsection occt_1621831385_810308609661 Preliminary Rules
-
-The Interactive Context allows us to manage in a transparent way, the graphic and *selectable* behavior of interactive objects in one or more viewers. Most functions which allow us to modify the attributes of interactive objects, and which were presented in the preceding chapter, will be looked at again here.
-
-There is one essential rule to follow: the modification of an interactive object, which is already known by the Context, must be done using Context functions. You can only directly call the functions available for an interactive object if it has not been loaded into an Interactive Context.
-
-<h4>Example </h4>
-
-Handle (AIS_Shape) TheAISShape = new AIS_Shape (ashape); myIntContext-Display(TheAISShape);
-myIntContext-SetDisplayMode(TheAISShape ,1);
-myIntContext-SetColor(TheAISShape,Quantity_NOC_RED);
-
-//but you can write
-
-Handle (AIS_Shape) TheAISShape = new AIS_Shape (ashape); TheAISShape-SetColor(Quantity_NOC_RED);
-TheAISShape-SetDisplayMode(1);
-myIntContext-Display(TheAISShape);
-
-
-@subsubsection occt_1621831385_810308609662 Groups of functions
-
-You must distinguish two states in the Interactive Context:
-* No Open Local Context; which will be referred to as Neutral Point.
-* One or several open local contexts, each representing a temporary state of selection and presentation.
-
-Some functions can only be used in open Local Context; others in closed local context; others do not have the same behavior in one state as in the other.
-
-The Interactive Context is composed of a great many functions, which can be conveniently grouped according to theme:
- * management proper to the context
- * management in the local context
- * presentations and selection in open/closed context
- * selection strictly speaking
-
-
-@subsubsection occt_1621831385_810308609663 Management proper to the Interactive Context
-
-The Interactive Context is made up of a Principal Viewer and, optionally, a trash bin or *Collector* Viewer. It also has a group of adjustable settings allowing you to personalize the behavior of presentations and selections:
- * Default Drawer, containing all the color and line attributes which can be used by interactive objects, which do not have their own attributes.
- * Default Visualization Mode for interactive objects
-Default: mode 0
- * Highlight color of entities detected by mouse movement
-Default: Quantity_NOC_CYAN1
- * Preselection color
-Default: Quantity_NOC_GREEN
- * Selection color (when you click on a detected object)
-Default: Quantity_NOC_GRAY80
- * Sub-Intensity color
-Default: Quantity_NOC_GRAY40
-
-All of these settings can be modified by functions proper to the Context.
-
-When you change a graphic attribute pertaining to the Context (visualization mode, for example), all interactive objects, which do not have the corresponding appropriate attribute, are updated.
-<h4>Example </h4>
-
-//obj1, obj2: 2 interactive objects.
-
-TheCtx-Display(obj1,Standard_False); // False = no update
-of viewer.
-TheCtx-Display(obj2,Standard_True); // True = Update of
-Viewer
-TheCtx-SetDisplayMode(obj1,3,Standard_False);
-TheCtx-SetDisplayMode(2);
-// obj2 is visualised in mode 2 (if it accepts this mode)
-// obj1 stays visualised in its mode 3.
-
-To the main Viewer, are associated a *PresentationManager3D* and a *Selector3D *which manage the presentation and selection of present interactive objects. The same is true of the optional Collector. As we shall see, this management is completely transparent for the user.
-
-
-@subsection occt_1621831385_8103086097 Management of Local Context
-
-@subsubsection occt_1621831385_810308609771 Rules and Conventions
-
- * Opening a local context allows you to prepare an environment for temporary presentations and selections, which will disappear once the local context is closed.
- * It is possible to open several local contexts, but only the last one will be active.
- * When you close a local context, the one before, which is still on the stack, reactivates. If none is left, you return to Neutral Point.
- * Each local context has an index created when the context opens. You should close the local context, which you have opened.
-
-@subsubsection occt_1621831385_810308609772 Important functionality
-
-The interactive object, which is used the most by applications, is *AIS_Shape*. Consequently, standard functions are available which allow you to easily prepare selection operations on the constituent elements of shapes (selection of vertices, edges, faces etc) in an open local context. The selection modes specific to *Shape* type objects are called **Standard Activation Mode**. These modes are only taken into account in open local context and only act on interactive objects which have redefined the virtual function *AcceptShapeDecomposition() *so that it returns *TRUE*.
- * Objects, which are temporarily in a local context, are not recognized by other local contexts a priori. Only objects visualized in Neutral Point are recognized by all local contexts.
- * The state of a temporary interactive object in a local context can only be modified while another local context is open (except for one special case - see III.4.2)
-
-<h4>WARNING </h4>
-The specific modes of selection only concern the interactive objects, which are present in the Main Viewer. In the Collector, you can only locate interactive objects, which answer positively to the positioned filters when a local context is open. Under no circumstances are they decomposed in standard mode etc.
+The combination of these elements defines the polygon display modes that will use the given offsets. You can switch off the polygon offsets by passing *Aspect_POM_Off*. Passing *Aspect_POM_None* allows changing the *aFactor* and *aUnits* values without changing the mode. If *aMode* is different from *Aspect_POM_Off*, the *aFactor* and *aUnits* arguments are used by the graphics renderer to calculate the depth offset value:
+~~~~~
+ offset = aFactor * m + aUnits * r
+~~~~~
+where *m* is the maximum depth slope for the currently displayed polygons, r is the minimum depth resolution (implementation-specific).
-@subsubsection occt_1621831385_810308609773 Use
-Opening and closing a local context are easy to put into operation:
+Negative offset values move polygons closer to the viewer while positive values shift polygons away.
- * AIS_InteractiveContext::OpenLocalContext
+**Warning**
+
+This method has a side effect – it creates its own shading aspect if not yet created, so it is better to set up the object shading aspect first.
-The options available allow you to control what you want to do:
- * *UseDisplayedObjects*: allows you to load or not load the interactive objects visualized at Neutral Point in the local context, which you open. If* FALSE*, the local context is empty after being opened. If *TRUE*, the objects at Neutral Point are modified by their default selection mode.
- * *AllowShapeDecomposition*: AIS_Shape allows or prevents decomposition in standard shape location mode of objects at Neutral Point, which are type-*privileged* (see selection chapter). This Flag is only taken into account when *UseDisplayedObjects* is *TRUE*.
- * *AcceptEraseOfObjects*: authorises other local contexts to erase the interactive objects present in this context. This option is rarely used. The last option has no current use.
+You can use the following functions to obtain the current settings for polygon offsets:
+~~~~~
+ void AIS_InteractiveObject::PolygonOffsets
+ (Standard_Integer &aMode,
+ Standard_Real &aFactor,
+ Standard_Real &aUnits)
+ Standard_Boolean AIS_InteractiveObject::HasPolygonOffsets()
+~~~~~
-This function returns the index of the created local context. It should be kept and used when the context is closed.
+The same operation could be performed for the interactive object known by the *AIS_InteractiveContext* with the following methods:
+~~~~~
+void AIS_InteractiveContext::SetPolygonOffsets
+ (const Handle(AIS_InteractiveObject) &anObj,
+ const Standard_Integer aMode,
+ const Standard_Real aFactor,
+ const Standard_Real aUnits)
+void AIS_InteractiveContext::PolygonOffsets
+ (const Handle(AIS_InteractiveObject) &anObj,
+ Standard_Integer &aMode,
+ Standard_Real &aFactor,
+ Standard_Real &aUnits)
+Standard_Boolean AIS_InteractiveContext::HasPolygonOffsets
+ (const Handle(AIS_InteractiveObject) &anObj)
+~~~~~
-To load objects visualized at Neutral Point into a local context or remove them from one:
- * AIS_InteractiveContext::UseDisplayedObjects
- * AIS_InteractiveContext::NotUseDisplayedObjects
+@subsection occt_visu_3_3 Interactive Context
-Closing Local Contexts is done by:
- * AIS_InteractiveContext::CloseLocalContext
- * AIS_InteractiveContext::CloseAllContexts
+@subsubsection occt_visu_3_3_1 Rules
-*WARNING *
+The Interactive Context allows us to manage in a transparent way, the graphic and "selectable" behavior of interactive objects in one or more viewers. Most functions which allow us to modify the attributes of interactive objects, and which were presented in the preceding chapter, will be looked at again here.
-When the index isn’t specified in the first function, the current Context is closed. This option can be dangerous, as other Interactive Functions can open local contexts without necessarily warning the user. For greater security, you have to close the context with the index given on opening.
+There is one essential rule to follow: the modification of an interactive object, which is already known by the Context, must be done using Context functions. You can only directly call the functions available for an interactive object if it has not been loaded into an Interactive Context.
-To get the index of the current context, use the following function:
+~~~~~
+Handle (AIS_Shape) TheAISShape = new AIS_Shape (ashape);
+ myIntContext-Display(TheAISShape);
+ myIntContext-SetDisplayMode(TheAISShape ,1);
+ myIntContext-SetColor(TheAISShape,Quantity_NOC_RED);
+~~~~~
- * AIS_InteractiveContext::IndexOfCurrentLocal
+You can also write
-The second function allows you to close all open local contexts at one go. In this case, you find yourself directly at Neutral Point.
+~~~~~
+Handle (AIS_Shape) TheAISShape = new AIS_Shape (ashape);
+ TheAISShape-SetColor(Quantity_NOC_RED);
+ TheAISShape-SetDisplayMode(1);
+ myIntContext-Display(TheAISShape);
+~~~~~
-When you close a local context, all temporary interactive objects are erased (deleted), all selection modes concerning the context are cancelled, and all content filters are emptied.
+@subsubsection occt_visu_3_3_2 Groups of functions
+You must distinguish two states in the Interactive Context:
+* No Open Local Context; which will be referred to as Neutral Point.
+* One or several open local contexts, each representing a temporary state of selection and presentation.
+Some functions can only be used in open Local Context; others in closed local context; others do not have the same behavior in one state as in the other.
-@subsubsection occt_1621831385_810308609774 Management of Presentations and Selections
+The Interactive Context is composed of many functions, which can be conveniently grouped according to the theme:
+ * management proper to the context;
+ * management in the local context;
+ * presentations and selection in open/closed context;
+ * selection strictly speaking.
-You must distinguish between the Neutral Point and the Open Local Context states. Although the majority of visualization functions can be used in both situations, their behavior is different:
-@subsubsection occt_1621831385_810308609775 Presentation in Neutral Point
+@subsubsection occt_visu_3_3_3 Management of the Interactive Context
-Neutral Point should be used to visualize the interactive objects, which represent and select an applicative entity. Visualization and Erasing orders are straightforward:
+The Interactive Context is made up of a Principal Viewer and, optionally, a trash bin or "Collector" Viewer. It also has a group of adjustable settings allowing you to personalize the behavior of presentations and selections:
+ * Default Drawer, containing all the color and line attributes which can be used by interactive objects, which do not have their own attributes.
+ * Default Visualization Mode for interactive objects. By default: *mode 0* ;
+ * Highlight color of entities detected by mouse movement. By default: *Quantity_NOC_CYAN1*;
+ * Pre-selection color. By default: *Quantity_NOC_GREEN*;
+ * Selection color (when you click on a detected object). By default: *Quantity_NOC_GRAY80*;
+ * Sub-Intensity color. By default: *Quantity_NOC_GRAY40*.
- * AIS_InteractiveContext::Display
-(const Handle(AIS_InteractiveObject)& anIobj,
- const Standard_Boolean updateviewer=Standard_True);
+All of these settings can be modified by functions proper to the Context.
- * AIS_InteractiveContext::Display
-(const Handle(AIS_InteractiveObject)& anIobj,
- const Standard_Integer amode,
- const Standard_Integer aSelectionMode,
- const Standard_Boolean
-updateviewer = Standard_True,
- const Standard_Boolean
-allowdecomposition = Standard_True);
+When you change a graphic attribute pertaining to the Context (visualization mode, for example), all interactive objects, which do not have the corresponding appropriate attribute, are updated.
- * AIS_InteractiveContext::Erase
- * AIS_InteractiveContext::EraseMode
- * AIS_InteractiveContext::ClearPrs
- * AIS_InteractiveContext::Redisplay
- * AIS_InteractiveContext::Remove
- * AIS_InteractiveContext::EraseAll
- * AIS_InteractiveContext::Hilight
- * AIS_InteractiveContext::HilightWithColor
+Let us examine the case of two interactive objects: *obj1* and *obj2*:
-@subsubsection occt_1621831385_810308609776 Important Remarks:
+~~~~~
+TheCtx-Display(obj1,Standard_False); // False = no viewer update
+TheCtx-Display(obj2,Standard_True); // True = viewer update
+TheCtx-SetDisplayMode(obj1,3,Standard_False);
+TheCtx-SetDisplayMode(2);
+// obj2 is visualised in mode 2 (if it accepts this mode)
+// obj1 stays visualised in its mode 3.
+~~~~~
-Bear in mind the following points:
- * It is recommended to display and erase interactive objects when no local context is opened, and open a local context for local selection only.
- * The first **Display** function among the two ones available in *InteractiveContext* visualizes the object in its default mode (set with help of SetDisplayMode() method of InteractiveObject prior to Display() call), or in the default context mode, if applicable. If it has neither, the function displays it in 0 presentation mode. The object’s default selection mode is automatically activated (0 mode by convention).
- * Activating the displayed object by default can be turned off with help of **SetAutoActivateSelection**() method. This might be efficient if you are not interested in selection immediately after displaying an object.
- * The second **Display** function should only be used in Neutral Point to visualize a supplementary mode for the object, which you can erase by EraseMode (...). You activate the selection mode. This is passed as an argument. By convention, if you do not want to activate a selection mode, you must set the *SelectionMode *argument to the value of -1. This function is especially interesting in open local context, as we will see below.
- * In Neutral Point, it is unadvisable to activate other selection modes than the default selection one. It is preferable to open a local context in order to activate particular selection modes.
- * When you call **Erase **(Interactive object) function, the *PutIncollector* argument, which is FALSE by default, allows you to visualize the object directly in the Collector and makes it selectable (by activation of 0 mode). You can nonetheless block its passage through the Collector by changing the value of this option. In this case, the object is present in the Interactive Context, but is not seen anywhere.
- * **Erase**() with *putInCollector* = Standard_True** might be slow as it re-computes the objects presentation in the Collector. Set putInCollector to Standard_False if you simply want to hide the object’s presentation temporarily.
- * Modifications of visualization attributes and graphic behavior is effected through a set of functions similar to those which are available for the interactive object (color, thickness of line, material, transparency, locations etc.) The context then manages immediate and deferred updates.
- * Call **Remove**() method of *InteractiveContext* as soon as the interactive object is no longer needed and you want to destroy it.. Otherwise, references to *InteractiveObject* are kept by *InteractiveContext*, and the *Object* is not destroyed that results in memory leaks. In general, if some interactive object’s presentation can be computed quickly, it is recommended to **Remove**() it instead of **Erase**()-ing.
+*PresentationManager3D* and a *Selector3D* which manage the presentation and selection of present interactive objects, are associated to the main Viewer. The same is true of the optional Collector.
-@subsubsection occt_1621831385_810308609777 Presentation in Local Context
+@subsection occt_visu_3_4 Local Context
+@subsubsection occt_visu_3_4_1 Rules and Conventions
-In open local context, the Display functions presented above apply as well.
+ * Opening a local context allows preparing an environment for temporary presentations and selections, which will disappear once the local context is closed.
+ * It is possible to open several local contexts, but only the last one will be active.
+ * When you close a local context, the previous one, which is still on the stack, is activated again. If none is left, you return to Neutral Point.
+ * Each local context has an index created when the context opens. You should close the local context, which you have opened.
-<h4>WARNING </h4>
-The function, AIS_InteractiveObject::Display, automatically activates the object’s default selection mode. When you only want to visualize an Interactive Object in open Context, you must call the second function:
+The interactive object, which is used the most by applications, is *AIS_Shape*. Consequently, standard functions are available which allow you to easily prepare selection operations on the constituent elements of shapes (selection of vertices, edges, faces etc) in an open local context. The selection modes specific to "Shape" type objects are called **Standard Activation Mode**. These modes are only taken into account in open local context and only act on interactive objects which have redefined the virtual function *AcceptShapeDecomposition()* so that it returns *TRUE*.
+ * Objects, which are temporarily in a local context, are not recognized by other local contexts a priori. Only objects visualized in Neutral Point are recognized by all local contexts.
+ * The state of a temporary interactive object in a local context can only be modified while another local context is open.
-AIS_InteractiveContext::Display.
+**Warning**
-You can activate or deactivate specific selection modes in local open context in several different ways:
-Use the Display functions with the appropriate modes
-Activate standard mode:
+The specific modes of selection only concern the interactive objects, which are present in the Main Viewer. In the Collector, you can only locate interactive objects, which answer positively to the positioned filters when a local context is open, however, they are never decomposed in standard mode.
- * AIS_InteractiveContext::ActivateStandardMode
-only if a local Context is opened
+@subsubsection occt_visu_3_4_2 Management of Local Context
- * AIS_InteractiveContext::DeactivateStandardMode
+The local context can be opened using method *AIS_InteractiveContext::OpenLocalContext*. The following options are available:
+ * *UseDisplayedObjects*: allows loading the interactive objects visualized at Neutral Point in the opened local context. If* FALSE*, the local context is empty after being opened. If *TRUE*, the objects at Neutral Point are modified by their default selection mode.
+ * *AllowShapeDecomposition*: *AIS_Shape* allows or prevents decomposition in standard shape location mode of objects at Neutral Point, which are type-privileged (see <a href="#occt_visu_3_2_4"> Selection</a> chapter). This Flag is only taken into account when *UseDisplayedObjects* is *TRUE*.
+ * *AcceptEraseOfObjects*: authorises other local contexts to erase the interactive objects present in this context. This option is rarely used. The last option has no current use.
- * AIS_InteractiveContext::ActivatedStandardModes
+This function returns the index of the created local context. It should be kept and used when the context is closed.
- * AIS_InteractiveContext::SetShapeDecomposition
+To load objects visualized at Neutral Point into a local context or remove them from it use methods
+~~~~~
+ AIS_InteractiveContext::UseDisplayedObjects
+ AIS_InteractiveContext::NotUseDisplayedObjects
+~~~~~
+Closing Local Contexts is done by:
+~~~~~
+ AIS_InteractiveContext::CloseLocalContext
+ AIS_InteractiveContext::CloseAllContexts
+~~~~~
-This has the effect of activating the corresponding selection mode for all objects in Local Context, which accept decomposition into sub-shapes. Every new Object which has been loaded into the interactive context and which answers these decomposition criteria is automatically activated according to these modes.
+*Warning*
+When the index isn’t specified in the first function, the current Context is closed. This option can be dangerous, as other Interactive Functions can open local contexts without necessarily warning the user. For greater security, you have to close the context with the index given on opening.
-<h4>WARNING </h4>
-If you have opened a local context by loading an object with the default options (AllowShapeDecomposition = Standard_True), all objects of the *Shape* type are also activated with the same modes. You can act on the state of these *Standard* objects by using SetShapeDecomposition(Status).
+To get the index of the current context, use function "AIS_InteractiveContext::IndexOfCurrentLocal". It allows closing all open local contexts at one go. In this case, you find yourself directly at Neutral Point.
-Load an interactive object by the following function:
+When you close a local context, all temporary interactive objects are deleted, all selection modes concerning the context are cancelled, and all content filters are emptied.
- * AIS_InteractiveContext::Load.
-This function allows you to load an Interactive Object whether it is visualized or not with a given selection mode, and/or with the desired decomposition option. If *AllowDecomp=TRUE* and obviously, if the interactive object is of the *Shape* type, these *standard* selection modes will be automatically activated as a function of the modes present in the Local Context.
+@subsubsection occt_visu_3_4_3 Presentation in a Neutral Point
-Directly activate/deactivate selection modes on an object:
+You must distinguish between the Neutral Point and the Open Local Context states. Although the majority of visualization functions can be used in both situations, their behavior is different.
- * AIS_InteractiveContext::Activate
- * AIS_InteractiveContext::Deactivate.
-
+Neutral Point should be used to visualize the interactive objects, which represent and select an applicative entity. Visualization and Erasing orders are straightforward:
+~~~~~
+AIS_InteractiveContext::Display
+ (const Handle(AIS_InteractiveObject)& anIobj,
+ const Standard_Boolean updateviewer=Standard_True);
+
+AIS_InteractiveContext::Display
+ (const Handle(AIS_InteractiveObject)& anIobj,
+ const Standard_Integer amode,
+ const Standard_Integer aSelectionMode,
+ const Standard_Boolean updateviewer = Standard_True,
+ const Standard_Boolean allowdecomposition = Standard_True);
+
+ AIS_InteractiveContext::Erase
+ AIS_InteractiveContext::EraseMode
+ AIS_InteractiveContext::ClearPrs
+ AIS_InteractiveContext::Redisplay
+ AIS_InteractiveContext::Remove
+ AIS_InteractiveContext::EraseAll
+ AIS_InteractiveContext::Hilight
+ AIS_InteractiveContext::HilightWithColor
+~~~~~
+
+Bear in mind the following points:
+ * It is recommended to display and erase interactive objects when no local context is opened, and open a local context for local selection only.
+ * The first *Display* function among the two ones available in *InteractiveContext* visualizes the object in its default mode (set with help of SetDisplayMode() method of InteractiveObject prior to Display() call), or in the default context mode, if applicable. If it has neither, the function displays it in 0 presentation mode. The object’s default selection mode is automatically activated (0 mode by convention).
+ * Activating the displayed object by default can be turned off with help of *SetAutoActivateSelection()* method. This might be efficient if you are not interested in selection immediately after displaying an object.
+ * The second *Display* function should only be used in Neutral Point to visualize a supplementary mode for the object, which you can erase by *EraseMode (...)*. You activate the selection mode. This is passed as an argument. By convention, if you do not want to activate a selection mode, you must set the *SelectionMode* argument to -1. This function is especially interesting in open local context, as we will see below.
+ * In Neutral Point, it is not advisable to activate other selection modes than the default selection one. It is preferable to open a local context in order to activate particular selection modes.
+ * When you call *Erase *(Interactive object) function, the *PutIncollector* argument, which is FALSE by default, allows you to visualize the object directly in the Collector and makes it selectable (by activation of 0 mode). You can nonetheless block its passage through the Collector by changing the value of this option. In this case, the object is present in the Interactive Context, but is not seen anywhere.
+ * *Erase()* with *putInCollector = Standard_True* might be slow as it computes again the object presentation in the Collector. Set *putInCollector* to *Standard_False* if you simply want to hide the object’s presentation temporarily.
+ * Visualization attributes and graphic behavior can be modified through a set of functions similar to those for the interactive object (color, thickness of line, material, transparency, locations, etc.) The context then manages immediate and deferred updates.
+ * Call *Remove()* method of *InteractiveContext* as soon as the interactive object is no longer needed and you want to destroy it.. Otherwise, references to *InteractiveObject* are kept by *InteractiveContext*, and the *Object* is not destroyed, which results in memory leaks. In general, if the presentation of an interactive object can be computed quickly, it is recommended to *Remove()* it instead of using *Erase()* method.
+@subsubsection occt_visu_3_4_4 Presentation in Local Context
+In open local context, the *Display* functions presented above can be as well.
+**WARNING**
+The function *AIS_InteractiveObject::Display* automatically activates the object’s default selection mode. When you only want to visualize an Interactive Object in open Context, you must call the function *AIS_InteractiveContext::Display*.
+You can activate or deactivate specific selection modes in the local open context in several different ways:
+Use the Display functions with the appropriate modes.
+
+~~~~~
+ AIS_InteractiveContext::ActivateStandardMode
+ //can be used only if a Local Context is opened.
+ AIS_InteractiveContext::DeactivateStandardMode
+ AIS_InteractiveContext::ActivatedStandardModes
+ AIS_InteractiveContext::SetShapeDecomposition
+~~~~~
-@subsubsection occt_1621831385_810308609778 Use of Filters
+This activates the corresponding selection mode for all objects in Local Context, which accept decomposition into sub-shapes. Every new Object which has been loaded into the interactive context and which meets the decomposition criteria is automatically activated according to these modes.
-When Interactive objects have been *prepared* in local context, you can add rejection filters. The root class of objects is *SelectMgr_Filter*. The principle behind it is straightforward: a filter tests to see whether the owners (*SelectMgr_EntityOwner*) detected in mouse position by the Local context selector answer *OK*. If so, it is kept; if not, it is rejected.
+**WARNING**
-You can therefore create your own class of filter objects by implementing the deferred function *IsOk()*:
-<h4>Example </h4>
+If you have opened a local context by loading an object with the default options *(AllowShapeDecomposition = Standard_True)*, all objects of the "Shape" type are also activated with the same modes. You can change the state of these "Standard" objects by using *SetShapeDecomposition(Status)*.
-class MyFilter : public SelectMgr_Filter {
-};
-virtual Standard_Boolean MyFilter::IsOk
-(const Handle(SelectMgr_EntityOwner)& anObj) const = 0;
+Load an interactive object by the function *AIS_InteractiveContext::Load*.
+This function allows loading an Interactive Object whether it is visualized or not with a given selection mode, and/or with the necessary decomposition option. If *AllowDecomp=TRUE* and obviously, if the interactive object is of the "Shape" type, these "standard" selection modes will be automatically activated as a function of the modes present in the Local Context.
-In *SelectMgr*, there are also Composition filters (AND Filters, OR Filters), which allow you to combine several filters. In InteractiveContext , all filters that you add are stocked in an OR filter (which answers *OK* if at least one filter answers *OK*).
+Use *AIS_InteractiveContext::Activate* and *AIS_InteractiveContext::Deactivate* to directly activate/deactivate selection modes on an object.
-There are Standard filters, which have already been implemented in several packages:
+@subsubsection occt_visu_3_4_5 Filters
- * StdSelect_EdgeFilter
-Filters acting on edges such as lines and circles
- * StdSelect_FaceFilter
-Filters acting on faces such as planes, cylinders and spheres
- * StdSelect_ShapeTypeFilter
-Filters shape types such as compounds, solids, shells and wires
- * AIS_TypeFilter
-Acts on types of interactive objects
- * AIS_SignatureFilter
-Acts on types and signatures of interactive objects
- * AIS_AttributeFilter
-Acts on attributes of Interactive Objects such as color and width
+When Interactive objects have been "prepared" in the local context, you can add rejection filters. The root class of objects is *SelectMgr_Filter*. The principle behind it is straightforward: a filter tests to see whether the owners *(SelectMgr_EntityOwner)* detected in mouse position by the Local context selector answer *OK*. If so, it is kept, otherwise it is rejected.
-Because there are specific behaviors on shapes, each new Filter class must, if necessary, redefine a function, which allows a Local Context to know if it acts on specific types of sub-shapes:
+You can create a custom class of filter objects by implementing the deferred function *IsOk()*:
- * AIS_LocalContext::ActsOn.
+~~~~~
+class MyFilter : public SelectMgr_Filter { };
+virtual Standard_Boolean MyFilter::IsOk
+ (const Handle(SelectMgr_EntityOwner)& anObj) const = 0;
+~~~~~
-By default, this function answers *FALSE*.
+In *SelectMgr*, there are also Composition filters (AND Filters, OR Filters), which allow combining several filters. In InteractiveContext , all filters that you add are stocked in an OR filter (which answers *OK* if at least one filter answers *OK*).
-*WARNING *
-Only type filters are activated in Neutral Point. This is to make it possible to identify a specific type of visualized object. For filters to come into play, one or more object selection modes must be activated.
+There are Standard filters, which have already been implemented in several packages:
+ * *StdSelect_EdgeFilter* - for edges, such as lines and circles;
+ * *StdSelect_FaceFilter* - for faces, such as planes, cylinders and spheres;
+ * *StdSelect_ShapeTypeFilter* - for shape types, such as compounds, solids, shells and wires;
+ * *AIS_TypeFilter* - for types of interactive objects;
+ * *AIS_SignatureFilter* - for types and signatures of interactive objects;
+ * *AIS_AttributeFilter* - for attributes of Interactive Objects, such as color and width.
-There are several functions to manipulate filters:
+As there are specific behaviors on shapes, each new Filter class must, if necessary, redefine *AIS_LocalContext::ActsOn* function, which informs the Local Context if it acts on specific types of sub-shapes. By default, this function answers *FALSE*.
- * AIS_InteractiveContext::AddFilter
+**WARNING**
+
+Only type filters are activated in Neutral Point to make it possible to identify a specific type of visualized object. For filters to come into play, one or more object selection modes must be activated.
-to add a filter passed as an argument.
+There are several functions to manipulate filters:
+ * *AIS_InteractiveContext::AddFilter* adds a filter passed as an argument.
+ * *AIS_InteractiveContext::RemoveFilter* removes a filter passed as an argument.
+ * *AIS_InteractiveContext::RemoveFilters* removes all present filters.
+ * *AIS_InteractiveContext::Filters* gets the list of filters active in a local context.
- * AIS_InteractiveContext::RemoveFilter
-
-to remove a filter passed as an argument.
-
- * AIS_InteractiveContext::RemoveFilters
-
-to remove all filters present.
-
- * AIS_InteractiveContext::Filters
-
-to get the list of filters active in a local context.
-<h4>Example </h4>
-
-myContext-OpenLocalContext(Standard_False);
-// no object in neutral point is loaded
-
-myContext-ActivateStandardMode(TopAbs_Face);
-//activates decomposition of shapes into faces.
-Handle (AIS_Shape) myAIShape = new AIS_Shape ( ATopoShape);
-
-myContext-Display(myAIShape,1,-1,Standard_True,Standard_True); //shading visualization mode, no specific mode, authorization for //decomposition into sub-shapes. At this Stage, myAIShape is decomposed into faces...
-
-Handle(StdSelect_FaceFilter) Fil1= new
-StdSelect_FaceFilter(StdSelect_Revol);
-Handle(StdSelect_FaceFilter) Fil2= new
- StdSelect_FaceFilter(StdSelect_Plane);
-
-myContext-AddFilter(Fil1); myContext-AddFilter(Fil2); //only faces of revolution or planar faces will be selected
- *
-myContext-MoveTo( xpix,ypix,Vue);
-// detects of mouse position
-
-
-@subsubsection occt_1621831385_810308609779 Selection Strictly Speaking.
-Dynamic detection and selection are put into effect in a straightforward way. There are only a few conventions and functions to be familiar with. The functions are the same in neutral point and in open local context:
-
- * AIS_InteractiveContext::MoveTo
-passes mouse position to Interactive Context selectors
- * AIS_InteractiveContext::Select
-stocks what has been detected on the last MoveTo. Replaces the previously selected object. Empties the stack if nothing has been detected at the last move
- * AIS_InteractiveContext::ShiftSelect
-if the object detected at the last move was not already selected , it is added to the list of those selected. If not, it is withdrawn. Nothing happens if you click on an empty area.
- * AIS_InteractiveContext::Select
-selects everything found in the surrounding area
- * AIS_InteractiveContext::ShiftSelect
-selects what was not previously in the list of selected, deselects those already present.
-
-Highlighting of detected and selected entities is automatically managed by the Interactive Context, whether you are in neutral point or Local Context. The Highlight colors are those dealt with above. You can nonetheless disconnect this automatic mode if you want to manage this part yourself:
-
- * AIS_InteractiveContext::SetAutomaticHilight
- * AIS_InteractiveContext::AutomaticHilight
-
-
-If there is no open local context, the objects selected are called CURRENT OBJECTS; SELECTED OBJECTS if there is one. Iterators allow entities to be recovered in either case. A set of functions allows you to manipulate the objects, which have been placed in these different lists.
-
-*WARNING *
-When a Local Context is open, you can select entities other than interactive objects (vertices, edges etc.) from decompositions in standard modes, or from activation in specific modes on specific interactive objects. Only interactive objects are stocked in the list of selected objects. You can question the Interactive context by moving the mouse. The following functions will allow you to:
- * tell whether something has been detected
- * tell whether it is a shape
- * get the shape if the detected entity is one
- * get the interactive object if the detected entity is one.
-
-The following functions are concerned:
- * AIS_InteractiveContext::HasDetected
- * AIS_InteractiveContext::HasDetectedShape
- * AIS_InteractiveContext::DetectedShape
- * AIS_InteractiveContext::DetectedInteractive
-
-After using the Select and ShiftSelect functions in Neutral Point, you can explore the list of selections, referred to as current objects in this context. You can:
- * initiate a scan of this list
- * extend the scan
- * resume the scan
- * get the name of the current object detected in the scan.
-
-The following functions are concerned:
- * AIS_InteractiveContext::InitCurrent
- * AIS_InteractiveContext::MoreCurrent
- * AIS_InteractiveContext::NextCurrent
- * AIS_InteractiveContext::Current
-
-You can:
- * get the first current interactive object
- * highlight current objects
- * remove highlight from current objects
- * empty the list of current objects in order to update it
- * find the current object.
-
-The following functions are concerned:
- * AIS_InteractiveContext::FirstCurrentObject
- * AIS_InteractiveContext::HilightCurrents
- * AIS_InteractiveContext::UnhilightCurrents
- * AIS_InteractiveContext::ClearCurrents
- * AIS_InteractiveContext::IsCurrent.
-
-In Local Context, you can explore the list of selected objects available. You can:
- * initiate,
- * extend,
- * resume a scan, and then
- * get the name of the selected object.
-
-The following functions are concerned:
-
- * AIS_InteractiveContext::InitSelected
- * AIS_InteractiveContext::MoreSelected
- * AIS_InteractiveContext::NextSelected
- * AIS_InteractiveContext::SelectedShape.
-
-You can:
- * check to see if you have a selected shape, and if not,
- * get the picked interactive object,
- * check to see if the applicative object has an owner from Interactive attributed to it
- * get the owner of the detected applicative entity
- * get the name of the selected object.
-
-The following functions are concerned:
-
- * AIS_InteractiveContext::HasSelectedShape
- * AIS_InteractiveContext::Interactive
- * AIS_InteractiveContext::HasApplicative
- * AIS_InteractiveContext::Applicative
- * AIS_InteractiveContext::IsSelected.
-
<h4>Example </h4>
+~~~~~
+myContext-OpenLocalContext(Standard_False);
+// no object in neutral point is loaded
-myAISCtx-InitSelected();
-while (myAISCtx-MoreSelected())
-{
-if (myAISCtx-HasSelectedShape)
-{
-TopoDS_Shape ashape = myAISCtx-SelectedShape();
-// to be able to use the picked shape
- }
-else
-{
-Handle_AIS_InteractiveObject aniobj = myAISCtx-Interactive();
-// to be able to use the picked interactive object
-}
-myAISCtx-NextSelected(); }
-
-
-@subsubsection occt_1621831385_8103086097710 Remarks:
-
-In Local Context and in the iteration loop, which allows you to recover selected entities, you have to ask whether you have selected a shape or an interactive object before you can recover the entity. If you have selected a Shape from TopoDS on decomposition in standard mode, the *Interactive ()* function returns the interactive object, which provided the selected shape. Other functions allow you to manipulate the content of Selected or Current Objects:
- * erase selected objects
- * display them,
- * put them in the list of selections
+myContext-ActivateStandardMode(TopAbs_Face);
+//activates decomposition of shapes into faces.
+Handle (AIS_Shape) myAIShape = new AIS_Shape ( ATopoShape);
-The following functions are concerned:
+myContext-Display(myAIShape,1,-1,Standard_True,Standard_True);
- * AIS_InteractiveContext::EraseSelected
- * AIS_InteractiveContext::DisplaySelected
- * AIS_InteractiveContext::SetSelected
+//shading visualization mode, no specific mode, authorization for //decomposition into sub-shapes. At this Stage, myAIShape is decomposed into faces...
+Handle(StdSelect_FaceFilter) Fil1= new
+ StdSelect_FaceFilter(StdSelect_Revol);
+Handle(StdSelect_FaceFilter) Fil2= new
+ StdSelect_FaceFilter(StdSelect_Plane);
-You can also:
+myContext-AddFilter(Fil1);
+myContext-AddFilter(Fil2);
- * take the list of selected objects from a local context and put it into the list of current objects in Neutral Point,
- * add or remove an object from the list of selected entities,
- * highlight and
- * remove highlighting from a selected object
- * empty the list of selected objects.
+//only faces of revolution or planar faces will be selected
+
+myContext-MoveTo( xpix,ypix,Vue);
+// detects the mouse position
+~~~~~
-The following functions are concerned:
+@subsubsection occt_visu_3_4_6 Selection in the Local Context
+
+Dynamic detection and selection are put into effect in a straightforward way. There are only a few conventions and functions to be familiar with. The functions are the same in neutral point and in open local context:
+ * *AIS_InteractiveContext::MoveTo* - passes mouse position to Interactive Context selectors
+ * *AIS_InteractiveContext::Select* - stocks what has been detected on the last *MoveTo*. Replaces the previously selected object. Empties the stack if nothing has been detected at the last move
+ * *AIS_InteractiveContext::ShiftSelect* - if the object detected at the last move was not already selected, it is added to the list of the selected objects. If not, it is withdrawn. Nothing happens if you click on an empty area.
+ * *AIS_InteractiveContext::Select* selects everything found in the surrounding area.
+ * *AIS_InteractiveContext::ShiftSelect* selects what was not previously in the list of selected, deselects those already present.
+
+Highlighting of detected and selected entities is automatically managed by the Interactive Context, whether you are in neutral point or Local Context. The Highlight colors are those dealt with above. You can nonetheless disconnect this automatic mode if you want to manage this part yourself :
+~~~~~
+ AIS_InteractiveContext::SetAutomaticHilight
+ AIS_InteractiveContext::AutomaticHilight
+~~~~~
- * AIS_InteractiveContext::SetSelectedCurrent
- * AIS_InteractiveContext::AddOrRemoveSelected
- * AIS_InteractiveContext::HilightSelected
- * AIS_InteractiveContext::UnhilightSelected
- * AIS_InteractiveContext::ClearSelected
+If there is no open local context, the objects selected are called **current objects**. If there is a local context, they are called **selected objects**. Iterators allow entities to be recovered in either case. A set of functions allows manipulating the objects, which have been placed in these different lists.
+
+**WARNING**
+
+When a Local Context is open, you can select entities other than interactive objects (vertices, edges etc.) from decompositions in standard modes, or from activation in specific modes on specific interactive objects. Only interactive objects are stocked in the list of selected objects.
+
+You can question the Interactive context by moving the mouse. The following functions can be used:
+ * *AIS_InteractiveContext::HasDetected* informs if something has been detected;
+ * *AIS_InteractiveContext::HasDetectedShape* informs if it is a shape;
+ * *AIS_InteractiveContext::DetectedShape* gets the shape if the detected entity is an object;
+ * *AIS_InteractiveContext::DetectedInteractive* gets the interactive object if the detected entity is an object.
+
+After using the *Select* and *ShiftSelect* functions in Neutral Point, you can explore the list of selections, referred to as current objects in this context. The following functions can be used:
+ * *AIS_InteractiveContext::InitCurrent* initiates a scan of this list;
+ * *AIS_InteractiveContext::MoreCurrent* extends the scan;
+ * *AIS_InteractiveContext::NextCurrent* resumes the scan;
+ * *AIS_InteractiveContext::Current* gets the name of the current object detected in the scan;
+ * *AIS_InteractiveContext::FirstCurrentObject* gets the first current interactive object;
+ * *AIS_InteractiveContext::HilightCurrents* highlights current objects;
+ * *AIS_InteractiveContext::UnhilightCurrents* removes highlight from current objects;
+ * *AIS_InteractiveContext::ClearCurrents* empties the list of current objects in order to update it;
+ * *AIS_InteractiveContext::IsCurrent* finds the current object.
+
+In the Local Context, you can explore the list of selected objects available. The following functions can be used:
+ * *AIS_InteractiveContext::InitSelected* initiates the list of objects;
+ * *AIS_InteractiveContext::MoreSelected* extends the list of objects;
+ * *AIS_InteractiveContext::NextSelected* resumes a scan;
+ * *AIS_InteractiveContext::SelectedShape* gets the name of the selected object;
+ * *AIS_InteractiveContext::HasSelectedShape* checks if the selected shape is obtained;
+ * *AIS_InteractiveContext::Interactive* gets the picked interactive object;
+ * *AIS_InteractiveContext::HasApplicative* checks if the applicative object has an owner from Interactive attributed to it;
+ * *AIS_InteractiveContext::Applicative* gets the owner of the detected applicative entity;
+ * *AIS_InteractiveContext::IsSelected* gets the name of the selected object.
-You can highlight and remove highlighting from a current object, and empty the list of current objects.
- * AIS_InteractiveContext::HilightCurrents
- * AIS_InteractiveContext::UnhilightCurrents
- * AIS_InteractiveContext::ClearCurrents
+<h4>Example </h4>
+~~~~~
+myAISCtx-InitSelected();
+while (myAISCtx-MoreSelected())
+ {
+ if (myAISCtx-HasSelectedShape)
+ {
+ TopoDS_Shape ashape = myAISCtx-SelectedShape();
+ // to be able to use the picked shape
+ }
+ else
+ {
+ Handle_AIS_InteractiveObject aniobj = myAISCtx-Interactive();
+ // to be able to use the picked interactive object
+ }
+myAISCtx-NextSelected();
+}
+~~~~~
-When you are in open Local Context, you may be lead to keep *temporary* interactive objects. This is possible using the following functions:
+You have to ask whether you have selected a shape or an interactive object before you can recover the entity in the Local Context or in the iteration loop. If you have selected a Shape from *TopoDS* on decomposition in standard mode, the *Interactive()* function returns the interactive object, which provided the selected shape. Other functions allow you to manipulate the content of Selected or Current Objects:
+ * *AIS_InteractiveContext::EraseSelected* erases the selected objects;
+ * *AIS_InteractiveContext::DisplaySelected* displays them;
+ * *AIS_InteractiveContext::SetSelected* puts the objects in the list of selections;
+ * *AIS_InteractiveContext::SetSelectedCurrent* takes the list of selected objects from a local context and puts it into the list of current objects in Neutral Point;
+ * *AIS_InteractiveContext::AddOrRemoveSelected* adds or removes an object from the list of selected entities;
+ * *AIS_InteractiveContext::HilightSelected* highlights the selected object;
+ * *AIS_InteractiveContext::UnhilightSelected* removes highlighting from the selected object;
+ * *AIS_InteractiveContext::ClearSelected* empties the list of selected objects.
- * AIS_InteractiveContext::KeepTemporary
- * AIS_InteractiveContext::SetSelectedCurrent
-The first function transfers the characteristics of the interactive object seen in its local context (visualization mode etc.) to the neutral point. When the local context is closed, the object does not disappear. The second allows the selected object to become the current object when you close the local context.
-You can also want to modify in a general way the state of the local context before continuing a selection (emptying objects, removing filters, standard activation modes). To do that, you must use the following function:
+You can highlight and remove highlighting from a current object, and empty the list of current objects using the following functions:
+~~~~~
+ AIS_InteractiveContext::HilightCurrents
+ AIS_InteractiveContext::UnhilightCurrents
+ AIS_InteractiveContext::ClearCurrents
+~~~~~
+When you are in an open Local Context, you may need to keep "temporary" interactive objects. This is possible using the following functions:
+ * *AIS_InteractiveContext::KeepTemporary* transfers the characteristics of the interactive object seen in its local context (visualization mode, etc.) to the neutral point. When the local context is closed, the object does not disappear.
+ * *AIS_InteractiveContext::SetSelectedCurrent* allows the selected object to become the current object when you close the local context.
- * AIS_InteractiveContext::ClearLocalContext
+You can also want to use function *AIS_InteractiveContext::ClearLocalContext* to modify in a general way the state of the local context before continuing a selection (emptying objects, removing filters, standard activation modes).
-@subsubsection occt_1621831385_8103086097711 Advice on Using Local Contexts
+@subsubsection occt_visu_3_4_7 Recommendations
-The possiblities of use for local contexts are numerous depending on the type of operation that you want to perform:
+The possibilities of use for local contexts are numerous depending on the type of operation that you want to perform:
* working on all visualized interactive objects,
* working on only a few objects,
* working on a single object.
-1. When you want to work on one type of entity, you should open a local context with the option UseDisplayedObjects set to FALSE. Some functions which allow you to recover the visualized interactive objects, which have a given Type, and Signature from the *Neutral Point* are:
-
-AIS_InteractiveContext::DisplayedObjects
-(AIS_ListOfInteractive& aListOfIO) const;
-
-AIS_InteractiveContext::DisplayedObjects
-(const AIS_KindOfInteractive WhichKind,
- const Standard_Integer WhichSignature,
-AIS_ListOfInteractive& aListOfIO) const;
-
-At this stage, you only have to load the functions Load, Activate, and so on.
-
-2. When you open a Local Context with default options, you must keep the following points in mind:
-
-The Interactive Objects visualized at Neutral Point are activated with their default selection mode. You must deactivate those, which you do not want to use.
+When you want to work on one type of entity, you should open a local context with the option *UseDisplayedObjects* set to FALSE. Some functions which allow you to recover the visualized interactive objects, which have a given Type, and Signature from the "Neutral Point" are:
-The Shape Type Interactive Objects are automatically decomposed into sub-shapes when standard activation modes are launched.
-
-The *temporary* Interactive Objects present in the Local Contexts are not automatically taken into account. You have to load them manually if you want to use them.
+~~~~~
+AIS_InteractiveContext::DisplayedObjects (AIS_ListOfInteractive& aListOfIO) const;
+AIS_InteractiveContext::DisplayedObjects (const AIS_KindOfInteractive WhichKind, const Standard_Integer WhichSignature;
+AIS_ListOfInteractive& aListOfIO) const;
+~~~~~
-The stages could be the following:
-1. Open a Local Context with the right options;
-2. Load/Visualize the required complementary objects with the desired activation modes.
-3. Activate Standard modes if necessary
-4. Create its filters and add them to the Local Context
-5. Detect/Select/recover the desired entities
-6. Close the Local Context with the adequate index.
+At this stage, you only have to load the functions *Load, Activate,* and so on.
-It is useful to create an INTERACTIVE EDITOR, to which you pass the Interactive Context. This will take care of setting up the different contexts of selection/presentation according to the operation, which you want to perform.
-<h4>Example </h4>
+When you open a Local Context with default options, you must keep the following points in mind:
+* The Interactive Objects visualized at Neutral Point are activated with their default selection mode. You must deactivate those, which you do not want to use.
+* The Shape Type Interactive Objects are automatically decomposed into sub-shapes when standard activation modes are launched.
+* The "temporary" Interactive Objects present in the Local Contexts are not automatically taken into account. You have to load them manually if you want to use them.
+The stages could be the following:
+ 1. Open a Local Context with the right options;
+ 2. Load/Visualize the required complementary objects with the desired activation modes.
+ 3. Activate Standard modes if necessary
+ 4. Create its filters and add them to the Local Context
+ 5. Detect/Select/recover the desired entities
+ 6. Close the Local Context with the adequate index.
-You have visualized several types of interactive objects: *AIS_Points*, *AIS_Axes*, *AIS_Trihedrons*, and *AIS_Shapes*.
+It is useful to create an **interactive editor**, to which you pass the Interactive Context. This allow setting up different contexts of selection/presentation according to the operation, which you want to perform.
+
+Let us assume that you have visualized several types of interactive objects: *AIS_Points*, *AIS_Axes*, *AIS_Trihedrons*, and *AIS_Shapes*.
-For your applicative function, you need an axis to create a revolved object. You could obtain this axis by identifying:
+For your applicative function, you need an axis to create a revolved object. You could obtain this axis by identifying:
* an axis which is already visualized,
* 2 points,
* a rectilinear edge on the shapes which are present,
- * a cylindrical face on the shapes (You will take the axis of this face)
-
-myIHMEditor::myIHMEditor
-(const Handle(AIS_InteractiveContext)& Ctx,
- ....) :
- myCtx(Ctx),
-...
+ * a cylindrical face on the shapes (You will take the axis of this face)
+~~~~~
+myIHMEditor::myIHMEditor
+ (const Handle(AIS_InteractiveContext)& Ctx,
+ ....) :
+ myCtx(Ctx),
+ ...
{
}
myIHMEditor::PrepareContext()
{
-myIndex =myCtx-OpenLocalContext();
-
-//the filters
+myIndex =myCtx-OpenLocalContext();
-Handle(AIS_SignatureFilter) F1 = new
- AIS_SignatureFilter(AIS_KOI_Datum,AIS_SD_Point);
-//filter on the points
+//the filters
-Handle(AIS_SignatureFilter) F2 = new
-AIS_SignatureFilter(AIS_KOI_Datum,AIS_SD_Axis);
-//filters on the axes.
+Handle(AIS_SignatureFilter) F1 = new AIS_SignatureFilter(AIS_KOI_Datum,AIS_SD_Point);
+//filter on the points
-Handle(StdSelect_FaceFilter) F3 = new
- StdSelect_FaceFilter(AIS_Cylinder);
-//cylindrical face filters
+Handle(AIS_SignatureFilter) F2 = new AIS_SignatureFilter(AIS_KOI_Datum,AIS_SD_Axis);
+//filters on the axes.
+Handle(StdSelect_FaceFilter) F3 = new StdSelect_FaceFilter(AIS_Cylinder);
+//cylindrical face filters
//...
-
-// activation of standard modes on the shapes..
+// activation of standard modes on the shapes..
myCtx-ActivateStandardMode(TopAbs_FACE);
myCtx-ActivateStandardMode(TopAbs_VERTEX);
myCTX-Add(F1);
myCTX-Add(F2);
-myCTX-Add(F3);
+myCTX-Add(F3);
-// at this point, you can call the selection/detection function
+// at this point, you can call the selection/detection function
}
void myIHMEditor::MoveTo(xpix,ypix,Vue)
-{ myCTX-MoveTo(xpix,ypix,vue); // the highlight of what is detected is automatic. }
-Standard_Boolean myIHMEditor::Select() { // returns true if you should continue the selection
-myCTX-Select(); myCTX-InitSelected(); if(myCTX-MoreSelected())
- { if(myCTX-HasSelectedShape())
-{ const TopoDS_Shape& sh = myCTX-SelectedShape();
-if( vertex){
-if(myFirstV...)
-{
-//if it’s the first vertex, you stock it, then you deactivate the faces and only keep the filter on the points:
-mypoint1 = ....;
-myCtx-RemoveFilters();
-myCTX-DeactivateStandardMode(TopAbs_FACE);
-myCtx-Add(F1);
-// the filter on the AIS_Points
-myFirstV = Standard_False;
-return Standard_True;
- } else {
- mypoint2 =...;
-// construction of the axis return Standard_False;
-}
- }
- else
- {
-//it is a cylindrical face : you recover the axis; visualize it; and stock it.
-return Standard_False;
-}
- }
-// it is not a shape but is no doubt a point.
-else
-{
-Handle(AIS_InteractiveObject)
-SelObj = myCTX-SelectedInteractive();
-if(SelObj-Type()==AIS_KOI_Datum)
-{
-if(SelObj-Signature()==1)
-{
-if (firstPoint)
-{
-mypoint1 =...
-return Standard_True;
-}
-else
-{
-mypoint2 = ...;
-//construction of the axis, visualization, stocking
-return Standard_False;
-}
-}
-
-else
-{
-// you have selected an axis; stock the axis
-return Standard_False;
-}
-}
-}
-}
-}
-@subsection occt_1621831385_810308609111 ANNEX I: Standard Interactive Object Classes in AIS DATUMS:
+{ myCTX-MoveTo(xpix,ypix,vue);
+// the highlight of what is detected is automatic.
+}
+Standard_Boolean myIHMEditor::Select()
+{
+// returns true if you should continue the selection
+ myCTX-Select();
+ myCTX-InitSelected();
+ if(myCTX-MoreSelected())
+ {
+ if(myCTX-HasSelectedShape())
+ { const TopoDS_Shape& sh = myCTX-SelectedShape();
+ if( vertex){
+ if(myFirstV...)
+ {
+ //if it’s the first vertex, you stock it, then you deactivate the faces and only keep the filter on the points:
+ mypoint1 = ....;
+ myCtx-RemoveFilters();
+ myCTX-DeactivateStandardMode(TopAbs_FACE);
+ myCtx-Add(F1);
+ // the filter on the AIS_Points
+ myFirstV = Standard_False;
+ return Standard_True;
+ }
+ else
+ {
+ mypoint2 =...;
+ // construction of the axis return Standard_False;
+ }
+ }
+ else
+ {
+ //it is a cylindrical face : you recover the axis; visualize it; and stock it.
+ return Standard_False;
+ }
+ }
+ // it is not a shape but is no doubt a point.
+ else
+ {
+ Handle(AIS_InteractiveObject)
+ SelObj = myCTX-SelectedInteractive();
+ if(SelObj-Type()==AIS_KOI_Datum)
+ {
+ if(SelObj-Signature()==1)
+ {
+ if (firstPoint)
+ {
+ mypoint1 =...
+ return Standard_True;
+ }
+ else
+ {
+ mypoint2 = ...;
+ //construction of the axis, visualization, stocking
+ return Standard_False;
+ }
+ }
+
+ else
+ {
+ // you have selected an axis; stock the axis
+ return Standard_False;
+ }
+ }
+ }
+ }
+ }
+void myIHMEditor::Terminate()
+{
+myCtx->CloseLocalContext(myIndex);
+...
+}
+~~~~~
-AIS_Point AIS_Axis AIS_Line AIS_Circle AIS_Plane AIS_Trihedron : 4 selection modes
- * mode 0 : selection of a trihedron
- * mode 1 : selection of the origin of the trihedron
- * mode 2 : selection of the axes
- * mode 3 : selection of the planes XOY, YOZ, XOZ
+@subsection occt_visu_3_5 Standard Interactive Object Classes
-when you activate one of modes 1 2 3 4 , you pick AIS objects of type:
- * AIS_Point
- * AIS_Axis (and information on the type of axis)
- * AIS_Plane (and information on the type of plane).
+@subsubsection occt_visu_3_5_1 Datums
+
+*AIS_Point, AIS_Axis, AIS_Line, AIS_Circle, AIS_Plane* and *AIS_Trihedron* have four selection modes:
+ * mode 0 : selection of a trihedron;
+ * mode 1 : selection of the origin of the trihedron;
+ * mode 2 : selection of the axes;
+ * mode 3 : selection of the planes XOY, YOZ, XOZ.
-AIS_PlaneTrihedron offers 3 selection modes:
- * mode 0 : selection of the whole trihedron
- * mode 1 : selection of the origin of the trihedron
- * mode 2 : selection of the axes - same remarks as for the Trihedron.
+when you activate one of modes: 1 2 3 4, you pick AIS objects of type:
+ * *AIS_Point*
+ * *AIS_Axis* (and information on the type of axis)
+ * *AIS_Plane* (and information on the type of plane).
-<h4>Warning </h4>
-For the presentation of planes and trihedra, the default unit of length is millimeter, and the default value for the representation of axes is 100. If you modify these dimensions, you must temporarily recover the object DRAWER. From inside it, take the Aspects in which the values for length are stocked (PlaneAspect for the plane, FirstAxisAspect for trihedra), and change these values inside these Aspects. Finally, recalculate the presentation.
+*AIS_PlaneTrihedron* offers three selection modes:
+ * mode 0 : selection of the whole trihedron;
+ * mode 1 : selection of the origin of the trihedron;
+ * mode 2 : selection of the axes - same remarks as for the Trihedron.
-@subsubsection occt_1621831385_8103086092222 OBJECTS
+For the presentation of planes and trihedra, the default unit of length is millimeter, and the default value for the representation of axes is 100. If you modify these dimensions, you must temporarily recover the object **Drawer**. From it, take the *Aspects* in which the values for length are stored (*PlaneAspect* for the plane, *FirstAxisAspect* for trihedra), and change these values inside these Aspects. Finally, recalculate the presentation.
-AIS_Shape : 3 visualization modes :
+@subsubsection occt_visu_3_5_2 Objects
+*AIS_Shape* has three visualization modes :
* mode 0 : Line (default mode)
* mode 1 : Shading (depending on the type of shape)
* mode 2 : Bounding Box
-Seven maximum selection modes, depending on the complexity of the shape:
- * mode 0 : selection of the AIS_Shape
- * mode 1 : selection of the vertices
- * mode 2 : selection of the edges
- * mode 3 : selection of the wires
- * mode 4 : selection of the faces
- * mode 5 : selection of the shells
+And at maximum seven selection modes, depending on the shape complexity:
+ * mode 0 : selection of the *AIS_Shape*;
+ * mode 1 : selection of the vertices;
+ * mode 2 : selection of the edges;
+ * mode 3 : selection of the wires;
+ * mode 4 : selection of the faces;
+ * mode 5 : selection of the shells;
* mode 6 : selection of the constituent solids.
-AIS_Triangulation: Simple interactive object for displaying triangular mesh contained in Poly_Triangulation container.
+* *AIS_Triangulation* is a simple interactive object for displaying triangular mesh contained in *Poly_Triangulation* container.
+* *AIS_ConnectedInteractive* is an Interactive Object connecting to another interactive object reference, and located elsewhere in the viewer makes it possible not to calculate presentation and selection, but to deduce them from your object reference.
+* *AIS_ConnectedShape* is an object connected to interactive objects having a shape; this class has the same decompositions as *AIS_Shape*. What’s more, it allows a presentation of hidden parts, which are calculated automatically from the shape of its reference.
+* *AIS_MultipleConnectedInteractive* is an object connected to a list of interactive objects (which can also be Connected objects. It does not require memory hungry calculations of presentation)
+* *AIS_MultipleConnectedShape* is an interactive Object connected to a list of interactive objects having a Shape <i>(AIS_Shape, AIS_ConnectedShape, AIS_MultipleConnectedShape)</i>. The presentation of hidden parts is calculated automatically.
+* *AIS_TexturedShape* is an Interactive Object that supports texture mapping. It is constructed as a usual AIS_Shape, but has additional methods that allow to map a texture on it.
+* *MeshVS_Mesh* is an Interactive Object that represents meshes, it has a data source that provides geometrical information (nodes, elements) and can be built up from the source data with a custom presentation builder.
-AIS_ConnectedInteractive: Interactive Object connecting to another interactive object reference, and located elsewhere in the viewer makes it possible not to calculate presentation and selection, but to deduce them from your object reference.
+@subsubsection occt_visu_3_5_3 Relations
+ * *AIS_ConcentricRelation*
+ * *AIS_FixRelation*
+ * *AIS_IdenticRelation*
+ * *AIS_ParallelRelation*
+ * *AIS_PerpendicularRelation*
+ * *AIS_Relation*
+ * *AIS_SymmetricRelation*
+ * *AIS_TangentRelation*
-AIS_ConnectedShape: Object connected to interactive objects having a shape; this class has the same decompositions as AIS_Shape. What’s more, it allows a presentation of hidden parts, which are calculated automatically from the shape of its reference.
+The list of relations is not exhaustive.
-AIS_MultipleConnectedInteractive: Object connected to a list of interactive objects (which can also be Connected objects. It does not require memory hungry calculations of presentation)
+@subsubsection occt_visu_3_5_4 Dimensions
+ * *AIS_AngleDimension*
+ * *AIS_Chamf3dDimension*
+ * *AIS_DiameterDimension*
+ * *AIS_DimensionOwner*
+ * *AIS_LengthDimension*
+ * *AIS_OffsetDimension*
+ * *AIS_RadiusDimension*
-AIS_MultipleConnectedShape: Interactive Object connected to a list of interactive objects having a Shape (AIS_Shape, AIS_ConnectedShape, AIS_MultipleConnectedShape). The presentation of hidden parts is calculated automatically.
+ @subsubsection occt_visu_3_5_5 MeshVS_Mesh
-AIS_TexturedShape: Interactive Object that supports texture mapping. It is constructed as a usual AIS_Shape, but has additional methods that allow to map a texture on it.
+*MeshVS_Mesh* is an Interactive Object that represents meshes. This object differs from the *AIS_Shape* as its geometrical data is supported by the data source *MeshVS_DataSource* that describes nodes and elements of the object. As a result, you can provide your own data source.
-MeshVS_Mesh: Interactive Object that represents meshes, it has a data source that provides geometrical information (nodes, elements) and can be built up from the source data with a custom presentation builder.
+However, the *DataSource* does not provide any information on attributes, for example nodal colors, but you can apply them in a special way – by choosing the appropriate presentation builder.
-@subsubsection occt_1621831385_8103086093333 RELATIONS
-The list is not exhaustive.
-AIS_ConcentricRelation
-AIS_FixRelation
-AIS_IdenticRelation
-AIS_ParallelRelation
-AIS_PerpendicularRelation
-AIS_Relation
-AIS_SymmetricRelation
-AIS_TangentRelation
+The presentations of *MeshVS_Mesh* are built with the presentation builders *MeshVS_PrsBuilder*. You can choose between the builders to represent the object in a different way. Moreover, you can redefine the base builder class and provide your own presentation builder.
-@subsubsection occt_1621831385_810308609444 DIMENSIONS
-AIS_AngleDimension
-AIS_Chamf2dDimension
-AIS_Chamf3dDimension
-AIS_DiameterDimension
-AIS_DimensionOwner
-AIS_LengthDimension
-AIS_OffsetDimension
-AIS_RadiusDimension
-
-@subsubsection occt_1621831385_810308609555 MeshVS_Mesh
-MeshVS_Mesh is an Interactive Object that represents meshes.
-This object differs from the AIS_Shape as its geometrical data is supported by the data source (*MeshVS_DataSource*) that describes nodes and elements of the object. As a result, you can provide your own data source.
-However, the *DataSource* does not provide any information on attributes, for example nodal colors, but you can apply them in a special way – by choosing the appropriate presentation builder.
-The presentations of MeshVS_Mesh are built with the presentation builders (*MeshVS_PrsBuilder*). You can choose between the builders to represent the object in a different way. Moreover, you can redefine the base builder class and provide your own presentation builder.
You can add/remove builders using the following methods:
- * MeshVS_Mesh::AddBuilder
- (const Handle (MeshVS_PrsBuilder) &Builder,
- Standard_Boolean TreatAsHilighter)
- * MeshVS_Mesh::RemoveBuilder (const Standard_Integer Index)
- * MeshVS_Mesh::RemoveBuilderById
- (const Standard_Integer Id)
-
-There is a set of reserved display and highlighting mode flags for MeshVS_Mesh. Mode value is a number of bits that allows you to select additional display parameters and combine the following mode flags:
- * MeshVS_DMF_WireFrame
- * MeshVS_DMF_Shading
- * MeshVS_DMF_Shrink
-base modes: display mesh in wireframe, shading, shrink modes.
-
- * MeshVS_DMF_VectorDataPrs
- * MeshVS_DMF_NodalColorDataPrs
- * MeshVS_DMF_ElementalColorDataPrs
- * MeshVS_DMF_TextDataPrs
- * MeshVS_DMF_EntitiesWithData
-represent different kinds of data
-
- * MeshVS_DMF_DeformedPrsWireFrame
- * MeshVS_DMF_DeformedPrsShading
- * MeshVS_DMF_DeformedPrsShrink
-display deformed mesh in wireframe, shading or shrink modes
-
- * MeshVS_DMF_SelectionPrs
- * MeshVS_DMF_HilightPrs
-selection and hilighting
-
- * MeshVS_DMF_User
-user-defined mode
-
-These values will be used by the presentation builder.
-There is also a set of selection modes flags that can be grouped in a combination of bits:
- * MeshVS_SMF_0D
- * MeshVS_SMF_Link
- * MeshVS_SMF_Face
- * MeshVS_SMF_Volume
- * MeshVS_SMF_Element
-Element: 0D, Link, Face and Volume grouped as a bit mask
+~~~~~
+ MeshVS_Mesh::AddBuilder (const Handle (MeshVS_PrsBuilder) &Builder, Standard_Boolean TreatAsHilighter)
+ MeshVS_Mesh::RemoveBuilder (const Standard_Integer Index)
+ MeshVS_Mesh::RemoveBuilderById (const Standard_Integer Id)
+~~~~~
- * MeshVS_SMF_Node
- * MeshVS_SMF_All
-All: Element and Node grouped as a bit mask
+There is a set of reserved display and highlighting mode flags for *MeshVS_Mesh*. Mode value is a number of bits that allows selecting additional display parameters and combining the following mode flags, which allow displaying mesh in wireframe, shading and shrink modes:
+~~~~~
+ MeshVS_DMF_WireFrame
+ MeshVS_DMF_Shading
+ MeshVS_DMF_Shrink
+~~~~~
- * MeshVS_SMF_Mesh
- * MeshVS_SMF_Group
+It is also possible to display deformed mesh in wireframe, shading or shrink modes usung :
+~~~~~
+ MeshVS_DMF_DeformedPrsWireFrame
+ MeshVS_DMF_DeformedPrsShading
+ MeshVS_DMF_DeformedPrsShrink
+~~~~~
-Such an object, for example, can be used for displaying the object, stored in the STL file format:
-<h4>Example </h4>
+The following methods represent different kinds of data :
+~~~~~
+ MeshVS_DMF_VectorDataPrs
+ MeshVS_DMF_NodalColorDataPrs
+ MeshVS_DMF_ElementalColorDataPrs
+ MeshVS_DMF_TextDataPrs
+ MeshVS_DMF_EntitiesWithData
+~~~~~
+
+The following methods provide selection and highlighting :
+~~~~~
+ MeshVS_DMF_SelectionPrs
+ MeshVS_DMF_HilightPrs
+~~~~~
-**// read the data and create a data source**
-Handle (StlMesh_Mesh) aSTLMesh = RWStl::ReadFile (aFileName);
-Handle (XSDRAWSTLVRML_DataSource) aDataSource =
- new XSDRAWSTLVRML_DataSource (aSTLMesh);
+*MeshVS_DMF_User* is a user-defined mode.
-**// create mesh**
-Handle (MeshVS_Mesh) aMesh = new MeshVS();
-aMesh-SetDataSource (aDataSource);
+These values will be used by the presentation builder.
+There is also a set of selection modes flags that can be grouped in a combination of bits:
+ * *MeshVS_SMF_0D*
+ * *MeshVS_SMF_Link*
+ * *MeshVS_SMF_Face*
+ * *MeshVS_SMF_Volume*
+ * *MeshVS_SMF_Element* - groups *0D, Link, Face* and *Volume* as a bit mask ;
+ * *MeshVS_SMF_Node*
+ * *MeshVS_SMF_All* - groups *Element* and *Node* as a bit mask;
+ * *MeshVS_SMF_Mesh*
+ * *MeshVS_SMF_Group*
+
+Such an object, for example, can be used for displaying the object and stored in the STL file format:
-**// use default presentation builder**
-Handle (MeshVS_MeshPrsBuilder) aBuilder =
- new MeshVS_MeshPrsBuilder (aMesh);
-aMesh-AddBuilder (aBuilder, Standard_True);
+~~~~~
+// read the data and create a data source
+Handle (StlMesh_Mesh) aSTLMesh = RWStl::ReadFile (aFileName);
+Handle (XSDRAWSTLVRML_DataSource) aDataSource = new XSDRAWSTLVRML_DataSource (aSTLMesh);
-MeshVS_NodalColorPrsBuilder allows you to represent a mesh with a color scaled texture mapped on it. To do this you should define a color map for the color scale, pass this map to the presentation builder, and define an appropriate value in the range of 0.0 – 1.0 for every node.
-The following example demonstrates how you can do this (**please check,** if the view has been set up to display textures):
-<h4>Example </h4>
+// create mesh
+Handle (MeshVS_Mesh) aMesh = new MeshVS();
+aMesh-SetDataSource (aDataSource);
-**// assign nodal builder to the mesh**
-Handle (MeshVS_NodalColorPrsBuilder) aBuilder =
- new MeshVS_NodalColorPrsBuilder
- (aMesh,MeshVS_DMF_NodalColorDataPrs | MeshVS_DMF_OCCMask);
-aBuilder-UseTexture (Standard_True);
-
-**// prepare color map**
-Aspect_SequenceOfColor aColorMap;
-aColorMap.Append ((Quantity_NameOfColor) Quantity_NOC_RED);
-aColorMap.Append ((Quantity_NameOfColor) Quantity_NOC_BLUE1);
-
-**// assign color scale map values (0..1) to nodes**
-TColStd_DataMapOfIntegerReal aScaleMap;
-**…**
-** // iterate through the nodes and add an node id and an appropriate **
-** // value to the map**
- aScaleMap.Bind (anId, aValue);
-
-**// pass color map and color scale values to the builder**
-aBuilder-SetColorMap (aColorMap);
-aBuilder-SetInvalidColor (Quantity_NOC_BLACK);
-aBuilder-SetTextureCoords (aScaleMap);
-aMesh-AddBuilder (aBuilder, Standard_True);
+// use default presentation builder
+Handle (MeshVS_MeshPrsBuilder) aBuilder = new MeshVS_MeshPrsBuilder (aMesh);
+aMesh-AddBuilder (aBuilder, Standard_True);
+~~~~~
-@subsection occt_1621831385_810308609666 ANNEX II : Principles of Dynamic Selection
+*MeshVS_NodalColorPrsBuilder* allows representing a mesh with a color scaled texture mapped on it.
+To do this you should define a color map for the color scale, pass this map to the presentation builder,
+and define an appropriate value in the range of 0.0 – 1.0 for every node.
+The following example demonstrates how you can do this (check if the view has been set up to display textures):
+
+~~~~~
+// assign nodal builder to the mesh
+Handle (MeshVS_NodalColorPrsBuilder) aBuilder = new MeshVS_NodalColorPrsBuilder
+ (aMesh,MeshVS_DMF_NodalColorDataPrs | MeshVS_DMF_OCCMask);
+aBuilder-UseTexture (Standard_True);
+
+// prepare color map
+Aspect_SequenceOfColor aColorMap;
+aColorMap.Append ((Quantity_NameOfColor) Quantity_NOC_RED);
+aColorMap.Append ((Quantity_NameOfColor) Quantity_NOC_BLUE1);
+
+// assign color scale map values (0..1) to nodes
+TColStd_DataMapOfIntegerReal aScaleMap;
+…
+// iterate through the nodes and add an node id and an appropriate value to the map
+aScaleMap.Bind (anId, aValue);
+
+// pass color map and color scale values to the builder
+aBuilder-SetColorMap (aColorMap);
+aBuilder-SetInvalidColor (Quantity_NOC_BLACK);
+aBuilder-SetTextureCoords (aScaleMap);
+aMesh-AddBuilder (aBuilder, Standard_True);
+~~~~~
-The idea of dynamic selection is to represent the entities, which you want to select by a bounding box in the actual 2D space of the selection view. The set of these zones is ordered by a powerful sorting algorithm. To then find the applicative entities actually detected at this position, all you have to do is read which rectangles are touched at mouse position (X,Y) of the view, and judiciously reject some of the entities which have provided these rectangles.
+@subsection occt_visu_3_6 Dynamic Selection
+The idea of dynamic selection is to represent the entities, which you want to select by a bounding box in the actual 2D space of the selection view. The set of these zones is ordered by a powerful sorting algorithm.
+To then find the applicative entities actually detected at this position, all you have to do is read which rectangles are touched at mouse position (X,Y) of the view, and judiciously reject some of the entities which have provided these rectangles.
-@subsubsection occt_1621831385_81030860912222 How to go from the objects to 2D boxes
+@subsubsection occt_visu_3_6_1 How to go from the objects to 2D boxes
-An intermediary stage consists in representing what you can make selectable by means of sensitive primitives and owners, entities of a high enough level to be known by the selector mechanisms.
+An intermediary stage consists in representing what you can make selectable by means of sensitive primitives and owners, entities of a high enough level to be known by the selector mechanisms.
-The sensitive primitive is capable of:
+The sensitive primitive is capable of:
* giving a 2D bounding box to the selector.
- * answering the rejection criteria positively or negatively by a *Matches* function.
+ * answering the rejection criteria positively or negatively by a "Matches" function.
* being projected from 3D in the 2D space of the view if need be.
- * returning the owner which it will represent in terms of selection.
+ * returning the owner which it will represent in terms of selection.
-A set of standard sensitive primitives exists in Select3D packages for 3D primitives, and Select2D for 2D primitives.
+A set of standard sensitive primitives exists in Select3D packages for 3D primitives.
-The owner is the entity, which makes it possible to link the sensitive primitives and the objects that you really wanted to detect. It stocks the diverse information, which makes it possible to find objects. An owner has a priority (*5* by default), which you can modulate, so as to make one entity more selectable than another.
-@image html /user_guides/visualization/images/visualization_image021.png
-@image latex /user_guides/visualization/images/visualization_image021.png
+The owner is the entity, which makes it possible to link the sensitive primitives and the objects that you really wanted to detect. It stocks the diverse information, which makes it possible to find objects. An owner has a priority (*5* by default), which you can change to make one entity more selectable than another.
-@subsubsection occt_1621831385_81030860912341 Implementation in an interactive/selectable object
-
-1. Define the number of selection modes possible, i.e. what you want to identify by activating each of the selection modes. Example: for an interactive object representing a topological shape,
-mode 0: selection of the interactive object itself
-mode 1: selection of the vertices
-mode 2: selection of the edges
-mode 3: selection of the wires
-mode 4: selection of the faces detectable
+@image html visualization_image021.png
+@image latex visualization_image021.png
-2. For each selection mode of an interactive object, *model* the set of entities, which you want to locate by these primitives and these owners.
+@subsubsection occt_visu_3_6_2 Implementation in an interactive/selectable object
+
+Define the number of selection modes possible, i.e. what you want to identify by activating each of the selection modes.
-3. There exists an *owner* root class, *SelectMgr_EntityOwne*r, containing a reference to a selectable object, which has created it. If you want to stock its information, you have to create classes derived from this root class. Example: for shapes, there is the *StdSelect_BRepOwner *class, which can save a TopoDS shape as a field as well as the Interactive Object.
+For example: for an interactive object representing a topological shape:
+* mode 0: selection of the interactive object itself;
+* mode 1: selection of the vertices;
+* mode 2: selection of the edges;
+* mode 3: selection of the wires;
+* mode 4: selection of the detectable faces.
-4. The set of sensitive primitives which has been calculated for a given mode is stocked in *SelectMgr_Selection*.
+For each selection mode of an interactive object, "model" is the set of entities, which you want to locate by these primitives and these owners.
-5. For an Interactive object, the modeling is done in the *ComputeSelection *virtual function.
+There is an "owner" root class, *SelectMgr_EntityOwner*, containing a reference to a selectable object, which has created it. If you want to stock its information, you have to create classes derived from this root class. Example: for shapes, there is the *StdSelect_BRepOwner* class, which can save a *TopoDS* shape as a field as well as the Interactive Object.
-<h4>Example </h4>
+The set of sensitive primitives which has been calculated for a given mode is stocked in *SelectMgr_Selection*.
-Let an interactive object represent a box.
-We are interested in having 2 location modes:
- * mode 0: location of the whole box.
- * mode 1: location of the edges on the box.
+For an Interactive object, the modeling is done in the *ComputeSelection* virtual function.
- For the first mode, all sensitive primitives will have the same owner, which will represent the interactive object. In the second case, we have to create an owner for each edge, and this owner will have to contain the index for the edge, which it represents. You will create a class of owner, which derives from *SelectMgr_EntityOwner*.
+Let us consider an example of an interactive object representing a box.
-The *ComputeSelection* function for the interactive box can have the following form:
+We are interested in two location modes:
+ * mode 0: location of the whole box.
+ * mode 1: location of the edges on the box.
-void InteractiveBox::ComputeSelection
-(const Handle(SelectMgr_Selection)& Sel,
- const Standard_Integer Mode)
-{
-switch(Mode)
-{ case 0: //locating the whole box by making its faces sensitive...
-{
-Handle(SelectMgr_EntityOwner) Ownr = new
- SelectMgr_EntityOwner(this,5);
-for(Standard_Integer I=1;I=Nbfaces;I++)
-{
-//Array is a TColgp_Array1OfPnt: which represents the array of vertices. Sensitivity is
-Select3D_TypeOfSensitivity value
-Sel-Add(new
-Select3D_SensitiveFace(Ownr,Array,Sensitivity));
-}
-break;
- }
- case 1:
-// locates the edges { for(Standard_Integer i=1;i=12;i++)
-{
-// 1 owner per edge...
-Handle(mypk_EdgeOwner) Ownr =
-new mypk_EdgeOwner(this,i,6);
-//6-priority
-Sel-Add(new Select3D_SensitiveSegment
- (Ownr,firstpt(i),lastpt(i)));
-}
-break;
-}
-}
-}
+For the first mode, all sensitive primitives will have the same owner, which will represent the interactive object. In the second case, we have to create an owner for each edge, and this owner will have to contain the index for the edge, which it represents. You will create a class of owner, which derives from *SelectMgr_EntityOwner*.
+
+The *ComputeSelection* function for the interactive box can have the following form:
+~~~~~
+void InteractiveBox::ComputeSelection
+ (const Handle(SelectMgr_Selection)& Sel,
+ const Standard_Integer Mode)
+{
+ switch(Mode)
+ { case 0: //locating the whole box by making its faces sensitive...
+ {
+ Handle(SelectMgr_EntityOwner) Ownr = new SelectMgr_EntityOwner(this,5);
+ for(Standard_Integer I=1;I=Nbfaces;I++)
+ {
+ //Array is a TColgp_Array1OfPnt: which represents the array of vertices. Sensitivity is
+ Select3D_TypeOfSensitivity value
+ Sel-Add(new
+Select3D_SensitiveFace(Ownr,Array,Sensitivity));
+ }
+ break;
+ }
+ case 1:
+ // locates the edges {
+ for(Standard_Integer i=1;i=12;i++)
+ {
+ // 1 owner per edge...
+ Handle(mypk_EdgeOwner) Ownr =
+ new mypk_EdgeOwner(this,i,6);
+ //6-priority
+ Sel-Add(new Select3D_SensitiveSegment (Ownr,firstpt(i),lastpt(i)));
+ }
+ break;
+ }
+ }
+ }
+~~~~~
-@subsubsection occt_1621831385_81030860912432 How It Works Concretely
+Selectable objects are loaded in the selection manager, which has one or more selectors; in general, we suggest assigning one selector per viewer. All you have to do afterwards is to activate or deactivate the different selection modes for selectable objects. The *SelectionManager* looks after the call to the *ComputeSelection* functions for different objects.
-Selectable objects are loaded in the selection manager, which has one or more selectors; in general, we suggest assigning one selector per viewer. All you have to do afterwards is to activate or deactivate the different selection modes for selectable objects. The *SelectionManager* looks after the call to the *ComputeSelection* functions for different objects. NOTE: This procedure is completely hidden if you use the interactive contexts of AIS (see section 3.3, Contexts)
+NOTE: This procedure is completely hidden if you use the <a href="#occt_visu_3_3"> AIS Interactive Context </a>
<h4>Example </h4>
+~~~~~
+//We have several " interactive boxes " box1, box2, box3;
+ Handle(SelectMgr_SelectionManager) SM = new SelectMgr_SelectionManager();
+ Handle(StdSelect_ViewerSelector3d) VS = new StdSelect_ViewerSelector3d();
+ SM-Add(VS);
+ SM-Load(box1);SM-Load(box2);SM-Load(box3);
+ // box load.
+ SM-Activate(box1,0,VS);
+ // activates mode 0 of box 1 in the selector VS
+ SM-Activate(box1,1,VS);
+ M-Activate(box3,1,VS);
+VS-Pick(xpix,ypix,vue3d)
+// detection of primitives by mouse position.
+Handle(EntityOwner) POwnr = VS-OnePicked();
+// picking of the "best" owner detected
+for(VS-Init();VS-More();VS-Next())
+ {
+ VS-Picked();
+ // picking of all owners detected
+ }
+ SM-Deactivate(box1);
+ // deactivate all active modes of box1
+~~~~~
-//We have several * interactive boxes * box1, box2, box3;
+@section occt_visu_4 3D Presentations
-Handle(SelectMgr_SelectionManager) SM = new SelectMgr_SelectionManager();
-Handle(StdSelect_ViewerSelector3d) VS = new StdSelect_ViewerSelector3d();
+@subsection occt_visu_4_1 Glossary of 3D terms
-SM-Add(VS);
-SM-Load(box1);SM-Load(box2);SM-Load(box3);
-// box load.
-SM-Activate(box1,0,VS);
-// activates mode 0 of box 1 in the selector VS
-SM-Activate(box1,1,VS);
-M-Activate(box3,1,VS);
+* **Anti-aliasing** This mode attempts to improve the screen resolution by drawing lines and curves in a mixture of colors so that to the human eye the line or curve is smooth. The quality of the result is linked to the quality of the algorithm used by the workstation hardware.
+* **Depth-cueing** Reduces the color intensity for the portion of an object further away from the eye to give the impression of depth. This is used for wireframe objects. Shaded objects do not require this.
+* **Group** - a set of primitives and attributes on those primitives. Primitives and attributes may be added to a group but cannot be removed from a group, except by erasing them globally. A group can have a pick identity.
+* **Light** There are five kinds of light source - ambient, headlight, directional, positional and spot. The light is only activated in a shading context in a view.
+* **Primitive** - a drawable element. It has a definition in 3D space. Primitives can either be lines, faces, text, or markers. Once displayed markers and text remain the same size. Lines and faces can be modified e.g. zoomed. Primitives must be stored in a group.
+* **Structure** - manages a set of groups. The groups are mutually exclusive. A structure can be edited, adding or removing groups. A structure can reference other structures to form a hierarchy. It has a default (identity) transformation and other transformations may be applied to it (rotation, translation, scale, etc). It has no default attributes for the primitive lines, faces, markers, and text. Attributes may be set in a structure but they are overridden by the attributes in each group. Each structure has a display priority associated with it, which rules the order in which it is redrawn in a 3D viewer. If the visualization mode is incompatible with the view it is not displayed in that view, e.g. a shading-only object is not visualized in a wireframe view.
+* **View** - is defined by a view orientation, a view mapping, and a context view.
+* **Viewer** - manages a set of views.
+* **View orientation** - defines the manner in which the observer looks at the scene in terms of View Reference Coordinates.
+* **View mapping** - defines the transformation from View Reference Coordinates to the Normalized Projection Coordinates. This follows the Phigs scheme.
+* **Z-Buffering** -= a form of hidden surface removal in shading mode only. This is always active for a view in the shading mode. It cannot be suppressed.
-VS-Pick(xpix,ypix,vue3d)
-// detection of primitives by mouse position.
+@subsection occt_visu_4_2 Creating a 3D scene
-Handle(EntityOwner) POwnr = VS-OnePicked();
-// picking of the *best* owner detected
+To create 3D graphic objects and display them on the screen, follow the procedure below:
+1. Create attributes.
+2. Create a 3D viewer..
+3. Create a view.
+4. Create an interactive context.
+5. Create interactive objects.
+6. Create primitives in the interactive object
+7. Display the interactive object.
-for(VS-Init();VS-More();VS-Next())
-{
-VS-Picked();
-// picking of all owners detected
- }
-SM-Deactivate(box1);
-// deactivate all active modes of box1
+@subsubsection occt_visu_4_2_1 Create attributes
-@image html /user_guides/visualization/images/visualization_image022.png
-@image latex /user_guides/visualization/images/visualization_image022.png
-1st activation of the box’s mode 1: calculation of sensitive primitives + 3D/2D projection + sorting
+Create colors.
-deactivation of mode: only updated by sorting
+~~~~~
+Quantity_Color Black (Quantity_NOC_BLACK);
+Quantity_Color Blue (Quantity_NOC_MATRABLUE);
+Quantity_Color Brown (Quantity_NOC_BROWN4);
+Quantity_Color Firebrick (Quantity_NOC_FIREBRICK);
+Quantity_Color Forest (Quantity_NOC_FORESTGREEN);
+Quantity_Color Gray (Quantity_NOC_GRAY70);
+Quantity_Color MyColor (0.99, 0.65, 0.31, Quantity_TOC_RGB);
+Quantity_Color Beet (Quantity_NOC_BEET);
+Quantity_Color White (Quantity_NOC_WHITE);
+~~~~~
-rotation of the view: only projection + sorting of active primitives
-modification of the box - Recalculation of the active selection, recalculation flag on the inactive ones + 3D/2D projection + sorting
+Create line attributes.
-@section occt_1621831385_1539918866 3D Presentations
+~~~~~
+Handle(Graphic3d_AspectLine3d) CTXLBROWN = new Graphic3d_AspectLine3d ();
+Handle(Graphic3d_AspectLine3d) CTXLBLUE = new Graphic3d_AspectLine3d ();
+Handle(Graphic3d_AspectLine3d) CTXLWHITE = new Graphic3d_AspectLine3d();
+ CTXLBROWN-SetColor (Brown);
+ CTXLBLUE-SetColor (Blue);
+ CTXLWHITE-SetColor (White);
+~~~~~
-@subsection occt_1621831385_15399188661 Glossary of 3D terms
+Create marker attributes.
+~~~~~
+Handle(Graphic3d_AspectMarker3d) CTXMFIREBRICK = new Graphic3d_AspectMarker3d();
+ CTXMFIREBRICK-SetColor (Firebrick);
+ CTXMFIREBRICK-SetScale (1.0);
+ CTXMFIREBRICK-SetType (Aspect_TOM_BALL);
+~~~~~
-@subsubsection occt_1621831385_153991886611 From Graphic3d
+Create facet attributes.
+~~~~~
+Handle(Graphic3d_AspectFillArea3d) CTXF = new Graphic3d_AspectFillArea3d ();
+Graphic3d_MaterialAspect BrassMaterial (Graphic3d_NOM_BRASS);
+Graphic3d_MaterialAspect GoldMaterial (Graphic3d_NOM_GOLD);
+ CTXF-SetInteriorStyle (Aspect_IS_SOLID);
+ CTXF-SetInteriorColor (MyColor);
+ CTXF-SetDistinguishOn ();
+ CTXF-SetFrontMaterial (GoldMaterial);
+ CTXF-SetBackMaterial (BrassMaterial);
+ CTXF-SetEdgeOn ();
+~~~~~
+Create text attributes.
+~~~~~
+Handle(Graphic3d_AspectText3d) CTXT = new Graphic3d_AspectText3d (Forest, Graphic3d_NOF_ASCII_MONO, 1., 0.);
+~~~~~
+@subsubsection occt_visu_4_2_2 Create a 3D Viewer (a Windows example)
-@subsubsection occt_1621831385_153991886612 From V3d
+~~~~~
+Handle(Aspect_DisplayConnection) aDisplayConnection;
+Handle(Graphic3d_GraphicDriver) aGraphicDriver = Graphic3d::InitGraphicDriver (aDisplayConnection);
+TCollection_ExtendedString aName("3DV");
+myViewer = new V3d_Viewer (aGraphicDriver,aName.ToExtString (), "");
+myViewer - SetDefaultLights ();
+myViewer - SetLightOn ();
+~~~~~
+@subsubsection occt_visu_4_2_3 Create a 3D view (a Windows example)
-** **
+It is assumed that a valid Windows window may already be accessed via the method *GetSafeHwnd()*.
+~~~~~
+Handle (WNT_Window) aWNTWindow;
+aWNTWindow = new WNT_Window (GetSafeHwnd());
+myView = myViewer -> CreateView();
+myView -> SetWindow (a WNTWindow);
+~~~~~
+@subsubsection occt_visu_4_2_4 Create an interactive context
-@subsection occt_1621831385_15399188662 Creating a 3D scene
+~~~~~
+myAISContext = new AIS_InteractiveContext (myViewer);
+~~~~~
-To create 3D graphic objects and display them on the screen, follow the procedure below:
-**1. **Create attributes.
-**2. **Create a 3D viewer..
-**3. **Create a view.
-**4. **Create an interactive context.
-**5. **Create interactive objects.
-**6. **Create primitives in the interactive object
-**7. **Display the interactive object.
+You are now able to display interactive objects such as an *AIS_Shape*.
-@subsubsection occt_1621831385_153991886621 Create attributes
+~~~~~
+TopoDS_Shape aShape = BRepAPI_MakeBox(10,20,30)_Solid();
+Handle (AIS_Shape) aAISShape = new AIS_Shape(aShape);
+myAISContext - Display (aAISShape);
+~~~~~
-Create colors.
-<h4>Example </h4>
+@subsubsection occt_visu_4_2_5 Create your own interactive object
-Quantity_Color Black (Quantity_NOC_BLACK);
-Quantity_Color Blue (Quantity_NOC_MATRABLUE);
-Quantity_Color Brown (Quantity_NOC_BROWN4);
-Quantity_Color Firebrick (Quantity_NOC_FIREBRICK);
-Quantity_Color Forest (Quantity_NOC_FORESTGREEN);
-Quantity_Color Gray (Quantity_NOC_GRAY70);
-Quantity_Color
-MyColor (0.99, 0.65, 0.31, Quantity_TOC_RGB);
-Quantity_Color Beet (Quantity_NOC_BEET);
-Quantity_Color White (Quantity_NOC_WHITE);
+Follow the procedure below to compute the presentable object:
+1. Build a presentable object inheriting from *AIS_InteractiveObject* (refer to the Chapter on Presentable Objects).
+2. Reuse the *Prs3d_Presentation* provided as an argument of the compute methods.
+**Note** that there are two compute methods: one for a standard representation, and the other for a degenerated representation, i.e. in hidden line removal and wireframe modes.
-Create line attributes.
-<h4>Example </h4>
+Let us look at the example of compute methods
-Handle(Graphic3d_AspectLine3d) CTXLBROWN =
-new Graphic3d_AspectLine3d ();
-Handle(Graphic3d_AspectLine3d) CTXLBLUE =
-new Graphic3d_AspectLine3d ();
-Handle(Graphic3d_AspectLine3d) CTXLWHITE =
-new Graphic3d_AspectLine3d();
-CTXLBROWN-SetColor (Brown);
-CTXLBLUE-SetColor (Blue);
-CTXLWHITE-SetColor (White);
+~~~~~
+Void
+myPresentableObject::Compute
+ (const Handle(PrsMgr_PresentationManager3d)&
+ aPresentationManager,
+ const Handle(Prs3d_Presentation)& aPrs,
+ const Standard_Integer aMode)
+(
+//...
+)
+void
+myPresentableObject::Compute
+ (const Handle(Prs3d_Projector)&,
+ const Handle(Prs3d_Presentation)& aPrs)
+(
+//...
+)
+~~~~~
-Create marker attributes.
-<h4>Example </h4>
+@subsubsection occt_visu_4_2_6 Create primitives in the interactive object
-Handle(Graphic3d_AspectMarker3d) CTXMFIREBRICK =
-new Graphic3d_AspectMarker3d();
-CTXMFIREBRICK-SetColor (Firebrick);
-CTXMFIREBRICK-SetScale (1.0);
-CTXMFIREBRICK-SetType (Aspect_TOM_BALL);
+Get the group used in *Prs3d_Presentation*.
+~~~~~
+Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPrs);
+~~~~~
-Create facet attributes.
-<h4>Example </h4>
-
-Handle(Graphic3d_AspectFillArea3d) CTXF =
-new Graphic3d_AspectFillArea3d ();
-Graphic3d_MaterialAspect BrassMaterial
-(Graphic3d_NOM_BRASS);
-Graphic3d_MaterialAspect GoldMaterial
-(Graphic3d_NOM_GOLD);
-CTXF-SetInteriorStyle (Aspect_IS_SOLID);
-CTXF-SetInteriorColor (MyColor);
-CTXF-SetDistinguishOn ();
-CTXF-SetFrontMaterial (GoldMaterial);
-CTXF-SetBackMaterial (BrassMaterial);
-CTXF-SetEdgeOn ();
-
-
-Create text attributes.
-<h4>Example </h4>
-
-Handle(Graphic3d_AspectText3d) CTXT =
-new Graphic3d_AspectText3d
-(Forest, Graphic3d_NOF_ASCII_MONO, 1., 0.);
-
-@subsubsection occt_1621831385_153991886622 Create a 3D Viewer (a Windows example)
-<h4>Example </h4>
-
-Handle(Graphic3d_WNTGraphicDevice) TheGraphicDevice = ...;
-TCollection_ExtendedString aName(*3DV*);
-myViewer =
-new V3d_Viewer (TheGraphicDevice,aName.ToExtString (), **);
-myViewer - SetDefaultLights ();
-myViewer - SetLightOn ();
-@subsubsection occt_1621831385_153991886623 Create a 3D view (a Windows example)
-
-It is assumed that a valid Windows window may already be accessed via the method GetSafeHwnd().
-<h4>Example </h4>
-
-
-
-@subsubsection occt_1621831385_153991886624 Create an interactive context
-<h4>Example </h4>
-
-myAISContext = new AIS_InteractiveContext (myViewer);
-
-
-You are now able to display interactive objects such as an AIS_Shape.
-<h4>Example </h4>
-
-TopoDS_Shape aShape = BRepAPI_MakeBox(10,20,30)_Solid();
-Handle (AIS_Shape) aAISShape = new AIS_Shape(aShape);
-myAISContext - Display (aAISShape);
-
-@subsubsection occt_1621831385_153991886625 Create your own interactive object
-
-Follow the procedure below to compute the presentable object:
-
-**1. **Build a presentable object inheriting from AIS_InteractiveObject (refer to the Chapter on Presentable Objects).
-
-**2. **Reuse the Prs3d_Presentation provided as an argument of the compute methods.
-
-*NOTE*
-*There are two compute methods: one for a ‘standard representation, and the other for a ‘degenerated representation, i.e. in hidden line removal and wireframe modes.*
-<h4>Example of the compute methods</h4>
-
-Void
-myPresentableObject::Compute
-(const Handle(PrsMgr_PresentationManager3d)&
-aPresentationManager,
-const Handle(Prs3d_Presentation)& aPrs,
-const Standard_Integer aMode)
-(
-//...
-)
-
-
-
-void
-myPresentableObject::Compute
-(const Handle(Prs3d_Projector)&,
-const Handle(Prs3d_Presentation)& aPrs)
-(
-//...
-)
-
-
-@subsubsection occt_1621831385_153991886626 Create primitives in the interactive object
-
-Get the group used in Prs3d_Presentation.
-<h4>Example </h4>
-
-Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPrs);
-
-
-Update the group attributes.
-
-<h4>Example </h4>
-
-TheGroup - SetPrimitivesAspect(CTXLBLUE);
+Update the group attributes.
+~~~~~
+TheGroup - SetPrimitivesAspect(CTXLBLUE);
+~~~~~
-Create two triangles in group TheGroup.
-<h4>Example </h4>
+Create two triangles in *TheGroup*.
+~~~~~
Standard_Integer aNbTria = 2;
-Handle(Graphic3d_ArrayOfTriangles) aTriangles = new Graphic3d_ArrayOfTriangles(3 * aNbTria, 0, Standard_True);
+Handle(Graphic3d_ArrayOfTriangles) aTriangles = new Graphic3d_ArrayOfTriangles(3 * aNbTria, 0, Standard_True);
Standard_Integer anIndex;
for (anIndex = 1; anIndex = aNbTria; nt++)
{
- aTriangles-AddVertex(anIndex * 5., 0., 0., 1., 1., 1.);
- aTriangles-AddVertex(anIndex * 5 + 5, 0., 0., 1., 1., 1.);
- aTriangles-AddVertex(anIndex * 5 + 2.5, 5., 0., 1., 1., 1.);
+ aTriangles-AddVertex(anIndex * 5., 0., 0., 1., 1., 1.);
+ aTriangles-AddVertex(anIndex * 5 + 5, 0., 0., 1., 1., 1.);
+ aTriangles-AddVertex(anIndex * 5 + 2.5, 5., 0., 1., 1., 1.);
}
TheGroup-BeginPrimitives ();
mygroup-AddPrimitiveArray(aTriangles);
TheGroup-EndPrimitives ();
+~~~~~
+The *BeginPrimitives()* and *EndPrimitives()* methods are used when creating a set of various primitives in the same group.
+Use the polyline function to create a boundary box for the *Struct* structure in group *TheGroup*.
-The BeginPrimitives () and EndPrimitives () methods are used when creating a set of various primitives in the same group.
-Use the polyline function to create a boundary box for the Struct structure in group TheGroup.
-<h4>Example </h4>
-
-Standard_Real Xm, Ym, Zm, XM, YM, ZM;
-Struct-MinMaxValues (Xm, Ym, Zm, XM, YM, ZM);
+~~~~~
+Standard_Real Xm, Ym, Zm, XM, YM, ZM;
+Struct-MinMaxValues (Xm, Ym, Zm, XM, YM, ZM);
-Handle(Graphic3d_ArrayOfPolylines) aPolylines = new Graphic3d_ArrayOfPolylines(16, 4);
+Handle(Graphic3d_ArrayOfPolylines) aPolylines = new Graphic3d_ArrayOfPolylines(16, 4);
aPolylines-AddBound (4);
-aPolylines-AddVertex (Xm, Ym, Zm);
-aPolylines-AddVertex (Xm, Ym, ZM);
-aPolylines-AddVertex (Xm, YM, ZM);
-aPolylines-AddVertex (Xm, YM, Zm);
+aPolylines-AddVertex (Xm, Ym, Zm);
+aPolylines-AddVertex (Xm, Ym, ZM);
+aPolylines-AddVertex (Xm, YM, ZM);
+aPolylines-AddVertex (Xm, YM, Zm);
aPolylines-AddBound (4);
-aPolylines-AddVertex (Xm, Ym, Zm);
-aPolylines-AddVertex (XM, Ym, Zm);
-aPolylines-AddVertex (XM, Ym, ZM);
-aPolylines-AddVertex (XM, YM, ZM);
+aPolylines-AddVertex (Xm, Ym, Zm);
+aPolylines-AddVertex (XM, Ym, Zm);
+aPolylines-AddVertex (XM, Ym, ZM);
+aPolylines-AddVertex (XM, YM, ZM);
aPolylines-AddBound (4);
-aPolylines-AddVertex (XM, YM, Zm);
-aPolylines-AddVertex (XM, Ym, Zm);
-aPolylines-AddVertex (XM, YM, Zm);
-aPolylines-AddVertex (Xm, YM, Zm);
+aPolylines-AddVertex (XM, YM, Zm);
+aPolylines-AddVertex (XM, Ym, Zm);
+aPolylines-AddVertex (XM, YM, Zm);
+aPolylines-AddVertex (Xm, YM, Zm);
aPolylines-AddBound (4);
-aPolylines-AddVertex (Xm, YM, ZM);
-aPolylines-AddVertex (XM, YM, ZM);
-aPolylines-AddVertex (XM, Ym, ZM);
-aPolylines-AddVertex (Xm, Ym, ZM);
+aPolylines-AddVertex (Xm, YM, ZM);
+aPolylines-AddVertex (XM, YM, ZM);
+aPolylines-AddVertex (XM, Ym, ZM);
+aPolylines-AddVertex (Xm, Ym, ZM);
-TheGroup-BeginPrimitives ();
+TheGroup-BeginPrimitives ();
TheGroup-AddPrimitiveArray(aPolylines);
-TheGroup-EndPrimitives ();
-
+TheGroup-EndPrimitives ();
+~~~~~
-Create text and markers in group TheGroup.
-<h4>Example </h4>
+Create text and markers in group *TheGroup*.
-static char *texte[3] = { *Application title*,
-*My company*,
-*My company address.* };
-Graphic3d_Array1OfVertex Tpts8 (0, 1);
-Tpts8(0).SetCoord (-40.0, -40.0, -40.0);
-Tpts8(1).SetCoord (40.0, 40.0, 40.0);
-TheGroup-MarkerSet (Tpts8);
-Graphic3d_Vertex Marker (0.0, 0.0, 0.0);
-
-for (i=0; i=2; i++) {
- Marker.SetCoord (-(Standard_Real)i*4 + 30,
- (Standard_Real)i*4,
- -(Standard_Real)i*4);
- TheGroup-Text (texte[i], Marker, 20.);
-}
+~~~~~
+static char *texte[3] = { "Application title",
+ "My company",
+ "My company address." };
+Graphic3d_Array1OfVertex Tpts8 (0, 1);
+Tpts8(0).SetCoord (-40.0, -40.0, -40.0);
+Tpts8(1).SetCoord (40.0, 40.0, 40.0);
+TheGroup-MarkerSet (Tpts8);
+Graphic3d_Vertex Marker (0.0, 0.0, 0.0);
+
+for (i=0; i=2; i++) {
+ Marker.SetCoord (-(Standard_Real)i*4 + 30,
+ (Standard_Real)i*4,
+ -(Standard_Real)i*4);
+ TheGroup-Text (texte[i], Marker, 20.);
+}
+~~~~~
-@section occt_1621831385_1435012457 3D Resources
+@section occt_visu_5 3D Resources
-The 3D resources include the Graphic3d and V3d packages.
+The 3D resources include the *Graphic3d* and *V3d* packages.
-@subsection occt_1621831385_14350124571 Graphic3D
+@subsection occt_visu_5_1 Graphic3D Package
-@subsubsection occt_1621831385_143501245711 Overview
+@subsubsection occt_visu_5_1_1 Overview
-The **Graphic3d** package is used to create 3D graphic objects in a 3D viewer. These objects called **structures** are made up of groups of primitives and attributes. A group is the smallest editable element of a structure. A transformation can be applied to a structure. Structures can be connected to form a tree of structures, composed by transformations. Structures are globally manipulated by the viewer.
+The *Graphic3d* package is used to create 3D graphic objects in a 3D viewer. These objects called **structures** are made up of groups of primitives and attributes. A group is the smallest editable element of a structure. A transformation can be applied to a structure. Structures can be connected to form a tree of structures, composed by transformations. Structures are globally manipulated by the viewer.
-@subsubsection occt_1621831385_143501245712 Provided services
+@subsubsection occt_visu_5_1_2 Provided services
-Graphic structures can be:
+Graphic structures can be:
* Displayed,
* Highlighted,
* Erased,
* Transformed,
* Connected to form a tree.
- There are classes for:
+
+There are classes for:
* Visual attributes for lines, faces, markers, text, materials,
* Vectors and vertices,
- * Defining an Advanced Graphic Device,
* Graphic objects, groups, and structures.
-@subsubsection occt_1621831385_143501245713 About the primitives
-** **
-** **Markers** **
+@subsubsection occt_visu_5_1_3 About the primitives
+
+* **Markers**
* Have one or more vertices,
* Have a type, a scale factor, and a color,
- * Have a size, shape, and orientation independent of transformations.
-*Polygons *
+ * Have a size, shape, and orientation independent of transformations.
+* **Polygons**
* Have one closed boundary,
* Have at least three vertices,
* Are planar and have a normal,
- * Have interior attributes - style, color, front and back material, texture and reflection ratio,
- * Have a boundary with the following attributes - type, width scale factor, color. The boundary is only drawn when the interior style is hollow.
+ * Have interior attributes - style, color, front and back material, texture and reflection ratio,
+ * Have a boundary with the following attributes - type, width scale factor, color. The boundary is only drawn when the interior style is hollow.
-*Polygons with holes *
- * Have multiple closed boundaries, each one with at least three vertices,
+* **Polygons with holes**
+ * Have multiple closed boundaries, each one with at least three vertices,
* Are planar and have a normal,
- * Have interior attributes - style, color, front and back material,
- * Have a boundary with the following attributes - type, width scale factor, color. The boundary is only drawn when the interior style is hollow.
+ * Have interior attributes - style, color, front and back material,
+ * Have a boundary with the following attributes - type, width scale factor, color. The boundary is only drawn when the interior style is hollow.
-*Polylines *
+* **Polylines**
* Have two or more vertices,
* Have the following attributes - type, width scale factor, color.
-*Text *
+* **Text**
* Has geometric and non-geometric attributes,
- * Geometric attributes - character height, character up vector, text path, horizontal and vertical alignment, orientation, three-dimensional position, zoomable flag
- * Non-geometric attributes - text font, character spacing, character expansion factor, color.
+ * Geometric attributes - character height, character up vector, text path, horizontal and vertical alignment, orientation, three-dimensional position, zoomable flag
+ * Non-geometric attributes - text font, character spacing, character expansion factor, color.
-@subsubsection occt_1621831385_143501245714 Primitive arrays
+@subsubsection occt_visu_5_1_4 Primitive arrays
-Primitive arrays are a more efficient approach to describe and display the primitives from the aspects of memory usage and graphical performance. The key feature of the primitive arrays is that the primitive data is not duplicated. For example, two polygons could share the same vertices, so it is more efficient to keep the vertices in a single array and specify the polygon vertices with indices of this array. In addition to such kind of memory savings, the OpenGl graphics driver provides the Vertex Buffer Objects (VBO). VBO is a sort of video memory storage that can be allocated to hold the primitive arrays, thus making the display operations more efficient and releasing the RAM memory.
+Primitive arrays are a more efficient approach to describe and display the primitives from the aspects of memory usage and graphical performance. The key feature of the primitive arrays is that the primitive data is not duplicated. For example, two polygons could share the same vertices, so it is more efficient to keep the vertices in a single array and specify the polygon vertices with indices of this array. In addition to such kind of memory savings, the OpenGl graphics driver provides the Vertex Buffer Objects (VBO). VBO is a sort of video memory storage that can be allocated to hold the primitive arrays, thus making the display operations more efficient and releasing the RAM memory.
-The Vertex Buffer Objects are enabled by default, but VBOs availability depends on the implementation of OpenGl. If the VBOs are unavailable or there is not enough video memory to store the primitive arrays, the RAM memory will be used to store the arrays.
+The Vertex Buffer Objects are enabled by default, but VBOs availability depends on the implementation of OpenGl. If the VBOs are unavailable or there is not enough video memory to store the primitive arrays, the RAM memory will be used to store the arrays.
-The Vertex Buffer Objects can be disabled at the application level. You can use the following method to enable/disable VBOs:
- * void Graphic3d_GraphicDriver::EnableVBO
- (const Standard_Boolean status)
+The Vertex Buffer Objects can be disabled at the application level. You can use the method *Graphic3d_GraphicDriver::EnableVBO (const Standard_Boolean status)* to enable/disable VBOs:
+
+The following example shows how to disable the VBO support:
-The following example shows how to disable the VBO support:
-<h4>Example </h4>
+~~~~~
+*// get the graphic driver*
+Handle (Graphic3d_GraphicDriver) aDriver =
+ myAISContext-CurrentViewer()-Driver();
-**// get the graphic driver**
-Handle (Aspect_GraphicDriver) aDriver =
- myAISContext-CurrentViewer()-Device()-GraphicDriver();
-
-**// disable VBO support**
-Handle (Graphic3d_GraphicDriver)::
- DownCast (aDriver)-EnableVBO (Standard_False);
-
-**Please note** that the use of Vertex Buffer Objects requires the application level primitive data provided by the Graphic3d_ArrayOfPrimitives to be transferred to the video memory. TKOpenGl transfers the data and releases the Graphic3d_ArrayOfPrimitives internal pointers to the primitive data. Thus it might be necessary to pay attention to such kind of behaviour, as the pointers could be modified (nullified) by the TKOpenGl.
-
-The different types of primitives could be presented with the following primitive arrays:
- * Graphic3d_ArrayOfPoints,
- * Graphic3d_ArrayOfPolygons,
- * Graphic3d_ArrayOfPolylines,
- * Graphic3d_ArrayOfQuadrangles,
- * Graphic3d_ArrayOfQuadrangleStrips,
- * Graphic3d_ArrayOfSegments,
- * Graphic3d_ArrayOfTriangleFans,
- * Graphic3d_ArrayOfTriangles,
- * Graphic3d_ArrayOfTriangleStrips.
-
-The Graphic3d_ArrayOfPrimitives is a base class for these primitive arrays.
-
-There is a set of similar methods to add vertices to the primitive array:
- * Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex
-
-These methods take vertex coordinates as an argument and allow you to define the color, the normal and the texture coordinates assigned to the vertex. The return value is the actual number of vertices in the array.
-
-You can also modify the values assigned to the vertex or query these values by the vertex index:
- * void Graphic3d_ArrayOfPrimitives::SetVertice
- * void Graphic3d_ArrayOfPrimitives::SetVertexColor
- * void Graphic3d_ArrayOfPrimitives::SetVertexNormal
- * void Graphic3d_ArrayOfPrimitives::SetVertexTexel
- * gp_Pnt Graphic3d_ArrayOfPrimitives::Verticie
- * gp_Dir Graphic3d_ArrayOfPrimitives::VertexNormal
- * gp_Pnt2d Graphic3d_ArrayOfPrimitives::VertexTexel
- * Quantity_Color Graphic3d_ArrayOfPrimitives::VertexColor
- * void Graphic3d_ArrayOfPrimitives::Verticie
- * void Graphic3d_ArrayOfPrimitives::VertexNormal
- * void Graphic3d_ArrayOfPrimitives::VertexTexel
- * void Graphic3d_ArrayOfPrimitives::VertexColor
-
-The following example shows how to define an array of points:
-<h4>Example </h4>
+*// disable VBO support*
+aDriver-EnableVBO (Standard_False);
+~~~~~
-**// create an array**
-Handle (Graphic3d_ArrayOfPoints) anArray =
- new Graphic3d_ArrayOfPoints (aVerticiesMaxCount);
+**Note** that the use of Vertex Buffer Objects requires the application level primitive data provided by the *Graphic3d_ArrayOfPrimitives* to be transferred to the video memory. *TKOpenGl* transfers the data and releases the *Graphic3d_ArrayOfPrimitives* internal pointers to the primitive data. Thus it might be necessary to pay attention to such kind of behaviour, as the pointers could be modified (nullified) by the *TKOpenGl*.
+
+The different types of primitives could be presented with the following primitive arrays:
+ * *Graphic3d_ArrayOfPoints,*
+ * *Graphic3d_ArrayOfPolygons,*
+ * *Graphic3d_ArrayOfPolylines,*
+ * *Graphic3d_ArrayOfQuadrangles,*
+ * *Graphic3d_ArrayOfQuadrangleStrips,*
+ * *Graphic3d_ArrayOfSegments,*
+ * *Graphic3d_ArrayOfTriangleFans,*
+ * *Graphic3d_ArrayOfTriangles,*
+ * *Graphic3d_ArrayOfTriangleStrips.*
+
+The *Graphic3d_ArrayOfPrimitives* is a base class for these primitive arrays.
+
+Method *Graphic3d_ArrayOfPrimitives::AddVertex* allows adding There is a set of similar methods to add vertices to the primitive array.
+
+These methods take vertex coordinates as an argument and allow you to define the color, the normal and the texture coordinates assigned to the vertex. The return value is the actual number of vertices in the array.
+
+You can also modify the values assigned to the vertex or query these values by the vertex index:
+ * *void Graphic3d_ArrayOfPrimitives::SetVertice*
+ * *void Graphic3d_ArrayOfPrimitives::SetVertexColor*
+ * *void Graphic3d_ArrayOfPrimitives::SetVertexNormal*
+ * *void Graphic3d_ArrayOfPrimitives::SetVertexTexel*
+ * *gp_Pnt Graphic3d_ArrayOfPrimitives::Vertices*
+ * *gp_Dir Graphic3d_ArrayOfPrimitives::VertexNormal*
+ * *gp_Pnt3d Graphic3d_ArrayOfPrimitives::VertexTexel*
+ * *Quantity_Color Graphic3d_ArrayOfPrimitives::VertexColor*
+ * *void Graphic3d_ArrayOfPrimitives::Vertices*
+ * *void Graphic3d_ArrayOfPrimitives::VertexNormal*
+ * *void Graphic3d_ArrayOfPrimitives::VertexTexel*
+ * *void Graphic3d_ArrayOfPrimitives::VertexColor*
+
+The following example shows how to define an array of points:
-**// add vertices to the array**
-anArray-AddVertex (10.0, 10.0, 10.0);
-anArray-AddVertex (0.0, 10.0, 10.0);
+~~~~~
+// create an array
+Handle (Graphic3d_ArrayOfPoints) anArray = new Graphic3d_ArrayOfPoints (aVerticiesMaxCount);
+
+// add vertices to the array
+anArray-AddVertex (10.0, 10.0, 10.0);
+anArray-AddVertex (0.0, 10.0, 10.0);
-**// add the array to the structure **
-Handle (Graphic3d_Group) aGroup =
- Prs3d_Root::CurrentGroup (aPrs);
+// add the array to the structure
+Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPrs);
aGroup-BeginPrimitives ();
aGroup-AddPrimitiveArray (anArray);
aGroup-EndPrimitives ();
+~~~~~
-If the primitives share the same vertices (polygons, triangles, etc) then you can define them as indices of the vertices array. The following method allows you to define the primitives by the indices:
- * Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge
+If the primitives share the same vertices (polygons, triangles, etc.) then you can define them as indices of the vertices array.
-This method adds an *edge* in the range [1, VertexNumber() ] in the array.
-It is also possible to query the vertex defined by an edge:
- * Standard_Integer Graphic3d_ArrayOfPrimitives::Edge
+The method *Graphic3d_ArrayOfPrimitives::AddEdge* allows defining the primitives by indices. This method adds an "edge" in the range <i> [1, VertexNumber() ] </i> in the array.
-The following example shows how to define an array of triangles:
-<h4>Example </h4>
+It is also possible to query the vertex defined by an edge using method *Graphic3d_ArrayOfPrimitives::Edge*
-**// create an array**
-Standard_Boolean IsNormals = Standard_False;
-Standard_Boolean IsColors = Standard_False;
-Standard_Boolean IsTextureCrds = Standard_False;
-Handle (Graphic3d_ArrayOfTriangles) anArray =
- new Graphic3d_ArrayOfTriangles (aVerticesMaxCount,
- aEdgesMaxCount,
- IsNormals,
- IsColors,
- IsTextureCrds);
-**// add vertices to the array**
-anArray-AddVertex (-1.0, 0.0, 0.0); **// vertex 1**
-anArray-AddVertex ( 1.0, 0.0, 0.0); **// vertex 2**
-anArray-AddVertex ( 0.0, 1.0, 0.0); **// vertex 3**
-anArray-AddVertex ( 0.0,-1.0, 0.0); **// vertex 4**
-
-**// add edges to the array**
-anArray-AddEdge (1); **// first triangle**
-anArray-AddEdge (2);
-anArray-AddEdge (3);
-anArray-AddEdge (1); **// second triangle**
-anArray-AddEdge (2);
-anArray-AddEdge (4);
-
-**// add the array to the structure**
-Handle (Graphic3d_Group) aGroup =
- Prs3d_Root::CurrentGroup (aPrs);
-aGroup-BeginPrimitives ();
-aGroup-AddPrimitiveArray (anArray);
-aGroup-EndPrimitives ();
+The following example shows how to define an array of triangles:
-If the primitive array presents primitives built from sequential sets of vertices, for example polygons, then you can specify the bounds, or the number of vertices for each primitive. You can use the following method to define the bounds and the color for each bound:
- * Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound
+~~~~~
+// create an array
+Standard_Boolean IsNormals = Standard_False;
+Standard_Boolean IsColors = Standard_False;
+Standard_Boolean IsTextureCrds = Standard_False;
+Handle (Graphic3d_ArrayOfTriangles) anArray =
+ new Graphic3d_ArrayOfTriangles (aVerticesMaxCount,
+ aEdgesMaxCount,
+ IsNormals,
+ IsColors,
+ IsTextureCrds);
+// add vertices to the array
+anArray-AddVertex (-1.0, 0.0, 0.0); // vertex 1
+anArray-AddVertex ( 1.0, 0.0, 0.0); // vertex 2
+anArray-AddVertex ( 0.0, 1.0, 0.0); // vertex 3
+anArray-AddVertex ( 0.0,-1.0, 0.0); // vertex 4
+
+// add edges to the array
+anArray-AddEdge (1); // first triangle
+anArray-AddEdge (2);
+anArray-AddEdge (3);
+anArray-AddEdge (1); // second triangle
+anArray-AddEdge (2);
+anArray-AddEdge (4);
+
+// add the array to the structure
+Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPrs);
+aGroup-BeginPrimitives ();
+aGroup-AddPrimitiveArray (anArray);
+aGroup-EndPrimitives ();
+~~~~~
-This method returns the actual number of bounds.
-It is also possible to set the color and query the number of edges in the bound and bound color:
- * Standard_Integer Graphic3d_ArrayOfPrimitives::Bound
- * Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor
- * void Graphic3d_ArrayOfPrimitives::BoundColor
+If the primitive array presents primitives built from sequential sets of vertices, for example polygons, then you can specify the bounds, or the number of vertices for each primitive. You can use the method *Graphic3d_ArrayOfPrimitives::AddBound* to define the bounds and the color for each bound. This method returns the actual number of bounds.
-The following example shows how to define an array of polygons:
-<h4>Example </h4>
+It is also possible to set the color and query the number of edges in the bound and bound color.
+~~~~~
+ Standard_Integer Graphic3d_ArrayOfPrimitives::Bound
+ Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor
+ void Graphic3d_ArrayOfPrimitives::BoundColor
+~~~~~
+
+The following example shows how to define an array of polygons:
-**// create an array**
-Standard_Boolean IsNormals = Standard_False;
-Standard_Boolean IsVertexColors = Standard_False;
-Standard_Boolean IsFaceColors = Standard_False;
-Standard_Boolean IsTextureCrds = Standard_False;
-Handle (Graphic3d_ArrayOfPolygons) anArray =
- new Graphic3d_ArrayOfPolygons (aVerticesMaxCount,
- aBoundsMaxCount,
- aEdgesMaxCount,
- IsNormals,
- IsVertexColors,
- IsFaceColors,
- IsTextureCrds);
-
-**// add bounds to the array, first polygon**
-anArray-AddBound (3);
-anArray-AddVertex (-1.0, 0.0, 0.0);
-anArray-AddVertex ( 1.0, 0.0, 0.0);
-anArray-AddVertex ( 0.0, 1.0, 0.0);
-
-**// add bounds to the array, second polygon**
+~~~~~
+// create an array
+Standard_Boolean IsNormals = Standard_False;
+Standard_Boolean IsVertexColors = Standard_False;
+Standard_Boolean IsFaceColors = Standard_False;
+Standard_Boolean IsTextureCrds = Standard_False;
+Handle (Graphic3d_ArrayOfPolygons) anArray =
+ new Graphic3d_ArrayOfPolygons (aVerticesMaxCount,
+ aBoundsMaxCount,
+ aEdgesMaxCount,
+ IsNormals,
+ IsVertexColors,
+ IsFaceColors,
+ IsTextureCrds);
+
+// add bounds to the array, first polygon
+anArray-AddBound (3);
+anArray-AddVertex (-1.0, 0.0, 0.0);
+anArray-AddVertex ( 1.0, 0.0, 0.0);
+anArray-AddVertex ( 0.0, 1.0, 0.0);
+
+// add bounds to the array, second polygon
anArray-AddBound (4);
-anArray-AddVertex (-1.0, 0.0, 0.0);
-anArray-AddVertex ( 1.0, 0.0, 0.0);
-anArray-AddVertex ( 1.0,-1.0, 0.0);
-anArray-AddVertex (-1.0,-1.0, 0.0);
-
-**// add the array to the structure **
-Handle (Graphic3d_Group) aGroup =
- Prs3d_Root::CurrentGroup (aPrs);
-aGroup-BeginPrimitives ();
-aGroup-AddPrimitiveArray (anArray);
-aGroup-EndPrimitives ();
+anArray-AddVertex (-1.0, 0.0, 0.0);
+anArray-AddVertex ( 1.0, 0.0, 0.0);
+anArray-AddVertex ( 1.0,-1.0, 0.0);
+anArray-AddVertex (-1.0,-1.0, 0.0);
+
+// add the array to the structure
+Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPrs);
+aGroup-BeginPrimitives ();
+aGroup-AddPrimitiveArray (anArray);
+aGroup-EndPrimitives ();
+~~~~~
-There are also several helper methods. You can get the type of the primitive array:
- * Graphic3d_TypeOfPrimitiveArray Graphic3d_ArrayOfPrimitives::Type
- * Standard_CString Graphic3d_ArrayOfPrimitives::StringType
+There are also several helper methods. You can get the type of the primitive array:
+~~~~~
+ Graphic3d_TypeOfPrimitiveArray
+ Graphic3d_ArrayOfPrimitives::Type
+ Standard_CString Graphic3d_ArrayOfPrimitives::StringType
+~~~~~
-and check if the primitive array provides normals, vertex colors, vertex texels (texture coordinates):
- * Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexNormals
- * Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexColors
- * Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexTexels
+and check if the primitive array provides normals, vertex colors and vertex texels (texture coordinates):
+~~~~~
+ Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexNormals
+ Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexColors
+ Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexTexels
+~~~~~
or get the number of vertices, edges and bounds:
- * Standard_Integer Graphic3d_ArrayOfPrimitives::VertexNumber
- * Standard_Integer Graphic3d_ArrayOfPrimitives::EdgeNumber
- * Standard_Integer Graphic3d_ArrayOfPrimitives::BoundNumber
-
-@subsubsection occt_1621831385_143501245715 About materials
+~~~~~
+ Standard_Integer Graphic3d_ArrayOfPrimitives::VertexNumber
+ Standard_Integer Graphic3d_ArrayOfPrimitives::EdgeNumber
+ Standard_Integer Graphic3d_ArrayOfPrimitives::BoundNumber
+~~~~~
+
+@subsubsection occt_visu_5_1_5 Materials
-A **material** is defined by coefficients of:
+A *material* is defined by :
* Transparency,
- * Diffuse reflection,
- * Ambient reflection,
- * Specular reflection.
+ * Diffuse reflection - a component of the object color;
+ * Ambient reflection;
+ * Specular reflection - a component of the color of the light source.
-Two properties define a given material:
- * Transparency
- * Reflection properties - its absorption and reflection of light.
-
-**Diffuse reflection** is seen as a component of the color of the object.
-
-**Specular reflection** is seen as a component of the color of the light source.
-
-The following items are required to determine the three colors of reflection:
+The following items are required to determine the three colors of reflection:
* Color,
* Coefficient of diffuse reflection,
* Coefficient of ambient reflection,
* Coefficient of specular reflection.
+@subsubsection occt_visu_5_1_6 Textures
-
-@subsubsection occt_1621831385_143501245716 About textures
-
-A **texture **is defined by a name.
-Three types of texture are available:
+A *texture* is defined by a name.
+Three types of texture are available:
* 1D,
* 2D,
* Environment mapping.
-@subsubsection occt_1621831385_143501245717 Graphic3d text
+@subsubsection occt_visu_5_1_7 Graphic3d text
-The OpenGl graphics driver uses advanced text rendering powered by FTGL library. This library provides vector text rendering, as a result the text can be rotated and zoomed without quality loss.
-Graphic3d text primitives have the following features:
+The OpenGl graphics driver uses advanced text rendering powered by FTGL library. This library provides vector text rendering, as a result the text can be rotated and zoomed without quality loss.
+*Graphic3d* text primitives have the following features:
* fixed size (non-zoomable) or zoomable,
* can be rotated to any angle in the view plane,
* support unicode charset.
-The text attributes for the group could be defined with the Graphic3d_AspectText3d attributes group.
-To add any text to the graphic structure you can use the following methods:
- * void Graphic3d_Group::Text
-(const Standard_CString AText,
- const Graphic3d_Vertex& APoint,
- const Standard_Real AHeight,
- const Quantity_PlaneAngle AAngle,
- const Graphic3d_TextPath ATp,
- const Graphic3d_HorizontalTextAlignment AHta,
- const Graphic3d_VerticalTextAlignment AVta,
- const Standard_Boolean EvalMinMax),
-AText parameter is the text string, APoint is the three-dimensional position of the text, AHeight is the text height, AAngle is the orientation of the text (at the moment, this parameter has no effect, but you can specify the text orientation through the Graphic3d_AspectText3d attributes).
-ATp parameter defines the text path, AHta is the horizontal alignment of the text, AVta is the vertical alignment of the text.
-You can pass Standard_False as EvalMinMax if you don’t want the graphic3d structure boundaries to be affected by the text position.
-**Please note** that the text orientation angle can be defined by Graphic3d_AspectText3d attributes.
-
- * void Graphic3d_Group::Text
-(const Standard_CString AText,
- const Graphic3d_Vertex& APoint,
- const Standard_Real AHeight,
- const Standard_Boolean EvalMinMax)
- * void Graphic3d_Group::Text
-(const TCcollection_ExtendedString &AText,
-const Graphic3d_Vertex& APoint,
- const Standard_Real AHeight,
- const Quantity_PlaneAngle AAngle,
- const Graphic3d_TextPath ATp,
- const Graphic3d_HorizontalTextAlignment AHta,
- const Graphic3d_VerticalTextAlignment AVta,
- const Standard_Boolean EvalMinMax)
- * void Graphic3d_Group::Text
-(const TCcollection_ExtendedString &AText,
- const Graphic3d_Vertex& APoint,
- const Standard_Real AHeight,
- const Standard_Boolean EvalMinMax)
-
-<h4>Example </h4>
+The text attributes for the group could be defined with the *Graphic3d_AspectText3d* attributes group.
+To add any text to the graphic structure you can use the following methods:
+~~~~~
+ void Graphic3d_Group::Text
+ (const Standard_CString AText,
+ const Graphic3d_Vertex& APoint,
+ const Standard_Real AHeight,
+ const Quantity_PlaneAngle AAngle,
+ const Graphic3d_TextPath ATp,
+ const Graphic3d_HorizontalTextAlignment AHta,
+ const Graphic3d_VerticalTextAlignment AVta,
+ const Standard_Boolean EvalMinMax),
+~~~~~
+*AText* parameter is the text string, *APoint* is the three-dimensional position of the text, *AHeight* is the text height, *AAngle* is the orientation of the text (at the moment, this parameter has no effect, but you can specify the text orientation through the *Graphic3d_AspectText3d* attributes).
+
+*ATp* parameter defines the text path, *AHta* is the horizontal alignment of the text, *AVta* is the vertical alignment of the text.
+
+You can pass *Standard_False* as *EvalMinMax* if you don’t want the graphic3d structure boundaries to be affected by the text position.
+
+**Note** that the text orientation angle can be defined by *Graphic3d_AspectText3d* attributes.
+~~~~~
+ void Graphic3d_Group::Text
+ (const Standard_CString AText,
+ const Graphic3d_Vertex& APoint,
+ const Standard_Real AHeight,
+ const Standard_Boolean EvalMinMax)
+ void Graphic3d_Group::Text
+ (const TCcollection_ExtendedString &AText,
+ const Graphic3d_Vertex& APoint,
+ const Standard_Real AHeight,
+ const Quantity_PlaneAngle AAngle,
+ const Graphic3d_TextPath ATp,
+ const Graphic3d_HorizontalTextAlignment AHta,
+ const Graphic3d_VerticalTextAlignment AVta,
+ const Standard_Boolean EvalMinMax)
+ void Graphic3d_Group::Text
+ (const TCcollection_ExtendedString &AText,
+ const Graphic3d_Vertex& APoint,
+ const Standard_Real AHeight,
+ const Standard_Boolean EvalMinMax)
+~~~~~
-**// get the group**
-Handle (Graphic3d_Group) aGroup =
- Prs3d_Root::CurrentGroup (aPrs);
+See the example:
+~~~~~
+// get the group
+Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPrs);
-**// change the text aspect**
-Handle(Graphic3d_AspectText3d) aTextAspect =
- new Graphic3d_AspectText3d ();
-aTextAspect-SetTextZoomable (Standard_True);
-aTextAspect-SetTextAngle (45.0);
-aGroup-SetPrimitivesAspect (aTextAspect);
+// change the text aspect
+Handle(Graphic3d_AspectText3d) aTextAspect = new Graphic3d_AspectText3d ();
+aTextAspect-SetTextZoomable (Standard_True);
+aTextAspect-SetTextAngle (45.0);
+aGroup-SetPrimitivesAspect (aTextAspect);
-**// add a text primitive to the structure**
+// add a text primitive to the structure
Graphic3d_Vertex aPoint (1, 1, 1);
-aGroup-Text (Standard_CString (*Text*), aPoint, 16.0);
+aGroup-Text (Standard_CString ("Text"), aPoint, 16.0);
+~~~~~
+
+@subsubsection occt_visu_5_1_8 Display priorities
+Structure display priorities control the order in which structures are drawn. When you display a structure you specify its priority. The lower the value, the lower the display priority. When the display is regenerated the structures with the lowest priority are drawn first. For structures with the same display priority the order in which they were displayed determines the drawing order. OCCT supports eleven structure display priorities.
-@subsubsection occt_1621831385_143501245718 Display priorities
+@subsubsection occt_visu_5_1_9 About structure hierarchies
-Structure display priorities control the order in which structures are drawn. When you display a structure you specify its priority. The lower the value, the lower the display priority. When the display is regenerated the structures with the lowest priority are drawn first. For structures with the same display priority the order in which they were displayed determines the drawing order. CAS.CADE supports eleven structure display priorities.
+The root is the top of a structure hierarchy or structure network. The attributes of a parent structure are passed to its descendants. The attributes of the descendant structures do not affect the parent. Recursive structure networks are not supported.
-@subsubsection occt_1621831385_143501245719 About structure hierarchies
+@subsection occt_visu_5_2 V3d Package
-The root is the top of a structure hierarchy or structure network. The attributes of a parent structure are passed to its descendants. The attributes of the descendant structures do not affect the parent. Recursive structure networks are not supported.
+@subsubsection occt_visu_5_2_1 Overview
-@subsection occt_1621831385_14350124572 V3d
-@subsubsection occt_1621831385_143501245721 Overview
-The **V3d** package provides the resources to define a 3D viewer and the views attached to this viewer (orthographic, perspective). This package provides the commands to manipulate the graphic scene of any 3D object visualized in a view on screen.
-A set of high-level commands allows the separate manipulation of parameters and the result of a projection (Rotations, Zoom, Panning, etc.) as well as the visualization attributes (Mode, Lighting, Clipping, Depth-cueing, etc) in any particular view.
+The *V3d* package provides the resources to define a 3D viewer and the views attached to this viewer (orthographic, perspective). This package provides the commands to manipulate the graphic scene of any 3D object visualized in a view on screen.
-@subsubsection occt_1621831385_143501245722 Provided services
-The V3d package is basically a set of tools directed by commands from the viewer front-end. This tool set contains methods for creating and editing classes of the viewer such as:
+A set of high-level commands allows the separate manipulation of parameters and the result of a projection (Rotations, Zoom, Panning, etc.) as well as the visualization attributes (Mode, Lighting, Clipping, Depth-cueing, etc.) in any particular view.
+
+@subsubsection occt_visu_5_2_2 Provided services
+
+The *V3d* package is basically a set of tools directed by commands from the viewer front-end. This tool set contains methods for creating and editing classes of the viewer such as:
* Default parameters of the viewer,
* Views (orthographic, perspective),
* Lighting (positional, directional, ambient, spot, headlight),
- * Clipping planes (note that only Z-clipping planes can work with the Phigs interface),
- * Instantiated sequences of views, planes, light sources, graphic structures, and picks,
+ * Clipping planes (note that only Z-clipping planes can work with the Phigs interface),
+ * Instantiated sequences of views, planes, light sources, graphic structures, and picks,
* Various package methods.
-@subsubsection occt_1621831385_143501245723 A programming example
-<h4>Example </h4>
+@subsubsection occt_visu_5_2_3 A programming example
-This sample TEST program for the V3d Package uses primary packages Xw and Graphic3d and secondary packages Visual3d, Aspect, Quantity, Phigs, math.
+This sample TEST program for the *V3d* Package uses primary packages *Xw* and *Graphic3d* and secondary packages *Visual3d, Aspect, Quantity, Phigs* and *math*.
-**//Create a Graphic Device from the default DISPLAY **
-Handle(Graphic3d_GraphicDevice) GD =
-new Graphic3d_GraphicDevice(**) ;
+~~~~~
+//Create a default display connection
+Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection();
-**// Create a Viewer to this Device **
-Handle(V3d_Viewer) VM = new V3d_Viewer(GD, 400.,
-// Space size
-V3d_Xpos,// Default projection Quantity_NOC_DARKVIOLET,
-// Default background
+//Create a Graphic Driver from the default *Aspect_DisplayConnection*
+Handle(Graphic3d_GraphicDriver) GD = Graphic3d::InitGraphicDriver (aDisplayConnection);
+
+//Create a Viewer to this Driver
+Handle(V3d_Viewer) VM = new V3d_Viewer(GD, 400.,
+// Space size
+V3d_Xpos,// Default projection Quantity_NOC_DARKVIOLET,
+// Default background
V3d_ZBUFFER,
-// Type of visualization
+// Type of visualization
V3d_GOURAUD,
-// Shading model
+// Shading model
V3d_WAIT);
-// Update mode
-**// Create a structure in this Viewer **
-Handle(Graphic3d_Structure) S =
-new Graphic3d_Structure(VM-Viewer()) ;
+// Update mode
+*// Create a structure in this Viewer *
+Handle(Graphic3d_Structure) S =
+new Graphic3d_Structure(VM-Viewer()) ;
-**// Type of structure **
-S-SetVisual (Graphic3d_TOS_SHADING);
+*// Type of structure *
+S-SetVisual (Graphic3d_TOS_SHADING);
-**// Create a group of primitives in this structure**
-Handle(Graphic3d_Group) G = new Graphic3d_Group(S) ;
+*// Create a group of primitives in this structure*
+Handle(Graphic3d_Group) G = new Graphic3d_Group(S) ;
-**// Fill this group with one polygon of size 100**
-Graphic3d_Array1OfVertex Points(0,3) ;
-Points(0).SetCoord(-100./2.,-100./2.,-100./2.) ;
-Points(1).SetCoord(-100./2., 100./2.,-100./2.) ;
-Points(2).SetCoord( 100./2., 100./2.,-100./2.) ;
-Points(3).SetCoord( 100./2.,-100./2.,-100./2.) ; Normal.SetCoord(0.,0.,1.) ;
-G-Polygon(Points,Normal) ;
+*// Fill this group with one polygon of size 100*
+Graphic3d_Array1OfVertex Points(0,3) ;
+Points(0).SetCoord(-100./2.,-100./2.,-100./2.) ;
+Points(1).SetCoord(-100./2., 100./2.,-100./2.) ;
+Points(2).SetCoord( 100./2., 100./2.,-100./2.) ;
+Points(3).SetCoord( 100./2.,-100./2.,-100./2.) ; Normal.SetCoord(0.,0.,1.) ;
+G-Polygon(Points,Normal) ;
-**// Create Ambient and Infinite Lights in this Viewer**
-Handle(V3d_AmbientLight) L1 = new V3d_AmbientLight
-(VM,Quantity_NOC_GRAY50) ;
-Handle(V3d_DirectionalLight) L2 = new V3d_DirectionalLight
-(VM,V3d_XnegYnegZneg,Quantity_NOC_WHITE) ;
+*// Create Ambient and Infinite Lights in this Viewer*
+Handle(V3d_AmbientLight) L1 = new V3d_AmbientLight
+(VM,Quantity_NOC_GRAY50) ;
+Handle(V3d_DirectionalLight) L2 = new V3d_DirectionalLight
+(VM,V3d_XnegYnegZneg,Quantity_NOC_WHITE) ;
-**// Create a 3D quality Window from the same GraphicDevice**
-Handle(Xw_Window) W =
-new Xw_Window(GD,*Test V3d*,0.5,0.5,0.5,0.5) ;
+*// Create a 3D quality Window with the same DisplayConnection*
+Handle(Xw_Window) W =
+new Xw_Window(aDisplayConnection,"Test V3d",0.5,0.5,0.5,0.5) ;
-**// Map this Window to this screen**
- W-Map() ;
+*// Map this Window to this screen*
+ W-Map() ;
-**// Create a Perspective View in this Viewer**
-Handle(V3d_PerspectiveView) V =
-new V3d_PerspectiveView(VM);
+*// Create a Perspective View in this Viewer*
+Handle(V3d_PerspectiveView) V =
+new V3d_PerspectiveView(VM);
-**// Set the Eye position**
-V-SetEye(100.,100.,100.) ;
+*// Set the Eye position*
+V-SetEye(100.,100.,100.) ;
-**// Associate this View with the Window **
-V-SetWindow(W) ;
+*// Associate this View with the Window *
+V-SetWindow(W) ;
-**// Activate ALL defined Lights in this View **
-V-SetLightOn() ;
+*// Activate ALL defined Lights in this View *
+V-SetLightOn() ;
-**// Display ALL structures in this View **
-(VM-Viewer())-Display() ;
+*// Display ALL structures in this View *
+(VM-Viewer())-Display() ;
-**// Finally update the Visualization in this View **
-V-Update() ;
+*// Finally update the Visualization in this View *
+V-Update() ;
+~~~~~
-@subsubsection occt_1621831385_143501245724 Glossary of view transformations
-The following terms are used to define view orientation, i.e. transformation from World Coordinates (WC) to the View Reference Coordinates system (VRC)
+@subsubsection occt_visu_5_2_4 Glossary of view transformations
-The following terms are used to define view mapping, i.e. transformation from View Reference Coordinates (VRC) to the Normalized Projection Coordinates (NPC)
+The following terms are used to define view orientation, i.e. transformation from World Coordinates (WC) to the View Reference Coordinates system (VRC):
+* **View Reference Point (VRP)** - defines the origin of View Reference Coordinates.
+* **View Reference Plane Normal (VPN)** - defines the normal of projection plane of the view.
+* **View Reference Up Vector (VUP)** - defines the vertical of observer of the view.
-The V3d_View API uses the following terms to define view orientation and mapping
+The following terms are used to define view mapping, i.e. transformation from View Reference Coordinates (VRC) to the Normalized Projection Coordinates (NPC):
+* **Projection type** - Orthographic or perspective.
+* **Projection Reference Point (PRP)** - Defines the observer position.
+* **Front Plane Distance (FPD)** - Defines the position of the front clipping plane in View Reference Coordinates system.
+* **Back Plane Distance (BPD)** Defines the position of the back clipping plane in View Reference Coordinates system.
+* **View Plane Distance (VPD)** Defines the position of the view projection plane in View Reference Coordinates system. View plane must be located between front and back clipping planes.
+* **Window Limits** Defines the visible part of the view projection plane (left, right, top and bottom boundaries: *Umin, Umax, Vmax* and *Vmin* respectively) in View Reference Coordinates.
+The *V3d_View* API uses the following terms to define view orientation and mapping:
+* **At** - Position of View Reference Point (VRP) in World Coordinates
+* **Eye** - Position of the observer (projection reference point) in World Coordinates. Influences to the view projection vector and depth value.
+* **Proj** - View projection vector (VPN)
+* **Up** - Position of the high point / view up vector (VUP)
+* **Depth** - Distance between Eye and At point
+* **ZSize** - Distance between front and back clipping planes
+* **Size** - Window size in View Reference Coordinates
+* **Focal Reference point** - Position of Projection Reference Point (PRP) in World Coordinates
+* **Focale** - Distance between Projection Reference Point (PRP) and View projection plane
-@subsubsection occt_1621831385_143501245725 Management of perspective projection
-The perspective projection allows definition of viewing volume as a truncated pyramid (frustum) with apex at the Projection Reference Point. In the View Reference Coordinate system it can be presented by the following picture:
-@image html /user_guides/visualization/images/visualization_image023.png
-@image latex /user_guides/visualization/images/visualization_image023.png
+@subsubsection occt_visu_5_2_5 Management of perspective projection
-@image html /user_guides/visualization/images/visualization_image024.png
-@image latex /user_guides/visualization/images/visualization_image024.png
-Figure 1 View Reference Coordinate System, perspective viewing volume and view mapping parameters
+The perspective projection allows definition of viewing volume as a truncated pyramid (frustum) with apex at the Projection Reference Point. In the View Reference Coordinate system it can be presented by the following picture:
-During panning, window limits are changed, as if a sort of *frame* through which the user sees a portion of the view plane was moved over the view. The perspective frustum itself remains unchanged.
+@image html visualization_image023.png "View Reference Coordinate System, perspective viewing volume and view mapping parameter"
+@image latex visualization_image023.png "View Reference Coordinate System, perspective viewing volume and view mapping parameter"
+
+During panning, window limits are changed, as if a sort of "frame" through which the user sees a portion of the view plane was moved over the view. The perspective frustum itself remains unchanged.
The perspective projection is defined by two parameters:
- * **Depth** value defines distance between Projection Reference Point and the nearest (front) clipping plane.
- * **ZSize** defines distance between Front and Back clipping planes. The influence of this parameter is caused by the OCCT specific to center viewing volume around View Reference Point so the front and back plane distances were the same: FPD = BPD = ZSize / 2.
-**Note** that the closer the displayed object to the Projection Reference Point the more visible its perspective distortion. Thus, in order to get a good perspective it is recommended to set ZSize value comparable with the expected model size and small Depth value.
+ * *Depth* value defines distance between Projection Reference Point and the nearest (front) clipping plane.
+ * *ZSize* defines distance between Front and Back clipping planes. The influence of this parameter is caused by the OCCT specific to center viewing volume around View Reference Point so the front and back plane distances were the same: *FPD = BPD = ZSize / 2*.
+
+**Note** that the closer the displayed object to the Projection Reference Point the more visible its perspective distortion. Thus, in order to get a good perspective it is recommended to set **ZSize** value comparable with the expected model size and small Depth value.
-However, very small Depth values might lead to inaccuracy of *fit all* operation and to non-realistic perspective distortion.
-<h4>Example </h4>
+However, very small Depth values might lead to inaccuracy of "fit all" operation and to non-realistic perspective distortion.
-**// Create a Perspective View in Viewer VM**
-Handle(V3d_PerspectiveView) V =
-new V3d_PerspectiveView(VM);
+Let us see the example:
+~~~~~
+// Create a Perspective View in Viewer VM
+Handle(V3d_PerspectiveView) V = new V3d_PerspectiveView(VM);
-**// Set the ZSize **
-V-SetZSize(2000.) ;
+// Set the ZSize
+V-SetZSize(2000.) ;
-**// Set the Depth value**
-V-SetDepth(20.) ;
+// Set the Depth value
+V-SetDepth(20.) ;
-**// Set the current mapping as default**
-**// to be used by Reset() operation**
-V-SetViewMappingDefault() ;
+// Set the current mapping as default to be used by Reset() operation
+V-SetViewMappingDefault() ;
+~~~~~
-As an alternative to manual setting of perspective parameters the *V3d_View::DepthFitAll* function can be used.
-<h4>Example </h4>
+As an alternative to manual setting of perspective parameters the *V3d_View::DepthFitAll* function can be used.
-**// Display shape in Viewer VM**
-Handle(AIS_InteractiveContext) aContext =
-new AIS_InteractiveContext(VM);
+~~~~~
+// Display shape in Viewer VM
+Handle(AIS_InteractiveContext) aContext = new AIS_InteractiveContext(VM);
aContext-Display(shape);
-**// Create a Perspective View in Viewer VM**
-Handle(V3d_PerspectiveView) V =
-new V3d_PerspectiveView(VM);
+// Create a Perspective View in Viewer VM
+Handle(V3d_PerspectiveView) V = new V3d_PerspectiveView(VM);
-**// Set automatically the perspective parameters**
-V-DepthFitAll() ;
+// Set automatically the perspective parameters
+V-DepthFitAll() ;
-**// Fit view to object size **
+// Fit view to object size
V-FitAll();
-**// Set the current mapping as default**
-**// to be used by Reset() operation**
-V-SetViewMappingDefault() ;
-
-
-It is necessary to take into account that during rotation Z size of the view might be modified automatically to fit the model into the viewing volume.
-Make sure the Eye point never gets between the Front and Back clipping planes.
-In perspective view, changing Z size results in changed perspective effect. To avoid this, an application should specify the maximum expected Z size using V3d_View::SetZSize() method in advance.
-V3d_View::FitAll() with FitZ = Standard_True and V3d_View::ZFitAll() also change the perspective effect and should therefore be used with precautions similar to those for rotation.
+// Set the current mapping as default to be used by Reset() operation
+V-SetViewMappingDefault() ;
+~~~~~
-@subsubsection occt_1621831385_143501245726 Underlay and overlay layers management
-In addition to interactive 3d graphics displayed in the view you can display an underlying and overlying graphics: text, color scales, drawings.
+It is necessary to take into account that during rotation Z size of the view might be modified automatically to fit the model into the viewing volume.
-All of the v3d view’s graphical objects in the overlay are managed by the default layer manager (*V3d_LayerMgr*). The v3d view has a basic layer manager capable of displaying the color scale, but you can redefine this class to provide your own overlay and underlay graphics.
+Make sure the Eye point never gets between the Front and Back clipping planes.
-You can assign your own layer manager to the v3d view using the following method:
- * void V3d_View::SetLayerMgr
-(const Handle (V3d_LayerMgr)& aMgr)
+In perspective view, changing Z size results in changed perspective effect. To avoid this, an application should specify the maximum expected Z size using *V3d_View::SetZSize()* method in advance.
-There are three virtual methods to prepare graphics in the manager for further drawing (set up layer dimensions, draw static graphics). These methods could be redefined:
- * void V3d_LayerMgr::Begin ()
- * void V3d_LayerMgr::Redraw ()
- * void V3d_LayerMgr::End ()
+*V3d_View::FitAll()* with *FitZ = Standard_True* and *V3d_View::ZFitAll()* also change the perspective effect and should therefore be used with precautions similar to those for rotation.
-The layer manager controls layers* *(*Visual3d_Layer*) and layer items* *(*Visual3d_LayerItem*). Both the overlay and underlay layers can be created by the layer manager.
+@subsubsection occt_visu_5_2_6 Underlay and overlay layers management
-The layer entity is presented by the *Visual3d_Layer* class. This entity provides drawing services in the layer, for example:
- * void Visual3d_Layer::DrawText
- * void Visual3d_Layer::DrawRectangle
- * void Visual3d_Layer::SetColor
- * void Visual3d_Layer::SetViewport
+In addition to interactive 3d graphics displayed in the view you can display an underlying and overlying graphics: text, color scales, drawings.
-The following example demonstrates how to draw overlay graphics by the V3d_LayerMgr:
-<h4>Example </h4>
+All *V3d* view graphical objects in the overlay are managed by the default layer manager (*V3d_LayerMgr*). The *V3d* view has a basic layer manager capable of displaying the color scale, but you can redefine this class to provide your own overlay and underlay graphics.
-**// redefined method of V3d_LayerMgr**
-void MyLayerMgr::Redraw ()
-{
- Quantity_Color aRed (Quantity_NOC_RED);
- myOverlayLayer-SetColor (aRed);
- myOverlayLayer-DrawRectangle (0, 0, 100, 100);
-}
+The method *V3d_View::SetLayerMgr(const Handle (V3d_LayerMgr)& aMgr)* allows assigning a custom layer manager to the *V3d* view.
-The layer contains layer items that will be displayed on view redraw. Such items are the Visual3d_LayerItem entities. To manipulate Visual3d_LayerItem entities assigned to the layer’s internal list you can use the following methods:
- * void Visual3d_Layer::AddLayerItem
-(const Handle (Visual3d_LayerItem)& Item)
- * void Visual3d_Layer::RemoveLayerItem
-(const Handle (Visual3d_LayerItem)& Item)
- * void Visual3d_Layer::RemoveAllLayerItems ()
- * const Visual3d_NListOfLayerItem&
-Visual3d_Layer::GetLayerItemList ()
-
-The layer’s items are rendered when the following method is called by the graphical driver:
- * void Visual3d_Layer::RenderLayerItems ()
-
-The *Visual3d_LayerItem* has virtual methods that are used to render the item:
- * void Visual3d_LayerItem::RedrawLayerPrs ()
- * void Visual3d_LayerItem::ComputeLayerPrs ()
-
-The item’s presentation can be computed before drawing by the ComputeLayerPrs method to save time on redraw. It also has an additional flag that is used to tell that the presentation should be recomputed:
- * void Visual3d_LayerItem::SetNeedToRecompute
-(const Standard_Boolean NeedToRecompute)
- * Standard_Boolean Visual3d_LayerItem::IsNeedToRecompute
-
-An example of Visual3d_LayerItem is *V3d_ColorScaleLayerItem* that represents the color scale entity as the layer’s item.
-The *V3d_ColorScaleLayerItem* sends render requests to the color scale entity represented by it. As this entity (*V3d_ColorScale*) is assigned to the *V3d_LayerMgr* it uses its overlay layer’s services for drawing:
-<h4>Example </h4>
+There are three virtual methods to prepare graphics in the manager for further drawing (set up layer dimensions, draw static graphics). These methods can be redefined:
+~~~~~
+ void V3d_LayerMgr::Begin ()
+ void V3d_LayerMgr::Redraw ()
+ void V3d_LayerMgr::End ()
+~~~~~
-**// tell V3d_ColorScale to draw itself**
-void V3d_ColorScaleLayerItem::RedrawLayerPrs ()
-{
- Visual3d_LayerItem::RedrawLayerPrs ()
- if (!MyColorScale.IsNull ())
- MyColorScale-DrawScale ();
-}
+The layer manager controls layers (*Visual3d_Layer*) and layer items (*Visual3d_LayerItem*). Both the overlay and underlay layers can be created by the layer manager.
-**// V3d_ColorScale has a reference to a LayerMgr**
-void V3d_ColorScale::DrawScale ()
-{
- **// calls *V3d_ColorScale::PaintRect, V3d_ColorScale::PaintText*, etc …**
-}
+The layer entity is presented by the *Visual3d_Layer* class. This entity provides drawing services in the layer, for example:
+~~~~~
+ void Visual3d_Layer::DrawText
+ void Visual3d_Layer::DrawRectangle
+ void Visual3d_Layer::SetColor
+ void Visual3d_Layer::SetViewport
+~~~~~
+The following example demonstrates how to draw overlay graphics by the *V3d_LayerMgr*:
-**// PaintRect method uses overlay layer of LayerMgr to draw a rectangle **
-void V3d_ColorScale::PaintRect
- (const Standard_Integer X, const Standard_Integer Y,
- const Standard_Integer W, const Standard_Integer H,
- const Quantity_Color aColor,
- const Standard_Boolean aFilled)
+~~~~~
+// redefined method of V3d_LayerMgr
+void MyLayerMgr::Redraw ()
{
- const Handle (Visual3d_Layer)& theLayer =
- myLayerMgr-Overlay ();
-** …**
-
-** **theLayer-SetColor (aColor);
- theLayer-DrawRectangle (X, Y, W, H);
-** …**
+ Quantity_Color aRed (Quantity_NOC_RED);
+ myOverlayLayer-SetColor (aRed);
+ myOverlayLayer-DrawRectangle (0, 0, 100, 100);
}
+~~~~~
+The layer contains layer items that will be displayed on view redraw. Such items are *Visual3d_LayerItem* entities. To manipulate *Visual3d_LayerItem* entities assigned to the layer’s internal list you can use the following methods:
-@subsubsection occt_1621831385_143501245727 View background styles
-There are three types of background styles available for V3d_view: solid color, gradient color and image.
-
-To set solid color for the background you can use the following methods:
- * void V3d_View::SetBackgroundColor
-(const Quantity_TypeOfColor Type,
- const Quantity_Parameter V1,
- const Quantity_Parameter V2,
- const Quantity_Parameter V3)
-This method allows you to specify the background color in RGB (red, green, blue) or HLS (hue, lightness, saturation) color spaces, so the appropriate values of the Type parameter are Quantity_TOC_RGB and Quantity_TOC_HLS. **Note** that the color value parameters V1,V2,V3 should be in the range between 0.0-1.0.
-
- * void V3d_View::SetBackgroundColor
-(const Quantity_Color &Color)
- * void V3d_View::SetBackgroundColor
-(const Quantity_NameOfColor Name)
-
-The gradient background style could be set up with the following methods:
- * void V3d_View::SetBgGradientColors
-(const Quantity_Color& Color1,
- const Quantity_Color& Color2,
- const Aspect_GradientFillMethod FillStyle,
- const Standard_Boolean update)
- * void V3d_View::SetBgGradientColors
-(const Quantity_NameOfColor Color1,
- const Quantity_NameOfColor Color2,
- const Aspect_GradientFillMethod FillStyle,
- const Standard_Boolean update)
-The Color1 and Color2 parameters define the boundary colors of interpolation, the FillStyle parameter defines the direction of interpolation. You can pass Standard_True as the last parameter to update the view.
-
-The fill style can be also set with the following method:
- * void V3d_View::SetBgGradientStyle
-(const Aspect_GradientFillMethod AMethod,
-const Standard_Boolean update)
-
-To get the current background color you can use the following methods:
- * void V3d_View::BackgroundColor
-(const Quantity_TypeOfColor Type,
- Quantity_Parameter &V1,
- Quantity_Parameter &V2,
- Quantity_Parameter &V3)
- * Quantity_Color V3d_View::BackgroundColor()
- * void V3d_View::GradientBackgroundColors
-(Quantity_Color& Color1,
- Quantity_Color& Color2)
- * Aspect_GradientBackground GradientBackground()
-
-To set the image as a background and change the background image style you can use the following methods:
- * void V3d_View::SetBackgroundImage
-(const Standard_CString FileName,
- const Aspect_FillMethod FillStyle,
- const Standard_Boolean update)
- * void V3d_View::SetBgImageStyle
-(const Aspect_FillMethod FillStyle,
- const Standard_Boolean update)
-
-The FileName parameter defines the image file name and the path to it, the FillStyle parameter defines the method of filling the background with the image. The methods are:
- * Aspect_FM_NONE: draw the image in the default position
- * Aspect_FM_CENTERED: draw the image at the center of the view
- * Aspect_FM_TILED: tile the view with the image
- * Aspect_FM_STRETCH: stretch the image over the view
-
-@subsubsection occt_1621831385_143501245728 User-defined clipping planes
-The ability to define custom clipping planes could be very useful for some tasks. The v3d view provides such an opportunity.
-
-The V3d_Plane class provides the services of clipping planes: it holds the plane equation coefficients and provides its graphical representation. To set and get plane equation coefficients you can use the following methods:
- * void V3d_Plane::SetPlane
-(const Quantity_Parameter A,
- const Quantity_Parameter B,
- const Quantity_Parameter C,
- const Quantity_Parameter D)
- * void V3d_Plane::Plane
-(Quantity_Parameter& A,
- Quantity_Parameter& B,
- Quantity_Parameter& C,
- Quantity_Parameter& D)
-
- V3d_Plane also provides display services:
- * void V3d_Plane::Display
-(const Handle(V3d_View)& aView,
- const Quantity_Color& aColor)
- * void V3d_Plane::Erase ()
- * Standard_Boolean V3d_Plane::IsDisplayed ()
-The Display method could be redefined to provide custom representation of the clipping plane.
-
-The clipping planes could be activated with the following methods:
- * void V3d_View::SetPlaneOn
-(const Handle(V3d_Plane)& MyPlane)
- * void V3d_View::SetPlaneOn ()
-The first method appends the given V3d_Plane to the internal list of user-defined clipping planes of a view and activates it. If the plane is already in the list, it becomes activated. The second method activates all of the planes defined for the view.
-
-The clipping planes could be deactivated with the similar methods:
- * void V3d_View::SetPlaneOff
-(const Handle(V3d_Plane)& MyPlane)
- * void V3d_View::SetPlaneOff ()
-
-The only difference is that these methods remove the user-defined clipping planes from the internal list. Thus, the view retains only active clipping planes.
-
-You can iterate through the active planes using the following methods:
- * void V3d_View::InitActivePlanes ()
-sets the iterator to the beginning of the internal list of clipping planes
- * Standard_Boolean V3d_View::MoreActivePlanes ()
-returns Standard_True if there are more active planes to return
- * void V3d_View::NextActivePlanes ()
-sets the iterator to the next active plane in the list
- * Handle(V3d_Plane) V3d_View::ActivePlane ()
-returns the active plane
-
-or check if a certain clipping plane has been activated:
- * Standard_Boolean V3d_View::IsActivePlane
-(const Handle (V3d_Plane)& aPlane)The number of clipping planes is limited. The following method allows you to check if it is possible to activate at least one more plane in the view or the limit has been reached:
- * Standard_Boolean V3d_View::IfMorePlanes ()
-<h4>Example </h4>
-
-**// try to use an existing clipping plane or create a new one**
-Handle(V3d_Plane) aCustomPlane;
-myView-InitActivePlanes ();
-if (myView-MoreActivePlanes ())
- aCustomPlane = myView-ActivePlane ();
-else
- aCustomPlane = new V3d_Plane ();
-
-**// calculate new coefficients**
-Standard_Real a, b, c, d;
-Standard_Real x = 0.0, y = 0.0, z = 10.0;
-Standard_Real dx = 0.0, dy = 0.0, dz = 1.0;
-gp_Pln aPln (gp_Pnt (x, y, z), gp_Dir (dx, dy, dz));
-aPln.Coefficients (a, b, c, d);
-
-**// update plane**
-aCustomPlane-SetPlane (a, b, c, d);
-myView-SetPlaneOn (aCustomPlane);
-
-@subsubsection occt_1621831385_143501245729 Dumping a 3D scene into an image file
-The 3D scene displayed in the view could be dumped in high resolution into an image file. The high resolution (8192x8192 on some implementations) is achieved using the Frame Buffer Objects (FBO) provided by the graphic driver. Frame Buffer Objects enable off-screen rendering into a virtual view to produce images in the background mode (without displaying any graphics on the screen).
-
-The V3d_View has the following methods for dumping the 3D scene:
- * Standard_Boolean V3d_View::Dump
-(const Standard_CString theFile,
- const Image_TypeOfImage theBufferType)
- * Standard_Boolean V3d_View::Dump
-(const Standard_CString theFile,
- const Aspect_FormatOfSheetPaper theFormat,
- const Image_TypeOfImage theBufferType)
-These methods dump the 3D scene into an image file passed by its name and path as theFile.
-The raster image data handling algorithm is based on the Image_PixMap class. The supported extensions are *.png*, *.bmp*, *.png*, *.png*.
-The first method dumps the scene into an image file with the view dimensions. The second method allows you to make the dimensions of the output image compatible to a certain format of printing paper passed by theFormat argument.
-The value passed as theBufferType argument defines the type of the buffer for an output image (RGB, RGBA, floating-point, RGBF, RGBAF). Both methods return Standard_True if the scene has been successfully dumped.
-**Please note** that dumping the image for a paper format with large dimensions is a memory consuming operation, it might be necessary to take care of preparing enough free memory to perform this operation.
-
- * Handle_Image_PixMap V3d_View::ToPixMap
-(const Standard_Integer theWidth,
- const Standard_Integer theHeight,
- const Image_TypeOfImage theBufferType,
- const Standard_Boolean theForceCentered)
-This method allows you to dump the displayed 3d scene into a pixmap with a width and height passed as theWidth and theHeight arguments.
-The value passed as theBufferType argument defines the type of the buffer for a pixmap (RGB, RGBA, floating-point, RGBF, RGBAF).
-The last parameter allows you to center the 3D scene on dumping.
-
-All these methods assume that you have created a view and displayed a 3d scene in it. However, the window used for such a view could be virtual, so you can dump the 3d scene in the background mode without displaying it on the screen. To use such an opportunity you can perform the following steps:
-1) Create a graphic device;
-2) Create a window;
-3) Set up the window as virtual, Aspect_Window::SetVirtual ();
-4) Create a view and an interactive context;
-5) Assign the virtual window to the view;
-6) Display a 3D scene;
-7) Use one of the functions described above to dump the 3D scene.
-
-The following example demonstrates this procedure for the WNT_Window:
-<h4>Example </h4>
-
-**// create a graphic device**
-Handle (WNT_GraphicDevice) aDevice =
- new Graphic3d_WNTGraphicDevice ();
-
-**// create a window**
-
-~~~~~{c++}
-Standard_Integer aDefWidth = 800;
-Standard_Integer aDefHeight = 600;
-Handle (WNT_WClass) aWClass =
- new WNT_WClass (*Virtual Class*,DefWindowProc,
- CS_VREDRAW | CS_HREDRAW, 0, 0,
- ::LoadCursor (NULL, IDC_ARROW));
-Handle (WNT_Window) aWindow =
- new WNT_Window (aDevice, *VirtualWnd*, aWClass,
- WS_OVERLAPPEDWINDOW, 0, 0,
- aDefWidth, aDefHeight);
-~~~~~
-
-**// set up the window as virtual**
-aWindow-SetVirtual (Standard_True);
-
-**// create a view and an interactive context**
-Handle (V3d_Viewer) aViewer =
- new V3d_Viewer (aDevice,
- Standard_ExtString (*Virtual*));
-Handle (AIS_InteractiveContext) aContext =
- new AIS_InteractiveContext (aViewer);
-Handle (V3d_View) aView = aViewer-CreateView ();
-
-**// assign the virtual window to the view**
-aView-SetWindow (aWindow);
-
-**// display a 3D scene**
-Handle (AIS_Shape) aBox =
- new AIS_Shape (BRepPrimAPI_MakeBox (5, 5, 5));
-aContext-Display (aBox);
-aView-FitAll();
-
-**// dump the 3D scene into an image file**
-aView-Dump (*3dscene.png*);
-
-@subsubsection occt_1621831385_1435012457210 Printing a 3D scene
-The contents of a view can be printed out. Moreover, the OpenGl graphic driver used by the v3d view supports printing in high resolution. The print method uses the OpenGl frame buffer (Frame Buffer Object) for rendering the view contents and advanced print algorithms that allow printing in, theoretically, any resolution.
-
-The following method prints the view contents:
- * void V3d_View::Print
-(const Aspect_Handle hPrnDC,
- const Standard_Boolean showDialog,
- const Standard_Boolean showBackground,
- const Standard_CString filename,
- const Aspect_PrintAlgo printAlgorithm)
-The hPrnDC is the printer device handle. You can pass your own printer handle or *NULL* to select the printer by the default dialog. In that case you can use the default dialog or pass *Standard_False* as the showDialog argument to select the default printer automatically.
-You can define the filename for the printer driver if you want to print out the result into a file.
-If you do not want to print the background, you can pass *Standard_False* as the showBackground argument.
-The printAlgorithm argument allows you to choose between two print algorithms that define how the 3d scene is mapped to the print area when the maximum dimensions of the frame buffer are smaller than the dimensions of the print area. You can pass the following values as the printAlgorithm argument:
- * Aspect_PA_STRETCH,
- * Aspect_PA_TILE
-
-The first value defines the stretch algorithm: the scene is drawn with the maximum possible frame buffer dimensions and then is stretched to the whole printing area. The second value defines TileSplit algorithm: covering the whole printing area by rendering multiple parts of the viewer.
-
-**Please note** that at the moment printing is implemented only for Windows.
-
-@subsubsection occt_1621831385_1435012457211 Vector image export
-The 3D content of a view can be exported to the vector image file format. The vector image export is powered by the GL2PS library. You can export your 3D scenes into a file format supported by the GL2PS library: PostScript (PS), Encapsulated PostScript (EPS), Portable Document Format (PDF), Scalable Vector Graphics (SVG), LaTeX file format and Portable LaTeX Graphics (PGF).
-
-The following method of Visual3d_View class allows you to export your 3D scene:
- * void Visual3d_View::Export
-(const Standard_CString FileName,
- const Graphic3d_ExportFormat Format,
- const Graphic3d_SortType aSortType,
- const Standard_Real Precision,
- const Standard_Address ProgressBarFunc,
- const Standard_Address ProgressObject)
-
-The FileName defines the output image file name and the Format argument defines the output file format:
- * Graphic3d_EF_PostScript (PS),
- * Graphic3d_EF_EhnPostScript (EPS),
- * Graphic3d_EF_TEX (TEX),
- * Graphic3d_EF_PDF (PDF),
- * Graphic3d_EF_SVG (SVG),
- * Graphic3d_EF_PGF (PGF)
-
-The aSortType parameter defines the GL2PS sorting algorithm for the primitives. The Precision, ProgressBarFunc and ProgressObject parameters are implemented for future uses and at the moment have no effect.
-
-The Export method supports only basic 3d graphics and has several limitations:
- * Rendering large scenes could be slow and can lead to large output files;
- * Transparency is only supported for PDF and SVG output;
- * Textures and some effects are not supported by the GL2PS library.
-
-@section occt_1621831385_1090976821 2D Presentations
-@subsection occt_1621831385_10909768211 Glossary of 2D terms
-
-@subsubsection occt_1621831385_10909768212 Creating a 2D scene
-
-To create 2D graphic objects and display them on the screen, follow the procedure below:
-**1. **Create the marker map.
-**2. **Create the attribute maps.
-**3. **Define the connection to a graphic device.
-**4. **Create a window.
-**5. **Create a window driver.
-**6. **Install the maps.
-**7. **Create a view.
-**8. **Create a view mapping.
-**9. **Create one or more graphic objects associated with a view.
-**10. **Create primitives and associate them with a graphic object.
-**11. **Get the workspace of the driver.
-**12. **Update the view in the driver.
-
-@subsubsection occt_1621831385_109097682121 Creating the marker map
-
-The marker map defines a set of markers available to the application. Markers may be predefined, Aspect_Tom_X for example, or user-defined.
-
-@image html /user_guides/visualization/images/visualization_image025.png
-@image latex /user_guides/visualization/images/visualization_image025.png
-Figure 15. Markers.
-
-The markers are manipulated by an index.
-A marker map is defined as follows:
-<h4>Example </h4>
-
-Handle(Aspect_MarkMap) mkrmap = new Aspect_MarkMap;
-Aspect_MarkMapEntry mkrmapentry1 (1, Aspect_TOM_X)
-Aspect_MarkMapEntry mkrmapentry2 (2, Aspect_TOM_PLUS)
-Aspect_MarkMapEntry mkrmapentry3 (3, Aspect_O_PLUS)
-
-mkrmap-AddEntry (mkrmapentry1);
-mkrmap-AddEntry (mkrmapentry2);
-mkrmap-AddEntry (mkrmapentry3);
-
-
-@subsubsection occt_1621831385_109097682122 Creating the attribute maps
-
-Maps are created for color, line type, line width, and text font. A map is used to reference a given attribute by an integer value.
-
-
-@image html /user_guides/visualization/images/visualization_image026.png
-@image latex /user_guides/visualization/images/visualization_image026.png
-Figure 16. Attributes
-
-The color map
-The hardware system will certainly have default colors available but to make the application portable and durable, it must be insulated from external factors by defining the set of colors to be used.
-
-A color map is defined as follows:
-
-<h4>Example </h4>
-
-Handle(Aspect_GenericColorMap) colmap =
-new Aspect_GenericColorMap;
-Aspect_ColorMapEntry colmapentry;
-Quantity_Color YELLOW (Quantity_NOC_YELLOW); colmapentry.SetValue (1, YELLOW);
-colmap-AddEntry (colmapentry);
-Quantity_Color RED (Quantity_NOC_RED);
-colmapentry.SetValue (2, RED);
-colmap-AddEntry (colmapentry);
-Quantity_Color GREEN (Quantity_NOC_GREEN); colmapentry.SetValue (3, GREEN);
-colmap-AddEntry (colmapentry);
-
-You can include as many colors in your color map as you like, though there are some restrictions related to the hardware.
-
-<h4>The type map </h4>
-Lines can be solid, dotted, dashed, dot-dashed, or user defined. For a user-defined type the pattern of solid and blank sections is listed.
-
-A type map is defined as follows:
-
-<h4>Example </h4>
-
-Handle(Aspect_TypeMap) typmap = new Aspect_TypeMap;
-{TColQuantity_Array1OfLength myLineStyle(1,2); myLineStyle.SetValue(1, 2); // the solid part is 2 mm myLineStyle.SetValue(2, 3); // the blank part is 3 mm Aspect_LineStyle linestyle1 (Aspect_TOL_SOLID); Aspect_LineStyle linestyle2 (Aspect_TOL_DASH); Aspect_LineStyle linestyle3 (myLineStyle);
-Aspect_LineStyle linestyle4 (Aspect_TOL_DOTDASH); Aspect_TypeMapEntry typmapentry1 (1, linestyle1); Aspect_TypeMapEntry typmapentry2 (2, linestyle2); Aspect_TypeMapEntry typmapentry3 (3, linestyle3); Aspect_TypeMapEntry typmapentry4 (4, linestyle4);
-typmap-AddEntry (typmapentry1);
-typmap-AddEntry (typmapentry2);
-typmap-AddEntry (typmapentry3);
-typmap-AddEntry (typmapentry4);
-
-
-*NOTE*
-*The line type enumeration and all the other enumerations are available from the Aspect package.*
-
-<h4>The width map </h4>
-The width map defines a set of levels of line thickness available to your application. Widths and all other distances are specified in mms or as members of an enumeration.
-
-A width map is defined as follows:
-<h4>Example </h4>
-
-Handle(Aspect_WidthMap) widmap = new Aspect_WidthMap; Aspect_WidthMapEntry widmapentry1 (1,Aspect_WOL_THIN); Aspect_WidthMapEntry widmapentry2 (2,Aspect_WOL_MEDIUM); Aspect_WidthMapEntry widmapentry3 (3, 3); Aspect_WidthMapEntry widmapentry4 (4, 40); widmap-AddEntry (widmapentry1); widmap-AddEntry (widmapentry2); widmap-AddEntry (widmapentry3); widmap-AddEntry (widmapentry4);
-
-The font map
-The font map defines a set of text fonts available to your application. Default fonts enumerated in Aspect may be used with addition of any other font known to the X driver, specifying the size and slant angle desired.
-
-A font map is defined as follows:
-
-<h4>Example </h4>
-
-Handle(Aspect_FontMap) fntmap = new Aspect_FontMap; Aspect_FontStyle fontstyle1 (*Courier-Bold*, 3, 0.0); Aspect_FontStyle fontstyle2 (*Helvetica-Bold*, 3, 0.0); Aspect_FontStyle fontstyle3 (Aspect_TOF_DEFAULT); Aspect_FontMapEntry fntmapentry1 (1, fontstyle1); Aspect_FontMapEntry fntmapentry2 (2, fontstyle2); Aspect_FontMapEntry fntmapentry3 (3, fontstyle3); fntmap-AddEntry (fntmapentry1); fntmap-AddEntry (fntmapentry2); fntmap-AddEntry (fntmapentry3);
-
-
-@subsubsection occt_1621831385_109097682123 Creating a 2D driver (a Windows example)
-
-<h4>Example </h4>
-
-Handle(WNT_GraphicDevice) TheGraphicDevice = ...; TCollection_ExtendedString aName(*2DV*);
-my2DViewer = new V2d_Viewer(TheGraphicDevice,
-aName.ToExtString());
-@subsubsection occt_1621831385_109097682124 Installing the maps
-
-When the 2D viewer has been created, you may install the maps created earlier.
-<h4>Example </h4>
-
-my2DViewer-SetColorMap(colormap);
-my2DViewer-SetTypeMap(typmap);
-my2DViewer-SetWidthMap(widthmap);
-my2DViewer-SetFontMap(fntmap);
-
-
-@subsubsection occt_1621831385_109097682125 Creating a view (a Windows example)
-
-It is assumed that a valid Windows window may be accessed via the method GetSafeHwnd().
-<h4>Example </h4>
+~~~~~
+ void Visual3d_Layer::AddLayerItem (const Handle (Visual3d_LayerItem)& Item)
+ void Visual3d_Layer::RemoveLayerItem (const Handle (Visual3d_LayerItem)& Item)
+ void Visual3d_Layer::RemoveAllLayerItems ()
+ const Visual3d_NListOfLayerItem& Visual3d_Layer::GetLayerItemList ()
+~~~~~
+The layer’s items are rendered when the method *void Visual3d_Layer::RenderLayerItems()* is called by the graphical driver.
-Handle(WNT_Window) aWNTWindow;
-aWNTWindow = new
-WNT_Window(TheGraphicDevice, GetSafeHwnd());
-aWNTWindow-SetBackground(Quantity_NOC_MATRAGRAY); Handle(WNT_WDriver) aDriver = new
-WNT_WDriver(aWNT_Window);
-myV2dView = new V2d_View(aDriver, my2dViewer, 0,0,50);
-// 0,0: view center and 50: view size
+The *Visual3d_LayerItem* has virtual methods that are used to render the item:
+~~~~~
+ void Visual3d_LayerItem::RedrawLayerPrs ()
+ void Visual3d_LayerItem::ComputeLayerPrs ()
+~~~~~
+The item presentation can be computed before drawing by the *ComputeLayerPrs* method to save time on redraw. It also has an additional flag that is used to tell that the presentation should be recomputed:
+~~~~~
+ void Visual3d_LayerItem::SetNeedToRecompute (const Standard_Boolean NeedToRecompute)
+ Standard_Boolean Visual3d_LayerItem::IsNeedToRecompute
+~~~~~
-@subsubsection occt_1621831385_109097682126 Creating the presentable object
+An example of *Visual3d_LayerItem* is *V3d_ColorScaleLayerItem* that represents the color scale entity as the layer’s item.
+The *V3d_ColorScaleLayerItem* sends render requests to the color scale entity represented by it. As this entity (*V3d_ColorScale*) is assigned to the *V3d_LayerMgr* it uses its overlay layer’s services for drawing:
-Follow the procedure below to compute the presentable object.
-**1. **Build a presentable object inheriting from AIS_InteractiveObject (refer to Chapter 1 Fundamental Concepts, Section Presentable objects)
-**2. **Re-use the graphic object provided as an argument of the Compute method for your presentable object.
<h4>Example </h4>
-void
-myPresentableObject::Compute (
-const Handle(Prs_Mgr_PresentationManager2D)&
-aPresentationManager,
-const Handle(Graphic2d_GraphicObject)& aGrObj,
-const Standard_Integer aMode)
+~~~~~
+// tell V3d_ColorScale to draw itself
+void V3d_ColorScaleLayerItem::RedrawLayerPrs ()
{
-...
+ Visual3d_LayerItem::RedrawLayerPrs ()
+ if (!MyColorScale.IsNull ())
+ MyColorScale-DrawScale ();
}
+// V3d_ColorScale has a reference to a LayerMgr
+void V3d_ColorScale::DrawScale ()
+{
+ // calls *V3d_ColorScale::PaintRect, V3d_ColorScale::PaintText, etc …
+}
-@subsubsection occt_1621831385_109097682127 Creating a primitive
-
-Primitives may be created using the resources of the Graphic2d package. Here for example an array is instantiated and filled with a set of three circles with different radii, line widths, and colors, centered on given origin coordinates (4.0, 1.0) and passed to the specified graphic object (go).
-<h4>Example </h4>
-
-Handle(Graphic2d_Circle) tcircle[4]; Quantity_Length radius; for (i=1; i=4; i++) { radius = Quantity_Length (i); tcircle[i-1] = new Graphic2d_Circle (aGrObj, 4.0, 1.0, radius);
-tcircle[i-1]-SetColorIndex (i);
-tcircle[i-1]-SetWidthIndex (1); }
-
-Add a filled rectangle to your graphic object. It will be put outside of your view mapping.
-<h4>Example </h4>
-
-TColStd_Array1OfReal aListX (1, 5);
-TColStd_Array1OfReal aListY (1, 5);
-aListX (1) = -7.0; aListY (1) = -1.0;
-aListX (2) = -7.0; aListY (2) = 1.0;
-aListX (3) = -5.0; aListY (3) = 1.0;
-aListX (4) = -5.0; aListY (4) = -1.0;
-aListX (5) = -7.0; aListY (5) = -1.0;
-Handle(Graphic2d_Polyline) rectangle =
-new Graphic2d_Polyline (go, 0., 0., aListX, aListY); rectangle-SetColorIndex (6);
-rectangle-SetWidthIndex (1);
-rectangle-SetTypeOfPolygonFilling(Graphic2d_TOPF_FILLED); rectangle-SetDrawEdge(Standard_True);
-*A given primitive can only be assigned to a single graphic object.*
-
-@image html /user_guides/visualization/images/visualization_image027.png
-@image latex /user_guides/visualization/images/visualization_image027.png
-Figure 17. Graphic object and view mapping in the space model.
-
-@subsection occt_1621831385_10909768213 Dealing with images
-
-@subsubsection occt_1621831385_109097682131 General case
-
-Images are primitives too. The graphic resources can currently accept all image types described in the *AlienImage* package. In the following example only **.xwd **formats are accepted.
-
-Define the primitive Image in the GraphicObject.
-<h4>Example </h4>
-
-Handle(Image_Image) anImage; if (XwdImage || RgbImage) { anImage = AlienUser-ToImage (); Handle(Graphic2d_Image) gImage = new Graphic2d_Image
-(aGrObj, anImage, 0., 0., 0., 0., Aspect_CP_CENTER); }
-
-
-<h4>NOTE</h4>
-*The above constructor for image takes as arguments the graphic object which will contain the image, the image itself, XY coordinates for the center, XY offsets in the device space, and a cardinal point value to give a direction of display. *
-
-Now update the view in the driver. In other words, draw the image.
-
-<h4>Example </h4>
-
-Standard_Boolean clear = Standard_True
-view-Update (driver, viewmapping, W/2., H/2., scale, clear);
-
-
-@subsubsection occt_1621831385_109097682132 Specific case: xwd format
-
-When the manipulated image is stored with the xwd format, a special class Graphic2d_ImageFile may be used to increase performance.
-<h4>Example </h4>
-
-OSD_Path aPath (*C:/test.xwd*);
-OSD_File aFile (aPath);
-Handle(Graphic2d_ImageFile)gImageFile =
-new Graphic2d_ImageFile (aGrObj,
-aFile,
-0.,0.,
-0.,0.,
-Aspect_CP_Center, 1);
-gImageFile-SetZoomable(Standard_True);
+// PaintRect method uses overlay layer of LayerMgr to draw a rectangle
+void V3d_ColorScale::PaintRect
+ (const Standard_Integer X, const Standard_Integer Y,
+ const Standard_Integer W, const Standard_Integer H,
+ const Quantity_Color aColor,
+ const Standard_Boolean aFilled)
+{
+ const Handle (Visual3d_Layer)& theLayer =
+ myLayerMgr-Overlay ();
+ …
+ theLayer-SetColor (aColor);
+ theLayer-DrawRectangle (X, Y, W, H);
+ …
+}
+~~~~~
+@subsubsection occt_visu_5_2_7 View background styles
+There are three types of background styles available for *V3d_view*: solid color, gradient color and image.
-The graphic contains now an image, which is manipulated as a primitive.
+To set solid color for the background you can use the following methods:
+~~~~~
+ void V3d_View::SetBackgroundColor
+ (const Quantity_TypeOfColor Type,
+ const Quantity_Parameter V1,
+ const Quantity_Parameter V2,
+ const Quantity_Parameter V3)
+~~~~~
+This method allows you to specify the background color in RGB (red, green, blue) or HLS (hue, lightness, saturation) color spaces, so the appropriate values of the Type parameter are *Quantity_TOC_RGB* and *Quantity_TOC_HLS*.
-@subsection occt_1621831385_10909768214 Dealing with text
+**Note** that the color value parameters *V1,V2,V3* should be in the range between *0.0-1.0.*
-The constructor for the Graphic2d_Text takes a reference point in the space model and an angle (in radians) as its arguments, as well as the graphic object to which it is assigned. Note that the angle is ignored unless the Xdps driver, which allows angled text, is in use.
-<h4>Example </h4>
+~~~~~
+ void V3d_View::SetBackgroundColor(const Quantity_Color &Color)
+ void V3d_View::SetBackgroundColor(const Quantity_NameOfColor Name)
+~~~~~
-TCollection_ExtendedString str1 (*yellow Courier-bold*); TCollection_ExtendedString str2 (*red Helevetica-bold*); TCollection_ExtendedString str3 (*green Aspect_TOF_DEFAULT*); Handle(Graphic2d_Text) t1 = new Graphic2d_Text
-(aGrObj, str1, 0.3, 0.3, 0.0);
-Handle(Graphic2d_Text) t2 = new Graphic2d_Text
-(aGrObj, str2, 0.0, 0.0, 0.0);
-Handle(Graphic2d_Text) t3 = new Graphic2d_Text
-(aGrObj, str3, -0.3, -0.3, 0.0);
-t1-SetFontIndex (1); t1-SetColorIndex (1);
-t2-SetFontIndex (2); t2-SetColorIndex (2);
-t3-SetFontIndex (3); t3-SetColorIndex (3);
+The gradient background style could be set up with the following methods:
+~~~~~
+ void V3d_View::SetBgGradientColors
+ (const Quantity_Color& Color1,
+ const Quantity_Color& Color2,
+ const Aspect_GradientFillMethod FillStyle,
+ const Standard_Boolean update)
+
+ void V3d_View::SetBgGradientColors
+ (const Quantity_NameOfColor Color1,
+ const Quantity_NameOfColor Color2,
+ const Aspect_GradientFillMethod FillStyle,
+ const Standard_Boolean update)
+~~~~~
+The *Color1* and *Color2* parameters define the boundary colors of interpolation, the *FillStyle* parameter defines the direction of interpolation. You can pass *Standard_True* as the last parameter to update the view.
-@subsection occt_1621831385_10909768215 Dealing with markers
+The fill style can be also set with the method *void V3d_View::SetBgGradientStyle(const Aspect_GradientFillMethod AMethod, const Standard_Boolean update)*.
-A marker is a primitive that retains its original size when the view is zoomed. Markers can be used, for example, as references to dimensions.
+To get the current background color you can use the following methods:
+~~~~~
+ void V3d_View::BackgroundColor
+ (const Quantity_TypeOfColor Type,
+ Quantity_Parameter &V1,
+ Quantity_Parameter &V2,
+ Quantity_Parameter &V3)
+ Quantity_Color V3d_View::BackgroundColor()
+ void V3d_View::GradientBackgroundColors(Quantity_Color& Color1, Quantity_Color& Color2)
+ Aspect_GradientBackground GradientBackground()
+~~~~~
+
+To set the image as a background and change the background image style you can use the following methods:
+~~~~~
+ * void V3d_View::SetBackgroundImage
+ (const Standard_CString FileName,
+ const Aspect_FillMethod FillStyle,
+ const Standard_Boolean update)
+ * void V3d_View::SetBgImageStyle
+ (const Aspect_FillMethod FillStyle,
+ const Standard_Boolean update)
+~~~~~
-@subsubsection occt_1621831385_109097682151 Vectorial markers
-Every marker takes an XY point as its reference point. The constructor also takes another pair of XY values as an offset from this reference point. For CircleMarker and EllipsMarker this offset point is its center. For PolylineMarker this offset point is its origin i.e. the first point in its list.
-In the example below, a rectangle is created using Graphic2d_Polyline.
-<h4>Example </h4>
+The *FileName* parameter defines the image file name and the path to it, the *FillStyle* parameter defines the method of filling the background with the image. The methods are:
+ * *Aspect_FM_NONE* - draws the image in the default position;
+ * *Aspect_FM_CENTERED* - draws the image at the center of the view;
+ * *Aspect_FM_TILED* tiles the view with the image;
+ * *Aspect_FM_STRETCH* stretches the image over the view.
-TColStd_Array1OfReal rListX (1, 5);
-TColStd_Array1OfReal rListY (1, 5);
-rListX (1) = -0.3; rListY (1) = -0.3;
-rListX (2) = -0.3; rListY (2) = 0.3;
-rListX (3) = 0.3; rListY (3) = 0.3;
-rListX (4) = 0.3; rListY (4) = -0.3;
-rListX (5) = -0.3; rListY (5) = -0.3;
-Handle(Graphic2d_Polyline) rp =
-new Graphic2d_Polyline (aGrObj, rListX, rListY);
+@subsubsection occt_visu_5_2_8 User-defined clipping planes
+The ability to define custom clipping planes could be very useful for some tasks. The *V3d* view provides such an opportunity.
+The *V3d_Plane* class provides the services of clipping planes: it holds the plane equation coefficients and provides its graphical representation. To set and get plane equation coefficients you can use the following methods:
+~~~~~
+ void V3d_Plane::SetPlane
+ (const Quantity_Parameter A,
+ const Quantity_Parameter B,
+ const Quantity_Parameter C,
+ const Quantity_Parameter D)
+ void V3d_Plane::Plane
+ (Quantity_Parameter& A,
+ Quantity_Parameter& B,
+ Quantity_Parameter& C,
+ Quantity_Parameter& D)
+~~~~~
+ *V3d_Plane* also provides display services:
+~~~~~
+ * void V3d_Plane::Display
+ (const Handle(V3d_View)& aView,
+ const Quantity_Color& aColor)
+ * void V3d_Plane::Erase ()
+ * Standard_Boolean V3d_Plane::IsDisplayed ()
+~~~~~
+The *Display* method could be redefined to provide custom representation of the clipping plane.
-Two Graphic2d_CircleMarkers are created. The first one has no offset from its center. The second is constrained to be a given offset from a reference point.
-<h4>Example </h4>
+The clipping planes could be activated with the methods *void V3d_View::SetPlaneOn (const Handle(V3d_Plane)& MyPlane)* and *void V3d_View::SetPlaneOn()*
-Handle(Graphic2d_CircleMarker) rc1 = new
-Graphic2d_CircleMarker
-(aGrObj, 0.04, 0.03, 0.0, 0.0, 0.01); Handle(Graphic2d_CircleMarker) rc2 = new
-Graphic2d_CircleMarker
-(aGrObj, 0.03, -0.03, 0.01, 0.0, 0.01);
-window-Clear ();
+The first method appends the given *V3d_Plane* to the internal list of user-defined clipping planes of a view and activates it. If the plane is already in the list, it becomes activated. The second method activates all of the planes defined for the view.
-@image html /user_guides/visualization/images/visualization_image028.png
-@image latex /user_guides/visualization/images/visualization_image028.png
-Figure 18. Figure of zoom and attachment point of a marker.
+The clipping planes could be deactivated with the similar methods *void V3d_View::SetPlaneOff(const Handle(V3d_Plane)& MyPlane)* and *void V3d_View::SetPlaneOff()*
+The only difference is that these methods remove the user-defined clipping planes from the internal list. Thus, the view retains only active clipping planes.
-@subsubsection occt_1621831385_109097682152 Indexed markers
+You can iterate through the active planes using the following methods:
+ * *void V3d_View::InitActivePlanes()* - sets the iterator to the beginning of the internal list of clipping planes;
+ * *Standard_Boolean V3d_View::MoreActivePlanes()* returns *Standard_True* if there are more active planes to return;
+ * *void V3d_View::NextActivePlanes()* sets the iterator to the next active plane in the list;
+ * *Handle(V3d_Plane) V3d_View::ActivePlane()* returns the active plane
-Once the marker map has been created, indexed markers may be added to a graphic object.
+or check if a certain clipping plane has been activated with method *Standard_Boolean V3d_View::IsActivePlane (const Handle (V3d_Plane)& aPlane)*
+
+The number of clipping planes is limited. The method *Standard_Boolean V3d_View::IfMorePlanes()* allows checking if it is possible to activate at least one more plane in the view or the limit has been reached.
+
<h4>Example </h4>
-Handle (Graphic2d_Marker) xmkr = new Graphic2d_Marker
-(aGrObj, 1, 0.04, 0.03, 0.0, 0.0, 0.0);
-Handle (Graphic2d_Marker) plusmkr = new Graphic2d_Marker
-(aGrObj, 2, 0.04, 0.0, 0.0, 0.0, 0.0);
-Handle (Graphic2d_Marker) oplusmkr = new Graphic2d_Marker
-(aGrObj, 3, 0.04, -0.03, 0.0, 0.0, 0.0);
-
-@subsection occt_1621831385_10909768216 Dragging with Buffers
-
-A **buffer** is used to draw very quickly a partial area of the scene without deleting the background context.
- A buffer contains a set of graphic objects or primitives which are to be moved, rotated or scaled above the scene in the front planes of the view (in this case, double-buffering is not active). For example:
-
-**1. **Draw a very complex scene in the view.
-**2. **Create a buffer of primitives with the primitive color index 10 and the font index 4:
-buffer = new Graphic2d_Buffer (view, 0., 0., 10, 4);
-
-**3. **Add graphic objects or primitives:
-buffer-Add (go);
-buffer-Add (tcircle[1]);
-buffer-Add (t1);
-
-**4. **Post the buffer in the view:
-buffer-Post ();
-
-**5. **Move, rotate or scale the buffer above the view:
-buffer-Move (x,y); buffer-Rotate (alpha);
-buffer-Scale (zoom_factor);
-
-**6. **Unpost the buffer from the view:
-buffer-Unpost ();
-@section occt_1621831385_86393950 2D Resources
-
-
-The 2D resources include the Graphic2d, Image, AlienImage, and V2d packages.
-
-
-@subsection occt_1621831385_863939501 Graphic2d
-
-
-@subsubsection occt_1621831385_8639395011 Overview
-
-The **Graphic2d** package is used to create a 2D graphic object. Each object, called a GraphicObject, is composed of primitives. Each primitive is a class and contains attributes. Each primitive has its own Draw method.
-
-A Graphic2d_Image is created from an Image from the Image package.
-
-
-@subsubsection occt_1621831385_8639395012 The services provided
-
-The **Graphic2d** packages provides classes for creating the following primitives:
- * Circle
- * Curve
- * Ellips
- * InfiniteLine
- * Polyline
- * Segment
- * SetOfSegments
- * Text
- * Marker
- * SetOfMarkers
- * VectorialMarker
- * CircleMarker
-
-**2D Resources **
- * PolylineMarker
- * EllipsMarker
- * Image
- * ImageFile
- * SetOfCurves
+~~~~~
+// try to use an existing clipping plane or create a new one
+Handle(V3d_Plane) aCustomPlane;
+myView-InitActivePlanes ();
+if (myView-MoreActivePlanes ())
+ aCustomPlane = myView-ActivePlane ();
+else
+ aCustomPlane = new V3d_Plane ();
+
+// calculate new coefficients
+Standard_Real a, b, c, d;
+Standard_Real x = 0.0, y = 0.0, z = 10.0;
+Standard_Real dx = 0.0, dy = 0.0, dz = 1.0;
+gp_Pln aPln (gp_Pnt (x, y, z), gp_Dir (dx, dy, dz));
+aPln.Coefficients (a, b, c, d);
+
+// update plane
+aCustomPlane-SetPlane (a, b, c, d);
+myView-SetPlaneOn (aCustomPlane);
+~~~~~
+@subsubsection occt_visu_5_2_9 Dumping a 3D scene into an image file
+The 3D scene displayed in the view could be dumped in high resolution into an image file. The high resolution (8192x8192 on some implementations) is achieved using the Frame Buffer Objects (FBO) provided by the graphic driver. Frame Buffer Objects enable off-screen rendering into a virtual view to produce images in the background mode (without displaying any graphics on the screen).
+The *V3d_View* has the following methods for dumping the 3D scene:
+* *Standard_Boolean V3d_View::Dump (const Standard_CString theFile, const Image_TypeOfImage theBufferType)* - dumps the scene into an image file with the view dimensions.
+* *Standard_Boolean V3d_View::Dump (const Standard_CString theFile, const Aspect_FormatOfSheetPaper theFormat, const Image_TypeOfImage theBufferType)* - allows making the dimensions of the output image compatible to a certain format of printing paper passed by *theFormat* argument.
+
+These methods dump the 3D scene into an image file passed by its name and path as theFile.
-@subsection occt_1621831385_863939502 Image
+The raster image data handling algorithm is based on the Image_PixMap class. The supported extensions are ".png", ".bmp", ".png", ".png".
-@subsubsection occt_1621831385_8639395021 Overview
+The value passed as *theBufferType* argument defines the type of the buffer for an output image *(RGB, RGBA, floating-point, RGBF, RGBAF)*. Both methods return *Standard_True* if the scene has been successfully dumped.
-The **Image** package provides the resources to produce and manage bitmap images. It has two purposes:
- * To define what is an image on the CAS.CADE platform.
- * To define operations which can be carried out on an image.
+**Note** that dumping the image for a paper format with large dimensions is a memory consuming operation, it might be necessary to take care of preparing enough free memory to perform this operation.
-The package allows the user to manipulate images without knowing their type. For various functionalities such as zoom, pan, and rotation, an application does not need to know the type nor the format of the image. Consequently, the image could be stored as an integer, real, or object of the Color type.
+* Handle_Image_PixMap V3d_View::ToPixMap (const Standard_Integer theWidth, const Standard_Integer theHeight, const Image_TypeOfImage theBufferType, const Standard_Boolean theForceCentered)* allows dumping the displayed 3d scene into a pixmap with a width and height passed as *theWidth* and theHeight arguments.
-Another important asset of the package is to make the handling of images independent of the type of pixel. Thus a new image based on a different pixel type can be created without rewriting any of the algorithms.
+The value passed as *theBufferType* argument defines the type of the buffer for a pixmap *(RGB, RGBA, floating-point, RGBF, RGBAF)*. The last parameter allows centering the 3D scene on dumping.
-@subsubsection occt_1621831385_8639395022 The services provided
+All these methods assume that you have created a view and displayed a 3d scene in it. However, the window used for such a view could be virtual, so you can dump the 3d scene in the background mode without displaying it on the screen. To use such an opportunity you can perform the following steps:
+* Create display connection;
+* Initialize graphic driver;
+* Create a window;
+* Set up the window as virtual, *Aspect_Window::SetVirtual()* ;
+* Create a view and an interactive context;
+* Assign the virtual window to the view;
+* Display a 3D scene;
+* Use one of the functions described above to dump the 3D scene.
-The classes **ColorImage** and **PseudoColorImage** define the two types of image, which can be handled by the Image toolkit. These classes support different types of operations, such as zoom and rotate. The **PixMap** class defines system-independent bitmaps. It stores raster image data and provides special services, such as saving the image data into an image file. The PixMaps are powered by the FreeImage library.
+The following example demonstrates this procedure for *WNT_Window* :
-**ColorImage** is used to create 24-bit TrueColor images:
- * Create a ColorImage object with a given background color.
- * Request the type of the image.
- * Request or set the color of a given pixel.
- * Zoom, rotating, translating, simple and refining transformations.
- * Set position and size.
- * Transpose, shift, clip, shift, clear.
- * Draw line and rectangle.
+~~~~~
+// create a dummy display connection
+Handle(Aspect_DisplayConnection) aDisplayConnection;
+
+// create a graphic driver
+Handle (Graphic3d_GraphicDriver) aDriver = Graphic3d::InitGraphicDriver (aDisplayConnection);
+
+// create a window
+Standard_Integer aDefWidth = 800;
+Standard_Integer aDefHeight = 600;
+Handle (WNT_WClass) aWClass =
+ new WNT_WClass ("Virtual Class",DefWindowProc,
+ CS_VREDRAW | CS_HREDRAW, 0, 0,
+ ::LoadCursor (NULL, IDC_ARROW));
+Handle (WNT_Window) aWindow =
+ new WNT_Window ("VirtualWnd", aWClass,
+ WS_OVERLAPPEDWINDOW, 0, 0,
+ aDefWidth, aDefHeight);
+
+// set up the window as virtual
+aWindow-SetVirtual (Standard_True);
+
+// create a view and an interactive context
+Handle (V3d_Viewer) aViewer =
+ new V3d_Viewer (aDriver,
+ Standard_ExtString ("Virtual"));
+Handle (AIS_InteractiveContext) aContext =
+ new AIS_InteractiveContext (aViewer);
+Handle (V3d_View) aView = aViewer-CreateView ();
+
+// assign the virtual window to the view
+aView-SetWindow (aWindow);
+
+// display a 3D scene
+Handle (AIS_Shape) aBox =
+ new AIS_Shape (BRepPrimAPI_MakeBox (5, 5, 5));
+aContext-Display (aBox);
+aView-FitAll();
-**PseudoColorImage** is used to create 32-bit images:
- * Create a PseudoColorImage object with a given background color associated with a given ColorMap (Generic, ColorCube, ColorRamp)
- * Ask or set the color of a given pixel, row, or column.
- * Find the maximum & minimum pixel values of an image.
- * Change the pixel values by scaling.
- * Change the pixel values below a threshold value.
- * Zoom, rotating, translating, simple and refining transformations.
- * Set position and size.
- * Transpose, shift, clip, shift, clear.
- * * Draw line and rectangle.
+// dump the 3D scene into an image file
+aView-Dump ("3dscene.png");
+~~~~~
-**PixMap **provides support for system-independent bitmaps:
- * Supports different kinds of raster images, such as 24-bit, 32-bit, 96-bit, 128-bit, or RGB, RGBA, floating-point RGB and RGBA.
- * Provides direct access to the pixel buffer.
- * Provides image dump services. The use of FreeImage library enhances these services with the capability of saving raster images into different image file formats. **Note** that without FreeImage library support, the raster images could be dumped into the PPM format only.
- * PixMaps could be used for handling system bitmaps and dumping window contents.
-
-**Convertor** is used to:
- * Change an image from a ColorImage to a PseudoColorImage. Select between two dithering algorithms for the change.
- * Change an image from a PseudoColorImage to a ColorImage.
- * Change a PseudoColorImage into one with a different ColorMap.
+@subsubsection occt_visu_5_2_10 Printing a 3D scene
-**LookupTable** is used to:
- * Transform the pixels of a PseudoColorImage.
+The contents of a view can be printed out. Moreover, the OpenGl graphic driver used by the v3d view supports printing in high resolution. The print method uses the OpenGl frame buffer (Frame Buffer Object) for rendering the view contents and advanced print algorithms that allow printing in, theoretically, any resolution.
-Various **PixelInterpolation** classes are available for dealing with pixel values at non-integer coordinates.
+The method *void V3d_View::Print(const Aspect_Handle hPrnDC, const Standard_Boolean showDialog, const Standard_Boolean showBackground, const Standard_CString filename, const Aspect_PrintAlgo printAlgorithm)* prints the view contents:
-The package also includes a number of **package methods** for zooming, rotation, translation, as well as simple and refining transformations.
+*hPrnDC* is the printer device handle. You can pass your own printer handle or "NULL" to select the printer by the default dialog. In that case you can use the default dialog or pass "Standard_False" as the showDialog argument to select the default printer automatically.
-@subsection occt_1621831385_863939503 AlienImage
+You can define the filename for the printer driver if you want to print out the result into a file.
+If you do not want to print the background, you can pass *Standard_False* as the *showBackground* argument.
+The *printAlgorithm* argument allows choosing between two print algorithms that define how the 3d scene is mapped to the print area when the maximum dimensions of the frame buffer are smaller than the dimensions of the print area by choosing *Aspect_PA_STRETCH* or *Aspect_PA_TILE*
-@subsubsection occt_1621831385_8639395031 Overview
+The first value defines the stretch algorithm: the scene is drawn with the maximum possible frame buffer dimensions and then is stretched to the whole printing area. The second value defines *TileSplit* algorithm: covering the whole printing area by rendering multiple parts of the viewer.
-The **AlienImage** package is used to import 2D images from some other format into the CAS.CADE format.
+**Note** that at the moment printing is implemented only for Windows.
-@subsubsection occt_1621831385_8639395032 Available Services
- * Reads the content of an AlienImage object from a file.
- * Writes the content of an AlienImage object to a file.
- * Converts an AlienImage object to an Image object.
- * Converts an Image object to an AlienImage object.
+@subsubsection occt_visu_5_2_11 Vector image export
-@subsection occt_1621831385_863939504 V2d
+The 3D content of a view can be exported to the vector image file format. The vector image export is powered by the GL2PS library. You can export your 3D scenes into a file format supported by the GL2PS library: PostScript (PS), Encapsulated PostScript (EPS), Portable Document Format (PDF), Scalable Vector Graphics (SVG), LaTeX file format and Portable LaTeX Graphics (PGF).
-@subsubsection occt_1621831385_8639395041 Overview
+The method *void Visual3d_View::Export (const Standard_CString FileName, const Graphic3d_ExportFormat Format, const Graphic3d_SortType aSortType, const Standard_Real Precision, const Standard_Address ProgressBarFunc, const Standard_Address ProgressObject)* of *Visual3d_View* class allows exporting a 3D scene:
-This package is used to build a 2D mono-view viewer in a windowing system. It contains the commands available within the viewer (zoom, pan, pick, etc).
+The *FileName* defines the output image file name and the *Format* argument defines the output file format:
+ * Graphic3d_EF_PostScript (PS),
+ * Graphic3d_EF_EhnPostScript (EPS),
+ * Graphic3d_EF_TEX (TEX),
+ * Graphic3d_EF_PDF (PDF),
+ * Graphic3d_EF_SVG (SVG),
+ * Graphic3d_EF_PGF (PGF)
-@subsubsection occt_1621831385_8639395042 The services provided
+The *aSortType* parameter defines *GL2PS* sorting algorithm for the primitives. The *Precision, ProgressBarFunc* and *ProgressObject* parameters are implemented for future uses and at the moment have no effect.
-The **V2d** package contains the **View** class. **View** is used to:
- * Create a view in an window.
- * Handle the view:
- * zoom
- * fit all
- * pan
- * translate
- * erase
- * pick
- * highlight
- * set drawing precision
- * Postscript output
+The *Export* method supports only basic 3d graphics and has several limitations:
+ * Rendering large scenes could be slow and can lead to large output files;
+ * Transparency is only supported for PDF and SVG output;
+ * Textures and some effects are not supported by the GL2PS library.
-@section occt_1621831385_1676618855 Graphic Attributes
-@subsection occt_1621831385_16766188551 Aspect
+@section occt_visu_6 Graphic Attributes
-@subsubsection occt_1621831385_167661885511 Overview
+@subsection occt_visu_6_1 Aspect Package
-The **Aspect** package provides classes for the graphic elements, which are common to all 2D and 3D viewers - screen background, windows, edges, groups of graphic attributes that can be used in describing 2D and 3D objects.
+The *Aspect* package provides classes for the graphic elements in the viewer:
+ * Color maps,
+ * Pixels,
+ * Groups of graphic attributes,
+ * Edges, lines, background,
+ * Font classes,
+ * Width map classes,
+ * Marker map classes,
+ * Type of Line map classes,
+ * Window,
+ * Driver, PlotterDriver (inherited by PS_Driver), WindowDriver,
+ * Enumerations for many of the above,
+ * Array instantiations for edges,
+ * Array instantiations for map entries for color, type, font, width, and marker.
-@subsubsection occt_1621831385_167661885512 The services provided
-The **Aspect** package provides classes to implement:
- * Color maps,
- * Pixels,
- * Groups of graphic attributes,
- * Edges, lines, background,
- * Font classes,
- * Width map classes,
- * Marker map classes,
- * Type of Line map classes,
- * Window,
- * Driver, PlotterDriver (inherited by PS_Driver), WindowDriver,
- * Graphic device (inherited by Xw_GraphicDevice, Graphic3d_GraphicDevice),
- * Enumerations for many of the above,
- * Array instantiations for edges,
- * Array instantiations for map entries for color, type, font, width, and marker.
--- /dev/null
+Voxel Package {#occt_voxels_wp}
+========================
+
+@tableofcontents
+
+@section occt_voxels_wp_1 Introduction
+
+ A voxel is a sub-volume box with constant scalar/vector value.
+ The object in voxel representation is split into many small sub-volumes (voxels)
+ and its properties are distributed through voxels.
+
+ Voxels are used for analysis and visualization of 3D-dimensional distribution of data.
+ Medicine (mainly, tomography), computational physics (hydrodynamics, aerodynamics, nuclear physics)
+ and many other industries use voxels for 3D data visualization and analysis of physical processes.
+
+ To produce a voxel representation the 3D space is split by equal intervals
+ along the main orthogonal coordinate axes to obtain nx x ny x nz voxels (small cubes):
+
+@image html voxels_wp_image003.jpg "A cube of 3 X 3 X 3 = 9 voxels."
+@image latex voxels_wp_image003.jpg "A cube of 3 X 3 X 3 = 9 voxels."
+
+ The data are attached to each voxel and remain the same within the voxel.
+ It means that we obtain the 3D space with discrete data distribution.
+
+ The number of voxels used in a calculation can vary.
+ An average model contains several tens of millions of voxels.
+ Such a great amount of data requires special algorithms of computation,
+ data containers keeping data in memory and visualization tools.
+
+ Open CASCADE Technology provides several basic data containers for voxels
+ with fast access to the data and optimal allocation of data in memory.
+
+ Also, a special visualization toolkit allows visualizing voxels
+ as colored or black/white points and cubes, displaying only the voxels
+ visible from the user's point of view.
+
+@image html voxels_wp_image004.jpg "A shape and its voxel representation"
+@image html voxels_wp_image005.jpg "A shape and its voxel representation"
+@image latex voxels_wp_image004.jpg "A shape and its voxel representation"
+@image latex voxels_wp_image005.jpg "A shape and its voxel representation"
+
+In these images a boundary representation is displayed to the left. In the center and to the right there are 3D discrete representations (or 3D discrete topology). Any solid shape can be translated into a voxel representation.
+
+@section occt_voxels_wp_2 Data structure
+
+ The data structure to store the voxels data is a special class which gives
+ fast access to the data of each voxel and allocates the data in an optimal way in the memory of a computer.
+
+ Fast access to the data is provided by means of bit-wise operators on the indices of internal arrays.
+
+ The optimal data allocation is reached through division
+ of the whole data set into data subsets and keeping only non-zero pieces of data in memory.
+
+ A voxel can contain different data types,
+ but presently Open CASCADE Technology implements only several basic ones:
+ * 1 bit or Boolean data type – a voxel contains a flag: 0 or 1 (false or true).
+ * 4 bits or Color data type – a voxel contains a value occupying 4 bits.
+ It is an integer in the range of 0 .. 15. The data can be divided into 16 subsets and displayed by Color-voxels.
+ * 4 bytes or Float data type – a voxel contains a floating-point data type.
+
+ In addition, the data structures provide methods for calculation of a center point
+ by voxel indices and a reverse task – fast search of a voxel by a point inside the cube of voxels.
+
+@section occt_voxels_wp_3 Algorithms
+
+ There are two service classes implemented for data structures of voxels:
+
+ * Boolean operations – provides simple boolean operations on cubes of voxels (fuse and cut).
+ * Voxelization – the conversion of a geometrical model into its voxel representation.
+
+### Boolean operations
+
+Fusion and cutting of two cubes of voxels are performed the class *Voxel_BooleanOperations*. The cubes should have the same size and be split into voxels in the same way.
+* <i>::Fuse()</i> summarizes the values of the corresponding voxels and limits the result by the upper limit (if succeeded).
+* <i>::Cut()</i> subtracts the values of the corresponding voxels and limits the result by zero.
+
+### Voxelization
+
+A class *Voxel_Convert* converts a *TopoDS_Shape* into one of the voxel data structures filling the solid shape by non-zero values.
+
+The algorithm of voxelization generates only 1-bit or 4-bit voxels. Other data types may be obtained by conversion of voxels from one type to another.
+
+Voxelization of a shape is performed by means of computation of intersection points between lines filling the volume and triangulation of the shape. The lines are parallel to main orthogonal axes and can intersect the shape from different sides: along +X, +Y and/or +Z axes.
+
+The algorithm can run in multi-threaded mode (the number of threads is unlimited). The user can see an integer value indicating the progress of computation.
+
+@section occt_voxels_wp_4 Visualization
+
+ Visualization of voxels is not a simple task due to a great amount of data used for 3D analysis.
+
+ Open CASCADE Technology allows visualization of a cube of voxels in two modes:
+ * Points – the centers of voxels as 3D points.
+ * Boxes – the voxels as 3D cubes of adjustable size.
+
+ A degenerated mode displays only the points (boxes) visible
+ from the point of view of the user for transformation operations (zoom, pan and rotate).
+
+ To focus on a particular part of the model non-relevant voxels can be erased.
+ The displayed region is defined by six co-ordinates along X, Y and Z axes .
+
+ It is possible to display the voxels from a particular range of values (iso-volume):
+
+@image html voxels_wp_image006.jpg "Iso-volume of a shape"
+@image latex voxels_wp_image006.jpg "Iso-volume of a shape"
+
+The voxels are displayed by means of "direct drawing in Open GL" technology or "user draw" technology. Therefore, some visualization files are compiled within Open CASCADE Technology, but the files of "direct drawing" are compiled by the end-user application.
+
+It is necessary to include the files *Voxel_VisData.h*, *VoxelClient_VisDrawer.h* and *VoxelClient_VisDrawer.cxx* into the visualization library of the application (containing all files of *OpenGl* package) and call the method *Voxel_VisDrawer::Init()* from the application before the visualization of voxels.
+
+@section occt_voxels_wp_5 Demo-application
+
+ A demonstration application has been created to show OCCT voxel models.
+ This is a test demo application because it includes a set of non-regression tests
+ and other commands for testing the functionality (accessible only through TEST pre-processor definition).
+
+ The *File* menu allows creation of canonical shapes (box, cylinder, sphere, torus) or loading of shapes in BREP format:
+
+@image html voxels_wp_image007.jpg "Demo-application. Creation or loading of a shape"
+@image latex voxels_wp_image007.jpg "Demo-application. Creation or loading of a shape"
+
+The menu *Converter* voxelizes the shape. Two types of voxels can be obtained: 1-bit or 4-bit voxels.
+ * 1-bit voxels are displayed in white color on black background.
+ * 4-bit voxels use 16 colors filling the model in a special way for demonstrative purposes:
+
+@image html voxels_wp_image008.jpg "Demo-application. Voxelization"
+@image latex voxels_wp_image008.jpg "Demo-application. Voxelization"
+
+ The converter uses two threads (two processors, if available) to perform voxelization.
+
+ The menu *Visualization* offers two modes of visualization: Points and Boxes,
+ allows defining the size of points and boxes (quadrangles),
+ the minimum and the maximum displayed color, and the boundaries of the bounding box for displayed voxels:
+
+@image html voxels_wp_image009.jpg "Demo-application. Visualization"
+@image latex voxels_wp_image009.jpg "Demo-application. Visualization"
+
+ The last menu, *Demo* contains a demo-command for running waves of 4-bit voxels:
+
+@image html voxels_wp_image010.jpg "Demo-application. Running waves"
+@image latex voxels_wp_image010.jpg "Demo-application. Running waves"
+
+@section occt_voxels_wp_6 Future development
+
+In the future OPEN CASCADE plans to develop the platform of voxels in the following directions:
+ * Data structure:
+ * Extension of the list of basic data types.
+ * Development of a deeper hierarchy of voxels (for example, octree – division of a voxel into 8 sub-voxels).
+ * Development of a doxel (4D voxels where the fourth co-ordinate is the time, for example).
+
+ * Algorithms:
+ * Conversion of a voxel model into a geometrical model (a reversed operation to voxelization).
+
+ * Visualization:
+ * Optimization of visualization (mainly, the speed of visualization).
+ * New shapes of voxel presentation in the 3D Viewer and new approaches to visualization.
+ * Selection of voxels.
+