# cee::app::Models

class `Models` : public RefCountedObject

  Class to manage the list of UnstructGridModel instances in the application.

  The interface provides methods adapted to a unique mode view for single-view applications

  Public Functions

  size_t `count`() const

    Returns the number of models.

  cee::ug::UnstructGridModel *`current`() const

    Returns the current model.

  cee::ug::SimulationInfo `currentInfo`() const

    Returns the current model info.

  void `setCurrent`(cee::ug::UnstructGridModel *model)

    Sets the model as current.

  size_t `currentIndex`() const

    Returns the index of the current model.

  void `setCurrentIndex`(size_t index)

    Sets the current model index.

  size_t `indexOf`(const cee::ug::UnstructGridModel *model) const

    Returns the index of the specified model.

  cee::ug::UnstructGridModel *`get`(size_t index) const

    Returns the model at given index.

  cee::ug::SimulationInfo `info`(size_t index) const

    Returns the model info at the specified index.

  cee::ug::SimulationInfo `info`(const cee::ug::UnstructGridModel *model) const

    Returns the model info for the specified model.

  size_t `add`(cee::ug::UnstructGridModel *model)

    Adds the given model and returns its index.

  cee::ug::UnstructGridModel *`open`(const cee::Str &filename, cee::ug::Error *error)

    Creates a model from the given file and adds it to the collection, returning the created model.

  cee::ug::UnstructGridModel *`open`(const cee::Str &filename, const cee::Str &password, cee::ug::Error *error)

    Creates a model from the given file and adds it to the collection, returning the created model.

  cee::ug::UnstructGridModel *`open`(const std::vector<cee::Str> &filenameArr, cee::ug::Error *error)

    Creates a model from the given set of files and adds it to the collection, returning the created model.

  cee::ug::UnstructGridModel *`open`(const std::vector<cee::Str> &filenameArr, const cee::Str &password, cee::ug::Error *error)

    Creates a model from the given set of files and adds it to the collection, returning the created model.

  bool `reopen`(cee::ug::UnstructGridModel *model, const cee::Str &filename, cee::ug::Error *error)

    Reopens specified model using the specified filename.

  bool `reopen`(size_t index, const cee::Str &filename, cee::ug::Error *error)

    Reopens the model at the given index using the specified filename.

  bool `openSecondary`(const cee::Str &filename, cee::ug::Error *error)

    Adds the given secondary file to the current model.

  void `close`(size_t index)

    Closes the model at the specified index.

  void `close`(cee::ug::UnstructGridModel *model)

    Closes the specified model.

  bool `closeCurrent`()

    Closes current model.

  void `closeAll`()

    Closes all model.

  Public Static Functions

  static Models *`instance`()

    Models is a singleton. Always access Models using this instance()

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Desktop in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...