17 #undef NDEBUG // enable assert in release mode
22 template<
typename PointCloud,
35 for(
int i = 0; i < 4; i++)
39 #pragma GCC diagnostic push
40 #pragma GCC diagnostic ignored "-Wunused-variable"
48 Point p2(1.f, 2.f, 3.f);
50 std::ostringstream ss;
59 auto pm =
get(boost::vertex_point, pc);
63 auto vi = iterator_pair.first;
64 auto vi_end = iterator_pair.second;
65 for(; vi != vi_end; ++vi)
67 put(pm, *vi,
Point(cnt, cnt+1, cnt+2));
71 assert(
get(pm, 0) ==
Point(1, 2, 3));
72 assert(
get(pm, 1) ==
Point(4, 5, 6));
73 assert(
get(pm, 2) ==
Point(7, 8, 9));
74 assert(
get(pm, 3) ==
Point(10, 11, 12));
82 auto pm =
get(boost::vertex_point, pc);
85 auto vi = iterator_pair.first;
86 auto vi_end = iterator_pair.second;
87 for(; vi != vi_end; ++vi)
89 auto p =
get(pm, *vi);
90 Point p2(gt.get_x(p)*2, gt.get_y(p)*2, gt.get_z(p)*2);
94 assert(
get(pm, 0) ==
Point(2, 4, 6));
95 assert(
get(pm, 1) ==
Point(8, 10, 12));
96 assert(
get(pm, 2) ==
Point(14, 16, 18));
97 assert(
get(pm, 3) ==
Point(20, 22, 24));
106 Normal n2(1., 2., 3.);
108 std::ostringstream ss;
130 auto vi = iterator_pair.first;
131 auto vi_end = iterator_pair.second;
132 for(; vi != vi_end; ++vi)
134 put(v_nm, *vi, Normal(cnt, cnt+1, cnt+2));
138 assert(
get(v_nm, 0) == Normal(10, 11, 12));
139 assert(
get(v_nm, 1) == Normal(13, 14, 15));
140 assert(
get(v_nm, 2) == Normal(16, 17, 18));
141 assert(
get(v_nm, 3) == Normal(19, 20, 21));
152 auto vi = iterator_pair.first;
153 auto vi_end = iterator_pair.second;
154 for(; vi != vi_end; ++vi)
156 auto n =
get(v_nm, *vi);
157 Normal n2(n[0]*10, n[1]*10, n[2]*10);
161 assert(
get(v_nm, 0) == Normal(100, 110, 120));
162 assert(
get(v_nm, 1) == Normal(130, 140, 150));
163 assert(
get(v_nm, 2) == Normal(160, 170, 180));
164 assert(
get(v_nm, 3) == Normal(190, 200, 210));
176 std::ostringstream ss;
180 #pragma GCC diagnostic pop
201 auto vi = iterator_pair.first;
202 auto vi_end = iterator_pair.second;
203 for(; vi != vi_end; ++vi)
205 put(v_cm, *vi, Color(cnt, cnt+1, cnt+2));
209 assert(
get(v_cm, 0) == Color(210, 211, 212));
210 assert(
get(v_cm, 1) == Color(213, 214, 215));
211 assert(
get(v_cm, 2) == Color(216, 217, 218));
212 assert(
get(v_cm, 3) == Color(219, 220, 221));
223 auto vi = iterator_pair.first;
224 auto vi_end = iterator_pair.second;
225 for(; vi != vi_end; ++vi)
227 auto c =
get(v_cm, *vi);
228 Color c2(c[0]-100, c[1]-100, c[2]-100);
232 assert(
get(v_cm, 0) == Color(110, 111, 112));
233 assert(
get(v_cm, 1) == Color(113, 114 ,115));
234 assert(
get(v_cm, 2) == Color(116, 117, 118));
235 assert(
get(v_cm, 3) == Color(119, 120, 121));
242 auto special_prop_map =
243 FEVV::make_vertex_property_map< PointCloud, int >(pc);
252 auto vi = iterator_pair.first;
253 auto vi_end = iterator_pair.second;
254 for(; vi != vi_end; ++vi)
256 put(special_prop_map, *vi, cnt);
260 assert(
get(special_prop_map, 0) == 333);
261 assert(
get(special_prop_map, 1) == 334);
262 assert(
get(special_prop_map, 2) == 335);
263 assert(
get(special_prop_map, 3) == 336);
272 auto vi = iterator_pair.first;
273 auto vi_end = iterator_pair.second;
274 for(; vi != vi_end; ++vi)
276 auto v =
get(special_prop_map, *vi);
277 put(special_prop_map, *vi, v*2);
280 assert(
get(special_prop_map, 0) == 666);
281 assert(
get(special_prop_map, 1) == 668);
282 assert(
get(special_prop_map, 2) == 670);
283 assert(
get(special_prop_map, 3) == 672);
290 std::cout <<
"Test passed.\n";