// Create an line graphics object ---- an line object created from an object broken apart with the To Graphics command. GraphicsLineSymbol CreateLineGraphicsObject(OcadObject obj, GraphicsSymDef symdef) { if (obj.coords == null || obj.coords.Length < 2) return null; SymPath path = CreateSymPath(obj.coords); LineStyle lineStyle = ImportLineStyle(obj.DiamFlags); return new GraphicsLineSymbol(symdef, path, GetColor((int) obj.Col), ToWorldDimensions(obj.LineWidth), lineStyle); }
// Create an area graphics object ---- an area object created from an object broken apart with the To Graphics command. GraphicsAreaSymbol CreateAreaGraphicsObject(OcadObject obj, GraphicsSymDef symdef) { SymPathWithHoles path = CreateAreaSymPath(obj.coords); return new GraphicsAreaSymbol(symdef, path, GetColor((int) obj.Col)); }
public GraphicsLineSymbol(GraphicsSymDef def, SymPath path, SymColor lineColor, float thickness, LineStyle lineStyle) { this.def = def; this.path = path; this.lineColor = lineColor; this.thickness = thickness; this.lineStyle = lineStyle; boundingBox = path.BoundingBox; boundingBox.Inflate(thickness / 2, thickness / 2); }
// Get the one and only graphics symdef for this map. Used for graphics objects -- created with OCAD To Graphics command. GraphicsSymDef GetGraphicsSymDef() { if (graphicsSymDef == null) { graphicsSymDef = new GraphicsSymDef(); map.AddSymdef(graphicsSymDef); } return graphicsSymDef; }
public GraphicsAreaSymbol(GraphicsSymDef def, SymPathWithHoles path, SymColor fillColor) { this.def = def; this.path = path; this.fillColor = fillColor; boundingBox = path.BoundingBox; }