OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimImageElevationHandler.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // File: ossimImageElevationHandler.h
4 //
5 // License: MIT
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 // Author: David Burken
10 //
11 // Description: See description for class below.
12 //
13 //----------------------------------------------------------------------------
14 // $Id$
15 
16 #ifndef ossimImageElevationHandler_HEADER
17 #define ossimImageElevationHandler_HEADER 1
18 
20 #include <ossim/base/ossimDrect.h>
21 #include <ossim/base/ossimIpt.h>
25 #include <mutex>
26 
33 {
34 public:
35 
39 
44  virtual double getHeightAboveMSL(const ossimGpt&);
45 
51  virtual ossimIpt getSizeOfElevCell() const;
52 
58  virtual double getPostValue(const ossimIpt& gridPt) const;
59 
61  virtual bool isOpen()const;
62 
68  virtual bool open(const ossimFilename& file);
69 
71  virtual void close();
72 
79  virtual bool pointHasCoverage(const ossimGpt&) const;
80 
81  virtual ossimObject* dup () const { return new ossimImageElevationHandler(this->getFilename()); }
82 
83 protected:
90  virtual ~ossimImageElevationHandler();
91 
92 private:
93 
95  {
96  public:
97  TileCacheEntry() : id(99999) {}
98  TileCacheEntry(ossim_uint32 xid, ossimImageData* xdata) : id(xid), data(xdata) {}
99  TileCacheEntry(const TileCacheEntry& copy) : id(copy.id), data(copy.data) {}
100 
102  { id = copy.id; data = copy.data; return *this; }
103 
106  };
107 
110 
113 
115  ossimImageData* getTile(ossim_uint32 x, ossim_uint32 y) const;
116 
120  mutable std::vector<TileCacheEntry> m_tileCache;
121 
126 
127  mutable std::mutex m_mutex;
128 
129  TYPE_DATA
130 };
131 
133 {
134  return m_ih.valid();
135 }
136 
138 {
139  m_geom = 0;
140  m_ih = 0;
141 }
142 
144 {
145  if ( m_geom.valid() )
146  {
147  ossimDpt dpt;
148  m_geom->worldToLocal(gpt, dpt);
149  return m_rect.pointWithin(dpt);
150  }
151  return false;
152 }
153 
154 #endif /* ossimImageElevationHandler_HEADER */
ossim_uint32 x
virtual double getHeightAboveMSL(const ossimGpt &)=0
Height access methods:
ossimRefPtr< ossimImageGeometry > m_geom
bool pointWithin(const ossimDpt &pt, double epsilon=0.0) const
Definition: ossimDrect.h:781
ossimDrect m_rect
Image space rect stored as drect for inlined pointHasCoverage method.
virtual const ossimFilename & getFilename() const
ossim_uint32 y
bool valid() const
Definition: ossimRefPtr.h:75
TileCacheEntry(ossim_uint32 xid, ossimImageData *xdata)
virtual bool pointHasCoverage(const ossimGpt &) const
METHOD: pointIsInsideRect() Method to check if the ground point elevation is defined: ...
virtual bool pointHasCoverage(const ossimGpt &) const
pointHasCoverage(gpt)
Elevation source for a generic image opened via ossimImageHandler.
virtual bool open(const ossimFilename &, bool=false)
#define TYPE_DATA
Definition: ossimRtti.h:339
const TileCacheEntry & operator=(const TileCacheEntry &copy)
virtual double getPostValue(const ossimIpt &gridPt) const =0
METHOD: getPostValue Returns the value at a given grid point as a double.
unsigned int ossim_uint32
virtual void close()
Closes the stream to the file.
virtual ossimObject * dup() const
const ossimSource & operator=(const ossimSource &rhs)
ossimRefPtr< ossimImageHandler > m_ih
Pointers to links in chain.
std::vector< TileCacheEntry > m_tileCache
#define OSSIM_DLL
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
virtual ossimIpt getSizeOfElevCell() const =0
METHOD: getSizeOfElevCell Returns the number of post in the cell.