World Ocean Simulation System (WOSS) library
sediment-deck41-db.h
Go to the documentation of this file.
1/* WOSS - World Ocean Simulation System -
2 *
3 * Copyright (C) 2009 Federico Guerra
4 * and regents of the SIGNET lab, University of Padova
5 *
6 * Author: Federico Guerra - federico@guerra-tlc.com
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation;
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22/*
23 * This software has been developed by Federico Guerra and SIGNET lab,
24 * University of Padova, in collaboration with the NATO Centre for
25 * Maritime Research and Experimentation (http://www.cmre.nato.int ;
26 * E-mail: pao@cmre.nato.int), whose support is gratefully acknowledged.
27 */
28
29
40#ifndef WOSS_SEDIMENT_DECK41_DB_H
41#define WOSS_SEDIMENT_DECK41_DB_H
42
43
44#ifdef WOSS_NETCDF_SUPPORT
45
46#include <map>
51
52
53namespace woss {
54
55
60 typedef ::std::map<int, int> FrequencyMap;
61 typedef FrequencyMap::const_iterator FMCIter;
62 typedef FrequencyMap::iterator FMIter;
63 typedef FrequencyMap::reverse_iterator FMRIter;
64 typedef FrequencyMap::const_reverse_iterator FMCRIter;
65
66
71 typedef ::std::map< char, double > SedimWeightMap;
72 typedef SedimWeightMap::iterator SWIter;
73 typedef SedimWeightMap::reverse_iterator SWRIter;
74
75
82 class SedimDeck41Db : public WossDb, public WossSedimentDb {
83
84
85 friend class SedimDeck41DbCreator;
86
87
88 public:
89
90
95 SedimDeck41Db( const ::std::string& name );
96
97 virtual ~SedimDeck41Db() { }
98
99
103 virtual bool openConnection() { return false; }
104
108 virtual bool finalizeConnection() { return false; }
109
110
115 virtual bool closeConnection();
116
117
124 virtual bool insertValue( const Coord& coordinates, const Sediment& sediment_value );
125
126
134 virtual Sediment* getValue( const CoordZ& coordz ) const ;
135
143 virtual Sediment* getValue( const CoordZVector& coordz_vector ) const ;
144
145
146 protected:
147
148
153
158
163
164
169
174
175
180
181
187
188
194 double calculateAvgDepth( const CoordZVector& coordz_vector ) const;
195
196
202 Deck41Types getDeck41TypesFromCoords( const CoordZVector& coordz_vector ) const;
203
209 Deck41Types getDeck41TypesFromMarsdenCoords( const CoordZVector& coordz_vector ) const ;
210
216 Deck41Types getDeck41TypesFromMarsdenSquare( const CoordZVector& coordz_vector ) const ;
217
218
226 Deck41Types calculateDeck41Types( const CoordZVector& coordz_vector ) const;
227
228
235 Sediment* calculateSediment( const Deck41Types& floor_types, double avg_depth ) const;
236
244 Sediment* createSediment( int deck41_type, double depth ) const;
245
246
252 int getMaxAppereanceFrequencyValue( const FrequencyMap& frequency_map ) const;
253
254
261 bool doTestA( const Deck41TypeTests& test ) const ;
262
269 bool doTestB( const Deck41TypeTests& test ) const ;
270
277 bool doTestC( const Deck41TypeTests& test ) const ;
278
279
280 };
281
282
283 // inline functions
285
286 inline bool SedimDeck41Db::doTestA(const Deck41TypeTests& floor) const {
287 return ((floor.getConditionA() == true) || (floor.getConditionB() == true) || (floor.getConditionE() == true) ||
288 (floor.getConditionF() == true));
289 }
290
291
292 inline bool SedimDeck41Db::doTestB(const Deck41TypeTests& floor) const {
293 return ((floor.getConditionC() == true) || (floor.getConditionD() == true) || (floor.getConditionG() == true) );
294 }
295
296
297 inline bool SedimDeck41Db::doTestC(const Deck41TypeTests& floor) const {
298 return ((floor.getConditionC() == true) || (floor.getConditionD() == true));
299 }
300
301
302}
303
304#endif // WOSS_NETCDF_SUPPORT
305
306#endif /* WOSS_SEDIMENT_DECK41_DB_H */
307
308
309
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:403
Coordinates (lat, long) class definitions and functions library.
Definition coordinates-definitions.h:107
Abstraction layer for database and data manipulation.
Definition sediment-deck41-db-logic-control.h:81
bool getConditionF() const
Definition sediment-deck41-db-logic-control.h:184
bool getConditionG() const
Definition sediment-deck41-db-logic-control.h:190
bool getConditionE() const
Definition sediment-deck41-db-logic-control.h:178
bool getConditionC() const
Definition sediment-deck41-db-logic-control.h:166
bool getConditionB() const
Definition sediment-deck41-db-logic-control.h:160
bool getConditionA() const
Definition sediment-deck41-db-logic-control.h:154
bool getConditionD() const
Definition sediment-deck41-db-logic-control.h:172
WossDb for custom made NetCDF DECK41 Sediment database.
Definition sediment-deck41-coord-db.h:94
DbCreator for NetCDF Deck41 Sediment database.
Definition sediment-deck41-db-creator.h:61
WossDb for NetCDF DECK41 Sediment database.
Definition sediment-deck41-db.h:82
Deck41Types getDeck41TypesFromCoords(const CoordZVector &coordz_vector) const
Definition sediment-deck41-db.cpp:180
Deck41Types getDeck41TypesFromMarsdenCoords(const CoordZVector &coordz_vector) const
Definition sediment-deck41-db.cpp:203
Sediment * calculateSediment(const Deck41Types &floor_types, double avg_depth) const
Definition sediment-deck41-db.cpp:309
SedimDeck41CoordDb sediment_coord_db
Definition sediment-deck41-db.h:152
Deck41TypeTests curr_tests_state
Definition sediment-deck41-db.h:168
virtual bool closeConnection()
Definition sediment-deck41-db.cpp:65
static SedimWeightMap sediment_weight_map
Definition sediment-deck41-db.h:179
bool doTestC(const Deck41TypeTests &test) const
Definition sediment-deck41-db.h:297
double calculateAvgDepth(const CoordZVector &coordz_vector) const
Definition sediment-deck41-db.cpp:151
virtual bool openConnection()
Definition sediment-deck41-db.h:103
Deck41Types calculateDeck41Types(const CoordZVector &coordz_vector) const
Definition sediment-deck41-db.cpp:247
Deck41Types getDeck41TypesFromMarsdenSquare(const CoordZVector &coordz_vector) const
Definition sediment-deck41-db.cpp:225
Sediment * createSediment(int deck41_type, double depth) const
Definition sediment-deck41-db.cpp:88
bool doTestA(const Deck41TypeTests &test) const
Definition sediment-deck41-db.h:286
Deck41TypeTests prev_tests_state
Definition sediment-deck41-db.h:173
virtual bool insertValue(const Coord &coordinates, const Sediment &sediment_value)
Definition sediment-deck41-db.cpp:71
static SedimWeightMap initSedimWeightMap()
Definition sediment-deck41-db.cpp:77
SedimDeck41MarsdenDb sediment_marsden_db
Definition sediment-deck41-db.h:157
SedimDeck41MarsdenOneDb sediment_marsden_one_db
Definition sediment-deck41-db.h:162
virtual bool finalizeConnection()
Definition sediment-deck41-db.h:108
virtual Sediment * getValue(const CoordZ &coordz) const
Definition sediment-deck41-db.cpp:363
int getMaxAppereanceFrequencyValue(const FrequencyMap &frequency_map) const
Definition sediment-deck41-db.cpp:164
bool doTestB(const Deck41TypeTests &test) const
Definition sediment-deck41-db.h:292
WossDb for custom made NetCDF marsden square DECK41 Sediment database.
Definition sediment-deck41-marsden-db.h:62
WossDb for custom made NetCDF marsden coordinates DECK41 Sediment database.
Definition sediment-deck41-marsden-one-db.h:62
Surficial sediment geoacoustic parameters definitions.
Definition sediment-definitions.h:63
Abstract class that provides the interface of databases.
Definition woss-db.h:89
Data behaviour class for Sediment database.
Definition woss-db.h:328
::std::vector< CoordZ > CoordZVector
Definition coordinates-definitions.h:64
Provides the interface for woss::SedimDeck41CoordDb class.
Provides the interface for woss::Deck41TypeTests class.
::std::map< char, double > SedimWeightMap
Definition sediment-deck41-db.h:71
::std::map< int, int > FrequencyMap
Definition sediment-deck41-db.h:60
Provides the interface for woss::SedimDeck41MarsdenDb class.
Provides the interface for woss::SedimDeck41MarsdenOneDb class.