root/OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/FltWriteResult.h @ 13041

Revision 13041, 1.9 kB (checked in by robert, 3 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
Line 
1/*
2 * This library is open source and may be redistributed and/or modified under
3 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or (at
4 * your option) any later version. The full license is in the LICENSE file
5 * included with this distribution, and on the openscenegraph.org website.
6 *
7 * This library is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * OpenSceneGraph Public License for more details.
11*/
12
13//
14// Copyright(c) 2008 Skew Matrix Software LLC.
15//
16
17#ifndef __FLT_WRITE_RESULT_H__
18#define __FLT_WRITE_RESULT_H__ 1
19
20#include <string>
21#include <utility>
22#include <vector>
23
24#include <osg/Node>
25#include <osg/Notify>
26#include <osgDB/ReaderWriter>
27#include <osgDB/FileNameUtils>
28
29
30namespace flt
31{
32
33
34/*!
35   Custom WriteResult to support proxy/validation ("validate" Option).
36   If the application is able to #include this header and obtain the Writeresult
37   from osgDB, then the app can query this class for warning or error
38   conditions due to scene graph incompatibility with FLT.
39 */
40class FltWriteResult : public osgDB::ReaderWriter::WriteResult
41{
42public:
43    FltWriteResult( WriteResult::WriteStatus status=WriteResult::FILE_SAVED )
44      : WriteResult( status )
45        {}
46
47    void setNumErrors( int n );
48    int getNumErrors() const;
49
50    void setNumWarnings( int n );
51    int getNumWarnings() const;
52
53    typedef std::pair< osg::NotifySeverity, std::string > MessagePair;
54    typedef std::vector< MessagePair > MessageVector;
55
56    void warn( const std::string &ss )
57    {
58        messages_.push_back( std::make_pair( osg::WARN, ss ) );
59    }
60
61    void error( const std::string &ss )
62    {
63        messages_.push_back( std::make_pair( osg::FATAL, ss ) );
64    }
65
66protected:
67    MessageVector messages_;
68};
69
70
71}
72
73#endif /* __OPEN_FLIGHT_WRITER_H__ */
Note: See TracBrowser for help on using the browser.