下面函数中的代码是原先BOOL CKDtreeDoc::OnNewDocument()函数中的代码,在OnNewDocment中可以实现三维点的显示,而移动下面的函数中时,就显示不了点了!如果下面的函数的代码不动,还要在窗口中显示三维点,需要添加什么语句或方法是怎样的呀?请大家帮忙,谢谢!
void CKDtreeDoc::OnPointsRanom()
{
// TODO: Add your command handler code here/////////////////////////////////////////////
//user add
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对象Getptss1();
pts->point.setValues(0,POINTS_NUM,ptss);//为模型点赋值
pointmodel->addChild(pts);SoPointSet* PointSet = new SoPointSet();//设置点的输出序列
pointmodel->addChild(PointSet);root->addChild(pointmodel);//在浏览器中显示点模型////////////////////////////////////////////////////////////
}
void CKDtreeDoc::OnPointsRanom()
{
// TODO: Add your command handler code here/////////////////////////////////////////////
//user add
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对象Getptss1();
pts->point.setValues(0,POINTS_NUM,ptss);//为模型点赋值
pointmodel->addChild(pts);SoPointSet* PointSet = new SoPointSet();//设置点的输出序列
pointmodel->addChild(PointSet);root->addChild(pointmodel);//在浏览器中显示点模型////////////////////////////////////////////////////////////
}
解决方案 »
- 对UDP,TCP打洞的疑惑
- IOCP在socket关闭后的异步发送问题
- 求助!select为什么会一直返回0
- 有没有什么办法让 被发送的数据走指定的 拨号链路?
- socket广播后响应的问题
- 创建一个子进程,然后结束自己。子进程依然运行~!
- 如何在一个函数中同步的去执行两个外部命令,在线等待!!!
- 请教如何取得当前时间的毫秒数。
- 急,各位大侠帮帮忙,我的win2000启动后桌面上什么东西也没有了,不过可以进入到我的电脑里面,怎么办?
- 不懂VC与ATL,现要用ATL开发一个聊天软件,工作端用ATL开发,服务端可以用MFC,不知道如何下手,急急急.......高手帮帮忙,请提供源程序或方法!!
- ISoapConnectorPtr这些是什么类型
- 给一个mfc的Dialog上的一个combobox控件添加消息(event)失败,提示对话框是readonly?什么意思
你说的绘制函数,是说浏览器如何嵌入到视图中的吧 ,我用的是OpenInventor的浏览器,他的嵌入是在视图中,
绘制点模型的函数就是上述代码啊帮帮我呀 哎 两三天都过去了