#include <iofhs.h>

Public Member Functions | |
| IOFhsModule (const MODULE_ID &_id, const wxString &_name, EventHandler *msgSink) | |
| Class constructor. | |
| virtual | ~IOFhsModule () |
| Class destructor. | |
| virtual wxString | GetDesc () const |
Get module description - Module overload. | |
| virtual wxString | GetSupportedExts () const |
Get string with file extensions supported by module - IOModule overload. | |
| virtual bool | ImportScene (const wxString &fname, SCENE_ID _sceneID, const wxString &rootUid) |
| virtual bool | ExportScene (const wxString &fname, const Scene *scene) |
Export scene to file - SceneIOModule overload. | |
Definition at line 24 of file iofhs.h.
| IOFhsModule::IOFhsModule | ( | const MODULE_ID & | _id, | |
| const wxString & | _name, | |||
| EventHandler * | msgSink | |||
| ) |
| IOFhsModule::~IOFhsModule | ( | ) | [virtual] |
| wxString IOFhsModule::GetDesc | ( | ) | const [virtual] |
Get module description - Module overload.
Implements VRUT::Module.
Definition at line 32 of file iofhs.cpp.
00033 { 00034 return wxT("Import and export FHS files with scene hierarchy and geometry data"); 00035 }
| wxString IOFhsModule::GetSupportedExts | ( | ) | const [virtual] |
Get string with file extensions supported by module - IOModule overload.
Implements VRUT::IOModule.
Definition at line 38 of file iofhs.cpp.
| bool IOFhsModule::ImportScene | ( | const wxString & | fname, | |
| SCENE_ID | _sceneID, | |||
| const wxString & | rootUid | |||
| ) | [virtual] |
Import scene from file - SceneIOModule overload
| [in] | fname | Path to scene files (archive) |
| [in] | _sceneID | ID of scene to be filled with data |
| [in] | rootUid | Uid of node where to start filling |
True if successful Implements VRUT::IOModule.
Definition at line 44 of file iofhs.cpp.
00045 { 00046 wxStopWatch sw; 00047 bool ret = false; 00048 wxInputStream * is = GetInputStream(fname); 00049 if (is) 00050 { 00051 FHSParser fhsParser(is, _sceneID, fname, this); 00052 ret = fhsParser.Parse(rootUid); 00053 delete is; 00054 } 00055 LOG(wxString::Format(wxT("<FHSParser>Scene parsed in %.3f secs, ID %i"), 0.001f * sw.Time(), _sceneID)); 00056 wxCommandEvent ev = Event::GET_EVT_IO_SCENE_IMPORT_DONE(_sceneID); 00057 PostToKernel(ev); 00058 return ret; 00059 }
| bool IOFhsModule::ExportScene | ( | const wxString & | fname, | |
| const Scene * | scene | |||
| ) | [virtual] |
Export scene to file - SceneIOModule overload.
Implements VRUT::IOModule.
Definition at line 62 of file iofhs.cpp.
00063 { 00064 wxOutputStream * sceneStream = new wxFileOutputStream(fname); 00065 if (sceneStream && sceneStream->IsOk()) 00066 { 00067 wxBufferedOutputStream *sceneStream2=new wxBufferedOutputStream(*sceneStream); 00068 FHSWriter fhsWriter(sceneStream2, scene); 00069 fhsWriter.Write(); 00070 sceneStream2->Sync(); 00071 SAFE_DELETE(sceneStream); 00072 return true; 00073 } 00074 SAFE_DELETE(sceneStream); 00075 return false; 00076 }
1.5.5