graph_analysis
Public Types | Public Slots | Public Member Functions | List of all members
graph_analysis::gui::FilterManager Class Reference

widget to manage all graphical custom regexp filter items in a common scene under behavioral restrictions More...

#include <FilterManager.hpp>

Inheritance diagram for graph_analysis::gui::FilterManager:
Inheritance graph
[legend]
Collaboration diagram for graph_analysis::gui::FilterManager:
Collaboration graph
[legend]

Public Types

typedef std::vector< FilterItem * > Filters
 container datatype for an array of filter items More...
 
typedef std::vector< QCheckBox * > CheckBoxes
 container datatype for an array of checkboxes handles More...
 
typedef std::map< QCheckBox *, FilterItem::filter_index_t > CheckBoxIndexMap
 container datatype for mapping each registered check box to its registration index (i.e. offset in the array of checkboxes) More...
 

Public Slots

void addFilter ()
 listener for the filter adding button in the property dialog More...
 
void swapFilters ()
 listener for the filters swapping button in the property dialog More...
 
void renameFilter ()
 listener for the filter renaming button in the property dialog More...
 
void removeFilter ()
 listener for the filter removing button in the property dialog More...
 
void removeFilters ()
 listener for the all-filters removing button in the property dialog More...
 
void renameSelectedFilter ()
 listener for the selected filter renaming action in the context menu More...
 
void removeSelectedFilter ()
 listener for the selected filter removing action in the context menu More...
 
void updateToolTip (int state)
 listener for the checkboxes user toggling More...
 
void showContextMenu (const QPoint &pos)
 displays context menu (upon a right click in the scene) More...
 

Public Member Functions

 FilterManager (QWidget *checkBoxGrid, QWidget *parent=NULL)
 constructor More...
 
bool getItemSelected (void)
 getter method for the boolean item-selection witness; returns true when a filter item is being hover-over; false otherwise More...
 
void setItemSelected (bool itemSelected)
 setter method for the boolean item-selection witness; More...
 
FilterItem * getSelectedItem (void)
 getter method for the currently selected filter item (i.e. currently being hovered over) More...
 
void setSelectedItem (FilterItem *selectedItem)
 setter method for the currently selected filter item (i.e. currently being hovered over) More...
 
int filterCount ()
 returns the number of filters currently managed by the filter manager More...
 
void addFilter (const std::string &label, bool enable)
 introduces a new filter item More...
 
void addFilter (const std::string &label)
 introduces a new filter item with the given 'label' as text regex More...
 
unsigned int createFilter (const std::string &label)
 creates a new filter item with the given 'label' as text regex and its corresponding checkbox More...
 
void swapFilters (FilterItem::filter_index_t left, FilterItem::filter_index_t right)
 swaps in-place the 2 filters of the given indices; NOTE: only left gets displaced (right is assumed to still be dragged by the mouse after the swapping) More...
 
void dieOnIndex (FilterItem::filter_index_t index, const std::string &caller=std::string())
 error checking method: tests for the 'caller' whether the provided filter 'index' is out of bounds More...
 
void updateToolTip (FilterItem::filter_index_t index, bool witness, bool refresh=true)
 synchronizes the GUI toolTip-s with the current text regex information held at index 'index' More...
 
void refreshToolTip (FilterItem::filter_index_t index, bool refresh=false)
 synchronizes the GUI toolTip-s with the current text regex information held at index 'index' More...
 
void renameFilter (FilterItem::filter_index_t index, QString regexp)
 changes regex of the filter at 'index' to 'regexp' More...
 
void renameFilter (FilterItem *item, QString regexp)
 changes regex of the filter item 'filter' to 'regexp' More...
 
void removeFilter (FilterItem::filter_index_t index)
 completely removes the filter item at 'index' More...
 
void removeFilter (FilterItem *item)
 completely removes the given filter item More...
 
void refreshView (bool updatesStatusBar=true)
 orders the layers view to refresh; when updatesStatusBar is unset, this takes place silently (the status bar won't get changed) More...
 
Filters getFilters (void)
 getter method for the array of filters More...
 

Detailed Description

widget to manage all graphical custom regexp filter items in a common scene under behavioral restrictions

the item can only move vertically dropping in a snap-to-grid fashion and displace/push each other when they overlap too much (beyond a threshold)

Member Typedef Documentation

◆ CheckBoxes

typedef std::vector<QCheckBox*> graph_analysis::gui::FilterManager::CheckBoxes

container datatype for an array of checkboxes handles

◆ CheckBoxIndexMap

container datatype for mapping each registered check box to its registration index (i.e. offset in the array of checkboxes)

◆ Filters

container datatype for an array of filter items

Constructor & Destructor Documentation

◆ FilterManager()

graph_analysis::gui::FilterManager::FilterManager ( QWidget *  checkBoxGrid,
QWidget *  parent = NULL 
)

constructor

Parameters
checkBoxGridwidget to host the check-boxes at this widget's disposal
parentoptional qt parent widget to assume ownership over this widget

Member Function Documentation

◆ addFilter() [1/3]

void graph_analysis::gui::FilterManager::addFilter ( const std::string &  label,
bool  enable 
)

introduces a new filter item

Parameters
labelthe regex text of the filter
enablethe state of the corresponding checkbox on init (checked/unchecked)

◆ addFilter() [2/3]

void graph_analysis::gui::FilterManager::addFilter ( const std::string &  label)

introduces a new filter item with the given 'label' as text regex

◆ addFilter [3/3]

void graph_analysis::gui::FilterManager::addFilter ( )
slot

listener for the filter adding button in the property dialog

◆ createFilter()

unsigned int graph_analysis::gui::FilterManager::createFilter ( const std::string &  label)

creates a new filter item with the given 'label' as text regex and its corresponding checkbox

◆ dieOnIndex()

void graph_analysis::gui::FilterManager::dieOnIndex ( FilterItem::filter_index_t  index,
const std::string &  caller = std::string() 
)

error checking method: tests for the 'caller' whether the provided filter 'index' is out of bounds

◆ filterCount()

int graph_analysis::gui::FilterManager::filterCount ( )
inline

returns the number of filters currently managed by the filter manager

◆ getFilters()

Filters graph_analysis::gui::FilterManager::getFilters ( void  )
inline

getter method for the array of filters

◆ getItemSelected()

bool graph_analysis::gui::FilterManager::getItemSelected ( void  )
inline

getter method for the boolean item-selection witness; returns true when a filter item is being hover-over; false otherwise

◆ getSelectedItem()

FilterItem* graph_analysis::gui::FilterManager::getSelectedItem ( void  )
inline

getter method for the currently selected filter item (i.e. currently being hovered over)

◆ refreshToolTip()

void graph_analysis::gui::FilterManager::refreshToolTip ( FilterItem::filter_index_t  index,
bool  refresh = false 
)

synchronizes the GUI toolTip-s with the current text regex information held at index 'index'

Parameters
indexthe offset of the concerned filter in the filters array
refreshboolean flag dictating whether to order a layers view refresh; it generally won't refresh

◆ refreshView()

void graph_analysis::gui::FilterManager::refreshView ( bool  updatesStatusBar = true)

orders the layers view to refresh; when updatesStatusBar is unset, this takes place silently (the status bar won't get changed)

◆ removeFilter() [1/3]

void graph_analysis::gui::FilterManager::removeFilter ( FilterItem::filter_index_t  index)

completely removes the filter item at 'index'

◆ removeFilter() [2/3]

void graph_analysis::gui::FilterManager::removeFilter ( FilterItem *  item)

completely removes the given filter item

◆ removeFilter [3/3]

void graph_analysis::gui::FilterManager::removeFilter ( )
slot

listener for the filter removing button in the property dialog

◆ removeFilters

void graph_analysis::gui::FilterManager::removeFilters ( )
slot

listener for the all-filters removing button in the property dialog

◆ removeSelectedFilter

void graph_analysis::gui::FilterManager::removeSelectedFilter ( )
slot

listener for the selected filter removing action in the context menu

◆ renameFilter() [1/3]

void graph_analysis::gui::FilterManager::renameFilter ( FilterItem::filter_index_t  index,
QString  regexp 
)

changes regex of the filter at 'index' to 'regexp'

◆ renameFilter() [2/3]

void graph_analysis::gui::FilterManager::renameFilter ( FilterItem *  item,
QString  regexp 
)

changes regex of the filter item 'filter' to 'regexp'

◆ renameFilter [3/3]

void graph_analysis::gui::FilterManager::renameFilter ( )
slot

listener for the filter renaming button in the property dialog

◆ renameSelectedFilter

void graph_analysis::gui::FilterManager::renameSelectedFilter ( )
slot

listener for the selected filter renaming action in the context menu

◆ setItemSelected()

void graph_analysis::gui::FilterManager::setItemSelected ( bool  itemSelected)
inline

setter method for the boolean item-selection witness;

◆ setSelectedItem()

void graph_analysis::gui::FilterManager::setSelectedItem ( FilterItem *  selectedItem)
inline

setter method for the currently selected filter item (i.e. currently being hovered over)

◆ showContextMenu

void graph_analysis::gui::FilterManager::showContextMenu ( const QPoint &  pos)
slot

displays context menu (upon a right click in the scene)

◆ swapFilters() [1/2]

void graph_analysis::gui::FilterManager::swapFilters ( FilterItem::filter_index_t  left,
FilterItem::filter_index_t  right 
)

swaps in-place the 2 filters of the given indices; NOTE: only left gets displaced (right is assumed to still be dragged by the mouse after the swapping)

◆ swapFilters [2/2]

void graph_analysis::gui::FilterManager::swapFilters ( )
slot

listener for the filters swapping button in the property dialog

◆ updateToolTip() [1/2]

void graph_analysis::gui::FilterManager::updateToolTip ( FilterItem::filter_index_t  index,
bool  witness,
bool  refresh = true 
)

synchronizes the GUI toolTip-s with the current text regex information held at index 'index'

Parameters
indexthe offset of the concerned filter in the filters array
witnessthe boolean value of the checkbox to update to
refreshboolean flag dictating whether to order a layers view refresh; it generally does so

◆ updateToolTip [2/2]

void graph_analysis::gui::FilterManager::updateToolTip ( int  state)
slot

listener for the checkboxes user toggling


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