UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
ZqbHeader Class Reference

#include <zqb_header.hpp>

Inheritance diagram for ZqbHeader:
ZqbRealTrace ZqbRealTrace

Public Member Functions

 ZqbHeader ()
 
 ZqbHeader (int trhdr_size, const void *trhdr=NULL)
 
 ZqbHeader (const ZqbHeader &hdr)
 
virtual ~ZqbHeader ()
 
ZqbHeaderoperator= (const ZqbHeader &hdr)
 
virtual int size () const
 
virtual void setHeader (int trhdr_size, const void *trhdr=NULL)
 
virtual void setHeader (const void *trhdr)
 
virtual void resetSortOrder ()
 
virtual void setSortOrder (int hwId, ZqbOrder eOrder=Z_O_ASCENT)
 
virtual void setSortOrder (int hwId1, ZqbOrder eOrder1, int hwId2, ZqbOrder eOrder2)
 
virtual void setSortOrder (int hwId1, ZqbOrder eOrder1, int hwId2, ZqbOrder eOrder2, int hwId3, ZqbOrder eOrder3)
 
virtual bool operator< (const ZqbHeader &hdr) const
 
virtual bool operator== (const ZqbHeader &hdr) const
 
bool operator!= (const ZqbHeader &hdr) const
 
int hwCompare (int hwId, const ZqbHeader &hdr, double fPrec=1e-32) const
 
virtual ZqbType hdrType (int hwId) const
 
virtual const char * hdrLabel (int hwId) const
 
virtual char hdrChar (int hwId) const
 
virtual int hdrInt (int hwId) const
 
virtual float hdrFloat (int hwId) const
 
virtual void hdrChar (int hwId, char cValue)
 
virtual void hdrInt (int hwId, int iValue)
 
virtual void hdrFloat (int hwId, float fValue)
 
virtual int hwid2index (int hwId) const
 
 ZqbHeader ()
 
 ZqbHeader (int trhdr_size, const void *trhdr=NULL)
 
 ZqbHeader (const ZqbHeader &hdr)
 
virtual ~ZqbHeader ()
 
ZqbHeaderoperator= (const ZqbHeader &hdr)
 
virtual int size () const
 
virtual void setHeader (int trhdr_size, const void *trhdr=NULL)
 
virtual void setHeader (const void *trhdr)
 
virtual void resetSortOrder ()
 
virtual void setSortOrder (int hwId, ZqbOrder eOrder=Z_O_ASCENT)
 
virtual void setSortOrder (int hwId1, ZqbOrder eOrder1, int hwId2, ZqbOrder eOrder2)
 
virtual void setSortOrder (int hwId1, ZqbOrder eOrder1, int hwId2, ZqbOrder eOrder2, int hwId3, ZqbOrder eOrder3)
 
virtual bool operator< (const ZqbHeader &hdr) const
 
virtual bool operator== (const ZqbHeader &hdr) const
 
bool operator!= (const ZqbHeader &hdr) const
 
int hwCompare (int hwId, const ZqbHeader &hdr, double fPrec=1e-32) const
 
virtual ZqbType hdrType (int hwId) const
 
virtual const char * hdrLabel (int hwId) const
 
virtual char hdrChar (int hwId) const
 
virtual int hdrInt (int hwId) const
 
virtual float hdrFloat (int hwId) const
 
virtual void hdrChar (int hwId, char cValue)
 
virtual void hdrInt (int hwId, int iValue)
 
virtual void hdrFloat (int hwId, float fValue)
 
virtual int hwid2index (int hwId) const
 
virtual int hwid2offset (int hwId) const
 

Static Public Member Functions

static bool compareLess (const ZqbHeader *hdr1, const ZqbHeader *hdr2)
 
static bool compareEqual (const ZqbHeader *hdr1, const ZqbHeader *hdr2)
 
static bool compareNotEqual (const ZqbHeader *hdr1, const ZqbHeader *hdr2)
 
static bool byteCompare (const ZqbHeader &hdr1, const ZqbHeader &hdr2)
 
static bool compareLess (const ZqbHeader *hdr1, const ZqbHeader *hdr2)
 
static bool compareEqual (const ZqbHeader *hdr1, const ZqbHeader *hdr2)
 
static bool compareNotEqual (const ZqbHeader *hdr1, const ZqbHeader *hdr2)
 
static bool byteCompare (const ZqbHeader &hdr1, const ZqbHeader &hdr2)
 

Public Attributes

int m_nHdrSize
 
void * m_pHdr
 
ZqbHeaderDefm_pHdrDef
 
bool m_bUseful
 

Static Public Attributes

static double s_fEpsilon
 

Protected Attributes

int m_nCriteria
 
int m_iSortHW [3]
 
ZqbOrder m_eSortOrder [3]
 

Detailed Description

Class implements the most common seismic trace header storage and access entity. Truely it may be used not only seismic headers but for other attributes.

Header words are addressed by their indeces counted from 0. Negative index allows to address from the end of the header. This feature allows to use extended header words simply by creating the object with larger header size.

Please handle data members with care bacause changing them directly may lead to SEGV.

Constructor & Destructor Documentation

ZqbHeader::ZqbHeader ( )

Create empty header container. It's supposed that later is will be assigned by some meaningful header.

ZqbHeader::ZqbHeader ( int  trhdr_size,
const void *  trhdr = NULL 
)

Create header of given size and with given header contents. Header size should be represented in bytes.

ZqbHeader::ZqbHeader ( const ZqbHeader hdr)

Create header as a copy of some othe one.

virtual ZqbHeader::~ZqbHeader ( )
virtual

Destroy the object.

ZqbHeader::ZqbHeader ( )

Create empty header container. It's supposed that later is will be assigned by some meaningful header.

ZqbHeader::ZqbHeader ( int  trhdr_size,
const void *  trhdr = NULL 
)

Create header of given size and with given header contents. Header size should be represented in bytes.

ZqbHeader::ZqbHeader ( const ZqbHeader hdr)

Create header as a copy of some othe one.

virtual ZqbHeader::~ZqbHeader ( )
virtual

Destroy the object.

Member Function Documentation

static bool ZqbHeader::byteCompare ( const ZqbHeader hdr1,
const ZqbHeader hdr2 
)
static

Compare headers. Returns true is two headers are identical byte-to-byte. This method does not use sort orders.

static bool ZqbHeader::byteCompare ( const ZqbHeader hdr1,
const ZqbHeader hdr2 
)
static

Compare headers. Returns true is two headers are identical byte-to-byte. This method does not use sort orders.

static bool ZqbHeader::compareEqual ( const ZqbHeader hdr1,
const ZqbHeader hdr2 
)
static

Compare two headers by their pointer and defined criteria.

static bool ZqbHeader::compareEqual ( const ZqbHeader hdr1,
const ZqbHeader hdr2 
)
static

Compare two headers by their pointer and defined criteria.

static bool ZqbHeader::compareLess ( const ZqbHeader hdr1,
const ZqbHeader hdr2 
)
static

Compare two headers by their pointer and defined criteria.

static bool ZqbHeader::compareLess ( const ZqbHeader hdr1,
const ZqbHeader hdr2 
)
static

Compare two headers by their pointer and defined criteria.

static bool ZqbHeader::compareNotEqual ( const ZqbHeader hdr1,
const ZqbHeader hdr2 
)
static

Compare two headers by their pointer and defined criteria.

static bool ZqbHeader::compareNotEqual ( const ZqbHeader hdr1,
const ZqbHeader hdr2 
)
static

Compare two headers by their pointer and defined criteria.

virtual char ZqbHeader::hdrChar ( int  hwId) const
virtual

Get the first one byte character value of given header word. If the header word is unknown, does not exist or header value has different type then return value is undefined. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual char ZqbHeader::hdrChar ( int  hwId) const
virtual

Get the first one byte character value of given header word. If the header word is unknown, does not exist or header value has different type then return value is undefined. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual void ZqbHeader::hdrChar ( int  hwId,
char  cValue 
)
virtual

Set one byte character value in given header word as the first byte. If the header word is unknown, does not exist or header value has different type then value will not be stored. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual void ZqbHeader::hdrChar ( int  hwId,
char  cValue 
)
virtual

Set one byte character value in given header word as the first byte. If the header word is unknown, does not exist or header value has different type then value will not be stored. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual float ZqbHeader::hdrFloat ( int  hwId) const
virtual

Get floaing point value of given header word. If the header word is unknown, does not exist or header value has different type then return value is undefined. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual float ZqbHeader::hdrFloat ( int  hwId) const
virtual

Get floaing point value of given header word. If the header word is unknown, does not exist or header value has different type then return value is undefined. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual void ZqbHeader::hdrFloat ( int  hwId,
float  fValue 
)
virtual

Set floaing point value in given header word. If the header word is unknown, does not exist or header value has different type then return value will not be stored. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual void ZqbHeader::hdrFloat ( int  hwId,
float  fValue 
)
virtual

Set floaing point value in given header word. If the header word is unknown, does not exist or header value has different type then return value will not be stored. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual int ZqbHeader::hdrInt ( int  hwId) const
virtual

Get integer value of given header word. If the header word is unknown, does not exist or header value has different type then return value is undefined. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual int ZqbHeader::hdrInt ( int  hwId) const
virtual

Get integer value of given header word. If the header word is unknown, does not exist or header value has different type then return value is undefined. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual void ZqbHeader::hdrInt ( int  hwId,
int  iValue 
)
virtual

Set integer value in given header word. If the header word is unknown, does not exist or header value has different type then value will not be stored. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual void ZqbHeader::hdrInt ( int  hwId,
int  iValue 
)
virtual

Set integer value in given header word. If the header word is unknown, does not exist or header value has different type then value will not be stored. By default hwId is interpreted as 4-byte word index in the header counted from 0.

virtual const char* ZqbHeader::hdrLabel ( int  hwId) const
virtual

Return text string with header word label. By default "Header word ##" is returned. The returned value points to static memory buffer!

virtual const char* ZqbHeader::hdrLabel ( int  hwId) const
virtual

Return text string with header word label. By default "Header word ##" is returned. The returned value points to static memory buffer!

virtual ZqbType ZqbHeader::hdrType ( int  hwId) const
virtual

Return type of given header word. By default header word information is not supported.

virtual ZqbType ZqbHeader::hdrType ( int  hwId) const
virtual

Return type of given header word. By default header word information is not supported.

int ZqbHeader::hwCompare ( int  hwId,
const ZqbHeader hdr,
double  fPrec = 1e-32 
) const

Compare headers by given header word. -1 - means this header is less than pointed; 0 - they are equal; 1 - this header is greater. A precision is applied in case of floating point comparison. This method does not use sort orders.

int ZqbHeader::hwCompare ( int  hwId,
const ZqbHeader hdr,
double  fPrec = 1e-32 
) const

Compare headers by given header word. -1 - means this header is less than pointed; 0 - they are equal; 1 - this header is greater. A precision is applied in case of floating point comparison. This method does not use sort orders.

virtual int ZqbHeader::hwid2index ( int  hwId) const
virtual

Convert header word id to the word index in hdr{Type} methods. By default it performs mapping based on m_mHwId2Index map. If the hwid is not found in the map then 0 is returned. If the map is empty then hwid is used as index.

virtual int ZqbHeader::hwid2index ( int  hwId) const
virtual

Convert header word id to the word index in hdr{Type} methods. By default it performs mapping based on m_mHwId2Index map. If the hwid is not found in the map then 0 is returned. If the map is empty then hwid is used as index.

virtual int ZqbHeader::hwid2offset ( int  hwId) const
virtual

Convert header word id to the offset in hdr{Type} methods. By default it performs mapping based on m_mHwId2Index map. If the hwid is not found in the map then 0 is returned. If the map is empty then hwid is used as index.

bool ZqbHeader::operator!= ( const ZqbHeader hdr) const
inline

Compare two headers by header words in defined criteria.

bool ZqbHeader::operator!= ( const ZqbHeader hdr) const
inline

Compare two headers by header words in defined criteria.

virtual bool ZqbHeader::operator< ( const ZqbHeader hdr) const
virtual

Compare two headers by defined criteria.

virtual bool ZqbHeader::operator< ( const ZqbHeader hdr) const
virtual

Compare two headers by defined criteria.

ZqbHeader& ZqbHeader::operator= ( const ZqbHeader hdr)

Copy given header into this object.

ZqbHeader& ZqbHeader::operator= ( const ZqbHeader hdr)

Copy given header into this object.

virtual bool ZqbHeader::operator== ( const ZqbHeader hdr) const
virtual

Compare two headers by header words in defined criteria.

virtual bool ZqbHeader::operator== ( const ZqbHeader hdr) const
virtual

Compare two headers by header words in defined criteria.

virtual void ZqbHeader::resetSortOrder ( )
virtual

Unset all comparison criteria.

virtual void ZqbHeader::resetSortOrder ( )
virtual

Unset all comparison criteria.

virtual void ZqbHeader::setHeader ( int  trhdr_size,
const void *  trhdr = NULL 
)
virtual

Assign new header size and contents (optionally).

virtual void ZqbHeader::setHeader ( int  trhdr_size,
const void *  trhdr = NULL 
)
virtual

Assign new header size and contents (optionally).

virtual void ZqbHeader::setHeader ( const void *  trhdr)
virtual

Assign new header contents of the same size.

virtual void ZqbHeader::setHeader ( const void *  trhdr)
virtual

Assign new header contents of the same size.

virtual void ZqbHeader::setSortOrder ( int  hwId,
ZqbOrder  eOrder = Z_O_ASCENT 
)
virtual

Set comparison criteria by given header word identifier in given order.

virtual void ZqbHeader::setSortOrder ( int  hwId,
ZqbOrder  eOrder = Z_O_ASCENT 
)
virtual

Set comparison criteria by given header word identifier in given order.

virtual void ZqbHeader::setSortOrder ( int  hwId1,
ZqbOrder  eOrder1,
int  hwId2,
ZqbOrder  eOrder2 
)
virtual

Set comparison criteria by two given header words. First header word will be used as primary one and the second - the secondary.

virtual void ZqbHeader::setSortOrder ( int  hwId1,
ZqbOrder  eOrder1,
int  hwId2,
ZqbOrder  eOrder2 
)
virtual

Set comparison criteria by two given header words. First header word will be used as primary one and the second - the secondary.

virtual void ZqbHeader::setSortOrder ( int  hwId1,
ZqbOrder  eOrder1,
int  hwId2,
ZqbOrder  eOrder2,
int  hwId3,
ZqbOrder  eOrder3 
)
virtual

Set comparison criteria by three given header words.

virtual void ZqbHeader::setSortOrder ( int  hwId1,
ZqbOrder  eOrder1,
int  hwId2,
ZqbOrder  eOrder2,
int  hwId3,
ZqbOrder  eOrder3 
)
virtual

Set comparison criteria by three given header words.

virtual int ZqbHeader::size ( ) const
virtual

Return size of header (in bytes).

virtual int ZqbHeader::size ( ) const
virtual

Return size of header (in bytes).

Member Data Documentation

bool ZqbHeader::m_bUseful
mutable

For marking the trace as usefull trace for paint in ZqSeismicView. It is probably temporary solution for optimization and may be removed later.

ZqbOrder ZqbHeader::m_eSortOrder
protected

List of header word criteria direction.

int ZqbHeader::m_iSortHW
protected

List of header words used to compare headers.

int ZqbHeader::m_nCriteria
protected

Number of header words used for comparison criteria.

int ZqbHeader::m_nHdrSize

Size of trace header in bytes.

void * ZqbHeader::m_pHdr

Pointer to trace header.

ZqbHeaderDef * ZqbHeader::m_pHdrDef

Special map from hwId to index (if not NULL).

static double ZqbHeader::s_fEpsilon
static

Custom precision for floating point header words matching.


The documentation for this class was generated from the following files: