Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PreviewIdentifyTool.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
22 #ifndef _PREVIEWIDENTIFYTOOL_H
23 #define _PREVIEWIDENTIFYTOOL_H
24 
25 #include "Tool.h"
26 #include <set>
27 #include <vector>
28 
29 class GLPreviewFrame;
30 
43 class PreviewIdentifyTool : public Tool
44 {
45 public:
53  PreviewIdentifyTool(ToolHelper *helper, GLPreviewFrame *owner, bool showNumbers);
55  void Activate();
57  void AfterDrawImagesEvent();
58  bool BeforeDrawImageEvent(unsigned int image);
62  void ShowImageNumber(unsigned int image);
64  void StopShowingImages();
66  void MouseButtonEvent(wxMouseEvent & e);
67 
68  void MouseMoveEvent(double x, double y, wxMouseEvent & e);
69 
70  void KeypressEvent(int keycode, int modifiers, int pressed);
71 
72  void setConstantOn(bool constant_on_in);
73 
74  void UpdateWithNewImageSet(std::set<unsigned int> new_image_set);
75  void ForceRedraw();
76 private:
78  void HighlightColour(unsigned int index, unsigned int count,
79  unsigned char &red, unsigned char &green,
80  unsigned char &blue);
81  static bool texture_created;
83  static unsigned int circle_border_tex;
85  static unsigned int rectangle_border_tex;
87  static unsigned int font_tex;
89  static unsigned int font_list;
91  static std::vector<int> m_glyphWidth;
92 
94  std::set<unsigned int> m_image_set;
97  unsigned int m_mouse_over_image;
99 
100  void StopUpdating();
101  void ContinueUpdating();
102 
104  //user has clicked and is holding left button while over panorama
106 
108 
111 };
112 
113 #endif
114 
void setConstantOn(bool constant_on_in)
PreviewIdentifyTool(ToolHelper *helper, GLPreviewFrame *owner, bool showNumbers)
constructor
unsigned int m_mouse_over_image
The image the user last placed their mouse over the button for.
The OpenGL preview frame.
GLPreviewFrame * m_preview_frame
void StopShowingImages()
Notification for when moving the mouse off an image button.
void Activate()
Switch on a tool.
static unsigned int rectangle_border_tex
OpenGL texture name for the rectangular border texture.
static unsigned int font_list
OpenGL call list id for font.
void MouseButtonEvent(wxMouseEvent &e)
Show control point editor if mouse is over two images.
void AfterDrawImagesEvent()
Draw (using OpenGL) images above the others.
std::set< unsigned int > m_image_set
Set of image numbers of the images we are displaying highlighted.
void ShowImageNumber(unsigned int image)
Notification for when moving the mouse on an image button.
void MouseMoveEvent(double x, double y, wxMouseEvent &e)
Notify when the mouse pointer has moved over the panorama preview.
ToolHelper * helper
The PreviewToolHelper that uses the same preview window and panorama as the tool should.
Definition: Tool.h:102
void HighlightColour(unsigned int index, unsigned int count, unsigned char &red, unsigned char &green, unsigned char &blue)
Generate a colour given how many colours we need and an index.
Definition: Tool.h:42
static unsigned int circle_border_tex
OpenGL texture name for the circular border texture.
void UpdateWithNewImageSet(std::set< unsigned int > new_image_set)
void KeypressEvent(int keycode, int modifiers, int pressed)
bool BeforeDrawImageEvent(unsigned int image)
Draw what the tool requires just before a given image is drawn.
void ImagesUnderMouseChangedEvent()
Notify when the images directly underneath the mouse pointer have changed.
Visually connect the image numbers with the image on the preview.
static unsigned int font_tex
OpenGL texture name for the font texture.
static std::vector< int > m_glyphWidth
glyph width for font