Choreonoid  1.1
SimulatorItem.h
説明を見る。
1 
6 #ifndef CNOID_BODYPLUGIN_SIMULATOR_ITEM_H_INCLUDED
7 #define CNOID_BODYPLUGIN_SIMULATOR_ITEM_H_INCLUDED
8 
9 #include <cnoid/Item>
10 #include <QWidget>
11 #include "exportdecl.h"
12 
13 namespace cnoid {
14 
15  class SimulatorItemImpl;
16 
17  class CNOID_EXPORT SimulatorItem : public Item
18  {
19  public:
20  SimulatorItem();
21  SimulatorItem(const SimulatorItem& org);
22  virtual ~SimulatorItem();
23 
24  void setAllLinkPositionOutputMode(bool on);
25  bool isAllLinkPositionOutputMode();
26 
27  bool startSimulation();
28  void stopSimulation();
29  bool isSimulationRunning();
30 
31  SignalProxy< boost::signal<void()> > sigSimulationFinished();
32 
33  protected:
34 
35  virtual QWidget* settingPanel() = 0;
36 
37  virtual bool doStartSimulation() = 0;
38  virtual bool doStepSimulation() = 0;
39 
43  virtual double doFlushResults() = 0;
44 
48  virtual double doStopSimulation() = 0;
49 
50  void lockResults();
51  void unlockResults();
52 
56  void requestToFlushResults();
57 
58  private:
59 
60  SimulatorItemImpl* impl;
61 
62  friend class SimulatorView;
63  friend class SimulatorItemImpl;
64  };
65 
66  typedef boost::intrusive_ptr<SimulatorItem> SimulatorItemPtr;
67 }
68 
69 #endif