VIEW CONFIGURATION
CALL SEQUENCE
void tview_config (wkid, view_ind, viewport_type, clip)
INPUT PARAMETERS
Pint wkid;
Pint view_ind;
Tviewport_type viewport_type;
Pclip_ind clip;
ARGUMENTS
- wkid
Identifier of the workstation on which the view is configured.
- view_ind
- Index of the view to be defined.
- viewport_type
- Type of viewport (last parameter of tview2_center and
tview3_xxx)
- TPHIGS_VIEWPORT
-
- Definition of the viewport conforming to the PHIGS standard.
- TNON_ISOTROPIC_VIEWPORT
-
- Viewport relative to the entire workstation window.
- TISOTROPIC_VIEWPORT
-
- Viewport relative to the entire workstation window, but without
deformation.
- clip
Indicator for image clipping at the edge of the viewport
- PIND_CLIP
- Clipping.
- PIND_NO_CLIP
- No clipping.
EFFECT
This function allows a viewport configuration definition by the functions
tview2_center and tview3_xxx if the workstation has already been
opened with topen_ws. The viewport is the part of the graphic window in
which is displayed the image defined by the scene and by the view function.
TNON_ISOTROPIC_VIEWPORT
The viewport is defined with respect to the space [0-1] × [0-1],
representing the entire graphic window. If the graphic window does not have the
same aspect ratio, height/width, as the viewport, there will be a deformation
of the image when it is displayed (for example, a circle could appear as an
ellipse).
TISOTROPIC_VIEWPORT
The viewport is defined with respect to the space [0-1] × [0-1],
representing the entire window. Images are never deformed, even if the graphic
does not have the same aspect ratio as the viewport (for example, a circle will
always appear as a circle). This is the default mode if the workstation is
opened by topen_ws and if tview_config is not called.
TPHIGS_VIEWPORT
The viewport is define with respect to the space [0-1] × [0-1],
representing the PHIGS NPC space (see the PHIGS reference manual).
Example: A scene defined in user space, [10-20] × [10-20], has a circle
centered at (15,15) with radius 5. Visualization of this scene with the
function tview2_center.
#define CIRCLE 1
#define SCENID 2
#define WKID 1
#define INVUE 1
static Plimit domain = {10.,20., 10.,20.};
static Ppoint center = {15.,15.};
Tcircle circle_s;
static Pint_list list_struct_list;
static Plimit viewport = { .... };
Tviewport_type type;
tdomain (&domain); /* user space [10-20] × [10-20] */
circle_s.type = TCENTER_RADIUS;
circle_s.geometry.cr.c = center;
circle_s.geometry.cr.r = 5.; /* circle centered at (15,15) */
tcircle (CIRCLE, &circle_s); /* with radius 5 */
struct_list.num_ints = 1;
struct_list.ints [0] = CIRCLE;
tscene (SCENID,&struct_list,INVUE); /* scene containing the circle */
ppost_struct (WKID,SCENID,0.); /* post scene */
tview_config. (WKID,INVUE,type,PIND_CLIP); /* view configuration */
tview2_center (WKID,INVUE, 0.5,0.5, 1.,viewport); /* view definition */
predraw_all_structs (WKID,PFLAG_ALWAYS); /* drawing */
