SunPHIGS 3.0 Extensions Reference Manual
검색에만이 책은
PDF로 이 문서 다운로드

NAME

SET INTERIOR REPRESENTATION PLUS - set extended interior attribute bundle on workstation

SYNOPSIS

C Syntax

void
pset_int_rep_plus ( wsid, index, rep )
Pint                wsid;     workstation id
Pint                index;    interior index
Pint_bundle_plus    * rep;    representation

FORTRAN Syntax

SUBROUTINE pseir ( WKID, INDEX, STYLE, ISTYLE, COLTYPE, ICOLR, COLR, REFEQ, SHADEM, AMCOEF, DICOEF, SPCOEF, SCOLM, ISCOLR, SCOLR, SPEXP, TRCOEF, APTYP, APVAL )
INTEGER      WKID            workstation identifier
INTEGER      INDEX           bundle index
INTEGER      STYLE(2)        interior styles
INTEGER      ISTYLE(2)       interior style indexes
INTEGER      COLTYPE(2)      interior colour types
INTEGER      ICOLR(2)        interior colour index
REAL         COLR(3,2)       interior colour triples
INTEGER      REFEQ(2)        reflectance equations
INTEGER      SHADEM(2)       shading methods
REAL         AMCOEF(2)       ambient reflectance coefficients
REAL         DICOEF(2)       diffuse reflectance coefficients
REAL         SPCOEF(2)       specular reflectance coefficients
INTEGER      SCOLM(2)        specular colour models
INTEGER      ISCOLR(2)       specular colour indexes
REAL         SCOLR(3,2)      specular colour triples
REAL         SPEXP(2)        specular exponents
REAL         TRCOEF(2)       transparency coefficients
INTEGER      APTYP           surface approximation type
REAL         APVAL(2)        surface approximation values, u and v

Required PHIGS Operating States

(PHOP, WSOP, * ,* )

DESCRIPTION

Purpose

SET INTERIOR REPRESENTATION PLUS sets a bundle table entry in the workstation extended interior bundle table.
This is a SunPHIGS Extension function based on PHIGS PLUS and is not part of the PHIGS standard.

C Input Parameters

wsid
The identifier of the workstation for which the representation is being set.
index
The index of the entry being set.
rep
A pointer to a Pint_bundle_plus structure containing the extended interior attributes. Pint_bundle_plus is defined as:
typedef struct {
Pint_style          style;              /* interior style * /
Pint                style_ind;          /* interior style index * /
Pgcolr              colr;               /* interior colour * /
Pint                refl_eqn;            /* reflectance equation * /
Pint                shad_meth;          /* shading method * /
Prefl_props          refl_props;          /* area properties * /
Pint_style          back_style;         /* interior style * /
Pint                back_style_ind;     /* interior style index * /
Pgcolr              back_colr;          /* interior colour * /
Pint                back_refl_eqn;       /* back reflectance equation * /
Pint                back_shad_meth;     /* back shading method * /
Prefl_props          back_refl_props;     /* back area properties * /
Pint                approx_type;        /* approximation method * /
Pfloat               approx_val[2];      /* approximation values,
                                           u and v * /

} Pint_bundle_plus;
Pint_style is defined as:
typedef enum {
PSTYLE_HOLLOW,
PSTYLE_SOLID,
PSTYLE_PAT,
PSTYLE_HATCH,
PSTYLE_EMPTY
} Pint_style;
See SET INTERIOR STYLE for a description of each style.
Pgcolr is defined as:
typedef struct {
Pint
type;
/* indirect, RGB, CIE, HSV, HLS * /
union {
Pint
ind;
/* index in workstation colour
bundle table * /
struct {
Pfloat         x;          /* red, hue, and so on * /
Pfloat         y;          /* green, saturation, lightness,
                             and so on * /

Pfloat
z;
/* blue, value, saturation, and so on * /
} general;
} val;
} Pgcolr;
Prefl_props is defined as:
typedef struct {
Pfloat           ambient_coef;     /* ambient reflectance coefficient * /
Pfloat           diffuse_coef;     /* diffuse reflectance coefficient * /
Pfloat           specular_coef;    /* specular reflectance coefficient * /
Pgcolr          specular_colr;    /* specular colour * /
Pfloat           specular_exp;     /* specular exponent * /
Pfloat           transpar_coef;    /* transparency coefficient * /

} Prefl_props;
The values for ambient, diffuse, specular, and transparency coefficients must all be in the range [0,1]. The specular exponent must be greater than zero. Note that SunPHIGS has accepted transparency coefficients since release 1.1. However, only GT workstations use these values. A value of 0.0 means no transparency (entirely opaque), and a value of 1.0 means entirely transparent (invisible).
Constants defined for colour type are:
0   PINDIRECT         Indirect
1   PMODEL_RGB        Red, Green, Blue
2   PMODEL_CIELUV     CIE
3   PMODEL_HSV        Hue, Saturation, Value
4   PMODEL_HLS        Hue, Lightness, Saturation

The index member of the val union is used for type PINDIRECT. The general member is used for the other types.
Predefined reflectance equation values are:
1   PREFL_NONE              No Reflectance Calculation Performed
2   PREFL_AMBIENT           Use Ambient Term
3   PREFL_AMB_DIFF          Use Ambient and Diffuse Terms
4   PREFL_AMB_DIFF_SPEC     Use Ambient, Diffuse, and Specular Terms

Predefined constants for interior shading method are:
1   PSD_NONE             No Shading
2   PSD_COLOUR           Colour Interpolation Shading
3   PSD_DOT_PRODUCT      Dot Product Interpolation Shading
4   PSD_NORMAL           Normal Interpolation Shading

Constants defined for surface approximation type are:
1
PSURF_WS_DEP
2
PSURF_CONSTANT_PARAMETRIC_BETWEEN_KNOTS
3
PSURF_CHORDAL_SIZE_WC
4
PSURF_CHORDAL_SIZE_NPC
5
PSURF_CHORDAL_SIZE_DC
6
PSURF_PLANAR_DEVIATION_WC
7
PSURF_PLANAR_DEVIATION_NPC
8
PSURF_PLANAR_DEVIATION_DC
See SET SURFACE APPROXIMATION CRITERIA for a description of these constants.

FORTRAN Input Parameters

All of the following data types are predefined in phigs77.h.
WKID
The identifier of the workstation for which the representation is being set.
INDEX The interior index of the entry being set.
STYLE(2)
The front and back interior styles. Valid values are defined as:
0   PHOLLO     Hollow
1   PSOLID     Solid
2   PPATTR     Patterned
3   PHATCH     Hatched
4   PISEMP     Empty

See SET INTERIOR STYLE for a description of each style.
ISTYLE(2)
The front and back interior style indexes, which select entries in the workstation Pattern ,Hatch, or General interior style tables.
COLTYPE(2)
The front and back interior colour types. Valid values are defined as:
0   PINDIR   Indirect
1   PRGB     Red, Green, and Blue
2   PCIE     CIE
3   PHSV     Hue, Saturation, and Value
4   PHLS     Hue, Lightness, and Saturation

ICOLR(2)
The front and back colour indexes. ICOLR(2) is used only when the corresponding value in COLTYPE(2) is PINDIR.
COLR(3,2)
The front and back colour triples. COLR(3,2) is used only when the corresponding value in COLTYPE(2) is not PINDIR. The triples are stored as:
ICOLR(1 ,c)= x Colour
ICOLR(2 ,c)= y Colour
ICOLR(3 ,c)= z Colour
REFEQ(2)
The front and back reflectance equations. Predefined reflectance equation values are:
1   PRNONE     No Reflectance Calculation Performed
2   PRAMB      Use Ambient Term

3   PRAMBD     Use Ambient and Diffuse Terms
4   PRAMDS     Use Ambient, Diffuse, and Specular Terms

SHADEM(2)
The front and back interior shading methods. Predefined constants are:
1   PSDNON     No Shading
2   PSDCOL     Colour Interpolation Shading
3   PSDDOT     Dot Product Interpolation Shading
4   PSDNOR     Normal Interpolation Shading

AMCOEF(2)
The front and back ambient reflectance coefficients, in the range [0,1].
DICOEF(2)
The front and back diffuse reflectance coefficients, in the range [0,1].
SPCOEF(2)
The front and back specular reflectance coefficients, in the range [0,1].
SCOLM(2)
The front and back specular colour models.
ISCOLR(2)
The front and back specular colour indexes. ISCOLR(2) is used only when the corresponding value in SCOLM is PINDIR.
SCOLR(3,2)
The front and back specular colour triples. SCOLR(3,2) is used only if the corresponding value in SCOLM is not PINDIR.
SPEXP(2)
The front and back specular exponents, greater than zero.
TRCOEF(2)
The front and back transparency coefficients, in the range [0,1]. Note that SunPHIGS has accepted transparency coefficients since release 1.1. However, only GT workstations use these values. A value of 0.0 means no transparency (entirely opaque) and a value of 1.0 means entirely transparent (invisible).
APTYP The surface approximation type. Predefined values are:
1   PSAWSD     Workstation-dependent
2   PSAEPK     Constant Parametric Subdivision Between Knots
3   PSACSW     Chordal Size in WC
4   PSACSN     Chordal Size in NPC
5   PSACSD     Chordal Size in DC
6   PSAPDW     Planar Deviation in WC
7   PSAPDN     Planar Deviation in NPC
8   PSAPDD     Planar Deviation in DC

APVAL(2)
The surface approximation values.

Execution

The extended interior bundle table contains bundled entries of the PHIGS and SunPHIGS Extension interior attributes. SET INTERIOR REPRESENTATION PLUS sets the individual entries of this table. During traversal, the attribute values of these bundles are used when the corresponding aspect source flag in the workstation state list is set to BUNDLED.
The PHIGS interior bundle table is a portion of the extended table. The function SET INTERIOR REPRESENTATION sets the following attributes in the extended table: interior style, interior style index, and colour index (colour type of Indirect is assumed).
During structure traversal the current interior index refers to an entry in the workstation extended interior bundle table. Depending on the settings of the aspect source flags, the contents of that bundle table entry are used to determine the attributes associated with output primitives that use the extended interior bundle table.

ERRORS

003
Ignoring function, function requires state (PHOP, WSOP, * ,* )
054
Ignoring function, the specified workstation is not open
059
Ignoring function, the specified workstation does not have output capability (that is, the workstation category is not OUTPUT, OUTIN, or MO)
100
Ignoring function, the bundle index value is less than one
103
Ignoring function, setting this bundle table entry would exceed the maximum number of entries allowed in the workstation bundle table
108
Ignoring function, the specified interior style is not available on the workstation
110
Ignoring function, the specified colour model is not available on the workstation
112
Ignoring function, the pattern index value is less than one

SEE ALSO

SET INDIVIDUAL ASF (3P)
SET SURFACE APPROXIMATION CRITERIA (3PP)
INQUIRE INTERIOR FACILITIES PLUS (3PP)
INQUIRE INTERIOR REPRESENTATION PLUS (3PP)
SET INTERIOR STYLE INDEX (3P)
SET INTERIOR REPRESENTATION (3P)