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.

78 lines
2.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef OVERLAY3D_H
  8. #define OVERLAY3D_H
  9. #pragma once
  10. #include <afxwin.h>
  11. #include "Box3D.h"
  12. #include "ToolInterface.h"
  13. #include "MapOverlay.h"
  14. #include "ToolManager.h"
  15. class CMapDoc;
  16. struct Shoreline_t;
  17. class CToolOverlay : public Box3D
  18. {
  19. public:
  20. //=========================================================================
  21. //
  22. // Constructur/Destructor
  23. //
  24. CToolOverlay();
  25. ~CToolOverlay();
  26. //=========================================================================
  27. //
  28. // CBaseTool virtual implementations
  29. //
  30. ToolID_t GetToolID( void ) { return TOOL_OVERLAY; }
  31. void OnActivate();
  32. void OnDeactivate();
  33. virtual bool OnKeyDown2D(CMapView2D *pView, UINT nChar, UINT nRepCnt, UINT nFlags);
  34. virtual bool OnKeyDown3D(CMapView3D *pView, UINT nChar, UINT nRepCnt, UINT nFlags);
  35. bool OnLMouseUp3D( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint );
  36. bool OnLMouseDown3D( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint );
  37. bool OnMouseMove3D( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint );
  38. bool OnContextMenu2D( CMapView2D *pView, UINT nFlags, const Vector2D &vPoint );
  39. void RenderTool3D(CRender3D *pRender);
  40. protected:
  41. bool UpdateTranslation( const Vector &vUpdate, UINT = 0 );
  42. private:
  43. bool HandleSelection( CMapView *pView, const Vector2D &vPoint );
  44. void OverlaySelection( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint );
  45. bool CreateOverlay( CMapSolid *pSolid, ULONG iFace, CMapView3D *pView, Vector2D point );
  46. void InitOverlay( CMapEntity *pEntity, CMapFace *pFace );
  47. void OnDrag( Vector const &vecRayStart, Vector const &vecRayEnd, bool bShift );
  48. void PreDrag( void );
  49. void PostDrag( void );
  50. void SetupHandleDragUndo( void );
  51. void HandlesReset( void );
  52. void SnapHandle( Vector &vecHandlePt );
  53. bool HandleInBBox( CMapOverlay *pOverlay, Vector const &vecHandlePt );
  54. bool HandleSnap( CMapOverlay *pOverlay, Vector &vecHandlePt );
  55. private:
  56. bool m_bDragging; // Are we dragging overlay handles?
  57. Shoreline_t *m_pShoreline; //
  58. CMapOverlay *m_pActiveOverlay; // The overlay currently being acted upon
  59. };
  60. #endif // OVERLAY3D_H