Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
Varun Patil | a24bd3e | 2020-11-24 10:08:33 +0530 | [diff] [blame^] | 3 | * Copyright (c) 2020, Regents of the University of California |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame] | 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 | |
Yingdi Yu | eb692ac | 2015-02-10 18:46:18 -0800 | [diff] [blame] | 13 | #ifndef CHRONOCHAT_TREE_LAYOUT_HPP |
| 14 | #define CHRONOCHAT_TREE_LAYOUT_HPP |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame] | 15 | |
| 16 | #include "trust-tree-node.hpp" |
| 17 | |
Yingdi Yu | eb692ac | 2015-02-10 18:46:18 -0800 | [diff] [blame] | 18 | namespace chronochat { |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame] | 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 | |
Yingdi Yu | eb692ac | 2015-02-10 18:46:18 -0800 | [diff] [blame] | 103 | } // namespace chronochat |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame] | 104 | |
Yingdi Yu | eb692ac | 2015-02-10 18:46:18 -0800 | [diff] [blame] | 105 | #endif // CHRONOCHAT_TREE_LAYOUT_HPP |