comparison OrthancStone/Sources/Toolbox/UnionOfRectangles.cpp @ 1878:c9ccd13c6a3c

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Jan 2022 08:27:26 +0100
parents b1f510e601d2
children e318b524ad3f
comparison
equal deleted inserted replaced
1877:a2955abe4c2e 1878:c9ccd13c6a3c
95 { 95 {
96 private: 96 private:
97 Operation operation_; 97 Operation operation_;
98 98
99 public: 99 public:
100 Visitor(Operation operation) : 100 explicit Visitor(Operation operation) :
101 operation_(operation) 101 operation_(operation)
102 { 102 {
103 } 103 }
104 104
105 virtual void Visit(const SegmentTree& node, 105 virtual void Visit(const SegmentTree& node,
479 **/ 479 **/
480 std::vector<HorizontalJunction> horizontalJunctions; 480 std::vector<HorizontalJunction> horizontalJunctions;
481 horizontalJunctions.reserve(2 * verticalEdges.size()); 481 horizontalJunctions.reserve(2 * verticalEdges.size());
482 482
483 for (std::list<Internals::OrientedIntegerLine2D>::const_iterator 483 for (std::list<Internals::OrientedIntegerLine2D>::const_iterator
484 it = verticalEdges.begin(); it != verticalEdges.end(); it++) 484 it = verticalEdges.begin(); it != verticalEdges.end(); ++it)
485 { 485 {
486 assert(it->GetX1() == it->GetX2()); 486 assert(it->GetX1() == it->GetX2());
487 horizontalJunctions.push_back(HorizontalJunction(it->GetX1(), it->GetY1(), it->GetY2(), it->IsDownward())); 487 horizontalJunctions.push_back(HorizontalJunction(it->GetX1(), it->GetY1(), it->GetY2(), it->IsDownward()));
488 horizontalJunctions.push_back(HorizontalJunction(it->GetX1(), it->GetY2(), it->GetY1(), it->IsDownward())); 488 horizontalJunctions.push_back(HorizontalJunction(it->GetX1(), it->GetY2(), it->GetY1(), it->IsDownward()));
489 } 489 }
516 **/ 516 **/
517 std::vector<Internals::OrientedIntegerLine2D> allEdges; 517 std::vector<Internals::OrientedIntegerLine2D> allEdges;
518 allEdges.reserve(horizontalEdges.size() + verticalEdges.size()); 518 allEdges.reserve(horizontalEdges.size() + verticalEdges.size());
519 519
520 for (std::list<Internals::OrientedIntegerLine2D>::const_iterator 520 for (std::list<Internals::OrientedIntegerLine2D>::const_iterator
521 it = horizontalEdges.begin(); it != horizontalEdges.end(); it++) 521 it = horizontalEdges.begin(); it != horizontalEdges.end(); ++it)
522 { 522 {
523 allEdges.push_back(*it); 523 allEdges.push_back(*it);
524 } 524 }
525 525
526 for (std::list<Internals::OrientedIntegerLine2D>::const_iterator 526 for (std::list<Internals::OrientedIntegerLine2D>::const_iterator
527 it = verticalEdges.begin(); it != verticalEdges.end(); it++) 527 it = verticalEdges.begin(); it != verticalEdges.end(); ++it)
528 { 528 {
529 allEdges.push_back(*it); 529 allEdges.push_back(*it);
530 } 530 }
531 531
532 assert(allEdges.size() == horizontalEdges.size() + verticalEdges.size()); 532 assert(allEdges.size() == horizontalEdges.size() + verticalEdges.size());