Added closeFigure in C++ API.