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

DtedHeight is a class for storing DTED information. More...

#include <ossimDtedHandler.h>

Public Member Functions

 DtedHeight ()
 DtedHeight methods. More...
 
virtual ~DtedHeight ()
 
double calcHeight ()
 
void debug ()
 

Public Attributes

DtedPost m_posts [TOTAL_POSTS]
 

Detailed Description

DtedHeight is a class for storing DTED information.

Definition at line 197 of file ossimDtedHandler.h.

Constructor & Destructor Documentation

◆ DtedHeight()

ossimDtedHandler::DtedHeight::DtedHeight ( )

DtedHeight methods.

Definition at line 558 of file ossimDtedHandler.cpp.

558 {}

◆ ~DtedHeight()

ossimDtedHandler::DtedHeight::~DtedHeight ( )
virtual

Definition at line 560 of file ossimDtedHandler.cpp.

560 {}

Member Function Documentation

◆ calcHeight()

double ossimDtedHandler::DtedHeight::calcHeight ( )

Definition at line 562 of file ossimDtedHandler.cpp.

References ossim::nan(), ossimDtedHandler::NULL_POST, and ossimDtedHandler::TOTAL_POSTS.

Referenced by ossimDtedHandler::getHeightAboveMSL().

563 {
564  double sum_weights = 0;
565  double sum_posts = 0;
566  for ( int i = 0; i < TOTAL_POSTS; ++i )
567  {
568  if ( m_posts[i].m_height == NULL_POST || !m_posts[i].m_status )
569  {
570  m_posts[i].m_weight = 0.0;
571  }
572  }
573 
574  for ( int i = 0; i < TOTAL_POSTS; ++i )
575  {
576  sum_weights += m_posts[i].m_weight;
577  sum_posts += m_posts[i].m_height * m_posts[i].m_weight;
578  }
579  if ( sum_weights )
580  {
581  return sum_posts / sum_weights;
582  }
583  return ossim::nan();
584 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
static const int TOTAL_POSTS
DtedPost m_posts[TOTAL_POSTS]

◆ debug()

void ossimDtedHandler::DtedHeight::debug ( )

Definition at line 586 of file ossimDtedHandler.cpp.

Referenced by ossimDtedHandler::getHeightAboveMSL().

587 {
588  cout << "\np00: " << m_posts[0].m_height
589  << "\np01: " << m_posts[1].m_height
590  << "\np10: " << m_posts[2].m_height
591  << "\np11: " << m_posts[3].m_height
592  << "\nw00: " << m_posts[0].m_weight
593  << "\nw01: " << m_posts[1].m_weight
594  << "\nw10: " << m_posts[2].m_weight
595  << "\nw11: " << m_posts[3].m_weight
596  << "\ns00: " << m_posts[0].m_status
597  << "\ns01: " << m_posts[1].m_status
598  << "\ns10: " << m_posts[2].m_status
599  << "\ns11: " << m_posts[3].m_status
600  << std::endl;
601 }
DtedPost m_posts[TOTAL_POSTS]

Member Data Documentation

◆ m_posts

DtedPost ossimDtedHandler::DtedHeight::m_posts[TOTAL_POSTS]

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