MODULE*************************************************************************** Convenience Procedures ***************************************************************************CameraGO EXPORTSCameraGO ,CameraGOPrivate ; IMPORT GO, GOPrivate, Point3, PointProp, PointPropPrivate, RealProp, RealPropPrivate; REVEAL T = Private BRANDED OBJECT OVERRIDES init := Init; needsTransparency := NeedsTransparency; END; PROCEDUREInit (self : T) : T = BEGIN EVAL GO.T.init (self); self.flag := FALSE; RETURN self; END Init; PROCEDURENeedsTransparency (<* UNUSED *> self : T; <* UNUSED *> t : REAL) : BOOLEAN = BEGIN RETURN FALSE; END NeedsTransparency;
PROCEDURE*************************************************************************** Module body ***************************************************************************SetFrom (o : GO.T; p: Point3.T) = BEGIN o.setProp(From.bind(PointProp.NewConst(p))); END SetFrom; PROCEDURESetTo (o : GO.T; p: Point3.T) = BEGIN o.setProp(To.bind(PointProp.NewConst(p))); END SetTo; PROCEDURESetUp (o : GO.T; p: Point3.T) = BEGIN o.setProp(Up.bind(PointProp.NewConst(p))); END SetUp; PROCEDURESetAspect (o : GO.T; r: REAL) = BEGIN o.setProp(Aspect.bind(RealProp.NewConst(r))); END SetAspect;
BEGIN From := NEW (PointProp.Name).init (Point3.T {0.0, 0.0, 100.0}); To := NEW (PointProp.Name).init (Point3.Origin); Up := NEW (PointProp.Name).init (Point3.T {0.0, 1.0, 0.0}); Aspect := NEW (RealProp.Name).init (1.0); END CameraGO.