FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
RexportSpatial.hpp
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.hpp"
13#include "FMTforest.hpp"
15//#include "FMTspatialaction.hpp"
16#include "FMTsaschedule.hpp"
17#include "FMTgraph.hpp"
18#include "FMTlinegraph.hpp"
19//#include "FMTsasolution.hpp"
20#include "Rdefinitions.hpp"
21#include "FMTevent.hpp"
22#include "FMTdevelopment.hpp"
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
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
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_DEFINEMAP(Spatial::FMTcoordinate, Core::FMTdevelopment)
RCPP_EXPOSED_WRAP(Spatial::FMTcoordinate)
RCPP_DEFINEVECTOR(Spatial::FMTforest)
RCPP_EXPOSED_AS(Spatial::FMTcoordinate)
Definition: FMTdevelopment.hpp:44
Definition: FMTlinegraph.hpp:30
Definition: FMTcoordinate.hpp:25
unsigned int getx() const
unsigned int gety() const
Definition: FMTevent.hpp:28
Definition: FMTexponentialschedule.hpp:20
Definition: FMTforest.hpp:27
std::vector< Core::FMTactualdevelopment > getarea() const
FMTforest grow() const
Definition: FMTlayer.hpp:29
Definition: FMTspatialschedule.hpp:44
Definition: RexportCore.hpp:153
void exportSpatial()
Definition: RexportSpatial.hpp:63