Пример #1
0
        public void CopyFrom(DropAreaPlotStyle from, Main.EventFiring eventFiring)
        {
            if (object.ReferenceEquals(this, from))
            {
                return;
            }

            using (var suspendToken = SuspendGetToken())
            {
                _connectionStyle                  = from._connectionStyle;
                _connectCircular                  = from._connectCircular;
                _ignoreMissingDataPoints          = from._ignoreMissingDataPoints;
                _independentOnShiftingGroupStyles = from._independentOnShiftingGroupStyles;

                _fillDirection = from._fillDirection;
                _fillRule      = from._fillRule;
                ChildCopyToMember(ref _fillBrush, from._fillBrush);
                _fillColorLinkage = from._fillColorLinkage;
                ChildCopyToMember(ref _framePen, from._framePen);
                _frameColorLinkage = from._frameColorLinkage;

                EhSelfChanged();

                suspendToken.Resume(eventFiring);
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        public void CopyFrom(LinePlotStyle from, Main.EventFiring eventFiring)
        {
            if (object.ReferenceEquals(this, from))
            {
                return;
            }

            using (var suspendToken = SuspendGetToken())
            {
                _independentSkipFrequency = from._independentSkipFrequency;
                _skipFrequency            = from._skipFrequency;

                _ignoreMissingDataPoints          = from._ignoreMissingDataPoints;
                _independentOnShiftingGroupStyles = from._independentOnShiftingGroupStyles;

                _connectCircular = from._connectCircular;
                _connectionStyle = from._connectionStyle;

                _linePen = null == from._linePen ? null : from._linePen.Clone();
                _independentDashStyle = from._independentDashStyle;
                _independentColor     = from._independentColor;

                _independentSymbolSize = from._independentSymbolSize;
                _symbolSize            = from._symbolSize;

                _useSymbolGap    = from._useSymbolGap;
                _symbolGapOffset = from._symbolGapOffset;
                _symbolGapFactor = from._symbolGapFactor;

                EhSelfChanged();

                suspendToken.Resume(eventFiring);
            }
        }
Пример #4
0
 /// <summary>
 /// Sets the position of the object's pivot point.
 /// </summary>
 /// <param name="value">The position to set (the object's pivot point) with reference to the parent's reference point).</param>
 /// <param name="eventFiring">Designates whether or not the change event should be fired if the value has changed.</param>
 protected virtual void SetPosition(PointD3D value, Main.EventFiring eventFiring)
 {
     _location.SetAbsolutePivotPosition(value, eventFiring);
     if (eventFiring == Main.EventFiring.Suppressed)
     {
         UpdateTransformationMatrix(); // even if events are suppressed - update at least the transformation matrix
     }
 }
Пример #5
0
        protected override void SetPosition(PointD2D value, Main.EventFiring eventFiring)
        {
            var oldPosition = GetPosition();

            base.SetPosition(value, eventFiring);

            if (_axisStyle.Title != null)
            {
                var oldTitlePos = _axisStyle.Title.Position;
                _axisStyle.Title.SilentSetPosition(oldTitlePos + (GetPosition() - oldPosition));
            }
        }
Пример #6
0
        public void SetAbsolutePivotPosition(PointD2D value, Main.EventFiring eventFiring)
        {
            var oldValueX = _positionX;
            var oldValueY = _positionY;

            InternalSetAbsolutePivotPositionXSilent(value.X);
            InternalSetAbsolutePivotPositionYSilent(value.Y);

            if (eventFiring == Main.EventFiring.Enabled && (oldValueX != _positionX || oldValueY != _positionY))
            {
                EhSelfChanged();
            }
        }
Пример #7
0
        public virtual void SetAbsoluteSize(PointD2D value, Main.EventFiring eventFiring)
        {
            var oldSizeX = _sizeX;
            var oldSizeY = _sizeY;

            InternalSetAbsoluteSizeSilent(value);

            if (eventFiring == Main.EventFiring.Enabled)
            {
                if (oldSizeX != _sizeX || oldSizeY != _sizeY)
                {
                    EhSelfChanged();
                }
            }
        }
Пример #8
0
        public void CopyFrom(DropLinePlotStyle from, Main.EventFiring eventFiring)
        {
            if (object.ReferenceEquals(this, from))
            {
                return;
            }

            using (var suspendToken = SuspendGetToken())
            {
                _independentSkipFrequency         = from._independentSkipFrequency;
                _skipFrequency                    = from._skipFrequency;
                _ignoreMissingDataPoints          = from._ignoreMissingDataPoints;
                _independentOnShiftingGroupStyles = from._independentOnShiftingGroupStyles;

                _dropTargets = from._dropTargets; // immutable

                _additionalDropTargetIsEnabled            = from._additionalDropTargetIsEnabled;
                _additionalDropTargetPerpendicularAxis    = from._additionalDropTargetPerpendicularAxis;
                _additionalDropTargetUsePhysicalBaseValue = from._additionalDropTargetUsePhysicalBaseValue;
                _additionalDropTargetBaseValue            = from._additionalDropTargetBaseValue;

                ChildCopyToMember(ref _pen, from._pen);

                _independentColor = from._independentColor;

                _independentSymbolSize = from._independentSymbolSize;
                _symbolSize            = from._symbolSize;
                _lineWidth1Offset      = from._lineWidth1Offset;
                _lineWidth1Factor      = from._lineWidth1Factor;

                _gapAtStartOffset = from._gapAtStartOffset;
                _gapAtStartFactor = from._gapAtStartFactor;
                _gapAtEndOffset   = from._gapAtEndOffset;
                _gapAtEndFactor   = from._gapAtEndFactor;

                EhSelfChanged(EventArgs.Empty);

                suspendToken.Resume(eventFiring);
            }
        }
Пример #9
0
        /// <inheritdoc/>
        public void CopyFrom(ScatterPlotStyle from, Main.EventFiring eventFiring)
        {
            if (object.ReferenceEquals(this, from))
            {
                return;
            }

            using (var suspendToken = SuspendGetToken())
            {
                _independentSkipFreq              = from._independentSkipFreq;
                _skipFreq                         = from._skipFreq;
                _ignoreMissingDataPoints          = from._ignoreMissingDataPoints;
                _independentOnShiftingGroupStyles = from._independentOnShiftingGroupStyles;

                _independentScatterSymbol = from._independentScatterSymbol;
                _scatterSymbol            = from._scatterSymbol;

                _independentSymbolSize = from._independentSymbolSize;
                _symbolSize            = from._symbolSize;

                _independentColor = from._independentColor;
                _color            = from._color;

                _overrideFrame   = from._overrideFrame;
                _overriddenFrame = from._overriddenFrame;
                _overrideInset   = from._overrideInset;
                _overriddenInset = from._overriddenInset;
                _overrideStructureWidthOffset = from._overrideStructureWidthOffset;
                _overrideStructureWidthFactor = from._overrideStructureWidthFactor;
                _overridePlotColorInfluence   = from._overridePlotColorInfluence;
                _overrideFillColor            = from._overrideFillColor;
                _overrideFrameColor           = from._overrideFrameColor;
                _overrideInsetColor           = from._overrideInsetColor;

                EhSelfChanged(EventArgs.Empty);

                suspendToken.Resume(eventFiring);
            }
        }
Пример #10
0
        public void CopyFrom(ScatterPlotStyle from, Main.EventFiring eventFiring)
        {
            if (object.ReferenceEquals(this, from))
            {
                return;
            }

            using (var suspendToken = SuspendGetToken())
            {
                _independentSkipFreq   = from._independentSkipFreq;
                _skipFreq              = from._skipFreq;
                _symbolShape           = from._symbolShape; // immutable
                _independentSymbolSize = from._independentSymbolSize;
                _symbolSize            = from._symbolSize;

                _material         = from._material; // immutable
                _independentColor = from._independentColor;

                EhSelfChanged(EventArgs.Empty);

                suspendToken.Resume(eventFiring);
            }
        }
Пример #11
0
        public void CopyFrom(FillToCurvePlotStyle from, bool copyWithDataReferences, Main.EventFiring eventFiring)
        {
            if (object.ReferenceEquals(this, from))
            {
                return;
            }

            using (var suspendToken = SuspendGetToken())
            {
                _independentFillColor = from._independentFillColor;
                FillBrush             = null == from._fillBrush ? null : from._fillBrush.Clone();

                _independentFrameColor = from._independentFrameColor;
                _framePen = null == from._framePen ? null : from._framePen.Clone();

                _fillToPrevPlotItem = from._fillToPrevPlotItem;
                _fillToNextPlotItem = from._fillToNextPlotItem;

                //this._parent = from._parent;

                suspendToken.Resume(eventFiring);
            }
        }
Пример #12
0
 /// <summary>
 /// Normally sets the size of the item. For the ClosedCardinalSpline, the size is calculated internally. Thus, the function is overriden in order to ignore both parameters.
 /// </summary>
 /// <param name="width">Unscaled width of the item (ignored here).</param>
 /// <param name="height">Unscaled height of the item (ignored here).</param>
 /// <param name="eventFiring">Suppressed the change event (ignored here).</param>
 protected override void SetSize(double width, double height, Main.EventFiring eventFiring)
 {
 }
Пример #13
0
        /// <summary>
        /// Sets all provided transformation values and updates the transformation matrix. You can leave out
        /// multiple parameters by setting them to null.
        /// </summary>
        /// <param name="x">Translation in x direction.</param>
        /// <param name="y">Translation in y direction.</param>
        /// <param name="rotation">Roation in degrees counterclockwise.</param>
        /// <param name="shearX">Shear in x-direction.</param>
        /// <param name="scaleX">X scale value.</param>
        /// <param name="scaleY">Y scale value.</param>
        /// <param name="eventFiring">Designates whether or not the change event should be fired if the value has changed.</param>
        public void SetTranslationRotationShearxScale(double?x, double?y, double?rotation, double?shearX, double?scaleX, double?scaleY, Main.EventFiring eventFiring)
        {
            if (null != x)
            {
                _x = (double)x;
            }
            if (null != y)
            {
                _y = (double)y;
            }
            if (null != rotation)
            {
                _rotationDeg = (double)rotation;
            }
            if (null != shearX)
            {
                _shearX = (double)shearX;
            }
            if (null != scaleX)
            {
                _scaleX = (double)scaleX;
            }
            if (null != scaleY)
            {
                _scaleY = (double)scaleY;
            }

            _transformation.SetTranslationRotationShearxScale(_x, _y, _rotationDeg, _shearX, _scaleX, _scaleY);

            if (eventFiring == Main.EventFiring.Enabled)
            {
                EhSelfChanged(EventArgs.Empty);
            }
        }
Пример #14
0
        /// <summary>
        /// Sets the bounds from.
        /// </summary>
        /// <param name="fixPointRelativePosition">The relative position of the object's edge or vertex, which is held fixed during the operation.</param>
        /// <param name="fixPointAbsolutePosition">The paramter <paramref name="fixPointRelativePosition"/>, converted to parent's (layer) coordinates.</param>
        /// <param name="movePointRelativePosition">The relative position of the draw grip (0..1, 0..1).</param>
        /// <param name="diff">The movement vector of the grip handle.</param>
        /// <param name="initialObjectSize">The initial size of the object.</param>
        /// <param name="eventFiring">Designates whether or not the change event should be fired if the value has changed.</param>
        public void SetBoundsFrom(VectorD3D fixPointRelativePosition, PointD3D fixPointAbsolutePosition, VectorD3D movePointRelativePosition, VectorD3D diff, VectorD3D initialObjectSize, Main.EventFiring eventFiring)
        {
            using (var suspendToken = SuspendGetToken())
            {
                var dx = movePointRelativePosition.X - fixPointRelativePosition.X;
                var dy = movePointRelativePosition.Y - fixPointRelativePosition.Y;
                var dz = movePointRelativePosition.Z - fixPointRelativePosition.Z;

                var newSizeX = initialObjectSize.X + diff.X / (dx);
                var newSizeY = initialObjectSize.Y + diff.Y / (dy);
                var newSizeZ = initialObjectSize.Z + diff.Z / (dz);

                var size = Size;
                if (Math.Abs(dx) == 1 && (newSizeX > 0 || AllowNegativeSize))
                {
                    size = size.WithX(newSizeX);
                }
                if (Math.Abs(dy) == 1 && (newSizeY > 0 || AllowNegativeSize))
                {
                    size = size.WithY(newSizeY);
                }
                if (Math.Abs(dz) == 1 && (newSizeZ > 0 || AllowNegativeSize))
                {
                    size = size.WithZ(newSizeZ);
                }

                SetSize(size.X, size.Y, size.Z, Main.EventFiring.Suppressed);

                var currFixaPos = RelativeLocalToAbsoluteParentCoordinates(fixPointRelativePosition);

                var currPos = GetPosition();
                SetPosition(new PointD3D(currPos.X + fixPointAbsolutePosition.X - currFixaPos.X, currPos.Y + fixPointAbsolutePosition.Y - currFixaPos.Y, currPos.Z + fixPointAbsolutePosition.Z - currFixaPos.Z), Main.EventFiring.Suppressed);
                UpdateTransformationMatrix();

                suspendToken.Resume(eventFiring);
            }
        }
Пример #15
0
 /// <summary>
 /// Sets the size of the item.
 /// </summary>
 /// <param name="sizeX">Unscaled width of the item.</param>
 /// <param name="sizeY">Unscaled height of the item.</param>
 /// <param name="sizeZ">Unscaled depth of the item.</param>
 /// <param name="eventFiring">Designates whether the change event should be fired.</param>
 protected virtual void SetSize(double sizeX, double sizeY, double sizeZ, Main.EventFiring eventFiring)
 {
     _location.SetAbsoluteSize(new VectorD3D(sizeX, sizeY, sizeZ), eventFiring);
 }