OpendTect-6_4  6.4
wellmarker.h
Go to the documentation of this file.
1 #ifndef wellmarker_h
2 #define wellmarker_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert Bril
9  Date: Aug 2003
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "wellmod.h"
17 #include "color.h"
18 #include "ranges.h"
19 #include "namedobj.h"
20 #include "manobjectset.h"
21 
22 class TaskRunner;
23 
24 
25 namespace Well
26 {
27 class Track;
28 
36 {
37 public:
38 
39  Marker( const char* nm=0, float dh=0, Color c=Color() )
40  : ::NamedObject(nm)
41  , dah_(dh)
42  , color_(c)
43  , levelid_(-1) {}
44  Marker( int lvlid, float dh )
45  : dah_(dh)
46  , color_(Color::Black())
47  , levelid_(lvlid) {}
48  Marker& operator =(const Marker&);
49  inline bool operator ==( const Marker& m )
50  { return m.name() == name(); }
51  bool operator > ( const Marker& wm ) const
52  { return dah_ > wm.dah_; }
53 
54  inline float dah() const { return dah_; }
55  inline void setDah( float v ) { dah_ = v; }
56  inline int levelID() const { return levelid_; }
57  inline void setLevelID( int id ) { levelid_ = id; }
58  Color color() const;
59 
60  static const char* sKeyDah();
61 
62  // setName() and setColor() only used as fallback, if not attached to level
63  void setColor( Color col ) { color_ = col; }
64 
65 protected:
66 
67  float dah_;
69  int levelid_;
70 
71 };
72 
73 
77 {
78 public:
79 
80  MarkerSet() {}
81  void fillWithAll(TaskRunner* tr=0);
82 
83  const Marker* getByName(const char* nm) const { return gtByName(nm); }
84  Marker* getByName(const char* nm) { return gtByName(nm); }
85  const Marker* getByLvlID(int id) const { return gtByLvlID(id);}
86  Marker* getByLvlID(int id) { return gtByLvlID(id);}
87  int getIdxAbove(float z,const Well::Track* trck=0) const;
88  int getIdxBelow(float z,const Well::Track* trck=0) const;
90 
91  bool isPresent(const char* n) const { return getByName(n); }
92  int indexOf(const char*) const;
93  void sortByDAH();
94  bool insertNew(Well::Marker*); //becomes mine
95  void addSameWell(const ObjectSet<Marker>&);
96  void mergeOtherWell(const ObjectSet<Marker>&);
97  virtual void append( const ObjectSet<Marker>& ms )
98  { mergeOtherWell(ms); }
99 
100  int indexOf( const Marker* m ) const
101  { return ObjectSet<Marker>::indexOf(m); }
102  bool isPresent( const Marker* m ) const
103  { return ObjectSet<Marker>::isPresent(m); }
104 
105  void getNames(BufferStringSet&) const;
106  void getColors(TypeSet<Color>&) const;
107  void fillPar(IOPar&) const;
108  void usePar(const IOPar&);
109 
110 protected:
111 
112  virtual ObjectSet<Marker>& doAdd(Marker*);
113  Marker* gtByName(const char*) const;
114  Marker* gtByLvlID(int) const;
115  void addCopy(const ObjectSet<Marker>&,int,float);
116  void alignOrderingWith(const ObjectSet<Marker>&);
117  void moveBlock(int,int,const TypeSet<int>&);
118  void insertNewAfter(int,ObjectSet<Marker>&);
119 
120 };
121 
122 
126 {
127 public:
128 
129  MarkerRange(const MarkerSet&,
130  const Interval<int>& idxrg=Interval<int>(-1,-1));
131  MarkerRange(const MarkerSet&,
132  const char*,const char*);
133 
134  inline int size() const { return rg_.width(false) + 1; }
135  bool isValid() const;
136 
137  inline bool isIncluded( int i ) const
138  { return rg_.includes(i,false);}
139  bool isIncluded(const char*) const;
140  bool isIncluded(float z) const;
141 
142  void getNames(BufferStringSet&) const;
143  MarkerSet* getResultSet() const;
144 
145 
146  const MarkerSet& markers() const { return markers_; }
147  const Interval<int>& idxRange() const { return rg_; }
148  Interval<int>& idxRange() { return rg_; }
149  float thickness() const;
150 
151 protected:
152 
155  bool isconst_;
156 
157  void init(const Interval<int>&);
158 
159 };
160 
161 
165 {
166 public:
167 
169  const Interval<int>& idxrg=Interval<int>(-1,-1) )
170  : MarkerRange(ms,idxrg) {}
171  MarkerChgRange( MarkerSet& ms, const char* m1,
172  const char* m2 )
173  : MarkerRange(ms,m1,m2) {}
174 
175  void setThickness(float);
176  void remove();
177 
179  { return const_cast<MarkerSet&>(markers_); }
180 
181 };
182 
183 
184 
185 } // namespace Well
186 
187 #endif
int size() const
Definition: wellmarker.h:134
#define mExpClass(module)
Definition: commondefs.h:160
void setLevelID(int id)
Definition: wellmarker.h:57
Set of Markers.
Definition: wellmarker.h:76
Range of markers (typically describing zone of interest)
Definition: wellmarker.h:125
const Marker * getByLvlID(int id) const
Definition: wellmarker.h:85
Interval< int > rg_
Definition: wellmarker.h:154
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
MarkerRange that can change its MarkerSet.
Definition: wellmarker.h:164
bool isPresent(const Marker *m) const
Definition: wellmarker.h:102
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
bool init()
MarkerSet()
Definition: wellmarker.h:80
void setColor(Color col)
Definition: wellmarker.h:63
const MarkerSet & markers() const
Definition: wellmarker.h:146
virtual bool isPresent(const T *) const
Definition: objectset.h:344
const Interval< int > & idxRange() const
Definition: wellmarker.h:147
Set of BufferString objects.
Definition: bufstringset.h:28
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:169
Marker(int lvlid, float dh)
Definition: wellmarker.h:44
const MarkerSet & markers_
Definition: wellmarker.h:153
Marker * getByName(const char *nm)
Definition: wellmarker.h:84
const Marker * getByName(const char *nm) const
Definition: wellmarker.h:83
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Class that can execute a task.
Definition: task.h:169
int levelID() const
Definition: wellmarker.h:56
float dah() const
Definition: wellmarker.h:54
FixedString Color()
Definition: keystrs.h:46
Definition: directionalsurvey.h:19
void setDah(float v)
Definition: wellmarker.h:55
Color color_
Definition: wellmarker.h:68
Well track.
Definition: welltrack.h:29
Marker * getByLvlID(int id)
Definition: wellmarker.h:86
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
Marker(const char *nm=0, float dh=0, Color c=Color())
Definition: wellmarker.h:39
bool isPresent(const char *n) const
Definition: wellmarker.h:91
int indexOf(const Marker *m) const
Definition: wellmarker.h:100
bool isIncluded(int i) const
Definition: wellmarker.h:137
float dah_
Definition: wellmarker.h:67
int levelid_
Definition: wellmarker.h:69
Object with a name.
Definition: namedobj.h:35
MarkerSet & getMarkers()
Definition: wellmarker.h:178
MarkerChgRange(MarkerSet &ms, const char *m1, const char *m2)
Definition: wellmarker.h:171
Marker, should be attached to Strat level.
Definition: wellmarker.h:35
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
MarkerChgRange(MarkerSet &ms, const Interval< int > &idxrg=Interval< int >(-1,-1))
Definition: wellmarker.h:168
bool isconst_
Definition: wellmarker.h:155
ObjectSet where the objects contained are owned by this set.
Definition: manobjectset.h:23
Interval< int > & idxRange()
Definition: wellmarker.h:148
virtual const OD::String & name() const
Definition: namedobj.h:47
virtual size_type indexOf(const T *) const
Definition: objectset.h:337
virtual void append(const ObjectSet< Marker > &ms)
Definition: wellmarker.h:97

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