6 * $Date: 2012-07-06 12:12:10 +0200 (Fr, 06. Jul 2012) $
7 ***************************************************************/
10 * \brief Implementation of class QuadTreeNodeNM.
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/QuadTreeNodeNM.h>
49 ostream
&operator<< (ostream
& output
, const QuadTreeNodeNM
& A
)
51 output
<<" Sm_level: "<<A
.Sm_level
<<" Sm_downleftcorner: "<<A
.Sm_downleftcorner
52 <<" Sm boxlength: "<<A
.Sm_boxlength
<<" Sm_center: "<<A
.Sm_center
53 <<"spnumber: "<<A
.subtreeparticlenumber
;
54 if(A
.father_ptr
== NULL
)
56 if((A
.child_lt_ptr
== NULL
) ||(A
.child_rt_ptr
== NULL
) || (A
.child_lb_ptr
== NULL
)||
57 (A
.child_rb_ptr
== NULL
))
59 output
<<" (no child in ";
60 if(A
.child_lt_ptr
== NULL
)
62 if(A
.child_rt_ptr
== NULL
)
64 if(A
.child_lb_ptr
== NULL
)
66 if(A
.child_rb_ptr
== NULL
)
73 output
<<"no list specified";
74 else if(A
.L_x_ptr
->empty())
78 forall_listiterators(ParticleInfo
, it
,*A
.L_x_ptr
)
84 output
<<"no list specified";
85 else if(A
.L_y_ptr
->empty())
89 forall_listiterators(ParticleInfo
, it
,*A
.L_y_ptr
)
98 forall_listiterators(QuadTreeNodeNM
*, v_ptr
,A
.I
)
99 output
<<" ["<<(*v_ptr
)->get_Sm_level()<<" , "
100 <<(*v_ptr
)->get_Sm_downleftcorner()<<","
101 <<(*v_ptr
)->get_Sm_boxlength()<<"]";
109 forall_listiterators(QuadTreeNodeNM
*, v_ptr
,A
.D1
)
110 output
<<" ["<<(*v_ptr
)->get_Sm_level()<<" , "
111 <<(*v_ptr
)->get_Sm_downleftcorner()<<","
112 <<(*v_ptr
)->get_Sm_boxlength()<<"]";
120 forall_listiterators(QuadTreeNodeNM
*, v_ptr
,A
.D2
)
121 output
<<" ["<<(*v_ptr
)->get_Sm_level()<<" , "
122 <<(*v_ptr
)->get_Sm_downleftcorner()<<","
123 <<(*v_ptr
)->get_Sm_boxlength()<<"]";
131 forall_listiterators(QuadTreeNodeNM
*, v_ptr
,A
.M
)
132 output
<<" ["<<(*v_ptr
)->get_Sm_level()<<" , "
133 <<(*v_ptr
)->get_Sm_downleftcorner()<<","
134 <<(*v_ptr
)->get_Sm_boxlength()<<"]";
136 output
<<" contained_nodes ";
137 if(A
.contained_nodes
.empty())
141 forall_listiterators(node
,v_it
,A
.contained_nodes
)
142 output
<<(*v_it
)->index()<<" ";
148 istream
&operator>> (istream
& input
, QuadTreeNodeNM
& A
)
155 QuadTreeNodeNM::QuadTreeNodeNM()
157 DPoint
double_null(0,0);
158 complex<double> comp_null(0,0);
160 L_x_ptr
= NULL
; ;L_y_ptr
= NULL
;
161 subtreeparticlenumber
= 0;
163 Sm_downleftcorner
= double_null
;
165 Sm_center
= comp_null
;
168 contained_nodes
.clear();
169 I
.clear();D1
.clear();D2
.clear();M
.clear();
171 child_lt_ptr
= child_rt_ptr
= child_lb_ptr
= child_rb_ptr
= NULL
;
175 QuadTreeNodeNM::~QuadTreeNodeNM()
187 contained_nodes
.clear();
188 I
.clear();D1
.clear();D2
.clear();M
.clear();