You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB
C

1 month ago
#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<><31>Intersection with model
void ZoomBoxWithModel();
//2<><32> zoom with scene
void ZoomBoxWithScene();
protected:
CXJManipulator* m_keyswitchManipulator;
};
} //end namespace
#endif