-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCmdFaceMod.h
74 lines (57 loc) · 1.8 KB
/
CmdFaceMod.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
//==============================
// CmdFaceMod.h
//==============================
#ifndef __COMMAND_FACE_MOD_H__
#define __COMMAND_FACE_MOD_H__
#include "qe3.h"
#include "Command.h"
/*
========================================================================
FACE MODIFICATION
For any change which modifies the properties of any number of brush faces,
without adding or removing them or changing their relationships.
- does not change memory location of modified faces
========================================================================
*/
class CmdFaceMod : public Command
{
public:
CmdFaceMod();
~CmdFaceMod();
// ModifyFace: clone off the data of these Faces and keep it
void ModifyFace(Face* f);
void ModifyFaces(std::vector<Face*> &fList);
void ModifyFaces(Face *fList);
// RestoreFace: restore cloned data from these Faces
void RestoreFace(Face* f);
void RestoreFaces(std::vector<Face*> &fList);
void RestoreFaces(Face *fList);
void RestoreAll();
// UnmodifyFace: throw away cloned data from these Faces and stop tracking - does NOT restore
void UnmodifyFace(Face* f);
void UnmodifyFaces(std::vector<Face*> &fList);
void UnmodifyFaces(Face *fList);
void UnmodifyAll();
// RevertFace: restore cloned data from these Faces and stop tracking
void RevertFace(Face* f);
void RevertFaces(std::vector<Face*> &fList);
void RevertFaces(Face *fList);
void RevertAll();
void RebuildAll();
private:
typedef struct fBasis_s {
fBasis_s() {};
fBasis_s(Face *fOrig) : f(fOrig), plane(fOrig->plane), texdef(fOrig->texdef) {};
Face *f;
Plane plane;
TexDef texdef;
} fBasis;
std::vector<fBasis> faceCache;
static bool fbasisCmp(const fBasis &a, const fBasis &b);
void Swap(fBasis &fb);
void SwapAll();
void Do_Impl();
void Undo_Impl();
void Redo_Impl();
};
#endif // __COMMAND_FACE_MOD_H__