예제 #1
0
파일: Hatch.cs 프로젝트: SOFAgh/CADability
 /// <summary>
 /// Overrides <see cref="CADability.GeoObject.IGeoObjectImpl.PaintTo3D (IPaintTo3D)"/>
 /// </summary>
 /// <param name="paintTo3D"></param>
 public override void PaintTo3D(IPaintTo3D paintTo3D)
 {
     if (this.compoundShape == null)
     {
         return;
     }
     if ((paintTo3D.Capabilities & PaintCapabilities.CanFillPaths) != 0 && hatchStyle is HatchStyleSolid)
     {
         paintTo3D.OpenPath();
         Path[] paths = compoundShape.MakePaths(this.plane);
         for (int i = 0; i < paths.Length; i++)
         {
             paths[i].PaintTo3D(paintTo3D);
             paintTo3D.CloseFigure();
         }
         Color clr;
         if (paintTo3D.SelectMode)
         {
             clr = paintTo3D.SelectColor;
         }
         else
         {
             if ((hatchStyle as HatchStyleSolid).Color == null && this.ColorDef != null)
             {
                 clr = this.ColorDef.Color;
             }
             else
             {
                 clr = (hatchStyle as HatchStyleSolid).Color.Color;
             }
         }
         paintTo3D.ClosePath(clr);
     }
     else
     {
         if (needsRecalc)
         {
             Recalc();
         }
         if (OnPaintTo3D != null && OnPaintTo3D(this, paintTo3D))
         {
             return;
         }
         bool ps = paintTo3D.PaintSurfaces;
         paintTo3D.PaintFaces(CADability.PaintTo3D.PaintMode.All); // kommt immer mit CurvesOnly...
         for (int i = 0; i < base.Count; ++i)
         {
             (Child(i) as IGeoObjectImpl).PaintTo3D(paintTo3D);
         }
         if (!ps)
         {
             paintTo3D.PaintFaces(CADability.PaintTo3D.PaintMode.CurvesOnly);
         }
     }
 }