auto_bus/include/mainScene.h

105 lines
1.7 KiB
C
Raw Permalink Normal View History

2022-06-16 22:42:55 +08:00
//
// 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"
2022-06-28 22:55:00 +08:00
#include "QGraphicsSimpleTextItem"
2022-06-17 10:33:28 +08:00
#include "PosPair.h"
#include "BusWidget.h"
2022-06-16 22:42:55 +08:00
2022-06-29 17:25:33 +08:00
/**
*
*/
2022-06-16 22:42:55 +08:00
class SceneManager
{
public:
2022-06-29 17:25:33 +08:00
/**
*
*/
2022-06-16 22:42:55 +08:00
QGraphicsScene *scene;
2022-06-17 10:33:28 +08:00
/**
*
*/
explicit SceneManager();
2022-06-29 17:25:33 +08:00
2022-06-16 22:42:55 +08:00
~SceneManager();
/**
*
* @param node_number
*/
2022-07-04 17:09:22 +08:00
void SetStopScene(int node_number, int node_distance);
2022-06-29 17:25:33 +08:00
/**
*
*/
2022-06-29 12:14:38 +08:00
void ResetBus();
/**
*
* @param direction
* @param duration
*/
void BeginBusAnimation(int direction, int duration);
2022-06-17 10:33:28 +08:00
private:
2022-06-16 22:42:55 +08:00
/**
2022-06-17 10:33:28 +08:00
*
2022-06-16 22:42:55 +08:00
*/
2022-06-17 10:33:28 +08:00
QGraphicsPixmapItem *pixmap_items;
2022-06-29 17:25:33 +08:00
/**
*
*/
2022-06-28 22:55:00 +08:00
QGraphicsSimpleTextItem *name_items;
2022-07-04 17:09:22 +08:00
/**
*
*/
QGraphicsPathItem *rail_path;
/**
*
*/
QGraphicsEllipseItem *pos_spots;
2022-06-16 22:42:55 +08:00
/**
2022-06-17 10:33:28 +08:00
*
2022-06-16 22:42:55 +08:00
*/
2022-06-17 10:33:28 +08:00
PosPair *stop_pos_pairs;
2022-06-16 22:42:55 +08:00
/**
*
*/
BusWidget *bus;
/**
*
*/
int stop_node_number;
2022-07-04 17:09:22 +08:00
/**
*
*/
int stop_node_distance;
/**
*
* 使scene都能在view的中心
*/
2022-06-17 10:33:28 +08:00
QGraphicsRectItem *rect_item;
/**
*
*/
void ClearStopScene();
2022-06-16 22:42:55 +08:00
};
#endif //AUTO_BUS_GUI_MAIN_SCENE_H