COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
CoviseIO.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef COVISEIO_H
9 #define COVISEIO_H
10 
11 #include <util/coviseCompat.h>
12 #include <appl/ApplInterface.h>
13 #include <file/covWriteFiles.h>
14 #include <file/covReadFiles.h>
15 #include <do/coDoData.h>
16 #include <string>
17 
18 namespace covise
19 {
20 
21 class coDoLines;
22 class coDoPixelImage;
23 class coDoPoints;
24 class coDoPolygons;
25 class coDoQuads;
26 class coDoRectilinearGrid;
27 class coDoSpheres;
28 class coDoStructuredGrid;
29 class coDoText;
30 class coDoTexture;
31 class coDoTriangleStrips;
32 class coDoTriangles;
33 class coDoUniformGrid;
34 class coDoUnstructuredGrid;
35 
37 {
38 private:
39  class doInfo
40  {
41  public:
43  {
44  obj = o;
45  fileOffset = offset;
46  }
48  int64_t fileOffset;
49  };
50  typedef std::vector<doInfo> ObjectList;
51  typedef std::list<std::string> ObjectNameList;
52 
53  // Local data
54  int n_coord, n_elem, n_conn;
55  int *el, *vl, *tl;
56  float *x_coord;
57  float *y_coord;
58  float *z_coord;
59  float *radius;
60 
62 
63  // Shared memory data
81 
82  int setsRead;
85  int skipSteps;
86 
87  void readattrib(int fd, coDistributedObject *tmp_Object);
88  void skipattrib(int fd);
89  coDistributedObject *readData(int fd, const char *Name);
90  void skipData(int fd);
91  void writeobj(int fd, const coDistributedObject *tmp_Object);
92  bool force;
95 
96 protected:
97  virtual int covOpenInFile(const char *grid_Path);
98  virtual int covCloseInFile(int fd);
99 
100 public:
101  coDistributedObject *ReadFile(const char *filename, const char *ObjectName, bool force = false, int firstStep = 0, int numSteps = 0, int skipSteps = 0);
102  int WriteFile(const char *filename, const coDistributedObject *Object);
104  {
105  force = false;
106  }
107  virtual ~CoviseIO()
108  {
109  }
110 };
111 }
112 #endif
coDoUniformGrid * ugrid
Definition: CoviseIO.h:64
GLsizei GLsizei GLuint * obj
Definition: khronos-glext.h:6733
coDoPoints * pts
Definition: CoviseIO.h:66
std::list< std::string > ObjectNameList
Definition: CoviseIO.h:51
Definition: coDoSpheres.h:46
int covOpenInFile(const char *filename)
Definition: covFiles.c:197
Definition: coDoPolygons.h:179
ObjectList objectList
Definition: CoviseIO.h:94
Definition: coDoPoints.h:47
coDoTriangles * triang
Definition: CoviseIO.h:68
coDoStructuredGrid * sgrid
Definition: CoviseIO.h:72
coDoText * txt
Definition: CoviseIO.h:78
#define READEREXPORT
Definition: coExport.h:200
coDoLines * lin
Definition: CoviseIO.h:67
std::string grid_Path
Definition: CoviseIO.h:61
coDoPolygons * pol
Definition: CoviseIO.h:65
CoviseIO()
Definition: CoviseIO.h:103
float * z_coord
Definition: CoviseIO.h:58
float * y_coord
Definition: CoviseIO.h:57
int n_elem
Definition: CoviseIO.h:54
int numStepsToRead
Definition: CoviseIO.h:84
Definition: CoviseIO.h:36
coDoPixelImage * pixelimage
Definition: CoviseIO.h:76
bool force
Definition: CoviseIO.h:92
Definition: coDoUnstructuredGrid.h:60
GLsizei const GLchar *const * string
Definition: khronos-glext.h:6750
Definition: coDoRectilinearGrid.h:53
coDoVec3 * us3dv
Definition: CoviseIO.h:75
virtual ~CoviseIO()
Definition: CoviseIO.h:107
Definition: coDoTexture.h:34
coDoFloat * us3d
Definition: CoviseIO.h:74
int64_t fileOffset
Definition: CoviseIO.h:48
coDoRectilinearGrid * rgrid
Definition: CoviseIO.h:71
Definition: coDoUniformGrid.h:53
Definition: coDoPolygons.h:241
std::vector< doInfo > ObjectList
Definition: CoviseIO.h:50
Definition: coDoData.h:367
float * radius
Definition: CoviseIO.h:59
Definition: coDoText.h:39
Definition: coDoLines.h:47
Definition: coDoStructuredGrid.h:53
coDoTexture * texture
Definition: CoviseIO.h:77
coDistributedObject * obj
Definition: CoviseIO.h:47
coDoRGBA * rgba
Definition: CoviseIO.h:79
int setsRead
Definition: CoviseIO.h:82
Definition: coDoData.h:84
Definition: coDistributedObject.h:295
coDoTriangleStrips * tri
Definition: CoviseIO.h:70
GLintptr offset
Definition: khronos-glext.h:6611
coDoQuads * quads
Definition: CoviseIO.h:69
doInfo(coDistributedObject *o, int64_t offset)
Definition: CoviseIO.h:42
int skipSteps
Definition: CoviseIO.h:85
int firstStepToRead
Definition: CoviseIO.h:83
Definition: coDoTriangleStrips.h:47
Definition: coDoPolygons.h:50
coDoUnstructuredGrid * mesh
Definition: CoviseIO.h:73
int * vl
Definition: CoviseIO.h:55
Definition: CoviseIO.h:39
Definition: coDoPixelImage.h:34
float * x_coord
Definition: CoviseIO.h:56
int covCloseInFile(int fd)
Definition: covFiles.c:237
ObjectNameList objectNameList
Definition: CoviseIO.h:93
coDoSpheres * sph
Definition: CoviseIO.h:80
Definition: coDoData.h:261