示例#1
0
    def OnCalculate(self, event):
        global current_date

        str_day = self.tc_date_dd.GetValue()
        str_month = self.tc_date_mm.GetValue()
        str_year = self.tc_date_yy.GetValue()

        if not (str_day and str_month and str_year):
            return

        self.lc.DeleteAllItems()

        day = int(str_day)
        month = int(str_month)
        year = int(str_year)

        current_date = datetime(year, month, day, hour=0, minute=0, second=0)

        import universe

        universe.processFrame()

        num_row = 0
        for planet in universe.planets:
            if draw_planets[planet.name]:
                self.lc.InsertStringItem(num_row, planet.name)
                info_list = planet.getInfo()

                num_col = 0
                for info in info_list:
                    self.lc.SetStringItem(num_row, num_col, info)
                    num_col += 1

                num_row += 1
示例#2
0
    def draw(self):
        glClearColor(0.1,0.1,0.1, 1.0)
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)

        self.fixViewportProjection()
        self.fixCamera()

        #self.drawAxes()
        #self.drawGrid()

        self.objects = universe.processFrame(self.vel)

        # Draw all scene elements
        for element in self.objects:
            element.draw()

        glutSwapBuffers()