File: SVSweepGeometry.mesa
Last edited by: Bier May 31, 1984 3:07:15 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Author: Eric Allan Bier on February 18, 1987 6:23:58 pm PST
Contents: Definitions for a package which creates and displays linear and revolute 3D structures
DIRECTORY
Imager, IO, SV2d, SV3d, SVModelTypes, SVSceneTypes;
SVSweepGeometry: CEDAR DEFINITIONS =
BEGIN
Camera: TYPE = SVModelTypes.Camera;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
Path: TYPE = SV2d.Path;
Polygon: TYPE = SV2d.Polygon;
Point2d: TYPE = SV2d.Point2d;
Point3d: TYPE = SV3d.Point3d;
Vector3d: TYPE = SV3d.Vector3d;
LinearMesh: TYPE = REF LinearMeshRecord;
LinearMeshRecord: TYPE = RECORD [
len: NAT,
array: LinearMeshArray,
surfaces: LinearSurfaceMesh];
RevoluteMesh: TYPE = REF RevoluteMeshRecord;
RevoluteMeshRecord: TYPE = RECORD [
linesOfLongitude: NAT,
linesOfLatitude: NAT,
array: RevoluteMeshArray,
surfaces: RevoluteSurfaceMesh];
ToroidalMesh: TYPE = REF ToroidalMeshRecord;
ToroidalMeshRecord: TYPE = RECORD [
linesOfLongitude: NAT,
linesOfLatitude: NAT,
array: RevoluteMeshArray,
surfaces: ToroidalSurfaceMesh];
maxMeshLen: NAT = 30;
LinearMeshArray: TYPE = ARRAY [1..maxMeshLen] OF ARRAY [1..2] OF Point3d;
maxLinesOfLat: NAT = 16;
maxLinesOfLong: NAT = 20;
RevoluteMeshArray: TYPE = ARRAY [1..maxLinesOfLat] OF ARRAY [1..maxLinesOfLong] OF Point3d;
LinearSurfaceMesh: TYPE = RECORD [
front: SweepSurface,
back: SweepSurface,
sides: ARRAY [1..maxMeshLen] OF SweepSurface];
RevoluteSurfaceMesh: TYPE = RECORD [
top: SweepSurface,
bottom: SweepSurface,
sides: ARRAY [1..maxLinesOfLat-1] OF ARRAY [1..maxLinesOfLong] OF SweepSurface];
ToroidalSurfaceMesh: TYPE = RECORD [
sides: ARRAY [1..maxLinesOfLat] OF ARRAY [1..maxLinesOfLong] OF SweepSurface];
SweepSurface: TYPE = RECORD [normal: Vector3d];
LightSource: TYPE = SVModelTypes.LightSource;
LightSourceList: TYPE = LIST OF LightSource;
MasterObject: TYPE = SVSceneTypes.MasterObject;
Slice: TYPE = SVSceneTypes.Slice;
PlanarSurface: TYPE = SVSceneTypes.PlanarSurface;
PlanarSurfaceList: TYPE = SVSceneTypes.PlanarSurfaceList;
LinearSweep: PROC [poly: Polygon, frontDepth: REAL ← 0.5, backDepth: REAL ← -0.5] RETURNS [meshRecord: LinearMesh];
TooFewPointsForShadedSweep: SIGNAL;
RevoluteSweep: PROC [path: Path, linesOfLongitude: NAT ← 10] RETURNS [meshRecord: RevoluteMesh];
ToroidalSweep: PROC [poly: Polygon, linesOfLongitude: NAT ← 10] RETURNS [meshRecord: ToroidalMesh];
Like RevoluteSweep but wraps around.
GetLinearPoly: PROC [linMesh: LinearMesh] RETURNS [poly: Polygon];
GetRevolutePath: PROC [revMesh: RevoluteMesh] RETURNS [path: Path];
LineDrawLinearSweep: PROC [dc: Imager.Context, meshRecord: LinearMesh, camera: Camera, localCS: CoordSystem];
LineDrawRevoluteSweep: PROC [dc: Imager.Context, meshRecord: RevoluteMesh, camera: Camera, localCS: CoordSystem];
LineDrawToroidalSweep: PROC [dc: Imager.Context, meshRecord: ToroidalMesh, camera: Camera, localCS: CoordSystem];
DrawNormalsLinearSweep: PROC [dc: Imager.Context, meshRecord: LinearMesh, camera: Camera, localCS: CoordSystem];
DrawNormalsRevoluteSweep: PROC [dc: Imager.Context, meshRecord: RevoluteMesh, camera: Camera, localCS: CoordSystem];
DrawNormalsToroidalSweep: PROC [dc: Imager.Context, meshRecord: ToroidalMesh, camera: Camera, localCS: CoordSystem];
PlanarSurfacesLinearSweep: PROC [meshRecord: LinearMesh, assembly: Slice, cameraCS: CoordSystem] RETURNS [psl: PlanarSurfaceList];
PlanarSurfacesRevoluteSweep: PROC [meshRecord: RevoluteMesh, assembly: Slice, cameraCS: CoordSystem] RETURNS [psl: PlanarSurfaceList];
PlanarSurfacesToroidalSweep: PROC [meshRecord: ToroidalMesh, assembly: Slice, cameraCS: CoordSystem] RETURNS [psl: PlanarSurfaceList];
PolyListLinear: PROC [f: IO.STREAM, meshRecord: LinearMesh];
PolyListRevolute: PROC [f: IO.STREAM, meshRecord: RevoluteMesh];
PolyListToroidal: PROC [f: IO.STREAM, meshRecord: ToroidalMesh];
CountPlanarSurfacesLinearSweep: PROC [meshRecord: LinearMesh] RETURNS [len: NAT];
CountPlanarSurfacesRevoluteSweep: PROC [meshRecord: RevoluteMesh] RETURNS [len: NAT];
CountPlanarSurfacesToroidalSweep: PROC [meshRecord: ToroidalMesh] RETURNS [len: NAT];
CountVerticesLinearSweep: PROC [meshRecord: LinearMesh] RETURNS [len: NAT];
CountVerticesRevoluteSweep: PROC [meshRecord: RevoluteMesh] RETURNS [len: NAT];
CountVerticesToroidalSweep: PROC [meshRecord: ToroidalMesh] RETURNS [len: NAT];
DrawPlanarSurfaceLinearSweep: PROC [dc: Imager.Context, ps: PlanarSurface, lightSources: LightSourceList, camera: Camera, hiddenLine: BOOL];
DrawPlanarSurfaceRevoluteSweep: PROC [dc: Imager.Context, ps: PlanarSurface, lightSources: LightSourceList, camera: Camera, hiddenLine: BOOL];
DrawPlanarSurfaceToroidalSweep: PROC [dc: Imager.Context, ps: PlanarSurface, lightSources: LightSourceList, camera: Camera, hiddenLine: BOOL];
END.