DataSourceVTF.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 "CeeUnstructGrid/DataSourceInterface.h"
17 
18 #include "CeeCore/Str.h"
19 
20 namespace cee {
21 class PropertySetCollection;
22 class ImageResources;
23 class Image;
24 
25 namespace ug {
26 
27 class Error;
28 
29 //==================================================================================================
30 //
31 //
32 //
33 //==================================================================================================
34 class CEE_UG_EXPORT DataSourceVTF : public DataSourceInterface
35 {
36 public:
37  DataSourceVTF(int dataSourceId);
38  virtual ~DataSourceVTF();
39 
40  static bool isVTFFile(const Str& filename);
41  static bool snapshotImage(const Str& filename, Image* image);
42  static bool isExpressFile(const Str& filename);
43 
44  bool isOpen() const;
45  virtual bool open(const Str& fileName, Error* error = NULL);
46  virtual void close();
47 
48  bool fileProperties(PropertySetCollection* propSetCollection, ImageResources* resources);
49  int vendorId() const;
50 
51  static size_t plotDataCount(const Str& filename);
52  static bool read2dPlotData(const Str& filename, size_t plotDataIndex, std::vector<Str>* variableNames, std::vector<Str>* variableUnits, std::vector<std::vector<double> >* variableData);
53 
54  static Str fileContentsInfo(const Str& filename);
55 
56 private:
57  virtual void internal_wasAssignedToModel(ug::UnstructGridModel* model);
58 
59  CEE_DISALLOW_COPY_AND_ASSIGN(DataSourceVTF);
60 };
61 
62 
63 } // namespace ug
64 } // namespace cee
Stores an RGBA image with 8 bits per pixel.
Definition: Image.h:25
Data source interface for VTF model files.
Definition: DataSourceVTF.h:34
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
A general unicode based string class.
Definition: Str.h:28
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