1 介绍(Introduction) 1

如何使用Open CASCADE技术(OCCT)基础类.

This manual explains how to use Open CASCADE Technology (OCCT) Foundation Classes. It provides basic
documentation on foundation classes. For advanced information on foundation classes and their applications, see
our E-learning & Training offerings.

基础类提供了常规目的服务如动态内存管理(由handle管理), 集合, 异常处理, 常规转换, 插件生成.
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.

基础类包括: 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),
• configurable optimized memory manager increasing the performance of applications that intensively use dynamically created objects,
• 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 and MMgt packages.

字符串 Strings

Strings are implemented in the TCollection package.

集合 Collections

集合处理动态增长的聚合数据 Collections are the classes that handle dynamically sized aggregates of data.

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.

标准对象集合 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.

向量和矩阵 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.

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.

Exceptions

A hierarchy of commonly used exception classes is provided, all based on class 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.

Quantities

These are various classes supporting date and time information and fundamental types representing most physical
quantities such as length, area, volume, mass, density, weight, temperature, pressure etc.

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.

2 基础(Basics) 3

This chapter deals with basic services such as library organization, persistence, data types, memory management,
programming with handles, exception handling, genericity by downcasting and plug-in creation.

2.1 库组织(Library organization)  6

This chapter introduces some basic concepts, which are used not only in Foundation Classes, but throughout the
whole OCCT library.

2.1.1 模块和工具Modules and toolkits 6

在物理上, 一个共享库(.so或.dll)表示一个工具箱.

The whole OCCT library is organized in a set of modules. The first module, providing most basic services and used
by all other modules, is called Foundation Classes and described by this manual.
Every module consists primarily of one or several toolkits (though it can also contain executables, resource units
etc.). Physically a toolkit is represented by a shared library (e.g. .so or .dll). The toolkit is built from one or several
packages.

2.1.2 包 Packages 6

语义相关的一些类组成一个包. 如: 一个几何包 会包含点,线,圆类.

通常, 每个类名会有包前缀.

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 (functions). In practice, a class name is prefixed with the name of its package e.g. Geom_Circle. 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 bear the same name.

2.1.3 类 Classes 7
2.1.4 继承 Inheritance 8
2.2 数据类型 Data Types 8

在OCCT中, Handles能安全的操作动态对象内存分配与释放.

A variable of a type manipulated by handle which is not attached to an object is said to be null. To reference an
object, we instantiate the class with one of its constructors. For example, in C++:

Handle(myClass) m = new myClass;

In Open CASCADE Technology, the Handles are specific classes that are used to safely manipulate objects allocated
in the dynamic memory by reference, providing reference counting mechanism and automatic destruction of
the object when it is not referenced.

2.2.1 原始类型Primitive Types 9

Table 1: Equivalence between C++ Types and OCCT Primitive Types

C++ Types OCCT Types
int Standard_Integer
double Standard_Real
float Standard_ShortReal
unsigned int Standard_Boolean
char Standard_Character
short Standard_ExtCharacter
char* Standard_CString
void* Standard_Address
short* Standard_ExtString

2.2.2 值类型 Types manipulated by value  10
2.2.3 引用(handle)类型 Types manipulated by reference (handle)    11
2.2.4 什么时候必须用handle When is it necessary to use a handle? 11
2.3 使用Handles Programming with Handles   12

Class Standard_Transient is a root of a big hierarchy of OCCT classes that are said to be operable by handles.

Handle(Geom_Line) aLine; // "Handle(Geom_Line)" is expanded to "opencascade::handleL<Geom_Line>"

In addition, for standard OCCT classes additional typedef is defined for a handle, as the name of a class prefixed
by Handle_. For instance, the above example can be also coded as:

Handle_Geom_Line aLine; // "Handle_Geom_Line" is typedef to "opencascade::handleL<Geom_Line>"

2.3.1 Handle定义 Handle Definition    12
2.3.2 类型管理 Type Management   12
2.3.3 使用Handles创建对象 Using Handles to Create Objects    14
2.3.4 调用方法 Invoking Methods    14
2.3.5 Handle释放 Handle deallocation   15
2.3.6 循环引用Cycles  16
2.4 内存管理 Memory Management  16
2.4.1 使用内存管理器 Usage of Memory Manager   16
2.4.2 如何配置内存管理器 How to configure the Memory Manager    16
2.4.3 优化技巧 Optimization Techniques    17
2.4.4 优点和drawbacks Benefits and drawbacks    17
2.5 异常 Exceptions    18
2.5.1 介绍 Introduction   18
2.5.2 抛出异常 Raising an Exception  18
2.5.3 处理异常 Handling an Exception 19
2.5.4 多平台实现 Implementation on various platforms.  21
2.6 插件管理 Plug-In Management  22
2.6.1 插件发布 Distribution by Plug-Ins 22

3 集合,字符串,数量和单位转换 Collections, Strings, Quantities and Unit Conversion   24

3.1 集合 Collections    24
3.1.1 总览 Overview    24
3.1.2 一般集合 Generic general-purpose Aggregates 24
3.1.3 一般表 Generic Maps  26
3.1.4 遍历 Iterators 29
3.2 标准对象集合 Collections of Standard Objects 29
3.2.1 总览 Overview    30
3.2.2 描述 Description   30
3.3 NCollections   30
3.3.1 Overview    30
3.3.2 Instantiation of collection classes    31
3.3.3 Arrays and sequences 31
3.3.4 Maps  32
3.3.5 Other collection types  32
3.3.6 Features    34
3.4 字符串 Strings  36
3.4.1 示例 Examples    36
3.4.2 约定 Conversion   37
3.5 数量 Quantities    37
3.6 单位转换 Unit Conversion 38

4 数学基础和算法 Math Primitives and Algorithms   39

4.1 总览 Overview    39
4.2 向量和矩阵 Vectors and Matrices  39
4.3 基础几何类型 Primitive Geometric Types    40
4.4 基础几何类型集合 Collections of Primitive Geometric Types    41
4.5 基本几何库 Basic Geometric Libraries    41
4.6 常用数学算法 Common Math Algorithms    41
4.7 精度 Precision 43
4.7.1 精度包 The Precision package 44
4.7.2 标准精度值 Standard Precision values   44

Open CASCADE 基础类(Foundation Classes)的更多相关文章

  1. Introduction of Open CASCADE Foundation Classes

    Open CASCADE Foundation Classes Open CASCADE基础类 eryar@163.com 一.简介 1. 基础类概述 Foundation Classes Overv ...

  2. Introduction of OpenCascade Foundation Classes

    Introduction of OpenCascade Foundation Classes Open CASCADE基础类简介 eryar@163.com 一.简介 1. 基础类概述 Foundat ...

  3. Open CASCADE Technology(OCCT)概述

    OCCT模块结构图 基础类: Foundation Classes module underlies all other OCCT classes; 模型数据: Modeling Data modul ...

  4. Overview of OpenCascade Library

    Overview of OpenCascade Library eryar@163.com 摘要Abstract:对OpenCascade库的功能及其实现做简要介绍. 关键字Key Words:Ope ...

  5. OpenCascade简介

    OpenCascade简介   Overview of OpenCascade Library eryar@163.com 摘要Abstract:对OpenCascade库的功能及其实现做简要介绍. ...

  6. OpenCASCADE入门指南

    OpenCASCADE入门指南 eryar@163.com 一.概述 荀子说“君子性非异也,善假于物也”.当你会用英语,就可以与世界各国的人交流:当你会用编程语言,就可以与计算机交流:当你会用数学语言 ...

  7. 带你玩转Visual Studio

    带你玩转Visual Studio 带你新建一个工程 工程目录下各文件的含义 解决方案与工程 在这之前先了解一个概念:解决方案与工程. 解决方案(Solution):一个大型项目的整体的工作环境: 工 ...

  8. java常用英文解释

    java常用名词解释: OO: object-oriented ,面向对象 OOP:object-oriented programming,面向对象编程 Author:JCC Object:对象JDK ...

  9. .NET Framework 框架的一些简单介绍

    20世纪90年代以来出现的3种典型的组件技术: 1)OMC(对象组件模型)的CORBA2)Microsoft的COM/DCOM3)Sun公司的JavaBeans 在2002年,微软发布了.NET框架的 ...

随机推荐

  1. vmware安装 ios10.8 过程

    前言:由于mac笔记本太贵,并且对于用thinkpad 习惯的我,实在是不想买mac,没办法,只能在win7下面使用vmware 安装mac虚拟机了.但是ios的版本一直变,vmware也一直在升级, ...

  2. DRM in Android

    我们Tieto公司的MM专家在<程序员>第8期上发表了一篇关于DRM的文章,请大家指教. DRM in Android DRM,英文全称为Digital Rights Management ...

  3. TCP/IP协议原理与应用笔记03:IP地址分类

    1. 事实上,每个IP地址都包含两部分,即网络号和主机号. 例如:202.112.81.34指的 就是202.112.81这个网络的第34号机. 网络号:用于识别主机所在的网络: 主机号:用于识别该网 ...

  4. 自己写http获取网络资源和解析json数据

    虽然github上有很多开源的,方便的jar报,用起来也很方便,但我们也需要了解其中的原理,如何自己不用第三方jar包来获取网络资源 主要代码如下:  因为联网是耗时的操作,所以需要另开一个线程来执行 ...

  5. Activiti源码分析(框架、核心类。。。)

    http://jiangwenfeng762.iteye.com/blog/1338553 Activiti是业界很流行的java工作流引擎,关于Activiti与JBPM5的关系和如何选择不是本文要 ...

  6. 【MINA】粘包断包处理

    1.先解释下什么叫粘包和断包 粘包 就是数据以字节的形式在网络中传输,一个数据包的字节可能经过多次的读取粘合才能形成一个完整的数据包 断包 一次读取的内容可能包含了两个或多个数据包的内容,那么我们必须 ...

  7. 用ASP取出HTML里面的图片地址的函数

    用ASP取出HTML里面的图片地址的函数主要原理就是用正则判断的属性.这在采集程序中将非常有用. 函数如下: 以下是引用片段: Function ShowPic(str) Set objRegExp ...

  8. android手机震动

    Vibrator是安卓提供的震动器,其没有构造器,通过getSystemService(Context.VIBRATOR_SERVICE)方法获取对象.但使用此类时需要在清单文件中添加访问权限andr ...

  9. c#调用JAVA的Webservice处理XML数据及批量轮询的实现方法

    前段时间做一个调用外单位WEBSERVICE的项目,项目完成的功能其实很简单,就是我们单位有很多车友会员,我们想对他们提供车辆违章信息告之服务!我们这边交警部门给我们开放了WS的接口,我们就是想通过这 ...

  10. Web开发知识点总结

    前言:这是一篇简单的web开发知识点的总结,适用于刚开始学习编程的人来学习的.我是为了能够在熟记熟记这些知识点而总结的一篇文章. 1       什么是浏览器? (1) 浏览器就是接收浏览者的操作(打 ...