PanosphereSphereTool.cpp

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

Generated on Fri Aug 1 01:25:37 2014 for Hugintrunk by  doxygen 1.3.9.1