GraphTool
1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
|
#include <main_controller.h>
Public Types | |
typedef SWUGraphBuilder | GraphBuilder |
Typedefs to make the application more generalized. | |
typedef SWUGraphModel | GraphModel |
typedef GraphBuilder::GraphType | GraphType |
Public Slots | |
void | search (std::string search_term, std::string search_type) |
bool | expand_item (std::string expand_item_, bool last, bool emit=true, bool update_focus=false, bool recursively=false) |
bool | contract_item (std::string item_name, bool last, bool emit=true) |
Contract an item, that is remove it from expanded items. More... | |
void | focus_item (std::string item_name) |
void | exclude_item (std::string item_name, bool last) |
void | remove_pre_filter (std::string filter_name, bool last=true) |
void | remove_post_filter (std::string filter_name, bool last=true) |
void | insert_pre_filter (std::string name, std::string type, bool hide, bool inverted_b, bool enabled, std::string color, std::string opacity, std::map< std::string, std::string > params, bool last) |
void | insert_post_filter (std::string name, std::string type, bool hide, bool inverted_b, bool enabled, std::string color, std::string opacity, std::map< std::string, std::string > params, bool last) |
void | update_pre_filter (std::string name, std::string type, bool hide, bool inverted_b, bool enabled, std::string color, std::string opacity, std::map< std::string, std::string > params, bool last) |
void | update_post_filter (std::string name, std::string type, bool hide, bool inverted_b, bool enabled, std::string color, std::string opacity, std::map< std::string, std::string > params, bool last) |
void | reset_all_pre_filters () |
void | reset_all_post_filters () |
Signals | |
void | graphChanged (std::string focus_node="", bool reset_zoom=false) |
void | unknownItem (std::string item_name) |
void | graphEmpty () |
void | duplicateFilterName (std::string filter_name) |
void | invalidFilterName (std::string filter_name) |
void | postFilterModelChanged () |
void | preFilterModelChanged () |
Public Member Functions | |
MainController () | |
virtual | ~MainController () |
std::vector< std::string > | excluded_nodes () |
QStringList | get_run_blocks () |
bool | was_any_node_focused () |
void | reinclude_excluded_node (std::string name) |
void | reinclude_all_excluded_nodes () |
void | undo_focused () |
void | add_to_focused (std::string name) |
void | load_from_xml (std::string file_name) |
void | load_diff_from_xml (std::string file_name) |
bool | save_to_graphviz (std::string file_name) |
GraphModel * | graphModel () |
GraphModel * | treeModel (bool dependents, bool dependencies) |
GraphModel * | emptyModel () |
GraphModel * | fullModel () |
bool | is_expanded (std::string item_name) |
bool | has_item (std::string item_name) |
bool | has_pre_layout_filters () |
bool | has_post_layout_filters () |
Check if it has pre layout filters. More... | |
void | set_linkler (Linkler *linkler, bool free=true) |
unsigned int | num_nodes () |
GraphType::node_value_type | item (std::string name) |
std::string | focus_item () const |
int | graph_width () const |
Get graph width. More... | |
int | graph_height () const |
Get graph height. More... | |
void | set_dependents (bool dependents) |
void | set_dependencies (bool dependencies) |
void | set_layout_type (std::string layout_type, bool relayout=true) |
void | import_filters (std::string file_path, bool clear=true) |
void | export_filters (std::string file_path) |
void | import_conditional_formattings (std::string file_path, bool clear=true) |
void | export_conditional_formattings (std::string file_path) |
GraphFilterList< GraphType > & | pre_filters () |
GraphFilterList< GraphType > & | post_filters () |
QStandardItemModel * | post_filter_model () |
QStandardItemModel * | pre_filter_model () |
The main controller class for the QT user interface of GraphTool. This controller class is used to drive the user interface. Primarily it is concerned with building and reconstructing the data model (graph model) on the basis of user interface actions.
MainController::MainController | ( | ) |
Constructor for the MainController
|
virtual |
Destructor for the MainController
void MainController::add_to_focused | ( | std::string | name | ) |
Method for adding the currently focused node to a list of focused nodes(used for undoing focus)
name | The name of the node currently focused |
|
slot |
Contract an item, that is remove it from expanded items.
Slot used to conract a previously expanded item. Will emit the signal graphChanged based on whether emit = true and last = true.
item_name | The name of the item to contract |
last | Whether this is the last contraction or more are coming |
emit | Whether or not to emit an update signal |
|
signal |
filter_name |
MainController::GraphModel * MainController::emptyModel | ( | ) |
Provides an empty model on the basis of the current graph
|
slot |
Slot for excluding items from the graph
item_name | The name of the item to be excluded |
last | True if it is the last item to be excluded, false if not |
std::vector< std::string > MainController::excluded_nodes | ( | ) |
An accessor method for the nodes currently excluded by the graph in the node exclusion filter
|
slot |
Slot for expanding a certain item in the graph
expand_item | The name of the item to be expanded |
last | True if it is the last item to be expanded, false if not |
emit | True(default) if it should emit the signal graphChanged(), false if it should not. |
update_focus | True if it should update the focus, false(default) if it should not |
void MainController::export_conditional_formattings | ( | std::string | file_path | ) |
file_path |
void MainController::export_filters | ( | std::string | file_path | ) |
Export the current list of filters to file with path file_path
file_path |
std::string MainController::focus_item | ( | ) | const |
Accessor for the name of the item currently being focused(used as root) in the graph
|
slot |
Slot for changing the current focus
item_name | The name of the item to be focused on |
MainController::GraphModel * MainController::fullModel | ( | ) |
Provides a full model of the graph
QStringList MainController::get_run_blocks | ( | ) |
Accessor to the names of all run blocks in the graph
int MainController::graph_height | ( | ) | const |
Get graph height.
Accessor for the height of the graph
int MainController::graph_width | ( | ) | const |
Get graph width.
Accessor for the width of the graph
|
signal |
focus_node | The node to focus on in the graph, ie. center in the graph |
reset_zoom | Whether to reset zoom or not |
MainController::GraphModel * MainController::graphModel | ( | ) |
Fetch a model of the current graph
bool MainController::has_item | ( | std::string | item_name | ) |
Check if an item exists in the current graph
item_name | The name of the item to check for |
bool MainController::has_post_layout_filters | ( | ) |
Check if it has pre layout filters.
Accessor for checking if there are any conditional formattings
bool MainController::has_pre_layout_filters | ( | ) |
Accessor for checking if there are any filters
void MainController::import_conditional_formattings | ( | std::string | file_path, |
bool | clear = true |
||
) |
file_path | |
clear |
void MainController::import_filters | ( | std::string | file_path, |
bool | clear = true |
||
) |
file_path | |
clear |
|
slot |
Slot for creating a conditional formatting from a set of conditional formatting params and inserting it into the conditional formatting set
name | The name of the conditional formatting |
type | The type of the conditional formatting |
hide | True if the conditional formatting should hide matches, false if not |
inverted_b | True if the conditional formatting should be inverted, false if not |
enabled | True if the conditional formatting should be enabled, false if not |
color | A string representing the color, if applicable. |
opacity | A string representing the opacity, if applicable. |
params | A set of conditional formatting type specific params |
last | True if this is the last conditional formatting to be inserted(right now), false if not |
|
slot |
Slot for creating a filter from a set of filter params and inserting it into the filter set
name | The name of the filter |
type | The type of the filter |
hide | True if the filter should hide matches, false if not |
inverted_b | True if the filter should be inverted, false if not |
enabled | True if the filter should be enabled, false if not |
color | A string representing the color, if applicable. |
opacity | A string representing the opacity, if applicable. |
params | A set of filter type specific params |
last | True if this is the last filter to be inserted(right now), false if not |
|
signal |
filter_name |
bool MainController::is_expanded | ( | std::string | item_name | ) |
Whether or not a given item is expanded
Provide | the node name for which to check if it is expanded or not |
MainController::GraphType::node_value_type MainController::item | ( | std::string | name | ) |
Accessor for getting specific node items from the builder holding the item
name | The name of the item to fetch |
void MainController::load_diff_from_xml | ( | std::string | file_name | ) |
Load a new graph from XML stored in file_name and create a diff between the new and the old graph
file_name | The name of the file to be loaded |
Clear previous static diff filters
void MainController::load_from_xml | ( | std::string | file_name | ) |
Load a new graph from XML stored in file_name
file_name | The name of the file to be loaded |
unsigned int MainController::num_nodes | ( | ) |
Accessor for the amount of nodes currently in the graph
QStandardItemModel * MainController::post_filter_model | ( | ) |
Accessor for the filter model
|
inline |
Retrieve the List of all post filters currently active
QStandardItemModel * MainController::pre_filter_model | ( | ) |
Accessor for the conditional formatting model
|
inline |
Retrieve the List of all pre filters currently active
void MainController::reinclude_all_excluded_nodes | ( | ) |
Method for clearing the exclusion filter and thereby reincluding all excluded nodes in the graph
void MainController::reinclude_excluded_node | ( | std::string | name | ) |
Method for reincluding excluded nodes in the graph
name | The name of the node to be reincluded |
|
slot |
Slot for removing specific conditional formattings from the conditional formatting set
filter_name | The name of the conditional formatting to be removed |
last | True(default) if it is the last conditional formatting to be removed, false if not |
|
slot |
Slot for removing specific filters from the filter set
filter_name | The name of the filter to be removed |
last | True(default) if it is the last filter to be removed, false if not |
|
slot |
Slot for removing all conditional formattings from MainController
|
slot |
Slot for removing all filters from MainController
bool MainController::save_to_graphviz | ( | std::string | file_name | ) |
Save the current graph to graphml
file_name | The name of the file to be saved |
|
slot |
Search for a specific item or run block
search_term | |
search_type |
void MainController::set_dependencies | ( | bool | dependencies | ) |
Set whether dependencies should be graphed or not
dependencies | True if dependencies should be graphed, false if not |
void MainController::set_dependents | ( | bool | dependents | ) |
Set whether dependents should be graphed or not
dependents | True if dependents should be graphed, false if not |
void MainController::set_layout_type | ( | std::string | layout_type, |
bool | relayout = true |
||
) |
Set the type of layout
layout_type | The layout type {Bubble, Hierarchical, Force} |
relayout | True if force relayout of the graph(default), false if not |
void MainController::set_linkler | ( | Linkler * | linkler, |
bool | free = true |
||
) |
Set the linkler of the MainController
linkler | A reference to the new linkler |
free | Whether or not to free the memory associated with the old linkler (sometimes we might need to old linkler, so then do not free) |
MainController::GraphModel * MainController::treeModel | ( | bool | dependents, |
bool | dependencies | ||
) |
Provedes a tree consisting of incoming/outgoing/both
dependents | True if dependents should be included in the treemodel, false if not |
dependencies | True if dependencies should be included in the treemodel, false if not |
void MainController::undo_focused | ( | ) |
Method for undoing the previously focused node
|
slot |
Slot for creating a conditional formatting from a set of conditional formatting params and inserting it into the conditional formatting set What it really does it that it removes the conditional formatting with the same name then adding the new conditional formatting to the set.
name | The name of the conditional formatting |
type | The type of the conditional formatting |
hide | True if the conditional formatting should hide matches, false if not |
inverted_b | True if the conditional formatting should be inverted, false if not |
enabled | True if the conditional formatting should be enabled, false if not |
color | A string representing the color, if applicable. |
opacity | A string representing the opacity, if applicable. |
params | A set of conditional formatting type specific params |
last | True if this is the last conditional formatting to be inserted(right now), false if not |
|
slot |
Slot for "updating" a filter from a set of filter params and inserting it into the filter set. What it really does it that it removes the filter with the same name then adding the new filter to the set.
name | The name of the filter |
type | The type of the filter |
hide | True if the filter should hide matches, false if not |
inverted_b | True if the filter should be inverted, false if not |
enabled | True if the filter should be enabled, false if not |
color | A string representing the color, if applicable. |
opacity | A string representing the opacity, if applicable. |
params | A set of filter type specific params |
last | True if this is the last filter to be inserted(right now), false if not |
bool MainController::was_any_node_focused | ( | ) |
Method for checking whether any node has been focused(used as root) in the graph