/* $XConsortium: fas6.pi,v 5.3 94/04/17 20:48:00 hersh Exp $ */ /***************************************************************** Copyright (c) 1989, 1990, 1991,1990 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. Copyright (c) 1989, 1990, 1991,1990 by Sun Microsystems, Inc. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Sun Microsystems, and the X Consortium, not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ ## fas6.pi - ## Test fill area set bundle attributes ## . interior style ## . interior colour index ## . interior colour ## . edge flag ## . edge colour index ## . edge colour ## . edge width source macro.pi tbegintest("fas6","fill area set bundle attributes"); # initialize: fill area set geometry data, # an interior representation of non-default values # an interior representation PLUS of non-default values # an edge representation of non-default values # and an edge representation PLUS of non-default values fa1 = IA_Ppoint3(3, 0.1,0.1,0.0, 0.3,0.3,0.0, 0.5,0.1,0.0); fa2 = IA_Ppoint3(3, 0.1,0.6,0.0, 0.3,0.8,0.0, 0.5,0.6,0.0); fa3 = IA_Ppoint3(3, 0.6,0.1,0.0, 0.8,0.3,0.0, 1.0,0.1,0.0); fa4 = IA_Ppoint3(3, 0.6,0.6,0.0, 0.8,0.8,0.0, 1.0,0.6,0.0); fset1 = I_Ppoint_list3(3,fa1); fset1_l = I_Ppoint_list_list3(1,&fset1); fset2 = I_Ppoint_list3(3,fa2); fset2_l = I_Ppoint_list_list3(1,&fset2); fset3 = I_Ppoint_list3(3,fa3); fset3_l = I_Ppoint_list_list3(1,&fset3); fset4 = I_Ppoint_list3(3,fa4); fset4_l = I_Ppoint_list_list3(1,&fset4); rep = I_Pint_bundle(PSTYLE_SOLID,1,2); erep = I_Pedge_bundle(PEDGE_ON,PLINE_DOT,4.0,4); gc1 = I_Pgcolr(PMODEL_RGB,1.0,0.0,0.0); exterep = I_Pedge_bundle_plus(PEDGE_ON,PLINE_SOLID,6.0,gc1); gc2 = I_Pgcolr(PMODEL_RGB,1.0,1.0,0.0); areaprops = I_Prefl_props(1.0,1.0,1.0,gc1,1.0,1.0); bareaprops = I_Prefl_props(0.0,0.0,0.0,gc2,0.0,0.0); extrep = I_Pint_bundle_plus(PSTYLE_SOLID,1,gc2,PREFL_AMBIENT,PSD_NONE,areaprops ,PSTYLE_SOLID,2,bgcol,PREFL_AMB_DIFF,PSD_COLOUR,bareaprops ,PSURF_CONSTANT_PARAMETRIC_BETWEEN_KNOTS,5.0,10.0); # setup: open phigs and a workstation, open and post a structure # set interior and edge representation, set interior and edge index to 1 # set interior style to EMPTY i_open_phigs(NULL,PDEF_MEM_SIZE); i_open_x_ws(1,&xdisplay,&xwindow,0,0,200,200); popen_struct(1); ppost_struct(1,1,1.0); pset_int_style(PSTYLE_EMPTY); pset_int_ind(1); pset_edge_ind(1); pset_int_rep(1,1,&rep); pset_edge_rep(1,1,&erep); # draw with bundled edge flag ON # bundled edge type DOT # bundled interior colour index 2 pset_indiv_asf(PASPECT_EDGE_FLAG,PASF_BUNDLED); pset_indiv_asf(PASPECT_EDGETYPE,PASF_BUNDLED); pset_indiv_asf(PASPECT_INT_COLR_IND,PASF_BUNDLED); pfill_area_set3(&fset1_l); # in addition to above bundled attributes # draw with bundled edge width 4.0 pset_indiv_asf(PASPECT_EDGEWIDTH,PASF_BUNDLED); pfill_area_set3(&fset2_l); # in addition to above bundled attributes # bundled interior style SOLID pset_indiv_asf(PASPECT_INT_STYLE,PASF_BUNDLED); pfill_area_set3(&fset3_l); # in addition to above bundled attributes # bundled edge colour index 4 pset_indiv_asf(PASPECT_EDGE_COLR_IND,PASF_BUNDLED); pfill_area_set3(&fset4_l); pclose_struct(); # verify image i_check_image("fas6_1",xdisplay,xwindow,0,0,199,199,"bundled fill area set attributes"); i_pause(); # test PHIGS+ bundle attributes pset_int_rep_plus(1,1,&extrep); pset_edge_rep_plus(1,1,&exterep); # verify image i_check_image("fas6_2",xdisplay,xwindow,0,0,199,199,"PHIGS+ bundled fill area set attributes"); i_pause(); tendtest();