~ubuntu-branches/ubuntu/trusty/openscenegraph/trusty

« back to all changes in this revision

Viewing changes to OpenSceneGraph/src/osgPlugins/view/ReaderWriterOsgViewer.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-11-12 02:21:14 UTC
  • mfrom: (31.1.3 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20131112022114-qaxfhdnhn88vnh10
Tags: 3.2.0~rc1-1ubuntu1
Fix deprecated url_feof.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2007 Robert Osfield 
 
1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2007 Robert Osfield
2
2
 *
3
 
 * This application is open source and may be redistributed and/or modified   
 
3
 * This application is open source and may be redistributed and/or modified
4
4
 * freely and without restriction, both in commercial and non commercial
5
5
 * applications, as long as this copyright notice is maintained.
6
 
 * 
 
6
 *
7
7
 * This application is distributed in the hope that it will be useful,
8
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
30
30
        supportsOption("precision","Set the floating point precision of output");
31
31
        supportsOption("OutputTextureFiles","Output texture image to file");
32
32
    }
33
 
    
 
33
 
34
34
    virtual const char* className() const { return "osgViewer configuration loader"; }
35
35
 
36
36
    void setPrecision(osgDB::Output& fout, const osgDB::ReaderWriter::Options* options) const
41
41
            std::string opt;
42
42
            while (iss >> opt)
43
43
            {
44
 
                if(opt=="PRECISION" || opt=="precision") 
 
44
                if(opt=="PRECISION" || opt=="precision")
45
45
                {
46
46
                    int prec;
47
47
                    iss >> prec;
53
53
                }
54
54
            }
55
55
        }
56
 
    }            
 
56
    }
57
57
 
58
58
 
59
59
    virtual ReadResult readObject(const std::string& file, const osgDB::ReaderWriter::Options* options) const
65
65
        std::string fileName = osgDB::findDataFile( file, options );
66
66
        if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
67
67
 
68
 
        // code for setting up the database path so that internally referenced file are searched for on relative paths. 
 
68
        // code for setting up the database path so that internally referenced file are searched for on relative paths.
69
69
        osgDB::ifstream fin(fileName.c_str());
70
70
        if (fin)
71
71
        {