!!! Warning: CreateSurfDemo takes some minutes on NT to cache curvatures.
Be aware to run it once for the surface and curve.

-- Creation of demo objects in demo.irt ---------------------------

PlanarSurf = FUNCTION():
	creates plane
DemoSimpleSurf = FUNCTION():
	creates surfaces you have seen today
DemoSurf = FUNCTION():
	creates surface you wanted
DemoCurve = FUNCTION():
        creates curve in parametric domain

-- Run demo functions ---------------------------------------------

RunSurfDomainDemo = PROCEDURE():
	start with this demo, shows mapping from domain to surface
RepeatMovie = PROCEDURE(numOfSamples):
	repeats last movie as it was
RunMovie = PROCEDURE(surfDeriv, surfCrvtr, curvDeriv, curvCrvtr):
	runs movie customizing its view to be without domain
        with surface and curve and geometry switched by
        surfDeriv - frame of partial derivatives
        surfCrvtr - osculating circles in principle directions
        curvDeriv - frame of curve partial derivatives
        curvCrvtr - geodesic and normal curvature circles
RunHodographDemo = PROCEDURE():
        runs movie of surface with frame and hodograph with frame
RunSurfGeomDemo = PROCEDURE():
        runs movie of surface with frame and principles
RunCurvGeomDemo = PROCEDURE():
        runs movie of curve in surface with frame and curvatures
RunSurfAndCurvDemo = PROCEDURE():
        runs movie of surface geometry with curve frame
RunCurvAndSurfDemo = PROCEDURE():
        runs movie of curve in surface geometry with surface frame

Each movie starts with pause and message letting you to adjust
scene and ecxplain what is going on. Functions are 3-lines and
describe well how to customize movie in other way.


-- Customization global variables in surfcore.irt ----------------------

srfMainColor   = white;
srfDomainColor = red;
srfCurveColor  = yellow;
srfUparColor   = magenta;
srfVparColor   = green;
srfNormColor   = cyan;
srfCrvtrColor  = blue;
crvTangColor   = yellow;    # tangent
crvNormColor   = red;       # normal
crvGCrvtrColor = cyan;      # geodesic osculating circle
crvNCrvtrColor = blue;      # normal osculating circle

showSurfMain = true;
showSurfDomain = true;
showSurfHodo = true;
showSurfDerivAtPoint = true;
showSurfDerivAtHodo = true;
showSurfCrvtr = true;
showCurvDeriv = true;
showCurvCrvtr = true;

hodoMat_ # matrix that operates on hodograph objects

-- Surface geometry objects creation functions in surfcore.irt ------

CreateSurfDemo = PROCEDURE(srf, crv):
	start with new surface or curve
SurfAndHodoScene = FUNCTION():
        returns static elements of the scene,
        subject to view customiz by showXXX flags
GeomAtCurvParam = FUNCTION(t)
        returns curve in surface geometry at t in [0, 1]
	(frame and geodesic + normal curvatures), subject to view
        customization by showXXX flags
GeomAtSurfPoint = FUNCTION(u, v):
        returns surface geometry at u and v in domain
	(frame and principal curvatures), subject to view
        customization by showXXX flags
GeomAtParam = FUNCTION(t):
        calls GeomAtSurfPoint substituting u and v by values of
        curve in parametric domain at t in [0, 1]

-- Helpers to customize view -----------------------------------------

ShowSurfHodo = PROCEDURE(showHodo, showFrame):
ShowSurfGeom = PROCEDURE(showDeriv, showCrvtr):
ShowCurvGeom = PROCEDURE(showDeriv, showCrvtr):

-- Sample sequence found in demo.irt -----------------------------------

CreateSurfDemo(DemoSurf(), DemoCurve());
RunSurfDomainDemo();
RunHodographDemo();
RunSurfGeomDemo();   # you can do RepeatMovie(20) here
view(GeomAtParam(0.013640) + SurfAndHodoScene(), true); # k2 inflection
RunSurfAndCurvDemo();

