Rebuilds the scene based on the current settings.
        
        :param      start | <QDate>
                    end   | <QDate>

def rebuild(self):
        """
        Rebuilds the scene based on the current settings.
        
        :param      start | <QDate>
                    end   | <QDate>
        """
        gantt = self.ganttWidget()
        scale = gantt.timescale()
        rect = self.sceneRect()
        header = gantt.treeWidget().header()
        
        # define the rendering options
        options = {}
        options['start']         = gantt.dateStart()
        options['end']           = gantt.dateEnd()
        options['cell_width']    = gantt.cellWidth()
        options['cell_height']   = gantt.cellHeight()
        options['rect']          = rect
        options['height']        = rect.height()
        
        options['header_height'] = header.height()
        if not header.isVisible():
            options['header_height'] = 0
        
        opt = XGanttRenderOptions(**options)
        
        # rebuild the minute timescale
        if scale in (gantt.Timescale.Minute, gantt.Timescale.Hour):
            opt.start = gantt.dateTimeStart()
            opt.end = gantt.dateTimeEnd()
            
            self.rebuildHour(opt)
        
        # rebuild the day timescale
        elif scale == gantt.Timescale.Day:
            self.rebuildDay(opt)
        
        # rebuild the week timescale
        elif scale == gantt.Timescale.Week:
            self.rebuildWeek(opt)
        
        self.rebuildTiles()