cpvoids program to copy voids from one HGT dataset to another
[tecorrec.git] / geo / tcCustomSunDirection.cpp
blob70e2097eefab4802bd58bad747dd88d0cca9fa83
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 tcCustomSunDirection.cpp
22 * @brief Dataset with raytraced shadow classification using a custom sun direction.
25 #include "tcCustomSunDirection.h"
26 #include "tcSrtmModel.h"
27 #include "tcChannelManager.h"
28 #include "tcLambertianShading.h"
29 #include "tcRaytracedShadowMap.h"
31 #include <QObject>
34 * Constructors + destructor
37 /// Primary constructor.
38 tcCustomSunDirection::tcCustomSunDirection(tcSrtmModel* dem, const tcGeo& sunDirection, const tcGeo& sunReference)
39 : tcShadowClassifyingData()
41 setName(QObject::tr("Custom sun direction"));
42 //setTexToGeo(landsatDatasets[0]->texToGeo());
43 setSunDirection(sunDirection, sunReference);
46 tcGeoImageData* refImagery = landsatDatasets[0];
47 tcChannel* reference = refImagery->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);
53 double pixelRes = 30.0/6378.137e3;
54 tcRaytracedShadowMap* raytrace = new tcRaytracedShadowMap(tcGeo(pixelRes, pixelRes), dem, this);
55 channelManager()->addChannel(raytrace);
56 setShadowClassification(raytrace);
59 /// Destructor.
60 tcCustomSunDirection::~tcCustomSunDirection()