/// <summary> /// Creates a default axis style. /// </summary> public AxisLineStyle(bool showTicks, CSAxisSide preferredTickSide, Main.Properties.IReadOnlyPropertyBag context) { double penWidth = GraphDocument.GetDefaultPenWidth(context); double majorTickLength = GraphDocument.GetDefaultMajorTickLength(context); var color = GraphDocument.GetDefaultForeColor(context); _axisPen = new PenX3D(color, penWidth); _majorTickPen = new PenX3D(color, penWidth); _minorTickPen = new PenX3D(color, penWidth); _majorTickLength = majorTickLength; _minorTickLength = majorTickLength / 2; if (showTicks) { _showFirstUpMajorTicks = preferredTickSide == CSAxisSide.FirstUp; _showFirstDownMajorTicks = preferredTickSide == CSAxisSide.FirstDown; _showSecondUpMajorTicks = preferredTickSide == CSAxisSide.SecondUp; _showSecondDownMajorTicks = preferredTickSide == CSAxisSide.SecondDown; _showFirstUpMinorTicks = preferredTickSide == CSAxisSide.FirstUp; _showFirstDownMinorTicks = preferredTickSide == CSAxisSide.FirstDown; _showSecondUpMinorTicks = preferredTickSide == CSAxisSide.SecondUp; _showSecondDownMinorTicks = preferredTickSide == CSAxisSide.SecondDown; } }
private void EhDashStartCap_SelectionChangeCommitted(object sender, EventArgs e) { if (_pen != null) { var cap = _cbDashStartCap.SelectedLineCap; if (null != cap) { if (_userChangedAbsDashStartCapSize && _cbDashStartCapAbsSize != null) { cap = cap.WithMinimumAbsoluteAndRelativeSize(_cbDashStartCapAbsSize.SelectedQuantityAsValueInPoints, cap.MinimumRelativeSize); } if (_userChangedRelDashStartCapSize && _cbDashStartCapRelSize != null) { cap = cap.WithMinimumAbsoluteAndRelativeSize(cap.MinimumAbsoluteSizePt, _cbDashStartCapRelSize.SelectedQuantityAsValueInSIUnits); } } _pen = _pen.WithDashStartCap(cap); if (_cbDashStartCapAbsSize != null && cap != null) { var oldValue = _userChangedAbsDashStartCapSize; _cbDashStartCapAbsSize.SelectedQuantityAsValueInPoints = cap.MinimumAbsoluteSizePt; _userChangedAbsDashStartCapSize = oldValue; } if (_cbDashStartCapRelSize != null && cap != null) { var oldValue = _userChangedRelDashStartCapSize; _cbDashStartCapRelSize.SelectedQuantityAsValueInSIUnits = cap.MinimumRelativeSize; _userChangedRelDashStartCapSize = oldValue; } OnPenChanged(); } }
public static void DrawLine(PositionNormalIndexedTriangleBuffers buffers, PenX3D pen, PointD3D p0, PointD3D p1) { var vertexIndexOffset = buffers.IndexedTriangleBuffer.VertexCount; if (null != buffers.PositionNormalIndexedTriangleBuffer) { var buf = buffers.PositionNormalIndexedTriangleBuffer; /* if (pen.Color.Name == "Beige") { */ var solid = new SolidStraightLine(); solid.AddGeometry( (position, normal) => buf.AddTriangleVertex(position.X, position.Y, position.Z, normal.X, normal.Y, normal.Z), (i0, i1, i2, isLeft) => buf.AddTriangleIndices(i0, i1, i2, isLeft), ref vertexIndexOffset, pen, new LineD3D(p0, p1)); /* } else { var polylinePoints = new[] { p0, p1 }; SolidPolyline.AddWithNormals( (position, normal) => buf.AddTriangleVertex(position.X, position.Y, position.Z, normal.X, normal.Y, normal.Z), (i0, i1, i2) => buf.AddTriangleIndices(i0, i1, i2), ref vertexIndexOffset, pen, polylinePoints); } */ } else if (null != buffers.PositionNormalColorIndexedTriangleBuffer) { var polylinePoints = new[] { p0, p1 }; var buf = buffers.PositionNormalColorIndexedTriangleBuffer; var color = pen.Color.Color; var r = color.ScR; var g = color.ScG; var b = color.ScB; var a = color.ScA; var solidPolyline = new SolidPolyline(); solidPolyline.AddWithNormals( (position, normal) => buf.AddTriangleVertex(position.X, position.Y, position.Z, normal.X, normal.Y, normal.Z, r, g, b, a), (i0, i1, i2, isLeftCOS) => buf.AddTriangleIndices(i0, i1, i2, isLeftCOS), ref vertexIndexOffset, pen, polylinePoints); } else if (null != buffers.PositionNormalUVIndexedTriangleBuffer) { throw new NotImplementedException("Texture on a line is not supported yet"); } else { throw new NotImplementedException("Unexpected type of buffer: " + buffers.IndexedTriangleBuffer.GetType().ToString()); } }
public void CopyFrom(LinePlotStyle from, Main.EventFiring eventFiring) { if (object.ReferenceEquals(this, from)) { return; } using (var suspendToken = SuspendGetToken()) { _independentSkipFreq = from._independentSkipFreq; _skipFreq = from._skipFreq; _ignoreMissingDataPoints = from._ignoreMissingDataPoints; _connectCircular = from._connectCircular; Connection = from._connectionStyle; // beachte links nur Connection, damit das Template mit gesetzt wird _linePen = from._linePen; // immutable _independentDashStyle = from._independentDashStyle; _independentColor = from._independentColor; _independentSymbolSize = from._independentSymbolSize; _symbolSize = from._symbolSize; _useSymbolGap = from._useSymbolGap; _symbolGapOffset = from._symbolGapOffset; _symbolGapFactor = from._symbolGapFactor; _keepWestNorthThroughSymbolGap = from._keepWestNorthThroughSymbolGap; EhSelfChanged(); suspendToken.Resume(eventFiring); } }
public LinePlotStyle(Altaxo.Main.Properties.IReadOnlyPropertyBag context) { var penWidth = GraphDocument.GetDefaultPenWidth(context); var color = GraphDocument.GetDefaultPlotColor(context); _linePen = new PenX3D(color, penWidth).WithLineJoin(PenLineJoin.Bevel); _connectionStyle = new LineConnectionStyles.StraightConnection(); }
public virtual void DrawLine(PenX3D pen, IPolylineD3D path) { var asStraightLine = path as StraightLineAsPolylineD3D; if (null != asStraightLine) { DrawLine(pen, asStraightLine.GetPoint(0), asStraightLine.GetPoint(1)); return; } else if (path.Count == 2) { DrawLine(pen, path.GetPoint(0), path.GetPoint(1)); return; } //var line = new SolidPolyline(pen.CrossSection, asSweepPath.Points); var buffers = GetPositionNormalIndexedTriangleBuffer(pen.Material); var offset = buffers.IndexedTriangleBuffer.VertexCount; if (null != buffers.PositionNormalIndexedTriangleBuffer) { var buf = buffers.PositionNormalIndexedTriangleBuffer; var solidPolyline = new SolidPolyline(); solidPolyline.AddWithNormals( (position, normal) => buf.AddTriangleVertex(position.X, position.Y, position.Z, normal.X, normal.Y, normal.Z), (i0, i1, i2, isLeftCos) => buf.AddTriangleIndices(i0, i1, i2, isLeftCos), ref offset, pen, path.Points); } else if (null != buffers.PositionNormalColorIndexedTriangleBuffer) { var buf = buffers.PositionNormalColorIndexedTriangleBuffer; var color = pen.Color.Color; var r = color.ScR; var g = color.ScG; var b = color.ScB; var a = color.ScA; var solidPolyline = new SolidPolyline(); solidPolyline.AddWithNormals( (position, normal) => buf.AddTriangleVertex(position.X, position.Y, position.Z, normal.X, normal.Y, normal.Z, r, g, b, a), (i0, i1, i2, isLeftCos) => buf.AddTriangleIndices(i0, i1, i2, isLeftCos), ref offset, pen, path.Points); } else if (null != buffers.PositionNormalUVIndexedTriangleBuffer) { throw new NotImplementedException("Texture on a line is not supported yet"); } else { throw new NotImplementedException("Unexpected type of buffer: " + buffers.IndexedTriangleBuffer.GetType().ToString()); } return; }
private void EhLineJoin_SelectionChangeCommitted(object sender, EventArgs e) { if (_pen != null) { _pen = _pen.WithLineJoin(_cbLineJoin.SelectedLineJoin); OnPenChanged(); } }
private void EhMiterLimit_SelectionChangeCommitted(object sender, DependencyPropertyChangedEventArgs e) { if (_pen != null) { _pen = _pen.WithMiterLimit(_cbMiterLimit.SelectedQuantityInSIUnits); OnPenChanged(); } }
public ColorTypeThicknessPenController(PenX3D doc) { if (doc == null) { throw new ArgumentNullException("doc"); } _doc = doc; _tempDoc = _doc; }
/// <summary> /// Template to make a line draw. /// </summary> /// <param name="g">Graphics context.</param> /// <param name="pdata">The plot data. Don't use the Range property of the pdata, since it is overriden by the next argument.</param> /// <param name="range">The plot range to use.</param> /// <param name="layer">Graphics layer.</param> /// <param name="pen">The pen to draw the line.</param> /// <param name="symbolGap">The size of the symbol gap. Argument is the original index of the data. The return value is the absolute symbol gap at this index. /// This function is null if no symbol gap is required.</param> /// <param name="skipFrequency">Skip frequency. Normally 1, thus all gaps are taken into account. If 2, only every 2nd gap is taken into account, and so on.</param> /// <param name="connectCircular">If true, the end of the line is connected with the start of the line.</param> public abstract void Paint( IGraphicsContext3D g, Processed3DPlotData pdata, PlotRange range, IPlotArea layer, PenX3D pen, Func <int, double> symbolGap, int skipFrequency, bool connectCircular);
public bool CopyFrom(object obj, bool copyWithDataReferences) { if (object.ReferenceEquals(this, obj)) { return(true); } var from = obj as VectorCartesicPlotStyle; if (null != from) { _meaningOfValues = from._meaningOfValues; _independentSkipFrequency = from._independentSkipFrequency; _skipFrequency = from._skipFrequency; _useManualVectorLength = from._useManualVectorLength; _vectorLengthOffset = from._vectorLengthOffset; _vectorLengthFactor = from._vectorLengthFactor; _independentSymbolSize = from._independentSymbolSize; _symbolSize = from._symbolSize; _strokePen = from._strokePen; _independentColor = from._independentColor; _lineWidth1Offset = from._lineWidth1Offset; _lineWidth1Factor = from._lineWidth1Factor; _lineWidth2Offset = from._lineWidth2Offset; _lineWidth2Factor = from._lineWidth2Factor; _endCapSizeFactor = from._endCapSizeFactor; _endCapSizeOffset = from._endCapSizeOffset; _useSymbolGap = from._useSymbolGap; _symbolGapFactor = from._symbolGapFactor; _symbolGapOffset = from._symbolGapOffset; _independentSkipFrequency = from._independentSkipFrequency; _skipFrequency = from._skipFrequency; _independentOnShiftingGroupStyles = from._independentOnShiftingGroupStyles; _cachedLogicalShiftX = from._cachedLogicalShiftX; _cachedLogicalShiftY = from._cachedLogicalShiftY; if (copyWithDataReferences) { ChildCloneToMember(ref _columnX, from._columnX); ChildCloneToMember(ref _columnY, from._columnY); ChildCloneToMember(ref _columnZ, from._columnZ); } EhSelfChanged(); return(true); } return(false); }
private void EhDashPattern_SelectionChangeCommitted(object sender, EventArgs e) { if (_pen != null) { var oldPen = _pen; _pen = _pen.WithDashPattern(_cbDashPattern.SelectedItem); if (!object.ReferenceEquals(_pen, oldPen)) { OnPenChanged(); } } }
public DropLinePlotStyle(CSPlaneID planeID, PenX3D pen) { if (null == pen) { throw new ArgumentNullException(nameof(pen)); } _dropTargets = new CSPlaneIDList(new[] { planeID }); // Cached values SetCachedValues(); }
private void EhBrush_SelectionChangeCommitted(object sender, EventArgs e) { if (_pen != null) { var oldPen = _pen; _pen = _pen.WithMaterial(_cbBrush.SelectedMaterial); if (!object.ReferenceEquals(_pen, oldPen)) { OnPenChanged(); } } }
public VectorCartesicPlotStyle(Altaxo.Main.Properties.IReadOnlyPropertyBag context) { var penWidth = GraphDocument.GetDefaultPenWidth(context); var color = GraphDocument.GetDefaultPlotColor(context); _lineWidth1Offset = penWidth; _lineWidth1Factor = 0; _lineWidth2Offset = penWidth; _lineWidth2Factor = 0; _strokePen = new PenX3D(color, penWidth).WithLineEndCap(new ContourArrow05()); }
protected OpenPathShapeBase(ItemLocationDirect location, Altaxo.Main.Properties.IReadOnlyPropertyBag context) : base(location) { if (null == context) { context = PropertyExtensions.GetPropertyContextOfProject(); } var penWidth = GraphDocument.GetDefaultPenWidth(context); var foreColor = context.GetValue(GraphDocument.PropertyKeyDefaultForeColor); Pen = new PenX3D(foreColor, penWidth); }
private void EhThickness2_ChoiceChanged(object sender, DependencyPropertyChangedEventArgs e) { if (_pen != null) { var oldPen = _pen; _pen = _pen.WithThickness2(_cbThickness2.SelectedQuantityAsValueInPoints); if (!object.ReferenceEquals(_pen, oldPen)) { OnPenChanged(); } } }
public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { _cachedColorForIndexFunction = null; _cachedSymbolSizeForIndexFunction = null; // color if (!_independentColor) { ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c) { _strokePen = _strokePen.WithColor(c); }); // but if there is a color evaluation function, then use that function with higher priority VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, System.Drawing.Color> evalFunc) { _cachedColorForIndexFunction = evalFunc; }); } if (!_independentSkipFrequency) { SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c) { SkipFrequency = c; }); } // symbol size if (!_independentSymbolSize) { _symbolSize = 0; SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size) { _symbolSize = size; }); // but if there is an symbol size evaluation function, then use this with higher priority. _cachedSymbolSizeForIndexFunction = null; VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, double> evalFunc) { _cachedSymbolSizeForIndexFunction = evalFunc; }); } else { _cachedSymbolSizeForIndexFunction = null; } // Shift the items ? _cachedLogicalShiftX = 0; _cachedLogicalShiftY = 0; _cachedLogicalShiftZ = 0; if (!_independentOnShiftingGroupStyles) { var shiftStyle = PlotGroupStyle.GetFirstStyleToApplyImplementingInterface <IShiftLogicalXYZGroupStyle>(externalGroups, localGroups); if (null != shiftStyle) { shiftStyle.Apply(out _cachedLogicalShiftX, out _cachedLogicalShiftY, out _cachedLogicalShiftZ); } } }
public override bool CopyFrom(object obj) { var isCopied = base.CopyFrom(obj); if (isCopied && !object.ReferenceEquals(this, obj)) { var from = obj as OpenPathShapeBase; if (from != null) { _linePen = from._linePen; } } return(isCopied); }
public DropLinePlotStyle(Altaxo.Main.Properties.IReadOnlyPropertyBag context) { _dropTargets = new CSPlaneIDList(new[] { new CSPlaneID(2, 0) }); var color = GraphDocument.GetDefaultPlotColor(context); double penWidth = GraphDocument.GetDefaultPenWidth(context); _pen = new PenX3D(color, penWidth); _lineWidth1Offset = penWidth; _lineWidth1Factor = 0; _lineWidth2Offset = penWidth; _lineWidth2Factor = 0; }
private void EhDashStartCapRelSize_SelectionChangeCommitted(object sender, DependencyPropertyChangedEventArgs e) { _userChangedRelDashStartCapSize = true; if (_pen != null) { var cap = _pen.DashStartCap; if (null != cap) { cap = cap.WithMinimumAbsoluteAndRelativeSize(cap.MinimumAbsoluteSizePt, _cbDashStartCapRelSize.SelectedQuantityAsValueInSIUnits); } _pen = _pen.WithDashStartCap(cap); OnPenChanged(); } }
private void EhLineEndCapAbsSize_SelectionChangeCommitted(object sender, DependencyPropertyChangedEventArgs e) { _userChangedAbsLineEndCapSize = true; if (_pen != null) { var cap = _pen.LineEndCap; if (null != cap) { cap = cap.WithMinimumAbsoluteAndRelativeSize(_cbLineEndCapAbsSize.SelectedQuantityAsValueInPoints, cap.MinimumRelativeSize); } _pen = _pen.WithLineEndCap(cap); OnPenChanged(); } }
/// <summary> /// Creates a default axis style. /// </summary> public AxisLineStyle(Main.Properties.IReadOnlyPropertyBag context) { double penWidth = GraphDocument.GetDefaultPenWidth(context); double majorTickLength = GraphDocument.GetDefaultMajorTickLength(context); var color = GraphDocument.GetDefaultForeColor(context); _axisPen = new PenX3D(color, penWidth); _majorTickPen = new PenX3D(color, penWidth); _minorTickPen = new PenX3D(color, penWidth); _majorTickLength = majorTickLength; _minorTickLength = majorTickLength / 2; _showFirstUpMajorTicks = true; // true if right major ticks should be visible _showFirstDownMajorTicks = true; // true if left major ticks should be visible _showFirstUpMinorTicks = true; // true if right minor ticks should be visible _showFirstDownMinorTicks = true; // true if left minor ticks should be visible }
public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { // SkipFrequency should be the same for all sub plot styles if (!_independentSkipFreq) { _skipFreq = 1; SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c) { _skipFreq = c; }); } if (IsColorReceiver) { ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c) { Color = c; }); } if (!_independentDashStyle) { DashPatternGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(IDashPattern c) { _linePen = LinePen.WithDashPattern(c); }); } if (!_independentSymbolSize) { _symbolSize = 0; SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size) { _symbolSize = size; }); } // symbol size if (!_independentSymbolSize) { _symbolSize = 0; SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size) { _symbolSize = size; }); // but if there is an symbol size evaluation function, then use this with higher priority. _cachedSymbolSizeForIndexFunction = null; VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, double> evalFunc) { _cachedSymbolSizeForIndexFunction = evalFunc; }); } else { _cachedSymbolSizeForIndexFunction = null; } }
private void EhCrossSection_SelectionChangeCommitted(object sender, EventArgs e) { if (_pen != null) { var node = (SelectableListNode)_cbCrossSection.SelectedValue; if (null != node) { var type = (Type)node.Tag; var crossSection = (ICrossSectionOfLine)Activator.CreateInstance(type); crossSection = crossSection.WithSize(_pen.Thickness1, _pen.Thickness2); var oldPen = _pen; _pen = _pen.WithCrossSection(crossSection); if (!object.ReferenceEquals(_pen, oldPen)) { OnPenChanged(); } } } }
/// <summary> /// Copy operation. /// </summary> /// <param name="obj">The AxisStyle to copy from</param> public bool CopyFrom(object obj) { if (object.ReferenceEquals(this, obj)) { return(true); } var from = obj as AxisLineStyle; if (null == from) { return(false); } using (var suspendToken = SuspendGetToken()) { _axisPen = from._axisPen; _axisPosition1 = from._axisPosition1; _axisPosition2 = from._axisPosition2; _showFirstDownMajorTicks = from._showFirstDownMajorTicks; _showFirstDownMinorTicks = from._showFirstDownMinorTicks; _showFirstUpMajorTicks = from._showFirstUpMajorTicks; _showFirstUpMinorTicks = from._showFirstUpMinorTicks; _showSecondDownMajorTicks = from._showSecondDownMajorTicks; _showSecondDownMinorTicks = from._showSecondDownMinorTicks; _showSecondUpMajorTicks = from._showSecondUpMajorTicks; _showSecondUpMinorTicks = from._showSecondUpMinorTicks; _majorTickLength = from._majorTickLength; _majorTickPen = from._majorTickPen; _minorTickLength = from._minorTickLength; _minorTickPen = from._minorTickPen; _cachedAxisStyleInfo = from._cachedAxisStyleInfo; EhSelfChanged(EventArgs.Empty); suspendToken.Resume(); } return(true); }
public IEnumerable <(string PropertyName, object PropertyValue, Action <object> PropertySetter)> GetRoutedProperties(string propertyName) { switch (propertyName) { case "StrokeWidth": yield return(propertyName, _axisPen.Thickness1, (w) => _axisPen = _axisPen.WithThickness1((double)w)); yield return(propertyName, _axisPen.Thickness2, (w) => _axisPen = _axisPen.WithThickness2((double)w)); yield return(propertyName, _axisPen.Thickness1, (w) => _majorTickPen = _majorTickPen.WithThickness1((double)w)); yield return(propertyName, _axisPen.Thickness2, (w) => _majorTickPen = _majorTickPen.WithThickness2((double)w)); yield return(propertyName, _axisPen.Thickness1, (w) => _minorTickPen = _minorTickPen.WithThickness1((double)w)); yield return(propertyName, _axisPen.Thickness2, (w) => _minorTickPen = _minorTickPen.WithThickness2((double)w)); break; } yield break; }
public void CopyFrom(DropLinePlotStyle from, Main.EventFiring eventFiring) { if (object.ReferenceEquals(this, from)) { return; } using (var suspendToken = SuspendGetToken()) { _independentSkipFreq = from._independentSkipFreq; _skipFreq = from._skipFreq; _dropTargets = from._dropTargets; // immutable _additionalDropTargetIsEnabled = from._additionalDropTargetIsEnabled; _additionalDropTargetPerpendicularAxis = from._additionalDropTargetPerpendicularAxis; _additionalDropTargetUsePhysicalBaseValue = from._additionalDropTargetUsePhysicalBaseValue; _additionalDropTargetBaseValue = from._additionalDropTargetBaseValue; _pen = from._pen; // immutable _independentColor = from._independentColor; _independentSymbolSize = from._independentSymbolSize; _symbolSize = from._symbolSize; _lineWidth1Offset = from._lineWidth1Offset; _lineWidth1Factor = from._lineWidth1Factor; _lineWidth2Offset = from._lineWidth2Offset; _lineWidth2Factor = from._lineWidth2Factor; _gapAtStartOffset = from._gapAtStartOffset; _gapAtStartFactor = from._gapAtStartFactor; _gapAtEndOffset = from._gapAtEndOffset; _gapAtEndFactor = from._gapAtEndFactor; EhSelfChanged(EventArgs.Empty); suspendToken.Resume(eventFiring); } }
public virtual bool CopyFrom(object obj, bool copyWithDataReferences) { if (object.ReferenceEquals(this, obj)) { return(true); } var from = obj as BarGraphPlotStyle; if (null != from) { _usePhysicalBaseValue = from._usePhysicalBaseValue; _baseValue = from._baseValue; _startAtPreviousItem = from._startAtPreviousItem; _previousItemZGap = from._previousItemZGap; _independentColor = from._independentColor; _pen = from._pen; _useUniformCrossSectionThickness = from._useUniformCrossSectionThickness; _barShiftStrategy = from._barShiftStrategy; _barShiftMaxNumberOfItemsInOneDirection = from._barShiftMaxNumberOfItemsInOneDirection; _relInnerGapX = from._relInnerGapX; _relOuterGapX = from._relOuterGapX; _relInnerGapY = from._relInnerGapY; _relOuterGapY = from._relOuterGapY; _xSizeLogical = from._xSizeLogical; _xOffsetLogical = from._xOffsetLogical; _ySizeLogical = from._ySizeLogical; _yOffsetLogical = from._yOffsetLogical; EhSelfChanged(); return(true); } return(false); }
public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { _cachedColorForIndexFunction = null; BarSizePosition3DGroupStyle bwp = PlotGroupStyle.GetStyleToApply <BarSizePosition3DGroupStyle>(externalGroups, localGroups); if (null != bwp) { bwp.Apply( out _barShiftStrategy, out _barShiftMaxNumberOfItemsInOneDirection, out _relInnerGapX, out _relOuterGapX, out _xSizeLogical, out _xOffsetLogical, out _relInnerGapY, out _relOuterGapY, out _ySizeLogical, out _yOffsetLogical); } if (!_independentColor) { ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c) { _pen = _pen.WithColor(c); }); // but if there is a color evaluation function, then use that function with higher priority VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, System.Drawing.Color> evalFunc) { _cachedColorForIndexFunction = evalFunc; }); } }
public BarGraphPlotStyle(Altaxo.Main.Properties.IReadOnlyPropertyBag context) { var color = GraphDocument.GetDefaultPlotColor(context); _pen = new PenX3D(color, 1); }
public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { _cachedColorForIndexFunction = null; BarSizePosition3DGroupStyle bwp = PlotGroupStyle.GetStyleToApply<BarSizePosition3DGroupStyle>(externalGroups, localGroups); if (null != bwp) bwp.Apply( out _barShiftStrategy, out _barShiftMaxNumberOfItemsInOneDirection, out _relInnerGapX, out _relOuterGapX, out _xSizeLogical, out _xOffsetLogical, out _relInnerGapY, out _relOuterGapY, out _ySizeLogical, out _yOffsetLogical); if (!_independentColor) { ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { _pen = _pen.WithColor(c); }); // but if there is a color evaluation function, then use that function with higher priority VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (Func<int, System.Drawing.Color> evalFunc) { _cachedColorForIndexFunction = evalFunc; }); } }
public virtual bool CopyFrom(object obj, bool copyWithDataReferences) { if (object.ReferenceEquals(this, obj)) return true; var from = obj as BarGraphPlotStyle; if (null != from) { this._usePhysicalBaseValue = from._usePhysicalBaseValue; this._baseValue = from._baseValue; this._startAtPreviousItem = from._startAtPreviousItem; this._previousItemZGap = from._previousItemZGap; this._independentColor = from._independentColor; this._pen = from._pen; this._useUniformCrossSectionThickness = from._useUniformCrossSectionThickness; this._barShiftStrategy = from._barShiftStrategy; this._barShiftMaxNumberOfItemsInOneDirection = from._barShiftMaxNumberOfItemsInOneDirection; this._relInnerGapX = from._relInnerGapX; this._relOuterGapX = from._relOuterGapX; this._relInnerGapY = from._relInnerGapY; this._relOuterGapY = from._relOuterGapY; this._xSizeLogical = from._xSizeLogical; this._xOffsetLogical = from._xOffsetLogical; this._ySizeLogical = from._ySizeLogical; this._yOffsetLogical = from._yOffsetLogical; EhSelfChanged(); return true; } return false; }
public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { _cachedColorForIndexFunction = null; _cachedSymbolSizeForIndexFunction = null; // color if (!_independentColor) { ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { _strokePen = _strokePen.WithColor(c); }); // but if there is a color evaluation function, then use that function with higher priority VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (Func<int, System.Drawing.Color> evalFunc) { _cachedColorForIndexFunction = evalFunc; }); } if (!_independentSkipFrequency) SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (int c) { this.SkipFrequency = c; }); // symbol size if (!_independentSymbolSize) { this._symbolSize = 0; SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (double size) { this._symbolSize = size; }); // but if there is an symbol size evaluation function, then use this with higher priority. _cachedSymbolSizeForIndexFunction = null; VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (Func<int, double> evalFunc) { _cachedSymbolSizeForIndexFunction = evalFunc; }); } else { _cachedSymbolSizeForIndexFunction = null; } // Shift the items ? _cachedLogicalShiftX = 0; _cachedLogicalShiftY = 0; _cachedLogicalShiftZ = 0; if (!_independentOnShiftingGroupStyles) { var shiftStyle = PlotGroupStyle.GetFirstStyleToApplyImplementingInterface<IShiftLogicalXYZGroupStyle>(externalGroups, localGroups); if (null != shiftStyle) { shiftStyle.Apply(out _cachedLogicalShiftX, out _cachedLogicalShiftY, out _cachedLogicalShiftZ); } } }
/// <summary> /// Copy operation. /// </summary> /// <param name="obj">The AxisStyle to copy from</param> public bool CopyFrom(object obj) { if (object.ReferenceEquals(this, obj)) return true; var from = obj as AxisLineStyle; if (null == from) return false; using (var suspendToken = SuspendGetToken()) { this._axisPen = from._axisPen; this._axisPosition1 = from._axisPosition1; this._axisPosition2 = from._axisPosition2; this._showFirstDownMajorTicks = from._showFirstDownMajorTicks; this._showFirstDownMinorTicks = from._showFirstDownMinorTicks; this._showFirstUpMajorTicks = from._showFirstUpMajorTicks; this._showFirstUpMinorTicks = from._showFirstUpMinorTicks; this._showSecondDownMajorTicks = from._showSecondDownMajorTicks; this._showSecondDownMinorTicks = from._showSecondDownMinorTicks; this._showSecondUpMajorTicks = from._showSecondUpMajorTicks; this._showSecondUpMinorTicks = from._showSecondUpMinorTicks; this._majorTickLength = from._majorTickLength; this._majorTickPen = from._majorTickPen; this._minorTickLength = from._minorTickLength; this._minorTickPen = from._minorTickPen; this._cachedAxisStyleInfo = from._cachedAxisStyleInfo; EhSelfChanged(EventArgs.Empty); suspendToken.Resume(); } return true; }
public VectorCartesicPlotStyle(Altaxo.Main.Properties.IReadOnlyPropertyBag context) { var penWidth = GraphDocument.GetDefaultPenWidth(context); var color = GraphDocument.GetDefaultPlotColor(context); _lineWidth1Offset = penWidth; _lineWidth1Factor = 0; _lineWidth2Offset = penWidth; _lineWidth2Factor = 0; this._strokePen = new PenX3D(color, penWidth).WithLineEndCap(new ContourArrow05()); }
public void SetRoutedProperty(IRoutedSetterProperty property) { switch (property.Name) { case "StrokeWidth": { var prop = (RoutedSetterProperty<double>)property; _axisPen = _axisPen.WithUniformThickness(prop.Value); _majorTickPen = _majorTickPen.WithUniformThickness(prop.Value); _minorTickPen = _minorTickPen.WithUniformThickness(prop.Value); EhSelfChanged(EventArgs.Empty); } break; } }
public virtual void DrawLine(PenX3D pen, PointD3D p0, PointD3D p1) { DrawLine(GetPositionNormalIndexedTriangleBuffer(pen.Material), pen, p0, p1); }
public DropLinePlotStyle(CSPlaneID planeID, PenX3D pen) { if (null == pen) throw new ArgumentNullException(nameof(pen)); this._dropTargets = new CSPlaneIDList(new[] { planeID }); // Cached values SetCachedValues(); }
public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { // SkipFrequency should be the same for all sub plot styles if (!_independentSkipFreq) { _skipFreq = 1; SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (int c) { this._skipFreq = c; }); } if (this.IsColorReceiver) ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { this.Color = c; }); if (!_independentDashStyle) DashPatternGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (IDashPattern c) { this._linePen = this.LinePen.WithDashPattern(c); }); if (!_independentSymbolSize) { _symbolSize = 0; SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (double size) { this._symbolSize = size; }); } // symbol size if (!_independentSymbolSize) { this._symbolSize = 0; SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (double size) { this._symbolSize = size; }); // but if there is an symbol size evaluation function, then use this with higher priority. _cachedSymbolSizeForIndexFunction = null; VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (Func<int, double> evalFunc) { _cachedSymbolSizeForIndexFunction = evalFunc; }); } else { _cachedSymbolSizeForIndexFunction = null; } }
public bool CopyFrom(object obj, bool copyWithDataReferences) { if (object.ReferenceEquals(this, obj)) return true; var from = obj as VectorCartesicPlotStyle; if (null != from) { this._meaningOfValues = from._meaningOfValues; this._independentSkipFrequency = from._independentSkipFrequency; this._skipFrequency = from._skipFrequency; this._useManualVectorLength = from._useManualVectorLength; this._vectorLengthOffset = from._vectorLengthOffset; this._vectorLengthFactor = from._vectorLengthFactor; this._independentSymbolSize = from._independentSymbolSize; this._symbolSize = from._symbolSize; this._strokePen = from._strokePen; this._independentColor = from._independentColor; _lineWidth1Offset = from._lineWidth1Offset; _lineWidth1Factor = from._lineWidth1Factor; _lineWidth2Offset = from._lineWidth2Offset; _lineWidth2Factor = from._lineWidth2Factor; this._endCapSizeFactor = from._endCapSizeFactor; this._endCapSizeOffset = from._endCapSizeOffset; this._useSymbolGap = from._useSymbolGap; this._symbolGapFactor = from._symbolGapFactor; this._symbolGapOffset = from._symbolGapOffset; this._independentSkipFrequency = from._independentSkipFrequency; this._skipFrequency = from._skipFrequency; this._independentOnShiftingGroupStyles = from._independentOnShiftingGroupStyles; this._cachedLogicalShiftX = from._cachedLogicalShiftX; this._cachedLogicalShiftY = from._cachedLogicalShiftY; if (copyWithDataReferences) { ChildCloneToMember(ref _columnX, from._columnX); ChildCloneToMember(ref _columnY, from._columnY); ChildCloneToMember(ref _columnZ, from._columnZ); } EhSelfChanged(); return true; } return false; }
public void CopyFrom(LinePlotStyle from, Main.EventFiring eventFiring) { if (object.ReferenceEquals(this, from)) return; using (var suspendToken = SuspendGetToken()) { this._independentSkipFreq = from._independentSkipFreq; this._skipFreq = from._skipFreq; this._ignoreMissingDataPoints = from._ignoreMissingDataPoints; this._connectCircular = from._connectCircular; this.Connection = from._connectionStyle; // beachte links nur Connection, damit das Template mit gesetzt wird this._linePen = from._linePen; // immutable this._independentDashStyle = from._independentDashStyle; this._independentColor = from._independentColor; this._independentSymbolSize = from._independentSymbolSize; this._symbolSize = from._symbolSize; this._useSymbolGap = from._useSymbolGap; this._symbolGapOffset = from._symbolGapOffset; this._symbolGapFactor = from._symbolGapFactor; this._keepWestNorthThroughSymbolGap = from._keepWestNorthThroughSymbolGap; EhSelfChanged(); suspendToken.Resume(eventFiring); } }
public static void DrawLine(IIndexedTriangleBuffer buffer, PenX3D pen, PointD3D p0, PointD3D p1) { DrawLine(GetBuffers(buffer), pen, p0, p1); }
public void CopyFrom(DropLinePlotStyle from, Main.EventFiring eventFiring) { if (object.ReferenceEquals(this, from)) return; using (var suspendToken = SuspendGetToken()) { this._independentSkipFreq = from._independentSkipFreq; this._skipFreq = from._skipFreq; this._dropTargets = from._dropTargets; // immutable this._additionalDropTargetIsEnabled = from._additionalDropTargetIsEnabled; this._additionalDropTargetPerpendicularAxis = from._additionalDropTargetPerpendicularAxis; this._additionalDropTargetUsePhysicalBaseValue = from._additionalDropTargetUsePhysicalBaseValue; this._additionalDropTargetBaseValue = from._additionalDropTargetBaseValue; this._pen = from._pen; // immutable this._independentColor = from._independentColor; _independentSymbolSize = from._independentSymbolSize; _symbolSize = from._symbolSize; _lineWidth1Offset = from._lineWidth1Offset; _lineWidth1Factor = from._lineWidth1Factor; _lineWidth2Offset = from._lineWidth2Offset; _lineWidth2Factor = from._lineWidth2Factor; this._gapAtStartOffset = from._gapAtStartOffset; this._gapAtStartFactor = from._gapAtStartFactor; this._gapAtEndOffset = from._gapAtEndOffset; this._gapAtEndFactor = from._gapAtEndFactor; EhSelfChanged(EventArgs.Empty); suspendToken.Resume(eventFiring); } }
public DropLinePlotStyle(Altaxo.Main.Properties.IReadOnlyPropertyBag context) { this._dropTargets = new CSPlaneIDList(new[] { new CSPlaneID(2, 0) }); var color = GraphDocument.GetDefaultPlotColor(context); double penWidth = GraphDocument.GetDefaultPenWidth(context); _pen = new PenX3D(color, penWidth); _lineWidth1Offset = penWidth; _lineWidth1Factor = 0; _lineWidth2Offset = penWidth; _lineWidth2Factor = 0; }