ExportVTFx.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: UnstructGrid
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeExport/Base.h"
16 #include "CeeCore/RefCountedObject.h"
17 #include "CeeCore/Str.h"
18 
19 #include <vector>
20 
21 namespace cee {
22 
23 class PropertySetCollection;
24 class Image;
25 class ImageResources;
26 
27 namespace ug {
28 class UnstructGridModel;
29 class VTFxMemoryFile;
30 }
31 
32 namespace exp {
33 
34 //==================================================================================================
35 //
36 // Export selected view to VTFx
37 //
38 //==================================================================================================
39 class CEE_EXP_EXPORT ExportVTFx
40 {
41 public:
43  {
45  FULL_DATA_MODEL
46  };
47 
49  {
53  BOTTOM_RIGHT
54  };
55 
56 public:
58  ExportVTFx(ExportType type, ug::UnstructGridModel* model, bool forceIdenticalDatabase);
59  ~ExportVTFx();
60 
61  void addProperties(const PropertySetCollection& properties);
62  void addResources(const ImageResources& resources);
63  void clearPropertiesAndResources();
64  size_t addPlotData(const Str& plotName, const std::vector<Str>& variableNames, const std::vector<std::vector<double> >& variableValues);
65 
66  void setVendorNameAndApplication(const Str& vendorName, const Str& vendorApplication);
67  void setSnapshotImage(Image* snapshotImage);
68  void setCaseName(const Str& name);
69  void setCaseDescription(const Str& description);
70  void setCustomLogo(Image* logoImage, OverlayPosition position);
71 
72  void setVisiblePartsOnly(bool on);
73  void setStartAnimation(bool on);
74  void setCompressionLevel(unsigned int compressionLevel);
75  void setPassword(const Str& password);
76  void setCreateSignature(bool on);
77  void setExportRelativeValues(bool on);
78  void setWriteAsciiDataFiles(bool on);
79  void setRelativeDisplacements(bool on);
80  void setExportOnlyVisibleElements(bool on);
81 
82  bool addUserTextFile(const Str& filename, const Str& content);
83 
84  bool saveCase(const Str& fileName);
85  bool appendCase(const Str& fileName);
86 
87  void close();
88 
89  bool saveCase(ug::VTFxMemoryFile* vtfxMemoryFile);
90  bool appendCase(ug::VTFxMemoryFile* vtfxMemoryFile);
91 
92 private:
93  CEE_PRIVATE_IMPL(ExportVTFx);
94  CEE_DISALLOW_COPY_AND_ASSIGN(ExportVTFx);
95 };
96 
97 } // namespace ug
98 } // namespace cee
Stores an RGBA image with 8 bits per pixel.
Definition: Image.h:25
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Export current view and model setting as VTFx file.
Definition: ExportVTFx.h:39
A VTFx model file existing in memory.
Definition: VTFxMemoryFile.h:31
Only exports the visible triangles/points/lines as well as any cutting plane or isosurfaces as precom...
Definition: ExportVTFx.h:44
A general unicode based string class.
Definition: Str.h:28
Top right corner.
Definition: ExportVTFx.h:51
Bottom left corner.
Definition: ExportVTFx.h:52
Top left corner.
Definition: ExportVTFx.h:50
A collection of property sets.
Definition: PropertySetCollection.h:29
OverlayPosition
Overlay position in exported VTFx.
Definition: ExportVTFx.h:48
Class for storing image resources.
Definition: ImageResources.h:30
ExportType
Type of export to perform.
Definition: ExportVTFx.h:42
UnstructGridModel is a subclass of Model which adds specific model structure and functionality for re...
Definition: UnstructGridModel.h:72