1 {- 2 - Fulsom (The Solid Modeller, written in Haskell) 3 - 4 - Copyright 1990,1991,1992,1993 Duncan Sinclair 5 - 6 - Permissiom to use, copy, modify, and distribute this software for any 7 - purpose and without fee is hereby granted, provided that the above 8 - copyright notice and this permission notice appear in all copies, and 9 - that my name not be used in advertising or publicity pertaining to this 10 - software without specific, written prior permission. I makes no 11 - representations about the suitability of this software for any purpose. 12 - It is provided ``as is'' without express or implied warranty. 13 - 14 - Duncan Sinclair 1993. 15 - 16 - All major types declared here. 17 - 18 -} 19 20 module Types ( 21 FType,BI,Prim(..),Ops(..),Csg(..),CsgOut,Calc, 22 Color(..),R3,R1,Row,Arr,Oct(..),tuple,Quad(..),Vector,In 23 ) 24 where 25 26 import Interval 27 28 --------------------------------------------------------- 29 -- Csg 30 ---------------------------------------------------------- 31 32 type FType = Double 33 34 type BI = Interval FType 35 36 data Prim = Sphere FType FType FType FType 37 | Cube FType FType FType FType 38 | Plane FType FType FType FType 39 | X | Y | Z 40 deriving Show{-was:Text-} 41 42 data Ops = RotX FType 43 | RotY FType 44 | RotZ FType 45 | Scale FType FType FType 46 | Trans FType FType FType 47 deriving Show{-was:Text-} 48 49 data Csg = Object Prim 50 | Geom Csg Ops 51 | Func Calc 52 | Matrix Csg Arr 53 | Colour Color Csg 54 | Union Csg Csg 55 | Inter Csg Csg 56 | Sub Csg Csg 57 | Comp Csg 58 -- deriving Show{-was:Text-} 59 60 61 -- type CsgOut = (R1 BI,Csg,Color,Bool) 62 type CsgOut = (BI,Csg,Color,Bool) 63 64 type Calc = Color -> (R3 BI) -> CsgOut 65 66 ---------------------------------------------------------- 67 -- [KC]olor 68 ---------------------------------------------------------- 69 70 data Color = RGB FType FType FType 71 deriving Show{-was:Text-} 72 73 ---------------------------------------------------------- 74 -- Matrix 75 ---------------------------------------------------------- 76 77 type Row = (FType,FType,FType,FType) 78 type Arr = (Row,Row,Row) 79 80 -- type (Fractional a) => R3 a = (a,a,a) 81 -- type (Fractional a) => R1 a = a 82 83 type R3 a = (a,a,a) 84 -- type R1 a = a 85 type R1 a = (a,a) 86 87 ---------------------------------------------------------- 88 -- Oct 89 ---------------------------------------------------------- 90 91 data Oct = O_Full Color | O_Empty | O_Sub Color [Oct] 92 deriving Show{-was:Text-} 93 94 ---------------------------------------------------------- 95 -- Quad 96 ---------------------------------------------------------- 97 98 data Quad = Q_Empty | Q_Full Color 99 | Q_Sub Color [Quad] 100 | Q_NewXY FType FType FType 101 deriving Show{-was:Text-} 102 103 ---------------------------------------------------------- 104 -- Vector 105 ---------------------------------------------------------- 106 107 type Vector = (FType,FType,FType) 108 109 type In = Interval FType 110 111 ---------------------------------------------------------- 112 -- Copyright 113 ---------------------------------------------------------- 114 115 copyright () = "Copyright 1990,1991,1992,1993 Duncan Sinclair." 116 e_mail () = "sinclair@dcs.gla.ac.uk" 117 118 tuple = (copyright,e_mail) 119 120 ----------------------------------------------------------