root/OpenSceneGraph/trunk/src/osgWrappers/serializers/osg/TexGen.cpp @ 13041

Revision 13041, 1.4 kB (checked in by robert, 3 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
Line 
1#include <osg/TexGen>
2#include <osgDB/ObjectWrapper>
3#include <osgDB/InputStream>
4#include <osgDB/OutputStream>
5
6#define PLANE_FUNCTION( PROP, COORD ) \
7    static bool check##PROP( const osg::TexGen& tex ) { return true; } \
8    static bool read##PROP( osgDB::InputStream& is, osg::TexGen& tex ) { \
9        osg::Plane plane; is >> plane; \
10        tex.setPlane(COORD, plane); \
11        return true; \
12    } \
13    static bool write##PROP( osgDB::OutputStream& os, const osg::TexGen& tex ) { \
14        os << tex.getPlane(COORD) << std::endl; \
15        return true; \
16    }
17
18PLANE_FUNCTION( PlaneS, osg::TexGen::S )
19PLANE_FUNCTION( PlaneT, osg::TexGen::T )
20PLANE_FUNCTION( PlaneR, osg::TexGen::R )
21PLANE_FUNCTION( PlaneQ, osg::TexGen::Q )
22
23REGISTER_OBJECT_WRAPPER( TexGen,
24                         new osg::TexGen,
25                         osg::TexGen,
26                         "osg::Object osg::StateAttribute osg::TexGen" )
27{
28    BEGIN_ENUM_SERIALIZER( Mode, OBJECT_LINEAR );
29        ADD_ENUM_VALUE( OBJECT_LINEAR );
30        ADD_ENUM_VALUE( EYE_LINEAR );
31        ADD_ENUM_VALUE( SPHERE_MAP );
32        ADD_ENUM_VALUE( NORMAL_MAP );
33        ADD_ENUM_VALUE( REFLECTION_MAP );
34    END_ENUM_SERIALIZER();  // _mode
35
36    ADD_USER_SERIALIZER( PlaneS );
37    ADD_USER_SERIALIZER( PlaneT );
38    ADD_USER_SERIALIZER( PlaneR );
39    ADD_USER_SERIALIZER( PlaneQ );  //_plane_s, _plane_t, _plane_r, _plane_q
40}
Note: See TracBrowser for help on using the browser.