public ChartCommonSeriesSettingsPointBuilder Symbol(PointSymbol value) { base.Options["symbol"] = value; return(this); }
private void AddPoints(PointPairList points, Color color, float size, bool labeled, PointSymbol pointSymbol, bool selected = false) { var symbolType = PointSymbolToSymbolType(pointSymbol); LineItem lineItem; if (HasOutline(pointSymbol)) { lineItem = new LineItem(null, points, Color.Black, symbolType) { Line = { IsVisible = false }, Symbol = { Border = { IsVisible = false }, Fill = new Fill(color), Size = size, IsAntiAlias = true } }; } else { lineItem = new LineItem(null, points, Color.Black, symbolType) { Line = { IsVisible = false }, Symbol = { Border = { IsVisible = true, Color = color }, Size = size, IsAntiAlias = true } }; } if (labeled) { foreach (var point in points) { var label = CreateLabel(point, color, size); _labeledPoints.Add(new LabeledPoint(point, label, selected)); zedGraphControl.GraphPane.GraphObjList.Add(label); } } _points.Add(lineItem); zedGraphControl.GraphPane.CurveList.Add(lineItem); }
public PointSymbolStringPair(PointSymbol pointSymbol, string displayString) { PointSymbol = pointSymbol; DisplayString = displayString; }
public ChartSeriesPointBuilder Symbol(PointSymbol value) { base.Options["symbol"] = value; return(this); }
protected override void AddToMap(Map map, SymDef symdef) { PointSymbol sym = new PointSymbol((PointSymDef)symdef, location, orientation, CircleGap.StartsAndStops(gaps)); map.AddSymbol(sym); }
public void DrawSymbol(Symbol symbol, RectangleF rect) { PointSymDef symdef; Pair<object, Symbol> key = new Pair<object, Symbol>(this, symbol); // The dictionary is used to contains symdefs for each symbol. if (dict.ContainsKey(key)) { symdef = (PointSymDef) dict[key]; } else { symdef = symbol.CreateSymdef(map, color, Geometry.TransformDistance(rect.Height, currentTransform)); dict[key] = symdef; } PointSymbol sym = new PointSymbol(symdef, Geometry.TransformPoint(new PointF(rect.X + rect.Width / 2, rect.Y + rect.Height / 2), currentTransform), 0, null); map.AddSymbol(sym); }
public static void PreparePointSymbol(IPaintTo3D paintTo3D, PointSymbol symbol) { int offset = 0; if (paintTo3D.UseLineWidth) { offset = 6; // so wird gesteuert dass bei nur dünn die dünnen Punkte und bei } // mit Linienstärke ggf. die dicken Punkte angezeigt werden (Forderung PFOCAD) Bitmap bmp = null; switch ((GeoObject.PointSymbol)((int)symbol & 0x07)) { case CADability.GeoObject.PointSymbol.Empty: bmp = null; break; case CADability.GeoObject.PointSymbol.Dot: { bmp = BitmapList[0 + offset]; } break; case CADability.GeoObject.PointSymbol.Plus: { bmp = BitmapList[1 + offset]; } break; case CADability.GeoObject.PointSymbol.Cross: { bmp = BitmapList[2 + offset]; } break; case CADability.GeoObject.PointSymbol.Line: { bmp = BitmapList[3 + offset]; } break; } if (bmp != null) { paintTo3D.PrepareIcon(bmp); } bmp = null; if ((symbol & CADability.GeoObject.PointSymbol.Circle) != 0) { bmp = BitmapList[5 + offset]; } if ((symbol & CADability.GeoObject.PointSymbol.Square) != 0) { bmp = BitmapList[4 + offset]; } if ((symbol & CADability.GeoObject.PointSymbol.Select) != 0) { bmp = BitmapList[12]; } if (bmp != null) { paintTo3D.PrepareIcon(bmp); } }
public static extern int imaqOverlayPoints(IntPtr image, ref Point points, int numPoints, ref RGBValue colors, int numColors, PointSymbol symbol, ref UserPointSymbol userSymbol, [MarshalAs(UnmanagedType.LPStr)] string group);
bool _ReadOnly = false; //图层是否可编辑 #endregion #region 构造函数 /// <summary> /// 静态构造函数 /// </summary> /// <param name="name">图层名称</param> /// <param name="geoType">图层类型</param> /// <returns>已初始化的图层,类型不对则返回null</returns> public static Layer CreateLayer(string name, Type geoType, string filePath) { if (geoType == typeof(PointD) || geoType == typeof(MultiPolyLine) || geoType == typeof(MultiPolygon)) { Layer sLayer = new Layer(); sLayer._FilePath = filePath; sLayer._DT = new DataTable(name); sLayer._GeoType = geoType; sLayer._Node = new TreeNode(name); sLayer._Node.Tag = sLayer; //Tag设置成layer sLayer._Node.Checked = true; //加入ID列 DataColumn mID = new DataColumn(__ID_COLUMN_NAME, typeof(int)); mID.Unique = true; mID.AllowDBNull = false; mID.AutoIncrementSeed = 1; mID.AutoIncrement = true; sLayer._DT.Columns.Add(mID); //加入要素列,存地理坐标 DataColumn mGeoData = new DataColumn(__GEO_COLUMN_NAME, geoType); mGeoData.AllowDBNull = true; sLayer._DT.Columns.Add(mGeoData); //加入要素列,存投影坐标 DataColumn mPrjData = new DataColumn(__PRJ_COLUMN_NAME, geoType); mPrjData.AllowDBNull = true; sLayer._DT.Columns.Add(mPrjData); //加入要素列,存储注记位置 DataColumn mTextLabeldData = new DataColumn(__TEXT_LABEL_COLUMN_NAME, typeof(PointD)); mTextLabeldData.AllowDBNull = true; mTextLabeldData.DefaultValue = null; sLayer._DT.Columns.Add(mTextLabeldData); if (geoType == typeof(PointD)) { Symbol symbol = new PointSymbol(PointSymbol.PointStyleConstant.FillCircle, 4, Color.Black); sLayer._SimpleRenderer = new SimpleRenderer(symbol); } else if (geoType == typeof(MultiPolyLine)) { Symbol symbol = new LineSymbol(DashStyle.Solid, 2, Color.Black); sLayer._SimpleRenderer = new SimpleRenderer(symbol); } else { LineSymbol outlineSymbol = new LineSymbol(DashStyle.Solid, 1, Color.Black); Symbol symbol = new PolygonSymbol(Color.Red, outlineSymbol); sLayer._SimpleRenderer = new SimpleRenderer(symbol); } sLayer._Renderer = sLayer._SimpleRenderer; //设置默认Renderer sLayer._UniqueValueRenderer = new UniqueValueRenderer(sLayer); sLayer._ClassBreakRenderer = new ClassBreakRenderer(sLayer); sLayer._TextLabel = new TextSymbol(sLayer); return(sLayer); } else { return(null); } }
/// <summary> /// Asserts the point style. /// </summary> /// <param name="pointStyle">The <see cref="PointStyle"/>to assert.</param> /// <param name="color">The expected <see cref="Color"/>.</param> /// <param name="width">The expected width of the point.</param> /// <param name="symbol">The expected <see cref="PointSymbol"/>.</param> /// <exception cref="AssertionException">Thrown when one of the parameters /// doesn't have the expected corresponding value.</exception> public static void AssertEqualStyle(PointStyle pointStyle, Color color, int width, PointSymbol symbol) { Assert.AreEqual(color, pointStyle.Color); Assert.AreEqual(width, pointStyle.Size); Assert.AreEqual(symbol, pointStyle.Symbol); }
void IPaintTo3D.PreparePointSymbol(PointSymbol pointSymbol) { }
void IPaintTo3D.Points(GeoPoint[] points, float size, PointSymbol pointSymbol) { }
public static extern int imaqOverlayROI(IntPtr image, ref ROI roi, PointSymbol symbol, ref UserPointSymbol userSymbol, [MarshalAs(UnmanagedType.LPStr)] string group);
private bool HasOutline(PointSymbol pointSymbol) { return(pointSymbol == PointSymbol.Circle || pointSymbol == PointSymbol.Square || pointSymbol == PointSymbol.Triangle || pointSymbol == PointSymbol.TriangleDown || pointSymbol == PointSymbol.Diamond); }
public bool RequireClone() { return((LineSymbol != null && LineSymbol.RequireClone()) || (PointSymbol != null && PointSymbol.RequireClone())); }
// Test for rendering into a map. // Render one course object to a map. internal Map RenderSymbolToMap(Symbol sym, float boxSize) { Map map = new Map(new GDIPlus_TextMetrics(), null); using (map.Write()) { //Dictionary<object, SymDef> dict = new Dictionary<object, SymDef>(); SymColor symColor = map.AddColor("Purple", 11, 0.045F, 0.59F, 0, 0.255F, false); PointSymDef symdef = sym.CreateSymdef(map, symColor, boxSize); PointSymbol symbol = new PointSymbol(symdef, new PointF(0,0), 0, null); map.AddSymbol(symbol); } return map; }
private static BaseSymbol GetSymbolFromType(int objectType, byte symType) { BaseSymbol bs = null; switch (objectType) { case 1: bs = new PointSymbol(); break; case 2: if (symType == 0x01) bs = new LineTextSymbol(); else bs = new LineSymbol(); break; case 3: bs = new AreaSymbol(); break; case 4: bs = new TextSymbol(); break; case 5: bs = new RectangleSymbol(); break; default: throw new ApplicationException("Unknown objectType: " + objectType); } return bs; }