Open Inventor的VRML2转换SoToVRML2Action
来源:互联网 发布:hifi耳机推荐 知乎 编辑:程序博客网 时间:2024/05/16 02:13
view plaincopy to clipboardprint?
#include <Inventor/SoDB.h>
#include <Inventor/SoInteraction.h>
#include <Inventor/SoInput.h>
#include <Inventor/SoOutput.h>
#include <Inventor/actions/SoWriteAction.h>
#include <Inventor/actions/SoToVRML2Action.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/VRMLnodes/SoVRMLGroup.h>
int
main(int argc, char *argv[])
{
SoDB::init();
SoInteraction::init();
SoInput in;
in.openFile(argv[1]);
printf("Reading... ");
SoSeparator *root = SoDB::readAll(&in);
if (root) {
root->ref();
SbString hdr = in.getHeader();
in.closeFile();
printf("Converting... ");
SoToVRML2Action tovrml2;
tovrml2.apply(root);
SoVRMLGroup *newroot = tovrml2.getVRML2SceneGraph();
newroot->ref();
root->unref();
printf("Writing... ");
SoOutput out;
out.openFile("out.wrl");
out.setHeaderString("#VRML V2.0 utf8");
SoWriteAction wra(&out);
wra.apply(newroot);
out.closeFile();
newroot->unref();
}
return 0;
}
#include <Inventor/SoDB.h>
#include <Inventor/SoInteraction.h>
#include <Inventor/SoInput.h>
#include <Inventor/SoOutput.h>
#include <Inventor/actions/SoWriteAction.h>
#include <Inventor/actions/SoToVRML2Action.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/VRMLnodes/SoVRMLGroup.h>
int
main(int argc, char *argv[])
{
SoDB::init();
SoInteraction::init();
SoInput in;
in.openFile(argv[1]);
printf("Reading... ");
SoSeparator *root = SoDB::readAll(&in);
if (root) {
root->ref();
SbString hdr = in.getHeader();
in.closeFile();
printf("Converting... ");
SoToVRML2Action tovrml2;
tovrml2.apply(root);
SoVRMLGroup *newroot = tovrml2.getVRML2SceneGraph();
newroot->ref();
root->unref();
printf("Writing... ");
SoOutput out;
out.openFile("out.wrl");
out.setHeaderString("#VRML V2.0 utf8");
SoWriteAction wra(&out);
wra.apply(newroot);
out.closeFile();
newroot->unref();
}
return 0;
}
- Open Inventor的VRML2转换SoToVRML2Action
- Open Inventor的VRML2转换SoToVRML2Action
- Open Inventor的VRML2转换SoToVRML2Action
- Open Inventor数据转换技术的研究
- VRML2.0的关键字
- Open Inventor练习-SoWinExaminerViewer的继承演示
- open Inventor与vc6.0的配置
- Open Inventor 在STK 模型转换中的应用
- Open Inventor 简介
- Basic Open Inventor
- Practical Open Inventor
- Open Inventor 简介
- 一个Open Inventor程序
- Open Inventor学习资源
- open inventor 映射实例
- Open Inventor学习资源
- Open Inventor 简介
- Open Inventor Base Class
- 自己实现RMI(四)socket通信方案之UDP通信
- 设置静态时序分析环境
- 三星过后 亚马逊或是苹果的专利“攻击”对象
- LRU缓存设计
- ucos 统计任务 OS_TaskStat() .
- Open Inventor的VRML2转换SoToVRML2Action
- Unable to Read class 错误
- ucos ii 在arm2410-s上的移植 .
- 如何查询在哪里调用的某一个procedue?
- 宿主在Windows Service中的WCF(创建,安装,调用) (host到exe,非IIS)
- perl 读取json 数据
- 命令行svn全部操作
- uC/OS-II学习笔记-定义全局变量 .
- Nagios 3.x在线文档第2章