package nodeshape

import (
	
	
	
)

type shapeCallout struct {
	shape.Shape
}

func ( shapeCallout) ( LabelTier) map[label.Position]struct{} {
	switch  {
	case Good:
		return map[label.Position]struct{}{
			label.InsideTopLeft:      {},
			label.InsideTopCenter:    {},
			label.InsideTopRight:     {},
			label.InsideMiddleLeft:   {},
			label.InsideMiddleCenter: {},
			label.InsideMiddleRight:  {},
			label.InsideBottomLeft:   {},
			label.InsideBottomCenter: {},
			label.InsideBottomRight:  {},
		}
	case OK:
		return map[label.Position]struct{}{
			label.OutsideTopLeft:      {},
			label.OutsideTopCenter:    {},
			label.OutsideTopRight:     {},
			label.OutsideBottomCenter: {},
		}
	case Unideal:
		return map[label.Position]struct{}{
			label.OutsideLeftTop:     {},
			label.OutsideLeftMiddle:  {},
			label.OutsideRightTop:    {},
			label.OutsideRightMiddle: {},
		}
	case Bad:
		return map[label.Position]struct{}{
			label.OutsideLeftBottom:  {},
			label.OutsideRightBottom: {},
			label.OutsideBottomLeft:  {},
			label.OutsideBottomRight: {},
		}
	}
	return map[label.Position]struct{}{}
}

func ( shapeCallout) () [][]*geo.RelativePoint {
	 := .GetBox()
	 := .Width
	 := .Height
	 := 30.0
	 := 45.0

	if  < *2 {
		 =  / 2.0
	}

	if  < *2 {
		 =  / 2.0
	}

	return [][]*geo.RelativePoint{
		// Top
		{
			geo.NewRelativePoint(0.25, 0),
			geo.NewRelativePoint(0.5, 0),
			geo.NewRelativePoint(0.75, 0),
		},
		// Left
		{
			geo.NewRelativePoint(0, ((-)/)*0.25),
			geo.NewRelativePoint(0, ((-)/)*0.5),
			geo.NewRelativePoint(0, ((-)/)*0.75),
		},
		// Bottom
		{
			geo.NewRelativePoint(0.5*0.33, (-)/),
			geo.NewRelativePoint(0.5*0.66, (-)/),
			geo.NewRelativePoint(0.5, 1),
			geo.NewRelativePoint(
				1-((/2.0-)/)*0.5,
				(-)/,
			),
		},
		// Right
		{
			geo.NewRelativePoint(1, ((-)/)*0.25),
			geo.NewRelativePoint(1, ((-)/)*0.5),
			geo.NewRelativePoint(1, ((-)/)*0.75),
		},
	}
}

func ( shapeCallout) ( geo.Orientation) []int {
	switch  {
	case geo.Top:
		return []int{0, 1, 2}
	case geo.Left:
		return []int{3, 4, 5}
	case geo.Bottom:
		return []int{6, 7, 8, 9}
	case geo.Right:
		return []int{10, 11, 12}
	case geo.TopLeft:
		return []int{0, 1, 2, 3, 4, 5}
	case geo.TopRight:
		return []int{0, 1, 2, 10, 11, 12}
	case geo.BottomLeft:
		return []int{6, 7, 8, 9, 3, 4, 5}
	case geo.BottomRight:
		return []int{6, 7, 8, 9, 10, 11, 12}
	default:
		return []int{}
	}
}
func ( shapeCallout) () []int {
	return []int{1, 4, 8, 11}
}

func ( shapeCallout) () map[int]int {
	// Left and right
	return map[int]int{4: 11, 11: 4}
}

func ( shapeCallout) ( geo.Orientation) int {
	 := .CenterPortIndices()
	var  int
	switch  {
	case geo.Top:
		 = 0
	case geo.Left:
		 = 1
	case geo.Bottom:
		 = 2
	case geo.Right:
		 = 3
	default:
		return -1
	}

	return []
}