root/OpenSceneGraph/trunk/src/osgPlugins/ive/ClusterCullingCallback.cpp @ 13041

Revision 13041, 2.2 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/**********************************************************************
2 *
3 *    FILE:            ClusterCullingCallback.cpp
4 *
5 *    DESCRIPTION:    Read/Write osg::ClusterCullingCallback in binary format to disk.
6 *
7 *    CREATED BY:        Auto generated by iveGenerate
8 *                    and later modified by Rune Schmidt Jensen.
9 *
10 *    HISTORY:        Created 25.3.2003
11 *
12 *    Copyright 2003 VR-C
13 **********************************************************************/
14
15#include "Exception.h"
16#include "ClusterCullingCallback.h"
17#include "Object.h"
18
19using namespace ive;
20
21void ClusterCullingCallback::write(DataOutputStream* out)
22{
23    // Write ClusterCullingCallback's identification.
24    out->writeInt(IVECLUSTERCULLINGCALLBACK);
25    // If the osg class is inherited by any other class we should also write this to file.
26    osg::Object*  obj = dynamic_cast<osg::Object*>(this);
27    if(obj)
28    {
29        ((ive::Object*)(obj))->write(out);
30    }
31    else
32        out_THROW_EXCEPTION("ClusterCullingCallback::write(): Could not cast this osg::ClusterCullingCallback to an osg::Object.");
33    // Write ClusterCullingCallback's properties.
34
35    out->writeVec3(_controlPoint);
36    out->writeVec3(_normal);
37    out->writeFloat(_radius);
38    out->writeFloat(_deviation);
39}
40
41void ClusterCullingCallback::read(DataInputStream* in)
42{
43    // Peek on ClusterCullingCallback's identification.
44    int id = in->peekInt();
45    if(id == IVECLUSTERCULLINGCALLBACK)
46    {
47        // Read ClusterCullingCallback's identification.
48        id = in->readInt();
49        // If the osg class is inherited by any other class we should also read this from file.
50        osg::Object*  obj = dynamic_cast<osg::Object*>(this);
51        if(obj)
52        {
53            ((ive::Object*)(obj))->read(in);
54        }
55        else
56            in_THROW_EXCEPTION("ClusterCullingCallback::read(): Could not cast this osg::ClusterCullingCallback to an osg::Object.");
57
58        // Read ClusterCullingCallback's properties
59
60        _controlPoint = in->readVec3();
61        _normal = in->readVec3();
62        _radius = in->readFloat();
63        _deviation = in->readFloat();
64
65    }
66    else
67    {
68        in_THROW_EXCEPTION("ClusterCullingCallback::read(): Expected ClusterCullingCallback identification.");
69    }
70}
Note: See TracBrowser for help on using the browser.