public void CopyWithoutIdentifierFrom(CSAxisInformation from) { this._nameOfAxisStyle = from._nameOfAxisStyle; this._nameOfFirstDownSide = from._nameOfFirstDownSide; this._nameOfFirstUpSide = from._nameOfFirstUpSide; this._nameOfSecondDownSide = from._nameOfSecondDownSide; this._nameOfSecondUpSide = from._nameOfSecondUpSide; this._preferedLabelSide = from._preferedLabelSide; this._isShownByDefault = from._isShownByDefault; this._hasTitleByDefault = from._hasTitleByDefault; }
public void CopyFrom(CSAxisInformation from) { this._identifier = from._identifier.Clone(); CopyWithoutIdentifierFrom(from); }
public CSAxisInformation(CSAxisInformation from) { CopyFrom(from); }
public AxisStyleControllerConditionalGlue(CSAxisInformation axisInfo, AxisStyleCollection axisStyleCollection) { _doc = axisStyleCollection; AxisInformation = axisInfo; InternalInitialize(); }
private void SetDefaultAxisTitlePositionAndOrientation(TextGraphic axisTitle, CSLineID id, CSAxisInformation info) { // find out the position and orientation of the item double rx0 = 0, rx1 = 1, ry0 = 0, ry1 = 1, rz0 = 0, rz1 = 1; double relOnAxis = 0.5; // where on the axis is the label positioned if (id.ParallelAxisNumber == 0) { ry0 = ry1 = id.LogicalValueOtherFirst; rz0 = rz1 = id.LogicalValueOtherSecond; } else if (id.ParallelAxisNumber == 1) { rx0 = rx1 = id.LogicalValueOtherFirst; rz0 = rz1 = id.LogicalValueOtherSecond; relOnAxis = 0.4; } else if (id.ParallelAxisNumber == 2) { rx0 = rx1 = id.LogicalValueOtherFirst; ry0 = ry1 = id.LogicalValueOtherSecond; relOnAxis = 0.4; } else { throw new NotImplementedException(); } VectorD3D normDirection; Logical3D tdirection = CoordinateSystem.GetLogicalDirection(info.Identifier.ParallelAxisNumber, info.PreferredLabelSide); var location = CoordinateSystem.GetPositionAndNormalizedDirection(new Logical3D(rx0, ry0, rz0), new Logical3D(rx1, ry1, rz1), relOnAxis, tdirection, out normDirection); axisTitle.Location.ParentAnchorX = RADouble.NewRel(location.X / this.Size.X); // set the x anchor of the parent axisTitle.Location.ParentAnchorY = RADouble.NewRel(location.Y / this.Size.Y); // set the y anchor of the parent axisTitle.Location.ParentAnchorZ = RADouble.NewRel(location.Z / this.Size.Z); // set the z anchor of the parent double distance = 0; AxisStyle axisStyle = _axisStyles[id]; if (null != axisStyle.AxisLineStyle) distance += axisStyle.AxisLineStyle.GetOuterDistance(info.PreferredLabelSide); double labelFontSize = 0; if (axisStyle.AreMajorLabelsEnabled) labelFontSize = Math.Max(labelFontSize, axisStyle.MajorLabelStyle.FontSize); if (axisStyle.AreMinorLabelsEnabled) labelFontSize = Math.Max(labelFontSize, axisStyle.MinorLabelStyle.FontSize); axisTitle.RotationX = 90; // Font height now is z, Font depth is y and x remains x axisTitle.Location.LocalAnchorX = normDirection.X == 0 ? RADouble.NewRel(0.5) : normDirection.X < 0 ? RADouble.NewRel(1) : RADouble.NewRel(0); axisTitle.Location.LocalAnchorY = normDirection.Z == 0 ? RADouble.NewRel(0.5) : normDirection.Z < 0 ? RADouble.NewRel(1) : RADouble.NewRel(0); axisTitle.Location.LocalAnchorZ = normDirection.Y == 0 ? RADouble.NewRel(0.5) : normDirection.Y < 0 ? RADouble.NewRel(1) : RADouble.NewRel(0); VectorD3D scaleFont = new VectorD3D(1, 1, 1.4); distance += Math.Abs(scaleFont.X * normDirection.X) * labelFontSize; distance += Math.Abs(scaleFont.Y * normDirection.Y) * labelFontSize; distance += Math.Abs(scaleFont.Z * normDirection.Z) * labelFontSize; axisTitle.Location.PositionX = RADouble.NewAbs(distance * normDirection.X); // because this is relative to the reference point, we don't need to take the location into account here, it is set above axisTitle.Location.PositionY = RADouble.NewAbs(distance * normDirection.Y); axisTitle.Location.PositionZ = RADouble.NewAbs(distance * normDirection.Z); }