blob: 1d4d0e16c3afa853f6575f7fed583964305435a1 [file] [log] [blame]
Yingdi Yu0b0a7362014-08-05 16:31:30 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
Varun Patila24bd3e2020-11-24 10:08:33 +05303 * Copyright (c) 2020, Regents of the University of California
Yingdi Yu0b0a7362014-08-05 16:31:30 -07004 * Yingdi Yu
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Yingdi Yu <yingdi@cs.ucla.edu>
9 */
10
Yingdi Yueb692ac2015-02-10 18:46:18 -080011#ifndef CHRONOCHAT_TRUST_TREE_SCENE_HPP
12#define CHRONOCHAT_TRUST_TREE_SCENE_HPP
Yingdi Yu0b0a7362014-08-05 16:31:30 -070013
Yingdi Yu0b0a7362014-08-05 16:31:30 -070014#ifndef Q_MOC_RUN
15#include "trust-tree-node.hpp"
16#include "tree-layout.hpp"
17#endif
18
Varun Patila24bd3e2020-11-24 10:08:33 +053019#include <QGraphicsScene>
20#include <QColor>
21#include <QMap>
22
Yingdi Yu0b0a7362014-08-05 16:31:30 -070023class QGraphicsTextItem;
24
Yingdi Yueb692ac2015-02-10 18:46:18 -080025namespace chronochat {
Yingdi Yu0b0a7362014-08-05 16:31:30 -070026
27class TrustTreeScene : public QGraphicsScene
28{
29 Q_OBJECT
30
31public:
Varun Patil3d850902020-11-23 12:19:14 +053032 TrustTreeScene(QObject* parent = 0);
Yingdi Yu0b0a7362014-08-05 16:31:30 -070033
34 void
Yingdi Yueb692ac2015-02-10 18:46:18 -080035 plotTrustTree(chronochat::TrustTreeNodeList& nodeList);
Yingdi Yu0b0a7362014-08-05 16:31:30 -070036
37private:
38 void
Yingdi Yueb692ac2015-02-10 18:46:18 -080039 plotEdge(const chronochat::TrustTreeNodeList& nodeList, int nodeSize);
Yingdi Yu0b0a7362014-08-05 16:31:30 -070040
41 void
Yingdi Yueb692ac2015-02-10 18:46:18 -080042 plotNode(const chronochat::TrustTreeNodeList& nodeList, int nodeSize);
Yingdi Yu0b0a7362014-08-05 16:31:30 -070043};
44
Yingdi Yueb692ac2015-02-10 18:46:18 -080045} // namespace chronochat
Yingdi Yu0b0a7362014-08-05 16:31:30 -070046
Yingdi Yueb692ac2015-02-10 18:46:18 -080047#endif // CHRONOCHAT_TRUST_TREE_SCENE_HPP