#include <opflip.h>
Inheritance diagram for OpFlipTrans:
Public Member Functions | |
OpFlipTrans () | |
Constructor. Does nothing but set a flag to a default value. | |
Static Public Member Functions | |
static BOOL | Declare () |
Adds the operation to the list of all known operations. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpFlipTrans) | |
virtual void | InitTransformImmediate (OpParam *pOpParam) |
Sets up the transform ready for an immediate translation. This is called from DoWithParam(). | |
virtual void | BuildMatrix () |
Builds the transform matrix required to Flip the selection. | |
virtual void | SetStartBlob (INT32 StartBlob) |
Allows the operations to know how it was started. This operation is interested in the horizontal / vertical nature of the transform. | |
Private Attributes | |
BOOL | IsHorizontal |
Definition at line 119 of file opflip.h.
|
Constructor. Does nothing but set a flag to a default value.
Definition at line 132 of file opflip.cpp. 00132 : TransOperation() 00133 { 00134 // Default to horizontal 00135 IsHorizontal = TRUE; 00136 }
|
|
Builds the transform matrix required to Flip the selection.
Reimplemented from TransOperation. Definition at line 208 of file opflip.cpp. 00209 { 00210 // Translate to the origin 00211 Transform = Matrix(-CentreOfTrans.x, -CentreOfTrans.y); 00212 00213 // Flip the selection according to horizontal / vertical ness 00214 Matrix FlipIt; 00215 if (IsHorizontal) 00216 FlipIt = Matrix(FIXED16(-1), FIXED16(1)); 00217 else 00218 FlipIt = Matrix(FIXED16(1), FIXED16(-1)); 00219 00220 // translate back again 00221 Matrix TransFromOrigin(CentreOfTrans.x, CentreOfTrans.y); 00222 00223 // Combine the 3 of them into a single matrix 00224 Transform *= FlipIt; 00225 Transform *= TransFromOrigin; 00226 }
|
|
|
|
Adds the operation to the list of all known operations.
Reimplemented from TransOperation. Definition at line 242 of file opflip.cpp. 00243 { 00244 return (RegisterOpDescriptor(0, _R(IDS_FLIPTRANS), CC_RUNTIME_CLASS(OpFlipTrans), 00245 OPTOKEN_FLIP, TransOperation::GetState)); 00246 }
|
|
Sets up the transform ready for an immediate translation. This is called from DoWithParam().
Reimplemented from TransOperation. Definition at line 190 of file opflip.cpp.
|
|
Allows the operations to know how it was started. This operation is interested in the horizontal / vertical nature of the transform.
Reimplemented from TransOperation. Definition at line 159 of file opflip.cpp. 00160 { 00161 // Only blobs 2, 7, 4 and 5 are relavant. All others are a problem 00162 ENSURE( (StartBlob==2) || (StartBlob==4) || (StartBlob==5) || (StartBlob==7), 00163 "Flip started on a diagonal startblob. This should not be."); 00164 00165 // blobs 2 and 7 are the Middle Top and Middle Bottom blobs 00166 // and would suggest horizontal shearing 00167 if ((StartBlob==2) || (StartBlob==7)) 00168 IsHorizontal = TRUE; 00169 else 00170 IsHorizontal = FALSE; 00171 }
|
|
|