Esempio n. 1
0
 internal Class2(
     BinaryReader r,
     Encoding encoding,
     CharRemapDelegate charRemapper,
     ShxFile shxfile)
 {
     this.binaryReader_0      = r;
     this.encoding_0          = encoding;
     this.charRemapDelegate_0 = charRemapper;
     this.shxFile_0           = shxfile;
     this.memoryStream_0      = new MemoryStream();
 }
Esempio n. 2
0
 internal static Class754.Class755 smethod_0(ShxFile file, double scale)
 {
     Class754.Class755 class755;
     lock (Class754.dictionary_0)
     {
         if (!Class754.dictionary_0.TryGetValue(file.FileName, out class755))
         {
             class755 = new Class754.Class755(file, scale);
             Class754.dictionary_0.Add(file.FileName, class755);
         }
     }
     return(class755);
 }
Esempio n. 3
0
 public Class27(Class596 settings, ShxFile shxFile)
     : base(settings)
 {
     this.shxFile_0  = shxFile;
     this.double_3   = 1.0 / (shxFile.Above != 0 ? (double)shxFile.Above : (double)shxFile.Height);
     this.double_4   = (double)shxFile.Below * this.double_3;
     this.vector2D_0 = settings.IsVertical ? new Vector2D(shxFile.HorizontalLinefeedAdvance * this.double_3 * this.Ascent, 0.0) : new Vector2D(0.0, shxFile.VerticalLinefeedAdvance * this.double_3 * this.Ascent);
     if (this.vector2D_0 == Vector2D.Zero)
     {
         this.vector2D_0 = settings.IsVertical ? new Vector2D(5.0 / 3.0 * this.Ascent, 0.0) : new Vector2D(0.0, -5.0 / 3.0 * this.Ascent);
     }
     this.class755_0 = Class754.smethod_0(shxFile, this.double_3);
 }
Esempio n. 4
0
 internal ShxFile GetShxFile()
 {
     if (this.shxFile_0 == null)
     {
         try
         {
             this.shxFile_0 = this.Model.GetShxFile(this.string_1);
         }
         catch (IOException ex)
         {
         }
     }
     return(this.shxFile_0);
 }
Esempio n. 5
0
 internal void method_0(DxfModel model)
 {
     if ((this.elementType_0 & DxfLineType.ElementType.IsShape) != DxfLineType.ElementType.None)
     {
         if (this.TextStyle == null)
         {
             return;
         }
         ShxFile shxFile = this.TextStyle.GetShxFile();
         if (shxFile == null)
         {
             return;
         }
         ShxShape shapeByIndex = shxFile.GetShapeByIndex((ushort)this.short_0);
         if (shapeByIndex == null)
         {
             return;
         }
         WW.Math.Point2D endPoint;
         this.fillableShape2D_0 = new FillableShape2D(shapeByIndex.GetGlyphShape(this.TextStyle.IsVertical, out endPoint), false);
     }
     else
     {
         if ((this.elementType_0 & DxfLineType.ElementType.IsText) == DxfLineType.ElementType.None || this.TextStyle == null)
         {
             return;
         }
         Class425        class425     = Class594.smethod_10(this.string_0, 1.0, this.TextStyle.ObliqueAngle, this.TextStyle.WidthFactor, this.TextStyle, Colors.White);
         List <Class908> class908List = new List <Class908>();
         class425.imethod_3((ICollection <Class908>)class908List, Matrix4D.Identity, (short)0);
         GeneralShape2D generalShape2D = new GeneralShape2D();
         bool           filled         = false;
         foreach (Class908 class908 in class908List)
         {
             generalShape2D.Append(class908.FontPath, false);
             if (class908.Font.Filled)
             {
                 filled = true;
             }
         }
         if (!generalShape2D.HasSegments)
         {
             return;
         }
         generalShape2D.ShrinkWrap();
         this.fillableShape2D_0 = new FillableShape2D((IShape2D) new CachedBoundsShape2D((IShape2D)generalShape2D), filled);
     }
 }
Esempio n. 6
0
        public Class521(ShxFile font, ShxShape shape, GraphicsConfig graphicsConfig)
        {
            this.int_0 = font.Above;
            Point2D  endPoint;
            IShape2D glyphShape = shape.GetGlyphShape(false, out endPoint);

            this.vector2D_0 = (Vector2D)endPoint;
            this.ilist_0    = (IList <Polyline2D>)ShapeTool.GetFlattened(glyphShape, graphicsConfig.ShapeFlattenEpsilon);
            foreach (List <Point2D> point2DList in (IEnumerable <Polyline2D>) this.ilist_0)
            {
                foreach (Point2D p in point2DList)
                {
                    this.bounds2D_0.Update(p);
                }
            }
        }
Esempio n. 7
0
        public static Class521 GetPolylines(
            ShxFile font,
            char character,
            GraphicsConfig config)
        {
            Class805 key = new Class805(font, character);
            Class521 class521;

            if (Class521.dictionary_0.TryGetValue(key, out class521))
            {
                return(class521);
            }
            ShxShape shape = font.GetShape(character);

            if (shape != null)
            {
                class521 = new Class521(font, shape, config);
                Class521.dictionary_0.Add(key, class521);
            }
            return(class521);
        }
Esempio n. 8
0
        public override void ResolveReferences(Class374 modelBuilder)
        {
            base.ResolveReferences(modelBuilder);
            DxfShape handledObject = (DxfShape)this.HandledObject;

            if (this.ulong_6 != 0UL)
            {
                DxfTextStyle textStyle = modelBuilder.method_4 <DxfTextStyle>(this.ulong_6);
                if (textStyle == null)
                {
                    return;
                }
                handledObject.SetShape(modelBuilder.Model, textStyle, handledObject.ShapeIndex, true);
            }
            else
            {
                if (handledObject.Name == null)
                {
                    return;
                }
                foreach (DxfTextStyle textStyle in (DxfHandledObjectCollection <DxfTextStyle>)modelBuilder.Model.TextStyles)
                {
                    if (textStyle.IsShape)
                    {
                        ShxFile shxFile = modelBuilder.Model.GetShxFile(textStyle.FontFilename);
                        if (shxFile != null)
                        {
                            ushort?indexByDescription = shxFile.GetShapeIndexByDescription(handledObject.Name);
                            if (indexByDescription.HasValue)
                            {
                                handledObject.SetShape(modelBuilder.Model, textStyle, indexByDescription.Value, false);
                                break;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 9
0
 public Class755(ShxFile shxFile, double scale)
 {
     this.shxFile_0    = shxFile;
     this.dictionary_0 = new Dictionary <int, Interface35>();
     this.matrix2D_0   = new Matrix2D(scale, 0.0, 0.0, -scale);
 }
Esempio n. 10
0
 internal Class5(BinaryReader r, Encoding encoding, ShxFile shxfile)
     : base(r, encoding, (CharRemapDelegate)null, shxfile)
 {
 }
Esempio n. 11
0
 internal Class805(ShxFile font, char character)
 {
     this.shxFile_0 = font;
     this.char_0    = character;
 }