10楼#
发布于:2005-03-08 19:03
ShowAllVertex需要在MapControl的AfterDraw来做
|
|
11楼#
发布于:2005-03-09 16:08
yeah!!谢了 关于这个问题 我估计以后大家都好办了 谢谢楼上的 谢谢斑竹<img src="images/post/smile/dvbbs/em04.gif" />
|
|
12楼#
发布于:2005-03-10 12:17
但是在AfterDraw中显示出节点以后,每次编辑,选中的图形都会闪好多次,为什么呢?
|
|
|
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编辑过]
|
|
|
上一页
下一页