ArcGIS Engine开发的ArcGIS 版本管理的功能
原文:ArcGIS Engine开发的ArcGIS 版本管理的功能
转自:http://blog.csdn.net/linghe301/article/details/7965901
这是以前的ArcGIS Engine开发成果,主要是Geodatabase方面的,模仿ArcGIS版本的流程
系统环境:
VS2010、ArcGIS Engine10、DevExpress721(第三方控件,比较常用易于下载)
------------------------------------------------------------------
我跟大家分享了存在#百度网盘#上的文件,“DXperienceEval-7.2.1.exe”,点击链接进行查看和下载。 http://t.cn/zWsdZRY (分享自 @百度网盘官方微博)
------------------------------------------------------------------
系统的连接参数都写在代码里面了,如果有问题,跟踪一下代码即可解决
相关功能:
1:打开ArcSDE版本数据
2:切换版本
3:创建新版本
4:查看版本信息
5:协调版本
6:冲突解决
7:提交版本
8:历史归档管理
因为这是很早的东西了,是自己兴趣开发的,会有相关bug,如果有一定基础肯定可以顺利的进行参考!希望能给大家带来帮助!
仅供参考!
下图为系统界面
下图为创建子版本
下图为协调版本
下图为冲突对话框
核心代码冲突对话框
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using DevExpress.XtraEditors;
- using ESRI.ArcGIS.Geometry;
- using ESRI.ArcGIS.Geodatabase;
- using ESRI.ArcGIS.esriSystem;
- using ESRI.ArcGIS.Display;
- using LSCommonHelper;
- using LSGISHelper;
- using ESRI.ArcGIS.DataSourcesGDB;
- using ESRI.ArcGIS.Controls;
- using ESRI.ArcGIS.Carto;
- using DevExpress.XtraGrid.Views.Grid;
- namespace LSVersion.Version
- {
- public partial class ConflictsForm : Form
- {
- public ConflictsForm()
- {
- InitializeComponent();
- }
- private IVersion m_peditVersion=null;
- public IVersion EditVersion
- {
- get { return m_peditVersion; }
- set { m_peditVersion = value; }
- }
- private IVersion m_ptargetVersion = null;
- public IVersion TargetVersion
- {
- get { return m_ptargetVersion; }
- set { m_ptargetVersion = value; }
- }
- private void ConflictsForm_Load(object sender, EventArgs e)
- {
- Init();
- }
- private IFeatureWorkspace featureWorkspace = null;
- private IFeatureWorkspace commonAncestorFWorkspace = null;
- private IFeatureWorkspace preReconcileFWorkspace = null;
- private IFeatureWorkspace reconcileFWorkspace = null;
- private AxMapControl m_pMapControl = null;
- public AxMapControl MapControl
- {
- get { return m_pMapControl; }
- set { m_pMapControl = value; }
- }
- IFeature featurePreReconcile = null;
- IFeature featureReconcile = null;
- IFeature featureCommonAncestor = null;
- private void ClickID(string sLayerName, int sOID, TreeNode sSelNode)
- {
- IFeatureClass featureClassPreReconcile =
- preReconcileFWorkspace.OpenFeatureClass(sLayerName);
- IFeatureClass featureClassReconcile =
- reconcileFWorkspace.OpenFeatureClass(sLayerName);
- IFeatureClass featureClassCommonAncestor =
- commonAncestorFWorkspace.OpenFeatureClass(sLayerName);
- this.axMapControl1.ClearLayers();
- this.axMapControl2.ClearLayers();
- this.axMapControl3.ClearLayers();
- this.listView1.Items.Clear();
- int flag = -1;
- if (sSelNode.Parent.Text == "更新-更新冲突")
- {
- flag = 0;
- }
- else if (sSelNode.Parent.Text == "删除-更新冲突")
- {
- flag = 1;
- }
- else if (sSelNode.Parent.Text == "更新-删除冲突")
- {
- flag = 2;
- }
- IFeatureLayer PreReconcileFL = new FeatureLayerClass();
- PreReconcileFL.FeatureClass = featureClassPreReconcile;
- IFeatureLayer ReconcileFL = new FeatureLayerClass();
- ReconcileFL.FeatureClass = featureClassReconcile;
- IFeatureLayer CommonAncestorFL = new FeatureLayerClass();
- CommonAncestorFL.FeatureClass = featureClassCommonAncestor;
- this.axMapControl1.Map.AddLayer(ReconcileFL as ILayer);
- this.axMapControl2.Map.AddLayer(PreReconcileFL as ILayer);
- this.axMapControl3.Map.AddLayer(CommonAncestorFL as ILayer);
- try
- {
- featurePreReconcile =
- featureClassPreReconcile.GetFeature(sOID);
- }
- catch { this.axMapControl2.ClearLayers(); }
- try
- {
- featureReconcile = featureClassReconcile.GetFeature(sOID);
- }
- catch { this.axMapControl1.ClearLayers(); }
- try
- {
- featureCommonAncestor =
- featureClassCommonAncestor.GetFeature(sOID);
- }
- catch { this.axMapControl3.ClearLayers(); }
- IField pField = null;
- if (flag == 0)
- {
- for (int i = 0; i < featureReconcile.Fields.FieldCount; i++)
- {
- pField = featureReconcile.Fields.get_Field(i);
- ListViewItem lv = new ListViewItem();
- lv.SubItems.Add(pField.AliasName);
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureReconcile, pField.AliasName));
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featurePreReconcile, pField.AliasName));
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureReconcile, pField.AliasName));
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureCommonAncestor, pField.AliasName));
- this.listView1.Items.Add(lv);
- }
- }
- else if (flag == 1)
- {
- for (int i = 0; i < featureReconcile.Fields.FieldCount; i++)
- {
- pField = featureReconcile.Fields.get_Field(i);
- ListViewItem lv = new ListViewItem();
- lv.SubItems.Add(pField.AliasName);
- if (i == 0)
- {
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureReconcile, pField.AliasName));
- lv.SubItems.Add("Deleted");
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureReconcile, pField.AliasName));
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureCommonAncestor, pField.AliasName));
- }
- else
- {
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureReconcile, pField.AliasName));
- lv.SubItems.Add("");
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureReconcile, pField.AliasName));
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureCommonAncestor, pField.AliasName));
- }
- this.listView1.Items.Add(lv);
- }
- }
- else if (flag == 2)
- {
- for (int i = 0; i < featurePreReconcile.Fields.FieldCount; i++)
- {
- pField = featurePreReconcile.Fields.get_Field(i);
- ListViewItem lv = new ListViewItem();
- lv.SubItems.Add(pField.AliasName);
- if (i == 0)
- {
- lv.SubItems.Add("Deleted");
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featurePreReconcile, pField.AliasName));
- lv.SubItems.Add("Deleted");
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureCommonAncestor, pField.AliasName));
- }
- else
- {
- lv.SubItems.Add("");
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featurePreReconcile, pField.AliasName));
- lv.SubItems.Add("");
- lv.SubItems.Add(LSGISHelper.FeatureHelper.GetFeatureStringValue(featureCommonAncestor, pField.AliasName));
- }
- this.listView1.Items.Add(lv);
- }
- }
- Flash(this.axMapControl1, featureReconcile);
- Flash(this.axMapControl2, featurePreReconcile);
- Flash(this.axMapControl3, featureCommonAncestor);
- #region//Display
- pageCon = this.m_pMapControl.ActiveView.GraphicsContainer;
- pageCon.DeleteAllElements();
- Display(featureReconcile);
- Display(featurePreReconcile);
- Display(featureCommonAncestor);
- #endregion
- }
- IGraphicsContainer pageCon = null;
- private void Display(IFeature pFea)
- {
- IFillShapeElement pPEle = new PolygonElementClass();
- IFillSymbol pFillSym = new SimpleFillSymbolClass();
- RgbColorClass rgbClr = new RgbColorClass();
- rgbClr.Transparency = 0;
- ILineSymbol pLineSym = new SimpleLineSymbolClass();
- pLineSym.Color = LSGISHelper.ColorHelper.CreateRandomColor();
- pLineSym.Width = 4;
- pFillSym.Color = rgbClr;
- pFillSym.Outline = pLineSym;
- pPEle.Symbol = pFillSym;
- IElement pEle = pPEle as IElement;
- pEle.Geometry = pFea.ShapeCopy;
- this.m_pMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
- pageCon.AddElement(pEle, 0);
- }
- private void Flash(AxMapControl axMapControl3, IFeature pFea)
- {
- if (pFea != null)
- {
- axMapControl3.Extent = pFea.Shape.Envelope;
- axMapControl3.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
- axMapControl3.FlashShape(pFea.ShapeCopy);
- }
- }
- private void Init()
- {
- this.myTreeView1.Nodes.Clear();
- this.listView1.Items.Clear();
- try
- {
- IWorkspaceEdit workspaceEdit = (IWorkspaceEdit2)m_peditVersion;
- IVersionEdit4 versionEdit4 = (IVersionEdit4)workspaceEdit;
- featureWorkspace = m_peditVersion as IFeatureWorkspace;
- // Get the various versions on which to output information.
- commonAncestorFWorkspace = (IFeatureWorkspace)
- versionEdit4.CommonAncestorVersion;
- preReconcileFWorkspace = (IFeatureWorkspace)
- versionEdit4.PreReconcileVersion;
- reconcileFWorkspace = (IFeatureWorkspace)
- versionEdit4.ReconcileVersion;
- IEnumConflictClass enumConflictClass = versionEdit4.ConflictClasses;
- TreeNode pRootNode = new TreeNode();
- pRootNode.Text = "Conflicts";
- this.myTreeView1.Nodes.Add(pRootNode);
- IConflictClass conflictClass = null;
- while ((conflictClass = enumConflictClass.Next()) != null)
- {
- IDataset dataset = (IDataset)conflictClass;
- // Make sure class is a feature class.
- if (dataset.Type == esriDatasetType.esriDTFeatureClass)
- {
- String datasetName = dataset.Name;
- TreeNode pRoot2Node = new TreeNode();
- pRoot2Node.Text = datasetName;
- this.myTreeView1.Nodes[0].Nodes.Add(pRoot2Node);
- IFeatureClass featureClass = featureWorkspace.OpenFeatureClass
- (datasetName);
- // Console.WriteLine("Conflicts on feature class {0}", datasetName);
- // Get conflict feature classes on the three reconcile versions.
- // Get all UpdateUpdate conflicts.
- ISelectionSet updateUpdates = conflictClass.UpdateUpdates;
- if (updateUpdates.Count > 0)
- {
- TreeNode pUUNode = new TreeNode();
- pUUNode.Text = "更新-更新冲突";
- pRoot2Node.Nodes.Add(pUUNode);
- #region 更新更新
- // Iterate through each OID, outputting information.
- IEnumIDs enumIDs = updateUpdates.IDs;
- int oid = enumIDs.Next();
- while (oid != -1)
- //loop through all conflicting features
- {
- // Console.WriteLine("UpdateUpdate conflicts on feature {0}", oid);
- // Get conflict feature on the three reconcile versions.
- TreeNode pOidNode = new TreeNode();
- pOidNode.Text ="OID:"+ oid.ToString();
- pUUNode.Nodes.Add(pOidNode);
- #region---处理
- // Check to make sure each shape is different than the common ancestor (conflict is on shape field).
- #endregion
- oid = enumIDs.Next();
- }
- #endregion
- }
- ISelectionSet deleteUpdates = conflictClass.DeleteUpdates;
- if (deleteUpdates.Count > 0)
- {
- TreeNode pDUNode = new TreeNode();
- pDUNode.Text = "删除-更新冲突";
- pRoot2Node.Nodes.Add(pDUNode);
- #region 删除更新
- // Iterate through each OID, outputting information.
- IEnumIDs enumIDs = deleteUpdates.IDs;
- int oid = enumIDs.Next();
- while (oid != -1)
- //loop through all conflicting features
- {
- // Console.WriteLine("UpdateUpdate conflicts on feature {0}", oid);
- // Get conflict feature on the three reconcile versions.
- TreeNode pOidNode = new TreeNode();
- pOidNode.Text = "OID:" + oid.ToString();
- pDUNode.Nodes.Add(pOidNode);
- oid = enumIDs.Next();
- }
- #endregion
- }
- ISelectionSet Updatedeletes = conflictClass.UpdateDeletes;
- if (Updatedeletes.Count > 0)
- {
- TreeNode pUDNode = new TreeNode();
- pUDNode.Text = "更新-删除冲突";
- pRoot2Node.Nodes.Add(pUDNode);
- #region 更新删除
- // Iterate through each OID, outputting information.
- IEnumIDs enumIDs = Updatedeletes.IDs;
- int oid = enumIDs.Next();
- while (oid != -1)
- //loop through all conflicting features
- {
- TreeNode pOidNode = new TreeNode();
- pOidNode.Text = "OID:" + oid.ToString();
- pUDNode.Nodes.Add(pOidNode);
- oid = enumIDs.Next();
- }
- #endregion
- }
- }
- }
- this.myTreeView1.ExpandAll();
- }
- catch (System.Runtime.InteropServices.COMException comExc)
- {
- Console.WriteLine("Error Message: {0}, Error Code: {1}", comExc.Message,
- comExc.ErrorCode);
- }
- }
- // Method to determine if shape field is in conflict.
- private bool IsShapeInConflict(IFeature commonAncestorFeature, IFeature
- preReconcileFeature, IFeature reconcileFeature)
- {
- // 1st check: Common Ancestor with PreReconcile.
- // 2nd check: Common Ancestor with Reconcile.
- // 3rd check: Reconcile with PreReconcile (case of same change on both versions)
- if (IsGeometryEqual(commonAncestorFeature.ShapeCopy,
- preReconcileFeature.ShapeCopy) || IsGeometryEqual
- (commonAncestorFeature.ShapeCopy, reconcileFeature.ShapeCopy) ||
- IsGeometryEqual(reconcileFeature.ShapeCopy, preReconcileFeature.ShapeCopy)
- )
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- // Method returning if two shapes are equal to one another.
- private bool IsGeometryEqual(IGeometry shape1, IGeometry shape2)
- {
- if (shape1 == null & shape2 == null)
- {
- return true;
- }
- else if (shape1 == null ^ shape2 == null)
- {
- return false;
- }
- else
- {
- IClone clone1 = (IClone)shape1;
- IClone clone2 = (IClone)shape2;
- return clone1.IsEqual(clone2);
- }
- }
- private void myTreeView1_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- if (this.myTreeView1.Nodes.Count > 0)
- {
- TreeNode sSelNode = this.myTreeView1.SelectedNode;
- if (sSelNode != null)
- {
- string sSel = sSelNode.Text;
- if (LSCommonHelper.OtherHelper.GetLeftName(sSel, ":") == "OID")
- {
- string sLayerName = sSelNode.Parent.Parent.Text;
- int sOID = LSCommonHelper.ConvertHelper.ObjectToInt(
- LSCommonHelper.OtherHelper.GetRightName(sSel, ":"));
- ClickID(sLayerName, sOID, sSelNode);
- }
- }
- }
- }
- private void ConflictsForm_FormClosing(object sender, FormClosingEventArgs e)
- {
- pageCon.DeleteAllElements();
- }
- private void replaceObjectWith(IFeature pfea,
- TreeNode pNode )
- {
- pageCon.DeleteAllElements();
- TreeNode sSelNode = this.myTreeView1.SelectedNode;
- if (sSelNode != null)
- {
- string sSel = sSelNode.Text;
- if (LSCommonHelper.OtherHelper.GetLeftName(sSel, ":") == "OID")
- {
- string sLayerName = sSelNode.Parent.Parent.Text;
- int sOID = LSCommonHelper.ConvertHelper.ObjectToInt(
- LSCommonHelper.OtherHelper.GetRightName(sSel, ":"));
- IFeatureClass featureClass = featureWorkspace.OpenFeatureClass(sLayerName);
- IFeature feature = featureClass.GetFeature(sOID);
- feature.Shape = pfea.ShapeCopy;
- feature.Store();
- m_pMapControl.ActiveView.Refresh();
- }
- }
- }
- private TreeNode sSelNode = null;
- private void myTreeView1_MouseDown(object sender, MouseEventArgs e)
- {
- sSelNode = this.myTreeView1.GetNodeAt(e.X, e.Y);
- if (sSelNode == null) return;
- if (e.Button == MouseButtons.Left)
- {//左键
- }
- else
- {
- System.Drawing.Point aPt = new System.Drawing.Point(e.X, e.Y);
- // TreeNode sSelNode = this.myTreeView1.SelectedNode;
- if (sSelNode != null)
- {
- string sSel = sSelNode.Text;
- if (LSCommonHelper.OtherHelper.GetLeftName(sSel, ":") == "OID")
- {
- this.contextMenuStrip1.Show(this.myTreeView1, aPt);
- }
- }
- }
- }
- private void replaceObjectWithCommonAncestorVersionToolStripMenuItem_Click(object sender, EventArgs e)
- {
- replaceObjectWith(featureCommonAncestor, sSelNode);
- }
- private void replaceObjectWithPreReconcileVersionToolStripMenuItem_Click(object sender, EventArgs e)
- {
- replaceObjectWith(featurePreReconcile, sSelNode);
- }
- private void replaceObjectWithConflictsVersionToolStripMenuItem_Click(object sender, EventArgs e)
- {
- replaceObjectWith(featureReconcile, sSelNode);
- }
- private void mergeGeometryToolStripMenuItem_Click(object sender, EventArgs e)
- {
- MergeGeometry(featureCommonAncestor, featurePreReconcile, featureReconcile, sSelNode);
- }
- private void MergeGeometry(IFeature featureCommonAncestor
- , IFeature featurePreReconcile, IFeature featureReconcile,TreeNode pNode)
- {
- pageCon.DeleteAllElements();
- TreeNode sSelNode = this.myTreeView1.SelectedNode;
- if (sSelNode != null)
- {
- string sSel = sSelNode.Text;
- if (LSCommonHelper.OtherHelper.GetLeftName(sSel, ":") == "OID")
- {
- string sLayerName = sSelNode.Parent.Parent.Text;
- int sOID = LSCommonHelper.ConvertHelper.ObjectToInt(
- LSCommonHelper.OtherHelper.GetRightName(sSel, ":"));
- IFeatureClass featureClass = featureWorkspace.OpenFeatureClass(sLayerName);
- // Check to make sure each shape is different than the common ancestor (conflict is on shape field).
- if (IsShapeInConflict(featureCommonAncestor,
- featurePreReconcile, featureReconcile))
- {
- //Console.WriteLine(
- // " Shape attribute has changed on both versions...");
- // Geometries are in conflict ... merge geometries.
- try
- {
- IConstructMerge constructMerge = new
- GeometryEnvironmentClass();
- IGeometry newGeometry =
- constructMerge.MergeGeometries
- (featureCommonAncestor.ShapeCopy,
- featureReconcile.ShapeCopy,
- featurePreReconcile.ShapeCopy);
- // Setting new geometry as a merge between the two versions.
- IFeature feature = featureClass.GetFeature(sOID);
- feature.Shape = newGeometry;
- feature.Store();
- //updateUpdates.RemoveList(1, ref oid);
- //conflictsRemoved = true;
- }
- catch (System.Runtime.InteropServices.COMException comExc)
- {
- // Check if the error is from overlapping edits.
- if (comExc.ErrorCode == (int)
- fdoError.FDO_E_WORKSPACE_EXTENSION_DATASET_CREATE_FAILED || comExc.ErrorCode == (int)fdoError.FDO_E_WORKSPACE_EXTENSION_DATASET_DELETE_FAILED)
- {
- // Edited areas overlap.
- LSCommonHelper.MessageBoxHelper.ShowMessageBox(
- "Error from overlapping edits on feature {0}"+
- " Can't merge overlapping edits to same feature.");
- }
- else
- {
- // Unexpected COM exception, throw this to the exception handler.
- throw comExc;
- }
- }
- }
- }
- }
- }
- }
- }
相关代码下载地址,下载完毕后,请使用kuaiya解压即可,WINRAR不行
ArcGIS Engine开发的ArcGIS 版本管理的功能的更多相关文章
- ArcGIS Engine开发鹰眼图的功能(代码优化篇)
在上一篇,ArcGIS Engine开发鹰眼图的功能(基础篇) 上一篇的实现效果图如下, 如果仔细观察,会发现一个问题,即在“鹰眼”的区域,只要在红色线框内的注记会被覆盖. 如果红色框包括整张图的话, ...
- ArcGIS Engine开发鹰眼图的功能(基础篇)
鹰眼是用于调节全视域范围内主地图显示范围情况的副地图.它体现了地图整体与详细局部的关系. 用户可以通过鼠标单击或者画框等动作实现鹰眼与主地图的交互情况. 鹰眼功能的原理是通过主地图窗口的地图控件和鹰眼 ...
- ArcGIS Engine开发之地图基本操作(4)
ArcGIS Engine开发中数据库的加载 1.加载个人地理数据库数据 个人地理数据库(Personal Geodatabase)使用Miscrosoft Access文件(*.mdb)进行空间数据 ...
- ArcGIS Engine开发前基础知识(3)
对象模型图 一.对象模型图中的类与接口 ArcGIS Engine 提供大量的对象,这些对象之间存在各种各样的关系,如继承.组合.关联等.对象模型图(Object model diagram,ODM) ...
- ArcGIS Engine开发前基础知识(2)
ArcGIS基本控件简介 ArcGIS Engine控件是一组可视化的开发组件,每个ArcGIS Engine控件都是一个COM组件.这些组件包括MapControl,PageLayoutContro ...
- C#,ArcGIS Engine开发入门教程
C#,ArcGIS Engine开发入门教程 转自:http://blog.csdn.net/yanleigis/article/details/2233674 目录(?)[+] 五实现 一 加载A ...
- ArcGIS Engine开发基础总结(一)
标准Engine功能 地图浏览 地图制作 数据查询 数据分析 及 所有的开发控件 —MapControl, PageLayout, Toolbar, TOC, ArcReader 对所有矢量和栅 ...
- ArcGIS Engine开发前基础知识(4)
ArcGIS不同开发方式的比较 关于GIS应用软件的开发,通常有三种方式:C/S架构.网络GIS和移动GIS.ArcGIS平台提供了对三种开发方式的支持,对于采用从C/S架构的大多数开发者来讲,首先想 ...
- ArcGIS Engine开发前基础知识(1)
ArcGIS二次开发是当前gis领域的一项重要必不可少的技能.下面介绍它的基本功能 一.ArcGIS Engine功能 在使用之前首先安装和部署arcgis sdk,(在这里不在赘述相关知识)可以实现 ...
随机推荐
- ural 1222. Chernobyl’ Eagles
1222. Chernobyl’ Eagles Time limit: 1.0 secondMemory limit: 64 MB A Chernobyl’ eagle has several hea ...
- ZOJ 3910 Market ZOJ Monthly, October 2015 - H
Market Time Limit: 2 Seconds Memory Limit: 65536 KB There's a fruit market in Byteland. The sal ...
- BZOJ2773 : ispiti
首先询问i相当于询问a[j]>=a[i],b[j]>=b[i]的j 如果b[j]==b[i],那么a[j]>a[i],这种情况先用set处理掉 如果b[j]>b[i],那么a[ ...
- BZOJ3833 : [Poi2014]Solar lamps
首先旋转坐标系,将范围表示成矩形或者射线 如果范围是一条线,则将灯按y坐标排序,y坐标相同的按x坐标排序, 对于y相同的灯,f[i]=min(i,它前面灯发光时刻的第k[i]小值), 线段树维护,$O ...
- centos 安装网络错误
yum install vnc-server 提示安装成功 rpm -q vnc-server 返回 package vnc-server is not installed 然而再重新安装时 yu ...
- jQuery Select操作大集合
jQuery获取Select选择的Text和Value: 语法解释: $("#select_id").change(function(){//code...}); //为S ...
- c++ stack 的使用
(1) stack::empty bool empty ( ) const; 判断是否为空. return Value : true if the container size is 0, false ...
- Linux下MySQL的备份与还原
Linux下MySQL的备份与还原 1. 备份 [root@localhost ~]# cd /var/lib/mysql (进入到MySQL库目录,根据自己的MySQL的安装情况调整目录) [roo ...
- ASP.NET中Url重写后,打不开真正的Html页面
不对IIS配置.html的映射,IIS站点目录下.html页面都能显示.当配置了.html的映射 IIS站点目录下真实存在的.html页面无法显示,错误信息:“页面无法显示”解决方法:1.首先照旧在网 ...
- FLTK 1.3.3 MinGW 4.9.1 Configuration 配置
Download FLTK 1.3.3 Download CMake 3.2.0 Start CMake 3.2.0, fill the source and destination: source: ...