Exemple #1
0
        public ArgbColor GetPlotColor(DxfEntity localBlockContext, WW.Cad.Model.Color color)
        {
            ArgbColor argbColor;

            if (this.graphicsConfig_0.PlotStyleManager != null)
            {
                argbColor = this.graphicsConfig_0.PlotStyleManager((IPlotPropertyOwner) new Class1065((IPlotPropertyOwner)localBlockContext, color), this).Color;
            }
            else if (color == WW.Cad.Model.Color.ByBlock)
            {
                if (localBlockContext.Color == EntityColor.ByLayer)
                {
                    DxfLayer layer = localBlockContext.GetLayer(this);
                    argbColor = layer == null ? DxfIndexedColor.DefaultColor : layer.Color.ToArgbColor(this.graphicsConfig_0.IndexedColors);
                }
                else
                {
                    argbColor = localBlockContext.DxfColor != null?localBlockContext.DxfColor.Color.ToArgbColor(this.graphicsConfig_0.IndexedColors) : (!(localBlockContext.Color == EntityColor.ByBlock) ? localBlockContext.Color.ToArgbColor(this.graphicsConfig_0.IndexedColors) : (this.dxfColor_0 == null ? this.entityColor_0.ToArgbColor(this.graphicsConfig_0.IndexedColors) : this.dxfColor_0.Color.ToArgbColor(this.graphicsConfig_0.IndexedColors)));
                }
            }
            else if (color == WW.Cad.Model.Color.ByLayer)
            {
                DxfLayer layer = localBlockContext.GetLayer(this);
                argbColor = layer == null ? DxfIndexedColor.DefaultColor : layer.Color.ToArgbColor(this.graphicsConfig_0.IndexedColors);
            }
            else
            {
                argbColor = color.ToArgbColor(this.graphicsConfig_0.IndexedColors);
            }
            return(argbColor);
        }
Exemple #2
0
 public CadColorEditor()
 {
     this.InitializeComponent();
     for (short colorIndex = 1; colorIndex < (short)256; ++colorIndex)
     {
         WW.Cad.Model.Color fromColorIndex = WW.Cad.Model.Color.CreateFromColorIndex(colorIndex);
         ArgbColor          argbColor      = fromColorIndex.ToArgbColor(this.dxfIndexedColorSet_0);
         if ((int)argbColor.R == (int)argbColor.G && (int)argbColor.R == (int)argbColor.B)
         {
             this.list_3.Add(fromColorIndex);
         }
         if (colorIndex <= (short)9)
         {
             this.list_2.Add(fromColorIndex);
         }
     }
     for (short index1 = 0; index1 < (short)5; ++index1)
     {
         for (short index2 = 0; index2 < (short)24; ++index2)
         {
             short colorIndex = (short)(10 + (int)index1 * 2 + (int)index2 * 5 * 2);
             this.list_0.Add(WW.Cad.Model.Color.CreateFromColorIndex(colorIndex));
             this.list_1.Add(WW.Cad.Model.Color.CreateFromColorIndex((short)((int)colorIndex + 1)));
         }
     }
     this.list_3.Sort((Comparison <WW.Cad.Model.Color>)((a, b) => (int)a.ToArgbColor(this.dxfIndexedColorSet_0).R >= (int)b.ToArgbColor(this.dxfIndexedColorSet_0).R ? 1 : -1));
     this.font_0 = this.byLayerButton.Font;
     this.font_1 = new Font(this.font_0, FontStyle.Bold);
     this.method_1(this.indexedColorSet1ListPicker, this.list_0);
     this.method_1(this.indexedColorSet2ListPicker, this.list_1);
     this.method_1(this.grayColorListPicker, this.list_3);
     this.method_1(this.standardColorListPicker, this.list_2);
 }
Exemple #3
0
 private void method_0(ColorListPicker colorListPicker)
 {
     if (this.bool_0 || colorListPicker.SelectedColorIndex < 0)
     {
         return;
     }
     this.color_0 = ((List <WW.Cad.Model.Color>)colorListPicker.Tag)[colorListPicker.SelectedColorIndex];
     this.method_2((Control)colorListPicker);
 }
Exemple #4
0
 private void colorRgbEditor_ColorChanged(object sender, EventArgs e)
 {
     if (this.bool_0)
     {
         return;
     }
     this.color_0 = WW.Cad.Model.Color.CreateFromRgb(this.colorRgbEditor.Color.ToArgb() & 16777215);
     this.method_2((Control)this.colorRgbEditor);
 }
Exemple #5
0
 private void byBlockButton_Click(object sender, EventArgs e)
 {
     if (this.bool_0)
     {
         return;
     }
     this.color_0 = WW.Cad.Model.Color.ByBlock;
     this.method_2((Control)this.byBlockButton);
 }
Exemple #6
0
 public void DrawCharPath(
     IShape2D path,
     Matrix4D transform,
     WW.Cad.Model.Color color,
     short lineWeight,
     bool filled,
     double extrusion)
 {
     this.DrawPath(path, transform, color, lineWeight, filled, true, extrusion);
 }
Exemple #7
0
 internal static void smethod_23(
     IPathDrawer pathDrawer,
     IEnumerable <IShape4D> shapes,
     WW.Cad.Model.Color color,
     short lineWeight)
 {
     foreach (IShape4D shape in shapes)
     {
         pathDrawer.DrawPath(shape, color, lineWeight);
     }
 }
Exemple #8
0
 internal static void smethod_24(
     IPathDrawer pathDrawer,
     IEnumerable <FlatShape4D> shapes,
     WW.Cad.Model.Color color,
     short lineWeight,
     double extrusion)
 {
     foreach (FlatShape4D shape in shapes)
     {
         pathDrawer.DrawPath(shape.FlatShape, shape.Transformation, color, lineWeight, shape.IsFilled, false, extrusion);
     }
 }
Exemple #9
0
        internal static short smethod_0(WW.Cad.Model.Color color)
        {
            switch (color.ColorType)
            {
            case ColorType.ByLayer:
                return(256);

            case ColorType.ByBlock:
                return(0);

            case ColorType.None:
                return(0);

            default:
                return(DxfIndexedColor.GetColorIndex(color.ToArgbColor(DxfIndexedColorSet.AcadClassicIndexedColors)));
            }
        }
Exemple #10
0
            public void DrawPath(
                IShape2D shape,
                Matrix4D transform,
                WW.Cad.Model.Color color,
                short lineWeight,
                bool filled,
                bool forText,
                double extrusion)
            {
                Matrix transform1 = this.graphics_0.Transform;

                using (Matrix matrix = new Matrix((float)transform.M00, (float)transform.M10, (float)transform.M01, (float)transform.M11, (float)transform.M03, (float)transform.M13))
                {
                    this.graphics_0.Transform = matrix;
                    using (GraphicsPath graphicsPath = ShapeTool.ToGraphicsPath(shape))
                        this.graphics_0.DrawPath(this.pen_0, graphicsPath);
                }
                this.graphics_0.Transform = transform1;
            }
Exemple #11
0
            public void DrawPath(IShape4D path, WW.Cad.Model.Color color, short lineWeight)
            {
                FlatShape4D flatShape = path.ToFlatShape();

                this.DrawPath(flatShape.FlatShape, flatShape.Transformation, color, lineWeight, flatShape.IsFilled, false, 0.0);
            }
Exemple #12
0
 private void colorNameTextBox_Validated(object sender, EventArgs e)
 {
     this.color_0 = WW.Cad.Model.Color.smethod_1(this.color_0.Data, this.colorBookNameTextBox.Text, this.colorNameTextBox.Text);
 }