ImplicitValue.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bloomenthal, November 21, 1992 6:59 pm PST
DIRECTORY G3dBasic, G3dPlane, ImplicitDefs, Rope;
ImplicitValue: CEDAR DEFINITIONS
~ BEGIN
Types
Pair:      TYPE ~ G3dBasic.Pair;
Segment:     TYPE ~ G3dBasic.Segment;
Triple:     TYPE ~ G3dBasic.Triple;
Plane:      TYPE ~ G3dPlane.Plane;
DistanceMode:   TYPE ~ ImplicitDefs.DistanceMode;
Sample:     TYPE ~ ImplicitDefs.Sample;
ValueProc:    TYPE ~ ImplicitDefs.ValueProc;
Source2d:     TYPE ~ RECORD [
p:         Pair,    -- location of 2d source
strength:       REAL    -- its strength
];
Source3d:     TYPE ~ RECORD [
p:         Triple,   -- location of 3d source
strength:       REAL,    -- its strength
sInvSqrd:       REAL    -- inverse squared strength
];
Source2dSequence:  TYPE ~ REF Source2dSequenceRep;
Source2dSequenceRep: TYPE ~ RECORD [
length:       NAT ¬ 0,
element:       SEQUENCE maxLength: NAT OF Source2d
];
Source3dSequence:  TYPE ~ REF Source3dSequenceRep;
Source3dSequenceRep: TYPE ~ RECORD [
length:       NAT ¬ 0,
element:       SEQUENCE maxLength: NAT OF Source3d
];
Item:      TYPE ~ RECORD [
sample:       Sample,
inside:       BOOL,
type:        {segment, tripoly}
]; 
ItemSequence:   TYPE ~ REF ItemSequenceRep;
ItemSequenceRep:  TYPE ~ RECORD [
length:       CARDINAL ¬ 0,
element:       SEQUENCE maxLength: CARDINAL OF Item
];
Point and Line Segment Sources
OfPoint: PROC [
q, source: Triple,
strength: REAL,
distanceMode: DistanceMode]
RETURNS [Sample];
Return the value between source and q.
OfSegment: PROC [
source: Triple,
segment: Segment,
strength: REAL,
distanceMode: DistanceMode]
RETURNS [Sample];
Return the value between source and q.
Miscellany
CombineSamples: PROC [samples: LIST OF Sample] RETURNS [sample: Sample];
Return the combined sample of the input list.
Source Sequences
CopySources2d: PROC [sources2d: Source2dSequence] RETURNS [Source2dSequence];
Return a copy of the input sequence of sources2d.
AddToSources2d: PROC [sources2d: Source2dSequence, source2d: Source2d]
RETURNS [Source2dSequence];
Add source2d to the sequence.
LengthenSources2d: PROC [sources2d: Source2dSequence, amount: REAL ¬ 1.3]
RETURNS [Source2dSequence];
Return a copy of the input sequence whose maxLength is amount*input.maxLength.
CopySources3d: PROC [sources3d: Source3dSequence] RETURNS [Source3dSequence];
Return a copy of the input sequence of sources3d.
AddToSources3d: PROC [sources3d: Source3dSequence, source3d: Source3d]
RETURNS [Source3dSequence];
Add source2d to the sequence.
LengthenSources3d: PROC [sources3d: Source3dSequence, amount: REAL ¬ 1.3]
RETURNS [Source3dSequence];
Return a copy of the input sequence whose maxLength is amount*input.maxLength.
ObtainSources2d: PROC [nSources: NAT] RETURNS [Source2dSequence];
Obtain a scratch Source2dSequence.
ObtainSources3d: PROC [nSources: NAT] RETURNS [Source3dSequence];
Obtain a scratch Source3dSequence.
ReleaseSources2d: PROC [sources: Source2dSequence];
Release the Source2dSequence.
ReleaseSources3d: PROC [sources: Source3dSequence];
Release the Source3dSequence.
OfSources2d: PROC [q: Pair, sources: Source2dSequence, distanceMode: DistanceMode]
RETURNS [REAL];
Return the value within the xy plane at point q; sample.point.z is unused.
OfSources3d: PROC [q: Triple, sources: Source3dSequence, distanceMode: DistanceMode]
RETURNS [REAL];
Return the value at a point q of a set of sources of value.
Simple Geometric Shapes
OfPlane: PROC [q: Triple, plane: Plane] RETURNS [Sample];
Return the value of a plane at a point q.
OfSphere: PROC [q, center: Triple, radiusSqd: REAL] RETURNS [Sample];
Return the value of a sphere at a point q.
OfCylinder: PROC [q: Triple, end0, end1: Triple, radiusSqd: REAL] RETURNS [Sample];
Return the value of a cylinder (from end0 to end1) at a point q.
OfTorus: PROC [q: Triple, minorRadius, majorRadius: REAL] RETURNS [Sample];
Return the value of a torus at a point q.
END.