class Situation : public RefCountedObject

A situation stores the setup of the unstructgrid model and view.

This enables the user to reapply/recreate a specific situation. This can for instance be fringes, vector results, current step, draw style, cutting plane configuration and so on. This enables the user to quickly change between a number of desired setups without having to manually apply all the changed settings.

The situation item is model independent and can be applied to any fitting model.

Situations can be saved/loaded from file using the SituationIo class.

Public Functions


Creates an empty situation item.

const PropertySetCollection *propertyCollection() const

Returns the collection of properties for this situation.

void setPropertyCollection(PropertySetCollection *collection)

Sets the property collection.

void setName(const Str &name)

Sets the name of this situation.

Str name() const

Returns the situation name.

void setDescription(const Str &description)

Sets the situation description.

Str description() const

Returns the description.

void setSourceModelFile(const Str &modelfile)

Sets the source model file path.

Str sourceModelFile() const

Returns the source model file path.

void setSnapshot(Image *image)

Sets a snapshot image for this situation.

const Image *snapshot() const

Returns the snapshot image.

Str date() const

Returns the date for when this situation item was created. Format: yy:mm:dd:hh:mm.

std::vector<const DataElementSet*> elementSets() const

Returns an array of element sets.

std::vector<SetInfo> elementSetInfos() const

Returns an array of element set info.

void addElementSetInfo(SetInfo setInfo)

Adds an element set info to a situation.

Number of element sets and element sets info must always be the same!

void addElementSet(const DataElementSet *set)

Adds an element set to a situation.

Number of element sets and element sets info must always be the same!

size_t userDataCount() const

Returns the number of user-defined data items.

Str userData(const Str &name) const

Returns the value of the given user-defined data key.

void setUserData(const Str &name, const Str &value)

Sets the value of a given user-defined data key.

User data consists of a map of key-value pair. Key names must be unique.

void setAllUserData(std::map<Str, Str> ud)

Sets all user data.

const std::map<Str, Str> *allUserData() const

Returns all user data.

void capture(const UnstructGridModel &model, const vis::View &view)

Captures the situation content from the given model and view.

void updateModel(UnstructGridModel *model) const

Updates the given model with this situation.

void updateView(vis::View *view) const

Updates the given view with this situation.