OpendTect  6.6
segyresorter.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: Jul 2008
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "seismod.h"
15 #include "executor.h"
16 #include "seisposkey.h"
17 #include "ranges.h"
18 #include "multiid.h"
19 #include "strmdata.h"
20 #include "bufstringset.h"
21 namespace Pos { class Filter; }
22 namespace PosInfo { class CubeData; class CubeDataPos; }
23 
24 
25 namespace SEGY
26 {
27 class DirectDef;
28 class FileDataSet;
29 class DirectReader;
30 
39 public:
40 
42  {
43  public:
44 
46  const char* outputfnm);
47 
49  mDefSetupMemb(MultiID,inpkey)
51  mDefSetupMemb(int,newfileeach)
52  mDefSetupMemb(bool,inlnames)
53 
54  Interval<int> getInlRg(int,const PosInfo::CubeData&) const;
55  BufferString getFileName(const Interval<int>&) const;
56 
57  mutable int curfnr_;
58 
59  };
60 
61  ReSorter(const Setup&,const char* linename=0);
63 
64  void setFilter(const Pos::Filter&);
65 
66  uiString uiMessage() const { return msg_; }
67  uiString uiNrDoneText() const { return tr("Traces handled"); }
68  od_int64 nrDone() const { return nrdone_; }
69  od_int64 totalNr() const { return totnr_; }
70  int nextStep();
71 
72  const DirectDef& dDef() const;
73  const FileDataSet& fds() const;
74 
75 protected:
76 
77  const Setup setup_;
78 
86 
90 
91  unsigned char hdrbuf_[3600];
92  unsigned char* trcbuf_;
94 
98 
99  int fillBinIDs();
100  int wrapUp();
101  bool getCurPos(BinID&);
102  bool toNext();
103  bool getNext(const BinID&,int&,int&) const;
104  bool createOutput(const BinID&);
106  int ensureFileOpen(int);
107  bool readData(int,int);
108  bool writeData();
109 
110 };
111 
112 } // namespace
113 
SEGY::ReSorter
Re-sorts SEG-Y files, input must be 'scanned'.
Definition: segyresorter.h:38
SEGY::ReSorter::msg_
uiString msg_
Definition: segyresorter.h:80
SEGY::ReSorter::Setup::Setup
Setup(Seis::GeomType gt, const MultiID &, const char *outputfnm)
SEGY::ReSorter::createOutput
bool createOutput(const BinID &)
SEGY::ReSorter::getNext
bool getNext(const BinID &, int &, int &) const
SEGY::ReSorter::nrDone
od_int64 nrDone() const
Definition: segyresorter.h:68
Pos
Position.
Definition: commontypes.h:78
ObjectSet< od_istream >
BufferStringSet
Set of BufferString objects.
Definition: bufstringset.h:26
SEGY::ReSorter::uiNrDoneText
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: segyresorter.h:67
Seis
Summary for a Seismic object.
Definition: segydirectdef.h:22
SEGY::ReSorter::cdp_
PosInfo::CubeDataPos & cdp_
Definition: segyresorter.h:96
od_int64
#define od_int64
Definition: plftypes.h:35
SEGY::ReSorter::posfilt_
Pos::Filter * posfilt_
Definition: segyresorter.h:97
SEGY::FileDataSet
Definition: segyfiledata.h:39
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
seisposkey.h
SEGY::ReSorter::Setup::mDefSetupMemb
mDefSetupMemb(Seis::GeomType, geom) mDefSetupMemb(MultiID
SEGY::DirectReader
Definition: segydirecttr.h:36
SEGY::ReSorter::trcbytes_
od_int64 trcbytes_
Definition: segyresorter.h:93
SEGY::ReSorter::nrdone_
od_int64 nrdone_
Definition: segyresorter.h:81
mDefSetupMemb
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:154
SEGY::ReSorter::curinlrg_
Interval< int > curinlrg_
Definition: segyresorter.h:84
SEGY::ReSorter::wrapUp
int wrapUp()
PosInfo::CubeDataPos
Position in a CubeData.
Definition: posinfo.h:73
SEGY::ReSorter::inpfnms_
BufferStringSet inpfnms_
Definition: segyresorter.h:89
SEGY::ReSorter::Setup
Definition: segyresorter.h:42
SEGY::ReSorter::fillBinIDs
int fillBinIDs()
multiid.h
BinID
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:31
sKey::Filter
FixedString Filter()
Definition: keystrs.h:69
SEGY::ReSorter::fds
const FileDataSet & fds() const
SEGY::ReSorter::toNext
bool toNext()
Executor
Specification to enable chunkwise execution of a process.
Definition: executor.h:39
SEGY::ReSorter::ensureFileOpen
int ensureFileOpen(int)
executor.h
SEGY::ReSorter::trcbuf_
unsigned char * trcbuf_
Definition: segyresorter.h:92
SEGY::ReSorter::readData
bool readData(int, int)
SEGY::ReSorter::totnr_
od_int64 totnr_
Definition: segyresorter.h:82
MultiID
Compound key consisting of ints.
Definition: multiid.h:24
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
SEGY::ReSorter::inpstrms_
ObjectSet< od_istream > inpstrms_
Definition: segyresorter.h:87
SEGY::ReSorter::dDef
const DirectDef & dDef() const
bufstringset.h
SEGY::ReSorter::mODTextTranslationClass
mODTextTranslationClass(ReSorter)
strmdata.h
Pos::Filter
Decides whether a given position should be included.
Definition: posfilter.h:45
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
SEGY::ReSorter::openOutputFile
bool openOutputFile()
SEGY::ReSorter::fidxs_
TypeSet< int > fidxs_
Definition: segyresorter.h:88
PosInfo
Position info, often segmented.
Definition: posinfo.h:40
SEGY::ReSorter::totalNr
od_int64 totalNr() const
Definition: segyresorter.h:69
SEGY
Keys that should be used with od_process_segyio.cc.
Definition: segybatchio.h:22
SEGY::ReSorter::binids_
TypeSet< BinID > binids_
Definition: segyresorter.h:95
SEGY::ReSorter::nextStep
int nextStep()
SEGY::DirectDef
Definition: segydirectdef.h:35
ranges.h
Seis::GeomType
GeomType
Definition: seistype.h:32
Interval
Interval of values.
Definition: commontypes.h:30
SEGY::ReSorter::outstrm_
od_ostream * outstrm_
Definition: segyresorter.h:83
od_ostream
OD class for stream write common access to the user log file, or std::cout in other than od_main.
Definition: od_ostream.h:26
SEGY::ReSorter::setup_
const Setup setup_
Definition: segyresorter.h:77
SEGY::ReSorter::drdr_
SEGY::DirectReader * drdr_
Definition: segyresorter.h:79
SEGY::ReSorter::getCurPos
bool getCurPos(BinID &)
SEGY::ReSorter::needwritefilehdrs_
bool needwritefilehdrs_
Definition: segyresorter.h:85
SEGY::ReSorter::writeData
bool writeData()
TypeSet< int >

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