ToolMap
Loading...
Searching...
No Matches
beziersettings_dlg.h
1/***************************************************************************
2 beziersettings_dlg.h
3 -------------------
4 copyright : (C) 2013 CREALP Lucien Schreiber
5 ***************************************************************************/
6
7/***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef _BEZIER_SETTINGS_H_
16#define _BEZIER_SETTINGS_H_
17
18#include <wx/wxprec.h>
19
20#ifndef WX_PRECOMP
21#include <wx/wx.h>
22#endif
23
24#include <wx/notebook.h>
25#include <wx/spinctrl.h>
26
27class tmEditManager;
28
29class tmRenderer;
30
32 public:
33 enum {
34 AGG = 0,
35 ETHZ = 1
36 } method;
37 double agg_approximation;
38 double ethz_width;
39 int ethz_max_points;
40
42 method = AGG;
43 agg_approximation = 0.2;
44 ethz_width = 1;
45 ethz_max_points = 10;
46 }
47
48 inline bool operator==(const BezierSettingsData& b) const {
49 if (method != b.method) {
50 return false;
51 }
52 if (agg_approximation != b.agg_approximation) {
53 return false;
54 }
55 if (ethz_width != b.ethz_width) {
56 return false;
57 }
58 if (ethz_max_points != b.ethz_max_points) {
59 return false;
60 }
61 return true;
62 }
63};
64
65class BezierSettings_DLG : public wxDialog {
66 public:
67 BezierSettings_DLG(wxWindow* parent, tmEditManager* editmanager, tmRenderer* renderer, wxWindowID id = wxID_ANY,
68 const wxString& title = _("Bezier Settings"), const wxPoint& pos = wxDefaultPosition,
69 const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
70
72
73 virtual bool TransferDataToWindow();
74
75 virtual bool TransferDataFromWindow();
76
77 void SetBezierSettings(BezierSettingsData data) {
78 m_Data = data;
79 }
80
81 BezierSettingsData GetBezierSettings() {
82 return m_Data;
83 }
84
85 private:
86 void OnIdlePreview(wxIdleEvent& event);
87
88 void OnCheckPreview(wxCommandEvent& event);
89
90 void OnUpdateUIPreview(wxUpdateUIEvent& event);
91
92 void _CreateControls();
93
94 void _GetDataFromControl(BezierSettingsData* data);
95
96 wxNotebook* m_NotebookMethodCtrl;
97 wxSpinCtrlDouble* m_ApproximationCtrl;
98 wxSpinCtrlDouble* m_WidthToleranceCtrl;
99 wxSpinCtrl* m_MaxNumPointsCtrl;
100 wxCheckBox* m_PreviewCtrl;
101
102 // double m_ApproximationValue;
103 // double m_ApproximationValuePrevious;
104 tmEditManager* m_EditManager;
105 tmRenderer* m_Renderer;
106 BezierSettingsData m_Data;
107 BezierSettingsData m_PreviousData;
108};
109
110#endif
Definition beziersettings_dlg.h:31
Definition beziersettings_dlg.h:65
Deals with editing data.
Definition tmeditmanager.h:87
Definition tmrenderer.h:99