diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /hammer/ToolOverlay.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'hammer/ToolOverlay.h')
| -rw-r--r-- | hammer/ToolOverlay.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/hammer/ToolOverlay.h b/hammer/ToolOverlay.h new file mode 100644 index 0000000..f87c0ce --- /dev/null +++ b/hammer/ToolOverlay.h @@ -0,0 +1,76 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef OVERLAY3D_H +#define OVERLAY3D_H +#pragma once + +#include <afxwin.h> +#include "Box3D.h" +#include "ToolInterface.h" +#include "MapOverlay.h" + +class CMapDoc; +struct Shoreline_t; + +class CToolOverlay : public Box3D +{ +public: + + //========================================================================= + // + // Constructur/Destructor + // + CToolOverlay(); + ~CToolOverlay(); + + //========================================================================= + // + // CBaseTool virtual implementations + // + ToolID_t GetToolID( void ) { return TOOL_OVERLAY; } + + void OnActivate(); + void OnDeactivate(); + + bool OnLMouseUp3D( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint ); + bool OnLMouseDown3D( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint ); + bool OnMouseMove3D( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint ); + bool OnContextMenu2D( CMapView2D *pView, UINT nFlags, const Vector2D &vPoint ); + + void RenderTool3D(CRender3D *pRender); + +protected: + + bool UpdateTranslation( const Vector &vUpdate, UINT = 0 ); + +private: + + bool HandleSelection( CMapView *pView, const Vector2D &vPoint ); + void OverlaySelection( CMapView3D *pView, UINT nFlags, const Vector2D &vPoint ); + + bool CreateOverlay( CMapSolid *pSolid, ULONG iFace, CMapView3D *pView, Vector2D point ); + void InitOverlay( CMapEntity *pEntity, CMapFace *pFace ); + + void OnDrag( Vector const &vecRayStart, Vector const &vecRayEnd, bool bShift ); + void PreDrag( void ); + void PostDrag( void ); + void SetupHandleDragUndo( void ); + + void HandlesReset( void ); + void SnapHandle( Vector &vecHandlePt ); + bool HandleInBBox( CMapOverlay *pOverlay, Vector const &vecHandlePt ); + bool HandleSnap( CMapOverlay *pOverlay, Vector &vecHandlePt ); + +private: + + bool m_bDragging; // Are we dragging overlay handles? + Shoreline_t *m_pShoreline; // + CMapOverlay *m_pActiveOverlay; // The overlay currently being acted upon +}; + +#endif // OVERLAY3D_H
\ No newline at end of file |