VRUT::IORdfModule Class Reference

RDF import/export module class. More...

#include <iordf.h>

Inheritance diagram for VRUT::IORdfModule:

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

List of all members.

Public Member Functions

 IORdfModule (const MODULE_ID &_id, const wxString &_name, EventHandler *msgSink)
 Class constructor.
virtual ~IORdfModule ()
 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.

Protected Member Functions

virtual void processEvent (wxCommandEvent &evt)
 Process event - SceneIOModule overload.


Detailed Description

RDF import/export module class.

Definition at line 24 of file iordf.h.


Constructor & Destructor Documentation

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

Class constructor.

Definition at line 20 of file iordf.cpp.

00021               : IOModule(_id, _name, 0, msgSink)
00022 {
00023 }

IORdfModule::~IORdfModule (  )  [virtual]

Class destructor.

Definition at line 25 of file iordf.cpp.

00026 {
00027 }


Member Function Documentation

void IORdfModule::processEvent ( wxCommandEvent &  evt  )  [protected, virtual]

Process event - SceneIOModule overload.

Reimplemented from VRUT::IOModule.

Definition at line 39 of file iordf.cpp.

00040 {
00041        IOModule::processEvent(evt);
00042 }

wxString IORdfModule::GetDesc (  )  const [virtual]

Get module description - Module overload.

Implements VRUT::Module.

Definition at line 29 of file iordf.cpp.

00030 {
00031        return wxT("Import and export RDF files (Adams)");
00032 }

wxString IORdfModule::GetSupportedExts (  )  const [virtual]

Get string with file extensions supported by module - IOModule overload.

Implements VRUT::IOModule.

Definition at line 34 of file iordf.cpp.

00035 {
00036        return wxT("RDF");
00037 }

bool IORdfModule::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 iordf.cpp.

00045 {
00046        wxStopWatch sw;
00047        bool ret = false;
00048        wxInputStream * is = GetInputStream(fname);
00049        if (is)
00050        {
00051               RDFParser rdfParser(is, _sceneID, fname, this);
00052               ret = rdfParser.Parse(rootUid);
00053               delete is;
00054        }
00055        LOG(wxString::Format(wxT("<IORdfModule>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 IORdfModule::ExportScene ( const wxString &  fname,
const Scene scene 
) [virtual]

Export scene to file.

Implements VRUT::IOModule.

Definition at line 61 of file iordf.cpp.

00062 {
00063        wxOutputStream * sceneStream = new wxFileOutputStream(fname);
00064        if (sceneStream && sceneStream->IsOk())
00065        {
00066               wxBufferedOutputStream *sceneStream2=new wxBufferedOutputStream(*sceneStream);
00067               RDFWriter rdfWriter(sceneStream2, scene);
00068               rdfWriter.Write();
00069               sceneStream2->Sync();
00070               SAFE_DELETE(sceneStream);
00071               return true;
00072        }
00073        SAFE_DELETE(sceneStream);
00074        return false;
00075 }


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