root/OpenSceneGraph/trunk/examples/osgpdf/osgpdf.cpp @ 12292

Revision 12292, 1.1 kB (checked in by robert, 3 years ago)

Ran svn propset -R svn:eol-style native . on the OpenSceneGraph

  • Property svn:eol-style set to native
RevLine 
[9156]1#include <osgViewer/Viewer>
2#include <osgViewer/ViewerEventHandlers>
3
[9319]4#include <osgWidget/PdfReader>
[9156]5
6int main(int argc,char** argv)
7{
8    osg::ArgumentParser arguments(&argc, argv);
9    osgViewer::Viewer viewer(arguments);
10
[9324]11    osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),
[9319]12                                   osg::Vec3(1.0f,0.0f,0.0f),
13                                   osg::Vec3(0.0f,0.0f,1.0f),
[9323]14                                   osg::Vec4(1.0f,1.0f,1.0f,1.0f),
[9319]15                                   osgWidget::GeometryHints::RESIZE_HEIGHT_TO_MAINTAINCE_ASPECT_RATIO);
16
17    osg::ref_ptr<osg::Group> group = new osg::Group;
18
[9156]19    for(int i=1; i<arguments.argc(); ++i)
20    {
21        if (!arguments.isOption(i))
22        {
[9319]23            osg::ref_ptr<osgWidget::PdfReader> pdfReader = new osgWidget::PdfReader;
24            if (pdfReader->open(arguments[i], hints))
[9156]25            {           
[9319]26                group->addChild(pdfReader.get());
27               
28                hints.position.x() += 1.1f;
[9156]29            }
30        }
31    }
32
[9319]33    viewer.setSceneData(group.get());
[9156]34
35    viewer.addEventHandler(new osgViewer::StatsHandler);
36
37    return viewer.run();
38}
Note: See TracBrowser for help on using the browser.