本文整理汇总了C#中PolylineClass.SegmentsChanged方法的典型用法代码示例。如果您正苦于以下问题:C# PolylineClass.SegmentsChanged方法的具体用法?C# PolylineClass.SegmentsChanged怎么用?C# PolylineClass.SegmentsChanged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolylineClass
的用法示例。
在下文中一共展示了PolylineClass.SegmentsChanged方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMouseDown
public override void OnMouseDown(int Button, int Shift, int X, int Y)
{
// �Ҽ�����
if (Button == 2) return;
if (m_pDongshiFeatureLayer == null)
return;
m_pPoint = m_hookHelper.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
m_pPoint = GIS.GraphicEdit.SnapSetting.getSnapPoint(m_pPoint);
double angle = -1;
string layerName = LayerNames.LAYER_ALIAS_MR_TUNNEL_FD; //���
pFeatLayer = drawSpecialCom.GetFeatureLayerByName(layerName);
IFeature pFeature = null;
TestExistPointFeature(m_hookHelper, m_pPoint, pFeatLayer, ref pFeature);
if (pFeature == null)
{
MessageBox.Show(@"�������û�����������ѡ��һ���������", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
//IPoint hightPoint= Snapping(m_pPoint, pFeatLayer, pFeature);
//if (hightPoint.IsEmpty)
//{
// MessageBox.Show("��ȡ����߽�ʧ�ܣ�������ѡ��", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return;
//}
IProximityOperator proximityOperator = (IProximityOperator)pFeature.Shape;
IPoint mousePoint = proximityOperator.ReturnNearestPoint(m_pPoint, esriSegmentExtension.esriNoExtension);
IProximityOperator proximityOperator2 = (IProximityOperator)mousePoint;
ISegmentCollection segmentCollection = (ISegmentCollection)pFeature.Shape;
for (int i = 0; i < segmentCollection.SegmentCount; i++)
{
ISegmentCollection geometryCollection = new PolylineClass();
ISegment segment = segmentCollection.get_Segment(i);
geometryCollection.AddSegment(segment);
geometryCollection.SegmentsChanged();
var distance = proximityOperator2.ReturnDistance((IGeometry)geometryCollection);
if (distance < 0.0001)
{
angle = ((ILine)segment).Angle;
break;
}
}
if (angle == -1)
{
MessageBox.Show(@"��ȡ����߽�ʧ�ܣ�������ѡ��", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
//�õ���Ӧ������
string hdid = pFeature.get_Value(pFeature.Fields.FindField(GIS_Const.FIELD_HDID)).ToString();
string bid = pFeature.get_Value(pFeature.Fields.FindField(GIS_Const.FIELD_BID)).ToString();
FormCaveSizeInput frmCaveSize = new FormCaveSizeInput();
frmCaveSize.ShowDialog();
if (frmCaveSize.DialogResult == DialogResult.OK)
{
//������ȷ��������ҵij��Ϳ�
double Width = frmCaveSize.CaveWidth;
double Height = frmCaveSize.CaveHeight;
PointClass p0 = RectanglePoint(mousePoint, angle, Width);
PointClass p1 = RectanglePoint(mousePoint, angle + Math.PI, Width);
PointClass p2 = RectanglePoint2(p0, angle + 90 * Math.PI / 180, Height);
PointClass p3 = RectanglePoint2(p1, angle + 90 * Math.PI / 180, Height);
//��������
CreateDongShi(p0, p2, p3, p1, hdid, bid);
}
}