OpendTect  6.3
segyhdrcalc.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: Mar 2011
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "segyhdrdef.h"
14 #include "namedobj.h"
15 #include "typeset.h"
16 #include "od_iosfwd.h"
17 #include "uistring.h"
18 class Executor;
19 class BufferStringSet;
20 namespace Math { class Expression; }
21 
22 
23 namespace SEGY
24 {
25 class BinHeader;
26 class TxtHeader;
27 
29 { mODTextTranslationClass(HdrCalc);
30 public:
31 
32  HdrCalc( const HdrEntry& he, const char* def )
33  : he_(he), def_(def) {}
34 
35  const HdrEntry& he_;
37 
38  inline BufferString getDispStr() const
39  { return BufferString( he_.name(), " = ", def_ ); }
40 
41 };
42 
43 
45  , public NamedObject
47 public:
48  HdrCalcSet(const HdrDef&);
49  ~HdrCalcSet();
50  const HdrDef& hdrDef() { return hdef_; }
51  const HdrEntry& trcIdxEntry() { return trcidxhe_; }
52 
53  int indexOf(const char* entrynm) const;
54  int indexOf( const HdrCalc* he ) const
55  { return ObjectSet<HdrCalc>::indexOf(he); }
56  bool set(int,const char* def,uiString* emsg=0);
57  bool add(const HdrEntry&,const char* def,
58  uiString* emsg=0);
59  bool add(const char* dispstr);
60  void discard(int);
61  void setEmpty();
62 
63  void reSetSeqNr( int seqnr=1 ) { seqnr_ = seqnr; }
64  void apply(void*,bool needswap) const;
65  Executor* getApplier(od_istream&,od_ostream&,
66  int data_bytes_per_trace,
67  const BinHeader* bh=0,
68  const TxtHeader* th=0) const;
69 
70  bool storeInSettings() const;
71  void getFromSettings(const char*);
72 
73  static void getStoredNames(BufferStringSet&);
74  static const char* sKeySettsFile() { return "segyhdrcalc"; }
75 
76 protected:
77 
78  const HdrDef& hdef_;
82  mutable int seqnr_;
83 
84  Math::Expression* gtME(const char*,TypeSet<int>&,
85  uiString*) const;
86 
87 };
88 
89 } // namespace
void reSetSeqNr(int seqnr=1)
Definition: segyhdrcalc.h:63
#define mExpClass(module)
Definition: commondefs.h:157
Seismics.
Definition: segydirectdef.h:20
const HdrDef & hdef_
Definition: segyhdrcalc.h:78
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:25
400 byte SEG-Y binary header
Definition: segyhdr.h:75
ObjectSet< Math::Expression > exprs_
Definition: segyhdrcalc.h:80
#define mODTextTranslationClass(clss)
Definition: uistring.h:37
const HdrEntry & he_
intended target
Definition: segyhdrcalc.h:35
Definition: segyhdrcalc.h:44
BufferString def_
user-defined math formula
Definition: segyhdrcalc.h:36
Definition: uistring.h:88
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
OD class for stream read.
Definition: od_istream.h:23
HdrCalc(const HdrEntry &he, const char *def)
Definition: segyhdrcalc.h:32
ObjectSet< TypeSet< int > > heidxs_
Definition: segyhdrcalc.h:81
Set of pointers to objects.
Definition: commontypes.h:28
HdrEntry trcidxhe_
Definition: segyhdrcalc.h:79
int seqnr_
Definition: segyhdrcalc.h:82
Definition: segyhdrdef.h:82
int indexOf(const HdrCalc *he) const
Definition: segyhdrcalc.h:54
const HdrEntry & trcIdxEntry()
Definition: segyhdrcalc.h:51
Parsed Math expression.
Definition: mathexpression.h:31
const HdrDef & hdrDef()
Definition: segyhdrcalc.h:50
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
object with a name.
Definition: namedobj.h:20
describes one tape or trace header field,
Definition: segyhdrdef.h:32
const char * name() const
static const char * sKeySettsFile()
Definition: segyhdrcalc.h:74
3200 byte SEG-Y text header.
Definition: segyhdr.h:36
Definition: math2.h:27
Keys that should be used with od_process_segyio.cc.
Definition: segybatchio.h:18
BufferString getDispStr() const
Definition: segyhdrcalc.h:38
virtual size_type indexOf(const T *) const
Definition: objectset.h:341
Definition: segyhdrcalc.h:28
Specification to enable chunkwise execution of a process.
Definition: executor.h:38

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