首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

关于OpenInventor浏览器嵌入的有关问题

2012-04-09 
关于OpenInventor浏览器嵌入的问题!下述代码编译通过,但嵌入的OpenInventor的浏览器不显示,是怎么回事呀?

关于OpenInventor浏览器嵌入的问题!
下述代码编译通过,但嵌入的OpenInventor的浏览器不显示,是怎么回事呀?请大家指正!急!
void CTestdataDoc::Myfunction()
{
root = new SoSeparator;
root->ref();

SoSeparator * pointmodel = new SoSeparator;//构建浏览器输出点模型

SoMaterial *myMaterial;
pointmodel->addChild(myMaterial = new SoMaterial);//设置模型点的材质颜色为红色
myMaterial->diffuseColor.setValue(1.0f,0.0f,0.0f);


SoDrawStyle *ds =new SoDrawStyle;//设置点的大小为3个像素点
ds->pointSize.setValue(3.0f);
pointmodel->addChild(ds);


SoCoordinate3 *pts =new SoCoordinate3;//构建3维坐标OpenInventor对象
//sigger();
pts->point.setValues(0,5,ptss);//为模型点赋值
pointmodel->addChild(pts);

SoPointSet* PointSet = new SoPointSet();//设置点的输出序列
pointmodel->addChild(PointSet);

root->addChild(pointmodel);//在浏览器中显示点模型*/

CTestdataView* pView;
pView=(CTestdataView*)((CFrameWnd*)AfxGetApp()->m_pMainWnd)->GetActiveView();

pView->viewer = new SoWinExaminerViewer(pView->m_hWnd);
pView->viewer->setTitle("sigger");
pView->viewer->setBackgroundColor(SbColor(0.75f,0.75f,1.0f));
pView->viewer->setDecoration(FALSE);
pView->viewer->setSceneGraph(root);
pView->viewer->show();
pView->viewer->viewAll();
}

[解决办法]
mark

热点排行