OpendTect-6_4  6.4
uiwelldahdisplay.h
Go to the documentation of this file.
1 #ifndef uiwelldahdisplay_h
2 #define uiwelldahdisplay_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bruno
9  Date: Sept 2010
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uiwellmod.h"
16 #include "uigraphicsview.h"
17 #include "uigraphicsitem.h"
18 #include "uiaxishandler.h"
19 #include "draw.h"
20 #include "survinfo.h"
21 #include "welldisp.h"
22 #include "welldata.h"
23 #include "welld2tmodel.h"
24 #include "welltrack.h"
25 #include "survinfo.h"
26 
27 namespace Well { class DahObj; class Marker; class D2TModel; }
28 
29 class uiTextItem;
30 class uiLineItem;
31 class uiPolyLineItem;
32 class uiPolygonItem;
33 class uiGraphicsScene;
34 
35 #define mDefZPos(zpos)\
36 if ( zdata_.zistime_ && zdata_.d2T() && track() )\
37  zpos = d2T()->getTime( zpos, *track() )*SI().zDomain().userFactor();\
38 else if ( !zdata_.zistime_ && track() )\
39  zpos = track() ? (float) zdata_.track()->getPos( zpos ).z : 0;
40 
41 #define mDefZPosInLoop(val) \
42  float zpos = val;\
43  float fac = 1.f; \
44  if( !zdata_.zistime_ && SI().depthsInFeet() ) \
45  fac = mToFeetFactorF; \
46  if ( zdata_.zistime_ && zdata_.d2T() && track() )\
47  zpos = d2T()->getTime( zpos, *track() )*SI().zDomain().userFactor();\
48  else if ( !zdata_.zistime_ && track() )\
49  zpos = track() ? (float) zdata_.track()->getPos( zpos ).z*fac : 0; \
50  if ( !ld1_->yax_.range().includes( zpos, true ) )\
51  continue;
52 
59 public:
60  mStruct(uiWell) Setup
61  {
62  Setup()
63  : nrmarkerchars_(2)
64  , pickls_(OD::LineStyle::Solid,1,Color(0,200,0))
65  , border_(5)
66  , noxannot_(false)
67  , noyannot_(false)
68  , annotinside_(false)
69  , samexaxisrange_(false)
70  , symetricalxaxis_(false)
71  , drawcurvenames_(false)
72  , xannotinpercents_(false)
73  {}
74 
75  mDefSetupMemb(uiBorder,border)
76  mDefSetupMemb(int,nrmarkerchars)
78  mDefSetupMemb(int,axisticsz)
79  mDefSetupMemb(bool,noxannot)
80  mDefSetupMemb(bool,noyannot)
81  mDefSetupMemb(bool,annotinside)
82  mDefSetupMemb(bool,drawcurvenames)
83  mDefSetupMemb(bool,samexaxisrange)
84  mDefSetupMemb(bool,symetricalxaxis)
85  mDefSetupMemb(bool,xannotinpercents)
86  };
87 
90 
91  mStruct(uiWell) DahObjData : public CallBacker
92  {
93  virtual ~DahObjData() { delete xaxprcts_; }
94 
95  //Set these
96  void setData(const Well::DahObj* d) { dahobj_ = d; }
97  bool hasData() const { return dahobj_; }
98  bool xrev_;
99  int zoverlayval_;
100  float cliprate_;
101  Color col_;
102  bool drawascurve_;
103  int curvesz_;
104  bool drawaspoints_;
105  int pointsz_;
106 
107  //Get these
108  Interval<float> zrg_;
109  Interval<float> valrg_;
110  uiAxisHandler xax_;
111  uiAxisHandler* xaxprcts_;
112  uiAxisHandler yax_;
113 
114  virtual void getInfoForDah(float dah,BufferString&) const;
115  void plotAxis();
116 
117  protected:
118  DahObjData(uiGraphicsScene&,bool,
119  const uiWellDahDisplay::Setup&);
120 
121  const Well::DahObj* dahobj_;
122  uiGraphicsItemSet curveitms_;
123  uiPolyLineItem* curvepolyitm_;
124 
125  friend class uiWellDahDisplay;
126  };
127 
128  mStruct(uiWell) Data
129  {
130  Data( const Well::Data* wd )
131  : zrg_(mUdf(float),mUdf(float))
132  , zistime_(SI().zIsTime())
133  , dispzinft_(SI().depthsInFeet())
134  , wd_(wd)
135  { if ( wd_ ) wd_->ref(); }
136  ~Data()
137  { if ( wd_ ) wd_->unRef(); }
138 
139  void copyFrom(const uiWellDahDisplay::Data& d)
140  {
141  if ( &d == this )
142  return;
143 
144  zrg_ = d.zrg_;
145  zistime_ = d.zistime_;
146  dispzinft_ = d.dispzinft_;
147  if ( wd_ )
148  wd_->unRef();
149  wd_ = d.wd_;
150  if ( wd_ )
151  wd_->ref();
152  }
153  const Well::D2TModel* d2T() const { return wd_ ? wd_->d2TModel() : 0;}
154  const Well::Track* track() const {return wd_ ? &wd_->track() : 0; }
155  const Well::MarkerSet* mrks() const {return wd_ ? &wd_->markers() : 0;}
156 
157  Interval<float> zrg_;
158  bool dispzinft_;
159  bool zistime_;
160  const Well::Data* wd_;
161  };
162 
163  mStruct(uiWell) PickData
164  {
165  PickData( float dah, Color c=Color::NoColor() )
166  : dah_(dah), color_(c), val_(mUdf(float)) {}
167 
168  bool operator ==( const PickData& pd ) const
169  { return mIsEqual(pd.dah_,dah_,1e-4); }
170 
171  float dah_;
172  Color color_;
173  //setup color
174  float val_; //this will be a point if defined,
175  //a line otherwise
176  };
177 
178  void setData(const Data& data);
180  { zdata_.zrg_ = zrg; dataChanged();}
181 
182  const Data& zData() { return zdata_; }
184  Well::DisplayProperties::Markers& markerDisp() { return mrkdisp_; }
185 
186  void reDraw() { gatherInfo(); draw(); }
188 
189  DahObjData& dahObjData( bool first )
190  { return first ? *ld1_ : *ld2_; }
191 protected:
192 
193  DahObjData* ld1_;
194  DahObjData* ld2_;
199 
200  mStruct(uiWell) MarkerDraw
201  {
202  MarkerDraw( const Well::Marker& mrk )
203  : mrk_(mrk)
204  {}
205  ~MarkerDraw();
206 
207  const Well::Marker& mrk_;
208  OD::LineStyle ls_;
209  uiTextItem* txtitm_;
210  uiLineItem* lineitm_;
211  };
213  MarkerDraw* getMarkerDraw(const Well::Marker&);
214  Well::DisplayProperties::Markers mrkdisp_;
215 
216  const Well::D2TModel* d2T() const { return zdata_.d2T(); }
217  const Well::Track* track() const { return zdata_.track(); }
218  const Well::MarkerSet* markers() const { return zdata_.mrks(); }
219 
220  virtual void draw();
221  virtual void drawCurve(bool);
222  void drawMarkers();
223  void drawZPicks();
224 
225  void setAxisRelations();
226  virtual void gatherInfo();
227  virtual void gatherDataInfo(bool);
228  void setAxisRanges(bool);
229 
230  void dataChanged();
231  void init(CallBacker*);
232  void reSized(CallBacker*);
233 
234  friend class uiWellDisplay;
235  friend class uiWellDisplayControl;
236 };
237 
238 
239 #endif
#define mExpClass(module)
Definition: commondefs.h:160
virtual void draw()
Set of Markers.
Definition: wellmarker.h:76
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
FixedString Setup()
Definition: keystrs.h:116
Depth to time model.
Definition: welld2tmodel.h:34
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
void setZRange(Interval< float > zrg)
Definition: uiwelldahdisplay.h:179
#define mStruct(module)
Definition: commondefs.h:165
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
void reDraw()
Definition: uiwelldahdisplay.h:186
Definition: draw.h:118
bool init()
Definition: uigraphicsitemimpl.h:192
Handles an axis on a plot.
Definition: uiaxishandler.h:51
Definition: draw.h:122
const Well::Track * track() const
Definition: uiwelldahdisplay.h:217
virtual void gatherDataInfo(bool)
Definition: uiwelldisplaycontrol.h:25
Definition: uiparent.h:26
Data zdata_
Definition: uiwelldahdisplay.h:195
void reDrawAnnots()
Definition: uiwelldahdisplay.h:187
MarkerDraw * getMarkerDraw(const Well::Marker &)
#define mIsEqual(x, y, eps)
Definition: commondefs.h:54
DahObjData & dahObjData(bool first)
Definition: uiwelldahdisplay.h:189
void setData(const Data &data)
TypeSet< PickData > zpicks_
Definition: uiwelldahdisplay.h:197
const Well::MarkerSet * markers() const
Definition: uiwelldahdisplay.h:218
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Well display.
Definition: uiwelldisplay.h:35
FixedString Color()
Definition: keystrs.h:46
const Well::D2TModel * d2T() const
Definition: uiwelldahdisplay.h:216
Definition: directionalsurvey.h:19
Well track.
Definition: welltrack.h:29
virtual void gatherInfo()
Depth/Distance along hole object.
Definition: welldahobj.h:28
TypeSet< PickData > & zPicks()
Definition: uiwelldahdisplay.h:183
Well depth/distance along hole display.
Definition: uiwelldahdisplay.h:57
Well::DisplayProperties::Markers & markerDisp()
Definition: uiwelldahdisplay.h:184
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
uiGraphicsItemSet zpickitms_
Definition: uiwelldahdisplay.h:198
void reSized(CallBacker *)
void setAxisRanges(bool)
Definition: repos.h:25
const SurveyInfo & SI()
Definition: uigeom.h:78
Definition: uigraphicsitemimpl.h:214
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Setup setup_
Definition: uiwelldahdisplay.h:196
virtual void drawCurve(bool)
Definition: uigraphicsitem.h:142
Marker, should be attached to Strat level.
Definition: wellmarker.h:35
Definition: uigraphicsview.h:51
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
void setAxisRelations()
Definition: uigraphicsitemimpl.h:273
Well::DisplayProperties::Markers mrkdisp_
Definition: uiwelldahdisplay.h:214
DahObjData * ld2_
Definition: uiwelldahdisplay.h:194
The holder of all data concerning a certain well.
Definition: welldata.h:113
ObjectSet< MarkerDraw > markerdraws_
Definition: uiwelldahdisplay.h:211
DahObjData * ld1_
Definition: uiwelldahdisplay.h:193
Definition: uigraphicsitemimpl.h:110
static Color NoColor()
Definition: color.h:75
Definition: uigraphicsscene.h:39
const Data & zData()
Definition: uiwelldahdisplay.h:182

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