home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / demos / gpc / basestat.c next >
Encoding:
Text File  |  1991-07-19  |  79.8 KB  |  2,046 lines

  1. /* $XConsortium: basestat.c,v 5.2 91/07/19 14:13:23 hersh Exp $ */
  2. /***********************************************************
  3. Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium at M.I.T.
  4.  
  5.                         All Rights Reserved
  6.  
  7. Permission to use, copy, modify, and distribute this software and its
  8. documentation for any purpose and without fee is hereby granted,
  9. provided that the above copyright notice appear in all copies and that
  10. both that copyright notice and this permission notice appear in
  11. supporting documentation, and that the names of Sun Microsystems,
  12. the X Consortium, and MIT not be used in advertising or publicity
  13. pertaining to distribution of the software without specific, written
  14. prior permission.
  15.  
  16. SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  17. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
  18. SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  19. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  20. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  21. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  22. SOFTWARE.
  23.  
  24. ******************************************************************/
  25.  
  26. /*--------------------------------------------------------------------*\
  27. |  Copyright (C) 1989,1990, 1991, National Computer Graphics Association
  28. |
  29. |  Permission is granted to any individual or institution to use, copy, or
  30. |  redistribute this software so long as it is not sold for profit, provided
  31. |  this copyright notice is retained.
  32. |
  33. |                         Developed for the
  34. |                National Computer Graphics Association
  35. |                         2722 Merrilee Drive
  36. |                         Fairfax, VA  22031
  37. |                           (703) 698-9600
  38. |
  39. |                                by
  40. |                 SimGraphics Engineering Corporation
  41. |                    1137 Huntington Drive  Unit A
  42. |                      South Pasadena, CA  91030
  43. |                           (213) 255-0900
  44. |---------------------------------------------------------------------
  45. |
  46. | Author        :    MJF / SimGraphics Engineering Corportation
  47. |
  48. | File          :    basestat.c
  49. | Date          :    Fri Feb  9 10:46:55 PST 1990
  50. | Project       :    PLB
  51. | Description   :    
  52. |         These functions (eg. do_markertype) will be called by 
  53. |         execute_traverser any time their bif namesake (ie. 
  54. |         MARKER_TYPE) is encountered within a bif verb file or
  55. |         if their bif namesake is encountered within a bif 
  56. |         structure which in encountered within a bif test loop.  
  57. |         These functions should be executed only if the push_level
  58. |         at the time encountered is 0.  The push_level is 
  59. |         incremented each time the traverser begins a called 
  60. |         structure (ie. attributes are pushed), and decremented 
  61. |         each time the traverser returns from  a called structure. 
  62. |
  63. |         If a non-retained structure is open the non-retained 
  64. |         must be closed before proceeding and reopened when 
  65. |         finished.
  66. | Status        :    Version 1.0
  67. |
  68. | Revisions     :    
  69. |    1/90        Various bugs found and solved
  70. |
  71. |       2/90            MFC Tektronix, Inc.: PEX-SI API implementation.
  72. |
  73. |       5/90            MFC Tektronix, Inc.: PEX-SI API Binding change.
  74. |
  75. |      12/90            MFC Tektronix, Inc.: PEX-SI PEX5R1 Release.
  76. |
  77. \*--------------------------------------------------------------------*/
  78.  
  79. /*--------------------------------------------------------------------*\
  80. |    Table of Contents
  81. |
  82. | ifdef USING_PHIGS
  83. |    do_2_generic_i(*BIF_Traverser_state, int, *int,
  84. |                       (*void)(), (*void)(), int)
  85. |        :    Generic integer value basestate update function
  86. |    do_generic_i(*BIF_Traverser_state, int, *int, (*void)(), int)
  87. |        :    Generic integer value basestate update function
  88. |    do_generic_f(*BIF_Traverser_state, int, *int, (*void)(), float)
  89. |        :    Generic float value basestate update function
  90. |    do_generic_c3(*BIF_Traverser_state, *BIF_All, *int, *int, *int,
  91. |            (*void)())
  92. |        :    Generic true color basestate update function
  93. |    do_generic_colorindex(*BIF_Traverser_state, int, *int, *int,
  94. |            *int, (*void)(), int)
  95. |        :    Generic index color basestate update function
  96. | endif USING_PHIGS
  97. |
  98. |    do_markertype(* BIF_Traverser_state, *BIF_All)
  99. |        :    Edit basestate value for this BIF attribute
  100. |    do_markersize(* BIF_Traverser_state, *BIF_All)
  101. |        :    Edit basestate value for this BIF attribute
  102. |    do_markercolorindex(* BIF_Traverser_state, *BIF_All)
  103. |        :    Edit basestate value for this BIF attribute
  104. |    do_linetype(* BIF_Traverser_state, *BIF_All)
  105. |        :    Edit basestate value for this BIF attribute
  106. |    do_linewidth(* BIF_Traverser_state, *BIF_All)
  107. |        :    Edit basestate value for this BIF attribute
  108. |    do_linecolorindex(* BIF_Traverser_state, *BIF_All)
  109. |        :    Edit basestate value for this BIF attribute
  110. |    do_interiorstyle(* BIF_Traverser_state, *BIF_All)
  111. |        :    Edit basestate value for this BIF attribute
  112. |    do_interiorcolorindex(* BIF_Traverser_state, *BIF_All)
  113. |        :    Edit basestate value for this BIF attribute
  114. |    do_interiorshading(* BIF_Traverser_state, *BIF_All)
  115. |        :    Edit basestate value for this BIF attribute
  116. |    do_interiorlighting(* BIF_Traverser_state, *BIF_All)
  117. |        :    Edit basestate value for this BIF attribute
  118. |    do_surfaceproperties(* BIF_Traverser_state, *BIF_All)
  119. |        :    Edit basestate value for this BIF attribute
  120. |    do_edgeflag(* BIF_Traverser_state, *BIF_All)
  121. |        :    Edit basestate value for this BIF attribute
  122. |    do_edgewidth(* BIF_Traverser_state, *BIF_All)
  123. |        :    Edit basestate value for this BIF attribute
  124. |    do_textfont(* BIF_Traverser_state, *BIF_All)
  125. |        :    Edit basestate value for this BIF attribute
  126. |    do_textprec(* BIF_Traverser_state, *BIF_All)
  127. |        :    Edit basestate value for this BIF attribute
  128. |    do_textcolorindex(* BIF_Traverser_state, *BIF_All)
  129. |        :    Edit basestate value for this BIF attribute
  130. |    do_textpath(* BIF_Traverser_state, *BIF_All)
  131. |        :    Edit basestate value for this BIF attribute
  132. |    do_textalign(* BIF_Traverser_state, *BIF_All)
  133. |        :    Edit basestate value for this BIF attribute
  134. |    do_charheight(* BIF_Traverser_state, *BIF_All)
  135. |        :    Edit basestate value for this BIF attribute
  136. |    do_charupvector(* BIF_Traverser_state,
  137. |        :    Edit basestate value for this BIF attribute
  138. |    do_hlhsremoval(* BIF_Traverser_state, *BIF_All)
  139. |        :    Edit basestate value for this BIF attribute
  140. |    do_globaltransformation3(* BIF_Traverser_state,
  141. |        :    Edit basestate value for this BIF attribute
  142. |    do_localtransformation3(* BIF_Traverser_state, *BIF_All)
  143. |        :    Edit basestate value for this BIF attribute
  144. |    do_applytoglobal3(* BIF_Traverser_state, *BIF_All)
  145. |        :    Edit basestate value for this BIF attribute
  146. |    do_applytolocal3(* BIF_Traverser_state, *BIF_All)
  147. |        :    Edit basestate value for this BIF attribute
  148. |    do_interiorcolor(* BIF_Traverser_state, *BIF_All)
  149. |        :    Edit basestate value for this BIF attribute
  150. |    do_markercolor(* BIF_Traverser_state, *BIF_All)
  151. |        :    Edit basestate value for this BIF attribute
  152. |    do_linecolor(* BIF_Traverser_state, *BIF_All)
  153. |        :    Edit basestate value for this BIF attribute
  154. |    do_textcolor(* BIF_Traverser_state, *BIF_All)
  155. |        :    Edit basestate value for this BIF attribute
  156. |    do_backfaceinteriorcolor(* BIF_Traverser_state, *BIF_All)
  157. |        :    Edit basestate value for this BIF attribute
  158. |    do_edgecolor(* BIF_Traverser_state, *BIF_All)
  159. |        :    Edit basestate value for this BIF attribute
  160. |    do_annotextstyle(* BIF_Traverser_state, *BIF_All)
  161. |        :    Edit basestate value for this BIF attribute
  162. |    do_backfaceinteriorcolorindex( * BIF_Traverser_state, *BIF_All)
  163. |        :    Edit basestate value for this BIF attribute
  164. |    do_annotextcharheight(* BIF_Traverser_state, *BIF_All)
  165. |        :    Edit basestate value for this BIF attribute
  166. |    do_charexp(* BIF_Traverser_state, *BIF_All)
  167. |        :    Edit basestate value for this BIF attribute
  168. |    do_charspace(* BIF_Traverser_state, *BIF_All)
  169. |        :    Edit basestate value for this BIF attribute
  170. |    do_depthcueindex(* BIF_Traverser_state, *BIF_All)
  171. |        :    Edit basestate value for this BIF attribute
  172. |    do_edgecolorindex(* BIF_Traverser_state, *BIF_All)
  173. |        :    Edit basestate value for this BIF attribute
  174. |    do_edgetype(* BIF_Traverser_state, *BIF_All)
  175. |        :    Edit basestate value for this BIF attribute
  176. |    do_interiorpatternindex(* BIF_Traverser_state, *BIF_All)
  177. |        :    Edit basestate value for this BIF attribute
  178. |    do_lineshading(* BIF_Traverser_state, *BIF_All)
  179. |        :    Edit basestate value for this BIF attribute
  180. |    do_annotextcharupvector(* BIF_Traverser_state, *BIF_All)
  181. |        :    Edit basestate value for this BIF attribute
  182. |    do_backfaceprocessing(* BIF_Traverser_state, *BIF_All)
  183. |        :    Edit basestate value for this BIF attribute
  184. |    do_backfaceproperties(* BIF_Traverser_state, *BIF_All)
  185. |        :    Edit basestate value for this BIF attribute
  186. |    do_lightstate(* BIF_Traverser_state, *BIF_All)
  187. |        :    Edit basestate value for this BIF attribute
  188. |    do_activeview(* BIF_Traverser_state, *BIF_All)
  189. |        :    Edit basestate value for this BIF attribute
  190. |    void init_base_state(int, int) 
  191. |        :    Set up the base_state structure. 
  192. |
  193. \*--------------------------------------------------------------------*/
  194.  
  195. /*--------------------------------------------------------------------*\
  196. |Include files  
  197. \*--------------------------------------------------------------------*/
  198. #include <stdio.h>
  199. #include "biftypes.h"
  200. #include "bifmacro.h"
  201. #include "globals.h"
  202. #include "ph_map.h"
  203.  
  204.  
  205. /*----------------------------------------------------------------------*\
  206. |Local #define
  207. \*----------------------------------------------------------------------*/
  208. #ifndef FALSE
  209. #define FALSE 0
  210. #endif
  211. #ifndef TRUE
  212. #define TRUE (!FALSE)
  213. #endif
  214.  
  215. #define BBS_PSVWI    1         /* Set base active view        */
  216. #define BBS_PSCHH    2         /* char_height            */
  217. #define BBS_PSCHUP   3         /* char_up_vector         */
  218. #define BBS_PSEDCI   4        /* edge_color_index        */
  219. #define BBS_PSEDFG   5         /* edge_flag            */
  220. #define BBS_PSEWSC   6         /* edge_width            */
  221. #define BBS_PSGLT3   7         /* global_transformation3    */
  222. #define BBS_PXSZBM   8         /* hlhs_removal            */
  223. #define BBS_PSICI    9         /* interior_color_index        */
  224. #define BBS_PSIRE   10         /* interior_lighting        */
  225. #define BBS_PSISM   11         /* interior_shading        */
  226. #define BBS_FPSBFCI 12        /* backface_interior_color_index*/
  227. #define BBS_PSPLCI  13         /* line_color_index        */
  228. #define BBS_PSLN    14         /* line_type            */
  229. #define BBS_PSLWSC  15         /* line_width            */
  230. #define BBS_PSLOT3  16         /* local_transformation3    */
  231. #define BBS_PSPMCI  17         /* marker_color_index        */
  232. #define BBS_PSMKSC  18         /* marker_size            */
  233. #define BBS_PSMK    19         /* marker_type            */
  234. #define BBS_PSAP    20         /* surface_properties        */
  235. #define BBS_PSTXAL  21         /* text_align            */
  236. #define BBS_PSTXCI  22         /* text_color_index        */
  237. #define BBS_PSTXFN  23         /* text_font            */
  238. #define BBS_PSTXP   24         /* text_path            */
  239. #define BBS_PSTXPR  25         /* text_prec            */
  240. #define BBS_PSIS    26        /* interior_style        */
  241. #define BBS_PSICO   27        /* interior_color        */
  242. #define BBS_PSPLCO  28        /* marker_color            */
  243. #define BBS_PSPMCO  29        /* line_color            */
  244. #define BBS_PSTXCO  30        /* text_color            */
  245. #define BBS_FPSBFIC 31        /* backface_interior_color    */
  246. #define BBS_PSECO   32        /* edge_color            */
  247. #define BBS_PSANS   33        /*                */
  248. #define BBS_PSATCH  34        /*                */
  249. #define BBS_PSCHXP  35        /*                */
  250. #define BBS_PSCHSP  36        /*                */
  251. #define BBS_PSDCI   37        /*                */
  252. #define BBS_PSEDT   38        /*                */
  253. #define BBS_FPSIPI  39        /*                */
  254. #define BBS_PSPLSM  40        /*                */
  255. #define BBS_PSATCHUP  41    /*                */
  256. #define BBS_FPBFPR  42        /*                */
  257. #define BBS_FPBFP   43        /*                */
  258. #define BBS_PSLSS   44         /* light_state            */
  259. #define BBS_END     45         /* end of base state        */
  260.  
  261.  
  262. #define   DEFAULT_AL3_CONCATTYPE         BIF_REPLACE
  263. #define   DEFAULT_AL3matrix               identityMatrix
  264. #define   DEFAULT_ANNOTCHUPV_X           0.0
  265. #define   DEFAULT_ANNOTCHUPV_Y           1.0
  266. #define   DEFAULT_ANNOTEXTCHARHEIGHT           0.01
  267. #define   DEFAULT_ANNOTEXTSTYLE         1
  268. #define   DEFAULT_ATG3matrix             identityMatrix
  269. #define   DEFAULT_BACKFACEINTERIORCOLORINDEX       1
  270. #define   DEFAULT_BACKFACEP_CULLF           0
  271. #define   DEFAULT_BACKFACEP_IDENTIFYF       0
  272. #define   DEFAULT_CHAREXP               1.0
  273. #define   DEFAULT_CHARHEIGHT               0.01
  274. #define   DEFAULT_CHARSPACE               0
  275. #define   DEFAULT_CHARUPCLASS_VEC_X           0.0
  276. #define   DEFAULT_CHARUPCLASS_VEC_Y           1.0
  277. #define   DEFAULT_COLORMODEL            BIF_RGB
  278. #define   DEFAULT_DEPTHCUEINDEX           0
  279. #define   DEFAULT_EDGECOLORINDEX           1
  280. #define   DEFAULT_EDGEFLAG               BIF_OFF
  281. #define   DEFAULT_EDGETYPE               1
  282. #define   DEFAULT_EDGEWIDTH               1.0
  283. #define   DEFAULT_GT3matrix               identityMatrix
  284. #define   DEFAULT_HLHSREMOVAL           BIF_HLHS_DISABLE
  285. #define   DEFAULT_INTERIORCOLORINDEX           1
  286. #define   DEFAULT_INTERIORLIGHTING           1
  287. #define   DEFAULT_INTERIORPATTERNINDEX       1
  288. #define   DEFAULT_INTERIORSHADING           1
  289. #define   DEFAULT_INTERIORSTYLE           BIF_HOLLOW
  290. #define   DEFAULT_LINECOLORINDEX           1
  291. #define   DEFAULT_LINESHADING           0
  292. #define   DEFAULT_LINETYPE               1
  293. #define   DEFAULT_LINEWIDTH               1.0
  294. #define   DEFAULT_LT3_CONCATTYPE           BIF_REPLACE
  295. #define   DEFAULT_LT3matrix               identityMatrix
  296. #define   DEFAULT_MARKERCOLORINDEX           1
  297. #define   DEFAULT_MARKERSIZE               1.0
  298. #define   DEFAULT_MARKERTYPE               3
  299. #define   DEFAULT_SP_AMBIENT               0.2
  300. #define   DEFAULT_SP_COLOR_MODEL           BIF_RGB
  301. #define   DEFAULT_SP_DEFFUSE               0.8
  302. #define   DEFAULT_SP_HIGHLIGHT           0.0
  303. #define   DEFAULT_SP_SPECULAR           0.0
  304. #define   DEFAULT_SP_SPEC_COLOR1          1.0
  305. #define   DEFAULT_SP_SPEC_COLOR2          1.0
  306. #define   DEFAULT_SP_SPEC_COLOR3          1.0
  307. #define   DEFAULT_SP_TRANSPARENCY          1.0
  308. #define   DEFAULT_TEXTALIGN_H           0
  309. #define   DEFAULT_TEXTALIGN_V           0
  310. #define   DEFAULT_TEXTCOLORINDEX           1
  311. #define   DEFAULT_TEXTFONT               1
  312. #define   DEFAULT_TEXTPATH               1
  313. #define   DEFAULT_TEXTPREC             BIF_STRING
  314. /* We don't allow for a default COLOR TRIPLET 'cause PHIGS don't like it! */
  315. #define   DEFAULT_TRUEC1             -1.0
  316. #define   DEFAULT_TRUEC2             -1.0
  317. #define   DEFAULT_TRUEC3             -1.0
  318. #define   DEFAULT_VIEWINDEX             0
  319.  
  320. /*--------------------------------------------------------------------*\
  321. |    Static Variables
  322. \*--------------------------------------------------------------------*/
  323. static matrix4 identityMatrix = 
  324. {
  325.     1., 0., 0., 0.,
  326.     0., 1., 0., 0.,
  327.     0., 0., 1., 0.,
  328.     0., 0., 0., 1.
  329. };
  330.  
  331. /*--------------------------------------------------------------------*\
  332. | BEGIN PROCEDURE CODE
  333. \*--------------------------------------------------------------------*/
  334.  
  335. /*--------------------------------------------------------------------*\
  336. | Local Utility Functions
  337. \*--------------------------------------------------------------------*/
  338. #ifdef USING_PHIGS
  339. /*--------------------------------------------------------------------*\
  340. | Procedure     :    do_2_generic_i(*BIF_Traverser_state, int, *int, 
  341. |                    (*void)(), (*void)(), int)
  342. |---------------------------------------------------------------------
  343. | Description   :    Generic integer value basestate update function
  344. |                       to support two calls per value
  345. |---------------------------------------------------------------------
  346. | Return        :    None.
  347. \*--------------------------------------------------------------------*/
  348. do_2_generic_i(traverser_state,inew_value,label,figs1_call,figs2_call,idefault)
  349. BIF_Traverser_state *traverser_state;
  350. int    inew_value;
  351. int    label;
  352. void    (*figs1_call)(),(*figs2_call)();
  353. int    idefault;
  354.  
  355. {/* do_2_generic_i */
  356.     int next_label; 
  357.   
  358.     if (traverser_state->push_level == 0) {
  359.         next_label = label + 1; 
  360.         if (traverser_state->nrs_state)  fxclns();
  361.         popen_struct((Pint)base_state_stid); 
  362.  
  363.         pset_elem_ptr((Pint)0);
  364.         pdel_elems_labels((Pint)label,(Pint)next_label); 
  365.         if ( inew_value != idefault ) {
  366.         (*figs1_call)((Pint)inew_value); 
  367.             (*figs2_call)((Pint)inew_value);
  368.         }
  369.  
  370.         pclose_struct(); 
  371.         if (traverser_state->nrs_state)  fxopns(); 
  372.     }
  373. }/* do_2_generic_i */
  374.  
  375. /*--------------------------------------------------------------------*\
  376. | Procedure     :    do_generic_i(*BIF_Traverser_state, int, *int, 
  377. |                    (*void)(), int)
  378. |---------------------------------------------------------------------
  379. | Description   :    Generic integer value basestate update function
  380. |---------------------------------------------------------------------
  381. | Return        :    None.
  382. \*--------------------------------------------------------------------*/
  383. do_generic_i(traverser_state,inew_value,label,figs_call,idefault)
  384. BIF_Traverser_state *traverser_state;
  385. int    inew_value;
  386. int    label;
  387. void    (*figs_call)();
  388. int    idefault;
  389.  
  390. {/* do_generic_i */
  391.     int next_label; 
  392.   
  393.     if (traverser_state->push_level == 0) {
  394.         next_label = label + 1; 
  395.         if (traverser_state->nrs_state)  fxclns();
  396.         popen_struct((Pint)base_state_stid); 
  397.  
  398.         pset_elem_ptr((Pint)0);
  399.         pdel_elems_labels((Pint)label,(Pint)next_label); 
  400.         if ( inew_value != idefault ) 
  401.         (*figs_call)((Pint)inew_value); 
  402.  
  403.         pclose_struct(); 
  404.         if (traverser_state->nrs_state)  fxopns(); 
  405.     }
  406. }/* do_generic_i */
  407.  
  408. /*--------------------------------------------------------------------*\
  409. | Procedure     :    do_generic_f(*BIF_Traverser_state, int, *int, 
  410. |                    (*void)(), float)
  411. |---------------------------------------------------------------------
  412. | Description   :    Generic float value basestate update function
  413. |---------------------------------------------------------------------
  414. | Return        :    
  415. \*--------------------------------------------------------------------*/
  416. do_generic_f(traverser_state,fnew_value,label,figs_call,fdefault)
  417. BIF_Traverser_state *traverser_state;
  418. float    fnew_value;
  419. int    label;
  420. void    (*figs_call)();
  421. float    fdefault;
  422.  
  423. {
  424.   int next_label; 
  425.   if (traverser_state->push_level == 0) {
  426.     next_label = label + 1; 
  427.     if (traverser_state->nrs_state)  fxclns(); 
  428.     popen_struct((Pint)base_state_stid); 
  429.     pset_elem_ptr((Pint)0);
  430.     pdel_elems_labels((Pint)label,(Pint)next_label); 
  431.     if ( fnew_value != fdefault ) 
  432.       (*figs_call)(fnew_value); 
  433.     pclose_struct(); 
  434.     if (traverser_state->nrs_state)  fxopns(); 
  435.   }
  436. }
  437.  
  438. /*--------------------------------------------------------------------*\
  439. | Procedure     :    do_generic_c3(*BIF_Traverser_state, *BIF_All,
  440. |                    *int, *int, *int, (*void)())
  441. |---------------------------------------------------------------------
  442. | Description   :    Generic true color basestate update function
  443. |---------------------------------------------------------------------
  444. | Return        :    
  445. \*--------------------------------------------------------------------*/
  446. do_generic_c3(traverser_state,entity,label,figs_call)
  447. BIF_Traverser_state *traverser_state;
  448. BIF_All *entity;
  449. int    label;
  450. void    (*figs_call)();
  451.  
  452. {/* do_generic_c3 */
  453.     int next_label,color_model; 
  454.     Pgcolr gcolor;
  455.  
  456.     if (traverser_state->push_level == 0) {
  457.     color_model = entity->truecolor.color_model;
  458.     
  459.     next_label = label + 1; 
  460.     if (traverser_state->nrs_state)  fxclns(); 
  461.     popen_struct((Pint)base_state_stid); 
  462.  
  463.     pset_elem_ptr((Pint)0);
  464.     pdel_elems_labels((Pint)label,(Pint)next_label); 
  465.     /* WORKING: ADD CONVERSIONS FOR DIFFERENT COLOR_MODELS */
  466.     if ( color_model != DEFAULT_COLORMODEL || 
  467.         entity->truecolor.color[0] != DEFAULT_TRUEC1 || 
  468.         entity->truecolor.color[1] != DEFAULT_TRUEC2 || 
  469.         entity->truecolor.color[2] != DEFAULT_TRUEC3) {
  470.       
  471.         gcolor.type = color_model;
  472.         gcolor.val.general.x = (Pfloat)entity->truecolor.color[0];
  473.         gcolor.val.general.y = (Pfloat)entity->truecolor.color[1];
  474.         gcolor.val.general.z = (Pfloat)entity->truecolor.color[2];
  475.         (*figs_call)(&gcolor);
  476.     }
  477.  
  478.     pclose_struct();
  479.  
  480.     if (traverser_state->nrs_state)  fxopns(); 
  481.     }
  482. }/* do_generic_c3 */
  483.  
  484. /*--------------------------------------------------------------------*\
  485. | Procedure     :    do_generic_colorindex(*BIF_Traverser_state, int,
  486. |                *int, *int, *int, (*void)(), int)
  487. |---------------------------------------------------------------------
  488. | Description   :    Generic index color basestate update function
  489. |---------------------------------------------------------------------
  490. | Return        :    
  491. \*--------------------------------------------------------------------*/
  492. do_generic_colorindex(traverser_state,inew_value,label,
  493.             figs_call,idefault)
  494. BIF_Traverser_state *traverser_state;
  495. int    inew_value;
  496. int    label;
  497. void    (*figs_call)();
  498. int    idefault;
  499.  
  500. {/* do_generic_colorindex */
  501.     int next_label; 
  502.     Pgcolr gcolor;
  503.     if (traverser_state->push_level == 0) {
  504.     next_label = label + 1; 
  505.     if (traverser_state->nrs_state)  fxclns(); 
  506.     popen_struct((Pint)base_state_stid); 
  507.  
  508.     pset_elem_ptr((Pint)0);
  509.     pdel_elems_labels((Pint)label,(Pint)next_label); 
  510.     if ( inew_value != idefault ) 
  511.         gcolor.type = PINDIRECT;
  512.         gcolor.val.ind = (Pint)inew_value;
  513.         (*figs_call)(&gcolor);
  514.     
  515.     pclose_struct();
  516.     if (traverser_state->nrs_state)  fxopns(); 
  517.     }
  518. }/* do_generic_colorindex */
  519. #endif /* ifdef USING_PHIGS */
  520.  
  521. /*----------------------------------------------------------------------*\
  522. | Procedure     :    do_markertype(* BIF_Traverser_state, *BIF_All)
  523. |------------------------------------------------------------------------
  524. | Description   :    Edit basestate value for this BIF attribute
  525. |         Patches the contents of the entity markertype to the
  526. |         phigs base_state structure.  For further details 
  527. |         see the Descriptions block at the top of this file.
  528. |------------------------------------------------------------------------
  529. | Return        :    
  530. \*----------------------------------------------------------------------*/
  531. int do_markertype( traverser_state, entity )
  532. BIF_Traverser_state *traverser_state;
  533. BIF_All *entity;
  534.  
  535. {
  536. #ifdef USING_PHIGS
  537.     do_generic_i(traverser_state,entity->markertype.markertype,
  538.             BBS_PSMK,pset_marker_type, DEFAULT_MARKERTYPE);
  539. #else /* ifdef USING_PHIGS */
  540. #endif /* ifdef USING_PHIGS */
  541.     return(0);
  542. } /* End do_markertype */
  543.  
  544. /*----------------------------------------------------------------------*\
  545. | Procedure     :    do_markersize(* BIF_Traverser_state, *BIF_All)
  546. |------------------------------------------------------------------------
  547. | Description   :    Edit basestate value for this BIF attribute
  548. |         Patches the contents of the entity markersize to the
  549. |         phigs base_state structure.  For further details 
  550. |         see the Descriptions block at the top of this file.
  551. |------------------------------------------------------------------------
  552. | Return        :    
  553. \*----------------------------------------------------------------------*/
  554. int do_markersize( traverser_state, entity )
  555. BIF_Traverser_state *traverser_state;
  556. BIF_All *entity;
  557. {
  558. #ifdef USING_PHIGS
  559.     do_generic_f(traverser_state,entity->markersize.size,
  560.             BBS_PSMKSC,pset_marker_size, DEFAULT_MARKERSIZE);
  561. #else /* ifdef USING_PHIGS */
  562. #endif /* ifdef USING_PHIGS */
  563.     return(0);
  564. } /* End do_markersize */
  565.  
  566. /*----------------------------------------------------------------------*\
  567. | Procedure     :    do_markercolorindex(* BIF_Traverser_state,
  568. |                        *BIF_All)
  569. |------------------------------------------------------------------------
  570. | Description   :    Edit basestate value for this BIF attribute
  571. |         Patches the contents of the entity markercolorindex to 
  572. |         the phigs base_state structure.  For further details 
  573. |         see the Descriptions block at the top of this file.
  574. |------------------------------------------------------------------------
  575. | Return        :    
  576. \*----------------------------------------------------------------------*/
  577. int do_markercolorindex( traverser_state, entity )
  578. BIF_Traverser_state *traverser_state;
  579. BIF_All *entity;
  580. {
  581. #ifdef USING_PHIGS
  582.     do_generic_colorindex(traverser_state,entity->ind.ind,
  583.                   BBS_PSPMCI, pset_marker_colr,
  584.                   DEFAULT_MARKERCOLORINDEX);
  585. #else /* ifdef USING_PHIGS */
  586. #endif /* ifdef USING_PHIGS */
  587.     return(0);
  588. } /* End do_markercolorindex */
  589.  
  590. /*----------------------------------------------------------------------*\
  591. | Procedure     :    do_linetype(* BIF_Traverser_state, *BIF_All)
  592. |------------------------------------------------------------------------
  593. | Description   :    Edit basestate value for this BIF attribute
  594. |         Patches the contents of the entity linetype to the
  595. |         phigs base_state structure.  For further details 
  596. |         see the Descriptions block at the top of this file.
  597. |------------------------------------------------------------------------
  598. | Return        :    
  599. \*----------------------------------------------------------------------*/
  600. int do_linetype( traverser_state, entity )
  601. BIF_Traverser_state *traverser_state;
  602. BIF_All *entity;
  603. {
  604. #ifdef USING_PHIGS
  605.     do_generic_i(traverser_state,entity->linetype.linetype,
  606.             BBS_PSLN,pset_linetype, DEFAULT_LINETYPE);
  607. #else /* ifdef USING_PHIGS */
  608. #endif /* ifdef USING_PHIGS */
  609.     return(0);
  610. } /* End do_linetype */
  611.  
  612. /*----------------------------------------------------------------------*\
  613. | Procedure     :    do_linewidth(* BIF_Traverser_state, *BIF_All)
  614. |------------------------------------------------------------------------
  615. | Description   :    Edit basestate value for this BIF attribute
  616. |         Patches the contents of the entity linewidth to the
  617. |         phigs base_state structure.  For further details 
  618. |         see the Descriptions block at the top of this file.
  619. |------------------------------------------------------------------------
  620. | Return        :    
  621. \*----------------------------------------------------------------------*/
  622. int do_linewidth( traverser_state, entity )
  623. BIF_Traverser_state *traverser_state;
  624. BIF_All *entity;
  625. {
  626. #ifdef USING_PHIGS
  627.     do_generic_f(traverser_state,entity->linewidth.width,
  628.             BBS_PSLWSC,pset_linewidth, DEFAULT_LINEWIDTH);
  629. #else /* ifdef USING_PHIGS */
  630. #endif /* ifdef USING_PHIGS */
  631.     return(0);
  632. } /* End do_linewidth */
  633.  
  634. /*----------------------------------------------------------------------*\
  635. | Procedure     :    do_linecolorindex(* BIF_Traverser_state,
  636. |                        *BIF_All)
  637. |------------------------------------------------------------------------
  638. | Description   :    Edit basestate value for this BIF attribute
  639. |         Patches the contents of the entity linecolorindex to the
  640. |         phigs base_state structure.  For further details 
  641. |         see the Descriptions block at the top of this file.
  642. |------------------------------------------------------------------------
  643. | Return        :    
  644. \*----------------------------------------------------------------------*/
  645. int do_linecolorindex( traverser_state, entity )
  646. BIF_Traverser_state *traverser_state;
  647. BIF_All *entity;
  648. {
  649. #ifdef USING_PHIGS
  650.     do_generic_colorindex(traverser_state,entity->ind.ind,
  651.                   BBS_PSPLCI, pset_line_colr,
  652.                   DEFAULT_LINECOLORINDEX);
  653. #else /* ifdef USING_PHIGS */
  654. #endif /* ifdef USING_PHIGS */
  655.     return(0);
  656. } /* End do_linecolorindex */
  657.  
  658. /*----------------------------------------------------------------------*\
  659. | Procedure     :    do_interiorstyle(* BIF_Traverser_state,
  660. |                        *BIF_All)
  661. |------------------------------------------------------------------------
  662. | Description   :    Edit basestate value for this BIF attribute
  663. |         Patches the contents of the entity interiorcolorindex to 
  664. |         the phigs base_state structure.  For further details 
  665. |         see the Descriptions block at the top of this file.
  666. |------------------------------------------------------------------------
  667. | Return        :    
  668. \*----------------------------------------------------------------------*/
  669. int do_interiorstyle( traverser_state, entity )
  670. BIF_Traverser_state *traverser_state;
  671. BIF_All *entity;
  672. {
  673. #ifdef USING_PHIGS
  674.     /* Do back interior style also */
  675.     do_2_generic_i(traverser_state,entity->interiorstyle.ind,
  676.                BBS_PSIS,pset_int_style,
  677.                pset_back_int_style,
  678.                DEFAULT_INTERIORSTYLE);
  679. #else /* ifdef USING_PHIGS */
  680. #endif /* ifdef USING_PHIGS */
  681.     return(0);
  682. } /* End do_interiorstyle */
  683.  
  684. /*----------------------------------------------------------------------*\
  685. | Procedure     :    do_interiorcolorindex(* BIF_Traverser_state,
  686. |                        *BIF_All)
  687. |------------------------------------------------------------------------
  688. | Description   :    Edit basestate value for this BIF attribute
  689. |         Patches the contents of the entity interiorcolorindex to 
  690. |         the phigs base_state structure.  For further details 
  691. |         see the Descriptions block at the top of this file.
  692. |------------------------------------------------------------------------
  693. | Return        :    
  694. \*----------------------------------------------------------------------*/
  695. int do_interiorcolorindex( traverser_state, entity )
  696. BIF_Traverser_state *traverser_state;
  697. BIF_All *entity;
  698. {
  699. #ifdef USING_PHIGS
  700.     do_generic_colorindex(traverser_state,entity->ind.ind,
  701.                   BBS_PSICI, pset_int_colr,
  702.                   DEFAULT_INTERIORCOLORINDEX);
  703. #else /* ifdef USING_PHIGS */
  704. #endif /* ifdef USING_PHIGS */
  705.     return(0);
  706. } /* End do_interiorcolorindex */
  707.  
  708. /*----------------------------------------------------------------------*\
  709. | Procedure     :    do_interiorshading(* BIF_Traverser_state,
  710. |                        *BIF_All)
  711. |------------------------------------------------------------------------
  712. | Description   :    Edit basestate value for this BIF attribute
  713. |         Patches the contents of the entity interiorshading
  714. |    to the phigs base_state structure.  For further details 
  715. |    see the Descriptions block at the top of this file.
  716. |------------------------------------------------------------------------
  717. | Return        :    
  718. \*----------------------------------------------------------------------*/
  719. int do_interiorshading( traverser_state, entity )
  720. BIF_Traverser_state *traverser_state;
  721. BIF_All *entity;
  722. {
  723. #ifdef USING_PHIGS
  724.     /* Do back interior shading also */
  725.     do_2_generic_i(traverser_state,entity->interiorshading.meth,
  726.                BBS_PSISM,pset_int_shad_meth,
  727.                pset_back_int_shad_meth,
  728.                DEFAULT_INTERIORSHADING);
  729. #else /* ifdef USING_PHIGS */
  730. #endif /* ifdef USING_PHIGS */
  731.     return(0);
  732. } /* End do_interiorshading */
  733.  
  734. /*----------------------------------------------------------------------*\
  735. | Procedure     :    do_interiorlighting(* BIF_Traverser_state,
  736. |                        *BIF_All)
  737. |------------------------------------------------------------------------
  738. | Description   :    Edit basestate value for this BIF attribute
  739. |         Patches the contents of the entity interiorlighting to 
  740. |         the phigs base_state structure.  For further details 
  741. |         see the Descriptions block at the top of this file.
  742. |------------------------------------------------------------------------
  743. | Return        :    
  744. \*----------------------------------------------------------------------*/
  745. int do_interiorlighting( traverser_state, entity )
  746. BIF_Traverser_state *traverser_state;
  747. BIF_All *entity;
  748. {
  749. #ifdef USING_PHIGS
  750.     /* Do back interior lighting also */
  751.     do_2_generic_i(traverser_state,entity->interiorlighting.equation,
  752.                BBS_PSIRE,pset_refl_eqn,
  753.                pset_back_refl_eqn,
  754.                DEFAULT_INTERIORLIGHTING);
  755. #else /* ifdef USING_PHIGS */
  756. #endif /* ifdef USING_PHIGS */
  757.     return(0);
  758. } /* End do_interiorlighting */
  759.  
  760. /*----------------------------------------------------------------------*\
  761. | Procedure     :    do_surfaceproperties(* BIF_Traverser_state,
  762. |                        *BIF_All)
  763. |------------------------------------------------------------------------
  764. | Description   :    Edit basestate value for this BIF attribute
  765. |         Patches the contents of the entity surfaceproperties to
  766. |         the phigs base_state structure.  For further details 
  767. |         see the Descriptions block at the top of this file.
  768. |------------------------------------------------------------------------
  769. | Return        :    
  770. \*----------------------------------------------------------------------*/
  771. int do_surfaceproperties( traverser_state, entity )
  772. BIF_Traverser_state *traverser_state;
  773. BIF_All *entity;
  774. {
  775.     float ambient, diffuse, specular;
  776.     int color_model;
  777.     float specular_color[3]; /* Specular color components */
  778.     float highlight, transparency;
  779.     int next_label;
  780.  
  781. #ifdef USING_PHIGS
  782.     if (traverser_state->push_level == 0) {
  783.     ambient = entity->surfaceproperties.props.ambient_coef;
  784.     diffuse = entity->surfaceproperties.props.diffuse_coef;
  785.     specular = entity->surfaceproperties.props.specular_coef;
  786.     color_model =
  787.         entity->surfaceproperties.props.specular_colr.type;
  788.     switch (color_model) {
  789.       case PINDIRECT:
  790.         specular_color[0] = 
  791.         (float)entity->surfaceproperties.props.specular_colr.val.ind;
  792.         break;
  793.       default:
  794.         specular_color[0] = 
  795.         entity->surfaceproperties.props.specular_colr.val.general.x;
  796.         specular_color[1] = 
  797.         entity->surfaceproperties.props.specular_colr.val.general.y;
  798.         specular_color[2] = 
  799.         entity->surfaceproperties.props.specular_colr.val.general.z;
  800.         break;
  801.     }
  802.     highlight = entity->surfaceproperties.props.specular_exp;
  803.     transparency = 0.0;
  804.  
  805.     next_label = BBS_PSAP + 1;
  806.     if (traverser_state->nrs_state)  fxclns();
  807.     popen_struct((Pint)base_state_stid);
  808.  
  809.     pset_elem_ptr((Pint)0);
  810.     pdel_elems_labels((Pint)BBS_PSAP,(Pint)next_label); 
  811.  
  812. #ifdef TEMPOUT
  813.     if ( ambient != DEFAULT_SP_AMBIENT ||
  814.         diffuse  != DEFAULT_SP_DEFFUSE ||
  815.         specular != DEFAULT_SP_SPECULAR ||
  816.         color_model != DEFAULT_SP_COLOR_MODEL ||
  817.         specular_color[0] != DEFAULT_SP_SPEC_COLOR1 ||
  818.         specular_color[1] != DEFAULT_SP_SPEC_COLOR2 ||
  819.         specular_color[2] != DEFAULT_SP_SPEC_COLOR3 ||
  820.         highlight != DEFAULT_SP_HIGHLIGHT ||
  821.         transparency != DEFAULT_SP_TRANSPARENCY
  822.         )
  823. #endif
  824.         pset_refl_props((Prefl_props *)&entity->surfaceproperties.props);
  825.  
  826.     pclose_struct();
  827.     if (traverser_state->nrs_state)  fxopns();
  828.     }
  829. #else /* ifdef USING_PHIGS */
  830. #endif /* ifdef USING_PHIGS */
  831.   return(0);
  832. } /* End do_surfaceproperties */
  833.  
  834. /*----------------------------------------------------------------------*\
  835. | Procedure     :    do_edgeflag(* BIF_Traverser_state, *BIF_All)
  836. |------------------------------------------------------------------------
  837. | Description   :    Edit basestate value for this BIF attribute
  838. |         Patches the contents of the entity edgeflag to the
  839. |         phigs base_state structure.  For further details 
  840. |         see the Descriptions block at the top of this file.
  841. |------------------------------------------------------------------------
  842. | Return        :    
  843. \*----------------------------------------------------------------------*/
  844. int do_edgeflag( traverser_state, entity )
  845. BIF_Traverser_state *traverser_state;
  846. BIF_All *entity;
  847. {
  848. #ifdef USING_PHIGS
  849.     do_generic_i(traverser_state,entity->edgeflag.edge_flag,
  850.             BBS_PSEDFG,pset_edge_flag, DEFAULT_EDGEFLAG);
  851. #else /* ifdef USING_PHIGS */
  852. #endif /* ifdef USING_PHIGS */
  853.     return(0);
  854. } /* End do_edgeflag */
  855.  
  856. /*----------------------------------------------------------------------*\
  857. | Procedure     :    do_edgewidth(* BIF_Traverser_state, *BIF_All)
  858. |------------------------------------------------------------------------
  859. | Description   :    Edit basestate value for this BIF attribute
  860. |         Patches the contents of the entity edgewidth to the
  861. |         phigs base_state structure.  For further details 
  862. |         see the Descriptions block at the top of this file.
  863. |------------------------------------------------------------------------
  864. | Return        :    
  865. \*----------------------------------------------------------------------*/
  866. int do_edgewidth( traverser_state, entity )
  867. BIF_Traverser_state *traverser_state;
  868. BIF_All *entity;
  869. {
  870. #ifdef USING_PHIGS
  871.     do_generic_f(traverser_state,entity->edgewidth.scale,
  872.             BBS_PSEWSC,pset_edgewidth, DEFAULT_EDGEWIDTH);
  873. #else /* ifdef USING_PHIGS */
  874. #endif /* ifdef USING_PHIGS */
  875.     return(0);
  876. } /* End do_edgewidth */
  877.  
  878. /*----------------------------------------------------------------------*\
  879. | Procedure     :    do_textfont(* BIF_Traverser_state, *BIF_All)
  880. |------------------------------------------------------------------------
  881. | Description   :    Edit basestate value for this BIF attribute
  882. |         Patches the contents of the entity textfont to the
  883. |         phigs base_state structure.  For further details 
  884. |         see the Descriptions block at the top of this file.
  885. |------------------------------------------------------------------------
  886. | Return        :    
  887. \*----------------------------------------------------------------------*/
  888. int do_textfont( traverser_state, entity )
  889. BIF_Traverser_state *traverser_state;
  890. BIF_All *entity;
  891. {
  892. #ifdef USING_PHIGS
  893.     do_generic_i(traverser_state,entity->textfont.font,
  894.             BBS_PSTXFN,pset_text_font, DEFAULT_TEXTFONT);
  895. #else /* ifdef USING_PHIGS */
  896. #endif /* ifdef USING_PHIGS */
  897.     return(0);
  898. } /* End do_textfont */
  899.  
  900. /*----------------------------------------------------------------------*\
  901. | Procedure     :    do_textprec(* BIF_Traverser_state, *BIF_All)
  902. |------------------------------------------------------------------------
  903. | Description   :    Edit basestate value for this BIF attribute
  904. |         Patches the contents of the entity textprec to the
  905. |         phigs base_state structure.  For further details 
  906. |         see the Descriptions block at the top of this file.
  907. |------------------------------------------------------------------------
  908. | Return        :    
  909. \*----------------------------------------------------------------------*/
  910. int do_textprec( traverser_state, entity )
  911. BIF_Traverser_state *traverser_state;
  912. BIF_All *entity;
  913. {
  914. #ifdef USING_PHIGS
  915.     do_generic_i(traverser_state,entity->textprec.precision,
  916.             BBS_PSTXPR,pset_text_prec, DEFAULT_TEXTPREC);
  917. #else /* ifdef USING_PHIGS */
  918. #endif /* ifdef USING_PHIGS */
  919.     return(0);
  920. } /* End do_textprec */
  921.  
  922. /*----------------------------------------------------------------------*\
  923. | Procedure     :    do_textcolorindex(* BIF_Traverser_state, *BIF_All)
  924. |------------------------------------------------------------------------
  925. | Description   :    Edit basestate value for this BIF attribute
  926. |         Patches the contents of the entity textcolorindex to the
  927. |         phigs base_state structure.  For further details 
  928. |         see the Descriptions block at the top of this file.
  929. |------------------------------------------------------------------------
  930. | Return        :    
  931. \*----------------------------------------------------------------------*/
  932. int do_textcolorindex( traverser_state, entity )
  933. BIF_Traverser_state *traverser_state;
  934. BIF_All *entity;
  935. {
  936. #ifdef USING_PHIGS
  937.     do_generic_colorindex(traverser_state,entity->ind.ind,
  938.                   BBS_PSTXCI, pset_text_colr,
  939.                   DEFAULT_TEXTCOLORINDEX);
  940. #else /* ifdef USING_PHIGS */
  941. #endif /* ifdef USING_PHIGS */
  942.     return(0);
  943. } /* End do_textcolorindex */
  944.  
  945. /*----------------------------------------------------------------------*\
  946. | Procedure     :    do_textpath(* BIF_Traverser_state, *BIF_All)
  947. |------------------------------------------------------------------------
  948. | Description   :    Edit basestate value for this BIF attribute
  949. |         Patches the contents of the entity textpath to the
  950. |         phigs base_state structure.  For further details 
  951. |         see the Descriptions block at the top of this file.
  952. |------------------------------------------------------------------------
  953. | Return        :    
  954. \*----------------------------------------------------------------------*/
  955. int do_textpath( traverser_state, entity )
  956. BIF_Traverser_state *traverser_state;
  957. BIF_All *entity;
  958. {
  959. #ifdef USING_PHIGS
  960.     extern void fxsattxp();
  961.     do_generic_i(traverser_state,entity->textpath.path_list,
  962.             BBS_PSTXP,fxsattxp, DEFAULT_TEXTPATH);
  963. #else /* ifdef USING_PHIGS */
  964. #endif /* ifdef USING_PHIGS */
  965.     return(0);
  966. } /* End do_textpath */
  967.  
  968. /*----------------------------------------------------------------------*\
  969. | Procedure     :    do_textalign(* BIF_Traverser_state, *BIF_All)
  970. |------------------------------------------------------------------------
  971. | Description   :    Edit basestate value for this BIF attribute
  972. |         Patches the contents of the entity textalign to the
  973. |         phigs base_state structure.  For further details 
  974. |         see the Descriptions block at the top of this file.
  975. |------------------------------------------------------------------------
  976. | Return        :    
  977. \*----------------------------------------------------------------------*/
  978. int do_textalign( traverser_state, entity )
  979. BIF_Traverser_state *traverser_state;
  980. BIF_All *entity;
  981. {
  982.   int horizontal_alignment, vertical_alignment;
  983.   int next_label;
  984. #ifdef USING_PHIGS
  985.   if (traverser_state->push_level == 0) {
  986.     next_label = BBS_PSTXAL + 1;
  987.     if (traverser_state->nrs_state)  fxclns();
  988.     horizontal_alignment = (int)entity->textalign.text_align.hor;
  989.     vertical_alignment = (int)entity->textalign.text_align.vert;
  990.     popen_struct((Pint)base_state_stid);
  991.     pset_elem_ptr((Pint)0);
  992.     pdel_elems_labels((Pint)BBS_PSTXAL,(Pint)next_label); 
  993.     if ( horizontal_alignment!= DEFAULT_TEXTALIGN_H || 
  994.     vertical_alignment != DEFAULT_TEXTALIGN_V ) 
  995.       fxsattxal((Ptext_align *)&entity->textalign.text_align);
  996.     pclose_struct();
  997.     if (traverser_state->nrs_state)  fxopns();
  998.   }
  999. #else /* ifdef USING_PHIGS */
  1000. #endif /* ifdef USING_PHIGS */
  1001.     return(0);
  1002. } /* End do_textalign */
  1003.  
  1004. /*----------------------------------------------------------------------*\
  1005. | Procedure     :    do_charheight(* BIF_Traverser_state, *BIF_All)
  1006. |------------------------------------------------------------------------
  1007. | Description   :    Edit basestate value for this BIF attribute
  1008. |         Patches the contents of the entity charheight to the
  1009. |         phigs base_state structure.  For further details 
  1010. |         see the Descriptions block at the top of this file.
  1011. |------------------------------------------------------------------------
  1012. | Return        :    
  1013. \*----------------------------------------------------------------------*/
  1014. int do_charheight( traverser_state, entity )
  1015. BIF_Traverser_state *traverser_state;
  1016. BIF_All *entity;
  1017. {
  1018. #ifdef USING_PHIGS
  1019.     do_generic_f(traverser_state,entity->charheight.height,
  1020.             BBS_PSCHH,pset_char_ht, DEFAULT_CHARHEIGHT);
  1021. #else /* ifdef USING_PHIGS */
  1022. #endif /* ifdef USING_PHIGS */
  1023.     return(0);
  1024. } /* End do_charheight */
  1025.  
  1026. /*----------------------------------------------------------------------*\
  1027. | Procedure     :    do_charupvector(* BIF_Traverser_state,
  1028. *BIF_All)
  1029. |------------------------------------------------------------------------
  1030. | Description   :    Edit basestate value for this BIF attribute
  1031. |         Patches the contents of the entity charupvector to the
  1032. |         phigs base_state structure.  For further details 
  1033. |         see the Descriptions block at the top of this file.
  1034. |------------------------------------------------------------------------
  1035. | Return        :    
  1036. \*----------------------------------------------------------------------*/
  1037. int do_charupvector( traverser_state, entity )
  1038. BIF_Traverser_state *traverser_state;
  1039. BIF_All *entity;
  1040. {
  1041.   float x, y;
  1042.   int next_label;
  1043. #ifdef USING_PHIGS
  1044.   if (traverser_state->push_level == 0) {
  1045.     next_label = BBS_PSCHUP + 1;
  1046.     if (traverser_state->nrs_state)  fxclns();
  1047.     x = entity->charupvector.up_vect.delta_x;
  1048.     y = entity->charupvector.up_vect.delta_y;
  1049.     popen_struct((Pint)base_state_stid); 
  1050.     pset_elem_ptr((Pint)0);
  1051.     pdel_elems_labels((Pint)BBS_PSCHUP,(Pint)next_label); 
  1052.     if ( x != DEFAULT_CHARUPCLASS_VEC_X || 
  1053.     y != DEFAULT_CHARUPCLASS_VEC_Y 
  1054.     ) 
  1055.       pset_char_up_vec((Pvec *)&entity->charupvector.up_vect);
  1056.     pclose_struct();
  1057.     if (traverser_state->nrs_state)  fxopns();
  1058.   }
  1059. #else /* ifdef USING_PHIGS */
  1060. #endif /* ifdef USING_PHIGS */
  1061.     return(0);
  1062. } /* End do_charupvector */
  1063.  
  1064. /*----------------------------------------------------------------------*\
  1065. | Procedure     :    do_hlhsremoval(* BIF_Traverser_state, *BIF_All)
  1066. |------------------------------------------------------------------------
  1067. | Description   :    Edit basestate value for this BIF attribute
  1068. |         Patches the contents of the entity hlhsremoval to the
  1069. |         phigs base_state structure.  For further details 
  1070. |         see the Descriptions block at the top of this file.
  1071. |------------------------------------------------------------------------
  1072. | Return        :    
  1073. \*----------------------------------------------------------------------*/
  1074. int do_hlhsremoval( traverser_state, entity )
  1075. BIF_Traverser_state *traverser_state;
  1076. BIF_All *entity;
  1077. {
  1078. #ifdef USING_PHIGS
  1079.     do_generic_i(traverser_state,entity->hlhsremoval.id,
  1080.             BBS_PXSZBM,pset_hlhsr_id, DEFAULT_HLHSREMOVAL);
  1081. #else /* ifdef USING_PHIGS */
  1082. #endif /* ifdef USING_PHIGS */
  1083.     return(0);
  1084. } /* End do_hlhsremoval */
  1085.  
  1086.  
  1087. /*----------------------------------------------------------------------*\
  1088. | Procedure     :    do_globaltransformation3(* BIF_Traverser_state,
  1089. *BIF_All)
  1090. |------------------------------------------------------------------------
  1091. | Description   :    Edit basestate value for this BIF attribute
  1092. |         Patches the contents of the entity globaltransformation3 
  1093. |         to the phigs base_state structure.  For further details 
  1094. |         see the Descriptions block at the top of this file.
  1095. |------------------------------------------------------------------------
  1096. | Return        :    
  1097. \*----------------------------------------------------------------------*/
  1098. int do_globaltransformation3( traverser_state, entity )
  1099. BIF_Traverser_state *traverser_state;
  1100. BIF_All *entity;
  1101. {
  1102.   float matrix[4][4];
  1103.   int next_label;
  1104. #ifdef USING_PHIGS
  1105.   if (traverser_state->push_level == 0) {
  1106.     next_label = BBS_PSGLT3 + 1;
  1107.     if (traverser_state->nrs_state)  fxclns();
  1108.     Transpose44(entity->globaltransformation3.xform,matrix);
  1109.     popen_struct((Pint)base_state_stid); 
  1110.     pset_elem_ptr((Pint)0);
  1111.     pdel_elems_labels((Pint)BBS_PSGLT3,(Pint)next_label); 
  1112.     if ( !mx_comp(entity->globaltransformation3.xform,DEFAULT_GT3matrix) )
  1113.       pset_global_tran3(matrix);
  1114.     pclose_struct();
  1115.     if (traverser_state->nrs_state)  fxopns();
  1116.   }
  1117. #else /* ifdef USING_PHIGS */
  1118. #endif /* ifdef USING_PHIGS */
  1119.  
  1120.   /*------------------------------------------------------------*\
  1121.   |    Update the data in the traverser_state to reflect this
  1122.   |    matrix operation on G and C.
  1123.   \*------------------------------------------------------------*/
  1124.   /* Global    */
  1125.   copy44f(entity->globaltransformation3.xform,traverser_state->global);
  1126.   /* Composite */
  1127.   mx_mult(traverser_state->local,traverser_state->global,
  1128.       traverser_state->composite);
  1129.   
  1130.   return(0);
  1131. } /* End do_globaltransformation3 */
  1132.  
  1133. /*----------------------------------------------------------------------*\
  1134. | Procedure     :    do_localtransformation3(* BIF_Traverser_state,
  1135. |                        *BIF_All)
  1136. |------------------------------------------------------------------------
  1137. | Description   :    Edit basestate value for this BIF attribute
  1138. |         Patches the contents of the entity localtransformation3 
  1139. |         to the phigs base_state structure.  For further details 
  1140. |         see the Descriptions block at the top of this file.
  1141. |------------------------------------------------------------------------
  1142. | Return        :    
  1143. \*----------------------------------------------------------------------*/
  1144. int do_localtransformation3( traverser_state, entity )
  1145. BIF_Traverser_state *traverser_state;
  1146. BIF_All *entity;
  1147. {
  1148.   float matrix[4][4];
  1149.   int concat_type;
  1150.   int next_label;
  1151.   concat_type = (int)entity->localtransformation3.compose_type;
  1152. #ifdef USING_PHIGS
  1153.   if (traverser_state->push_level == 0) {
  1154.     next_label = BBS_PSLOT3 + 1;
  1155.     if (traverser_state->nrs_state)  fxclns();
  1156.     Transpose44(entity->localtransformation3.xform,matrix);
  1157.     popen_struct((Pint)base_state_stid);
  1158.     pset_elem_ptr((Pint)0);
  1159.     pdel_elems_labels((Pint)BBS_PSLOT3,(Pint)next_label); 
  1160.     if ( !mx_comp(entity->localtransformation3.xform,DEFAULT_LT3matrix) ||
  1161.     concat_type != DEFAULT_LT3_CONCATTYPE 
  1162.     )
  1163.       pset_local_tran3(matrix,concat_type);
  1164.     pclose_struct();
  1165.         if (traverser_state->nrs_state)  fxopns();
  1166.     }
  1167. #else /* ifdef USING_PHIGS */
  1168. #endif /* ifdef USING_PHIGS */
  1169.  
  1170.     /*------------------------------------------------------------*\
  1171.     |    Update the data in the traverser_state to reflect this
  1172.     |    matrix operation on G, L, and C.
  1173.     \*------------------------------------------------------------*/
  1174.     /* Local     */
  1175.     matcat(entity->localtransformation3.xform,
  1176.            traverser_state->local,concat_type);
  1177.     /* Composite */
  1178.     mx_mult(traverser_state->local,traverser_state->global,
  1179.         traverser_state->composite);
  1180.  
  1181.     return(0);
  1182. } /* End do_localtransformation3 */
  1183.  
  1184. /*----------------------------------------------------------------------*\
  1185. | Procedure     :    do_applytoglobal3(* BIF_Traverser_state,
  1186. |                        *BIF_All)
  1187. |------------------------------------------------------------------------
  1188. | Description   :    Edit basestate value for this BIF attribute
  1189. |         Patches the contents of the entity localtransformation3 
  1190. |         to the phigs base_state structure.  For further details 
  1191. |         see the Descriptions block at the top of this file.
  1192. |------------------------------------------------------------------------
  1193. | Return        :    
  1194. \*----------------------------------------------------------------------*/
  1195. int do_applytoglobal3( traverser_state, entity )
  1196. BIF_Traverser_state *traverser_state;
  1197. BIF_All *entity;
  1198. {
  1199.   float matrix[4][4];
  1200.   int matrix_id;
  1201.   int next_label;
  1202.   matrix_id = entity->applytoglobal3.matrix_id;
  1203.  
  1204. #ifdef USING_PHIGS
  1205.   if (traverser_state->nrs_state)  fxclns();
  1206.   Transpose44(matrix_table[matrix_id],matrix);
  1207. #ifdef TEST_PRINT
  1208. #ifdef TEST_PRINT2
  1209.   printf("A2G3: mx_id = %d label = %d\n",matrix_id,
  1210.      entity->applytoglobal3.matrix_label);
  1211.   PRINT_MATRIX44f(matrix);
  1212. #endif /* TEST_PRINT2 */
  1213. #endif /* TEST_PRINT */
  1214.   if (traverser_state->push_level == 0) {
  1215.       next_label = BBS_PSGLT3 + 1;
  1216.       popen_struct((Pint)base_state_stid);
  1217.       pset_elem_ptr((Pint)0);
  1218.       pdel_elems_labels((Pint)BBS_PSGLT3,(Pint)next_label); 
  1219.       if ( !mx_comp(matrix_table[matrix_id],DEFAULT_ATG3matrix))
  1220.     pset_global_tran3(matrix);
  1221.       pclose_struct();
  1222.   }
  1223.  
  1224. #ifdef REFER_STRUCTURE_EXISTS
  1225.     /* Ordinary PHIGs Open */
  1226.   popen_struct((Pint)entity->applytoglobal3.structure_id);
  1227.   pset_elem_ptr((Pint)0);
  1228. #else /* REFER_STRUCTURE_EXISTS */
  1229.     /*------------------------------------------------------------*\
  1230.     |    Using the link list built up by call and execute open
  1231.     |    and shift to the appropriate BIF structure in the 
  1232.     |    expanded PHIGs structures.
  1233.     \*------------------------------------------------------------*/
  1234.   openUsingLinkList(traverser_state->tol);
  1235. #endif /* REFER_STRUCTURE_EXISTS */
  1236.   pset_elem_ptr_label((Pint)entity->applytoglobal3.matrix_label);
  1237.   poffset_elem_ptr((Pint)1);
  1238.   pdel_elem();
  1239.   pset_global_tran3(matrix);
  1240.   pclose_struct();
  1241.   if (traverser_state->nrs_state)  fxopns();
  1242. #else /* ifdef USING_PHIGS */
  1243. #endif /* ifdef USING_PHIGS */
  1244.  
  1245.     /*------------------------------------------------------------*\
  1246.     |    Update the data in the traverser_state to reflect this
  1247.     |    matrix operation on G and C.
  1248.     \*------------------------------------------------------------*/
  1249.   /* Global    */
  1250.   copy44f(matrix_table[matrix_id],traverser_state->global);
  1251.   /* Composite */
  1252.   mx_mult(traverser_state->local,traverser_state->global,
  1253.       traverser_state->composite);
  1254.  
  1255.   return(0);
  1256. } /* End do_applytoglobal3 */
  1257.  
  1258. /*----------------------------------------------------------------------*\
  1259. | Procedure     :    do_applytolocal3(* BIF_Traverser_state,
  1260. |                        *BIF_All)
  1261. |------------------------------------------------------------------------
  1262. | Description   :    Edit basestate value for this BIF attribute
  1263. |         Patches the contents of the entity localtransformation3 
  1264. |         to the phigs base_state structure.  For further details 
  1265. |         see the Descriptions block at the top of this file.
  1266. |------------------------------------------------------------------------
  1267. | Return        :    
  1268. \*----------------------------------------------------------------------*/
  1269. int do_applytolocal3( traverser_state, entity )
  1270. BIF_Traverser_state *traverser_state;
  1271. BIF_All *entity;
  1272. {
  1273.     float matrix[4][4];
  1274.     int matrix_id;
  1275.     int concat_type;
  1276.     int next_label;
  1277.     matrix_id = entity->applytolocal3.matrix_id;
  1278.     concat_type = entity->applytolocal3.concat_type;
  1279. #ifdef USING_PHIGS
  1280.     if (traverser_state->nrs_state)  fxclns();
  1281.     Transpose44(matrix_table[matrix_id],matrix);
  1282. #ifdef TEST_PRINT
  1283. #ifdef TEST_PRINT2
  1284.     printf("A2L3: mx_id = %d concat = %d label = %d\n",matrix_id, concat_type,
  1285.        entity->applytolocal3.matrix_label);
  1286. PRINT_MATRIX44f(matrix);
  1287. #endif /* TEST_PRINT2 */
  1288. #endif /* TEST_PRINT */
  1289.     if (traverser_state->push_level == 0) {
  1290.     next_label = BBS_PSLOT3 + 1;
  1291.     popen_struct((Pint)base_state_stid);
  1292.  
  1293.     pset_elem_ptr((Pint)0);
  1294.     pdel_elems_labels((Pint)BBS_PSLOT3,(Pint)next_label); 
  1295.     if ( !mx_comp(matrix_table[matrix_id],DEFAULT_AL3matrix)||
  1296.         concat_type != DEFAULT_AL3_CONCATTYPE)
  1297.         pset_local_tran3(matrix,concat_type);
  1298.  
  1299.     pclose_struct();
  1300.     }
  1301. /* WORKING: Add the CALL Structure "fancy open" here */
  1302.     
  1303. #ifdef REFER_STRUCTURE_EXISTS
  1304.     /* Ordinary PHIGs Open */
  1305.     popen_struct((Pint)entity->applytolocal3.structure_id);
  1306.  
  1307.     pset_elem_ptr((Pint)0);
  1308. #else /* REFER_STRUCTURE_EXISTS */
  1309.     /*------------------------------------------------------------*\
  1310.     | Using the link list built up by call and execute open
  1311.     | and shift to the appropriate BIF structure in the 
  1312.     | expanded PHIGs structures.
  1313.     \*------------------------------------------------------------*/
  1314.     openUsingLinkList(traverser_state->tol);
  1315. #endif /* REFER_STRUCTURE_EXISTS */
  1316.     pset_elem_ptr_label((Pint)entity->applytolocal3.matrix_label);
  1317.     poffset_elem_ptr((Pint)1);
  1318.     pdel_elem();
  1319.     pset_local_tran3(matrix,concat_type);
  1320.  
  1321.     pclose_struct();
  1322.     if (traverser_state->nrs_state)  fxopns();
  1323. #else /* ifdef USING_PHIGS */
  1324. #endif /* ifdef USING_PHIGS */
  1325.  
  1326.     /*------------------------------------------------------------*\
  1327.     | Update the data in the traverser_state to reflect this
  1328.     | matrix operation on G, L, and C.
  1329.     \*------------------------------------------------------------*/
  1330.     /* Local     */
  1331.     matcat(matrix_table[matrix_id],
  1332.        traverser_state->local,concat_type);
  1333.     /* Composite */
  1334.     mx_mult(traverser_state->local,traverser_state->global,
  1335.         traverser_state->composite);
  1336.  
  1337.   return(0);
  1338. } /* End do_applytolocal3 */
  1339.  
  1340. /*--------------------------------------------------------------------*\
  1341. | Procedure     :    do_interiorcolor(* BIF_Traverser_state,
  1342. |                        *BIF_All)
  1343. |----------------------------------------------------------------------
  1344. | Description   :    Edit basestate value for this BIF attribute
  1345. |         Patches the contents of the entity interiorcolor to the
  1346. |          phigs base_state structure.  For further details 
  1347. |          see the Descriptions block at the top of this file.
  1348. |----------------------------------------------------------------------
  1349. | Return        :    
  1350. \*--------------------------------------------------------------------*/
  1351. int do_interiorcolor( traverser_state, entity )
  1352. BIF_Traverser_state *traverser_state;
  1353. BIF_All *entity;
  1354. {
  1355. #ifdef USING_PHIGS
  1356.     do_generic_c3(traverser_state,entity,BBS_PSICO, pset_int_colr);
  1357. #else /* ifdef USING_PHIGS */
  1358. #endif /* ifdef USING_PHIGS */
  1359.     return(0);
  1360. } /* End do_markertype */
  1361.  
  1362. /*--------------------------------------------------------------------*\
  1363. | Procedure     :    do_markercolor(* BIF_Traverser_state, *BIF_All)
  1364. |----------------------------------------------------------------------
  1365. | Description   :    Edit basestate value for this BIF attribute
  1366. |         Patches the contents of the entity markercolor to the
  1367. |          phigs base_state structure.  For further details 
  1368. |          see the Descriptions block at the top of this file.
  1369. |----------------------------------------------------------------------
  1370. | Return        :    
  1371. \*--------------------------------------------------------------------*/
  1372. int do_markercolor( traverser_state, entity )
  1373. BIF_Traverser_state *traverser_state;
  1374. BIF_All *entity;
  1375. {
  1376. #ifdef USING_PHIGS
  1377.     do_generic_c3(traverser_state,entity,BBS_PSPMCO, pset_marker_colr);
  1378. #else /* ifdef USING_PHIGS */
  1379. #endif /* ifdef USING_PHIGS */
  1380.     return(0);
  1381. } /* End do_markertype */
  1382.  
  1383. /*--------------------------------------------------------------------*\
  1384. | Procedure     :    do_linecolor(* BIF_Traverser_state, *BIF_All)
  1385. |----------------------------------------------------------------------
  1386. | Description   :    Edit basestate value for this BIF attribute
  1387. |         Patches the contents of the entity linecolor to the
  1388. |          phigs base_state structure.  For further details 
  1389. |          see the Descriptions block at the top of this file.
  1390. |----------------------------------------------------------------------
  1391. | Return        :    
  1392. \*--------------------------------------------------------------------*/
  1393. int do_linecolor( traverser_state, entity )
  1394. BIF_Traverser_state *traverser_state;
  1395. BIF_All *entity;
  1396. {
  1397. #ifdef USING_PHIGS
  1398.     do_generic_c3(traverser_state,entity,BBS_PSPLCO, pset_line_colr);
  1399. #else /* ifdef USING_PHIGS */
  1400. #endif /* ifdef USING_PHIGS */
  1401.     return(0);
  1402. } /* End do_markertype */
  1403.  
  1404. /*--------------------------------------------------------------------*\
  1405. | Procedure     :    do_textcolor(* BIF_Traverser_state, *BIF_All)
  1406. |----------------------------------------------------------------------
  1407. | Description   :    Edit basestate value for this BIF attribute
  1408. |         Patches the contents of the entity textcolor to the
  1409. |          phigs base_state structure.  For further details 
  1410. |          see the Descriptions block at the top of this file.
  1411. |----------------------------------------------------------------------
  1412. | Return        :    
  1413. \*--------------------------------------------------------------------*/
  1414. int do_textcolor( traverser_state, entity )
  1415. BIF_Traverser_state *traverser_state;
  1416. BIF_All *entity;
  1417. {
  1418. #ifdef USING_PHIGS
  1419.     do_generic_c3(traverser_state,entity,BBS_PSTXCO, pset_text_colr);
  1420. #else /* ifdef USING_PHIGS */
  1421. #endif /* ifdef USING_PHIGS */
  1422.     return(0);
  1423. } /* End do_markertype */
  1424.  
  1425. /*--------------------------------------------------------------------*\
  1426. | Procedure     :    do_backfaceinteriorcolor(* BIF_Traverser_state,
  1427. |                        *BIF_All)
  1428. |----------------------------------------------------------------------
  1429. | Description   :    Edit basestate value for this BIF attribute
  1430. |         Patches the contents of the entity 
  1431. |          backfaceinteriorcolor to the
  1432. |          phigs base_state structure.  For further details 
  1433. |          see the Descriptions block at the top of this file.
  1434. |----------------------------------------------------------------------
  1435. | Return        :    
  1436. \*--------------------------------------------------------------------*/
  1437. int do_backfaceinteriorcolor( traverser_state, entity )
  1438. BIF_Traverser_state *traverser_state;
  1439. BIF_All *entity;
  1440. {
  1441. #ifdef USING_PHIGS
  1442.     do_generic_c3(traverser_state,entity,BBS_FPSBFIC, pset_back_int_colr);
  1443. #else /* ifdef USING_PHIGS */
  1444. #endif /* ifdef USING_PHIGS */
  1445.     return(0);
  1446. } /* End do_markertype */
  1447.  
  1448. /*--------------------------------------------------------------------*\
  1449. | Procedure     :    do_edgecolor(* BIF_Traverser_state, *BIF_All)
  1450. |----------------------------------------------------------------------
  1451. | Description   :    Edit basestate value for this BIF attribute
  1452. |         Patches the contents of the entity edgecolor to the
  1453. |          phigs base_state structure.  For further details 
  1454. |          see the Descriptions block at the top of this file.
  1455. |----------------------------------------------------------------------
  1456. | Return        :    
  1457. \*--------------------------------------------------------------------*/
  1458. int do_edgecolor( traverser_state, entity )
  1459. BIF_Traverser_state *traverser_state;
  1460. BIF_All *entity;
  1461. {
  1462. #ifdef USING_PHIGS
  1463.     do_generic_c3(traverser_state,entity,BBS_PSECO, pset_edge_colr);
  1464. #else /* ifdef USING_PHIGS */
  1465. #endif /* ifdef USING_PHIGS */
  1466.     return(0);
  1467. } /* End do_markertype */
  1468.  
  1469. /*--------------------------------------------------------------------*\
  1470. | Procedure     :    do_annotextstyle(* BIF_Traverser_state,
  1471. |                        *BIF_All)
  1472. |----------------------------------------------------------------------
  1473. | Description   :    Edit basestate value for this BIF attribute
  1474. |         Patches the contents of the entity annotextstyle to the
  1475. |          phigs base_state structure.  For further details 
  1476. |          see the Descriptions block at the top of this file.
  1477. |----------------------------------------------------------------------
  1478. | Return        :    
  1479. \*--------------------------------------------------------------------*/
  1480. int do_annotextstyle( traverser_state, entity )
  1481. BIF_Traverser_state *traverser_state;
  1482. BIF_All *entity;
  1483. {
  1484. #ifdef USING_PHIGS
  1485.     do_generic_i(traverser_state, entity->ind.ind,
  1486.              BBS_PSANS, pset_anno_style, 
  1487.              DEFAULT_ANNOTEXTSTYLE);
  1488. #else /* ifdef USING_PHIGS */
  1489. #endif /* ifdef USING_PHIGS */
  1490.     return(0);
  1491. } /* End do_annoteststyle */
  1492.  
  1493. /*--------------------------------------------------------------------*\
  1494. | Procedure     :    do_backfaceinteriorcolorindex(
  1495. |                    * BIF_Traverser_state, *BIF_All)
  1496. |----------------------------------------------------------------------
  1497. | Description   :    Edit basestate value for this BIF attribute
  1498. |         Patches the contents of the entity backfaceinteriorcolorindex to the
  1499. |          phigs base_state structure.  For further details 
  1500. |          see the Descriptions block at the top of this file.
  1501. |----------------------------------------------------------------------
  1502. | Return        :    
  1503. \*--------------------------------------------------------------------*/
  1504. int do_backfaceinteriorcolorindex( traverser_state, entity )
  1505. BIF_Traverser_state *traverser_state;
  1506. BIF_All *entity;
  1507. {
  1508. #ifdef USING_PHIGS
  1509.     do_generic_colorindex(traverser_state,entity->ind.ind,
  1510.                   BBS_FPSBFCI, pset_back_int_colr,
  1511.                   DEFAULT_BACKFACEINTERIORCOLORINDEX);
  1512. #else /* ifdef USING_PHIGS */
  1513. #endif /* ifdef USING_PHIGS */
  1514.     return(0);
  1515. } /* End do_backfaceinteriorcolorindex */
  1516.  
  1517. /*--------------------------------------------------------------------*\
  1518. | Procedure     :    do_annotextcharheight(* BIF_Traverser_state,
  1519. |                        *BIF_All)
  1520. |----------------------------------------------------------------------
  1521. | Description   :    Edit basestate value for this BIF attribute
  1522. |         Patches the contents of the entity annotextcharheight to the
  1523. |          phigs base_state structure.  For further details 
  1524. |          see the Descriptions block at the top of this file.
  1525. |----------------------------------------------------------------------
  1526. | Return        :    
  1527. \*--------------------------------------------------------------------*/
  1528. int do_annotextcharheight( traverser_state, entity )
  1529. BIF_Traverser_state *traverser_state;
  1530. BIF_All *entity;
  1531. {
  1532. #ifdef USING_PHIGS
  1533.     do_generic_f(traverser_state,entity->size.size,
  1534.              BBS_PSATCH,pset_anno_char_ht,
  1535.              DEFAULT_ANNOTEXTCHARHEIGHT);
  1536. #else /* ifdef USING_PHIGS */
  1537. #endif /* ifdef USING_PHIGS */
  1538.     return(0);
  1539. } /* End do_annotextcharheight */
  1540.  
  1541. /*--------------------------------------------------------------------*\
  1542. | Procedure     :    do_charexp(* BIF_Traverser_state, *BIF_All)
  1543. |----------------------------------------------------------------------
  1544. | Description   :    Edit basestate value for this BIF attribute
  1545. |         Patches the contents of the entity charexp to the
  1546. |          phigs base_state structure.  For further details 
  1547. |          see the Descriptions block at the top of this file.
  1548. |----------------------------------------------------------------------
  1549. | Return        :    
  1550. \*--------------------------------------------------------------------*/
  1551. int do_charexp( traverser_state, entity )
  1552. BIF_Traverser_state *traverser_state;
  1553. BIF_All *entity;
  1554. {
  1555. #ifdef USING_PHIGS
  1556.     do_generic_f(traverser_state,entity->size.size,
  1557.             BBS_PSCHXP,pset_char_expan, DEFAULT_CHAREXP);
  1558. #else /* ifdef USING_PHIGS */
  1559. #endif /* ifdef USING_PHIGS */
  1560.     return(0);
  1561. } /* End do_charexp */
  1562.  
  1563. /*--------------------------------------------------------------------*\
  1564. | Procedure     :    do_charspace(* BIF_Traverser_state, *BIF_All)
  1565. |----------------------------------------------------------------------
  1566. | Description   :    Edit basestate value for this BIF attribute
  1567. |         Patches the contents of the entity charspace to the
  1568. |          phigs base_state structure.  For further details 
  1569. |          see the Descriptions block at the top of this file.
  1570. |----------------------------------------------------------------------
  1571. | Return        :    
  1572. \*--------------------------------------------------------------------*/
  1573. int do_charspace( traverser_state, entity )
  1574. BIF_Traverser_state *traverser_state;
  1575. BIF_All *entity;
  1576. {
  1577. #ifdef USING_PHIGS
  1578.     do_generic_f(traverser_state,entity->size.size,
  1579.             BBS_PSCHSP,pset_char_space, DEFAULT_CHARSPACE);
  1580. #else /* ifdef USING_PHIGS */
  1581. #endif /* ifdef USING_PHIGS */
  1582.     return(0);
  1583. } /* End do_charspace */
  1584.  
  1585. /*--------------------------------------------------------------------*\
  1586. | Procedure     :    do_depthcueindex(* BIF_Traverser_state,
  1587. |                        *BIF_All)
  1588. |----------------------------------------------------------------------
  1589. | Description   :    Edit basestate value for this BIF attribute
  1590. |         Patches the contents of the entity depthcueindex to the
  1591. |          phigs base_state structure.  For further details 
  1592. |          see the Descriptions block at the top of this file.
  1593. |----------------------------------------------------------------------
  1594. | Return        :    
  1595. \*--------------------------------------------------------------------*/
  1596. int do_depthcueindex( traverser_state, entity )
  1597. BIF_Traverser_state *traverser_state;
  1598. BIF_All *entity;
  1599. {
  1600. #ifdef USING_PHIGS
  1601.     do_generic_i(traverser_state,entity->ind.ind,
  1602.             BBS_PSDCI,pset_dcue_ind, DEFAULT_DEPTHCUEINDEX);
  1603. #else /* ifdef USING_PHIGS */
  1604. #endif /* ifdef USING_PHIGS */
  1605.     return(0);
  1606. } /* End do_depthcueindex */
  1607.  
  1608. /*--------------------------------------------------------------------*\
  1609. | Procedure     :    do_edgecolorindex(* BIF_Traverser_state,
  1610. |                        *BIF_All)
  1611. |----------------------------------------------------------------------
  1612. | Description   :    Edit basestate value for this BIF attribute
  1613. |         Patches the contents of the entity edgecolorindex to the
  1614. |          phigs base_state structure.  For further details 
  1615. |          see the Descriptions block at the top of this file.
  1616. |----------------------------------------------------------------------
  1617. | Return        :    
  1618. \*--------------------------------------------------------------------*/
  1619. int do_edgecolorindex( traverser_state, entity )
  1620. BIF_Traverser_state *traverser_state;
  1621. BIF_All *entity;
  1622. {
  1623. #ifdef USING_PHIGS
  1624.     do_generic_colorindex(traverser_state,entity->ind.ind,
  1625.                   BBS_PSEDCI, pset_edge_colr,
  1626.                   DEFAULT_EDGECOLORINDEX);
  1627. #else /* ifdef USING_PHIGS */
  1628. #endif /* ifdef USING_PHIGS */
  1629.     return(0);
  1630. } /* End do_edgecolorindex */
  1631.  
  1632. /*--------------------------------------------------------------------*\
  1633. | Procedure     :    do_edgetype(* BIF_Traverser_state, *BIF_All)
  1634. |----------------------------------------------------------------------
  1635. | Description   :    Edit basestate value for this BIF attribute
  1636. |         Patches the contents of the entity edgetype to the
  1637. |          phigs base_state structure.  For further details 
  1638. |          see the Descriptions block at the top of this file.
  1639. |----------------------------------------------------------------------
  1640. | Return        :    
  1641. \*--------------------------------------------------------------------*/
  1642. int do_edgetype( traverser_state, entity )
  1643. BIF_Traverser_state *traverser_state;
  1644. BIF_All *entity;
  1645. {
  1646. #ifdef USING_PHIGS
  1647.     do_generic_i(traverser_state,entity->ind.ind,
  1648.             BBS_PSEDT,pset_edgetype, DEFAULT_EDGETYPE);
  1649. #else /* ifdef USING_PHIGS */
  1650. #endif /* ifdef USING_PHIGS */
  1651.     return(0);
  1652. } /* End do_edgetype */
  1653.  
  1654. /*--------------------------------------------------------------------*\
  1655. | Procedure     :    do_interiorpatternindex(* BIF_Traverser_state,
  1656. |                        *BIF_All)
  1657. |----------------------------------------------------------------------
  1658. | Description   :    Edit basestate value for this BIF attribute
  1659. |         Patches the contents of the entity interiorpatternindex to the
  1660. |          phigs base_state structure.  For further details 
  1661. |          see the Descriptions block at the top of this file.
  1662. |----------------------------------------------------------------------
  1663. | Return        :    
  1664. \*--------------------------------------------------------------------*/
  1665. int do_interiorpatternindex( traverser_state, entity )
  1666. BIF_Traverser_state *traverser_state;
  1667. BIF_All *entity;
  1668. {
  1669. #ifdef USING_PHIGS
  1670.     /* Do back interior pattern index also */
  1671.     do_2_generic_i(traverser_state,entity->ind.ind,
  1672.                BBS_FPSIPI,pset_int_style_ind,
  1673.                pset_back_int_style_ind,
  1674.                DEFAULT_INTERIORPATTERNINDEX);
  1675. #else /* ifdef USING_PHIGS */
  1676. #endif /* ifdef USING_PHIGS */
  1677.     return(0);
  1678. } /* End do_interiorpatternindex */
  1679.  
  1680. /*--------------------------------------------------------------------*\
  1681. | Procedure     :    do_lineshading(* BIF_Traverser_state, *BIF_All)
  1682. |----------------------------------------------------------------------
  1683. | Description   :    Edit basestate value for this BIF attribute
  1684. |         Patches the contents of the entity lineshading to the
  1685. |          phigs base_state structure.  For further details 
  1686. |          see the Descriptions block at the top of this file.
  1687. |----------------------------------------------------------------------
  1688. | Return        :    
  1689. \*--------------------------------------------------------------------*/
  1690. int do_lineshading( traverser_state, entity )
  1691. BIF_Traverser_state *traverser_state;
  1692. BIF_All *entity;
  1693. {
  1694. #ifdef USING_PHIGS
  1695.     do_generic_i(traverser_state,entity->ind.ind,
  1696.              BBS_PSPLSM,pset_line_shad_meth,
  1697.              DEFAULT_LINESHADING);
  1698. #else /* ifdef USING_PHIGS */
  1699. #endif /* ifdef USING_PHIGS */
  1700.     return(0);
  1701. } /* End do_lineshading */
  1702.  
  1703. /*--------------------------------------------------------------------*\
  1704. | Procedure     :    do_annotextcharupvector(* BIF_Traverser_state,
  1705. |                        *BIF_All)
  1706. |----------------------------------------------------------------------
  1707. | Description   :    Edit basestate value for this BIF attribute
  1708. |         Patches the contents of the entity annotextcharupvector to the
  1709. |          phigs base_state structure.  For further details 
  1710. |          see the Descriptions block at the top of this file.
  1711. |----------------------------------------------------------------------
  1712. | Return        :    
  1713. \*--------------------------------------------------------------------*/
  1714. int do_annotextcharupvector( traverser_state, entity )
  1715. BIF_Traverser_state *traverser_state;
  1716. BIF_All *entity;
  1717. {
  1718.   float x, y;
  1719.   int next_label;
  1720. #ifdef USING_PHIGS
  1721.   if (traverser_state->push_level == 0) {
  1722.     next_label = BBS_PSATCHUP + 1;
  1723.     if (traverser_state->nrs_state)  fxclns();
  1724.     x = entity->charupvector.up_vect.delta_x;
  1725.     y = entity->charupvector.up_vect.delta_y;
  1726.     popen_struct((Pint)base_state_stid);
  1727.     pset_elem_ptr((Pint)0);
  1728.     pdel_elems_labels((Pint)BBS_PSATCHUP,(Pint)next_label); 
  1729.     if ( x    != DEFAULT_ANNOTCHUPV_X || 
  1730.     y    != DEFAULT_ANNOTCHUPV_Y ) 
  1731.       pset_anno_char_up_vec((Pvec *)&entity->charupvector.up_vect);
  1732.     pclose_struct();
  1733.     if (traverser_state->nrs_state)  fxopns();
  1734.   }
  1735. #else /* ifdef USING_PHIGS */
  1736. #endif /* ifdef USING_PHIGS */
  1737.   return(0);
  1738. } /* End do_annotextcharupvector */
  1739.  
  1740.  
  1741. /*--------------------------------------------------------------------*\
  1742. | Procedure     :    do_backfaceprocessing(* BIF_Traverser_state,
  1743. |                        *BIF_All)
  1744. |----------------------------------------------------------------------
  1745. | Description   :    Edit basestate value for this BIF attribute
  1746. |         Patches the contents of the entity backfaceprocessing to the
  1747. |          phigs base_state structure.  For further details 
  1748. |          see the Descriptions block at the top of this file.
  1749. |----------------------------------------------------------------------
  1750. | Return        :    
  1751. \*--------------------------------------------------------------------*/
  1752. int do_backfaceprocessing ( traverser_state, entity )
  1753. BIF_Traverser_state *traverser_state;
  1754. BIF_All *entity;
  1755. {
  1756.   int next_label;
  1757. #ifdef USING_PHIGS
  1758.   if (traverser_state->push_level == 0) {
  1759.     next_label = BBS_FPBFPR + 1;
  1760.     if (traverser_state->nrs_state)  fxclns();
  1761.     popen_struct((Pint)base_state_stid);
  1762.     pset_elem_ptr((Pint)0);
  1763.     pdel_elems_labels((Pint)BBS_FPBFPR,(Pint)next_label); 
  1764.     if ( (int)(entity->backfaceprocessing.g_mode)
  1765.     != DEFAULT_BACKFACEP_IDENTIFYF || 
  1766.     (int)(entity->backfaceprocessing.cull_mode)
  1767.     != DEFAULT_BACKFACEP_CULLF ) {
  1768.     pset_face_disting_mode(entity->backfaceprocessing.g_mode);
  1769.     pset_face_cull_mode(entity->backfaceprocessing.cull_mode);
  1770.     }
  1771.     pclose_struct();
  1772.     if (traverser_state->nrs_state)  fxopns();
  1773.   }
  1774. #else /* ifdef USING_PHIGS */
  1775. #endif /* ifdef USING_PHIGS */
  1776.     return(0);
  1777. } /* End do_backfaceprocessing */
  1778.  
  1779. /*--------------------------------------------------------------------*\
  1780. | Procedure     :    do_backfaceproperties(* BIF_Traverser_state,
  1781. |                        *BIF_All)
  1782. |----------------------------------------------------------------------
  1783. | Description   :    Edit basestate value for this BIF attribute
  1784. |         Patches the contents of the entity backfaceproperties to the
  1785. |          phigs base_state structure.  For further details 
  1786. |          see the Descriptions block at the top of this file.
  1787. |----------------------------------------------------------------------
  1788. | Return        :    
  1789. \*--------------------------------------------------------------------*/
  1790. int do_backfaceproperties( traverser_state, entity )
  1791. BIF_Traverser_state *traverser_state;
  1792. BIF_All *entity;
  1793. {
  1794.   float ambient, diffuse, specular;
  1795.   int color_model; 
  1796.   float specular_color[3]; /* Specular color components */
  1797.   float highlight, transparency;
  1798.   int next_label;
  1799.  
  1800. #ifdef USING_PHIGS
  1801.   if (traverser_state->push_level == 0) {
  1802.     ambient     = entity->surfaceproperties.props.ambient_coef;
  1803.     diffuse     = entity->surfaceproperties.props.diffuse_coef;
  1804.     specular     = entity->surfaceproperties.props.specular_coef;
  1805.     color_model =
  1806.       entity->surfaceproperties.props.specular_colr.type;
  1807.     switch (color_model) {
  1808.     case PINDIRECT:
  1809.       specular_color[0] = 
  1810.     (float)entity->surfaceproperties.props.specular_colr.val.ind;
  1811.       break;
  1812.     default:
  1813.       specular_color[0] = 
  1814.     (float)entity->surfaceproperties.props.specular_colr.val.general.x;
  1815.       specular_color[1] = 
  1816.     (float)entity->surfaceproperties.props.specular_colr.val.general.y;
  1817.       specular_color[2] = 
  1818.     (float)entity->surfaceproperties.props.specular_colr.val.general.z;
  1819.       break;
  1820.     }
  1821.     highlight      = (float)entity->surfaceproperties.props.specular_exp;
  1822.     transparency = 0.0;
  1823.  
  1824.     next_label = BBS_FPBFP + 1;
  1825.     if (traverser_state->nrs_state)  fxclns();
  1826.     popen_struct((Pint)base_state_stid);
  1827.     pset_elem_ptr((Pint)0);
  1828.     pdel_elems_labels((Pint)BBS_FPBFP,(Pint)next_label); 
  1829.     if (     ambient     !=   DEFAULT_SP_AMBIENT || 
  1830.     diffuse        !=   DEFAULT_SP_DEFFUSE ||
  1831.     specular    !=   DEFAULT_SP_SPECULAR ||
  1832.     color_model    !=   DEFAULT_SP_COLOR_MODEL ||
  1833.     specular_color[0]!=  DEFAULT_SP_SPEC_COLOR1 ||
  1834.     specular_color[1]!=  DEFAULT_SP_SPEC_COLOR2 ||
  1835.     specular_color[2]!=  DEFAULT_SP_SPEC_COLOR3 ||
  1836.     highlight    !=   DEFAULT_SP_HIGHLIGHT ||
  1837.     transparency    !=   DEFAULT_SP_TRANSPARENCY)
  1838.       pset_back_refl_props(&entity->surfaceproperties.props);
  1839.     pclose_struct();
  1840.     if (traverser_state->nrs_state)  fxopns();
  1841.   }
  1842. #else /* ifdef USING_PHIGS */
  1843. #endif /* ifdef USING_PHIGS */
  1844.   return(0);
  1845. } /* End do_backfaceproperties */
  1846.  
  1847.  
  1848. /*----------------------------------------------------------------------*\
  1849. | Procedure     :    do_lightstate(* BIF_Traverser_state, *BIF_All)
  1850. |------------------------------------------------------------------------
  1851. | Description   :    Edit basestate value for this BIF attribute
  1852. |         Patches the contents of the entity lightstate to the
  1853. |         phigs base_state structure.  For further details 
  1854. |         see the Descriptions block at the top of this file.
  1855. |------------------------------------------------------------------------
  1856. | Return        :    
  1857. \*----------------------------------------------------------------------*/
  1858. int do_lightstate( traverser_state, entity )
  1859. BIF_Traverser_state *traverser_state;
  1860. BIF_All *entity;
  1861. {
  1862.     int next_label;
  1863.  
  1864. #ifdef USING_PHIGS
  1865.     if (traverser_state->push_level == 0) {
  1866.     next_label = BBS_PSLSS + 1;
  1867.     if (traverser_state->nrs_state)  fxclns();
  1868.     
  1869. #ifdef EXTERNALNOTE
  1870.  
  1871.     The following block of code has been changed to reflect an error
  1872.     in the original code for the GPC benchmark.
  1873.  
  1874.     The code to update the base state active lights list is redundant 
  1875.     and is no longer needed. The original call to pslss passed the 
  1876.     incorrect light pointers, which is why lighting declared outside
  1877.     the test loop would not work. The corrected pslss needs to be 
  1878.     communicated to all users of the current source code.
  1879. #endif
  1880.  
  1881.  
  1882.     popen_struct((Pint)base_state_stid);
  1883.  
  1884.     pset_elem_ptr((Pint)0);
  1885.     pdel_elems_labels((Pint)BBS_PSLSS,(Pint)next_label); 
  1886.  
  1887.     pset_light_src_state((Pint_list *)&entity->lightstate.activation,
  1888.               (Pint_list *)&entity->lightstate.deactivation);
  1889.  
  1890.     pclose_struct();
  1891.     
  1892.     if (traverser_state->nrs_state)  fxopns();
  1893.     }
  1894. #else /* USING_PHIGS */
  1895. #endif /* USING_PHIGS */
  1896.   return(0);
  1897. } /* End do_lightstate */
  1898.  
  1899. /*----------------------------------------------------------------------*\
  1900. | Procedure     :    do_activeview(* BIF_Traverser_state, *BIF_All)
  1901. |------------------------------------------------------------------------
  1902. | Description   :    Edit basestate value for this BIF attribute
  1903. |------------------------------------------------------------------------
  1904. | Return        :    Error code
  1905. \*----------------------------------------------------------------------*/
  1906. int do_activeview( traverser_state, entity )
  1907. BIF_Traverser_state *traverser_state;
  1908. BIF_All *entity;
  1909. {
  1910.     /* Set this because GET_MATRIX3 needs it */
  1911.     traverser_state->id_active_view = entity->ind.ind;
  1912.  
  1913. #ifdef USING_PHIGS
  1914.     do_generic_i(traverser_state,entity->ind.ind,
  1915.             BBS_PSVWI,pset_view_ind, DEFAULT_VIEWINDEX);
  1916. #else /* ifdef USING_PHIGS */
  1917. #endif /* ifdef USING_PHIGS */
  1918.     /* Return Error Code */
  1919.     return(0);  /* No Error */
  1920. } /* End do_activeview */
  1921.  
  1922.  
  1923. /*----------------------------------------------------------------------*\
  1924. | Procedure     :    void init_base_state(int, int) 
  1925. |--------------------------------------------------------------------------|
  1926. | Description   :    Set up the base_state structure. 
  1927. |    This structure contains all the 
  1928. |    attributes which are allowed outside of bif structures but not 
  1929. |    allowed outside of phigs structures
  1930. |--------------------------------------------------------------------------|
  1931. | Return:                                                                  |
  1932.  \*----------------------------------------------------------------------*/
  1933. /*ARGSUSED*/
  1934. void init_base_state(base_state_stid,base_state_vid)
  1935. int base_state_stid, base_state_vid;
  1936. {
  1937.  
  1938. #ifdef USING_PHIGS
  1939.         Pgcolr gcolr;
  1940.  
  1941.     /* Always use general color which supports indirect and RGB */
  1942.     gcolr.type = PINDIRECT;
  1943.     gcolr.val.ind = 2;
  1944.  
  1945.     /*------------------------------------------------------------*\
  1946.     |    Make the sure the base is empty
  1947.     \*------------------------------------------------------------*/
  1948.     pempty_struct((Pint)base_state_stid);
  1949.  
  1950.  
  1951.     popen_struct((Pint)base_state_stid);
  1952.         plabel((Pint) BBS_PSVWI);  /* Use Default active view    */
  1953.         fxnoop(1);           /*                */
  1954.         plabel((Pint)BBS_PSCHH);   /* char_height        */
  1955.         fxnoop(1);           /* pschh   char_height    */
  1956.         plabel((Pint)BBS_PSCHUP);  /* char_up_vector         */
  1957.         fxnoop(2);           /* pschup  char_up_vector     */
  1958.         plabel((Pint)BBS_PSEDCI);  /* edgecolorindex        */
  1959.         pset_edge_colr(&gcolr);       /*                */
  1960.         plabel((Pint)BBS_PSEDFG);  /* edge_flag            */
  1961.         fxnoop(1);           /* psedfg  edge_flag        */
  1962.         plabel((Pint)BBS_PSEWSC);  /* edge_width        */
  1963.         fxnoop(1);           /* psewsc  edge_width    */
  1964.         plabel((Pint)BBS_PSGLT3);  /* global_transformation3    */
  1965.         fxnoop(16);           /* psgmt3  global_transformation3*/
  1966.         plabel((Pint)BBS_PXSZBM);  /* hlhs_removal        */
  1967.         fxnoop(2);           /* pshir  hlhs_removal    */
  1968.         plabel((Pint)BBS_PSICI);   /* interior_color_index    */
  1969.         pset_int_colr(&gcolr);     /* psici   interior_color_index*/
  1970.             plabel((Pint)BBS_PSIRE);   /* interior_lighting            */
  1971.         fxnoop(2);           /* psilm   interior_lighting    */
  1972.         plabel((Pint)BBS_PSISM);   /* interior_shading        */
  1973.         fxnoop(2);           /* psism   interior_shading    */
  1974.         plabel((Pint)BBS_FPSBFCI); /* backfaceinteriorcolorindex*/
  1975.         pset_back_int_colr(&gcolr); /*                */
  1976.         plabel((Pint)BBS_PSPLCI);  /* line_color_index        */
  1977.         pset_line_colr(&gcolr);       /* psplci  line_color_index    */
  1978.         plabel((Pint)BBS_PSLN);       /* line_type            */
  1979.         fxnoop(1);           /* psln    line_type        */
  1980.         plabel((Pint)BBS_PSLWSC);  /* line_width        */
  1981.         fxnoop(1);           /* pslwsc  line_width    */
  1982.         plabel((Pint)BBS_PSLOT3);  /* local_transformation3     */
  1983.         fxnoop(17);           /* pslmt3  local_transformation3*/
  1984.         plabel((Pint)BBS_PSPMCI);  /* marker_color_index    */
  1985.         pset_marker_colr(&gcolr);  /* pspmci  marker_color_index*/
  1986.         plabel((Pint)BBS_PSMKSC);  /* marker_size        */
  1987.         fxnoop(1);           /* psmksc  marker_size    */
  1988.         plabel((Pint)BBS_PSMK);       /* marker_type        */
  1989.         fxnoop(1);           /* psmk    marker_type    */
  1990.         plabel((Pint)BBS_PSAP);       /* surface_properties    */
  1991.         fxnoop(7);           /* pssp    surface_properties*/
  1992.         plabel((Pint)BBS_PSTXAL);  /* text_align        */
  1993.         fxnoop(2);           /* fxsattxal  text_align    */
  1994.         plabel((Pint)BBS_PSTXCI);  /* text_color_index        */
  1995.         pset_text_colr(&gcolr);       /* pstxci  text_color_index    */
  1996.         plabel((Pint)BBS_PSTXFN);  /* text_font            */
  1997.         fxnoop(1);           /* pstxfn  text_font        */
  1998.         plabel((Pint)BBS_PSTXP);   /* text_path            */
  1999.         fxnoop(1);           /* fxsattxp   text_path    */
  2000.         plabel((Pint)BBS_PSTXPR);  /* text_prec            */
  2001.         fxnoop(1);           /* pstxpr  text_prec        */
  2002.         plabel((Pint)BBS_PSIS);       /* interior_style        */
  2003.         fxnoop(2);           /* psis    interior_style    */
  2004.         plabel((Pint)BBS_PSICO);   /* interior_color        */
  2005.         fxnoop(3);           /*                 */
  2006.         plabel((Pint)BBS_PSPLCO);  /* marker_color        */
  2007.         fxnoop(3);           /*                 */
  2008.         plabel((Pint)BBS_PSPMCO);  /* line_color        */
  2009.         fxnoop(3);           /*                 */
  2010.         plabel((Pint)BBS_PSTXCO);  /* text_color        */
  2011.         fxnoop(3);           /*                 */
  2012.         plabel((Pint)BBS_FPSBFIC); /* do_backfaceinteriorcolor  */
  2013.         fxnoop(1);           /*                     */
  2014.         plabel((Pint)BBS_PSECO);   /* edge_color        */
  2015.         fxnoop(3);           /*                 */
  2016.         plabel((Pint)BBS_PSANS);   /* annotextstyle        */
  2017.         fxnoop(1);           /*                */
  2018.         plabel((Pint)BBS_PSATCH);  /* annotextcharheight    */
  2019.         fxnoop(1);           /*                */
  2020.         plabel((Pint)BBS_PSCHXP);  /* charexp            */
  2021.         fxnoop(1);           /*                */
  2022.         plabel((Pint)BBS_PSCHSP);  /* charspace            */
  2023.         fxnoop(1);           /*                */
  2024.         plabel((Pint)BBS_PSDCI);   /* depthcueindex        */
  2025.         fxnoop(1);           /*                */
  2026.         plabel((Pint)BBS_PSEDT);   /* edgetype            */
  2027.         fxnoop(1);           /*                */
  2028.         plabel((Pint)BBS_FPSIPI);  /* interiorpatternindex    */
  2029.         fxnoop(2);           /*                */
  2030.         plabel((Pint)BBS_PSPLSM);  /* lineshading        */
  2031.         fxnoop(1);           /*                */
  2032.         plabel((Pint)BBS_PSATCHUP);/*                */
  2033.         fxnoop(2);           /*                */
  2034.         plabel((Pint)BBS_FPBFPR);  /*                */
  2035.         fxnoop(1);           /*                */
  2036.         plabel((Pint)BBS_FPBFP);   /*                */
  2037.         fxnoop(7);           /* pssp    surface_properties*/
  2038.         plabel((Pint)BBS_PSLSS);   /* light_state        */ 
  2039.         fxnoop(20);           /* pslss   light_state    */
  2040.  
  2041.         plabel((Pint)BBS_END );       /* end of base state        */
  2042.     pclose_struct();
  2043.     setNextLabel(BBS_END + 1);
  2044. #endif /* USING_PHIGS */
  2045. }
  2046.