Abstracted tcLandsatData shading and shadow classification accessors into tcShadowCla...
[tecorrec.git] / geo / tcProcessingData.cpp
blob2b5e0203d29de1f7694dd3f7ec6e659e54f85706
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 "tcElevationDifference.h"
32 #include "tcElevationOptimization.h"
33 #include "tcPixelOp.h"
35 #include <QObject>
38 * Constructors + destructor
41 /// Primary constructor.
42 tcProcessingData::tcProcessingData(const QList<tcLandsatData*>& landsatDatasets, tcSrtmModel* dem)
43 : tcGeoImageData()
45 setName(QObject::tr("Processing channels"));
46 //setTexToGeo(landsatDatasets[0]->texToGeo());
48 tcGeoImageData* refImagery = landsatDatasets[0];
49 tcChannel* reference = refImagery->channelManager()->channel(0);
51 tcLambertianShading* upshading = new tcLambertianShading(reference, dem, this, maths::Vector<3,float>(0.0f, 0.0f, 1.0f));
52 channelManager()->addChannel(upshading);
54 tcElevation* elevation = new tcElevation(refImagery, reference, dem, this);
55 channelManager()->addChannel(elevation);
57 tcElevationDifference* elevationDifference = new tcElevationDifference(refImagery, reference, dem, this);
58 channelManager()->addChannel(elevationDifference);
60 tcElevationOptimization* elevationOpt = new tcElevationOptimization(landsatDatasets, dem, this);
61 channelManager()->addChannel(elevationOpt);
63 tcPixelOp* elevDiff = new tcPixelOp(tcPixelOp::Diff, QList<tcChannel*>() << elevationOpt << elevation);
64 channelManager()->addChannel(elevDiff);
67 /// Destructor.
68 tcProcessingData::~tcProcessingData()