Esempio n. 1
0
        private void DrawInternal(IPathDrawer pathDrawer, Color color, short lineWeight)
        {
            DxfTolerance.Class397[] class397Array = this.method_13();
            Matrix4D transform = this.Transform;
            Vector3D zero      = Vector3D.Zero;
            double   num1      = this.dxfDimensionStyleOverrides_0.TextHeight * 2.0;
            double   scale     = this.dxfDimensionStyleOverrides_0.ScaleFactor;

            if (System.Math.Abs(scale) < 1E-10)
            {
                scale = 1.0;
            }
            if (this.IsAnnotative)
            {
                scale /= DxfAnnotationScaleObjectContextData.smethod_9((DxfEntity)this, this.Model.Header.CurrentAnnotationScale);
            }
            double num2 = num1 * scale;

            foreach (DxfTolerance.Class397 class397 in class397Array)
            {
                double num3 = class397.Draw(this, pathDrawer, transform * Transformation4D.Translation(zero), color, lineWeight, scale);
                if (class397.NewLineAfterField)
                {
                    zero.X  = 0.0;
                    zero.Y -= num2;
                }
                else
                {
                    zero.X += num3;
                }
            }
        }
Esempio n. 2
0
        double ILeader.GetEffectiveArrowSize()
        {
            if (!this.bool_4)
            {
                return(this.dxfDimensionStyleOverrides_0.ScaleFactor * this.dxfDimensionStyleOverrides_0.ArrowSize);
            }
            DxfAnnotationScaleObjectContextData objectContextData = DxfAnnotationScaleObjectContextData.smethod_4((DxfHandledObject)this, this.Model.Header.CurrentAnnotationScale, false);

            if (objectContextData != null)
            {
                return(this.dxfDimensionStyleOverrides_0.ArrowSize / objectContextData.Scale.ScaleFactor);
            }
            return(this.dxfDimensionStyleOverrides_0.ArrowSize);
        }
Esempio n. 3
0
        internal override void vmethod_10(DxfModel model)
        {
            base.vmethod_10(model);
            DxfAnnotationScaleObjectContextData.smethod_8((DxfEntity)this);
            this.bool_2 = Class1064.smethod_0((DxfHandledObject)this.Block, model);
            if (!this.bool_2 || DxfAnnotationScaleObjectContextData.smethod_5((DxfHandledObject)this, true) != null)
            {
                return;
            }
            DxfScale  currentAnnotationScale = model.Header.CurrentAnnotationScale;
            DxfInsert dxfInsert = this;

            dxfInsert.scaleFactor = dxfInsert.scaleFactor / currentAnnotationScale.ScaleFactor;
            DxfDictionary dxfDictionary = DxfAnnotationScaleObjectContextData.smethod_6((DxfHandledObject)this);
            DxfAnnotationScaleObjectContextData contextData = this.CreateContextData(currentAnnotationScale);

            contextData.IsDefault = true;
            dxfDictionary.Entries.Add((IDictionaryEntry) new DxfDictionaryEntry("*A", (DxfObject)contextData));
        }
Esempio n. 4
0
 internal override void vmethod_10(DxfModel model)
 {
     base.vmethod_10(model);
     DxfAnnotationScaleObjectContextData.smethod_8((DxfEntity)this);
     this.bool_4 = Class1064.smethod_0((DxfHandledObject)this, model);
 }
Esempio n. 5
0
 internal DxfMText method_21()
 {
     if (this.ExtensionDictionary != null)
     {
         DxfObject valueByName = this.ExtensionDictionary.GetValueByName("ACAD_MLATT");
         if (valueByName is DxfXRecord)
         {
             DxfXRecord dxfXrecord            = (DxfXRecord)valueByName;
             int        num                   = 0;
             DxfXRecordValueCollection values = dxfXrecord.Values;
             while (num < values.Count)
             {
                 DxfXRecordValue dxfXrecordValue = values[num++];
                 if (dxfXrecordValue.Code == (short)1 && "Embedded Object".Equals(dxfXrecordValue.Value.ToString()))
                 {
                     break;
                 }
             }
             if (num < values.Count)
             {
                 DxfXRecordValueCollection xrecordValueCollection = new DxfXRecordValueCollection();
                 xrecordValueCollection.AddRange((IEnumerable <DxfXRecordValue>) new DxfXRecordValue[5]
                 {
                     new DxfXRecordValue((short)0, (object)"MTEXT"),
                     new DxfXRecordValue((short)100, (object)"AcDbEntity"),
                     new DxfXRecordValue((short)8, (object)this.Layer.Name),
                     new DxfXRecordValue((short)67, (object)(short)(this.PaperSpace ? 1 : 0)),
                     new DxfXRecordValue((short)100, (object)"AcDbMText")
                 });
                 while (num < values.Count)
                 {
                     xrecordValueCollection.Add(values[num++]);
                 }
                 Struct18 endGroup = new Struct18(0, (object)"ENDSIM");
                 DxfModel model    = this.Model;
                 if (model == null)
                 {
                     throw new Exception("Cannot get MTEXT substitute when attribute has no parent object.");
                 }
                 DxfMText dxfMtext = DxfReader.smethod_1(model, (Interface33) new Class720(endGroup, (IEnumerable <DxfXRecordValue>)xrecordValueCollection), endGroup) as DxfMText;
                 if (dxfMtext != null)
                 {
                     dxfMtext.method_12((DxfEntity)this);
                     dxfMtext.Style = this.Style;
                     if (this.IsAnnotative)
                     {
                         dxfMtext.IsAnnotative = true;
                         dxfMtext.vmethod_2((IDxfHandledObject)this);
                         DxfDictionary dxfDictionary1 = DxfAnnotationScaleObjectContextData.smethod_7((DxfHandledObject)this, true);
                         DxfDictionary dxfDictionary2 = DxfAnnotationScaleObjectContextData.smethod_7((DxfHandledObject)dxfMtext, true);
                         foreach (IDictionaryEntry entry in (ActiveList <IDictionaryEntry>)dxfDictionary1.Entries)
                         {
                             dxfDictionary2.Entries.Add((IDictionaryEntry) new DxfDictionaryEntry("*A", (DxfObject)((DxfAttributeObjectContextData)entry.Value).Mtext));
                         }
                     }
                     return(dxfMtext);
                 }
             }
         }
     }
     return((DxfMText)null);
 }
Esempio n. 6
0
        internal override void vmethod_10(DxfModel model)
        {
            base.vmethod_10(model);
            DxfAnnotationScaleObjectContextData.smethod_8((DxfEntity)this);
            this.bool_2 = Class1064.smethod_0((DxfHandledObject)this, model);
            if (this.ExtensionDictionary == null)
            {
                return;
            }
            DxfXRecord valueByName = this.ExtensionDictionary.GetValueByName("ACAD_MTEXT_2008_RT") as DxfXRecord;

            if (valueByName == null)
            {
                return;
            }
            string empty    = string.Empty;
            double?nullable = new double?();

            foreach (DxfXRecordValue dxfXrecordValue in (List <DxfXRecordValue>)valueByName.Values)
            {
                switch (dxfXrecordValue.Code)
                {
                case 1:
                    empty += (string)dxfXrecordValue.Value;
                    continue;

                case 40:
                    nullable = new double?((double)dxfXrecordValue.Value);
                    continue;

                default:
                    continue;
                }
            }
            if (model.Header.AcadVersion < DxfVersion.Dxf21)
            {
                if (!nullable.HasValue)
                {
                    return;
                }
                if (MathUtil.AreApproxEqual(this.method_14(empty, model.Header.DrawingCodePage), nullable.Value, 1E-10))
                {
                    this.string_1 = empty;
                }
                else
                {
                    if (!MathUtil.AreApproxEqual(this.method_13(this.string_1), nullable.Value, 1E-10))
                    {
                        return;
                    }
                    this.string_1 = empty;
                }
            }
            else
            {
                if (!nullable.HasValue || !MathUtil.AreApproxEqual(this.method_13(this.string_1), nullable.Value, 1E-10))
                {
                    return;
                }
                this.string_1 = empty;
            }
        }