{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.1/drawings/view.schema.json",
  "title": "View",
  "description": "A view with its detail items inline, as the single-file form holds it.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[^/]+$"
    },
    "name": {
      "type": "string"
    },
    "revision": {
      "type": "integer",
      "minimum": 0
    },
    "fontFamily": {
      "type": "string",
      "x-eik-application": true
    },
    "parentViewId": {
      "type": "string",
      "x-eik-ref": "view"
    },
    "dependentOn": {
      "type": "string",
      "x-eik-ref": "view"
    },
    "viewRange": {
      "type": "object",
      "properties": {
        "direction": {
          "type": "string",
          "enum": [
            "down",
            "up"
          ]
        },
        "top": {
          "type": "object",
          "properties": {
            "levelId": {
              "type": "string"
            },
            "offset": {
              "type": "number"
            }
          },
          "required": [
            "offset"
          ],
          "x-eik-closed": true
        },
        "cut": {
          "type": "object",
          "properties": {
            "levelId": {
              "type": "string"
            },
            "offset": {
              "type": "number"
            }
          },
          "required": [
            "offset"
          ],
          "x-eik-closed": true
        },
        "bottom": {
          "type": "object",
          "properties": {
            "levelId": {
              "type": "string"
            },
            "offset": {
              "type": "number"
            }
          },
          "required": [
            "offset"
          ],
          "x-eik-closed": true
        },
        "depth": {
          "type": "object",
          "properties": {
            "levelId": {
              "type": "string"
            },
            "offset": {
              "type": "number"
            }
          },
          "required": [
            "offset"
          ],
          "x-eik-closed": true
        }
      },
      "required": [
        "direction",
        "top",
        "cut",
        "bottom",
        "depth"
      ],
      "x-eik-closed": true
    },
    "scopeBoxId": {
      "type": "string",
      "x-eik-ref": "scopeBox"
    },
    "planRotation": {
      "type": "number"
    },
    "inheritParentClip": {
      "type": "boolean"
    },
    "hiddenElementIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "fireHidden": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "maxItems": 5000
    },
    "hiddenCategories": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "slab",
          "foundation",
          "wall",
          "ceiling",
          "roof",
          "beam",
          "column",
          "door",
          "window",
          "slabEdge",
          "rebar",
          "mesh",
          "component",
          "gutter",
          "room",
          "roomSeparator",
          "shaft",
          "stair",
          "railing",
          "pipe",
          "duct",
          "terminal",
          "terrain",
          "grading",
          "propertyLine",
          "furniture",
          "planting",
          "road",
          "parking",
          "fire",
          "generic"
        ]
      }
    },
    "hiddenViewReferences": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "maxItems": 200
    },
    "mepTagEdits": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "offset": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "prefixItems": [
              {
                "type": "number"
              },
              {
                "type": "number"
              }
            ]
          },
          "hidden": {
            "type": "boolean",
            "const": true
          },
          "elbow": {
            "type": "boolean",
            "const": true
          }
        },
        "x-eik-closed": true
      },
      "propertyNames": {
        "minLength": 1
      }
    },
    "sectionMark": {
      "type": "string",
      "enum": [
        "line",
        "detail"
      ]
    },
    "displayModel": {
      "type": "string",
      "enum": [
        "normal",
        "halftone",
        "hidden"
      ]
    },
    "scaleName": {
      "type": "string",
      "maxLength": 40
    },
    "annotationCrop": {
      "type": "boolean"
    },
    "cropRegionVisible": {
      "type": "boolean"
    },
    "annotationCropOffset": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000
        },
        {
          "type": "array",
          "minItems": 4,
          "maxItems": 4,
          "prefixItems": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000
            },
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000
            },
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000
            },
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000
            }
          ]
        }
      ]
    },
    "datums": {
      "type": "object",
      "properties": {
        "levelIds": {
          "type": "array",
          "items": {
            "type": "string",
            "x-eik-ref": "level"
          }
        },
        "gridIds": {
          "type": "array",
          "items": {
            "type": "string",
            "x-eik-ref": "grid"
          }
        },
        "elevationBase": {
          "type": "string",
          "enum": [
            "project",
            "shared"
          ],
          "default": "shared"
        }
      },
      "required": [
        "levelIds",
        "gridIds"
      ],
      "x-eik-closed": true
    },
    "display": {
      "type": "object",
      "properties": {
        "style": {
          "type": "string",
          "enum": [
            "wireframe",
            "hiddenLine",
            "shaded"
          ]
        },
        "shadows": {
          "type": "boolean"
        },
        "sunPath": {
          "type": "boolean"
        },
        "sun": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "time": {
              "type": "string",
              "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
            }
          },
          "required": [
            "date",
            "time"
          ],
          "x-eik-closed": true
        },
        "detailLevel": {
          "type": "string",
          "enum": [
            "coarse",
            "medium",
            "fine"
          ]
        },
        "transparency": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "hiddenDisciplines": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "architectural",
              "structural",
              "systems",
              "site"
            ]
          },
          "maxItems": 4
        },
        "belowCut": {
          "type": "string",
          "enum": [
            "off",
            "dashed",
            "hatched"
          ]
        },
        "aboveCut": {
          "type": "string",
          "enum": [
            "off",
            "dashDot"
          ]
        },
        "underFloor": {
          "type": "string",
          "enum": [
            "off",
            "dashed"
          ]
        },
        "facadeLine": {
          "type": "string",
          "enum": [
            "off",
            "level",
            "above"
          ]
        },
        "textBackground": {
          "type": "string",
          "enum": [
            "opaque",
            "transparent"
          ]
        },
        "textFrame": {
          "type": "object",
          "properties": {
            "shape": {
              "type": "string",
              "enum": [
                "rectangle",
                "rounded",
                "none"
              ]
            },
            "margin": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            },
            "weight": {
              "type": "number",
              "minimum": 0.05,
              "maximum": 2
            }
          },
          "required": [
            "shape"
          ],
          "x-eik-closed": true
        },
        "mepTagFrame": {
          "type": "object",
          "properties": {
            "shape": {
              "type": "string",
              "enum": [
                "rectangle",
                "rounded",
                "none"
              ]
            },
            "margin": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            },
            "weight": {
              "type": "number",
              "minimum": 0.05,
              "maximum": 2
            }
          },
          "required": [
            "shape"
          ],
          "x-eik-closed": true
        },
        "mepTagTemplates": {
          "type": "object",
          "properties": {
            "pipe": {
              "type": "object",
              "properties": {
                "rows": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "x-eik-application": true
                  },
                  "minItems": 1,
                  "maxItems": 3
                }
              },
              "required": [
                "rows"
              ],
              "x-eik-closed": true
            },
            "duct": {
              "type": "object",
              "properties": {
                "rows": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "x-eik-application": true
                  },
                  "minItems": 1,
                  "maxItems": 3
                }
              },
              "required": [
                "rows"
              ],
              "x-eik-closed": true
            },
            "terminal": {
              "type": "object",
              "properties": {
                "rows": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "x-eik-application": true
                  },
                  "minItems": 1,
                  "maxItems": 3
                }
              },
              "required": [
                "rows"
              ],
              "x-eik-closed": true
            }
          },
          "x-eik-closed": true
        },
        "fireClasses": {
          "type": "string",
          "enum": [
            "off",
            "shown"
          ]
        },
        "surfacePatterns": {
          "type": "boolean"
        },
        "roomColors": {
          "type": "string",
          "enum": [
            "type",
            "department",
            "unit",
            "class",
            "escape",
            "off"
          ]
        },
        "areaPlan": {
          "type": "string",
          "minLength": 1,
          "x-eik-values": "national"
        },
        "cutFill": {
          "type": "boolean"
        },
        "siteStage": {
          "type": "string",
          "enum": [
            "existing",
            "excavation",
            "finished"
          ]
        },
        "viewReferences": {
          "type": "string",
          "enum": [
            "all",
            "none"
          ]
        },
        "mepTags": {
          "type": "string",
          "enum": [
            "each",
            "perRun",
            "none"
          ]
        },
        "trussMarks": {
          "type": "boolean"
        }
      },
      "required": [
        "style",
        "shadows",
        "sunPath"
      ],
      "x-eik-closed": true
    },
    "sectionBox": {
      "type": "object",
      "properties": {
        "min": {
          "type": "array",
          "minItems": 3,
          "maxItems": 3,
          "prefixItems": [
            {
              "type": "number"
            },
            {
              "type": "number"
            },
            {
              "type": "number"
            }
          ]
        },
        "max": {
          "type": "array",
          "minItems": 3,
          "maxItems": 3,
          "prefixItems": [
            {
              "type": "number"
            },
            {
              "type": "number"
            },
            {
              "type": "number"
            }
          ]
        },
        "rotation": {
          "type": "number",
          "minimum": -360,
          "maximum": 360
        }
      },
      "required": [
        "min",
        "max"
      ],
      "x-eik-closed": true
    },
    "axonometricElevation": {
      "type": "number",
      "minimum": 0,
      "maximum": 90
    },
    "assembly": {
      "type": "object",
      "properties": {
        "typeId": {
          "type": "string",
          "minLength": 1
        },
        "mode": {
          "type": "string",
          "enum": [
            "vertical",
            "horizontal",
            "isometric"
          ]
        }
      },
      "required": [
        "typeId",
        "mode"
      ],
      "x-eik-closed": true
    },
    "sectionSpan": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "prefixItems": [
        {
          "type": "number"
        },
        {
          "type": "number"
        }
      ]
    },
    "details": {
      "type": "array",
      "maxItems": 50000,
      "items": {
        "$ref": "detail-item.schema.json"
      }
    },
    "source": {
      "type": "object",
      "properties": {
        "file": {
          "type": "string"
        },
        "page": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "kind": {
          "type": "string",
          "const": "converted-drafting"
        }
      },
      "required": [
        "file",
        "page",
        "kind"
      ],
      "x-eik-closed": true
    },
    "visibility": {
      "type": "object",
      "properties": {
        "regions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "scopeBoxId": {
                "type": "string"
              },
              "bottom": {
                "type": "number"
              },
              "top": {
                "type": "number"
              }
            },
            "required": [
              "scopeBoxId"
            ],
            "x-eik-closed": true
          }
        },
        "elementIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "slab",
              "foundation",
              "wall",
              "ceiling",
              "roof",
              "beam",
              "column",
              "door",
              "window",
              "slabEdge",
              "rebar",
              "mesh",
              "component",
              "gutter",
              "room",
              "roomSeparator",
              "shaft",
              "stair",
              "railing",
              "pipe",
              "duct",
              "terminal",
              "terrain",
              "grading",
              "propertyLine",
              "furniture",
              "planting",
              "road",
              "parking",
              "fire",
              "generic"
            ]
          }
        },
        "systems": {
          "type": "object",
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "show",
                "hide"
              ]
            },
            "ids": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^(sewage|storm|coldWater|hotWater|hotWaterCirculation|heating|brine|compressedAir|districtHeating|greaseWaste|oilWaste|gas|supplyAir|extractAir|outdoorAir|exhaustAir|kitchenExhaust)(:[1-9][0-9]?)?$"
              },
              "minItems": 1,
              "maxItems": 40
            }
          },
          "required": [
            "mode",
            "ids"
          ],
          "x-eik-closed": true
        },
        "opacity": {
          "type": "object",
          "additionalProperties": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "propertyNames": {
            "enum": [
              "slab",
              "foundation",
              "wall",
              "ceiling",
              "roof",
              "beam",
              "column",
              "door",
              "window",
              "slabEdge",
              "rebar",
              "mesh",
              "component",
              "gutter",
              "room",
              "roomSeparator",
              "shaft",
              "stair",
              "railing",
              "pipe",
              "duct",
              "terminal",
              "terrain",
              "grading",
              "propertyLine",
              "furniture",
              "planting",
              "road",
              "parking",
              "fire",
              "generic"
            ]
          }
        },
        "elementOpacity": {
          "type": "object",
          "additionalProperties": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "propertyNames": {
            "minLength": 1
          }
        },
        "foregroundCategories": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "slab",
              "foundation",
              "wall",
              "ceiling",
              "roof",
              "beam",
              "column",
              "door",
              "window",
              "slabEdge",
              "rebar",
              "mesh",
              "component",
              "gutter",
              "room",
              "roomSeparator",
              "shaft",
              "stair",
              "railing",
              "pipe",
              "duct",
              "terminal",
              "terrain",
              "grading",
              "propertyLine",
              "furniture",
              "planting",
              "road",
              "parking",
              "fire",
              "generic"
            ]
          }
        },
        "bottom": {
          "type": "number"
        },
        "top": {
          "type": "number"
        },
        "bounds": {
          "type": "array",
          "minItems": 4,
          "maxItems": 4,
          "prefixItems": [
            {
              "type": "number"
            },
            {
              "type": "number"
            },
            {
              "type": "number"
            },
            {
              "type": "number"
            }
          ]
        }
      },
      "x-eik-closed": true
    },
    "piece": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "role": {
          "type": "string",
          "enum": [
            "front",
            "top",
            "section",
            "endA",
            "endB",
            "3d",
            "lists",
            "rebar",
            "rebarOuter",
            "rebarInner",
            "sectionLift",
            "sectionOpening",
            "sectionPlan",
            "3dBack",
            "own1",
            "own2",
            "own3",
            "own4",
            "own5",
            "own6",
            "ownPlan1",
            "ownPlan2",
            "ownPlan3",
            "ownDetail1",
            "ownDetail2"
          ]
        }
      },
      "required": [
        "id",
        "role"
      ],
      "x-eik-closed": true
    },
    "kind": {
      "type": "string",
      "enum": [
        "plan",
        "3d",
        "section",
        "elevation",
        "drafting"
      ]
    },
    "levelId": {
      "type": "string",
      "x-eik-ref": "level"
    },
    "origin": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "prefixItems": [
        {
          "type": "number"
        },
        {
          "type": "number"
        }
      ]
    },
    "direction": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "prefixItems": [
        {
          "type": "number"
        },
        {
          "type": "number"
        }
      ]
    },
    "markerElevation": {
      "type": "number"
    },
    "far": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "cutHeight": {
      "type": "number"
    },
    "scale": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "crop": {
      "type": "array",
      "minItems": 4,
      "maxItems": 4,
      "prefixItems": [
        {
          "type": "number"
        },
        {
          "type": "number"
        },
        {
          "type": "number"
        },
        {
          "type": "number"
        }
      ]
    }
  },
  "required": [
    "id",
    "name",
    "kind",
    "levelId",
    "origin",
    "direction",
    "far",
    "cutHeight",
    "scale",
    "crop"
  ],
  "x-eik-closed": true
}
