• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
ClipPainter.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2006-2009 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007 Inge Wallin <ingwa@kde.org>
10 //
11 
12 #ifndef MARBLE_CLIPPAINTER_H
13 #define MARBLE_CLIPPAINTER_H
14 
15 
16 #include <QPointF>
17 #include <QPainter>
18 #include "marble_export.h"
19 #include "MarbleGlobal.h"
20 
21 class QPaintDevice;
22 class QPolygonF;
23 
24 namespace Marble
25 {
38 // The reason for this class is a terrible bug in some versions of the
39 // X Server. Suppose the widget size is, say, 1000 x 1000 and we have
40 // a high zoom so that we want to draw a vector from (-100000,
41 // -100000) to (100000, 100000). Then the X server will create a
42 // bitmap that is at least 100000 x 100000 and in the process eat all
43 // available memory.
44 //
45 // So we introduce the ClipPainter that clips all polylines and polygons
46 // to the area that is actually visible in the viewport.
47 //
48 // @internal
49 
50 class ClipPainterPrivate;
51 class MARBLE_EXPORT ClipPainter : public QPainter
52 {
53  public:
54  ClipPainter();
55  ClipPainter(QPaintDevice*, bool);
56 
57  ~ClipPainter();
58 
59  void setClipping( bool enable );
60  bool isClipping() const;
61 
62  void drawPolygon( const QPolygonF &,
63  Qt::FillRule fillRule = Qt::OddEvenFill );
64 
65  void drawPolyline( const QPolygonF & );
66  void drawPolyline( const QPolygonF &, QVector<QPointF>& labelNodes,
67  LabelPositionFlags labelPositionFlag = LineCenter );
68 
69  // void clearNodeCount(){ m_debugNodeCount = 0; }
70  // int nodeCount(){ return m_debugNodeCount; }
71 
72  private:
73  ClipPainterPrivate * const d;
74 };
75 
76 }
77 
78 #endif
QPaintDevice
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
QPainter
Marble::LineCenter
Definition: MarbleGlobal.h:113
Marble::ClipPainter
Definition: ClipPainter.h:51
MarbleGlobal.h
QVector
marble_export.h
QPolygonF
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal