@ -9,21 +9,19 @@ FluidLabelSet is a server-side container of associations between labels (from a
CLASSMETHODS::
CLASSMETHODS::
PRIVATE:: kr
METHOD:: new
METHOD:: new
Make a new instance of a label set, uniquely identified by its name. Creating an instance with a name already in use will throw an exception. Use link::Classes/FluidLabelSet#*at:: or free the existing instance.
Make a new instance of a label set, uniquely identified by its name. Creating an instance with a name already in use will throw an exception. Use link::Classes/FluidLabelSet#*at:: or free the existing instance.
ARGUMENT:: server
ARGUMENT:: server
The link::Classes/Server:: on which to create the label set
The link::Classes/Server:: on which to create the label set.
ARGUMENT:: name
ARGUMENT:: name
symbol or string with the label set's name
symbol with the label set's name.
METHOD:: at
METHOD:: at
Retreive a label set from the cache
Retrieve a label set from the cache.
ARGUMENT:: server
ARGUMENT:: server
The link::Classes/Server:: on which to create the label set
The link::Classes/Server:: on which to create the label set.
ARGUMENT:: id
ARGUMENT:: id
symbol or string with the label set's name
symbol or string with the label set's name.
INSTANCEMETHODS::
INSTANCEMETHODS::
@ -31,68 +29,54 @@ INSTANCEMETHODS::
PRIVATE:: init, id
PRIVATE:: init, id
METHOD:: addLabel
METHOD:: addLabel
Add a label to the label set
Add a label to the label set.
ARGUMENT:: id
ARGUMENT:: id
symbol or string with the ID for this label
symbol or string with the ID for this label.
ARGUMENT:: label
ARGUMENT:: label
symbol or string with the label to add
symbol or string with the label to add.
ARGUMENT:: action
ARGUMENT:: action
function to run when the operation completes
function to run when the operation completes.
METHOD:: updateLabel
METHOD:: updateLabel
Change a label in the label set
Change a label in the label set.
ARGUMENT:: id
symbol or string with the ID for this label
ARGUMENT:: label
symbol or string with the label to add
ARGUMENT:: action
function to run when the operation completes
METHOD:: getLabel
METHOD:: getLabel
Retreive the label associated with an ID. Will report an error if the ID isn't present in the set
Retrieve the label associated with an ID. Will report an error if the ID isn't present in the set.
ARGUMENT:: id
symbol or string with the ID to retreive.
ARGUMENT:: action
A function to run when the server responds, with the label as its argument
METHOD:: deleteLabel
METHOD:: deleteLabel
Remove a id-label pair from the label set
Remove a id-label pair from the label set.
ARGUMENT:: id
symbol or string with the ID to remove
ARGUMENT:: action
A function to run when the label has been removed
METHOD:: clear
METHOD:: clear
Empty the label set
Empty the label set.
ARGUMENT:: action
Function to run whrn the action completes
METHOD:: size
METHOD:: size
Report the number of items in the label set
Report the number of items in the label set.
ARGUMENT:: action
A function to run when the server responds, taking the size as its argument
METHOD:: cols
METHOD:: cols
Returns the dimensionality of the link::Classes/FluidDataSet:: associated with this label set
Report the number of labels per point (at the moment only 1 is supported).
ARGUMENT:: action
A function to run when the server responds, with the dimensionality as its argument
METHOD:: write
METHOD:: write
Write this label set to disk as a JSON file.
Write this label set to disk as a JSON file.
ARGUMENT:: filename
Absolute path of file to write
ARGUMENT:: action
A function to run when the file is written
METHOD:: read
METHOD:: read
Read a label set from a JSON file on disk
Read a label set from a JSON file on disk, replacing the current contents.
ARGUMENT:: filename
Absolute path of the file to read
METHOD:: dump
ARGUMENT:: action
Get the contents of the label set as a Dictionary (note: uses a temporary file under the hood);
A function to run when the file is read
METHOD:: load
Fill the label set with the contents of a dictionary, replacing its current contents (note: uses a temporary file under the hood).
METHOD:: print
Post an abbreviated content of the label set in the window by default, but you can supply a custom action instead.