blob: aa69251a67faa2e49646bb1066482e634611e225 [file] [log] [blame]
Yingdi Yu7989eb22013-10-31 17:38:22 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 * Yingdi Yu
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
9 * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -070010 * Yingdi Yu <yingdi@cs.ucla.edu>
Yingdi Yu7989eb22013-10-31 17:38:22 -070011 */
12
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -070013#ifndef TREE_LAYOUT_H
14#define TREE_LAYOUT_H
15
Zhenkai Zhu5c6ad572012-06-04 19:50:08 -070016#include <vector>
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -070017#include "trust-tree-node.h"
Zhenkai Zhu5c6ad572012-06-04 19:50:08 -070018
Yingdi Yufa0b6a02014-04-30 14:26:42 -070019class TreeLayout
Zhenkai Zhu5c6ad572012-06-04 19:50:08 -070020{
21public:
22 struct Coordinate
23 {
24 double x;
25 double y;
26 };
27 TreeLayout(){}
28 virtual void setOneLevelLayout(std::vector<Coordinate> &childNodesCo){};
29 void setSiblingDistance(int d) {m_siblingDistance = d;}
30 void setLevelDistance(int d) {m_levelDistance = d;}
31 int getSiblingDistance() {return m_siblingDistance;}
32 int getLevelDistance() {return m_levelDistance;}
33 virtual ~TreeLayout(){}
34private:
35 int m_siblingDistance;
36 int m_levelDistance;
37};
38
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -070039class OneLevelTreeLayout : public TreeLayout
Zhenkai Zhu5c6ad572012-06-04 19:50:08 -070040{
41public:
42 OneLevelTreeLayout(){}
Zhenkai Zhu21d75f92012-06-04 21:23:34 -070043 virtual void setOneLevelLayout(std::vector<Coordinate> &childNodesCo);
Zhenkai Zhu5c6ad572012-06-04 19:50:08 -070044 virtual ~OneLevelTreeLayout(){}
45};
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -070046
47class MultipleLevelTreeLayout : public TreeLayout
48{
49public:
50 MultipleLevelTreeLayout(){}
51 virtual ~MultipleLevelTreeLayout(){}
52 virtual void setMultipleLevelTreeLayout(TrustTreeNodeList& nodeList);
53};
54
55#endif // TREE_LAYOUT_H