TinkeCell API 1.0.0
The TinkerCell C API is a collection of functions that allow C programs to directly interact with TinkerCell's visual interface. SWIG is used to extend this API to other languages, such as Python, Perl, R, etc. The functions provided in this API are coverted to Signals, which are much slower than function calls. But they can be used to communicate between threads, which is the main reason why they are used in TinkerCell.The API uses six main data structures:
item: just a reference to a TinkerCell object. Items are represented as integers in Python and Octave and as long ints in C.
string: a string of characters used. Represented as const char* in C.
tc_items array of items
tc_items A = tc_allItems() A.length tc_getItem(A,3) long x = tc_find("x") tc_setItem(A,3,x) tc_items A2 = tc_createItemsArray(10) //array of length 10
tc_strings: array of strings
tc_items A = tc_allItems() tc_strings S = tc_getNames( A ) S.length tc_getString(S,3) tc_setString(S,3,"hello") tc_strings S2 = tc_createStringsArray(10) //array of length 10
long x = tc_find("x") tc_matrix M = tc_getNumericalData( x, "Parameters" ) int r = M.rows int c = M.cols tc_getColumnName(M,2) tc_setColumnName(M,2,"col2") tc_getRowName(M,1) tc_setRowName(M,1,"row1") tc_getMatrixValue(M,2,3) tc_setMatrixValue(M,2,3,0.5) tc_matrix M2 = tc_createMatrix(5,4)