Foundation Classes

 

Foundation Classes provide a variety of general-purpose services such as:

  • Primitive types, strings and various types of quantities

  • Automated management of heap memory

  • Exception handling

  • Classes for manipulating aggregates of data

  • Math tools such as vectors, matrices and primitive geometric types

  • Basic services for saving data in ASCII files

These services are organized into the following libraries:

  • Kernel Classes

  • Math Utilities

  • Basic Persistence 

image\fc.gif

 

 

Kernel Classes

Root Classes

Root Classes, primarily implemented in the Standard package, are the classes on which all other Open CASCADE classes are built. They provide:

Quantities

Quantitiy classes provide the following services:

Exceptions

Exception classes list all the exceptions, which can be raised by any Open CASCADE function. Syntaxes compatible with the ANSI C++ standard allow you to handle abnormal conditions.

Each exception inherits from Standard_Failure either directly or by inheriting from another exception.

Strings

String classes provide the following services to manipulate character strings:

Open CASCADE supports both ASCII character types (8-bit) and Unicode character types UTF-8 (8-bit) and utf-16 - UCS-2 (16-bit).

Memory management makes string objects easier to use than ordinary character arrays. Strings may also be manipulated by handles and therefore, can be shared.

These classes are implemented in the TCollection package and in the NCollection nocdlpack.

Collections

Apart from strings, the TCollection package contains classes of dynamically sized aggregates of data. They include a wide range of collections such as:

The TCollection package also offers specific iterators for sequences, maps, and stacks.

It also includes Collection classes. Collection classes are generic (C++ template-like), that is, they can contain a variety of objects which do not necessarily inherit from a unique root class. When you need to use a collection of a given object type, you must instantiate the collection for this specific type. Once the code for this declaration is compiled, all functions available on the generic collection are available on your instantiated class.

If you are not using CDL in your project (CDL compilation under WOK is necessary to instantiate any generic Collection from package TCollection), then you should use the Collections defined in nocdlpack NCollection. It contains definitions of the same generic collection classes described above, but in a form of C++ templates. Therefore, to instantiate any collection type no additional support is required beyond the ANSI C++ compiler.

Most collections follow value semantics, meaning that an instantiation of a collection is the actual collection, not a handle to it.

Collections of Standard Objects

TCollection

The collections of standard object classes provide frequently used instantiation of generic classes from the TCollection package with objects from the Standard package, strings from the TCollection package and geometric primitives.

There exists a limitation: Open Cascade generic classes require compilation of definitions in the CDL language and therefore can only be instantiated in WOK.

NCollection

The NCollection unit meets the requirements of Open Cascade community and all end users who do not use WOK development environment in their projects.

The NCollection provides a full replacement of all TCollection generic classes so that any Open Cascade collection could be instantiated via C++ template definitions. It is used in WOK environment (as nocdlpack development unit) or in any other configuration, since it only uses the standard capabilities of C++ language.

Earlier releases of Open Cascade offered NCollection classes in the form of macro definitions. Now it is strongly recommended to use C++ template classes instead, as they are more flexible and reliable. The old definitions based on C macros (in the header files NCollection_Define*.hxx) are kept for backward compatibility and no more supported.

 

Math Utilities

Vectors and Matrices

The Vector and Matrix classes provide commonly used mathematical algorithms which include:

These classes also provide a data structure in order to represent any expression, relation, or function used in mathematics, including the assignment of variables.

Primitive Geometric Types

Open CASCADE primitive geometric types are defined in the basic geometry package gp, which provides descriptions of primitive geometric shapes such as:

These types are handled by value only, and never by reference.

gp also provides a means of positioning your shapes in space or on a plane using an axis or coordinate system, and defines the following geometric transformations available for these positioned shapes:

Common Math Algorithms

The common math algorithms provided in Open CASCADE include:

An algorithm to find the eigenvalues and eigenvectors of a square matrix.