UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zd_ldb_seismic.hpp
1 /* zd_hds_useismic.hpp */
2 /* $Id: $ */
3 #ifndef __zd_ldb_seismic_hpp
4 #define __zd_ldb_seismic_hpp
5 
6 #include <vector>
7 
8 #include <ldb/trset.h>
9 #include <ldb/trselect.h>
10 
11 #include <zq4/zqb_header.hpp>
12 #include <zq4/zd_seismic_set.hpp>
13 
16 #define ZDUS_EXTRA_HW_SIZE 8
17 
19 namespace hds
20 {
21 
37  class ZdLdbSeismic : public ZdSeismicSet
38  {
39  public:
40 
42  struct SortOrder
43  {
44  int iHdrWord;
45  ZqbOrder eOrder;
46  bool bEnabled;
47  };
48 
49 
51  ZdLdbSeismic(const char* szDocName = NULL);
52 
57  ZdLdbSeismic (const char* szProject, const char* szSeisFile,
58  int nExtraHW = 0, const char* szDocName = NULL);
59 
63  ZdLdbSeismic (TrSet* pTS, int nExtraHW = 0, const char* szDocName = NULL);
64 
66  virtual ~ZdLdbSeismic();
67 
68 
69  /*
70  * Basic information
71  */
72 
75  virtual bool getCoordRange (double c[2]);
76 
78  virtual double averageCoordStep ();
79 
81  virtual const ZqbAbstrTrace& tracePar () const;
82 
84  virtual int traceCount () const;
85 
87  virtual void getAllTraceIds (TraceIdsV& viTraceIds) const;
88 
89 
90  /*
91  * Coordinate based services (see ZdCoordObjStream)
92  */
93 
95  virtual int coordCount () const;
96 
99  virtual int coordToTraceId (double fCoord,
100  int iEnsIndex = 0);
101 
104  virtual void coordToTraceIds (double fCoord,
105  TraceIdsV& viTraceIds);
106 
108  virtual void getCoords (CoordsV& vfCoords);
109 
112  virtual double traceIdToCoord (int iTraceId,
113  int* piEnsIndex = NULL);
114 
115  /*
116  * Write-only access features
117  */
118 
122  virtual bool modify ();
123 
126  virtual bool isModifiable () const;
127 
132  virtual bool setHeader (int id, const ZqbHeader& hdr);
133 
137  virtual bool setTrace (int id, const ZqbRealTrace& rtr);
138 
143  virtual bool setSamples (int id, const float* pSamples);
144 
145 
146  /*
147  * Read-only access features
148  */
149 
152  virtual const ZqbHeader* headerById (int id);
153 
156  virtual const float* samplesById (int id);
157 
160  virtual const ZqbRealTrace* traceById (int id);
161 
162 
163  /*
164  * Iterator methods.
165  */
166 
168  virtual void setCustomCoord(int iCoordId);
169  virtual int getCustomCoord() const;
170 
172  virtual void setFirstOrder (int iCoordHW,
173  ZqbOrder eOrder = Z_O_ASCENT);
174  virtual bool getFirstOrder (int &iCoordHW, ZqbOrder &eOrder) const;
175 
177  virtual void setSecondaryOrder (int iSecondaryHW,
178  ZqbOrder eOrder = Z_O_ASCENT);
179  virtual bool getSecondaryOrder (int &iSecondaryHW, ZqbOrder &eOrder) const;
180 
182  virtual void setTertiaryOrder (int iTertiaryHW,
183  ZqbOrder eOrder = Z_O_ASCENT);
184  virtual bool getTertiaryOrder (int &iTertiaryHW, ZqbOrder &eOrder) const;
185 
186 
188  virtual void setCoordsSelection(const CoordSelectionVec &selCoords)
189  {m_vSelectCoords = selCoords;}
190 
192  virtual const CoordSelectionVec& getCoordsSelection() const
193  {return m_vSelectCoords;}
194 
195 
197  virtual void setInvisibleCoordinates(const CoordSelectionVec &unvisibleCoords)
198  {m_vInvisibleCoords = unvisibleCoords;}
199 
202  {return m_vInvisibleCoords;}
203 
204 
206  virtual void resetOrder();
207 
208 
209 
212  virtual bool goFirstCoord ();
213 
216  virtual bool goNextCoord ();
217 
220  virtual double coord ();
221 
223  virtual bool visibleCoord ();
224 
226  virtual void* custom(int ens_index = 0,
227  ZqbType* pRetType = NULL);
228 
231  virtual int ensembleLength ();
232 
234  virtual int maxEnsembleLength ();
235 
238  virtual const ZqbRealTrace& trace (int ens_index = 0);
239 
242  virtual const ZqbHeader& header (int ens_index = 0);
243 
247  virtual int traceId (int ens_index = 0);
248 
250  int getFieldsCount() const {return TrFieldsCount;}
251 
252 
253  /*
254  * Additional service
255  */
256 
258  virtual void globalAmplInfo (double pfAmm[2]);
259 
262  virtual const char* coordMeaning () const;
263 
265  virtual const char* coordUnit () const;
266 
268  virtual const char* timeMeaning () const;
269 
271  virtual const char* timeUnit () const;
272 
274  virtual const ZqbHdrField* headerWordInfo(int hwId) const;
275 
276 
277  /*
278  * General services
279  */
280 
287  static void initialize (int nExtraHW = 0,
288  const ZqbHdrField* pExtraHW = NULL,
289  void (*InitExtraHW)(ZqbHeader&) = NULL);
290 
292  static ZqbType hwType (int hwId);
293 
296  static ZqbHdrField* hwInfo (int hwId);
297 
298 
299  /*
300  * Local services
301  */
302 
304  bool properOrder () const;
305 
309  void applyOrder ();
310 
312  virtual ZqbType coordTypeFromId(int coordId) const;
313 
314 
316  const TrSet* getTrSetPtr() const {return m_pTS;}
317 
318  protected:
319 
321  void constructor ();
322 
325 
329 
332 
335 
337  std::map<int, ZqbRealTrace*> m_mTraces;
338 
341 
344 
346  int m_iCustomCoordId;
347 
350  static void (*s_initExtraHW)(ZqbHeader&);
351 
354 
356  size_t m_CurrentTrsBufferSize;
357 
359  std::vector<SortOrder> m_vSortOrders;
360 
363 
366 
367  private:
368 
370  ZqbRealTrace* make_trace_by_id(int id) const;
371 
373  void loadProjectAttr (const char* szProject);
374 
376  bool m_bIsTSOpened;
377 
379  static int s_iNameCounter;
380 
382  static const char *s_szOwnType;
383 
385  TrMtable *m_pTmpMT;
386 
388  bool m_bOwnTrSet;
389  };
390 
391 }; // hds namespace
392 
393 #endif /* zd_ldb_seismic.hpp */
virtual void * custom(int ens_index=0, ZqbType *pRetType=NULL)
Definition: zqb_hdr_field.h:16
virtual int getCustomCoord() const
virtual bool modify()
virtual void setFirstOrder(int iCoordHW, ZqbOrder eOrder=Z_O_ASCENT)
ZqbOrder eOrder
Definition: zd_ldb_seismic.hpp:45
virtual const char * timeMeaning() const
std::vector< double > CoordsV
Definition: zd_seismic_set.hpp:25
virtual void setCoordsSelection(const CoordSelectionVec &selCoords)
Definition: zd_ldb_seismic.hpp:188
virtual const ZqbRealTrace * traceById(int id)
ZqbRealTrace m_EmptyTrace
Definition: zd_ldb_seismic.hpp:334
bool properOrder() const
Definition: zd_ldb_seismic.hpp:42
int iHdrWord
Definition: zd_ldb_seismic.hpp:44
virtual int ensembleLength()
virtual bool getFirstOrder(int &iCoordHW, ZqbOrder &eOrder) const
virtual const char * timeUnit() const
int m_iCurTrace
Definition: zd_ldb_seismic.hpp:340
virtual bool visibleCoord()
virtual const ZqbHeader * headerById(int id)
virtual void setInvisibleCoordinates(const CoordSelectionVec &unvisibleCoords)
Definition: zd_ldb_seismic.hpp:197
virtual bool getSecondaryOrder(int &iSecondaryHW, ZqbOrder &eOrder) const
Definition: zqb_header.hpp:27
virtual const char * coordUnit() const
virtual const char * coordMeaning() const
virtual const ZqbHeader & header(int ens_index=0)
virtual void getCoords(CoordsV &vfCoords)
virtual bool getTertiaryOrder(int &iTertiaryHW, ZqbOrder &eOrder) const
std::map< int, ZqbRealTrace * > m_mTraces
Definition: zd_ldb_seismic.hpp:337
ZdCoordObjStream::CoordSelectionVec m_vSelectCoords
Definition: zd_ldb_seismic.hpp:362
virtual int coordCount() const
static ZqbHdrField * hwInfo(int hwId)
virtual double averageCoordStep()
static void initialize(int nExtraHW=0, const ZqbHdrField *pExtraHW=NULL, void(*InitExtraHW)(ZqbHeader &)=NULL)
int m_nExtraHW
Definition: zd_ldb_seismic.hpp:343
bool bEnabled
Definition: zd_ldb_seismic.hpp:46
virtual const ZqbHdrField * headerWordInfo(int hwId) const
virtual const CoordSelectionVec & getCoordsSelection() const
Definition: zd_ldb_seismic.hpp:192
virtual bool setTrace(int id, const ZqbRealTrace &rtr)
static ZqbType hwType(int hwId)
virtual const float * samplesById(int id)
virtual int traceId(int ens_index=0)
virtual int maxEnsembleLength()
Definition: zqb_abstr_trace.hpp:13
std::vector< int > TraceIdsV
Definition: zd_seismic_set.hpp:22
ZqbAbstrTrace m_aTrace
Definition: zd_ldb_seismic.hpp:331
virtual double coord()
virtual ~ZdLdbSeismic()
Definition: zqb_real_trace.hpp:19
virtual void coordToTraceIds(double fCoord, TraceIdsV &viTraceIds)
TrSet * m_pTS
Definition: zd_ldb_seismic.hpp:324
virtual double traceIdToCoord(int iTraceId, int *piEnsIndex=NULL)
UnitId m_eLengthUnitId
Definition: zd_ldb_seismic.hpp:353
virtual const ZqbRealTrace & trace(int ens_index=0)
Definition: trset.h:56
virtual void resetOrder()
std::vector< SortOrder > m_vSortOrders
Definition: zd_ldb_seismic.hpp:359
virtual bool isModifiable() const
virtual const CoordSelectionVec & getInvisibleCoordinates() const
Definition: zd_ldb_seismic.hpp:201
ZdLdbSeismic(const char *szDocName=NULL)
virtual bool setSamples(int id, const float *pSamples)
virtual bool setHeader(int id, const ZqbHeader &hdr)
virtual void setTertiaryOrder(int iTertiaryHW, ZqbOrder eOrder=Z_O_ASCENT)
const TrSet * getTrSetPtr() const
Definition: zd_ldb_seismic.hpp:316
virtual void setSecondaryOrder(int iSecondaryHW, ZqbOrder eOrder=Z_O_ASCENT)
virtual void getAllTraceIds(TraceIdsV &viTraceIds) const
int getFieldsCount() const
Definition: zd_ldb_seismic.hpp:250
virtual bool getCoordRange(double c[2])
virtual const ZqbAbstrTrace & tracePar() const
virtual void setCustomCoord(int iCoordId)
Definition: zd_ldb_seismic.hpp:37
std::vector< CoordSelection > CoordSelectionVec
Definition: zd_coord_obj_stream.hpp:39
virtual ZqbType coordTypeFromId(int coordId) const
Definition: zd_seismic_set.hpp:17
Definition: trset.h:44
virtual void globalAmplInfo(double pfAmm[2])
TrIndexTable m_it
Definition: zd_ldb_seismic.hpp:328
Definition: trset.h:96
ZdCoordObjStream::CoordSelectionVec m_vInvisibleCoords
Definition: zd_ldb_seismic.hpp:365
virtual bool goNextCoord()
virtual int traceCount() const
virtual int coordToTraceId(double fCoord, int iEnsIndex=0)
virtual bool goFirstCoord()
static void(* s_initExtraHW)(ZqbHeader &)
Definition: zd_ldb_seismic.hpp:350