From: <hug...@li...> - 2011-02-27 15:26:26
|
branch: details: http://hugin.hg.sourceforge.net/hgweb/hugin/hugin/hgrepo/h/hu/hugin/hugin/rev/7d0a3d8b9a8b changeset: 5007:7d0a3d8b9a8b user: dmakreshanski <dma...@us...> date: Sun Feb 27 16:24:47 2011 +0100 description: separated transparent semi transparent sphere from panosphere projection grid tool diffstat: src/hugin1/hugin/CMakeLists.txt | 4 +- src/hugin1/hugin/GLPreviewFrame.cpp | 6 +++ src/hugin1/hugin/GLPreviewFrame.h | 2 + src/hugin1/hugin/PanosphereSphereTool.cpp | 72 ++++++++++++++++++++++++++++++++++++ src/hugin1/hugin/PanosphereSphereTool.h | 43 +++++++++++++++++++++ src/hugin1/hugin/ProjectionGridTool.cpp | 14 +++--- 6 files changed, 132 insertions(+), 9 deletions(-) diffs (217 lines): diff -r f1663f841086 -r 7d0a3d8b9a8b src/hugin1/hugin/CMakeLists.txt --- a/src/hugin1/hugin/CMakeLists.txt Sun Feb 27 16:00:36 2011 +0100 +++ b/src/hugin1/hugin/CMakeLists.txt Sun Feb 27 16:24:47 2011 +0100 @@ -31,7 +31,7 @@ HFOVDialog.cpp TextureManager.cpp MeshRemapper.cpp VertexCoordRemapper.cpp TexCoordRemapper.cpp ChoosyRemapper.cpp MeshManager.cpp ViewState.cpp OutputProjectionInfo.cpp ToolHelper.cpp Tool.cpp OverviewCameraTool.cpp ProjectionGridTool.cpp OverviewOutlinesTool.cpp -PreviewCropTool.cpp DragTool.cpp PreviewIdentifyTool.cpp +PreviewCropTool.cpp DragTool.cpp PreviewIdentifyTool.cpp PanosphereSphereTool.cpp PreviewDifferenceTool.cpp PreviewPanoMaskTool.cpp PreviewControlPointTool.cpp GreatCircles.cpp AboutDialog.cpp LayoutRemapper.cpp PreviewLayoutLinesTool.cpp PreviewColorPickerTool.cpp MaskEditorPanel.cpp MaskImageCtrl.cpp MaskLoadDialog.cpp HtmlWindow.cpp) @@ -46,7 +46,7 @@ HFOVDialog.h TextureManager.h MeshRemapper.h VertexCoordRemapper.h TexCoordRemapper.h ChoosyRemapper.h MeshManager.h ViewState.h OutputProjectionInfo.h ToolHelper.h Tool.h OverviewCameraTool.h ProjectionGridTool.h OverviewOutlinesTool.h -PreviewCropTool.h DragTool.h PreviewIdentifyTool.h +PreviewCropTool.h DragTool.h PreviewIdentifyTool.h PanosphereSphereTool.h PreviewDifferenceTool.h PreviewPanoMaskTool.h PreviewControlPointTool.h GreatCircles.h AboutDialog.h LayoutRemapper.h PreviewLayoutLinesTool.h PreviewColorPickerTool.h MaskEditorPanel.h MaskImageCtrl.h MaskLoadDialog.h HtmlWindow.h) diff -r f1663f841086 -r 7d0a3d8b9a8b src/hugin1/hugin/GLPreviewFrame.cpp --- a/src/hugin1/hugin/GLPreviewFrame.cpp Sun Feb 27 16:00:36 2011 +0100 +++ b/src/hugin1/hugin/GLPreviewFrame.cpp Sun Feb 27 16:24:47 2011 +0100 @@ -75,6 +75,7 @@ #include "PreviewColorPickerTool.h" #include "ProjectionGridTool.h" +#include "PanosphereSphereTool.h" #include "OverviewCameraTool.h" #include "OverviewOutlinesTool.h" @@ -1793,12 +1794,17 @@ panosphere_overview_helper->ActivateTool(panosphere_overview_camera_tool); panosphere_overview_identify_tool = new PreviewIdentifyTool(panosphere_overview_helper, this); panosphere_overview_helper->ActivateTool(panosphere_overview_identify_tool); + + panosphere_sphere_tool = new PanosphereSphereTool(panosphere_overview_helper); + panosphere_overview_helper->ActivateTool(panosphere_sphere_tool); overview_projection_grid = new PanosphereOverviewProjectionGridTool(panosphere_overview_helper); if(m_previewGrid->GetValue()) { panosphere_overview_helper->ActivateTool(overview_projection_grid); } + + overview_outlines_tool = new PanosphereOverviewOutlinesTool(panosphere_overview_helper, m_GLPreview); panosphere_overview_helper->ActivateTool(overview_outlines_tool); panosphere_difference_tool = new PreviewDifferenceTool(panosphere_overview_helper); diff -r f1663f841086 -r 7d0a3d8b9a8b src/hugin1/hugin/GLPreviewFrame.h --- a/src/hugin1/hugin/GLPreviewFrame.h Sun Feb 27 16:00:36 2011 +0100 +++ b/src/hugin1/hugin/GLPreviewFrame.h Sun Feb 27 16:24:47 2011 +0100 @@ -71,6 +71,7 @@ class PanosphereOverviewProjectionGridTool; class PreviewProjectionGridTool; +class PanosphereSphereTool; class PanosphereOverviewOutlinesTool; class PlaneOverviewOutlinesTool; @@ -416,6 +417,7 @@ PanosphereOverviewProjectionGridTool * overview_projection_grid; PreviewProjectionGridTool * preview_projection_grid; + PanosphereSphereTool * panosphere_sphere_tool; PanosphereOverviewToolHelper *panosphere_overview_helper; diff -r f1663f841086 -r 7d0a3d8b9a8b src/hugin1/hugin/PanosphereSphereTool.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hugin1/hugin/PanosphereSphereTool.cpp Sun Feb 27 16:24:47 2011 +0100 @@ -0,0 +1,72 @@ +// -*- c-basic-offset: 4 -*- +/** @file ProjectionGridTool.h + * + * @author Darko Makreshanski + * + * @brief implementation of PanosphereSphereTool Class + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#if !defined Hugin_shared || !defined _WINDOWS +#define GLEW_STATIC +#endif +#include <GL/glew.h> +#ifdef __WXMAC__ +#include <OpenGL/gl.h> +#include <OpenGL/glu.h> +#else +#include <GL/gl.h> +#include <GL/glu.h> +#endif +#ifdef __APPLE__ + #include <GLUT/glut.h> +#endif + + +#include "PanosphereSphereTool.h" + + +void PanosphereSphereTool::Activate() +{ + ((PanosphereOverviewToolHelper*)helper)->NotifyMe(PanosphereOverviewToolHelper::DRAW_OVER_IMAGES_BACK, this); + ((PanosphereOverviewToolHelper*)helper)->NotifyMe(PanosphereOverviewToolHelper::DRAW_OVER_IMAGES_FRONT, this); +} + + +void PanosphereSphereTool::AfterDrawImagesBackEvent() +{ + + glDisable(GL_TEXTURE_2D); + glColor4f(0.3,0.3,0.3,0.6); + glEnable(GL_BLEND); + glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + GLUquadric* gridb = gluNewQuadric(); + gluSphere(gridb, 101,40,20); + + glEnable(GL_TEXTURE_2D); + glDisable(GL_BLEND); + + glMatrixMode(GL_MODELVIEW); + +} + +void PanosphereSphereTool::AfterDrawImagesFrontEvent() +{ + + +} + diff -r f1663f841086 -r 7d0a3d8b9a8b src/hugin1/hugin/PanosphereSphereTool.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hugin1/hugin/PanosphereSphereTool.h Sun Feb 27 16:24:47 2011 +0100 @@ -0,0 +1,43 @@ +// -*- c-basic-offset: 4 -*- +/** @file PanosphereSphereTool.h + * + * @author Darko Makreshanski + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _PANOSPHERE_SPHERE_TOOL_H +#define _PANOSPHERE_SPHERE_TOOL_H + +#include "Tool.h" + +/** + * tool to draw a whiteish transparent sphere for the panosphere + */ +class PanosphereSphereTool : public PanosphereOverviewTool +{ +public: + void Activate(); + PanosphereSphereTool(PanosphereOverviewToolHelper *helper) : PanosphereOverviewTool(helper) {} + + void AfterDrawImagesBackEvent(); + void AfterDrawImagesFrontEvent(); +protected: + +}; + +#endif + diff -r f1663f841086 -r 7d0a3d8b9a8b src/hugin1/hugin/ProjectionGridTool.cpp --- a/src/hugin1/hugin/ProjectionGridTool.cpp Sun Feb 27 16:00:36 2011 +0100 +++ b/src/hugin1/hugin/ProjectionGridTool.cpp Sun Feb 27 16:24:47 2011 +0100 @@ -139,14 +139,14 @@ DEBUG_DEBUG("resources created"); - glDisable(GL_TEXTURE_2D); - glColor4f(0.3,0.3,0.3,0.6); - glEnable(GL_BLEND); - glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - GLUquadric* gridb = gluNewQuadric(); - gluSphere(gridb, 101,40,20); +// glDisable(GL_TEXTURE_2D); +// glColor4f(0.3,0.3,0.3,0.6); +// glEnable(GL_BLEND); +// glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); +// GLUquadric* gridb = gluNewQuadric(); +// gluSphere(gridb, 101,40,20); - glEnable(GL_TEXTURE_2D); +// glEnable(GL_TEXTURE_2D); glColor4f(1,1,1,0.3); glEnable( GL_TEXTURE_2D ); |