Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.1 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ====
  2. //
  3. // Purpose: Defines the interface to the entity placement tool.
  4. //
  5. //=============================================================================
  6. #ifndef TOOLENTITY_H
  7. #define TOOLENTITY_H
  8. #pragma once
  9. #include "ToolInterface.h"
  10. #include "Tool3D.h"
  11. class CRender2D;
  12. class CRender3D;
  13. class CToolEntity : public Tool3D
  14. {
  15. friend class CToolEntityMessageWnd;
  16. public:
  17. CToolEntity(void);
  18. ~CToolEntity(void);
  19. inline void GetPos(Vector &vecPos);
  20. //
  21. // CBaseTool implementation.
  22. //
  23. virtual ToolID_t GetToolID(void) { return TOOL_ENTITY; }
  24. virtual bool OnContextMenu2D(CMapView2D *pView, UINT nFlags, const Vector2D &vPoint);
  25. virtual bool OnKeyDown2D(CMapView2D *pView, UINT nChar, UINT nRepCnt, UINT nFlags);
  26. virtual bool OnLMouseDown2D(CMapView2D *pView, UINT nFlags, const Vector2D &vPoint);
  27. virtual bool OnLMouseUp2D(CMapView2D *pView, UINT nFlags, const Vector2D &vPoint);
  28. virtual bool OnMouseMove2D(CMapView2D *pView, UINT nFlags, const Vector2D &vPoint);
  29. virtual bool OnMouseMove3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint);
  30. virtual bool OnKeyDown3D(CMapView3D *pView, UINT nChar, UINT nRepCnt, UINT nFlags);
  31. virtual bool OnLMouseDown3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint);
  32. virtual void RenderTool2D(CRender2D *pRender);
  33. virtual void RenderTool3D(CRender3D *pRender);
  34. protected:
  35. //
  36. // Tool3D implementation.
  37. //
  38. void StartTranslation( CMapView *pView, const Vector2D &vPoint);
  39. virtual bool UpdateTranslation(const Vector &vUpdate, UINT flags);
  40. virtual void FinishTranslation(bool bSave);
  41. virtual int HitTest(CMapView *pView, const Vector2D &vPoint, bool bTestHandles = false);
  42. private:
  43. void OnEscape(void);
  44. void CreateMapObject(CMapView2D *pView);
  45. Vector m_vecPos; // Current position of the marker.
  46. };
  47. //-----------------------------------------------------------------------------
  48. // Purpose: Returns the current position of the marker.
  49. //-----------------------------------------------------------------------------
  50. inline void CToolEntity::GetPos(Vector &vecPos)
  51. {
  52. vecPos = m_vecPos;
  53. }
  54. #endif // TOOLENTITY_H