/* include file containing the "define" and types specific to PHIGURE */
#include <phigure.h>
main () {
Pfloat zoom=1.0, circle_radius = 5.0;
Tcircle circle;
static Pint ws_id = 1, scene_id = 10, circle_id = 11, view_ind = 1;
static Plimit viewport ={0.,1., 0., 1.}, domain ={10., 20., 10., 20.};
static Ppoint circle_center = {15., 15.}, view_center = {0.5, 0.5};
static Pint_list struct_id_list = {1, &circle_id};
/* open PHIGURE and an X-Window type workstation (8887) */
topen_phigure (PDEF_ERR_FILE);
topen_ws (ws_id, PDEF_ERR_FILE, 8887);
/* define domain */
tdomain (&domain);
/* build circle */
circle.type = TCENTER_RADIUS;
circle.geometry.cr.r = circle_radius;
circle.geometry.cr.c = circle_center;
tcircle (circle_id, &circle);
/* define scene */
tscene (scene_id, &struct_id_list, view_ind);
/* define a centered 2D view */
tview2_center (ws_id, view_ind, &view_center, zoom, &viewport);
/* display scene on workstation */
ppost_struct (ws_id, scene_id, 1.0);
predraw_all_structs (ws_id, PFLAG_ALWAYS);
/* close workstation and phigure */
tclose_ws (ws_id);
tclose_phigure ();
}
The
following image corresponds to the X-window obtained by executing this program.

Certain window characteristics (such as dimensions and title) are specified in a file read when PHIGURE is opened. This file is called GPHIGS.def by default and is found by PHIGURE in the current program execution directory. To change the name of this configuration file, just call the pxset_conf_file_name function before calling topen_phigure.
e.g.
pxset_conf_file_name ("toto.def");
the configuration file is toto.def in the current execution directory
pxset_conf_file_name ("/users/toto/toto.def");
the configuration file is toto.def in the /users/toto directory