Contour.h 605 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <vector>
  3. #include "EdgeHolder.h"
  4. namespace msdfgen {
  5. /// A single closed contour of a shape.
  6. class Contour {
  7. public:
  8. /// The sequence of edges that make up the contour.
  9. std::vector<EdgeHolder> edges;
  10. /// Adds an edge to the contour.
  11. void addEdge(const EdgeHolder &edge);
  12. #ifdef MSDFGEN_USE_CPP11
  13. void addEdge(EdgeHolder &&edge);
  14. #endif
  15. /// Creates a new edge in the contour and returns its reference.
  16. EdgeHolder & addEdge();
  17. /// Computes the bounding box of the contour.
  18. void bounds(double &l, double &b, double &r, double &t) const;
  19. };
  20. }