ETHZ_Logo RAMSES_Logo_Right   RAMSES   RAMSES_Logo_Left Systems Ecology  
Start    search button      Modules:   A-Z   Function   Layer        QuickRefs:   DM   AuxLib   AuxLibE   SciLib   EasyMW   MW   ISIS   RMSLib

DEFINITION MODULE Curves3D;

  (*******************************************************************

    Module  Curves3D     (Version 1.0)

      Copyright (c) 1986-2006 by Markus Ulrich and ETH Zurich.

    Purpose   Draws curves in a three dimensional (3D) space and
              their projections on the coordinate system (CS) planes.

    Remarks   Any combination of projections can be selected, and
              all of them are drawn simultaneously by one single
              call to procedure PlotTo3D.

              The module also provides an automatical update procedure
              for nRun curves (each of them can have different
              projections) with each containing a maximum of nVal
              values.  After a change of the CS by calling "CSedit"
              or "InstallCS", "ReplotAll" plots the old curves in
              the  newly defined CS. This is a very useful tool
              or considering the same curves under different views.

              This module works closely together with DMWindows and
              DM3DGraphics which are part of the Dialog Machine.


    Programming

      o Design
        Markus Ulrich             25/03/1986

      o Implementation
        Markus Ulrich             25/03/1986


    ETH Zurich
    Systems Ecology
    CHN E 35.1
    Universitaetstrasse 16
    8092 Zurich
    SWITZERLAND

    URLs:
        <mailto:RAMSES@env.ethz.ch>
        <http://www.sysecol.ethz.ch>
        <http://www.sysecol.ethz.ch/SimSoftware/RAMSES>


    Last revision of definition:  12/06/1987  AF

  *******************************************************************)


FROM Graphics3D IMPORT Point3D;

CONST
  nRun = 5; (*maximal number of curves which can be stored*)
  nVal =250;(*maximal number of values per curves*)

TYPE
  ProjectionEnumerator = (xyPlane, xzPlane, yzPlane, spacial);
    (* These projections can be selected, and are automatically generated
       by the procedure 'Draw3D'. 'spacial' means no projection         *)
  Projections = [xyPlane..spacial];

  ProjectionSet = SET OF ProjectionEnumerator;
    (* Contains the set of selected projections, typical statement for
       assinging projections:
       projection:= ProjectionSet{xyPlane, xzPlane};                    *)


PROCEDURE SelectSymbol(theProjection: Projections; symbol: CHAR);
    (* This procedure can be called to select a symbol, which will be
       plottet at each point of the curve.
       "theProjection" indicates for which projection the symbol will be
       taken.
       As default only a line, without any symbols will be plotted.
       Assigning of '0C' to symbol suppresses again the plotting
       of a symbol.                                                     *)

PROCEDURE ClearUpdateStore;
  (*This procedure deletes the update store. Typically called after
    erasing the plot if no further updating is desired.                 *)

PROCEDURE StartNewCurve(projection:ProjectionSet; firstPoint: Point3D);
  (*This procedure stores the projection for a curve, and its first point.
                                                                        *)

PROCEDURE PlotTo3D(P: Point3D);
  (* This procedure plots all projections (defined by calling
     StartNewCurve) from the last point (defined by the last call
     of PlotTo3D, or by calling StartNewCurve) to P.
     At the end of each line, the symbol defined by default or by
     'SelectSymbol' is plotted.
     Example:  You want to display a spacial curve spacially, as well
               as its projection on the xy-Plane:
               1)    projection:=ProjectionSet{xyPlane,spacial};
               2)    StartNewCurve(projection, firstPoint);
               3..n) PlotTo3D(nextPoint);

     In combination with these procedures, all curves are stored (within
     the limits of nRun and nVal).                                      *)

PROCEDURE ReplotAll;
  (*This procedure replots all curves saved in the updatestore. For each
    curve the formerly assigned projection type is used.
    Replotting after a change of the CS (with "EditCS", for instance) is
    done in the NEW CS. This feature is very useful if you want to see a
    curve from different views.                                         *)

PROCEDURE GetCurrentProjection():ProjectionSet;
  (*This procedure returns the current value of projections defined by
    the last call of StartNewCurve.                                     *)

PROCEDURE StorageOff;
  (* Suppresses all subsequent storage of values. If this procedure was
     called BEFORE a call of 'StartNewCurve', all following storage will
     fail for that given curve, even after calling 'StorageOn'          *)

PROCEDURE StorageOn;
  (* Reinstalls storage of values, default.*)

END Curves3D.

  Contact RAMSES@env.ethz.ch Last updated: 25-Jul-2011 [Top of page]