1 #ifndef GraphRenderer_H_ 2 #define GraphRenderer_H_ 4 #include <SFML/Graphics.hpp> 5 #include <SFML/Window.hpp> 6 #include <SFML/Graphics/RectangleShape.hpp> 12 #include "colorlist.h" 14 #include "../alignment/Graph.h" 15 #include "../alignment/Edge.h" 16 #include "../alignment/State.h" 17 #include "../alignment/DrawNode.h" 18 #include "ArrowShape.h" 19 #include "FuncArrowShape.h" 21 #include "../GameMain/Gamemaster.h" 54 std::vector<std::vector<sf::RectangleShape>>
rects;
55 std::vector<TextProps>
txt;
75 vector<DrawNode> new_nodes;
76 vector<DrawNode> old_nodes;
80 std::vector<DrawNode> updateDrawNode(vector<Node>& nodeList);
82 void initShapes(
const vector<DrawNode>& Nodes,
const vector<Node>& nodeList);
83 void setCoords(
const vector<DrawNode>& Nodes,
const vector<Node>& nodeList);
91 void drawShape(sf::RenderWindow& window);
99 void drawText(sf::RenderWindow& window);
107 void moveWindow(
int dir);
116 void showEdges(vector<Node>& nodeList, vector<DrawNode>& Nodes, sf::Vector2f pos,
state& gameState);
122 void selectEdge(vector<Node>& nodeList,
Gamemaster& gamemaster);
130 void hoverNode(vector<Node>& nodeList, vector<DrawNode>& Nodes, sf::Vector2f pos);
144 void hoverEdge(sf::Vector2f pos);
158 void clickNode(vector<Node>& nodeList, vector<DrawNode>& Nodes, sf::Vector2f pos);
175 Node* positionToNode(sf::Vector2f pos, vector<Node>& nodeList, vector<DrawNode>& Nodes);
184 sf::Vector2f positionToCoords(sf::Vector2f pos);
192 bool isPositionEdge(sf::Vector2f pos);
200 bool isPositionNode(sf::Vector2f pos, vector<DrawNode>& Nodes, vector<Node>& nodeList);
235 void render(sf::RenderWindow& window, vector<DrawNode>& Nodes, vector<Node>& nodeList);
247 void eventHandler(
const sf::Event event, sf::RenderWindow& window, vector<Node>& nodeList,
248 Gamemaster& gamemaster,
const sf::Vector2f& mouse_pos);
282 void updateBoundaries(
const vector<DrawNode>& Nodes);
285 #endif //GraphRenderer_H_ std::vector< FuncArrowShape > consistentEdges
vector of FuncArrowShapes which represent consistent edges
Definition: GraphRenderer.h:51
std::vector< ArrowShape > rowArrows
vector of ArrowShapes which get drawed only in a row
Definition: GraphRenderer.h:53
void animation(sf::RenderWindow &window, Gamemaster &gamemaster, vector< Node > &nodeList, Button &menuButton)
Definition: GraphRenderer.cc:525
float offset
a constant which make a offset on the upper horizontal
Definition: GraphRenderer.h:62
Definition: Gamemaster.h:11
unsigned maxNodesPerRow
an upper bound for the row lengths
Definition: GraphRenderer.h:59
void display_score(sf::RenderWindow &window, const state &gamestate)
Definition: GraphRenderer.cc:86
unsigned maxSequences
an upper boudn for the column lengths
Definition: GraphRenderer.h:60
bool getAnimate()
Definition: GraphRenderer.cc:559
std::vector< TextProps > txt
vector of textproperties to draw Node strings
Definition: GraphRenderer.h:55
vector< float > boundary
a vector which save the maximum amount of nodes in each direction
Definition: GraphRenderer.h:64
std::vector< std::vector< sf::RectangleShape > > rects
vector of vector of rectangles where a rectangle represent a node (with analogue indices) ...
Definition: GraphRenderer.h:54
GraphRenderer()
Definition: GraphRenderer.cc:189
sf::Vector2i clickPosition
a index vector for the actual clicked Node
Definition: GraphRenderer.h:57
void update(float delta)
Definition: GraphRenderer.cc:111
vector< float > direction
a vector of 2 floats which saves the scrolled way of the view
Definition: GraphRenderer.h:65
void eventHandler(const sf::Event event, sf::RenderWindow &window, vector< Node > &nodeList, Gamemaster &gamemaster, const sf::Vector2f &mouse_pos)
Definition: GraphRenderer.cc:35
This state class encapsulates the current game state. It can output possible actions and select them...
Definition: State.h:16
sf::Color colorOfClickedNode
the color of the Node rectangle, which is in the position of the clickPosition
Definition: GraphRenderer.h:58
std::vector< FuncArrowShape > selectedEdges
vector of FuncArrowShapes which represent selected edges
Definition: GraphRenderer.h:52
sf::Vector2i hoverPosition
a index vector for the actual hovered Node
Definition: GraphRenderer.h:56
float moveConstant
a (upper bound) constant which is used to scroll in terms of computer speed
Definition: GraphRenderer.h:63
int sizeConstant
a constant which defines the scale of the visuals
Definition: GraphRenderer.h:61
void render(sf::RenderWindow &window, vector< DrawNode > &Nodes, vector< Node > &nodeList)
Definition: GraphRenderer.cc:10
This Class stores Methods which manipulates a window in terms of a MAS Game-Structure.
Definition: GraphRenderer.h:40