25 #ifndef DATA_VIEWER_PANEL_BASE_HH_
26 #define DATA_VIEWER_PANEL_BASE_HH_
32 #include <boost/shared_ptr.hpp>
51 #include <QRubberBand>
53 namespace ost {
namespace img {
namespace gui {
90 void UpdateView(
const QRect& rect,
bool update_raster_image=
true);
239 QRubberBand* rubberband_;
242 bool update_raster_image_;
243 Real offset_x_, offset_y_;
246 bool show_clicked_position_;
253 bool display_pixel_values_;
257 int right_press_x_,right_press_y_;
262 std::map<int, QCursor> cursors_;
264 bool use_update_extent_;
271 QAction* phase_toggle_action_;
272 QAction* invert_toggle_action_;
273 QAction* show_click_pos_toggle_action_;
274 QAction* fast_low_mag_toggle_action_;
275 QAction* fast_high_mag_toggle_action_;
276 QAction* display_pixel_toggle_action_;
277 QAction* antialiasing_toggle_action_;
280 void move(
int dx,
int dy);
285 void draw_extent(QPainter& p);
286 void draw_pixel_values(QPainter& p);
287 void update_min_max();
288 void update_rubberband_from_selection_();
Three dimensional vector class, using Real precision.
Abstract base class of data observer.
Defines lower and upper valid indices.
Manage shared instances of images.
class encapsulating 1D to 3D point
QPoint PointToWin(const Point &p) const
convert image point to window coordinates
QPoint FracPointToWinCenter(const geom::Vec2 &p) const
convert fractional image point to window coordinates (center of point)
QPoint FracPointToWin(const geom::Vec2 &p) const
convert fractional image point to window coordinates (top left corner of point)
geom::Vec3 GetClickedPosition()
Real GetZoomScale() const
retrieve the zoomscale
void SetCursor(const QCursor &c)
set cursor
void HideClickedPosition()
bool GetFastLowMagnificationDrawing()
Point WinToPoint(const QPoint &p) const
void SetSelectionMode(int mode)
void SetViewerMax(Real max)
virtual void mouseReleaseEvent(QMouseEvent *event)
void ShowClickedPosition(bool show)
Real GetViewerMin() const
ImageHandle Extract(const Extent &e)
virtual void paintEvent(QPaintEvent *event)
void toggle_display_pixels()
geom::Vec2 WinToFracPointCenter(int mx, int my) const
geom::Vec2 GetOffset() const
Extent GetSelection() const
return currently active selection
virtual void mousePressEvent(QMouseEvent *event)
virtual void ObserverUpdate()
called upon data change, noop by default
bool GetFastHighMagnificationDrawing()
virtual void SetData(const ImageHandle &d)
void slabChanged(int slab)
bool GetDisplayPixelValues()
virtual void mouseMoveEvent(QMouseEvent *event)
geom::Vec2 WinToFracPoint(int mx, int my) const
void SetDefaultCursor(const QCursor &c)
set default cursor
void UpdateView(bool update_raster_image=true)
update view
void toggle_phase_color()
bool IsWithin(const QPoint &p) const
checks if given point is visible in current panel
void Renormalize()
do a renormalization with the current normalizer
void SetGamma(Real gamma)
void Recenter()
re-center with spatial origin in the middle of the window
void toggle_fast_low_mag()
Real GetViewerMax() const
virtual void keyPressEvent(QKeyEvent *event)
void UpdateView(const QRect &rect, bool update_raster_image=true)
RasterImage::Mode GetColorMode()
void SetColorMode(RasterImage::Mode m)
set coloring mode to either greyscale or phasecolor
void selected(const Extent &selection)
void SetZoomScale(Real zoom)
set the zoomscale
virtual void ObserverUpdate(const Extent &e)
special update, calls ObserverUpdate() by default
virtual void ObserverUpdate(const Point &p)
special update, calls ObserverUpdate() by default
void UpdateNormalizer(Real min, Real max, Real gamma, bool invert)
void SetDisplayPixelValues(bool show)
set display pixelvalues
void SetDefaultCursor(int id)
void SetOffset(const geom::Vec2 &offset)
geom::Vec3 GetPixelSampling()
retrieve the pixel sampling of the image
void SetAntialiasing(bool f)
Point WinToPoint(int mx, int my) const
convert window coordinates to image point
virtual void ObserverRelease()
Called if data is released from memory.
void toggle_show_click_pos()
void zoomed(int zoomlevel)
DataViewerPanelBase(const ImageHandle &data, QWidget *parent)
virtual void resizeEvent(QResizeEvent *event)
Extent GetExtent()
retrieve the extent of the image
ViewerNormalizerPtr GetNormalizer() const
retrieve ptr to internal normalizer
bool ClickedPositionIsVisible()
void MoveTo(const geom::Vec2 &p)
void SetFastLowMagnificationDrawing(bool flag)
set/get fast drawing modes for low and high magnification
virtual ~DataViewerPanelBase()
void clicked(const geom::Vec3 &mousepos)
void SetFastHighMagnificationDrawing(bool flag)
void toggle_antialiasing()
virtual void wheelEvent(QWheelEvent *event)
geom::Vec2 GetMousePosition()
geom::Vec2 WinToFracPointCenter(const QPoint &p) const
void toggle_fast_high_mag()
geom::Vec2 WinToFracPoint(const QPoint &p) const
convert window coordinates to fractional image point
void SetSelection(const Extent &extent)
set currently active selection
bool GetAntialiasing() const
void SetViewerMin(Real min)
void SetInvert(bool invert)
#define DLLEXPORT_OST_GUI
boost::shared_ptr< ViewerNormalizer > ViewerNormalizerPtr