summaryrefslogtreecommitdiff
path: root/hammer/ToolPickAngles.h
blob: 7c9b5066ba4461823782e81967b9a0f180b29f79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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