Choreonoid  1.8
MprStatementPanel.h
Go to the documentation of this file.
1 #ifndef CNOID_MANIPULATOR_PLUGIN_MPR_STATEMENT_PANEL_H
2 #define CNOID_MANIPULATOR_PLUGIN_MPR_STATEMENT_PANEL_H
3 
4 #include <QWidget>
5 #include <cnoid/MprStatement>
6 #include "exportdecl.h"
7 
8 namespace cnoid {
9 
10 class MprProgramItemBase;
11 
12 class CNOID_EXPORT MprStatementPanel : public QWidget
13 {
14 public:
17 
18  void activate(
19  MprProgramItemBase* programItem, MprStatement* statement,
20  std::function<void(const std::string& caption)> setCaption);
21  void deactivate();
22 
23  virtual void setEditingEnabled(bool on);
24  virtual void onActivated() = 0;
25  virtual void onStatementUpdated();
26  virtual void onAdditionalStatementsUpdated(const std::vector<MprStatementPtr>& additionalStatements);
27  virtual void onDeactivated();
28 
29 protected:
30  MprProgramItemBase* currentProgramItem();
31 
32  template<class StatementType> StatementType* currentStatement(){
33  return dynamic_cast<StatementType*>(getCurrentStatement());
34  }
36  return getCurrentStatement();
37  }
38 
39  void setCaption(const std::string& caption);
40 
41 private:
42  class Impl;
43  Impl* impl;
44 
45  MprStatement* getCurrentStatement();
46 };
47 
48 }
49 
50 #endif
cnoid::MprStatementPanel::currentStatement
MprStatement * currentStatement()
Definition: MprStatementPanel.h:35
cnoid::MprProgramItemBase
Definition: MprProgramItemBase.h:16
cnoid::MprStatementPanel::currentStatement
StatementType * currentStatement()
Definition: MprStatementPanel.h:32
cnoid::MprStatementPanel
Definition: MprStatementPanel.h:12
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::MprStatement
Definition: MprStatement.h:16