Beispiel #1
0
    def move(self, measure, direction):
        [dx, dy, dz, _] = normalize(direction) @ rotate(self.angle)

        self.origin = (self.x + measure * dx, self.y + measure * dy,
                       self.z + measure * dz)

        __log__(landscape=str(self))
        __project__("landscape")
Beispiel #2
0
def register(shape):
    global ID_COUNTER
    ID_COUNTER += 1
    shape.id = ID_COUNTER

    global DISPLAY_FILE
    DISPLAY_FILE.append(shape)

    __log__(new_object=shape)
    __project__("display_file")
Beispiel #3
0
def delete(id):
    global DISPLAY_FILE

    i = 0
    while i < len(DISPLAY_FILE):
        if DISPLAY_FILE[i].id == id:
            DISPLAY_FILE.pop(i)
            break
        i += 1

    __log__(object_deleted=id)
    __project__("display_file")
Beispiel #4
0
    def zoom(self, measure, direction):
        self.scale *= 1 + measure / 100 * direction[2]

        __log__(landscape=str(self))
        __project__("landscape")
Beispiel #5
0
    def turn(self, measure, direction):
        self.angle += math.radians(measure * direction[0])
        self.angle %= math.radians(360)

        __log__(landscape=str(self))
        __project__("landscape")
Beispiel #6
0
def load(path):
    Loader().load(path)
    __log__(file_loaded=path)
    __project__("display_file")
Beispiel #7
0
def describe(id):
    __log__(object=get(id))