# cee::rep::Snapshot

class `Snapshot` : public RefCountedObject

  An image, 3D model or tabular data describing a snapshot.

  There are three types of snapshots that can be used in reports:

  - Images: Snapshot or other image data.
  - 3D model data: 3D models, results and feature extractions are handled through the VTFx file format from Envision enabling the use of 3D directly into the Word/PowerPoint/HTML document.
  - Tabular data: All table data is represented as strings. The first row of data will be column headers. Use this for simple tabular listings or for input data to a chart.

  In addition to the snapshot object itself, each snapshot has the following attributes:

  - Name: Each snapshot can have a name. This is just for internal help and will not be used in the reports.

  - Title: Each snapshot has a title. This can be inserted in the generated reports.

  - Description: This is a more exhaustive description available for each snapshot and simple html formatting can be applied. The description can be inserted in the generated reports. The description can also contain field values (see below). The syntax for inserting field values is $(‘field name’). For instance: . These will then be replaced with the belonging field value upon creating a report.

  - Field values: Field values are a user specified map of field name and field value string pairs belonging to a snapshot. Typical field values can be:

    - Database name
    - Database type
    - Number of parts
    - Number of elements
    - Number of nodes
    - Current scalar result name
    - Current vector result name
    - Maximum result values
    - Minimum result values

    Field value names should, by convention, be in capital letters (i.e. DATABASE_NAME). Field values can be used in the report template, or directly into the snapshot description above.

  The snapshot type (image, 3D model or table) is set upon creation of the snapshot. The corresponding media must be set using setImage(), setTable() or setModelVTFx(). Media that don’t match the given snapshot type is ignored. (For instance if the snapshots type is OBJECT_IMAGE, the existence of a table will be ignored.)

  Note! In PowerPoint and Word, the VTFx file is embedded into the .pptx/.docx file. But for HTML reports, we put the VTFx in the cloud using Ceetron Cloud (https://cloud.ceetron.com) and reference this in the report. To enable the cloud integration, the user need to specify the url to the VTFx model in the Snapshot object using Snapshot::setCloudViewerUrl() instead of (or in addition to) Snapshot::setModelVtfx(). See Ceetron Cloud: Add a Send-To-Cloud Button to Your App for how to upload the VTFx to cloud.

  The QtRepositoryManager and WinFormsReport examples provided in the distribution has example code for this.

  Snapshots are added to a repository and the repository is used by the report creator.

  See more about snapshots on: Snapshots

  See also

  Repository, Table, ReportCreatorWord, ReportCreatorPowerPoint, and ReportCreatorHtml

  Public Types

  enum `SnapshotType`

    Type of data for this snapshot.

    Can be either an image, a 3D model or a table.

    Values:

    enumerator `OBJECT_IMAGE`

      Image snapshot.

      Can be, for instance, a snapshot of the view or an image plot.

    enumerator `OBJECT_VTFX`

      3D model from a view.

      Can contain an animation. Can be viewed in 3D Plugin for Word and PowerPoint or directly in the browser through the Ceetron Cloud feature.

    enumerator `OBJECT_TABLE`

      Tabular data.

      Can be, for instance, a series of picking information or plot data.

  Public Functions

  `Snapshot`(SnapshotType type)

    Creates an empty snapshot with the specified snapshot type.

  Str `name`() const

    Returns the name of the snapshot.

  void `setName`(const Str &name)

    Sets the name of the snapshot.

    This is for internal use and naming when saving the repository. If no name is specified, a default name will be generated. The snapshot name must be unique. If it’s not, it will be appended with a number when added to the repository to make sure it’s unique.

  SnapshotType `type`() const

    Returns the snapshot type (image, 3D model or table)

    See also

    SnapshotObjectType

  Str `title`() const

    Returns the title of this snapshot.

  void `setTitle`(const Str &title)

    Sets the title of the snapshot.

  Str `description`() const

    Returns the snapshot description.

  void `setDescription`(const Str &description)

    Sets the snapshot description.

  Str `expandedDescription`() const

    Returns the snapshot description expanded with the actual values of the field values.

  FieldValueSet `fieldValueSet`() const

    Returns the set of field values for this snapshot.

  void `setFieldValueSet`(const FieldValueSet &fieldValueSet)

    Sets the field values for this snapshot.

  Str `cloudViewerUrl`() const

    Returns the url to the model if it has been uploaded to Ceetron Cloud.

  void `setCloudViewerUrl`(const Str &url)

    Sets the url to the model on Ceetron Cloud.

    Note! Does not do the actual upload, this has to be done in app code.

    See also

    setModelVtfx()

  Str `originalModelPath`() const

    Returns the path to the original model file.

    For instance if you want to reopen the file this snapshot was captured from.

  void `setOriginalModelPath`(const Str &path)

    Sets the path to the original model file.

  const Image *`image`() const

    Returns the image from this image snapshot.

  void `setImage`(Image *image)

    Sets the image for an image snapshot.

  const ug::VTFxMemoryFile *`modelVTFx`() const

    Gets the VTFx model.

  void `setModelVTFx`(ug::VTFxMemoryFile *memoryFile)

    Sets the VTFx model.

    Note! Special handling for HTML. For HTML reports, we put the VTFx in the cloud using Ceetron Cloud (https://cloud.ceetron.com) and reference this in the report. To enable the cloud integration in a HTML, the user need to specify the url to the VTFx model in the Snapshot object using Snapshot::setCloudViewerUrl(), in stead (or in addition) to Snapshot::setModelVtfx(). See Ceetron Cloud: Add a Send-To-Cloud Button to Your App for how to upload the VTFx to cloud. The QtRepositoryManager and WinFormsReport examples provided in the distribution has example code for this.

    Note! Only used by ReportCreatorPowerPoint and ReportCreatorWord!

  bool `setModelVTFxFromFile`(const Str &vtfxFileName)

    Sets the VTFx model from a file.

    A ug::VTFxMemoryFile will be created and inserted into the snapshot.

    Note! Special handling for HTML. For HTML reports, we put the VTFx in the cloud using Ceetron Cloud (https://cloud.ceetron.com) and reference this in the report. To enable the cloud integration in a HTML, the user need to specify the url to the VTFx model in the Snapshot object using Snapshot::setCloudViewerUrl(), in stead (or in addition) to Snapshot::setModelVtfx(). See Ceetron Cloud: Add a Send-To-Cloud Button to Your App for how to upload the VTFx to cloud. The QtRepositoryManager and WinFormsReport examples provided in the distribution has example code for this.

    Note! Only used by ReportCreatorPowerPoint and ReportCreatorWord!

  const Table *`table`() const

    Returns the tabular data for a table snapshot.

  void `setTable`(Table *table)

    Sets the tabular data for a table snapshot.

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...