Choreonoid  1.8
WorldLogFileItem.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_PLUGIN_WORLD_LOG_FILE_ITEM_H
7 #define CNOID_BODY_PLUGIN_WORLD_LOG_FILE_ITEM_H
8 
9 #include <cnoid/Item>
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class SE3;
15 class DeviceState;
16 
17 class CNOID_EXPORT WorldLogFileItem : public Item
18 {
19 public:
20  static void initializeClass(ExtensionManager* ext);
21 
25 
26  bool setLogFile(const std::string& filename);
27  const std::string& logFile() const;
28 
29  void setTimeStampSuffixEnabled(bool on);
30  bool isTimeStampSuffixEnabled() const;
31 
32  void setRecordingFrameRate(double rate);
33  double recordingFrameRate() const;
34 
35  void clearOutput();
36  void beginHeaderOutput();
37  int outputBodyHeader(const std::string& name);
38  void endHeaderOutput();
39  void beginFrameOutput(double time);
40  void beginBodyStateOutput();
41  void outputLinkPositions(SE3* positions, int size);
42  void outputJointPositions(double* values, int size);
43  void beginDeviceStateOutput();
44  void outputDeviceState(DeviceState* state);
45  void endDeviceStateOutput();
46  void endBodyStateOutput();
47  void endFrameOutput();
48 
49  int numBodies() const;
50  const std::string& bodyName(int bodyIndex) const;
51 
52  bool recallStateAtTime(double time);
53  void invalidateLastStateConsistency();
54 
55  virtual void notifyUpdate() override;
56 
57 protected:
58  virtual Item* doDuplicate() const override;
59  virtual void onTreePathChanged() override;
60  virtual void doPutProperties(PutPropertyFunction& putProperty) override;
61  virtual bool store(Archive& archive) override;
62  virtual bool restore(const Archive& archive) override;
63 
64 private:
65  class Impl;
66  Impl* impl;
67 };
68 
70 
71 }
72 
73 #endif
cnoid::ExtensionManager
Definition: ExtensionManager.h:23
cnoid::PutPropertyFunction
Definition: PutPropertyFunction.h:51
cnoid::Archive
Definition: Archive.h:22
cnoid::ref_ptr< WorldLogFileItem >
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Item
Definition: Item.h:29
cnoid::DeviceState
Definition: Device.h:20
cnoid::SE3
Definition: EigenTypes.h:79
cnoid::WorldLogFileItem
Definition: WorldLogFileItem.h:17
cnoid::WorldLogFileItemPtr
ref_ptr< WorldLogFileItem > WorldLogFileItemPtr
Definition: WorldLogFileItem.h:69