File: SVCatScan.mesa
Last edited by: Eric Bier on April 18, 1987 0:24:43 am PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Contents: A scanline data structure representing a ray-traced catScan thru a 3D scene. Can be shown in 3D by drawing the endpoints in perspective or in 2D by rotating the slicing plane into the viewing plane.
DIRECTORY
Imager, SV2d, SV3d, SVModelTypes, SVRayTypes, SVSceneTypes;
SVCatScan: CEDAR DEFINITIONS =
BEGIN
Camera: TYPE = SVModelTypes.Camera;
Classification: TYPE = SVRayTypes.Classification;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
CSGTree: TYPE = SVRayTypes.CSGTree;
FrameBlock: TYPE = SVSceneTypes.FrameBlock;
Point2d: TYPE = SV2d.Point2d;
Point3d: TYPE = SV3d.Point3d;
Ray: TYPE = SVRayTypes.Ray;
CatScanScanLine: TYPE = REF CatScanScanLineObj;
CatScanScanLineObj: TYPE = RECORD [
lineVal: REAL,
hits: ARRAY [1..SVRayTypes.maxSceneDepth] OF Point3d,
classifs: ARRAY [1..SVRayTypes.maxSceneDepth] OF BOOL,
count: NAT];
CatScan: TYPE = REF CatScanObj;
CatScanObj: TYPE = RECORD [
coordSys: CoordSystem, frame: FrameBlock, plane: NAT, seq: SEQUENCE maxScans: NAT OF CatScanScanLine];
CreateCatScan: PROC [maxScans: NAT, coordSys: CoordSystem, frame: FrameBlock, plane: NAT] RETURNS [catScan: CatScan];
UpdateCatScan: PROC [catScan: CatScan, coordSys: CoordSystem, frame: FrameBlock, plane: NAT];
ChangeCatScanPlane: PROC [catScan: CatScan, plane: NAT];
RayTraceTheCatScan: PROC [catScan: CatScan, tree: CSGTree, camera: Camera];
WidthAndHeight: PROC [catScan: CatScan] RETURNS [width, height: REAL];
Uses the dimensions of the framebox and the current plane to determine the size of the rectangle this catScan will project to in the chosen plane.
DrawCatScan: PROC [dc: Imager.Context, catScan: CatScan, origin: Point2d];
Draw the catScan in a 2d window such as the scratchpad.
DrawCatScan3d: PROC [dc: Imager.Context, catScan: CatScan, camera: Camera];
Draw the outline of the catScan in with a set of solid objects.
END.