-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoopProjectFile.h
181 lines (163 loc) · 10.1 KB
/
LoopProjectFile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#ifndef __LOOPPROJECTFILE__H
#define __LOOPPROJECTFILE__H
#include <netcdf>
#include <string>
#include <iostream>
#include <sys/stat.h>
#include "LoopProjectFileUtils.h"
#include "LoopVersion.h"
#include "LoopExtents.h"
#include "LoopDataCollection.h"
#include "LoopExtractedInformation.h"
#include "LoopStructuralModels.h"
#include "LoopGeophysicalModels.h"
#include "LoopUncertaintyModels.h"
/*! \brief The core namespace for Loop Project File functions and structures */
namespace LoopProjectFile {
/*!
* \brief Creates a simple loop project file with versioning information
*
* \param filename - the filename of the loop project file to create
*
* \return Response with success/fail of the create of the file with error message if it failed
*/
LoopProjectFileResponse CreateBasicFile(std::string filename);
/*!
* \brief Opens a loop project file
*
* \param filename - the filename of the loop project file to open
* \param file - a reference to return the netCDF file once opened
* \param readOnly - a flag to open the file in read only mode
* \param verbose - a flag to toggle verbose message printing
*
* \return A flag to indicate whether the project file failed 0-Success, 1-Failed
*/
bool OpenProjectFile(std::string filename, netCDF::NcFile& file, bool readOnly=true, bool verbose=false);
/*!
* \brief Closes an open netCDF file with appropriate exception handling and error messaging
*
* \param file - a pointer to the netCDF file to be closed
*/
void CloseProjectFile(netCDF::NcFile* file);
/*!
* \brief Checks the structure of the loop project file is valid
*
* \param filename - the name of the file to check
* \param verbose - a flag to toggle verbose message printing
*
* \return A flag indicating whether the netCDF file is valid
*/
bool CheckFileValid(std::string filename, bool verbose=false);
/*!
* \brief Sets the version of this repo to the project file
*
* \param filename - the name of the file to change
* \param verbose - a flag to toggle verbose message printing
*
* \return Response with success/fail of setting version with an error message if it failed
*/
LoopProjectFileResponse SetVersion(std::string filename, bool verbose=false);
/*!
* \brief Gets the version of the repo used to create the project file
*
* \param filename - the name of the file to retrieve the version from
* \param verbose - a flag to toggle verbose message printing
*
* \return The version of the repo used to create this project file
*/
LoopVersion GetVersion(std::string filename, bool verbose=false);
// Getters for Extents/Observation/Events/Layers/Models
/*! @{
* \brief Retrieves specified data from the loop project file
*
* \param filename - the filename of the loop project file
* \param data - a reference to where the data is to be copied
* \param verbose - a flag to toggle verbose message printing
*
* \return Response with success/fail of data retrieval with error message if it failed
*/
LoopProjectFileResponse GetExtents(std::string filename, LoopExtents& data, bool verbose=false);
LoopProjectFileResponse GetDataCollectionConfiguration(std::string filename, DataCollectionConfiguration& data, bool verbose=false);
LoopProjectFileResponse GetDataCollectionSources(std::string filename, DataCollectionSources& data, bool verbose=false);
LoopProjectFileResponse GetStructuralModelsConfiguration(std::string filename, StructuralModelsConfiguration& data, bool verbose=false);
LoopProjectFileResponse GetConfiguration(std::string filename, DataCollectionConfiguration& data, bool verbose=false);
LoopProjectFileResponse GetFaultObservations(std::string filename, std::vector<FaultObservation> &data, bool verbose=false);
LoopProjectFileResponse GetFoldObservations(std::string filename, std::vector<FoldObservation> &data, bool verbose=false);
LoopProjectFileResponse GetFoliationObservations(std::string filename, std::vector<FoliationObservation> &data, bool verbose=false);
LoopProjectFileResponse GetDiscontinuityObservations(std::string filename, std::vector<DiscontinuityObservation> &data, bool verbose=false);
LoopProjectFileResponse GetStratigraphicObservations(std::string filename, std::vector<StratigraphicObservation> &data, bool verbose=false);
LoopProjectFileResponse GetContacts(std::string filename, std::vector<ContactObservation> &data, bool verbose=false);
LoopProjectFileResponse GetDrillholeObservations(std::string filename, std::vector<DrillholeObservation> &data, bool verbose=false);
LoopProjectFileResponse GetDrillholeProperties(std::string filename, std::vector<DrillholeProperty> &data, bool verbose=false);
LoopProjectFileResponse GetDrillholeSurveys(std::string filename, std::vector<DrillholeSurvey> &data, bool verbose=false);
LoopProjectFileResponse GetFaultEvents(std::string filename, std::vector<FaultEvent> &data, bool verbose=false);
LoopProjectFileResponse GetFoldEvents(std::string filename, std::vector<FoldEvent> &data, bool verbose=false);
LoopProjectFileResponse GetFoliationEvents(std::string filename, std::vector<FoliationEvent> &data, bool verbose=false);
LoopProjectFileResponse GetDiscontinuityEvents(std::string filename, std::vector<DiscontinuityEvent> &data, bool verbose=false);
LoopProjectFileResponse GetStratigraphicLayers(std::string filename, std::vector<StratigraphicLayer> &data, bool verbose=false);
LoopProjectFileResponse GetEventRelationships(std::string filename, std::vector<EventRelationship> &data, bool verbose=false);
LoopProjectFileResponse GetDrillholeDescriptions(std::string filename, std::vector<DrillholeDescription> &data, bool verbose=false);
/*!@}*/
/*! @{
* \brief Retrieves specified data from the loop project file
*
* \param filename - the filename of the loop project file
* \param data - a reference to where the data is to be copied
* \param dataShape - the dimensions of the data being retrieved
* \param index - the index location for the data
* \param verbose - a flag to toggle verbose message printing
*
* \return Response with success/fail of data retrieval with error message if it failed
*/
LoopProjectFileResponse GetStructuralModel(std::string filename, std::vector<float> &data, std::vector<int> &dataShape, int index, bool verbose=false);
LoopProjectFileResponse GetGeophysicalModel(std::string filename, std::vector<float> &data, std::vector<int> &dataShape, int index, bool verbose=false);
LoopProjectFileResponse GetUncertaintyModel(std::string filename, std::vector<float> &data, std::vector<int> &dataShape, int index, bool verbose=false);
/*!@}*/
// Setters for Extents/Observation/Events/Layers/Models
/*! @{
* \brief Adds or overrides specified data to the loop project file
*
* \param filename - the filename of the loop project file
* \param data - the data to be added
* \param verbose - a flag to toggle verbose message printing
*
* \return Response with success/fail of data insertion with error message if it failed
*/
LoopProjectFileResponse SetExtents(std::string filename, LoopExtents data, bool verbose=false);
LoopProjectFileResponse SetDataCollectionConfiguration(std::string filename, DataCollectionConfiguration data, bool verbose=false);
LoopProjectFileResponse SetDataCollectionSources(std::string filename, DataCollectionSources data, bool verbose=false);
LoopProjectFileResponse SetStructuralModelsConfiguration(std::string filename, StructuralModelsConfiguration data, bool verbose=false);
LoopProjectFileResponse SetFaultObservations(std::string filename, std::vector<FaultObservation> data, bool verbose=false);
LoopProjectFileResponse SetFoldObservations(std::string filename, std::vector<FoldObservation> data, bool verbose=false);
LoopProjectFileResponse SetFoliationObservations(std::string filename, std::vector<FoliationObservation> data, bool verbose=false);
LoopProjectFileResponse SetDiscontinuityObservations(std::string filename, std::vector<DiscontinuityObservation> data, bool verbose=false);
LoopProjectFileResponse SetStratigraphicObservations(std::string filename, std::vector<StratigraphicObservation> data, bool verbose=false);
LoopProjectFileResponse SetContacts(std::string filename, std::vector<ContactObservation> data, bool verbose=false);
LoopProjectFileResponse SetDrillholeObservations(std::string filename, std::vector<DrillholeObservation> data, bool verbose=false);
LoopProjectFileResponse SetDrillholeProperties(std::string filename, std::vector<DrillholeProperty> data, bool verbose=false);
LoopProjectFileResponse SetDrillholeSurveys(std::string filename, std::vector<DrillholeSurvey> data, bool verbose=false);
LoopProjectFileResponse SetFaultEvents(std::string filename, std::vector<FaultEvent> data, bool verbose=false);
LoopProjectFileResponse SetFoldEvents(std::string filename, std::vector<FoldEvent> data, bool verbose=false);
LoopProjectFileResponse SetFoliationEvents(std::string filename, std::vector<FoliationEvent> data, bool verbose=false);
LoopProjectFileResponse SetDiscontinuityEvents(std::string filename, std::vector<DiscontinuityEvent> data, bool verbose=false);
LoopProjectFileResponse SetStratigraphicLayers(std::string filename, std::vector<StratigraphicLayer> data, bool verbose=false);
LoopProjectFileResponse SetEventRelationships(std::string filename, std::vector<EventRelationship> data, bool verbose=false);
LoopProjectFileResponse SetDrillholeDescriptions(std::string filename, std::vector<DrillholeDescription> data, bool verbose=false);
/*!@}*/
/*! @{
* \brief Adds or overrides specified data to the loop project file
*
* \param filename - the filename of the loop project file
* \param data - the data to be added
* \param dataShape - the dimensions of the data being retrieved
* \param index - the index location for the data
* \param verbose - a flag to toggle verbose message printing
*
* \return Response with success/fail of data insertion with error message if it failed
*/
LoopProjectFileResponse SetStructuralModel(std::string filename, std::vector<float> data, std::vector<int> dataShape, int index, bool verbose=false);
LoopProjectFileResponse SetGeophysicalModel(std::string filename, std::vector<float> data, std::vector<int> dataShape, int index, bool verbose=false);
LoopProjectFileResponse SetUncertaintyModel(std::string filename, std::vector<float> data, std::vector<int> dataShape, int index, bool verbose=false);
/*!@}*/
} // namespace LoopProjectFile
#endif