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); } } }
private void DrawArrow(int[] arrow, Graphics3D graphics) { Vector3D pt0 = _pts[arrow[0]]; Vector3D pt0_ = pt0 + (pt0 - _pts[arrow[2]]) * offsetPerc; Vector3D pt00_ = pt0 + (pt0 - _pts[arrow[2]]) * offsetPerc * 1.1; Vector3D pt1 = _pts[arrow[1]]; Vector3D pt1_ = pt1 + (pt1 - _pts[arrow[3]]) * offsetPerc; Vector3D pt11_ = pt1 + (pt1 - _pts[arrow[3]]) * offsetPerc * 1.1; if ((pt1 - pt0).GetLengthSquared() < 1.0E-03) { return; } string text = string.Format("{0:0.0}", (pt1 - pt0).GetLength()); graphics.Draw(text, 0.5 * (pt1_ + pt0_), _color, _fontSize); graphics.Draw(new Segment(pt0_, pt0_ + (pt1 - pt0) * (2.0 / 5.0), _color)); graphics.Draw(new Segment(pt0_ + (pt1 - pt0) * (3.0 / 5.0), pt1_, _color)); graphics.Draw(new Segment(pt0, pt00_, _color)); graphics.Draw(new Segment(pt1, pt11_, _color)); }
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); } } }
private void DrawArrow(int[] arrow, Graphics3D graphics) { Vector3D pt0 = _pts[arrow[0]]; Vector3D pt0_ = pt0 + (pt0 - _pts[arrow[2]]) * offsetPerc; Vector3D pt00_ = pt0 + (pt0 - _pts[arrow[2]]) * offsetPerc * 1.1; Vector3D pt1 = _pts[arrow[1]]; Vector3D pt1_ = pt1 + (pt1 - _pts[arrow[3]]) * offsetPerc; Vector3D pt11_ = pt1 + (pt1 - _pts[arrow[3]]) * offsetPerc * 1.1; if ((pt1 - pt0).GetLengthSquared() < 1.0E-03) return; string text = string.Format("{0:0.0}", (pt1-pt0).GetLength()); graphics.Draw(text, 0.5 * (pt1_ + pt0_), _color, _fontSize); graphics.Draw(new Segment(pt0_, pt0_ + (pt1 - pt0) * (2.0 / 5.0), _color)); graphics.Draw(new Segment(pt0_ + (pt1 - pt0) * (3.0 / 5.0), pt1_, _color)); graphics.Draw(new Segment(pt0, pt00_, _color)); graphics.Draw(new Segment(pt1, pt11_, _color)); }