BlendPathOffset Class Reference

Stores the translation of the blendpath to the centre of its parent object. More...

#include <brushref.h>

List of all members.

Public Member Functions

 BlendPathOffset ()
 BlendPathOffset (MILLIPOINT X, MILLIPOINT Y)
void CalculateAngleAndMagnitude ()
 takes the x and y offset members and calculates the angle and magnitude of that vector
void GetAngleAndMagnitude (double *pAngle, MILLIPOINT *pMagnitude)
 to get the angle and magnitude of this vector
void RotateByAngle (double Angle, MILLIPOINT *pXoffset, MILLIPOINT *pYOffset)
 to find out the x and y offset values if this blendpathoffset were to be rotated by the given angle

Public Attributes

MILLIPOINT m_XOffset
MILLIPOINT m_YOffset

Protected Attributes

double m_Angle
MILLIPOINT m_Magnitude


Detailed Description

Stores the translation of the blendpath to the centre of its parent object.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/10/99

Definition at line 119 of file brushref.h.


Constructor & Destructor Documentation

BlendPathOffset::BlendPathOffset  )  [inline]
 

Definition at line 122 of file brushref.h.

00122 {m_XOffset = 0; m_YOffset = 0; m_Angle = 0; m_Magnitude = 0;}

BlendPathOffset::BlendPathOffset MILLIPOINT  X,
MILLIPOINT  Y
[inline]
 

Definition at line 123 of file brushref.h.

00123                                                 {m_XOffset = X; m_YOffset = Y; 
00124                                                 CalculateAngleAndMagnitude();}


Member Function Documentation

void BlendPathOffset::CalculateAngleAndMagnitude  ) 
 

takes the x and y offset members and calculates the angle and magnitude of that vector

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/12/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 141 of file brushref.cpp.

00142 {
00143     MILLIPOINT Xsq = m_XOffset * m_XOffset;
00144     MILLIPOINT Ysq = m_YOffset * m_YOffset;
00145     double Hypotenuse = sqrt((double)Xsq + (double)Ysq);
00146     double Calc = ((double)m_XOffset / Hypotenuse);
00147     double RadAngle = acos(Calc);
00148 //  double DegAngle = RadAngle * (180 / PI);
00149 
00150     m_Angle = RadAngle;
00151     m_Magnitude = (MILLIPOINT)Hypotenuse;
00152 }

void BlendPathOffset::GetAngleAndMagnitude double *  pAngle,
MILLIPOINT pMagnitude
 

to get the angle and magnitude of this vector

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/12/99
Parameters:
- [INPUTS]
pAngle [OUTPUTS] pMagnitude
Returns:
-

Definition at line 169 of file brushref.cpp.

00170 {
00171     *pAngle = m_Angle;
00172     *pMagnitude = m_Magnitude;
00173 }

void BlendPathOffset::RotateByAngle double  Angle,
MILLIPOINT pXOffset,
MILLIPOINT pYOffset
 

to find out the x and y offset values if this blendpathoffset were to be rotated by the given angle

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/12/99
Parameters:
Angle - the angle to rotate by [INPUTS]
pXOffset - the resulting scalar value of the vector [OUTPUTS] pYOffset
Returns:
-

Definition at line 191 of file brushref.cpp.

00192 {
00193     double NewAngle = m_Angle + Angle;
00194 
00195     *pXOffset = (MILLIPOINT)(m_Magnitude * cos(NewAngle));
00196     *pYOffset = (MILLIPOINT)(m_Magnitude * sin(NewAngle));
00197 }


Member Data Documentation

double BlendPathOffset::m_Angle [protected]
 

Definition at line 140 of file brushref.h.

MILLIPOINT BlendPathOffset::m_Magnitude [protected]
 

Definition at line 141 of file brushref.h.

MILLIPOINT BlendPathOffset::m_XOffset
 

Definition at line 135 of file brushref.h.

MILLIPOINT BlendPathOffset::m_YOffset
 

Definition at line 136 of file brushref.h.


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