00001 #ifndef __ayam_h__
00002 #define __ayam_h__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <limits.h>
00020 #include <float.h>
00021 #include <math.h>
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <string.h>
00025 #include <errno.h>
00026
00027 #ifdef WIN32
00028 #define WIN32_LEAN_AND_MEAN
00029 #include <windows.h>
00030 #undef WIN32_LEAN_AND_MEAN
00031 #endif
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 #ifdef AYWITHAQUA
00038 #include <OpenGL/glu.h>
00039 #else
00040 #include <GL/glu.h>
00041 #endif
00042
00043
00044
00045
00046 #include <togl.h>
00047
00048
00049
00050
00051
00052
00053 #ifdef AYUSEAFFINE
00054 #include <ributil.h>
00055 #endif
00056
00057 #ifdef AYUSEBMRTRIBOUT
00058 #include <ri.h>
00059 #endif
00060
00061 #ifdef AYUSEAQSISRIB
00062 #include <ri.h>
00063 #endif
00064
00065 #ifdef AYUSESLARGS
00066 #include <sl.h>
00067 #endif
00068
00069 #ifdef AYUSESLCARGS
00070 #include <slc.h>
00071 #endif
00072
00073 #ifdef AYUSESLOARGS
00074 #include <slo.h>
00075 #endif
00076
00077 #ifdef AYUSESOARGS
00078 #include <so.h>
00079 #endif
00080
00081 #ifdef AYUSESLXARGS
00082 #include <slx.h>
00083 #endif
00084
00085 #define AYGLUCBTYPE
00086
00087 #ifdef WIN32
00088 #undef AYGLUCBTYPE
00089 #define AYGLUCBTYPE (GLUnurbsErrorProc)
00090 #ifdef AYMESASGIGLU
00091 #undef AYGLUCBTYPE
00092 #define AYGLUCBTYPE (_GLUfuncptr)
00093 #endif
00094 #endif
00095
00096
00097
00098
00100 typedef struct ay_point_s
00101 {
00102 struct ay_point_s *next;
00103 char homogenous;
00104 char readonly;
00105 double *point;
00106 unsigned int index;
00107 } ay_point;
00108
00109
00111 typedef struct ay_mpoint_s
00112 {
00113 struct ay_mpoint_s *next;
00114 int multiplicity;
00115 double **points;
00116 unsigned int *indices;
00117 } ay_mpoint;
00118
00119
00121 typedef struct ay_pointedit_s
00122 {
00123 unsigned int num;
00124 double **coords;
00125 unsigned int *indices;
00126 char homogenous;
00127 char readonly;
00128 } ay_pointedit;
00129
00130
00132 typedef struct ay_tag_s
00133 {
00134 struct ay_tag_s *next;
00135 char is_temp;
00136 char is_binary;
00137 char *name;
00138 char *type;
00139 void *val;
00140 } ay_tag;
00141
00142
00144 typedef struct ay_btval_s
00145 {
00146 size_t size;
00147 void *payload;
00148 } ay_btval;
00149
00151 typedef struct ay_trafo_s
00152 {
00154
00155 double movx, movy, movz;
00158
00159 double rotx, roty, rotz;
00162
00163 double scalx, scaly, scalz;
00165 double quat[4];
00166 } ay_trafo;
00167
00168
00170 typedef struct ay_object_s {
00171 struct ay_object_s *next;
00172 struct ay_object_s *down;
00175 unsigned int type;
00176
00178 char *name;
00179
00181 unsigned int glname;
00182
00184 unsigned int refcount;
00185
00187 int selected;
00188
00190 int modified;
00191
00193 int parent;
00194
00196 int inherit_trafos;
00197
00198
00200 int hide;
00202 int hide_children;
00203
00206 double movx, movy, movz;
00211 double rotx, roty, rotz;
00216 double scalx, scaly, scalz;
00219 double quat[4];
00221 #if 0
00222 ay_trafo *trafo;
00223 #endif
00224 ay_point *selp;
00226 ay_tag *tags;
00228 struct ay_mat_object_s *mat;
00230 void *refine;
00231 } ay_object;
00232
00233
00235 typedef struct ay_list_object_s
00236 {
00237 struct ay_list_object_s *next;
00238 ay_object *object;
00239 } ay_list_object;
00240
00241
00242
00243
00245 typedef struct ay_shader_arg_s
00246 {
00247 struct ay_shader_arg_s *next;
00248 char *name;
00249 int type;
00251 union {
00252 float color[3];
00253 float point[4];
00254 float matrix[16];
00255 float scalar;
00256 char *string;
00257 } val;
00258 } ay_shader_arg;
00259
00260
00262 typedef struct ay_shader_s
00263 {
00264 struct ay_shader_s *next;
00265 int type;
00267 char *name;
00268 ay_shader_arg *arg;
00269 } ay_shader;
00270
00271
00273 typedef struct ay_mat_object_s {
00274
00275 int registered;
00277 char **nameptr;
00278 unsigned int *refcountptr;
00279 ay_object *objptr;
00281
00282
00285 int colr, colg, colb;
00290 int opr, opg, opb;
00293
00294 int matte;
00296
00297 double shading_rate;
00298 int shading_interpolation;
00300
00301 double dbound_val;
00302 int dbound;
00304
00305 int sides;
00307
00309 ay_shader *sshader;
00311 ay_shader *dshader;
00313 ay_shader *ishader;
00315 ay_shader *eshader;
00316
00317
00318
00321 int avr, avg, avb, ava;
00325 int emr, emg, emb, ema;
00329 int spr, spg, spb, spa;
00331
00332 double patch_size;
00333 double elem_size;
00334 double min_size;
00335
00336 int zonal;
00338
00339 int has_caustics;
00341
00342 int cast_shadows;
00344
00345 int true_displacement;
00347
00348 int camera;
00349 int reflection;
00350 int shadow;
00352 } ay_mat_object;
00353
00355 typedef struct ay_riopt_s
00356 {
00357 double Variance;
00358 double Samples_X;
00359 double Samples_Y;
00360 char FilterFunc;
00361 double FilterWidth;
00362 double FilterHeight;
00363 double ExpGain;
00364 double ExpGamma;
00365 double RGBA_ONE;
00366 double RGBA_MIN;
00367 double RGBA_MAX;
00368 double RGBA_Dither;
00370 int MinSamples;
00371 int MaxSamples;
00372 int MaxRayLevel;
00373 double ShadowBias;
00374 char PRManSpec;
00375 int RadSteps;
00376 int PatchSamples;
00378 char *textures;
00379 char *shaders;
00380 char *archives;
00381 char *procedurals;
00383 int texturemem;
00384 int geommem;
00386 int width;
00387 int height;
00389 int use_std_display;
00390 } ay_riopt;
00391
00392
00394 typedef struct ay_root_object_s
00395 {
00396 ay_riopt *riopt;
00397 ay_shader *imager;
00398 ay_shader *atmosphere;
00399 } ay_root_object;
00400
00401
00403 typedef struct ay_nurbcurve_object_s
00404 {
00405 int type;
00406 int length;
00407 int order;
00408 int knot_type;
00409 int is_rat;
00410 double *controlv;
00411 double *knotv;
00413 double glu_sampling_tolerance;
00414 int display_mode;
00416 GLUnurbsObj *no;
00418
00419 int tesslen;
00420 double *tessv;
00421 int tessqf;
00423
00424 int createmp;
00425 ay_mpoint *mpoints;
00426 } ay_nurbcurve_object;
00427
00428
00430 typedef struct ay_stess_uvp_s {
00431 struct ay_stess_uvp_s *next;
00432 int type;
00433 int dir;
00434
00435 double u, v;
00437 double C[6];
00438 } ay_stess_uvp;
00439
00440
00442 typedef struct ay_stess_s {
00443
00444 int tessw;
00445 int tessh;
00446 double *tessv;
00448
00449 int upslen;
00450 int vpslen;
00451 ay_stess_uvp **ups;
00452 ay_stess_uvp **vps;
00454 int ft_cw;
00455 int tcslen;
00456 double **tcs;
00457 int *tcslens;
00458 int *tcsdirs;
00460 double ud;
00461 double vd;
00462 } ay_stess;
00463
00464
00466 typedef struct ay_nurbpatch_object_s
00467 {
00468 int width;
00469 int height;
00470 int uorder;
00471 int vorder;
00472 int uknot_type;
00473 int vknot_type;
00474
00475 int is_rat;
00477 double *controlv;
00478 double *uknotv;
00479 double *vknotv;
00480
00481
00482 GLUnurbsObj *no;
00484 double glu_sampling_tolerance;
00485 int display_mode;
00487
00488 int tessqf;
00489 ay_stess *stess;
00491
00492 int createmp;
00493 ay_mpoint *mpoints;
00494 } ay_nurbpatch_object;
00495
00496
00498 typedef struct ay_pamesh_object_s {
00499 int width;
00500 int height;
00501 int close_u;
00502 int close_v;
00503 double *controlv;
00505 int type;
00506 int btype_u;
00507 int btype_v;
00508 int ustep;
00509 double *ubasis;
00510 int vstep;
00511 double *vbasis;
00514 ay_object *npatch;
00515
00516 double glu_sampling_tolerance;
00517 int display_mode;
00518 } ay_pamesh_object;
00519
00520
00522 typedef struct ay_pomesh_object_s {
00523 int type;
00525 unsigned int npolys;
00526 unsigned int *nloops;
00527 unsigned int *nverts;
00528 unsigned int *verts;
00530 unsigned int ncontrols;
00531 int has_normals;
00532 double *controlv;
00533 } ay_pomesh_object;
00534
00535
00537 typedef struct ay_sdmesh_object_s {
00538 int scheme;
00540 unsigned int nfaces;
00541 unsigned int *nverts;
00542 unsigned int *verts;
00543 unsigned int ntags;
00544 int *tags;
00545 unsigned int *nargs;
00546 int *intargs;
00547 double *floatargs;
00549 unsigned int ncontrols;
00550 double *controlv;
00551 } ay_sdmesh_object;
00552
00553
00555 typedef struct ay_gordon_object_s {
00556 int wcc;
00557 int uorder;
00558 int vorder;
00561 ay_object *caps_and_bevels;
00562
00564 ay_object *npatch;
00565
00566 double glu_sampling_tolerance;
00567 int display_mode;
00568 } ay_gordon_object;
00569
00570
00572 typedef struct ay_text_object_s
00573 {
00574 char *fontname;
00575 Tcl_UniChar *unistring;
00576 double height;
00577 int revert;
00578 int has_upper_cap;
00579 int has_lower_cap;
00582 ay_object *npatch;
00583
00584 double *pnts;
00585 unsigned int pntslen;
00587 double glu_sampling_tolerance;
00588 int display_mode;
00589 } ay_text_object;
00590
00591
00593 typedef struct ay_light_object_s
00594 {
00595 int type;
00596 int on;
00597 int local;
00598 RtLightHandle light_handle;
00599 int shadows;
00600 int samples;
00601
00602 int colr, colg, colb;
00604 double intensity;
00605 double cone_angle;
00606 double cone_delta_angle;
00607 double beam_distribution;
00608 int use_sm;
00609 int sm_resolution;
00610 ay_shader *lshader;
00611 double tfrom[3];
00612 double tto[3];
00613 } ay_light_object;
00614
00615
00617 typedef struct ay_level_object_s
00618 {
00619 int type;
00620 } ay_level_object;
00621
00622
00624 typedef struct ay_box_object_s
00625 {
00626 double width;
00627 double length;
00628 double height;
00629 double *pnts;
00630 } ay_box_object;
00631
00632
00634 typedef struct ay_bpatch_object_s
00635 {
00636 double p1[3];
00637 double p2[3];
00638 double p3[3];
00639 double p4[3];
00640 } ay_bpatch_object;
00641
00642
00644 typedef struct ay_sphere_object_s
00645 {
00646 char closed;
00647 char is_simple;
00648 double radius;
00649 double zmin;
00650 double zmax;
00651 double thetamax;
00652 double *pnts;
00653 } ay_sphere_object;
00654
00655
00657 typedef struct ay_cone_object_s
00658 {
00659 char closed;
00660 char is_simple;
00661 double radius;
00662 double height;
00663 double thetamax;
00664 double *pnts;
00665 } ay_cone_object;
00666
00667
00669 typedef struct ay_disk_object_s
00670 {
00671 char is_simple;
00672 double radius;
00673 double height;
00674 double thetamax;
00675 double *pnts;
00676 } ay_disk_object;
00677
00678
00680 typedef struct ay_cylinder_object_s
00681 {
00682 char closed;
00683 char is_simple;
00684 double radius;
00685 double zmin;
00686 double zmax;
00687 double thetamax;
00688 double *pnts;
00689 } ay_cylinder_object;
00690
00691
00693 typedef struct ay_hyperboloid_s
00694 {
00695 char closed;
00696 double p1[3];
00697 double p2[3];
00698 double thetamax;
00699 double *pnts;
00700 } ay_hyperboloid_object;
00701
00702
00704 typedef struct ay_paraboloid_object_s
00705 {
00706 char closed;
00707 double rmax;
00708 double zmin;
00709 double zmax;
00710 double thetamax;
00711 double *pnts;
00712 } ay_paraboloid_object;
00713
00714
00716 typedef struct ay_torus_object_s
00717 {
00718 char closed;
00719 double majorrad;
00720 double minorrad;
00721 double phimin;
00722 double phimax;
00723 double thetamax;
00724 double *pnts;
00725 } ay_torus_object;
00726
00727
00729 typedef struct ay_icurve_object_s
00730 {
00731 int type;
00732 int length;
00733 int order;
00734 int derivs;
00735 int param_type;
00736 double sdlen;
00737 double edlen;
00739 double *controlv;
00740 double sderiv[3];
00741 double ederiv[3];
00744 ay_object *ncurve;
00745
00746 double glu_sampling_tolerance;
00747 int display_mode;
00748 } ay_icurve_object;
00749
00750
00752 typedef struct ay_acurve_object_s
00753 {
00754 int length;
00755 int alength;
00756 int closed;
00757 int symmetric;
00758 int order;
00760 double *controlv;
00763 ay_object *ncurve;
00764
00765 double glu_sampling_tolerance;
00766 int display_mode;
00767 } ay_acurve_object;
00768
00769
00771 typedef struct ay_concatnc_object_s
00772 {
00773 int closed;
00774 int fillgaps;
00775 int revert;
00776 int knot_type;
00777 double ftlength;
00780 ay_object *ncurve;
00781
00782 double glu_sampling_tolerance;
00783 int display_mode;
00784 } ay_concatnc_object;
00785
00786
00788 typedef struct ay_offnc_object_s
00789 {
00790 int mode;
00791 int revert;
00792 double offset;
00795 ay_object *ncurve;
00796
00797 double glu_sampling_tolerance;
00798 int display_mode;
00799 } ay_offnc_object;
00800
00801
00803 typedef struct ay_cap_object_s
00804 {
00805 int type;
00808 ay_object *npatch;
00809
00810 double glu_sampling_tolerance;
00811 int display_mode;
00812 } ay_cap_object;
00813
00814
00816 typedef struct ay_bevel_object_s
00817 {
00818 int has_cap;
00821 ay_object *npatch;
00822
00823 double glu_sampling_tolerance;
00824 int display_mode;
00825 } ay_bevel_object;
00826
00827
00829 typedef struct ay_clone_object_s
00830 {
00831 int numclones;
00832 int rotate;
00833 int mirror;
00835
00837 double movx, movy, movz;
00839
00840 double rotx, roty, rotz;
00843
00844 double scalx, scaly, scalz;
00846 double quat[4];
00848 double *pnts;
00849 unsigned int pntslen;
00852 ay_object *clones;
00853 } ay_clone_object;
00854
00855
00857 typedef struct ay_camera_object_s
00858 {
00859 double from[3];
00860 double to[3];
00861 double up[3];
00862 double roll;
00863 double zoom;
00864 double nearp;
00865 double farp;
00866 } ay_camera_object;
00867
00868
00870 typedef struct ay_riinc_object_s
00871 {
00874 double width, length, height;
00876 char *file;
00877 } ay_riinc_object;
00878
00879
00881 typedef struct ay_riproc_object_s
00882 {
00883 int type;
00886 double minx, miny, minz, maxx, maxy, maxz;
00888 char *file;
00889 char *data;
00890 } ay_riproc_object;
00891
00892
00894 typedef struct ay_revolve_object_s
00895 {
00896 double thetamax;
00897 int sections;
00898 int order;
00899 int has_upper_cap;
00900 ay_object *upper_cap;
00901 int has_lower_cap;
00902 ay_object *lower_cap;
00903 int has_start_cap;
00904 ay_object *start_cap;
00905 int has_end_cap;
00906 ay_object *end_cap;
00909 ay_object *npatch;
00910
00911 double glu_sampling_tolerance;
00912 int display_mode;
00913 } ay_revolve_object;
00914
00915
00917 typedef struct ay_extrude_object_s
00918 {
00919 double height;
00920 int has_upper_cap;
00921 int has_lower_cap;
00924 ay_object *caps_and_bevels;
00925
00927 ay_object *npatch;
00928
00929 double glu_sampling_tolerance;
00930 int display_mode;
00931 } ay_extrude_object;
00932
00933
00935 typedef struct ay_sweep_object_s
00936 {
00937 int rotate;
00938 int interpolate;
00939 int close;
00940 int sections;
00941 int has_start_cap;
00942 int has_end_cap;
00945 ay_object *caps_and_bevels;
00946
00948 ay_object *npatch;
00949
00950 double glu_sampling_tolerance;
00951 int display_mode;
00952 } ay_sweep_object;
00953
00954
00956 typedef struct ay_swing_object_s
00957 {
00958 int has_upper_cap;
00959 ay_object *upper_cap;
00960 int has_lower_cap;
00961 ay_object *lower_cap;
00962 int has_start_cap;
00963 ay_object *start_cap;
00964 int has_end_cap;
00965 ay_object *end_cap;
00968 ay_object *npatch;
00969
00970 double glu_sampling_tolerance;
00971 int display_mode;
00972 } ay_swing_object;
00973
00974
00976 typedef struct ay_birail1_object_s
00977 {
00978 int close;
00979 int sections;
00980 int has_start_cap;
00981 int has_end_cap;
00984 ay_object *caps_and_bevels;
00985
00987 ay_object *npatch;
00988
00989 double glu_sampling_tolerance;
00990 int display_mode;
00991 } ay_birail1_object;
00992
00993
00995 typedef struct ay_birail2_object_s
00996 {
00997 int close;
00998 int sections;
00999 int interpolctrl;
01000 int has_start_cap;
01001 int has_end_cap;
01004 ay_object *caps_and_bevels;
01005
01007 ay_object *npatch;
01008
01009 double glu_sampling_tolerance;
01010 int display_mode;
01011 } ay_birail2_object;
01012
01013
01015 typedef struct ay_skin_object_s
01016 {
01017 int interpolate;
01018 int uorder;
01019 int uknot_type;
01020 double uknotv;
01021 int has_start_cap;
01022 int has_end_cap;
01025 ay_object *caps_and_bevels;
01026
01028 ay_object *npatch;
01029
01030 double glu_sampling_tolerance;
01031 int display_mode;
01032 } ay_skin_object;
01033
01034
01036 typedef struct ay_extrnc_object_s
01037 {
01038 int side;
01039 int pnum;
01040 int revert;
01041 int relative;
01042 double parameter;
01045 ay_object *ncurve;
01046
01047 double glu_sampling_tolerance;
01048 int display_mode;
01049 } ay_extrnc_object;
01050
01051
01053 typedef struct ay_extrnp_object_s
01054 {
01055 int pnum;
01056 int relative;
01059 double umin, umax, vmin, vmax;
01063 ay_object *npatch;
01064
01065 double glu_sampling_tolerance;
01066 int display_mode;
01067 } ay_extrnp_object;
01068
01069
01071 typedef struct ay_concatnp_object_s
01072 {
01073 int type;
01074 int revert;
01075 int knot_type;
01077 int fillgaps;
01078 double ftlength;
01081 ay_object *npatch;
01082
01083 double glu_sampling_tolerance;
01084 int display_mode;
01085 } ay_concatnp_object;
01086
01087
01089 typedef struct ay_offnp_object_s
01090 {
01091 int mode;
01092 double offset;
01095 ay_object *npatch;
01096
01097 double glu_sampling_tolerance;
01098 int display_mode;
01099 } ay_offnp_object;
01100
01101
01103 typedef struct ay_ncircle_object_s
01104 {
01105 double radius;
01106 double tmin;
01107 double tmax;
01110 ay_object *ncurve;
01111
01112 double glu_sampling_tolerance;
01113 int display_mode;
01114 } ay_ncircle_object;
01115
01116
01118 typedef int (ay_sevalcb) (Tcl_Interp *interp, char *script, int compile,
01119 Tcl_Obj **cscript);
01120
01121
01123 typedef struct ay_script_object_s
01124 {
01125 char *script;
01126 int active;
01127 int type;
01128 ay_object *cm_objects;
01130 int modified;
01131 Tcl_Obj *cscript;
01133 int paramslen;
01134 Tcl_Obj **params;
01136 double *pnts;
01137 unsigned int pntslen;
01139 ay_sevalcb *cb;
01140 } ay_script_object;
01141
01142
01144 typedef struct ay_view_object_s
01145 {
01146 struct Togl *togl;
01147 int type;
01148 double grid;
01150 int local;
01151 int aligned;
01153 int drawsel;
01154 int drawlevel;
01155 int redraw;
01156 int drawgrid;
01157 int usegrid;
01158 int shade;
01159 int antialiaslines;
01161
01162 int ppreview;
01163
01164
01165 int drawobjectcs;
01167
01168 double from[3];
01169 double to[3];
01170 double up[3];
01171 double roll;
01172 double zoom;
01173 double nearp;
01174 double farp;
01178 double rotx, roty, rotz;
01183 double conv_x, conv_y;
01188 double rect_xmin, rect_xmax, rect_ymin, rect_ymax;
01190 int drawrect;
01194 double markworld[3];
01195 double markx;
01196 double marky;
01198 int drawmark;
01202 int pos_x, pos_y;
01206 int isicon;
01207
01209 int drawhandles;
01210
01212 int dirty;
01213
01214
01215 char *bgimage;
01216 int bgimagedirty;
01217 int drawbgimage;
01221 int bgwidth, bgheight;
01222 int bguorder, bgvorder;
01223 float *bgknotv, *bgcv;
01228 int id;
01229
01230 int transform_points;
01234 Togl_Callback *altdispcb;
01235 } ay_view_object;
01236
01237
01239 typedef struct ay_select_object_s
01240 {
01241 char *indices;
01242 int length;
01243 int *seli;
01244 } ay_select_object;
01245
01246
01248 typedef struct ay_trim_object_s
01249 {
01250 int patchnum;
01253 ay_object *npatch;
01254 } ay_trim_object;
01255
01256
01258 typedef struct ay_preferences_s
01259 {
01260 int list_types;
01261 int mark_hidden;
01262 int single_window;
01264
01265 int edit_snaps_to_grid;
01266 double pick_epsilon;
01267 int lazynotify;
01268 int completenotify;
01269 int undo_levels;
01270 int snap3d;
01271 int globalmark;
01273
01274 int resolveinstances;
01275 int checklights;
01276 int ristandard;
01277 int use_sm;
01278 int defaultmat;
01279 int writeident;
01280 int excludehidden;
01282
01283 int mopsiresetdisplaymode;
01284 int mopsiresettolerance;
01286
01287 double handle_size;
01291 double bgr, bgg, bgb;
01295 double obr, obg, obb;
01299 double ser, seg, seb;
01303 double grr, grg, grb;
01307 double tpr, tpg, tpb;
01311 double shr, shg, shb;
01315 double lir, lig, lib;
01319 double sxr, sxg, sxb;
01322 int use_materialcolor;
01324 double linewidth;
01325 double sellinewidth;
01327
01328 char onerror;
01329 int writelog;
01330 char *logfile;
01332
01333 int wrib_sm;
01334 int wrib_em;
01335 int wrib_archives;
01338 double glu_sampling_tolerance;
01339 int np_display_mode;
01340 int nc_display_mode;
01341 int glu_cache_float;
01343 int stess_qf;
01346 int smethod;
01347 double sparamu;
01348 double sparamv;
01351 int wutag;
01352
01353 double polyoffset0;
01354 double polyoffset1;
01357 int save_rootviews;
01358
01360 int pprev_open;
01361 char *pprender;
01363
01364 char *texcoordname;
01365 char *normalname;
01366 char *colorname;
01368 } ay_preferences;
01369
01370
01372 typedef void (*ay_voidfp)(void);
01373
01375 typedef struct ay_ftable_s
01376 {
01377 unsigned int size;
01378 ay_voidfp *arr;
01379 } ay_ftable;
01380
01381
01382
01384 typedef int (ay_createcb) (int argc, char *argv[], ay_object *o);
01385
01387 typedef int (ay_deletecb) (void *c);
01388
01390 typedef int (ay_copycb) (void *src, void **dst);
01391
01393 typedef int (ay_drawcb) (struct Togl *togl, ay_object *o);
01394
01396 typedef int (ay_propcb) (Tcl_Interp *interp, int argc, char *argv[],
01397 ay_object *o);
01398
01400 typedef int (ay_getpntcb) (int mode, ay_object *o, double *p,
01401 ay_pointedit *pe);
01402
01404 typedef int (ay_wribcb) (char *file, ay_object *o);
01405
01407 typedef int (ay_readcb) (FILE *fileptr, ay_object *o);
01408
01410 typedef int (ay_writecb) (FILE *fileptr, ay_object *o);
01411
01413 typedef int (ay_notifycb) (ay_object *o);
01414
01416 typedef int (ay_treedropcb) (ay_object *o);
01417
01419 typedef int (ay_comparecb) (ay_object *o1, ay_object *o2);
01420
01422 typedef int (ay_convertcb) (ay_object *o, int in_place);
01423
01425 typedef int (ay_providecb) (ay_object *o, unsigned int type,
01426 ay_object **result);
01427
01429 typedef int (ay_bbccb) (ay_object *o, double *bbox, int *flags);
01430
01431
01432
01433
01435 extern Tcl_Interp *ay_interp;
01436
01438 extern Tcl_Interp *ay_safeinterp;
01439
01441 extern ay_preferences ay_prefs;
01442
01444 extern ay_object *ay_root;
01445
01447 extern ay_object *ay_endlevel;
01448
01451 extern ay_object **ay_next;
01452
01454 extern ay_view_object *ay_currentview;
01455
01457 extern ay_list_object *ay_selection;
01458
01460 extern ay_list_object *ay_currentlevel;
01461
01463 extern ay_object *ay_clipboard;
01464
01466 extern GLUquadric *ay_gluquadobj;
01467
01469 extern Tcl_HashTable ay_otypesht;
01470
01472 extern Tcl_HashTable ay_typenamesht;
01473
01475 extern Tcl_HashTable ay_tagtypesht;
01476
01478 extern Tcl_HashTable ay_languagesht;
01479
01480
01483 extern ay_ftable ay_createcbt;
01485 extern ay_ftable ay_deletecbt;
01487 extern ay_ftable ay_copycbt;
01489 extern ay_ftable ay_drawcbt;
01491 extern ay_ftable ay_drawhcbt;
01493 extern ay_ftable ay_shadecbt;
01495 extern ay_ftable ay_getpropcbt;
01497 extern ay_ftable ay_setpropcbt;
01499 extern ay_ftable ay_getpntcbt;
01501 extern ay_ftable ay_wribcbt;
01503 extern ay_ftable ay_readcbt;
01505 extern ay_ftable ay_writecbt;
01507 extern ay_ftable ay_notifycbt;
01509 extern ay_ftable ay_bbccbt;
01511 extern ay_ftable ay_treedropcbt;
01513 extern ay_ftable ay_convertcbt;
01515 extern ay_ftable ay_providecbt;
01519 extern ay_ftable ay_sevalcbt;
01520
01521
01523 extern int ay_errno;
01524
01526 extern int ay_read_version;
01527
01529 extern int ay_read_viewnum;
01530
01532 extern unsigned int ay_current_glname;
01533
01535 extern int ay_wrib_framenum;
01536
01538 extern unsigned int ay_current_primlevel;
01539
01541 extern char ay_version_ma[];
01543 extern char ay_version_mi[];
01544
01547 extern char *ay_oi_tagtype;
01548 extern char *ay_oi_tagname;
01549 extern char *ay_riattr_tagtype;
01550 extern char *ay_riattr_tagname;
01551 extern char *ay_riopt_tagtype;
01552 extern char *ay_riopt_tagname;
01553 extern char *ay_tc_tagtype;
01554 extern char *ay_tc_tagname;
01555 extern char *ay_pv_tagtype;
01556 extern char *ay_pv_tagname;
01557 extern char *ay_ridisp_tagtype;
01558 extern char *ay_ridisp_tagname;
01559 extern char *ay_rihider_tagtype;
01560 extern char *ay_rihider_tagname;
01561 extern char *ay_noexport_tagtype;
01562 extern char *ay_noexport_tagname;
01563 extern char *ay_tp_tagtype;
01564 extern char *ay_tp_tagname;
01565 extern char *ay_bns_tagtype;
01566 extern char *ay_bns_tagname;
01567 extern char *ay_ans_tagtype;
01568 extern char *ay_ans_tagname;
01569 extern char *ay_dbns_tagtype;
01570 extern char *ay_dbns_tagname;
01571 extern char *ay_dans_tagtype;
01572 extern char *ay_dans_tagname;
01573 extern char *ay_umm_tagtype;
01574 extern char *ay_umm_tagname;
01575 extern char *ay_vmm_tagtype;
01576 extern char *ay_vmm_tagname;
01577 extern char *ay_bp_tagtype;
01578 extern char *ay_bp_tagname;
01579 extern char *ay_np_tagtype;
01580 extern char *ay_np_tagname;
01581 extern char *ay_rp_tagtype;
01582 extern char *ay_rp_tagname;
01583 extern char *ay_hc_tagtype;
01584 extern char *ay_hc_tagname;
01585 extern char *ay_no_tagtype;
01586 extern char *ay_no_tagname;
01587 extern char *ay_nm_tagtype;
01588 extern char *ay_nm_tagname;
01591
01592
01595 #define AY_TRUE 1
01596 #define AY_FALSE 0
01597
01601 #define AY_OK 0
01602 #define AY_EWARN 1
01603 #define AY_ERROR 2
01604 #define AY_EFLUSH 3
01605 #define AY_EOUTPUT 4
01606 #define AY_EOMEM 5
01607 #define AY_EOPENFILE 10
01608 #define AY_ECLOSEFILE 11
01609 #define AY_EFORMAT 12
01610 #define AY_EUEOF 13
01611 #define AY_EEOF 14
01612 #define AY_EDONOTLINK 15
01613 #define AY_ENOSEL 20
01614 #define AY_EARGS 21
01615 #define AY_EOPT 22
01616 #define AY_EUOPT 23
01617 #define AY_EWTYPE 24
01618 #define AY_ETYPE 30
01619 #define AY_ENTYPE 31
01620 #define AY_EREF 40
01621 #define AY_ENULL 50
01622
01626 #define AY_IDROOT 0
01627 #define AY_IDNPATCH 1
01628 #define AY_IDNCURVE 2
01629 #define AY_IDLEVEL 3
01630 #define AY_IDLIGHT 4
01631 #define AY_IDBOX 5
01632 #define AY_IDBPATCH 6
01633 #define AY_IDVIEW 7
01634 #define AY_IDCAMERA 8
01635 #define AY_IDINSTANCE 9
01636 #define AY_IDSPHERE 10
01637 #define AY_IDDISK 11
01638 #define AY_IDCONE 12
01639 #define AY_IDCYLINDER 13
01640 #define AY_IDPARABOLOID 14
01641 #define AY_IDHYPERBOLOID 15
01642 #define AY_IDTORUS 16
01643 #define AY_IDRIINC 17
01644 #define AY_IDMATERIAL 18
01645 #define AY_IDICURVE 19
01646 #define AY_IDREVOLVE 20
01647 #define AY_IDEXTRUDE 21
01648 #define AY_IDSWEEP 22
01649 #define AY_IDSKIN 23
01650 #define AY_IDCAP 24
01651 #define AY_IDPAMESH 25
01652 #define AY_IDPOMESH 26
01653 #define AY_IDCONCATNC 27
01654 #define AY_IDCLONE 28
01655 #define AY_IDSDMESH 29
01656 #define AY_IDGORDON 30
01657 #define AY_IDTEXT 31
01658 #define AY_IDBIRAIL1 32
01659 #define AY_IDBIRAIL2 33
01660 #define AY_IDEXTRNC 34
01661 #define AY_IDSCRIPT 35
01662 #define AY_IDRIPROC 36
01663 #define AY_IDBEVEL 37
01664 #define AY_IDNCIRCLE 38
01665 #define AY_IDSWING 39
01666 #define AY_IDSELECT 40
01667 #define AY_IDEXTRNP 41
01668 #define AY_IDOFFNC 42
01669 #define AY_IDACURVE 43
01670 #define AY_IDTRIM 44
01671 #define AY_IDCONCATNP 45
01672 #define AY_IDOFFNP 46
01673
01674 #define AY_IDLAST 50
01675
01679 #define AY_LTEND 0
01680 #define AY_LTLEVEL 1
01681 #define AY_LTUNION 2
01682 #define AY_LTDIFF 3
01683 #define AY_LTINT 4
01684 #define AY_LTPRIM 5
01685
01689 #define AY_VTFRONT 0
01690 #define AY_VTSIDE 1
01691 #define AY_VTTOP 2
01692 #define AY_VTPERSP 3
01693 #define AY_VTTRIM 4
01694
01698 #define AY_STSURFACE 0
01699 #define AY_STDISPLACEMENT 1
01700 #define AY_STVOLUME 2
01701 #define AY_STLIGHT 3
01702 #define AY_STIMAGER 4
01703 #define AY_STTRANSFORMATION 5
01704
01705 #define AY_STAREALIGHT 6
01706 #define AY_STINTERIOR 7
01707 #define AY_STEXTERIOR 8
01708 #define AY_STATMOSPHERE 9
01709
01713 #define AY_SASCALAR 0
01714 #define AY_SAPOINT 1
01715 #define AY_SANORMAL 2
01716 #define AY_SAVECTOR 3
01717 #define AY_SACOLOR 4
01718 #define AY_SASTRING 5
01719 #define AY_SAMATRIX 6
01720
01724 #define AY_LITCUSTOM 0
01725 #define AY_LITPOINT 1
01726 #define AY_LITDISTANT 2
01727 #define AY_LITSPOT 3
01728
01732 #define AY_CTOPEN 0
01733 #define AY_CTCLOSED 1
01734 #define AY_CTPERIODIC 2
01735
01739 #define AY_KTBEZIER 0
01740 #define AY_KTBSPLINE 1
01741 #define AY_KTNURB 2
01742 #define AY_KTCUSTOM 3
01743 #define AY_KTCHORDAL 4
01744 #define AY_KTCENTRI 5
01745
01749 #define AY_PTBILINEAR 0
01750 #define AY_PTBICUBIC 1
01751
01755 #define AY_BTBEZIER 0
01756 #define AY_BTBSPLINE 1
01757 #define AY_BTCATMULLROM 2
01758 #define AY_BTHERMITE 3
01759 #define AY_BTCUSTOM 4
01760
01764 #define AY_SDSCATMULL 0
01765 #define AY_SDSLOOP 1
01766
01770 #define AY_SDTHOLE 0
01771 #define AY_SDTCORNER 1
01772 #define AY_SDTCREASE 2
01773 #define AY_SDTIB 3
01774
01778 #define AY_PRTDREADA 0
01779 #define AY_PRTRUNPROG 1
01780 #define AY_PRTDYNLOAD 2
01782
01783
01785 #define AY_POINTER 8
01786
01788 #define AY_EPSILON 1.0e-06
01789
01792 #define AY_NORTH 0
01793 #define AY_EAST 1
01794 #define AY_SOUTH 2
01795 #define AY_WEST 3
01796
01800 #ifdef M_PI
01801 #define AY_PI M_PI
01802 #define AY_HALFPI (M_PI/2.0)
01803 #else
01804 #define AY_PI 3.1415926535897932384626433
01805 #define AY_HALFPI (3.1415926535897932384626433/2.0)
01806 #endif
01807
01808 #define AY_D2R(x) ((x)*AY_PI/180.0)
01809
01810 #define AY_R2D(x) ((x)*180.0/AY_PI)
01811
01812 #define AY_COT(x) (cos(x)/sin(x))
01813
01817 #define AY_VLEN(x,y,z) sqrt((x*x)+(y*y)+(z*z))
01818
01819 #define AY_V3LEN(v) sqrt((v[0]*v[0])+(v[1]*v[1])+(v[2]*v[2]))
01820
01821 #define AY_V2LEN(v) sqrt((v[0]*v[0])+(v[1]*v[1]))
01822
01823 #define AY_V3ZERO(v) {v[0]=0.0; v[1]=0.0; v[2]=0.0;}
01824
01825 #define AY_V3SUB(r,v1,v2) {r[0]=v1[0]-v2[0];r[1]=v1[1]-v2[1];r[2]=v1[2]-v2[2];}
01826
01827 #define AY_V3ADD(r,v1,v2) {r[0]=v1[0]+v2[0];r[1]=v1[1]+v2[1];r[2]=v1[2]+v2[2];}
01828
01829 #define AY_V3MUL(r,v1,v2) {r[0]=v1[0]*v2[0];r[1]=v1[1]*v2[1];r[2]=v1[2]*v2[2];}
01830
01831 #define AY_V3CROSS(r,v1,v2) {r[0]=(v1[1] * v2[2]) - (v1[2] * v2[1]);r[1]=(v1[2] * v2[0]) - (v1[0] * v2[2]);r[2]=(v1[0] * v2[1]) - (v1[1] * v2[0]);}
01832
01833 #define AY_V3SCAL(v,f) {(v[0])*=(f);(v[1])*=(f);(v[2])*=(f);}
01834
01835 #define AY_V2SCAL(v,f) {(v[0])*=(f);(v[1])*=(f);}
01836
01837
01838 #define AY_V3NORM(v) {AY_V3SCAL((v),(1.0/(AY_V3LEN(v))));}
01839
01840 #define AY_V2NORM(v) {AY_V2SCAL((v),(1.0/(AY_V2LEN(v))));}
01841
01842 #define AY_V3DOT(v1,v2) (v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2])
01843
01844 #define AY_V2DOT(v1,v2) (v1[0]*v2[0] + v1[1]*v2[1])
01845
01846 #define AY_V4COMP(v1, v2) ((fabs(v1[0]-v2[0]) < AY_EPSILON) &&\
01847 (fabs(v1[1]-v2[1]) < AY_EPSILON) &&\
01848 (fabs(v1[2]-v2[2]) < AY_EPSILON) &&\
01849 (fabs(v1[3]-v2[3]) < AY_EPSILON))
01850
01851 #define AY_V3COMP(v1, v2) ((fabs(v1[0]-v2[0]) < AY_EPSILON) &&\
01852 (fabs(v1[1]-v2[1]) < AY_EPSILON) &&\
01853 (fabs(v1[2]-v2[2]) < AY_EPSILON))
01854
01855 #define AY_V2COMP(v1, v2) ((fabs(v1[0]-v2[0]) < AY_EPSILON) &&\
01856 (fabs(v1[1]-v2[1]) < AY_EPSILON))
01857
01860
01862 #define AY_APTRAN4(v1,v2,m) {v1[0]=v2[0]*m[0]+v2[1]*m[4]+v2[2]*m[8]+v2[3]*m[12];v1[1]=v2[0]*m[1]+v2[1]*m[5]+v2[2]*m[9]+v2[3]*m[13];v1[2]=v2[0]*m[2]+v2[1]*m[6]+v2[2]*m[10]+v2[3]*m[14];v1[3]=v2[0]*m[3]+v2[1]*m[7]+v2[2]*m[11]+v2[3]*m[15];}
01863
01864
01866 #define AY_APTRAN3(v1,v2,m) {v1[0]=v2[0]*m[0]+v2[1]*m[4]+v2[2]*m[8]+1.0*m[12];v1[1]=v2[0]*m[1]+v2[1]*m[5]+v2[2]*m[9]+1.0*m[13];v1[2]=v2[0]*m[2]+v2[1]*m[6]+v2[2]*m[10]+1.0*m[14];}
01867
01869 #define AY_M44(m,r,c) ((m)[(c)*4+(r)])
01870
01872 #define AY_ISTRAFO(o) ((fabs(o->movx) > AY_EPSILON) ||\
01873 (fabs(o->movy) > AY_EPSILON) ||\
01874 (fabs(o->movz) > AY_EPSILON) ||\
01875 (fabs(o->quat[0]) > AY_EPSILON) ||\
01876 (fabs(o->quat[1]) > AY_EPSILON) ||\
01877 (fabs(o->quat[2]) > AY_EPSILON) ||\
01878 (fabs(1.0 - o->quat[3]) > AY_EPSILON) ||\
01879 (fabs(1.0 - o->scalx) > AY_EPSILON) ||\
01880 (fabs(1.0 - o->scaly) > AY_EPSILON) ||\
01881 (fabs(1.0 - o->scalz) > AY_EPSILON))
01882
01884 #define AY_CHTCLERRRET(stat,name,interp) if(stat){\
01885 ay_error(AY_ERROR, name, Tcl_GetStringResult(interp));\
01886 Tcl_ResetResult(interp);\
01887 return TCL_OK;}
01888
01890 #define AY_CHTCLERRGOT(stat,name,interp) if(stat){\
01891 ay_error(AY_ERROR, name, Tcl_GetStringResult(interp));\
01892 Tcl_ResetResult(interp);\
01893 goto cleanup;}
01894
01897 #define AY_VERSIONSTR "1.18"
01898 #define AY_VERSIONSTRMI "0"
01899
01900 #define AY_VERSIONMA 1
01901 #define AY_VERSION 18
01902 #define AY_VERSIONMI 0
01903
01905
01906 #include "aycore.h"
01907 #include "nurbs.h"
01908 #include "objects.h"
01909 #include "contrib.h"
01910
01929 #ifdef __cplusplus
01930 }
01931 #endif
01932
01933 #endif
01934