kpresenter

KoPointArray.h

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 2001 Laurent MONTEL <lmontel@mandrakesoft.com>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 #ifndef KOPOINTARRAY_H
00021 #define KOPOINTARRAY_H
00022 
00023 #include <qmemarray.h>
00024 #include <KoPoint.h>
00025 #include <KoRect.h>
00026 
00027 class KoZoomHandler;
00028 class KoPointArray : public QMemArray<KoPoint>
00029 {
00030 public:
00031     KoPointArray() {}
00032     ~KoPointArray() {}
00033     KoPointArray( int size ) : QMemArray<KoPoint>( size ) {}
00034     KoPointArray( const KoPointArray &a ) : QMemArray<KoPoint>( a ) {}
00035 
00036     KoPointArray &operator=( const KoPointArray &a )
00037         { return (KoPointArray&)assign( a ); }
00038 
00039     KoPointArray copy() const
00040         { KoPointArray tmp; return *((KoPointArray*)&tmp.duplicate(*this)); }
00041 
00042     void    translate( double dx, double dy );
00043     KoRect   boundingRect() const;
00044 
00045     void    point( uint i, double *x, double *y ) const;
00046     KoPoint  point( uint i ) const;
00047     void    setPoint( uint i, double x, double y );
00048     void    setPoint( uint i, const KoPoint &p );
00049     bool    putPoints( int index, int nPoints, double firstx, double firsty, ... );
00050 
00051     KoPointArray cubicBezier() const;
00052     static void cleanBuffers();
00053 
00054     QPointArray zoomPointArray( const KoZoomHandler* zoomHandler ) const;
00055     // Zoom the point array, taking into account the width of the pen
00056     // (reducing the figure as necessary)
00057     QPointArray zoomPointArray( const KoZoomHandler* zoomHandler, int penWidth ) const;
00058 
00059 protected:
00060     static uint splen;
00061     static void* sp;
00062 };
00063 
00064 
00065 #endif // KOPOINTARRAY_H
KDE Home | KDE Accessibility Home | Description of Access Keys