当前位置: 首页>>代码示例>>C++>>正文


C++ LayerList::count方法代码示例

本文整理汇总了C++中LayerList::count方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerList::count方法的具体用法?C++ LayerList::count怎么用?C++ LayerList::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LayerList的用法示例。


在下文中一共展示了LayerList::count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: listIndexOfItem

/// <summary>
/// Returns what index the specified item would be if the entire scene was
/// represented in a linear list.
/// </summary>
int Scene::listIndexOfItem(SceneItem *item) const
{
	int index = 0;
	for(int i = 0; i < m_groups.count(); i++) {
		const GroupInfo &group = m_groups.at(i);
		if(item == group.sceneItem)
			return index;
		index++;
		LayerList layers = group.group->getLayers();
		for(int j = 0; j < layers.count(); j++) {
			if(item == itemForLayer(layers.at(j)))
				return index;
			index++;
		}
	}
	return -1; // Not found
}
开发者ID:andrejsavikin,项目名称:mishira,代码行数:21,代码来源:scene.cpp

示例2: itemForLayer

/// <summary>
/// Returns the item at the specified index if the entire scene was represented
/// in a linear list.
/// </summary>
SceneItem *Scene::itemAtListIndex(int index) const
{
	int item = 0;
	for(int i = 0; i < m_groups.count(); i++) {
		const GroupInfo &group = m_groups.at(i);
		if(item == index)
			return group.sceneItem;
		item++;
		LayerList layers = group.group->getLayers();
		for(int j = 0; j < layers.count(); j++) {
			Layer *layer = layers.at(j);
			if(item == index)
				return itemForLayer(layer);
			item++;
		}
	}
	return NULL; // Not found
}
开发者ID:andrejsavikin,项目名称:mishira,代码行数:22,代码来源:scene.cpp

示例3: getCapabilities

void Wms::getCapabilities()
{
  QByteArray data;
  QTextStream out(&data);
  QString wmsurl = Qt::escape(m_request->url(FastCgiQt::LocationUrl).toEncoded()); 

  QString proj = renderer.map.getProjection();
  LayerList layers = renderer.map.getLayerList();

  //out << XML_HEADER << endl;
  out << "<WMT_MS_Capabilities version=\"1.1.1\">";

  // service info

  out << "<Service>"
      << "<Name>OGC:WMS</Name>"
      << "<Title>" << Qt::escape(renderer.title()) << "</Title>"
      << "<Abstract/>"
      << "<OnlineResource " << XML_XLINK_NS << " xlink:href=\"" << wmsurl << "\"/>"
      << "<ContactInformation/>"
      << "<Fees/>"
      << "<AccessConstraints/>"
      << "<KeywordList>";
  
  out << "<Keyword>" << "</Keyword>"; // TODO

  out << "</KeywordList>"
      << "</Service>";

  out << "<Capability>" 
      << "<Request>" 
      << "<GetCapabilities>" 
      << "<Format>" << MIMETYPE_GC << "</Format>" 
      << "<DCPType><HTTP><Get>"
      << "<OnlineResource " << XML_XLINK_NS
      <<   " xlink:href=\"" << wmsurl << "?Service=WMS&amp;"
      <<   "\"/></Get></HTTP></DCPType>"
      << "</GetCapabilities>" 
      << "<GetMap>";

  // image formats
  QList<QByteArray> formats = renderer.getImageFormats();
  for (QList<QByteArray>::ConstIterator fit = formats.constBegin();
    fit != formats.constEnd();
    ++fit) {
    QByteArray fb = *fit;
    QString outf;

    // ony return a few formats we want to support
    if (fb == "png") {
      outf = MIMETYPE_PNG;
    }
    else if (fb == "jpg") {
      outf = MIMETYPE_JPG;
    }
    else if (fb == "tiff") {
      outf = MIMETYPE_TIF;
    }

    if (!outf.isEmpty()) {
      out << "<Format>" << QString(outf) << "</Format>";  
    }
  }
  
  out << "<DCPType><HTTP><Get>" 
      << "<OnlineResource " << XML_XLINK_NS
      <<  " xlink:href=\"" << wmsurl << "?SERVICE=WMS&amp;\"/>"
      << "</Get></HTTP></DCPType>"
      << "</GetMap>"
      << "</Request>"; 

  out << "<Exception><Format>" << MIMETYPE_SE << "</Format></Exception>";

  out << "<Layer>" 
      << "<Title>" << Qt::escape(renderer.title()) << "</Title>" 
      << "<SRS>" << Qt::escape(proj) << "</SRS>"; 
      //<LatLonBoundingBox minx="-179.992" miny="-90.008" maxx="180.008" maxy="89.992"/> 
      //
   // layers

/*  for (LayerList::ConstIterator layer_it = layers.constBegin();
              layer_it != layers.constEnd();
              ++layer_it) {
    Layer layer = **layer_it;
*/
  for(int i = 0; i < layers.count(); ++i) {
    Layer* layer = layers[i];

    out << "<Layer queryable=\"0\">" 
        << "<Name>" << Qt::escape(layer->name) << "</Name>"
        << "<Title>" << Qt::escape(layer->title) << "</Title>"
        << "<SRS>" << Qt::escape(proj) << "</SRS>";

    out << "<LatLonBoundingBox minx=\"" << layer->bbox.left << "\" miny=\""
        << layer->bbox.bottom << "\" maxx=\"" << layer->bbox.right 
        << "\" maxy=\"" << layer->bbox.top << "\"/>" 
        << "<BoundingBox SRS=\"" << Qt::escape(proj) << "\" minx=\"" << layer->bbox.left 
        << "\" miny=\"" << layer->bbox.bottom << "\" maxx=\"" 
        << layer->bbox.right << "\" maxy=\"" << layer->bbox.top << "\"/>"; 

//.........这里部分代码省略.........
开发者ID:nmandery,项目名称:openlayers-wms,代码行数:101,代码来源:Wms.cpp


注:本文中的LayerList::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。