Marble

KmlPolyStyleTagWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2013 Thibaut Gridel <[email protected]>
4 
5 #include "KmlPolyStyleTagWriter.h"
6 
7 #include "GeoDataPolyStyle.h"
8 #include "GeoDataTypes.h"
9 #include "GeoWriter.h"
10 #include "KmlElementDictionary.h"
11 
12 namespace Marble
13 {
14 
15 static GeoTagWriterRegistrar s_writerLineStyle(
16  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataPolyStyleType,
17  kml::kmlTag_nameSpaceOgc22 ),
18  new KmlPolyStyleTagWriter );
19 
20 KmlPolyStyleTagWriter::KmlPolyStyleTagWriter() : KmlColorStyleTagWriter( kml::kmlTag_PolyStyle )
21 {
22 }
23 
24 bool KmlPolyStyleTagWriter::writeMid( const GeoNode *node, GeoWriter& writer ) const
25 {
26  const GeoDataPolyStyle *style = static_cast<const GeoDataPolyStyle*>( node );
27 
28  if ( !style->fill() ) {
29  writer.writeElement( "fill", "0" );
30  }
31  if ( !style->outline() ) {
32  writer.writeElement( "outline", "0" );
33  }
34 
35  return true;
36 }
37 
38 bool KmlPolyStyleTagWriter::isEmpty(const GeoNode *node) const
39 {
40  const GeoDataPolyStyle *style = static_cast<const GeoDataPolyStyle*>( node );
41  return style->fill() && style->outline();
42 }
43 
44 }
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Definition: GeoTagWriter.h:44
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Oct 3 2023 04:09:48 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.