INITIALIZE LOCATOR 3
CALL SEQUENCE
void pinit_loc3 (ws_id, loc_dev, init_view_index, init_loc_pos, pet, echo_volume, loc_data_rec)
INPUT PARAMETERS
Pint ws_id,
Pint loc_dev,
Pint init_view_index,
const Ppoint3 *init_loc_pos,
Pint pet,
const Plimit3 *echo_volume,
const Ploc_data3 *loc_data_rec
ARGUMENTS
- ws_id,
Workstation identifier
- loc_dev,
Locator device number
- init_view_index,
- Initial view index
- init_loc_pos,
- Initial locator position
- pet,
Prompt and echo type
- echo_volume,
- Echo volume
- loc_data_rec
Data record
TYPES
typedef struct {
Pfloat x; /* x coordinate */
Pfloat y; /* y coordinate */
Pfloat z; /* z coordinate */
} Ppoint3;
typedef struct {
Pfloat x_min; /* minimum x */
Pfloat x_max; /* maximum x */
Pfloat y_min; /* minimum y */
Pfloat y_max; /* maximum y */
Pfloat z_min; /* minimum z */
Pfloat z_max; /* maximum z */
} Plimit3;
typedef struct {
union Ploc3_pets {
struct Ploc3_pet_r1 {
int impl_dep;
} pet_r1;
struct Ploc3_pet_r2 {
int impl_dep;
} pet_r2;
struct Ploc3_pet_r3 {
int impl_dep;
} pet_r3;
struct Ploc3_pet_r4 {
Pline_attrs line_attrs; /* polyline attributes */
} pet_r4;
struct Ploc3_pet_r5 {
Pline_fill_ctrl_flag line_fill_ctrl_flag; /* control flag */
union Ploc3_attrs {
Pline_attrs line_attrs; /* polyline attributes */
Pint_attrs int_attrs; /* interior attributes */
struct Ploc3_fill_set {
Pint_attrs int_attrs; /* interior attributes */
Pedge_attrs edge_attrs; /* edge attributes */
} fill_set;
} attrs;
} pet_r5;
struct Ploc3_pet_r6 {
int impl_dep;
} pet_r6;
} pets;
} Ploc_data3;
PHIGS STATE
(PHOP, WSOP, *, *).
EFFECT
This function initializes the LOCATOR 3 input device (designation of a point in
space) number loc_dev for workstation ws_id.
Devices 1 and 2 are associated with the mouse.
The initial locator position is only used to draw rubber rectangle or rubber
band.
The following echo types are available:
- 1: Hard X-Window cross cursor.
- 2: Crosshair.
- 3: Tracking cross.
- 4: Rubber band.
- 5: Rubber rectangle.
- 6: Digital display of Device Coordinates (DC).
- 0: Digital display of World Coordinates (WC) and view index.
- -2:-3,-4:-5,-6: Same as 2,3,4,5 and 6 with digital display of World
Coordinates (WC) and view index.
Depending on the echo type, the locator data record may contain additional
information about the visual aspect of the echo. For echo type 0,1,2,3,6,-2,-3
and -6 this parameter does not need to be initialized.
For echo type 4 and -4: The field pet_r4 of the Ploc_data structure must be
initialized:
- Ploc_data loc_data_rec;
- loc_data_rec.pets.pet_r4.line_attrs.type_asf = ASF of line style.
- loc_data_rec.pets.pet_r4.line_attrs.width_asf = ASF of line width.
- loc_data_rec.pets.pet_r4.line_attrs.colr_ind_asf = ASF of line colour.
- loc_data_rec.pets.pet_r4.line_attrs.ind = line index.
- loc_data_rec.pets.pet_r4.line_attrs.bundle.type = line style.
- loc_data_rec.pets.pet_r4.line_attrs.bundle.width = line width.
- loc_data_rec.pets.pet_r4.line_attrs.bundle.colr_ind = line colour
index.
GPHIGS will use line index to access line style, line width or line
colour index if corresponding ASF is set to PASF_BUNDLED. Otherwise the line
style, line width and line colour index of the bundle field will be used if
corresponding ASF is set to PASF_INDIV. Rubber band will appear on the screen
with specified attributes.
For echo type 5 and -5: The field pet_r5 of the Ploc_data structure must be
initialized:
- Ploc_data loc_data_rec;
- loc_data_rec.pets.pet_r5.line_fill_ctrl_flag = type of primitive to be
used to generate the rubber rectangle. May be either PFLAG_LINE, PFLAG_FILL or
PFLAG_FILL_SET.
If PFLAG_LINE:
- loc_data_rec.pets.pet_r5.attrs.line_attrs.type_asf = ASF of line style.
- loc_data_rec.pets.pet_r5.attrs.line_attrs.width_asf = ASF of line width.
- loc_data_rec.pets.pet_r5.attrs.line_attrs.colr_ind_asf = ASF of line
colour.
- loc_data_rec.pets.pet_r5.attrs.line_attrs.ind = line index.
- loc_data_rec.pets.pet_r5.attrs.line_attrs.bundle.type = line style.
- loc_data_rec.pets.pet_r5.attrs.line_attrs.bundle.width = line width.
- loc_data_rec.pets.pet_r5.attrs.line_attrs.bundle.colr_ind = line colour
index.
GPHIGS will use line index to access line style, line width or line
colour index if corresponding ASF is set to PASF_BUNDLED. Otherwise the line
style, line width and line colour index of the bundle field will be used if
corresponding ASF is set to PASF_INDIV. Rubber rectangle will appear on the
screen with specified line attributes.
If PFLAG_FILL:
- loc_data_rec.pets.pet_r5.attrs.int_attrs.style_asf = ASF of interior style.
- loc_data_rec.pets.pet_r5.attrs.int_attrs.style_ind_asf = ASF of interior
style index.
- loc_data_rec.pets.pet_r5.attrs.int_attrs.colr_ind_asf = ASF of fill colour.
- loc_data_rec.pets.pet_r5.attrs.int_attrs.ind = interior index.
- loc_data_rec.pets.pet_r5.attrs.int_attrs.bundle.style = interior style.
- loc_data_rec.pets.pet_r5.attrs.int_attrs.bundle.style_ind = interior style
index.
- loc_data_rec.pets.pet_r5.attrs.int_attrs.bundle.colr_ind = interior colour
index.
GPHIGS will use style index to access interior style, interior style
index or interior colour index if corresponding ASF is set to PASF_BUNDLED.
Otherwise the interior style, interior style index or interior colour index of
the bundle field will be used if corresponding ASF is set to PASF_INDIV. Rubber
rectangle will appear on the screen with specified interior attributes.
If PFLAG_FILL_SET:
- loc_data_rec.pets.pet_r5.attrs.fill_set.int_attrs.style_asf = ASF of
interior style.
- loc_data_rec.pets.pet_r5.attrs.fill_set.int_attrs.style_ind_asf = ASF of
interior style index.
- loc_data_rec.pets.pet_r5.attrs.fill_set.int_attrs.colr_ind_asf = ASF of
fill colour.
- loc_data_rec.pets.pet_r5.attrs.fill_set.int_attrs.ind = interior index.
- loc_data_rec.pets.pet_r5.attrs.fill_set.int_attrs.bundle.style = interior
style.
- loc_data_rec.pets.pet_r5.attrs.fill_set.int_attrs.bundle.style_ind =
interior style index.
- loc_data_rec.pets.pet_r5.attrs.fill_set.int_attrs.bundle.colr_ind =
interior colour index.
- loc_data_rec.pets.pet_r5.attrs.fill_set.edge_attrs.flag_asf = ASF of edge
flag.
- loc_data_rec.pets.pet_r5.attrs.fill_set.edge_attrs.type_asf = ASF of edge
type.
- loc_data_rec.pets.pet_r5.attrs.fill_set.edge_attrs.width_asf = ASF of edge
width.
- loc_data_rec.pets.pet_r5.attrs.fill_set.edge_attrs.colr_ind_asf = ASF of
edge colour.
- loc_data_rec.pets.pet_r5.attrs.fill_set.edge_attrs.ind = edge index.
- loc_data_rec.pets.pet_r5.attrs.fill_set.edge_attrs.bundle.flag= edge flag.
- loc_data_rec.pets.pet_r5.attrs.fill_set.edge_attrs.bundle.type = edge type.
- loc_data_rec.pets.pet_r5.attrs.fill_set.edge_attrs.bundle.width = edge
width.
- loc_data_rec.pets.pet_r5.attrs.fill_set.edge_attrs.bundle.colr_ind = edge
colour index.
GPHIGS will use style index to access interior style,
interior style index or interior colour index if corresponding ASF is set to
PASF_BUNDLED. Otherwise the interior style, interior style index or interior
colour index of the bundle field will be used if corresponding ASF is set to
PASF_INDIV.
GPHIGS will use edge index to access edge flag, edge type, edge width and edge
colour index if corresponding ASF is set to PASF_BUNDLED. Otherwise edge flag,
edge type, edge width and edge colour index of the bundle field will be used if
corresponding ASF is set to PASF_INDIV.
Example:
#include <phigs.h>
/* Sample program to initialize a locator device */
main()
{
Pint ws_id,loc_dev,init_view_index,pet,error,update_state;
Ppoint3 init_loc_pos;
Ploc_data loc_data_rec;
Plimit3 echo_volume,req_view,cur_win,req_win;
ws_id = 1;
loc_dev = 1;
pet = 4;
init_view_index = 0;
init_loc_pos.x = init_loc_pos.y = init_loc_pos.z = 0.;
/* Open PHIGS session */
popen_phigs(PDEF_ERR_FILE,PDEF_MEM_SIZE);
/* Open a PHIGS workstation */
popen_ws(ws_id,"GPHIGS.OUT",8887);
/* Get back the DC of the workstation */
pinq_ws_tran3(ws_id,&error,&update_state,&req_win,
&cur_win,&req_view,&echo_volume);
/* Initialize locator for pet 4 */
/* rubber band will be dashed, red with a line width of 3 */
loc_data_rec.pets.pet_r4.line_attrs.type_asf = PASF_INDIV;
loc_data_rec.pets.pet_r4.line_attrs.width_asf = PASF_INDIV;
loc_data_rec.pets.pet_r4.line_attrs.colr_ind_asf = PASF_INDIV;
loc_data_rec.pets.pet_r4.line_attrs.ind = 1 ;
loc_data_rec.pets.pet_r4.line_attrs.bundle.type = 2 ;
loc_data_rec.pets.pet_r4.line_attrs.bundle.width = 3.;
loc_data_rec.pets.pet_r4.line_attrs.bundle.colr_ind = 2 ;
pinit_loc3(ws_id,loc_dev,init_view_index,&init_loc_pos,
pet,&echo_volume,&loc_data_rec);
/* Close workstation */
pclose_ws(ws_id);
/* Close PHIGS */
pclose_phigs();
}
ERRORS
- 3
Ignoring function, function requires state (PHOP, WSOP,*,*)
- 54
- Ignoring function, the specified workstation is not open
- 61
- Ignoring function, specified workstation is neither of category INPUT nor
of category OUTIN
- 250
- Ignoring function, the specified device is not available on the specified
workstation
- 251
- Ignoring function, the function requires the input device to be in REQUEST
mode
- 254
- Ignoring function, invalid echo area volume: XMIN>>=XMAX,
YMIN>>=YMAX or ZMIN>>ZMAX
- 255
- Ignoring function, one of the echo area volume boundary points is outside
the range of the device
- 253
- Ignoring function, the specified prompt echo type is not available on the
specified workstation
- 260
- Ignoring function, one of the fields within the input device data record is
in error
- 261
- Ignoring function, initial value is invalid
- 114
- Ignoring function, the view index value is less than zero
SEE ALSO
initialize locator, set locator mode, request locator 3, sample locator 3, get
locator 3, inquire locator device state 3, inquire default locator device state
3, inquire number of available logical input devices