Advertisement
Guest User

renderGraph.hpp

a guest
May 7th, 2014
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #ifndef RENDERGRAPH_HPP
  2. #define RENDERGRAPH_HPP
  3.  
  4. #include "entity.hpp"
  5.  
  6. class RenderGraph {
  7. public:
  8.     void SetEntities( const std::vector< Entity* >& a_entities );
  9.     void CalculateDependencies();
  10.     void Sort( std::vector< Entity* >& a_output );
  11.  
  12. private:
  13.     struct Node {
  14.         Node( Entity* a_entity );
  15.  
  16.         Entity* entity_;
  17.         std::vector< Node* > dependencies_;
  18.         int isoDepth_;
  19.         bool visited_;
  20.     };
  21.  
  22.     void VisitNode( int& sortDepth, Node* a_node );
  23.  
  24.     struct Comparator {
  25.         bool operator()( const Node& a_lhs, const Node& a_rhs ) const;
  26.     };
  27.  
  28.     std::vector< Node > nodes_;
  29. };
  30.  
  31. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement