Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -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> |
| 10 | * Yingdi Yu <yingdi@cs.ucla.edu> |
| 11 | */ |
| 12 | |
| 13 | #ifndef CHRONOS_TREE_LAYOUT_HPP |
| 14 | #define CHRONOS_TREE_LAYOUT_HPP |
| 15 | |
| 16 | #include "trust-tree-node.hpp" |
| 17 | |
| 18 | namespace chronos { |
| 19 | |
| 20 | class TreeLayout |
| 21 | { |
| 22 | public: |
| 23 | struct Coordinate |
| 24 | { |
| 25 | double x; |
| 26 | double y; |
| 27 | }; |
| 28 | |
| 29 | TreeLayout() |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | virtual |
| 34 | ~TreeLayout() |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | virtual void |
| 39 | setOneLevelLayout(std::vector<Coordinate>& childNodesCo) |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | void |
| 44 | setSiblingDistance(int d) |
| 45 | { |
| 46 | m_siblingDistance = d; |
| 47 | } |
| 48 | |
| 49 | void |
| 50 | setLevelDistance(int d) |
| 51 | { |
| 52 | m_levelDistance = d; |
| 53 | } |
| 54 | |
| 55 | int |
| 56 | getSiblingDistance() |
| 57 | { |
| 58 | return m_siblingDistance; |
| 59 | } |
| 60 | |
| 61 | int |
| 62 | getLevelDistance() |
| 63 | { |
| 64 | return m_levelDistance; |
| 65 | } |
| 66 | |
| 67 | |
| 68 | private: |
| 69 | int m_siblingDistance; |
| 70 | int m_levelDistance; |
| 71 | }; |
| 72 | |
| 73 | class OneLevelTreeLayout : public TreeLayout |
| 74 | { |
| 75 | public: |
| 76 | OneLevelTreeLayout() |
| 77 | { |
| 78 | } |
| 79 | |
| 80 | virtual ~OneLevelTreeLayout() |
| 81 | { |
| 82 | } |
| 83 | |
| 84 | virtual void |
| 85 | setOneLevelLayout(std::vector<Coordinate>& childNodesCo); |
| 86 | |
| 87 | }; |
| 88 | |
| 89 | class MultipleLevelTreeLayout : public TreeLayout |
| 90 | { |
| 91 | public: |
| 92 | MultipleLevelTreeLayout() |
| 93 | { |
| 94 | } |
| 95 | |
| 96 | virtual ~MultipleLevelTreeLayout() |
| 97 | { |
| 98 | } |
| 99 | |
| 100 | virtual void setMultipleLevelTreeLayout(TrustTreeNodeList& nodeList); |
| 101 | }; |
| 102 | |
| 103 | } // namespace chronos |
| 104 | |
| 105 | #endif // CHRONOS_TREE_LAYOUT_HPP |