-
Notifications
You must be signed in to change notification settings - Fork 1
/
iselect.h
132 lines (104 loc) · 3.52 KB
/
iselect.h
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#pragma once
// NB: these are used for file I/O and must not be changed/reordered!
enum ItemTypeEnum
{
eItemSurface,
eItemFlipper,
eItemTimer,
eItemPlunger,
eItemTextbox,
eItemBumper,
eItemTrigger,
eItemLight,
eItemKicker,
eItemDecal,
eItemGate,
eItemSpinner,
eItemRamp,
eItemTable,
eItemLightCenter,
eItemDragPoint,
eItemCollection,
eItemDispReel,
eItemLightSeq,
eItemPrimitive,
eItemFlasher,
eItemRubber,
eItemHitTarget,
//eItemLightSeqCenter,
eItemTypeCount,
eItemInvalid = 0xffffffff // Force enum to be 32 bits
};
class Sur;
class PinTable;
class IEditable;
struct PropertyPane;
enum SelectState
{
eNotSelected,
eSelected,
eMultiSelected
};
INT_PTR CALLBACK RotateProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ScaleProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK TranslateProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
// ISelect is the subclass for anything that can be manipulated with the mouse.
// and that has a property sheet.
class ISelect : public ILoadable
{
public:
ISelect();
virtual void OnLButtonDown(int x, int y);
virtual void OnLButtonUp(int x, int y);
virtual void OnRButtonDown(int x, int y, HWND hwnd);
virtual void OnRButtonUp(int x, int y);
virtual void OnMouseMove(int x, int y);
// Things to override
virtual void MoveOffset(const float dx, const float dy);
virtual void EditMenu(HMENU hmenu);
virtual void DoCommand(int icmd, int x, int y);
virtual void SetObjectPos();
virtual void SetSelectFormat(Sur *psur);
virtual void SetMultiSelectFormat(Sur *psur);
virtual void SetLockedFormat(Sur *psur);
virtual PinTable *GetPTable() = 0;
virtual HRESULT GetTypeName(BSTR *pVal);
static void GetTypeNameForType(ItemTypeEnum type, WCHAR * buf);
virtual IDispatch *GetDispatch() = 0;
virtual void GetDialogPanes(vector<PropertyPane*> &pvproppane) = 0;
virtual ItemTypeEnum GetItemType() const = 0;
virtual void Delete() = 0;
virtual void Uncreate() = 0;
virtual void FlipY(const Vertex2D& pvCenter);
virtual void FlipX(const Vertex2D& pvCenter);
virtual void Rotate(const float ang, const Vertex2D& pvCenter, const bool useElementCenter);
virtual void Scale(const float scalex, const float scaley, const Vertex2D& pvCenter, const bool useElementCenter);
virtual void Translate(const Vertex2D &pvOffset);
// So objects don't have to implement all the transformation functions themselves
virtual Vertex2D GetCenter() const = 0;
virtual Vertex2D GetScale() const
{
return Vertex2D(1.f, 1.f);
}
virtual float GetRotate() const
{
return 0.0f;
}
virtual void PutCenter(const Vertex2D& pv) = 0;
virtual void SetDefaultPhysics(bool fromMouseClick) {}
virtual IEditable *GetIEditable() = 0;
virtual BOOL LoadToken(int id, BiffReader *pbr);
HRESULT SaveData(IStream *pstm, HCRYPTHASH hcrypthash);
virtual int GetSelectLevel() { return 1; }
virtual bool LoadMesh() { return false; }
virtual void ExportMesh() {}
virtual void UpdatePropertyPanes() {}
virtual void AddPoint(int x, int y, const bool smooth) {}
POINT m_ptLast;
SelectState m_selectstate;
int m_menuid; // context menu to use
int m_layerIndex;
bool m_fDragging;
bool m_fMarkedForUndo;
bool m_fLocked; // Can not be dragged in the editor
};