Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[f7b49d]: src / hugin1 / hugin / GLRenderer.h Maximize Restore History

Download this file

GLRenderer.h    151 lines (121 with data), 4.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// -*- c-basic-offset: 4 -*-
/** @file GLRenderer.h
*
* @author James Legg
* @author Darko Makreshanski
*
* This 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
* Lesser 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 _GLRENDERER_H
#define _GLRENDERER_H
// TODO needed?
//#include <vector>
/* something messed up... temporary fix :-( */
#include "hugin_utils/utils.h"
#define DEBUG_HEADER ""
#include <base_wx/ImageCache.h>
#include <vigra_ext/ROIImage.h>
#include <vigra/diff2d.hxx>
#include <utility>
class ToolHelper;
class OverviewToolHelper;
class PreviewToolHelper;
class PanosphereOverviewToolHelper;
class PlaneOverviewToolHelper;
/** The renderer handles drawing the opengl scene. It is used by a GLViewer, which is
* a wxWidget. The work of generating textures to represent the image is done by
* a TextureManager, and the remappings are made in display lists by a
* MeshManager. The GLViewer gives us instances of those objects to use.
*/
class GLRenderer
{
public:
/** ctor.
*/
// GLRenderer(PT::Panorama * pano, TextureManager *tex_man,
// MeshManager *mesh_man, VisualizationState *visualization_state,
// PreviewToolHelper *tool_helper);
/** dtor.
*/
virtual ~GLRenderer();
/** Resize the viewport because the window's dimensions have changed.
* @return the number of screen pixels from the corner of the widget to the
* start of the panorma, both horizontally and vertically.
* @param width the width of the widget in screen pixels.
* @param height the height of the widget in screen pixels.
*/
virtual vigra::Diff2D Resize(int width, int height) = 0;
virtual void Redraw() = 0;
void SetBackground(unsigned char red, unsigned char green, unsigned char blue);
float width_o, height_o;
protected:
PT::Panorama * m_pano;
TextureManager * m_tex_man;
MeshManager * m_mesh_man;
ToolHelper *m_tool_helper;
int width, height;
};
/**
* subclass for the preview canvas
*/
class GLPreviewRenderer : public GLRenderer
{
public:
GLPreviewRenderer(PT::Panorama * pano, TextureManager *tex_man,
MeshManager *mesh_man, VisualizationState *visualization_state,
PreviewToolHelper *tool_helper);
vigra::Diff2D Resize(int width, int height);
void Redraw();
protected:
VisualizationState * m_visualization_state;
};
class GLOverviewRenderer : public GLRenderer
{
public:
// GLOverviewRenderer(PT::Panorama * pano, TextureManager *tex_man,
// MeshManager *mesh_man, PanosphereOverviewVisualizationState *visualization_state,
// OverviewToolHelper *tool_helper)
protected:
};
/**
* subclass for the panosphere overview mode
*/
class GLPanosphereOverviewRenderer : public GLOverviewRenderer
{
public:
GLPanosphereOverviewRenderer(PT::Panorama * pano, TextureManager *tex_man,
MeshManager *mesh_man, PanosphereOverviewVisualizationState *visualization_state,
PanosphereOverviewToolHelper *tool_helper);
vigra::Diff2D Resize(int width, int height);
void Redraw();
protected:
PanosphereOverviewVisualizationState * m_visualization_state;
};
/**
* subclass for the plane overview mode
*/
class GLPlaneOverviewRenderer : public GLOverviewRenderer
{
public:
GLPlaneOverviewRenderer(PT::Panorama * pano, TextureManager *tex_man,
MeshManager *mesh_man, PlaneOverviewVisualizationState *visualization_state,
PlaneOverviewToolHelper *tool_helper);
vigra::Diff2D Resize(int width, int height);
void Redraw();
protected:
PlaneOverviewVisualizationState * m_visualization_state;
};
#endif