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

📄 convexplanarpolygon.cpp

📁 最新osg包
💻 CPP
字号:
/********************************************************************** * *    FILE:            ConvexPlanarPolygon.cpp * *    DESCRIPTION:    Read/Write osg::ConvexPlanarPolygon in binary format to disk. * *    CREATED BY:        Auto generated by iveGenerator *                    and later modified by Rune Schmidt Jensen. * *    HISTORY:        Created 23.4.2003 * *    Copyright 2003 VR-C **********************************************************************/#include "Exception.h"#include "ConvexPlanarPolygon.h"using namespace ive;void ConvexPlanarPolygon::write(DataOutputStream* out){    // Write ConvexPlanarPolygon's identification.    out->writeInt(IVECONVEXPLANARPOLYGON);    // If the osg class is inherited by any other class we should also write this to file.    //osg::Object*  obj = dynamic_cast<osg::Object*>(this);    //if(obj){    //    ((ive::Object*)(obj))->write(out);    //}    //else    //    throw Exception("ConvexPlanarPolygon::write(): Could not cast this osg::ConvexPlanarPolygon to an osg::Object.");    // Write ConvexPlanarPolygon's properties.    // Write Vertex list    VertexList vertexList = getVertexList();    int size = vertexList.size();    out->writeInt(size);    for(int i=0; i<size; i++){        out->writeVec3(vertexList[i]);    }}void ConvexPlanarPolygon::read(DataInputStream* in){    // Peek on ConvexPlanarPolygon's identification.    int id = in->peekInt();    if(id == IVECONVEXPLANARPOLYGON){        // Read ConvexPlanarPolygon's identification.        id = in->readInt();        // If the osg class is inherited by any other class we should also read this from file.        //osg::Object*  obj = dynamic_cast<osg::Object*>(this);        //if(obj){        //    ((ive::Object*)(obj))->read(in);        //}        //else        //    throw Exception("ConvexPlanarPolygon::read(): Could not cast this osg::ConvexPlanarPolygon to an osg::Object.");        // Read ConvexPlanarPolygon's properties        // Read Vertex list        int size = in->readInt();        for(int i=0; i<size; i++){            add(in->readVec3());        }    }    else{        throw Exception("ConvexPlanarPolygon::read(): Expected ConvexPlanarPolygon identification.");    }}

⌨️ 快捷键说明

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