WorkCoord Class Reference

#include <wrkcoord.h>

List of all members.

Public Member Functions

 WorkCoord ()
 WorkCoord (INT32 x, INT32 y)
 WorkCoord (XLONG x, XLONG y)
 Constructor that can initialise elements.
OilCoord ToOil (const WorkCoord &scrollOffset)
 Converts a WorkCoord to an OilCoord.
void ToOil (const WorkCoord &scrollOffset, OilCoord *result)
 Converts a WorkCoord to an OilCoord.
WorkCoordoperator= (const Coord &)
 Safe casting between types using operator overloading.
WorkCoord Pixelise (double pixwidthx, double pixwidthy)

Public Attributes

XLONG x
XLONG y

Friends

WorkCoord operator- (const WorkCoord &)
 Negates a WorkCoord.


Detailed Description

Definition at line 125 of file wrkcoord.h.


Constructor & Destructor Documentation

WorkCoord::WorkCoord  )  [inline]
 

Definition at line 131 of file wrkcoord.h.

00131 { };

WorkCoord::WorkCoord INT32  x,
INT32  y
[inline]
 

Definition at line 168 of file wrkcoord.h.

00169 {
00170     x = (XLONG) initialX;
00171     y = (XLONG) initialY;
00172 }

WorkCoord::WorkCoord XLONG  initialX,
XLONG  initialY
[inline]
 

Constructor that can initialise elements.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/5/93
Parameters:
x and y positions, as ints or XLONGs [INPUTS]
None [OUTPUTS]
Returns:
Errors: None

Definition at line 162 of file wrkcoord.h.

00163 {
00164     x = initialX;
00165     y = initialY;
00166 }


Member Function Documentation

WorkCoord & WorkCoord::operator= const Coord input  )  [inline]
 

Safe casting between types using operator overloading.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/5/93
Parameters:
A Coord [INPUTS]
A WorkCoord [OUTPUTS]
Returns:
Errors: None

Definition at line 189 of file wrkcoord.h.

00190 {
00191     this->x = input.x;
00192     this->y = input.y;
00193 
00194     return *this;
00195 }

WorkCoord WorkCoord::Pixelise double  pixwidthx,
double  pixwidthy
[inline]
 

Definition at line 141 of file wrkcoord.h.

00141                                                            {return WorkCoord(
00142         (INT64)((floor(0.5 + (double)x / pixwidthx)) * pixwidthx),
00143         (INT64)((floor(0.5 + (double)x / pixwidthy)) * pixwidthy)
00144         );}

void WorkCoord::ToOil const WorkCoord scrollOffset,
OilCoord result
 

Converts a WorkCoord to an OilCoord.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/8/93
Parameters:
Scroll offset. [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 139 of file wrkcoord.cpp.

00140 {
00141     result->x = INT32(x - scrollOffset.x); 
00142     result->y = INT32(y - scrollOffset.y);
00143 }

OilCoord WorkCoord::ToOil const WorkCoord scrollOffset  ) 
 

Converts a WorkCoord to an OilCoord.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/8/93
Parameters:
Scroll offset. [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 118 of file wrkcoord.cpp.

00119 {
00120     OilCoord result( INT32(x - scrollOffset.x), INT32(y - scrollOffset.y) );
00121     
00122     return result;
00123 }


Friends And Related Function Documentation

WorkCoord operator- const WorkCoord input  )  [friend]
 

Negates a WorkCoord.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/6/93
Parameters:
A WprkCoord [INPUTS]
A WorkCoord [OUTPUTS]
Returns:
Errors: None

Definition at line 210 of file wrkcoord.h.

00211 {
00212     WorkCoord result;
00213 
00214     result.x = -input.x;
00215     result.y = -input.y;
00216     return result;
00217 }


Member Data Documentation

XLONG WorkCoord::x
 

Definition at line 128 of file wrkcoord.h.

XLONG WorkCoord::y
 

Definition at line 129 of file wrkcoord.h.


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