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.

75 lines
2.1 KiB

  1. //========= Copyright 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. class CMapDoc;
  15. struct Shoreline_t;
  16. class CToolOverlay : public Box3D
  17. {
  18. public:
  19. //=========================================================================
  20. //
  21. // Constructur/Destructor
  22. //
  23. CToolOverlay();
  24. ~CToolOverlay();
  25. //=========================================================================
  26. //
  27. // CBaseTool virtual implementations
  28. //
  29. ToolID_t GetToolID( void ) { return TOOL_OVERLAY; }
  30. void OnActivate();
  31. void OnDeactivate();
  32. bool OnLMouseUp3D( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint );
  33. bool OnLMouseDown3D( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint );
  34. bool OnMouseMove3D( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint );
  35. bool OnContextMenu2D( CMapView2D *pView, UINT nFlags, const Vector2D &vPoint );
  36. void RenderTool3D(CRender3D *pRender);
  37. protected:
  38. bool UpdateTranslation( const Vector &vUpdate, UINT = 0 );
  39. private:
  40. bool HandleSelection( CMapView *pView, const Vector2D &vPoint );
  41. void OverlaySelection( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint );
  42. bool CreateOverlay( CMapSolid *pSolid, ULONG iFace, CMapView3D *pView, Vector2D point );
  43. void InitOverlay( CMapEntity *pEntity, CMapFace *pFace );
  44. void OnDrag( Vector const &vecRayStart, Vector const &vecRayEnd, bool bShift );
  45. void PreDrag( void );
  46. void PostDrag( void );
  47. void SetupHandleDragUndo( void );
  48. void HandlesReset( void );
  49. void SnapHandle( Vector &vecHandlePt );
  50. bool HandleInBBox( CMapOverlay *pOverlay, Vector const &vecHandlePt );
  51. bool HandleSnap( CMapOverlay *pOverlay, Vector &vecHandlePt );
  52. private:
  53. bool m_bDragging; // Are we dragging overlay handles?
  54. Shoreline_t *m_pShoreline; //
  55. CMapOverlay *m_pActiveOverlay; // The overlay currently being acted upon
  56. };
  57. #endif // OVERLAY3D_H