Commit e476bda4 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[STYLE #42] renamed main view to be consistent with capitalization guidelines...

[STYLE #42] renamed main view to be consistent with capitalization guidelines as it shows up in the GUI
parent e6ae7d36
......@@ -87,7 +87,7 @@ WGEViewer::WGEViewer( std::string name, osg::ref_ptr<osg::Referenced> wdata, int
case( WGECamera::ORTHOGRAPHIC ):
m_pickHandler = new WPickHandler( name );
m_View->addEventHandler( m_pickHandler );
if( name != std::string( "main" ) )
if( name != std::string( "Main View" ) )
break;
case( WGECamera::PERSPECTIVE ):
// camera manipulator
......
......@@ -168,7 +168,7 @@ boost::shared_ptr< WGEViewer > WGraphicsEngine::getViewerByName( std::string nam
boost::shared_ptr< WGEViewer > WGraphicsEngine::getViewer()
{
boost::mutex::scoped_lock lock( m_viewersLock );
return m_viewers[ "main" ];
return m_viewers[ "Main View" ];
}
bool WGraphicsEngine::isRunning()
......
......@@ -185,7 +185,7 @@ void WPickHandler::pick( osgViewer::View* view, const osgGA::GUIEventAdapter& ea
updatePickInfoModifierKeys( &pickInfo );
// if we are in another viewer than the main view we just need the pixel position
if( m_viewerName != "" && m_viewerName != "main" )
if( m_viewerName != "" && m_viewerName != "Main View" )
{
pickInfo = WPickInfo( "", m_viewerName, m_startPick.getPickPosition(), std::make_pair( x, y ),
m_startPick.getModifierKey(), m_mouseButton, m_startPick.getPickNormal() );
......
......@@ -124,7 +124,7 @@ WROIBox::WROIBox( WPosition minPos, WPosition maxPos ) :
boost::shared_ptr< WGraphicsEngine > ge = WGraphicsEngine::getGraphicsEngine();
assert( ge );
boost::shared_ptr< WGEViewer > viewer = ge->getViewerByName( "main" );
boost::shared_ptr< WGEViewer > viewer = ge->getViewerByName( "Main View" );
assert( viewer );
m_viewer = viewer;
m_pickHandler = m_viewer->getPickHandler();
......
......@@ -56,7 +56,7 @@ WROISphere::WROISphere( WPosition position, float radius ) :
{
boost::shared_ptr< WGraphicsEngine > ge = WGraphicsEngine::getGraphicsEngine();
assert( ge );
boost::shared_ptr< WGEViewer > viewer = ge->getViewerByName( "main" );
boost::shared_ptr< WGEViewer > viewer = ge->getViewerByName( "Main View" );
assert( viewer );
m_viewer = viewer;
m_pickHandler = m_viewer->getPickHandler();
......
......@@ -37,7 +37,7 @@ class WROIBoxTest : public CxxTest::TestSuite
public:
/**
* I would like to test instantiation here, but WROIBox needs nearly a complete
* running GUI and GE with the "main" viewer. This seemed to much effort for
* running GUI and GE with the "Main View" viewer. This seemed to much effort for
* this small test to me.
*/
void testInstantiation( void )
......
......@@ -87,7 +87,7 @@ boost::shared_ptr< WCrosshair >WSelectionManager::getCrosshair()
int WSelectionManager::getFrontSector()
{
boost::shared_ptr< WGEViewer > viewer;
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "main" );
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "Main View" );
viewer->getCamera()->getViewMatrix();
osg::Matrix rm = viewer->getCamera()->getViewMatrix();
......
......@@ -92,7 +92,7 @@ void WMHud::moduleMain()
// NOTE: ALWAYS remove your osg nodes!
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->remove( m_rootNode );
// disconnect from picking
boost::shared_ptr< WGEViewer > viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "main" );
boost::shared_ptr< WGEViewer > viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "Main View" );
if( viewer->getPickHandler() )
{
viewer->getPickHandler()->getPickSignal()->disconnect( boost::bind( &WMHud::updatePickText, this, _1 ) );
......@@ -207,7 +207,7 @@ void WMHud::init()
}
// connect updateGFX with picking
boost::shared_ptr< WGEViewer > viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "main" );
boost::shared_ptr< WGEViewer > viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "Main View" );
WAssert( viewer, "Requested viewer (main) not found." );
if(viewer->getPickHandler() )
{
......
......@@ -100,7 +100,7 @@ void WMLineGuidedSlice::moduleMain()
boost::shared_ptr< WGraphicsEngine > ge = WGraphicsEngine::getGraphicsEngine();
assert( ge );
m_viewer = ge->getViewerByName( "main" );
m_viewer = ge->getViewerByName( "Main View" );
assert( m_viewer );
m_viewer->getPickHandler()->getPickSignal()->connect( boost::bind( &WMLineGuidedSlice::setSlicePosFromPick, this, _1 ) );
......
......@@ -289,7 +289,7 @@ WMNavigationSlices::PickCallback::PickCallback( osg::ref_ptr< osg::Node > node,
m_dir( negateDirection ? -1.0 : 1.0 )
{
boost::shared_ptr< WGraphicsEngine > ge = WGraphicsEngine::getGraphicsEngine();
boost::shared_ptr< WGEViewer > viewer = ge->getViewerByName( "main" );
boost::shared_ptr< WGEViewer > viewer = ge->getViewerByName( "Main View" );
m_camera = viewer->getCamera();
m_pickConnection = viewer->getPickHandler()->getPickSignal()->connect( boost::bind( &WMNavigationSlices::PickCallback::pick, this, _1 ) );
node->getOrCreateStateSet()->addUniform( m_pickUniform );
......
......@@ -51,7 +51,7 @@ void WTransparentLinesDrawable::drawImplementation( osg::RenderInfo &renderInfo
{
boost::shared_ptr< WGraphicsEngine > ge = WGraphicsEngine::getGraphicsEngine();
boost::shared_ptr< WGEViewer > viewer; //!< Stores reference to the main viewer
viewer = ge->getViewerByName( "main" );
viewer = ge->getViewerByName( "Main View" );
WPosition endPos = WPosition( wge::unprojectFromScreen( WPosition( 0.0, 0.0, 1.0 ), viewer->getCamera() ) );
WPosition startPos = WPosition( wge::unprojectFromScreen( WPosition(), viewer->getCamera() ) );
WPosition viewDir = normalize( endPos - startPos );
......
......@@ -232,7 +232,7 @@ void WMainWindow::setupGUI()
m_glDock->setDockOptions( QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks );
m_glDock->setDocumentMode( true );
setCentralWidget( m_glDock );
WQtGLDockWidget* mainGLDock = new WQtGLDockWidget( "main", "3D View", m_glDock );
WQtGLDockWidget* mainGLDock = new WQtGLDockWidget( "Main View", "3D View", m_glDock );
mainGLDock->getGLWidget()->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
m_mainGLWidget = mainGLDock->getGLWidget();
m_mainGLWidgetScreenCapture = m_mainGLWidget->getScreenCapture( this );
......@@ -772,7 +772,7 @@ void WMainWindow::openOpenWalnutHelpDialog()
void WMainWindow::setPresetViewLeft()
{
boost::shared_ptr< WGEViewer > viewer;
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "main" );
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "Main View" );
osg::ref_ptr<osgGA::TrackballManipulator> cm = osg::dynamic_pointer_cast<osgGA::TrackballManipulator>( viewer->getCameraManipulator() );
osg::Quat q( 0.5, -0.5, -0.5, 0.5 );
cm->setRotation( q );
......@@ -781,7 +781,7 @@ void WMainWindow::setPresetViewLeft()
void WMainWindow::setPresetViewRight()
{
boost::shared_ptr< WGEViewer > viewer;
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "main" );
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "Main View" );
osg::ref_ptr<osgGA::TrackballManipulator> cm = osg::dynamic_pointer_cast<osgGA::TrackballManipulator>( viewer->getCameraManipulator() );
osg::Quat q( -0.5, -0.5, -0.5, -0.5 );
cm->setRotation( q );
......@@ -790,7 +790,7 @@ void WMainWindow::setPresetViewRight()
void WMainWindow::setPresetViewSuperior()
{
boost::shared_ptr< WGEViewer > viewer;
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "main" );
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "Main View" );
osg::ref_ptr<osgGA::TrackballManipulator> cm = osg::dynamic_pointer_cast<osgGA::TrackballManipulator>( viewer->getCameraManipulator() );
osg::Quat q( 0., 0., 0., 1 );
cm->setRotation( q );
......@@ -799,7 +799,7 @@ void WMainWindow::setPresetViewSuperior()
void WMainWindow::setPresetViewInferior()
{
boost::shared_ptr< WGEViewer > viewer;
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "main" );
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "Main View" );
osg::ref_ptr<osgGA::TrackballManipulator> cm = osg::dynamic_pointer_cast<osgGA::TrackballManipulator>( viewer->getCameraManipulator() );
osg::Quat q( 0., -1., 0., 0. );
cm->setRotation( q );
......@@ -808,7 +808,7 @@ void WMainWindow::setPresetViewInferior()
void WMainWindow::setPresetViewAnterior()
{
boost::shared_ptr< WGEViewer > viewer;
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "main" );
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "Main View" );
osg::ref_ptr<osgGA::TrackballManipulator> cm = osg::dynamic_pointer_cast<osgGA::TrackballManipulator>( viewer->getCameraManipulator() );
osg::Quat q( 0., -0.707107, -0.707107, 0. );
cm->setRotation( q );
......@@ -817,7 +817,7 @@ void WMainWindow::setPresetViewAnterior()
void WMainWindow::setPresetViewPosterior()
{
boost::shared_ptr< WGEViewer > viewer;
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "main" );
viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewerByName( "Main View" );
osg::ref_ptr<osgGA::TrackballManipulator> cm = osg::dynamic_pointer_cast<osgGA::TrackballManipulator>( viewer->getCameraManipulator() );
osg::Quat q( 0.707107, 0., 0., 0.707107 );
cm->setRotation( q );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment