Choreonoid  1.8
BodyLoader.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_BODY_LOADER_H
7 #define CNOID_BODY_BODY_LOADER_H
8 
9 #include "AbstractBodyLoader.h"
10 #include <functional>
11 #include <initializer_list>
12 #include "exportdecl.h"
13 
14 namespace cnoid {
15 
16 class CNOID_EXPORT BodyLoader : public AbstractBodyLoader
17 {
18 public:
19  static void registerLoader(
20  const std::string& extension, std::function<AbstractBodyLoaderPtr()> factory);
21  static void registerLoader(
22  std::initializer_list<const char*> extensions, std::function<AbstractBodyLoaderPtr()> factory);
23 
24  BodyLoader();
25  ~BodyLoader();
26  virtual void setMessageSink(std::ostream& os);
27  virtual void setVerbose(bool on);
28  virtual void setShapeLoadingEnabled(bool on);
29  virtual void setDefaultDivisionNumber(int n);
30  virtual void setDefaultCreaseAngle(double theta);
31 
32  enum LengthUnit { Meter, Millimeter, Inch, NumLengthUnitIds };
33  enum UpperAxis { Z, Y, NumUpperAxisIds };
34  void setMeshImportHint(LengthUnit unit, UpperAxis axis);
35 
36  virtual bool load(Body* body, const std::string& filename);
37  Body* load(const std::string& filename);
38  AbstractBodyLoaderPtr lastActualBodyLoader() const;
39 
40 private:
41  class Impl;
42  Impl* impl;
43 };
44 
45 }
46 
47 #endif
cnoid::BodyLoader
Definition: BodyLoader.h:16
AbstractBodyLoader.h
cnoid::BodyLoader::Z
@ Z
Definition: BodyLoader.h:33
cnoid::BodyLoader::UpperAxis
UpperAxis
Definition: BodyLoader.h:33
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::BodyLoader::LengthUnit
LengthUnit
Definition: BodyLoader.h:32
cnoid::AbstractBodyLoaderPtr
std::shared_ptr< AbstractBodyLoader > AbstractBodyLoaderPtr
Definition: AbstractBodyLoader.h:31
cnoid::AbstractBodyLoader
Definition: AbstractBodyLoader.h:18
cnoid::Body
Definition: Body.h:28