Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / src / energybased / NodeAttributes.cpp
blob8fbcbdcd7a310e8967fb44beff94a218c91bb383
1 /*
2 * $Revision: 2552 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-05 16:45:20 +0200 (Do, 05. Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Implementation of class NodeAttributes.
12 * \author Stefan Hachul
14 * \par License:
15 * This file is part of the Open Graph Drawing Framework (OGDF).
17 * \par
18 * Copyright (C)<br>
19 * See README.txt in the root directory of the OGDF installation for details.
21 * \par
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
26 * for details.
28 * \par
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * \par
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
44 #include <ogdf/internal/energybased/NodeAttributes.h>
46 namespace ogdf{
48 ostream &operator<< (ostream & output, const NodeAttributes & A)
50 output <<"width: "<< A.width<<" height: "<<A.height<<" position: "<<A.position ;
51 output<<" index of lower level node ";
52 if (A.v_lower_level == NULL)
53 output <<"NULL";
54 else output<<A.v_lower_level->index();
55 output<<" index of higher level node ";
56 if (A.v_higher_level == NULL)
57 output <<"NULL";
58 else output<<A.v_higher_level->index();
59 output<<" mass "<<A.mass<<" type "<<A.type;
60 if(A.type == 3)
62 output<<" dedic_moon_nodes ";
63 if(A.moon_List.empty())
64 output<<" is empty";
65 else forall_listiterators(node,it,A.moon_List) output<<(*it)->index()<<" ";
67 if(A.type == 4)
68 output<<" dedic_pm_node "<<A.dedicated_pm_node;
69 output<<" index of dedicated sun_node ";
70 if (A.get_dedicated_sun_node() == NULL)
71 output<<"NULL";
72 else
73 output<<A.dedicated_sun_node->index();
74 output<<" distance to dedicated sun "<<A.dedicated_sun_distance;
75 output<<" lambda_List ";
76 if(A.lambda.empty())
77 output<<" is empty";
78 else forall_listiterators(double, l,A.lambda) output<<*l<<" ";
79 output<<" neighbour_sun_node_List ";
80 if(A.neighbour_s_node.empty())
81 output<<" is empty";
82 else forall_listiterators(node, it,A.neighbour_s_node) output<<(*it)->index()<<" ";
83 if(A.placed == true)
84 output<<" is placed";
85 else
86 output<<" is not placed";
87 cout<<" angle_1 "<<A.angle_1<<" angle_2 "<<A.angle_2<<endl;
88 return output;
92 istream &operator>> (istream & input, NodeAttributes & /* A */)
94 //input >> A.l;
95 return input;
99 void NodeAttributes::init_mult_values()
101 type = 0;
102 dedicated_sun_node = NULL;
103 dedicated_sun_distance = 0;
104 dedicated_pm_node = NULL;
105 lambda.clear();
106 neighbour_s_node.clear();
107 lambda_List_ptr = &lambda;
108 neighbour_s_node_List_ptr = &neighbour_s_node;
109 moon_List.clear();
110 moon_List_ptr = &moon_List;
111 placed = false;
112 angle_1 = 0;
113 angle_2 = 6.2831853;
117 NodeAttributes::NodeAttributes()
119 position.m_x = 0;
120 position.m_y = 0;
121 width = 0;
122 height = 0;
123 v_lower_level = NULL;
124 v_higher_level = NULL;
126 //for multilevel step
127 mass = 0;
128 type = 0;
129 dedicated_sun_node = NULL;
130 dedicated_sun_distance = 0;
131 dedicated_pm_node = NULL;
132 lambda.clear();
133 neighbour_s_node.clear();
134 lambda_List_ptr = &lambda;
135 neighbour_s_node_List_ptr = &neighbour_s_node;
136 moon_List.clear();
137 moon_List_ptr = &moon_List;
138 placed = false;
139 angle_1 = 0;
140 angle_2 = 6.2831853;
143 }//namespace ogdf