Hugin trunk 0.1
Loading...
Searching...
No Matches
MeshManager.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
23#ifndef _MESHMANAGER_H
24#define _MESHMANAGER_H
25
26#include "panodata/Panorama.h"
27
28#include "MeshRemapper.h"
29
30class MeshRemapper;
32
38{
39public:
41 virtual ~MeshManager();
42
43 void CheckUpdate();
44
47 void RenderMesh(unsigned int image_number) const;
48 unsigned int GetDisplayList(unsigned int image_number) const;
49
57 void SetLayoutMode(bool state);
59 bool GetLayoutMode() const;
60 void SetLayoutScale(double scale);
61
65 {
66 public:
80 MeshInfo(const MeshInfo & source);
81 virtual ~MeshInfo();
83 void CallList() const;
85 void Update();
86 unsigned int display_list_number;
87 void SetScaleFactor(double scale);
89
93 class Coord3D
94 {
95 public:
97 explicit Coord3D(hugin_utils::FDiff2D & coord) {x = coord.x; y = coord.y; z = 0;}
98 double x,y,z;
99 };
100
105 public:
107 explicit MeshCoords3D(const MeshRemapper::Coords & coords);
108 double tex_coords[2][2][2];
109 double vertex_coords[2][2][3];
110 };
111
112
113 protected:
114
115 virtual void BeforeCompile() {}
116 virtual void Transform() {}
117 virtual void AfterCompile() {}
118
126 void CompileList();
128 };
129
149
155 {
156 public:
163
168
172 static void Convert(double &x, double &y, double &z, double th, double ph, double r);
173
174 static MeshCoords3D GetMeshCoords3D(MeshRemapper::Coords &coords, VisualizationState * state);
176
178 static const double scale_diff;
179
180 protected:
181
182 void BeforeCompile();
183 void Transform();
184 void AfterCompile();
185
186 double yaw,pitch;
187
188 };
189
212
215
216
218
219protected:
220
221
224
225
226 std::vector<MeshInfo*> meshes;
228};
229
230
240
251
262
263
264#endif
265
Model for a panorama.
Definition Panorama.h:153
All variables of a source image.
a class to handle a 3D point
Definition MeshManager.h:94
Coord3D(hugin_utils::FDiff2D &coord)
Definition MeshManager.h:97
a class to keep data of a single rectangle with texture coordinates
Handles the remapper and a display list for a specific image.
Definition MeshManager.h:65
HuginBase::SrcPanoImage image
virtual void AfterCompile()
void CallList() const
Draw the mesh.
unsigned int display_list_number
Definition MeshManager.h:86
void CompileList()
Use the remapper to create the display list.
VisualizationState * m_visualization_state
void SetSrcImage(HuginBase::SrcPanoImage *image)
Definition MeshManager.h:88
void SetScaleFactor(double scale)
virtual void Transform()
MeshRemapper * remap
The ramapper we should use.
HuginBase::Panorama * m_pano
void Update()
Recreate the mesh when the image or panorama it represents changes.
virtual void BeforeCompile()
a subclass for the panosphere it converts coordinates obtained from an equirectangular projection to ...
static void Convert(double &x, double &y, double &z, double th, double ph, double r)
convert from spherical to cartesian coordinates
static MeshCoords3D GetMeshCoords3D(MeshRemapper::Coords &coords, VisualizationState *state)
PanosphereOverviewMeshInfo(HuginBase::Panorama *m_pano, HuginBase::SrcPanoImage *image, VisualizationState *visualization_state, bool layout_mode_on)
static const double scale_diff
scale factor to be used for the layout mode TODO: test this for more scenarios
static Coord3D GetCoord3D(hugin_utils::FDiff2D &coord, VisualizationState *state)
PanosphereOverviewMeshInfo(const PanosphereOverviewMeshInfo &source)
subclass for the plane overview mode.
PlaneOverviewMeshInfo(HuginBase::Panorama *m_pano, HuginBase::SrcPanoImage *image, VisualizationState *visualization_state, bool layout_mode_on)
static MeshCoords3D GetMeshCoords3D(MeshRemapper::Coords &coords, VisualizationState *state)
static Coord3D GetCoord3D(hugin_utils::FDiff2D &coord, VisualizationState *state)
PlaneOverviewMeshInfo(const PlaneOverviewMeshInfo &source)
subclass of MeshInfo for the preview It actually does nothing in addition to the base class
PreviewMeshInfo(const PreviewMeshInfo &source)
static Coord3D GetCoord3D(hugin_utils::FDiff2D &coord, VisualizationState *state)
PreviewMeshInfo(HuginBase::Panorama *m_pano, HuginBase::SrcPanoImage *image, VisualizationState *visualization_state, bool layout_mode_on)
static MeshCoords3D GetMeshCoords3D(MeshRemapper::Coords &coords, VisualizationState *state)
A MeshManager handles the graphics system representation of a remapping, by creating OpenGL display l...
Definition MeshManager.h:38
void CheckUpdate()
bool layout_mode_on
bool GetLayoutMode() const
return if layout mode is active
virtual MeshInfo::MeshCoords3D GetMeshCoords3D(MeshRemapper::Coords &coords)=0
void SetLayoutMode(bool state)
Turn layout mode on or off.
VisualizationState * visualization_state
HuginBase::Panorama * m_pano
virtual ~MeshManager()
virtual MeshInfo::Coord3D GetCoord3D(hugin_utils::FDiff2D &)=0
void SetLayoutScale(double scale)
unsigned int GetDisplayList(unsigned int image_number) const
std::vector< MeshInfo * > meshes
virtual MeshInfo * ObtainMeshInfo(HuginBase::SrcPanoImage *, bool layout_mode_on)=0
void RenderMesh(unsigned int image_number) const
void CleanMeshes()
Remove meshes for images that have been deleted.
A class for exchanging pointers to coordinates.
An abstract base class for objects that calculate an approximate remap specified by quadrilatrials.
MeshInfo::Coord3D GetCoord3D(hugin_utils::FDiff2D &coord)
PanosphereOverviewMeshManager(HuginBase::Panorama *pano, VisualizationState *visualization_state)
MeshInfo::MeshCoords3D GetMeshCoords3D(MeshRemapper::Coords &coords)
MeshInfo * ObtainMeshInfo(HuginBase::SrcPanoImage *, bool layout_mode_on)
MeshInfo::MeshCoords3D GetMeshCoords3D(MeshRemapper::Coords &coords)
PlaneOverviewMeshManager(HuginBase::Panorama *pano, VisualizationState *visualization_state)
MeshInfo::Coord3D GetCoord3D(hugin_utils::FDiff2D &coord)
MeshInfo * ObtainMeshInfo(HuginBase::SrcPanoImage *, bool layout_mode_on)
PreviewMeshManager(HuginBase::Panorama *pano, VisualizationState *visualization_state)
MeshInfo::Coord3D GetCoord3D(hugin_utils::FDiff2D &coord)
MeshInfo * ObtainMeshInfo(HuginBase::SrcPanoImage *, bool layout_mode_on)
MeshInfo::MeshCoords3D GetMeshCoords3D(MeshRemapper::Coords &coords)
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41