OpendTect-6_4  6.4
uisaveimagedlg.h
Go to the documentation of this file.
1 #ifndef uisaveimagedlg_h
2 #define uisaveimagedlg_h
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Satyaki Maitra
8  Date: February 2009
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "uitoolsmod.h"
15 #include "uidialog.h"
16 #include "bufstringset.h"
17 #include "geometry.h"
18 #include "ptrman.h"
19 
20 class Settings;
21 class uiCheckBox;
22 class uiFileInput;
23 class uiGenInput;
24 class uiLabel;
25 class uiLabeledSpinBox;
26 
29 public:
30  uiSaveImageDlg(uiParent*,bool withclipbrd = true,
31  bool withuseparsfld = true);
32 
34 
35  void sPixels2Inch(const Geom::Size2D<float>&,
36  Geom::Size2D<float>&,float);
37  void sInch2Pixels(const Geom::Size2D<float>&,
38  Geom::Size2D<float>&,float);
39  void sCm2Inch(const Geom::Size2D<float>&,
41  void sInch2Cm(const Geom::Size2D<float>&,
43  void createGeomInpFlds(uiObject*);
44  void fillPar(IOPar&,bool is2d);
45  bool usePar(const IOPar&);
46 
47  static void addPrintFmtFilters(BufferString&);
48 
49 protected:
50  void setDirName(const char*);
51 
63 
69 
70  void getSettingsPar(PtrMan<IOPar>&,BufferString);
71  void setSizeInPix(int width, int height);
72  void updateFilter();
73  virtual void getSupportedFormats(const char** imgfrmt,
74  const char** frmtdesc,
75  BufferString& filter) =0;
76  void fileSel(CallBacker*);
77  void addFileExtension(BufferString&);
78  bool filenameOK() const;
79 
80  void unitChg(CallBacker*);
81  void lockChg(CallBacker*);
82  void sizeChg(CallBacker*);
83  void dpiChg(CallBacker*);
84  void surveyChanged(CallBacker*);
85  virtual void setFldVals(CallBacker*) {}
86  void copyToClipBoardClicked(CallBacker*);
87 
88 
92  float aspectratio_; // width / height
93  float screendpi_;
94 
96 
97  void updateSizes();
98  void setNotifiers(bool enable);
99  virtual const char* getExtension();
100  virtual void writeToSettings() {}
101 
102  static const char* sKeyType() { return "Type"; }
103  static const char* sKeyHeight() { return "Height"; }
104  static const char* sKeyWidth() { return "Width"; }
105  static const char* sKeyUnit() { return "Unit"; }
106  static const char* sKeyRes() { return "Resolution"; }
107  static const char* sKeyFileType() { return "File type"; }
108 };
109 
110 
112 {
113 public:
115 protected:
116  void getSupportedFormats(const char** imgfrmt,
117  const char** frmtdesc,
118  BufferString& filter);
119  void setFldVals(CallBacker*);
120  bool acceptOK(CallBacker*);
121 };
122 
123 
124 #endif
static const char * sKeyUnit()
Definition: uisaveimagedlg.h:105
#define mExpClass(module)
Definition: commondefs.h:160
float screendpi_
Definition: uisaveimagedlg.h:93
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
bool withuseparsfld_
Definition: uisaveimagedlg.h:68
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
uiCheckBox * cliboardselfld_
Definition: uisaveimagedlg.h:62
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
A file-name input.
Definition: uifileinput.h:34
virtual void setFldVals(CallBacker *)
Definition: uisaveimagedlg.h:85
The base class for most UI elements.
Definition: uiobj.h:38
Definition: uisaveimagedlg.h:111
Definition: uiparent.h:26
Settings & settings_
Definition: uisaveimagedlg.h:66
uiLabel * pixlable_
Definition: uisaveimagedlg.h:57
Definition: uidialog.h:42
Interval< float > fldranges_
Definition: uisaveimagedlg.h:67
static const char * sKeyType()
Definition: uisaveimagedlg.h:102
Geom::Size2D< float > sizepix_
Definition: uisaveimagedlg.h:89
Definition: ptrman.h:79
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Definition: uispinbox.h:128
BufferString selfilter_
Definition: uisaveimagedlg.h:65
static const char * sKeyRes()
Definition: uisaveimagedlg.h:106
Geom::Size2D< float > sizecm_
Definition: uisaveimagedlg.h:91
static const char * sKeyFileType()
Definition: uisaveimagedlg.h:107
static const char * sKeyHeight()
Definition: uisaveimagedlg.h:103
General Input Element.
Definition: uigeninput.h:58
virtual void writeToSettings()
Definition: uisaveimagedlg.h:100
Settings class holds the user settings. It is an IOPar.
Definition: settings.h:34
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
uiLabeledSpinBox * pixheightfld_
Definition: uisaveimagedlg.h:52
uiLabeledSpinBox * pixwidthfld_
Definition: uisaveimagedlg.h:53
BufferString filters_
Definition: uisaveimagedlg.h:64
static BufferString dirname_
Definition: uisaveimagedlg.h:95
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
float aspectratio_
Definition: uisaveimagedlg.h:92
uiGenInput * useparsfld_
Definition: uisaveimagedlg.h:60
Definition: uilabel.h:24
uiGenInput * unitfld_
Definition: uisaveimagedlg.h:58
uiLabeledSpinBox * dpifld_
Definition: uisaveimagedlg.h:56
Geom::Size2D< float > sizeinch_
Definition: uisaveimagedlg.h:90
uiLabeledSpinBox * widthfld_
Definition: uisaveimagedlg.h:55
uiCheckBox * lockfld_
Definition: uisaveimagedlg.h:59
Definition: uisaveimagedlg.h:27
uiFileInput * fileinputfld_
Definition: uisaveimagedlg.h:61
Definition: uibutton.h:134
uiLabeledSpinBox * heightfld_
Definition: uisaveimagedlg.h:54
Notifier< uiSaveImageDlg > sizesChanged
Definition: uisaveimagedlg.h:33
static const char * sKeyWidth()
Definition: uisaveimagedlg.h:104

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019