Maximum Acyclic Subgraph - Multiple Sequence Alignment
MaximumAcyclicSubgraph
|
This Class stores Methods which manipulates a window in terms of a MAS Game-Structure. More...
#include <GraphRenderer.h>
Public Member Functions | |
GraphRenderer (sf::RenderWindow &window, Gamemaster &gamemaster, float xoffset) | |
GraphRenderer () | |
void | render (sf::RenderWindow &window, vector< DrawNode > &Nodes, vector< Node > &nodeList) |
void | eventHandler (const sf::Event event, sf::RenderWindow &window, vector< Node > &nodeList, Gamemaster &gamemaster, const sf::Vector2f &mouse_pos) |
void | display_score (sf::RenderWindow &window, const state &gamestate) |
void | update (float delta) |
void | animation (sf::RenderWindow &window, Gamemaster &gamemaster, vector< Node > &nodeList, Button &menuButton) |
bool | getAnimate () |
void | updateBoundaries (const vector< DrawNode > &Nodes) |
Protected Attributes | |
std::vector< FuncArrowShape > | consistentEdges |
vector of FuncArrowShapes which represent consistent edges | |
std::vector< FuncArrowShape > | selectedEdges |
vector of FuncArrowShapes which represent selected edges | |
std::vector< ArrowShape > | rowArrows |
vector of ArrowShapes which get drawed only in a row | |
std::vector< std::vector< sf::RectangleShape > > | rects |
vector of vector of rectangles where a rectangle represent a node (with analogue indices) | |
std::vector< TextProps > | txt |
vector of textproperties to draw Node strings | |
sf::Vector2i | hoverPosition |
a index vector for the actual hovered Node | |
sf::Vector2i | clickPosition |
a index vector for the actual clicked Node | |
sf::Color | colorOfClickedNode |
the color of the Node rectangle, which is in the position of the clickPosition | |
unsigned | maxNodesPerRow |
an upper bound for the row lengths | |
unsigned | maxSequences |
an upper boudn for the column lengths | |
int | sizeConstant |
a constant which defines the scale of the visuals | |
float | offset |
a constant which make a offset on the upper horizontal | |
float | moveConstant |
a (upper bound) constant which is used to scroll in terms of computer speed | |
vector< float > | boundary |
a vector which save the maximum amount of nodes in each direction | |
vector< float > | direction |
a vector of 2 floats which saves the scrolled way of the view | |
This Class stores Methods which manipulates a window in terms of a MAS Game-Structure.
This Class Stores different functionalitys: The shape and text data which visualize the Graph via the window and a seperate Draw function, the functions which give the Graph functionality and the functions which implement general functionalitys.
an explanation: The Class will get initialized with vectors which have the data of all nodes and edges we're looking for, which is a constant, that is used to scale the visuals in terms of it (see next point) and what is a reference to the window u want to manipulate.
We got in the window rectangles and arrows between them. In coordinates would hold:
GraphRenderer::GraphRenderer | ( | sf::RenderWindow & | window, |
Gamemaster & | gamemaster, | ||
float | xoffset | ||
) |
a function for the animation
window | is the current RenderWindow |
gamemaster | contains the current coordinates of all nodes |
nodeList | contains all nodes |
menuButton | is the button to return to the menu The Complete Constructor, which initialize the visuals in the referenced window. |
window | a renderWindow what gets the drawed shapes and texts |
nodeList | a vector of Nodes we use for the game (shape inits) |
edgeList | a vector of Edges we use for the game (state inits) |
GraphRenderer::GraphRenderer | ( | ) |
The standard constructor, which do nothing.
void GraphRenderer::animation | ( | sf::RenderWindow & | window, |
Gamemaster & | gamemaster, | ||
vector< Node > & | nodeList, | ||
Button & | menuButton | ||
) |
a function which initialize the shapes and texts in terms of the NodeList. this is only called in the constructor.
nodeList | a vector of Nodes which we want to draw as rectangles with text |
void GraphRenderer::display_score | ( | sf::RenderWindow & | window, |
const state & | gamestate | ||
) |
a function which display the current score of the game
window | a renderWindow what gets the new score |
gamestate | is the current state of the game |
void GraphRenderer::eventHandler | ( | const sf::Event | event, |
sf::RenderWindow & | window, | ||
vector< Node > & | nodeList, | ||
Gamemaster & | gamemaster, | ||
const sf::Vector2f & | mouse_pos | ||
) |
a function which handles events that are given by argument and make adjustments in the argument window
window | a renderWindow which is needed to get informations (i.e. mousepos) |
event | a Event which will describe the event that will happen |
nodeList | a vector of Nodes which is needed for a few methods |
mouse_pos | the current mouse position |
bool GraphRenderer::getAnimate | ( | ) |
void GraphRenderer::render | ( | sf::RenderWindow & | window, |
vector< DrawNode > & | Nodes, | ||
vector< Node > & | nodeList | ||
) |
a function which draw the shapes of the class in the argument window
window | a renderWindow what gets the drawed shapes and texts |
void GraphRenderer::update | ( | float | delta | ) |
a function which set an upper bound for the scroll speed via the arrow buttons.
delta | a float which gets the upper bound |