{-# LANGUAGE ForeignFunctionInterface, TypeFamilies, MultiParamTypeClasses, 
             FlexibleInstances, TypeSynonymInstances, EmptyDataDecls, 
             OverlappingInstances, IncoherentInstances #-}

module HROOT.Hist.TH3D.Implementation where


import FFICXX.Runtime.Cast

import HROOT.Hist.TH3D.RawType
import HROOT.Hist.TH3D.FFI
import HROOT.Hist.TH3D.Interface
import HROOT.Hist.TH3D.Cast
import HROOT.Hist.TH1D.RawType
import HROOT.Hist.TH1D.Cast
import HROOT.Hist.TH1D.Interface
import HROOT.Hist.TF1.RawType
import HROOT.Hist.TF1.Cast
import HROOT.Hist.TF1.Interface
import HROOT.Core.TDirectory.RawType
import HROOT.Core.TDirectory.Cast
import HROOT.Core.TDirectory.Interface
import HROOT.Hist.TAxis.RawType
import HROOT.Hist.TAxis.Cast
import HROOT.Hist.TAxis.Interface
import HROOT.Core.TClass.RawType
import HROOT.Core.TClass.Cast
import HROOT.Core.TClass.Interface
import HROOT.Hist.TH3.RawType
import HROOT.Hist.TH3.Cast
import HROOT.Hist.TH3.Interface
import HROOT.Core.TArrayD.RawType
import HROOT.Core.TArrayD.Cast
import HROOT.Core.TArrayD.Interface
import HROOT.Hist.TH1.RawType
import HROOT.Hist.TH1.Cast
import HROOT.Hist.TH1.Interface
import HROOT.Core.TAtt3D.RawType
import HROOT.Core.TAtt3D.Cast
import HROOT.Core.TAtt3D.Interface
import HROOT.Core.TObject.RawType
import HROOT.Core.TObject.Cast
import HROOT.Core.TObject.Interface
import HROOT.Core.TAttLine.RawType
import HROOT.Core.TAttLine.Cast
import HROOT.Core.TAttLine.Interface
import HROOT.Core.TAttFill.RawType
import HROOT.Core.TAttFill.Cast
import HROOT.Core.TAttFill.Interface
import HROOT.Core.TAttMarker.RawType
import HROOT.Core.TAttMarker.Cast
import HROOT.Core.TAttMarker.Interface
import HROOT.Core.Deletable.RawType
import HROOT.Core.Deletable.Cast
import HROOT.Core.Deletable.Interface
import HROOT.Core.TArray.RawType
import HROOT.Core.TArray.Cast
import HROOT.Core.TArray.Interface

import Data.Word
import Foreign.C
import Foreign.Ptr 
import Foreign.ForeignPtr

import System.IO.Unsafe


instance ITH3D TH3D where
instance ITH3 TH3D where
  fill3 = xform3 c_th3d_fill3
  fill3w = xform4 c_th3d_fill3w
  fitSlicesZ = xform7 c_th3d_fitslicesz
  getCorrelationFactor3 = xform2 c_th3d_getcorrelationfactor3
  getCovariance3 = xform2 c_th3d_getcovariance3
  rebinX3 = xform2 c_th3d_rebinx3
  rebinY3 = xform2 c_th3d_rebiny3
  rebinZ3 = xform2 c_th3d_rebinz3
  rebin3D = xform4 c_th3d_rebin3d
instance ITArrayD TH3D where
instance ITH1 TH3D where
  add = xform2 c_th3d_add
  addBinContent = xform2 c_th3d_addbincontent
  chi2Test = xform3 c_th3d_chi2test
  computeIntegral = xform0 c_th3d_computeintegral
  directoryAutoAdd = xform1 c_th3d_directoryautoadd
  divide = xform5 c_th3d_divide
  drawCopyTH1 = xform1 c_th3d_drawcopyth1
  drawNormalized = xform2 c_th3d_drawnormalized
  drawPanelTH1 = xform0 c_th3d_drawpanelth1
  bufferEmpty = xform1 c_th3d_bufferempty
  evalF = xform2 c_th3d_evalf
  fFT = xform2 c_th3d_fft
  fill1 = xform1 c_th3d_fill1
  fill1w = xform2 c_th3d_fill1w
  fillN1 = xform4 c_th3d_filln1
  fillRandom = xform2 c_th3d_fillrandom
  findBin = xform3 c_th3d_findbin
  findFixBin = xform3 c_th3d_findfixbin
  findFirstBinAbove = xform2 c_th3d_findfirstbinabove
  findLastBinAbove = xform2 c_th3d_findlastbinabove
  fitPanelTH1 = xform0 c_th3d_fitpanelth1
  getNdivisionA = xform1 c_th3d_getndivisiona
  getAxisColorA = xform1 c_th3d_getaxiscolora
  getLabelColorA = xform1 c_th3d_getlabelcolora
  getLabelFontA = xform1 c_th3d_getlabelfonta
  getLabelOffsetA = xform1 c_th3d_getlabeloffseta
  getLabelSizeA = xform1 c_th3d_getlabelsizea
  getTitleFontA = xform1 c_th3d_gettitlefonta
  getTitleOffsetA = xform1 c_th3d_gettitleoffseta
  getTitleSizeA = xform1 c_th3d_gettitlesizea
  getTickLengthA = xform1 c_th3d_getticklengtha
  getBarOffset = xform0 c_th3d_getbaroffset
  getBarWidth = xform0 c_th3d_getbarwidth
  getContour = xform1 c_th3d_getcontour
  getContourLevel = xform1 c_th3d_getcontourlevel
  getContourLevelPad = xform1 c_th3d_getcontourlevelpad
  getBin = xform3 c_th3d_getbin
  getBinCenter = xform1 c_th3d_getbincenter
  getBinContent1 = xform1 c_th3d_getbincontent1
  getBinContent2 = xform2 c_th3d_getbincontent2
  getBinContent3 = xform3 c_th3d_getbincontent3
  getBinError1 = xform1 c_th3d_getbinerror1
  getBinError2 = xform2 c_th3d_getbinerror2
  getBinError3 = xform3 c_th3d_getbinerror3
  getBinLowEdge = xform1 c_th3d_getbinlowedge
  getBinWidth = xform1 c_th3d_getbinwidth
  getCellContent = xform2 c_th3d_getcellcontent
  getCellError = xform2 c_th3d_getcellerror
  getEntries = xform0 c_th3d_getentries
  getEffectiveEntries = xform0 c_th3d_geteffectiveentries
  getFunction = xform1 c_th3d_getfunction
  getDimension = xform0 c_th3d_getdimension
  getKurtosis = xform1 c_th3d_getkurtosis
  getLowEdge = xform1 c_th3d_getlowedge
  getMaximumTH1 = xform1 c_th3d_getmaximumth1
  getMaximumBin = xform0 c_th3d_getmaximumbin
  getMaximumStored = xform0 c_th3d_getmaximumstored
  getMinimumTH1 = xform1 c_th3d_getminimumth1
  getMinimumBin = xform0 c_th3d_getminimumbin
  getMinimumStored = xform0 c_th3d_getminimumstored
  getMean = xform1 c_th3d_getmean
  getMeanError = xform1 c_th3d_getmeanerror
  getNbinsX = xform0 c_th3d_getnbinsx
  getNbinsY = xform0 c_th3d_getnbinsy
  getNbinsZ = xform0 c_th3d_getnbinsz
  getQuantilesTH1 = xform3 c_th3d_getquantilesth1
  getRandom = xform0 c_th3d_getrandom
  getStats = xform1 c_th3d_getstats
  getSumOfWeights = xform0 c_th3d_getsumofweights
  getSumw2 = xform0 c_th3d_getsumw2
  getSumw2N = xform0 c_th3d_getsumw2n
  getRMS = xform1 c_th3d_getrms
  getRMSError = xform1 c_th3d_getrmserror
  getSkewness = xform1 c_th3d_getskewness
  integral1 = xform3 c_th3d_integral1
  interpolate1 = xform1 c_th3d_interpolate1
  interpolate2 = xform2 c_th3d_interpolate2
  interpolate3 = xform3 c_th3d_interpolate3
  kolmogorovTest = xform2 c_th3d_kolmogorovtest
  labelsDeflate = xform1 c_th3d_labelsdeflate
  labelsInflate = xform1 c_th3d_labelsinflate
  labelsOption = xform2 c_th3d_labelsoption
  multiflyF = xform2 c_th3d_multiflyf
  multiply = xform5 c_th3d_multiply
  putStats = xform1 c_th3d_putstats
  rebin = xform3 c_th3d_rebin
  rebinAxis = xform2 c_th3d_rebinaxis
  rebuild = xform1 c_th3d_rebuild
  recursiveRemove = xform1 c_th3d_recursiveremove
  reset = xform1 c_th3d_reset
  resetStats = xform0 c_th3d_resetstats
  scale = xform2 c_th3d_scale
  setAxisColorA = xform2 c_th3d_setaxiscolora
  setAxisRange = xform3 c_th3d_setaxisrange
  setBarOffset = xform1 c_th3d_setbaroffset
  setBarWidth = xform1 c_th3d_setbarwidth
  setBinContent1 = xform2 c_th3d_setbincontent1
  setBinContent2 = xform3 c_th3d_setbincontent2
  setBinContent3 = xform4 c_th3d_setbincontent3
  setBinError1 = xform2 c_th3d_setbinerror1
  setBinError2 = xform3 c_th3d_setbinerror2
  setBinError3 = xform4 c_th3d_setbinerror3
  setBins1 = xform2 c_th3d_setbins1
  setBins2 = xform4 c_th3d_setbins2
  setBins3 = xform6 c_th3d_setbins3
  setBinsLength = xform1 c_th3d_setbinslength
  setBuffer = xform2 c_th3d_setbuffer
  setCellContent = xform3 c_th3d_setcellcontent
  setContent = xform1 c_th3d_setcontent
  setContour = xform2 c_th3d_setcontour
  setContourLevel = xform2 c_th3d_setcontourlevel
  setDirectory = xform1 c_th3d_setdirectory
  setEntries = xform1 c_th3d_setentries
  setError = xform1 c_th3d_seterror
  setLabelColorA = xform2 c_th3d_setlabelcolora
  setLabelSizeA = xform2 c_th3d_setlabelsizea
  setLabelFontA = xform2 c_th3d_setlabelfonta
  setLabelOffsetA = xform2 c_th3d_setlabeloffseta
  setMaximum = xform1 c_th3d_setmaximum
  setMinimum = xform1 c_th3d_setminimum
  setNormFactor = xform1 c_th3d_setnormfactor
  setStats = xform1 c_th3d_setstats
  setOption = xform1 c_th3d_setoption
  setXTitle = xform1 c_th3d_setxtitle
  setYTitle = xform1 c_th3d_setytitle
  setZTitle = xform1 c_th3d_setztitle
  showBackground = xform2 c_th3d_showbackground
  showPeaks = xform3 c_th3d_showpeaks
  smooth = xform2 c_th3d_smooth
  sumw2 = xform0 c_th3d_sumw2
instance ITAtt3D TH3D where
instance ITObject TH3D where
  draw = xform1 c_th3d_draw
  findObject = xform1 c_th3d_findobject
  getName = xform0 c_th3d_getname
  isA = xform0 c_th3d_isa
  paint = xform1 c_th3d_paint
  printObj = xform1 c_th3d_printobj
  saveAs = xform2 c_th3d_saveas
  write = xform3 c_th3d_write
instance ITAttLine TH3D where
  getLineColor = xform0 c_th3d_getlinecolor
  getLineStyle = xform0 c_th3d_getlinestyle
  getLineWidth = xform0 c_th3d_getlinewidth
  resetAttLine = xform1 c_th3d_resetattline
  setLineAttributes = xform0 c_th3d_setlineattributes
  setLineColor = xform1 c_th3d_setlinecolor
  setLineStyle = xform1 c_th3d_setlinestyle
  setLineWidth = xform1 c_th3d_setlinewidth
instance ITAttFill TH3D where
  setFillColor = xform1 c_th3d_setfillcolor
  setFillStyle = xform1 c_th3d_setfillstyle
instance ITAttMarker TH3D where
  getMarkerColor = xform0 c_th3d_getmarkercolor
  getMarkerStyle = xform0 c_th3d_getmarkerstyle
  getMarkerSize = xform0 c_th3d_getmarkersize
  resetAttMarker = xform1 c_th3d_resetattmarker
  setMarkerAttributes = xform0 c_th3d_setmarkerattributes
  setMarkerColor = xform1 c_th3d_setmarkercolor
  setMarkerStyle = xform1 c_th3d_setmarkerstyle
  setMarkerSize = xform1 c_th3d_setmarkersize
instance IDeletable TH3D where
  delete = xform0 c_th3d_delete
instance ITArray TH3D where

instance ITH3D (Exist TH3D) where

instance ITH3 (Exist TH3D) where
  fill3 (ETH3D x) = fill3 x
  fill3w (ETH3D x) = fill3w x
  fitSlicesZ (ETH3D x) = fitSlicesZ x
  getCorrelationFactor3 (ETH3D x) = getCorrelationFactor3 x
  getCovariance3 (ETH3D x) = getCovariance3 x
  rebinX3 (ETH3D x) = rebinX3 x
  rebinY3 (ETH3D x) = rebinY3 x
  rebinZ3 (ETH3D x) = rebinZ3 x
  rebin3D (ETH3D x) = rebin3D x
instance ITArrayD (Exist TH3D) where

instance ITH1 (Exist TH3D) where
  add (ETH3D x) = add x
  addBinContent (ETH3D x) = addBinContent x
  chi2Test (ETH3D x) = chi2Test x
  computeIntegral (ETH3D x) = computeIntegral x
  directoryAutoAdd (ETH3D x) = directoryAutoAdd x
  divide (ETH3D x) = divide x
  drawCopyTH1 (ETH3D x) a1 = return . ETH3D =<< drawCopyTH1 x a1
  drawNormalized (ETH3D x) = drawNormalized x
  drawPanelTH1 (ETH3D x) = drawPanelTH1 x
  bufferEmpty (ETH3D x) = bufferEmpty x
  evalF (ETH3D x) = evalF x
  fFT (ETH3D x) = fFT x
  fill1 (ETH3D x) = fill1 x
  fill1w (ETH3D x) = fill1w x
  fillN1 (ETH3D x) = fillN1 x
  fillRandom (ETH3D x) = fillRandom x
  findBin (ETH3D x) = findBin x
  findFixBin (ETH3D x) = findFixBin x
  findFirstBinAbove (ETH3D x) = findFirstBinAbove x
  findLastBinAbove (ETH3D x) = findLastBinAbove x
  fitPanelTH1 (ETH3D x) = fitPanelTH1 x
  getNdivisionA (ETH3D x) = getNdivisionA x
  getAxisColorA (ETH3D x) = getAxisColorA x
  getLabelColorA (ETH3D x) = getLabelColorA x
  getLabelFontA (ETH3D x) = getLabelFontA x
  getLabelOffsetA (ETH3D x) = getLabelOffsetA x
  getLabelSizeA (ETH3D x) = getLabelSizeA x
  getTitleFontA (ETH3D x) = getTitleFontA x
  getTitleOffsetA (ETH3D x) = getTitleOffsetA x
  getTitleSizeA (ETH3D x) = getTitleSizeA x
  getTickLengthA (ETH3D x) = getTickLengthA x
  getBarOffset (ETH3D x) = getBarOffset x
  getBarWidth (ETH3D x) = getBarWidth x
  getContour (ETH3D x) = getContour x
  getContourLevel (ETH3D x) = getContourLevel x
  getContourLevelPad (ETH3D x) = getContourLevelPad x
  getBin (ETH3D x) = getBin x
  getBinCenter (ETH3D x) = getBinCenter x
  getBinContent1 (ETH3D x) = getBinContent1 x
  getBinContent2 (ETH3D x) = getBinContent2 x
  getBinContent3 (ETH3D x) = getBinContent3 x
  getBinError1 (ETH3D x) = getBinError1 x
  getBinError2 (ETH3D x) = getBinError2 x
  getBinError3 (ETH3D x) = getBinError3 x
  getBinLowEdge (ETH3D x) = getBinLowEdge x
  getBinWidth (ETH3D x) = getBinWidth x
  getCellContent (ETH3D x) = getCellContent x
  getCellError (ETH3D x) = getCellError x
  getEntries (ETH3D x) = getEntries x
  getEffectiveEntries (ETH3D x) = getEffectiveEntries x
  getFunction (ETH3D x) = getFunction x
  getDimension (ETH3D x) = getDimension x
  getKurtosis (ETH3D x) = getKurtosis x
  getLowEdge (ETH3D x) = getLowEdge x
  getMaximumTH1 (ETH3D x) = getMaximumTH1 x
  getMaximumBin (ETH3D x) = getMaximumBin x
  getMaximumStored (ETH3D x) = getMaximumStored x
  getMinimumTH1 (ETH3D x) = getMinimumTH1 x
  getMinimumBin (ETH3D x) = getMinimumBin x
  getMinimumStored (ETH3D x) = getMinimumStored x
  getMean (ETH3D x) = getMean x
  getMeanError (ETH3D x) = getMeanError x
  getNbinsX (ETH3D x) = getNbinsX x
  getNbinsY (ETH3D x) = getNbinsY x
  getNbinsZ (ETH3D x) = getNbinsZ x
  getQuantilesTH1 (ETH3D x) = getQuantilesTH1 x
  getRandom (ETH3D x) = getRandom x
  getStats (ETH3D x) = getStats x
  getSumOfWeights (ETH3D x) = getSumOfWeights x
  getSumw2 (ETH3D x) = getSumw2 x
  getSumw2N (ETH3D x) = getSumw2N x
  getRMS (ETH3D x) = getRMS x
  getRMSError (ETH3D x) = getRMSError x
  getSkewness (ETH3D x) = getSkewness x
  integral1 (ETH3D x) = integral1 x
  interpolate1 (ETH3D x) = interpolate1 x
  interpolate2 (ETH3D x) = interpolate2 x
  interpolate3 (ETH3D x) = interpolate3 x
  kolmogorovTest (ETH3D x) = kolmogorovTest x
  labelsDeflate (ETH3D x) = labelsDeflate x
  labelsInflate (ETH3D x) = labelsInflate x
  labelsOption (ETH3D x) = labelsOption x
  multiflyF (ETH3D x) = multiflyF x
  multiply (ETH3D x) = multiply x
  putStats (ETH3D x) = putStats x
  rebin (ETH3D x) = rebin x
  rebinAxis (ETH3D x) = rebinAxis x
  rebuild (ETH3D x) = rebuild x
  recursiveRemove (ETH3D x) = recursiveRemove x
  reset (ETH3D x) = reset x
  resetStats (ETH3D x) = resetStats x
  scale (ETH3D x) = scale x
  setAxisColorA (ETH3D x) = setAxisColorA x
  setAxisRange (ETH3D x) = setAxisRange x
  setBarOffset (ETH3D x) = setBarOffset x
  setBarWidth (ETH3D x) = setBarWidth x
  setBinContent1 (ETH3D x) = setBinContent1 x
  setBinContent2 (ETH3D x) = setBinContent2 x
  setBinContent3 (ETH3D x) = setBinContent3 x
  setBinError1 (ETH3D x) = setBinError1 x
  setBinError2 (ETH3D x) = setBinError2 x
  setBinError3 (ETH3D x) = setBinError3 x
  setBins1 (ETH3D x) = setBins1 x
  setBins2 (ETH3D x) = setBins2 x
  setBins3 (ETH3D x) = setBins3 x
  setBinsLength (ETH3D x) = setBinsLength x
  setBuffer (ETH3D x) = setBuffer x
  setCellContent (ETH3D x) = setCellContent x
  setContent (ETH3D x) = setContent x
  setContour (ETH3D x) = setContour x
  setContourLevel (ETH3D x) = setContourLevel x
  setDirectory (ETH3D x) = setDirectory x
  setEntries (ETH3D x) = setEntries x
  setError (ETH3D x) = setError x
  setLabelColorA (ETH3D x) = setLabelColorA x
  setLabelSizeA (ETH3D x) = setLabelSizeA x
  setLabelFontA (ETH3D x) = setLabelFontA x
  setLabelOffsetA (ETH3D x) = setLabelOffsetA x
  setMaximum (ETH3D x) = setMaximum x
  setMinimum (ETH3D x) = setMinimum x
  setNormFactor (ETH3D x) = setNormFactor x
  setStats (ETH3D x) = setStats x
  setOption (ETH3D x) = setOption x
  setXTitle (ETH3D x) = setXTitle x
  setYTitle (ETH3D x) = setYTitle x
  setZTitle (ETH3D x) = setZTitle x
  showBackground (ETH3D x) = showBackground x
  showPeaks (ETH3D x) = showPeaks x
  smooth (ETH3D x) = smooth x
  sumw2 (ETH3D x) = sumw2 x
instance ITAtt3D (Exist TH3D) where

instance ITObject (Exist TH3D) where
  draw (ETH3D x) = draw x
  findObject (ETH3D x) = findObject x
  getName (ETH3D x) = getName x
  isA (ETH3D x) = isA x
  paint (ETH3D x) = paint x
  printObj (ETH3D x) = printObj x
  saveAs (ETH3D x) = saveAs x
  write (ETH3D x) = write x
instance ITAttLine (Exist TH3D) where
  getLineColor (ETH3D x) = getLineColor x
  getLineStyle (ETH3D x) = getLineStyle x
  getLineWidth (ETH3D x) = getLineWidth x
  resetAttLine (ETH3D x) = resetAttLine x
  setLineAttributes (ETH3D x) = setLineAttributes x
  setLineColor (ETH3D x) = setLineColor x
  setLineStyle (ETH3D x) = setLineStyle x
  setLineWidth (ETH3D x) = setLineWidth x
instance ITAttFill (Exist TH3D) where
  setFillColor (ETH3D x) = setFillColor x
  setFillStyle (ETH3D x) = setFillStyle x
instance ITAttMarker (Exist TH3D) where
  getMarkerColor (ETH3D x) = getMarkerColor x
  getMarkerStyle (ETH3D x) = getMarkerStyle x
  getMarkerSize (ETH3D x) = getMarkerSize x
  resetAttMarker (ETH3D x) = resetAttMarker x
  setMarkerAttributes (ETH3D x) = setMarkerAttributes x
  setMarkerColor (ETH3D x) = setMarkerColor x
  setMarkerStyle (ETH3D x) = setMarkerStyle x
  setMarkerSize (ETH3D x) = setMarkerSize x
instance IDeletable (Exist TH3D) where
  delete (ETH3D x) = delete x
instance ITArray (Exist TH3D) where








instance FPtr (Exist TH3D) where
  type Raw (Exist TH3D) = RawTH3D
  get_fptr (ETH3D obj) = castForeignPtr (get_fptr obj)
  cast_fptr_to_obj fptr = ETH3D (cast_fptr_to_obj (fptr :: ForeignPtr RawTH3D) :: TH3D)