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

#include <ossimQuadTreeWarp.h>

Public Member Functions

 ossimQuadTreeWarpVertex (const ossimDpt &position=ossimDpt(0, 0), const ossimDpt &delta=ossimDpt(0, 0))
 
 ~ossimQuadTreeWarpVertex ()
 
void setPosition (const ossimDpt &position)
 
void setDelta (const ossimDpt &delta)
 
const ossimDptgetDelta () const
 
const ossimDptgetPosition () const
 
void addSharedNode (ossimQuadTreeWarpNode *node)
 
void removeNode (ossimQuadTreeWarpNode *node)
 
bool isShared () const
 
bool saveState (ossimKeywordlist &kwl, const char *prefix) const
 
bool loadState (const ossimKeywordlist &kwl, const char *prefix)
 

Public Attributes

std::vector< ossimQuadTreeWarpNode * > theSharedNodeList
 
ossimDpt thePosition
 
ossimDpt theDelta
 
bool theLockedFlag
 

Friends

std::ostream & operator<< (std::ostream &out, const ossimQuadTreeWarpVertex &rhs)
 

Detailed Description

Definition at line 24 of file ossimQuadTreeWarp.h.

Constructor & Destructor Documentation

◆ ossimQuadTreeWarpVertex()

ossimQuadTreeWarpVertex::ossimQuadTreeWarpVertex ( const ossimDpt position = ossimDpt(0,0),
const ossimDpt delta = ossimDpt(0,0) 
)

Definition at line 24 of file ossimQuadTreeWarp.cpp.

26  :thePosition(position),
27  theDelta(delta),
28  theLockedFlag(false)
29 {
30 }

◆ ~ossimQuadTreeWarpVertex()

ossimQuadTreeWarpVertex::~ossimQuadTreeWarpVertex ( )

Definition at line 32 of file ossimQuadTreeWarp.cpp.

References theSharedNodeList.

33 {
34  for(ossim_uint32 i = 0;i< theSharedNodeList.size();++i)
35  {
36  theSharedNodeList[i]->removeVertex(this);
37  }
38 
39 }
unsigned int ossim_uint32
std::vector< ossimQuadTreeWarpNode * > theSharedNodeList

Member Function Documentation

◆ addSharedNode()

void ossimQuadTreeWarpVertex::addSharedNode ( ossimQuadTreeWarpNode node)

Definition at line 61 of file ossimQuadTreeWarp.cpp.

References theSharedNodeList.

Referenced by ossimQuadTreeWarp::create(), ossimQuadTreeWarp::getNewQuads(), ossimQuadTreeWarp::pruneTree(), and ossimQuadTreeWarp::recursiveLoad().

62 {
63  if(node)
64  {
65  theSharedNodeList.push_back(node);
66  }
67 }
std::vector< ossimQuadTreeWarpNode * > theSharedNodeList

◆ getDelta()

const ossimDpt & ossimQuadTreeWarpVertex::getDelta ( ) const

Definition at line 51 of file ossimQuadTreeWarp.cpp.

References theDelta.

Referenced by ossimQuadTreeWarp::getShift().

52 {
53  return theDelta;
54 }

◆ getPosition()

const ossimDpt & ossimQuadTreeWarpVertex::getPosition ( ) const

Definition at line 56 of file ossimQuadTreeWarp.cpp.

References thePosition.

Referenced by ossimQuadTreeWarp::updateLockFlag().

57 {
58  return thePosition;
59 }

◆ isShared()

bool ossimQuadTreeWarpVertex::isShared ( ) const

Definition at line 94 of file ossimQuadTreeWarp.cpp.

References theSharedNodeList.

95 {
96  return (theSharedNodeList.size() > 0);
97 }
std::vector< ossimQuadTreeWarpNode * > theSharedNodeList

◆ loadState()

bool ossimQuadTreeWarpVertex::loadState ( const ossimKeywordlist kwl,
const char *  prefix 
)

Definition at line 126 of file ossimQuadTreeWarp.cpp.

References ossimKeywordlist::find(), theDelta, theLockedFlag, thePosition, ossimString::toBool(), ossimString::toDouble(), ossimDpt::x, x, ossimDpt::y, and y.

Referenced by ossimQuadTreeWarp::loadState().

128 {
129  const char* x = kwl.find(prefix,
130  "x");
131  const char* y = kwl.find(prefix,
132  "y");
133  const char* dx = kwl.find(prefix,
134  "dx");
135  const char* dy = kwl.find(prefix,
136  "dy");
137  const char* lockedFlag = kwl.find(prefix,
138  "lock_flag");
139  if(x&&y&&dx&&dy&&lockedFlag)
140  {
143  theDelta.x = ossimString(dx).toDouble();
144  theDelta.y = ossimString(dy).toDouble();
145  theLockedFlag = ossimString(lockedFlag).toBool();
146 
147  return true;
148  }
149 
150  return false;
151 }
ossim_uint32 x
ossim_uint32 y
const char * find(const char *key) const
double y
Definition: ossimDpt.h:165
bool toBool() const
String to numeric methods.
double toDouble() const
double x
Definition: ossimDpt.h:164

◆ removeNode()

void ossimQuadTreeWarpVertex::removeNode ( ossimQuadTreeWarpNode node)

Definition at line 69 of file ossimQuadTreeWarp.cpp.

References ossimQuadTreeWarpNode::removeVertex(), and theSharedNodeList.

Referenced by ossimQuadTreeWarpNode::removeVertex().

70 {
71  std::vector<ossimQuadTreeWarpNode*>::iterator iter = theSharedNodeList.begin();
72  bool found = false;
73  ossimQuadTreeWarpNode* removedNode = NULL;
74  while((iter != theSharedNodeList.end())&&!found)
75  {
76  if(*iter == node)
77  {
78  removedNode = *iter;
79  iter = theSharedNodeList.erase(iter);
80  found = true;
81  }
82  else
83  {
84  ++iter;
85  }
86  }
87 
88  if(removedNode)
89  {
90  removedNode->removeVertex(this);
91  }
92 }
void removeVertex(ossimQuadTreeWarpVertex *v)
std::vector< ossimQuadTreeWarpNode * > theSharedNodeList

◆ saveState()

bool ossimQuadTreeWarpVertex::saveState ( ossimKeywordlist kwl,
const char *  prefix 
) const

Definition at line 99 of file ossimQuadTreeWarp.cpp.

References ossimKeywordlist::add(), theDelta, theLockedFlag, thePosition, ossimDpt::x, and ossimDpt::y.

101 {
102  kwl.add(prefix,
103  "x",
104  thePosition.x,
105  true);
106  kwl.add(prefix,
107  "y",
108  thePosition.y,
109  true);
110  kwl.add(prefix,
111  "dx",
112  theDelta.x,
113  true);
114  kwl.add(prefix,
115  "dy",
116  theDelta.y,
117  true);
118  kwl.add(prefix,
119  "lock_flag",
120  (int)theLockedFlag,
121  true);
122 
123  return true;
124 }
double y
Definition: ossimDpt.h:165
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
double x
Definition: ossimDpt.h:164

◆ setDelta()

void ossimQuadTreeWarpVertex::setDelta ( const ossimDpt delta)

Definition at line 46 of file ossimQuadTreeWarp.cpp.

References theDelta.

47 {
48  theDelta = delta;
49 }

◆ setPosition()

void ossimQuadTreeWarpVertex::setPosition ( const ossimDpt position)

Definition at line 41 of file ossimQuadTreeWarp.cpp.

References thePosition.

42 {
43  thePosition = position;
44 }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const ossimQuadTreeWarpVertex rhs 
)
friend

Definition at line 1610 of file ossimQuadTreeWarp.cpp.

1611 {
1612  out << "Position: " << rhs.thePosition
1613  << "\nDelta: " << rhs.theDelta
1614  << "\nLocked flag: " << rhs.theLockedFlag
1615  << "\nShared nodes: " << rhs.theSharedNodeList.size() << std::endl;
1616 
1617  return out;
1618 }
std::vector< ossimQuadTreeWarpNode * > theSharedNodeList

Member Data Documentation

◆ theDelta

ossimDpt ossimQuadTreeWarpVertex::theDelta

◆ theLockedFlag

bool ossimQuadTreeWarpVertex::theLockedFlag

◆ thePosition

ossimDpt ossimQuadTreeWarpVertex::thePosition

◆ theSharedNodeList

std::vector<ossimQuadTreeWarpNode*> ossimQuadTreeWarpVertex::theSharedNodeList

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