<<>> <> <> <> DIRECTORY G3dBasic, G3dOctree, G3dShape, G3dSpline, Imager, Real, Rope, ViewerClasses; ImplicitDefs: CEDAR DEFINITIONS ~ BEGIN <> <> <> Octree: TYPE ~ G3dOctree.Octree; Cube: TYPE ~ G3dOctree.Cube; Corner: TYPE ~ G3dOctree.Corner; CrossSequence: TYPE ~ G3dOctree.CrossSequence; NatSequence: TYPE ~ G3dBasic.NatSequence; NatSequenceRep: TYPE ~ G3dBasic.NatSequenceRep; Pair: TYPE ~ G3dBasic.Pair; Triple: TYPE ~ G3dBasic.Triple; TripleSequence: TYPE ~ G3dBasic.TripleSequence; TripleSequenceRep: TYPE ~ G3dBasic.TripleSequenceRep; ScreenSequence: TYPE ~ G3dShape.ScreenSequence; Validity: TYPE ~ G3dShape.Validity; SplineSequence: TYPE ~ G3dSpline.SplineSequence; ROPE: TYPE ~ Rope.ROPE; Context: TYPE ~ Imager.Context; Viewer: TYPE ~ ViewerClasses.Viewer; <> Use: TYPE ~ {unknown, animateClient, animateSurface}; EdgeMode: TYPE ~ { regulaFalsi, -- methods of converging binarySectioning -- along a segment }; DistanceMode: TYPE ~ { inverse, -- value inverseSqrd, -- wtInverse, -- value wtInverseSqrd -- }; <> ConnectProc: TYPE ~ PROC [p0, p1: Triple]; <<>> ValueProc: TYPE ~ PROC [ point: Triple, clientData: REF ANY ¬ NIL, corner: Corner ¬ NIL] RETURNS [value: REAL ¬ 0.0]; << Return the value at point (> 0 inside, < 0 outside surface).>> << corner is available for setting .nearest or .outOfRange.>> << corner.outOfRange ¬ TRUE if point out of function range.>> <<>> StartProc: TYPE ~ PROC [ clientData: REF ANY ¬ NIL, use: Use ¬ unknown, frame, nFrames: NAT ¬ 0] RETURNS [point: Triple]; << Return a start point for implicit tracking.>> << frame and nFrames meaningful if use is an animation.>> <<>> CubeOkProc: TYPE ~ PROC [cube: Cube, clientData: REF ANY ¬ NIL] RETURNS [ok: BOOL]; << Return FALSE to eliminate cube from the octree.>> <<>> VertexOkProc: TYPE ~ PROC [point: Triple, clientData: REF ANY ¬ NIL] RETURNS [ok: BOOL]; << Return FALSE to eliminate point (and any polygons>> << containing it) from the surface.>> <<>> PolygonOkProc: TYPE ~ PROC [points: TripleSequence, clientData: REF ANY ¬ NIL] RETURNS [ok: BOOL]; << Return FALSE to eliminate polygon from the surface.>> <<>> NormalProc: TYPE ~ PROC [ point: Triple, value: REAL ¬ 0.0, clientData: REF ANY ¬ NIL] RETURNS [normal: Triple ¬ [0.0, 0.0, 0.0]]; << Return the surface normal at point, presumably unitized.>> ColorProc: TYPE ~ PROC [vertex: Vertex, clientData: REF ANY ¬ NIL] RETURNS [color: Triple ¬ [1.0, 1.0, 1.0]]; << Return the color at vertex.>> <<>> TextureProc: TYPE ~ PROC [vertex: Vertex, clientData: REF ANY ¬ NIL] RETURNS [texture: Pair ¬ [0.0, 0.0]]; << Return the u, v texture coordinates at vertex.>> <<>> StatusProc: TYPE ~ PROC [ref: REF ¬ NIL] RETURNS [atom: ATOM ¬ $Continue]; << Called when making the surface or the octree.>> << ref is usually one of:>> << $MakeOctree, $AdaptOctree, $SetCorners, $MakeVertices>> << $MakePolygons, $MakeNormals, $MakeTextures, $Done,>> << ROPE, or Cube.>> << atom = $Abort or $RejectCube is generally recognized.>> <<>> SurfaceProc: TYPE ~ PROC [cube: Cube] RETURNS [intersects: BOOL]; << True iff surface intersects the cube.>> <<>> DocProc: TYPE ~ PROC [clientData: REF ANY] RETURNS [doc: ROPE]; << Get client documentation when, for example, writing to a file.>> <<>> DiagramProc: TYPE ~ PROC [ context: Context, point: Triple, clientData: REF ANY ¬ NIL, whatChanged: REF ANY ¬ NIL, viewer: Viewer ¬ NIL]; << Diagram an implicit function relative to given point in space.>> <> Vertex: TYPE ~ G3dShape.Vertex; VertexSequence: TYPE ~ G3dShape.VertexSequence; VertexSequenceRep: TYPE ~ G3dShape.VertexSequenceRep; <> <> <> <> <> <<>> Surface: TYPE ~ REF SurfaceRep; SurfaceRep: TYPE ~ RECORD [ octree: Octree ¬ NIL, -- the octree vertices: VertexSequence ¬ NIL, -- sequence of surface vertices vertexValidities: ARRAY Validity OF BOOL ¬ ALL[FALSE], screens: ScreenSequence ¬ NIL, -- screen locations of vertices nPolygons: CARDINAL ¬ 0, -- number of polygons polygons: LIST OF NatSequence ¬ NIL, -- run-encoded vertex indices faceNormals: TripleSequence ¬ NIL, -- normal per polygon faceCenters: TripleSequence ¬ NIL, -- center per polygon curves: SplineSequence ¬ NIL, -- curves connecting vertices curvesValid: BOOL ¬ FALSE, -- true if curves updated clientData: REF ANY ¬ NIL -- client data ]; MacroPolygons: TYPE ~ RECORD [ nPolygons: {none, one, many}, polygon: CrossSequence ]; <> Target: TYPE ~ RECORD [ point: Triple ¬ origin, value: REAL ¬ 0.0, nTries: NAT ¬ 0 ]; <> Sample: TYPE ~ RECORD [ value: REAL ¬ 0.0, -- value of point sampled in space near: Triple ¬ origin, -- nearest point vector: Triple ¬ origin, -- from query point to nearest point proximity: REAL ¬ huge, -- client evaluated (~ ABS[value-threshold]) normalized: BOOL ¬ FALSE, -- iff vector normalized radius: REAL ¬ 0.0, -- radius of tube at nearest point ratio: REAL ¬ 0.0, -- (distance-radius)/radius squareDistance: REAL ¬ 0.0, -- distance-squared to nearest point distance: REAL ¬ 0.0, -- distance to nearest point distanceSet: BOOL ¬ FALSE, -- iff distance field is correct refAny: REF ANY ¬ NIL -- probably pointer to nearest surface ]; <> origin: Triple ~ G3dBasic.origin; huge: REAL ~ Real.LargestNumber; maxNTriples: CARDINAL ~ (LAST[CARDINAL]-4-SIZE[TripleSequenceRep[0]])/SIZE[Triple]; maxNNats: CARDINAL ~ (LAST[CARDINAL]-4-SIZE[NatSequenceRep[0]])/SIZE[NAT]; maxNVertices: CARDINAL ~ (LAST[CARDINAL]-4-SIZE[VertexSequenceRep[0]])/SIZE[Vertex]; END.