Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
Ogshow.h
Go to the documentation of this file.
1
#ifndef OGSHOW_H
2
#define OGSHOW_H "Ogshow.h"
3
4
#include "
CompositeGrid.h
"
5
#include "
CompositeGridFunction.h
"
6
#include "
ShowFileParameter.h
"
7
8
#include OV_STD_INCLUDE(vector)
9
10
class
HDF_DataBase
;
11
12
class
Ogshow
13
{
14
public
:
15
16
typedef
int
FrameSeriesID
;
17
18
enum
ShowFileOpenOption
19
{
20
openNewFileForWriting
,
21
openOldFileForWriting
22
};
23
24
25
Ogshow
();
26
Ogshow
(
const
aString
& nameOfShowFile,
27
const
aString
& nameOfDirectory =
"."
,
28
int
useStreamMode=
false
,
29
ShowFileOpenOption
openOption=
openNewFileForWriting
);
30
31
~Ogshow
();
32
33
// return a pointer to the current frame
34
HDF_DataBase
*
getFrame
(
const
Ogshow::FrameSeriesID
= 0);
35
36
int
open
(
const
aString
& nameOfShowFile,
37
const
aString
& nameOfDirectory =
"."
,
38
int
useStreamMode=
false
,
39
ShowFileOpenOption
openOption=
openNewFileForWriting
);
40
41
int
close
();
42
43
// save a comment that applies to the whole file
44
int
saveGeneralComment
(
const
aString
& comment );
45
46
// save a comment with the current frame
47
int
saveComment
(
const
int
commentNumber,
const
aString
& comment );
48
49
int
saveSequence
(
const
aString
& name,
50
const
RealArray
& time,
51
const
RealArray
& value,
52
aString
*name1=
NULL
,
53
aString
*name2=
NULL
);
54
55
// save parameters that apply to the whole file
56
enum
PlaceToSaveGeneralParameters
{
57
THEShowFileRoot
=-2,
58
THECurrentFrameSeries
=-1
59
};
60
61
int
saveGeneralParameters
(
ListOfShowFileParameters
& params,
62
const
PlaceToSaveGeneralParameters
placeToSave=
THECurrentFrameSeries
);
63
64
// Save parameters into the current frame
65
int
saveParameters
(
const
aString
& nameOfDirectory,
ListOfShowFileParameters
& params );
66
67
enum
GridLocationEnum
68
{
69
useDefaultLocation
=-2,
70
useCurrentFrame
=-1
71
};
72
73
int
getTotalNumberOfFrames
()
const
;
74
int
getNumberOfFrames
()
const
;
75
76
const
aString
&
getShowFileName
()
const
;
77
78
int
saveSolution
(
realGridCollectionFunction
& u,
const
aString
& name=
"u"
,
79
int
frameForGrid=
useDefaultLocation
);
80
81
int
saveSolution
(
realMappedGridFunction
& u,
const
aString
& name=
"u"
,
82
int
frameForGrid=
useDefaultLocation
);
83
84
int
getNumberOfFrameSeries
()
const
;
85
FrameSeriesID
newFrameSeries
(
const
aString
& name);
86
FrameSeriesID
getFrameSeriesID
(
const
aString
& name);
87
const
aString
&
getFrameSeriesName
(
const
FrameSeriesID
frameSeries);
88
int
setFrameSeriesName
(
const
FrameSeriesID
frameSeries,
const
aString
& name);
89
FrameSeriesID
getCurrentFrameSeries
()
const
;
90
int
setCurrentFrameSeries
(
const
FrameSeriesID
frameSeries);
91
int
setCurrentFrameSeries
(
const
aString
& name);
92
93
int
startFrame
(
const
int
frame=-1);
// start a new frame or write to an existing one
94
int
endFrame
();
// end the frame, close sub-files if appropriate.
95
96
bool
getIsMovingGridProblem
()
const
;
97
void
setIsMovingGridProblem
(
const
bool
trueOrFalse );
98
99
// indicate that the file should be flushed every so often:
100
void
setFlushFrequency
(
const
int
flushFrequency = 5 );
101
int
getFlushFrequency
()
const
;
102
103
// return true if the current frame is the first frame in the current subFile
104
bool
isFirstFrameInSubFile
()
const
;
105
// return true if the current frame is the last frame in the current subFile
106
bool
isLastFrameInSubFile
()
const
;
107
108
// flush the data in the file *** this does not work ***
109
void
flush
();
110
111
112
protected
:
113
void
initialize
();
114
int
cleanup
();
115
int
createShowFile
(
const
aString
& nameOfShowFile,
const
aString
& nameOfDirectory,
ShowFileOpenOption
openOption );
116
int
saveGeneralCommentsToFile
();
117
int
saveCommentsToFile
();
118
119
aString
showFileName
,
showFileDirectory
;
120
GenericDataBase
*
showFile
;
// here is the show file
121
GenericDataBase
*
showDir
;
// Here is where we save the showfile information
122
int
currentFrameSeries
;
123
124
int
showFileCounter
;
// counts number of solutions saved so far
125
int
showFileCreated
;
// TRUE if a show file is mounted
126
bool
generalCommentsSaved
;
127
128
std::vector<aString>
generalComment
;
129
130
int
totalNumberOfFrames
;
131
int
numberOfFramesPerFile
;
// This many frames per sub file
132
int
magicNumber
;
// unique identifier saved with the file
133
int
defaultStreamMode
;
134
135
struct
OgshowFrameSeries
{
136
OgshowFrameSeries
();
137
138
~OgshowFrameSeries
();
139
140
GenericDataBase
*
showDir
;
// current frame;
141
GenericDataBase
*
frame
;
// current frame;
142
143
int
solutionCounter
;
// local version of showFileCounter
144
145
bool
commentsSaved
;
146
std::vector<aString>
comment
;
147
int
movingGridProblem
;
// true if grids are moving (make this an int to be consistent with ShowFileReader)
148
int
numberOfFrames
;
// local version of totalNumberOfFrames
149
int
frameNumber
;
// current frame
150
int
globalFrameNumber
;
151
FrameSeriesID
id
;
152
int
sequenceNumber
;
// number of seqences saved in the show file.
153
int
streamMode
;
// if true, save file in stream mode (compressed).
154
aString
name
;
155
int
totalNumberOfFramesWhenCreated
;
156
};
157
158
std::vector<OgshowFrameSeries>
frameSeriesList
;
159
160
};
161
162
163
#endif
Generated on Fri Jan 4 2013 10:17:57 for Overture by
1.8.3