home *** CD-ROM | disk | FTP | other *** search
/ vis-ftp.cs.umass.edu / vis-ftp.cs.umass.edu.tar / vis-ftp.cs.umass.edu / pub / Software / ASCENDER / ascender.tar.Z / ascender.tar / lisp-phantoms.c < prev    next >
C/C++ Source or Header  |  1996-04-03  |  14KB  |  594 lines

  1.  
  2.  
  3. /* 
  4.  * Lisp-side phantom functions
  5.  * Incoming parameters appear on xdr_in stream, 
  6.  * Outgoing return value placed on xdr_out stream.
  7.  */
  8.  
  9. #include <rpc/rpc.h>
  10. #include "/home/rcde/CME-6d/lci/rcde_types.h"
  11. #include "rcde_types.h"
  12. extern int sv_return_length;
  13. extern int sv_return_type;
  14. extern int sv_element_size[];
  15. extern XDR  xdr_in, xdr_out;
  16.  
  17.  
  18. char stub_error[500];
  19. extern int xdr_keyword();
  20.  
  21. extern bool_t xdr_double_2();
  22.  
  23. /* 
  24.  * Dispatching table of Lisp function names.
  25.  * derived from unresolved references list.
  26.  * Names are mangled, with _ph appended.
  27.  */
  28.  
  29. void working_image_ph();
  30. void z_height_at_xy_ph();
  31. void draw_fat_point_ph();
  32. void project_to_world_ph();
  33. void set_ior_alu_ph();
  34. void get_projection_matrix_ph();
  35. void flush_display_ph();
  36. void read_tec_projection_ph();
  37. void draw_fat_line_ph();
  38. void project_to_world_KP_ph();
  39. void make_2d_building_curve_ph();
  40. void get_interactor_ph();
  41. void lines_form_corner_ph();
  42. void get_3d_image_world_ph();
  43. void image_line_support_ph();
  44. void backprop_point_ph();
  45. void tec_project_point_ph();
  46. void extrude_roof_curve_ph();
  47.  
  48. void (*lisp_function_table_Poly[])() = { 
  49.     working_image_ph,
  50.     z_height_at_xy_ph,
  51.     draw_fat_point_ph,
  52.     project_to_world_ph,
  53.     set_ior_alu_ph,
  54.     get_projection_matrix_ph,
  55.     flush_display_ph,
  56.     read_tec_projection_ph,
  57.     draw_fat_line_ph,
  58.     project_to_world_KP_ph,
  59.     make_2d_building_curve_ph,
  60.     get_interactor_ph,
  61.     lines_form_corner_ph,
  62.     get_3d_image_world_ph,
  63.     image_line_support_ph,
  64.     backprop_point_ph,
  65.     tec_project_point_ph,
  66.     extrude_roof_curve_ph
  67.     };
  68.  
  69.  
  70. extern c_handle working_image();
  71.  
  72. void
  73. working_image_ph()
  74.     {
  75.     c_handle arg_0;
  76.     c_handle result;
  77.  
  78.     if (xdr_int(&xdr_in, &arg_0) )
  79.         {
  80.         result =  working_image(arg_0);
  81.         if (xdr_int(&xdr_out, &result))
  82.             return;    /* Return type always void */
  83.         else
  84.             interface_error(sprintf(stub_error,
  85.               "Result XDR error in working_image.\n"));
  86.         }
  87.     else
  88.         interface_error(sprintf(stub_error,
  89.           "Main XDR error in working_image.\n"));
  90.     }
  91.  
  92.  
  93.  
  94.  
  95. extern double z_height_at_xy();
  96.  
  97. void
  98. z_height_at_xy_ph()
  99.     {
  100.     double arg_0;
  101.     double arg_1;
  102.     double arg_2;
  103.     c_handle arg_3;
  104.     double result;
  105.  
  106.     if (xdr_double(&xdr_in, &arg_0) &&
  107.         xdr_double(&xdr_in, &arg_1) &&
  108.         xdr_double(&xdr_in, &arg_2) &&
  109.         xdr_int(&xdr_in, &arg_3) )
  110.         {
  111.         result =  z_height_at_xy(arg_0, arg_1, arg_2, arg_3);
  112.         if (xdr_double(&xdr_out, &result))
  113.             return;    /* Return type always void */
  114.         else
  115.             interface_error(sprintf(stub_error,
  116.               "Result XDR error in z_height_at_xy.\n"));
  117.         }
  118.     else
  119.         interface_error(sprintf(stub_error,
  120.           "Main XDR error in z_height_at_xy.\n"));
  121.     }
  122.  
  123.  
  124.  
  125.  
  126. extern int draw_fat_point();
  127.  
  128. void
  129. draw_fat_point_ph()
  130.     {
  131.     c_handle arg_0;
  132.     double arg_1;
  133.     double arg_2;
  134.     double arg_3;
  135.     int result;
  136.  
  137.     if (xdr_int(&xdr_in, &arg_0) &&
  138.         xdr_double(&xdr_in, &arg_1) &&
  139.         xdr_double(&xdr_in, &arg_2) &&
  140.         xdr_double(&xdr_in, &arg_3) )
  141.         {
  142.         result =  draw_fat_point(arg_0, arg_1, arg_2, arg_3);
  143.         if (xdr_int(&xdr_out, &result))
  144.             return;    /* Return type always void */
  145.         else
  146.             interface_error(sprintf(stub_error,
  147.               "Result XDR error in draw_fat_point.\n"));
  148.         }
  149.     else
  150.         interface_error(sprintf(stub_error,
  151.           "Main XDR error in draw_fat_point.\n"));
  152.     }
  153.  
  154.  
  155.  
  156.  
  157. extern c_handle project_to_world();
  158.  
  159. void
  160. project_to_world_ph()
  161.     {
  162.     c_handle arg_0;
  163.     double arg_1;
  164.     double arg_2;
  165.     c_handle arg_3;
  166.     c_handle result;
  167.  
  168.     if (xdr_int(&xdr_in, &arg_0) &&
  169.         xdr_double(&xdr_in, &arg_1) &&
  170.         xdr_double(&xdr_in, &arg_2) &&
  171.         xdr_int(&xdr_in, &arg_3) )
  172.         {
  173.         result =  project_to_world(arg_0, arg_1, arg_2, arg_3);
  174.         if (xdr_int(&xdr_out, &result))
  175.             return;    /* Return type always void */
  176.         else
  177.             interface_error(sprintf(stub_error,
  178.               "Result XDR error in project_to_world.\n"));
  179.         }
  180.     else
  181.         interface_error(sprintf(stub_error,
  182.           "Main XDR error in project_to_world.\n"));
  183.     }
  184.  
  185.  
  186.  
  187.  
  188. extern int set_ior_alu();
  189.  
  190. void
  191. set_ior_alu_ph()
  192.     {
  193.     c_handle arg_0;
  194.     int result;
  195.  
  196.     if (xdr_int(&xdr_in, &arg_0) )
  197.         {
  198.         result =  set_ior_alu(arg_0);
  199.         if (xdr_int(&xdr_out, &result))
  200.             return;    /* Return type always void */
  201.         else
  202.             interface_error(sprintf(stub_error,
  203.               "Result XDR error in set_ior_alu.\n"));
  204.         }
  205.     else
  206.         interface_error(sprintf(stub_error,
  207.           "Main XDR error in set_ior_alu.\n"));
  208.     }
  209.  
  210.  
  211.  
  212.  
  213. extern c_handle get_projection_matrix();
  214.  
  215. void
  216. get_projection_matrix_ph()
  217.     {
  218.     c_handle arg_0;
  219.     c_handle result;
  220.  
  221.     if (xdr_int(&xdr_in, &arg_0) )
  222.         {
  223.         result =  get_projection_matrix(arg_0);
  224.         if (xdr_int(&xdr_out, &result))
  225.             return;    /* Return type always void */
  226.         else
  227.             interface_error(sprintf(stub_error,
  228.               "Result XDR error in get_projection_matrix.\n"));
  229.         }
  230.     else
  231.         interface_error(sprintf(stub_error,
  232.           "Main XDR error in get_projection_matrix.\n"));
  233.     }
  234.  
  235.  
  236.  
  237.  
  238. extern int flush_display();
  239.  
  240. void
  241. flush_display_ph()
  242.     {
  243.     c_handle arg_0;
  244.     int result;
  245.  
  246.     if (xdr_int(&xdr_in, &arg_0) )
  247.         {
  248.         result =  flush_display(arg_0);
  249.         if (xdr_int(&xdr_out, &result))
  250.             return;    /* Return type always void */
  251.         else
  252.             interface_error(sprintf(stub_error,
  253.               "Result XDR error in flush_display.\n"));
  254.         }
  255.     else
  256.         interface_error(sprintf(stub_error,
  257.           "Main XDR error in flush_display.\n"));
  258.     }
  259.  
  260.  
  261.  
  262.  
  263. extern c_handle read_tec_projection();
  264.  
  265. void
  266. read_tec_projection_ph()
  267.     {
  268.     c_handle result;
  269.         result =  read_tec_projection();
  270.         if (xdr_int(&xdr_out, &result))
  271.             return;    /* Return type always void */
  272.         else
  273.             interface_error(sprintf(stub_error,
  274.               "Result XDR error in read_tec_projection.\n"));
  275.     }
  276.  
  277.  
  278.  
  279.  
  280. extern int draw_fat_line();
  281.  
  282. void
  283. draw_fat_line_ph()
  284.     {
  285.     c_handle arg_0;
  286.     double arg_1;
  287.     double arg_2;
  288.     double arg_3;
  289.     double arg_4;
  290.     double arg_5;
  291.     int result;
  292.  
  293.     if (xdr_int(&xdr_in, &arg_0) &&
  294.         xdr_double(&xdr_in, &arg_1) &&
  295.         xdr_double(&xdr_in, &arg_2) &&
  296.         xdr_double(&xdr_in, &arg_3) &&
  297.         xdr_double(&xdr_in, &arg_4) &&
  298.         xdr_double(&xdr_in, &arg_5) )
  299.         {
  300.         result =  draw_fat_line(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
  301.         if (xdr_int(&xdr_out, &result))
  302.             return;    /* Return type always void */
  303.         else
  304.             interface_error(sprintf(stub_error,
  305.               "Result XDR error in draw_fat_line.\n"));
  306.         }
  307.     else
  308.         interface_error(sprintf(stub_error,
  309.           "Main XDR error in draw_fat_line.\n"));
  310.     }
  311.  
  312.  
  313.  
  314.  
  315. extern c_handle project_to_world_KP();
  316.  
  317. void
  318. project_to_world_KP_ph()
  319.     {
  320.     c_handle arg_0;
  321.     double arg_1;
  322.     double arg_2;
  323.     double arg_3;
  324.     c_handle result;
  325.  
  326.     if (xdr_int(&xdr_in, &arg_0) &&
  327.         xdr_double(&xdr_in, &arg_1) &&
  328.         xdr_double(&xdr_in, &arg_2) &&
  329.         xdr_double(&xdr_in, &arg_3) )
  330.         {
  331.         result =  project_to_world_KP(arg_0, arg_1, arg_2, arg_3);
  332.         if (xdr_int(&xdr_out, &result))
  333.             return;    /* Return type always void */
  334.         else
  335.             interface_error(sprintf(stub_error,
  336.               "Result XDR error in project_to_world_KP.\n"));
  337.         }
  338.     else
  339.         interface_error(sprintf(stub_error,
  340.           "Main XDR error in project_to_world_KP.\n"));
  341.     }
  342.  
  343.  
  344.  
  345.  
  346. extern c_handle make_2d_building_curve();
  347.  
  348. void
  349. make_2d_building_curve_ph()
  350.     {
  351.     boolean arg_0;
  352.     c_handle arg_1;
  353.     c_handle result;
  354.  
  355.     if (xdr_bool(&xdr_in, &arg_0) &&
  356.         xdr_int(&xdr_in, &arg_1) )
  357.         {
  358.         result =  make_2d_building_curve(arg_0, arg_1);
  359.         if (xdr_int(&xdr_out, &result))
  360.             return;    /* Return type always void */
  361.         else
  362.             interface_error(sprintf(stub_error,
  363.               "Result XDR error in make_2d_building_curve.\n"));
  364.         }
  365.     else
  366.         interface_error(sprintf(stub_error,
  367.           "Main XDR error in make_2d_building_curve.\n"));
  368.     }
  369.  
  370.  
  371.  
  372.  
  373. extern c_handle get_interactor();
  374.  
  375. void
  376. get_interactor_ph()
  377.     {
  378.     int optionals_used;
  379.     c_handle pane;
  380.     c_handle result;
  381.  
  382.     if (xdr_int(&xdr_in, &optionals_used) )
  383.         {
  384.  
  385.         if (optionals_used > 0 &&
  386.             xdr_int(&xdr_in, &pane) )
  387.             ;
  388.         result =  get_interactor(optionals_used, pane);
  389.         if (xdr_int(&xdr_out, &result))
  390.             return;    /* Return type always void */
  391.         else
  392.             interface_error(sprintf(stub_error,
  393.               "Result XDR error in get_interactor.\n"));
  394.         }
  395.     else
  396.         interface_error(sprintf(stub_error,
  397.           "Main XDR error in get_interactor.\n"));
  398.     }
  399.  
  400.  
  401.  
  402.  
  403. extern struct double_2* lines_form_corner();
  404.  
  405. void
  406. lines_form_corner_ph()
  407.     {
  408.     c_handle arg_0;
  409.     double arg_1;
  410.     double arg_2;
  411.     double arg_3;
  412.     double arg_4;
  413.     double arg_5;
  414.     double arg_6;
  415.     double arg_7;
  416.     double arg_8;
  417.     double arg_9;
  418.     struct double_2* result;
  419.  
  420.     if (xdr_int(&xdr_in, &arg_0) &&
  421.         xdr_double(&xdr_in, &arg_1) &&
  422.         xdr_double(&xdr_in, &arg_2) &&
  423.         xdr_double(&xdr_in, &arg_3) &&
  424.         xdr_double(&xdr_in, &arg_4) &&
  425.         xdr_double(&xdr_in, &arg_5) &&
  426.         xdr_double(&xdr_in, &arg_6) &&
  427.         xdr_double(&xdr_in, &arg_7) &&
  428.         xdr_double(&xdr_in, &arg_8) &&
  429.         xdr_double(&xdr_in, &arg_9) )
  430.         {
  431.         result =  lines_form_corner(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9);
  432.         if (xdr_pointer(&xdr_out,&result,sizeof(struct double_2),xdr_double_2))
  433.             return;    /* Return type always void */
  434.         else
  435.             interface_error(sprintf(stub_error,
  436.               "Result XDR error in lines_form_corner.\n"));
  437.         }
  438.     else
  439.         interface_error(sprintf(stub_error,
  440.           "Main XDR error in lines_form_corner.\n"));
  441.     }
  442.  
  443.  
  444.  
  445.  
  446. extern c_handle get_3d_image_world();
  447.  
  448. void
  449. get_3d_image_world_ph()
  450.     {
  451.     int arg_0;
  452.     c_handle result;
  453.  
  454.     if (xdr_int(&xdr_in, &arg_0) )
  455.         {
  456.         result =  get_3d_image_world(arg_0);
  457.         if (xdr_int(&xdr_out, &result))
  458.             return;    /* Return type always void */
  459.         else
  460.             interface_error(sprintf(stub_error,
  461.               "Result XDR error in get_3d_image_world.\n"));
  462.         }
  463.     else
  464.         interface_error(sprintf(stub_error,
  465.           "Main XDR error in get_3d_image_world.\n"));
  466.     }
  467.  
  468.  
  469.  
  470.  
  471. extern double image_line_support();
  472.  
  473. void
  474. image_line_support_ph()
  475.     {
  476.     c_handle image;
  477.     double u1;
  478.     double v1;
  479.     double u2;
  480.     double v2;
  481.     double width;
  482.     double percentage;
  483.     double result;
  484.  
  485.     if (xdr_int(&xdr_in, &image) &&
  486.         xdr_double(&xdr_in, &u1) &&
  487.         xdr_double(&xdr_in, &v1) &&
  488.         xdr_double(&xdr_in, &u2) &&
  489.         xdr_double(&xdr_in, &v2) &&
  490.         xdr_double(&xdr_in, &width) &&
  491.         xdr_double(&xdr_in, &percentage) )
  492.         {
  493.         result =  image_line_support(image, u1, v1, u2, v2, width, percentage);
  494.         if (xdr_double(&xdr_out, &result))
  495.             return;    /* Return type always void */
  496.         else
  497.             interface_error(sprintf(stub_error,
  498.               "Result XDR error in image_line_support.\n"));
  499.         }
  500.     else
  501.         interface_error(sprintf(stub_error,
  502.           "Main XDR error in image_line_support.\n"));
  503.     }
  504.  
  505.  
  506.  
  507.  
  508. extern c_handle backprop_point();
  509.  
  510. void
  511. backprop_point_ph()
  512.     {
  513.     int arg_0;
  514.     double arg_1;
  515.     double arg_2;
  516.     c_handle result;
  517.  
  518.     if (xdr_int(&xdr_in, &arg_0) &&
  519.         xdr_double(&xdr_in, &arg_1) &&
  520.         xdr_double(&xdr_in, &arg_2) )
  521.         {
  522.         result =  backprop_point(arg_0, arg_1, arg_2);
  523.         if (xdr_int(&xdr_out, &result))
  524.             return;    /* Return type always void */
  525.         else
  526.             interface_error(sprintf(stub_error,
  527.               "Result XDR error in backprop_point.\n"));
  528.         }
  529.     else
  530.         interface_error(sprintf(stub_error,
  531.           "Main XDR error in backprop_point.\n"));
  532.     }
  533.  
  534.  
  535.  
  536.  
  537. extern c_handle tec_project_point();
  538.  
  539. void
  540. tec_project_point_ph()
  541.     {
  542.     c_handle arg_0;
  543.     double arg_1;
  544.     double arg_2;
  545.     double arg_3;
  546.     c_handle result;
  547.  
  548.     if (xdr_int(&xdr_in, &arg_0) &&
  549.         xdr_double(&xdr_in, &arg_1) &&
  550.         xdr_double(&xdr_in, &arg_2) &&
  551.         xdr_double(&xdr_in, &arg_3) )
  552.         {
  553.         result =  tec_project_point(arg_0, arg_1, arg_2, arg_3);
  554.         if (xdr_int(&xdr_out, &result))
  555.             return;    /* Return type always void */
  556.         else
  557.             interface_error(sprintf(stub_error,
  558.               "Result XDR error in tec_project_point.\n"));
  559.         }
  560.     else
  561.         interface_error(sprintf(stub_error,
  562.           "Main XDR error in tec_project_point.\n"));
  563.     }
  564.  
  565.  
  566.  
  567.  
  568. extern c_handle extrude_roof_curve();
  569.  
  570. void
  571. extrude_roof_curve_ph()
  572.     {
  573.     c_handle arg_0;
  574.     c_handle result;
  575.  
  576.     if (xdr_int(&xdr_in, &arg_0) )
  577.         {
  578.         result =  extrude_roof_curve(arg_0);
  579.         if (xdr_int(&xdr_out, &result))
  580.             return;    /* Return type always void */
  581.         else
  582.             interface_error(sprintf(stub_error,
  583.               "Result XDR error in extrude_roof_curve.\n"));
  584.         }
  585.     else
  586.         interface_error(sprintf(stub_error,
  587.           "Main XDR error in extrude_roof_curve.\n"));
  588.     }
  589.  
  590.  
  591.  
  592.  
  593.  
  594.