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

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