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

DTED Info class. More...

#include <ossimDtedInfo.h>

Inheritance diagram for ossimDtedInfo:
ossimInfoBase ossimReferenced

Public Member Functions

 ossimDtedInfo ()
 default constructor More...
 
virtual ~ossimDtedInfo ()
 virtual destructor More...
 
virtual bool open (std::shared_ptr< ossim::istream > &str, const std::string &connectionString)
 open method. More...
 
virtual std::ostream & print (std::ostream &out) const
 Print method. More...
 
ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 Gets a property for name. More...
 
void getPropertyNames (std::vector< ossimString > &propertyNames) const
 Adds this class's properties to list. More...
 
- Public Member Functions inherited from ossimInfoBase
 ossimInfoBase ()
 default constructor More...
 
virtual bool open (const ossimFilename &file)
 open method. More...
 
void setProcessOverviewFlag (bool flag)
 Sets the overview flag. More...
 
bool getProcessOverviewFlag () const
 Method to get the overview flag. More...
 
virtual bool getKeywordlist (ossimKeywordlist &kwl) const
 Method to dump info to a keyword list. More...
 
virtual bool getKeywordlist (ossimKeywordlist &kwl, ossim_uint32 entryIndex) const
 Method to dump info to a keyword list. More...
 
- 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
 

Private Attributes

std::shared_ptr< ossim::istreamm_dtedFileStr
 
std::string m_connectionString
 
ossimDtedVol m_vol
 
ossimDtedHdr m_hdr
 
ossimDtedUhl m_uhl
 
ossimDtedDsi m_dsi
 
ossimDtedAcc m_acc
 

Additional Inherited Members

- Protected Member Functions inherited from ossimInfoBase
virtual ~ossimInfoBase ()
 virtual destructor More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Attributes inherited from ossimInfoBase
bool theOverviewFlag
 

Detailed Description

DTED Info class.

Encapsulates the dtedInfo functionality.

Definition at line 36 of file ossimDtedInfo.h.

Constructor & Destructor Documentation

◆ ossimDtedInfo()

ossimDtedInfo::ossimDtedInfo ( )

default constructor

Definition at line 22 of file ossimDtedInfo.cpp.

23 {
24 }

◆ ~ossimDtedInfo()

ossimDtedInfo::~ossimDtedInfo ( )
virtual

virtual destructor

Definition at line 26 of file ossimDtedInfo.cpp.

27 {
28 }

Member Function Documentation

◆ getProperty()

ossimRefPtr< ossimProperty > ossimDtedInfo::getProperty ( const ossimString name) const

Gets a property for name.

Parameters
nameProperty name to get.
Returns
ossimRefPtr<ossimProperty> Note that this can be empty if property for name was not found.

Definition at line 94 of file ossimDtedInfo.cpp.

References ossimContainerProperty::addChildren(), ossimErrorStatusInterface::getErrorStatus(), ossimDtedVol::getProperty(), ossimDtedHdr::getProperty(), ossimDtedUhl::getProperty(), ossimDtedAcc::getProperty(), ossimDtedDsi::getProperty(), ossimDtedVol::getPropertyNames(), ossimDtedHdr::getPropertyNames(), ossimDtedUhl::getPropertyNames(), ossimDtedAcc::getPropertyNames(), ossimDtedDsi::getPropertyNames(), m_acc, m_dsi, m_hdr, m_uhl, m_vol, ossimErrorCodes::OSSIM_OK, ossimProperty::setName(), and ossimRefPtr< T >::valid().

96 {
97  ossimRefPtr<ossimProperty> result = 0;
98 
99  //---
100  // Look through dted records.
101  // Must have uhl, dsi and acc records. vol and hdr
102  // are for magnetic tape only; hence, may or may not be there.
103  //---
104  //ossimDtedVol vol(m_dtedFileStr, 0);
106  {
107  if (name == "dted_vol_record")
108  {
110  box->setName(name);
111 
112  std::vector<ossimString> list;
113  m_vol.getPropertyNames(list);
114 
115  std::vector< ossimRefPtr<ossimProperty> > propList;
116 
117  std::vector<ossimString>::const_iterator i = list.begin();
118  while (i != list.end())
119  {
121  if (prop.valid())
122  {
123  propList.push_back(prop);
124  }
125  ++i;
126  }
127  box->addChildren(propList);
128  result = box;
129  }
130  }
131  if (result.valid() == false)
132  {
133  //ossimDtedHdr hdr(m_dtedFileStr, vol.stopOffset());
135  {
136  if (name == "dted_hdr_record")
137  {
139  box->setName(name);
140 
141  std::vector<ossimString> list;
142  m_hdr.getPropertyNames(list);
143 
144  std::vector< ossimRefPtr<ossimProperty> > propList;
145 
146  std::vector<ossimString>::const_iterator i = list.begin();
147  while (i != list.end())
148  {
150  if (prop.valid())
151  {
152  propList.push_back(prop);
153  }
154  ++i;
155  }
156  box->addChildren(propList);
157  result = box;
158  }
159  }
160  if (result.valid() == false)
161  {
162  // ossimDtedUhl uhl(m_dtedFileStr, hdr.stopOffset());
164  {
165  if (name == "dted_uhl_record")
166  {
168  box->setName(name);
169 
170  std::vector<ossimString> list;
171  m_uhl.getPropertyNames(list);
172 
173  std::vector< ossimRefPtr<ossimProperty> > propList;
174 
175  std::vector<ossimString>::const_iterator i = list.begin();
176  while (i != list.end())
177  {
179  if (prop.valid())
180  {
181  propList.push_back(prop);
182  }
183  ++i;
184  }
185  box->addChildren(propList);
186  result = box;
187  }
188  }
189  if (result.valid() == false)
190  {
191  //ossimDtedDsi dsi(m_dtedFileStr, uhl.stopOffset());
193  {
194  if (name == "dted_dsi_record")
195  {
198  box->setName(name);
199 
200  std::vector<ossimString> list;
201  m_dsi.getPropertyNames(list);
202 
203  std::vector< ossimRefPtr<ossimProperty> > propList;
204 
205  std::vector<ossimString>::const_iterator i = list.begin();
206  while (i != list.end())
207  {
209  m_dsi.getProperty( (*i) );
210  if (prop.valid())
211  {
212  propList.push_back(prop);
213  }
214  ++i;
215  }
216  box->addChildren(propList);
217  result = box;
218  }
219  }
220  if (result.valid() == false)
221  {
222  //ossimDtedAcc acc(m_dtedFileStr, dsi.stopOffset());
224  {
225  if (name == "dted_acc_record")
226  {
229  box->setName(name);
230 
231  std::vector<ossimString> list;
232  m_acc.getPropertyNames(list);
233 
234  std::vector< ossimRefPtr<ossimProperty> > propList;
235 
237  std::vector<ossimString>::const_iterator i =
238  list.begin();
239  while (i != list.end())
240  {
242  m_acc.getProperty( (*i) );
243  if (prop.valid())
244  {
245  propList.push_back(prop);
246  }
247  ++i;
248  }
249  box->addChildren(propList);
250  result = box;
251  }
252  }
253  }
254  }
255  }
256  }
257 
258  return result;
259 }
ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Gets a property for name.
static const ossimErrorCode OSSIM_OK
bool valid() const
Definition: ossimRefPtr.h:75
void getPropertyNames(std::vector< ossimString > &propertyNames) const
Adds this class&#39;s properties to list.
ossimDtedVol m_vol
Definition: ossimDtedInfo.h:83
void getPropertyNames(std::vector< ossimString > &propertyNames) const
Adds this class&#39;s properties to list.
ossimDtedDsi m_dsi
Definition: ossimDtedInfo.h:86
void getPropertyNames(std::vector< ossimString > &propertyNames) const
Adds this class&#39;s properties to list.
ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Gets a property for name.
ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Gets a property for name.
ossimDtedUhl m_uhl
Definition: ossimDtedInfo.h:85
void getPropertyNames(std::vector< ossimString > &propertyNames) const
Adds this class&#39;s properties to list.
ossimDtedAcc m_acc
Definition: ossimDtedInfo.h:87
void getPropertyNames(std::vector< ossimString > &propertyNames) const
Adds this class&#39;s properties to list.
virtual void addChildren(std::vector< ossimRefPtr< ossimProperty > > &propertyList)
virtual ossimErrorCode getErrorStatus() const
ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Gets a property for name.
ossimDtedHdr m_hdr
Definition: ossimDtedInfo.h:84
void setName(const ossimString &name)
ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Gets a property for name.

◆ getPropertyNames()

void ossimDtedInfo::getPropertyNames ( std::vector< ossimString > &  propertyNames) const

Adds this class's properties to list.

Parameters
propertyNameslist to append to.

Definition at line 261 of file ossimDtedInfo.cpp.

263 {
264  propertyNames.push_back(ossimString("dted_vol_record"));
265  propertyNames.push_back(ossimString("dted_hdr_record"));
266  propertyNames.push_back(ossimString("dted_uhl_record"));
267  propertyNames.push_back(ossimString("dted_dsi_record"));
268  propertyNames.push_back(ossimString("dted_acc_record"));
269 }

◆ open()

bool ossimDtedInfo::open ( std::shared_ptr< ossim::istream > &  str,
const std::string &  connectionString 
)
virtual

open method.

Parameters
strstream to test.
connectionStringoriginal string for the stream.
Returns
true on success false on error.

Reimplemented from ossimInfoBase.

Definition at line 30 of file ossimDtedInfo.cpp.

References ossimString::c_str(), ossimFilename::ext(), ossimRegExp::find(), ossimErrorStatusInterface::getErrorStatus(), m_acc, m_connectionString, m_dsi, m_dtedFileStr, m_hdr, m_uhl, m_vol, ossimErrorCodes::OSSIM_OK, ossimDtedVol::parse(), ossimDtedHdr::parse(), ossimDtedAcc::parse(), ossimDtedUhl::parse(), and ossimDtedDsi::parse().

32 {
33  bool result = false;
34  if(!str) return false;
35  // Test for extension, like dt0, dt1...
36  ossimString ext = ossimFilename(connectionString).ext();
37  ossimRegExp regExp("^[d|D][t|T][0-9]");
38  m_dtedFileStr.reset();
39  if ( regExp.find( ext.c_str() ) )
40  {
41  m_vol.parse(*str);
42  m_hdr.parse(*str);
43  m_uhl.parse(*str);
44  m_dsi.parse(*str);
45  m_acc.parse(*str);
46  //---
47  // Check for errors. Must have uhl, dsi and acc records. vol and hdr
48  // are for magnetic tape only; hence, may or may not be there.
49  //---
53  {
54  result = true;
55  m_connectionString = connectionString;
56  m_dtedFileStr = str;
57  }
58  else
59  {
60  m_connectionString.clear();
61  m_dtedFileStr.reset();
62  }
63  }
64 
65  return result;
66 }
static const ossimErrorCode OSSIM_OK
std::shared_ptr< ossim::istream > m_dtedFileStr
Definition: ossimDtedInfo.h:81
ossimDtedVol m_vol
Definition: ossimDtedInfo.h:83
void parse(std::istream &in)
ossimDtedDsi m_dsi
Definition: ossimDtedInfo.h:86
ossimDtedUhl m_uhl
Definition: ossimDtedInfo.h:85
ossimDtedAcc m_acc
Definition: ossimDtedInfo.h:87
std::string m_connectionString
Definition: ossimDtedInfo.h:82
void parse(std::istream &in)
void parse(std::istream &in)
void parse(std::istream &in)
virtual ossimErrorCode getErrorStatus() const
ossimDtedHdr m_hdr
Definition: ossimDtedInfo.h:84
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
void parse(std::istream &in)
ossimString ext() const

◆ print()

std::ostream & ossimDtedInfo::print ( std::ostream &  out) const
virtual

Print method.

Parameters
outStream to print to.
Returns
std::ostream&

Implements ossimInfoBase.

Definition at line 68 of file ossimDtedInfo.cpp.

References ossimErrorStatusInterface::getErrorStatus(), m_acc, m_dsi, m_hdr, m_uhl, m_vol, ossimErrorCodes::OSSIM_OK, ossimDtedHdr::print(), ossimDtedAcc::print(), ossimDtedUhl::print(), ossimDtedVol::print(), and ossimDtedDsi::print().

69 {
70  std::string prefix = "dted.";
72  {
73  m_vol.print(out, prefix);
74  }
76  {
77  m_hdr.print(out, prefix);
78  }
80  {
81  m_uhl.print(out, prefix);
82  }
84  {
85  m_dsi.print(out, prefix);
86  }
88  {
89  m_acc.print(out, prefix);
90  }
91  return out;
92 }
std::ostream & print(std::ostream &out, const std::string &prefix) const
print method that outputs a key/value type format adding prefix to keys.
std::ostream & print(std::ostream &out, const std::string &prefix) const
print method that outputs a key/value type format adding prefix to keys.
static const ossimErrorCode OSSIM_OK
ossimDtedVol m_vol
Definition: ossimDtedInfo.h:83
std::ostream & print(std::ostream &out, const std::string &prefix) const
print method that outputs a key/value type format adding prefix to keys.
ossimDtedDsi m_dsi
Definition: ossimDtedInfo.h:86
ossimDtedUhl m_uhl
Definition: ossimDtedInfo.h:85
ossimDtedAcc m_acc
Definition: ossimDtedInfo.h:87
virtual ossimErrorCode getErrorStatus() const
ossimDtedHdr m_hdr
Definition: ossimDtedInfo.h:84
std::ostream & print(std::ostream &out, const std::string &prefix) const
print method that outputs a key/value type format adding prefix to keys.
std::ostream & print(std::ostream &out, const std::string &prefix) const
print method that outputs a key/value type format adding prefix to keys.

Member Data Documentation

◆ m_acc

ossimDtedAcc ossimDtedInfo::m_acc
private

Definition at line 87 of file ossimDtedInfo.h.

Referenced by getProperty(), open(), and print().

◆ m_connectionString

std::string ossimDtedInfo::m_connectionString
private

Definition at line 82 of file ossimDtedInfo.h.

Referenced by open().

◆ m_dsi

ossimDtedDsi ossimDtedInfo::m_dsi
private

Definition at line 86 of file ossimDtedInfo.h.

Referenced by getProperty(), open(), and print().

◆ m_dtedFileStr

std::shared_ptr<ossim::istream> ossimDtedInfo::m_dtedFileStr
mutableprivate

Definition at line 81 of file ossimDtedInfo.h.

Referenced by open().

◆ m_hdr

ossimDtedHdr ossimDtedInfo::m_hdr
private

Definition at line 84 of file ossimDtedInfo.h.

Referenced by getProperty(), open(), and print().

◆ m_uhl

ossimDtedUhl ossimDtedInfo::m_uhl
private

Definition at line 85 of file ossimDtedInfo.h.

Referenced by getProperty(), open(), and print().

◆ m_vol

ossimDtedVol ossimDtedInfo::m_vol
private

Definition at line 83 of file ossimDtedInfo.h.

Referenced by getProperty(), open(), and print().


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