private static PdfMeasurement GetStrokeWidth(DxfEntity entity, DxfLayer layer)
        {
            // TODO many entities have a Thickness property (which is often zero).
            DxfLineWeight lw = new DxfLineWeight {
                Value = entity.LineweightEnumValue
            };
            DxfLineWeightType type = lw.LineWeightType;

            if (type == DxfLineWeightType.ByLayer)
            {
                lw = layer.LineWeight;
            }
            if (lw.Value == 0)
            {
                return(default(PdfMeasurement));
            }
            if (lw.Value < 0)
            {
                return(PdfMeasurement.Points(1)); // smallest valid stroke width
            }
            // TODO What is the meaning of this short? Some default app-dependent table? DXF spec doesn't tell.
            // QCad 1mm => lw.Value==100
            return(PdfMeasurement.Mm(lw.Value / 100.0));
        }
Beispiel #2
0
 public DxfDimStyle()
     : base()
 {
     DimensioningSuffix = null;
     AlternateDimensioningSuffix = null;
     ArrowBlockName = null;
     FirstArrowBlockName = null;
     SecondArrowBlockName = null;
     DimensioningScaleFactor = 1.0;
     DimensioningArrowSize = 0.0;
     DimensionExtensionLineOffset = 0.0;
     DimensionLineIncrement = 0.0;
     DimensionExtensionLineExtension = 0.0;
     DimensionDistanceRoundingValue = 0.0;
     DimensionLineExtension = 0.0;
     DimensionPlusTolerance = 0.0;
     DimensionMinusTolerance = 0.0;
     DimensioningTextHeight = 0.0;
     CenterMarkSize = 0.0;
     DimensioningTickSize = 0.0;
     AlternateDimensioningScaleFactor = 1.0;
     DimensionLinearMeasurementScaleFactor = 1.0;
     DimensionVerticalTextPosition = 0.0;
     DimensionToleranceDisplacScaleFactor = 1.0;
     DimensionLineGap = 0.0;
     AlternateDimensioningUnitRounding = 0.0;
     GenerateDimensionTolerances = true;
     GenerateDimensionLimits = true;
     DimensionTextInsideHorizontal = true;
     DimensionTextOutsideHorizontal = true;
     SuppressFirstDimensionExtensionLine = true;
     SuppressSecondDimensionExtensionLine = true;
     TextAboveDimensionLine = true;
     DimensionUnitZeroSuppression = DxfUnitZeroSuppression.SuppressZeroFeetAndZeroInches;
     DimensionAngleZeroSuppression = DxfUnitZeroSuppression.SuppressZeroFeetAndZeroInches;
     UseAlternateDimensioning = false;
     AlternateDimensioningDecimalPlaces = 0;
     ForceDimensionLineExtensionsOutsideIfTextExists = true;
     UseSeparateArrowBlocksForDimensions = false;
     ForceDimensionTextInsideExtensions = false;
     SuppressOutsideExtensionDimensionLines = false;
     DimensionLineColor = null;
     DimensionExtensionLineColor = null;
     DimensionTextColor = null;
     AngularDimensionPrecision = 12;
     DimensionUnitFormat = DxfUnitFormat.Scientific;
     DimensionUnitToleranceDecimalPlaces = 0;
     DimensionToleranceDecimalPlaces = 0;
     AlternateDimensioningUnits = DxfUnitFormat.Scientific;
     AlternateDimensioningToleranceDecimalPlaces = 0;
     DimensioningAngleFormat = DxfAngleFormat.DecimalDegrees;
     DimensionPrecision = 12;
     DimensionNonAngularUnits = DxfNonAngularUnits.Scientific;
     DimensionDecimalSeparatorChar = '.';
     DimensionTextMovementRule = DxfDimensionTextMovementRule.MoveLineWithText;
     DimensionTextJustification = DxfDimensionTextJustification.AboveLineCenter;
     DimensionToleranceVerticalJustification = DxfJustification.Top;
     DimensionToleranceZeroSuppression = DxfUnitZeroSuppression.SuppressZeroFeetAndZeroInches;
     AlternateDimensioningZeroSupression = DxfUnitZeroSuppression.SuppressZeroFeetAndZeroInches;
     AlternateDimensioningToleranceZeroSupression = DxfUnitZeroSuppression.SuppressZeroFeetAndZeroInches;
     DimensionTextAndArrowPlacement = DxfDimensionFit.TextAndArrowsOutsideLines;
     DimensionCursorControlsTextPosition = true;
     DimensionTextAndArrowPlacement = DxfDimensionFit.TextAndArrowsOutsideLines;
     DimensionTextStyle = null;
     DimensionLeaderBlockName = null;
     ArrowBlockName = null;
     FirstArrowBlockName = null;
     SecondArrowBlockName = null;
     DimensionLineWeight = new DxfLineWeight();
     DimensionExtensionLineWeight = new DxfLineWeight();
 }
Beispiel #3
0
 public DxfLayer()
     : base()
 {
     Color = DxfColor.FromIndex(1);
     LinetypeName = null;
     IsLayerPlotted = true;
     LineWeight = new DxfLineWeight();
     PlotStylePointer = 0u;
     MaterialHandle = 0u;
 }
Beispiel #4
0
 internal static short GetRawValue(DxfLineWeight lineWeight)
 {
     return(lineWeight?.Value ?? 0);
 }
Beispiel #5
0
 internal static short GetRawValue(DxfLineWeight lineWeight)
 {
     return lineWeight.Value;
 }