package nodeshape

import (
	
	
	
)

type shapeStep struct {
	shape.Shape
}

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

func ( shapeStep) () [][]*geo.RelativePoint {
	 := .GetBox().Width
	 := shape.STEP_WEDGE_WIDTH
	if  <  {
		 =  / 2.0
	}

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

func ( shapeStep) ( 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}
	case geo.Right:
		return []int{9}
	case geo.TopLeft:
		return []int{0, 1, 2, 3, 4, 5}
	case geo.TopRight:
		return []int{0, 1, 2, 9}
	case geo.BottomLeft:
		return []int{6, 7, 8, 3, 4, 5}
	case geo.BottomRight:
		return []int{6, 7, 8, 9}
	default:
		return []int{}
	}
}

func ( shapeStep) () map[int]int {
	return map[int]int{
		// Top and bottom
		1: 7,
		7: 1,
		// Left and right
		4: 9,
		9: 4,
	}
}

func ( shapeStep) () []int {
	return []int{1, 4, 7, 9}
}

func ( shapeStep) ( 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 []
}