Displaying 1 result from an estimated 1 matches for "vtkobject".
Did you mean:
gtkobject
2005 Apr 18
3
A 'true' R-wrapper for C++ classes
...es = R_MakeExternalPtr(ptr, R_NilValue, R_NilValue));
UNPROTECT(1);
return res;
}
extern "C" SEXP R_foo_fun(SEXP obj)
{
foo *ptr= (foo *) R_ExternalPtrAddr(obj);
ptr->fun();
return R_NilValue;
}
---------------------
R-wrapper:
defineClass(className = "foo");
vtkObject$defineFields(ptr = "externalptr");
vtkObject$defineMethod(
"initialize",
function(){
ptr <- .Call("R_foo_init")
}
);
vtkObject$defineMethod(
"fun",
function()
{
.Call("R_foo_fun", ptr);
}
);
--------------------
(3...