auto_bus/include/mainScene.h
jackfiled 35569b093d 将PosPair类独立出来
添加了公交车显示类
2022-06-28 11:10:49 +08:00

66 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// Created by ricardo on 2022/6/11.
//
#ifndef AUTO_BUS_GUI_MAIN_SCENE_H
#define AUTO_BUS_GUI_MAIN_SCENE_H
#include "QGraphicsScene"
#include "QGraphicsPixmapItem"
#include "PosPair.h"
#include "BusWidget.h"
class SceneManager
{
public:
QGraphicsScene *scene;
/**
* 构造函数,同时生成站点
* @param stop_node_number 站点的数量
*/
explicit SceneManager();
~SceneManager();
/**
* 生成站点画面
* @param node_number
*/
void SetStopScene(int node_number);
private:
/**
* 显示站点的像素图对象
*/
QGraphicsPixmapItem *pixmap_items;
/**
* 每个站点的所在位置
*/
PosPair *stop_pos_pairs;
/**
* 公交车对象
*/
BusWidget *bus;
/**
* 总共的站点数量
*/
int stop_node_number;
/**
* 一个矩形的边框
* 使无论中间存在多少站点这个scene都能在view的中心
*/
QGraphicsRectItem *rect_item;
/**
* 清除画面
*/
void ClearStopScene();
};
#endif //AUTO_BUS_GUI_MAIN_SCENE_H