QGIS API Documentation  master-3f58142
src/core/qgsoverlayobject.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                          qgsoverlayobject.h  -  description
00003                          ------------------------------
00004     begin                : January 2007
00005     copyright            : (C) 2007 by Marco Hugentobler
00006     email                : marco dot hugentobler at karto dot baug dot ethz dot ch
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef QGSOVERLAYOBJECT_H
00019 #define QGSOVERLAYOBJECT_H
00020 
00021 #include "qgsgeometry.h"
00022 #include "qgspoint.h"
00023 #include <QList>
00024 
00025 class QgsGeometry;
00026 
00032 class CORE_EXPORT QgsOverlayObject
00033 {
00034   public:
00035     QgsOverlayObject( int width = 0, int height = 0, double rotation = 0, QgsGeometry* geometry = 0 );
00036     virtual ~QgsOverlayObject();
00037 
00038     //copy constructor and assignment operator necessary because of mGeometry
00039     QgsOverlayObject( const QgsOverlayObject& other );
00040     QgsOverlayObject& operator=( const QgsOverlayObject& other );
00041 
00042     //getters
00043     int width() const {return mWidth;}
00044     int height() const {return mHeight;}
00045     double rotation() const {return mRotation;}
00046     QgsGeometry* geometry() {return mGeometry;}
00047     const QgsGeometry* geometry() const {return mGeometry;}
00048     QgsPoint position() const;
00049     QList<QgsPoint> positions() const {return mPositions;}
00050 
00051     //setters
00052     void setHeight( int height ) {mHeight = height;}
00053     void setWidth( int width ) {mWidth = width;}
00054     void setRotation( double rotation ) {mRotation = rotation;}
00056     void setGeometry( QgsGeometry* g );
00058     void addPosition( const QgsPoint& position );
00059 
00060 
00061   private:
00062 
00064     int mWidth;
00066     int mHeight;
00071     QList<QgsPoint> mPositions;
00073     double mRotation;
00076     QgsGeometry* mGeometry;
00077 
00078 };
00079 
00080 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines