; $Id: davedat2d__define.pro,v 1.5 2005/02/08 17:17:34 azuah Exp $
;###############################################################################
;
; CLASS NAME:
;   DaveDat2D
;
; PURPOSE:
;   This class encapsulates a DAVE formated dataset containing 2D
;   data.
;
; CATEGORY:
;   Data Browser
;
; SUPERCLASSES:
;   DaveDat
;
; PUBLIC METHODS:
;   Clone
;   Get
;   Print
;   Rebin
;   ResetData
;   Restore
;   Set
;   Transpose
;   XSpec
;
; AUTHOR:
;   Richard Tumanjong Azuah
;   NIST Center for Neutron Research
;   100 Bureau Drive, Gaithersburg, MD 20899
;   United States
;   azuah@nist.gov; (301) 9755604
;   Oct, 2002
;
; LICENSE:
;  The software in this file is written by an employee of 
;  National Institute of Standards and Technology 
;  as part of the DAVE software project.
;
;  The DAVE software package is not subject to copyright protection
;  and is in the public domain. It should be considered as an
;  experimental neutron scattering data reduction, visualization, and
;  analysis system. As such, the authors assume no responsibility
;  whatsoever for its use, and make no guarantees, expressed or
;  implied, about its quality, reliability, or any other
;  characteristic. The use of certain trade names or commercial
;  products does not imply any endorsement of a particular product,
;  nor does it imply that the named product is necessarily the best
;  product for the stated purpose. We would appreciate acknowledgment
;  if the DAVE software is used or if the code in this file is
;  included in another product.
;
;###############################################################################



;===============================================================================
; DaveDat2D::cleanup
;
; PURPOSE:
;   Cleanup method for objects of this class
;
; PARAMETERS:
;
; KEYWORDS:
;
pro DaveDat2D::cleanup

if (ptr_valid(self.yvPtr)) then ptr_free, self.yvPtr

; call the base class cleanup method
self->DaveDat::cleanup

end
;-------------------------------------------------------------------------------



;===============================================================================
; DaveDat2D::Init
;
; PURPOSE:
;   Initialization method for objects of this class
;
; PARAMETERS:
;
; KEYWORDS:
;   _EXTRA [in] - Allows keywords to be passed to the base class (see
;                 DaveDat::init).
;
; RETURN VALUE:
;     0 => failure 
;     1 => success.
;
function DaveDat2D::init,  _EXTRA=etc

retVal = 1

; call the base class init method
if (self->DaveDat::init(_EXTRA=etc) ne 1) then return, 0

; initialize remainder of class variables if keywords
; 'davePtr' or 'filename' were passed.
if (n_elements(etc) gt 0) then begin
    isTrue1 = where(tag_names(etc) eq 'DAVEPTR')
    isTrue2 = where(tag_names(etc) eq 'FILENAME')
    ;; use /skipbase to skip base class resetData() since it was
    ;; already performed in call to base class init().
    if ((isTrue1 ge 0) or (isTrue2 ge 0)) then retVal = self->resetData(/skipbase) 
endif

return, retVal

end
;-------------------------------------------------------------------------------



;===============================================================================
; DaveDat2D__define
;
; PURPOSE:
;   Class structure definition procedure
;
; PARAMETERS:
;
; KEYWORDS:
;
pro DaveDat2D__define

void = {DaveDat2D, $
        yvPtr:ptr_new(), $      ; secondary independent axis values (y-axis)
        yLabel:'', $            ; y-axis label eg 'Scattering angle'
        yType:'', $             ; y-axis type 'points' or 'hist'
        yUnits:'', $            ; y-axis units eg 'degrees'
        yDir:0b, $              ; 0=original y was increasing; 1=y was decreasing with index
        transposeFlag:0b, $     ; transpose state of data
        inherits DaveDat $      ; inherits from DaveDat class
       }

end
