|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Graphics Extension Library header file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef GFXPOINT2D_H |
|
20 #define GFXPOINT2D_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include "GfxFloatFixPt.h" |
|
24 |
|
25 |
|
26 /** |
|
27 * Implementation of a 2D point. |
|
28 * |
|
29 * @lib Gfx2D.lib |
|
30 * @since 1.0 |
|
31 */ |
|
32 class TGfxPoint2D |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Constructor. Default coordinates to (0, 0). |
|
38 * |
|
39 * @since 1.0 |
|
40 * @return |
|
41 */ |
|
42 TGfxPoint2D(); |
|
43 |
|
44 /** |
|
45 * Constructor. Define point to be at the given coordinates. |
|
46 * |
|
47 * @since 1.0 |
|
48 * @param aX : x coordinate |
|
49 * @param aY : y coordinate |
|
50 * @return |
|
51 */ |
|
52 TGfxPoint2D( TFloatFixPt aX, TFloatFixPt aY ); |
|
53 |
|
54 /** |
|
55 * Get distance between this point and the given point. |
|
56 * |
|
57 * @since 1.0 |
|
58 * @param aPoint : point for distance calculation |
|
59 * @return distance between two points. |
|
60 */ |
|
61 TFloatFixPt Distance( const TGfxPoint2D& aPoint ); |
|
62 |
|
63 /** |
|
64 * Get distance squared between this point and the given point. |
|
65 * |
|
66 * @since 1.0 |
|
67 * @param aPoint : point for distance calculation |
|
68 * @return distance squared between two points. |
|
69 */ |
|
70 TFloatFixPt DistanceSq( const TGfxPoint2D& aPoint ); |
|
71 |
|
72 TInt operator==( const TGfxPoint2D& aPoint ) const; |
|
73 |
|
74 TInt operator!=( const TGfxPoint2D& aPoint ) const; |
|
75 |
|
76 public: |
|
77 // Coordinates |
|
78 TFloatFixPt iX; |
|
79 TFloatFixPt iY; |
|
80 }; |
|
81 |
|
82 #endif // GFXPOINT2D_H |