-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapViewer.h
71 lines (54 loc) · 1.9 KB
/
MapViewer.h
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
#include "MapDB.h"
#include "MapAccessor.h"
#include <QGLViewer/qglviewer.h>
class MapAccessor;
class MapViewer: public QGLViewer
{
public:
MapViewer(QWidget *parent) ;
void setMapAccessor(MapAccessor *ma);
virtual void draw() override ;
void forceUpdate();
protected:
void computeSlice();
void updateSlice();
void exportMap();
void displayHelp();
void dropEvent(QDropEvent *event) override;
void dragEnterEvent(QDragEnterEvent *event) override;
GLuint getTextureId(MapDB::ImageHandle h,const MapAccessor::ImageData& img_data) ;
void screenCoordinatesToImageSpaceCoordinates(int i, int j, MapDB::ImageSpaceCoord &is) const;
void computeDescriptorsForCurrentImage();
void computeRelatedTransform();
void computeAllPositions();
void addReferencePoint(QMouseEvent *e);
bool screenPositionToSingleImagePixelPosition(int px, int py, float &img_x, float &img_y, MapDB::ImageHandle& h);
void moveFromKeyboard(int key);
virtual void resizeEvent(QResizeEvent *) override;
virtual void wheelEvent(QWheelEvent *e) override;
virtual void mouseMoveEvent(QMouseEvent *e) override;
virtual void mouseReleaseEvent(QMouseEvent *e) override;
virtual void mousePressEvent(QMouseEvent *e) override;
virtual void keyPressEvent(QKeyEvent *e) override;
int mCurrentSlice_W ;
int mCurrentSlice_H ;
int mCurrentImageX;
int mCurrentImageY;
float *mCurrentSlice_data ;
float mViewScale ; // width of the viewing window in degrees of longitude
bool mSliceUpdateNeeded ;
bool mExplicitDraw;
bool mMovingSelected;
bool mShowImagesBorder;
bool mShowExportGrid;
MapRegistration::ImageDescriptor mCurrentDescriptor ;
int mDisplayDescriptor;
int mLastX ;
int mLastY ;
bool mMoving ;
MapDB::ImageHandle mSelectedImage;
MapDB::ImageHandle mLastSelectedImage ;
MapAccessor *mMA;
std::vector<MapAccessor::ImageData> mImagesToDraw;
MapDB::ImageSpaceCoord mCenter;
};