auto_bus/include/mainScene.h

65 lines
1.2 KiB
C
Raw 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-17 10:33:28 +08:00
class PosPair{
public:
int pos_x;
int pos_y;
PosPair();
/**
*
* @param stop_number
* @return
*/
int GetStopSpaceLength(int stop_number) const;
/**
*
* @param length
*/
void AddLength(int length);
private:
const int stop_begin_x = 100;
const int stop_begin_y = 80;
const int stop_rail_width = 300;
const int stop_rail_height = 200;
int distance = 0;
};
2022-06-16 22:42:55 +08:00
class SceneManager
{
public:
QGraphicsScene *scene;
2022-06-17 10:33:28 +08:00
/**
*
* @param stop_node_number
*/
explicit SceneManager(int stop_node_number);
2022-06-16 22:42:55 +08:00
~SceneManager();
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-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
2022-06-17 10:33:28 +08:00
QGraphicsRectItem *rect_item;
2022-06-16 22:42:55 +08:00
};
#endif //AUTO_BUS_GUI_MAIN_SCENE_H