PanosphereSphereTool.cpp

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00024 #include <GL/glew.h>
00025 #ifdef __WXMAC__
00026 #include <OpenGL/gl.h>
00027 #include <OpenGL/glu.h>
00028 #else
00029 #include <GL/gl.h>
00030 #include <GL/glu.h>
00031 #endif
00032 #ifdef __APPLE__
00033   #include <GLUT/glut.h>
00034 #endif
00035 
00036 #include "PanosphereSphereTool.h"
00037 
00038 PanosphereSphereTool::PanosphereSphereTool(PanosphereOverviewToolHelper *helper, const wxColour backgroundColour) : PanosphereOverviewTool(helper)
00039 {
00040     m_background_color = backgroundColour;
00041 }
00042 
00043 void PanosphereSphereTool::Activate()
00044 {
00045     static_cast<PanosphereOverviewToolHelper*>(helper)->NotifyMe(PanosphereOverviewToolHelper::DRAW_UNDER_IMAGES_BACK, this);
00046     static_cast<PanosphereOverviewToolHelper*>(helper)->NotifyMe(PanosphereOverviewToolHelper::DRAW_UNDER_IMAGES_FRONT, this);
00047 }
00048 
00049 void PanosphereSphereTool::BeforeDrawImagesBackEvent()
00050 {
00051     helper->GetViewStatePtr()->GetTextureManager()->DisableTexture();
00052     glDisable(GL_TEXTURE_2D);
00053     glColor4f((float)m_background_color.Red() / 255, (float)m_background_color.Green() / 255, (float)m_background_color.Blue() / 255, 0.8f);
00054  
00055     glEnable(GL_BLEND);
00056     glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
00057     GLUquadric* gridb = gluNewQuadric();
00058     gluSphere(gridb, 101,40,20);
00059 
00060     glEnable(GL_TEXTURE_2D);
00061     glDisable(GL_BLEND);
00062 
00063     glMatrixMode(GL_MODELVIEW);
00064     
00065 }
00066 
00067 void PanosphereSphereTool::BeforeDrawImagesFrontEvent()
00068 {
00069 
00070 }
00071 
00072 void PanosphereSphereTool::SetPreviewBackgroundColor (wxColour c)
00073 {
00074     m_background_color = c;
00075 }

Generated on 27 Aug 2016 for Hugintrunk by  doxygen 1.4.7