Choreonoid  1.5
SceneWidgetEditable.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_SCENE_WIDGET_EDITABLE_H
6 #define CNOID_BASE_SCENE_WIDGET_EDITABLE_H
7 
8 #include <cnoid/SceneGraph>
9 #include "exportdecl.h"
10 
11 namespace cnoid {
12 
13 class SceneWidget;
14 class MenuManager;
15 
17 {
18 public:
20 
21  const Vector3& point() const { return point_; }
22 
23  const SgNodePath& nodePath() const { return nodePath_; }
24 
25  // OpenGL viewport coordinate
26  double x() const { return x_; }
27  double y() const { return y_; }
28 
32  int key() const { return key_; }
33 
37  int button() const { return button_; }
38 
42  int modifiers() const { return modifiers_; }
43 
44  double wheelSteps() const { return wheelSteps_; }
45 
46  const SgNodePath& cameraPath() const { return cameraPath_; }
47 
48  const Affine3& currentCameraPosition() const;
49 
50  SceneWidget* sceneWidget() const { return sceneWidget_; }
51 
52  void updateIndicator(const std::string& message) const;
53 
54 private:
55  int key_;
56  int button_;
57  int modifiers_;
58  Vector3 point_;
59  double x_;
60  double y_;
61  double wheelSteps_;
62  SgNodePath nodePath_;
63  SgNodePath cameraPath_;
64 
65  mutable SceneWidget* sceneWidget_;
66 
68  SceneWidgetEvent& operator=(const SceneWidgetEvent& org); // disabled
69 
70  friend class SceneWidgetImpl;
71 };
72 
73 
75 {
76 public:
77  virtual bool onKeyPressEvent(const SceneWidgetEvent& event);
78  virtual bool onKeyReleaseEvent(const SceneWidgetEvent& event);
79  virtual bool onButtonPressEvent(const SceneWidgetEvent& event);
80  virtual bool onButtonReleaseEvent(const SceneWidgetEvent& event);
81  virtual bool onDoubleClickEvent(const SceneWidgetEvent& event);
82  virtual bool onPointerMoveEvent(const SceneWidgetEvent& event);
83  virtual void onPointerLeaveEvent(const SceneWidgetEvent& event);
84  virtual bool onScrollEvent(const SceneWidgetEvent& event);
85  virtual void onFocusChanged(const SceneWidgetEvent& event, bool on);
86  virtual void onContextMenuRequest(const SceneWidgetEvent& event, MenuManager& menuManager);
87  virtual void onSceneModeChanged(const SceneWidgetEvent& event);
88  virtual bool onUndoRequest();
89  virtual bool onRedoRequest();
90 };
91 
92 }
93 
94 #endif
const Vector3 & point() const
Definition: SceneWidgetEditable.h:21
Definition: SceneWidget.h:26
double x() const
Definition: SceneWidgetEditable.h:26
const SgNodePath & nodePath() const
Definition: SceneWidgetEditable.h:23
Eigen::Affine3d Affine3
Definition: EigenTypes.h:64
Definition: SceneWidgetEditable.h:74
int modifiers() const
Definition: SceneWidgetEditable.h:42
int button() const
Definition: SceneWidgetEditable.h:37
double y() const
Definition: SceneWidgetEditable.h:27
std::vector< SgNode * > SgNodePath
Definition: SceneGraph.h:140
Definition: MenuManager.h:23
int key() const
Definition: SceneWidgetEditable.h:32
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
const SgNodePath & cameraPath() const
Definition: SceneWidgetEditable.h:46
Eigen::Vector3d Vector3
Definition: EigenTypes.h:58
SceneWidget * sceneWidget() const
Definition: SceneWidgetEditable.h:50
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37
Definition: SceneWidgetEditable.h:16
double wheelSteps() const
Definition: SceneWidgetEditable.h:44