OCCT基础类库介绍: Foundation Classes - Introduction

Introduction

This manual explains how to use Open CASCADE Technology (OCCT) Foundation Classes. It provides basic documentation on foundation classes.

Foundation Classes provide a variety of general-purpose services such as automated dynamic memory management (manipulation of objects by handle), collections, exception handling, genericity by down-casting and plug-in creation.

简介

本手册介绍如何使用开源 CASCADE 技术(OCCT)基础类库,并提供基础类的基本文档说明。

基础类库提供多种通用服务,例如自动化动态内存管理(通过句柄操作对象)、集合、异常处理,以及通过向下转型和插件创建实现的泛型特性。

Foundation Classes include the following:

基础类库包含以下内容:

Root Classes

Root classes are the basic data types and classes on which all the other classes are built. They provide:

  • fundamental types such as Boolean, Character, Integer or Real,
  • safe handling of dynamically created objects, ensuring automatic deletion of unreferenced objects (see Standard_Transient class),
  • standard and custom memory allocators,
  • extended run-time type information (RTTI) mechanism facilitating the creation of complex programs,
  • management of exceptions,
  • encapsulation of C++ streams. Root classes are mainly implemented in Standard package.
根类

根类是构建所有其他类的基本数据类型和类,其功能包括:

  • 布尔型、字符型、整型、实型等基本数据类型;
  • 动态创建对象的安全处理,确保自动删除未引用的对象(见 Standard_Transient 类);
  • 标准及自定义内存分配器;
  • 扩展运行时类型信息(RTTI)机制,便于创建复杂程序;
  • 异常管理;
  • C++ 流的封装。
    根类主要在 Standard 包中实现。
Strings

Strings are classes that handle dynamically sized sequences of characters based on UTF-8 and UTF-16 encodings. Strings may also be manipulated by handles, and consequently be shared. Strings are implemented in the TCollection package.

字符串

字符串类基于 UTF-8 和 UTF-16 编码处理动态长度的字符序列,也可通过句柄操作以实现共享。字符串在 TCollection 包中实现。

Collections

Collections are the classes that handle dynamically sized aggregates of data. Collection classes are generic and rely on C++ templates.

Collections include a wide range of generic classes such as run-time sized arrays, lists, stacks, queues, sets and hash maps. Collections are implemented in the TCollection and NCollection packages.

集合

集合类处理动态大小的数据聚合,具有泛型特性并依赖 C++ 模板,包含运行时大小的数组、列表、栈、队列、集合和哈希映射等多种泛型类。集合在 TCollection 和 NCollection 包中实现。

Collections of Standard Objects

The TColStd package provides frequently used instantiations of generic classes from the TCollection package with objects from the Standard package or strings from the TCollection package.

标准对象集合

TColStd 包提供 TCollection 包中泛型类的常用实例化,这些实例化对象来自 Standard 包或 TCollection 包中的字符串。

Vectors and Matrices

These classes provide commonly used mathematical algorithms and basic calculations (addition, multiplication, transposition, inversion, etc.) involving vectors and matrices.

向量和矩阵

这些类提供涉及向量和矩阵的常用数学算法和基本计算(加法、乘法、转置、求逆等)。

Primitive Geometric Types

Open CASCADE Technology primitive geometric types are a STEP-compliant implementation of basic geometric and algebraic entities. They provide:

Descriptions of elementary geometric shapes:
Points,
Vectors,
Lines,
Circles and conics,
Planes and elementary surfaces,
Positioning of these shapes in space or in a plane by means of an axis or a coordinate system,
Definition and application of geometric transformations to these shapes:
Translations
Rotations
Symmetries
Scaling transformations
Composed transformations
Tools (coordinates and matrices) for algebraic computation.

基本几何类型

开源 CASCADE 技术的基本几何类型是符合 STEP 标准的基本几何和代数实体实现,包括:

  • 基本几何形状的描述:
    • 向量
    • 直线
    • 圆和圆锥曲线
    • 平面和基本曲面
  • 通过轴或坐标系在空间或平面中定位这些形状;
  • 几何变换的定义和应用:
    • 平移
    • 旋转
    • 对称
    • 缩放变换
    • 复合变换
  • 代数计算工具(坐标和矩阵)。
Common Math Algorithms

Open CASCADE Technology common math algorithms provide a C++ implementation of the most frequently used mathematical algorithms. These include:

Algorithms to solve a set of linear algebraic equations,
Algorithms to find the minimum of a function of one or more independent variables,
Algorithms to find roots of one, or of a set, of non-linear equations,
Algorithms to find the eigen-values and eigen-vectors of a square matrix.

通用数学算法

开源 CASCADE 技术的通用数学算法提供 C++ 实现的常用数学算法,包括:

  • 求解线性代数方程组的算法;
  • 寻找单变量或多变量函数最小值的算法;
  • 寻找单非线性方程或方程组根的算法;
  • 求方阵特征值和特征向量的算法。
Exceptions

A hierarchy of commonly used exception classes is provided, all based on class Standard_Failure, the root of exceptions. Exceptions describe exceptional situations, which can arise during the execution of a function. With the raising of an exception, the normal course of program execution is abandoned. The execution of actions in response to this situation is called the treatment of the exception.

异常

系统提供基于异常根类 Standard_Failure 的常用异常类层次结构。异常用于描述函数执行过程中可能出现的异常情况,当异常抛出时,程序会放弃正常执行流程,针对该情况执行的操作称为异常处理。

Quantities

These are various classes supporting date and time information.

数量

这些类支持日期和时间等多种信息。

Application services

Foundation Classes also include implementation of several low-level services that facilitate the creation of customizable and user-friendly applications with Open CASCADE Technology. These include:

  • Unit conversion tools, providing a uniform mechanism for dealing with quantities and associated physical units: check unit compatibility, perform conversions of values between different units and so on (see package UnitsAPI);
  • Basic interpreter of expressions that facilitates the creation of customized scripting tools, generic definition of expressions and so on (see package ExprIntrp);
  • Tools for dealing with configuration resource files (see package Resource) and customizable message files (see package Message), making it easy to provide a multi-language support in applications;
  • Progress indication and user break interfaces, giving a possibility even for low-level algorithms to communicate with the user in a universal and convenient way.
应用服务

基础类库还包括若干底层服务的实现,便于使用开源 CASCADE 技术创建可定制的用户友好型应用,包括:

  • 单位转换工具(见 UnitsAPI 包),提供统一机制处理物理量和单位,如检查单位兼容性、执行单位间数值转换等;
  • 表达式基本解释器(见 ExprIntrp 包),便于创建自定义脚本工具和表达式通用定义;
  • 配置资源文件(见 Resource 包)和可定制消息文件(见 Message 包)处理工具,支持应用程序的多语言功能;
  • 进度指示和用户中断接口,使底层算法能以通用便捷的方式与用户交互。

你可能感兴趣的:(OCCT,开源)