Skip to content
This repository
Browse code

+ fix member variables names

  • Loading branch information...
commit a9cb16303fcaa56c88abd65c8d581b7f8fec15aa 1 parent 8598202
Artem Pavlenko artemp authored

Showing 1 changed file with 122 additions and 122 deletions. Show diff stats Hide diff stats

  1. +122 122 include/mapnik/svg/svg_path_adapter.hpp
244 include/mapnik/svg/svg_path_adapter.hpp
@@ -47,9 +47,9 @@ template<class VertexContainer> class path_adapter : boost::noncopyable
47 47 typedef path_adapter<VertexContainer> self_type;
48 48
49 49 //--------------------------------------------------------------------
50   - path_adapter(VertexContainer & vertices) : m_vertices(vertices), m_iterator(0) {}
51   - //void remove_all() { m_vertices.remove_all(); m_iterator = 0; }
52   - //void free_all() { m_vertices.free_all(); m_iterator = 0; }
  50 + path_adapter(VertexContainer & vertices) : vertices_(vertices), iterator_(0) {}
  51 + //void remove_all() { vertices_.remove_all(); iterator_ = 0; }
  52 + //void free_all() { vertices_.free_all(); iterator_ = 0; }
53 53
54 54 // Make path functions
55 55 //--------------------------------------------------------------------
@@ -109,8 +109,8 @@ template<class VertexContainer> class path_adapter : boost::noncopyable
109 109
110 110 // Accessors
111 111 //--------------------------------------------------------------------
112   - const container_type& vertices() const { return m_vertices; }
113   - container_type& vertices() { return m_vertices; }
  112 + const container_type& vertices() const { return vertices_; }
  113 + container_type& vertices() { return vertices_; }
114 114
115 115 unsigned total_vertices() const;
116 116
@@ -160,7 +160,7 @@ template<class VertexContainer> class path_adapter : boost::noncopyable
160 160 vs.rewind(path_id);
161 161 while(!is_stop(cmd = vs.vertex(&x, &y)))
162 162 {
163   - m_vertices.add_vertex(x, y, cmd);
  163 + vertices_.add_vertex(x, y, cmd);
164 164 }
165 165 }
166 166
@@ -185,7 +185,7 @@ template<class VertexContainer> class path_adapter : boost::noncopyable
185 185 if(calc_distance(x, y, x0, y0) > vertex_dist_epsilon)
186 186 {
187 187 if(is_move_to(cmd)) cmd = path_cmd_line_to;
188   - m_vertices.add_vertex(x, y, cmd);
  188 + vertices_.add_vertex(x, y, cmd);
189 189 }
190 190 }
191 191 else
@@ -198,12 +198,12 @@ template<class VertexContainer> class path_adapter : boost::noncopyable
198 198 {
199 199 if(is_move_to(cmd)) cmd = path_cmd_line_to;
200 200 }
201   - m_vertices.add_vertex(x, y, cmd);
  201 + vertices_.add_vertex(x, y, cmd);
202 202 }
203 203 }
204 204 while(!is_stop(cmd = vs.vertex(&x, &y)))
205 205 {
206   - m_vertices.add_vertex(x, y, is_move_to(cmd) ?
  206 + vertices_.add_vertex(x, y, is_move_to(cmd) ?
207 207 unsigned(path_cmd_line_to) :
208 208 cmd);
209 209 }
@@ -218,16 +218,16 @@ template<class VertexContainer> class path_adapter : boost::noncopyable
218 218 template<class Trans>
219 219 void transform(const Trans& trans, unsigned path_id=0)
220 220 {
221   - unsigned num_ver = m_vertices.total_vertices();
  221 + unsigned num_ver = vertices_.total_vertices();
222 222 for(; path_id < num_ver; path_id++)
223 223 {
224 224 double x, y;
225   - unsigned cmd = m_vertices.vertex(path_id, &x, &y);
  225 + unsigned cmd = vertices_.vertex(path_id, &x, &y);
226 226 if(is_stop(cmd)) break;
227 227 if(is_vertex(cmd))
228 228 {
229 229 trans.transform(&x, &y);
230   - m_vertices.modify_vertex(path_id, x, y);
  230 + vertices_.modify_vertex(path_id, x, y);
231 231 }
232 232 }
233 233 }
@@ -237,14 +237,14 @@ template<class VertexContainer> class path_adapter : boost::noncopyable
237 237 void transform_all_paths(const Trans& trans)
238 238 {
239 239 unsigned idx;
240   - unsigned num_ver = m_vertices.total_vertices();
  240 + unsigned num_ver = vertices_.total_vertices();
241 241 for(idx = 0; idx < num_ver; idx++)
242 242 {
243 243 double x, y;
244   - if(is_vertex(m_vertices.vertex(idx, &x, &y)))
  244 + if(is_vertex(vertices_.vertex(idx, &x, &y)))
245 245 {
246 246 trans.transform(&x, &y);
247   - m_vertices.modify_vertex(idx, x, y);
  247 + vertices_.modify_vertex(idx, x, y);
248 248 }
249 249 }
250 250 }
@@ -255,21 +255,21 @@ template<class VertexContainer> class path_adapter : boost::noncopyable
255 255 unsigned perceive_polygon_orientation(unsigned start, unsigned end);
256 256 void invert_polygon(unsigned start, unsigned end);
257 257
258   - VertexContainer & m_vertices;
259   - unsigned m_iterator;
260   - double m_start_x;
261   - double m_start_y;
  258 + VertexContainer & vertices_;
  259 + unsigned iterator_;
  260 + double start_x_;
  261 + double start_y_;
262 262 };
263 263
264 264 //------------------------------------------------------------------------
265 265 template<class VC>
266 266 unsigned path_adapter<VC>::start_new_path()
267 267 {
268   - if(!is_stop(m_vertices.last_command()))
  268 + if(!is_stop(vertices_.last_command()))
269 269 {
270   - m_vertices.add_vertex(0.0, 0.0, path_cmd_stop);
  270 + vertices_.add_vertex(0.0, 0.0, path_cmd_stop);
271 271 }
272   - return m_vertices.total_vertices();
  272 + return vertices_.total_vertices();
273 273 }
274 274
275 275
@@ -277,12 +277,12 @@ unsigned path_adapter<VC>::start_new_path()
277 277 template<class VC>
278 278 inline void path_adapter<VC>::rel_to_abs(double* x, double* y) const
279 279 {
280   - if(m_vertices.total_vertices())
  280 + if(vertices_.total_vertices())
281 281 {
282 282 double x2;
283 283 double y2;
284   - if(is_vertex(m_vertices.last_vertex(&x2, &y2))
285   - || !is_stop(m_vertices.last_command()))
  284 + if(is_vertex(vertices_.last_vertex(&x2, &y2))
  285 + || !is_stop(vertices_.last_command()))
286 286 {
287 287 *x += x2;
288 288 *y += y2;
@@ -294,9 +294,9 @@ inline void path_adapter<VC>::rel_to_abs(double* x, double* y) const
294 294 template<class VC>
295 295 inline void path_adapter<VC>::move_to(double x, double y)
296 296 {
297   - m_start_x = x;
298   - m_start_y = y;
299   - m_vertices.add_vertex(x, y, path_cmd_move_to);
  297 + start_x_ = x;
  298 + start_y_ = y;
  299 + vertices_.add_vertex(x, y, path_cmd_move_to);
300 300 }
301 301
302 302 //------------------------------------------------------------------------
@@ -304,14 +304,14 @@ template<class VC>
304 304 inline void path_adapter<VC>::move_rel(double dx, double dy)
305 305 {
306 306 rel_to_abs(&dx, &dy);
307   - m_vertices.add_vertex(dx, dy, path_cmd_move_to);
  307 + vertices_.add_vertex(dx, dy, path_cmd_move_to);
308 308 }
309 309
310 310 //------------------------------------------------------------------------
311 311 template<class VC>
312 312 inline void path_adapter<VC>::line_to(double x, double y)
313 313 {
314   - m_vertices.add_vertex(x, y, path_cmd_line_to);
  314 + vertices_.add_vertex(x, y, path_cmd_line_to);
315 315 }
316 316
317 317 //------------------------------------------------------------------------
@@ -319,14 +319,14 @@ template<class VC>
319 319 inline void path_adapter<VC>::line_rel(double dx, double dy)
320 320 {
321 321 rel_to_abs(&dx, &dy);
322   - m_vertices.add_vertex(dx, dy, path_cmd_line_to);
  322 + vertices_.add_vertex(dx, dy, path_cmd_line_to);
323 323 }
324 324
325 325 //------------------------------------------------------------------------
326 326 template<class VC>
327 327 inline void path_adapter<VC>::hline_to(double x)
328 328 {
329   - m_vertices.add_vertex(x, last_y(), path_cmd_line_to);
  329 + vertices_.add_vertex(x, last_y(), path_cmd_line_to);
330 330 }
331 331
332 332 //------------------------------------------------------------------------
@@ -335,14 +335,14 @@ inline void path_adapter<VC>::hline_rel(double dx)
335 335 {
336 336 double dy = 0;
337 337 rel_to_abs(&dx, &dy);
338   - m_vertices.add_vertex(dx, dy, path_cmd_line_to);
  338 + vertices_.add_vertex(dx, dy, path_cmd_line_to);
339 339 }
340 340
341 341 //------------------------------------------------------------------------
342 342 template<class VC>
343 343 inline void path_adapter<VC>::vline_to(double y)
344 344 {
345   - m_vertices.add_vertex(last_x(), y, path_cmd_line_to);
  345 + vertices_.add_vertex(last_x(), y, path_cmd_line_to);
346 346 }
347 347
348 348 //------------------------------------------------------------------------
@@ -351,7 +351,7 @@ inline void path_adapter<VC>::vline_rel(double dy)
351 351 {
352 352 double dx = 0;
353 353 rel_to_abs(&dx, &dy);
354   - m_vertices.add_vertex(dx, dy, path_cmd_line_to);
  354 + vertices_.add_vertex(dx, dy, path_cmd_line_to);
355 355 }
356 356
357 357 //------------------------------------------------------------------------
@@ -362,12 +362,12 @@ void path_adapter<VC>::arc_to(double rx, double ry,
362 362 bool sweep_flag,
363 363 double x, double y)
364 364 {
365   - if(m_vertices.total_vertices() && is_vertex(m_vertices.last_command()))
  365 + if(vertices_.total_vertices() && is_vertex(vertices_.last_command()))
366 366 {
367 367 const double epsilon = 1e-30;
368 368 double x0 = 0.0;
369 369 double y0 = 0.0;
370   - m_vertices.last_vertex(&x0, &y0);
  370 + vertices_.last_vertex(&x0, &y0);
371 371
372 372 rx = fabs(rx);
373 373 ry = fabs(ry);
@@ -419,8 +419,8 @@ template<class VC>
419 419 void path_adapter<VC>::curve3(double x_ctrl, double y_ctrl,
420 420 double x_to, double y_to)
421 421 {
422   - m_vertices.add_vertex(x_ctrl, y_ctrl, path_cmd_curve3);
423   - m_vertices.add_vertex(x_to, y_to, path_cmd_curve3);
  422 + vertices_.add_vertex(x_ctrl, y_ctrl, path_cmd_curve3);
  423 + vertices_.add_vertex(x_to, y_to, path_cmd_curve3);
424 424 }
425 425
426 426 //------------------------------------------------------------------------
@@ -430,8 +430,8 @@ void path_adapter<VC>::curve3_rel(double dx_ctrl, double dy_ctrl,
430 430 {
431 431 rel_to_abs(&dx_ctrl, &dy_ctrl);
432 432 rel_to_abs(&dx_to, &dy_to);
433   - m_vertices.add_vertex(dx_ctrl, dy_ctrl, path_cmd_curve3);
434   - m_vertices.add_vertex(dx_to, dy_to, path_cmd_curve3);
  433 + vertices_.add_vertex(dx_ctrl, dy_ctrl, path_cmd_curve3);
  434 + vertices_.add_vertex(dx_to, dy_to, path_cmd_curve3);
435 435 }
436 436
437 437 //------------------------------------------------------------------------
@@ -440,11 +440,11 @@ void path_adapter<VC>::curve3(double x_to, double y_to)
440 440 {
441 441 double x0;
442 442 double y0;
443   - if(is_vertex(m_vertices.last_vertex(&x0, &y0)))
  443 + if(is_vertex(vertices_.last_vertex(&x0, &y0)))
444 444 {
445 445 double x_ctrl;
446 446 double y_ctrl;
447   - unsigned cmd = m_vertices.prev_vertex(&x_ctrl, &y_ctrl);
  447 + unsigned cmd = vertices_.prev_vertex(&x_ctrl, &y_ctrl);
448 448 if(is_curve(cmd))
449 449 {
450 450 x_ctrl = x0 + x0 - x_ctrl;
@@ -473,9 +473,9 @@ void path_adapter<VC>::curve4(double x_ctrl1, double y_ctrl1,
473 473 double x_ctrl2, double y_ctrl2,
474 474 double x_to, double y_to)
475 475 {
476   - m_vertices.add_vertex(x_ctrl1, y_ctrl1, path_cmd_curve4);
477   - m_vertices.add_vertex(x_ctrl2, y_ctrl2, path_cmd_curve4);
478   - m_vertices.add_vertex(x_to, y_to, path_cmd_curve4);
  476 + vertices_.add_vertex(x_ctrl1, y_ctrl1, path_cmd_curve4);
  477 + vertices_.add_vertex(x_ctrl2, y_ctrl2, path_cmd_curve4);
  478 + vertices_.add_vertex(x_to, y_to, path_cmd_curve4);
479 479 }
480 480
481 481 //------------------------------------------------------------------------
@@ -487,9 +487,9 @@ void path_adapter<VC>::curve4_rel(double dx_ctrl1, double dy_ctrl1,
487 487 rel_to_abs(&dx_ctrl1, &dy_ctrl1);
488 488 rel_to_abs(&dx_ctrl2, &dy_ctrl2);
489 489 rel_to_abs(&dx_to, &dy_to);
490   - m_vertices.add_vertex(dx_ctrl1, dy_ctrl1, path_cmd_curve4);
491   - m_vertices.add_vertex(dx_ctrl2, dy_ctrl2, path_cmd_curve4);
492   - m_vertices.add_vertex(dx_to, dy_to, path_cmd_curve4);
  490 + vertices_.add_vertex(dx_ctrl1, dy_ctrl1, path_cmd_curve4);
  491 + vertices_.add_vertex(dx_ctrl2, dy_ctrl2, path_cmd_curve4);
  492 + vertices_.add_vertex(dx_to, dy_to, path_cmd_curve4);
493 493 }
494 494
495 495 //------------------------------------------------------------------------
@@ -532,9 +532,9 @@ void path_adapter<VC>::curve4_rel(double dx_ctrl2, double dy_ctrl2,
532 532 template<class VC>
533 533 inline void path_adapter<VC>::end_poly(unsigned flags)
534 534 {
535   - if(is_vertex(m_vertices.last_command()))
  535 + if(is_vertex(vertices_.last_command()))
536 536 {
537   - m_vertices.add_vertex(m_start_x, m_start_y, path_cmd_end_poly | flags);
  537 + vertices_.add_vertex(start_x_, start_y_, path_cmd_end_poly | flags);
538 538 }
539 539 }
540 540
@@ -549,85 +549,85 @@ inline void path_adapter<VC>::close_polygon(unsigned flags)
549 549 template<class VC>
550 550 inline unsigned path_adapter<VC>::total_vertices() const
551 551 {
552   - return m_vertices.total_vertices();
  552 + return vertices_.total_vertices();
553 553 }
554 554
555 555 //------------------------------------------------------------------------
556 556 template<class VC>
557 557 inline unsigned path_adapter<VC>::last_vertex(double* x, double* y) const
558 558 {
559   - return m_vertices.last_vertex(x, y);
  559 + return vertices_.last_vertex(x, y);
560 560 }
561 561
562 562 //------------------------------------------------------------------------
563 563 template<class VC>
564 564 inline unsigned path_adapter<VC>::prev_vertex(double* x, double* y) const
565 565 {
566   - return m_vertices.prev_vertex(x, y);
  566 + return vertices_.prev_vertex(x, y);
567 567 }
568 568
569 569 //------------------------------------------------------------------------
570 570 template<class VC>
571 571 inline double path_adapter<VC>::last_x() const
572 572 {
573   - return m_vertices.last_x();
  573 + return vertices_.last_x();
574 574 }
575 575
576 576 //------------------------------------------------------------------------
577 577 template<class VC>
578 578 inline double path_adapter<VC>::last_y() const
579 579 {
580   - return m_vertices.last_y();
  580 + return vertices_.last_y();
581 581 }
582 582
583 583 //------------------------------------------------------------------------
584 584 template<class VC>
585 585 inline unsigned path_adapter<VC>::vertex(unsigned idx, double* x, double* y) const
586 586 {
587   - return m_vertices.vertex(idx, x, y);
  587 + return vertices_.vertex(idx, x, y);
588 588 }
589 589
590 590 //------------------------------------------------------------------------
591 591 template<class VC>
592 592 inline unsigned path_adapter<VC>::command(unsigned idx) const
593 593 {
594   - return m_vertices.command(idx);
  594 + return vertices_.command(idx);
595 595 }
596 596
597 597 //------------------------------------------------------------------------
598 598 template<class VC>
599 599 void path_adapter<VC>::modify_vertex(unsigned idx, double x, double y)
600 600 {
601   - m_vertices.modify_vertex(idx, x, y);
  601 + vertices_.modify_vertex(idx, x, y);
602 602 }
603 603
604 604 //------------------------------------------------------------------------
605 605 template<class VC>
606 606 void path_adapter<VC>::modify_vertex(unsigned idx, double x, double y, unsigned cmd)
607 607 {
608   - m_vertices.modify_vertex(idx, x, y, cmd);
  608 + vertices_.modify_vertex(idx, x, y, cmd);
609 609 }
610 610
611 611 //------------------------------------------------------------------------
612 612 template<class VC>
613 613 void path_adapter<VC>::modify_command(unsigned idx, unsigned cmd)
614 614 {
615   - m_vertices.modify_command(idx, cmd);
  615 + vertices_.modify_command(idx, cmd);
616 616 }
617 617
618 618 //------------------------------------------------------------------------
619 619 template<class VC>
620 620 inline void path_adapter<VC>::rewind(unsigned path_id)
621 621 {
622   - m_iterator = path_id;
  622 + iterator_ = path_id;
623 623 }
624 624
625 625 //------------------------------------------------------------------------
626 626 template<class VC>
627 627 inline unsigned path_adapter<VC>::vertex(double* x, double* y)
628 628 {
629   - if(m_iterator >= m_vertices.total_vertices()) return path_cmd_stop;
630   - return m_vertices.vertex(m_iterator++, x, y);
  629 + if(iterator_ >= vertices_.total_vertices()) return path_cmd_stop;
  630 + return vertices_.vertex(iterator_++, x, y);
631 631 }
632 632
633 633 //------------------------------------------------------------------------
@@ -643,8 +643,8 @@ unsigned path_adapter<VC>::perceive_polygon_orientation(unsigned start,
643 643 for(i = 0; i < np; i++)
644 644 {
645 645 double x1, y1, x2, y2;
646   - m_vertices.vertex(start + i, &x1, &y1);
647   - m_vertices.vertex(start + (i + 1) % np, &x2, &y2);
  646 + vertices_.vertex(start + i, &x1, &y1);
  647 + vertices_.vertex(start + (i + 1) % np, &x2, &y2);
648 648 area += x1 * y2 - y1 * x2;
649 649 }
650 650 return (area < 0.0) ? path_flags_cw : path_flags_ccw;
@@ -655,23 +655,23 @@ template<class VC>
655 655 void path_adapter<VC>::invert_polygon(unsigned start, unsigned end)
656 656 {
657 657 unsigned i;
658   - unsigned tmp_cmd = m_vertices.command(start);
  658 + unsigned tmp_cmd = vertices_.command(start);
659 659
660 660 --end; // Make "end" inclusive
661 661
662 662 // Shift all commands to one position
663 663 for(i = start; i < end; i++)
664 664 {
665   - m_vertices.modify_command(i, m_vertices.command(i + 1));
  665 + vertices_.modify_command(i, vertices_.command(i + 1));
666 666 }
667 667
668 668 // Assign starting command to the ending command
669   - m_vertices.modify_command(end, tmp_cmd);
  669 + vertices_.modify_command(end, tmp_cmd);
670 670
671 671 // Reverse the polygon
672 672 while(end > start)
673 673 {
674   - m_vertices.swap_vertices(start++, end--);
  674 + vertices_.swap_vertices(start++, end--);
675 675 }
676 676 }
677 677
@@ -680,18 +680,18 @@ template<class VC>
680 680 void path_adapter<VC>::invert_polygon(unsigned start)
681 681 {
682 682 // Skip all non-vertices at the beginning
683   - while(start < m_vertices.total_vertices() &&
684   - !is_vertex(m_vertices.command(start))) ++start;
  683 + while(start < vertices_.total_vertices() &&
  684 + !is_vertex(vertices_.command(start))) ++start;
685 685
686 686 // Skip all insignificant move_to
687   - while(start+1 < m_vertices.total_vertices() &&
688   - is_move_to(m_vertices.command(start)) &&
689   - is_move_to(m_vertices.command(start+1))) ++start;
  687 + while(start+1 < vertices_.total_vertices() &&
  688 + is_move_to(vertices_.command(start)) &&
  689 + is_move_to(vertices_.command(start+1))) ++start;
690 690
691 691 // Find the last vertex
692 692 unsigned end = start + 1;
693   - while(end < m_vertices.total_vertices() &&
694   - !is_next_poly(m_vertices.command(end))) ++end;
  693 + while(end < vertices_.total_vertices() &&
  694 + !is_next_poly(vertices_.command(end))) ++end;
695 695
696 696 invert_polygon(start, end);
697 697 }
@@ -704,18 +704,18 @@ unsigned path_adapter<VC>::arrange_polygon_orientation(unsigned start,
704 704 if(orientation == path_flags_none) return start;
705 705
706 706 // Skip all non-vertices at the beginning
707   - while(start < m_vertices.total_vertices() &&
708   - !is_vertex(m_vertices.command(start))) ++start;
  707 + while(start < vertices_.total_vertices() &&
  708 + !is_vertex(vertices_.command(start))) ++start;
709 709
710 710 // Skip all insignificant move_to
711   - while(start+1 < m_vertices.total_vertices() &&
712   - is_move_to(m_vertices.command(start)) &&
713   - is_move_to(m_vertices.command(start+1))) ++start;
  711 + while(start+1 < vertices_.total_vertices() &&
  712 + is_move_to(vertices_.command(start)) &&
  713 + is_move_to(vertices_.command(start+1))) ++start;
714 714
715 715 // Find the last vertex
716 716 unsigned end = start + 1;
717   - while(end < m_vertices.total_vertices() &&
718   - !is_next_poly(m_vertices.command(end))) ++end;
  717 + while(end < vertices_.total_vertices() &&
  718 + !is_next_poly(vertices_.command(end))) ++end;
719 719
720 720 if(end - start > 2)
721 721 {
@@ -724,10 +724,10 @@ unsigned path_adapter<VC>::arrange_polygon_orientation(unsigned start,
724 724 // Invert polygon, set orientation flag, and skip all end_poly
725 725 invert_polygon(start, end);
726 726 unsigned cmd;
727   - while(end < m_vertices.total_vertices() &&
728   - is_end_poly(cmd = m_vertices.command(end)))
  727 + while(end < vertices_.total_vertices() &&
  728 + is_end_poly(cmd = vertices_.command(end)))
729 729 {
730   - m_vertices.modify_command(end++, set_orientation(cmd, orientation));
  730 + vertices_.modify_command(end++, set_orientation(cmd, orientation));
731 731 }
732 732 }
733 733 }
@@ -741,10 +741,10 @@ unsigned path_adapter<VC>::arrange_orientations(unsigned start,
741 741 {
742 742 if(orientation != path_flags_none)
743 743 {
744   - while(start < m_vertices.total_vertices())
  744 + while(start < vertices_.total_vertices())
745 745 {
746 746 start = arrange_polygon_orientation(start, orientation);
747   - if(is_stop(m_vertices.command(start)))
  747 + if(is_stop(vertices_.command(start)))
748 748 {
749 749 ++start;
750 750 break;
@@ -761,7 +761,7 @@ void path_adapter<VC>::arrange_orientations_all_paths(path_flags_e orientation)
761 761 if(orientation != path_flags_none)
762 762 {
763 763 unsigned start = 0;
764   - while(start < m_vertices.total_vertices())
  764 + while(start < vertices_.total_vertices())
765 765 {
766 766 start = arrange_orientations(start, orientation);
767 767 }
@@ -774,12 +774,12 @@ void path_adapter<VC>::flip_x(double x1, double x2)
774 774 {
775 775 unsigned i;
776 776 double x, y;
777   - for(i = 0; i < m_vertices.total_vertices(); i++)
  777 + for(i = 0; i < vertices_.total_vertices(); i++)
778 778 {
779   - unsigned cmd = m_vertices.vertex(i, &x, &y);
  779 + unsigned cmd = vertices_.vertex(i, &x, &y);
780 780 if(is_vertex(cmd))
781 781 {
782   - m_vertices.modify_vertex(i, x2 - x + x1, y);
  782 + vertices_.modify_vertex(i, x2 - x + x1, y);
783 783 }
784 784 }
785 785 }
@@ -790,12 +790,12 @@ void path_adapter<VC>::flip_y(double y1, double y2)
790 790 {
791 791 unsigned i;
792 792 double x, y;
793   - for(i = 0; i < m_vertices.total_vertices(); i++)
  793 + for(i = 0; i < vertices_.total_vertices(); i++)
794 794 {
795   - unsigned cmd = m_vertices.vertex(i, &x, &y);
  795 + unsigned cmd = vertices_.vertex(i, &x, &y);
796 796 if(is_vertex(cmd))
797 797 {
798   - m_vertices.modify_vertex(i, x, y2 - y + y1);
  798 + vertices_.modify_vertex(i, x, y2 - y + y1);
799 799 }
800 800 }
801 801 }
@@ -804,17 +804,17 @@ void path_adapter<VC>::flip_y(double y1, double y2)
804 804 template<class VC>
805 805 void path_adapter<VC>::translate(double dx, double dy, unsigned path_id)
806 806 {
807   - unsigned num_ver = m_vertices.total_vertices();
  807 + unsigned num_ver = vertices_.total_vertices();
808 808 for(; path_id < num_ver; path_id++)
809 809 {
810 810 double x, y;
811   - unsigned cmd = m_vertices.vertex(path_id, &x, &y);
  811 + unsigned cmd = vertices_.vertex(path_id, &x, &y);
812 812 if(is_stop(cmd)) break;
813 813 if(is_vertex(cmd))
814 814 {
815 815 x += dx;
816 816 y += dy;
817   - m_vertices.modify_vertex(path_id, x, y);
  817 + vertices_.modify_vertex(path_id, x, y);
818 818 }
819 819 }
820 820 }
@@ -824,15 +824,15 @@ template<class VC>
824 824 void path_adapter<VC>::translate_all_paths(double dx, double dy)
825 825 {
826 826 unsigned idx;
827   - unsigned num_ver = m_vertices.total_vertices();
  827 + unsigned num_ver = vertices_.total_vertices();
828 828 for(idx = 0; idx < num_ver; idx++)
829 829 {
830 830 double x, y;
831   - if(is_vertex(m_vertices.vertex(idx, &x, &y)))
  831 + if(is_vertex(vertices_.vertex(idx, &x, &y)))
832 832 {
833 833 x += dx;
834 834 y += dy;
835   - m_vertices.modify_vertex(idx, x, y);
  835 + vertices_.modify_vertex(idx, x, y);
836 836 }
837 837 }
838 838 }
@@ -846,25 +846,25 @@ template<class Container> class vertex_stl_adapter : boost::noncopyable
846 846 typedef typename vertex_type::value_type value_type;
847 847
848 848 explicit vertex_stl_adapter(Container & vertices)
849   - : m_vertices(vertices) {}
  849 + : vertices_(vertices) {}
850 850
851 851 void add_vertex(double x, double y, unsigned cmd)
852 852 {
853   - m_vertices.push_back(vertex_type(value_type(x),
  853 + vertices_.push_back(vertex_type(value_type(x),
854 854 value_type(y),
855 855 int8u(cmd)));
856 856 }
857 857
858 858 void modify_vertex(unsigned idx, double x, double y)
859 859 {
860   - vertex_type& v = m_vertices[idx];
  860 + vertex_type& v = vertices_[idx];
861 861 v.x = value_type(x);
862 862 v.y = value_type(y);
863 863 }
864 864
865 865 void modify_vertex(unsigned idx, double x, double y, unsigned cmd)
866 866 {
867   - vertex_type& v = m_vertices[idx];
  867 + vertex_type& v = vertices_[idx];
868 868 v.x = value_type(x);
869 869 v.y = value_type(y);
870 870 v.cmd = int8u(cmd);
@@ -872,61 +872,61 @@ template<class Container> class vertex_stl_adapter : boost::noncopyable
872 872
873 873 void modify_command(unsigned idx, unsigned cmd)
874 874 {
875   - m_vertices[idx].cmd = int8u(cmd);
  875 + vertices_[idx].cmd = int8u(cmd);
876 876 }
877 877
878 878 void swap_vertices(unsigned v1, unsigned v2)
879 879 {
880   - vertex_type t = m_vertices[v1];
881   - m_vertices[v1] = m_vertices[v2];
882   - m_vertices[v2] = t;
  880 + vertex_type t = vertices_[v1];
  881 + vertices_[v1] = vertices_[v2];
  882 + vertices_[v2] = t;
883 883 }
884 884
885 885 unsigned last_command() const
886 886 {
887   - return m_vertices.size() ?
888   - m_vertices[m_vertices.size() - 1].cmd :
  887 + return vertices_.size() ?
  888 + vertices_[vertices_.size() - 1].cmd :
889 889 (unsigned)path_cmd_stop;
890 890 }
891 891
892 892 unsigned last_vertex(double* x, double* y) const
893 893 {
894   - if(m_vertices.size() == 0)
  894 + if(vertices_.size() == 0)
895 895 {
896 896 *x = *y = 0.0;
897 897 return path_cmd_stop;
898 898 }
899   - return vertex(m_vertices.size() - 1, x, y);
  899 + return vertex(vertices_.size() - 1, x, y);
900 900 }
901 901
902 902 unsigned prev_vertex(double* x, double* y) const
903 903 {
904   - if(m_vertices.size() < 2)
  904 + if(vertices_.size() < 2)
905 905 {
906 906 *x = *y = 0.0;
907 907 return path_cmd_stop;
908 908 }
909   - return vertex(m_vertices.size() - 2, x, y);
  909 + return vertex(vertices_.size() - 2, x, y);
910 910 }
911 911
912 912 double last_x() const
913 913 {
914   - return m_vertices.size() ? m_vertices[m_vertices.size() - 1].x : 0.0;
  914 + return vertices_.size() ? vertices_[vertices_.size() - 1].x : 0.0;
915 915 }
916 916
917 917 double last_y() const
918 918 {
919   - return m_vertices.size() ? m_vertices[m_vertices.size() - 1].y : 0.0;
  919 + return vertices_.size() ? vertices_[vertices_.size() - 1].y : 0.0;
920 920 }
921 921
922 922 unsigned total_vertices() const
923 923 {
924   - return m_vertices.size();
  924 + return vertices_.size();
925 925 }
926 926
927 927 unsigned vertex(unsigned idx, double* x, double* y) const
928 928 {
929   - const vertex_type& v = m_vertices[idx];
  929 + const vertex_type& v = vertices_[idx];
930 930 *x = v.x;
931 931 *y = v.y;
932 932 return v.cmd;
@@ -934,11 +934,11 @@ template<class Container> class vertex_stl_adapter : boost::noncopyable
934 934
935 935 unsigned command(unsigned idx) const
936 936 {
937   - return m_vertices[idx].cmd;
  937 + return vertices_[idx].cmd;
938 938 }
939 939
940 940 private:
941   - Container & m_vertices;
  941 + Container & vertices_;
942 942 };
943 943
944 944

0 comments on commit a9cb163

Please sign in to comment.
Something went wrong with that request. Please try again.