File: Transformation.h

package info (click to toggle)
darkradiant 3.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 41,080 kB
  • sloc: cpp: 264,743; ansic: 10,659; python: 1,852; xml: 1,650; sh: 92; makefile: 21
file content (118 lines) | stat: -rw-r--r-- 3,233 bytes parent folder | download | duplicates (2)
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
#pragma once

#include "icommandsystem.h"
#include "iclipper.h"
#include "math/Vector3.h"

namespace selection
{

namespace algorithm
{

/**
 * Applies the given quaternion to the current selection.
 */
void rotateSelected(const Quaternion& rotation);

/** greebo: Rotates the current selection about the
	* 			specified rotation angles.
	*
	* @eulerXYZ: A three-component vector containing the three
	* 			  angles in degrees (vector[0] refers to x-axis rotation).
	*
	* Note: this is an undoable command.
	*/
void rotateSelected(const Vector3& eulerXYZ);

/**
 * Command adapter for rotateSelected(Vector3)
 */
void rotateSelectedEulerXYZ(const cmd::ArgumentList& args);

/** greebo: Scales the current selection with the given vector.
	* 			this emits an error if one of the vector's components
	* 			are zero.
	*
	* @scaleXYZ: A three-component vector (can be non-uniform) containing
	* 			  the three scale factors.
	*
	* Note: this is an undoable command.
	*/
void scaleSelected(const Vector3& scaleXYZ);

/**
 * Command adapter for scaleSelected(Vector3)
 */
void scaleSelectedCmd(const cmd::ArgumentList& args);

/**
 * greebo: This duplicates the current selection (that's what happening
 * when you hit the space bar).
 */
void cloneSelected(const cmd::ArgumentList& args);

/**
 * Moves the current selection by the given translation vector.
 */
void translateSelected(const Vector3& translation);

enum ENudgeDirection
{
	eNudgeUp		= 1,
	eNudgeDown	= 3,
	eNudgeLeft	= 0,
	eNudgeRight	= 2,
};

// "Nudges" (translates) the current selection in the specified direction
// The GlobalXYWnd's active viewtype decides how "left" / "right" / "up" / "down"
// are interpreted. The GlobalGrid is used for the amount
void nudgeSelected(ENudgeDirection direction);

// Overload for more control of what happens
void nudgeSelected(ENudgeDirection direction, float amount, OrthoOrientation viewtype);

/**
* Command target, interprets the first command as direction
*
* args[0]: String enum indicating the direction: "left", "right", "up" or "down"
*/
void nudgeSelectedCmd(const cmd::ArgumentList& args);

/**
* Generic move command, always moves the selection in the given direction.
* args[0]: Vector defining the translation
*/
void moveSelectedCmd(const cmd::ArgumentList& args);

/**
* Moves the selection along the z axis by the given amount.
*/
void moveSelectedAlongZ(float amount);

/**
* Vertical move command, always moves the selection along the z axis.
* args[0]: String indicating the direction: "up" or "down".
* Each move command is using the current grid size as amount.
*/
void moveSelectedVerticallyCmd(const cmd::ArgumentList& args);

/**
 * Rotates the current selection about one of the main axes.
 */
void rotateSelectionX(const cmd::ArgumentList& args);
void rotateSelectionY(const cmd::ArgumentList& args);
void rotateSelectionZ(const cmd::ArgumentList& args);

/**
 * Mirrors the current selection about one of the main axes.
 * Behind the scenes, a negative scale operation is performed.
 */
void mirrorSelectionX(const cmd::ArgumentList& args);
void mirrorSelectionY(const cmd::ArgumentList& args);
void mirrorSelectionZ(const cmd::ArgumentList& args);

} // namespace algorithm

} // namespace selection