KHtml

SVGFELightElement.cpp
1 /*
2  Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <[email protected]>
3  2004, 2005, 2006 Rob Buis <[email protected]>
4  2005 Oliver Hunt <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
23 #include "SVGFELightElement.h"
24 
25 #include "SVGNames.h"
26 
27 namespace WebCore
28 {
29 
30 SVGFELightElement::SVGFELightElement(const QualifiedName &tagName, Document *doc)
31  : SVGElement(tagName, doc)
32  , m_azimuth(0.0f)
33  , m_elevation(0.0f)
34  , m_x(0.0f)
35  , m_y(0.0f)
36  , m_z(0.0f)
37  , m_pointsAtX(0.0f)
38  , m_pointsAtY(0.0f)
39  , m_pointsAtZ(0.0f)
40  , m_specularExponent(1.0f)
41  , m_limitingConeAngle(0.0f)
42 {
43 }
44 
45 SVGFELightElement::~SVGFELightElement()
46 {
47 }
48 
49 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Azimuth, azimuth, SVGNames::azimuthAttr, m_azimuth)
50 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Elevation, elevation, SVGNames::elevationAttr, m_elevation)
51 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, X, x, SVGNames::xAttr, m_x)
52 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Y, y, SVGNames::yAttr, m_y)
53 
54 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Z, z, SVGNames::zAttr, m_z)
55 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, PointsAtX, pointsAtX, SVGNames::pointsAtXAttr, m_pointsAtX)
56 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, PointsAtY, pointsAtY, SVGNames::pointsAtYAttr, m_pointsAtY)
57 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, PointsAtZ, pointsAtZ, SVGNames::pointsAtZAttr, m_pointsAtZ)
58 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, SpecularExponent, specularExponent, SVGNames::specularExponentAttr, m_specularExponent)
59 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, LimitingConeAngle, limitingConeAngle, SVGNames::limitingConeAngleAttr, m_limitingConeAngle)
60 
61 void SVGFELightElement::parseMappedAttribute(MappedAttribute *attr)
62 {
63  const String &value = attr->value();
64  if (attr->name() == SVGNames::azimuthAttr) {
65  setAzimuthBaseValue(value.toFloat());
66  } else if (attr->name() == SVGNames::elevationAttr) {
67  setElevationBaseValue(value.toFloat());
68  } else if (attr->name() == SVGNames::xAttr) {
69  setXBaseValue(value.toFloat());
70  } else if (attr->name() == SVGNames::yAttr) {
71  setYBaseValue(value.toFloat());
72  } else if (attr->name() == SVGNames::zAttr) {
73  setZBaseValue(value.toFloat());
74  } else if (attr->name() == SVGNames::pointsAtXAttr) {
75  setPointsAtXBaseValue(value.toFloat());
76  } else if (attr->name() == SVGNames::pointsAtYAttr) {
77  setPointsAtYBaseValue(value.toFloat());
78  } else if (attr->name() == SVGNames::pointsAtZAttr) {
79  setPointsAtZBaseValue(value.toFloat());
80  } else if (attr->name() == SVGNames::specularExponentAttr) {
81  setSpecularExponentBaseValue(value.toFloat());
82  } else if (attr->name() == SVGNames::limitingConeAngleAttr) {
83  setLimitingConeAngleBaseValue(value.toFloat());
84  } else {
85  SVGElement::parseMappedAttribute(attr);
86  }
87 }
88 
89 }
90 
91 #endif // ENABLE(SVG)
92 
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.