Quantum GIS API Documentation
1.8
|
00001 /*************************************************************************** 00002 qgscentralpointpositionmanager.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 QGSCENTRALPOINTPOSITIONMANAGER 00019 #define QGSCENTRALPOINTPOSITIONMANAGER 00020 00021 #include "qgsoverlayobjectpositionmanager.h" 00022 #include "qgsrendercontext.h" 00023 00024 class QgsPoint; 00025 00030 class QgsCentralPointPositionManager: public QgsOverlayObjectPositionManager 00031 { 00032 public: 00033 QgsCentralPointPositionManager(); 00034 ~QgsCentralPointPositionManager(); 00035 void addLayer( QgsVectorLayer* vl, QList<QgsVectorOverlay*>& overlays ); 00037 void removeLayers(); 00038 void findObjectPositions( const QgsRenderContext& context, QGis::UnitType unitType ); 00039 00040 private: 00042 int findObjectPosition( const unsigned char* wkb, QgsPoint& position ) const; 00045 int calculatePolygonCentroid( double x[], double y[], int numberOfPoints, double& centroidX, double& centroidY ) const; 00046 00048 QList<QgsVectorOverlay*> mOverlays; 00049 }; 00050 00051 #endif