→ summary
******************************************************************************************
Module Evolife.Graphics.Curves:
==============================
EVOLIFE: Module Curves:
Stores data that can be used to plot curves and stored into a file
******************************************************************************************
--------------------------------------------------------------------------------------
Function Shade:
==============
compute a shade for a given base colour
Green colours between 10 and 21
Red colours between 22 and 33
Blue colours between 34 and 45
--------------------------------------------------------------------------------------
Arguments:
. x
. BaseColour
. Min
. Max
. darkToLight
. invisible
--------------------------------------------------------------------------------------
Function EvolifeColourID:
========================
Recognizes Colour_designation as a number, a name, a (R,V,B) tuple or a #RRVVBB pattern.
Returns the recognized colour as a couple (Number, Name)
--------------------------------------------------------------------------------------
Arguments:
. Colour_designation
. default
**************************************************************************************
Class Stroke:
============
stores coordinates as: (x, y, colour, thickness)
Missing values are completed with default values
A fractional size value means a fraction of the reference size (typically window width)
A negative size value means that size is provided in logical coordinates
(and that the object should be resized when zoomed). Otherwise size means pixels.
**************************************************************************************
----------------------------------------------------------------------------------
Method Stroke.__init__
----------------------------------------------------------------------------------
Arguments:
. Coordinates
. RefSize
----------------------------------------------------------------------------------
Method Stroke.point
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Stroke.endpoint
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Stroke.scroll
----------------------------------------------------------------------------------
**************************************************************************************
Class Curve:
===========
Holds a complete (continuous) curve in memory
**************************************************************************************
----------------------------------------------------------------------------------
Method Curve.__init__:
=====================
creation of a curve.
A curve is a list of successive connected positions + a list of dicontinuities
----------------------------------------------------------------------------------
Arguments:
. colour
. ID
. ColName
. Legend
----------------------------------------------------------------------------------
Method Curve.erase:
==================
reset curve
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Curve.start:
==================
A curve is a list of successive connected positions + a list of dicontinuities
----------------------------------------------------------------------------------
Arguments:
. StartPos
----------------------------------------------------------------------------------
Method Curve.name:
=================
sets the curve’s name
----------------------------------------------------------------------------------
Arguments:
. N
----------------------------------------------------------------------------------
Method Curve.legend:
===================
sets the curve’s caption
----------------------------------------------------------------------------------
Arguments:
. L
----------------------------------------------------------------------------------
Method Curve.last:
=================
returns the last position in the curve
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Curve.add:
================
Adds a new position to the curve.
Notes a discontinuity if ‘Draw’ is False.
----------------------------------------------------------------------------------
Arguments:
. Pos
. Draw
----------------------------------------------------------------------------------
Method Curve.length
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Curve.X_coord:
====================
list of x-coordinates
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Curve.Y_coord:
====================
list of y-coordinates
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Curve.Avg:
================
compute average value of Y_coord
----------------------------------------------------------------------------------
Arguments:
. start
----------------------------------------------------------------------------------
Method Curve.next:
=================
Iteratively returns segments of the curve
----------------------------------------------------------------------------------
**************************************************************************************
Class Curves:
============
Stores a list of ‘Curves’
**************************************************************************************
----------------------------------------------------------------------------------
Method Curves.__init__:
======================
Creates a list of curves matching all available Evolife colours
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Curves.start_Curve:
=========================
defines where a curve should start
----------------------------------------------------------------------------------
Arguments:
. Curve_id
. location
----------------------------------------------------------------------------------
Method Curves.CurveAddPoint:
===========================
Adds a point to a Curve. Stores the Curve as "used"
----------------------------------------------------------------------------------
Arguments:
. Curve_id
. Point
. Draw
----------------------------------------------------------------------------------
Method Curves.Curvenames:
========================
records names for Curves.
Names = list of (Colour, Name, Legend) tuples (Name and Legend replaced by ‘’ if missing)
----------------------------------------------------------------------------------
Arguments:
. Names
----------------------------------------------------------------------------------
Method Curves.ActiveCurves:
==========================
returns actually used curves
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Curves.Legend:
====================
returns tuples (ID, colour, colourname, curvename, legend) representing active curves
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Curves.dump:
==================
Saves Curves to a file.
Average values are stored in a file with ‘_res’ appended to ResultFileName
----------------------------------------------------------------------------------
Arguments:
. ResultFileName
. ResultHeader
. DumpStart
Back to Evolife