NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
DependencyDialog Class Reference

This class represents a dialog showing the dependencies of a selected procedure file. More...

#include <dependencydialog.hpp>

Inheritance diagram for DependencyDialog:
Collaboration diagram for DependencyDialog:

Public Member Functions

 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. More...
 
 DECLARE_EVENT_TABLE ()
 

Private Member Functions

void calculateDependencies (ProcedureLibrary &lib, const std::string &mainfile)
 This private member function calculates the dependencies of the current selected main file. It will fill the map with additional items calculated from the called procedures. More...
 
void fillDependencyTree ()
 This private member function fills the tree in the UI with the calculated dependencies. It will call the function DependencyDialog::insertChilds() recursively to fill the childs of a procedure call. More...
 
void insertChilds (wxTreeItemId item, const std::string &sParentProcedure)
 This private member function is called recursively to fill the childs of a procedure call. The recursion is stopped at the end of a branch or if the branch itself is a recursion. More...
 
bool findInParents (wxTreeItemId item, const std::string &sCurrProc)
 This private member function searches the procedure call in the parents of the current branch. More...
 
void CollapseAll (wxTreeItemId item)
 This private member function will collapse the current item and all corresponding subitems. More...
 
std::vector< std::string > parseNameSpace (std::string sNameSpace) const
 Convert a name space into a vector of single namespaces for easier comparison. More...
 
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 the nested namespaces. More...
 
void CreateDotFile ()
 This member function handles the creation of GraphViz DOT files. More...
 
void OnItemActivate (wxTreeEvent &event)
 This private member function is the event handler for double clicking on an item in the dependency tree. More...
 
void OnItemRightClick (wxTreeEvent &event)
 This private member function shows the popup menu on a right click on any tree item. More...
 
void OnMenuEvent (wxCommandEvent &event)
 This private member function handles all menu events yielded by clicking on an item of the popup menu. More...
 

Private Attributes

wxcode::wxTreeListCtrl * m_dependencyTree
 
wxTreeItemId m_selectedItem
 
std::string m_mainProcedure
 
std::map< std::string, DependencyListm_deps
 

Detailed Description

This class represents a dialog showing the dependencies of a selected procedure file.

Definition at line 35 of file dependencydialog.hpp.

Constructor & Destructor Documentation

◆ DependencyDialog()

DependencyDialog::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.

Parameters
parentwxWindow*
idwxWindowID
titleconst wxString&
mainfileconst string&
libProcedureLibrary&
stylelong

Definition at line 51 of file dependencydialog.cpp.

References _guilang, and Language::get().

Here is the call graph for this function:

Member Function Documentation

◆ calculateClusterLevel()

int DependencyDialog::calculateClusterLevel ( const std::vector< std::string > &  sCurrentNameSpace,
const std::vector< std::string > &  sNewNameSpace 
)
private

This private member function calculates the level of nested clusters needed to correctly visualize the nested namespaces.

Parameters
sCurrentNameSpaceconst std::vector<std::string>&
sNewNameSpaceconst std::vector<std::string>&
Returns
int

Definition at line 310 of file dependencydialog.cpp.

Referenced by CreateDotFile().

◆ calculateDependencies()

void DependencyDialog::calculateDependencies ( ProcedureLibrary lib,
const std::string &  mainfile 
)
private

This private member function calculates the dependencies of the current selected main file. It will fill the map with additional items calculated from the called procedures.

Parameters
libProcedureLibrary&
mainfileconst string&
Returns
void

Definition at line 83 of file dependencydialog.cpp.

References ProcedureElement::getDependencies(), Dependencies::getDependencyMap(), Dependencies::getMainProcedure(), ProcedureLibrary::getProcedureContents(), m_deps, m_mainProcedure, and replacePathSeparator().

Here is the call graph for this function:

◆ CollapseAll()

void DependencyDialog::CollapseAll ( wxTreeItemId  item)
private

This private member function will collapse the current item and all corresponding subitems.

Parameters
itemwxTreeItemId
Returns
void

Definition at line 256 of file dependencydialog.cpp.

References CollapseAll(), and m_dependencyTree.

Referenced by CollapseAll(), and OnMenuEvent().

Here is the call graph for this function:

◆ CreateDotFile()

void DependencyDialog::CreateDotFile ( )
private

This member function handles the creation of GraphViz DOT files.

Returns
void

Definition at line 341 of file dependencydialog.cpp.

References _guilang, calculateClusterLevel(), Language::get(), m_deps, parseNameSpace(), and toString().

Referenced by OnMenuEvent().

Here is the call graph for this function:

◆ DECLARE_EVENT_TABLE()

DependencyDialog::DECLARE_EVENT_TABLE ( )

◆ fillDependencyTree()

void DependencyDialog::fillDependencyTree ( )
private

This private member function fills the tree in the UI with the calculated dependencies. It will call the function DependencyDialog::insertChilds() recursively to fill the childs of a procedure call.

Returns
void

Definition at line 135 of file dependencydialog.cpp.

References insertChilds(), m_dependencyTree, m_deps, and m_mainProcedure.

Here is the call graph for this function:

◆ findInParents()

bool DependencyDialog::findInParents ( wxTreeItemId  item,
const std::string &  sCurrProc 
)
private

This private member function searches the procedure call in the parents of the current branch.

Parameters
itemwxTreeItemId
sCurrProcconst string&
Returns
bool

Definition at line 227 of file dependencydialog.cpp.

References m_dependencyTree.

Referenced by insertChilds().

◆ insertChilds()

void DependencyDialog::insertChilds ( wxTreeItemId  item,
const std::string &  sParentProcedure 
)
private

This private member function is called recursively to fill the childs of a procedure call. The recursion is stopped at the end of a branch or if the branch itself is a recursion.

Parameters
itemwxTreeItemId
sParentProcedureconst string&
Returns
void

Definition at line 183 of file dependencydialog.cpp.

References findInParents(), insertChilds(), m_dependencyTree, and m_deps.

Referenced by fillDependencyTree(), and insertChilds().

Here is the call graph for this function:

◆ OnItemActivate()

void DependencyDialog::OnItemActivate ( wxTreeEvent &  event)
private

This private member function is the event handler for double clicking on an item in the dependency tree.

Parameters
eventwxTreeEvent&
Returns
void

Definition at line 478 of file dependencydialog.cpp.

References NumeReWindow::FindAndOpenProcedure(), and m_dependencyTree.

Here is the call graph for this function:

◆ OnItemRightClick()

void DependencyDialog::OnItemRightClick ( wxTreeEvent &  event)
private

This private member function shows the popup menu on a right click on any tree item.

Parameters
eventwxTreeEvent&
Returns
void

Definition at line 505 of file dependencydialog.cpp.

References _guilang, Language::get(), ID_DEPENDENCYDIALOG_EXPORTDOT, ID_DEPENDENCYDIALOG_FOLDALL, ID_DEPENDENCYDIALOG_FOLDITEM, ID_DEPENDENCYDIALOG_UNFOLDALL, ID_DEPENDENCYDIALOG_UNFOLDITEM, m_dependencyTree, and m_selectedItem.

Here is the call graph for this function:

◆ OnMenuEvent()

void DependencyDialog::OnMenuEvent ( wxCommandEvent &  event)
private

This private member function handles all menu events yielded by clicking on an item of the popup menu.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 531 of file dependencydialog.cpp.

References CollapseAll(), CreateDotFile(), ID_DEPENDENCYDIALOG_EXPORTDOT, ID_DEPENDENCYDIALOG_FOLDALL, ID_DEPENDENCYDIALOG_FOLDITEM, ID_DEPENDENCYDIALOG_UNFOLDALL, ID_DEPENDENCYDIALOG_UNFOLDITEM, m_dependencyTree, and m_selectedItem.

Here is the call graph for this function:

◆ parseNameSpace()

std::vector< std::string > DependencyDialog::parseNameSpace ( std::string  sNameSpace) const
private

Convert a name space into a vector of single namespaces for easier comparison.

Parameters
sNameSpacestd::string
Returns
std::vector<std::string>

Definition at line 279 of file dependencydialog.cpp.

Referenced by CreateDotFile().

Member Data Documentation

◆ m_dependencyTree

wxcode::wxTreeListCtrl* DependencyDialog::m_dependencyTree
private

◆ m_deps

std::map<std::string, DependencyList> DependencyDialog::m_deps
private

◆ m_mainProcedure

std::string DependencyDialog::m_mainProcedure
private

Definition at line 40 of file dependencydialog.hpp.

Referenced by calculateDependencies(), and fillDependencyTree().

◆ m_selectedItem

wxTreeItemId DependencyDialog::m_selectedItem
private

Definition at line 39 of file dependencydialog.hpp.

Referenced by OnItemRightClick(), and OnMenuEvent().


The documentation for this class was generated from the following files: