1 2 module Prog(prog) where 3 4 5 -- Program module - defines the program expression 6 7 import Interface (modeller) 8 import Init (initialiseMouse,initialiseScreen) 9 import Interpret (Command,interpret, Operation(..), Operations(..)) 10 import Input (operationsBatch) 11 import BSPT (BSPT,Point,buildBSPT) 12 import Euclid (Face, Faces(..)) 13 14 15 16 -- Main program ----------------------------- 17 18 -- prog - initialises the Geometric Modeller System 19 -- with an initial (null) object and with 20 -- interpretation (lazy) of users requirements. 21 -- 22 -- Operations can be predefined in the file 23 -- Input.hs, with the modeller being supplied 24 -- batchOperations (as opposed to operations) 25 -- as the second argument. 26 27 prog :: String -> String 28 prog rawinp = 29 initialise ++ modeller (buildBSPT []) operations 30 where 31 initialise = initialiseMouse ++ initialiseScreen 32 lined@(head:rest) = lines rawinp 33 operations = 34 if (head=="batch") then operationsBatch else interpret lined 35