[原][OE][官方例子]osgearth_annotation 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地球添加热点标签的更多相关文章
- [原][OE][官方例子]osgearth_features OE地球添加shp文件(特征标识)
OE所有官方样例 官方示例代码 /* -*-c++-*- */ /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph * Co ...
- Asp.Net MVC4.0 官方教程 入门指南之三--添加一个视图
Asp.Net MVC4.0 官方教程 入门指南之三--添加一个视图 在本节中,您需要修改HelloWorldController类,从而使用视图模板文件,干净优雅的封装生成返回到客户端浏览器HTML ...
- Java Restful框架:Jersey入门示例(官方例子)
本文主要介绍了Java Restful框架Jersey入门例子(来源于官方网站https://jersey.java.net/),废话不多说进入正题. 在Jersey官方示例中(https://jer ...
- Asp.Net MVC4.0 官方教程 入门指南之四--添加一个模型
Asp.Net MVC4.0 官方教程 入门指南之四--添加一个模型 在这一节中,你将添加用于管理数据库中电影的类.这些类是ASP.NET MVC应用程序的模型部分. 你将使用.NET Framewo ...
- 解析苹果的官方例子LazyTableImages实现图片懒加载原理
解析苹果的官方例子LazyTableImages实现图片懒加载原理 首先在官网下载源码: https://developer.apple.com/library/ios/navigation/#sec ...
- dedecms:织梦文章如何添加“自定义属性”标签(sql命令行工具)
dede织梦如何添加“自定义属性”标签“症状” 1.进入后台——系统——SQL命令行工具——运行SQL命令行,添加arcatt表字段: insert into`dede_arcatt`(sortid, ...
- Discuz 3.X 门户文章插入图片自动添加 alt 标签
最近用 Discuz 搭建了个网站--儿童安全座椅网(www.bbseat.com.cn),用到了门户功能,不得不说Discuz 的功能还是非常强大的,但在使用过程中发现在发表文章时添加了图片却不能像 ...
- Asp.net 后台添加Meta标签方法
Asp.net 后台添加Meta标签方法包括keywords,CSS.JS 下面是从Asp.net 后台添加CSS.JS.Meta标签的写法,我们这里写成函数方便以后使用.如果函数放在页面类中, Pa ...
- 详解Android ActionBar之二:ActionBar添加Tabs标签和下拉导航
本节主要讲解ActionBar如何添加Tabs标签和下拉导航. 一.添加标签 Tabs 在ActionBar中实现标签页可以实现android.app.ActionBar.TabListener ,重 ...
随机推荐
- Discuz! ML RCE漏洞 getshell 复现
0x01 影响版本 Discuz! ML V3.2 Discuz! ML V3.3 Discuz! ML V3.4 0x02 环境搭建 直接官网下载即可http://discuz.ml/downloa ...
- winform上传文件到服务器——资料整理
标题:使用简单的wcf文件实现上传,下载文件到服务器 地址:https://blog.csdn.net/duanzi_peng/article/details/19037777
- java通过url读取网络图片
使用java.net读取网络文件 import java.io.BufferedInputStream; import java.io.FileOutputStream; import java.io ...
- Idea和eclipse安装activiti插件
eclipse安装:help>install new software>add 有外网状态下 输入 :http://www.activiti.org/design ...
- matlab之数组反序输出
a=[1 2 3 4 5] a(end:-1:1)=[5 4 3 2 1]
- 初【001】——Python 基础知识
1.python基础入门 提示: 语法基于python3.x版本(会提示2.x版本和3.x版本的区别) Python命令行将以>>>开始,比如 >>>print ( ...
- Linux 服务器用户间ssh免密码登录
1.本脚本为服务器用户间密码互信登录脚本 2.依赖 需要安装expect工具 3.使用 sh CreateUserssh.sh hadoop hadoop /home/hadoop/.ssh 三个带入 ...
- Problem 6 二分
$des$有 $n$ 个物品,第 $i$ 个物品有两个属性 $k_i, b_i$ ,表示它在时刻 $x$ 的价值为 $k_i \times x + b_i$ .当前处于时刻 $0$ ,你可以选择不超过 ...
- 洛谷 P1231教辅的组成
题目描述 /* s->练习册(1~b)->书(b+1~a+b)->答案(a+b+1~a+b+c)->t 但是可能会有多本练习册指向同一本书,这本书又可能会指向多本答案 这样每本 ...
- luogu P1046 陶陶摘苹果
二次联通门 : luoguP1046 /* 这个题好难..... 由苹果树可知 这应该是个树结构的题 所以很自然的想到了用树链剖分来搞一下 连边 最后查询以1为根节点的子树的权值和... 从前闲的没事 ...