#ifndef _OPCAMERAZOOMBOX_H #define _OPCAMERAZOOMBOX_H #include "OpConstructRectangle.h" #include "XJTrackballManipulator.h" namespace OSGView { //interface of the HOpConstruction class // draws a 2D box in view port based on pointer first position and last position // Derived classes access the Points for the rectangle in HBaseOperator members // m_ptFirst and m_ptLast; Points are stored in window space. class OpCameraZoomBox : public OpConstructRectangle { public: OpCameraZoomBox(); OpCameraZoomBox(osgViewer::Viewer* pViewer); virtual ~OpCameraZoomBox(); /*! \returns A pointer to a character string denoting the name of the operator which is 'Construct Rectangle'. */ virtual const char * GetName() {return "OpCameraZoomBox";} /*! OnLButtonUp finalizes the size of the rectangle and cleans up. \param hevent An GUIEventAdapter object containing information about the current event. \return An #HOperatorReturn indicating the status of the event. */ virtual int OnLButtonUp(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa); // transfer manipulator to this class void SetManipulator(CXJManipulator* mp) {m_keyswitchManipulator = mp;} protected: //two zoomBox mechanism //1ˇ˘Intersection with model void ZoomBoxWithModel(); //2ˇ˘ zoom with scene void ZoomBoxWithScene(); protected: CXJManipulator* m_keyswitchManipulator; }; } //end namespace #endif