OpendTect  6.6
stratcontent.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
8  Date: Jan 2012
9  RCS: $Id$
10 ________________________________________________________________________
11 
12  Impl is in stratlith.cc.
13 
14 -*/
15 
16 #include "stratmod.h"
17 #include "namedobj.h"
18 #include "objectset.h"
19 #include "draw.h"
20 
23 namespace Strat
24 {
25 
29 {
30 public:
31 
32  Content( const char* nm )
33  : NamedObject(nm) {}
34  Content( const Content& c )
35  : NamedObject(c)
36  , pattern_(c.pattern_)
37  , color_(c.color_) {}
38 
39  Content& operator =( const Content& c )
40  {
41  setName(c.name());
42  pattern_=c.pattern_;
43  color_ = c.color_;
44  return *this;
45  }
46  bool operator ==( const Content& c ) const
47  { return name() == c.name(); }
48 
49  inline bool isUnspecified() const
50  { return this == &unspecified(); }
51 
52  static const Content& unspecified();
53 
56 
57  bool getApearanceFrom(const char*);
59 
60 };
61 
62 
64 mGlobal(Strat) inline bool isUnspecified( const Content* ct )
65 {
66  return !ct || ct->isUnspecified();
67 }
68 
69 
73 {
74 public:
75 
76  ~ContentSet() { deepErase(*this); }
77 
78  int getIndexOf(const char*) const;
79 
80  Content* getByName( const char* s )
81  { const int idx = getIndexOf(s); return idx<0 ? 0 : (*this)[idx]; }
82  const Content* getByName( const char* s ) const
83  { return const_cast<ContentSet*>(this)->getByName(s); }
84 
85  const Content& getContent( const char* s ) const
86  { const Content* c = getByName(s); return c ? *c : Content::unspecified(); }
87 
88 };
89 
90 
91 } // namespace Strat
92 
NamedObject
object with a name.
Definition: namedobj.h:42
Strat::Content::unspecified
static const Content & unspecified()
Strat::Content::putAppearanceTo
void putAppearanceTo(BufferString &) const
Strat::Content::Content
Content(const Content &c)
Definition: stratcontent.h:34
mGlobal
#define mGlobal(module)
Definition: commondefs.h:180
ObjectSet< Content >
Strat::ContentSet::~ContentSet
~ContentSet()
Definition: stratcontent.h:76
Strat::Content::pattern_
FillPattern pattern_
Definition: stratcontent.h:55
Strat::ContentSet
set of names for stuff that can be inside porous layers
Definition: stratcontent.h:73
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
Strat::Content::isUnspecified
bool isUnspecified() const
Definition: stratcontent.h:49
namedobj.h
Strat::Content
stuff that can be inside porous layers
Definition: stratcontent.h:29
Strat::ContentSet::getIndexOf
int getIndexOf(const char *) const
Strat::isUnspecified
bool isUnspecified(const Content *ct)
convenience: contents can be null or unspecified, handle in one go
Definition: stratcontent.h:64
operator==
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:81
NamedObject::name
virtual const name_type & name() const
Definition: namedobj.h:54
Strat::Content::color_
Color color_
Definition: stratcontent.h:54
Strat::ContentSet::getContent
const Content & getContent(const char *s) const
Definition: stratcontent.h:85
FillPattern
Definition: draw.h:146
Strat::Content::getApearanceFrom
bool getApearanceFrom(const char *)
draw.h
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
Strat::ContentSet::getByName
Content * getByName(const char *s)
Definition: stratcontent.h:80
deepErase
void deepErase(BufferStringSet &)
Strat
Stratigraphy.
Definition: stratlevel.h:26
sKey::Content
FixedString Content()
Definition: keystrs.h:49
Strat::ContentSet::getByName
const Content * getByName(const char *s) const
Definition: stratcontent.h:82
Strat::Content::Content
Content(const char *nm)
Definition: stratcontent.h:32
Color
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer,...
Definition: color.h:26
objectset.h

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