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 Ceetron 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 array 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 Ceetron 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.
-
enumerator OBJECT_IMAGE
Public Functions
-
Snapshot(SnapshotType type)
Creates an empty snapshot with the specified snapshot type.
-
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 expandedDescription() const
Returns the snapshot description expanded with the actual values of the field values.
-
void setFieldValues(const std::map<Str, Str> &fieldValues)
Sets the field values for this snapshot.
-
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.
-
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 QtReposityoryManager and WinFormsReport examples provided in the distribution has example code for this.
Note! Only used by ReportCreatorPowerPoint and ReportCreatorWord!