<div dir="ltr">Gabor,<div><br></div><div>The issue is that we don't know how to translate C++ enums into R (since R has no enum construct). Since R typically uses a character vector for enumerated values, another way to approach this would be use a std::string and then just convert it to enum within the C++ implementation.</div>
<div><br></div><div>J.J.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 28, 2014 at 11:32 PM, Gábor Csárdi <span dir="ltr"><<a href="mailto:csardi.gabor@gmail.com" target="_blank">csardi.gabor@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All, <div><br></div><div>it seems that this is currently not supported. </div><div><br></div><div>For this:</div>
<div><br></div><div><div>// [[Rcpp::export("L_tree")]]</div><div>NumericMatrix rogdf_tree_layout(GraphAttributes graph,</div>
<div><span style="white-space:pre-wrap">  </span> double siblingDistance=20, double subtreeDistance=20,</div><div><span style="white-space:pre-wrap">   </span> double levelDistance=50, double treeDistance=50,</div><div>
<span style="white-space:pre-wrap">     </span> bool orthogonalLayout=false,</div><div><span style="white-space:pre-wrap">    </span> Orientation orientation=topToBottom,</div><div><span style="white-space:pre-wrap">    </span> TreeLayout::RootSelectionType selectRoot=TreeLayout::rootIsSource) {</div>

</div><div>...</div><div><br></div><div>where the last two arguments are enums, I get:</div><div><br></div><div><div>Warning messages:</div><div>1: Unable to parse C++ default value 'topToBottom' for argument orientation of function rogdf_tree_layout </div>

</div><div><div>2: Unable to parse C++ default value 'TreeLayout::rootIsSource' for argument selectRoot of function rogdf_tree_layout </div></div><div><br></div><div>and there are no default values in the generated R code.</div>

<div><br></div><div>Is there a workaround? Any chance of adding support for it? How hard do you think it is to support it?</div><div><br></div><div>Thanks, Best,</div><div>Gabor</div><div><br></div></div>
<br>_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br></blockquote></div><br></div>