Parasol Framework
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Core
    • Display
    • Fluid
    • Font
    • Network
    • Vector
    • Audio
    • Sound
    • File
    • MetaClass
    • Module
    • StorageDevice
    • Task
    • Thread
    • Time
    • Compression
    • Config
    • Script
    • XML
    • Controller
    • BlurFX
    • ColourFX
    • CompositeFX
    • ConvolveFX
    • DisplacementFX
    • FilterEffect
    • FloodFX
    • ImageFX
    • LightingFX
    • MergeFX
    • MorphologyFX
    • OffsetFX
    • RemapFX
    • SourceFX
    • TurbulenceFX
    • WaveFunctionFX
    • Scintilla
    • ScintillaSearch
    • Bitmap
    • Clipboard
    • Display
    • Document
    • Font
    • Picture
    • Pointer
    • Surface
    • SVG
    • ClientSocket
    • HTTP
    • NetClient
    • NetSocket
    • Proxy
    • Vector
    • VectorClip
    • VectorColour
    • VectorEllipse
    • VectorFilter
    • VectorGradient
    • VectorGroup
    • VectorImage
    • VectorPath
    • VectorPattern
    • VectorPolygon
    • VectorRectangle
    • VectorScene
    • VectorShape
    • VectorSpiral
    • VectorText
    • VectorTransition
    • VectorViewport
    • VectorWave

WaveFunctionFX Class

A filter effect that plots the probability distribution of a quantum wave function.

This filter effect uses a quantum wave function algorithm to generate a plot of electron probability density. Ignoring its scientific value, the formula can be exploited for its aesthetic qualities. It can be used as an alternative to the radial gradient for generating more interesting shapes for example.

The rendering of the wave function is controlled by its parameters N, L and M. A Scale is also provided to deal with situations where the generated plot would otherwise be too large for its bounds.

The parameter values are clamped according to the rules N >= 1, 0 <= L < N, 0 <= M <= L. Check that the values are assigned and clamped correctly if the wave function is not rendering as expected.

Structure

The WaveFunctionFX class consists of the following fields:

Access
NameTypeComment
  AspectRatioINTSVG compliant aspect ratio settings.
NameDescription
ARF::MEETAspect ratio is preserved. The entire viewbox will be visible in the viewport. The viewbox is scaled up as much as possible.
ARF::NONEScale the viewbox to match the size of the viewport. Aspect ratio is not preserved.
ARF::SLICEAspect ratio is preserved. The viewbox can extend beyond the viewport's edges on one axis. The viewbox is scaled up as much as possible.
ARF::X_MAXAlign to the right.
ARF::X_MIDAlign to the horizontal center.
ARF::X_MINAlign to the left.
ARF::Y_MAXAlign to the bottom.
ARF::Y_MIDAlign to the vertical center.
ARF::Y_MINAlign to the top.
  ColourMapSTRINGAssigns a pre-defined colourmap to the wave function.

An alternative to defining colour Stops in a wave function is available in the form of named colourmaps. Declaring a colourmap in this field will automatically populate the wave function's gradient with the colours defined in the map.

We currently support the following established colourmaps from the matplotlib and seaborn projects: cmap:crest, cmap:flare, cmap:icefire, cmap:inferno, cmap:magma, cmap:mako, cmap:plasma, cmap:rocket, cmap:viridis.

The use of colourmaps and custom stops are mutually exclusive.

  LINTAzimuthal quantum number.

This value is clamped by 0 <= L < N.

  MINTMagnetic quantum number.

This value is clamped by 0 <= M <= L.

  NINTPrincipal quantum number.

This value is clamped by N >= 1.

  ResolutionINTThe pixel resolution of the internally rendered wave function.

By default the resolution of the wave function will match the smallest dimension of the filter target region, which gives the best looking result at the cost of performance.

Setting the Resolution field will instead fix the resolution to that size permanently, and the final result will be scaled to fit the target region. This can give a considerable performance increase, especially when the filter is redrawn it will not be necessary to redraw the wave function if its parameters are constant.

  ScaleDOUBLEMultiplier that affects the scale of the plot.
  StopsSTRUCT []Defines the colours to use for the wave function.

The colours that will be used for drawing a wave function can be defined by the Stops array. At least two stops are required to define a start and end point for interpolating the gradient colours.

If no stops are defined, the wave function will be drawn in greyscale.

  XMLDefSTRINGReturns an SVG compliant XML string that describes the effect.

Actions

The following actions are currently supported:

DrawRender the effect to the target bitmap.
ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height)
ParameterDescription
XThe X position of the region to be drawn.
YThe Y position of the region to be drawn.
WidthThe width of the region to be drawn.
HeightThe height of the region to be drawn.

Note that drawing the wave function will result in the N, L and M parameters being clamped to their valid ranges and this will be reflected in the object once the method returns.

WaveFunctionFX class documentation © Paul Manias © 2010-2025

ARF Type

Aspect ratios control alignment, scaling and clipping.

NameDescription
ARF::MEETAspect ratio is preserved. The entire viewbox will be visible in the viewport. The viewbox is scaled up as much as possible.
ARF::NONEScale the viewbox to match the size of the viewport. Aspect ratio is not preserved.
ARF::SLICEAspect ratio is preserved. The viewbox can extend beyond the viewport's edges on one axis. The viewbox is scaled up as much as possible.
ARF::X_MAXAlign to the right.
ARF::X_MIDAlign to the horizontal center.
ARF::X_MINAlign to the left.
ARF::Y_MAXAlign to the bottom.
ARF::Y_MIDAlign to the vertical center.
ARF::Y_MINAlign to the top.
WaveFunctionFX module documentation © Paul Manias © 2010-2025