查看: 672|回复: 1

智能指针的assign函数如何关联?

[复制链接]

该用户从未签到

发表于 2015-1-3 11:23:13 | 显示全部楼层 |阅读模式
本帖最后由 颂鼎 于 2015-1-3 14:00 编辑
  1.   
  2. #include <osg/Geode>
  3. #include <osgViewer/Viewer>
  4. #include <osg/StateSet>
  5. #include <osg/Camera>
  6. #include <osg/MatrixTransform>
  7. #include <osg/Switch>
  8. #pragma comment(lib,"OpenThreadsd.lib")
  9. #pragma comment(lib,"osgd.lib")
  10. #pragma comment(lib,"osgDBd.lib")
  11. #pragma comment(lib,"osgAPExd.lib")
  12. #pragma comment(lib,"osgGAd.lib")
  13. #pragma comment(lib,"osgUtild.lib")
  14. #pragma comment(lib,"osgTextd.lib")
  15. #pragma comment(lib,"osgSimd.lib")
  16. #pragma comment(lib,"osgViewerd.lib")
  17. using namespace osg;

  18. class cbase :public Switch{
  19. public:
  20.         cbase(){};
  21.         virtual ~cbase(){};

  22. };

  23. class sub : public cbase{
  24. public:
  25.         sub(){};
  26.         ~sub(){};
  27.         void Update(){};
  28. };

  29. int _tmain(int argc, _TCHAR* argv[])
  30. {
  31.         osg::ref_ptr<cbase> pBase = new sub;
  32.         sub* pSub = dynamic_cast<sub*>(pBase.Release());
  33.        
  34.         return 0;
  35. }


复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表