OpFlipTrans Class Reference

This operation allows you to flip the selection either vertically or horizontally. It only has an immediate version and no interactive version. More...

#include <opflip.h>

Inheritance diagram for OpFlipTrans:

TransOperation UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

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

Detailed Description

This operation allows you to flip the selection either vertically or horizontally. It only has an immediate version and no interactive version.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/7/94

Definition at line 119 of file opflip.h.


Constructor & Destructor Documentation

OpFlipTrans::OpFlipTrans  ) 
 

Constructor. Does nothing but set a flag to a default value.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/7/93

Definition at line 132 of file opflip.cpp.

00132                         : TransOperation()
00133 {
00134     // Default to horizontal
00135     IsHorizontal = TRUE;
00136 }


Member Function Documentation

void OpFlipTrans::BuildMatrix  )  [private, virtual]
 

Builds the transform matrix required to Flip the selection.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/7/94

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 }

OpFlipTrans::CC_DECLARE_DYNCREATE OpFlipTrans   )  [private]
 

BOOL OpFlipTrans::Declare  )  [static]
 

Adds the operation to the list of all known operations.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/7/93
Returns:
TRUE if all went OK, False otherwise

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 }

void OpFlipTrans::InitTransformImmediate OpParam pOpParam  )  [private, virtual]
 

Sets up the transform ready for an immediate translation. This is called from DoWithParam().

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/94
Parameters:
pOpParam - The parameters that were passed into the operation [INPUTS]
See also:
TransOperation::DoWithParam()

Reimplemented from TransOperation.

Definition at line 190 of file opflip.cpp.

00191 {
00192     // Does nothing
00193 }

void OpFlipTrans::SetStartBlob INT32  StartBlob  )  [private, virtual]
 

Allows the operations to know how it was started. This operation is interested in the horizontal / vertical nature of the transform.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/7/94
Parameters:
StartBlob - the Number of the blob that the operation was initiated on, [INPUTS] if applicabale. They are numbered as follows :- MonoOn 1 2 3 4 5 6 7 8 MonoOff All operations that were not started from one of the 8 blobs should use 0

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 }


Member Data Documentation

BOOL OpFlipTrans::IsHorizontal [private]
 

Definition at line 139 of file opflip.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:58:12 2007 for Camelot by  doxygen 1.4.4