svgtopt/gfx2d/src/GfxGeom/GfxEllipse2D.cpp
changeset 46 88edb906c587
equal deleted inserted replaced
-1:000000000000 46:88edb906c587
       
     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 source file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "GfxEllipse2D.h"
       
    20 #include "GfxEllipseIteratorP.h"
       
    21 #include "GfxFlatteningPathIterator.h"
       
    22 
       
    23 // --------------------------------------------------------------------------
       
    24 //  TGfxEllipse2D::TGfxEllipse2D( const TFloatFixPt& aX,
       
    25 // ---------------------------------------------------------------------------
       
    26  TGfxEllipse2D::TGfxEllipse2D( const TFloatFixPt& aX,
       
    27                                        const TFloatFixPt& aY,
       
    28                                        const TFloatFixPt& aWidth,
       
    29                                        const TFloatFixPt& aHeight ) :
       
    30          TGfxRectangularShape( aX, aY, aWidth, aHeight )
       
    31 {
       
    32 }
       
    33 
       
    34 
       
    35 // --------------------------------------------------------------------------
       
    36 //  TGfxEllipse2D::TGfxEllipse2D( const TFloatFixPt& aX1,
       
    37 // ---------------------------------------------------------------------------
       
    38  TGfxEllipse2D::TGfxEllipse2D( const TFloatFixPt& aX1,
       
    39                                        const TFloatFixPt& aY1,
       
    40                                        const TFloatFixPt& aX2,
       
    41                                        const TFloatFixPt& aY2,
       
    42                                        TEllipseConstructType aEtype )
       
    43     {
       
    44     if ( aEtype == EElipseRectangular )
       
    45         {
       
    46         iX = aX1;
       
    47         iY = aY1;
       
    48         iWidth = aX2;
       
    49         iHeight = aY2;
       
    50         }
       
    51     else
       
    52         {
       
    53         // convert cx,cy,rx,ry -> x,y,w,h
       
    54         iX = aX1 - aX2;
       
    55         iY = aY1 - aY2;
       
    56         iWidth = aX2 + aX2;
       
    57         iHeight = aY2 + aY2;
       
    58         }
       
    59     }
       
    60 
       
    61 // --------------------------------------------------------------------------
       
    62 //  void TGfxEllipse2D::GetPathIteratorL( TGfxAffineTransform* aAt,
       
    63 // ---------------------------------------------------------------------------
       
    64  void TGfxEllipse2D::GetPathIteratorL( TGfxAffineTransform* aAt,
       
    65                                                CGfxPathIterator*& aPitr )
       
    66     {
       
    67     aPitr = new( ELeave ) CGfxEllipseIteratorP( this, aAt );
       
    68     }
       
    69 
       
    70 // --------------------------------------------------------------------------
       
    71 //  void TGfxEllipse2D::GetPathIteratorL( TGfxAffineTransform* aAt,
       
    72 // ---------------------------------------------------------------------------
       
    73  void TGfxEllipse2D::GetPathIteratorL( TGfxAffineTransform* aAt,
       
    74                                                TInt aLimit,
       
    75                                                CGfxPathIterator*& aPitr )
       
    76     {
       
    77     aPitr = CGfxFlatteningPathIterator::NewL( this, aAt, aLimit );
       
    78 
       
    79     }
       
    80