Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
Unit CastleSpaceFillingCurves
Description
Generate space-filling curves (TSwapScanCurve, THilbertCurve, TPeanoCurve). These are sequences of points that completely fill some 2D space.
Uses
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Constants
Description
Functions and Procedures
procedure PeanoCurve(InitialOrient: boolean; Angle: TSFCAngle; InitialLevel: Cardinal; Step: TSFCStepFunction; StepData: Pointer); |
Low-level procedures to generate consecutive Peano and Hilbert curve points. See e.g. "Graphic Gems II" (gem I.8) or http://en.wikipedia.org/wiki/Space-filling_curve for nice description.
Step is a function that goes to a neighbor 2D point, and "marks" it (whatever it means for your usage). If the starting point is "marked" at the beginning, using Peano or Hilbert curve guarantees that you will eventually "mark" the whole 2D space.
Peano curve fills a plane size 3ˆLevel, Hilbert curve fills size 2ˆLevel.
Angle is an initial orientation, determining in which direction the curve will be drawn. If you want to fill the space up and to the left from the initial point (according to conventions that Angle = 0 is right, Angle = 1 is up, and so on (CCW)), then use:
|
procedure HilbertCurve(InitialOrient: boolean; Angle: TSFCAngle; InitialLevel: Cardinal; Step: TSFCStepFunction; StepData: Pointer); |
|
function AllSFCurveClassesNames: string; |
All non-abstract space-filling curve names. Separated by commas, in apostrophes.
|
Types
TSFCAngle = 0..3; |
Angle for space-filling curves.
Let's say 0 = 0 degrees, 1 = 90 degrees, 2 = 180, 3 = 270, but actually it doesn't matter much — it all a matter of convention here.
|
TSFCStepFunction = procedure (Angle: TSFCAngle; StepFuncData: Pointer); |
|
Constants
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:14
|