Ejemplo n.º 1
0
        /// <summary>
        /// 拾取2D几何曲线
        /// </summary>
        /// <param name="P"></param>
        /// <param name="data"></param>
        private void Snap_Geo2DEntity(WPoint2D P, RenderData data)
        {
            Geo2D_Entities.Clear();
            Geo2D_Temp.Clear();
            try
            {
                if (data.Entities.Count == 0 || data.Entities == null)
                {
                    return;
                }
            } catch { }
            ///////

            for (int i = 0; i < data.Entities.Count; i++)
            {
                if (!(data.Entities[i] is WCurve2D))
                {
                    continue;
                }
                if (((WCurve2D)data.Entities[i]).Contains(P, 2f) == true)
                {
                    Geo2D_Temp.Add(i);
                }
            }
            if (Geo2D_Temp.Count == 0)
            {
                return;
            }
            /////
            NumMin = Geo2D_Temp[0];
            DisMin = double.MaxValue;
            Diss   = new double[Geo2D_Temp.Count];
            for (int i = 0; i < Geo2D_Temp.Count; i++)
            {
                Dis     = ((WCurve2D)(data.Entities[Geo2D_Temp[i]])).GetDistance(P);
                Diss[i] = Dis;
                if (Dis < DisMin)
                {
                    DisMin = Dis;
                    NumMin = Geo2D_Temp[i];
                }
            }
            Geo2D_Entities.Add(NumMin);
        }
Ejemplo n.º 2
0
 public void Snap(RenderData data, WPoint2D P, List <SnapMode> Modes)
 {
     if (data == null)
     {
         Geo2D_Entities.Clear();
         return;
     }
     if (Modes.Contains(SnapMode.Geo2DEntity))
     {
         Snap_Geo2DEntity(P, data);
     }
     if (Modes.Contains(SnapMode.Geo2DRim))
     {
         Snap_Geo2DRim(P, data);
     }
     if (Modes.Contains(SnapMode.Geo2DPoint))
     {
         Snap_Geo2DPoint(P, data);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MeshRenderer" /> class.
        /// </summary>
        public MeshRenderer(RenderData data, RenderParameter renderColors)
        {
            this.data         = data;
            this.renderColors = renderColors;

            int featureCount = data.Points.Length;

            if (data.MeshEdges != null)
            {
                featureCount += data.MeshEdges.Length;
            }
            else if (data.Triangles != null)
            {
                featureCount += 2 * data.Triangles.Length;
            }

            this.ignoreBounds = featureCount < 1000;

            if (data.Triangles != null && data.NumberOfRegions > 0)
            {
                renderColors.MakeRegionMap(data.TrianglePartition, data.NumberOfRegions);
            }
        }
Ejemplo n.º 4
0
 public WMeshRenderer(ref RenderData data)
 {
     this.data = data;
 }
Ejemplo n.º 5
0
 public void SetData(RenderData data)
 {
     renderer.SetData(data);
 }
Ejemplo n.º 6
0
 public WGeoRimRenderer(RenderData data)
 {
     this.data = data;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VoronoiRenderer" /> class.
 /// </summary>
 public VoronoiRenderer(RenderData data)
 {
     this.data = data;
 }