12 : QGraphicsScene(parent)
14 setItemIndexMethod(QGraphicsScene::NoIndex);
21 this->setSceneRect(QRectF(startx, starty,
m_width - startx,
m_height - starty));
39 for (
auto* item : list) {
42 ((QGraphicsPathItem*)item)->setPen(QPen(QColor(
ROADDEFAULT)));
44 ((QGraphicsPathItem*)item)->setPen(QPen(QColor(
ROADSELECTED)));
59 for (
auto* item : list) {
75 rect->setPos(p->x(), p->y());
96 for (
auto it : *roads) {
99 QPainterPath* path =
new QPainterPath(QPointF(
m_roadPoints->at(listOfPointId[0]).x(),
m_roadPoints->at(listOfPointId[0]).y()));
100 for (uint i = 1; i < listOfPointId.size(); i++) {
103 QGraphicsPathItem* pathItem =
new QGraphicsPathItem();
104 pathItem->setPath(*path);
132 std::cout <<
"Point " << pointId << std::endl;
143 foreach (QGraphicsItem* item, items()) {
144 QGraphicsPathItem* path = qgraphicsitem_cast<QGraphicsPathItem*>(item);
150 if (path->data(
KEY_ROADID).toLongLong() == r) {
156 path->setPen(defaultPen);
void onSignalAllRoads(std::unordered_map< long, Road > *roads, std::vector< PointRoad > *)
std::vector< QGraphicsRectItem * > pointItems
const std::vector< int > & vectorOfPointsId() const
Get the vector of points composing the road.
void setBackToDefault(int pointId)
void onSignalAllPoints(std::vector< PointGPS * > *)
std::vector< PointGPS * > * m_trackPoints
Road is an element of a network. Road are strongly linked with Points.
void onSignalRoadPath(std::vector< long > *rp)
std::vector< long > m_neighboursId
void signalNeighboursId(std::vector< long > *)
void highlightRoadsDefault(bool basic)
QGraphicsEllipseItem * m_selectionCircle
std::unordered_map< long, Road > * m_roads
long edgeId() const
Get the id of the road.
std::vector< PointRoad > * m_roadPoints
void onSignalCurrentPoint(int pointId)
QMapScene(QObject *parent=0)
void highlightSelectedPoint(int pointId)
void signalTrackCompleted(QString)
void signalItemToShow(QGraphicsItem *)
void initialize(int startx, int starty, int width, int height)