Choreonoid  1.1
SceneBody.h
説明を見る。
1 
5 #ifndef CNOID_BODYPLUGIN_SCENE_BODY_H_INCLUDED
6 #define CNOID_BODYPLUGIN_SCENE_BODY_H_INCLUDED
7 
8 #include <boost/dynamic_bitset.hpp>
9 #include <cnoid/SceneObject>
10 #include "BodyItem.h"
11 #include "exportdecl.h"
12 
13 namespace cnoid {
14 
15  class SceneBodyImpl;
16 
17  class CNOID_EXPORT SceneBody : public SceneObject
18  {
19  public:
20  SceneBody(BodyItemPtr bodyItem);
21 
22  void setLinkVisibilities(const boost::dynamic_bitset<>& visibilities);
23 
24  void showCenterOfMass(bool on);
25  bool isCenterOfMassVisible() const;
26 
27  void showZmp(bool on);
28  bool isZmpVisible() const;
29 
30  Link* getPointedSceneLink();
31  osg::ref_ptr<osg::Node> getPointedShapeNode();
32 
33  protected:
34 
35  virtual ~SceneBody();
36  bool createSceneLinks();
37 
38  virtual void onAttachedToScene();
39  virtual void onDetachedFromScene();
40 
41  virtual bool onKeyPressEvent(const SceneViewEvent& event);
42  virtual bool onKeyReleaseEvent(const SceneViewEvent& event);
43  virtual bool onButtonPressEvent(const SceneViewEvent& event);
44  virtual bool onButtonReleaseEvent(const SceneViewEvent& event);
45  virtual bool onDoubleClickEvent(const SceneViewEvent& event);
46  virtual bool onPointerMoveEvent(const SceneViewEvent& event);
47  virtual void onPointerLeaveEvent(const SceneViewEvent& event);
48  virtual void onContextMenuRequest(const SceneViewEvent& event, MenuManager& menuManager);
49  virtual void onSceneModeChanged();
50  virtual bool onUndoRequest();
51  virtual bool onRedoRequest();
52 
53  private:
54 
55  SceneBodyImpl* impl;
56 
57  friend class SceneBodyImpl;
58  };
59 
60  typedef osg::ref_ptr<SceneBody> SceneBodyPtr;
61 }
62 
63 #endif