RcsPySim
A robot control and simulation library
ViewerComponent.h
Go to the documentation of this file.
1 #ifndef RCS_VIEWERCOMPONENT_H
2 #define RCS_VIEWERCOMPONENT_H
3 
4 
5 #include <SensorComponent.h>
6 
7 #include <RcsViewer.h>
8 #include <KeyCatcher.h>
9 #include <BodyNode.h>
10 
11 
12 namespace Rcs
13 {
14 class ComponentViewer;
15 
16 class ViewerComponent : public SensorComponent
17 {
18 public:
19  ViewerComponent(RcsGraph* currentGraph, bool syncWithEventLoop = false);
20 
22  RcsGraph* desiredGraph, RcsGraph* currentGraph,
23  bool syncWithEventLoop = false);
24 
25  virtual ~ViewerComponent();
26 
27  void updateGraph(RcsGraph* graph);
28 
29  void postUpdateGraph();
30 
31  const char* getName() const;
32 
33  double getCallbackUpdatePeriod() const;
34 
35  void setText(const std::string& text);
36 
37  KeyCatcher* getKeyCatcher();
38 
39  Viewer* getViewer();
40 
41  BodyNode* getBodyNodePtrFromDesiredGraph(const char* name);
42 
43  BodyNode* getBodyNodePtrFromCurrentGraph(const char* name);
44 
45  void lock();
46 
47  void unlock();
48 
49  bool startThread();
50 
51  bool stopThread();
52 
53 private:
54  void init();
55 
56  const RcsGraph* desiredGraph;
57  const RcsGraph* currentGraph;
59  KeyCatcher* kc;
61 
63 
65 };
66 
67 }
68 
69 #endif // RCS_VIEWERCOMPONENT_H
const RcsGraph * desiredGraph
const char * getName() const
BodyNode * getBodyNodePtrFromDesiredGraph(const char *name)
KeyCatcher * getKeyCatcher()
const RcsGraph * currentGraph
ViewerComponent(RcsGraph *currentGraph, bool syncWithEventLoop=false)
void setText(const std::string &text)
void updateGraph(RcsGraph *graph)
ViewerComponent & operator=(const ViewerComponent &)
double getCallbackUpdatePeriod() const
BodyNode * getBodyNodePtrFromCurrentGraph(const char *name)
ComponentViewer * viewer