Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 1 | /* -*- 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 Yu | f4aaa8b | 2014-03-10 11:24:31 -0700 | [diff] [blame] | 10 | * Yingdi Yu <yingdi@cs.ucla.edu> |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 11 | */ |
| 12 | |
Yingdi Yu | f4aaa8b | 2014-03-10 11:24:31 -0700 | [diff] [blame] | 13 | #ifndef TREE_LAYOUT_H |
| 14 | #define TREE_LAYOUT_H |
| 15 | |
Zhenkai Zhu | 5c6ad57 | 2012-06-04 19:50:08 -0700 | [diff] [blame] | 16 | #include <vector> |
Yingdi Yu | f4aaa8b | 2014-03-10 11:24:31 -0700 | [diff] [blame] | 17 | #include "trust-tree-node.h" |
Zhenkai Zhu | 5c6ad57 | 2012-06-04 19:50:08 -0700 | [diff] [blame] | 18 | |
Yingdi Yu | fa0b6a0 | 2014-04-30 14:26:42 -0700 | [diff] [blame] | 19 | class TreeLayout |
Zhenkai Zhu | 5c6ad57 | 2012-06-04 19:50:08 -0700 | [diff] [blame] | 20 | { |
| 21 | public: |
| 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(){} |
| 34 | private: |
| 35 | int m_siblingDistance; |
| 36 | int m_levelDistance; |
| 37 | }; |
| 38 | |
Yingdi Yu | f4aaa8b | 2014-03-10 11:24:31 -0700 | [diff] [blame] | 39 | class OneLevelTreeLayout : public TreeLayout |
Zhenkai Zhu | 5c6ad57 | 2012-06-04 19:50:08 -0700 | [diff] [blame] | 40 | { |
| 41 | public: |
| 42 | OneLevelTreeLayout(){} |
Zhenkai Zhu | 21d75f9 | 2012-06-04 21:23:34 -0700 | [diff] [blame] | 43 | virtual void setOneLevelLayout(std::vector<Coordinate> &childNodesCo); |
Zhenkai Zhu | 5c6ad57 | 2012-06-04 19:50:08 -0700 | [diff] [blame] | 44 | virtual ~OneLevelTreeLayout(){} |
| 45 | }; |
Yingdi Yu | f4aaa8b | 2014-03-10 11:24:31 -0700 | [diff] [blame] | 46 | |
| 47 | class MultipleLevelTreeLayout : public TreeLayout |
| 48 | { |
| 49 | public: |
| 50 | MultipleLevelTreeLayout(){} |
| 51 | virtual ~MultipleLevelTreeLayout(){} |
| 52 | virtual void setMultipleLevelTreeLayout(TrustTreeNodeList& nodeList); |
| 53 | }; |
| 54 | |
| 55 | #endif // TREE_LAYOUT_H |