root/OpenSceneGraph/trunk/src/osgDB/WriteFile.cpp @ 13041

Revision 13041, 2.5 kB (checked in by robert, 3 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/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
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
24using namespace osg;
25using namespace osgDB;
26
27bool 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
35bool 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
43bool 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
50bool 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
57bool 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}
Note: See TracBrowser for help on using the browser.