| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | #include <osg/Notify> |
|---|
| 15 | #include <osg/Object> |
|---|
| 16 | #include <osg/Image> |
|---|
| 17 | #include <osg/Node> |
|---|
| 18 | #include <osg/Group> |
|---|
| 19 | #include <osg/Geode> |
|---|
| 20 | |
|---|
| 21 | #include <osgDB/Registry> |
|---|
| 22 | #include <osgDB/WriteFile> |
|---|
| 23 | |
|---|
| 24 | using namespace osg; |
|---|
| 25 | using namespace osgDB; |
|---|
| 26 | |
|---|
| 27 | bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const Options* options ) |
|---|
| 28 | { |
|---|
| 29 | ReaderWriter::WriteResult wr = Registry::instance()->writeObject( object, filename, options ); |
|---|
| 30 | if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl; |
|---|
| 31 | return wr.success(); |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | bool osgDB::writeImageFile(const Image& image,const std::string& filename, const Options* options ) |
|---|
| 36 | { |
|---|
| 37 | ReaderWriter::WriteResult wr = Registry::instance()->writeImage( image, filename, options ); |
|---|
| 38 | if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl; |
|---|
| 39 | return wr.success(); |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const Options* options ) |
|---|
| 44 | { |
|---|
| 45 | ReaderWriter::WriteResult wr = Registry::instance()->writeHeightField( HeightField, filename, options ); |
|---|
| 46 | if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl; |
|---|
| 47 | return wr.success(); |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const Options* options ) |
|---|
| 51 | { |
|---|
| 52 | ReaderWriter::WriteResult wr = Registry::instance()->writeNode( node, filename, options ); |
|---|
| 53 | if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl; |
|---|
| 54 | return wr.success(); |
|---|
| 55 | } |
|---|
| 56 | |
|---|
| 57 | bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const Options* options ) |
|---|
| 58 | { |
|---|
| 59 | ReaderWriter::WriteResult wr = Registry::instance()->writeShader( shader, filename, options ); |
|---|
| 60 | if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl; |
|---|
| 61 | return wr.success(); |
|---|
| 62 | } |
|---|