soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
STransformation.h
1#ifndef __STRANSFORMATION__H__
2#define __STRANSFORMATION__H__
3
4#include <interface/SRender-i.h>
5#include <matrix/SMatrix.h>
6#include <interface/STransform-i.h>
7
8SNSBEGIN
9
10/**
11 * @class STransformation
12 * @brief Defines the transformation to be applied at one point in time of an Animation.
13 */
14class SOUI_EXP STransformation : public ITransformation {
15 public:
16 /**
17 * @brief Creates a new transformation with alpha = 1 and the identity matrix.
18 */
20
21 protected:
22 SMatrix mMatrix; ///< The 3x3 matrix representing the transformation.
23 BYTE mAlpha; ///< The degree of transparency (255 means fully opaque, 0 means fully transparent).
24 int mTransformationType; ///< Indicates the nature of this transformation.
25
26 public:
27 /**
28 * @brief Gets the matrix representing the transformation.
29 * @return Pointer to the matrix.
30 */
31 STDMETHOD_(IMatrix *, GetMatrix)(THIS) OVERRIDE;
32
33 /**
34 * @brief Gets the degree of transparency.
35 * @return The alpha value (255 means fully opaque, 0 means fully transparent).
36 */
37 STDMETHOD_(BYTE, GetAlpha)(THIS) SCONST OVERRIDE;
38
39 /**
40 * @brief Sets the degree of transparency.
41 * @param alpha The alpha value (255 means fully opaque, 0 means fully transparent).
42 */
43 STDMETHOD_(void, SetAlpha)(THIS_ BYTE alpha) OVERRIDE;
44
45 /**
46 * @brief Composes this transformation with another transformation.
47 * @param t Pointer to the transformation to compose with.
48 */
49 STDMETHOD_(void, Compose)(const ITransformation *t) OVERRIDE;
50
51 /**
52 * @brief Clears the transformation to the identity matrix and alpha to 1.
53 */
54 STDMETHOD_(void, Clear)(THIS) OVERRIDE;
55
56 /**
57 * @brief Sets the type of transformation.
58 * @param type The type of transformation.
59 */
60 STDMETHOD_(void, SetTransformationType)(THIS_ int type) OVERRIDE;
61
62 public:
63 /**
64 * @brief Indicates the nature of this transformation.
65 * @return {@link #TYPE_ALPHA}, {@link #TYPE_MATRIX}, {@link #TYPE_BOTH}, or {@link #TYPE_IDENTITY}.
66 */
67 int getTransformationType() const;
68
69 /**
70 * @brief Clones the specified transformation.
71 * @param t The transformation to clone.
72 */
73 void set(STransformation t);
74
75 /**
76 * @brief Applies this STransformation to an existing STransformation.
77 * @param t The transformation to compose with.
78 */
79 void compose(const STransformation &t);
80
81 /**
82 * @brief Composes this transformation with another transformation using postConcat.
83 * @param t The transformation to compose with.
84 * @hide
85 */
87
88 /**
89 * @brief Gets the 3x3 matrix representing the transformation.
90 * @return Constant reference to the matrix.
91 */
92 const SMatrix &getMatrix() const;
93
94 /**
95 * @brief Gets the 3x3 matrix representing the transformation.
96 * @return Reference to the matrix.
97 */
99
100 /**
101 * @brief Sets the matrix representing the transformation.
102 * @param mtx The matrix to set.
103 */
104 void setMatrix(const SMatrix &mtx);
105
106 /**
107 * @brief Updates the transformation type based on the current matrix and alpha.
108 */
109 void updateMatrixType();
110
111 /**
112 * @brief Checks if the transformation affects the alpha property.
113 * @return TRUE if the transformation affects the alpha property, FALSE otherwise.
114 */
115 bool hasAlpha() const;
116
117 /**
118 * @brief Checks if the transformation affects the matrix property.
119 * @return TRUE if the transformation affects the matrix property, FALSE otherwise.
120 */
121 bool hasMatrix() const;
122
123 /**
124 * @brief Checks if the transformation is the identity transformation.
125 * @return TRUE if the transformation is the identity transformation, FALSE otherwise.
126 */
127 bool isIdentity() const;
128};
129
130SNSEND
131
132#endif // __STRANSFORMATION__H__
The SMatrix class holds a 3x3 matrix for transforming coordinates. SMatrix does not have a constructo...
Definition SMatrix.h:22
void set(STransformation t)
Clones the specified transformation.
void updateMatrixType()
Updates the transformation type based on the current matrix and alpha.
void Clear() OVERRIDE
Clears the transformation to the identity matrix and alpha to 1.
IMatrix * GetMatrix() OVERRIDE
Gets the matrix representing the transformation.
bool hasMatrix() const
Checks if the transformation affects the matrix property.
int mTransformationType
Indicates the nature of this transformation.
void Compose(const ITransformation *t) OVERRIDE
Composes this transformation with another transformation.
void compose(const STransformation &t)
Applies this STransformation to an existing STransformation.
BYTE GetAlpha() SCONST OVERRIDE
Gets the degree of transparency.
void SetTransformationType(int type) OVERRIDE
Sets the type of transformation.
void postCompose(STransformation t)
Composes this transformation with another transformation using postConcat.
bool isIdentity() const
Checks if the transformation is the identity transformation.
BYTE mAlpha
The degree of transparency (255 means fully opaque, 0 means fully transparent).
void SetAlpha(BYTE alpha) OVERRIDE
Sets the degree of transparency.
STransformation()
Creates a new transformation with alpha = 1 and the identity matrix.
const SMatrix & getMatrix() const
Gets the 3x3 matrix representing the transformation.
bool hasAlpha() const
Checks if the transformation affects the alpha property.
SMatrix mMatrix
The 3x3 matrix representing the transformation.
void setMatrix(const SMatrix &mtx)
Sets the matrix representing the transformation.
int getTransformationType() const
Indicates the nature of this transformation.