1 /***************************************************************************
2 * This file is part of Tecorrec. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
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. *
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. *
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 ***************************************************************************/
21 * @file tcProcessingData.cpp
22 * @brief Processing data channels.
25 #include "tcProcessingData.h"
26 #include "tcShadowClassifyingData.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 "tcNormals.h"
34 #include "tcPixelOp.h"
39 * Constructors + destructor
42 /// Primary constructor.
43 tcProcessingData::tcProcessingData(const QList
<tcShadowClassifyingData
*>& datasets
, tcSrtmModel
* dem
)
46 setName(QObject::tr("Processing channels"));
47 //setTexToGeo(datasets[0]->texToGeo());
49 tcGeoImageData
* refImagery
= datasets
[0];
50 tcChannel
* reference
= refImagery
->channelManager()->channel(0);
52 tcLambertianShading
* upshading
= new tcLambertianShading(reference
, dem
, this, maths::Vector
<3,float>(0.0f
, 0.0f
, 1.0f
));
53 channelManager()->addChannel(upshading
);
55 tcElevation
* elevation1
= new tcElevation(refImagery
, reference
, dem
, this);
56 channelManager()->addChannel(elevation1
);
58 tcElevation
* elevation2
= new tcElevation(refImagery
, reference
, dem
+1, this);
59 channelManager()->addChannel(elevation2
);
61 tcNormals
* normals
= new tcNormals(refImagery
, reference
, dem
, this);
62 channelManager()->addChannel(normals
);
64 tcElevationDifference
* elevationDifference
= new tcElevationDifference(refImagery
, reference
, dem
, this);
65 channelManager()->addChannel(elevationDifference
);
67 tcElevationOptimization
* elevationOpt
= new tcElevationOptimization(datasets
, dem
, this);
68 channelManager()->addChannel(elevationOpt
);
70 tcPixelOp
* elevDiff
= new tcPixelOp(tcPixelOp::Diff
, QList
<tcChannel
*>() << elevationOpt
<< elevation2
);
71 channelManager()->addChannel(elevDiff
);
75 tcProcessingData::~tcProcessingData()