OpendTect-6_4  6.4
uigraphicsscalebar.h
Go to the documentation of this file.
1 #ifndef uigraphicsscalebar_h
2 #define uigraphicsscalebar_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Henrique Mageste
9  Date: May 2015
10  RCS: $Id: $
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uitoolsmod.h"
16 #include "uigraphicsitem.h"
17 #include "uiworld2ui.h"
18 
19 class uiAdvancedTextItem;
20 class uiRectItem;
21 class SurveyInfo;
22 
27 mExpClass(uiTools) uiScaleBarItem : public uiGraphicsItem
28 {
29 public:
30  uiScaleBarItem(int pxwidth=100,int pxheight=6);
31  ~uiScaleBarItem();
32 
33  inline int getPxHeight() const { return pxheight_; }
34  inline float getLength() const { return worldwidth_; }
35  inline int getPxWidth() const { return pxwidth_; }
36  inline void setPxHeight(int pxh) { pxheight_ = pxh; }
37  inline void setLength(float len) { worldwidth_ = len; }
38  inline void setPxWidth(int pxw) { pxwidth_ = pxw;
39  preferablepxwidth_ = pxw; }
40  inline void setUnit( const uiString& unit ) { unitstr_=unit; }
41 
42  void setWorld2Ui(const uiWorld2Ui&);
43 
44  void update();
45 
46 protected:
47  float worldwidth_;
48  int pxwidth_;
49  int pxheight_;
51 
61 
62 private:
63  void initDefaultScale();
64  void adjustValues();
65  void setPolygons(int,int);
68 
69 };
70 #endif
Class to provide coordinate conversion between a cartesian coordinate system (or any other transforme...
Definition: uiworld2ui.h:55
#define mExpClass(module)
Definition: commondefs.h:160
int preferablepxwidth_
Definition: uigraphicsscalebar.h:67
It adds a graphic scale made from polygons.
Definition: uigraphicsscalebar.h:27
void setLength(float len)
Definition: uigraphicsscalebar.h:37
void setPxHeight(int pxh)
Definition: uigraphicsscalebar.h:36
uiWorld2Ui w2ui_
Definition: uigraphicsscalebar.h:66
uiRectItem * upperleft_
Definition: uigraphicsscalebar.h:54
Definition: uigraphicsitemimpl.h:303
Definition: uistring.h:89
Holds survey general information.
Definition: survinfo.h:45
int getPxHeight() const
Definition: uigraphicsscalebar.h:33
int getPxWidth() const
Definition: uigraphicsscalebar.h:35
uiAdvancedTextItem * midnr_
Definition: uigraphicsscalebar.h:59
uiString unitstr_
Definition: uigraphicsscalebar.h:50
void setUnit(const uiString &unit)
Definition: uigraphicsscalebar.h:40
uiAdvancedTextItem * startnr_
Definition: uigraphicsscalebar.h:58
uiRectItem * lowerright_
Definition: uigraphicsscalebar.h:55
Definition: uigraphicsitemimpl.h:255
void setPxWidth(int pxw)
Definition: uigraphicsscalebar.h:38
uiRectItem * uppermid_
Definition: uigraphicsscalebar.h:53
uiAdvancedTextItem * stopnr_
Definition: uigraphicsscalebar.h:60
int pxheight_
Definition: uigraphicsscalebar.h:49
uiRectItem * lowerleft_
Definition: uigraphicsscalebar.h:57
int pxwidth_
Definition: uigraphicsscalebar.h:48
float worldwidth_
Definition: uigraphicsscalebar.h:47
uiRectItem * upperright_
Definition: uigraphicsscalebar.h:52
float getLength() const
Definition: uigraphicsscalebar.h:34
uiRectItem * lowermid_
Definition: uigraphicsscalebar.h:56

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