2. Attributes - CoordSys, Units, VisContext

Currently there are three attribute objects, 1) CoordSys for defining coordinate systems, 2) Units for defining the units of physical quantities and 3) VisContext for defining visualization parameters.

Note that the Units and CoordSys objects hold floating point data internally in double precision.

2.1. Coordinate System - CoordSys

The CoordSys object is used to define Cartesian, cylindrical, spherical and toroidal coordinate systems. The systems are defined given an origin and orientation relative to the global coordinate system. The methods associated with a CoordSys object are the following.

Instance a CoordSys object using vis_CoordSysBegin(). Once a CoordSys object is instanced, define the coordinate system type using vis_CoordSysDef(). Coordinate system types include Cartesian, cylindrical, toroidal and two variations of spherical systems. After the coordinate system type is defined then set the coordinate system origin and orientation direction cosine matrix using vis_CoordSysSetOriginTriad(). If the user is only concerned with the orientation of the z axis then use vis_CoordSysSetOriginZAxis(). In this case the directions of the x and y axes will be automatically generated.

The following convention for the direction cosine matrices of a local coordinate system is used. Given that x’,y’ and z’ are three orthonormal vectors indicating the direction of the local coordinate axes in the global coordinate system (x,y,z), then the direction cosine matrix, tm for this local coordinate system is defined as:

tm[0][0] = x'x  tm[0][1] = x'y  tm[0][2] = x'z
tm[1][0] = y'x  tm[1][1] = y'y  tm[1][2] = y'z
tm[2][0] = z'x  tm[2][1] = z'y  tm[2][2] = z'z

where y’x, for example, is the global x coordinate of the y’ unit vector.

Note that all CoordSys functions involving floating point data have both single and double precision versions. The single precision versions are provided for convenience, all floating point data is held internally in the CoordSys object in double precision.

The orientation of the coordinate system is specified by a direction cosine matrix which defines a local x’,y’,z’ rectangular system in global coordinate space. The coordinate system is aligned to the x’,y’,z’ system. Note that all angles are in degrees.

  • A Cartesian system is a rectangular coordinate system characterized by coordinates x’,y’,z’.

  • A cylindrical system is characterized by coordinates r,theta,z’ where theta is the angle about the z’ axis (positive x’ toward positive y’). An alternate definition of a cylindrical system is available characterized by coordinates z,theta,r where theta is the angle about the z’ axis (positive y’ toward positive x’).

  • A spherical system is characterized by coordinates r,theta,phi where theta is the angle about the z’ axis (positive x’ toward positive y’) and phi is the angle about the x’ axis (positive y’ toward positive z’). An alternate definition of a spherical system is available (for specific support of NASTRAN spherical coordinate systems) in which theta is the angle about the negative x’ axis (positive z’ toward positive y’) and phi is the angle about the z’ axis (positive x’ toward positive y’).

  • A toroidal system is characterized by a radius of the torus and coordinates r,theta,phi where theta is the angle about the z’ axis (positive x’ toward positive y’) and phi is the angle about the x’ axis (positive y’ toward positive z’).

Figure 2-1 illustrates the coordinate system conventions. Use the Triad object to draw coordinate systems.

../../_images/vistools-vc1.gif

Figure 2-1, Coordinate System Conventions

The functions vis_CoordSysConvertVector(), vis_CoordSysConvertTensor() and vis_CoordSysConvertMatrix() may be used to convert a vector, tensor or general tensor at a point P expressed in the global Cartesian system to a local Cartesian system which is dependent upon the coordinate location of P. The functions vis_CoordSysComputeVector(), vis_CoordSysComputeTensor() and vis_CoordSysComputeMatrix() perform the inverse transformation. See section VisTools, Mathematical Data Types for a description of ordering conventions for the components of vectors, tensors and general tensors. The local Cartesian system at point P may be computed using vis_CoordSysDirCos().

The function vis_CoordSysDirCos() may be used to compute the direction cosine matrix of a local Cartesian coordinate system at a point. Figure 2-2 illustrates the local Cartesian direction cosine matrix x’,y’,z’ computed at a point P within a cylindrical coordinate system. The x’ local axis is in the radial direction at P, the y’ local axis is in the tangential direction at P and the z’ axis is in the axial direction. The equivalent, rotation angle vector representation of the local Cartesion system at point P may be computed using vis_CoordSysRotAng(). This rotation angle vector may be converted to a direction cosine matrix using the Rodrigues formula. It is a vector whose direction is the axis of rotation and whose magnitude is the rotation angle in degrees.

../../_images/vistools-vc2.gif

Figure 2-2, Local Cartesian Direction Cosine Matrix

The function vis_CoordSysConvertCoord() may be used to convert a coordinate location expressed in global Cartesian coordinates to the coordinate system type. This operation involves subtracting the offset of the coordinate system origin and converting to the coordinate sytem type. For cylindrical, alternate cylindrical, spherical, alternate spherical and toroidal systems the coordinates are converted to (r,theta,z’), (z’,theta,r), (r,theta,phi) (r,theta,phi) and (r,theta,phi) respectively. The function vis_CoordSysComputeCoord() performs the inverse operation.

2.2. Function Descriptions

The currently available CoordSys functions are described in detail in this section.

vis_CoordSys *vis_CoordSysBegin(void)

create an instance of a CoordSys object

Create an instance of a CoordSys object. Memory is allocated for the object private data and the pointer to the data is returned. By default the coordinate system type is Cartesian, the identifier is 0, the origin is 0.,0.,0. and the orientation direction cosine matrix is the identity matrix.

Destroy an instance of a CoordSys object using

void vis_CoordSysEnd (vis_CoordSys *coordsys)

Return the current value of a CoordSys object error flag using

Vint vis_CoordSysError (vis_CoordSys *coordsys)

Make a copy of a CoordSys object. The private data from the fromcoordsys object is copied to the coordsys object. Any previous private data in coordsys is lost.

void vis_CoordSysCopy (vis_CoordSys *coordsys,
                       vis_CoordSys *fromcoordsys)

Returns:

The function returns a pointer to the newly created CoordSys object. If the object creation fails, NULL is returned.

void vis_CoordSysEnd(vis_CoordSys *p)

destroy an instance of a CoordSys objec

See vis_CoordSysBegin()

Vint vis_CoordSysError(vis_CoordSys *p)

return the current value of an object error flag

See vis_CoordSysBegin()

void vis_CoordSysDef(vis_CoordSys *p, Vint type)

define a coordinate system type

Define the coordinate system type. Set the origin and orientation of the system using vis_CoordSysSetOriginTriad(), vis_CoordSysSetOriginRotAng(). vis_CoordSysSetOriginVectors() or vis_CoordSysSetOriginZAxis(). Set the radius of a toroidal system using vis_CoordSysSetRadius().

Inquire of defined type as an output argument.

void vis_CoordSysInq (vis_CoordSys *coordsys,
                      Vint *type)

Errors

VIS_ERROR_ENUM is generated if an improper type is specified.

Parameters:
  • p – Pointer to CoordSys object.

  • type – Coordinate system type.

    x=SYS_CARTESIAN          Cartesian system
     =SYS_CYLINDRICAL        Cylindrical system
     =SYS_CYLINDRICAL_ALT    Cylindrical alternalte system
     =SYS_SPHERICAL          Spherical system
     =SYS_SPHERICAL_ALT      Spherical alternate system
     =SYS_TOROIDAL           Toroidal system
    

void vis_CoordSysInq(const vis_CoordSys *p, Vint *type)

inquire of defined type as an output argument.

See vis_CoordSysDef()

void vis_CoordSysSetOriginZAxis(vis_CoordSys *p, Vfloat x[3], Vfloat zv[3])

specify origin and z axis orientation

Specify the coordinate system origin, x in global coordinates and the system z axis direction vector, zv. The direction vector, zv, should be a unit vector. The orientations of the x and y axes are computed internally. This function is useful if only the z axis orientation of the system is critical. No check is performed by the CoordSys object on the validity of the input zv.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Origin of coordinate system in global coordinates.

  • zv – Vector of system local z axis.

void vis_CoordSysSetOriginZAxisdv(vis_CoordSys *p, Vdouble x[3], Vdouble zv[3])

specify origin and z axis orientation

See vis_CoordSysSetOriginZAxis()

void vis_CoordSysSetOriginVectors(vis_CoordSys *p, Vfloat x[3], Vfloat v1[3], Vfloat v2[3])

specify origin and vector orientation

Specify the coordinate system origin, x in global coordinates and the system as two vectors, v1 and v2. The two vectors must form a valid x’-y’ plane.

Errors

VIS_ERROR_COMPUTE is generated if the input vectors do not form a valid plane.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Origin of coordinate system in global coordinates.

  • v1 – Vector along x’ axis.

  • v2 – Vector in x’-y’ plane.

void vis_CoordSysSetOriginVectorsdv(vis_CoordSys *p, Vdouble x[3], Vdouble xa[3], Vdouble ya[3])

specify origin and vector orientation

See vis_CoordSysSetOriginVectors()

void vis_CoordSysSetOriginRotAng(vis_CoordSys *p, Vfloat x[3], Vfloat ra[3])

specify origin and angle orientation

Specify the coordinate system origin, x in global coordinates and the system orientation using the rotation angle vector, ra.

Errors

VIS_ERROR_COMPUTE is generated if the input vectors do not form a valid plane.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Origin of coordinate system in global coordinates.

  • ra – Rotation angle vector of system local axes.

void vis_CoordSysSetOriginRotAngdv(vis_CoordSys *p, Vdouble x[3], Vdouble rotang[3])

specify origin and angle orientation

See vis_CoordSysSetOriginRotAng()

void vis_CoordSysSetOriginTriad(vis_CoordSys *p, Vfloat x[3], Vfloat tm[3][3])

specify origin and orientation

Specify the coordinate system origin, x in global coordinates and the system orientation, tm. The direction cosine matrix, tm, should be a proper orthonormal rotation matrix. No check is performed by the CoordSys object on the validity of the input tm.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Origin of coordinate system in global coordinates.

  • tm – Direction cosine matrix of system local axis.

void vis_CoordSysSetOriginTriaddv(vis_CoordSys *p, Vdouble x[3], Vdouble tm[3][3])

specify origin and orientation

See vis_CoordSysSetOriginTriad()

void vis_CoordSysSetRadius(vis_CoordSys *p, Vfloat radius)

specify radius of torus

Specify the radius of the torus for a toroidal coordinate system. By default the radius is unity.

Parameters:
  • p – Pointer to CoordSys object.

  • radius – Radius of torus.

void vis_CoordSysSetRadiusdv(vis_CoordSys *p, Vdouble radius)

specify radius of torus

See vis_CoordSysSetRadius()

void vis_CoordSysDirCos(vis_CoordSys *p, Vfloat x[3], Vfloat tm[3][3])

compute direction cosine matrix

Compute the direction cosine matrix, tm, associated with a specified global coordinate location x. For Cartesian systems, tm is independent of location x and is aligned exactly with the system x’,y’,z’ axes. For cylindrical systems, the x local axis is in the radial direction at x, the y local axis is in the tangential direction and the z local axis is in the axial direction. For spherical systems, the x local axis is in the radial direction at x, the y local axis is in the tangential direction and the z local axis is constructed to be orthonormal to the x local and y local axes. If x is located at the coordinate system origin, then the direction cosine matrix, tm, is always aligned to the system x’,y’,z’ axes. For toroidal systems, the x local axis is in the radial direction at x, the y local axis is in the tangential direction and the z local axis is constructed to be orthonormal to the x local and y local axes.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Origin of coordinate system in global coordinates.

  • tm[out] Direction cosine matrix of system local axis.

void vis_CoordSysDirCosdv(vis_CoordSys *p, Vdouble x[3], Vdouble tm[3][3])

compute direction cosine matrix

See vis_CoordSysDirCos()

void vis_CoordSysRotAng(vis_CoordSys *p, Vfloat x[3], Vfloat ra[3])

compute rotation angle vector

Compute the rotation angle vector, ra, associated with a specified global coordinate location x. This is a compact rotation angle vector using the Rodriques formula which is equivalent to the direction cosine matrix computed using vis_CoordSysDirCos().

Parameters:
  • p – Pointer to CoordSys object.

  • x – Origin of coordinate system in global coordinates.

  • ra[out] Rotation angle vector of system local axes.

void vis_CoordSysRotAngdv(vis_CoordSys *p, Vdouble x[3], Vdouble rotang[3])

compute rotation angle vector

See vis_CoordSysRotAng()

void vis_CoordSysOriginTriad(vis_CoordSys *p, Vfloat x[3], Vfloat tm[3][3])

query origin and orientation

Query the coordinate system origin, x in global coordinates and the system orientation, tm.

Parameters:
  • p – Pointer to CoordSys object.

  • x[out] Origin of coordinate system in global coordinates.

  • tm[out] Direction cosine matrix of system local axis.

void vis_CoordSysOriginTriaddv(vis_CoordSys *p, Vdouble x[3], Vdouble tm[3][3])

query origin and orientation

See vis_CoordSysOriginTriad()

void vis_CoordSysOriginRotAng(vis_CoordSys *p, Vfloat x[3], Vfloat rotang[3])

query origin and orientation

Query the coordinate system origin, x in global coordinates and the system orientation as a rotation angle vector, rotang.

Parameters:
  • p – Pointer to CoordSys object.

  • x[out] Origin of coordinate system in global coordinates.

  • rotang[out] Rotation angle vector of system local axis.

void vis_CoordSysOriginRotAngdv(vis_CoordSys *p, Vdouble x[3], Vdouble rotang[3])

query origin and orientation

Query the coordinate system origin, x in global coordinates and the system orientation as a rotation angle vector, rotang.

Parameters:
  • p – Pointer to CoordSys object.

  • x[out] Origin of coordinate system in global coordinates.

  • rotang[out] Rotation angle vector of system local axis.

void vis_CoordSysConvertCoord(vis_CoordSys *p, Vfloat x[3], Vfloat xl[3])

convert coordinates to local system

Convert global coordinate location, x, to local coordinates xl. Use vis_CoordSysComputeCoord() to perform the inverse operation.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Global coordinates

  • xl[out] Local coordinates

void vis_CoordSysConvertCoorddv(vis_CoordSys *p, Vdouble x[3], Vdouble xl[3])

convert coordinates to local system

See vis_CoordSysConvertCoord()

void vis_CoordSysComputeCoord(vis_CoordSys *p, Vfloat xl[3], Vfloat x[3])

compute coordinates in global system

Compute global coordinate location, x, of a point, xl, expressed in local coordinates. Use vis_CoordSysConvertCoord() to perform the inverse operation.

Parameters:
  • p – Pointer to CoordSys object.

  • xl – Local coordinates

  • x[out] Global coordinates

void vis_CoordSysComputeCoorddv(vis_CoordSys *p, Vdouble x[3], Vdouble xg[3])

compute coordinates in global system

See vis_CoordSysComputeCoord()

void vis_CoordSysComputeVector(vis_CoordSys *p, Vfloat x[3], Vfloat vl[3], Vfloat v[3])

compute vector in global system

Compute a vector, v, expressed in global coordinates given the vector, vl expressed in local coordinates at global coordinate location x.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Global coordinate location

  • vl – Vector in local coordinates

  • v[out] Vector in global coordinates

void vis_CoordSysComputeVectordv(vis_CoordSys *p, Vdouble x[3], Vdouble t[3], Vdouble tg[3])

compute vector in global system

See vis_CoordSysComputeVector()

void vis_CoordSysComputeTensor(vis_CoordSys *p, Vfloat x[3], Vfloat tl[6], Vfloat t[6])

compute tensor in global system

Compute a symmetric tensor, t, expressed in global coordinates given the tensor, tl expressed in local coordinates at global coordinate location x.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Global coordinate location

  • tl – Tensor in local coordinates

  • t[out] Tensor in global coordinates

void vis_CoordSysComputeTensordv(vis_CoordSys *p, Vdouble x[3], Vdouble t[6], Vdouble tg[6])

compute tensor in global system

See vis_CoordSysComputeTensor()

void vis_CoordSysComputeMatrix(vis_CoordSys *p, Vfloat x[3], Vfloat gl[9], Vfloat g[9])

compute general tensor in global system

Compute a general tensor, g, expressed in global coordinates given the general tensor, gl expressed in local coordinates at global coordinate location x.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Global coordinate location

  • gl – General tensor in local coordinates

  • g[out] General tensor in global coordinates

void vis_CoordSysComputeMatrixdv(vis_CoordSys *p, Vdouble x[3], Vdouble t[9], Vdouble tg[9])

compute general tensor in global system

See vis_CoordSysComputeMatrix()

void vis_CoordSysConvertVector(vis_CoordSys *p, Vfloat x[3], Vfloat v[3], Vfloat vl[3])

convert vector to local system

Convert a vector, v, expressed in global coordinates at global coordinate location x to the vector, vl expressed in local coordinates. Use vis_CoordSysComputeVector() to perform the inverse operation.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Global coordinate location

  • v – Vector in global coordinates

  • vl[out] Vector in local coordinates

void vis_CoordSysConvertVectordv(vis_CoordSys *p, Vdouble x[3], Vdouble t[3], Vdouble tl[3])

convert vector to local system

See vis_CoordSysConvertVector()

void vis_CoordSysConvertTensor(vis_CoordSys *p, Vfloat x[3], Vfloat t[6], Vfloat tl[6])

convert tensor to local system

Convert a symmetric tensor, t, expressed in global coordinates at global coordinate location x to the tensor, tl expressed in local coordinates. Use vis_CoordSysComputeTensor() to perform the inverse operation.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Global coordinate location

  • t – Tensor in global coordinates

  • tl[out] Tensor in local coordinates

void vis_CoordSysConvertTensordv(vis_CoordSys *p, Vdouble x[3], Vdouble t[6], Vdouble tl[6])

convert tensor to local system

See vis_CoordSysConvertTensor()

void vis_CoordSysConvertMatrix(vis_CoordSys *p, Vfloat x[3], Vfloat g[9], Vfloat gl[9])

convert general tensor to local system

Convert a general tensor, g, expressed in global coordinates at global coordinate location x to the general tensor, gl expressed in local coordinates. Use vis_CoordSysComputeMatrix() to perform the inverse operation.

Parameters:
  • p – Pointer to CoordSys object.

  • x – Global coordinate location

  • g – General tensor in global coordinates

  • gl[out] General tensor in local coordinates

void vis_CoordSysConvertMatrixdv(vis_CoordSys *p, Vdouble x[3], Vdouble t[9], Vdouble tl[9])

convert general tensor to local system

See vis_CoordSysConvertMatrix()

void vis_CoordSysCopy(vis_CoordSys *p, vis_CoordSys *q)

make a copy

See vis_CoordSysBegin()

void vis_CoordSysTransform(vis_CoordSys *p, Vdouble u[3], Vdouble tm[3][3])

translate and rotate a coordinate system

Transform CoordSys by a translation u, and a rotation tm.

Parameters:
  • p – Pointer to CoordSys object.

  • u – Translation vector

  • tm – Rotation direction cosine matrix

2.3. Units - Units

The Units object is used to define the units for physical quantities. The basic unit types supported are length, mass, time, temperature, angle and charge. The methods associated with a Units object are the following.

Instance a Units object using vis_UnitsBegin(). By default the base and conversion units are set to SI and all conversion factors are set to unity. Once a Units object is instanced, set the base unit types using vis_UnitsSetBase(). If the Units object is to be used to convert units, set the conversion unit types using vis_UnitsSetConv() after setting the base unit type and set the conversion factors using vis_UnitsSetFactor(). Usually it is only necessary to set conversion factors if either the base or conversion units type is “USER”. The conversion factors may be automatically computed and set using vis_UnitsComputeFactors().

The basic unit types are length, mass, time, temperature, angle and charge. A unit of measurement is defined for each unit type as follows:

  • Length, UNITS_LENGTH

    UNITS_LENGTH_METER (default)
    UNITS_LENGTH_CENTIMETER
    UNITS_LENGTH_MILLIMETER
    UNITS_LENGTH_MICRON
    UNITS_LENGTH_NANOMETER
    UNITS_LENGTH_ANGSTROM
    UNITS_LENGTH_KILOMETER
    UNITS_LENGTH_INCH
    UNITS_LENGTH_FOOT
    UNITS_LENGTH_MILE
    UNITS_LENGTH_USER
  • Mass, UNITS_MASS

    UNITS_MASS_KILOGRAM (default)
    UNITS_MASS_METRICTON
    UNITS_MASS_GRAM
    UNITS_MASS_POUND
    UNITS_MASS_SLUG
    UNITS_MASS_METRICTON
    UNITS_MASS_BLOB
    UNITS_MASS_KILOGRAMFM
    UNITS_MASS_KILOGRAMFMM
    UNITS_MASS_USER
  • Time, UNITS_TIME

    UNITS_TIME_SECOND (default)
    UNITS_TIME_MINUTE
    UNITS_TIME_HOUR
    UNITS_TIME_USER
  • Temperature, UNITS_TEMP

    UNITS_TEMP_KELVIN (default)
    UNITS_TEMP_CELSIUS
    UNITS_TEMP_RANKINE
    UNITS_TEMP_FAHRENHEIT
    UNITS_TEMP_USER
  • Angle, UNITS_ANGLE

    UNITS_ANGLE_RADIAN (default)
    UNITS_ANGLE_DEGREE
    UNITS_ANGLE_CYCLE
    UNITS_ANGLE_USER
  • Charge, UNITS_CHARGE

    UNITS_CHARGE_COULOMB (default)
    UNITS_CHARGE_USER

Associated with each unit type is a conversion unit type and conversion factor. The conversion unit types are set using vis_UnitsSetConv(). The conversion factor for each unit type is set using vis_UnitsSetFactor(). The conversion factors are applied to the base units to yield the conversion units.

unit_conversion = factor*unit_base

Temperature comversion requires use of an offset. Specifically for temperature the conversion is as follows:

temp_conversion = factor*(temp_base + offset)

By default the conversion unit types are set to the basic unit types (SI units) and the conversion factors are all unity and the temperature offset is zero.

2.4. Function Descriptions

The currently available Units functions are described in detail in this section.

vis_Units *vis_UnitsBegin(void)

create an instance of a Units object

Create an instance of a Units object. Memory is allocated for the object private data and the pointer to the data is returned. By default the units types are SI, ie length in meters, mass in kilograms, time in seconds, temperature in Kelvin. Angles are in radians.

Destroy an instance of a Units object using

void vis_UnitsEnd (vis_Units *units)

Return the current value of a Units object error flag using

Vint vis_UnitsError (vis_Units *units)

Make a copy of a Units object. The private data from the fromunits object is copied to the units object. Any previous private data in units is lost.

void vis_UnitsCopy (vis_Units *units,
                    vis_Units *fromunits)

Returns:

The function returns a pointer to the newly created Units object. If the object creation fails, NULL is returned.

void vis_UnitsEnd(vis_Units *p)

destroy an instance of a Units object

See vis_UnitsBegin()

Vint vis_UnitsError(vis_Units *p)

return the current value of a Units object error flag

See vis_UnitsBegin()

void vis_UnitsSetBase(vis_Units *p, Vint type, Vint value)

set basic unit types

Set the basic units type. The conversion unit type is also set to this type. The conversion factor is set to unity.

Get basic unit types as output arguments.

void vis_UnitsGetBase (vis_Units *units,
                       Vint type,
                       Vint *value)

Errors

VIS_ERROR_ENUM is generated if an improper type or value is specified.

Parameters:
  • p – Pointer to Units object.

  • type – Units type.

    x=UNITS_LENGTH            Length
     =UNITS_MASS              Mass
     =UNITS_TIME              Time
     =UNITS_TEMP              Temperature
     =UNITS_ANGLE             Angle
     =UNITS_CHARGE            Charge
    

  • value – Units type value

    x=UNITS_LENGTH_METER      Meter
     =UNITS_LENGTH_CENTIMETER Centimeter
     =UNITS_LENGTH_MILLIMETER Millimeter
     =UNITS_LENGTH_MICRON     Micron
     =UNITS_LENGTH_NANOMETER  Nanometer
     =UNITS_LENGTH_ANGSTROM   Angstrom
     =UNITS_LENGTH_KILOMETER  Kilometer
     =UNITS_LENGTH_INCH       Inch
     =UNITS_LENGTH_FOOT       Foot
     =UNITS_LENGTH_MILE       Mile
     =UNITS_LENGTH_USER       User defined
     =UNITS_MASS_KILOGRAM     Kilogram
     =UNITS_MASS_METRICTON    Metric ton
     =UNITS_MASS_GRAM         Gram
     =UNITS_MASS_POUND        Pound
     =UNITS_MASS_SLUG         Slug
     =UNITS_MASS_METRICTON    Metric ton
     =UNITS_MASS_BLOB         Blob
     =UNITS_MASS_KILOGRAMFM   kgf-sec**2/m
     =UNITS_MASS_KILOGRAMFMM  kgf-sec**2/mm
     =UNITS_MASS_USER         User defined
     =UNITS_TIME_SECOND       Second
     =UNITS_TIME_MINUTE       Minute
     =UNITS_TIME_HOUR         Hour
     =UNITS_TIME_USER         User defined
     =UNITS_TEMP_KELVIN       Kelvin
     =UNITS_TEMP_CELSIUS      Celsius
     =UNITS_TEMP_RANKINE      Rankine
     =UNITS_TEMP_FAHRENHEIT   Fahrenheit
     =UNITS_TEMP_USER         User defined
     =UNITS_ANGLE_RADIAN      Radian
     =UNITS_ANGLE_DEGREE      Degree
     =UNITS_ANGLE_CYCLE       Cycle, 2 pi radians
     =UNITS_ANGLE_USER        User defined
     =UNITS_CHARGE_COULOMB    Coulomb
     =UNITS_CHARGE_USER       User defined
    

void vis_UnitsGetBase(vis_Units *p, Vint type, Vint *value)

get basic unit types as output arguments

See vis_UnitsSetBase()

void vis_UnitsSetConv(vis_Units *p, Vint type, Vint value)

set conversion unit types

Set the conversion unit types. The possible unit types are listed in vis_UnitsSetBase(). Specify conversion factors and temperature offset using vis_UnitsSetFactor().

Get the set conversion unit types as output arguments.

void vis_UnitsGetConv (vis_Units *units,
                       Vint type,
                       Vint *value)

Errors

VIS_ERROR_ENUM is generated if an improper type or value is specified.

Parameters:
  • p – Pointer to Units object.

  • type – Units type.

  • value – Units type value

void vis_UnitsGetConv(vis_Units *p, Vint type, Vint *value)

get conversion unit types

See vis_UnitsSetConv()

void vis_UnitsSetFactor(vis_Units *p, Vint type, Vdouble value)

set conversion factors

Set the conversion unit conversion factors. The temperature conversion requires an addition temperature offset.

Get the set conversion unit factors as output arguments.

void vis_UnitsGetFactor (vis_Units *units,
                         Vint type)
                         Vdouble *value)

Errors

VIS_ERROR_ENUM is generated if an improper type is specified.

Parameters:
  • p – Pointer to Units object.

  • type – Units type.

    x=UNITS_LENGTH            Length
     =UNITS_MASS              Mass
     =UNITS_TIME              Time
     =UNITS_TEMP              Temperature
     =UNITS_TEMP_OFFSET       Temperature offset
     =UNITS_ANGLE             Angle
     =UNITS_CHARGE            Charge
    

  • value – Unit factor or offset

void vis_UnitsGetFactor(vis_Units *p, Vint type, Vdouble *value)

get conversion factors

See vis_UnitsSetFactor()

void vis_UnitsComputeFactors(vis_Units *p)

compute and set conversion factors

Compute and set the conversion unit conversion factors.

Parameters:

p – Pointer to Units object.

void vis_UnitsCopy(vis_Units *p, vis_Units *fromp)

make a copy of a Units object

See vis_UnitsBegin()

2.5. Visualization Context - VisContext

There are many attributes which can affect the display of a visualization entity such as a tensor marker or an isosurface. Examples of these attributes are color, transparency, size, shading, line width and line style. A collection of visualization attributes which affect the display of a given visualization entity is termed the visualization context. It is the function of a VisContext object to hold these attributes as its private data and act as a convenient method of passing these attributes to objects which perform the actual display of a visualization entity. In some cases only a subset of the attributes held in a VisContext object are accessed by given visualization object. On the other hand, for more complex visualization objects more than one VisContext object may be required. The methods associated with a VisContext object are the following.

The attributes of a visualization context have a specific interpretation when used by any given visualization object.

Each VisContext object contains an internal modification counter. A visualization object which uses a VisContext object is sensitive to the modification counter in that it signals when a VisContext object has been changed or “touched”. If a visualization object detects that the modification counter of a VisContext object has been changed, then initializing graphics attributes such as color, transparency and line width are generated when the drawing methods for that visualization object are called. For this reason, when using more than one visualization object, vis_VisContextTouch() should be called before invoking the drawing methods of a visualization object.

2.6. Function Descriptions

All attributes which may be set in a VisContext object are accessed using “inline” methods. These methods are implemented using C preprocessor macros. For example the current color attribute in a VisContext object, viscontext, may be accessed as follows:

color = vis_VisContextColor(vis_VisContext *viscontext);
vis_VisContext *vis_VisContextBegin(void)

create an instance of a VisContext object

Create an instance of a VisContext object. Memory is allocated for the object private data and the pointer to the data is returned. All attributes are set to their default values.

Destroy an instance of a VisContext object using

void vis_VisContextEnd (vis_VisContext *viscontext)

Return the current value of a VisContext object error flag using

Vint vis_VisContextError (vis_VisContext *viscontext)

Make a copy of a VisContext object. The private data from the fromviscontext object is copied to the viscontext object. Any previous private data in viscontext is lost.

void vis_VisContextCopy (vis_VisContext *viscontext,
                         vis_VisContext *fromviscontext)

Returns:

The function returns a pointer to the newly created VisContext object. If the object creation fails, NULL is returned.

void vis_VisContextEnd(vis_VisContext *p)

destroy an instance of a VisContext object

See vis_VisContextBegin()

Vint vis_VisContextError(vis_VisContext *p)

return the current value of a VisContext object error flag

See vis_VisContextBegin()

void vis_VisContextInit(vis_VisContext *p)

set attributes to default values

Set all attributes in a VisContext object to the default values.

Parameters:

p – Pointer to VisContext object.

void vis_VisContextTouch(vis_VisContext *p)

update modification counter

Increment the modification counter of a visualization context object. The modification counter of a visualization context is also incremented whenever one of its attributes is “Set”. Calling this function is generally required when mixing calls to the drawing methods of more than one visualization object. As a general rule, call vis_VisContextTouch() for the VisContext objects used by a visualization object before calling the drawing methods for that object. Once called in this manner, vis_VisContextTouch() need only be called again if the drawing methods of a different visualization object are invoked.

Parameters:

p – Pointer to VisContext object.

void vis_VisContextSetAngle(vis_VisContext *p, Vfloat angle)

set angle in degrees

Set angle in degrees. This attribute is used by Mark objects to specify the half angle of the heads of vectors. The length of a vector head relative to the total length of a vector is specified by the Ratio visualization context which is set using vis_VisContextSetRatio(). By default angle is 24. degrees.

Get angle as output argument using:

void vis_VisContextGetAngle (vis_VisContext *viscontext,
                             Vfloat *angle)

Access angle using:

vis_VisContextAngle (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • angle – Angle in degrees

void vis_VisContextGetAngle(vis_VisContext *p, Vfloat *angle)

get angle in degrees

See vis_VisContextSetAngle()

void vis_VisContextSetBitmapSize(vis_VisContext *p, Vint bitmapsize)

set bitmap size multiplier

Set bitmap size multiplier. Bitmap size affects any visualization object which generates bitmap icons. The bitmap size is an integer multiplier which is applied to the entire bitmap. By default bitmapsize is 1.

Get bitmapsize as output argument using using:

void vis_VisContextGetBitmapSize (vis_VisContext *viscontext,
                                  Vint *bitmapsize)

Access bitmapsize using:

vis_VisContextBitmapSize (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • bitmapsize – Bitmap size multiplier

void vis_VisContextGetBitmapSize(vis_VisContext *p, Vint *bitmapsize)

get bitmap size multiplier

See vis_VisContextGetBitmapSize()

void vis_VisContextSetColor(vis_VisContext *p, Vint color)

set color attributes

Set color or minor color attribute as a color map index. The color attribute is ignored if color is mapped to field value. The minor color attribute is used for coloring secondary items which always appear in a constant color and are never color mapped to field value. By default color is 1.

Get color as output argument using:

void vis_VisContextGetColor (vis_VisContext *viscontext,
                             Vint *color)
void vis_VisContextGetMinorColor (vis_VisContext *viscontext,
                                  Vint *color)

Access color using:

vis_VisContextColor (vis_VisContext *viscontext);
vis_VisContextMinorColor (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • color – Color map index.

void vis_VisContextGetColor(vis_VisContext *p, Vint *color)

get color attributes

See vis_VisContextSetColor()

void vis_VisContextSetMinorColor(vis_VisContext *p, Vint minorcolor)

set color attributes

Set color or minor color attribute as a color map index. The color attribute is ignored if color is mapped to field value. The minor color attribute is used for coloring secondary items which always appear in a constant color and are never color mapped to field value. By default minorcolor is 1.

Get minorcolor as output argument using:

void vis_VisContextGetColor (vis_VisContext *viscontext,
                             Vint *color)
void vis_VisContextGetMinorColor (vis_VisContext *viscontext,
                                  Vint *color)

Access minorcolor using:

vis_VisContextColor (vis_VisContext *viscontext);
vis_VisContextMinorColor (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • minorcolor – Color map index.

void vis_VisContextGetMinorColor(vis_VisContext *p, Vint *minorcolor)

get color attributes

See vis_VisContextSetMinorColor()

void vis_VisContextSetABCColor(vis_VisContext *p, Vint acolor, Vint bcolor, Vint ccolor)

set miscellaneous color attributes

Set miscellaneous color attributes as color map indices. The a,b,c color attributes are used to specify constant colors to miscellaneous visualization entities. In some cases the a,b,c colors complement the x,y,z colors. For example, the Triad module uses the a,b,c colors for the labels used for each coordinate axis. By default a acolor, bcolor and ccolor are 1.

Get acolor, bcolor and ccolor as output arguments using

void vis_VisContextGetABCColor (vis_VisContext *viscontext,
                                Vint *acolor, Vint *bcolor, Vint *ccolor)

Access acolor, bcolor and ccolor respectively using:

vis_VisContextAColor(vis_VisContext *viscontext);
vis_VisContextBColor(vis_VisContext *viscontext);
vis_VisContextCColor(vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • acolor – A color map index.

  • bcolor – B color map index.

  • ccolor – C color map index.

void vis_VisContextGetABCColor(vis_VisContext *p, Vint *acolor, Vint *bcolor, Vint *ccolor)

get miscellaneous color attributes

See vis_VisContextSetABCColor()

void vis_VisContextSetXYZColor(vis_VisContext *p, Vint xcolor, Vint ycolor, Vint zcolor)

set x,y,z color attributes

Set x,y,z color attributes as color map indices. The x,y,z color attributes are used to specify constant colors to visualization entities which are aligned to a coordinate system such as the components of a vector. By default xcolor, ycolor and zcolor are 1.

Get xcolor, ycolor and zcolor as output arguments using:

void vis_VisContextGetXYZColor (vis_VisContext *viscontext,
                                Vint *xcolor,
                                Vint *ycolor,
                                Vint *zcolor)

Access xcolor, ycolor and zcolor respectively using:

vis_VisContextXColor (vis_VisContext *viscontext);
vis_VisContextYColor (vis_VisContext *viscontext);
vis_VisContextZColor (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • xcolor – X color map index.

  • ycolor – Y color map index.

  • zcolor – Z color map index.

void vis_VisContextGetXYZColor(vis_VisContext *p, Vint *xcolor, Vint *ycolor, Vint *zcolor)

get x,y,z color attributes

See vis_VisContextSetXYZColor()

void vis_VisContextSetMapColor(vis_VisContext *p, Vint mapcolor)

set color mapping flag

Set color mapping type. If color mapping is off, then the Color visualization attribute is used to color the appropriate entity. If color mapping is VIS_MAPCOLOR_CONSTANT, then field value is mapped to a color map index using a Levels object. This results in a constant color between levels values. If color mapping is VIS_MAPCOLOR_SMOOTH, then field value is mapped to a linearly interpolated color between bounding color map indices using a Levels object. This results in a smooth color variation between levels values. By default mapcolor is VIS_MAPCOLOR_CONSTANT.

Get mapcolor as output argument using:

void vis_VisContextGetMapColor (vis_VisContext *viscontext,
                                Vint *mapcolor)

Access mapcolor using:

vis_VisContextMapColor (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • mapcolor – Color mapping flag

    x=VIS_MAPCOLOR_NONE      Turn color mapping off
     =VIS_MAPCOLOR_CONSTANT  Constant level color mapping
     =VIS_MAPCOLOR_SMOOTH    Smooth level color mapping
    

void vis_VisContextGetMapColor(vis_VisContext *p, Vint *mapcolor)

get color mapping flag

See vis_VisContextSetMapColor()

void vis_VisContextSetTrans(vis_VisContext *p, Vint trans)

set transparency attribute

Set transparency attribute as a transparency map index. The transparency attribute is ignored if transparency is mapped to field value. By default trans is 0.

Get trans as output argument using:

void vis_VisContextGetTrans (vis_VisContext *viscontext,
                             Vint *trans)

Access trans using:

vis_VisContextTrans (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • trans – Transparency map index.

void vis_VisContextGetTrans(vis_VisContext *p, Vint *transparency)

get transparency attribute

See vis_VisContextSetTrans()

void vis_VisContextSetMapTrans(vis_VisContext *p, Vint maptrans)

set transparency mapping flag

Set transparency mapping flag. If transparency mapping is off, then the Trans visualization attribute is used to determine the transparency of the appropriate entity. If transparency mapping in on, then field value is mapped to transparency map index using a Levels object. By default maptrans is off.

Get maptrans as output argument using:

void vis_VisContextGetMapTrans (vis_VisContext *viscontext,
                                Vint *maptrans)

Access maptrans using:

vis_VisContextMapTrans (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • maptrans – Transparency mapping flag

    =VIS_OFF      Turn transparency mapping flag off
    =VIS_ON       Turn transparency mapping flag on
    

void vis_VisContextGetMapTrans(vis_VisContext *p, Vint *maptrans)

get transparency mapping flag

See vis_VisContextSetMapTrans()

void vis_VisContextSetRatio(vis_VisContext *p, Vfloat ratio)

set ratio

Set ratio. This attribute is used by Mark objects to specify the length of a vector head relative to the total length of a vector. The half angle of a vector head is specified by the Angle visualization context which is set using vis_VisContextSetAngle(). By default ratio is .26 .

Get ratio as output argument using:

void vis_VisContextGetRatio (vis_VisContext *viscontext,
                             Vfloat *ratio)

Access ratio using:

vis_VisContextRatio (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object

  • ratio – Ratio

void vis_VisContextGetRatio(vis_VisContext *p, Vfloat *ratio)

get ratio

See vis_VisContextSetRatio()

void vis_VisContextSetSize(vis_VisContext *p, Vfloat size)

set size attribute

Set size or minor size attribute. The size attribute is used to specify the size in global coordinates of various visualization entities. If size mapping is on, then field value is mapped to size where size represents the size of the visualization entity at maximum field value. The minor size is used to size secondary components of a visualization entity. By default size is 1.

Get size as output argument using:

void vis_VisContextGetSize (vis_VisContext *viscontext,
                            Vfloat *size)
void vis_VisContextGetMinorSize (vis_VisContext *viscontext,
                                 Vfloat *size)

Access size using:

vis_VisContextSize (vis_VisContext *viscontext);
vis_VisContextMinorSize (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • size – Size in global coordinates

void vis_VisContextGetSize(vis_VisContext *p, Vfloat *size)

get size attribute

See vis_VisContextSetSize()

void vis_VisContextSetMinorSize(vis_VisContext *p, Vfloat minorsize)

set size attribute

Set size or minor size attribute. The size attribute is used to specify the size in global coordinates of various visualization entities. If size mapping is on, then field value is mapped to size where minorsize represents the size of the visualization entity at maximum field value. The minor size is used to size secondary components of a visualization entity. By default minorsize is 1.

Get size as output argument using:

void vis_VisContextGetSize (vis_VisContext *viscontext,
                            Vfloat *size)
void vis_VisContextGetMinorSize (vis_VisContext *viscontext,
                                 Vfloat *size)

Access size using:

vis_VisContextSize (vis_VisContext *viscontext);
vis_VisContextMinorSize (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • minorsize – Size in global coordinates

void vis_VisContextGetMinorSize(vis_VisContext *p, Vfloat *minorsize)

get minor size attribute

See vis_VisContextSetMinorSize()

void vis_VisContextSetMapSize(vis_VisContext *p, Vint mapsize)

set size mapping flag

Set size mapping flag. If size mapping is off, then the Size visualization attribute is used to size the appropriate entity. If size mapping in on, then field value is mapped to size using a Levels object. Size is scaled to field value by linearly mapping the maximum absolute value of the field value extremes contained in the Levels object to mapsize. This means that entities with zero field value are drawn as a single pixel and entities at the maximum absolute field value are drawn with mapsize. Note that most visualization objects inhibit the drawing of entities which have a zero field value and as a result have been mapped to a single pixel. By default mapsize is off.

Get mapsize as output argument using:

void vis_VisContextGetMapSize (vis_VisContext *viscontext,
                               Vint *mapsize)

Access mapsize using:

vis_VisContextMapSize (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • mapsize – Size mapping flag

    =VIS_OFF      Turn size mapping flag off
    =VIS_ON       Turn size mapping flag on
    

void vis_VisContextGetMapSize(vis_VisContext *p, Vint *mapsize)

get size mapping flag

See vis_VisContextSetMapSize()

void vis_VisContextSetComponent(vis_VisContext *p, Vint component)

set component type

Set component type. If the component flag is VIS_COMPONENT_PRINCIPAL, then vector and tensor markers and values are displayed in resultant or principal directions. If the component flag is VIS_COMPONENT_BASIC, then vector and tensor markers and values are displayed in component form in the coordinate systems in which they are defined. If the component flag is VIS_COMPONENT_MAXSHEAR, then tensor markers and values are displayed in the directions of maximum shear. Vector and matrix markers and values are displayed in resultant or principal directions. By default component is VIS_COMPONENT_PRINCIPAL.

Get component as output argument using:

void vis_VisContextGetComponent (vis_VisContext *viscontext,
                                 Vint *component)

Access component using:

vis_VisContextComponent (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • component – Component flag

    x=VIS_COMPONENT_PRINCIPAL      Principal components
     =VIS_COMPONENT_BASIC          Basic components
     =VIS_COMPONENT_MAXSHEAR       Maximum shear components
    

void vis_VisContextGetComponent(vis_VisContext *p, Vint *component)

get component type

See vis_VisContextSetComponent()

void vis_VisContextSetShade(vis_VisContext *p, Vint shade)

set light source shading attribute

Set light source shading attribute. The shade attribute is used to specify the type of surface normals computed for polygon graphics primitives. If no shading is specified, polygons are sent to the graphics subsystem (drawn) with no normals supplied. If flat shading is specified then polygons are drawn with a single surface normal per facet. If vertex shading is specified then polygons are drawn with normals supplied at each polygon vertex. By default shade is VIS_FLATSHADE.

Get shade as output argument using:

void vis_VisContextGetShade (vis_VisContext *viscontext,
                             Vint *shade)

Access shade using:

vis_VisContextShade (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper shade is specified.

Parameters:
  • p – Pointer to VisContext object.

  • shade – Light source shading.

    x=VIS_NOSHADE            No shading
     =VIS_FLATSHADE          Flat shading
     =VIS_VERTEXSHADE        Vertex shading
    

void vis_VisContextGetShade(vis_VisContext *p, Vint *shade)

get light source shading attribute

See vis_VisContextSetShade()

void vis_VisContextSetRefinement(vis_VisContext *p, Vint refinement)

set order of refinement attribute

Set the order of refinement attribute. The refinement attribute is used to specify the degree of tessellation used on curved lines and surfaces as well as polygonal and polyhedral cells.

For Serendipity and Lagrange topologies, a refinement of -1 will tesselate using only the end points of a line and the corner points of a surface. A refinement of 0 yields a tesselation which uses all points on a curved line or surface without subdividing the line or edges of the surface. A refinement of 1 or 2 subdivides the line and surface. Incrementing the refinement generally doubles the number of subdivisions along a particular dimension.

For polygonal and polyhedral cells, a a refinement of -1 or 0 will tesselate using only the points defining the cell, a refinement greater than zero will add center points to the cell and cell faces for tesselation.

By default refinement is 0.

Get refinement as output argument using:

void vis_VisContextGetRefinement (vis_VisContext *viscontext,
                                  Vint *refinement)

Access refinement using:

vis_VisContextRefinement (vis_VisContext *viscontext);

Errors

VIS_ERROR_VALUE is generated if an improper refinement is specified.

Parameters:
  • p – Pointer to VisContext object.

  • refinement – Order of refinement. -1 <= refinement <= 2.

void vis_VisContextGetRefinement(vis_VisContext *p, Vint *refinement)

get order of refinement attribute

See vis_VisContextSetRefinement()

void vis_VisContextSetPrimType(vis_VisContext *p, Vint primtype)

set suggested primitive type

Set suggested primitive type to be generated by visualization modules. Primitive type affects the Contour and Face visualization modules. The primitive type is only a suggested type. It may not be possible for the visualization modules to effectively build the suggested primitive type. If the suggested primitive type can not be supported then polygon types are generated. By default primtype is VIS_PRIM_POLY.

Get primtype as output argument using:

void vis_VisContextGetPrimType (vis_VisContext *viscontext,
                                Vint *primtype)

Access primtype using:

vis_VisContextPrimType (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • primtype – Primitive type

    x=VIS_PRIM_POLY          Polygon
     =VIS_PRIM_ARRAY         Arrays of triangles, quads or lines
     =VIS_PRIM_STRIP         Triangle strips
    

void vis_VisContextGetPrimType(vis_VisContext *p, Vint *primtype)

get suggested primitive type

See vis_VisContextSetPrimType()

void vis_VisContextSetUnitTol(vis_VisContext *p, Vfloat unittol)

set unit tolerance

Set unit tolerance. The unit tolerance represents a relative tolerance measure used as a tolerance bound. Unit tolerances are usually small which respect to unity. This tolerance bound is in contrast to the distance tolerance, set by vis_VisContextSetDistTol(), which is an absolute world coordinate distance tolerance. By default unittol is .001.

Get unittol as output argument using:

void vis_VisContextGetUnitTol (vis_VisContext *viscontext,
                               Vfloat *unittol)

Access utol using:

vis_VisContextUnitTol (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • unittol – Unit tolerance

void vis_VisContextGetUnitTol(vis_VisContext *p, Vfloat *utol)

get unit tolerance

See vis_VisContextSetUnitTol()

void vis_VisContextSetDistTol(vis_VisContext *p, Vfloat disttol)

set distance tolerance

Set distance tolerance. The distance tolerance represents an absolute global coordinate distance used as a tolerance bound for certain operations such as intersection testing. This tolerance bound is in contrast to the unit tolerance, set by vis_VisContextSetUnitTol(), which is a tolerance relative to some other measure such as edge length or face area, etc. By default disttol is .001.

Get disttol as output argument using:

void vis_VisContextGetDistTol (vis_VisContext *viscontext,
                               Vfloat *disttol)

Access disttol using:

vis_VisContextDistTol (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • disttol – Distance tolerance

void vis_VisContextGetDistTol(vis_VisContext *p, Vfloat *dtol)

get distance tolerance

See vis_VisContextSetDistTol()

void vis_VisContextSetPosition(vis_VisContext *p, Vint position)

set position or direction attribute

Set position or direction attribute. This attribute is used to specify the baseline position of text strings or the direction of axes, etc. By default position is VIS_BOTTOMLEFT.

Get position as output argument using:

void vis_VisContextGetPosition (vis_VisContext *viscontext,
                                Vint *position)

Access position using:

vis_VisContextPosition (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper position is specified.

Parameters:
  • p – Pointer to VisContext object.

  • position – Position or direction

    x=VIS_LEFT               Left
     =VIS_RIGHT              Right
     =VIS_BOTTOM             Bottom
     =VIS_TOP                Top
     =VIS_CENTER             Center
     =VIS_BOTTOMLEFT         Bottom left
     =VIS_TOPLEFT            Top left
     =VIS_BOTTOMRIGHT        Bottom right
     =VIS_TOPRIGHT           Top right
    

void vis_VisContextGetPosition(vis_VisContext *p, Vint *position)

get position or direction attribute

See vis_VisContextSetPosition()

void vis_VisContextSetFill(vis_VisContext *p, Vint fill)

set fill flag

Set fill flag on or off. The fill flag determines whether or not certain visualization entities are polygon filled. By default fill is on.

Get fill as output argument using:

void vis_VisContextGetFill (vis_VisContext *viscontext,
                            Vint *fill)

Access fill using:

vis_VisContextFill (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • fill – Fill flag

    =VIS_OFF      Turn fill flag off
    =VIS_ON       Turn fill flag on
    

void vis_VisContextGetFill(vis_VisContext *p, Vint *fill)

get fill flag

See vis_VisContextSetFill()

void vis_VisContextSetEdge(vis_VisContext *p, Vint edge)

set edge flag

Set edge flag on or off. The edge flag determines whether or not the boundaries of certain visualization entities are drawn. By default edge is off.

Get edge as output argument using:

void vis_VisContextGetEdge (vis_VisContext *viscontext,
                            Vint *edge)

Access edge using:

vis_VisContextEdge (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • edge – Edge flag

    =VIS_OFF      Turn edge flag off
    =VIS_ON       Turn edge flag on
    

void vis_VisContextGetEdge(vis_VisContext *p, Vint *edge)

get edge flag

See vis_VisContextSetEdge()

void vis_VisContextSetSpot(vis_VisContext *p, Vint spot)

set spot flag

Set spot flag on or off. The spot flag determines whether or not the nodes or points of certain visualization entities are drawn. By default spot is off.

Get spot as output argument using:

void vis_VisContextGetSpot (vis_VisContext *viscontext,
                            Vint *spot)

Access spot using:

vis_VisContextSpot (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • spot – Spot flag

    =VIS_OFF      Turn spot flag off
    =VIS_ON       Turn spot flag on
    

void vis_VisContextGetSpot(vis_VisContext *p, Vint *spot)

get spot flag

See vis_VisContextSetSpot()

void vis_VisContextSetLineStyle(vis_VisContext *p, Vint linestyle)

set line style

Set line style or minor line style attribute. Line style affects most visualization displays. The minor line style is used for secondary lines in a visualization entity. By default linestyle is VIS_SOLID.

Get linestyle as output argument using:

void vis_VisContextGetLineStyle (vis_VisContext *viscontext,
                                 Vint *linestyle)
void vis_VisContextGetMinorLineStyle (vis_VisContext *viscontext,
                                      Vint *linestyle)

Access linestyle using:

vis_VisContextLineStyle (vis_VisContext *viscontext);
vis_VisContextMinorLineStyle (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper linestyle is specified.

Parameters:
  • p – Pointer to VisContext object.

  • linestyle – Line style

    =VIS_SOLID    Solid line
    =VIS_DASHDASH Dashed line
    =VIS_DOTDOT   Dotted line
    =VIS_DOTDASH  Dot dash line
    =VIS_CYLINDER Solid cylinder
    

void vis_VisContextGetLineStyle(vis_VisContext *p, Vint *linestyle)

get line style

See vis_VisContextSetLineStyle()

void vis_VisContextSetMinorLineStyle(vis_VisContext *p, Vint minorlinestyle)

set minor line style

Set line style or minor line style attribute. Line style affects most visualization displays. The minor line style is used for secondary lines in a visualization entity. By default minorlinestyle is VIS_SOLID.

Get minorlinestyle as output argument using:

void vis_VisContextGetLineStyle (vis_VisContext *viscontext,
                                 Vint *linestyle)
void vis_VisContextGetMinorLineStyle (vis_VisContext *viscontext,
                                      Vint *minorlinestyle)

Access minorlinestyle using:

vis_VisContextLineStyle (vis_VisContext *viscontext);
vis_VisContextMinorLineStyle (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper minorlinestyle is specified.

Parameters:
  • p – Pointer to VisContext object.

  • minorlinestyle – Line style

    =VIS_SOLID    Solid line
    =VIS_DASHDASH Dashed line
    =VIS_DOTDOT   Dotted line
    =VIS_DOTDASH  Dot dash line
    =VIS_CYLINDER Solid cylinder
    

void vis_VisContextGetMinorLineStyle(vis_VisContext *p, Vint *minorlinestyle)

get minor line style

See vis_VisContextSetMinorLineStyle()

void vis_VisContextSetLineWidth(vis_VisContext *p, Vint linewidth)

set line width

Set line width or minor line width attribute. Line width affects most visualization displays. The minor line width is used for secondary lines in a visualization entity. The line width is an integer multiplier applied to a single pixel wide line. For solid cylinder line styles, a unit width line has a radius equal to the Size visualization attribute (see vis_VisContextSize()). By default linewidth is 1.

Get linewidth as output argument using:

void vis_VisContextGetLineWidth (vis_VisContext *viscontext,
                                 Vint *linewidth)
void vis_VisContextGetMinorLineWidth (vis_VisContext *viscontext,
                                      Vint *linewidth)

Access linewidth using:

vis_VisContextLineWidth (vis_VisContext *viscontext);
vis_VisContextMinorLineWidth (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • linewidth – Line width multiplier

void vis_VisContextGetLineWidth(vis_VisContext *p, Vint *linewidth)

get line width

See vis_VisContextSetLineWidth()

void vis_VisContextSetMinorLineWidth(vis_VisContext *p, Vint minorlinewidth)

set line width

Set line width or minor line width attribute. Line width affects most visualization displays. The minor line width is used for secondary lines in a visualization entity. The line width is an integer multiplier applied to a single pixel wide line. For solid cylinder line styles, a unit width line has a radius equal to the Size visualization attribute (see vis_VisContextSize()). By default minorlinewidth is 1.

Get linewidth as output argument using:

void vis_VisContextGetLineWidth (vis_VisContext *viscontext,
                                 Vint *linewidth)
void vis_VisContextGetMinorLineWidth (vis_VisContext *viscontext,
                                      Vint *linewidth)

Access linewidth using:

vis_VisContextLineWidth (vis_VisContext *viscontext);
vis_VisContextMinorLineWidth (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • minorlinewidth – Line width multiplier

void vis_VisContextGetMinorLineWidth(vis_VisContext *p, Vint *minorlinewidth)

get minor line width

See vis_VisContextSetMinorLineWidth()

void vis_VisContextSetPointSize(vis_VisContext *p, Vint pointsize)

set point size

Set point size. Point size affects any visualization object which generates discrete point graphics primitives. The point size is an integer multiplier which is applied to a single pixel point. For example, a point size of 2 is meant to produce points which are 2 by 2 squares of pixels. By default pointsize is 1.

Get pointsize as output argument using:

void vis_VisContextGetPointSize (vis_VisContext *viscontext,
                                 Vint *pointsize)

Access pointsize using:

vis_VisContextPointSize (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • pointsize – Point size multiplier

void vis_VisContextGetPointSize(vis_VisContext *p, Vint *pointsize)

get point size

See vis_VisContextSetPointSize()

void vis_VisContextSetFormat(vis_VisContext *p, Vint format)

set format attribute

Set format attribute. This attribute is used to determine the format to be used whenever numbers are drawn, value displays, axis labels, etc. VIS_XFORMAT is used to indicate that the mantissa is to be displayed separately from the exponent in scientific floating point format. The exact nature of the display is module dependent. VIS_GFORMAT in addition to adaptively selecting fixed for floating point format also displays fewer significant digits. By default format is VIS_EFORMAT. Use VIS_E2FORMAT and VIS_E3FORMAT to control the number of digits in the exponent.

Get format as output argument using:

void vis_VisContextGetFormat (vis_VisContext *viscontext,
                              Vint *format)

Access format using:

vis_VisContextFormat (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper format is specified.

Parameters:
  • p – Pointer to VisContext object.

  • format – Format.

    =VIS_EFORMAT  Use scientific floating point format
    =VIS_E2FORMAT Use scientific floating point format
                  with minimum of 2 digits in exponent
    =VIS_E3FORMAT Use scientific floating point format
                  with minimum of 3 digits in exponent
    =VIS_FFORMAT  Use fixed floating point format
    =VIS_IFORMAT  Use integer format
    =VIS_GFORMAT  Use adaptive fixed or scientific floating
                  point format
    =VIS_XFORMAT  Use extended scientific floating point format
    

void vis_VisContextGetFormat(vis_VisContext *p, Vint *format)

get format attribute

See vis_VisContextSetFormat()

void vis_VisContextSetFrequency(vis_VisContext *p, Vint frequency)

set frequency attribute

Set frequency attribute. This attribute is an integer greater than or equal to zero. It is used in a general way to specify the number or frequency of occurrence of an item such as an axis label or contour line label. By default frequency is 0.

Get frequency as output argument using:

void vis_VisContextGetFrequency (vis_VisContext *viscontext,
                                 Vint *frequency)

Access frequency using:

vis_VisContextFrequency (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • frequency – Frequency

void vis_VisContextGetFrequency(vis_VisContext *p, Vint *frequency)

get frequency attribute

See vis_VisContextSetFrequency()

void vis_VisContextSetMarkerType(vis_VisContext *p, Vint markertype)

set marker type attribute

Set marker type attribute. Note that the point marker types, VIS_POINT, VIS_POINT2, etc. and circle marker types, VIS_CIRCLE3, VIS_CIRCLE5, etc. are not effected by size mapping. By default markertype is VIS_TRIANGLE.

Get markertype as output argument using:

void vis_VisContextGetMarkerType (vis_VisContext *viscontext,
                                  Vint *markertype)

Access markertype using:

vis_VisContextMarkerType (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper markertype is specified.

Parameters:
  • p – Pointer to VisContext object.

  • markertype – Marker type

    x=VIS_BOX                Filled box
     =VIS_CIRCLE             Circle
     =VIS_CIRCLE3            Circle, 3 pixel diameter
     =VIS_CIRCLE5            Circle, 5 pixel diameter
     =VIS_CIRCLE7            Circle, 7 pixel diameter
     =VIS_CIRCLE9            Circle, 9 pixel diameter
     =VIS_DOT                Filled Circle
     =VIS_DIAMOND            Diamond
     =VIS_HOURGLASS          Hourglass
     =VIS_METER              Meter
     =VIS_OCTAHEDRON         Filled octahedron
     =VIS_PLUSSIGN           Plus sign
     =VIS_POINT              Point, single pixel
     =VIS_POINT2             Point, 2 by 2 pixel square
     =VIS_POINT4             Point, 4 by 4 pixel square
     =VIS_SPHERE             Filled sphere
     =VIS_SQUARE             Square
     =VIS_TETRAHEDRON        Filled tetrahedron
     =VIS_TRIANGLE           Triangle
    

void vis_VisContextGetMarkerType(vis_VisContext *p, Vint *markertype)

get marker type attribute

See vis_VisContextSetMarkerType()

void vis_VisContextSetVectorType(vis_VisContext *p, Vint vectortype)

set vector type attribute

Set vector type attribute. This attribute is used by Mark objects, for example, to display vector and tensor markers. By default vectortype is VIS_VECTORLINE.

Get vectortype as output argument using:

void vis_VisContextGetVectorType (vis_VisContext *viscontext,
                                  Vint *vectortype)

Access vectortype using:

vis_VisContextVectorType (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper vectortype is specified.

Parameters:
  • p – Pointer to VisContext object.

  • vectortype – Vector type

    x=VIS_VECTORLINE         Vector line drawn 2D arrow
     =VIS_VECTORCYLINDER     Vector polygon drawn 3D arrow
     =VIS_VECTORUMBRELLA     Vector line drawn 2D tail and
                             polygon drawn 3D head.
    

void vis_VisContextGetVectorType(vis_VisContext *p, Vint *vectortype)

get vector type attribute

See vis_VisContextSetVectorType()

void vis_VisContextSetTensorType(vis_VisContext *p, Vint tensortype)

set tensor type attribute

Set tensor type attribute. This attribute is used only by Mark objects to display tensor “box” markers. Tensor markers are generally drawn as a composite of a tensor box and vector arrows which represent the direction and magnitude of the individual components of the tensor. Use vis_VisContextSetVectorType() to control the appearance of the vector arrows. By default tensortype is VIS_TENSORCUBE.

Get tensortype as output argument using:

void vis_VisContextGetTensorType (vis_VisContext *viscontext,
                                  Vint *tensortype)

Access tensortype using:

vis_VisContextTensorType (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper tensortype is specified.

Parameters:
  • p – Pointer to VisContext object.

  • tensortype – Tensor type

    x=VIS_TENSORCUBE         Tensor "box" is a cube
     =VIS_TENSORELLIPSOID    Tensor "box" is an ellipsoid
     =VIS_TENSORCROWSFEET    Tensor "box" is not drawn,
                             instead the component shear vector
                             icons are drawn bisecting the positive
                             quadrant of the shear plane.
    

void vis_VisContextGetTensorType(vis_VisContext *p, Vint *tensortype)

get tensor type attribute

See vis_VisContextSetTensorType()

void vis_VisContextSetIsoValType(vis_VisContext *p, Vint isovaltype)

set isovalue type attribute

Set isovalue type attribute. The isovalue type is used by Segment, Contour and Threshold objects to determine the method of display for isovalues. By default isovaltype is VIS_ISOVALPOINT.

Get isovaltype as output argument using:

void vis_VisContextGetIsoValType (vis_VisContext *viscontext,
                                  Vint *isovaltype)

Access isovaltype using:

vis_VisContextIsoValType (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper isovaltype is specified.

Parameters:
  • p – Pointer to VisContext object.

  • isovaltype – Isovalue type

    x=VIS_ISOVALPOINT        Draw points at isovalues
     =VIS_ISOVALLINE         Draw lines along isovalues
     =VIS_ISOVALSURFACE      Draw surfaces along isovalues
     =VIS_ISOVALVOLUME       Draw volumes bounding isovalues
     =VIS_ISOVALFRINGE       Draw constant color and transparency
                             fill between isovalues
     =VIS_ISOVALGOURAUD      Draw continuously varying color and
                             constant transparency fill
                             within an element or cell
     =VIS_ISOVALTONE         Draw continuously varying color and
                             constant transparency fill
                             between isovalues
     =VIS_ISOVALTEXTURE      Draw an element or cell by supplying
                             texture coordinates mapped to
                             scalar field values.
    

void vis_VisContextGetIsoValType(vis_VisContext *p, Vint *isovaltype)

get isovalue type attribute

See vis_VisContextSetIsoValType()

void vis_VisContextSetIsoValInterp(vis_VisContext *p, Vint isovalinterp)

set isovalue interpolation method

Set isovalue interpolation. The isovalue interpolation method is used by Segment, Contour and Threshold objects to determine the method of interpolation for the scalar field.

The value of VIS_INTERP_CLAMP uses shape function interpolation but will clamp all interpolated values to the input scalar values. This is useful in avoiding “overshoot” particularly in the case of contouring parabolic Serendipity quadrilaterals. By default isovalinterp is VIS_INTERP_SHAPE.

Get isovalinterp as output argument using:

void vis_VisContextGetIsoValInterp (vis_VisContext *viscontext,
                                    Vint *isovalinterp)

Access isovalinterp using:

vis_VisContextIsoValInterp (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper isovalinterp is specified.

Parameters:
  • p – Pointer to VisContext object.

  • isovalinterp – Isovalue interpolation method

    x=VIS_INTERP_SHAPE       Shape function interpolation
     =VIS_INTERP_CLAMP       Clamped shape function interpolation
    

void vis_VisContextGetIsoValInterp(vis_VisContext *p, Vint *isovalinterp)

get isovalue interpolation method

See vis_VisContextSetIsoValInterp()

void vis_VisContextSetStreamType(vis_VisContext *p, Vint streamtype)

set trace and stream type attribute

Set stream type attribute. This attribute is used only by Trace and Stream objects to display trace and stream lines. By default streamtype is VIS_STREAMLINE. Some stream types are applicable to tangent curve generation in tensor fields.

Get streamtype as output argument using:

void vis_VisContextGetStreamType (vis_VisContext *viscontext,
                                  Vint *streamtype)

Access streamtype using:

vis_VisContextStreamType (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper streamtype is specified.

Parameters:
  • p – Pointer to VisContext object.

  • streamtype – Stream type

    x=VIS_STREAMBOX          Stream box for tensor fields
     =VIS_STREAMELLIPSE      Stream ellipse for tensor fields
     =VIS_STREAMLINE         Streamline
     =VIS_STREAMPOINT        Series of points
     =VIS_STREAMRIBBON       Stream ribbon
     =VIS_STREAMTUBE         Stream tube
     =VIS_STREAMTWIST        Stream tube and ribbon
    

void vis_VisContextGetStreamType(vis_VisContext *p, Vint *streamtype)

get trace and stream type attribute

See vis_VisContextSetStreamType()

void vis_VisContextSetScale(vis_VisContext *p, Vfloat scale)

set scale factor

Set scale factor. The scale factor is a positive value which determines the amount to scale the coordinates of a visualization geometry. This attribute is used by the BeamElem and ShellElem objects, for example, to scale the beam section and shell walls when drawing beam and shell elements. By default scale is 1.

Get scale as output argument using:

void vis_VisContextGetScale (vis_VisContext *viscontext,
                             Vfloat *scale)

Access scale using:

vis_VisContextScale (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • scale – Scale factor

void vis_VisContextGetScale(vis_VisContext *p, Vfloat *scale)

get scale factor

See vis_VisContextSetScale()

void vis_VisContextSetShrink(vis_VisContext *p, Vfloat shrink)

set shrink factor

Set shrink factor. The shrink factor is a value in the interval [0.,1.] which determines the amount to shrink an element towards its centroid for visualization. A shrink factor of 0. results in no shrink. A shrink value of 1. shrinks objects to a point. This attribute is used by the BeamElem and ShellElem objects, for example, to draw beam and shell elements. By default shrink is 0.

Get shrink as output argument using:

void vis_VisContextGetShrink (vis_VisContext *viscontext,
                              Vfloat *shrink)

Access shrink using:

vis_VisContextShrink (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • shrink – Shrink factor

void vis_VisContextGetShrink(vis_VisContext *p, Vfloat *shrink)

get shrink factor

See vis_VisContextSetShrink()

void vis_VisContextSetShrinkType(vis_VisContext *p, Vint shrinktype)

set shrink type

Set shrink type. The shrink type is used by some visualization modules which draw element edges or faces to control the point about which shrink is applied. If the shrink type is VIS_SHRINKENTITY then the point about which shrink is applied is the center of the entity. If the shrink type is VIS_SHRINKELEMENT then the point about which shrink is applied is the center of the element to which the entity belongs. Set the shrink factor using vis_VisContextSetShrink(). By default shrinktype is VIS_SHRINKNONE.

Get shrinktype as output argument using:

void vis_VisContextGetShrinkType (vis_VisContext *viscontext,
                                  Vint *shrinktype)

Access shrinktype using:

vis_VisContextShrinkType (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • shrinktype – Shrink type

    x=VIS_SHRINKNONE         No shrink is performed
     =VIS_SHRINKENTITY       Perform shrink local to entity
     =VIS_SHRINKELEMENT      Perform shrink local to element
    

void vis_VisContextGetShrinkType(vis_VisContext *p, Vint *shrinktype)

get shrink type

See vis_VisContextSetShrinkType()

void vis_VisContextSetReflect(vis_VisContext *p, Vint reflect)

set reflect flag

Set reflect flag on or off. The reflect flag determines whether or not the sense of output polygons is reversed or not. This option is useful when applied to the Face and Contour modules to draw the “bottom” face of a shell element distinctly from the “top” face. Enable back face culling when drawing colocated top and bottom shell surfaces. By default reflect is off.

Get reflect as output argument using:

void vis_VisContextGetReflect (vis_VisContext *viscontext,
                               Vint *reflect)

Access reflect using:

vis_VisContextReflect (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • reflect – Reflect flag

void vis_VisContextGetReflect(vis_VisContext *p, Vint *reflect)

get reflect flag

See vis_VisContextSetReflect()

void vis_VisContextSetDraw(vis_VisContext *p, Vint draw)

set draw flag

Set draw flag on or off. If the draw flag is off, certain visualization objects will not generate graphics primitive functions. By default draw is on. This flag is meant to be used if a visualization object (eg. the Contour object) has been put into data interpolation or integration mode. In this case it may be desirable to inhibit the generation of graphics primitives if only data interpolation or integration functions are required.

Get draw as output argument using:

void vis_VisContextGetDraw (vis_VisContext *viscontext,
                            Vint *draw)

Access draw using:

vis_VisContextDraw (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • draw – Draw flag

    =VIS_OFF      Turn draw flag off
    =VIS_ON       Turn draw flag on
    

void vis_VisContextGetDraw(vis_VisContext *p, Vint *draw)

get draw flag

See vis_VisContextSetDraw()

void vis_VisContextSetFlags(vis_VisContext *p, Vint flags)

set miscellaneous flags

Set flags. The flags argument is generated by ORing a set of symbolic constants which are specific to a given visualization object. By default flags is 0.

Get flags as output argument using:

void vis_VisContextGetFlags (vis_VisContext *viscontext,
                             Vint *flags)

Access flags using:

vis_VisContextFlags (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • flags – ORed flags which are specific to a given visualization object

void vis_VisContextGetFlags(vis_VisContext *p, Vint *flags)

get miscellaneous flags

See vis_VisContextSetFlags()

void vis_VisContextSetTextBox(vis_VisContext *p, Vint dx, Vint dy)

set size of character text box

Set the width and height of a single raster text character box. If a proportionately spaced font is used then set the text box dimensions to the width and height of the largest character(s). This attribute is used by Value objects to size value brackets and background fill. By default dx is 9 and dy is 13.

Get dx and dy as output arguments using:

void vis_VisContextGetTextBox (vis_VisContext *viscontext,
                               Vint *dx,
                               Vint *dy)

Access dx and dy respectively using:

vis_VisContextXTextBox (vis_VisContext *viscontext);
vis_VisContextYTextBox (vis_VisContext *viscontext);

Errors

VIS_ERROR_VALUE is generated if either dx or dy less than or equal to zero is specified.

Parameters:
  • p – Pointer to VisContext object.

  • dx – Width of single character text box in device coordinates (pixels).

  • dy – Height of single character text box in device coordinates (pixels).

void vis_VisContextGetTextBox(vis_VisContext *p, Vint *dx, Vint *dy)

get size of character text box

See vis_VisContextSetTextBox()

void vis_VisContextSetDeviceOffset(vis_VisContext *p, Vint dx, Vint dy)

set offset in device coordinates

Set device offset attribute. The device offset attribute is used to specify an offset in device coordinates to be used with visualization entities which are drawn with device coordinate style (DC) drawing functions. The offset is useful to finely control the positioning of such graphics primitives with respect to the world coordinate anchor point. By default dx is 0 and dy is 0.

Get dx and dy as output arguments using:

void vis_VisContextGetDeviceOffset (vis_VisContext *viscontext,
                                    Vint *dx,
                                    Vint *dy)

Access dx and dy respectively using:

vis_VisContextXDeviceOffset (vis_VisContext *viscontext);
vis_VisContextYDeviceOffset (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • dx – Horizontal offset in device coordinates (pixels).

  • dy – Vertical offset in device coordinates (pixels).

void vis_VisContextGetDeviceOffset(vis_VisContext *p, Vint *dx, Vint *dy)

get offset in device coordinates

See vis_VisContextSetDeviceOffset()

void vis_VisContextSetProject(vis_VisContext *p, Vint project)

set projection type

Set the projection type to be performed upon certain visualization entities. If the view plane projection is VIS_ON, then 3D visualization entities are generated in the viewing plane to ensure a particular orientation and then projected back to world coordinates. This type of projection requires that the XfmMatrix (modelview matrix) is set using vis_VisContextSetXfmMatrix(). By default viewplane projection is VIS_OFF.

Get project as output argument using:

void vis_VisContextGetProject (vis_VisContext *viscontext,
                               Vint *project)

Access project using:

vis_VisContextProject (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • project – Projection type

    =VIS_OFF      Turn view plane projection flag off
    =VIS_ON       Turn view plane projection flag on
    

void vis_VisContextGetProject(vis_VisContext *p, Vint *project)

get projection type

See vis_VisContextSetProject()

void vis_VisContextSetDeviceSize(vis_VisContext *p, Vint devicesize)

set size in device coordinates

Set device size attribute. The device size attribute is used to specify the size in device coordinates of various visualization entities. The device size is expressed in pixels. The device size is multiplied by the current Size and MinorSize visualization contexts. It is used only if the SizeType visualization context is set to VIS_SIZEDEVICE. Use vis_VisContextSetSizeType() to set the size type. If size mapping is on, then field value is mapped to size where devicesize represents the size of the visualization entity at maximum field value. Note that the device size is scaled by the size and minor size values set by vis_VisContextSetSize() and vis_VisContextSetMinorSize(). By default devicesize is 50.

In order to compute the proper device coordinate sizing, the XfmMatrix, ProjMatrix and Viewport visualization contexts are required. These components should reflect the current state of the graphics device.

Get devicesize as output argument using:

void vis_VisContextGetDeviceSize (vis_VisContext *viscontext,
                                  Vint *devicesize)

Access devicesize using:

vis_VisContextDeviceSize (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • devicesize – Size in device coordinates

void vis_VisContextGetDeviceSize(vis_VisContext *p, Vint *devicesize)

get size in device coordinates

See vis_VisContextSetDeviceSize()

void vis_VisContextSetSizeType(vis_VisContext *p, Vint sizetype)

set size type

Set size type attribute. By default sizetype is VIS_SIZEWORLD.

If the size type is VIS_SIZEWORLD then visualization entities are sized using a world coordinate size specified by the Size visualization context set using vis_VisContextSetSize().

If the size type is VIS_SIZEDEVICE then visualization entities are sized using a device coordinate size specified by the DeviceSize visualization context set using vis_VisContextSetDeviceSize(). Note that the device size is scaled by the size and minor size values set by vis_VisContextSetSize() and vis_VisContextSetMinorSize(). In order to compute the proper device coordinate sizing, the XfmMatrix, ProjMatrix and Viewport visualization contexts are required. These components should reflect the current state of the graphics device.

Get sizetype as output argument using:

void vis_VisContextGetSizeType (vis_VisContext *viscontext,
                                Vint *sizetype)

Access sizetype using:

vis_VisContextSizeType (vis_VisContext *viscontext);

Errors

VIS_ERROR_ENUM is generated if an improper sizetype is specified.

Parameters:
  • p – Pointer to VisContext object.

  • sizetype – Size type

    x=VIS_SIZEWORLD          Size to world coordinate
     =VIS_SIZEDEVICE         Size to device coordinates
    

void vis_VisContextGetSizeType(vis_VisContext *p, Vint *sizetype)

get size type

See vis_VisContextSetSizeType()

void vis_VisContextSetElemRep(vis_VisContext *p, Vint elemrep)

set element representation type

Set element representation. This attribute is used by the BeamElem and ShellElem objects, for example, to determine the graphical style in which features of the element are represented. The representation used to display an element affects the visual quality and the speed of drawing. By default elemrep is VIS_ELEMREP_LINE.

Get elemrep as output argument using:

void vis_VisContextGetElemRep (vis_VisContext *viscontext,
                               Vint *elemrep)

Access elemrep using:

vis_VisContextElemRep (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • elemrep – Element representation

    x=VIS_ELEMREP_LINE       Line
     =VIS_ELEMREP_SEMI       Line and solid combination
     =VIS_ELEMREP_SOLID      Solid
     =VIS_ELEMREP_BITMAP     Bitmap
     =VIS_ELEMREP_PIXMAP     Colored bitmap
     =VIS_ELEMREP_VALUE      Value
    

void vis_VisContextGetElemRep(vis_VisContext *p, Vint *elemrep)

vis_VisContextGetElemRep

See vis_VisContextSetElemRep()

void vis_VisContextSetElemLoc(vis_VisContext *p, Vint elemloc)

set element locations

Set element location. This attribute is used by the BeamElem and ShellElem objects, for example, to determine the locations at which element coordinate systems are drawn. By default elemloc is VIS_ELEMLOC_CENTROID.

Get elemloc as output argument using:

void vis_VisContextGetElemLoc (vis_VisContext *viscontext,
                               Vint *elemloc)

Access elemloc using:

vis_VisContextElemLoc (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • elemloc – Element location

    x=VIS_ELEMLOC_CENTROID   Element centroid
     =VIS_ELEMLOC_CORNERS    Element corners
     =VIS_ELEMLOC_NODES      Element nodes
    

void vis_VisContextGetElemLoc(vis_VisContext *p, Vint *elemloc)

get element locations

See vis_VisContextSetElemLoc()

void vis_VisContextSetElemAxes(vis_VisContext *p, Vint elemaxes)

set element axes flags

Set element axes flags. Element axes are drawn in the direction of the local element Cartesian coordinate system. The element axes can be drawn in any combination of the element local x,y and z directions by OR’ing the VIS_ELEMAXES_X, VIS_ELEMAXES_Y and VIS_ELEMAXES_Z flags together. This attribute is used by the BeamElem and ShellElem objects, for example, to draw the element local coordinate systems. By default elemaxes is VIS_ELEMAXES_NONE.

Get elemaxes as output argument using:

vis_VisContextGetElemAxes (vis_VisContext *viscontext,
                           Vint *elemaxes)

Access elemaxes using:

vis_VisContextElemAxes (vis_VisContext *viscontext);

Parameters:
  • p – Pointer to VisContext object.

  • elemaxes – Element axes flags.

    x=VIS_ELEMAXES_NONE      No element axes drawn
     =VIS_ELEMAXES_XYZ       Draw x,y,z axes
     =VIS_ELEMAXES_X         Draw x axis
     =VIS_ELEMAXES_Y         Draw y axis
     =VIS_ELEMAXES_Z         Draw z axis
    

void vis_VisContextGetElemAxes(vis_VisContext *p, Vint *elemaxes)

get element axes flags

See vis_VisContextSetElemAxes()

void vis_VisContextSetXfmMatrix(vis_VisContext *p, Vfloat xfmmatrix[4][4])

set the graphics modelview matrix

Set the modelview transformation. The graphics modelview transformation is required for device coordinate sizing. The sizing type is set using vis_VisContextSetSizeType() The modelview matrix is also used for viewplane projections which are enabled using vis_VisContextProject(). The default modelview matrix is the identity matrix

Get xfmmatrix as output argument using:

void vis_VisContextGetXfmMatrix (vis_VisContext *viscontext,
                                 Vfloat xfmmatrix[4][4])

Parameters:
  • p – Pointer to VisContext object.

  • xfmmatrix – The 4x4 modelview matrix

void vis_VisContextGetXfmMatrix(vis_VisContext *p, Vfloat mtm[4][4])

get the graphics modelview matrix

See vis_VisContextSetXfmMatrix()

void vis_VisContextSetProjMatrix(vis_VisContext *p, Vfloat projmatrix[4][4])

set the graphics projection matrix

Set the projection transformation. The graphics projection transformation is required for device coordinate sizing. The sizing type is set using vis_VisContextSetSizeType() The default projection matrix is the identity matrix

Get projmatrix as output argument using:

void vis_VisContextGetProjMatrix (vis_VisContext *viscontext,
                                  Vfloat projmatrix[4][4])

Parameters:
  • p – Pointer to VisContext object.

  • projmatrix – The 4x4 projection matrix

void vis_VisContextGetProjMatrix(vis_VisContext *p, Vfloat ptm[4][4])

get the graphics projection matrix

See vis_VisContextSetProjMatrix()

void vis_VisContextSetViewport(vis_VisContext *p, Vint left, Vint right, Vint bottom, Vint top)

set the graphics viewport

Set the viewport transformation. The graphics viewport is required for device coordinate sizing. The sizing type is set using vis_VisContextSetSizeType() The default viewport is 0, 100, 0, 100.

Get right, left, bottom and top as output arguments using:

void vis_VisContextGetViewport (vis_VisContext *viscontext,
                                Vint *left, Vint *right,
                                Vint *bottom, Vint *top)

Parameters:
  • p – Pointer to VisContext object.

  • left – Device coordinates of left planes of viewport

  • right – Device coordinates of right planes of viewport

  • bottom – Device coordinates of bottom planes of viewport

  • top – Device coordinates of top planes of viewport

void vis_VisContextGetViewport(vis_VisContext *p, Vint *left, Vint *right, Vint *bottom, Vint *top)

get the graphics viewport

See vis_VisContextSetViewport()

void vis_VisContextCopy(vis_VisContext *p, vis_VisContext *fromp)

make a copy of a VisContext object

See vis_VisContextBegin()

vis_VisContextBitmapSize(x)

access bitmapsize

See vis_VisContextSetBitmapSize()

vis_VisContextColor(x)

access color

See vis_VisContextSetColor()

vis_VisContextMinorColor(x)

access color

See vis_VisContextSetMinorColor()

vis_VisContextAColor(x)

access acolor

See vis_VisContextSetABCColor()

vis_VisContextBColor(x)

access bcolor

See vis_VisContextSetABCColor()

vis_VisContextCColor(x)

access ccolor

See vis_VisContextSetABCColor()

vis_VisContextXColor(x)

access x color attribute

See vis_VisContextSetXYZColor()

vis_VisContextYColor(x)

access y color attribute

See vis_VisContextSetXYZColor()

vis_VisContextZColor(x)

access z color attribute

See vis_VisContextSetXYZColor()

vis_VisContextMapColor(x)

access color mapping flag

See vis_VisContextSetMapColor()

vis_VisContextTrans(x)

access transparency attribute

See vis_VisContextSetTrans()

vis_VisContextMapTrans(x)

access transparency mapping flag

See vis_VisContextSetMapTrans()

vis_VisContextRatio(x)

access ratio

See vis_VisContextSetRatio()

vis_VisContextSize(x)

access size attribute

See vis_VisContextSetSize()

vis_VisContextMinorSize(x)

access minor size

See vis_VisContextSetMinorSize()

vis_VisContextMapSize(x)

access size mapping flag

See vis_VisContextSetMapSize()

vis_VisContextComponent(x)

access component

See vis_VisContextSetComponent()

vis_VisContextShade(x)

access light source shading attribute

See vis_VisContextSetShade()

vis_VisContextRefinement(x)

access order of refinement attribute

See vis_VisContextSetRefinement()

vis_VisContextPrimType(x)

access suggested primitive type

See vis_VisContextSetPrimType()

vis_VisContextUnitTol(x)

access unit tolerance

See vis_VisContextSetUnitTol()

vis_VisContextDistTol(x)

access distance tolerance

See vis_VisContextSetDistTol()

vis_VisContextPosition(x)

access position or direction attribute

See vis_VisContextSetPosition()

vis_VisContextFill(x)

access fill flag

See vis_VisContextSetFill()

vis_VisContextEdge(x)

access edge flag

See vis_VisContextSetEdge()

vis_VisContextSpot(x)

access spot flag

See vis_VisContextSetSpot()

vis_VisContextLineStyle(x)

access line style

See vis_VisContextSetLineStyle()

vis_VisContextMinorLineStyle(x)

access minorline style

See vis_VisContextSetMinorLineStyle()

vis_VisContextLineWidth(x)

access line style

See vis_VisContextSetLineWidth()

vis_VisContextMinorLineWidth(x)

access minor line style

See vis_VisContextSetMinorLineWidth()

vis_VisContextPointSize(x)

access point size

See vis_VisContextSetPointSize()

vis_VisContextFormat(x)

access format attribute

See vis_VisContextSetFormat()

vis_VisContextFrequency(x)

access frequency attribute

See vis_VisContextSetFrequency()

vis_VisContextMarkerType(x)

access marker type attribute

See vis_VisContextSetMarkerType()

vis_VisContextVectorType(x)

access vector type attribute

See vis_VisContextSetVectorType()

vis_VisContextTensorType(x)

access tensor type attribute

See vis_VisContextSetTensorType()

vis_VisContextIsoValType(x)

access isovalue type attribute

See vis_VisContextSetIsoValType()

vis_VisContextIsoValInterp(x)

access isovalue interpolation method

See vis_VisContextSetIsoValInterp()

vis_VisContextStreamType(x)

access trace and stream type attribute

See vis_VisContextSetStreamType()

vis_VisContextScale(x)

access scale factor

See vis_VisContextSetScale()

vis_VisContextShrink(x)

access shrink factor

See vis_VisContextSetShrink()

vis_VisContextShrinkType(x)

access shrink type

See vis_VisContextSetShrinkType()

vis_VisContextReflect(x)

access reflect flag

See vis_VisContextSetReflect()

vis_VisContextDraw(x)

access draw flag

See vis_VisContextSetDraw()

vis_VisContextFlags(x)

access miscellaneous flags

See vis_VisContextSetFlags()

vis_VisContextXTextBox(x)

access size of character text box

See vis_VisContextSetTextBox()

vis_VisContextYTextBox(x)

access size of character text box

See vis_VisContextSetTextBox()

vis_VisContextXDeviceOffset(x)

access offset in device coordinates

See vis_VisContextSetDeviceOffset()

vis_VisContextYDeviceOffset(x)

access offset in device coordinates

See vis_VisContextSetDeviceOffset()

vis_VisContextProject(x)

access projection type

See vis_VisContextSetProject()

vis_VisContextDeviceSize(x)

access device size

See vis_VisContextSetDeviceSize()

vis_VisContextSizeType(x)

access size type

See vis_VisContextSetSizeType()

vis_VisContextElemRep(x)

access element representation type

See vis_VisContextSetElemRep()

vis_VisContextElemLoc(x)

access element locations

See vis_VisContextSetElemLoc()

vis_VisContextElemAxes(x)

access element axes

See vis_VisContextSetElemAxes()