Project

General

Profile

Statistics
| Branch: | Revision:

root / src / layout / concentrictreeembedding.h @ 8aeaaccc

History | View | Annotate | Download (1.31 KB)

1
//=========================================================================
2
//  CONCENTRICTREEEMBEDDING.H - part of
3
//                  OMNeT++/OMNEST
4
//           Discrete System Simulation in C++
5
//
6
//  Author: Levente Meszaros
7
//
8
//=========================================================================
9

    
10
/*--------------------------------------------------------------*
11
  Copyright (C) 2006-2008 OpenSim Ltd.
12

13
  This file is distributed WITHOUT ANY WARRANTY. See the file
14
  `license' for details on this and other legal matters.
15
*--------------------------------------------------------------*/
16

    
17
#ifndef __CONCENTRICTREEEMBEDDING_H_
18
#define __CONCENTRICTREEEMBEDDING_H_
19

    
20
#include "vector"
21
#include "geometry.h"
22
#include "graphcomponent.h"
23

    
24
NAMESPACE_BEGIN
25

    
26
/**
27
 *
28
 */
29
class ConcentricTreeEmbedding
30
{
31
    public:
32
        /**
33
         * Minimum distance between vertices
34
         */
35
        double vertexSpacing;
36

    
37
    private:
38
        /**
39
         * A connected graph component which must have a spanning tree.
40
         */
41
        GraphComponent *graphComponent;
42

    
43
        std::vector<double> levelPositions;
44

    
45
    public:
46
        ConcentricTreeEmbedding(GraphComponent *graphComponent, double vertexSpacing);
47
        void embed();
48

    
49
    private:
50
        void calculateCenterRecursive(Vertex *vertex, int level);
51
};
52

    
53
NAMESPACE_END
54

    
55

    
56
#endif