Constructors
Fields
Properties
Arguments
#Gets all the arguments associated with this function. Arguments can be either of type Vector (i.e. 2D grips) or Scalar (i.e. 1D sliders) or referents (i.e. 1D functions).
AssumeContinuous
#Override this property and return false if the underlying function is expected to contain discontinuities.
LatestGraphSegments
#The polyline segments the graph was most recently drawn with, in graph (content) coordinates. Empty when the function hasn't been drawn yet. Populated by DrawGraph(FunctionGraphics) from whatever GraphSegments(FunctionGraphics) yields, so subclasses that override GraphSegments (LinearFunction, ThresholdFunction, etc.) contribute here too. Hit-testing uses these so the click tolerance matches the rendered pixels exactly.
Rank
#Gets or sets the stature of this function. The stature controls the visual style of the function, as well as its inclusion in any outputted collection.
Tint
#Gets or sets the Open-Color family used to tint this function. A concrete shade is resolved at draw time based on the current background so the function stays legible under any theme. Use TintFor(Color) when a concrete Color is needed.
Methods
AfterDrawGraphSegments
#Draw any decoration that should appear on top of the graph polyline. Called from DrawGraph(FunctionGraphics) after the polyline has been rendered.
protected virtual void AfterDrawGraphSegments()
BeforeDrawGraphSegments
#Draw any decoration that should appear behind the graph polyline. Called from DrawGraph(FunctionGraphics) after GraphSegments(FunctionGraphics) has run, so LatestGraphSegments is populated and available.
protected virtual void BeforeDrawGraphSegments()
CanInsertVector
#Test whether a grip can be inserted at or near a coordinate.
Returns: True if grip can be inserted at modifiedCoordinate.
DrawGraph
#Draw this function graph into a graphics context. Non-virtual: subclasses customise the rendering via GraphSegments(FunctionGraphics) (the polyline itself) and the BeforeDrawGraphSegments(FunctionGraphics) / AfterDrawGraphSegments(FunctionGraphics) hooks (any decorations before or after the curve). This keeps pen setup, rank thickness rules, obscure dashing, and segment capture in one place.
DrawHints
#Draw the visual hints such as asymptotes, limits and markers associated with this function.
EstimateDistance
#Compute an estimate of the distance from the function to the given point. This estimate is done by sampling the function at small intervals around the point. Note: implementors may choose to override this method and provide analytic distance measurements.
Returns: Smallest sampled distance or double.NaN if no sample was within radius.
EstimateProjection
#Compute an estimate of the point on the function closest to a search point. This estimate is done by sampling the function at small intervals around the point.
Returns: Closest point or Point2d.Unset if no sample was within radius.
GraphSegments
#Override this method if you think you can provide a more performant way to generate a graphics path representing the graph curve.
SetupDrawing
#Must be called prior to any draw method. This will ensure the colours and layout are correct.
TintFor
#Resolve Tint into a concrete colour that stands out against the supplied background.
public Color TintFor()
Color
background
Background the tint must contrast with.
Events
FunctionChanged
#Raised when the shape of the function changes due to non-grip/scalar events, for example when the function is modified via a custom menu item.