Team Fortress 2 Source Code as on 22/4/2020
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.

77 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Tool used for point-and-click picking of angles for filling out
  4. // entity properties.
  5. //
  6. //=============================================================================//
  7. #ifndef TOOLPICKANGLES_H
  8. #define TOOLPICKANGLES_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "MapEntity.h"
  13. #include "ToolInterface.h"
  14. class CMapView3D;
  15. class CToolPickAngles;
  16. //
  17. // Interface for notification by the angles picking tool. Inherit from this if you
  18. // are a client of the angles picker.
  19. //
  20. class IPickAnglesTarget
  21. {
  22. public:
  23. virtual void OnNotifyPickAngles(const Vector &vecPos) = 0;
  24. };
  25. class CToolPickAngles : public CBaseTool
  26. {
  27. public:
  28. //
  29. // Constructor/Destructor
  30. //
  31. CToolPickAngles();
  32. ~CToolPickAngles();
  33. //
  34. // CBaseTool virtual implementations
  35. //
  36. virtual ToolID_t GetToolID(void) { return TOOL_PICK_ANGLES; }
  37. virtual bool OnLMouseUp3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint);
  38. virtual bool OnLMouseDown3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint);
  39. virtual bool OnLMouseDblClk3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint);
  40. virtual bool OnRMouseUp3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint);
  41. virtual bool OnRMouseDown3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint);
  42. virtual bool OnMouseMove3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint);
  43. //
  44. // Functions specific to this tool.
  45. //
  46. inline void Attach(IPickAnglesTarget *pTarget);
  47. protected:
  48. void SetToolCursor(void);
  49. IPickAnglesTarget *m_pNotifyTarget; // Object to notify when selection events occur.
  50. };
  51. //-----------------------------------------------------------------------------
  52. // Purpose: Attaches the given notification target to this tool. That object
  53. // will be used for all future notifications and updates by the tool.
  54. //-----------------------------------------------------------------------------
  55. void CToolPickAngles::Attach(IPickAnglesTarget *pNotifyTarget)
  56. {
  57. m_pNotifyTarget = pNotifyTarget;
  58. }
  59. #endif // TOOLPICKANGLES_H