SVUtility.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last edited by Bier on February 5, 1987
Contents: Some helpful Solidviews routines that don't fit anywhere in particular.
DIRECTORY
Feedback, Imager, Rope, SVSceneTypes, ViewerClasses;
SVUtility: CEDAR DEFINITIONS =
BEGIN
FeatureData: TYPE = SVSceneTypes.FeatureData;
MasterObject: TYPE = SVSceneTypes.MasterObject;
MasterObjectList: TYPE = SVSceneTypes.MasterObjectList;
Slice: TYPE = SVSceneTypes.Slice;
SliceList: TYPE = SVSceneTypes.SliceList;
SliceDescriptor: TYPE = SVSceneTypes.SliceDescriptor;
Viewer: TYPE = ViewerClasses.Viewer;
Operations on REAL
For algorithms that need a variable initialized to an impossibly large number. Unfortunately, Real.PlusInfinity can't be compared with anything. These sizes were chosen so that they can be scaled by 1000 and squared once without causing overflow. (Many geometric algorithms work with distance squared to keep from doing square roots)
plusInfinity: REAL = 1E16;
minusInfinity: REAL = -1E16;
Gargoyle guarantees accuracy to within 0.001 inches, or 0.072 screen dots. Allowing two orders of magnitude leeway gives 10-5 inches or 7.2 * 10-4 screen dots.
epsilonInPoints: REAL = 7.2E-4;
epsilonInInches: REAL = 1.0E-5;
Algebraic Math
QuadraticFormula: PROC [a, b, c: REAL] RETURNS [roots: ARRAY [1..2] OF REAL, rootCount: NAT];
Operations on LIST OF MasterObject
AppendToMasterObjects: PROC [mo: MasterObject, list: MasterObjectList] RETURNS [MasterObjectList];
AppendToAssemblyList: PROC [assembly: Slice, list: SliceList] RETURNS [SliceList];
Operations on LIST OF Slice
StartSliceList: PROC [] RETURNS [entityList, ptr: LIST OF Slice];
AddSlice: PROC [slice: Slice, entityList, ptr: LIST OF Slice] RETURNS [newList, newPtr: LIST OF Slice];
Operations on LIST OF REF ANY (should use List.mesa)
StartList: PROC [] RETURNS [entityList, ptr: LIST OF REF ANY];
AddEntity: PROC [entity: REF ANY, entityList, ptr: LIST OF REF ANY] RETURNS [newList, newPtr: LIST OF REF ANY];
Operations on LIST OF SliceDescriptor
StartSliceDescriptorList: PROC [] RETURNS [entityList, ptr: LIST OF SliceDescriptor];
AddSliceDescriptor: PROC [entity: SliceDescriptor, entityList, ptr: LIST OF SliceDescriptor] RETURNS [newList, newPtr: LIST OF SliceDescriptor];
AppendSliceDescriptorList: PROC [list1, list2: LIST OF SliceDescriptor] RETURNS [result: LIST OF SliceDescriptor];
DeleteSliceDescriptorFromList: PROC [sliceD: SliceDescriptor, sliceDList: LIST OF SliceDescriptor] RETURNS [smallerList: LIST OF SliceDescriptor];
Operations on LIST OF FeatureData
CopyFeatureList: PROC [features: LIST OF FeatureData] RETURNS [copyList: LIST OF FeatureData];
FeatureDataNconc: PROC [l1, l2: LIST OF FeatureData] RETURNS [bigList: LIST OF FeatureData];
Filename Operations (factor out as GGFiles in GGCore)
GetInterpressFileName: PROC [shortName, workingDir: Rope.ROPE, feedback: Feedback.FeedbackData] RETURNS [fullName: Rope.ROPENIL, success: BOOLTRUE];
GetScriptFileName: PROC [scriptName: Rope.ROPE, currentWDir: Rope.ROPE, feedback: Feedback.FeedbackData] RETURNS [fullName: Rope.ROPENIL, success: BOOLTRUE];
GetGenericFileName: PROC [shortName, workingDir, defaultExt: Rope.ROPE, illegalExts: LIST OF Rope.ROPE, feedback: Feedback.FeedbackData, emergency: BOOLFALSE] RETURNS [fullName: Rope.ROPENIL, success: BOOLTRUE, versionSpecified: BOOLFALSE];
Colors
GetSpecialColor: PROC RETURNS [color: Imager.Color];
END.