# Copyright 2008 by Peter Moxhay and Wade Brainerd. # This file is part of Math. # # Math is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Math is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Math. If not, see . from objectarea import ObjectArea, Color from vector import Vector from shapeobject import ShapeObject from symbolobject import SymbolObject from linesegmentobject import LineSegmentObject import gtk, math, random class TestLesson(ObjectArea): """Empty lesson containing a variety of test objects to interact with.""" def __init__(self, activity): ObjectArea.__init__(self, activity) self.add_test_objects() def add_test_objects(self): SMALL_SQUARE_SHAPE = ( Vector(0, 0), Vector(200, 0), Vector(200, 200), Vector(0, 200) ) SQUARE_SHAPE = ( Vector(0, 0), Vector(250, 0), Vector(250, 250), Vector(0, 250) ) LARGE_SQUARE_SHAPE = ( Vector(0, 0), Vector(300, 0), Vector(300, 300), Vector(0, 300) ) TRIANGLE_SHAPE = ( Vector(0, 0), Vector(250, 0), Vector(0, -250) ) TRAPEZOID_SHAPE = ( Vector(0, 0), Vector(350, 0), Vector(150, -200), Vector(0, -200)) shape_object1 = ShapeObject(Color.BLUE, 'C', SQUARE_SHAPE, Vector(200, 200), 0) shape_object2 = ShapeObject(Color.RED, 'B', LARGE_SQUARE_SHAPE, Vector(550, 400), math.pi/4) self.add_shape_object(shape_object1) self.add_shape_object(shape_object2) #self.add_object(SymbolObject((100, 500), '<')) #self.add_object(SymbolObject((200, 500), '=')) #self.add_object(SymbolObject((300, 500), '>'))