OpendTect-6_4  6.4
uigraphicssceneaxismgr.h
Go to the documentation of this file.
1 #ifndef uigraphicssceneaxismgr_h
2 #define uigraphicssceneaxismgr_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Duntao Wei
9  Date: Jan 2005
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uitoolsmod.h"
16 #include "draw.h"
17 #include "ranges.h"
18 #include "samplingdata.h"
19 #include "uigeom.h"
20 #include "uifont.h"
21 #include "uiaxishandler.h"
22 
23 class uiGraphicsScene;
24 class uiGraphicsView;
26 class uiRectItem;
27 class uiTextItem;
28 class uiLineItem;
29 class uiBorder;
30 
53 //Deprecated . Now FlatView Axis Drawing handled by uiAxisHandler
55 {
56 public:
57  ~uiGraphicsSceneAxis();
58  uiGraphicsSceneAxis(uiGraphicsScene&);
59 
60  void setPosition(bool isx,bool istoporleft,bool isinside);
61  void setWorldCoords(const Interval<double>&);
62  void setViewRect(const uiRect&);
63 
64  void setZValue(int nv);
65  void turnOn(bool);
66 
67  void setAnnotInside(bool yn) { inside_ = yn; reDraw(); }
68  void enableAxisLine(bool yn) { drawaxisline_=yn; reDraw(); }
69  void enableGridLines(bool yn){ drawgridlines_=yn; reDraw(); }
70  void setAnnotInInt(bool yn) { annotinint_=yn; }
71 
72  void enableMask(bool yn);
73  void setTextFactor(int n) { txtfactor_ = n; reDraw(); }
74  // Values displayed along axis are multiplied by this
75  // factor.
76  void setLineStyle(const OD::LineStyle& lst)
77  { ls_=lst; reDraw(); }
79  { gridls_ = gls; reDraw(); }
80  void setFontData(const FontData&);
81 
82 protected:
83 
84  void reDraw();
85  void drawAtPos(float worldpos, bool drawgrid,
86  int& curtextitm,int& curlineitm);
87  int getNrAnnotChars() const;
88 
89  bool inside_;
90  bool isx_;
91  bool istop_;
95 
99 
101 
104 
106 
112 };
113 
114 
120 {
121 public:
123  virtual ~uiGraphicsSceneAxisMgr();
124 
125  virtual void setZValue(int z);
126  virtual void setWorldCoords(const uiWorldRect&);
127  void setWorldCoords(const StepInterval<float>& xrg,
128  const StepInterval<float>& yrg);
129  void setViewRect(const uiRect&);
130 
131  void enableXAxis(bool yn) { xaxis_->setVisible(yn); }
132  void enableYAxis(bool yn) { yaxis_->setVisible(yn); }
133 
134  int getZValue() const;
135  int getNeededWidth() const;
136  int getNeededHeight() const;
137 
138  void setAnnotInside(bool yn);
139  void enableAxisLine(bool yn);
140  void setBorder(const uiBorder&);
141  void setXLineStyle(const OD::LineStyle&);
142  void setYLineStyle(const OD::LineStyle&);
143  void setGridLineStyle(const OD::LineStyle&);
144  void setAuxLineStyle(const OD::LineStyle&,bool forx,
145  bool forhl=false);
146  void setAnnotInInt( bool xaxis, bool dowant )
147  { xaxis ? xaxis_->setup().annotinint(dowant)
148  : yaxis_->setup().annotinint(dowant); }
149  void showAuxPositions(bool forx,bool yn);
150  void setAuxAnnotPositions(const TypeSet<PlotAnnotation>&,
151  bool forx);
152 
153  virtual void updateScene()
154  { xaxis_->updateScene(); yaxis_->updateScene(); }
155  NotifierAccess& layoutChanged();
156 
157 protected:
158 
161 
168 
169  void updateFontSizeCB(CallBacker*);
170 };
171 
172 #endif
uiRect viewrect_
Definition: uigraphicssceneaxismgr.h:100
#define mExpClass(module)
Definition: commondefs.h:160
void setAnnotInInt(bool yn)
Definition: uigraphicssceneaxismgr.h:70
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
void turnOn(int flag)
Overrides the envirnonment variable.
Definition: uigeom.h:42
uiRectItem * leftmask_
Definition: uigraphicssceneaxismgr.h:166
void setAnnotInInt(bool xaxis, bool dowant)
Definition: uigraphicssceneaxismgr.h:146
Interface class for Notifier. See comments there.
Definition: callback.h:161
int txtfactor_
Definition: uigraphicssceneaxismgr.h:110
Definition: draw.h:118
Definition: uifont.h:39
bool istop_
Definition: uigraphicssceneaxismgr.h:91
Handles an axis on a plot.
Definition: uiaxishandler.h:51
void enableYAxis(bool yn)
Definition: uigraphicssceneaxismgr.h:132
void setTextFactor(int n)
Definition: uigraphicssceneaxismgr.h:73
void enableAxisLine(bool yn)
Definition: uigraphicssceneaxismgr.h:68
FontData fontdata_
Definition: uigraphicssceneaxismgr.h:111
uiRectItem * rightmask_
Definition: uigraphicssceneaxismgr.h:167
ObjectSet< uiLineItem > lines_
Definition: uigraphicssceneaxismgr.h:102
Data needed to make an actual font.
Definition: fontdata.h:20
OD::LineStyle ls_
Definition: uigraphicssceneaxismgr.h:107
ObjectSet< uiTextItem > texts_
Definition: uigraphicssceneaxismgr.h:103
void setAnnotInside(bool yn)
Definition: uigraphicssceneaxismgr.h:67
void setLineStyle(const OD::LineStyle &lst)
Definition: uigraphicssceneaxismgr.h:76
void setGridLineStyle(const OD::LineStyle &gls)
Definition: uigraphicssceneaxismgr.h:78
bool isx_
Definition: uigraphicssceneaxismgr.h:90
uiAxisHandler * xaxis_
Definition: uigraphicssceneaxismgr.h:159
bool inside_
Definition: uigraphicssceneaxismgr.h:89
Interval< double > rg_
Definition: uigraphicssceneaxismgr.h:105
void enableGridLines(bool yn)
Definition: uigraphicssceneaxismgr.h:69
Definition: uigraphicsitem.h:157
uiRectItem * topmask_
Definition: uigraphicssceneaxismgr.h:164
To draw simple axes for a 2D coordinate system.
Definition: uigraphicssceneaxismgr.h:54
OD::LineStyle gridls_
Definition: uigraphicssceneaxismgr.h:108
Definition: uigraphicsitemimpl.h:255
uiAxisHandler * yaxis_
Definition: uigraphicssceneaxismgr.h:160
bool drawgridlines_
Definition: uigraphicssceneaxismgr.h:93
Definition: uigeom.h:78
uiGraphicsView & view_
Definition: uigraphicssceneaxismgr.h:163
uiRectItem * mask_
Definition: uigraphicssceneaxismgr.h:98
Manages uiGraphicsSceneAxis.
Definition: uigraphicssceneaxismgr.h:119
Definition: uigraphicsview.h:51
bool drawaxisline_
Definition: uigraphicssceneaxismgr.h:92
Definition: uigraphicsitemimpl.h:273
uiGraphicsScene & scene_
Definition: uigraphicssceneaxismgr.h:96
SamplingData< double > sampling_
Definition: uigraphicssceneaxismgr.h:109
uiFont & uifont_
Definition: uigraphicssceneaxismgr.h:162
virtual void updateScene()
Definition: uigraphicssceneaxismgr.h:153
uiRectItem * bottommask_
Definition: uigraphicssceneaxismgr.h:165
void enableXAxis(bool yn)
Definition: uigraphicssceneaxismgr.h:131
uiGraphicsItemGroup * itmgrp_
Definition: uigraphicssceneaxismgr.h:97
Definition: uigraphicsitemimpl.h:110
Definition: uigraphicsscene.h:39
bool annotinint_
Definition: uigraphicssceneaxismgr.h:94

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