#pragma once #include "OBaseOperator.h" #include "OSGPeriodicLattice.h" #include #include namespace OSGView { class OpPickZValue : public OBaseOperator { public: OpPickZValue(osgViewer::Viewer* pViewer); virtual ~OpPickZValue(); virtual const char * GetName() {return "OpMeasureDistance";} virtual int OnMouseMove(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa); void SetMeshData(COSGPeriodicLattice* posgMesh); protected: virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa); void SnapPoint(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa); osgText::Text* createText(const osg::Vec3& pos, double val); protected: //text ½Úµã osg::ref_ptr m_textZValue; COSGPeriodicLattice* m_pOsgMesh; osg::Vec3 m_snapPoint; }; } //end namespace