VRUT::IOFhsModule Class Reference

FHS import/export module class. More...

#include <iofhs.h>

Inheritance diagram for VRUT::IOFhsModule:

VRUT::IOModule VRUT::SceneModule VRUT::Module

List of all members.

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.


Detailed Description

FHS import/export module class.

Definition at line 24 of file iofhs.h.


Constructor & Destructor Documentation

IOFhsModule::IOFhsModule ( const MODULE_ID _id,
const wxString &  _name,
EventHandler msgSink 
)

Class constructor.

Definition at line 20 of file iofhs.cpp.

00021               : IOModule(_id, _name, 0, msgSink)
00022 {
00023 //     REGISTER_LISTENER(Event::EVT_SCENE_IMAGE_ADDED);
00024 }

IOFhsModule::~IOFhsModule (  )  [virtual]

Class destructor.

Definition at line 27 of file iofhs.cpp.

00028 {
00029 }


Member Function Documentation

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.

00039 {
00040        return wxT("FHS");
00041 }

bool IOFhsModule::ImportScene ( const wxString &  fname,
SCENE_ID  _sceneID,
const wxString &  rootUid 
) [virtual]

Import scene from file - SceneIOModule overload

Parameters:
[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
Returns:
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 }


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

Generated on Tue Mar 10 14:41:40 2009 for VRUT by  doxygen 1.5.5