Choreonoid  1.8
BodyItemFileIO.h
Go to the documentation of this file.
1 #ifndef CNOID_BODY_PLUGIN_BODY_ITEM_FILE_IO_H
2 #define CNOID_BODY_PLUGIN_BODY_ITEM_FILE_IO_H
3 
4 #include "BodyItem.h"
5 #include <cnoid/ItemFileIO>
6 #include <cnoid/BodyLoader>
7 #include <cnoid/StdBodyWriter>
8 #include <QBoxLayout>
9 #include <QComboBox>
10 #include <QCheckBox>
11 #include "exportdecl.h"
12 
13 namespace cnoid {
14 
15 class CNOID_EXPORT BodyItemFileIoBase : public ItemFileIoBase<BodyItem>
16 {
17 protected:
18  BodyItemFileIoBase(const char* format, int api);
20 
21  virtual QWidget* getOptionPanelForSaving(BodyItem* item) override;
22  virtual void createOptionPanelForSaving() = 0;
23  void addExtModelFileModeCombo(QBoxLayout* box);
24  void addTransformIntegrationCheck(QBoxLayout* box);
25 
26  QVBoxLayout* optionVBox;
29 
30 private:
31  QWidget* optionPanel;
32 };
33 
34 
35 class CNOID_EXPORT BodyItemBodyFileIO : public BodyItemFileIoBase
36 {
37 public:
39 
40  StdBodyWriter* bodyWriter(){ return ensureBodyWriter(); }
41 
42 protected:
43  virtual bool load(BodyItem* item, const std::string& filename) override;
44  StdBodyWriter* ensureBodyWriter();
45  virtual void createOptionPanelForSaving() override;
46  virtual void fetchOptionPanelForSaving() override;
47  virtual bool save(BodyItem* item, const std::string& filename) override;
48 
49 private:
50  BodyLoader bodyLoader_;
51  std::unique_ptr<StdBodyWriter> bodyWriter_;
52 };
53 
54 }
55 
56 #endif
cnoid::BodyLoader
Definition: BodyLoader.h:16
cnoid::ItemFileIoBase
Definition: ItemFileIO.h:142
cnoid::BodyItem
Definition: BodyItem.h:28
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::BodyItemFileIoBase::transformIntegrationCheck
QCheckBox * transformIntegrationCheck
Definition: BodyItemFileIO.h:28
cnoid::BodyItemFileIoBase::extModelFileModeCombo
QComboBox * extModelFileModeCombo
Definition: BodyItemFileIO.h:27
cnoid::BodyItemFileIoBase
Definition: BodyItemFileIO.h:15
cnoid::StdBodyWriter
Definition: StdBodyWriter.h:16
cnoid::BodyItemFileIoBase::optionVBox
QVBoxLayout * optionVBox
Definition: BodyItemFileIO.h:26
cnoid::BodyItemBodyFileIO::bodyWriter
StdBodyWriter * bodyWriter()
Definition: BodyItemFileIO.h:40
BodyItem.h
cnoid::BodyItemBodyFileIO
Definition: BodyItemFileIO.h:35