Overture  Version 25
DataFormats.h
Go to the documentation of this file.
1 #ifndef DATA_FORMATS_H
2 #define DATA_FORMATS_H
3 
4 // The DataFormats class handles IO and conversion between different
5 // data formats such as Plot3d, Ingrid, ply, ...
6 
7 #include "Mapping.h"
8 #include "MappingInformation.h"
9 
10 // Forward declarations:
11 class DataPointMapping;
14 class MappedGrid;
15 class CompositeGrid;
18 #ifdef OV_USE_DOUBLE
20 #else
22 #endif
23 
25 {
26 public:
27 
29 {
34 };
35 
36 
37 // DataFormats(GenericGraphicsInterface *ggiPointer=NULL );
38 // virtual ~DataFormats();
39 
40 // virtual int setGraphicsInterface( GenericGraphicsInterface *ggiPointer=NULL );
41 
42 // read in a single grid from a file, optionally read a mask (iblank) array
43 static int readPlot3d(DataPointMapping & dpm,
44  int gridToRead=-1,
45  const aString & gridFileName=nullString,
46  intArray *maskPointer=NULL,
47  const bool expectIblank=false );
48 
49 // read in all grids from a file.
50 static int readPlot3d(MappingInformation & mapInfo,
51  const aString & gridFileName /*=nullString*/,
52  intArray *&maskPointer,
53  const bool expectIblank=false );
54 
55 // read in a solution array and parameters from a file
56 static int readPlot3d(realArray & q, RealArray & par,
57  const aString & qFileName=nullString);
58 
59 // read in all solutions and parameters from a file
60 static int readPlot3d(realArray *& q, RealArray & par,
61  const aString & qFileName=nullString);
62 
63 // read in an unstructured Mapping from an Ingrid file
64 static int readIngrid(UnstructuredMapping &map,
65  const aString & gridFileName=nullString);
66 
67 static int readTecplot(ListOfMappingRC &mList, const aString &gridFileName = nullString);
68 
69 static int readCart3dTri(ListOfMappingRC &mList, const aString &gridFileName = nullString);
70 
71 #if 0
72 // read in an unstructured mesh into a mapped grid
73 static int readIngrid(MappedGrid &mg,
74  const aString & gridFileName=nullString);
75 #endif
76 
77 // read in an unstructured Mapping from a Ply polygonal file (Stanford/graphics)
78 static int readPly(UnstructuredMapping &map,
79  const aString &gridFileName =nullString);
80 
81 // read in an unstructured Mapping from an STL file
82 static int readSTL(UnstructuredMapping &map,
83  const aString & stlFileName =nullString);
84 
85 // save a Mapping in plot3d format
86 static int writePlot3d(Mapping & map,
87  const aString & gridFileName=nullString );
88 
89 // save a MappedGrid in plot3d format
90 static int writePlot3d(MappedGrid & mg,
91  const aString & gridFileName=nullString );
92 
93 // save a CompositeGrid in plot3d format
94 static int writePlot3d(CompositeGrid & cg,
95  const aString & gridFileName=nullString,
96  const aString & interpolationDataFileName=nullString );
97 
98 // save a realCompositeGridFunction in a plot3d "q" file.
100  const RealArray & par );
101 
102 // write a Mapping to an Ingrid file
103 static int writeIngrid(Mapping &map,
104  const aString & gridFileName=nullString);
105 
106 // write a ComposteGrid to an Ingrid file
107 static int writeIngrid(CompositeGrid & cg,
108  const aString & gridFileName=nullString);
109 
110 protected:
111 
112 static int readPlot3d(MappingInformation & mapInfo,
113  int gridToRead,
114  const aString & plot3dFileName,
115  DataPointMapping *dpmPointer,
116  realArray *&qPointer,
117  RealArray & par /*= Overture::nullRealArray()*/,
118  intArray *&maskPointer/*=NULL*/,
119  const bool expectIblank /* =false */ );
120 
121 // GenericGraphicsInterface *giPointer;
122 
123 };
124 
125 #endif