Commit 1368ec36 authored by Sanjiban Bairagya's avatar Sanjiban Bairagya
Browse files

Kml_scaleTagHandler{.cpp, .h} -> KmlScaleTagHandler{.cpp, .h}

parent a8f0f4b7
......@@ -326,7 +326,7 @@ geodata/handlers/kml/KmlRoleTagHandler.cpp
geodata/handlers/kml/KmlRollTagHandler.cpp
geodata/handlers/kml/KmlRotationTagHandler.cpp
geodata/handlers/kml/KmlRotationXYTagHandler.cpp
geodata/handlers/kml/Kml_scaleTagHandler.cpp
geodata/handlers/kml/KmlScaleTagHandler.cpp
geodata/handlers/kml/KmlSchemaDataTagHandler.cpp
geodata/handlers/kml/KmlSchemaTagHandler.cpp
geodata/handlers/kml/KmlScreenOverlayTagHandler.cpp
......
//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2013 Mayank Madan <maddiemadan@gmail.com>
//
/*
Copyright (C) 2008 Patrick Spendrin <ps_ml@gmx.de>
This file is part of the KDE project
This library is free software you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
aint with this library see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
// be aware that there is another Tag called Scale which uses the name KmlscaleTagHandler.h
// as it is impossible to use the name KmlscaleTagHandler then, use an underscore
// to mark the lower case variant
#include "KmlScaleTagHandler.h"
#include "MarbleDebug.h"
#include "KmlElementDictionary.h"
#include "KmlObjectTagHandler.h"
#include "GeoDataScale.h"
#include "GeoDataGeometry.h"
#include "GeoDataModel.h"
#include "GeoDataParser.h"
#include "GeoDataIconStyle.h"
#include "GeoDataLabelStyle.h"
#include "GeoParser.h"
namespace Marble
{
namespace kml
{
KML_DEFINE_TAG_HANDLER( Scale )
KML_DEFINE_TAG_HANDLER( scale )
GeoNode* KmlScaleTagHandler::parse( GeoParser& parser ) const
GeoNode* KmlscaleTagHandler::parse( GeoParser& parser ) const
{
Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_Scale)));
Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_scale)));
GeoDataScale scale;
KmlObjectTagHandler::parseIdentifiers( parser, &scale );
GeoStackItem parentItem = parser.parentElement();
if( parentItem.represents( kmlTag_Model ) ) {
parentItem.nodeAs<GeoDataModel>()->setScale(scale);
return &parentItem.nodeAs<GeoDataModel>()->scale();
} else {
return 0;
if ( parentItem.represents( kmlTag_IconStyle ) ) {
parentItem.nodeAs<GeoDataIconStyle>()->setScale(
parser.readElementText().trimmed().toFloat() );
} else if( parentItem.represents( kmlTag_LabelStyle ) ) {
parentItem.nodeAs<GeoDataLabelStyle>()->setScale(
parser.readElementText().trimmed().toFloat() );
}
return 0;
}
}
......
//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2013 Mayank Madan <maddiemadan@gmail.com>
//
#ifndef KMLSCALETAGHANDLER_H
#define KMLSCALETAGHANDLER_H
/*
Copyright (C) 2008 Patrick Spendrin <ps_ml@gmx.de>
This file is part of the KDE project
This library is free software you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
aint with this library see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef MARBLE_KML_KMLsCALETAGHANDLER_H
#define MARBLE_KML_KMLsCALETAGHANDLER_H
// be aware that there is another Tag called Scale which uses the name KmlscaleTagHandler.h
// as it is impossible to use the name KmlscaleTagHandler then, use an underscore
// to mark the lower case variant
// FIXME: is this really the case nowadays?
// There does not seem to be a KmlscaleTagHandler.h, nor seems kmlTag_Scale to be used anymore.
// As a reminder let's keep the small 's' for now.
#include "GeoTagHandler.h"
......@@ -18,7 +36,7 @@ namespace Marble
namespace kml
{
class KmlScaleTagHandler : public GeoTagHandler
class KmlscaleTagHandler : public GeoTagHandler
{
public:
virtual GeoNode* parse(GeoParser&) const;
......@@ -26,4 +44,5 @@ public:
}
}
#endif // KMLSCALETAGHANDLER_H
#endif
/*
Copyright (C) 2008 Patrick Spendrin <ps_ml@gmx.de>
This file is part of the KDE project
This library is free software you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
aint with this library see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
// be aware that there is another Tag called Scale which uses the name KmlscaleTagHandler.h
// as it is impossible to use the name KmlscaleTagHandler then, use an underscore
// to mark the lower case variant
#include "Kml_scaleTagHandler.h"
#include "MarbleDebug.h"
#include "KmlElementDictionary.h"
#include "GeoDataIconStyle.h"
#include "GeoDataLabelStyle.h"
#include "GeoParser.h"
namespace Marble
{
namespace kml
{
KML_DEFINE_TAG_HANDLER( scale )
GeoNode* KmlscaleTagHandler::parse( GeoParser& parser ) const
{
Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_scale)));
GeoStackItem parentItem = parser.parentElement();
if ( parentItem.represents( kmlTag_IconStyle ) ) {
parentItem.nodeAs<GeoDataIconStyle>()->setScale(
parser.readElementText().trimmed().toFloat() );
} else if( parentItem.represents( kmlTag_LabelStyle ) ) {
parentItem.nodeAs<GeoDataLabelStyle>()->setScale(
parser.readElementText().trimmed().toFloat() );
}
return 0;
}
}
}
/*
Copyright (C) 2008 Patrick Spendrin <ps_ml@gmx.de>
This file is part of the KDE project
This library is free software you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
aint with this library see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef MARBLE_KML_KMLsCALETAGHANDLER_H
#define MARBLE_KML_KMLsCALETAGHANDLER_H
// be aware that there is another Tag called Scale which uses the name KmlscaleTagHandler.h
// as it is impossible to use the name KmlscaleTagHandler then, use an underscore
// to mark the lower case variant
// FIXME: is this really the case nowadays?
// There does not seem to be a KmlscaleTagHandler.h, nor seems kmlTag_Scale to be used anymore.
// As a reminder let's keep the small 's' for now.
#include "GeoTagHandler.h"
namespace Marble
{
namespace kml
{
class KmlscaleTagHandler : public GeoTagHandler
{
public:
virtual GeoNode* parse(GeoParser&) const;
};
}
}
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment