{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Types (DisplayableObject(..), DisplayableObjects(..), Model, model, Triangle(..), triangle, Point(..), point) where -- IMPORTS -- import qualified Graphics.Rendering.OpenGL as GL import Relude -- TYPES -- -- io -- type DisplayableObjects = [DisplayableObject] data DisplayableObject = DisplayableObject GL.VertexArrayObject GL.NumArrayIndices GL.NumComponents GL.PrimitiveMode -- model -- data Model = Model { counter :: Integer } -- absolute objects data AbsoluteObject = AbsoluteObject [AbsoluteObject] | AbsolutePoint Point | PinnedRelativeObject Point RelativeObject data Point = Point { x :: Float , y :: Float , z :: Float , k :: Float } data Line = Line Point Point data Triangle = Triangle Point Point Point -- relative objects data RelativeObject = RelativeObject [RelativeObject] | RelativeHVolume HVolume | RelativeVolume Volume | RelativeSurface Surface data HVolume = HSphere Float | HPrism Float Volume data Volume = Sphere Float | Prism Float Surface data Surface = Circle Float | Square Float -- CONSTRUCTORS -- model :: Model model = Model { counter = 0 } -- absolutes point :: Point point = Point { x = 0 , y = 0 , z = 0 , k = 0 } origin :: Point origin = point line :: Line line = Line point point triangle :: Triangle triangle = Triangle point point point -- relatives hSphere :: HVolume hSphere = HSphere 1 hPrism :: HVolume hPrism = HPrism 1 prism -- Volumes sphere :: Volume sphere = Sphere 1 prism :: Volume prism = Prism 1 square circle :: Surface circle = Circle 1 square :: Surface square = Square 1