Work on CompositeViewer and related calsses to implement viewers with multiple views

This commit is contained in:
Robert Osfield
2007-01-16 08:56:33 +00:00
parent 6fda4a927a
commit 0873a8cea0
11 changed files with 1650 additions and 158 deletions

View File

@@ -238,6 +238,7 @@ void View::setUpViewOnSingleScreen(unsigned int screenNum)
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(screenNum), width, height);
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->screenNum = screenNum;
traits->x = 0;
traits->y = 0;
traits->width = width;
@@ -327,6 +328,18 @@ void View::requestWarpPointer(float x,float y)
}
}
bool View::containsCamera(const osg::Camera* camera) const
{
if (_camera == camera) return true;
for(unsigned i=0; i<getNumSlaves(); ++i)
{
const Slave& slave = getSlave(i);
if (slave._camera == camera) return true;
}
return false;
}
const osg::Camera* View::getCameraContainingPosition(float x, float y, float& local_x, float& local_y) const
{
const osgGA::GUIEventAdapter* eventState = getEventQueue()->getCurrentEventState();