SunPHIGS 3.0 Extensions Reference Manual
  Procure somente este livro
Fazer download desta apostila em PDF

NAME

INQUIRE INTERIOR REPRESENTATION PLUS - inquire for values of extended interior representation on workstation

SYNOPSIS

C Syntax

void
pinq_int_rep_plus ( ws, index, type, error_ind, rep )
Pint                ws;            workstation identifier
Pint                index;         interior index
Pinq_type           type;          type of returned value
Pint                * error_ind;   OUT error indicator
Pint_bundle_plus    * rep;         OUT interior representation

FORTRAN Syntax

SUBROUTINE pqeir ( WKID, INDEX, TYPE, ERRIND, 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      TYPE            type of returned values (PSET, PREALI )
INTEGER      ERRIND          OUT error indicator
INTEGER      STYLE(2)        OUT interior styles
INTEGER      ISTYLE(2)       OUT interior style indexes
INTEGER      COLTYPE(2)      OUT interior colour types
INTEGER      ICOLR(2)        OUT interior colour index
REAL         COLR(3,2)       OUT interior colour triples
INTEGER      REFEQ(2)        OUT reflectance equations
INTEGER      SHADEM(2)       OUT shading methods
REAL         AMCOEF(2)       OUT ambient reflectance coefficients
REAL         DICOEF(2)       OUT diffuse reflectance coefficients
REAL         SPCOEF(2)       OUT specular reflectance coefficients
INTEGER      SCOLM(2)        OUT specular colour models
INTEGER      ISCOLR(2)       OUT specular colour indexes
REAL         SCOLR(3,2)      OUT specular colour triples
REAL         SPEXP(2)        OUT specular exponents
REAL         TRCOEF(2)       OUT transparency coefficients
INTEGER      APTYP           OUT surface approximation type
REAL         APVAL(2)        OUT surface approximation values, u and v

Required PHIGS Operating States

(PHOP, WSOP, * ,* )

DESCRIPTION

Purpose

INQUIRE INTERIOR REPRESENTATION PLUS returns the values of a specified entry in a 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

ws
The workstation identifier.
index
Index of the entry to be returned. If this entry is not present in the table, and the type of returned value parameter is PINQ_REALIZED, the representation for interior index one is returned.
type
An enumerated value specifying whether the values to be returned are those originally specified by the application (PINQ_SET), or those resulting after PHIGS mapped them to ones available on the workstation (PINQ_REALIZED). A Pinq_type structure is defined as:
typedef enum {
PINQ_SET,
PINQ_REALIZED
} Pinq_type;

C Output Parameters

error_ind
A pointer to the location to store the error number of any error detected by this function.
rep
A pointer to a Pint_bundle_plus structure that returns the specified extended interior representation. 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;
Pgcolr is defined as:
typedef struct {
Pinttype;
/* 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.
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
For a description of their use, see SET SURFACE APPROXIMATION CRITERIA.

FORTRAN Input Parameters

All of the following data types are predefined in phigs77.h.
WKID
Workstation identifier.
INDEX Index of the entry to be returned. If this entry is not present in the table and the
type of returned value parameter is PREALI ,then the representation for interior index one is returned.
TYPE
An enumerated value specifying whether the values to be returned are those originally specified by the application (Set), or those resulting after PHIGS mapped them to ones available on the workstation (Realized). Valid values are:
0   PSET      Set
1   PREALI    Realized

FORTRAN Output Parameters

ERRIND
The error number of any error detected by this function.
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
5   PGENER     General

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, Blue
2   PCIE     CIE Colour Model
3   PHSV     Hue, Saturation, Value
4   PHLS     Hue, Lightness, Saturation

ICOLR(2)
The front and back colour indexes. ICOLR is used only when the corresponding value in COLTYPE is PINDIR.
COLR(3,2)
The front and back colour triples. COLR(3,* )is used only when the corresponding value in COLTYPE 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 PINDIR.
SCOLR(3,2)
The front and back specular colour triples. SCOLR(3,2) is used only when 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].
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

For a description of their use, see SET SURFACE APPROXIMATION CRITERIA.
APVAL(2)
The surface approximation values. For a description of their use, see SET SURFACE APPROXIMATION CRITERIA.

Execution

If the inquired information is available, the error indicator is returned as zero and the requested information is returned in the output parameters.
If the specified interior index is not present in the interior bundle table on the workstation and the specified type of returned value is Realized, the representation for interior index one is returned.
If the inquired information is not available, the values returned in the output parameters are undefined and the error indicator is set to one of the below error numbers to indicate the reason for nonavailability.
The extended interior bundle table contains bundled entries of the PHIGS and SunPHIGS Extension interior attributes. 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 INQUIRE INTERIOR REPRESENTATION function returns the following attributes from the extended table: interior style, interior style index, and colour index.
Since this is an inquiry function, ERROR HANDLING is not invoked when an error is detected by this function.

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
101
Ignoring function, the specified representation has not been defined

SEE ALSO

SET INTERIOR REPRESENTATION PLUS (3PP)
INQUIRE INTERIOR REPRESENTATION (3P)
INQUIRE PREDEFINED INTERIOR REPRESENTATION PLUS (3PP)