| 1 | #include <osgVolume/Volume> |
|---|
| 2 | #include <osgVolume/VolumeTile> |
|---|
| 3 | #include <osgDB/ObjectWrapper> |
|---|
| 4 | #include <osgDB/InputStream> |
|---|
| 5 | #include <osgDB/OutputStream> |
|---|
| 6 | |
|---|
| 7 | static bool checkTileID( const osgVolume::VolumeTile& tile ) |
|---|
| 8 | { return true; } |
|---|
| 9 | |
|---|
| 10 | static bool readTileID( osgDB::InputStream& is, osgVolume::VolumeTile& tile ) |
|---|
| 11 | { |
|---|
| 12 | osgVolume::TileID id; |
|---|
| 13 | is >> id.level >> id.x >> id.y >> id.z; |
|---|
| 14 | tile.setTileID( id ); |
|---|
| 15 | return true; |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | static bool writeTileID( osgDB::OutputStream& os, const osgVolume::VolumeTile& tile ) |
|---|
| 19 | { |
|---|
| 20 | const osgVolume::TileID& id = tile.getTileID(); |
|---|
| 21 | os << id.level << id.x << id.y << id.z << std::endl; |
|---|
| 22 | return true; |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | REGISTER_OBJECT_WRAPPER( osgVolume_VolumeTile, |
|---|
| 26 | new osgVolume::VolumeTile, |
|---|
| 27 | osgVolume::VolumeTile, |
|---|
| 28 | "osg::Object osg::Node osg::Group osgVolume::VolumeTile" ) |
|---|
| 29 | { |
|---|
| 30 | ADD_OBJECT_SERIALIZER( Volume, osgVolume::Volume, NULL ); |
|---|
| 31 | UPDATE_TO_VERSION( 90 ) |
|---|
| 32 | { |
|---|
| 33 | REMOVE_SERIALIZER( Volume ); |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | ADD_BOOL_SERIALIZER( Dirty, false ); |
|---|
| 37 | ADD_USER_SERIALIZER( TileID ); |
|---|
| 38 | ADD_OBJECT_SERIALIZER( VolumeTechnique, osgVolume::VolumeTechnique, NULL ); |
|---|
| 39 | ADD_OBJECT_SERIALIZER( Locator, osgVolume::Locator, NULL ); |
|---|
| 40 | ADD_OBJECT_SERIALIZER( Layer, osgVolume::Layer, NULL ); |
|---|
| 41 | } |
|---|