6 * $Date: 2012-07-05 16:45:20 +0200 (Do, 05. Jul 2012) $
7 ***************************************************************/
10 * \brief Implementation of class NodeAttributes.
12 * \author Stefan Hachul
15 * This file is part of the Open Graph Drawing Framework (OGDF).
19 * See README.txt in the root directory of the OGDF installation for details.
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
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.
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>
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
)
54 else output
<<A
.v_lower_level
->index();
55 output
<<" index of higher level node ";
56 if (A
.v_higher_level
== NULL
)
58 else output
<<A
.v_higher_level
->index();
59 output
<<" mass "<<A
.mass
<<" type "<<A
.type
;
62 output
<<" dedic_moon_nodes ";
63 if(A
.moon_List
.empty())
65 else forall_listiterators(node
,it
,A
.moon_List
) output
<<(*it
)->index()<<" ";
68 output
<<" dedic_pm_node "<<A
.dedicated_pm_node
;
69 output
<<" index of dedicated sun_node ";
70 if (A
.get_dedicated_sun_node() == NULL
)
73 output
<<A
.dedicated_sun_node
->index();
74 output
<<" distance to dedicated sun "<<A
.dedicated_sun_distance
;
75 output
<<" lambda_List ";
78 else forall_listiterators(double, l
,A
.lambda
) output
<<*l
<<" ";
79 output
<<" neighbour_sun_node_List ";
80 if(A
.neighbour_s_node
.empty())
82 else forall_listiterators(node
, it
,A
.neighbour_s_node
) output
<<(*it
)->index()<<" ";
86 output
<<" is not placed";
87 cout
<<" angle_1 "<<A
.angle_1
<<" angle_2 "<<A
.angle_2
<<endl
;
92 istream
&operator>> (istream
& input
, NodeAttributes
& /* A */)
99 void NodeAttributes::init_mult_values()
102 dedicated_sun_node
= NULL
;
103 dedicated_sun_distance
= 0;
104 dedicated_pm_node
= NULL
;
106 neighbour_s_node
.clear();
107 lambda_List_ptr
= &lambda
;
108 neighbour_s_node_List_ptr
= &neighbour_s_node
;
110 moon_List_ptr
= &moon_List
;
117 NodeAttributes::NodeAttributes()
123 v_lower_level
= NULL
;
124 v_higher_level
= NULL
;
126 //for multilevel step
129 dedicated_sun_node
= NULL
;
130 dedicated_sun_distance
= 0;
131 dedicated_pm_node
= NULL
;
133 neighbour_s_node
.clear();
134 lambda_List_ptr
= &lambda
;
135 neighbour_s_node_List_ptr
= &neighbour_s_node
;
137 moon_List_ptr
= &moon_List
;