OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimGeneralRasterElevFactory Class Reference

#include <ossimGeneralRasterElevFactory.h>

Inheritance diagram for ossimGeneralRasterElevFactory:
ossimElevSourceFactory ossimObject ossimReferenced

Public Types

typedef std::vector< ossimGeneralRasterElevHandler::GeneralRasterInfoBoundingRectListType
 

Public Member Functions

 ossimGeneralRasterElevFactory ()
 Constructor that takes a file name. More...
 
 ossimGeneralRasterElevFactory (const ossimFilename &dir)
 Constructor that takes a directory name. More...
 
virtual ~ossimGeneralRasterElevFactory ()
 destructor More...
 
void setDirectory (const ossimFilename &directory)
 
virtual ossimElevSourcegetNewElevSource (const ossimGpt &gpt) const
 Open the appropriate handler that covers given a ground point. More...
 
virtual void createIndex ()
 To satisfy pure virtual. More...
 
- Public Member Functions inherited from ossimElevSourceFactory
 ossimElevSourceFactory ()
 default constructor More...
 
virtual ~ossimElevSourceFactory ()
 virtual destructor More...
 
virtual ossimFilename getDirectory () const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Protected Member Functions

void addInfo (const ossimGeneralRasterElevHandler::GeneralRasterInfo &info)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

std::vector< ossimGeneralRasterElevHandler::GeneralRasterInfotheGeneralRasterInfoList
 
ossimDrect theBoundingRect
 
ossim_int32 theCurrentIdx
 
bool theHandlerReturnedFlag
 
- Protected Attributes inherited from ossimElevSourceFactory
ossimFilename theDirectory
 

Detailed Description

Definition at line 26 of file ossimGeneralRasterElevFactory.h.

Member Typedef Documentation

◆ BoundingRectListType

Definition at line 29 of file ossimGeneralRasterElevFactory.h.

Constructor & Destructor Documentation

◆ ossimGeneralRasterElevFactory() [1/2]

ossimGeneralRasterElevFactory::ossimGeneralRasterElevFactory ( )

Constructor that takes a file name.

default constructor

Definition at line 7 of file ossimGeneralRasterElevFactory.cpp.

◆ ossimGeneralRasterElevFactory() [2/2]

ossimGeneralRasterElevFactory::ossimGeneralRasterElevFactory ( const ossimFilename dir)

Constructor that takes a directory name.

Definition at line 12 of file ossimGeneralRasterElevFactory.cpp.

References setDirectory().

14 {
15  setDirectory(dir);
16 }
void setDirectory(const ossimFilename &directory)

◆ ~ossimGeneralRasterElevFactory()

ossimGeneralRasterElevFactory::~ossimGeneralRasterElevFactory ( )
virtual

destructor

Definition at line 18 of file ossimGeneralRasterElevFactory.cpp.

19 {
20 }

Member Function Documentation

◆ addInfo()

void ossimGeneralRasterElevFactory::addInfo ( const ossimGeneralRasterElevHandler::GeneralRasterInfo info)
protected

Definition at line 77 of file ossimGeneralRasterElevFactory.cpp.

References theGeneralRasterInfoList.

Referenced by setDirectory().

78 {
79  theGeneralRasterInfoList.push_back(info);
80 }
std::vector< ossimGeneralRasterElevHandler::GeneralRasterInfo > theGeneralRasterInfoList

◆ createIndex()

void ossimGeneralRasterElevFactory::createIndex ( )
virtual

To satisfy pure virtual.

Definition at line 82 of file ossimGeneralRasterElevFactory.cpp.

83 {
84 }

◆ getNewElevSource()

ossimElevSource * ossimGeneralRasterElevFactory::getNewElevSource ( const ossimGpt gpt) const
virtual

Open the appropriate handler that covers given a ground point.

Parameters
gptGround point that an elevation source is need for.
Returns
Returns a pointer to an ossimElevSource if an elevation file is found that can cover the ground point. Returns NULL if no cell is found for the point.

Implements ossimElevSourceFactory.

Definition at line 61 of file ossimGeneralRasterElevFactory.cpp.

References theGeneralRasterInfoList.

62 {
63  ossimDpt pt(gpt);
64  std::vector<ossimGeneralRasterElevHandler::GeneralRasterInfo>::const_iterator i = theGeneralRasterInfoList.begin();
65  while (i != theGeneralRasterInfoList.end())
66  {
67  if ((*i).theWgs84GroundRect.pointWithin(pt))
68  {
69  return new ossimGeneralRasterElevHandler((*i));
70 
71  }
72  ++i;
73  }
74  return 0;
75 }
std::vector< ossimGeneralRasterElevHandler::GeneralRasterInfo > theGeneralRasterInfoList

◆ setDirectory()

void ossimGeneralRasterElevFactory::setDirectory ( const ossimFilename directory)
virtual
Parameters
directoryThe directory to return data from.

Reimplemented from ossimElevSourceFactory.

Definition at line 22 of file ossimGeneralRasterElevFactory.cpp.

References addInfo(), ossimString::downcase(), ossimFilename::exists(), ossimFilename::ext(), ossimGeneralRasterElevHandler::generalRasterInfo(), ossimDirectory::getFirst(), ossimDirectory::getNext(), ossimFilename::isDir(), ossimGeneralRasterElevHandler::open(), ossimElevSourceFactory::setDirectory(), ossimElevSourceFactory::theDirectory, and theGeneralRasterInfoList.

Referenced by ossimGeneralRasterElevFactory().

23 {
27 
28  if(theDirectory.exists())
29  {
30  if(theDirectory.isDir())
31  {
33 
34  ossimFilename file;
35  ossim_uint32 maxCount = 10; // search at least the first 10 files to see if there are any here
36  ossim_uint32 count = 0;
37  bool foundOne = false;
38  if(dir.getFirst(file))
39  {
40  do
41  {
42  ++count;
43  ossimString ext = file.ext();
44  ext = ext.downcase();
45  if(ext == "ras")
46  {
47  if(handler->open(file))
48  {
49  foundOne = true;
50  addInfo(handler->generalRasterInfo());
51  }
52  }
53  } while(dir.getNext(file) &&
54  (foundOne ||
55  (!foundOne && (count < maxCount))));
56  }
57  }
58  }
59 }
bool open(const ossimFilename &file, bool memoryMapFlag=false)
Opens a stream to the srtm cell.
bool isDir() const
std::vector< ossimGeneralRasterElevHandler::GeneralRasterInfo > theGeneralRasterInfoList
bool exists() const
unsigned int ossim_uint32
virtual void setDirectory(const ossimFilename &directory)
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
const ossimGeneralRasterElevHandler::GeneralRasterInfo & generalRasterInfo() const
ossimString ext() const
void addInfo(const ossimGeneralRasterElevHandler::GeneralRasterInfo &info)

Member Data Documentation

◆ theBoundingRect

ossimDrect ossimGeneralRasterElevFactory::theBoundingRect
protected

Definition at line 66 of file ossimGeneralRasterElevFactory.h.

◆ theCurrentIdx

ossim_int32 ossimGeneralRasterElevFactory::theCurrentIdx
mutableprotected

Definition at line 68 of file ossimGeneralRasterElevFactory.h.

◆ theGeneralRasterInfoList

std::vector<ossimGeneralRasterElevHandler::GeneralRasterInfo> ossimGeneralRasterElevFactory::theGeneralRasterInfoList
protected

Definition at line 65 of file ossimGeneralRasterElevFactory.h.

Referenced by addInfo(), getNewElevSource(), and setDirectory().

◆ theHandlerReturnedFlag

bool ossimGeneralRasterElevFactory::theHandlerReturnedFlag
mutableprotected

Definition at line 69 of file ossimGeneralRasterElevFactory.h.


The documentation for this class was generated from the following files: