DataSourceVTFx.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 "CeeUnstructGrid/Base.h"
16 #include "CeeCore/PtrRef.h"
17 #include "CeeCore/Str.h"
18 
19 #include "CeeUnstructGrid/DataSourceInterface.h"
20 
21 namespace cee {
22 
23 class PropertySetCollection;
24 class ImageResources;
25 
26 namespace ug {
27 
28 class VTFxMemoryFile;
29 class UnstructGridModel;
30 class Error;
31 
32 //==================================================================================================
33 //
34 //
35 //
36 //==================================================================================================
37 class CEE_UG_EXPORT DataSourceVTFx : public DataSourceInterface
38 {
39 public:
40  DataSourceVTFx(int dataSourceId);
41  virtual ~DataSourceVTFx();
42 
43  bool isOpen() const;
44 
45  bool openCase(const Str& fileName, size_t caseIndex, Error* error = NULL);
46  bool openCase(const VTFxMemoryFile* vtfxMemFile, size_t caseIndex, Error* error = NULL);
47  bool openCaseById(const Str& fileName, int caseId, Error* error = NULL);
48  bool caseProperties(PropertySetCollection* propSetCollection, ImageResources* resources);
49  bool isDisplayModelOnly();
50  int caseId() const;
51  Str caseName() const;
52  Str caseDescription() const;
53 
54  void setReadShellsOnly(bool readSurfaceElementOnly);
55  void setPassword(const Str& password);
56 
57  size_t plotDataCount() const;
58  Str plotDataName(size_t plotIndex);
59  size_t plotDataVariableCount(size_t plotIndex);
60  Str plotDataVariableName(size_t plotIndex, size_t plotVariableIndex);
61  std::vector<double> plotDataVariableValues(size_t plotIndex, size_t plotVariableIndex);
62 
63  virtual bool open(const Str& filename, Error* error = NULL);
64  virtual void close();
65 
66  static bool isVTFxFile(const Str& filename);
67 
68 
69 private:
70  virtual void internal_wasAssignedToModel(ug::UnstructGridModel* model);
71  CEE_DISALLOW_COPY_AND_ASSIGN(DataSourceVTFx);
72 
73 private:
74  Str m_password;
75  bool m_readShellsOnly;
76 };
77 
78 
79 
80 } // namespace ug
81 } // namespace cee
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
A VTFx model file existing in memory.
Definition: VTFxMemoryFile.h:31
A general unicode based string class.
Definition: Str.h:28
Data source interface for VTFx model files.
Definition: DataSourceVTFx.h:37
A collection of property sets.
Definition: PropertySetCollection.h:29
Class for storing image resources.
Definition: ImageResources.h:30
Error object for simple error management
Definition: Error.h:27
UnstructGridModel is a subclass of Model which adds specific model structure and functionality for re...
Definition: UnstructGridModel.h:72
A parent class for interface data sources.
Definition: DataSourceInterface.h:34