MODULE; IMPORT Animate AS MGAnimate, GraphVBT, GraphVBTExtras, MG, MGPaintOp, MGV, PaintOp, VBT; REVEAL T = PublicT BRANDED OBJECT pntop: PaintOp.T; OVERRIDES init := Init; set := Set; get := Get; op := Op; animate := Animate; END; PROCEDURE PaintOpAnim Init (t: T; rgb: RGB): T = BEGIN t.pntop := MGPaintOp.New(rgb); RETURN t; END Init; PROCEDURESet (t: T; graph: GraphVBT.T; rgb: RGB) = BEGIN MGPaintOp.Set(VBT.ScreenTypeOf(graph), t.pntop, rgb); END Set; PROCEDUREGet (t: T): RGB = BEGIN RETURN MGPaintOp.Get(t.pntop); END Get; PROCEDUREOp (t: T): PaintOp.T = BEGIN RETURN t.pntop END Op; TYPE MyAnimation = MGAnimate.T OBJECT t : T; graph: GraphVBT.T; anim : Animation; OVERRIDES length := Length; doStep := DoStep; END; PROCEDURELength (<* UNUSED *> t : MyAnimation; <* UNUSED *> v : MG.V; <* UNUSED *> mg: MG.T ): INTEGER = BEGIN RETURN 30; END Length; PROCEDUREDoStep ( self : MyAnimation; time : REAL; <* UNUSED *> timePrev: REAL; <* UNUSED *> v : MG.V; <* UNUSED *> mg : MG.T ) = BEGIN self.t.set(self.graph, self.anim.rgb(time)); END DoStep; PROCEDUREAnimate (t: T; graph: GraphVBT.T; animation: Animation) = BEGIN MGV.AddAnimationLocked( GraphVBTExtras.GetMG(graph), NEW(MyAnimation, t := t, graph := graph, anim := animation).init(), NIL); END Animate; BEGIN END PaintOpAnim.