ocean_model.h

00001 
00005 #pragma once
00006 
00007 #include <usml/ocean/boundary_model.h>
00008 #include <usml/ocean/profile_model.h>
00009 #include <usml/ocean/volume_model.h>
00010 #include <vector>
00011 #include <iterator>
00012 
00013 namespace usml {
00014 namespace ocean {
00015 
00018 
00022 class USML_DECLSPEC ocean_model {
00023 
00024   public:
00025 
00027         inline boundary_model& surface() {
00028                 return *_surface ;
00029         }
00030 
00032         inline boundary_model& bottom() {
00033                 return *_bottom ;
00034         }
00035 
00037         inline volume_model& volume( std::vector<volume_model*>::size_type n ) {
00038                 return *(_volume.at(n)) ;
00039         }
00040 
00042         inline size_t num_volume() {
00043                 return _volume.size() ;
00044         }
00045 
00047         inline void add_volume( volume_model* layer ) {
00048                 _volume.push_back( layer ) ;
00049         }
00050 
00052         inline profile_model& profile() {
00053                 return *_profile ;
00054         }
00055 
00061         ocean_model( boundary_model* surface,
00062                                  boundary_model* bottom,
00063                                  profile_model* profile,
00064                                  std::vector<volume_model*>* volume = NULL ) :
00065         _surface(surface), _bottom(bottom), _profile(profile)
00066         {
00067                 if ( volume ) {
00068                         _volume = *volume ;
00069                 }
00070         }
00071 
00075         virtual ~ocean_model() {
00076                 delete _surface ;
00077                 delete _bottom ;
00078                 for ( std::vector<volume_model*>::iterator iter =_volume.begin();
00079                       iter != _volume.end(); ++iter)
00080                 {
00081                         delete *iter ;
00082                 }
00083                 delete _profile ;
00084         }
00085 
00086   private:
00087 
00089         boundary_model* _surface ;
00090 
00092         boundary_model* _bottom ;
00093 
00095         std::vector<volume_model*> _volume ;
00096 
00098         profile_model* _profile ;
00099 };
00100 
00102 }  // end of namespace ocean
00103 }  // end of namespace usml

Generated on 4 May 2015 for USML by  doxygen 1.6.1