TinkeCell API
1.0.0
C/Python/Octave/Ruby API
|
00001 #ifndef TINKERCELL_TC_MAIN_API_H 00002 #define TINKERCELL_TC_MAIN_API_H 00003 00004 #include "TC_structs.h" 00005 BEGIN_C_DECLS 00006 00012 TCAPIEXPORT tc_items tc_allItems(); 00013 00019 TCAPIEXPORT tc_items tc_selectedItems(); 00020 00027 TCAPIEXPORT tc_items tc_itemsOfFamily(const char* family); 00028 00036 TCAPIEXPORT tc_items tc_itemsOfFamilyFrom(const char* family, tc_items itemsToSelectFrom); 00037 00044 TCAPIEXPORT long tc_find(const char* name); 00045 00052 TCAPIEXPORT tc_items tc_findItems(tc_strings names); 00053 00060 TCAPIEXPORT tc_items tc_findItemsUsingRegexp(const char* names); 00061 00067 TCAPIEXPORT void tc_select(long item); 00068 00073 TCAPIEXPORT void tc_deselect(); 00074 00081 TCAPIEXPORT const char* tc_getName(long item); 00082 00089 TCAPIEXPORT const char* tc_getUniqueName(long item); 00090 00097 TCAPIEXPORT void tc_rename(long item,const char* name); 00098 00105 TCAPIEXPORT tc_strings tc_getNames(tc_items items); 00106 00113 TCAPIEXPORT tc_strings tc_getUniqueNames(tc_items items); 00114 00121 TCAPIEXPORT const char* tc_getFamily(long item); 00122 00130 TCAPIEXPORT int tc_isA(long item,const char* family); 00131 00137 TCAPIEXPORT void tc_print(const char* text); 00138 00144 TCAPIEXPORT void tc_openUrl(const char* url); 00145 00151 TCAPIEXPORT void tc_errorReport(const char* text); 00152 00158 TCAPIEXPORT void tc_printMatrix(tc_matrix data); 00159 00165 TCAPIEXPORT void tc_printFile(const char* filename); 00166 00171 TCAPIEXPORT void tc_clear(); 00172 00178 TCAPIEXPORT void tc_remove(long item); 00179 00189 TCAPIEXPORT long tc_insert(const char* name, const char* family); 00190 00198 TCAPIEXPORT long tc_insertConnection(tc_items parts, const char* name, const char* family); 00199 00206 TCAPIEXPORT tc_items tc_getConnectedNodes(long connection); 00207 00214 TCAPIEXPORT tc_items tc_getConnections(long part); 00215 00222 TCAPIEXPORT double tc_getY(long item); 00223 00230 TCAPIEXPORT double tc_getX(long item); 00231 00238 TCAPIEXPORT tc_matrix tc_getPos(tc_items items); 00239 00247 TCAPIEXPORT void tc_setPos(long item,double x,double y); 00248 00255 TCAPIEXPORT void tc_setPosMulti(tc_items items, tc_matrix positions); 00256 00263 TCAPIEXPORT void tc_moveSelected(double dx,double dy); 00264 00270 TCAPIEXPORT int tc_isWindows(); 00271 00277 TCAPIEXPORT int tc_isMac(); 00278 00284 TCAPIEXPORT int tc_isLinux(); 00285 00291 TCAPIEXPORT const char* tc_appDir(); 00292 00298 TCAPIEXPORT const char* tc_homeDir(); 00299 00307 TCAPIEXPORT void tc_createInputWindowForScript(tc_matrix input, const char* title, const char* functionname); 00308 00316 TCAPIEXPORT void tc_createInputWindow(tc_matrix input, const char* title, void (*f)(tc_matrix)); 00317 00326 TCAPIEXPORT void tc_addInputWindowOptions(const char* title, int i, int j, tc_strings options); 00327 00334 TCAPIEXPORT void tc_addInputWindowCheckbox(const char* title, int i, int j); 00335 00341 TCAPIEXPORT void tc_openNewWindow(const char* title); 00348 TCAPIEXPORT tc_items tc_getChildren(long o); 00349 00356 TCAPIEXPORT long tc_getParent(long o); 00357 00365 TCAPIEXPORT tc_matrix tc_getNumericalData(long item,const char* data); 00366 00374 TCAPIEXPORT void tc_setNumericalData(long o,const char* title,tc_matrix data); 00375 00381 TCAPIEXPORT void tc_setNumericalValues(tc_matrix data); 00382 00389 TCAPIEXPORT void tc_setNumericalValue(const char * name, double value); 00390 00398 TCAPIEXPORT tc_table tc_getTextData(long item,const char* data); 00399 00407 TCAPIEXPORT void tc_setTextData(long o,const char* title,tc_table data); 00408 00414 TCAPIEXPORT void tc_setTextValues(tc_table data); 00415 00421 TCAPIEXPORT double tc_getNumericalValue(const char* name); 00422 00429 TCAPIEXPORT tc_matrix tc_getNumericalValueUsingRegexp(const char* regex); 00430 00436 TCAPIEXPORT const char* tc_getTextValue(const char* name); 00437 00444 TCAPIEXPORT tc_table tc_getTextValueUsingRegexp(const char* regex); 00445 00452 TCAPIEXPORT void tc_setTextValue(const char * name, const char * value); 00453 00460 TCAPIEXPORT tc_strings tc_getNumericalDataNames(long o); 00461 00468 TCAPIEXPORT tc_strings tc_getTextDataNames(long o); 00469 00475 TCAPIEXPORT void tc_zoom(double factor); 00476 00482 TCAPIEXPORT void tc_viewWindow(const char * name); 00483 00488 TCAPIEXPORT const char* tc_getStringDialog(const char* title); 00494 TCAPIEXPORT const char* tc_getFilename(); 00495 00504 TCAPIEXPORT int tc_getStringFromList(const char* title, tc_strings list,const char* selectedString); 00511 TCAPIEXPORT double tc_getNumber(const char* title); 00512 00519 TCAPIEXPORT tc_matrix tc_getNumbers(tc_strings labels); 00520 00526 TCAPIEXPORT int tc_askQuestion(const char* message); 00527 00533 TCAPIEXPORT void tc_messageDialog(const char* message); 00534 00540 TCAPIEXPORT void tc_openFile(const char* file); 00541 00547 TCAPIEXPORT void tc_saveToFile(const char* file); 00548 00554 TCAPIEXPORT long tc_thisThread(); 00555 00562 TCAPIEXPORT void tc_createSliders(tc_matrix input, void (*f)(tc_matrix)); 00563 00570 TCAPIEXPORT const char* tc_getColor(long item); 00571 00579 TCAPIEXPORT void tc_setColor(long item,const char* name, int permanent); 00580 00587 TCAPIEXPORT void tc_changeNodeImage(long item,const char* filename); 00588 00595 TCAPIEXPORT void tc_changeArrowHead(long connection,const char* filename); 00596 00604 TCAPIEXPORT void tc_setSize(long item,double width,double height); 00605 00612 TCAPIEXPORT double tc_getWidth(long item); 00613 00620 TCAPIEXPORT double tc_getHeight(long item); 00621 00628 TCAPIEXPORT void tc_rotate(long item, double t); 00629 00637 TCAPIEXPORT void tc_screenshot(const char * filename, int width, int height); 00638 00644 TCAPIEXPORT int tc_screenWidth(); 00645 00651 TCAPIEXPORT int tc_screenHeight(); 00652 00658 TCAPIEXPORT int tc_screenX(); 00659 00665 TCAPIEXPORT int tc_screenY(); 00671 TCAPIEXPORT const char * tc_annotations(); 00679 TCAPIEXPORT void tc_insertAnnotations(const char *, double, double); 00688 TCAPIEXPORT double tc_getControlPointX(long connection,long part,int whichPoint); 00697 TCAPIEXPORT double tc_getControlPointY(long connection,long part,int whichPoint); 00707 TCAPIEXPORT void tc_setControlPoint(long connection,long part,int whichPoint, double x,double y); 00715 TCAPIEXPORT void tc_setCenterPoint(long connection,double y,double x); 00722 TCAPIEXPORT double tc_getCenterPointX(long connection); 00729 TCAPIEXPORT double tc_getCenterPointY(long connection); 00736 TCAPIEXPORT void tc_setStraight(long item,int straight); 00742 TCAPIEXPORT void tc_setAllStraight(int straight); 00750 TCAPIEXPORT void tc_setLineWidth(long item,double width, int permanent); 00755 TCAPIEXPORT void tc_Main_api_initialize( 00756 tc_items (*tc_allItems0)(), 00757 tc_items (*tc_selectedItems0)(), 00758 tc_items (*tc_itemsOfFamily0)(const char*), 00759 tc_items (*tc_itemsOfFamily1)(const char*, tc_items), 00760 long (*tc_find0)(const char*), 00761 tc_items (*tc_findItems0)(tc_strings), 00762 tc_items (*tc_findItemsUsingRegexp0)(const char*), 00763 void (*tc_select0)(long), 00764 void (*tc_deselect0)(), 00765 const char* (*tc_getName0)(long), 00766 const char* (*tc_getUniqueName0)(long), 00767 00768 void (*tc_setName0)(long item,const char* name), 00769 tc_strings (*tc_getNames0)(tc_items), 00770 tc_strings (*tc_getUniqueNames0)(tc_items), 00771 const char* (*tc_getFamily0)(long), 00772 int (*tc_isA0)(long,const char*), 00773 00774 void (*tc_clearText)(), 00775 void (*tc_outputText0)(const char*), 00776 void (*tc_errorReport0)(const char*), 00777 void (*tc_outputTable0)(tc_matrix), 00778 void (*tc_printFile0)(const char*), 00779 00780 void (*tc_removeItem0)(long), 00781 long (*insertItem)(const char* , const char* ), 00782 long (*insertConnection)(tc_items, const char*, const char*), 00783 tc_items (*getConnectedParts)(long), 00784 tc_items (*getConnections)(long), 00785 00786 double (*tc_getY0)(long), 00787 double (*tc_getX0)(long), 00788 tc_matrix (*tc_getPos0)(tc_items), 00789 void (*tc_setPos0)(long,double,double), 00790 void (*tc_setPos1)(tc_items,tc_matrix), 00791 void (*tc_moveSelected0)(double,double), 00792 00793 int (*tc_isWindows0)(), 00794 int (*tc_isMac0)(), 00795 int (*tc_isLinux0)(), 00796 const char* (*tc_appDir0)(), 00797 const char* (*tc_homeDir0)(), 00798 00799 void (*tc_createInputWindow0)(tc_matrix , const char* , const char* ), 00800 void (*tc_createInputWindow1)(long, tc_matrix, const char*, void (*f)(tc_matrix)), 00801 void (*createSliders)(long, tc_matrix, void (*f)(tc_matrix)), 00802 00803 void (*tc_addInputWindowOptions0)(const char*, int i, int j, tc_strings), 00804 void (*tc_addInputWindowCheckbox0)(const char*, int i, int j), 00805 void (*tc_openNewWindow0)(const char* title), 00806 00807 tc_items (*tc_getChildren0)(long), 00808 long (*tc_getParent0)(long), 00809 00810 tc_matrix (*tc_getNumericalData0)(long,const char*), 00811 void (*tc_setNumericalData0)(long,const char*,tc_matrix), 00812 tc_table (*tc_getTextData0)(long,const char*), 00813 void (*tc_setTextData0)(long,const char*, tc_table), 00814 00815 tc_strings (*tc_getNumericalDataNames0)(long), 00816 tc_strings (*tc_getTextDataNames0)(long), 00817 00818 void (*tc_zoom0)(double factor), 00819 void (*tc_viewWindow0)(const char*), 00820 00821 const char* (*tc_getStringDialog0)(const char*), 00822 int (*getSelectedString)(const char*, tc_strings, const char*), 00823 double (*getNumber)(const char*), 00824 tc_matrix (*getNumbers)( tc_strings), 00825 const char* (*getFilename)(), 00826 00827 int (*askQuestion)(const char*), 00828 void (*messageDialog)(const char*), 00829 void (*openFile)(const char*), 00830 void (*saveToFile)(const char*), 00831 00832 void (*setSize0)(long,double,double,int), 00833 double (*getWidth0)(long), 00834 double (*getHeight0)(long), 00835 void (*setAngle0)(long,double,int), 00836 const char* (*getColor)(long), 00837 void (*setColor0)(long,const char*,int), 00838 00839 void (*changeGraphics0)(long,const char*), 00840 void (*changeArrowHead0)(long,const char*), 00841 00842 void (*screenshot)(const char*, int, int), 00843 int (*screenHeight)(), 00844 int (*screenWidth)(), 00845 int (*screenX)(), 00846 int (*screenY)(), 00847 00848 const char * (*annotations)(), 00849 void (*insertAnnotations)(const char *, double, double), 00850 00851 void (*setNumericalValues)(tc_matrix), 00852 void (*setNumericalValue)(const char *, double), 00853 void (*setTextValues)(tc_table), 00854 void (*setTextValue)(const char *, const char *), 00855 00856 double (*getNumericalValue)(const char*), 00857 const char* (*getTextValue)(const char*), 00858 00859 tc_matrix (*getNumericalValueUsingRegexp)(const char*), 00860 tc_table (*getTextValueUsingRegexp)(const char*), 00861 00862 void (*openUrl)(), 00863 00864 double (*getControlPointX)(long,long,int), 00865 double (*getControlPointY)(long,long,int), 00866 void (*setControlPoint)(long,long,int,double,double), 00867 void (*setCenterPoint)(long,double,double), 00868 double (*getCenterPointX)(long), 00869 double (*getCenterPointY)(long), 00870 void (*setStraight)(long,int), 00871 void (*setAllStraight)(int), 00872 void (*setLineWidth)(long,double,int) 00873 ); 00874 00881 TCAPIEXPORT void tc_showProgress(const char * title, int progress); 00887 TCAPIEXPORT void tc_callback(void (*f)(void)); 00893 TCAPIEXPORT void tc_callWhenExiting(void (*f)(void)); 00898 TCAPIEXPORT void tc_CThread_api_initialize( 00899 long cthread, 00900 void (*callback)(long, void (*f)(void)), 00901 void (*callWhenExiting)(long, void (*f)(void)), 00902 void (*showProgress)(long, const char*, int)); 00903 00910 TCAPIEXPORT void tc_displayText(long item,const char* text); 00917 TCAPIEXPORT void tc_displayNumber(long item,double number); 00924 TCAPIEXPORT void tc_setDisplayLabelColor(const char* color1, const char* color2); 00931 TCAPIEXPORT void tc_highlight(long item,const char* color); 00938 TCAPIEXPORT void tc_burn(long item,double intensity); 00945 TCAPIEXPORT void tc_setAlpha(long item,double alpha); 00950 TCAPIEXPORT void tc_LabelingTool_api( 00951 void (*displayText)(long item,const char*), 00952 void (*displayNumber)(long item,double), 00953 void (*setDisplayLabelColor)(const char* color1,const char* color2), 00954 void (*highlight)(long,const char* color), 00955 void (*burn)(long,double), 00956 void (*setalpha)(long,double) 00957 ); 00958 00959 END_C_DECLS 00960 #endif 00961