#pragma once #include #include #include #include class RadarLobeOperate : public osg::Operation { public: RadarLobeOperate(osg::Node *pTerrain, osg::Vec3d center, osg::Matrixd localToWorld, osg::Matrixd worldToLocal, OpenThreads::Mutex &mutex); ~RadarLobeOperate(); void SetBlockCount(OpenThreads::BlockCount *pBlockCount); void SetComputerPara(QList pts, double angleYaw, double anglePitch); void AddIntersectObject(osg::Node *pObject); void RemoveIntersectObject(osg::Node *pObject); virtual void operator () (osg::Object* callingObject); QVariantList GetIntersections() { return _intersections; } //QVariantList ComputerIntersect(QList pts, double angleYaw, double anglePitch); //QVariantList IntersectTerrain(QList pts, double angleYaw, double anglePitch); //QVariantList IntersectObject(QVariantList pts); osg::Vec3d GetPointMapping(osg::Vec3d org, double ang, osg::Vec3d axis, osg::Vec3d pt); bool IsIntersectTerrain() { return m_bIntersectTerrain; } double GetIntersectDistance() { return m_dDisHill; } void ComputerAngle(osg::Vec3d hit); double GetAngle() { return m_dAngle; } private: OpenThreads::BlockCount *_pBlockCount; OpenThreads::Mutex &_mutex; QVariantList _intersections; osg::Node *m_pTerrain; osg::Vec3d m_center; osg::Matrixd m_localToWorld; osg::Matrixd m_worldToLocal; QList m_pts; double m_angleYaw; double m_anglePitch; QList m_Objects; bool m_bIntersectTerrain; double m_dDisHill; double m_dAngle; };