Esempio n. 1
0
        public void ExtentToTop()
        {
            var dim = new LengthDimension()
            {
                FirstPoint  = new Pnt2d(-10, -5),
                SecondPoint = new Pnt2d(10, -10),
            };

            Drawing drawing = new();

            drawing.Add(dim);

            var svg = SvgDrawingExporter.Export(drawing);

            Assert.IsNotNull(svg);
            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "ExtentToTop.svg"), svg, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }
Esempio n. 2
0
        public void ScaleLabeling()
        {
            var dim = new LengthDimension()
            {
                FirstPoint  = new Pnt2d(-3, -0.5),
                SecondPoint = new Pnt2d(3, -3),
            };

            Drawing drawing = new();

            drawing.Add(dim);

            var svg = SvgDrawingExporter.Export(drawing);

            Assert.IsNotNull(svg);
            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "ScaleLabeling.svg"), svg, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }
Esempio n. 3
0
        public void ReversedCoordinates()
        {
            var dim = new LengthDimension()
            {
                SecondPoint = new Pnt2d(-10, 5),
                FirstPoint  = new Pnt2d(10, 10),
            };

            Drawing drawing = new();

            drawing.Add(dim);

            var svg = SvgDrawingExporter.Export(drawing);

            Assert.IsNotNull(svg);
            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "ReversedCoordinates.svg"), svg, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }
Esempio n. 4
0
        public void Dimension()
        {
            // Create simple geometry
            var dim = new LengthDimension()
            {
                FirstPoint  = new Pnt2d(-10, 5),
                SecondPoint = new Pnt2d(10, 10),
            };

            Drawing drawing = new();

            drawing.Add(dim);

            var svg = SvgDrawingExporter.Export(drawing);

            Assert.IsNotNull(svg);

            // Write to file and compare
            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "Dimension.svg"), svg, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }
Esempio n. 5
0
        //--------------------------------------------------------------------------------------------------

        void _AddLengthDimension(LengthDimension dim)
        {
            _InitDimensionBlock();

            dim.ComputeParameters(out var p);

            var textMidPos = p.TextOrigin.Translated(p.DimensionDirection.ToVec(p.TextWidth * 0.5))
                             .Translated(p.ExtensionVector.Normalized().Scaled(p.TextHeight * 0.5));
            var dimLinePoint = dim.SecondPoint.Translated(p.DimensionOffset);

            var entity = new DxfDomDimension(_CurrentLayerName, _CurrentBlock.Name, textMidPos, -Maths.NormalizeAngleRad(p.DimensionRotation).ToDeg());

            entity.SetAlignedDimension(dimLinePoint, dim.FirstPoint, dim.SecondPoint);
            if (!dim.AutoText)
            {
                entity.Text = dim.Text;
            }

            _Document.Entities.Add(entity); // Add to document, not to block
        }
Esempio n. 6
0
        public void TextWithUmlauts()
        {
            var dim = new LengthDimension()
            {
                FirstPoint  = new Pnt2d(-10, 5),
                SecondPoint = new Pnt2d(10, 10),
                AutoText    = false,
                Text        = "ö 23°"
            };

            Drawing drawing = new();

            drawing.Add(dim);

            var dxf = DxfDrawingExporter.Export(drawing, DxfVersion.AC1009);

            Assert.IsNotNull(dxf);

            // Write to file and compare
            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "TextWithUmlauts.dxf"), dxf, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }
Esempio n. 7
0
        public void LengthDimension()
        {
            var dim = new LengthDimension()
            {
                FirstPoint  = new Pnt2d(-10, 5),
                SecondPoint = new Pnt2d(10, 10),
            };

            Drawing drawing = new();

            drawing.Add(dim);

            var dxf = DxfDrawingExporter.Export(drawing, DxfVersion.AC1009);

            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "LengthDimension.dxf"), dxf, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);

            dxf = DxfDrawingExporter.Export(drawing, DxfVersion.AC1012);
            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "LengthDimension_AC1012.dxf"), dxf, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);

            dxf = DxfDrawingExporter.Export(drawing, DxfVersion.AC1015);
            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "LengthDimension_AC1015.dxf"), dxf, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }
Esempio n. 8
0
 [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] public partial class GiftCardProductTypePhysicalGiftCard { private LengthDimension itemDisplayHeightField; private LengthDimension itemDisplayLengthField; private WeightDimension itemDisplayWeightField; private LengthDimension itemDisplayWidthField; private static System.Xml.Serialization.XmlSerializer serializer; public GiftCardProductTypePhysicalGiftCard()
                                                                                                                              {
                                                                                                                                  this.itemDisplayWidthField = new LengthDimension(); this.itemDisplayWeightField = new WeightDimension(); this.itemDisplayLengthField = new LengthDimension(); this.itemDisplayHeightField = new LengthDimension();
                                                                                                                              }
 } public FoodServiceAndJanSanProductTypeFoodServiceAndJanSan()
 {
     this.wideEndDiameterField = new LengthDimension(); this.waterRemovalCapacityField = new VolumeDimension(); this.upperTemperatureRatingField = new TemperatureDimension(); this.timerRangeField = new TimeDimension(); this.temperatureRecoveryField = new TimeDimension(); this.temperatureRangeField = new TemperatureDimension(); this.suctionFlowRateField = new VolumeRateDimension(); this.stemOutsideDiameterField = new LengthDimension(); this.shakingSpeedField = new SpeedDimension(); this.pressureFlowRateField = new VolumeRateDimension(); this.poreSizeField = new VolumeRateDimension(); this.outsideDiameterField = new LengthDimension(); this.outputCapacityField = new VolumeDimension(); this.operatingPressureField = new PressureDimension(); this.neckDiameterField = new LengthDimension(); this.narrowEndDiameterField = new LengthDimension(); this.minimumStirringSpeedField = new SpeedDimension(); this.minimumSpeedField = new SpeedDimension(); this.minimumInletWaterTemperatureField = new TemperatureDimension(); this.minimumDispensingVolumeField = new VolumeRateDimension(); this.maximumWorkingVolumeField = new VolumeAndVolumeRateDimension(); this.maximumTemperatureField = new TemperatureDimension(); this.maximumStirringVolumeField = new VolumeAndVolumeRateDimension(); this.maximumStirringSpeedField = new SpeedDimension(); this.maximumSpeedField = new SpeedDimension(); this.maximumInletPressureField = new PressureDimension(); this.maximumDispensingVolumeField = new VolumeRateDimension(); this.lowerTemperatureRatingField = new TemperatureDimension(); this.itemVolumeField = new VolumeDimension(); this.itemThicknessField = new LengthDimension(); this.itemDiameterField = new LengthDimension(); this.itemDepthField = new LengthDimension(); this.insideWidthField = new LengthDimension(); this.insideLengthField = new LengthDimension(); this.insideHeightField = new LengthDimension(); this.insideDiameterField = new LengthDimension(); this.insideDepthField = new LengthDimension(); this.inletOutsideDimensionsField = new LengthDimension(); this.holdingTimeField = new TimeDimension(); this.heatTimeField = new TimeDimension(); this.graduationRangeField = new LengthDimension(); this.graduationIntervalField = new GraduationInterval(); this.extensionLengthField = new LengthDimension(); this.dropVolumeField = new VolumeDimension(); this.drawVolumeField = new VolumeAndVolumeRateDimension(); this.currentRatingField = new CurrentDimension(); this.coolantConsumptionRateField = new VolumeRateDimension(); this.coolantCapacityField = new VolumeDimension(); this.closureDiameterField = new LengthDimension(); this.capSizeField = new LengthDimension(); this.capacityField = new VolumeWeightDimension();
 }
Esempio n. 10
0
 } public ClothingAccessoriesClassificationData()
 {
     this.legDiameterField = new LengthDimension(); this.itemRiseField = new LengthDimension(); this.chestSizeField = new ClothingSizeDimension(); this.neckSizeField = new ClothingSizeDimension(); this.sleeveLengthField = new ClothingSizeDimension(); this.inseamLengthField = new ClothingSizeDimension(); this.waistSizeField = new ClothingSizeDimension(); this.materialAndFabricField = new List <string>(); this.specialFeatureField = new List <string>();
 }
Esempio n. 11
0
 } public MechanicalFastenersProductTypeMechanicalFasteners()
 {
     this.workingLoadLimitField = new WeightDimension(); this.wingSpanField = new LengthDimension(); this.upperTemperatureRatingField = new TemperatureDimension(); this.uncompressedDiameterField = new LengthDimension(); this.threadPitchField = new LengthDimension(); this.threadLengthField = new LengthDimension(); this.specificationMetField = new List <string>(); this.shoulderLengthToleranceField = new LengthDimension(); this.shoulderLengthField = new LengthDimension(); this.shoulderDiameterToleranceField = new LengthDimension(); this.shoulderDiameterField = new LengthDimension(); this.outsideThreadSizeField = new LengthDimension(); this.nominalOutsideDiameterField = new LengthDimension(); this.minimumEmbedmentDepthField = new LengthDimension(); this.minimumCompatibleThicknessField = new LengthDimension(); this.maxShearStrengthField = new ShearStrengthDimension(); this.maximumDoubleShearStrengthField = new ShearStrengthDimension(); this.maximumCompatibleThicknessField = new LengthDimension(); this.magneticPullCapacityField = new WeightDimension(); this.lowerTemperatureRatingField = new TemperatureDimension(); this.itemThicknessToleranceField = new LengthDimension(); this.itemThicknessField = new LengthDimension(); this.itemDiameterField = new LengthDimension(); this.itemDepthField = new LengthDimension(); this.insideThreadSizeField = new LengthDimension(); this.insideDiameterToleranceField = new LengthDimension(); this.insideDiameterField = new LengthDimension(); this.indentationHardnessField = new HardnessDimension(); this.headHeightToleranceField = new LengthDimension(); this.headHeightField = new LengthDimension(); this.headDiameterToleranceField = new LengthDimension(); this.headDiameterField = new LengthDimension(); this.compatibleWithInsideDiameterField = new LengthDimension(); this.compatibleGrooveWidthField = new LengthDimension(); this.compatibleGrooveDiameterField = new LengthDimension(); this.compatibleGrooveDepthField = new LengthDimension();
 }
Esempio n. 12
0
 } public SportsVariationData()
 {
     this.widthField = new LengthDimension(); this.wheelSizeField = new LengthDimension(); this.weightSupportedField = new WeightDimension(); this.weightField = new WeightDimension(); this.wattageField = new WattageDimension(); this.volumeField = new VolumeDimension(); this.temperatureRatingField = new TemperatureRatingDimension(); this.shaftLengthField = new LengthDimension(); this.lengthField = new LengthDimension(); this.itemThicknessField = new LengthDimension(); this.heightField = new LengthDimension(); this.golfLoftField = new DegreeDimension(); this.divingHoodThicknessField = new LengthDimension(); this.diameterField = new LengthDimension(); this.departmentField = new List <string>(); this.capacityField = new VolumeDimension(); this.bikeRimSizeField = new LengthDimension(); this.amperageField = new AmperageDimension();
 }
Esempio n. 13
0
 } public FashionNecklaceBraceletAnkletVariationData()
 {
     this.lengthField = new LengthDimension();
 }
Esempio n. 14
0
 } public FineOtherVariationData()
 {
     this.totalDiamondWeightField = new JewelryWeightDimension(); this.lengthField = new LengthDimension();
 }
Esempio n. 15
0
 } public FineNecklaceBraceletAnkletVariationData()
 {
     this.totalDiamondWeightField = new JewelryWeightDimension(); this.lengthField = new LengthDimension();
 }
Esempio n. 16
0
 } public FashionOtherVariationData()
 {
     this.lengthField = new LengthDimension();
 }