OpendTect  6.3
welldisp.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: Dec 2008
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "wellcommon.h"
14 #include "namedmonitorable.h"
15 #include "color.h"
16 #include "coltab.h"
17 #include "ranges.h"
18 #include "fontdata.h"
19 #include "bufstringset.h"
20 
21 
22 namespace Well
23 {
24 
26 {
27 public:
28 
29  typedef int SizeType;
30 
31  BasicDispProps(SizeType);
32  ~BasicDispProps();
34 
35  mImplSimpleMonitoredGetSet(inline,color,setColor,Color,color_,
36  cColorChg());
37  mImplSimpleMonitoredGetSet(inline,size,setSize,SizeType,size_,
38  cSizeChg());
40  cFontChg());
41 
42  static SizeType cDefaultFontSize() { return 10; }
43 
44  static ChangeType cColorChg() { return 2; }
45  static ChangeType cSizeChg() { return 3; }
46  static ChangeType cFontChg() { return 4; }
47 
48  virtual const char* subjectName() const = 0;
49 
50 protected:
51 
53  SizeType size_;
55 
56  void baseUsePar(const IOPar&,const char*,const char*);
57  void baseFillPar(IOPar&,const char*) const;
58 
59 };
60 
61 
63 {
64 public:
66  ~TrackDispProps();
68 
69  mImplSimpleMonitoredGetSet(inline,dispAbove,setDispAbove,bool,
70  dispabove_,cDispPosChg());
71  mImplSimpleMonitoredGetSet(inline,dispBelow,setDispBelow,bool,
72  dispbelow_,cDispPosChg());
73 
74  virtual void usePar(const IOPar&);
75  virtual void fillPar(IOPar&) const;
76 
77  static ChangeType cDispPosChg() { return 5; }
78  virtual const char* subjectName() const { return "Track"; }
79 
80 protected:
81 
82  bool dispabove_;
83  bool dispbelow_;
84 
85 };
86 
88 {
89 public:
90 
91  typedef int ShapeType;
92  typedef int HeightType;
93 
95  ~MarkerDispProps();
97 
98  mImplSimpleMonitoredGetSet(inline,shapeType,setShapeType,ShapeType,
99  shapetype_,cShapeChg());
100  mImplSimpleMonitoredGetSet(inline,cylinderHeight,setCylinderHeight,
101  HeightType,cylinderheight_,cShapeChg());
102  mImplSimpleMonitoredGetSet(inline,singleColor,setSingleColor,bool,
103  issinglecol_,cColorChg());
104  mImplSimpleMonitoredGetSet(inline,nameColor,setNameColor,Color,
105  nmcol_,cColorChg());
106  mImplSimpleMonitoredGetSet(inline,sameNameCol,setSameNameCol,bool,
107  samenmcol_,cColorChg());
108  mImplSimpleMonitoredGetSet(inline,selMarkerNames,setSelMarkerNames,
109  BufferStringSet,selmarkernms_,cMarkerNmsChg());
110 
111  virtual void usePar(const IOPar&);
112  virtual void fillPar(IOPar&) const;
113 
114  void addSelMarkerName(const char*);
115  void removeSelMarkerName(const char*);
116 
117  static ChangeType cShapeChg() { return 5; }
118  static ChangeType cMarkerNmsChg() { return 6; }
119  virtual const char* subjectName() const { return "Markers"; }
120 
121 protected:
122 
123  ShapeType shapetype_;
124  HeightType cylinderheight_;
129 
130 };
131 
132 mExpClass(Well) LogDispProps : public BasicDispProps
133 {
134 public:
135 
136  typedef int WidthType;
137  typedef int StyleType;
138 
139  LogDispProps();
140  ~LogDispProps();
142 
143  virtual const char* subjectName() const { return "Log"; }
144 
145  static ChangeType cNameChg() { return 1; }
146  static ChangeType cShapeChg() { return 5; }
147  static ChangeType cScaleChg() { return 6; }
148 
149  virtual void usePar(const IOPar&,bool isleft);
150  virtual void fillPar(IOPar&,bool isleft) const;
151 
152  mImplSimpleMonitoredGetSet(inline,logName,setLogName,BufferString,
153  logname_,cNameChg());
154  mImplSimpleMonitoredGetSet(inline,fillName,setFillName,BufferString,
155  fillname_,cNameChg());
156  mImplSimpleMonitoredGetSet(inline,seqName,setSeqName,BufferString,
157  seqname_,cNameChg());
158 
159  mImplSimpleMonitoredGetSet(inline,clipRate,setClipRate,float,
160  cliprate_,cScaleChg());
161  mImplSimpleMonitoredGetSet(inline,range,setRange,Interval<float>,
162  range_,cScaleChg());
163  mImplSimpleMonitoredGetSet(inline,fillRange,setFillRange,
164  Interval<float>,fillrange_,cScaleChg());
165  mImplSimpleMonitoredGetSet(inline,isLogarithmic,setIsLogarithmic,bool,
166  islogarithmic_,cScaleChg());
167  mImplSimpleMonitoredGetSet(inline,isDataRange,setIsDataRange,bool,
168  isdatarange_,cScaleChg());
169 
170  mImplSimpleMonitoredGetSet(inline,fillLeft,setFillLeft,bool,
171  isleftfill_,cShapeChg());
172  mImplSimpleMonitoredGetSet(inline,fillRight,setFillRight,bool,
173  isrightfill_,cShapeChg());
174  mImplSimpleMonitoredGetSet(inline,revertLog,setRevertLog,bool,
175  islogreverted_,cShapeChg());
176  mImplSimpleMonitoredGetSet(inline,repeat,setRepeat,int,repeat_,
177  cShapeChg());
178  mImplSimpleMonitoredGetSet(inline,repeatOverlap,setRepeatOverlap,float,
179  repeatovlap_,cShapeChg());
180  mImplSimpleMonitoredGetSet(inline,style,setStyle,StyleType,style_,
181  cShapeChg());
182  mImplSimpleMonitoredGetSet(inline,logWidth,setLogWidth,WidthType,
183  logwidth_,cShapeChg());
184 
185  mImplSimpleMonitoredGetSet(inline,singleColor,setSingleColor,bool,
186  issinglecol_,cColorChg());
187  mImplSimpleMonitoredGetSet(inline,seqUseMode,setSeqUseMode,
188  ColTab::SeqUseMode,sequsemode_,cColorChg());
189  mImplSimpleMonitoredGetSet(inline,seisColor,setSeisColor,Color,
190  seiscolor_,cColorChg());
191 
192 protected:
193 
197 
198  float cliprate_;
203 
207  int repeat_;
209  StyleType style_;
210  WidthType logwidth_;
211 
215 
216 };
217 
218 inline const char* sKey2DDispProp() { return "2D Display"; }
219 inline const char* sKey3DDispProp() { return "3D Display"; }
220 
224 {
225 public:
226 
228  typedef int LogPairID; // yeah well. hit me.
229 
230  DisplayProperties(const char* nm=sKey3DDispProp());
234 
235  TrackDispProps& track() { return track_; }
236  const TrackDispProps& track() const { return track_; }
237  MarkerDispProps& markers() { return markers_; }
238  const MarkerDispProps& markers() const { return markers_; }
239 
240  int nrLogPairs() const;
241  LogDispProps& log(bool first_is_left,LogPairID nr=0);
242  const LogDispProps& log(bool first_is_left,LogPairID nr=0) const;
243  LogPairID addLogPair();
244  void setNrLogPairs(int);
245  bool removeLogPair(LogPairID); // refuses to remove last one
246 
247  void usePar(const IOPar&);
248  void fillPar(IOPar&) const;
249 
250  static ChangeType cLogPairAdded() { return 2; }
251  static ChangeType cLogPairRemove() { return 3; }
252  static ChangeType cDispStratChg() { return 4; }
253 
254  mImplSimpleMonitoredGetSet(inline,displayStrat,setDisplayStrat,bool,
255  displaystrat_,cDispStratChg());
256 
257  static DisplayProperties& defaults();
258  static void commitDefaults();
259  bool valsAreDefaults() const { return isdefaults_; }
260 
261  virtual const char* subjectName() const { return name().buf(); }
262 
263 protected:
264 
268  bool displaystrat_; //2d only
270 
271  LogPairID doAddLogPair();
272  void copyLogPairsFrom(const DisplayProperties&);
273  void addCBsToLogPair(LogPairID);
274  void subobjChgCB(CallBacker*);
275  int idx4PairID( LogPairID id, bool scnd=false ) const
276  { return scnd ? 2*id + 1 : 2*id; }
277  int pairID4Idx( int idx ) const
278  { return idx / 2; }
279  int nrPairs() const
280  { return logs_.size() / 2; }
281  bool isIDAvailable( LogPairID id )
282  { return logs_.size() > id * 2; }
283 
284 private:
285 
286  void init();
287 
288 };
289 
290 } // namespace
Display properties of a well.
Definition: welldisp.h:223
#define mExpClass(module)
Definition: commondefs.h:157
Object that can be MT-safely monitored from cradle to grave.
Definition: monitorable.h:76
bool islogarithmic_
Definition: welldisp.h:201
static SizeType cDefaultFontSize()
Definition: welldisp.h:42
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
Definition: welldisp.h:62
HeightType cylinderheight_
Definition: welldisp.h:124
static ChangeType cLogPairRemove()
Definition: welldisp.h:251
int ChangeType
Definition: monitorable.h:80
static ChangeType cShapeChg()
Definition: welldisp.h:117
Monitorable object with a name. All but name() are MT-safe.
Definition: namedmonitorable.h:20
SizeType size_
Definition: welldisp.h:53
static ChangeType cNameChg()
Definition: welldisp.h:145
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
Interval< float > fillrange_
Definition: welldisp.h:200
BasicDispProps::SizeType SizeType
Definition: welldisp.h:227
static ChangeType cSizeChg()
Definition: welldisp.h:45
bool init()
bool displaystrat_
Definition: welldisp.h:268
static ChangeType cShapeChg()
Definition: welldisp.h:146
bool isIDAvailable(LogPairID id)
Definition: welldisp.h:281
ColTab::SeqUseMode sequsemode_
Definition: welldisp.h:213
const char * sKey2DDispProp()
Definition: welldisp.h:218
bool isrightfill_
Definition: welldisp.h:205
int repeat_
Definition: welldisp.h:207
Definition: welldisp.h:87
BufferString logname_
Definition: welldisp.h:194
bool issinglecol_
Definition: welldisp.h:125
bool samenmcol_
Definition: welldisp.h:127
static ChangeType cColorChg()
Definition: welldisp.h:44
Set of BufferString objects.
Definition: bufstringset.h:25
Data needed to make an actual font.
Definition: fontdata.h:18
TrackDispProps & track()
Definition: welldisp.h:235
virtual const char * subjectName() const
Definition: welldisp.h:143
int nrPairs() const
Definition: welldisp.h:279
#define mDeclMonitorableAssignment(clss)
like mDeclAbstractMonitorableAssignment but for non-abstract subclasses. Implements the clone() metho...
Definition: monitor.h:111
virtual const char * subjectName() const
Definition: welldisp.h:261
static ChangeType cScaleChg()
Definition: welldisp.h:147
MarkerDispProps & markers()
Definition: welldisp.h:237
BufferString seqname_
Definition: welldisp.h:196
float cliprate_
Definition: welldisp.h:198
const char * sKey3DDispProp()
Definition: welldisp.h:219
#define mDeclInstanceCreatedNotifierAccess(clss)
Definition: notify.h:235
size_type size() const
Definition: objectset.h:48
MarkerDispProps markers_
Definition: welldisp.h:266
int idx4PairID(LogPairID id, bool scnd=false) const
Definition: welldisp.h:275
static ChangeType cFontChg()
Definition: welldisp.h:46
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
#define mImplSimpleMonitoredGetSet(pfx, fnnmget, fnnmset, typ, memb, chgtyp)
Defines simple MT-safe copyable member access.
Definition: monitor.h:39
Definition: wellcommon.h:16
int LogPairID
Definition: welldisp.h:228
static ChangeType cLogPairAdded()
Definition: welldisp.h:250
int SizeType
Definition: welldisp.h:29
static ChangeType cDispPosChg()
Definition: welldisp.h:77
BufferStringSet selmarkernms_
Definition: welldisp.h:128
int WidthType
Definition: welldisp.h:136
Definition: welldisp.h:132
bool dispabove_
Definition: welldisp.h:82
WidthType logwidth_
Definition: welldisp.h:210
Color seiscolor_
Definition: welldisp.h:214
Interval< float > range_
Definition: welldisp.h:199
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
StyleType style_
Definition: welldisp.h:209
static ChangeType cMarkerNmsChg()
Definition: welldisp.h:118
const MarkerDispProps & markers() const
Definition: welldisp.h:238
Definition: welldisp.h:25
SeqUseMode
Definition: coltab.h:27
bool valsAreDefaults() const
Definition: welldisp.h:259
ShapeType shapetype_
Definition: welldisp.h:123
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
FontData font_
Definition: welldisp.h:54
BufferString fillname_
Definition: welldisp.h:195
virtual void setFont(const QFont &)
override Qt
Definition: i_uiobjqtbody.h:31
bool islogreverted_
Definition: welldisp.h:206
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
int pairID4Idx(int idx) const
Definition: welldisp.h:277
bool isdefaults_
Definition: welldisp.h:269
int ShapeType
Definition: welldisp.h:91
int StyleType
Definition: welldisp.h:137
virtual const char * subjectName() const
Definition: welldisp.h:78
int HeightType
Definition: welldisp.h:92
TrackDispProps track_
Definition: welldisp.h:265
bool isdatarange_
Definition: welldisp.h:202
Color color_
Definition: welldisp.h:52
ManagedObjectSet< LogDispProps > logs_
Definition: welldisp.h:267
bool dispbelow_
Definition: welldisp.h:83
ObjectSet where the objects contained are owned by this set.
Definition: manobjectset.h:49
#define mDeclAbstractMonitorableAssignment(clss)
Monitorable subclasses: assignment and comparison.
Definition: monitor.h:105
const TrackDispProps & track() const
Definition: welldisp.h:236
float repeatovlap_
Definition: welldisp.h:208
bool issinglecol_
Definition: welldisp.h:212
virtual const char * subjectName() const
Definition: welldisp.h:119
Color nmcol_
Definition: welldisp.h:126
static ChangeType cDispStratChg()
Definition: welldisp.h:252
bool isleftfill_
Definition: welldisp.h:204

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