Commit e7b811b5 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - graphics engine project file io added.

parent b3738926
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include <string>
#include "WGEProjectFileIO.h"
WGEProjectFileIO::WGEProjectFileIO():
WProjectFileIO()
{
// initialize members
}
WGEProjectFileIO::~WGEProjectFileIO()
{
// cleanup
}
bool WGEProjectFileIO::parse( std::string line, unsigned int lineNumber )
{
return false;
}
void WGEProjectFileIO::done()
{
// apply camera here
}
void WGEProjectFileIO::save( std::ostream& output ) // NOLINT
{
// save camera state here
}
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WGEPROJECTFILEIO_H
#define WGEPROJECTFILEIO_H
#include <string>
#include "../kernel/WProjectFileIO.h"
/**
* IO class for writing the graphics engine state to a project file. Currently it only writes the camera settings.
*/
class WGEProjectFileIO: public WProjectFileIO
{
public:
/**
* Default constructor.
*/
WGEProjectFileIO();
/**
* Destructor.
*/
virtual ~WGEProjectFileIO();
/**
* This method parses the specified line and interprets it. It gets called line by line by WProjectFile.
*
* \param line the current line as string
* \param lineNumber the current line number. Useful for error/warning/debugging output.
*
* \return true if the line could be parsed.
*/
virtual bool parse( std::string line, unsigned int lineNumber );
/**
* Called whenever the end of the project file has been reached. This is useful if your specific parser class wants to do some post
* processing after parsing line by line.
*/
virtual void done();
/**
* Saves the state to the specified stream.
*
* \param output the stream to print the state to.
*/
virtual void save( std::ostream& output ); // NOLINT
protected:
private:
};
#endif // WGEPROJECTFILEIO_H
......@@ -30,6 +30,7 @@
#include "WKernel.h"
#include "combiner/WModuleProjectFileCombiner.h"
#include "../graphicsEngine/WGEProjectFileIO.h"
#include "../common/exceptions/WFileNotFound.h"
#include "../common/exceptions/WFileOpenFailed.h"
......@@ -49,12 +50,17 @@ WProjectFile::WProjectFile( boost::filesystem::path project ):
// m_parsers.push_back( new W???() );
// The Camera parser
// m_parsers.push_back( new W???() );
m_parsers.push_back( new WGEProjectFileIO() );
}
WProjectFile::~WProjectFile()
{
// cleanup
for ( std::vector< WProjectFileIO* >::iterator iter = m_parsers.begin(); iter != m_parsers.end(); ++iter )
{
delete( *iter );
}
m_parsers.clear();
}
void WProjectFile::load()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment