[QGIS Commit] r8823 - branches/advanced_printing_branch/src/app/composer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Jul 22 08:36:18 EDT 2008


Author: mhugent
Date: 2008-07-22 08:36:18 -0400 (Tue, 22 Jul 2008)
New Revision: 8823

Removed:
   branches/advanced_printing_branch/src/app/composer/qgsticksdownscalebarstyle.cpp
   branches/advanced_printing_branch/src/app/composer/qgsticksdownscalebarstyle.h
Log:
Different ticks styles now in the same class

Deleted: branches/advanced_printing_branch/src/app/composer/qgsticksdownscalebarstyle.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgsticksdownscalebarstyle.cpp	2008-07-22 12:34:30 UTC (rev 8822)
+++ branches/advanced_printing_branch/src/app/composer/qgsticksdownscalebarstyle.cpp	2008-07-22 12:36:18 UTC (rev 8823)
@@ -1,74 +0,0 @@
-/***************************************************************************
-                            qgsticksdownscalebarstyle.cpp
-                            ------------------------------
-    begin                : July 2008
-    copyright            : (C) 2008 by Marco Hugentobler
-    email                : marco.hugentobler at karto.baug.ethz.ch
- ***************************************************************************/
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- ***************************************************************************/
-
-#include "qgsticksdownscalebarstyle.h"
-#include "qgscomposerscalebar.h"
-#include <QPainter>
-
-QgsTicksDownScaleBarStyle::QgsTicksDownScaleBarStyle(const QgsComposerScaleBar* bar): QgsScaleBarStyle(bar)
-{
-
-}
-
-QgsTicksDownScaleBarStyle::QgsTicksDownScaleBarStyle(): QgsScaleBarStyle(0)
-{
-
-}
-
-QgsTicksDownScaleBarStyle::~QgsTicksDownScaleBarStyle()
-{
-
-}
-
-QString QgsTicksDownScaleBarStyle::name() const
-{
-  return "Line Ticks Middle";
-}
-
-void QgsTicksDownScaleBarStyle::draw(QPainter* p) const
-{
-  if(!mScaleBar)
-    {
-      return;
-    }
-  double barTopPosition = mScaleBar->fontHeight() + mScaleBar->labelBarSpace() + mScaleBar->boxContentSpace();
-  double middlePosition = barTopPosition + mScaleBar->height()/2.0;
-
-  p->save();
-  p->setPen(mScaleBar->pen());
-
-  QList<QPair<double, double> > segmentInfo;
-  mScaleBar->segmentPositions(segmentInfo);
-
-  QList<QPair<double, double> >::const_iterator segmentIt = segmentInfo.constBegin();
-  for(; segmentIt != segmentInfo.constEnd(); ++segmentIt)
-    {
-      p->drawLine(segmentIt->first, barTopPosition, segmentIt->first, barTopPosition + mScaleBar->height());
-      p->drawLine(segmentIt->first, barTopPosition, segmentIt->first + mScaleBar->segmentMM(), barTopPosition); 
-    }
-
-  //draw last tick
-  if(!segmentInfo.isEmpty())
-    {
-      double lastTickPositionX = segmentInfo.last().first + mScaleBar->segmentMM();
-      p->drawLine(lastTickPositionX, barTopPosition, lastTickPositionX, barTopPosition + mScaleBar->height());
-    }
-
-  p->restore();
-
-  //draw labels using the default method
-  drawLabels(p);
-}

Deleted: branches/advanced_printing_branch/src/app/composer/qgsticksdownscalebarstyle.h
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgsticksdownscalebarstyle.h	2008-07-22 12:34:30 UTC (rev 8822)
+++ branches/advanced_printing_branch/src/app/composer/qgsticksdownscalebarstyle.h	2008-07-22 12:36:18 UTC (rev 8823)
@@ -1,37 +0,0 @@
-/***************************************************************************
-                            qgsticksdownscalebarstyle.h
-                            -----------------------------
-    begin                : July 2008
-    copyright            : (C) 2008 by Marco Hugentobler
-    email                : marco.hugentobler at karto.baug.ethz.ch
- ***************************************************************************/
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- ***************************************************************************/
-
-#ifndef QGSTICKSDOWNSCALEBARSTYLE_H
-#define QGSTICKSDOWNSCALEBARSTYLE_H
-
-#include "qgsscalebarstyle.h"
-
-/**Scale bar style that draws a line and ticks down*/
-class QgsTicksDownScaleBarStyle: public QgsScaleBarStyle
-{
-  public:
-  QgsTicksDownScaleBarStyle(const QgsComposerScaleBar* bar);
-  ~QgsTicksDownScaleBarStyle();
-
-  QString name() const;
-
-  void draw(QPainter* p) const;
-
- private:
-  QgsTicksDownScaleBarStyle(); //forbidden
-}
-
-#endif 



More information about the QGIS-commit mailing list