Choreonoid  1.8
BodyMotionItem.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_PLUGIN_BODY_MOTION_ITEM_H
7 #define CNOID_BODY_PLUGIN_BODY_MOTION_ITEM_H
8 
9 #include <cnoid/BodyMotion>
10 #include <cnoid/MultiValueSeqItem>
11 #include <cnoid/MultiSE3SeqItem>
12 #include "exportdecl.h"
13 
14 namespace cnoid {
15 
16 class BodyMotionItemImpl;
17 
18 class CNOID_EXPORT BodyMotionItem : public AbstractSeqItem
19 {
20 public:
21  static void initializeClass(ExtensionManager* ext);
22 
23  static void addExtraSeqItemFactory(
24  const std::string& key, std::function<AbstractSeqItem*(std::shared_ptr<AbstractSeq> seq)> factory);
25 
27  BodyMotionItem(std::shared_ptr<BodyMotion> bodyMotion);
28  BodyMotionItem(const BodyMotionItem& org);
29  ~BodyMotionItem();
30 
31  virtual std::shared_ptr<AbstractSeq> abstractSeq() override;
32 
33  std::shared_ptr<BodyMotion> motion() { return bodyMotion_; }
34  std::shared_ptr<const BodyMotion> motion() const { return bodyMotion_; }
35 
37  return jointPosSeqItem_;
38  }
39 
41  return jointPosSeqItem_;
42  }
43 
44  std::shared_ptr<MultiValueSeq> jointPosSeq() {
45  return bodyMotion_->jointPosSeq();
46  }
47 
49  return linkPosSeqItem_;
50  }
51 
53  return linkPosSeqItem_;
54  }
55 
56  std::shared_ptr<MultiSE3Seq> linkPosSeq() {
57  return bodyMotion_->linkPosSeq();
58  }
59 
60  int numExtraSeqItems() const;
61  const std::string& extraSeqKey(int index) const;
62  AbstractSeqItem* extraSeqItem(int index);
63  const AbstractSeqItem* extraSeqItem(int index) const;
64  SignalProxy<void()> sigExtraSeqItemsChanged();
65  void updateExtraSeqItems();
66 
67  virtual void notifyUpdate() override;
68 
69 protected:
70  virtual bool onChildItemAboutToBeAdded(Item* childItem, bool isManualOperation) override;
71  virtual Item* doDuplicate() const override;
72  virtual bool store(Archive& archive) override;
73  virtual bool restore(const Archive& archive) override;
74 
75 private:
76  std::shared_ptr<BodyMotion> bodyMotion_;
77  MultiValueSeqItemPtr jointPosSeqItem_;
78  MultiSE3SeqItemPtr linkPosSeqItem_;
79 
80  BodyMotionItemImpl* impl;
81  friend class BodyMotionItemImpl;
82 };
83 
85 
86 }
87 
88 #endif
cnoid::BodyMotionItem::jointPosSeqItem
const MultiValueSeqItem * jointPosSeqItem() const
Definition: BodyMotionItem.h:40
cnoid::ExtensionManager
Definition: ExtensionManager.h:23
cnoid::Archive
Definition: Archive.h:22
cnoid::ref_ptr
Definition: Referenced.h:103
cnoid::BodyMotionItem
Definition: BodyMotionItem.h:18
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::BodyMotionItem::motion
std::shared_ptr< const BodyMotion > motion() const
Definition: BodyMotionItem.h:34
cnoid::Item
Definition: Item.h:29
cnoid::BodyMotionItemPtr
ref_ptr< BodyMotionItem > BodyMotionItemPtr
Definition: BodyMotionItem.h:84
cnoid::BodyMotionItem::jointPosSeq
std::shared_ptr< MultiValueSeq > jointPosSeq()
Definition: BodyMotionItem.h:44
cnoid::AbstractSeqItem
Definition: AbstractSeqItem.h:15
cnoid::BodyMotionItem::linkPosSeqItem
MultiSE3SeqItem * linkPosSeqItem()
Definition: BodyMotionItem.h:48
cnoid::SignalProxy
Definition: Signal.h:470
cnoid::BodyMotionItem::linkPosSeq
std::shared_ptr< MultiSE3Seq > linkPosSeq()
Definition: BodyMotionItem.h:56
cnoid::BodyMotionItem::motion
std::shared_ptr< BodyMotion > motion()
Definition: BodyMotionItem.h:33
cnoid::BodyMotionItem::jointPosSeqItem
MultiValueSeqItem * jointPosSeqItem()
Definition: BodyMotionItem.h:36
cnoid::MultiSeqItem
Definition: MultiSeqItem.h:16
cnoid::BodyMotionItem::linkPosSeqItem
const MultiSE3SeqItem * linkPosSeqItem() const
Definition: BodyMotionItem.h:52