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

#include <ossimWms.h>

Inheritance diagram for ossimWmsLayer:
ossimReferenced

Public Member Functions

 ossimWmsLayer ()
 
virtual bool read (ossimRefPtr< ossimXmlNode > node)
 
void clearFields ()
 
const ossimWmsLayergetParent () const
 
ossimWmsLayergetParent ()
 
void setParent (ossimWmsLayer *parent)
 
const ossimRefPtr< ossimWmsBoundingBoxfindBoundingBox () const
 
void getNamedLayers (ossimWmsLayerListType &namedLayers)
 
const ossimStringgetName () const
 
const ossimStringgetTitle () const
 
const ossimStringgetAbstract () const
 
const ossimStringgetSrs () const
 
const ossimRefPtr< ossimWmsTimeExtentgetTimeExtent ()
 
const ossimStringgetDimensionUnits () const
 
const ossimStringgetDimensionName () const
 
const ossimRefPtr< ossimWmsBoundingBoxgetBoundingBox () const
 
const ossimRefPtr< ossimWmsScaleHintgetScaleHint () const
 
const ossimWmsStyleListTypegetStyles () const
 
ossimWmsStyleListTypegetStyles ()
 
const ossimWmsLayerListTypegetLayers () const
 
ossimWmsLayerListTypegetLayers ()
 
ossim_uint32 getNumberOfChildren () const
 
ossim_uint32 getNumberOfStyles () const
 
- 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 Attributes

ossimWmsLayertheParent
 
ossimString theName
 
ossimString theTitle
 
ossimString theAbstract
 
ossimString theSrs
 
ossimRefPtr< ossimWmsTimeExtenttheTimeExtent
 
ossimString theDimensionUnits
 
ossimString theDimensionName
 
ossimRefPtr< ossimWmsBoundingBoxtheBoundingBox
 
ossimRefPtr< ossimWmsScaleHinttheScaleHint
 
ossimWmsStyleListType theStyles
 
ossimWmsLayerListType theLayers
 

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description

Definition at line 320 of file ossimWms.h.

Constructor & Destructor Documentation

◆ ossimWmsLayer()

ossimWmsLayer::ossimWmsLayer ( )
inline

Definition at line 324 of file ossimWms.h.

Referenced by read().

325  :theParent(0)
326  {
327  clearFields();
328  }
void clearFields()
Definition: ossimWms.h:331
ossimWmsLayer * theParent
Definition: ossimWms.h:439

Member Function Documentation

◆ clearFields()

void ossimWmsLayer::clearFields ( )
inline

Definition at line 331 of file ossimWms.h.

Referenced by read().

332  {
333  theName = "";
334  theTitle = "";
335  theAbstract = "";
336  theSrs = "";
337  theTimeExtent = 0;
338  theDimensionUnits = "";
339  theDimensionName = "";
340  theBoundingBox = 0;
341  theScaleHint = 0;
342  theStyles.clear();
343  theLayers.clear();
344  }
ossimRefPtr< ossimWmsScaleHint > theScaleHint
Definition: ossimWms.h:448
ossimString theName
Definition: ossimWms.h:440
ossimString theDimensionName
Definition: ossimWms.h:446
ossimString theAbstract
Definition: ossimWms.h:442
ossimString theSrs
Definition: ossimWms.h:443
ossimRefPtr< ossimWmsBoundingBox > theBoundingBox
Definition: ossimWms.h:447
ossimRefPtr< ossimWmsTimeExtent > theTimeExtent
Definition: ossimWms.h:444
ossimWmsStyleListType theStyles
Definition: ossimWms.h:449
ossimWmsLayerListType theLayers
Definition: ossimWms.h:450
ossimString theTitle
Definition: ossimWms.h:441
ossimString theDimensionUnits
Definition: ossimWms.h:445

◆ findBoundingBox()

const ossimRefPtr<ossimWmsBoundingBox> ossimWmsLayer::findBoundingBox ( ) const
inline

Definition at line 359 of file ossimWms.h.

References theBoundingBox, theParent, and ossimRefPtr< T >::valid().

360  {
361  const ossimWmsLayer* currentLayer = this;
362 
363  while(currentLayer)
364  {
365  if(currentLayer->theBoundingBox.valid())
366  {
367  return currentLayer->theBoundingBox;
368  }
369  currentLayer = currentLayer->theParent;
370  }
371 
372  return 0;
373  }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimWmsBoundingBox > theBoundingBox
Definition: ossimWms.h:447
ossimWmsLayer * theParent
Definition: ossimWms.h:439

◆ getAbstract()

const ossimString& ossimWmsLayer::getAbstract ( ) const
inline

Definition at line 385 of file ossimWms.h.

386  {
387  return theAbstract;
388  }
ossimString theAbstract
Definition: ossimWms.h:442

◆ getBoundingBox()

const ossimRefPtr<ossimWmsBoundingBox> ossimWmsLayer::getBoundingBox ( ) const
inline

Definition at line 405 of file ossimWms.h.

406  {
407  return theBoundingBox;
408  }
ossimRefPtr< ossimWmsBoundingBox > theBoundingBox
Definition: ossimWms.h:447

◆ getDimensionName()

const ossimString& ossimWmsLayer::getDimensionName ( ) const
inline

Definition at line 401 of file ossimWms.h.

402  {
403  return theDimensionName;
404  }
ossimString theDimensionName
Definition: ossimWms.h:446

◆ getDimensionUnits()

const ossimString& ossimWmsLayer::getDimensionUnits ( ) const
inline

Definition at line 397 of file ossimWms.h.

398  {
399  return theDimensionUnits;
400  }
ossimString theDimensionUnits
Definition: ossimWms.h:445

◆ getLayers() [1/2]

const ossimWmsLayerListType& ossimWmsLayer::getLayers ( ) const
inline

Definition at line 421 of file ossimWms.h.

Referenced by getNamedLayers().

422  {
423  return theLayers;
424  }
ossimWmsLayerListType theLayers
Definition: ossimWms.h:450

◆ getLayers() [2/2]

ossimWmsLayerListType& ossimWmsLayer::getLayers ( )
inline

Definition at line 425 of file ossimWms.h.

426  {
427  return theLayers;
428  }
ossimWmsLayerListType theLayers
Definition: ossimWms.h:450

◆ getName()

const ossimString& ossimWmsLayer::getName ( ) const
inline

Definition at line 377 of file ossimWms.h.

Referenced by getNamedLayers().

378  {
379  return theName;
380  }
ossimString theName
Definition: ossimWms.h:440

◆ getNamedLayers()

void ossimWmsLayer::getNamedLayers ( ossimWmsLayerListType namedLayers)

Definition at line 304 of file ossimWms.cpp.

References ossimString::empty(), getLayers(), getName(), getNumberOfChildren(), and theLayers.

305 {
306  if(theLayers.empty()) return;
307 
308  std::deque<ossimRefPtr<ossimWmsLayer> > layers(theLayers.begin(), theLayers.end());
309 
310  while(!layers.empty())
311  {
312  ossimRefPtr<ossimWmsLayer> layer = layers.front();
313  layers.pop_front();
314  if(!layer->getName().empty())
315  {
316  namedLayers.push_back(layer);
317  }
318  if(layer->getNumberOfChildren()>0)
319  {
320  ossimWmsLayerListType& layerList = layer->getLayers();
321  layers.insert(layers.end(), layerList.begin(), layerList.end());
322  }
323  }
324 }
std::vector< ossimRefPtr< ossimWmsLayer > > ossimWmsLayerListType
Definition: ossimWms.h:17
const ossimString & getName() const
Definition: ossimWms.h:377
ossim_uint32 getNumberOfChildren() const
Definition: ossimWms.h:430
ossimWmsLayerListType theLayers
Definition: ossimWms.h:450
bool empty() const
Definition: ossimString.h:411
const ossimWmsLayerListType & getLayers() const
Definition: ossimWms.h:421

◆ getNumberOfChildren()

ossim_uint32 ossimWmsLayer::getNumberOfChildren ( ) const
inline

Definition at line 430 of file ossimWms.h.

Referenced by getNamedLayers().

431  {
432  return (ossim_uint32)theLayers.size();
433  }
unsigned int ossim_uint32
ossimWmsLayerListType theLayers
Definition: ossimWms.h:450

◆ getNumberOfStyles()

ossim_uint32 ossimWmsLayer::getNumberOfStyles ( ) const
inline

Definition at line 434 of file ossimWms.h.

435  {
436  return (ossim_uint32)theStyles.size();
437  }
unsigned int ossim_uint32
ossimWmsStyleListType theStyles
Definition: ossimWms.h:449

◆ getParent() [1/2]

const ossimWmsLayer* ossimWmsLayer::getParent ( ) const
inline

Definition at line 345 of file ossimWms.h.

346  {
347  return theParent;
348  }
ossimWmsLayer * theParent
Definition: ossimWms.h:439

◆ getParent() [2/2]

ossimWmsLayer* ossimWmsLayer::getParent ( )
inline

Definition at line 350 of file ossimWms.h.

351  {
352  return theParent;
353  }
ossimWmsLayer * theParent
Definition: ossimWms.h:439

◆ getScaleHint()

const ossimRefPtr<ossimWmsScaleHint> ossimWmsLayer::getScaleHint ( ) const
inline

Definition at line 409 of file ossimWms.h.

410  {
411  return theScaleHint;
412  }
ossimRefPtr< ossimWmsScaleHint > theScaleHint
Definition: ossimWms.h:448

◆ getSrs()

const ossimString& ossimWmsLayer::getSrs ( ) const
inline

Definition at line 389 of file ossimWms.h.

390  {
391  return theSrs;
392  }
ossimString theSrs
Definition: ossimWms.h:443

◆ getStyles() [1/2]

const ossimWmsStyleListType& ossimWmsLayer::getStyles ( ) const
inline

Definition at line 413 of file ossimWms.h.

414  {
415  return theStyles;
416  }
ossimWmsStyleListType theStyles
Definition: ossimWms.h:449

◆ getStyles() [2/2]

ossimWmsStyleListType& ossimWmsLayer::getStyles ( )
inline

Definition at line 417 of file ossimWms.h.

418  {
419  return theStyles;
420  }
ossimWmsStyleListType theStyles
Definition: ossimWms.h:449

◆ getTimeExtent()

const ossimRefPtr<ossimWmsTimeExtent> ossimWmsLayer::getTimeExtent ( )
inline

Definition at line 393 of file ossimWms.h.

394  {
395  return theTimeExtent;
396  }
ossimRefPtr< ossimWmsTimeExtent > theTimeExtent
Definition: ossimWms.h:444

◆ getTitle()

const ossimString& ossimWmsLayer::getTitle ( ) const
inline

Definition at line 381 of file ossimWms.h.

382  {
383  return theTitle;
384  }
ossimString theTitle
Definition: ossimWms.h:441

◆ read()

bool ossimWmsLayer::read ( ossimRefPtr< ossimXmlNode node)
virtual

Definition at line 223 of file ossimWms.cpp.

References clearFields(), ossimRefPtr< T >::get(), ossimXmlNode::getChildNodes(), ossimWmsLayer(), ossimWmsTimeExtent::read(), ossimWmsStyle::read(), ossimWmsScaleHint::read(), ossimWmsBoundingBox::read(), read(), setParent(), theAbstract, theBoundingBox, theDimensionName, theDimensionUnits, theLayers, theName, theScaleHint, theSrs, theStyles, theTimeExtent, and theTitle.

Referenced by read(), and ossimWmsCapability::read().

224 {
225  clearFields();
226  const vector<ossimRefPtr<ossimXmlNode> >& childNodes = node->getChildNodes();
227  ossim_uint32 idx = 0;
228  for(idx = 0; idx < childNodes.size();++idx)
229  {
230  if(childNodes[idx]->getTag() == "Name")
231  {
232  theName = childNodes[idx]->getText();
233  }
234  else if(childNodes[idx]->getTag() == "Title")
235  {
236  theTitle = childNodes[idx]->getText();
237  }
238  else if(childNodes[idx]->getTag() == "Abstract")
239  {
240  theAbstract = childNodes[idx]->getText();
241  }
242  else if(childNodes[idx]->getTag() == "Extent")
243  {
244  ossimString name;
245  if(childNodes[idx]->getAttributeValue(name, "name"))
246  {
247  if(name == "time")
248  {
250  if(!theTimeExtent->read(childNodes[idx]))
251  {
252  theTimeExtent = 0;
253  }
254  }
255  }
256  }
257  else if(childNodes[idx]->getTag() == "SRS")
258  {
259  theSrs = childNodes[idx]->getText();
260  }
261  else if(childNodes[idx]->getTag() == "Dimension")
262  {
263  childNodes[idx]->getAttributeValue(theDimensionUnits, "units");
264  childNodes[idx]->getAttributeValue(theDimensionName, "name");
265  }
266  else if(childNodes[idx]->getTag() == "Style")
267  {
269  style->read(childNodes[idx]);
270  theStyles.push_back(style);
271  }
272  else if(childNodes[idx]->getTag() == "ScaleHint")
273  {
275  if(!theScaleHint->read(childNodes[idx]))
276  {
277  theScaleHint = 0;
278  }
279  }
280  else if(childNodes[idx]->getTag() == "LatLonBoundingBox"||
281  childNodes[idx]->getTag() == "BoundingBox")
282  {
284  if(!theBoundingBox->read(childNodes[idx]))
285  {
286  theBoundingBox = 0;
287  }
288  }
289  else if(childNodes[idx]->getTag() == "Layer")
290  {
292  if(!layer->read(childNodes[idx]))
293  {
294  return false;
295  }
296  layer->setParent(this);
297  theLayers.push_back(layer.get());
298  }
299  }
300 
301  return true;
302 }
virtual bool read(ossimRefPtr< ossimXmlNode > node)
Definition: ossimWms.cpp:223
const ossimXmlNode::ChildListType & getChildNodes() const
virtual bool read(ossimRefPtr< ossimXmlNode > node)
Definition: ossimWms.cpp:182
virtual bool read(ossimRefPtr< ossimXmlNode > node)
Definition: ossimWms.cpp:199
void clearFields()
Definition: ossimWms.h:331
ossimRefPtr< ossimWmsScaleHint > theScaleHint
Definition: ossimWms.h:448
ossimString theName
Definition: ossimWms.h:440
virtual bool read(ossimRefPtr< ossimXmlNode > node)
Definition: ossimWms.cpp:159
ossimString theDimensionName
Definition: ossimWms.h:446
unsigned int ossim_uint32
ossimString theAbstract
Definition: ossimWms.h:442
ossimString theSrs
Definition: ossimWms.h:443
ossimRefPtr< ossimWmsBoundingBox > theBoundingBox
Definition: ossimWms.h:447
ossimRefPtr< ossimWmsTimeExtent > theTimeExtent
Definition: ossimWms.h:444
virtual bool read(ossimRefPtr< ossimXmlNode > node)
Definition: ossimWms.cpp:148
ossimWmsStyleListType theStyles
Definition: ossimWms.h:449
ossimWmsLayerListType theLayers
Definition: ossimWms.h:450
ossimString theTitle
Definition: ossimWms.h:441
ossimString theDimensionUnits
Definition: ossimWms.h:445
void setParent(ossimWmsLayer *parent)
Definition: ossimWms.h:355

◆ setParent()

void ossimWmsLayer::setParent ( ossimWmsLayer parent)
inline

Definition at line 355 of file ossimWms.h.

Referenced by read().

356  {
357  theParent = parent;
358  }
ossimWmsLayer * theParent
Definition: ossimWms.h:439

Member Data Documentation

◆ theAbstract

ossimString ossimWmsLayer::theAbstract
protected

Definition at line 442 of file ossimWms.h.

Referenced by read().

◆ theBoundingBox

ossimRefPtr<ossimWmsBoundingBox> ossimWmsLayer::theBoundingBox
protected

Definition at line 447 of file ossimWms.h.

Referenced by findBoundingBox(), and read().

◆ theDimensionName

ossimString ossimWmsLayer::theDimensionName
protected

Definition at line 446 of file ossimWms.h.

Referenced by read().

◆ theDimensionUnits

ossimString ossimWmsLayer::theDimensionUnits
protected

Definition at line 445 of file ossimWms.h.

Referenced by read().

◆ theLayers

ossimWmsLayerListType ossimWmsLayer::theLayers
protected

Definition at line 450 of file ossimWms.h.

Referenced by getNamedLayers(), and read().

◆ theName

ossimString ossimWmsLayer::theName
protected

Definition at line 440 of file ossimWms.h.

Referenced by read().

◆ theParent

ossimWmsLayer* ossimWmsLayer::theParent
protected

Definition at line 439 of file ossimWms.h.

Referenced by findBoundingBox().

◆ theScaleHint

ossimRefPtr<ossimWmsScaleHint> ossimWmsLayer::theScaleHint
protected

Definition at line 448 of file ossimWms.h.

Referenced by read().

◆ theSrs

ossimString ossimWmsLayer::theSrs
protected

Definition at line 443 of file ossimWms.h.

Referenced by read().

◆ theStyles

ossimWmsStyleListType ossimWmsLayer::theStyles
protected

Definition at line 449 of file ossimWms.h.

Referenced by read().

◆ theTimeExtent

ossimRefPtr<ossimWmsTimeExtent> ossimWmsLayer::theTimeExtent
protected

Definition at line 444 of file ossimWms.h.

Referenced by read().

◆ theTitle

ossimString ossimWmsLayer::theTitle
protected

Definition at line 441 of file ossimWms.h.

Referenced by read().


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