?? geode.cpp
字號(hào):
#include "osg/Geode"#include "osgDB/Registry"#include "osgDB/Input"#include "osgDB/Output"using namespace osg;using namespace osgDB;// forward declare functions to use later.bool Geode_readLocalData(Object& obj, Input& fr);bool Geode_writeLocalData(const Object& obj, Output& fw);// register the read and write functions with the osgDB::Registry.RegisterDotOsgWrapperProxy g_GeodeProxy( new osg::Geode, "Geode", "Object Node Geode", &Geode_readLocalData, &Geode_writeLocalData);bool Geode_readLocalData(Object& obj, Input& fr){ bool iteratorAdvanced = false; Geode& geode = static_cast<Geode&>(obj); int num_drawables; if ((fr[0].matchWord("num_drawables") || fr[0].matchWord("num_geosets")) && fr[1].getInt(num_drawables)) { // could allocate space for children here... fr+=2; iteratorAdvanced = true; } Drawable* drawable = NULL; while((drawable=fr.readDrawable())!=NULL) { geode.addDrawable(drawable); iteratorAdvanced = true; } return iteratorAdvanced;}bool Geode_writeLocalData(const osg::Object& obj, Output& fw){ const Geode& geode = static_cast<const Geode&>(obj); fw.indent() << "num_drawables " << geode.getNumDrawables() << std::endl; for(unsigned int i=0;i<geode.getNumDrawables();++i) { fw.writeObject(*geode.getDrawable(i)); } return true;}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -