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/ToolPickAngles.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'hammer/ToolPickAngles.h')
| -rw-r--r-- | hammer/ToolPickAngles.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/hammer/ToolPickAngles.h b/hammer/ToolPickAngles.h new file mode 100644 index 0000000..7c9b506 --- /dev/null +++ b/hammer/ToolPickAngles.h @@ -0,0 +1,77 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Tool used for point-and-click picking of angles for filling out +// entity properties. +// +//=============================================================================// + +#ifndef TOOLPICKANGLES_H +#define TOOLPICKANGLES_H +#ifdef _WIN32 +#pragma once +#endif + +#include "MapEntity.h" +#include "ToolInterface.h" + + +class CMapView3D; +class CToolPickAngles; + + +// +// Interface for notification by the angles picking tool. Inherit from this if you +// are a client of the angles picker. +// +class IPickAnglesTarget +{ +public: + virtual void OnNotifyPickAngles(const Vector &vecPos) = 0; +}; + + +class CToolPickAngles : public CBaseTool +{ +public: + + // + // Constructor/Destructor + // + CToolPickAngles(); + ~CToolPickAngles(); + + // + // CBaseTool virtual implementations + // + virtual ToolID_t GetToolID(void) { return TOOL_PICK_ANGLES; } + + virtual bool OnLMouseUp3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint); + virtual bool OnLMouseDown3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint); + virtual bool OnLMouseDblClk3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint); + virtual bool OnRMouseUp3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint); + virtual bool OnRMouseDown3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint); + virtual bool OnMouseMove3D(CMapView3D *pView, UINT nFlags, const Vector2D &vPoint); + + // + // Functions specific to this tool. + // + inline void Attach(IPickAnglesTarget *pTarget); + +protected: + + void SetToolCursor(void); + + IPickAnglesTarget *m_pNotifyTarget; // Object to notify when selection events occur. +}; + + +//----------------------------------------------------------------------------- +// Purpose: Attaches the given notification target to this tool. That object +// will be used for all future notifications and updates by the tool. +//----------------------------------------------------------------------------- +void CToolPickAngles::Attach(IPickAnglesTarget *pNotifyTarget) +{ + m_pNotifyTarget = pNotifyTarget; +} + +#endif // TOOLPICKANGLES_H |