-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTemporalChangeFeature.cpp
More file actions
64 lines (50 loc) · 1.84 KB
/
TemporalChangeFeature.cpp
File metadata and controls
64 lines (50 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* File: TemporalChangeFeature.cpp
* Author: zoizoi
*
* Created on 09 February 2011, 20:07
*/
#include "TemporalChangeFeature.h"
TemporalChangeFeature::TemporalChangeFeature(float weight, OVASControl* oc,string name) : Feature(weight, oc,name) {
intAreaData = ArrayTools::allocate2DArray<int>(oc->numSteps, oc->geoSphere->getNumVs());
for (int i = 0; i < oc->numSteps; i++) {
for (int j = 0; j < oc->geoSphere->getNumVs(); j++) {
intAreaData[i][j] = 0;
}
}
intScoreData=ArrayTools::allocate2DArray<int>(oc->numSteps,oc->geoSphere->getNumVs());
for(int i=0;i<oc->numSteps;i++){
for(int j=0;j<oc->geoSphere->getNumVs();j++){
intScoreData[i][j]=0;
}
}
colourB=1;
colourG=0;
colourR=0;
cout<<"new tc feature"<<endl;
}
TemporalChangeFeature::TemporalChangeFeature(const TemporalChangeFeature& orig) {
}
TemporalChangeFeature::~TemporalChangeFeature() {
}
void TemporalChangeFeature::scoreFeature(GeoPoint* view) {
// if(oc->AreaDone[oc->currentStep]==false){
// Feature::scoreFeature(view);
// }
float viewRange = 3;
camera->SetPosition(viewRange * view->getx(), viewRange * view->gety(), viewRange * view->getz());
renderWindow->Render();
int result,dArea;
if (oc->currentStep == 0) {
result=0;
} else {
//#TD does not recycle area calc #inefficiency
int area=countColour(framebuffer);
intAreaData[oc->currentStep][oc->currentView]=area;
int prevArea=intAreaData[oc->currentStep-1][oc->currentView];
dArea = area-prevArea;
result = abs(dArea);
//cout<<" elevated "<<dArea<<" from "<< oc->currentStep <<" " << oc->currentView <<" "<<area<< " "<<prevArea<<endl;
}
scoreData[oc->currentStep][oc->currentView]=result;
}