#include <OSGVRMLSceneFileType.h>

Public Types | |
| typedef std::vector < FieldContainerPtr > | FCPtrStore |
Flags | |
| enum | { OSG_READ_SUPPORTED = 1, OSG_WRITE_SUPPORTED = 2 } |
Public Member Functions | |
Destructor | |
| virtual | ~VRMLSceneFileType (void) |
Get | |
| virtual const Char8 * | getName (void) const |
Read | |
| virtual NodePtr | read (std::istream &is, const Char8 *fileNameOrExtension) const |
Write | |
| virtual bool | write (const NodePtr &node, std::ostream &os, const Char8 *fileNameOrExtension) const |
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 | readFile (const Char8 *fileName) const |
Write | |
| virtual bool | writeFile (const NodePtr &node, const Char8 *fileName) const |
Debug | |
| void | print (void) |
Static Public Member Functions | |
Class Get | |
| static VRMLSceneFileType & | the (void) |
Protected Member Functions | |
Constructors | |
| VRMLSceneFileType (const Char8 *suffixArray[], UInt16 suffixByteCount, bool override, UInt32 overridePriority, UInt32 flags) | |
Protected Attributes | |
Member | |
| std::list< IDString > | _suffixList |
| bool | _override |
| UInt32 | _overridePriority |
| UInt32 | _flags |
| std::string | _options |
Static Protected Attributes | |
Member | |
| static const Char8 * | _suffixA [] = { "wrl" } |
| static VRMLSceneFileType | _the |
Private Types | |
| typedef SceneFileType | Inherited |
Private Member Functions | |
| VRMLSceneFileType (const VRMLSceneFileType &source) | |
| prohibit default function (move to 'public' if needed) | |
| void | operator= (const VRMLSceneFileType &source) |
| prohibit default function (move to 'public' if needed) | |
Definition at line 54 of file OSGVRMLSceneFileType.h.
| typedef std::vector<FieldContainerPtr> osg::VRMLSceneFileType::FCPtrStore |
typedef SceneFileType osg::VRMLSceneFileType::Inherited [private] |
Definition at line 123 of file OSGVRMLSceneFileType.h.
anonymous enum [inherited] |
Definition at line 78 of file OSGSceneFileType.h.
00079 { 00080 OSG_READ_SUPPORTED = 1, 00081 OSG_WRITE_SUPPORTED = 2 00082 };
| VRMLSceneFileType::~VRMLSceneFileType | ( | void | ) | [virtual] |
| VRMLSceneFileType::VRMLSceneFileType | ( | const Char8 * | suffixArray[], | |
| UInt16 | suffixByteCount, | |||
| bool | override, | |||
| UInt32 | overridePriority, | |||
| UInt32 | flags | |||
| ) | [protected] |
Definition at line 137 of file OSGVRMLSceneFileType.cpp.
00141 : 00142 Inherited(suffixArray, 00143 suffixByteCount, 00144 override, 00145 overridePriority, 00146 flags) 00147 { 00148 }
| osg::VRMLSceneFileType::VRMLSceneFileType | ( | const VRMLSceneFileType & | source | ) | [private] |
| VRMLSceneFileType & VRMLSceneFileType::the | ( | void | ) | [static] |
Definition at line 67 of file OSGVRMLSceneFileType.cpp.
References _the.
00068 { 00069 return _the; 00070 }
| const Char8 * VRMLSceneFileType::getName | ( | void | ) | const [virtual] |
| NodePtr VRMLSceneFileType::read | ( | std::istream & | is, | |
| const Char8 * | fileNameOrExtension | |||
| ) | const [virtual] |
Reimplemented from osg::SceneFileType.
Definition at line 91 of file OSGVRMLSceneFileType.cpp.
References osg::VRMLFile::createStandardPrototypes(), osg::VRMLFile::getRoot(), osg::NullFC, and osg::VRMLFile::scanStream().
00092 { 00093 NodePtr root = NullFC; 00094 00095 VRMLFile *loader = new VRMLFile(); 00096 loader->createStandardPrototypes(); 00097 loader->scanStream(is); 00098 root = loader->getRoot(); 00099 delete loader; 00100 00101 return root; 00102 }
| bool VRMLSceneFileType::write | ( | const NodePtr & | node, | |
| std::ostream & | os, | |||
| const Char8 * | fileNameOrExtension | |||
| ) | const [virtual] |
Reimplemented from osg::SceneFileType.
Definition at line 107 of file OSGVRMLSceneFileType.cpp.
References osg::SceneFileType::_options, osg::VRMLWriteAction::addOptions(), osg::VRMLWriteAction::close(), osg::VRMLWriteAction::create(), osg::VRMLWriteAction::open(), osg::VRMLWriteAction::OSGPixelTextures, osg::VRMLWriteAction::subOptions(), and osg::VRMLWriteAction::write().
00109 { 00110 // This is a hack but should be safer. 00111 std::ofstream *osf = dynamic_cast<std::ofstream *>(&os); 00112 if(osf != NULL) 00113 osf->close(); 00114 00115 VRMLWriteAction *pWriter = VRMLWriteAction::create(); 00116 00117 // parse options 00118 if(_options.find("inlineTextures=true") != std::string::npos) 00119 pWriter->addOptions(VRMLWriteAction::OSGPixelTextures); 00120 else if(_options.find("inlineTextures=false") != std::string::npos) 00121 pWriter->subOptions(VRMLWriteAction::OSGPixelTextures); 00122 00123 pWriter->open(fileNameOrExtension); 00124 00125 pWriter->write(node); 00126 00127 pWriter->close(); 00128 00129 delete pWriter; 00130 00131 return true; 00132 }
| void osg::VRMLSceneFileType::operator= | ( | const VRMLSceneFileType & | source | ) | [private] |
| void SceneFileType::setOptions | ( | const Char8 * | options | ) | [inherited] |
Definition at line 115 of file OSGSceneFileType.cpp.
References osg::SceneFileType::_options.
Referenced by osg::SceneFileHandler::setOptions().
00116 { 00117 _options = options; 00118 }
| std::list< IDString > & SceneFileType::suffixList | ( | void | ) | [virtual, inherited] |
Definition at line 138 of file OSGSceneFileType.cpp.
References osg::SceneFileType::_suffixList.
Referenced by osg::SceneFileHandler::addSceneFileType(), and osg::SceneFileHandler::subSceneFileType().
00139 { 00140 return _suffixList; 00141 }
| bool SceneFileType::doOverride | ( | void | ) | [inherited] |
Definition at line 145 of file OSGSceneFileType.cpp.
References osg::SceneFileType::_override.
Referenced by osg::SceneFileHandler::addSceneFileType(), and osg::SceneFileHandler::FindOverride::operator()().
00146 { 00147 return _override; 00148 }
| UInt32 SceneFileType::getOverridePriority | ( | void | ) | [inherited] |
Definition at line 152 of file OSGSceneFileType.cpp.
References osg::SceneFileType::_overridePriority.
Referenced by osg::SceneFileHandler::addSceneFileType(), and osg::SceneFileHandler::FindOverride::operator()().
00153 { 00154 return _overridePriority; 00155 }
| UInt32 SceneFileType::getFlags | ( | void | ) | [inherited] |
Definition at line 159 of file OSGSceneFileType.cpp.
References osg::SceneFileType::_flags.
Referenced by osg::SceneFileHandler::getSuffixList(), and osg::SceneFileHandler::print().
00160 { 00161 return _flags; 00162 }
| const Char8 * SceneFileType::getOptions | ( | void | ) | [inherited] |
Definition at line 166 of file OSGSceneFileType.cpp.
References osg::SceneFileType::_options.
Referenced by osg::SceneFileHandler::getOptions().
00167 { 00168 return _options.c_str(); 00169 }
Definition at line 181 of file OSGSceneFileType.cpp.
References FWARNING, and osg::NullFC.
Referenced by osg::SceneFileHandler::read().
| bool SceneFileType::writeFile | ( | const NodePtr & | node, | |
| const Char8 * | fileName | |||
| ) | const [virtual, inherited] |
Definition at line 197 of file OSGSceneFileType.cpp.
References FWARNING.
Referenced by osg::SceneFileHandler::write().
00199 { 00200 FWARNING (("FILE INTERFACE NOT IMPLEMENTED!\n")); 00201 return false; 00202 }
| void SceneFileType::print | ( | void | ) | [inherited] |
Definition at line 121 of file OSGSceneFileType.cpp.
References osg::SceneFileType::_suffixList, osg::SceneFileType::getName(), osg::LOG_DEBUG, osg::osgLog(), and osg::Log::stream().
00122 { 00123 std::list<IDString>::iterator sI; 00124 00125 osgLog() << getName(); 00126 00127 if (_suffixList.empty()) 00128 osgLog() << "NONE"; 00129 else 00130 for (sI = _suffixList.begin(); sI != _suffixList.end(); sI++) 00131 osgLog().stream(OSG::LOG_DEBUG) << sI->str() << " "; 00132 00133 osgLog() << std::endl; 00134 }
const Char8 * VRMLSceneFileType::_suffixA = { "wrl" } [static, protected] |
Definition at line 105 of file OSGVRMLSceneFileType.h.
VRMLSceneFileType VRMLSceneFileType::_the [static, protected] |
std::list<IDString> osg::SceneFileType::_suffixList [protected, inherited] |
Definition at line 152 of file OSGSceneFileType.h.
Referenced by osg::SceneFileType::print(), osg::SceneFileType::SceneFileType(), and osg::SceneFileType::suffixList().
bool osg::SceneFileType::_override [protected, inherited] |
UInt32 osg::SceneFileType::_overridePriority [protected, inherited] |
Definition at line 155 of file OSGSceneFileType.h.
Referenced by osg::SceneFileType::getOverridePriority().
UInt32 osg::SceneFileType::_flags [protected, inherited] |
std::string osg::SceneFileType::_options [protected, inherited] |
Definition at line 158 of file OSGSceneFileType.h.
Referenced by osg::SceneFileType::getOptions(), osg::SceneFileType::setOptions(), and write().
1.5.5