xxwwdd
路人甲
路人甲
  • 注册日期2003-08-19
  • 发帖数88
  • QQ
  • 铜币230枚
  • 威望0点
  • 贡献值0点
  • 银元0个
10楼#
发布于:2005-03-08 19:03
ShowAllVertex需要在MapControl的AfterDraw来做
举报 回复(0) 喜欢(0)     评分
ziliujiang
路人甲
路人甲
  • 注册日期2004-08-11
  • 发帖数15
  • QQ
  • 铜币158枚
  • 威望0点
  • 贡献值0点
  • 银元0个
11楼#
发布于:2005-03-09 16:08
yeah!!谢了 关于这个问题 我估计以后大家都好办了 谢谢楼上的 谢谢斑竹<img src="images/post/smile/dvbbs/em04.gif" />
举报 回复(0) 喜欢(0)     评分
万里云
路人甲
路人甲
  • 注册日期2005-01-14
  • 发帖数114
  • QQ
  • 铜币414枚
  • 威望0点
  • 贡献值0点
  • 银元0个
12楼#
发布于:2005-03-10 12:17
但是在AfterDraw中显示出节点以后,每次编辑,选中的图形都会闪好多次,为什么呢?
女口果人尔能看日月白这段言舌,那言兑日月人尔白勺目艮目青有严重白勺散光 
举报 回复(0) 喜欢(0)     评分
waterblue
路人甲
路人甲
  • 注册日期2004-09-02
  • 发帖数72
  • QQ
  • 铜币387枚
  • 威望0点
  • 贡献值0点
  • 银元0个
13楼#
发布于:2005-03-10 15:57
<P>Modify Polygon</P>
<P>这是两个编辑Polygon的例子,一个是编辑顶点,一个是编辑线段。</P>
<P>请问怎么样做到象arcmap里面那么爽的编辑节点效果,请指点一二或谈一下心得体会</P>
<P>
modifyOneVertexOfAPolygon shows how to modify a polygon vertex using Hittest.</P>
<P>modifyOneSegmentOfAPolygon shows how to modify a polygon segment using Hittest.</P>
<P>'*************************************************************************
'* NAME: modifyOneVertexOfAPolygon
'* DESCRIPTION: Modify a vertex of a multipart polygon using hittest to identify the vertex,
'* move it and set the point back in the polygon.'* NOTE:
'*************************************************************************
Sub modifyOneVertexOfAPolygon()
Dim pPolColl As IGeometryCollection, pPol As IPolygon, pHitTest As IHitTest, pTrans2D As ITransform2D, pPathColl As IPointCollection
Dim pqpt As IPoint, dr As Double, pHit As IPoint, dht As Double, lPart As Long, lVertex As Long, bright As Boolean
Set pPolColl = FunctionCreateMultiPartPolygonViaIGeometryCollection 'Here the polygon to be modified
Set pPol = pPolColl
Set pHitTest = pPolColl
Set pqpt = pPol.FromPoint 'This could be an user input point (Ex: Mouse click etc.)
dr = 1
Set pHit = New esriGeometry.Point 'Create the output point
pHitTest.HitTest pqpt, dr, esriGeometryPartVertex, pHit, dht, lPart, lVertex, bright
Set pPathColl = pPolColl.Geometry(lPart) 'Get the ring where the point is
Set pTrans2D = pPathColl.Point(lVertex)
'Get the vertex that got hit
pTrans2D.Move -10, 0 'Move the point
pPathColl.UpdatePoint lVertex, pTrans2D 'Update the point via IPointCollection
pPolColl.GeometriesChanged 'To let the polygon knows its geometry changed'User should call ITopologicalOperator::Simplify at this pointEnd Sub
End Sub</P>
<P>'*************************************************************************
'* NAME: modifyOneSegmentOfAPolygon()
'* DESCRIPTION: Modify a segment of a multipart polygon using hittest to identify the segment and
'* move it.'* NOTE: '*************************************************************************
Sub modifyOneSegmentOfAPolygon()</P>
<P>
Dim pPolColl As IGeometryCollection, pPol As IPolyline, pHitTest As IHitTest, pTrans2D As ITransform2D, pPathColl As ISegmentCollection
Dim pqpt As IPoint, dr As Double, pHit As IPoint, dht As Double, lPart As Long, lSeg As Long, bright As Boolean
Set pPolColl = FunctionCreateMultiPartPolygonViaIGeometryCollection 'Here the polygon to be modified
Set pPol = pPolColl
Set pHitTest = pPolColl
Set pqpt = pPol.FromPoint 'This could be an user input point (Ex: Mouse click etc.)
dr = 1
Set pHit = New esriGeometry.Point
pHitTest.HitTest pqpt, dr, esriGeometryPartBoundary, pHit, dht, lPart, lSeg, bright
Set pPathColl = pPolColl.Geometry(lPart) 'Get the ring where the point is
Set pTrans2D = pPathColl.Segment(lSeg) 'Get the segment that got hit
pTrans2D.Move -10, 0
'In this case the segment doesn't have to be set back in the geometry, since the segment'was returned by reference by pPathColl.Segment(lSeg)
pPolColl.GeometriesChanged 'To let the polygon knows its geometry changed'User should call ITopologicalOperator::Simplify at this pointEnd Sub</P>
<P>End Sub
</P>


[此贴子已经被作者于2005-3-10 16:04:31编辑过]
http://www.geostar.com.cn(吉奥 公司) http://www.waterblue.com.cn(水之灵,蓝之静 个人)
举报 回复(0) 喜欢(0)     评分
上一页 下一页
游客

返回顶部