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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • data
GeoDataPolyStyle.cpp
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 2008 Patrick Spendrin <ps_ml@gmx.de>
9 //
10 
11 
12 #include "GeoDataPolyStyle.h"
13 
14 #include "GeoDataTypes.h"
15 
16 namespace Marble
17 {
18 
19 class GeoDataPolyStylePrivate
20 {
21  public:
22  GeoDataPolyStylePrivate()
23  : m_fill( true ), m_outline( true ), m_brushStyle( Qt::SolidPattern )
24  {
25  }
26 
27  const char* nodeType() const
28  {
29  return GeoDataTypes::GeoDataPolyStyleType;
30  }
31 
33  bool m_fill;
35  bool m_outline;
36  Qt::BrushStyle m_brushStyle;
37 };
38 
39 GeoDataPolyStyle::GeoDataPolyStyle()
40  : d( new GeoDataPolyStylePrivate )
41 {
42 }
43 
44 GeoDataPolyStyle::GeoDataPolyStyle( const GeoDataPolyStyle& other )
45  : GeoDataColorStyle( other ), d( new GeoDataPolyStylePrivate( *other.d ) )
46 {
47 }
48 
49 GeoDataPolyStyle::GeoDataPolyStyle( const QColor &color )
50  : d( new GeoDataPolyStylePrivate )
51 {
52  setColor( color );
53 }
54 
55 GeoDataPolyStyle::~GeoDataPolyStyle()
56 {
57  delete d;
58 }
59 
60 GeoDataPolyStyle& GeoDataPolyStyle::operator=( const GeoDataPolyStyle& other )
61 {
62  GeoDataColorStyle::operator=( other );
63  *d = *other.d;
64  return *this;
65 }
66 
67 const char* GeoDataPolyStyle::nodeType() const
68 {
69  return d->nodeType();
70 }
71 
72 void GeoDataPolyStyle::setFill( const bool &fill )
73 {
74  d->m_fill = fill;
75 }
76 
77 bool GeoDataPolyStyle::fill() const
78 {
79  return d->m_fill;
80 }
81 
82 void GeoDataPolyStyle::setOutline( const bool &outline )
83 {
84  d->m_outline = outline;
85 }
86 
87 bool GeoDataPolyStyle::outline() const
88 {
89  return d->m_outline;
90 }
91 
92 void GeoDataPolyStyle::setBrushStyle( const Qt::BrushStyle style )
93 {
94  d->m_brushStyle = style;
95 }
96 
97 Qt::BrushStyle GeoDataPolyStyle::brushStyle() const
98 {
99  return d->m_brushStyle;
100 }
101 
102 void GeoDataPolyStyle::pack( QDataStream& stream ) const
103 {
104  GeoDataColorStyle::pack( stream );
105 
106  stream << d->m_fill;
107  stream << d->m_outline;
108 }
109 
110 void GeoDataPolyStyle::unpack( QDataStream& stream )
111 {
112  GeoDataColorStyle::unpack( stream );
113 
114  stream >> d->m_fill;
115  stream >> d->m_outline;
116 }
117 
118 }
Marble::GeoDataPolyStyle::fill
bool fill() const
Return true if polygons get filled.
Definition: GeoDataPolyStyle.cpp:77
Marble::GeoDataTypes::GeoDataPolyStyleType
const char * GeoDataPolyStyleType
Definition: GeoDataTypes.cpp:66
Marble::GeoDataColorStyle::setColor
void setColor(const QColor &value)
Set a new color.
Definition: GeoDataColorStyle.cpp:73
Marble::GeoDataPolyStyle::unpack
virtual void unpack(QDataStream &stream)
Unserialize the style from a stream.
Definition: GeoDataPolyStyle.cpp:110
Marble::GeoDataPolyStyle::GeoDataPolyStyle
GeoDataPolyStyle()
Construct a new GeoDataPolyStyle.
Definition: GeoDataPolyStyle.cpp:39
Marble::GeoDataPolyStyle::pack
virtual void pack(QDataStream &stream) const
Serialize the style to a stream.
Definition: GeoDataPolyStyle.cpp:102
Marble::GeoDataPolyStyle::~GeoDataPolyStyle
~GeoDataPolyStyle()
Definition: GeoDataPolyStyle.cpp:55
Marble::GeoDataPolyStyle::operator=
GeoDataPolyStyle & operator=(const GeoDataPolyStyle &other)
assignment operator
Definition: GeoDataPolyStyle.cpp:60
Marble::GeoDataColorStyle::pack
virtual void pack(QDataStream &stream) const
Serialize the style to a stream.
Definition: GeoDataColorStyle.cpp:107
Marble::GeoDataPolyStyle::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataPolyStyle.cpp:67
Marble::GeoDataColorStyle
an abstract base class for various style classes
Definition: GeoDataColorStyle.h:64
Marble::GeoDataPolyStyle::setFill
void setFill(const bool &fill)
Set whether to fill the polygon.
Definition: GeoDataPolyStyle.cpp:72
Marble::GeoDataPolyStyle::outline
bool outline() const
Return true if outlines of polygons get drawn.
Definition: GeoDataPolyStyle.cpp:87
Marble::GeoDataPolyStyle::brushStyle
Qt::BrushStyle brushStyle() const
Return brush style.
Definition: GeoDataPolyStyle.cpp:97
Marble::GeoDataColorStyle::unpack
virtual void unpack(QDataStream &stream)
Unserialize the style from a stream.
Definition: GeoDataColorStyle.cpp:116
Marble::GeoDataPolyStyle::setBrushStyle
void setBrushStyle(const Qt::BrushStyle style)
Set brush style.
Definition: GeoDataPolyStyle.cpp:92
GeoDataTypes.h
Marble::GeoDataPolyStyle::setOutline
void setOutline(const bool &outline)
Set whether to draw the outline.
Definition: GeoDataPolyStyle.cpp:82
Marble::GeoDataColorStyle::operator=
GeoDataColorStyle & operator=(const GeoDataColorStyle &other)
assignment operator
Definition: GeoDataColorStyle.cpp:61
Marble::GeoDataPolyStyle
specifies the style how polygons are drawn
Definition: GeoDataPolyStyle.h:34
GeoDataPolyStyle.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:50 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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