visualizations

Programmatic visualizations
git clone git://git.laack.co/visualizations.git
Log | Files | Refs | README

graph.hpp (654B)


      1 #pragma once
      2 
      3 #include <string>
      4 #include <unordered_map>
      5 #include <vector>
      6 #include "edge.hpp"
      7 #include "vertex.hpp"
      8 
      9 class Graph {
     10     private:
     11         std::unordered_map<std::size_t, std::vector<Edge>> edges {};
     12         std::vector<Vertex> vertices {};
     13     public:
     14         // based on the edgeCount and vertCount, random edges and vertices will be created.
     15         Graph(std::size_t edgeCount, std::size_t vertCount, float xMax, float yMax);
     16         std::string toString();
     17         void render();
     18         void traverseVertexIdx(std::size_t idx);
     19         std::vector<Edge> getEdgesOfVertexIdx(std::size_t idx);
     20         void setEdgeTraversed(Edge e);
     21 };