NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
dependencydialog.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2019 Erik Haenel et al.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17******************************************************************************/
18
19#ifndef DEPENDENCYDIALOG_HPP
20#define DEPENDENCYDIALOG_HPP
21
22#include <wx/wx.h>
23#include <string>
24#include <map>
25#include <vector>
26#include "../controls/treelistctrl.h"
27#include "../../kernel/core/procedure/procedurelibrary.hpp"
28#include "../../kernel/core/procedure/dependency.hpp"
29#include "../../common/datastructures.h"
30
35class DependencyDialog : public wxDialog
36{
37 private:
38 wxcode::wxTreeListCtrl* m_dependencyTree;
39 wxTreeItemId m_selectedItem;
40 std::string m_mainProcedure;
41 std::map<std::string, DependencyList> m_deps;
42
43 void calculateDependencies(ProcedureLibrary& lib, const std::string& mainfile);
44 void fillDependencyTree();
45 void insertChilds(wxTreeItemId item, const std::string& sParentProcedure);
46 bool findInParents(wxTreeItemId item, const std::string& sCurrProc);
47
48 void CollapseAll(wxTreeItemId item);
49 std::vector<std::string> parseNameSpace(std::string sNameSpace) const;
50 int calculateClusterLevel(const std::vector<std::string>& sCurrentNameSpace, const std::vector<std::string>& sNewNameSpace);
51 void CreateDotFile();
52
53 void OnItemActivate(wxTreeEvent& event);
54 void OnItemRightClick(wxTreeEvent& event);
55 void OnMenuEvent(wxCommandEvent& event);
56
57 public:
58 DependencyDialog(wxWindow* parent, wxWindowID id, const wxString& title, const std::string& mainfile, ProcedureLibrary& lib, long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
59
61};
62
63
64#endif // DEPENDENCYDIALOG_HPP
65
66
This class represents a dialog showing the dependencies of a selected procedure file.
std::string m_mainProcedure
DependencyDialog(wxWindow *parent, wxWindowID id, const wxString &title, const std::string &mainfile, ProcedureLibrary &lib, long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
Constructor. Creates the UI elements and calls the dependency walker.
void OnMenuEvent(wxCommandEvent &event)
This private member function handles all menu events yielded by clicking on an item of the popup menu...
wxTreeItemId m_selectedItem
void OnItemRightClick(wxTreeEvent &event)
This private member function shows the popup menu on a right click on any tree item.
std::map< std::string, DependencyList > m_deps
void calculateDependencies(ProcedureLibrary &lib, const std::string &mainfile)
This private member function calculates the dependencies of the current selected main file....
std::vector< std::string > parseNameSpace(std::string sNameSpace) const
Convert a name space into a vector of single namespaces for easier comparison.
void CreateDotFile()
This member function handles the creation of GraphViz DOT files.
void CollapseAll(wxTreeItemId item)
This private member function will collapse the current item and all corresponding subitems.
void OnItemActivate(wxTreeEvent &event)
This private member function is the event handler for double clicking on an item in the dependency tr...
int calculateClusterLevel(const std::vector< std::string > &sCurrentNameSpace, const std::vector< std::string > &sNewNameSpace)
This private member function calculates the level of nested clusters needed to correctly visualize th...
void fillDependencyTree()
This private member function fills the tree in the UI with the calculated dependencies....
wxcode::wxTreeListCtrl * m_dependencyTree
bool findInParents(wxTreeItemId item, const std::string &sCurrProc)
This private member function searches the procedure call in the parents of the current branch.
void insertChilds(wxTreeItemId item, const std::string &sParentProcedure)
This private member function is called recursively to fill the childs of a procedure call....
This class manages all already read and possibly pre-parsed procedure files for easier and faster acc...