Choreonoid  1.8
CollisionSeq.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_COLLISION_SEQ_H
7 #define CNOID_BODY_COLLISION_SEQ_H
8 
9 #include <cnoid/CollisionLinkPair>
10 #include <cnoid/MultiSeq>
11 #include <cnoid/YAMLWriter>
12 #include "exportdecl.h"
13 
14 namespace cnoid {
15 
16 class YAMLWriter;
18 
19 typedef std::vector<CollisionLinkPairPtr> CollisionLinkPairList;
20 
21 class CNOID_EXPORT CollisionSeq : public MultiSeq<std::shared_ptr<CollisionLinkPairList>>
22 {
24 
25 public:
27  CollisionSeq(CollisionSeqItem* collisionSeqItem);
28 
29  using BaseSeqType::operator=;
30 
31  bool loadStandardYAMLformat(const std::string& filename, std::ostream& os = nullout());
32  bool saveAsStandardYAMLformat(const std::string& filename);
33  void writeCollsionData(YAMLWriter& writer, std::shared_ptr<const CollisionLinkPairList> ptr);
34  void readCollisionData(int nFrames, const Listing& values);
35 
36 protected:
37  virtual bool doReadSeq(const Mapping* archive, std::ostream& os) override;
38  virtual bool doWriteSeq(YAMLWriter& writer, std::function<void()> additionalPartCallback) override;
39 };
40 
41 }
42 
43 #endif
cnoid::Mapping
Definition: ValueTree.h:253
cnoid::YAMLWriter
Definition: YAMLWriter.h:16
cnoid::CollisionSeq
Definition: CollisionSeq.h:21
cnoid::MultiSeq
Definition: MultiSeq.h:17
cnoid::nullout
std::ostream & nullout()
Definition: NullOut.cpp:26
cnoid::CollisionSeq::collisionSeqItem_
CollisionSeqItem * collisionSeqItem_
Definition: CollisionSeq.h:26
cnoid::Listing
Definition: ValueTree.h:486
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::CollisionSeqItem
Definition: CollisionSeqItem.h:17
cnoid::CollisionLinkPairList
std::vector< CollisionLinkPairPtr > CollisionLinkPairList
Definition: CollisionSeq.h:17