OpenSceneGraph
Classes | Typedefs | Enumerations | Functions | Variables
osgDB Namespace Reference

The osgDB library provides support for reading and writing scene graphs, providing a plugin framework and file utility classes. More...

Classes

class  Archive
 Base class for implementing database Archives. More...
 
class  AuthenticationDetails
 
class  AuthenticationMap
 
struct  base64_decodestate
 
struct  base64_encodestate
 
class  Base64decoder
 
class  Base64encoder
 
class  BaseCompressor
 
class  BaseSerializer
 
struct  basic_type_wrapper
 basic structure for custom runtime inheritance checking More...
 
class  BitFlagsSerializer
 
class  ClassInterface
 ClassInterface provides a general means of checking for supported properties of classes, and getting/setting those properties. More...
 
class  DatabasePager
 Database paging class which manages the loading of files in a background thread, and synchronizing of loaded models with the main scene graph. More...
 
class  DatabaseRevision
 
class  DatabaseRevisions
 
class  DeprecatedDotOsgWrapperManager
 deprecated. More...
 
class  DotOsgWrapper
 deprecated. More...
 
class  DynamicLibrary
 DynamicLibrary - encapsulates the loading and unloading of dynamic libraries, typically used for loading ReaderWriter plug-ins. More...
 
class  EnumSerializer
 
class  ExternalFileWriter
 Helper allowing 'intelligent' writing of external files (images, shaders, etc.), regarding to a main file (a scene), especially in plugins. More...
 
class  Field
 deprecated. More...
 
class  FieldReader
 deprecated. More...
 
class  FieldReaderIterator
 deprecated. More...
 
class  FileCache
 
class  FileList
 
class  FileLocationCallback
 
struct  FileNameComparator
 Functor for helping sort filename in alphabetical and numerical order when using in conjunction with std::sort. More...
 
class  FindFileCallback
 
struct  FinishedObjectReadCallback
 
class  GLenumSerializer
 
class  ifstream
 
class  ImageOptions
 
class  ImagePager
 
class  ImageProcessor
 
class  ImageSerializer
 
class  Input
 deprecated. More...
 
class  InputException
 
class  InputIterator
 
class  InputStream
 
class  IntLookup
 
class  IsAVectorSerializer
 
class  ListSerializer
 
class  MapBaseSerializer
 
class  MapIteratorObject
 
class  MapSerializer
 
class  MatrixSerializer
 
struct  MethodObject
 
class  ObjectCache
 
struct  ObjectGLenum
 
class  ObjectMark
 
class  ObjectProperty
 
class  ObjectSerializer
 
class  ObjectWrapper
 
struct  ObjectWrapperAssociate
 
class  ObjectWrapperManager
 
class  ofstream
 
class  Options
 Options base class used for passing options into plugins to control their operation. More...
 
class  Output
 deprecated. More...
 
class  OutputException
 
class  OutputIterator
 
class  OutputStream
 
class  ParameterOutput
 
struct  PluginFunctionProxy
 
class  PropByRefSerializer
 
class  PropByValSerializer
 
class  ReaderWriter
 Pure virtual base class for reading and writing of non native formats. More...
 
class  ReaderWriterInfo
 
class  ReadFileCallback
 
class  RegisterCompressorProxy
 
class  RegisterCustomWrapperProxy
 
class  RegisterDotOsgWrapperProxy
 deprecated. More...
 
class  RegisterImageProcessorProxy
 Proxy class for automatic registration of reader/writers with the Registry. More...
 
class  RegisterReaderWriterProxy
 Proxy class for automatic registration of reader/writers with the Registry. More...
 
class  RegisterWrapperProxy
 
class  Registry
 Registry is a singleton factory which stores the reader/writers which are linked in at runtime for reading non-native file formats. More...
 
class  SharedStateManager
 
class  StringSerializer
 
class  TemplateRegisterDotOsgWrapperProxy
 deprecated. More...
 
class  TemplateSerializer
 
struct  type_wrapper
 a class template that checks inheritance between a given Object's class and a class defined at compile time through the template parameter T. More...
 
struct  UpdateWrapperVersionProxy
 
class  UserLookupTableProxy
 
class  UserSerializer
 
class  VectorBaseSerializer
 
class  VectorSerializer
 
class  WriteFileCallback
 
class  XmlNode
 XmlNode class for very basic reading and writing of xml files. More...
 

Typedefs

typedef std::deque< std::string > FilePathList
 list of directories to search through which searching for files. More...
 
typedef osg::ObjectObjectPtr
 
typedef std::vector< std::string > DirectoryContents
 simple list of names to represent a directory's contents. More...
 
typedef std::list< std::string > FileNameList
 
typedef std::list< osg::ref_ptr< ReaderWriterInfo > > ReaderWriterInfoList
 
typedef std::vector< std::string > StringList
 

Enumerations

enum  CaseSensitivity { CASE_SENSITIVE, CASE_INSENSITIVE }
 
enum  base64_decodestep { step_a, step_b, step_c, step_d }
 
enum  base64_encodestep { step_A, step_B, step_C }
 
enum  FileType { FILE_NOT_FOUND, REGULAR_FILE, DIRECTORY }
 
enum  CopyFileResult {
  COPY_FILE_OK, COPY_FILE_SOURCE_EQUALS_DESTINATION, COPY_FILE_BAD_ARGUMENT, COPY_FILE_SOURCE_MISSING,
  COPY_FILE_SOURCE_NOT_OPENED, COPY_FILE_DESTINATION_NOT_OPENED, COPY_FILE_READ_ERROR, COPY_FILE_WRITE_ERROR
}
 

Functions

OSGDB_EXPORT ArchiveopenArchive (const std::string &filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint=4096)
 Open an archive for reading or writing. More...
 
OSGDB_EXPORT ArchiveopenArchive (const std::string &filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, Options *options)
 Open an archive for reading or writing. More...
 
OSGDB_EXPORT osgDB::BaseSerializer::Type getTypeEnumFromPtr (const osg::Object *)
 
OSGDB_EXPORT const char * getTypeStringFromPtr (const osg::Object *)
 
OSGDB_EXPORT osgDB::BaseSerializer::Type getTypeEnumFromPtr (const osg::Image *)
 
OSGDB_EXPORT const char * getTypeStringFromPtr (const osg::Image *)
 
void base64_init_encodestate (base64_encodestate *state_in)
 
void base64_init_decodestate (base64_decodestate *state_in)
 
OSGDB_EXPORT std::string convertUTF16toUTF8 (const wchar_t *source, unsigned sourceLength)
 
OSGDB_EXPORT std::wstring convertUTF8toUTF16 (const char *source, unsigned sourceLength)
 
OSGDB_EXPORT std::string convertUTF16toUTF8 (const std::wstring &s)
 
OSGDB_EXPORT std::string convertUTF16toUTF8 (const wchar_t *s)
 
OSGDB_EXPORT std::wstring convertUTF8toUTF16 (const std::string &s)
 
OSGDB_EXPORT std::wstring convertUTF8toUTF16 (const char *s)
 
OSGDB_EXPORT std::string convertStringFromCurrentCodePageToUTF8 (const char *source, unsigned sourceLength)
 
OSGDB_EXPORT std::string convertStringFromUTF8toCurrentCodePage (const char *source, unsigned sourceLength)
 
OSGDB_EXPORT std::string convertStringFromCurrentCodePageToUTF8 (const std::string &s)
 
OSGDB_EXPORT std::string convertStringFromCurrentCodePageToUTF8 (const char *s)
 
OSGDB_EXPORT std::string convertStringFromUTF8toCurrentCodePage (const std::string &s)
 
OSGDB_EXPORT std::string convertStringFromUTF8toCurrentCodePage (const char *s)
 
OSGDB_EXPORT std::string getFilePath (const std::string &filename)
 Gets the parent path from full name (Ex: /a/b/c.Ext => /a/b). More...
 
OSGDB_EXPORT std::string getFileExtension (const std::string &filename)
 Gets the extension without dot (Ex: /a/b/c.Ext => Ext). More...
 
OSGDB_EXPORT std::string getFileExtensionIncludingDot (const std::string &filename)
 Gets the extension including dot (Ex: /a/b/c.Ext => .Ext). More...
 
OSGDB_EXPORT std::string getLowerCaseFileExtension (const std::string &filename)
 Gets the lowercase extension without dot (Ex: /a/b/c.Ext => ext). More...
 
OSGDB_EXPORT std::string getSimpleFileName (const std::string &fileName)
 Gets file name with extension (Ex: /a/b/c.Ext => c.Ext). More...
 
OSGDB_EXPORT std::string getNameLessExtension (const std::string &fileName)
 Gets file path without last extension (Ex: /a/b/c.Ext => /a/b/c ; file.ext1.ext2 => file.ext1). More...
 
OSGDB_EXPORT std::string getNameLessAllExtensions (const std::string &fileName)
 Gets file path without all extensions (Ex: /a/b/c.Ext => /a/b/c ; file.ext1.ext2 => file). More...
 
OSGDB_EXPORT std::string getStrippedName (const std::string &fileName)
 Gets file name without last extension (Ex: /a/b/c.Ext => c ; file.ext1.ext2 => file.ext1). More...
 
OSGDB_EXPORT std::string getPathRelative (const std::string &from, const std::string &to)
 If 'to' is in a subdirectory of 'from' then this function returns the subpath, otherwise it just returns the file name. More...
 
OSGDB_EXPORT std::string getPathRoot (const std::string &path)
 Gets root part of a path ("/" or "C:"), or an empty string if none found. More...
 
OSGDB_EXPORT bool isAbsolutePath (const std::string &path)
 Tests if path is absolute, as !getPathRoot(path).empty(). More...
 
OSGDB_EXPORT std::string convertFileNameToWindowsStyle (const std::string &fileName)
 Converts forward slashes (/) to back slashes (). More...
 
OSGDB_EXPORT std::string convertFileNameToUnixStyle (const std::string &fileName)
 Converts back slashes () to forward slashes (/). More...
 
OSGDB_EXPORT std::string convertToLowerCase (const std::string &fileName)
 
OSGDB_EXPORT char getNativePathSeparator ()
 Get the path separator for the current platform. More...
 
OSGDB_EXPORT bool isFileNameNativeStyle (const std::string &fileName)
 Check if the path contains only the current platform's path separators. More...
 
OSGDB_EXPORT std::string convertFileNameToNativeStyle (const std::string &fileName)
 Convert the path to contain only the current platform's path separators. More...
 
OSGDB_EXPORT bool equalCaseInsensitive (const std::string &lhs, const std::string &rhs)
 
OSGDB_EXPORT bool equalCaseInsensitive (const std::string &lhs, const char *rhs)
 
OSGDB_EXPORT bool containsServerAddress (const std::string &filename)
 
OSGDB_EXPORT std::string getServerProtocol (const std::string &filename)
 
OSGDB_EXPORT std::string getServerAddress (const std::string &filename)
 
OSGDB_EXPORT std::string getServerFileName (const std::string &filename)
 
OSGDB_EXPORT std::string concatPaths (const std::string &left, const std::string &right)
 Concatenates two paths. More...
 
OSGDB_EXPORT std::string getRealPath (const std::string &path)
 Removes . More...
 
OSGDB_EXPORT void getPathElements (const std::string &path, std::vector< std::string > &out_elements)
 Splits a path into elements between separators (including Windows' root, if any). More...
 
OSGDB_EXPORT void stringcopy (char *dest, const char *src, size_t length)
 
OSGDB_EXPORT FILE * fopen (const char *filename, const char *mode)
 Overload of the standard fopen function. More...
 
OSGDB_EXPORT bool makeDirectory (const std::string &directoryPath)
 Make a new directory. More...
 
OSGDB_EXPORT bool makeDirectoryForFile (const std::string &filePath)
 Make a new directory for a given file. More...
 
OSGDB_EXPORT std::string getCurrentWorkingDirectory (void)
 Get current working directory. More...
 
OSGDB_EXPORT bool setCurrentWorkingDirectory (const std::string &newCurrentWorkingDirectory)
 Set current working directory. More...
 
OSGDB_EXPORT bool fileExists (const std::string &filename)
 return true if a file exists. More...
 
OSGDB_EXPORT FileType fileType (const std::string &filename)
 return type of file. More...
 
OSGDB_EXPORT std::string findFileInPath (const std::string &filename, const FilePathList &filePath, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
 find specified file in specified file path. More...
 
OSGDB_EXPORT std::string findFileInDirectory (const std::string &fileName, const std::string &dirName, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
 return the directory/filename of a file if its is contained within specified directory. More...
 
OSGDB_EXPORT DirectoryContents getDirectoryContents (const std::string &dirName)
 Return the contents of a directory. More...
 
OSGDB_EXPORT DirectoryContents getSortedDirectoryContents (const std::string &dirName)
 Return the contents of a directory, sorting the names into alphabetic and numberical order. More...
 
OSGDB_EXPORT DirectoryContents expandWildcardsInFilename (const std::string &filename)
 Return the list of filenames that match the given filename with wildcards. More...
 
OSGDB_EXPORT CopyFileResult copyFile (const std::string &source, const std::string &destination)
 Copy a file to another location, overwriting if necessary. More...
 
void setDataFilePathList (const FilePathList &filepath)
 
void setDataFilePathList (const std::string &paths)
 
FilePathListgetDataFilePathList ()
 
OSGDB_EXPORT std::string findDataFile (const std::string &filename, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
 Search for specified file in file system, checking the DataFilePathList for possible paths, returning the full path of the first valid file found, return an empty string if no string is found. More...
 
OSGDB_EXPORT std::string findDataFile (const std::string &filename, const Options *options, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
 Search for specified file in file system, checking first the database path set in the Options structure, then the DataFilePathList for possible paths, returning the full path of the first valid file found, return an empty string if no string is found. More...
 
void setLibraryFilePathList (const FilePathList &filepaths)
 
void setLibraryFilePathList (const std::string &paths)
 
FilePathListgetLibraryFilePathList ()
 
OSGDB_EXPORT std::string findLibraryFile (const std::string &filename, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
 
OSGDB_EXPORT void convertStringPathIntoFilePathList (const std::string &paths, FilePathList &filepath)
 convert a string containing a list of paths delimited either with ';' (Windows) or ':' (All other platforms) into FilePath representation. More...
 
OSGDB_EXPORT bool containsCurrentWorkingDirectoryReference (const FilePathList &paths)
 Return true if FilePathList contains a filepath that is significies checking of the current working directory. More...
 
OSGDB_EXPORT void appendPlatformSpecificLibraryFilePaths (FilePathList &filepath)
 
OSGDB_EXPORT void appendPlatformSpecificResourceFilePaths (FilePathList &filepath)
 
void OSGDB_EXPORT open (std::fstream &fs, const char *filename, std::ios_base::openmode mode)
 Convenience function for fstream open , std::ifstream, and std::ofstream to automatically handle UTF-8 to UTF-16 filename conversion. More...
 
template<class Iterator >
void writeArray (Output &fw, Iterator first, Iterator last, int noItemsPerLine=0)
 
template<class Iterator >
void writeArrayAsInts (Output &fw, Iterator first, Iterator last, int noItemsPerLine=0)
 
FileNameList OSGDB_EXPORT listAllAvailablePlugins ()
 
bool OSGDB_EXPORT queryPlugin (const std::string &fileName, ReaderWriterInfoList &infoList)
 
bool OSGDB_EXPORT outputPluginDetails (std::ostream &out, const std::string &fileName)
 
OSGDB_EXPORT osg::ref_ptr< osg::ObjectreadRefObjectFile (const std::string &filename, const Options *options)
 Read an osg::Object from file. More...
 
osg::ref_ptr< osg::ObjectreadRefObjectFile (const std::string &filename)
 Read an osg::Object from file. More...
 
template<class T >
osg::ref_ptr< T > readRefFile (const std::string &filename, const Options *options)
 
template<class T >
osg::ref_ptr< T > readRefFile (const std::string &filename)
 
OSGDB_EXPORT osg::ref_ptr< osg::ImagereadRefImageFile (const std::string &filename, const Options *options)
 Read an osg::Image from file. More...
 
osg::ref_ptr< osg::ImagereadRefImageFile (const std::string &filename)
 Read an osg::Image from file. More...
 
OSGDB_EXPORT osg::ref_ptr< osg::HeightFieldreadRefHeightFieldFile (const std::string &filename, const Options *options)
 Read an osg::HeightField from file. More...
 
osg::ref_ptr< osg::HeightFieldreadRefHeightFieldFile (const std::string &filename)
 Read an osg::HeightField from file. More...
 
OSGDB_EXPORT osg::ref_ptr< osg::NodereadRefNodeFile (const std::string &filename, const Options *options)
 Read an osg::Node from file. More...
 
osg::ref_ptr< osg::NodereadRefNodeFile (const std::string &filename)
 Read an osg::Node from file. More...
 
OSGDB_EXPORT osg::ref_ptr< osg::NodereadRefNodeFiles (std::vector< std::string > &fileList, const Options *options)
 Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more than one subgraph has been loaded. More...
 
osg::ref_ptr< osg::NodereadRefNodeFiles (std::vector< std::string > &fileList)
 Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more than one subgraph has been loaded. More...
 
OSGDB_EXPORT osg::ref_ptr< osg::NodereadRefNodeFiles (osg::ArgumentParser &parser, const Options *options)
 Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more than one subgraph has been loaded. More...
 
osg::ref_ptr< osg::NodereadRefNodeFiles (osg::ArgumentParser &parser)
 Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more than one subgraph has been loaded. More...
 
OSGDB_EXPORT osg::ref_ptr< osg::ShaderreadRefShaderFile (const std::string &filename, const Options *options)
 Read an osg::Shader from file. More...
 
osg::ref_ptr< osg::ShaderreadRefShaderFile (const std::string &filename)
 Read an osg::Shader from file. More...
 
osg::ref_ptr< osg::ShaderreadRefShaderFile (osg::Shader::Type type, const std::string &filename, const Options *options)
 Read an osg::Shader from file and set to specified shader type. More...
 
osg::ref_ptr< osg::ShaderreadRefShaderFile (osg::Shader::Type type, const std::string &filename)
 Read an osg::Shader from file and set to specified shader type Return valid osg::Shader on success, return NULL on failure. More...
 
OSGDB_EXPORT osg::ref_ptr< osg::ShaderreadRefShaderFileWithFallback (osg::Shader::Type type, const std::string &filename, const Options *options, const char *fallback)
 Read an osg::Shader from file and set to specified shader type, if a shader isn't loaded fallback to specific shader source. More...
 
osg::ref_ptr< osg::ShaderreadRefShaderFileWithFallback (osg::Shader::Type type, const std::string &filename, const char *fallback)
 Read an osg::Shader from file and set to specified shader type, if a shader isn't loaded fallback to specific shader source. More...
 
OSGDB_EXPORT osg::ref_ptr< osg::ScriptreadRefScriptFile (const std::string &filename, const Options *options)
 Read an osg::Script from file. More...
 
osg::ref_ptr< osg::ScriptreadRefScriptFile (const std::string &filename)
 Read an osg::Script from file. More...
 
void readCommandLine (osg::ArgumentParser &parser)
 read the command line arguments. More...
 
OSGDB_EXPORT void split (const std::string &src, StringList &list, char separator=' ')
 
OSGDB_EXPORT bool writeObjectFile (const osg::Object &object, const std::string &filename, const Options *options)
 Write an osg::Object to file. More...
 
bool writeObjectFile (const osg::Object &object, const std::string &filename)
 Write an osg::Object to file. More...
 
OSGDB_EXPORT bool writeImageFile (const osg::Image &image, const std::string &filename, const Options *options)
 Write an osg::Image to file. More...
 
bool writeImageFile (const osg::Image &image, const std::string &filename)
 Write an osg::Image to file. More...
 
OSGDB_EXPORT bool writeHeightFieldFile (const osg::HeightField &hf, const std::string &filename, const Options *options)
 Write an osg::HeightField to file. More...
 
bool writeHeightFieldFile (const osg::HeightField &hf, const std::string &filename)
 Write an osg::HeightField to file. More...
 
OSGDB_EXPORT bool writeNodeFile (const osg::Node &node, const std::string &filename, const Options *options)
 Write an osg::Node to file. More...
 
bool writeNodeFile (const osg::Node &node, const std::string &filename)
 Write an osg::Node to file. More...
 
OSGDB_EXPORT bool writeShaderFile (const osg::Shader &shader, const std::string &filename, const Options *options)
 Write an osg::Shader to file. More...
 
bool writeShaderFile (const osg::Shader &shader, const std::string &filename)
 Write an osg::Shader to file. More...
 
OSGDB_EXPORT bool writeScriptFile (const osg::Script &image, const std::string &filename, const Options *options)
 Write an osg::Script to file. More...
 
bool writeScriptFile (const osg::Script &image, const std::string &filename)
 Write an osg::Script to file. More...
 
OSGDB_EXPORT XmlNodereadXmlFile (const std::string &filename, const Options *options)
 read an Xml file, find the file in Options DataFilePathList. More...
 
XmlNodereadXmlFile (const std::string &filename)
 read an Xml file, find the file in osgDB::Registry's eaderWriter::Options DataFilePathList. More...
 
OSGDB_EXPORT XmlNodereadXmlStream (std::istream &fin)
 read an Xml from from an istream. More...
 
OSGDB_EXPORT std::string trimEnclosingSpaces (const std::string &str)
 

Variables

const int BUFFERSIZE = 8192
 
const unsigned int PLUGIN_VERSION = 2
 
const int BOOL_SIZE = 1
 
const int CHAR_SIZE = 1
 
const int SHORT_SIZE = 2
 
const int INT_SIZE = 4
 
const int LONG_SIZE = 4
 
const int INT64_SIZE = 8
 
const int FLOAT_SIZE = 4
 
const int DOUBLE_SIZE = 8
 
const int GLENUM_SIZE = 4
 
const int ID_BYTE_ARRAY = 0
 
const int ID_UBYTE_ARRAY = 1
 
const int ID_SHORT_ARRAY = 2
 
const int ID_USHORT_ARRAY = 3
 
const int ID_INT_ARRAY = 4
 
const int ID_UINT_ARRAY = 5
 
const int ID_FLOAT_ARRAY = 6
 
const int ID_DOUBLE_ARRAY = 7
 
const int ID_VEC2B_ARRAY = 8
 
const int ID_VEC3B_ARRAY = 9
 
const int ID_VEC4B_ARRAY = 10
 
const int ID_VEC4UB_ARRAY = 11
 
const int ID_VEC2S_ARRAY = 12
 
const int ID_VEC3S_ARRAY = 13
 
const int ID_VEC4S_ARRAY = 14
 
const int ID_VEC2_ARRAY = 15
 
const int ID_VEC3_ARRAY = 16
 
const int ID_VEC4_ARRAY = 17
 
const int ID_VEC2D_ARRAY = 18
 
const int ID_VEC3D_ARRAY = 19
 
const int ID_VEC4D_ARRAY = 20
 
const int ID_VEC2UB_ARRAY = 21
 
const int ID_VEC3UB_ARRAY = 22
 
const int ID_VEC2US_ARRAY = 23
 
const int ID_VEC3US_ARRAY = 24
 
const int ID_VEC4US_ARRAY = 25
 
const int ID_VEC2I_ARRAY = 26
 
const int ID_VEC3I_ARRAY = 27
 
const int ID_VEC4I_ARRAY = 28
 
const int ID_VEC2UI_ARRAY = 29
 
const int ID_VEC3UI_ARRAY = 30
 
const int ID_VEC4UI_ARRAY = 31
 
const int ID_UINT64_ARRAY = 32
 
const int ID_INT64_ARRAY = 33
 
const int ID_DRAWARRAYS = 50
 
const int ID_DRAWARRAY_LENGTH = 51
 
const int ID_DRAWELEMENTS_UBYTE = 52
 
const int ID_DRAWELEMENTS_USHORT = 53
 
const int ID_DRAWELEMENTS_UINT = 54
 
const int INDENT_VALUE = 2
 
const int IMAGE_INLINE_DATA = 0
 
const int IMAGE_INLINE_FILE = 1
 
const int IMAGE_EXTERNAL = 2
 
const int IMAGE_WRITE_OUT = 3
 
const char UNIX_PATH_SEPARATOR = '/'
 
const char WINDOWS_PATH_SEPARATOR = '\\'
 

Detailed Description

The osgDB library provides support for reading and writing scene graphs, providing a plugin framework and file utility classes.

The plugin framework in centered around the osgDB::Registry, and allows plugins which provide specific file format support to be dynamically loaded on demand.

Typedef Documentation

◆ DirectoryContents

typedef std::vector<std::string> osgDB::DirectoryContents

simple list of names to represent a directory's contents.

◆ FileNameList

typedef std::list<std::string> osgDB::FileNameList

◆ FilePathList

typedef std::deque< std::string > osgDB::FilePathList

list of directories to search through which searching for files.

List of directories to search through which searching for files.

◆ ObjectPtr

◆ ReaderWriterInfoList

◆ StringList

typedef std::vector<std::string> osgDB::StringList

Enumeration Type Documentation

◆ base64_decodestep

Enumerator
step_a 
step_b 
step_c 
step_d 

◆ base64_encodestep

Enumerator
step_A 
step_B 
step_C 

◆ CaseSensitivity

Enumerator
CASE_SENSITIVE 
CASE_INSENSITIVE 

◆ CopyFileResult

Enumerator
COPY_FILE_OK 

Operation done.

COPY_FILE_SOURCE_EQUALS_DESTINATION 

Operation is useless (source == destination).

COPY_FILE_BAD_ARGUMENT 
COPY_FILE_SOURCE_MISSING 

Source file doesn't exist.

COPY_FILE_SOURCE_NOT_OPENED 

Error opening source file.

COPY_FILE_DESTINATION_NOT_OPENED 

Error opening destination file.

COPY_FILE_READ_ERROR 
COPY_FILE_WRITE_ERROR 

◆ FileType

Enumerator
FILE_NOT_FOUND 
REGULAR_FILE 
DIRECTORY 

Function Documentation

◆ appendPlatformSpecificLibraryFilePaths()

OSGDB_EXPORT void osgDB::appendPlatformSpecificLibraryFilePaths ( FilePathList filepath)

Referenced by getLibraryFilePathList().

◆ appendPlatformSpecificResourceFilePaths()

OSGDB_EXPORT void osgDB::appendPlatformSpecificResourceFilePaths ( FilePathList filepath)

Referenced by getLibraryFilePathList().

◆ base64_init_decodestate()

void osgDB::base64_init_decodestate ( base64_decodestate state_in)
inline

◆ base64_init_encodestate()

void osgDB::base64_init_encodestate ( base64_encodestate state_in)
inline

◆ concatPaths()

OSGDB_EXPORT std::string osgDB::concatPaths ( const std::string &  left,
const std::string &  right 
)

Concatenates two paths.

◆ containsCurrentWorkingDirectoryReference()

OSGDB_EXPORT bool osgDB::containsCurrentWorkingDirectoryReference ( const FilePathList paths)

Return true if FilePathList contains a filepath that is significies checking of the current working directory.

Referenced by getLibraryFilePathList().

◆ containsServerAddress()

OSGDB_EXPORT bool osgDB::containsServerAddress ( const std::string &  filename)

◆ convertFileNameToNativeStyle()

OSGDB_EXPORT std::string osgDB::convertFileNameToNativeStyle ( const std::string &  fileName)

Convert the path to contain only the current platform's path separators.

◆ convertFileNameToUnixStyle()

OSGDB_EXPORT std::string osgDB::convertFileNameToUnixStyle ( const std::string &  fileName)

Converts back slashes () to forward slashes (/).

◆ convertFileNameToWindowsStyle()

OSGDB_EXPORT std::string osgDB::convertFileNameToWindowsStyle ( const std::string &  fileName)

Converts forward slashes (/) to back slashes ().

◆ convertStringFromCurrentCodePageToUTF8() [1/3]

OSGDB_EXPORT std::string osgDB::convertStringFromCurrentCodePageToUTF8 ( const char *  source,
unsigned  sourceLength 
)

◆ convertStringFromCurrentCodePageToUTF8() [2/3]

OSGDB_EXPORT std::string osgDB::convertStringFromCurrentCodePageToUTF8 ( const std::string &  s)

◆ convertStringFromCurrentCodePageToUTF8() [3/3]

OSGDB_EXPORT std::string osgDB::convertStringFromCurrentCodePageToUTF8 ( const char *  s)

◆ convertStringFromUTF8toCurrentCodePage() [1/3]

OSGDB_EXPORT std::string osgDB::convertStringFromUTF8toCurrentCodePage ( const char *  source,
unsigned  sourceLength 
)

◆ convertStringFromUTF8toCurrentCodePage() [2/3]

OSGDB_EXPORT std::string osgDB::convertStringFromUTF8toCurrentCodePage ( const std::string &  s)

◆ convertStringFromUTF8toCurrentCodePage() [3/3]

OSGDB_EXPORT std::string osgDB::convertStringFromUTF8toCurrentCodePage ( const char *  s)

◆ convertStringPathIntoFilePathList()

OSGDB_EXPORT void osgDB::convertStringPathIntoFilePathList ( const std::string &  paths,
FilePathList filepath 
)

convert a string containing a list of paths delimited either with ';' (Windows) or ':' (All other platforms) into FilePath representation.

Referenced by getLibraryFilePathList().

◆ convertToLowerCase()

OSGDB_EXPORT std::string osgDB::convertToLowerCase ( const std::string &  fileName)

◆ convertUTF16toUTF8() [1/3]

OSGDB_EXPORT std::string osgDB::convertUTF16toUTF8 ( const wchar_t *  source,
unsigned  sourceLength 
)

◆ convertUTF16toUTF8() [2/3]

OSGDB_EXPORT std::string osgDB::convertUTF16toUTF8 ( const std::wstring &  s)

◆ convertUTF16toUTF8() [3/3]

OSGDB_EXPORT std::string osgDB::convertUTF16toUTF8 ( const wchar_t *  s)

◆ convertUTF8toUTF16() [1/3]

OSGDB_EXPORT std::wstring osgDB::convertUTF8toUTF16 ( const char *  source,
unsigned  sourceLength 
)

◆ convertUTF8toUTF16() [2/3]

OSGDB_EXPORT std::wstring osgDB::convertUTF8toUTF16 ( const std::string &  s)

◆ convertUTF8toUTF16() [3/3]

OSGDB_EXPORT std::wstring osgDB::convertUTF8toUTF16 ( const char *  s)

◆ copyFile()

OSGDB_EXPORT CopyFileResult osgDB::copyFile ( const std::string &  source,
const std::string &  destination 
)

Copy a file to another location, overwriting if necessary.

You must provide full path for both source and destination.

Returns
true on success, or if source and destination are the same.

◆ equalCaseInsensitive() [1/2]

OSGDB_EXPORT bool osgDB::equalCaseInsensitive ( const std::string &  lhs,
const std::string &  rhs 
)

◆ equalCaseInsensitive() [2/2]

OSGDB_EXPORT bool osgDB::equalCaseInsensitive ( const std::string &  lhs,
const char *  rhs 
)

◆ expandWildcardsInFilename()

OSGDB_EXPORT DirectoryContents osgDB::expandWildcardsInFilename ( const std::string &  filename)

Return the list of filenames that match the given filename with wildcards.

Will only expand '*', and will not expand wildcards in directory, only in filename part of the given filename. Return value will contain path+filename so that if ever the above limitation (expanding wildcards in directory) is fixed, client code will still work unchanged.

◆ fileExists()

OSGDB_EXPORT bool osgDB::fileExists ( const std::string &  filename)

return true if a file exists.

Referenced by osgDB::Archive::acceptsExtension().

◆ fileType()

OSGDB_EXPORT FileType osgDB::fileType ( const std::string &  filename)

return type of file.

◆ findDataFile() [1/2]

OSGDB_EXPORT std::string osgDB::findDataFile ( const std::string &  filename,
CaseSensitivity  caseSensitivity = CASE_SENSITIVE 
)

Search for specified file in file system, checking the DataFilePathList for possible paths, returning the full path of the first valid file found, return an empty string if no string is found.

Referenced by getDataFilePathList().

◆ findDataFile() [2/2]

OSGDB_EXPORT std::string osgDB::findDataFile ( const std::string &  filename,
const Options options,
CaseSensitivity  caseSensitivity = CASE_SENSITIVE 
)

Search for specified file in file system, checking first the database path set in the Options structure, then the DataFilePathList for possible paths, returning the full path of the first valid file found, return an empty string if no string is found.

◆ findFileInDirectory()

OSGDB_EXPORT std::string osgDB::findFileInDirectory ( const std::string &  fileName,
const std::string &  dirName,
CaseSensitivity  caseSensitivity = CASE_SENSITIVE 
)

return the directory/filename of a file if its is contained within specified directory.

return "" if directory does not contain file. If caseInsensitive is set to true then a case insensitive comparison is used to compare fileName to directory contents. This is useful when unix programs attempt read case insensitive windows filenames.

◆ findFileInPath()

OSGDB_EXPORT std::string osgDB::findFileInPath ( const std::string &  filename,
const FilePathList filePath,
CaseSensitivity  caseSensitivity = CASE_SENSITIVE 
)

find specified file in specified file path.

◆ findLibraryFile()

OSGDB_EXPORT std::string osgDB::findLibraryFile ( const std::string &  filename,
CaseSensitivity  caseSensitivity = CASE_SENSITIVE 
)

Referenced by getLibraryFilePathList().

◆ fopen()

OSGDB_EXPORT FILE* osgDB::fopen ( const char *  filename,
const char *  mode 
)

Overload of the standard fopen function.

If OSG_USE_UTF8_FILENAME is defined, filename will be expanded from UTF8 to UTF16 and _wfopen will be called.

◆ getCurrentWorkingDirectory()

OSGDB_EXPORT std::string osgDB::getCurrentWorkingDirectory ( void  )

Get current working directory.

◆ getDataFilePathList()

FilePathList& osgDB::getDataFilePathList ( )
inline

◆ getDirectoryContents()

OSGDB_EXPORT DirectoryContents osgDB::getDirectoryContents ( const std::string &  dirName)

Return the contents of a directory.

Return value will contain filenames only, not absolute paths. Returns an empty array on any error.

◆ getFileExtension()

OSGDB_EXPORT std::string osgDB::getFileExtension ( const std::string &  filename)

Gets the extension without dot (Ex: /a/b/c.Ext => Ext).

◆ getFileExtensionIncludingDot()

OSGDB_EXPORT std::string osgDB::getFileExtensionIncludingDot ( const std::string &  filename)

Gets the extension including dot (Ex: /a/b/c.Ext => .Ext).

◆ getFilePath()

OSGDB_EXPORT std::string osgDB::getFilePath ( const std::string &  filename)

Gets the parent path from full name (Ex: /a/b/c.Ext => /a/b).

◆ getLibraryFilePathList()

FilePathList& osgDB::getLibraryFilePathList ( )
inline

◆ getLowerCaseFileExtension()

OSGDB_EXPORT std::string osgDB::getLowerCaseFileExtension ( const std::string &  filename)

Gets the lowercase extension without dot (Ex: /a/b/c.Ext => ext).

◆ getNameLessAllExtensions()

OSGDB_EXPORT std::string osgDB::getNameLessAllExtensions ( const std::string &  fileName)

Gets file path without all extensions (Ex: /a/b/c.Ext => /a/b/c ; file.ext1.ext2 => file).

◆ getNameLessExtension()

OSGDB_EXPORT std::string osgDB::getNameLessExtension ( const std::string &  fileName)

Gets file path without last extension (Ex: /a/b/c.Ext => /a/b/c ; file.ext1.ext2 => file.ext1).

◆ getNativePathSeparator()

OSGDB_EXPORT char osgDB::getNativePathSeparator ( )

Get the path separator for the current platform.

◆ getPathElements()

OSGDB_EXPORT void osgDB::getPathElements ( const std::string &  path,
std::vector< std::string > &  out_elements 
)

Splits a path into elements between separators (including Windows' root, if any).

◆ getPathRelative()

OSGDB_EXPORT std::string osgDB::getPathRelative ( const std::string &  from,
const std::string &  to 
)

If 'to' is in a subdirectory of 'from' then this function returns the subpath, otherwise it just returns the file name.

The function does not automagically resolve paths as the system does, so be careful to give canonical paths. However, the function interprets slashes ('/') and backslashes ('\') as they were equal.

◆ getPathRoot()

OSGDB_EXPORT std::string osgDB::getPathRoot ( const std::string &  path)

Gets root part of a path ("/" or "C:"), or an empty string if none found.

◆ getRealPath()

OSGDB_EXPORT std::string osgDB::getRealPath ( const std::string &  path)

Removes .

. and . dirs in a path

◆ getServerAddress()

OSGDB_EXPORT std::string osgDB::getServerAddress ( const std::string &  filename)

◆ getServerFileName()

OSGDB_EXPORT std::string osgDB::getServerFileName ( const std::string &  filename)

◆ getServerProtocol()

OSGDB_EXPORT std::string osgDB::getServerProtocol ( const std::string &  filename)

◆ getSimpleFileName()

OSGDB_EXPORT std::string osgDB::getSimpleFileName ( const std::string &  fileName)

Gets file name with extension (Ex: /a/b/c.Ext => c.Ext).

◆ getSortedDirectoryContents()

OSGDB_EXPORT DirectoryContents osgDB::getSortedDirectoryContents ( const std::string &  dirName)

Return the contents of a directory, sorting the names into alphabetic and numberical order.

Return value will contain filenames only, not absolute paths. Returns an empty array on any error.

◆ getStrippedName()

OSGDB_EXPORT std::string osgDB::getStrippedName ( const std::string &  fileName)

Gets file name without last extension (Ex: /a/b/c.Ext => c ; file.ext1.ext2 => file.ext1).

◆ getTypeEnumFromPtr() [1/2]

OSGDB_EXPORT osgDB::BaseSerializer::Type osgDB::getTypeEnumFromPtr ( const osg::Object )

◆ getTypeEnumFromPtr() [2/2]

OSGDB_EXPORT osgDB::BaseSerializer::Type osgDB::getTypeEnumFromPtr ( const osg::Image )

◆ getTypeStringFromPtr() [1/2]

OSGDB_EXPORT const char* osgDB::getTypeStringFromPtr ( const osg::Object )

◆ getTypeStringFromPtr() [2/2]

OSGDB_EXPORT const char* osgDB::getTypeStringFromPtr ( const osg::Image )

◆ isAbsolutePath()

OSGDB_EXPORT bool osgDB::isAbsolutePath ( const std::string &  path)

Tests if path is absolute, as !getPathRoot(path).empty().

◆ isFileNameNativeStyle()

OSGDB_EXPORT bool osgDB::isFileNameNativeStyle ( const std::string &  fileName)

Check if the path contains only the current platform's path separators.

◆ listAllAvailablePlugins()

FileNameList OSGDB_EXPORT osgDB::listAllAvailablePlugins ( )

◆ makeDirectory()

OSGDB_EXPORT bool osgDB::makeDirectory ( const std::string &  directoryPath)

Make a new directory.

Returns true if directory exists or was created.

◆ makeDirectoryForFile()

OSGDB_EXPORT bool osgDB::makeDirectoryForFile ( const std::string &  filePath)

Make a new directory for a given file.

◆ open()

void OSGDB_EXPORT osgDB::open ( std::fstream &  fs,
const char *  filename,
std::ios_base::openmode  mode 
)

Convenience function for fstream open , std::ifstream, and std::ofstream to automatically handle UTF-8 to UTF-16 filename conversion.

Always use one of these classes in any OpenSceneGraph code instead of the STL equivalent.

Referenced by osgWidget::Browser::Browser(), osgDB::Output::getWriteOutDefaultValues(), and osgWidget::PdfReader::PdfReader().

◆ openArchive() [1/2]

OSGDB_EXPORT Archive* osgDB::openArchive ( const std::string &  filename,
ReaderWriter::ArchiveStatus  status,
unsigned int  indexBlockSizeHint = 4096 
)

Open an archive for reading or writing.

◆ openArchive() [2/2]

OSGDB_EXPORT Archive* osgDB::openArchive ( const std::string &  filename,
ReaderWriter::ArchiveStatus  status,
unsigned int  indexBlockSizeHint,
Options options 
)

Open an archive for reading or writing.

◆ outputPluginDetails()

bool OSGDB_EXPORT osgDB::outputPluginDetails ( std::ostream &  out,
const std::string &  fileName 
)

◆ queryPlugin()

bool OSGDB_EXPORT osgDB::queryPlugin ( const std::string &  fileName,
ReaderWriterInfoList infoList 
)

◆ readCommandLine()

void osgDB::readCommandLine ( osg::ArgumentParser parser)
inline

◆ readRefFile() [1/2]

template<class T >
osg::ref_ptr<T> osgDB::readRefFile ( const std::string &  filename,
const Options options 
)
inline

References readRefObjectFile().

◆ readRefFile() [2/2]

template<class T >
osg::ref_ptr<T> osgDB::readRefFile ( const std::string &  filename)
inline

◆ readRefHeightFieldFile() [1/2]

OSGDB_EXPORT osg::ref_ptr<osg::HeightField> osgDB::readRefHeightFieldFile ( const std::string &  filename,
const Options options 
)

Read an osg::HeightField from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

Referenced by readRefHeightFieldFile(), and readRefImageFile().

◆ readRefHeightFieldFile() [2/2]

osg::ref_ptr<osg::HeightField> osgDB::readRefHeightFieldFile ( const std::string &  filename)
inline

Read an osg::HeightField from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

References osgDB::Registry::instance(), OSGDB_EXPORT, readRefHeightFieldFile(), and readRefNodeFile().

◆ readRefImageFile() [1/2]

OSGDB_EXPORT osg::ref_ptr<osg::Image> osgDB::readRefImageFile ( const std::string &  filename,
const Options options 
)

Read an osg::Image from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

Referenced by osgDB::ImagePager::getPreLoadTime(), osg::NodeVisitor::ImageRequestHandler::ImageRequestHandler(), readRefFile(), and readRefImageFile().

◆ readRefImageFile() [2/2]

osg::ref_ptr<osg::Image> osgDB::readRefImageFile ( const std::string &  filename)
inline

Read an osg::Image from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

References osgDB::Registry::instance(), OSGDB_EXPORT, readRefHeightFieldFile(), and readRefImageFile().

◆ readRefNodeFile() [1/2]

OSGDB_EXPORT osg::ref_ptr<osg::Node> osgDB::readRefNodeFile ( const std::string &  filename,
const Options options 
)

Read an osg::Node from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

Referenced by readRefHeightFieldFile(), and readRefNodeFile().

◆ readRefNodeFile() [2/2]

osg::ref_ptr<osg::Node> osgDB::readRefNodeFile ( const std::string &  filename)
inline

Read an osg::Node from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

References osgDB::Registry::instance(), OSGDB_EXPORT, readRefNodeFile(), and readRefNodeFiles().

◆ readRefNodeFiles() [1/4]

OSGDB_EXPORT osg::ref_ptr<osg::Node> osgDB::readRefNodeFiles ( std::vector< std::string > &  fileList,
const Options options 
)

Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more than one subgraph has been loaded.

Use the Options object to control cache operations and file search paths in osgDB::Registry. Does NOT ignore strings beginning with a dash '-' character.

Referenced by readRefNodeFile(), and readRefNodeFiles().

◆ readRefNodeFiles() [2/4]

osg::ref_ptr<osg::Node> osgDB::readRefNodeFiles ( std::vector< std::string > &  fileList)
inline

Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more than one subgraph has been loaded.

References osgDB::Registry::instance(), OSGDB_EXPORT, and readRefNodeFiles().

◆ readRefNodeFiles() [3/4]

OSGDB_EXPORT osg::ref_ptr<osg::Node> osgDB::readRefNodeFiles ( osg::ArgumentParser parser,
const Options options 
)

Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more than one subgraph has been loaded.

Use the Options object to control cache operations and file search paths in osgDB::Registry.

◆ readRefNodeFiles() [4/4]

osg::ref_ptr<osg::Node> osgDB::readRefNodeFiles ( osg::ArgumentParser parser)
inline

Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more than one subgraph has been loaded.

References osgDB::Registry::instance(), OSGDB_EXPORT, readRefNodeFiles(), and readRefShaderFile().

◆ readRefObjectFile() [1/2]

OSGDB_EXPORT osg::ref_ptr<osg::Object> osgDB::readRefObjectFile ( const std::string &  filename,
const Options options 
)

Read an osg::Object from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

Referenced by readRefFile(), readRefObjectFile(), and readRefScriptFile().

◆ readRefObjectFile() [2/2]

osg::ref_ptr<osg::Object> osgDB::readRefObjectFile ( const std::string &  filename)
inline

Read an osg::Object from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

References osgDB::Registry::instance(), and readRefObjectFile().

◆ readRefScriptFile() [1/2]

OSGDB_EXPORT osg::ref_ptr<osg::Script> osgDB::readRefScriptFile ( const std::string &  filename,
const Options options 
)

Read an osg::Script from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

Referenced by readRefScriptFile(), and readRefShaderFileWithFallback().

◆ readRefScriptFile() [2/2]

osg::ref_ptr<osg::Script> osgDB::readRefScriptFile ( const std::string &  filename)
inline

Read an osg::Script from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

References osgDB::Registry::getOptions(), osgDB::Registry::instance(), OSGDB_EXPORT, readRefObjectFile(), readRefScriptFile(), osg::ref_ptr< T >::release(), osg::Shader::setType(), and osg::Shader::UNDEFINED.

◆ readRefShaderFile() [1/4]

OSGDB_EXPORT osg::ref_ptr<osg::Shader> osgDB::readRefShaderFile ( const std::string &  filename,
const Options options 
)

Read an osg::Shader from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

Referenced by readRefNodeFiles(), and readRefShaderFile().

◆ readRefShaderFile() [2/4]

osg::ref_ptr<osg::Shader> osgDB::readRefShaderFile ( const std::string &  filename)
inline

Read an osg::Shader from file.

Return an assigned osg::ref_ptr on success, return an osg::ref_ptr with a NULL pointer assigned to it on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

References osgDB::Registry::instance(), and readRefShaderFile().

◆ readRefShaderFile() [3/4]

osg::ref_ptr<osg::Shader> osgDB::readRefShaderFile ( osg::Shader::Type  type,
const std::string &  filename,
const Options options 
)
inline

Read an osg::Shader from file and set to specified shader type.

Return valid osg::Shader on success, return NULL on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

References readRefShaderFile(), osg::Shader::setType(), osg::Shader::UNDEFINED, and osg::ref_ptr< T >::valid().

◆ readRefShaderFile() [4/4]

osg::ref_ptr<osg::Shader> osgDB::readRefShaderFile ( osg::Shader::Type  type,
const std::string &  filename 
)
inline

Read an osg::Shader from file and set to specified shader type Return valid osg::Shader on success, return NULL on failure.

The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

References osgDB::Registry::instance(), OSGDB_EXPORT, readRefShaderFile(), and readRefShaderFileWithFallback().

◆ readRefShaderFileWithFallback() [1/2]

OSGDB_EXPORT osg::ref_ptr<osg::Shader> osgDB::readRefShaderFileWithFallback ( osg::Shader::Type  type,
const std::string &  filename,
const Options options,
const char *  fallback 
)

Read an osg::Shader from file and set to specified shader type, if a shader isn't loaded fallback to specific shader source.

Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

Referenced by readRefShaderFile(), and readRefShaderFileWithFallback().

◆ readRefShaderFileWithFallback() [2/2]

osg::ref_ptr<osg::Shader> osgDB::readRefShaderFileWithFallback ( osg::Shader::Type  type,
const std::string &  filename,
const char *  fallback 
)
inline

Read an osg::Shader from file and set to specified shader type, if a shader isn't loaded fallback to specific shader source.

The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to read the specified file.

References osgDB::Registry::instance(), OSGDB_EXPORT, readRefScriptFile(), and readRefShaderFileWithFallback().

◆ readXmlFile() [1/2]

OSGDB_EXPORT XmlNode* osgDB::readXmlFile ( const std::string &  filename,
const Options options 
)

read an Xml file, find the file in Options DataFilePathList.

Referenced by readXmlFile().

◆ readXmlFile() [2/2]

XmlNode* osgDB::readXmlFile ( const std::string &  filename)
inline

read an Xml file, find the file in osgDB::Registry's eaderWriter::Options DataFilePathList.

References osgDB::Registry::instance(), OSGDB_EXPORT, readXmlFile(), readXmlStream(), and trimEnclosingSpaces().

◆ readXmlStream()

OSGDB_EXPORT XmlNode* osgDB::readXmlStream ( std::istream &  fin)

read an Xml from from an istream.

Referenced by readXmlFile().

◆ setCurrentWorkingDirectory()

OSGDB_EXPORT bool osgDB::setCurrentWorkingDirectory ( const std::string &  newCurrentWorkingDirectory)

Set current working directory.

◆ setDataFilePathList() [1/2]

void osgDB::setDataFilePathList ( const FilePathList filepath)
inline

◆ setDataFilePathList() [2/2]

void osgDB::setDataFilePathList ( const std::string &  paths)
inline

◆ setLibraryFilePathList() [1/2]

void osgDB::setLibraryFilePathList ( const FilePathList filepaths)
inline

◆ setLibraryFilePathList() [2/2]

void osgDB::setLibraryFilePathList ( const std::string &  paths)
inline

◆ split()

OSGDB_EXPORT void osgDB::split ( const std::string &  src,
StringList list,
char  separator = ' ' 
)

◆ stringcopy()

OSGDB_EXPORT void osgDB::stringcopy ( char *  dest,
const char *  src,
size_t  length 
)

◆ trimEnclosingSpaces()

OSGDB_EXPORT std::string osgDB::trimEnclosingSpaces ( const std::string &  str)

◆ writeArray()

template<class Iterator >
void osgDB::writeArray ( Output fw,
Iterator  first,
Iterator  last,
int  noItemsPerLine = 0 
)

◆ writeArrayAsInts()

template<class Iterator >
void osgDB::writeArrayAsInts ( Output fw,
Iterator  first,
Iterator  last,
int  noItemsPerLine = 0 
)

◆ writeHeightFieldFile() [1/2]

OSGDB_EXPORT bool osgDB::writeHeightFieldFile ( const osg::HeightField hf,
const std::string &  filename,
const Options options 
)

Write an osg::HeightField to file.

Return true on success, return false on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

Referenced by writeHeightFieldFile(), and writeImageFile().

◆ writeHeightFieldFile() [2/2]

bool osgDB::writeHeightFieldFile ( const osg::HeightField hf,
const std::string &  filename 
)
inline

Write an osg::HeightField to file.

Return true on success, return false on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

References osgDB::Registry::instance(), OSGDB_EXPORT, writeHeightFieldFile(), and writeNodeFile().

◆ writeImageFile() [1/2]

OSGDB_EXPORT bool osgDB::writeImageFile ( const osg::Image image,
const std::string &  filename,
const Options options 
)

Write an osg::Image to file.

Return true on success, return false on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

Referenced by writeImageFile(), and writeObjectFile().

◆ writeImageFile() [2/2]

bool osgDB::writeImageFile ( const osg::Image image,
const std::string &  filename 
)
inline

Write an osg::Image to file.

Return true on success, return false on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

References osgDB::Registry::instance(), OSGDB_EXPORT, writeHeightFieldFile(), and writeImageFile().

◆ writeNodeFile() [1/2]

OSGDB_EXPORT bool osgDB::writeNodeFile ( const osg::Node node,
const std::string &  filename,
const Options options 
)

Write an osg::Node to file.

Return true on success, return false on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

Referenced by writeHeightFieldFile(), and writeNodeFile().

◆ writeNodeFile() [2/2]

bool osgDB::writeNodeFile ( const osg::Node node,
const std::string &  filename 
)
inline

Write an osg::Node to file.

Return true on success, return false on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

References osgDB::Registry::instance(), OSGDB_EXPORT, writeNodeFile(), and writeShaderFile().

◆ writeObjectFile() [1/2]

OSGDB_EXPORT bool osgDB::writeObjectFile ( const osg::Object object,
const std::string &  filename,
const Options options 
)

Write an osg::Object to file.

Return true on success, return false on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

Referenced by writeObjectFile().

◆ writeObjectFile() [2/2]

bool osgDB::writeObjectFile ( const osg::Object object,
const std::string &  filename 
)
inline

Write an osg::Object to file.

Return true on success, return false on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

References osgDB::Registry::instance(), OSGDB_EXPORT, writeImageFile(), and writeObjectFile().

◆ writeScriptFile() [1/2]

OSGDB_EXPORT bool osgDB::writeScriptFile ( const osg::Script image,
const std::string &  filename,
const Options options 
)

Write an osg::Script to file.

Return true on success, return false on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

Referenced by writeScriptFile(), and writeShaderFile().

◆ writeScriptFile() [2/2]

bool osgDB::writeScriptFile ( const osg::Script image,
const std::string &  filename 
)
inline

Write an osg::Script to file.

Return true on success, return false on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

References osgDB::Registry::instance(), and writeScriptFile().

◆ writeShaderFile() [1/2]

OSGDB_EXPORT bool osgDB::writeShaderFile ( const osg::Shader shader,
const std::string &  filename,
const Options options 
)

Write an osg::Shader to file.

Return true on success, return false on failure. Use the Options object to control cache operations and file search paths in osgDB::Registry. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

Referenced by writeNodeFile(), and writeShaderFile().

◆ writeShaderFile() [2/2]

bool osgDB::writeShaderFile ( const osg::Shader shader,
const std::string &  filename 
)
inline

Write an osg::Shader to file.

Return true on success, return false on failure. The osgDB::Registry is used to load the appropriate ReaderWriter plugin for the filename extension, and this plugin then handles the request to write the specified file.

References osgDB::Registry::instance(), OSGDB_EXPORT, writeScriptFile(), and writeShaderFile().

Variable Documentation

◆ BOOL_SIZE

const int osgDB::BOOL_SIZE = 1

◆ BUFFERSIZE

const int osgDB::BUFFERSIZE = 8192

◆ CHAR_SIZE

const int osgDB::CHAR_SIZE = 1

◆ DOUBLE_SIZE

const int osgDB::DOUBLE_SIZE = 8

◆ FLOAT_SIZE

const int osgDB::FLOAT_SIZE = 4

◆ GLENUM_SIZE

const int osgDB::GLENUM_SIZE = 4

◆ ID_BYTE_ARRAY

const int osgDB::ID_BYTE_ARRAY = 0

◆ ID_DOUBLE_ARRAY

const int osgDB::ID_DOUBLE_ARRAY = 7

◆ ID_DRAWARRAY_LENGTH

const int osgDB::ID_DRAWARRAY_LENGTH = 51

◆ ID_DRAWARRAYS

const int osgDB::ID_DRAWARRAYS = 50

◆ ID_DRAWELEMENTS_UBYTE

const int osgDB::ID_DRAWELEMENTS_UBYTE = 52

◆ ID_DRAWELEMENTS_UINT

const int osgDB::ID_DRAWELEMENTS_UINT = 54

◆ ID_DRAWELEMENTS_USHORT

const int osgDB::ID_DRAWELEMENTS_USHORT = 53

◆ ID_FLOAT_ARRAY

const int osgDB::ID_FLOAT_ARRAY = 6

◆ ID_INT64_ARRAY

const int osgDB::ID_INT64_ARRAY = 33

◆ ID_INT_ARRAY

const int osgDB::ID_INT_ARRAY = 4

◆ ID_SHORT_ARRAY

const int osgDB::ID_SHORT_ARRAY = 2

◆ ID_UBYTE_ARRAY

const int osgDB::ID_UBYTE_ARRAY = 1

◆ ID_UINT64_ARRAY

const int osgDB::ID_UINT64_ARRAY = 32

◆ ID_UINT_ARRAY

const int osgDB::ID_UINT_ARRAY = 5

◆ ID_USHORT_ARRAY

const int osgDB::ID_USHORT_ARRAY = 3

◆ ID_VEC2_ARRAY

const int osgDB::ID_VEC2_ARRAY = 15

◆ ID_VEC2B_ARRAY

const int osgDB::ID_VEC2B_ARRAY = 8

◆ ID_VEC2D_ARRAY

const int osgDB::ID_VEC2D_ARRAY = 18

◆ ID_VEC2I_ARRAY

const int osgDB::ID_VEC2I_ARRAY = 26

◆ ID_VEC2S_ARRAY

const int osgDB::ID_VEC2S_ARRAY = 12

◆ ID_VEC2UB_ARRAY

const int osgDB::ID_VEC2UB_ARRAY = 21

◆ ID_VEC2UI_ARRAY

const int osgDB::ID_VEC2UI_ARRAY = 29

◆ ID_VEC2US_ARRAY

const int osgDB::ID_VEC2US_ARRAY = 23

◆ ID_VEC3_ARRAY

const int osgDB::ID_VEC3_ARRAY = 16

◆ ID_VEC3B_ARRAY

const int osgDB::ID_VEC3B_ARRAY = 9

◆ ID_VEC3D_ARRAY

const int osgDB::ID_VEC3D_ARRAY = 19

◆ ID_VEC3I_ARRAY

const int osgDB::ID_VEC3I_ARRAY = 27

◆ ID_VEC3S_ARRAY

const int osgDB::ID_VEC3S_ARRAY = 13

◆ ID_VEC3UB_ARRAY

const int osgDB::ID_VEC3UB_ARRAY = 22

◆ ID_VEC3UI_ARRAY

const int osgDB::ID_VEC3UI_ARRAY = 30

◆ ID_VEC3US_ARRAY

const int osgDB::ID_VEC3US_ARRAY = 24

◆ ID_VEC4_ARRAY

const int osgDB::ID_VEC4_ARRAY = 17

◆ ID_VEC4B_ARRAY

const int osgDB::ID_VEC4B_ARRAY = 10

◆ ID_VEC4D_ARRAY

const int osgDB::ID_VEC4D_ARRAY = 20

◆ ID_VEC4I_ARRAY

const int osgDB::ID_VEC4I_ARRAY = 28

◆ ID_VEC4S_ARRAY

const int osgDB::ID_VEC4S_ARRAY = 14

◆ ID_VEC4UB_ARRAY

const int osgDB::ID_VEC4UB_ARRAY = 11

◆ ID_VEC4UI_ARRAY

const int osgDB::ID_VEC4UI_ARRAY = 31

◆ ID_VEC4US_ARRAY

const int osgDB::ID_VEC4US_ARRAY = 25

◆ IMAGE_EXTERNAL

const int osgDB::IMAGE_EXTERNAL = 2

◆ IMAGE_INLINE_DATA

const int osgDB::IMAGE_INLINE_DATA = 0

◆ IMAGE_INLINE_FILE

const int osgDB::IMAGE_INLINE_FILE = 1

◆ IMAGE_WRITE_OUT

const int osgDB::IMAGE_WRITE_OUT = 3

◆ INDENT_VALUE

const int osgDB::INDENT_VALUE = 2

◆ INT64_SIZE

const int osgDB::INT64_SIZE = 8

◆ INT_SIZE

const int osgDB::INT_SIZE = 4

◆ LONG_SIZE

const int osgDB::LONG_SIZE = 4

◆ PLUGIN_VERSION

const unsigned int osgDB::PLUGIN_VERSION = 2

◆ SHORT_SIZE

const int osgDB::SHORT_SIZE = 2

◆ UNIX_PATH_SEPARATOR

const char osgDB::UNIX_PATH_SEPARATOR = '/'

◆ WINDOWS_PATH_SEPARATOR

const char osgDB::WINDOWS_PATH_SEPARATOR = '\\'