Seismic Widget Class


Data Structures

The Seismic widget uses several types of data structures when displaying and manipulating a seismic section. A single instance of any of these types of data structures can be shared among several Seismic widgets. The primary data structure used by a Seismic widget is an instance of the data type XintSeismicDataRec. It contains the trace data and refers to a list of data structures, each of which is of data type XintSeismicKeyRec. Each instance of the XintSeismicKeyRec Structure contains the key information for the associated trace. The typedef statements that define these data structures are contained in the header file Seismic.h and are described in the paragraphs below. Another type of data structure used by the Seismic widget is the color record structure, XintColorRec. A color record is used by the Seismic widget to define the colormap used to display a color rendition of the seismic section. The final type of data structure used by a Seismic widget is an instance of the picking record structure, XintPickingRecord. This type of structure is for horizon picking using the Picking Library.

Using the XintSeismicDataRec Structure

You must create your own instance of the XintSeismicDataRec structure and manage that data structure yourself. The Seismic widget uses your instance of the XintSeismicDataRec structure when displaying and manipulating the seismic data. You specify that a specific instance of the XintSeismicDataRec structure is to be used by a Seismic widget when creating the widget via the resource XmNdataRec. After the Seismic widget is created, if you wish to change the data used by the widget, change the data in the XintSeismicDataRec instance, set the new_data_flag to True in the XintSeismicDataRec instance and then perform an XtSetValues operation on the Seismic widget specifying the XintSeismicDataRec structure containing the changed data as the value of the XmNdataRec resource. This will signal the Seismic widget to redisplay the data.

Using the XintSeismicKeyRec Structure

You must create your own instance of the XintSeismicKeyRec structure and manage that data structure yourself. The Seismic widget uses your instance of the XintSeismicKeyRec structure when displaying and manipulating the seismic data. You specify that an instance of an XintSeismicKeyRec structure is to be used with a specific XintSeismicDataRec structure by setting a pointer in the XintSeismicDataRec instance to the instance of the XintSeismicKeyRec structure. When you make the changes in the XintSeismicDataRec instance, you must also make the corresponding changes in the XintSeismicKeyRec instance.

XintSeismicDataRec Structure

The XintSeismicDataRec structure contains the trace data to be displayed by the Seismic widget. An instance of this data structure must remain allocated as long as the Seismic widget needs to refer to it. The data type definition for the XintSeismicDataRec structure is as follows:

   typedef struct {
                   XtPointer data;
                   XintSeismicKeyRec *key_info;
                   int ntrace;
                   int nsample;
                   float starting_time;
                   float sample_rate;
                   int data_type;
                   Boolean new_data_flag;
                   int data_format;
   } XintSeismicDataRec;

where:

MemberDescription
dataAddress of two dimensional (ntrace rows and nsample columns) array containing the trace data.
key_infoPointer to a single dimensional array (ntrace elements) of keys associated with the traces.
ntraceThe number of traces in the data array.
nsampleThe number of samples in each trace.
starting_timeThe starting time in seconds of the trace data.
sample_rateThe sample rate in seconds (or feet or meters, etc.).
data_typeSpecifies the type of trace data specified as XintTIME_DATA or XintDEPTH_DATA.
new_data_flagIndicates whether the data array has changed and must be set to True or False before each call to XtSetValues.
data_formatSpecifies the format of the data in the data array using XintFLOAT_DATA_FORMAT, for single precision floating point data, XintBYTE_DATA_FORMAT for signed byte data, XintINT_DATA_FORMAT for signed 32 bit integer data, and Xint16BIT_DATA_FORMAT for 16 bit signed integer data


XintSeismicKeyRec Structure

The XintSeismicKeyRec structure contains the indices for the trace data being displayed by the Seismic widget. An array of these data structures must be allocated as long as the Seismic widget needs to refer to them. The data type definition for the XintSeismicKeyRec structure is as follows:

   typedef struct {
                   long user_data;
                   int pkey;
                   int skey;
                   float pakey;
                   float sakey;
   } XintSeismicKeyRec;

where

MemberDescription
user_dataOptional field used for application defined data associated with the trace.
pkeyPrimary key value.
skeySecondary key value.
pakeyPrimary annotation key value.
sakeySecondary annotation key value.

The keys pkey and skey can be used for selecting the traces. They will be used if resources XmNprimaryKeyName and XmNsecondaryKeyName are not NULL. If you need only one key for selecting the traces, set XmNprimaryKeyName to a non NULL value and XmNsecondaryKeyName to NULL, and assign a value to the pkey field of each trace in your dataset.

The keys pakey and sakey can be used to contain the values to display as annotation. As with the above mentioned pkey and skey, pakey and sakey need to be set only if resources XmNprimaryAnnotationName and XmNsecondaryAnnotationName are non NULL.