Main Page
Namespaces
Classes
Files
File List
File Members
src
descriptor_surface_based_trainer
wxImagePanel.cpp
Go to the documentation of this file.
1
21
#include "
descriptor_surface_based_trainer/wxImagePanel.h
"
22
#include <
ros/ros.h
>
23
24
25
26
BEGIN_EVENT_TABLE(
wxImagePanel
, wxPanel)
27
/*
28
EVT_MOTION(wxImagePanel::mouseMoved)
29
EVT_LEFT_DOWN(wxImagePanel::mouseDown)
30
EVT_LEFT_UP(wxImagePanel::mouseReleased)
31
EVT_RIGHT_DOWN(wxImagePanel::rightClick)
32
EVT_LEAVE_WINDOW(wxImagePanel::mouseLeftWindow)
33
EVT_KEY_DOWN(wxImagePanel::keyPressed)
34
EVT_KEY_UP(wxImagePanel::keyReleased)
35
EVT_MOUSEWHEEL(wxImagePanel::mouseWheelMoved)
36
*/
37
38
// catch paint events
39
EVT_PAINT(
wxImagePanel
::paintEvent)
40
41
END_EVENT_TABLE()
42
43
wxImagePanel
::
wxImagePanel
(
44
wxWindow* parent,
int
height,
int
width) :
45
wxPanel(parent)
46
{
47
SetSize(wxSize(width, height));
48
image =
new
wxBitmap(width, height);
49
}
50
51
/*
52
* Called by the system of by wxWidgets when the panel needs
53
* to be redrawn. You can also trigger this call by
54
* calling Refresh()/Update().
55
*/
56
57
void
wxImagePanel::paintEvent
(wxPaintEvent & evt)
58
{
59
// depending on your system you may need to look at double-buffered dcs
60
wxPaintDC dc(
this
);
61
render
(dc);
62
}
63
64
/*
65
* Alternatively, you can use a clientDC to paint on the panel
66
* at any time. Using this generally does not free you from
67
* catching paint events, since it is possible that e.g. the window
68
* manager throws away your drawing when the window comes to the
69
* background, and expects you will redraw it when the window comes
70
* back (by sending a paint event).
71
*/
72
void
wxImagePanel::paintNow
()
73
{
74
// depending on your system you may need to look at double-buffered dcs
75
wxClientDC dc(
this
);
76
render
(dc);
77
}
78
79
/*
80
* Here we do the actual rendering. I put it in a separate
81
* method so that it can work no matter what type of DC
82
* (e.g. wxPaintDC or wxClientDC) is used.
83
*/
84
void
wxImagePanel::render
(wxDC& dc)
85
{
86
dc.DrawBitmap( *
image
, 0, 0,
false
);
87
}
88
89
void
wxImagePanel::setImage
(wxBitmap*
image
) {
90
delete
this->
image
;
91
this->image =
image
;
92
}
93
94
wxImagePanel::render
void render(wxDC &dc)
Definition:
wxImagePanel.cpp:84
wxImagePanel::paintEvent
void paintEvent(wxPaintEvent &evt)
Definition:
wxImagePanel.cpp:57
wxImagePanel
Definition:
wxImagePanel.h:27
wxImagePanel::image
wxBitmap * image
Definition:
wxImagePanel.h:30
wxImagePanel.h
wxImagePanel::paintNow
void paintNow()
Definition:
wxImagePanel.cpp:72
ros.h
wxImagePanel::setImage
void setImage(wxBitmap *image)
Definition:
wxImagePanel.cpp:89
asr_descriptor_surface_based_recognition
Author(s): Allgeyer Tobias, Hutmacher Robin, Meißner Pascal
autogenerated on Mon Dec 16 2019 03:31:15