Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitTreeComponents ¶
func InitTreeComponents(engine *qml.Engine) error
Package-wide initialisation, but it requires that the QML Engine be available, so it can't be done as an actual package init, but must be called explicitly once the Engine is created inside the QML run method.
func NewSippRootNode ¶
func NewSippRootNode(url string)
NewSippRootNode initialises a new root SippNode by loading the given file. Returns nil on error.
Types ¶
type SippNode ¶
type SippNode struct { // The Image(s) at this node. Src []SippImage // The operation that got us here from the Parent node, i.e. Src = Op(...) SippOp // The UI object that corresponds to this node. QmlNode *qml.Window // The UI object(s) that correspond(s) to the window(s) displaying the full // image(s) for this node. QmlImage *qml.Window // The parameters to the SippOp that got us here. This is also used to // store raw base data for nodes that have images only as visualisations // of underlying data. For example, the gradient operation produces a // GradImage (see sgrad.go) and must be rendered to obtain images of the // real and imaginary parts. Params SippOpParams // The nodes that have been derived (and retained) from this node. // The slice itself is nil at a leaf. Children []*SippNode // The node that this one was derived from, nil at the root of the tree. Parent *SippNode // The name of this image, to be used for window titles and as a key // in a map of nodes. Must be unique so that a map can work as a lookup // mechanism. Name string }
We store all images as a tree, retaining the operations and parameters that produced each image from its parent in the tree. A SippNode is a node in the tree.
func (*SippNode) CloseImage ¶
func (victim *SippNode) CloseImage()
type SippOp ¶
type SippOp interface {
Op([]*SippImage, *SippOpParams) []*SippImage
}
A SippOp specifies a function that takes a slice of source images and an arbitrary set of parameters, and returns a slice of result images.
type SippOpParams ¶
type SippOpParams interface{}
A type used only to allow storing an arbitrary set of parameters as part of a SippNode.