⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clipnode.cpp

📁 最新osg包
💻 CPP
字号:
#include "osg/ClipNode"#include "osgDB/Registry"#include "osgDB/Input"#include "osgDB/Output"using namespace osg;using namespace osgDB;// forward declare functions to use later.bool ClipNode_readLocalData(Object& obj, Input& fr);bool ClipNode_writeLocalData(const Object& obj, Output& fw);// register the read and write functions with the osgDB::Registry.RegisterDotOsgWrapperProxy g_ClipNodeProxy(    new osg::ClipNode,    "ClipNode",    "Object Node ClipNode Group",    &ClipNode_readLocalData,    &ClipNode_writeLocalData);bool ClipNode_readLocalData(Object& obj, Input& fr){    bool iteratorAdvanced = false;    ClipNode& clipnode = static_cast<ClipNode&>(obj);    osg::ref_ptr<StateAttribute> sa=0;    while((sa=fr.readStateAttribute())!=0)    {        ClipPlane* clipplane = dynamic_cast<ClipPlane*>(sa.get());        if (clipplane) clipnode.addClipPlane(clipplane);        iteratorAdvanced = true;    }    return iteratorAdvanced;}bool ClipNode_writeLocalData(const Object& obj, Output& fw){    const ClipNode& clipnode = static_cast<const ClipNode&>(obj);    for(unsigned  int i=0;i<clipnode.getNumClipPlanes();++i)    {        fw.writeObject(*clipnode.getClipPlane(i));    }    return true;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -