package shape

import (
	

	
	
	
)

type shapeQueue struct {
	*baseShape
}

func ( *geo.Box) Shape {
	 := shapeQueue{
		baseShape: &baseShape{
			Type: QUEUE_TYPE,
			Box:  ,
		},
	}
	.FullShape = go2.Pointer(Shape())
	return 
}

func getArcWidth( *geo.Box) float64 {
	 := defaultArcDepth
	// Note: box width should always be larger than 3*default
	// this just handles after collaping into an oval
	if .Width < *2 {
		 = .Width / 2.0
	}
	return 
}

func ( shapeQueue) () *geo.Box {
	 := .Box.Width
	 := .Box.TopLeft.Copy()
	 := getArcWidth(.Box)
	 -= 3 * 
	.X += 
	return geo.NewBox(, , .Box.Height)
}

func queueOuterPath( *geo.Box) *svg.SvgPathContext {
	 := getArcWidth()
	 := 0.45
	 := svg.NewSVGPathContext(.TopLeft, 1, 1)
	.StartAt(.Absolute(, 0))
	.H(true, .Width-2*)
	.C(false, .Width, 0, .Width, .Height*, .Width, .Height/2.0)
	.C(false, .Width, .Height-.Height*, .Width, .Height, .Width-, .Height)
	.H(true, -1*(.Width-2*))
	.C(false, 0, .Height, 0, .Height-.Height*, 0, .Height/2.0)
	.C(false, 0, .Height*, 0, 0, , 0)
	.Z()
	return 
}

func queueInnerPath( *geo.Box) *svg.SvgPathContext {
	 := getArcWidth()
	 := 0.45
	 := svg.NewSVGPathContext(.TopLeft, 1, 1)
	.StartAt(.Absolute(.Width-, 0))
	.C(false, .Width-2*, 0, .Width-2*, .Height*, .Width-2*, .Height/2.0)
	.C(false, .Width-2*, .Height-.Height*, .Width-2*, .Height, .Width-, .Height)
	return 
}

func ( shapeQueue) () []geo.Intersectable {
	return queueOuterPath(.Box).Path
}

func ( shapeQueue) () []string {
	return []string{
		queueOuterPath(.Box).PathData(),
		queueInnerPath(.Box).PathData(),
	}
}

func ( shapeQueue) (, , ,  float64) (float64, float64) {
	// 1 arc left, width+ padding, 2 arcs right
	 := 3*defaultArcDepth +  + 
	return math.Ceil(), math.Ceil( + )
}

func ( shapeQueue) () (,  float64) {
	return defaultPadding / 2, defaultPadding
}