#include #include #include #include // _columns, _rows static bool checkArea( const osg::HeightField& shape ) { return true; } static bool readArea( osgDB::InputStream& is, osg::HeightField& shape ) { unsigned int numCols, numRows; is >> numCols >> numRows; shape.allocate( numCols, numRows ); return true; } static bool writeArea( osgDB::OutputStream& os, const osg::HeightField& shape ) { os << shape.getNumColumns() << shape.getNumRows() << std::endl; return true; } // _heights static bool checkHeights( const osg::HeightField& shape ) { return shape.getFloatArray()!=NULL; } static bool readHeights( osgDB::InputStream& is, osg::HeightField& shape ) { osg::ref_ptr array = is.readArray(); osg::FloatArray* farray = dynamic_cast( array.get() ); if ( farray ) { unsigned int numCols = shape.getNumColumns(), numRows = shape.getNumRows(); if ( farray->size()