FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
RexportSpatial.h
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Qu�bec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifndef REXPORTSPATIAL_H_INCLUDED
9#define REXPORTSPATIAL_H_INCLUDED
10
11#include <Rcpp.h>
12#include "FMTCoordinate.h"
13#include "FMTForest.h"
14#include "FMTSpatialSchedule.h"
15//#include "FMTspatialaction.h"
16#include "FMTSaSchedule.h"
17#include "FMTGraph.hpp"
18#include "FMTLineGraph.h"
19//#include "FMTSaSolution.h"
20#include "Rdefinitions.h"
21#include "FMTEvent.h"
22#include "FMTDevelopment.h"
23
24//RCPP_EXPOSED_ENUM_NODECL(Spatial::FMTsamovetype);
25
28
32
36
39/*
40RCPP_EXPOSED_WRAP(Spatial::FMTspatialaction);
41RCPP_EXPOSED_AS(Spatial::FMTspatialaction);
42RCPP_DEFINEVECTOR(Spatial::FMTspatialaction);//For vector
43*/
47
48
49//RCPP_EXPOSED_WRAP(Spatial::FMTExponentialSchedule); / Comment Gab 2026-02-09
50// RCPP_EXPOSED_AS(Spatial::FMTExponentialSchedule); / Comment Gab 2026-02-09
51/*
52RCPP_EXPOSED_WRAP(Spatial::FMTSaSolution);
53RCPP_EXPOSED_AS(Spatial::FMTSaSolution);
54RCPP_DEFINEVECTOR(Spatial::FMTSaSolution);//For vector
55*/
58
59
60namespace R
61{
62
64 {
65
66
67 Rcpp::class_<Spatial::FMTCoordinate>("FMTcoordinate","@DocString(FMTCoordinate)")
68 .constructor("@DocString(FMTCoordinate())")
69 .constructor<unsigned int,unsigned int>("@DocString(FMTCoordinate(unsigned int,unsigned int))")
70 .method("lt",&Spatial::FMTCoordinate::operator <,
71 "@DocString(FMTCoordinate::operator<)")
72 .method("getx",&Spatial::FMTCoordinate::getX,
73 "@DocString(FMTCoordinate::getx)")
74 .method("gety",&Spatial::FMTCoordinate::getY,
75 "@DocString(FMTCoordinate::gety)");
76
77
78 define_FMTlayer<Core::FMTDevelopment>("FMTdevelopmentlayer");
79
80
81 Rcpp::class_<Spatial::FMTForest>("FMTforest", "@DocString(FMTForest)")
82 .derives<Spatial::FMTLayer<Core::FMTDevelopment>>("FMTdevelopmentlayer")
83 .constructor("@DocString(FMTForest())")
84 .constructor<Spatial::FMTForest>("@DocString(FMTForest(Spatial::FMTForest))")
85 .method("getarea",&Spatial::FMTForest::getArea,
86 "@DocString(FMTForest(Spatial::getarea))")
87 .method("grow",&Spatial::FMTForest::grow,
88 "@DocString(FMTForest(Spatial::grow))");
89
90
91 Rcpp::class_<Spatial::FMTSpatialSchedule>("FMTSpatialSchedule", "@DocString(FMTSpatialSchedule)")
92 .constructor("@DocString(FMTSpatialSchedule())");
93
94 /*
95 Rcpp::class_<Spatial::FMTspatialaction>("FMTspatialaction", "@DocString(FMTspatialaction)")
96 .constructor("@DocString(FMTspatialaction())")
97 .derives<Core::FMTAction> ("FMTaction")
98 .constructor<Core::FMTAction>("@DocString(FMTspatialaction(FMTAction))")
99 .field("neighbors",&Spatial::FMTspatialaction::neighbors,
100 "@DocString(FMTspatialaction(FMTspatialaction::neighbors))")
101 .field("green_up",&Spatial::FMTspatialaction::green_up,
102 "@DocString(FMTspatialaction(FMTspatialaction::green_up))")
103 .field("adjacency",&Spatial::FMTspatialaction::adjacency,
104 "@DocString(FMTspatialaction(FMTspatialaction::adjacency))")
105 .field("minimal_size",&Spatial::FMTspatialaction::minimal_size,
106 "@DocString(FMTspatialaction(FMTspatialaction::minimal_size))")
107 .field("maximal_size",&Spatial::FMTspatialaction::maximal_size,
108 "@DocString(FMTspatialaction(FMTspatialaction::maximal_size))")
109 .field("neighbors_size",&Spatial::FMTspatialaction::neighbors_size,
110 "@DocString(FMTspatialaction(FMTspatialaction::neighbors_size))")
111 .field("greenup_weight",&Spatial::FMTspatialaction::greenup_weight,
112 "@DocString(FMTspatialaction(FMTspatialaction::greenup_weight))")
113 .field("adjacency_weight",&Spatial::FMTspatialaction::adjacency_weight,
114 "@DocString(FMTspatialaction(FMTspatialaction::adjacency_weight))")
115 .field("size_weight",&Spatial::FMTspatialaction::size_weight);
116 */
117
118// comment Gab 2026-02-09
119// Rcpp::class_<Spatial::FMTExponentialSchedule>("FMTexponentialschedule", "@DocString(FMTExponentialSchedule)")
120// .constructor("@DocString(FMTExponentialSchedule())")
121// .constructor<double>("@DocString(FMTExponentialSchedule(double))");
122
123
124 define_FMTlayer<Graph::FMTLineGraph>("FMTgraphlayer");
125
126 /*
127 Rcpp::class_<Spatial::FMTSaSolution>("FMTsasolution", "@DocString(FMTSaSolution)")
128 .constructor("@DocString(FMTSaSolution())")
129 .derives<Spatial::FMTLayer<Graph::FMTLineGraph>>("FMTgraphlayer")
130 .method("get_stats",&Spatial::FMTSaSolution::getsolution_stats,
131 "@DocString(FMTSaSolution::getsolution_stats)")
132 .method("getobjfvalue",&Spatial::FMTSaSolution::getobjfvalue,
133 "@DocString(FMTSaSolution::getobjfvalue)")
134 .method("get_forest_at_period",&Spatial::FMTSaSolution::getForestPeriod,
135 "@DocString(FMTSaSolution::getForestPeriod)");
136 */
137 }
138}
139
140#endif // PYEXPORTSPATIAL_H_INCLUDED
RCPP_EXPOSED_AS(Spatial::FMTCoordinate)
RCPP_DEFINEVECTOR(Spatial::FMTForest)
RCPP_EXPOSED_WRAP(Spatial::FMTCoordinate)
RCPP_DEFINEMAP(Spatial::FMTCoordinate, Core::FMTDevelopment)
Base class of FMTActualDevelopment and FMTFuturDevelopment representing a forest stand.
Definition: FMTDevelopment.h:44
Simple graph where each action generates a single new vertex (0-—0-—0-—0), used with FMTLayer to simu...
Definition: FMTLineGraph.h:27
Spatially referenced coordinate holding an x and y position on a raster grid.
Definition: FMTCoordinate.h:29
uint16_t getY() const
Return the y position of the coordinate.
uint16_t getX() const
Return the x position of the coordinate.
Base class for a spatial event (FMTsaevent or FMTsesevent): a set of FMTCoordinate corresponding to t...
Definition: FMTEvent.h:28
Spatially referenced layer of Core::FMTDevelopment representing the forest.
Definition: FMTForest.h:33
std::vector< Core::FMTActualDevelopment > getArea() const
Return the actual developments of the forest, aggregating the area of identical developments by cell ...
FMTForest grow() const
Grow every development of the forest by one period.
Definition: FMTParser.h:54
Map containing a line graph for each cell, representing the stand, the action and the transition at e...
Definition: FMTSpatialSchedule.h:50
Definition: RexportCore.h:153
void exportSpatial()
Definition: RexportSpatial.h:63