OSG::SceneFileType Class Reference

OSGSceneFileType. More...

#include <OSGSceneFileType.h>

Inheritance diagram for OSG::SceneFileType:

OSG::A3DSSceneFileType OSG::NFIOSceneFileType OSG::OBJSceneFileType OSG::OSGSceneFileType OSG::RAWSceneFileType OSG::VRMLSceneFileType List of all members.

Public Types

typedef std::vector< FieldContainerPtr > FCPtrStore
Flags


enum  { OSG_READ_SUPPORTED = 1, OSG_WRITE_SUPPORTED = 2 }

Public Member Functions

Class Get


virtual const Char8 * getName (void) const=0
Destructors


virtual ~SceneFileType (void)
Set


void setOptions (const Char8 *options)
Get


virtual std::list< IDString > & suffixList (void)
bool doOverride (void)
UInt32 getOverridePriority (void)
UInt32 getFlags (void)
const Char8 * getOptions (void)
Read


virtual NodePtr read (std::istream &is, const Char8 *fileNameOrExtension) const
virtual NodePtr readFile (const Char8 *fileName) const
Write


virtual bool write (const NodePtr &node, std::ostream &os, const Char8 *fileNameOrExtension) const
virtual bool writeFile (const NodePtr &node, const Char8 *fileName) const
Debug


void print (void)

Protected Member Functions

Constructors


 SceneFileType (const Char8 *suffixArray[], UInt16 suffixByteCount, bool override, UInt32 overridePriority, UInt32 flags=OSG_READ_SUPPORTED)
 SceneFileType (const SceneFileType &obj)

Protected Attributes

Member


std::list< IDString_suffixList
bool _override
UInt32 _overridePriority
UInt32 _flags
std::string _options

Private Member Functions

void operator= (const SceneFileType &source)
 prohibit default function (move to 'public' if needed)

Detailed Description

Base class for all file loaders.

Definition at line 60 of file OSGSceneFileType.h.


Member Typedef Documentation

typedef std::vector<FieldContainerPtr> OSG::SceneFileType::FCPtrStore

Reimplemented in OSG::VRMLSceneFileType, and OSG::OSGSceneFileType.

Definition at line 66 of file OSGSceneFileType.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
OSG_READ_SUPPORTED  The file type supports reading.
OSG_WRITE_SUPPORTED  The file type supports writing.

Definition at line 79 of file OSGSceneFileType.h.

00080     {
00081         OSG_READ_SUPPORTED  = 1,  
00082         OSG_WRITE_SUPPORTED = 2   
00083     };


Constructor & Destructor Documentation

SceneFileType::~SceneFileType ( void   )  [virtual]

Definition at line 123 of file OSGSceneFileType.cpp.

References OSG::GlobalSystemState, OSG::Shutdown, and OSG::SingletonHolder< SingletonT >::the().

00124 {
00125 #ifndef OSG_WINCE
00126     if(GlobalSystemState != Shutdown)
00127         SceneFileHandler::the()->subSceneFileType(*this);
00128 #endif
00129 }

SceneFileType::SceneFileType ( const Char8 *  suffixArray[],
UInt16  suffixByteCount,
bool  override,
UInt32  overridePriority,
UInt32  flags = OSG_READ_SUPPORTED 
) [protected]

Definition at line 81 of file OSGSceneFileType.cpp.

References _suffixList, FINFO, and OSG::SingletonHolder< SingletonT >::the().

00085                                                   :
00086     _suffixList      (                ),
00087     _override        (override        ),
00088     _overridePriority(overridePriority),
00089     _flags           (flags           ),
00090     _options         (                )
00091 {
00092     FINFO(( "Init %s Scene File Type %d\n", suffixArray[0], this ));
00093 
00094     int count = (suffixByteCount / sizeof(const Char8 *)), i = 0;
00095 
00096     std::list<IDString>::iterator sI;
00097 
00098     _suffixList.resize(count);
00099 
00100     for(sI = _suffixList.begin(); sI != _suffixList.end(); sI++)
00101     {
00102         sI->set(suffixArray[i++]);
00103     }
00104 
00105 #ifndef OSG_WINCE
00106     SceneFileHandler::the()->addSceneFileType(*this);
00107 #endif
00108 }

SceneFileType::SceneFileType ( const SceneFileType obj  )  [protected]

Definition at line 112 of file OSGSceneFileType.cpp.

References SWARNING.

00112                                                      :
00113     _suffixList      (obj._suffixList      ),
00114     _override        (obj._override        ),
00115     _overridePriority(obj._overridePriority),
00116     _flags           (obj._flags),
00117     _options         (obj._options)
00118 {
00119     SWARNING << "In SceneFileType copy constructor" << std::endl;
00120 }


Member Function Documentation

virtual const Char8* OSG::SceneFileType::getName ( void   )  const [pure virtual]

void SceneFileType::setOptions ( const Char8 *  options  ) 

Definition at line 143 of file OSGSceneFileType.cpp.

References _options.

Referenced by OSG::SceneFileHandlerBase::setOptions().

00144 {
00145     _options = options;
00146 }

std::list< IDString > & SceneFileType::suffixList ( void   )  [virtual]

Definition at line 172 of file OSGSceneFileType.cpp.

References _suffixList.

Referenced by OSG::SceneFileHandlerBase::addSceneFileType(), and OSG::SceneFileHandlerBase::subSceneFileType().

00173 {
00174     return _suffixList;
00175 }

bool SceneFileType::doOverride ( void   ) 

Definition at line 179 of file OSGSceneFileType.cpp.

References _override.

Referenced by OSG::SceneFileHandlerBase::addSceneFileType(), and OSG::SceneFileHandlerBase::FindOverride::operator()().

00180 {
00181     return _override;
00182 }

UInt32 SceneFileType::getOverridePriority ( void   ) 

UInt32 SceneFileType::getFlags ( void   ) 

Definition at line 193 of file OSGSceneFileType.cpp.

References _flags.

Referenced by OSG::SceneFileHandlerBase::print().

00194 {
00195     return _flags;
00196 }

const Char8 * SceneFileType::getOptions ( void   ) 

Return the current options string for the loader.

See also:
setOptions

Definition at line 203 of file OSGSceneFileType.cpp.

References _options.

Referenced by OSG::SceneFileHandlerBase::getOptions().

00204 {
00205     return _options.c_str();
00206 }

virtual NodePtr OSG::SceneFileType::read ( std::istream &  is,
const Char8 *  fileNameOrExtension 
) const [virtual]

virtual NodePtr OSG::SceneFileType::readFile ( const Char8 *  fileName  )  const [virtual]

virtual bool OSG::SceneFileType::write ( const NodePtr &  node,
std::ostream &  os,
const Char8 *  fileNameOrExtension 
) const [virtual]

virtual bool OSG::SceneFileType::writeFile ( const NodePtr &  node,
const Char8 *  fileName 
) const [virtual]

void SceneFileType::print ( void   ) 

Definition at line 150 of file OSGSceneFileType.cpp.

References _suffixList, getName(), OSG::LOG_DEBUG, and OSG::osgLog().

00151 {
00152     std::list<IDString>::iterator sI;
00153 
00154     osgLog() << getName();
00155 
00156     if (_suffixList.empty())
00157     {
00158         osgLog() << "NONE";
00159     }
00160     else
00161     {
00162         for (sI = _suffixList.begin(); sI != _suffixList.end(); sI++)
00163         {
00164             osgLog().stream(OSG::LOG_DEBUG) << sI->str() << " ";
00165         }
00166     }
00167     osgLog() << std::endl;
00168 }

void OSG::SceneFileType::operator= ( const SceneFileType source  )  [private]


Member Data Documentation

std::list<IDString> OSG::SceneFileType::_suffixList [protected]

Definition at line 155 of file OSGSceneFileType.h.

Referenced by print(), SceneFileType(), and suffixList().

List of valid suffixes for this loader.

Definition at line 157 of file OSGSceneFileType.h.

Referenced by doOverride().

If true loader can override others.

Definition at line 158 of file OSGSceneFileType.h.

Referenced by getOverridePriority().

UInt32 OSG::SceneFileType::_flags [protected]

The priority for overriding.

Definition at line 159 of file OSGSceneFileType.h.

Referenced by getFlags().

std::string OSG::SceneFileType::_options [protected]

String list of options to use with the loader.

Definition at line 162 of file OSGSceneFileType.h.

Referenced by getOptions(), OSG::NFIOSceneFileType::read(), setOptions(), OSG::VRMLSceneFileType::write(), and OSG::NFIOSceneFileType::write().


The documentation for this class was generated from the following files: