Пример #1
0
 public override void Draw(Graphics3D graphics)
 {
     // draw tray back faces
     if (_packProperties.Wrap.Type == PackWrapper.WType.WT_TRAY)
     {
     }
     // draw inner boxes
     if (_packProperties.Wrap.Type == PackWrapper.WType.WT_POLYETHILENE ||
         _packProperties.Wrap.Type == PackWrapper.WType.WT_TRAY ||
         _forceTransparency)
     {
         List <Box> boxes = InnerBoxes;
         boxes.Sort(new BoxComparerSimplifiedPainterAlgo(graphics.GetWorldToEyeTransformation()));
         foreach (Box b in boxes)
         {
             graphics.Draw(b);
         }
     }
     if (_packProperties.Wrap.Type != PackWrapper.WType.WT_TRAY)
     {
         // draw front faces
         foreach (Face f in Faces)
         {
             graphics.Draw(
                 f
                 , Graphics3D.FaceDir.FRONT
                 , _packProperties.Wrap.Color
                 , _packProperties.Wrap.Transparent || _forceTransparency);
         }
     }
     else
     {
         // draw tray front faces
         foreach (Face f in TrayFaces)
         {
             graphics.Draw(
                 f
                 , Graphics3D.FaceDir.FRONT
                 , _packProperties.Wrap.Color
                 , _packProperties.Wrap.Transparent);
         }
     }
 }
Пример #2
0
 public override void Draw(Graphics3D graphics)
 {
     // draw tray back faces
     if (_packProperties.Wrap.Type == PackWrapper.WType.WT_TRAY)
     {}
     // draw inner boxes
     if (_packProperties.Wrap.Type == PackWrapper.WType.WT_POLYETHILENE
         || _packProperties.Wrap.Type == PackWrapper.WType.WT_TRAY
         || _forceTransparency)
     {
         List<Box> boxes = InnerBoxes;
         boxes.Sort( new BoxComparerSimplifiedPainterAlgo(graphics.GetWorldToEyeTransformation()) );
         foreach (Box b in boxes)
             graphics.Draw(b);
     }
     if (_packProperties.Wrap.Type != PackWrapper.WType.WT_TRAY)
     {
         // draw front faces
         foreach (Face f in Faces)
         {
             graphics.Draw(
                 f
                 , Graphics3D.FaceDir.FRONT
                 , _packProperties.Wrap.Color
                 , _packProperties.Wrap.Transparent || _forceTransparency);
         }
     }
     else
     {
         // draw tray front faces
         foreach (Face f in TrayFaces)
         {
             graphics.Draw(
                 f
                 , Graphics3D.FaceDir.FRONT
                 , _packProperties.Wrap.Color
                 , _packProperties.Wrap.Transparent);
         }
     }
 }