OpendTect  6.3
coltabseqmgr.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: A.H. Bril
8  Date: 23-3-2000
9 ________________________________________________________________________
10 
11 -*/
12 
13 
14 #include "coltabsequence.h"
15 #include "ptrman.h"
16 
17 
18 namespace ColTab
19 {
20 
21 
35 public:
36 
38  typedef size_type IdxType;
40 
42 
43  bool isPresent(const char*) const;
44  ConstRef getByName(const char*) const;
45  ConstRef getAny(const char*,bool seismics_if_default=true) const;
47  ConstRef getDefault(bool for_seismics=true) const;
49  ConstRef getFromPar(const IOPar&,const char* subky=0) const;
51 
52  // Use monitorLock when using indexes
53  size_type size() const;
54  Sequence::Status statusOf(const Sequence&) const;
55  IdxType indexOf(const char*) const;
56  IdxType indexOf(const Sequence&) const;
57  ConstRef getByIdx(IdxType) const;
58  void getSequenceNames(BufferStringSet&) const;
59 
60  bool needsSave() const;
61  uiRetVal write(bool sys=false,bool applsetup=true) const;
62 
63  // ID is the index ... see class remarks.
64  static ChangeType cSeqAdd() { return 2; }
65  static ChangeType cSeqRemove() { return 3; }
66  static const char* sKeyRemoved();
67 
70 
71  static const Sequence& getRGBBlendColSeq(int);
73 
74 protected:
75 
78  const bool iscopy_;
80 
82  ~SequenceManager();
83 
84  // Not locked:
85  size_type gtSize() const;
86  IdxType idxOf(const char*) const;
87  const Sequence* gtAny(const char*,bool) const;
88  void doAdd(Sequence*,bool issys);
89  void addFromPar(const IOPar&,bool);
90  void rollbackFrom(const SequenceManager&);
91 
92  static IdxType gtIdxOf(const ObjectSet<Sequence>&,const char*);
93 
94  void seqChgCB(CallBacker*);
95 
96  friend mGlobal(General) const SequenceManager& SeqMGR();
97  friend class Sequence;
98  // friend class uiColSeqMan;
99 
100 public:
101 
102  // leave this to the color table manager
103  RefMan<Sequence> get4Edit(const char*) const;
104  void add(Sequence*);
105  void removeByName(const char*);
106  ConstRef getSystemSeq(const char*) const;
107  void rollbackFromCopy(const SequenceManager&);
108  static void deleteInst(SequenceManager*);
109 
110  inline bool isPresent( const OD::String& s ) const
111  { return isPresent(s.str()); }
112  inline ConstRef getByName( const OD::String& s ) const
113  { return getByName(s.str()); }
114  inline ConstRef getAny( const OD::String& s, bool fs=true ) const
115  { return getAny(s.str(),fs); }
116  inline IdxType indexOf( const OD::String& s ) const
117  { return indexOf(s.str()); }
118  inline void removeByName( const OD::String& s )
119  { removeByName(s.str()); }
120 
121 };
122 
123 mGlobal(General) const SequenceManager& SeqMGR();
125 { return const_cast<SequenceManager&>(SeqMGR()); }
126 
128 { return SeqMGR4Edit(); }
130 
131 
132 } // namespace ColTab
#define mExpClass(module)
Definition: commondefs.h:157
Object that can be MT-safely monitored from cradle to grave.
Definition: monitorable.h:76
ConstRef getByName(const OD::String &s) const
Definition: coltabseqmgr.h:112
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
void removeByName(const OD::String &s)
Definition: coltabseqmgr.h:118
const char * str() const
Definition: odstring.h:46
int ChangeType
Definition: monitorable.h:80
#define mODTextTranslationClass(clss)
Definition: uistring.h:37
A series of color control points able to give an (interpolated) color for every position [0...
Definition: coltabsequence.h:37
#define mGlobal(module)
Definition: commondefs.h:160
CNotifier< SequenceManager, ChangeData > nameChange
provides name change notif for any of the seqs
Definition: coltabseqmgr.h:68
mDeprecated SequenceManager & SM()
Definition: coltabseqmgr.h:127
int size_type
Definition: objectset.h:37
Set of BufferString objects.
Definition: bufstringset.h:25
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:173
Manages Sequences; reads/writes system or user-defined.
Definition: coltabseqmgr.h:33
#define mDeclMonitorableAssignment(clss)
like mDeclAbstractMonitorableAssignment but for non-abstract subclasses. Implements the clone() metho...
Definition: monitor.h:111
Set of pointers to objects.
Definition: commontypes.h:28
mDeprecated typedef SequenceManager SeqMgr
Definition: coltabseqmgr.h:129
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
static ChangeType cSeqAdd()
Definition: coltabseqmgr.h:64
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:29
ConstRef getAny(const OD::String &s, bool fs=true) const
Definition: coltabseqmgr.h:114
ObjectSet< Sequence > seqs_
Definition: coltabseqmgr.h:76
static ChangeType cSeqRemove()
Definition: coltabseqmgr.h:65
DirtyCounter lastsaveddirtycount_
Definition: coltabseqmgr.h:79
#define mDeprecated
Definition: plfdefs.h:213
Definition: uistring.h:299
OpendTect.
Definition: commontypes.h:25
const bool iscopy_
Definition: coltabseqmgr.h:78
Notifier with automatic capsule creation.
Definition: notify.h:166
Definition: coltab.h:20
ObjectSet< Sequence >::size_type size_type
Definition: coltabseqmgr.h:37
ConstRefMan< Sequence > ConstRef
Definition: coltabseqmgr.h:39
IdxType indexOf(const OD::String &s) const
Definition: coltabseqmgr.h:116
Status
Definition: coltabsequence.h:46
ObjectSet< Sequence > sysseqs_
Definition: coltabseqmgr.h:77
size_type IdxType
Definition: coltabseqmgr.h:38
Definition: ptrman.h:227
SequenceManager & SeqMGR4Edit()
Definition: coltabseqmgr.h:124
bool getFromPar(const IOPar &, GeomType &)
Definition: ptrman.h:200
const SequenceManager & SeqMGR()

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