Updated to optimize elevation of multiple landsat datasets at the same time
[tecorrec.git] / geo / tcProcessingData.cpp
blob1d485f2776d25aa736d47cefb20ea177ce6f3447
1 /***************************************************************************
2 * This file is part of Tecorrec. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * Tecorrec is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * Tecorrec is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with Tecorrec. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 /**
21 * @file tcProcessingData.cpp
22 * @brief Processing data channels.
25 #include "tcProcessingData.h"
26 #include "tcLandsatData.h"
27 #include "tcSrtmModel.h"
28 #include "tcChannelManager.h"
29 #include "tcLambertianShading.h"
30 #include "tcElevation.h"
31 #include "tcElevationOptimization.h"
32 #include "tcPixelOp.h"
34 #include <QObject>
37 * Constructors + destructor
40 /// Primary constructor.
41 tcProcessingData::tcProcessingData(const QList<tcLandsatData*>& landsatDatasets, tcSrtmModel* dem)
42 : tcGeoImageData()
44 setName(QObject::tr("Processing channels"));
45 //setTexToGeo(landsatDatasets[0]->texToGeo());
47 tcChannel* reference = landsatDatasets[0]->channelManager()->channel(0);
49 tcLambertianShading* upshading = new tcLambertianShading(reference, dem, this, maths::Vector<3,float>(0.0f, 0.0f, 1.0f));
50 channelManager()->addChannel(upshading);
52 tcElevation* elevation = new tcElevation(reference, dem, this);
53 channelManager()->addChannel(elevation);
55 tcElevationOptimization* elevationOpt = new tcElevationOptimization(landsatDatasets, dem, this);
56 channelManager()->addChannel(elevationOpt);
58 tcPixelOp* elevDiff = new tcPixelOp(tcPixelOp::Diff, QList<tcChannel*>() << elevationOpt << elevation);
59 channelManager()->addChannel(elevDiff);
62 /// Destructor.
63 tcProcessingData::~tcProcessingData()