Choreonoid  1.5
JointGraphView.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BODYPLUGIN_JOINT_GRAPH_VIEW_H_INCLUDED
6 #define CNOID_BODYPLUGIN_JOINT_GRAPH_VIEW_H_INCLUDED
7 
8 #include "BodyItem.h"
9 #include "LinkSelectionView.h"
10 #include <cnoid/MultiValueSeqItem>
11 #include <cnoid/View>
12 #include <cnoid/GraphWidget>
13 #include <cnoid/ItemList>
14 #include <cnoid/ConnectionSet>
15 
16 namespace cnoid {
17 
18 class Archive;
19 
20 class JointGraphView : public View
21 {
22 public:
23  static void initializeClass(ExtensionManager* ext);
24 
27 
28  virtual bool storeState(Archive& archive);
29  virtual bool restoreState(const Archive& archive);
30 
31 protected:
32 
33  virtual QWidget* indicatorOnInfoBar();
34 
35 private:
36 
37  GraphWidget graph;
38  LinkSelectionView* linkSelection;
39 
40  struct ItemInfo
41  {
42  ~ItemInfo(){
43  connections.disconnect();
44  }
46  MultiValueSeqPtr seq;
47  BodyItemPtr bodyItem;
48  ConnectionSet connections;
49  std::vector<GraphDataHandlerPtr> handlers;
50  };
51 
52  std::list<ItemInfo> itemInfos;
53 
54  std::set<BodyItemPtr> bodyItems;
55  ConnectionSet bodyItemConnections;
56  Connection itemTreeViewConnection;
57 
58  void onItemSelectionChanged(const ItemList<MultiValueSeqItem>& items);
59  void onDataItemDetachedFromRoot(std::list<ItemInfo>::iterator itemInfoIter);
60  void updateBodyItems();
61  void onBodyItemDetachedFromRoot(BodyItemPtr bodyItem);
62  void setupGraphWidget();
63  void addJointTrajectory(std::list<ItemInfo>::iterator itemInfoIter, Link* joint, MultiValueSeqPtr seq);
64  void onDataItemUpdated(std::list<ItemInfo>::iterator itemInfoIter);
65  void onDataRequest(std::list<ItemInfo>::iterator itemInfoIter, int jointId, int frame, int size, double* out_values);
66  void onDataModified(std::list<ItemInfo>::iterator itemInfoIter, int jointId, int frame, int size, double* values);
67 
68 };
69 }
70 
71 #endif
static void initializeClass(ExtensionManager *ext)
Definition: JointGraphView.cpp:18
Definition: ItemList.h:14
Definition: Archive.h:21
MultiValueSeq::Ptr MultiValueSeqPtr
Definition: MultiValueSeq.h:36
Definition: ExtensionManager.h:26
Definition: ConnectionSet.h:22
Definition: LinkSelectionView.h:18
Definition: Referenced.h:128
virtual QWidget * indicatorOnInfoBar()
Definition: JointGraphView.cpp:49
Definition: JointGraphView.h:20
Definition: GraphWidget.h:67
JointGraphView()
Definition: JointGraphView.cpp:25
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
Definition: Signal.h:107
virtual bool restoreState(const Archive &archive)
Definition: JointGraphView.cpp:237
Definition: View.h:28
~JointGraphView()
Definition: JointGraphView.cpp:42
virtual bool storeState(Archive &archive)
Definition: JointGraphView.cpp:231