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

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