Added -4 command line entry that creates two seperate windows within CompositeViewer
This commit is contained in:
parent
72ab22e539
commit
fdc7d225a0
@ -198,6 +198,46 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (arguments.read("-4"))
|
||||||
|
{
|
||||||
|
|
||||||
|
// view one
|
||||||
|
{
|
||||||
|
osgViewer::View* view = new osgViewer::View;
|
||||||
|
view->setName("View one");
|
||||||
|
viewer.addView(view);
|
||||||
|
|
||||||
|
view->setUpViewInWindow(0, 0, 800, 600);
|
||||||
|
view->setSceneData(scene.get());
|
||||||
|
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||||
|
|
||||||
|
// add the state manipulator
|
||||||
|
osg::ref_ptr<osgGA::StateSetManipulator> statesetManipulator = new osgGA::StateSetManipulator;
|
||||||
|
statesetManipulator->setStateSet(view->getCamera()->getOrCreateStateSet());
|
||||||
|
|
||||||
|
view->addEventHandler( statesetManipulator.get() );
|
||||||
|
}
|
||||||
|
|
||||||
|
// view two
|
||||||
|
{
|
||||||
|
osgViewer::View* view = new osgViewer::View;
|
||||||
|
view->setName("View two");
|
||||||
|
viewer.addView(view);
|
||||||
|
|
||||||
|
view->setUpViewInWindow(1000, 0, 800, 600);
|
||||||
|
view->setSceneData(scene.get());
|
||||||
|
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||||
|
|
||||||
|
view->addEventHandler( new osgViewer::StatsHandler );
|
||||||
|
|
||||||
|
|
||||||
|
// add the handler for doing the picking
|
||||||
|
view->addEventHandler(new PickHandler());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (arguments.read("-3") || viewer.getNumViews()==0)
|
if (arguments.read("-3") || viewer.getNumViews()==0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user