OE所有官方例子

OE代码样例

/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2016 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/ #include <osgEarth/MapNode> #include <osgEarthUtil/EarthManipulator>
#include <osgEarthUtil/ExampleResources> #include <osgEarthAnnotation/ImageOverlay>
#include <osgEarthAnnotation/CircleNode>
#include <osgEarthAnnotation/RectangleNode>
#include <osgEarthAnnotation/EllipseNode>
#include <osgEarthAnnotation/PlaceNode>
#include <osgEarthAnnotation/LabelNode>
#include <osgEarthAnnotation/LocalGeometryNode>
#include <osgEarthAnnotation/FeatureNode>
#include <osgEarthAnnotation/ModelNode> #include <osgEarthAnnotation/AnnotationEditing>
#include <osgEarthAnnotation/ImageOverlayEditor> #include <osgEarthSymbology/GeometryFactory> #include <osgViewer/Viewer> using namespace osgEarth;
using namespace osgEarth::Annotation;
using namespace osgEarth::Features;
using namespace osgEarth::Util; //------------------------------------------------------------------ int
usage(char** argv)
{
OE_WARN << "Usage: " << argv[] << " <earthfile>" << std::endl;
return -;
} //------------------------------------------------------------------ int
main(int argc, char** argv)
{
osg::Group* root = new osg::Group(); // try to load an earth file.
osg::ArgumentParser arguments(&argc, argv); osgViewer::Viewer viewer(arguments);
viewer.setCameraManipulator(new EarthManipulator()); // load an earth file and parse demo arguments
osg::Node* node = MapNodeHelper().load(arguments, &viewer);
if (!node)
return usage(argv); root->addChild(node); // find the map node that we loaded.
MapNode* mapNode = MapNode::findMapNode(node);
if (!mapNode)
return usage(argv); // Group to hold all our annotation elements.
osg::Group* annoGroup = new osg::Group();
root->addChild(annoGroup); // Make a group for labels
osg::Group* labelGroup = new osg::Group();
annoGroup->addChild(labelGroup); osg::Group* editGroup = new osg::Group();
root->addChild(editGroup); // Style our labels:
Style labelStyle;
labelStyle.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_CENTER_CENTER;
labelStyle.getOrCreate<TextSymbol>()->fill()->color() = Color::Yellow; // A lat/long SRS for specifying points.
const SpatialReference* geoSRS = mapNode->getMapSRS()->getGeographicSRS(); //-------------------------------------------------------------------- // A series of place nodes (an icon with a text label)
{
Style pm;
pm.getOrCreate<IconSymbol>()->url()->setLiteral("E:/temp/OE/placemark32.png");
pm.getOrCreate<IconSymbol>()->declutter() = true;
pm.getOrCreate<TextSymbol>()->halo() = Color("#5f5f5f"); // bunch of pins:
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -74.00, 40.71), "New York", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -77.04, 38.85), "Washington, DC", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -118.40, 33.93), "Los Angeles", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -71.03, 42.37), "Boston", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -157.93, 21.35), "Honolulu", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, 139.75, 35.68), "Tokyo", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -90.25, 29.98), "New Orleans", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -80.28, 25.82), "Miami", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -117.17, 32.72), "San Diego", pm)); // test with an LOD:
osg::LOD* lod = new osg::LOD();
lod->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, 14.68, 50.0), "Prague", pm), 0.0, 2e6);
labelGroup->addChild(lod); // absolute altitude:
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -87.65, 41.90, , ALTMODE_ABSOLUTE), "Chicago", pm));
} //-------------------------------------------------------------------- // a box that follows lines of latitude (rhumb line interpolation, the default)
{
Geometry* geom = new Polygon();
geom->push_back(osg::Vec3d(, , ));
geom->push_back(osg::Vec3d(-, , ));
geom->push_back(osg::Vec3d(-, , ));
geom->push_back(osg::Vec3d(, , )); Feature* feature = new Feature(geom, geoSRS);
feature->geoInterp() = GEOINTERP_RHUMB_LINE; Style geomStyle;
geomStyle.getOrCreate<LineSymbol>()->stroke()->color() = Color::Cyan;
geomStyle.getOrCreate<LineSymbol>()->stroke()->width() = 5.0f;
geomStyle.getOrCreate<LineSymbol>()->tessellationSize() = ;
geomStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
geomStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_GPU; FeatureNode* fnode = new FeatureNode(mapNode, feature, geomStyle); annoGroup->addChild(fnode); labelGroup->addChild(new LabelNode(mapNode, GeoPoint(geoSRS, -, ), "Rhumb line polygon", labelStyle));
} //-------------------------------------------------------------------- // another rhumb box that crosses the antimeridian
{
Geometry* geom = new Polygon();
geom->push_back(-., -.);
geom->push_back(., -.);
geom->push_back(., -.);
geom->push_back(-., -.);
Style geomStyle; Feature* feature = new Feature(geom, geoSRS);
feature->geoInterp() = GEOINTERP_RHUMB_LINE; geomStyle.getOrCreate<LineSymbol>()->stroke()->color() = Color::Lime;
geomStyle.getOrCreate<LineSymbol>()->stroke()->width() = 3.0f;
geomStyle.getOrCreate<LineSymbol>()->tessellationSize() = ;
geomStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
geomStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_GPU; FeatureNode* gnode = new FeatureNode(mapNode, feature, geomStyle);
annoGroup->addChild(gnode); labelGroup->addChild(new LabelNode(mapNode, GeoPoint(geoSRS, -, -), "Antimeridian polygon", labelStyle));
} //-------------------------------------------------------------------- // A path using great-circle interpolation.
// Keep a pointer to it so we can modify it later on.
FeatureNode* pathNode = ;
{
Geometry* path = new LineString();
path->push_back(osg::Vec3d(-, 40.714, )); // New York
path->push_back(osg::Vec3d(139.75, 35.68, )); // Tokyo Feature* pathFeature = new Feature(path, geoSRS);
pathFeature->geoInterp() = GEOINTERP_GREAT_CIRCLE; Style pathStyle;
pathStyle.getOrCreate<LineSymbol>()->stroke()->color() = Color::White;
pathStyle.getOrCreate<LineSymbol>()->stroke()->width() = 1.0f;
pathStyle.getOrCreate<LineSymbol>()->tessellationSize() = ;
pathStyle.getOrCreate<PointSymbol>()->size() = ;
pathStyle.getOrCreate<PointSymbol>()->fill()->color() = Color::Red;
pathStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
pathStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_GPU; //OE_INFO << "Path extent = " << pathFeature->getExtent().toString() << std::endl; pathNode = new FeatureNode(mapNode, pathFeature, pathStyle);
annoGroup->addChild(pathNode); labelGroup->addChild(new LabelNode(mapNode, GeoPoint(geoSRS, -, 61.2), "Great circle path", labelStyle));
} //-------------------------------------------------------------------- // Two circle segments around New Orleans.
{
Style circleStyle;
circleStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Cyan, 0.5);
circleStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
circleStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_DRAPE; CircleNode* circle = new CircleNode(
mapNode,
GeoPoint(geoSRS, -90.25, 29.98, ., ALTMODE_RELATIVE),
Distance(, Units::KILOMETERS),
circleStyle, Angle(-45.0, Units::DEGREES), Angle(45.0, Units::DEGREES), true);
annoGroup->addChild(circle); editGroup->addChild(new CircleNodeEditor(circle));
} {
Style circleStyle;
circleStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Red, 0.5);
circleStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
circleStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_DRAPE; CircleNode* circle = new CircleNode(
mapNode,
GeoPoint(geoSRS, -90.25, 29.98, ., ALTMODE_RELATIVE),
Distance(, Units::KILOMETERS),
circleStyle, Angle(45.0, Units::DEGREES), Angle(360.0 - 45.0, Units::DEGREES), true);
annoGroup->addChild(circle); editGroup->addChild(new CircleNodeEditor(circle));
} //-------------------------------------------------------------------- // An extruded ellipse around Miami.
{
Style ellipseStyle;
ellipseStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Orange, 0.75);
ellipseStyle.getOrCreate<ExtrusionSymbol>()->height() = 250000.0; // meters MSL
EllipseNode* ellipse = new EllipseNode(
mapNode,
GeoPoint(geoSRS, -80.28, 25.82, 0.0, ALTMODE_RELATIVE),
Distance(, Units::MILES),
Distance(, Units::MILES),
Angle(, Units::DEGREES),
ellipseStyle,
Angle(45.0, Units::DEGREES),
Angle(360.0 - 45.0, Units::DEGREES),
true);
annoGroup->addChild(ellipse); editGroup->addChild(new EllipseNodeEditor(ellipse));
}
{
Style ellipseStyle;
ellipseStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Blue, 0.75);
ellipseStyle.getOrCreate<ExtrusionSymbol>()->height() = 250000.0; // meters MSL
EllipseNode* ellipse = new EllipseNode(
mapNode,
GeoPoint(geoSRS, -80.28, 25.82, 0.0, ALTMODE_RELATIVE),
Distance(, Units::MILES),
Distance(, Units::MILES),
Angle(, Units::DEGREES),
ellipseStyle,
Angle(-40.0, Units::DEGREES),
Angle(40.0, Units::DEGREES),
true);
annoGroup->addChild(ellipse); editGroup->addChild(new EllipseNodeEditor(ellipse));
} //-------------------------------------------------------------------- {
// A rectangle around San Diego
Style rectStyle;
rectStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Green, 0.5);
rectStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
rectStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_DRAPE;
RectangleNode* rect = new RectangleNode(
mapNode,
GeoPoint(geoSRS, -117.172, 32.721),
Distance(, Units::KILOMETERS),
Distance(, Units::KILOMETERS),
rectStyle);
annoGroup->addChild(rect); editGroup->addChild(new RectangleNodeEditor(rect));
} //-------------------------------------------------------------------- // An extruded polygon roughly the shape of Utah. Here we demonstrate the
// FeatureNode, where you create a geographic geometry and use it as an
// annotation.
{
Geometry* utah = new Polygon();
utah->push_back(-114.052, 37.0);
utah->push_back(-109.054, 37.0);
utah->push_back(-109.054, 41.0);
utah->push_back(-111.040, 41.0);
utah->push_back(-111.080, 42.059);
utah->push_back(-114.080, 42.024); Style utahStyle;
utahStyle.getOrCreate<ExtrusionSymbol>()->height() = 250000.0; // meters MSL
utahStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::White, 0.8); Feature* utahFeature = new Feature(utah, geoSRS);
FeatureNode* featureNode = new FeatureNode(mapNode, utahFeature, utahStyle);
annoGroup->addChild(featureNode);
} //-------------------------------------------------------------------- // an image overlay.
{
ImageOverlay* imageOverlay = 0L;
osg::Image* image = osgDB::readImageFile("E:/temp/OE/placemark32.png/USFLAG.TGA");
//osg::Image* image = osgDB::readImageFile("../data/USFLAG.TGA"); if (image)
{
imageOverlay = new ImageOverlay(mapNode, image);
imageOverlay->setBounds(Bounds(-100.0, 35.0, -90.0, 40.0));
annoGroup->addChild(imageOverlay); editGroup->addChild(new ImageOverlayEditor(imageOverlay));
}
} //-------------------------------------------------------------------- // a model node with auto scaling.
{
Style style;
style.getOrCreate<ModelSymbol>()->autoScale() = true;
style.getOrCreate<ModelSymbol>()->url()->setLiteral("E:/temp/OE/red_flag.osg.50.scale");
ModelNode* modelNode = new ModelNode(mapNode, style);
modelNode->setPosition(GeoPoint(geoSRS, -, ));
annoGroup->addChild(modelNode);
} //-------------------------------------------------------------------- // initialize the viewer:
viewer.setSceneData(root); viewer.getCamera()->setSmallFeatureCullingPixelSize(-1.0f);
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = ;
traits->y = ;
traits->width = ;
traits->height = ;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = ; osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get()); osg::ref_ptr<osg::Camera> camera = new osg::Camera;
camera->setGraphicsContext(gc.get());
camera->setViewport(new osg::Viewport(, , traits->width, traits->height));
GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
camera->setDrawBuffer(buffer);
camera->setReadBuffer(buffer);
viewer.addSlave(camera); return viewer.run();
}

earth文件样例为  :  annotation.earth

<!--
osgEarth Sample - Annotations
-->
<map name="readymap.org" type="geocentric" version=""> <image name="ReadyMap.org - Imagery" driver="tms">
<url>http://readymap.org/readymap/tiles/1.0.//</url>
</image> <elevation name="ReadyMap.org - Elevation" driver="tms">
<url>http://readymap.org/readymap/tiles/1.0.//</url>
</elevation> <viewpoints>
<viewpoint name="Annotation Samples"
lat="" long="-118" range=""
heading="35.27" pitch="-35" />
</viewpoints> <!--annotations name="Annotations Group A"> <label text="Label">
<position lat="" long="-120" />
<style type="text/css">
text-align: center_center;
text-size: ;
text-declutter: true;
text-halo: #;
text-bbox-fill: #00FF0033;
text-bbox-margin: ;
text-bbox-border: #FFFFFFFF;
text-bbox-border-width: ;
</style>
</label> <label text="Label with offsets">
<position lat="" long="-120" />
<style type="text/css">
text-align: center_center;
text-size: ;
text-declutter: true;
text-halo: #;
text-offset-x: ;
text-offset-y: -;
text-bbox-fill: #00FF0033;
text-bbox-margin: ;
text-bbox-border: #FFFFFFFF;
text-bbox-border-width: ;
</style>
</label> <place text="Place">
<position lat="" long="-110"/>
<icon>../data/placemark32.png</icon>
<style type="text/css">
text-declutter: true;
text-halo: #;
</style>
</place> <place text="Extruded Place">
<position lat="" long="-105" alt=""/>
<icon>../data/placemark32.png</icon>
<style type="text/css">
text-declutter: true;
text-halo: #;
</style>
</place> <circle name="draped circle">
<position lat="34.051" long="-117.974"/>
<radius>50km</radius>
<style type="text/css">
fill: #ffff0080;
stroke: #ffffff;
stroke-width: 2px;
altitude-clamping: terrain-drape;
</style>
</circle>
<label text="Draped circle" lat="34.051" long="-117.974"/> <circle name="scene-clamped circle">
<position lat="22.074" long="-159.606"/>
<radius>.2km</radius>
<style type="text/css">
stroke: #ffffff;
stroke-width: 2px;
altitude-clamping: terrain-scene;
altitude-binding: vertex;
render-depth-offset-auto: true;
</style>
</circle>
<label text="scene-clamped circle" lat="22.074" long="-159.606"/> <ellipse name="ellipse relative">
<position lat="" long="-100" hat=""/>
<radius_major>50km</radius_major>
<radius_minor>40km</radius_minor>
<style type="text/css">
fill: #ff00ff7f;
stroke: #ffffff;
</style>
</ellipse>
<label text="HAT Ellipse" lat="" long="-100.0"/>
</annotations> <annotations name="Annotations Group B"> <ellipse name="ellipse extruded">
<position lat="" long="-100.0"/>
<radius_major>50km</radius_major>
<radius_minor>20km</radius_minor>
<style type="text/css">
fill: #ff7f007f;
stroke: #ff0000ff;
extrusion-height: ;
</style>
</ellipse>
<label text="Extruded Ellipse" lat="" long="-100.0"/> <feature name="Extruded Line">
<srs>wgs84</srs>
<geometry>
LINESTRING(-80.37 34.039, -80.09 33.96, -79.75 , -79.43 33.37, -79.48 32.88)
</geometry>
<style type="text/css">
fill: #ff00ff7f;
stroke: #ffff00;
stroke-width: ;
stroke-crease-angle: 45.0;
extrusion-height: ;
render-lighting: true;
</style>
</feature>
<label text="Extruded Line" lat="" long="-80"/> <feature name="GPU-Clamped Line">
<srs>wgs84</srs>
<geometry>
LINESTRING(- , - , - , - )
</geometry>
<style type="text/css">
stroke: #ff3000;
stroke-width: ;
stroke-tessellation-size: 1km;
altitude-clamping: terrain-gpu;
</style>
</feature>
<label text="GPU-Clamped Line" lat="" long="-115">
<style type="text/css">
text-align: center_center;
text-geographic-course: 45.0;
text-bbox-fill: #FFFF0033;
text-bbox-margin: ;
text-bbox-border: #FFFF00;
text-bbox-border-width: 0.5;
</style>
</label> <feature name="Draped Polygon">
<srs>wgs84</srs>
<geometry>
POLYGON((- , - , - , - , - ))
</geometry>
<style type="text/css">
fill: #ffff007f;
stroke: #ffffff;
stroke-width: 2px;
altitude-clamping: terrain-drape;
</style>
</feature>
<label text="Draped Polygon" lat="" long="-98"/> <model name="Auto-Scaled Model">
<position lat="" long="-100"/>
<style>
model: "../data/red_flag.osg.45.scale";
model-scale: auto;
</style>
</model>
<label text="Auto-Scaled Model" lat="42.5" long="-100"/> <imageoverlay>
<url>../data/fractal.png</url>
<alpha>1.0</alpha>
<geometry>POLYGON((- , -80.5 , -80.5 26.5, - 26.5))</geometry>
</imageoverlay>
<label text="ImageOverlay" lat="" long="-81"/> <local_geometry name="3D geometry">
<geometry>
POLYGON(( , - , , ))
</geometry>
<position lat="33.4" long="-116.6"/>
<style type="text/css">
fill: #00ff00;
stroke: #ffff00;
stroke-width: 2px;
render-lighting: false;
</style>
<horizon_culling>true</horizon_culling>
</local_geometry>
<label text="3D Geometry" lat="33.4" long="-116.6"/> <feature name="Long Line">
<srs>wgs84</srs>
<geometry>
LINESTRING( , )
</geometry>
<style type="text/css">
stroke: #ffff00;
stroke-width: ;
stroke-tessellation-size: 1km;
altitude-clamping: terrain;
altitude-technique: gpu;
render-lighting: false;
</style>
</feature> <label text="Tessellated line" lat="" long="">
<style type="text/css">
text-align: center_bottom;
text-geographic-course: ;
</style>
</label> </annotations-->
</map>

[原][OE][官方例子]osgearth_annotation OE地球添加热点标签的更多相关文章

  1. [原][OE][官方例子]osgearth_features OE地球添加shp文件(特征标识)

    OE所有官方样例 官方示例代码 /* -*-c++-*- */ /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph * Co ...

  2. Asp.Net MVC4.0 官方教程 入门指南之三--添加一个视图

    Asp.Net MVC4.0 官方教程 入门指南之三--添加一个视图 在本节中,您需要修改HelloWorldController类,从而使用视图模板文件,干净优雅的封装生成返回到客户端浏览器HTML ...

  3. Java Restful框架:Jersey入门示例(官方例子)

    本文主要介绍了Java Restful框架Jersey入门例子(来源于官方网站https://jersey.java.net/),废话不多说进入正题. 在Jersey官方示例中(https://jer ...

  4. Asp.Net MVC4.0 官方教程 入门指南之四--添加一个模型

    Asp.Net MVC4.0 官方教程 入门指南之四--添加一个模型 在这一节中,你将添加用于管理数据库中电影的类.这些类是ASP.NET MVC应用程序的模型部分. 你将使用.NET Framewo ...

  5. 解析苹果的官方例子LazyTableImages实现图片懒加载原理

    解析苹果的官方例子LazyTableImages实现图片懒加载原理 首先在官网下载源码: https://developer.apple.com/library/ios/navigation/#sec ...

  6. dedecms:织梦文章如何添加“自定义属性”标签(sql命令行工具)

    dede织梦如何添加“自定义属性”标签“症状” 1.进入后台——系统——SQL命令行工具——运行SQL命令行,添加arcatt表字段: insert into`dede_arcatt`(sortid, ...

  7. Discuz 3.X 门户文章插入图片自动添加 alt 标签

    最近用 Discuz 搭建了个网站--儿童安全座椅网(www.bbseat.com.cn),用到了门户功能,不得不说Discuz 的功能还是非常强大的,但在使用过程中发现在发表文章时添加了图片却不能像 ...

  8. Asp.net 后台添加Meta标签方法

    Asp.net 后台添加Meta标签方法包括keywords,CSS.JS 下面是从Asp.net 后台添加CSS.JS.Meta标签的写法,我们这里写成函数方便以后使用.如果函数放在页面类中, Pa ...

  9. 详解Android ActionBar之二:ActionBar添加Tabs标签和下拉导航

    本节主要讲解ActionBar如何添加Tabs标签和下拉导航. 一.添加标签 Tabs 在ActionBar中实现标签页可以实现android.app.ActionBar.TabListener ,重 ...

随机推荐

  1. yarn 错误There appears to be trouble with your network connection. Retrying...

    原因:yarn超时 解决途径:1.安装好后更换淘宝镜像 yarn config set registry https://registry.npm.taobao.org

  2. Linux下安装zookeeper和启动

    原文:https://yq.aliyun.com/articles/662422 1.zookeeper官网下载安装包http://mirrors.hust.edu.cn/apache/zookeep ...

  3. Problem E: 数量的类模板

    #include<iostream> #include<iomanip> #include<algorithm> using namespace std; temp ...

  4. ASCII、Unicode、UTF-8字符集编码

    ASCII码 计算机内部,所有信息都是由二进制的字符串表示 每一个二进制位有“0”.“1”两种状态,因此8个二进制位可以表示256个状态,每个状态代表一个符号就是256个符号,从0000000到111 ...

  5. 2019-2020-1 20199302《Linux内核原理与分析》第六周作业

    一 .万能函数 1.过程抽象 (1)接口:指明模块要做什么,标识符/类型.函数等,.h ,函数调用者 (2)实现:指明模块如何完成接口,一个接口多个实现(可能),.c ,函数实现者 (3)函数签名:函 ...

  6. mysql数据库从一台服务器迁移到另一台服务器上

    一.应用场景      由于要把测试服务器上的数据库迁移到正式服务器上,因此需要做数据库的迁移.这里记录一下. 二.数据库迁移1.新建数据库test create database test;12.进 ...

  7. 洛谷 P2827 蚯蚓 题解

    每日一题 day32 打卡 Analysis 我们可以想一下,对于每一秒除了被切的哪一个所有的蚯蚓都增长Q米,我们来维护3个队列,队列1表示最开始的蚯蚓,队列2表示每一次被切的蚯蚓被分开的较长的那一部 ...

  8. Kafka ISR and AR HW 、 LEO

    相信大家已经对 kafka 的基本概念已经有一定的了解了,下面直接来分析一下 ISR 和 AR 的概念. 0|1ISR and AR 简单来说,分区中的所有副本统称为 AR (Assigned Rep ...

  9. 【angularJS】学习笔记

    一.一个html中多个ng-app //对于ng-app初始化一个AngularJS程序属性的使用需要注意,在一个页面中AngularJS自动加载第一个ng-app,其他ng-app会忽略 //如果需 ...

  10. noi.ac #32 快速排序归并排序应用

    \(des\) 给定长度为 \(n\) 的数组,要求翻转一段区间 \([l, r]\) 使其升序排列. 要求 \(\sum r - l + 1 <= 2e7\) \(sol\) 考虑快速排序,每 ...