为实现在机检测系统与通用实体建模软件的数据传输以及与虚拟仿真模型的实时交互,深入研究了基于初始图形交换规范(initial graphics exchange specification,IGES)的拓扑信息,提出了符合该文件格式中各种常用图形实体几何信息的存储结构.以Visual C++为开发平台,设计出符合IGES规范的数据结构及其程序算法,为非均匀有理B样条(non—uniform rational B—spline,NURBS)曲线、直线和组合曲线等多种图元实体都定义了各自的结构体,并且以结构体为节点将其存储到各自的链表当中,最终以类的形式进行封装.借助于OpenGL图形库函数读取存储到链表中的实体数据,实现了IGES数据中基面的绘制以及对内外边界的裁剪,最终完成了对在机检测系统中复杂空间型面的再生以及与虚拟仿真模型的交互.程序成功读取了约1M大小的IGES数据文件,并实现了原模型的再生.
To realize the data transmission of the on machine verification system with general solid modeling software and the real time interaction with virtual simulation model, the topology information based on initial graphics exchange specification (IGES) was studied, and the storage structure that conformed to the geometric information of various graphical entities in the formats of the file was put forward. Taking Visual C++ as the development platform, the data structure and the program algorithm that met the IGES were designed, and the structure bodies for some graphic elements were defined such as nonuniform rational B-spline (NURBS) curves, lines and composite curves. Besides, by taking the structure bodies as nodes, the entity data were respectively stored into various linked lists, and finally encapsulated in the form of class. By using the open graphics library (OpenGL) function to read the entity data stored in the linked lists, the drawing of the base surface in the IGES data and the cutting-off of the inner and outer boundaries were realized;and finally the regeneration of the complicated surface was completed, and the interaction with the virtual simulation model in the on machine verification system was realized. The program successfully reads the IGES data file about 1 M and realizes the regeneration of the original model.