OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WriteFile.h
Go to the documentation of this file.
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 #ifndef OSGDB_WRITEFILE
15 #define OSGDB_WRITEFILE 1
16 
17 #include <osg/Image>
18 #include <osg/Shape>
19 #include <osg/Node>
20 
21 #include <osgDB/Export>
22 #include <osgDB/Registry>
23 
24 #include <string>
25 
26 namespace osgDB {
27 
35 extern OSGDB_EXPORT bool writeObjectFile(const osg::Object& object, const std::string& filename, const Options* options );
36 
43 inline bool writeObjectFile(const osg::Object& object, const std::string& filename)
44 {
45  return writeObjectFile( object, filename, Registry::instance()->getOptions() );
46 }
47 
55 extern OSGDB_EXPORT bool writeImageFile(const osg::Image& image, const std::string& filename, const Options* options );
56 
63 inline bool writeImageFile(const osg::Image& image, const std::string& filename)
64 {
65  return writeImageFile( image, filename, Registry::instance()->getOptions() );
66 }
67 
75 extern OSGDB_EXPORT bool writeHeightFieldFile(const osg::HeightField& hf, const std::string& filename, const Options* options );
76 
83 inline bool writeHeightFieldFile(const osg::HeightField& hf, const std::string& filename)
84 {
85  return writeHeightFieldFile( hf, filename, Registry::instance()->getOptions() );
86 }
87 
95 extern OSGDB_EXPORT bool writeNodeFile(const osg::Node& node, const std::string& filename, const Options* options );
96 
103 inline bool writeNodeFile(const osg::Node& node, const std::string& filename)
104 {
105  return writeNodeFile( node, filename, Registry::instance()->getOptions() );
106 }
107 
115 extern OSGDB_EXPORT bool writeShaderFile(const osg::Shader& shader, const std::string& filename, const Options* options );
116 
123 inline bool writeShaderFile(const osg::Shader& shader, const std::string& filename)
124 {
125  return writeShaderFile( shader, filename, Registry::instance()->getOptions() );
126 }
127 
135 extern OSGDB_EXPORT bool writeScriptFile(const osg::Script& image, const std::string& filename, const Options* options );
136 
143 inline bool writeScriptFile(const osg::Script& image, const std::string& filename)
144 {
145  return writeScriptFile( image, filename, Registry::instance()->getOptions() );
146 }
147 
148 }
149 
150 #endif
OSGDB_EXPORT bool writeShaderFile(const osg::Shader &shader, const std::string &filename, const Options *options)
OSGDB_EXPORT bool writeHeightFieldFile(const osg::HeightField &hf, const std::string &filename, const Options *options)
OSGDB_EXPORT bool writeNodeFile(const osg::Node &node, const std::string &filename, const Options *options)
OSGDB_EXPORT bool writeImageFile(const osg::Image &image, const std::string &filename, const Options *options)
OSGDB_EXPORT bool writeScriptFile(const osg::Script &image, const std::string &filename, const Options *options)
Definition: Archive.h:24
#define OSGDB_EXPORT
Definition: Export.h:39
static Registry * instance(bool erase=false)
Definition: Node.h:71
OSGDB_EXPORT bool writeObjectFile(const osg::Object &object, const std::string &filename, const Options *options)