2
* Copyright (C) 2009 Timothy Reaves
3
* Copyright (C) 2013 Pawel Stolowski
4
* Copyright (C) 2013 Alexander Wolf
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program 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
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
28
Lens::Lens(const QObject& other)
30
this->m_multipler = other.property("multipler").toDouble();
31
this->m_name = other.property("name").toString();
38
static QMap<int, QString> mapping;
39
QMap<int, QString> Lens::propertyMap()
41
if(mapping.isEmpty()) {
42
mapping = QMap<int, QString>();
44
mapping[1] = "multipler";
49
const QString Lens::name() const
54
void Lens::setName(const QString& theValue)
59
double Lens::multipler() const
64
void Lens::setMultipler(double theValue)
66
m_multipler = theValue;
69
/* ********************************************************************* */
72
#pragma mark Static Methods
74
/* ********************************************************************* */
76
Lens* Lens:: lensFromSettings(QSettings* theSettings, int lensIndex)
78
Lens* lens = new Lens();
79
QString prefix = "lens/" + QVariant(lensIndex).toString() + "/";
81
lens->setName(theSettings->value(prefix + "name", "").toString());
82
lens->setMultipler(theSettings->value(prefix + "multipler", "1").toDouble());
87
Lens* Lens::lensModel()
89
Lens* model = new Lens();
90
model->setName("My Lens");
91
model->setMultipler(2.0f);