KHTML
SVGFELightElement.cpp
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 00003 2004, 2005, 2006 Rob Buis <buis@kde.org> 00004 2005 Oliver Hunt <oliver@nerget.com> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #include "config.h" 00023 00024 #if ENABLE(SVG) && ENABLE(SVG_FILTERS) 00025 #include "SVGFELightElement.h" 00026 00027 #include "SVGNames.h" 00028 00029 namespace WebCore { 00030 00031 SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document* doc) 00032 : SVGElement(tagName, doc) 00033 , m_azimuth(0.0f) 00034 , m_elevation(0.0f) 00035 , m_x(0.0f) 00036 , m_y(0.0f) 00037 , m_z(0.0f) 00038 , m_pointsAtX(0.0f) 00039 , m_pointsAtY(0.0f) 00040 , m_pointsAtZ(0.0f) 00041 , m_specularExponent(1.0f) 00042 , m_limitingConeAngle(0.0f) 00043 { 00044 } 00045 00046 SVGFELightElement::~SVGFELightElement() 00047 { 00048 } 00049 00050 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Azimuth, azimuth, SVGNames::azimuthAttr, m_azimuth) 00051 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Elevation, elevation, SVGNames::elevationAttr, m_elevation) 00052 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, X, x, SVGNames::xAttr, m_x) 00053 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Y, y, SVGNames::yAttr, m_y) 00054 00055 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Z, z, SVGNames::zAttr, m_z) 00056 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, PointsAtX, pointsAtX, SVGNames::pointsAtXAttr, m_pointsAtX) 00057 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, PointsAtY, pointsAtY, SVGNames::pointsAtYAttr, m_pointsAtY) 00058 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, PointsAtZ, pointsAtZ, SVGNames::pointsAtZAttr, m_pointsAtZ) 00059 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, SpecularExponent, specularExponent, SVGNames::specularExponentAttr, m_specularExponent) 00060 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, LimitingConeAngle, limitingConeAngle, SVGNames::limitingConeAngleAttr, m_limitingConeAngle) 00061 00062 void SVGFELightElement::parseMappedAttribute(MappedAttribute* attr) 00063 { 00064 const String& value = attr->value(); 00065 if (attr->name() == SVGNames::azimuthAttr) 00066 setAzimuthBaseValue(value.toFloat()); 00067 else if (attr->name() == SVGNames::elevationAttr) 00068 setElevationBaseValue(value.toFloat()); 00069 else if (attr->name() == SVGNames::xAttr) 00070 setXBaseValue(value.toFloat()); 00071 else if (attr->name() == SVGNames::yAttr) 00072 setYBaseValue(value.toFloat()); 00073 else if (attr->name() == SVGNames::zAttr) 00074 setZBaseValue(value.toFloat()); 00075 else if (attr->name() == SVGNames::pointsAtXAttr) 00076 setPointsAtXBaseValue(value.toFloat()); 00077 else if (attr->name() == SVGNames::pointsAtYAttr) 00078 setPointsAtYBaseValue(value.toFloat()); 00079 else if (attr->name() == SVGNames::pointsAtZAttr) 00080 setPointsAtZBaseValue(value.toFloat()); 00081 else if (attr->name() == SVGNames::specularExponentAttr) 00082 setSpecularExponentBaseValue(value.toFloat()); 00083 else if (attr->name() == SVGNames::limitingConeAngleAttr) 00084 setLimitingConeAngleBaseValue(value.toFloat()); 00085 else 00086 SVGElement::parseMappedAttribute(attr); 00087 } 00088 00089 } 00090 00091 #endif // ENABLE(SVG) 00092 00093 // vim:ts=4:noet
KDE 4.6 API Reference