osgGA.GUIActionAdapter是一个输入事件的处理器。该类主要用于处理GUI没有处理的输入事件,以及提供一个与GUI交互的接口。
class OSGGA_EXPORT GUIActionAdapter : public ActionAdapter
{
public:
GUIActionAdapter() : ActionAdapter() {}
GUIActionAdapter(const GUIActionAdapter& ga, const CopyOp& copyop=CopyOp::SHALLOW_COPY) : ActionAdapter(ga,copyop) {}
META_Object(osgGA,GUIActionAdapter)
/** get the GUIEventType of this action. */
virtual GUIEventType getEventType() const { return GUIEventAdapter::NO_EVENT; }
/** Get the GUIEventAdapter pointer for this action.
* Returns NULL if there is no gui event associated with this action.
* Note, the event adapter will only exist for a short period of time, so if
* you want to keep hold of it, then clone it or copy it's data over
* to a local copy. */
virtual GUIEventAdapter* getEventAdapter() { return 0; }
/** Get the GUIEventAdapter pointer (const version) for this action.
* Returns NULL if there is no gui event associated with this action.
* Note, the event adapter will only exist for a short period of time, so if
* you want to keep hold of it, then clone it or copy it's data over
* to a local copy. */
virtual const GUIEventAdapter* getEventAdapter() const { return 0; }
};
GUIActionAdapter() : ActionAdapter() {}
该构造函数创建一个空的GUIActionAdapter对象。
GUIActionAdapter(const GUIActionAdapter& ga, const CopyOp& copyop=CopyOp::SHALLOW_COPY) : ActionAdapter(ga,copyop) {}
该构造函数复制一个已存在的GUIActionAdapter对象。
virtual GUIEventType getEventType() const { return GUIEventAdapter::NO_EVENT; }
获取该GUIActionAdapter对象中的GUIEventType类型。
virtual GUIEventAdapter* getEventAdapter() { return 0; }
获取该GUIActionAdapter对象中的GUIEventAdapter指针,如果没有与该动作相关联的GUI事件,则返回空指针。
virtual const GUIEventAdapter* getEventAdapter() const { return 0; }
获取该GUIActionAdapter对象中的GUIEventAdapter指针(const版本),如果没有与该动作相关联的GUI事件,则返回空指针。