scene/schema/registry.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | /// @file registry.cpp | ||
| 3 | /// @brief Every registered schema, by family, bases before the types deriving from them. | ||
| 4 | #include "ernie/scene/schema/camera.h" | ||
| 5 | #include "ernie/scene/schema/collection.h" | ||
| 6 | #include "ernie/scene/schema/geom.h" | ||
| 7 | #include "ernie/scene/schema/instancer.h" | ||
| 8 | #include "ernie/scene/schema/lux.h" | ||
| 9 | #include "ernie/scene/schema/mesh.h" | ||
| 10 | #include "ernie/scene/schema/planet.h" | ||
| 11 | #include "ernie/scene/schema/render.h" | ||
| 12 | #include "ernie/scene/schema/shade.h" | ||
| 13 | #include "ernie/scene/schema/vol.h" | ||
| 14 | |||
| 15 | namespace ernie { | ||
| 16 | |||
| 17 | 1326 | ERNIE_DEFINE_SCHEMA(CollectionAPI, MultipleApply, kInheritExtent, ERNIE_COLLECTION_API_ATTRIBUTES) | |
| 18 | |||
| 19 | 663 | std::span<const SchemaFamily> SchemaFamilies() { | |
| 20 | 663 | static const std::vector<SchemaFamily> kFamilies{ | |
| 21 | {"geometry", | ||
| 22 | "Geometry", | ||
| 23 | "UsdGeom", | ||
| 24 | "https://openusd.org/release/api/usd_geom_page_front.html", | ||
| 25 | 146 | {&Imageable::Definition(), &Xformable::Definition(), &Boundable::Definition(), | |
| 26 | 438 | &Gprim::Definition(), &Xform::Definition(), &Scope::Definition(), | |
| 27 | 438 | &GeomModelAPI::Definition(), &GeomSubset::Definition(), &Cube::Definition(), | |
| 28 | 438 | &Sphere::Definition(), &Cylinder::Definition(), &Cone::Definition(), | |
| 29 | 438 | &Capsule::Definition(), &Plane::Definition(), &PointBased::Definition(), | |
| 30 | 438 | &Mesh::Definition(), &Points::Definition(), &Curves::Definition(), | |
| 31 | 438 | &BasisCurves::Definition(), &NurbsCurves::Definition(), &HermiteCurves::Definition(), | |
| 32 | 146 | &PointInstancer::Definition()}, | |
| 33 | {}}, | ||
| 34 | {"volumes", | ||
| 35 | "Volumes", | ||
| 36 | "UsdVol", | ||
| 37 | "https://openusd.org/release/api/usd_vol_page_front.html", | ||
| 38 | 146 | {&Volume::Definition(), &FieldBase::Definition(), &FieldAsset::Definition(), | |
| 39 | 146 | &OpenVDBAsset::Definition()}, | |
| 40 | 146 | {&NanoVDBField::Definition(), &DenseField::Definition()}}, | |
| 41 | {"cameras", | ||
| 42 | "Cameras and lenses", | ||
| 43 | "UsdGeom", | ||
| 44 | "https://openusd.org/release/api/class_usd_geom_camera.html", | ||
| 45 | 146 | {&Camera::Definition()}, | |
| 46 | 146 | {&ErnieLensAPI::Definition(), &ErniePolarizerAPI::Definition(), | |
| 47 | 146 | &ErnieSensorAPI::Definition()}}, | |
| 48 | {"lights", | ||
| 49 | "Lights", | ||
| 50 | "UsdLux", | ||
| 51 | "https://openusd.org/release/api/usd_lux_page_front.html", | ||
| 52 | 146 | {&LightAPI::Definition(), &BoundableLightBase::Definition(), | |
| 53 | 292 | &NonboundableLightBase::Definition(), &DistantLight::Definition(), | |
| 54 | 438 | &DiskLight::Definition(), &RectLight::Definition(), &SphereLight::Definition(), | |
| 55 | 438 | &CylinderLight::Definition(), &DomeLight::Definition(), &PortalLight::Definition(), | |
| 56 | 438 | &MeshLightAPI::Definition(), &VolumeLightAPI::Definition(), &ShapingAPI::Definition(), | |
| 57 | 146 | &ShadowAPI::Definition()}, | |
| 58 | 146 | {&PhotometricAreaLightAPI::Definition(), &PhotometricDistantLightAPI::Definition(), | |
| 59 | 292 | &PhotometricDomeLightAPI::Definition(), &PhysicalLightIlluminantAPI::Definition(), | |
| 60 | 146 | &LaserLight::Definition()}}, | |
| 61 | {"materials", | ||
| 62 | "Materials", | ||
| 63 | "UsdShade", | ||
| 64 | "https://openusd.org/release/api/usd_shade_page_front.html", | ||
| 65 | 146 | {&MaterialBindingAPI::Definition(), &NodeGraph::Definition(), &Material::Definition(), | |
| 66 | 146 | &Shader::Definition()}, | |
| 67 | {}}, | ||
| 68 | {"render", | ||
| 69 | "Render settings", | ||
| 70 | "UsdRender", | ||
| 71 | "https://openusd.org/release/api/usd_render_page_front.html", | ||
| 72 | 146 | {&RenderSettingsBase::Definition(), &RenderSettings::Definition(), | |
| 73 | 438 | &RenderProduct::Definition(), &RenderVar::Definition(), &RenderPass::Definition()}, | |
| 74 | {}}, | ||
| 75 | {"planetary", | ||
| 76 | "Planetary", | ||
| 77 | "", | ||
| 78 | "", | ||
| 79 | {}, | ||
| 80 | 146 | {&Terrain::Definition(), &Atmosphere::Definition(), &StarField::Definition(), | |
| 81 | 146 | &GroundPlane::Definition()}}, | |
| 82 | {"collections", | ||
| 83 | "Collections", | ||
| 84 | "Usd", | ||
| 85 | "https://openusd.org/release/api/class_usd_collection_a_p_i.html", | ||
| 86 | 146 | {&CollectionAPI::Definition()}, | |
| 87 | {}}, | ||
| 88 | 1977 | }; | |
| 89 | 663 | return kFamilies; | |
| 90 | 730 | } | |
| 91 | |||
| 92 | 3470 | std::span<const SchemaDef* const> Schemas() { | |
| 93 | 146 | static const std::vector<const SchemaDef*> kSchemas = [] { | |
| 94 | 146 | std::vector<const SchemaDef*> schemas; | |
| 95 | 1314 | for (const SchemaFamily& family : SchemaFamilies()) { | |
| 96 | 1168 | schemas.insert(schemas.end(), family.usd.begin(), family.usd.end()); | |
| 97 | 1168 | schemas.insert(schemas.end(), family.ernie.begin(), family.ernie.end()); | |
| 98 | } | ||
| 99 | 146 | return schemas; | |
| 100 | 3470 | }(); | |
| 101 | 3470 | return kSchemas; | |
| 102 | } | ||
| 103 | |||
| 104 | } // namespace ernie | ||
| 105 |