#include <Mdo.h>
Inheritance diagram for Mdo:

Definition at line 1050 of file Mdo.h.
Public Member Functions | |
| Mdo (void) | |
| ~Mdo (void) | |
| virtual bool | ReadData (FILE *inputFilePtr) |
| virtual bool | WriteData (FILE *outputFilePtr) |
| virtual bool | FileRetrieveData (H_BYTE *data, size_t *length, long *location, long direction=0) |
| bool | FileStoreData (H_BYTE *data, size_t *length, long *location, long direction) |
| void | ErrEnd (char *errMessage, long errorType=0) |
| void | CopyHeader (_mdo_header *newHeader) |
| void | SetDebug () |
| void | UnsetDebug () |
| long | GetNumberOfDimensions () |
| long | GetStorageWordLength () |
| float | GetMinScale () |
| float | GetMaxScale () |
| float | GetMaxAbs () |
| float | GetMinValue () |
| float | GetMaxValue () |
| char * | GetTitle () |
| MdoRetrieveInfo * | GetUserDataInfo () |
| virtual void | flush () |
| bool | retrieveLine (H_BYTE *data, size_t length, long *location, long direction) |
| bool | ReturnDebug (void) |
| void | PrintSerialNumber () |
| unsigned long | GetSerialNumber () |
| wxString | GetSerialNumberString () |
Protected Member Functions | |
| bool | DeleteHeader () |
| void | SetDimensions (long dimension, long *setCounts, long setStorageWordLength) |
| virtual bool | RetrieveData (H_BYTE *data, size_t *arrayLength, long *location, long direction=0) |
| virtual bool | StoreData (H_BYTE *data, size_t *length, long *location, long direction=0) |
Protected Attributes | |
| _mdo_header * | header |
| bool | byteSwap |
| bool | dimensionSet |
| long | typeOfStorage |
| long | numberOfStorageFiles |
| char ** | fileNames |
| H_BYTE * | memPtr |
| float | minScale |
| float | maxScale |
| bool | MDODEBUG |
| MdoRetrieveInfo * | userDataInfo |
Private Member Functions | |
| void | TransposePlane (H_BYTE *plane, long numberColumns, long numberRows) |
| void | CleanFileNames () |
| void | SetTitle (char *newTitle) |
| bool | ReadMdo (char *mdoInputFileName) |
| bool | WriteMdo (char *mdoOutputFileName) |
| void | Dump (char *dumpMessage="Mdo Dump") |
| void | Open () |
| void | Open (char *newFileName) |
| void | SetSampleRates (float *inputSampleRates) |
| void | SetAnnotationStart (float *inputAnnotationStart) |
| void | SetAnnotationEnd (float *inputAnnotationEnd) |
| void | SetAnnotationLabels (char inputAnnotationLabels[3][MAX_ANNOTATION_SIZE+1]) |
| void | SetScale (float inputMinScale, float inputMaxScale) |
| void | SetPlaneExtents (long index, long min, long max) |
| long | GetDimension (long dimension) |
| long | GetXDimension () |
| long | GetYDimension () |
| long | GetZDimension () |
| float | GetXAnnotationStart () |
| float | GetYAnnotationStart () |
| float | GetZAnnotationStart () |
| float | GetXAnnotationEnd () |
| float | GetYAnnotationEnd () |
| float | GetZAnnotationEnd () |
| char * | GetXAnnotationLabel () |
| char * | GetYAnnotationLabel () |
| char * | GetZAnnotationLabel () |
| bool | CopyMDO (MdoADT *newMDO) |
| void | StoreDataValue (long data, long *location, long dir) |
| void | StoreDataValue (float data, long *location, long dir) |
| void | StoreDataValue (H_BYTE data, long *location, long dir) |
| float | GetTrueMinValue () |
| float | GetTrueMaxValue () |
| void | SetTrueMinMaxValues (float minValue, float maxValue) |
| void | Save (FILE *fp) |
| long | Retrieve (FILE *fp) |
| void | SetUserDataInfo (MdoRetrieveInfo *inputStructure) |
| void | Flush () |
| void | FindLocation (size_t offset, long *location) |
| size_t | GetMdoMemorySize (long localStorage) |
| bool | RetrieveLine (H_BYTE *data, size_t length, long *location, long direction) |
| bool | RetrieveBytePlane (H_BYTE *retrievedPlane, long *planeStart, long *planeEnd, long transpose=FALSE) |
| bool | RetrievePlane (H_BYTE *retrievedPlane, long *planeStart, long *planeEnd, long transpose=FALSE) |
| long | GetD1 (long *planeStart, long *planeEnd) |
| long | GetD2 (long *planeStart, long *planeEnd) |
| void | StoreFetchedStride (long *inputFetchStride) |
| bool | SupplyRetrieveVector (MdoUserRetrieveVector suppliedUserVector) |
|
|
Default constructor
Definition at line 8 of file Mdo.cpp. References NclLog::Creation().
00009 {
00010 MyLog->Creation( "MDO", this );
00011 }
|
|
|
Default destructor
Definition at line 13 of file Mdo.cpp. References NclLog::Destruction().
00014 {
00015 MyLog->Destruction( "MDO", this );
00016 }
|
|
|
delete pointers associated with fileNames Reimplemented from MdoADT. |
|
|
This copies the header from the entered header structure This is a memcpy of one header to another.
Definition at line 576 of file Mdo.h.
00576 { memcpy ( header, newHeader, sizeof(header)); }
|
|
|
* Copies this MDO to another on this machine. In the following, location is a (nx, ny, nz, ...) location In order to (store,retrieve)Data() just call a *{Store,Retrieve}Data() member function that is appropriate to the internal storage type. *
Reimplemented from MdoADT. Definition at line 314 of file Mdo.cpp.
00315 {
00316 return false;
00317 }
|
|
|
Delete the Mdo Header.
|
|
|
Utility that prints out the various parameters of this mdo.
Reimplemented from MdoADT. Definition at line 100 of file Mdo.cpp.
00101 {
00102 }
|
|
||||||||||||
|
This is a utility that prints error messages. We use a default value of 1 to correspond to the nmeonic of several things can go wrong (1,2,3,...) but only one thing can go right (0). These errorType integers are passed to the exit call in the method.
|
|
||||||||||||||||||||
|
This retrieves an array of length length in an mdo file version. Location follows the mdo data location convention.
Reimplemented from MdoADT. Definition at line 548 of file Mdo.cpp.
00551 {
00552 return false;
00553 }
|
|
||||||||||||||||||||
|
This stores an array of length length in an mdo file version. Location follows the mdo data location convention.
Reimplemented from MdoADT. Definition at line 572 of file Mdo.cpp.
00574 {
00575 return false;
00576 }
|
|
||||||||||||
|
The inverse of findOffset. This will produce a location when given an offset. The resulting array must be freed by the user.
Implements MdoADT. Definition at line 560 of file Mdo.cpp.
00561 {
00562 }
|
|
|
Flushes mdo buffers if on disk Set the storage parameters for a specific typeOfStorage if typeOfStorage == singleFile, take a bunch of default values for block dimensions, cache size, etc. Allowable storageType's are: none, memory, singleFile, multipleFiles Of course, a storage type of none is not very productive. It will however, provide access to header and other non-data portions of the mdo. Definition at line 912 of file Mdo.h.
00912 {}
|
|
|
Flushes mdo buffers if on disk Set the storage parameters for a specific typeOfStorage if typeOfStorage == singleFile, take a bunch of default values for block dimensions, cache size, etc. Allowable storageType's are: none, memory, singleFile, multipleFiles Of course, a storage type of none is not very productive. It will however, provide access to header and other non-data portions of the mdo. Definition at line 444 of file Mdo.cpp.
00444 {}
|
|
||||||||||||
|
This method will find the first varying direction in the plane parallel to the axis that contains both the points planeStart and planeEnd.
Reimplemented from MdoADT. Definition at line 479 of file Mdo.cpp.
00480 {
00481 return (long)NULL;
00482 }
|
|
||||||||||||
|
This method will find the second varying direction in the plane parallel to the axis that contains both the points planeStart and planeEnd.
Reimplemented from MdoADT. Definition at line 493 of file Mdo.cpp.
00494 {
00495 return (long)NULL;
00496 }
|
|
|
Retrieve a sepcific number of samples in direction getDimension.
Reimplemented from MdoADT. Definition at line 187 of file Mdo.cpp.
00188 {
00189 return 0;
00190 }
|
|
|
These methods return various extrema of the mdo. These extrema are caculated during the data loading phase of the mdo. The above scaling methods only work with float, H_BYTE, and long types.
Definition at line 805 of file Mdo.h. References _mdo_header::maxAbs.
|
|
|
Gets the scale's used for conversion to H_BYTE data in retrieveBytePlane. Data retrieved as bytes are returned scaled by (maxScale-minScale). The origin of the H_BYTE data is set at (maxScale+minScale)/2.0
Definition at line 794 of file Mdo.h.
00794 { return maxScale;}
|
|
|
These methods return various extrema of the mdo. These extrema are caculated during the data loading phase of the mdo. The above scaling methods only work with float, H_BYTE, and long types.
Definition at line 825 of file Mdo.h. References _mdo_header::maxValue.
|
|
|
Returns the size of this mdo in bytes.
Implements MdoADT. Definition at line 451 of file Mdo.cpp.
00452 {
00453 return (size_t)NULL;
00454 }
|
|
|
Gets the scale's used for conversion to H_BYTE data in retrieveBytePlane. Data retrieved as bytes are returned scaled by (maxScale-minScale). The origin of the H_BYTE data is set at (maxScale+minScale)/2.0
Definition at line 787 of file Mdo.h.
00787 { return minScale;}
|
|
|
These methods return various extrema of the mdo. These extrema are caculated during the data loading phase of the mdo. The above scaling methods only work with float, H_BYTE, and long types.
Definition at line 815 of file Mdo.h. References _mdo_header::minValue.
|
|
|
Retrieve the number of dimensions (directions) in this mdo.
Definition at line 665 of file Mdo.h. References _mdo_header::dimension.
|
|
|
Return the serial number as an unsigned long.
Definition at line 82 of file NclBase.cpp. References NclBase::serialNumber.
00084 {
00085 return(serialNumber);
00086 }
|
|
|
Return the serial number as a wxString.
Definition at line 88 of file NclBase.cpp. References NclBase::serialNumber. Referenced by NclLog::Creation(), NclLog::Destruction(), and NclCanvas::OnDraw().
00090 {
00091 wxString rv;
00092 rv.Printf( "%d", serialNumber );
00093 return rv;
00094 }
|
|
|
Retrieve the number storage word length.
Definition at line 678 of file Mdo.h. References _mdo_header::storageWordLength.
00678 { return header->storageWordLength; } ;
|
|
|
Returns a pointer to the mdo title.
Definition at line 862 of file Mdo.h.
00862 { return title; }
|
|
|
These methods return various extrema of the mdo. These extrema are caculated during the data loading phase of the mdo. The above scaling methods only work with float, H_BYTE, and long types.
Reimplemented from MdoADT. Definition at line 372 of file Mdo.cpp.
00373 {
00374 return (float)NULL;
00375 }
|
|
|
The above scaling methods only work with float, H_BYTE, and long types.
Reimplemented from MdoADT. Definition at line 359 of file Mdo.cpp.
00360 {
00361 return (float)NULL;
00362 }
|
|
|
Gets the userDataInfo structure.
|
|
|
these three methods get the annotation value of the end sample for X,Y,Z
Reimplemented from MdoADT. Definition at line 252 of file Mdo.cpp.
00253 {
00254 return 0.0;
00255 }
|
|
|
these three methods get the annotation value of the end sample for X,Y,Z
Reimplemented from MdoADT. Definition at line 281 of file Mdo.cpp.
00282 {
00283 return NULL;
00284 }
|
|
|
these three methods get the annotation value of the start sample for X,Y,Z
Reimplemented from MdoADT. Definition at line 224 of file Mdo.cpp.
00225 {
00226 return 0.0;
00227 }
|
|
|
These three methods return the mdo deimensions in the first three directions.
Reimplemented from MdoADT. Definition at line 197 of file Mdo.cpp.
00198 {
00199 return 0;
00200 }
|
|
|
these three methods get the annotation value of the end sample for X,Y,Z
Reimplemented from MdoADT. Definition at line 261 of file Mdo.cpp.
00262 {
00263 return 0.0;
00264 }
|
|
|
these three methods get the annotation value of the end sample for X,Y,Z
Reimplemented from MdoADT. Definition at line 290 of file Mdo.cpp.
00291 {
00292 return NULL;
00293 }
|
|
|
these three methods get the annotation value of the start sample for X,Y,Z
Reimplemented from MdoADT. Definition at line 233 of file Mdo.cpp.
00234 {
00235 return 0.0;
00236 }
|
|
|
These three methods return the mdo deimensions in the first three directions.
Reimplemented from MdoADT. Definition at line 205 of file Mdo.cpp.
00206 {
00207 return 0;
00208 }
|
|
|
these three methods get the annotation value of the end sample for X,Y,Z
Reimplemented from MdoADT. Definition at line 270 of file Mdo.cpp.
00271 {
00272 return 0.0;
00273 }
|
|
|
these three methods get the annotation value of the end sample for X,Y,Z
Reimplemented from MdoADT. Definition at line 299 of file Mdo.cpp.
00300 {
00301 return NULL;
00302 }
|
|
|
these three methods get the annotation value of the start sample for X,Y,Z
Reimplemented from MdoADT. Definition at line 242 of file Mdo.cpp.
00243 {
00244 return 0.0;
00245 }
|
|
|
These three methods return the mdo deimensions in the first three directions.
Reimplemented from MdoADT. Definition at line 214 of file Mdo.cpp.
00215 {
00216 return (long)NULL;
00217 }
|
|
|
Open a single file temporary storage, using a file name.
Reimplemented from MdoADT. Definition at line 118 of file Mdo.cpp.
00119 {
00120 }
|
|
|
Open and allocate sotrage as memory, files, etc. Reimplemented from MdoADT. Definition at line 109 of file Mdo.cpp.
00110 {
00111 }
|
|
|
Print the serial number on cerr.
Definition at line 74 of file NclBase.cpp. References NclBase::myName, NclBase::ReturnDebug(), and NclBase::serialNumber.
00076 {
00077 if ( ReturnDebug() )
00078 cerr << "\n" << myName << "." << serialNumber << " Serial number ";
00079 }
|
|
|
Reads the data of an open file into the mdo.
Implements MdoADT. Definition at line 25 of file Mdo.cpp.
00026 {
00027 return true;
00028 }
|
|
|
Reads in the mdo from the given file pointer.
Reimplemented from MdoADT. Definition at line 79 of file Mdo.cpp.
00080 {
00081 return true;
00082 }
|
|
|
Retrieves member objects from a file. Currently, this objects Save and Retrieve methods will not work in conjunction with the other objects' Save an Retrieve methods. This object stores the binary data on the file pointed, and retireves the information by a file pointer. Other methods use a file pointer on Save, and a object pointer on Retrieve. Thus, the safest use of the mdo Save and Retrieve methods is in a separate file. In any event, most applications execute Save and Retrieve for the objects that build the mdo, without saving the mdo directly.
Reimplemented from MdoADT. Definition at line 417 of file Mdo.cpp.
00418 {
00419 return (long)NULL;
00420 }
|
|
||||||||||||||||||||
|
This method uses the members minScale, maxScale to scale the data and provide H_BYTE output in the user allocated array data. The plane retrieved is specified by two long's variedDimension1 and variedDimension2. which specify the directions of the plane spanned by data. If transpose == TRUE, we want the transpose of the plane returned. Otherwise, return the data in the natural ordering, i.e. the direction with the lower numerical value is contiguous in the plane. The default value of transpose is FALSE, i.e. use the natural ordering. retrievedPlane is a data cache used by private methods.
Reimplemented from MdoADT. |
|
||||||||||||||||||||
|
This will retrieve a data array of length arrayLength at location. ArrayLength is given in bytes. Location follows the mdo data location convention.
Definition at line 491 of file Mdo.h.
00493 {direction++;return( (bool) 0);}
|
|
||||||||||||||||||||
|
This allows retrieval of a datum by an array of "length" arrayLength, in bytes. That is the value "length" is the number of samples times header->storageWordLength.
Definition at line 938 of file Mdo.h.
00938 { return false;};
|
|
||||||||||||||||||||
|
This allows retrieval of a datum by an array of "length" arrayLength, in bytes. That is the value "length" is the number of samples times header->storageWordLength.
Definition at line 466 of file Mdo.cpp.
00467 {
00468 return false;
00469 }
|
|
||||||||||||||||||||
|
retrievePlane() calls {singleFile,memory}RetrievePlane() The plane retrieved is specified by two points in the plane, as provided by planeStart and planeEnd. If transpose == TRUE, we want the transpose of the plane returned. Otherwise, return the data in the natural ordering, i.e. the direction with the lower numerical value is contiguous in the plane. The default value of transpose is FALSE, i.e. use the natural ordering. retrievedPlane is a data cache used by private methods. {singleFile,memory}RetrievePlane() are called by retrievePlane()
|
|
|
Definition at line 61 of file NclBase.cpp. Referenced by NclBase::PrintSerialNumber().
00062 {
00063 return true;
00064 }
|
|
|
Saves the parameters to a binary file.
Reimplemented from MdoADT. Definition at line 396 of file Mdo.cpp.
00397 {
00398 }
|
|
|
Set the annotation value of the end sample
Reimplemented from MdoADT. Definition at line 145 of file Mdo.cpp.
00146 {
00147 }
|
|
|
Set the annotation value of the end sample
Reimplemented from MdoADT. Definition at line 154 of file Mdo.cpp.
00155 {
00156 }
|
|
|
Set the annotation value of the start sample
Reimplemented from MdoADT. Definition at line 136 of file Mdo.cpp.
00137 {
00138 }
|
|
|
Set any internal debug flags. Reimplemented from NclBase. Definition at line 601 of file Mdo.h.
00601 { MDODEBUG = (bool) TRUE;}
|
|
||||||||||||||||
|
This routine sets the information needed for setting the dimension informtion. There are dimension directions, and setCounts[0],...,setCounts[diemnsion] samples in each direction.
|
|
||||||||||||||||
|
Set the plane extraction extents
Reimplemented from MdoADT. Definition at line 176 of file Mdo.cpp.
00177 {
00178 }
|
|
|
Set the sample rates.
Reimplemented from MdoADT. Definition at line 127 of file Mdo.cpp.
00128 {
00129 }
|
|
||||||||||||
|
Sets the scale factors used for conversion to H_BYTE in retrieveBytePlane.
Reimplemented from MdoADT. Definition at line 165 of file Mdo.cpp.
00166 {
00167 }
|
|
|
Sets the title of this mdo.
Reimplemented from MdoADT. Definition at line 68 of file Mdo.cpp.
00069 {
00070 }
|
|
||||||||||||
|
These methods return various extrema of the mdo. These extrema are caculated during the data loading phase of the mdo. The above scaling methods only work with float, H_BYTE, and long types.
Reimplemented from MdoADT. Definition at line 387 of file Mdo.cpp.
00388 {
00389 }
|
|
|
Sets the userDataInfo structure.
Reimplemented from MdoADT. Definition at line 428 of file Mdo.cpp.
00429 {
00430 }
|
|
||||||||||||||||||||
|
This will store a data array of length length at location. Length is given in bytes. Location follows the mdo data location convention.
Definition at line 505 of file Mdo.h.
00507 {direction++;return( (bool) 0);}
|
|
||||||||||||||||
|
These three methods allow storage by type, i.e. long, float, or H_BYTE. The value stored is passed by reference, not pointer.
Reimplemented from MdoADT. Definition at line 349 of file Mdo.cpp.
00350 {
00351 }
|
|
||||||||||||||||
|
These three methods allow storage by type, i.e. long, float, or H_BYTE. The value stored is passed by reference, not pointer.
Reimplemented from MdoADT. Definition at line 338 of file Mdo.cpp.
00339 {
00340 }
|
|
||||||||||||||||
|
These three methods allow storage by type, i.e. long, float, or H_BYTE. The value stored is passed by reference, not pointer.
Reimplemented from MdoADT. Definition at line 327 of file Mdo.cpp.
00328 {
00329 }
|
|
|
This will store the stride used when using the mdo direct fetch. It is only used in MdoDirect.h. For other mdo's only data used in the mdo is stored it the mdo. In the direct case, the decision of which data to use, and which to skip is postponed until the time of retrieval.
Implements MdoADT. Definition at line 508 of file Mdo.cpp.
00509 {
00510 }
|
|
|
This method sets the internally required userRetrieveVector function for the MdoDirectADT object to that pointed to by suppliedUserVector. The function must match the following template: H_BYTE *suppliedUserVector( size_t offset, size_t length) where the offset is the offset in bytes of the requested vector if the data were stored in contiguous memory. The method findOffset of the mdo will correctly convert a location to an offset. The value of length is the length_in_bytes of the vector to be retrieved. By supplying this function pointer, the user provides the MdoDirectADT object the method that will be used to retrieve data.
Implements MdoADT. Definition at line 534 of file Mdo.cpp.
00535 {
00536 return false;
00537 }
|
|
||||||||||||||||
|
Reimplemented from MdoADT. Definition at line 59 of file Mdo.cpp.
00060 {
00061 }
|
|
|
These routines toggle the MDODEBUG flag. When set to the DEBUG mode, the mdo will conduct complex error checking on data storage and retrieval. Reimplemented from NclBase. Definition at line 608 of file Mdo.h.
00608 { MDODEBUG = (bool) FALSE;}
|
|
|
For the exchange format
Implements MdoADT. Definition at line 35 of file Mdo.cpp.
00036 {
00037 return true;
00038 }
|
|
|
This will write the mdo in a format that can be read back in later.
Reimplemented from MdoADT. Definition at line 90 of file Mdo.cpp.
00091 {
00092 return true;
00093 }
|
|
|
Was the data H_BYTE swapped on input? |
|
|
Has the dimension info been entered? |
|
|
The name(s) of the storage file(s). |
|
|
The header of the mdo. The size, extents, sampling rates, title, etc. are stored in this header. |
|
|
The maximum scale used for display. |
|
|
Used to flag DEBUG output at runtime. This may be set using the method setDebug(). This sets MDODEBUG to TRUE, and it remains until unsetDebug() is called. |
|
|
Pointer to memory for storage. If the storage type is none, this is a null. |
|
|
Ths minimum scale used for display. |
|
|
The number of file names in fileNames array. |
|
|
There are setStorageWordLength bytes stored at each location. Type is not set until other resources have been set. |
|
|
Provides a structure of information about the user format. |
1.3.1 using KingsTools