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

This class represents Scence coordinate. More...

#include <SceneCoord.h>

Public Member Functions

 SceneCoord ()
 Constructor. More...
 
virtual ~SceneCoord ()
 Destructor. More...
 
 SceneCoord (const SceneCoord &rhs)
 Copy constructor. More...
 
SceneCoordoperator= (const SceneCoord &rhs)
 Affectation operator. More...
 
bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save object state to a keyword list. More...
 
bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of the object from a keyword list. More...
 
virtual std::ostream & print (std::ostream &out) const
 
void set_numberOfSceneCoord (const ossim_uint32 &numberOfSceneCoord)
 
void set_centerSceneCoord (const InfoSceneCoord &centerSceneCoord)
 
void set_cornersSceneCoord (const std::vector< InfoSceneCoord > &cornersSceneCoord)
 

Protected Attributes

ossim_uint32 _numberOfSceneCoord
 Number of scene coordinate. More...
 
InfoSceneCoord _centerSceneCoord
 Center scene coordinate. More...
 
std::vector< InfoSceneCoord_tabCornersSceneCoord
 Corners InfoIncidenceAngle. More...
 

Detailed Description

This class represents Scence coordinate.

Definition at line 29 of file SceneCoord.h.

Constructor & Destructor Documentation

◆ SceneCoord() [1/2]

ossimplugins::SceneCoord::SceneCoord ( )

Constructor.

Definition at line 26 of file SceneCoord.cpp.

27  :
31 {
32 }
InfoSceneCoord _centerSceneCoord
Center scene coordinate.
Definition: SceneCoord.h:94
std::vector< InfoSceneCoord > _tabCornersSceneCoord
Corners InfoIncidenceAngle.
Definition: SceneCoord.h:98
ossim_uint32 _numberOfSceneCoord
Number of scene coordinate.
Definition: SceneCoord.h:90

◆ ~SceneCoord()

ossimplugins::SceneCoord::~SceneCoord ( )
virtual

Destructor.

Definition at line 34 of file SceneCoord.cpp.

35 {
36 }

◆ SceneCoord() [2/2]

ossimplugins::SceneCoord::SceneCoord ( const SceneCoord rhs)

Copy constructor.

Definition at line 38 of file SceneCoord.cpp.

39  :
40  _numberOfSceneCoord(rhs._numberOfSceneCoord),
41  _centerSceneCoord(rhs._centerSceneCoord),
42  _tabCornersSceneCoord(rhs._tabCornersSceneCoord)
43 {
44 }
InfoSceneCoord _centerSceneCoord
Center scene coordinate.
Definition: SceneCoord.h:94
std::vector< InfoSceneCoord > _tabCornersSceneCoord
Corners InfoIncidenceAngle.
Definition: SceneCoord.h:98
ossim_uint32 _numberOfSceneCoord
Number of scene coordinate.
Definition: SceneCoord.h:90

Member Function Documentation

◆ loadState()

bool ossimplugins::SceneCoord::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)

Method to the load (recreate) the state of the object from a keyword list.

Return true if ok or false on error.

Returns
true if load OK, false on error

Definition at line 84 of file SceneCoord.cpp.

References _centerSceneCoord, _numberOfSceneCoord, _tabCornersSceneCoord, ossimString::c_str(), ossimKeywordlist::find(), ossimplugins::InfoSceneCoord::loadState(), ossimNotify(), ossimNotifyLevel_WARN, ossimString::toString(), and ossimString::toUInt32().

85 {
86  static const char MODULE[] = "SceneCoord::loadState";
87 
88  bool result = true;
89 
90  ossimString s;
91  const char* lookup = 0;
92 
93  std::string pfx("");
94  if (prefix)
95  {
96  pfx = prefix;
97  }
98  pfx += SCENE_COORD;
99  pfx += ".";
100 
101 
102  lookup = kwl.find(pfx.c_str(), NUMBER_OF_SCENE_CORNER_COORD);
103 
104  if (lookup)
105  {
106  s = lookup;
108  }
109  else
110  {
112  << MODULE << " Keyword not found: " << NUMBER_OF_SCENE_CORNER_COORD << " in "<<pfx.c_str()<<" path.\n";
113  result = false;
114  }
115 
116  std::string s1 = pfx + SCENE_CENTER_COORD;
117 
118  result = _centerSceneCoord.loadState(kwl, s1.c_str());
119 
120  _tabCornersSceneCoord.clear();
121  std::string s2 = pfx + SCENE_CORNER_COORD;
122  for (unsigned int i = 0; i < _numberOfSceneCoord; ++i)
123  {
124  std::string s3 = s2 + "[" + ossimString::toString(i).c_str() + "]";
125  InfoSceneCoord isc;
126  result = isc.loadState(kwl, s3.c_str());
127  _tabCornersSceneCoord.push_back(isc);
128  }
130  {
132  << MODULE << " Keyword " << NUMBER_OF_SCENE_CORNER_COORD << " is different with the number of _tabCornersScenceCoord nodes \n";
133  }
134 
135  return result;
136 }
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
ossim_uint32 toUInt32() const
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of the object from a keyword list.
InfoSceneCoord _centerSceneCoord
Center scene coordinate.
Definition: SceneCoord.h:94
std::vector< InfoSceneCoord > _tabCornersSceneCoord
Corners InfoIncidenceAngle.
Definition: SceneCoord.h:98
ossim_uint32 _numberOfSceneCoord
Number of scene coordinate.
Definition: SceneCoord.h:90
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
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ operator=()

SceneCoord & ossimplugins::SceneCoord::operator= ( const SceneCoord rhs)

Affectation operator.

Definition at line 46 of file SceneCoord.cpp.

References _centerSceneCoord, _numberOfSceneCoord, and _tabCornersSceneCoord.

47 {
48  if ( this != &rhs )
49  {
50  _numberOfSceneCoord = rhs._numberOfSceneCoord;
51  _centerSceneCoord = rhs._centerSceneCoord;
52  _tabCornersSceneCoord = rhs._tabCornersSceneCoord;
53  }
54 
55  return *this;
56 }
InfoSceneCoord _centerSceneCoord
Center scene coordinate.
Definition: SceneCoord.h:94
std::vector< InfoSceneCoord > _tabCornersSceneCoord
Corners InfoIncidenceAngle.
Definition: SceneCoord.h:98
ossim_uint32 _numberOfSceneCoord
Number of scene coordinate.
Definition: SceneCoord.h:90

◆ print()

std::ostream & ossimplugins::SceneCoord::print ( std::ostream &  out) const
virtual

METHOD: print() Fulfills base-class pure virtual. Dumps contents of object to ostream.

Definition at line 139 of file SceneCoord.cpp.

References _centerSceneCoord, _numberOfSceneCoord, _tabCornersSceneCoord, ossimKeywordlist::add(), ossimString::c_str(), ossimplugins::InfoSceneCoord::saveState(), and ossimString::toString().

140 {
141  out << setprecision(15) << setiosflags(ios::fixed)
142  << "\n SceneCoord class data members:\n";
143 
144  const char* prefix = 0;
145  ossimKeywordlist kwl;
146  ossimString pfx;
147  pfx += SCENE_COORD;
148  ossimString s = pfx + "." + NUMBER_OF_SCENE_CORNER_COORD;
149  kwl.add(prefix, s.c_str(), _numberOfSceneCoord);
150 
151  ossimString s1 = pfx + "." + SCENE_CENTER_COORD;
152  _centerSceneCoord.saveState(kwl, s1.c_str());
153 
154  ossimString s2 =pfx + "." + SCENE_CORNER_COORD;
155  for (unsigned int i = 0; i < _tabCornersSceneCoord.size(); ++i)
156  {
157  ossimString s3 = s2 + "[" + ossimString::toString(i) + "]";
158  _tabCornersSceneCoord[i].saveState(kwl, s3.c_str());
159  }
160  out << kwl;
161 
162  return out;
163 }
Represents serializable keyword/value map.
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
InfoSceneCoord _centerSceneCoord
Center scene coordinate.
Definition: SceneCoord.h:94
std::vector< InfoSceneCoord > _tabCornersSceneCoord
Corners InfoIncidenceAngle.
Definition: SceneCoord.h:98
ossim_uint32 _numberOfSceneCoord
Number of scene coordinate.
Definition: SceneCoord.h:90
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
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.

◆ saveState()

bool ossimplugins::SceneCoord::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const

Method to save object state to a keyword list.

Parameters
kwlKeyword list to save to.
prefixadded to keys when saved.
Returns
true on success, false on error.

Definition at line 58 of file SceneCoord.cpp.

References _centerSceneCoord, _numberOfSceneCoord, _tabCornersSceneCoord, ossimKeywordlist::add(), ossimString::c_str(), ossimplugins::InfoSceneCoord::saveState(), and ossimString::toString().

59 {
60  std::string pfx("");
61  std::string pfx2("");
62  if (prefix)
63  {
64  pfx = prefix;
65  }
66  pfx += SCENE_COORD;
67  pfx2 = pfx;
68  pfx2 += ".";
69 
70  kwl.add(pfx2.c_str(), NUMBER_OF_SCENE_CORNER_COORD, _numberOfSceneCoord);
71 
72  std::string s = pfx + "." + SCENE_CENTER_COORD;
73  _centerSceneCoord.saveState(kwl, s.c_str());
74 
75  std::string s2 =pfx + "." + SCENE_CORNER_COORD;
76  for (unsigned int i = 0; i < _tabCornersSceneCoord.size(); ++i)
77  {
78  std::string s3 = s2 + "[" + ossimString::toString(i).c_str() + "]";
79  _tabCornersSceneCoord[i].saveState(kwl, s3.c_str());
80  }
81  return true;
82 }
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
InfoSceneCoord _centerSceneCoord
Center scene coordinate.
Definition: SceneCoord.h:94
std::vector< InfoSceneCoord > _tabCornersSceneCoord
Corners InfoIncidenceAngle.
Definition: SceneCoord.h:98
ossim_uint32 _numberOfSceneCoord
Number of scene coordinate.
Definition: SceneCoord.h:90
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
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.

◆ set_centerSceneCoord()

void ossimplugins::SceneCoord::set_centerSceneCoord ( const InfoSceneCoord centerSceneCoord)
inline

Definition at line 76 of file SceneCoord.h.

Referenced by ossimplugins::ossimTerraSarProductDoc::initSceneCoord().

77  {
78  _centerSceneCoord = centerSceneCoord;
79  }
InfoSceneCoord _centerSceneCoord
Center scene coordinate.
Definition: SceneCoord.h:94

◆ set_cornersSceneCoord()

void ossimplugins::SceneCoord::set_cornersSceneCoord ( const std::vector< InfoSceneCoord > &  cornersSceneCoord)
inline

Definition at line 80 of file SceneCoord.h.

Referenced by ossimplugins::ossimTerraSarProductDoc::initSceneCoord().

81  {
82  _tabCornersSceneCoord = cornersSceneCoord;
83  }
std::vector< InfoSceneCoord > _tabCornersSceneCoord
Corners InfoIncidenceAngle.
Definition: SceneCoord.h:98

◆ set_numberOfSceneCoord()

void ossimplugins::SceneCoord::set_numberOfSceneCoord ( const ossim_uint32 numberOfSceneCoord)
inline

Definition at line 72 of file SceneCoord.h.

Referenced by ossimplugins::ossimTerraSarProductDoc::initSceneCoord().

73  {
74  _numberOfSceneCoord = numberOfSceneCoord;
75  }
ossim_uint32 _numberOfSceneCoord
Number of scene coordinate.
Definition: SceneCoord.h:90

Member Data Documentation

◆ _centerSceneCoord

InfoSceneCoord ossimplugins::SceneCoord::_centerSceneCoord
protected

Center scene coordinate.

Definition at line 94 of file SceneCoord.h.

Referenced by loadState(), operator=(), print(), and saveState().

◆ _numberOfSceneCoord

ossim_uint32 ossimplugins::SceneCoord::_numberOfSceneCoord
protected

Number of scene coordinate.

Definition at line 90 of file SceneCoord.h.

Referenced by loadState(), operator=(), print(), and saveState().

◆ _tabCornersSceneCoord

std::vector<InfoSceneCoord> ossimplugins::SceneCoord::_tabCornersSceneCoord
protected

Corners InfoIncidenceAngle.

Definition at line 98 of file SceneCoord.h.

Referenced by loadState(), operator=(), print(), and saveState().


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