From Paul Martz, "Some small changes and code cleanup. Biggest change is an improvement to the WriteResult return."

This commit is contained in:
Robert Osfield
2008-03-28 19:56:25 +00:00
parent 960e0bd378
commit 2c1d440444
4 changed files with 5 additions and 6 deletions

View File

@@ -23,8 +23,6 @@
#include <osgDB/ReadFile>
#include "ExportOptions.h"
//#include "DataOutputStream.h"
//#include "FltNodeVisitor.h"
#include <fstream>
#include <sstream>

View File

@@ -40,7 +40,7 @@ namespace flt
class FltWriteResult : public osgDB::ReaderWriter::WriteResult
{
public:
FltWriteResult( WriteResult::WriteStatus status=WriteResult::FILE_NOT_HANDLED )
FltWriteResult( WriteResult::WriteStatus status=WriteResult::FILE_SAVED )
: WriteResult( status )
{}

View File

@@ -451,11 +451,12 @@ class FLTReaderWriter : public ReaderWriter
// must use Node::accept() which requires 'node' to be non-const.
// Pretty much requires casting away const.
osg::Node* nodeNonConst = const_cast<osg::Node*>( &node );
if (!nodeNonConst)
return WriteResult::ERROR_IN_WRITING_FILE;
nodeNonConst->accept( fnv );
fnv.complete( node );
// FIXME: Error-handling?
return WriteResult::FILE_SAVED;
return fltOpt->getWriteResult();
}
protected:

View File

@@ -43,7 +43,7 @@ VertexPaletteManager::~VertexPaletteManager()
if (_verticesStr.is_open())
{
osg::notify( osg::WARN ) << "fltexp: VertexPaletteManager destructor has an open temp file." << std::endl;
// This should not happen. FltNodeVisitor::complete should close
// This should not happen. FltExportVisitor::complete should close
// this file before we get to this destructor.
return;
}