📄 shademodel.cpp
字号:
#include "osg/ShadeModel"#include "osgDB/Registry"#include "osgDB/Input"#include "osgDB/Output"using namespace osg;using namespace osgDB;// forward declare functions to use later.bool ShadeModel_readLocalData(Object& obj, Input& fr);bool ShadeModel_writeLocalData(const Object& obj, Output& fw);// register the read and write functions with the osgDB::Registry.RegisterDotOsgWrapperProxy g_ShadeModelFuncProxy( new osg::ShadeModel, "ShadeModel", "Object StateAttribute ShadeModel", &ShadeModel_readLocalData, &ShadeModel_writeLocalData);bool ShadeModel_readLocalData(Object& obj,Input& fr){ bool iteratorAdvanced = false; ShadeModel& shademodel = static_cast<ShadeModel&>(obj); if (fr[0].matchWord("mode")) { if (fr[1].matchWord("FLAT")) { shademodel.setMode(ShadeModel::FLAT); fr+=2; iteratorAdvanced = true; } else if (fr[1].matchWord("SMOOTH")) { shademodel.setMode(ShadeModel::SMOOTH); fr+=2; iteratorAdvanced = true; } } return iteratorAdvanced;}bool ShadeModel_writeLocalData(const Object& obj, Output& fw){ const ShadeModel& shademodel = static_cast<const ShadeModel&>(obj); switch(shademodel.getMode()) { case(ShadeModel::FLAT): fw.indent() << "mode FLAT" <<std::endl; break; case(ShadeModel::SMOOTH): fw.indent() << "mode SMOOTH" <<std::endl; break; } return true;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -