/* $XConsortium: fa1.pi,v 5.2 94/04/17 20:47:53 rws 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. ******************************************************************/ ## fa1.pi - ## Test fill area geometry ## . triangle ## . quadrilateral ## . bowtie ## . self crossing area ## . n vertexes: n = 129 ## Test individual interior attributes: ## . interior style ## . interior colour index source macro.pi tbegintest("fa1","fill area geometry and individual interior attributes"); # initialize: fill areas geometry data pts1 = IA_Ppoint(3, 0.2,0.9, 0.1,0.7, 0.0,0.8); fa_triangle = I_Ppoint_list(3,pts1); pts2 = IA_Ppoint3(4, 0.0,0.7,0.0, 0.0,0.8,0.0, 0.1,0.8,0.0, 0.1,0.7,0.0); fa_square = I_Ppoint_list3(4,pts2); pts3 = IA_Ppoint3(4, 0.3,0.8,0.0, 0.5,0.9,0.0, 0.45,0.8,0.5, 0.3,0.7,0.5); fa_quad = I_Ppoint_list3(4,pts3); pts4 = IA_Ppoint3(4, 0.6,0.9,0.0, 0.8,0.7,0.0, 0.8,0.9,0.0, 0.6,0.7,0.0); fa_bowtie = I_Ppoint_list3(4,pts4); pts5 = IA_Ppoint3(10, 0.0,0.5,0.0, 0.4,0.5,0.0, 0.4,0.2,0.0, 0.1,0.2,0.0, 0.1,0.6,0.0, 0.2,0.6,0.0, 0.2,0.3,0.0, 0.3,0.3,0.0, 0.3,0.4,0.0, 0.0,0.4,0.0); fa_self_cross = I_Ppoint_list3(10,pts5); pts6 = i_generate_n_Ppoint3(129, 0.45,0.35, 0.015); fa_n_vertexes = I_Ppoint_list3(129, pts6); # setup: open phigs and a workstation, open a structure i_open_phigs(NULL,PDEF_MEM_SIZE); i_open_x_ws(1,&xdisplay,&xwindow,0,0,200,200); popen_struct(1); # draw 3D fill areas with interior style SOLID pset_int_style(PSTYLE_SOLID); pfill_area3(&fa_bowtie); pfill_area3(&fa_bowtie); pfill_area3(&fa_self_cross); pfill_area3(&fa_n_vertexes); # draw 2D fill area draw with colour index 2 pset_int_colr_ind(2); pfill_area(&fa_triangle); # draw 3D fill area with colour index 3, interior style HOLLOW pset_int_style(PSTYLE_HOLLOW); pset_int_colr_ind(3); pfill_area3(&fa_quad); # draw 3D fill area with colour index 4, interior style EMPTY pset_int_colr_ind(4); pset_int_style(PSTYLE_EMPTY); pfill_area3(&fa_square); # close and post structure pclose_struct(); ppost_struct(1,1,1.0); # verify image i_check_image("fa1",xdisplay,xwindow,0,0,199,199,"fillarea geometry and individual interior attributes"); im_def_grid(); i_pause(); tendtest();