svgtopt/gfx2d/inc/GfxLine2D.h
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 header file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef GFXLINE2D_H
       
    20 #define GFXLINE2D_H
       
    21 
       
    22 #include <e32std.h>
       
    23 
       
    24 
       
    25 #include "GfxFloatFixPt.h"
       
    26 #include "GfxRectangle2D.h"
       
    27 #include "GfxRectangularShape.h"
       
    28 #include "GfxPoint2D.h"
       
    29 #include "GfxPathIterator.h"
       
    30 #include "GfxAffineTransform.h"
       
    31 
       
    32 
       
    33 
       
    34 /**
       
    35  * Implementation of a line.
       
    36  *
       
    37  *  @lib Gfx2D.lib
       
    38  *  @since 1.0
       
    39  */
       
    40 class TGfxLine2D : public MGfxShape
       
    41     {
       
    42     public:
       
    43 
       
    44         /**
       
    45          * Contructor.
       
    46          *
       
    47          * @since 1.0
       
    48          * @param aX1 : x coordinate of starting point.
       
    49          * @param aY1 : y coordinate of starting point.
       
    50          * @param aX2 : x coordinate of ending point.
       
    51          * @param aY2 : y coordinate of ending point.
       
    52          * @return
       
    53          */
       
    54                  TGfxLine2D( const TFloatFixPt& aX1,
       
    55                                      const TFloatFixPt& aY1,
       
    56                                      const TFloatFixPt& aX2,
       
    57                                      const TFloatFixPt& aY2 );
       
    58 
       
    59         /**
       
    60          * Contructor.
       
    61          *
       
    62          * @since 1.0
       
    63          * @param aP1 : starting point.
       
    64          * @param aP2 : ending point.
       
    65          * @return
       
    66          */
       
    67                 TGfxLine2D( TGfxPoint2D aP1, TGfxPoint2D aP2 );
       
    68 
       
    69         //
       
    70 
       
    71         /**
       
    72          * Get the length of this line.
       
    73          *
       
    74          * @since 1.0
       
    75          * @return length
       
    76          */
       
    77          TFloatFixPt Length();
       
    78 
       
    79         // Implementation of MGfShape
       
    80 
       
    81         /**
       
    82          * Get the bounding box.
       
    83          *
       
    84          * @since 1.0
       
    85          * @param aAt : transform to apply.
       
    86          * @param aRect : storage of bounding box info.
       
    87          * @return
       
    88          */
       
    89          void   GetBounds( const TGfxAffineTransform& aAt,
       
    90                                    TGfxRectangle2D& aRect );
       
    91 
       
    92         /**
       
    93          * Get the path iterator for this line.
       
    94          *
       
    95          * @since 1.0
       
    96          * @param aAt : transform to apply.
       
    97          * @param aPitr : storage for iterator.
       
    98          * @return
       
    99          */
       
   100          void   GetPathIteratorL( TGfxAffineTransform* aAt,
       
   101                                           CGfxPathIterator*& aPitr );
       
   102 
       
   103         /**
       
   104          * Get the path iterator for this line.
       
   105          *
       
   106          * @since 1.0
       
   107          * @param aAt : transform to apply.
       
   108          * @param aLimit : maximum of point to define iterator.
       
   109          * @param aPitr : storage for iterator.
       
   110          * @return
       
   111          */
       
   112          void   GetPathIteratorL( TGfxAffineTransform* aAt,
       
   113                                           TInt aLimit,
       
   114                                           CGfxPathIterator*& aPitr );
       
   115 
       
   116         /**
       
   117          * Get area of this line: zero.
       
   118          *
       
   119          * @since 1.0
       
   120          * @return
       
   121          */
       
   122         TFloatFixPt AreaSize();
       
   123 
       
   124 
       
   125         /* Return shape type */
       
   126         inline virtual TInt ShapeType () { return ELine; };
       
   127 
       
   128     public:
       
   129         TFloatFixPt  iX1;
       
   130         TFloatFixPt  iY1;
       
   131         TFloatFixPt  iX2;
       
   132         TFloatFixPt  iY2;
       
   133     };
       
   134 
       
   135 #endif      // GFXLINE2D_H