46 vector <double> inBounds(nInBounds,0.);
57 vector<ModelRegion*> toReturn;
86 vector<ModelRegion*> toReturn;
88 for (uint i=0;i<allRegions.size();i++){
90 toReturn.push_back(allRegions[i]);
112 vector<double> toReturn;
116 vector < vector <double> >
119 vector < vector <double> > toReturn;
130 for(uint j=0;j<fTypes.size();j++){
131 if (fTypes[j] == fType_h){
136 for(uint u=0;u<dClasses.size();u++){
137 if (dClasses[u] == dClass_h){
145 return getArea(ft_pos, dc_pos);
152 for(uint j=0;j<fTypes.size();j++){
153 if (fTypes[j] == fType_h){
164 double totalarea = 0.0;
165 for(uint i=0;i<
myPixels.size(); i++){
166 totalarea +=
myPixels[i]->area.at(ft_pos).at(dc_pos);
173 double totalarea = 0.0;
174 for(uint i=0;i<
myPixels.size(); i++){
183 double totalarea = 0.0;
184 for(uint i=0;i<
myPixels.size(); i++){
194 for(uint i=0;i<nPx; i++){
195 sumvalue +=
myPixels[i]->getDoubleValue(layerName,
true);
199 }
else if (op ==
OP_AVG) {
202 string thisf = __PRETTY_FUNCTION__;
217 for(uint i=0;i<xyNPixels;i++){
231 for(uint i=0;i<
myPixels.size();i++) {
void setMyPixels()
It sets a double link pixels <–> region.
int parRegId
Id of the parent region;.
void setMyRegion(ModelRegion *region_h)
int regLevel
The level of the region. 1: country, 2: regions.
ThreadManager * MTHREAD
Pointer to the Thread manager.
double getValue(string layerName, int op=OP_SUM)
return the values of its own pixels for the specified layer. Possible operations: OP_SUM or OP_AVG ...
ModelData * MD
the model data object
void msgOut(const int &msgCode_h, const string &msg_h, const bool &refreshGUI_h=true) const
Overloaded function to print the output log.
double getXyNPixels() const
Return the number of pixels on Y.
Gis * GIS
GIS information and methods.
Thread manager. Responsable to manage the main thread and "speak" with the GUI.
vector< string > getStringVectorSetting(const string &name_h, int reg=WORLD) const
vector< ModelRegion * > chRegions
Vector of level-1 children regions.
vector< double > inResByAnyCombination
Vector of inventory resource for each possible combination of primary products. This store both alive...
Print an error message and stop the model.
double getDoubleValue(const string &layerName_h, const bool &returnZeroForNoValue=false) const
Return the value for a specific layer.
int vSum(const vector< int > &vector_h) const
bool isResidual
A flag if this region should be explicitelly modelled or it is just a residual.
int regId
Regional unique ID.
int getNChildren(bool excludeResidual=true)
vector< string > getForTypeIds(bool all=false)
By default it doesn't return forTypes used only as input.
vector< ModelRegion * > getSiblings(bool excludeResidual=true)
Return a vector of pointers to the siblings regions.
Pixel * getPixel(int x_h, int y_h)
vector< Pixel * > myPixels
Vector of pixels for this region.
bool getIsResidual() const
vector< ModelRegion * > getChildren(bool excludeResidual=true)
Returns a pointer to the parent regions.
Perform an AVERAGE operation.
vector< Pixel * > getMyPixels()
ModelRegion(ThreadManager *MTHREAD_h, int regId_h, string regSName_h, string regLName_h, int regLevel_h, int parRegId_h, bool isResidual_h)
Constructor.
string regLName
Region long name;.
void swap(const int &swap_what)
vector< ModelRegion * > getAllRegions(bool excludeResidual=true)
string regSName
A short name of the region.
double getArea()
Get whole forest area (from pixel->area matrix)