{
	"description": "List of control object type definitions",
	"type": "object",
	"$schema": "http://json-schema.org/draft-04/schema#",
	"title": "Control Object Catalog",
	"required": [
		"types"
	],
	"definitions": {
		"chevron": {
			"description": "chevron",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "chevron specific properties",
					"type": "object",
					"properties": {
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"chevron"
							]
						},
						"outside_edge_length": {
							"description": "length of the two outer edges in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"thickness": {
							"description": "thickness in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						}
					},
					"required": [
						"shape",
						"outside_edge_length",
						"thickness"
					]
				}
			]
		},
		"common": {
			"description": "common object properties",
			"type": "object",
			"properties": {
				"name": {
					"description": "unique type identifier",
					"type": "string",
					"minLength": 3
				},
				"description": {
					"description": "string describing the object",
					"type": "string"
				},
				"shape": {
					"description": "shape identifier",
					"type": "string",
					"enum": [
						"rectangle",
						"checkerboard2x2",
						"chevron",
						"circular_disk",
						"cylinder",
						"sphere",
						"round_corner_cube_prism"
					]
				},
				"surface_type": {
					"description": "surface material type",
					"type": "string",
					"enum": [
						"retro_reflective_foil",
						"diffuse"
					]
				}
			},
			"required": [
				"name",
				"shape"
			]
		},
		"circular_disk": {
			"description": "circular disk",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "circular disk specific properties",
					"type": "object",
					"properties": {
						"diameter": {
							"description": "diameter in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"offset": {
							"description": "offset in meters, e.g. reflector constant (optional)",
							"type": "number"
						},
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"circular_disk"
							]
						}
					},
					"required": [
						"shape",
						"diameter"
					]
				}
			]
		},
		"cylinder": {
			"description": "cylinder",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "cylinder specific properties",
					"type": "object",
					"properties": {
						"diameter": {
							"description": "diameter in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"cylinder"
							]
						},
						"height": {
							"description": "height in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						}
					},
					"required": [
						"shape",
						"diameter",
						"height"
					]
				}
			]
		},
		"sphere": {
			"description": "sphere",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "sphere specific properties",
					"type": "object",
					"properties": {
						"diameter": {
							"description": "diameter in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"sphere"
							]
						}
					},
					"required": [
						"shape",
						"diameter"
					]
				}
			]
		},
		"checkerboard2x2": {
			"description": "checkerboard 2 by 2",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "checkerboard specific properties",
					"type": "object",
					"properties": {
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"checkerboard2x2"
							]
						},
						"square_length": {
							"description": "length of a square of the checkerboard in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						}
					},
					"required": [
						"shape",
						"square_length"
					]
				}
			]
		},
		"rectangle": {
			"description": "rectangle",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "rectangle specific properties",
					"type": "object",
					"properties": {
						"length": {
							"description": "length in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"shape": {
							"type": "string",
							"enum": [
								"rectangle"
							]
						},
						"width": {
							"description": "width in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						}
					},
					"required": [
						"shape",
						"length",
						"width"
					]
				}
			]
		},
		"round_corner_cube_prism": {
			"description": "round corner cube prism",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "round corner cube prism specific properties",
					"type": "object",
					"properties": {
						"diameter": {
							"description": "diameter in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"offset": {
							"description": "offset in meters, e.g. reflector constant (optional)",
							"type": "number"
						},
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"round_corner_cube_prism"
							]
						}
					},
					"required": [
						"shape",
						"diameter"
					]
				}
			]
		}
	},
	"properties": {
		"types": {
			"type": "array",
			"items": {
				"type": "object",
				"oneOf": [
					{
						"$ref": "#/definitions/rectangle"
					},
					{
						"$ref": "#/definitions/checkerboard2x2"
					},
					{
						"$ref": "#/definitions/chevron"
					},
					{
						"$ref": "#/definitions/circular_disk"
					},
					{
						"$ref": "#/definitions/cylinder"
					},
					{
						"$ref": "#/definitions/sphere"
					},
					{
						"$ref": "#/definitions/round_corner_cube_prism"
					}
				]
			},
			"uniqueItems": true
		}
	}
}