#include <ioobj.h>

Public Member Functions | |
| IOObjModule (const MODULE_ID &_id, const wxString &_name, EventHandler *msgSink) | |
Process event - SceneIOModule overload. | |
| virtual | ~IOObjModule () |
| 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. | |
Definition at line 24 of file ioobj.h.
| IOObjModule::IOObjModule | ( | const MODULE_ID & | _id, | |
| const wxString & | _name, | |||
| EventHandler * | msgSink | |||
| ) |
| IOObjModule::~IOObjModule | ( | ) | [virtual] |
| wxString IOObjModule::GetDesc | ( | ) | const [virtual] |
Get module description - Module overload.
Implements VRUT::Module.
Definition at line 31 of file ioobj.cpp.
| wxString IOObjModule::GetSupportedExts | ( | ) | const [virtual] |
Get string with file extensions supported by module - IOModule overload.
Implements VRUT::IOModule.
Definition at line 37 of file ioobj.cpp.
| bool IOObjModule::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 56 of file ioobj.cpp.
00057 { 00058 wxStopWatch sw; 00059 bool ret = false; 00060 wxInputStream * is = GetInputStream(fname); 00061 if (is) 00062 { 00063 OBJParser objParser(is, _sceneID, fname, this); 00064 ret = objParser.Parse(rootUid); 00065 delete is; 00066 } 00067 LOG(wxString::Format(wxT("<IOObjModule>Scene parsed in %.3f secs, ID %i"), 0.001f * sw.Time(), _sceneID)); 00068 wxCommandEvent ev = Event::GET_EVT_IO_SCENE_IMPORT_DONE(_sceneID); 00069 PostToKernel(ev); 00070 return ret; 00071 }
| bool IOObjModule::ExportScene | ( | const wxString & | fname, | |
| const Scene * | scene | |||
| ) | [virtual] |
Export scene to file.
Implements VRUT::IOModule.
Definition at line 74 of file ioobj.cpp.
00075 { 00076 wxOutputStream * sceneStream = new wxFileOutputStream(fname); 00077 if (sceneStream && sceneStream->IsOk()) 00078 { 00079 wxBufferedOutputStream *sceneStream2=new wxBufferedOutputStream(*sceneStream); 00080 OBJWriter objWriter(sceneStream2, scene); 00081 objWriter.Write(); 00082 sceneStream2->Sync(); 00083 SAFE_DELETE(sceneStream); 00084 return true; 00085 } 00086 SAFE_DELETE(sceneStream); 00087 return false; 00088 }
1.5.5