File: aplot.h

package info (click to toggle)
fityk 1.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,772 kB
  • sloc: cpp: 34,595; ansic: 4,676; python: 963; makefile: 384; sh: 119; xml: 91; java: 31; ruby: 27; perl: 25
file content (70 lines) | stat: -rw-r--r-- 2,174 bytes parent folder | download | duplicates (5)
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
70
// This file is part of fityk program. Copyright 2001-2013 Marcin Wojdyr
// Licence: GNU General Public License ver. 2+

#ifndef FITYK_WX_APLOT_H_
#define FITYK_WX_APLOT_H_

#include "plot.h"

enum AuxPlotKind
{
    apk_empty,
    apk_diff,
    apk_diff_stddev,
    apk_diff_y_perc,
    apk_cum_chi2
};

//Auxiliary plot, usually shows residuals or peak positions
class AuxPlot : public FPlot
{
    friend class AuxPlotConfDlg;
public:
    AuxPlot(wxWindow *parent, FPlot *master, wxString const& name);
    ~AuxPlot() {}
    void save_settings(wxConfigBase *cf) const;
    void read_settings(wxConfigBase *cf);
    void show_pref_dialog();

private:
    static const int move_plot_margin_width = 20;

    FPlot* master_;
    const wxString name_;
    AuxPlotKind kind_;
    bool mark_peak_pos_;
    bool reversed_diff_;
    double y_zoom_, y_zoom_base_;
    bool auto_zoom_y_;
    bool fit_y_once_;

    void OnPaint(wxPaintEvent &event);
    virtual void draw(wxDC &dc, bool monochrome=false);
    void OnLeaveWindow (wxMouseEvent& event);
    void OnMouseMove(wxMouseEvent &event);
    void OnLeftDown(wxMouseEvent &event);
    void OnLeftUp(wxMouseEvent &event);
    void OnRightDown(wxMouseEvent &event);
    void OnMiddleDown(wxMouseEvent &event);
    // function called when Esc is pressed
    virtual void cancel_action() { cancel_mouse_left_press(); }
    void cancel_mouse_left_press();
    void set_scale(int pixel_width, int pixel_height);
    bool is_zoomable(); //false if kind is eg. empty or peak-position
    void OnPrefs(wxCommandEvent&) { show_pref_dialog(); }
    void OnPopupPlot(wxCommandEvent& event);
    void OnMarkPeakPositions(wxCommandEvent& event);
    void OnPopupYZoom(wxCommandEvent& event);
    void OnPopupYZoomFit(wxCommandEvent& event);
    void OnAutoZoom(wxCommandEvent& event);

    void draw_diff (wxDC& dc, std::vector<Point>::const_iterator first,
                                std::vector<Point>::const_iterator last);
    void draw_zoom_text(wxDC& dc, bool set_pen=true);
    void fit_y_zoom(fityk::Data const* data, fityk::Model const* model);
    void change_plot_kind(AuxPlotKind kind);

    DECLARE_EVENT_TABLE()
};

#endif