|
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 GFXELLIPSE2D_H |
|
20 #define GFXELLIPSE2D_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include "GfxFloatFixPt.h" |
|
24 |
|
25 #include "GfxRectangle2D.h" |
|
26 #include "GfxRectangularShape.h" |
|
27 #include "GfxPoint2D.h" |
|
28 #include "GfxPathIterator.h" |
|
29 #include "GfxAffineTransform.h" |
|
30 |
|
31 |
|
32 |
|
33 enum TEllipseConstructType |
|
34 { |
|
35 EElipseCenterAndRadius, // cx, cy, rx, ry |
|
36 EElipseRectangular // x, y, w, h |
|
37 }; |
|
38 |
|
39 |
|
40 /** |
|
41 * Implementation of an ellipse. |
|
42 * |
|
43 * @lib Gfx2D.lib |
|
44 * @since 1.0 |
|
45 */ |
|
46 class TGfxEllipse2D : public TGfxRectangularShape |
|
47 { |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Construct a TGfxEllipse2D object. |
|
52 * |
|
53 * @since 1.0 |
|
54 * @param aX1 : focus point 1 or top-left x coordinate |
|
55 * @param aY1 : focus point 1 or top-left y coordinate |
|
56 * @param aWidth : focus point 2 or width |
|
57 * @param aHeight : focus point 2 or height |
|
58 * @return |
|
59 */ |
|
60 TGfxEllipse2D( const TFloatFixPt & aX, |
|
61 const TFloatFixPt & aY, |
|
62 const TFloatFixPt & aWidth, |
|
63 const TFloatFixPt & aHeight ); |
|
64 |
|
65 /** |
|
66 * Construct a TGfxEllipse2D object. The TEllipseConstructType |
|
67 * parameter defines the type of ellipse to create. |
|
68 * |
|
69 * @since 1.0 |
|
70 * @param aX1 : focus point 1 or top-left x coordinate |
|
71 * @param aY1 : focus point 1 or top-left y coordinate |
|
72 * @param aX1 : focus point 2 or width |
|
73 * @param aY1 : focus point 2 or height |
|
74 * @param aEtype : elliptical or rectangular data given |
|
75 * @return |
|
76 */ |
|
77 TGfxEllipse2D( const TFloatFixPt & aX1, |
|
78 const TFloatFixPt & aY1, |
|
79 const TFloatFixPt & aX2, |
|
80 const TFloatFixPt & aY2, |
|
81 TEllipseConstructType aEtype ); |
|
82 |
|
83 /** |
|
84 * Get the path iterator for this shape. |
|
85 * Implementation of MGfxShape method. |
|
86 * |
|
87 * @since 1.0 |
|
88 * @param aAt : transform to apply the defining points. |
|
89 * @param aPitr : path iterator data storage. |
|
90 * @return |
|
91 */ |
|
92 void GetPathIteratorL( TGfxAffineTransform* aAt, |
|
93 CGfxPathIterator*& aPitr ); |
|
94 |
|
95 /** |
|
96 * Get the path iterator for this shape. |
|
97 * Implementation of MGfxShape method. |
|
98 * |
|
99 * @since 1.0 |
|
100 * @param aAt : transform to apply the defining points. |
|
101 * @param aLimit : number of points defining the path. |
|
102 * @param aPitr : path iterator data storage. |
|
103 * @return |
|
104 */ |
|
105 void GetPathIteratorL( TGfxAffineTransform* aAt, |
|
106 TInt aLimit, |
|
107 CGfxPathIterator*& aPitr ); |
|
108 |
|
109 |
|
110 /* Return shape type */ |
|
111 inline virtual TInt ShapeType () { return EEllipse; }; |
|
112 |
|
113 }; |
|
114 |
|
115 #endif // GFXELLIPSE2D_H |