~ubuntu-branches/ubuntu/quantal/marble/quantal

« back to all changes in this revision

Viewing changes to src/lib/geodata/writers/dgml/DgmlVectorTagWriter.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Philip Muškovac
  • Date: 2011-07-11 15:43:02 UTC
  • Revision ID: james.westby@ubuntu.com-20110711154302-lq69ftcx125g1jx5
Tags: upstream-4.6.90+repack
Import upstream version 4.6.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 2011 Utku Aydın <utkuaydin34@gmail.com>
 
9
//
 
10
 
 
11
#include "DgmlVectorTagWriter.h"
 
12
 
 
13
#include "GeoWriter.h"
 
14
#include "GeoSceneVector.h"
 
15
#include "GeoSceneTypes.h"
 
16
#include "DgmlElementDictionary.h"
 
17
 
 
18
namespace Marble
 
19
{
 
20
 
 
21
static GeoTagWriterRegistrar s_writerVector( GeoTagWriter::QualifiedName( GeoSceneTypes::GeoSceneVectorType, dgml::dgmlTag_nameSpace20 ), new DgmlVectorTagWriter() );
 
22
 
 
23
bool DgmlVectorTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
 
24
{
 
25
    const GeoSceneVector *vector = static_cast<const GeoSceneVector*>( node );
 
26
    writer.writeStartElement( dgml::dgmlTag_Vector );
 
27
    writer.writeAttribute( "name", vector->name() );
 
28
    writer.writeAttribute( "feature", vector->feature() );
 
29
    
 
30
    writer.writeStartElement( dgml::dgmlTag_SourceFile );
 
31
    writer.writeAttribute( "format", vector->fileFormat() );
 
32
    writer.writeCharacters( vector->sourceFile() );
 
33
    writer.writeEndElement();
 
34
    
 
35
    writer.writeStartElement( dgml::dgmlTag_Pen );
 
36
    writer.writeAttribute( "color", vector->pen().color().name() );
 
37
    writer.writeEndElement();
 
38
        
 
39
    writer.writeEndElement();
 
40
    return true;
 
41
}
 
42
 
 
43
}