OpenSceneGraph 3.6.5
WriteFile
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
26namespace osgDB {
27
35extern OSGDB_EXPORT bool writeObjectFile(const osg::Object& object, const std::string& filename, const Options* options );
36
43inline bool writeObjectFile(const osg::Object& object, const std::string& filename)
44{
45 return writeObjectFile( object, filename, Registry::instance()->getOptions() );
46}
47
55extern OSGDB_EXPORT bool writeImageFile(const osg::Image& image, const std::string& filename, const Options* options );
56
63inline bool writeImageFile(const osg::Image& image, const std::string& filename)
64{
65 return writeImageFile( image, filename, Registry::instance()->getOptions() );
66}
67
75extern OSGDB_EXPORT bool writeHeightFieldFile(const osg::HeightField& hf, const std::string& filename, const Options* options );
76
83inline bool writeHeightFieldFile(const osg::HeightField& hf, const std::string& filename)
84{
85 return writeHeightFieldFile( hf, filename, Registry::instance()->getOptions() );
86}
87
95extern OSGDB_EXPORT bool writeNodeFile(const osg::Node& node, const std::string& filename, const Options* options );
96
103inline bool writeNodeFile(const osg::Node& node, const std::string& filename)
104{
105 return writeNodeFile( node, filename, Registry::instance()->getOptions() );
106}
107
115extern OSGDB_EXPORT bool writeShaderFile(const osg::Shader& shader, const std::string& filename, const Options* options );
116
123inline bool writeShaderFile(const osg::Shader& shader, const std::string& filename)
124{
125 return writeShaderFile( shader, filename, Registry::instance()->getOptions() );
126}
127
135extern OSGDB_EXPORT bool writeScriptFile(const osg::Script& image, const std::string& filename, const Options* options );
136
143inline 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
The osgDB library provides support for reading and writing scene graphs, providing a plugin framework...
Definition Archive:24
OSGDB_EXPORT bool writeNodeFile(const osg::Node &node, const std::string &filename, const Options *options)
Write an osg::Node to file.
OSGDB_EXPORT bool writeObjectFile(const osg::Object &object, const std::string &filename, const Options *options)
Write an osg::Object to file.
OSGDB_EXPORT bool writeScriptFile(const osg::Script &image, const std::string &filename, const Options *options)
Write an osg::Script to file.
OSGDB_EXPORT bool writeHeightFieldFile(const osg::HeightField &hf, const std::string &filename, const Options *options)
Write an osg::HeightField to file.
OSGDB_EXPORT bool writeShaderFile(const osg::Shader &shader, const std::string &filename, const Options *options)
Write an osg::Shader to file.
OSGDB_EXPORT bool writeImageFile(const osg::Image &image, const std::string &filename, const Options *options)
Write an osg::Image to file.
Image class for encapsulating the storage texture image data.
Definition Image:179
Base class for all internal nodes in the scene graph.
Definition Node:72
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Definition ScriptEngine:30
osg::Shader is an application-level abstraction of an OpenGL glShader.
Definition Shader:89
Definition Shape:483
Options base class used for passing options into plugins to control their operation.
Definition Options:30
static Registry * instance(bool erase=false)
#define OSGDB_EXPORT
Definition Export:39

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.