Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
mapviz::SelectTopicDialog Class Reference

#include <select_topic_dialog.h>

Inheritance diagram for mapviz::SelectTopicDialog:
Inheritance graph
[legend]

Public Member Functions

void allowMultipleTopics (bool allow)
 
ros::master::TopicInfo selectedTopic () const
 
std::vector< ros::master::TopicInfoselectedTopics () const
 
 SelectTopicDialog (QWidget *parent=0)
 
void setDatatypeFilter (const std::vector< std::string > &datatypes)
 

Static Public Member Functions

static ros::master::TopicInfo selectTopic (const std::string &datatype, QWidget *parent=0)
 
static ros::master::TopicInfo selectTopic (const std::string &datatype1, const std::string &datatype2, QWidget *parent=0)
 
static ros::master::TopicInfo selectTopic (const std::vector< std::string > &datatypes, QWidget *parent=0)
 
static std::vector< ros::master::TopicInfoselectTopics (const std::string &datatype, QWidget *parent=0)
 
static std::vector< ros::master::TopicInfoselectTopics (const std::string &datatype1, const std::string &datatype2, QWidget *parent=0)
 
static std::vector< ros::master::TopicInfoselectTopics (const std::vector< std::string > &datatypes, QWidget *parent=0)
 

Private Slots

void fetchTopics ()
 
void updateDisplayedTopics ()
 

Private Member Functions

void closeEvent (QCloseEvent *)
 
std::vector< ros::master::TopicInfofilterTopics (const std::vector< ros::master::TopicInfo > &) const
 
void timerEvent (QTimerEvent *)
 

Private Attributes

std::set< std::string > allowed_datatypes_
 
QPushButton * cancel_button_
 
std::vector< ros::master::TopicInfodisplayed_topics_
 
int fetch_topics_timer_id_
 
std::vector< ros::master::TopicInfoknown_topics_
 
QListWidget * list_widget_
 
QLineEdit * name_filter_
 
QPushButton * ok_button_
 

Detailed Description

Provides a dialog for the user to select one or more topics. Several static functions are provided that can be used instead of instantiating the class directly.

Definition at line 53 of file select_topic_dialog.h.

Constructor & Destructor Documentation

◆ SelectTopicDialog()

mapviz::SelectTopicDialog::SelectTopicDialog ( QWidget *  parent = 0)

Constructor for the SelectTopicDialog.

Definition at line 111 of file select_topic_dialog.cpp.

Member Function Documentation

◆ allowMultipleTopics()

void mapviz::SelectTopicDialog::allowMultipleTopics ( bool  allow)

Choose whether the user can select one (allow=false) or multiple (allow=true) topics. The default is false.

Definition at line 163 of file select_topic_dialog.cpp.

◆ closeEvent()

void mapviz::SelectTopicDialog::closeEvent ( QCloseEvent *  event)
private

Definition at line 156 of file select_topic_dialog.cpp.

◆ fetchTopics

void mapviz::SelectTopicDialog::fetchTopics ( )
privateslot

Definition at line 221 of file select_topic_dialog.cpp.

◆ filterTopics()

std::vector< ros::master::TopicInfo > mapviz::SelectTopicDialog::filterTopics ( const std::vector< ros::master::TopicInfo > &  topics) const
private

Definition at line 228 of file select_topic_dialog.cpp.

◆ selectedTopic()

ros::master::TopicInfo mapviz::SelectTopicDialog::selectedTopic ( ) const

Returns the currently selected topic. If multiple topics are allowed, this will only return the first selected element. If there is no selection, the returned info will have an empty topic name and datatype.

Definition at line 183 of file select_topic_dialog.cpp.

◆ selectedTopics()

std::vector< ros::master::TopicInfo > mapviz::SelectTopicDialog::selectedTopics ( ) const

Returns the currently selected topics. If there is no selection, the returned vector will be empty.

Definition at line 193 of file select_topic_dialog.cpp.

◆ selectTopic() [1/3]

ros::master::TopicInfo mapviz::SelectTopicDialog::selectTopic ( const std::string &  datatype,
QWidget *  parent = 0 
)
static

Present the user with a dialog to select a single topic. This is convenience wrapper for the common case where only one datatype is allowed.

If the user cancels the selection or doesn't make a valid selection, the topic and datatype fields of the returned topic info will be empty.

Definition at line 43 of file select_topic_dialog.cpp.

◆ selectTopic() [2/3]

ros::master::TopicInfo mapviz::SelectTopicDialog::selectTopic ( const std::string &  datatype1,
const std::string &  datatype2,
QWidget *  parent = 0 
)
static

Present the user with a dialog to select a single topic This is a convenience wrapper for the common case where two datatypes are allowed.

If the user cancels the selection or doesn't make a valid selection, the topic and datatype fields of the returned topic info will be empty.

Definition at line 52 of file select_topic_dialog.cpp.

◆ selectTopic() [3/3]

ros::master::TopicInfo mapviz::SelectTopicDialog::selectTopic ( const std::vector< std::string > &  datatypes,
QWidget *  parent = 0 
)
static

Present the user with a dialog to select a single topic.

If the user cancels the selection or doesn't make a valid selection, the topic and datatype fields of the returned topic info will be empty.

Definition at line 63 of file select_topic_dialog.cpp.

◆ selectTopics() [1/3]

std::vector< ros::master::TopicInfo > mapviz::SelectTopicDialog::selectTopics ( const std::string &  datatype,
QWidget *  parent = 0 
)
static

Present the user with a dialog to select a multiple topics. This is a convenience wrapper for the common case where only one datatype is allowed.

If the user cancels the selection or doesn't make a valid selection, the returned vector will be empty.

Definition at line 77 of file select_topic_dialog.cpp.

◆ selectTopics() [2/3]

std::vector< ros::master::TopicInfo > mapviz::SelectTopicDialog::selectTopics ( const std::string &  datatype1,
const std::string &  datatype2,
QWidget *  parent = 0 
)
static

Present the user with a dialog to select a multiple topics. This is a convenience wrapper for the common case where two datatypes are allowed.

If the user cancels the selection or doesn't make a valid selection, the returned vector will be empty.

Definition at line 86 of file select_topic_dialog.cpp.

◆ selectTopics() [3/3]

std::vector< ros::master::TopicInfo > mapviz::SelectTopicDialog::selectTopics ( const std::vector< std::string > &  datatypes,
QWidget *  parent = 0 
)
static

Present the user with a dialog to select a multiple topics.

If the user cancels the selection or doesn't make a valid selection, the returned vector will be empty.

Definition at line 97 of file select_topic_dialog.cpp.

◆ setDatatypeFilter()

void mapviz::SelectTopicDialog::setDatatypeFilter ( const std::vector< std::string > &  datatypes)

Set a datatype filter to limit displayed topics based on their types. If the vector is empty (default), the dialog will display all available topics.

Definition at line 173 of file select_topic_dialog.cpp.

◆ timerEvent()

void mapviz::SelectTopicDialog::timerEvent ( QTimerEvent *  event)
private

Definition at line 149 of file select_topic_dialog.cpp.

◆ updateDisplayedTopics

void mapviz::SelectTopicDialog::updateDisplayedTopics ( )
privateslot

Definition at line 252 of file select_topic_dialog.cpp.

Member Data Documentation

◆ allowed_datatypes_

std::set<std::string> mapviz::SelectTopicDialog::allowed_datatypes_
private

Definition at line 173 of file select_topic_dialog.h.

◆ cancel_button_

QPushButton* mapviz::SelectTopicDialog::cancel_button_
private

Definition at line 179 of file select_topic_dialog.h.

◆ displayed_topics_

std::vector<ros::master::TopicInfo> mapviz::SelectTopicDialog::displayed_topics_
private

Definition at line 175 of file select_topic_dialog.h.

◆ fetch_topics_timer_id_

int mapviz::SelectTopicDialog::fetch_topics_timer_id_
private

Definition at line 176 of file select_topic_dialog.h.

◆ known_topics_

std::vector<ros::master::TopicInfo> mapviz::SelectTopicDialog::known_topics_
private

Definition at line 174 of file select_topic_dialog.h.

◆ list_widget_

QListWidget* mapviz::SelectTopicDialog::list_widget_
private

Definition at line 180 of file select_topic_dialog.h.

◆ name_filter_

QLineEdit* mapviz::SelectTopicDialog::name_filter_
private

Definition at line 181 of file select_topic_dialog.h.

◆ ok_button_

QPushButton* mapviz::SelectTopicDialog::ok_button_
private

Definition at line 178 of file select_topic_dialog.h.


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


mapviz
Author(s): Marc Alban
autogenerated on Fri Dec 16 2022 03:59:30