{-# LANGUAGE EmptyDataDecls, ExistentialQuantification,
  FlexibleContexts, FlexibleInstances, ForeignFunctionInterface,
  MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies,
  TypeSynonymInstances #-}
module GDAL.OGRCurve.Interface where
import Data.Word
import Data.Int
import Foreign.C
import Foreign.Ptr
import FFICXX.Runtime.Cast
import GDAL.OGRCurve.RawType
import GDAL.OGRPointIterator.RawType
import GDAL.OGRGeometry.Interface

class (IOGRGeometry a) => IOGRCurve a where
        getNumPoints :: () => a -> IO CInt
        
        getPointIterator :: () => a -> IO OGRPointIterator

upcastOGRCurve :: forall a . (FPtr a, IOGRCurve a) => a -> OGRCurve
upcastOGRCurve :: forall a. (FPtr a, IOGRCurve a) => a -> OGRCurve
upcastOGRCurve a
h
  = let fh :: Ptr (Raw a)
fh = a -> Ptr (Raw a)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr a
h
        Ptr RawOGRCurve
fh2 :: Ptr RawOGRCurve = Ptr (Raw a) -> Ptr RawOGRCurve
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw OGRCurve) -> OGRCurve
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw OGRCurve)
Ptr RawOGRCurve
fh2

downcastOGRCurve ::
                 forall a . (FPtr a, IOGRCurve a) => OGRCurve -> a
downcastOGRCurve :: forall a. (FPtr a, IOGRCurve a) => OGRCurve -> a
downcastOGRCurve OGRCurve
h
  = let fh :: Ptr (Raw OGRCurve)
fh = OGRCurve -> Ptr (Raw OGRCurve)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr OGRCurve
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawOGRCurve -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw OGRCurve)
Ptr RawOGRCurve
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2