1 // 2 // Copyright 2021 Pixar 3 // 4 // Licensed under the Apache License, Version 2.0 (the "Apache License") 5 // with the following modification; you may not use this file except in 6 // compliance with the Apache License and the following modification to it: 7 // Section 6. Trademarks. is deleted and replaced with: 8 // 9 // 6. Trademarks. This License does not grant permission to use the trade 10 // names, trademarks, service marks, or product names of the Licensor 11 // and its affiliates, except as required to comply with Section 4(c) of 12 // the License and to reproduce the content of the NOTICE file. 13 // 14 // You may obtain a copy of the Apache License at 15 // 16 // http://www.apache.org/licenses/LICENSE-2.0 17 // 18 // Unless required by applicable law or agreed to in writing, software 19 // distributed under the Apache License with the above modification is 20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 21 // KIND, either express or implied. See the Apache License for the specific 22 // language governing permissions and limitations under the Apache License. 23 // 24 //////////////////////////////////////////////////////////////////////// 25 // This file is generated by a script. Do not edit directly. Edit the 26 // schema.template.h file to make changes. 27 28 #ifndef PXR_IMAGING_HD_BASIS_CURVES_TOPOLOGY_SCHEMA_H 29 #define PXR_IMAGING_HD_BASIS_CURVES_TOPOLOGY_SCHEMA_H 30 31 #include "pxr/imaging/hd/api.h" 32 33 #include "pxr/imaging/hd/schema.h" 34 35 PXR_NAMESPACE_OPEN_SCOPE 36 37 //----------------------------------------------------------------------------- 38 39 #define HDBASISCURVESTOPOLOGY_SCHEMA_TOKENS \ 40 (topology) \ 41 (curveVertexCounts) \ 42 (curveIndices) \ 43 (basis) \ 44 (type) \ 45 (wrap) \ 46 47 TF_DECLARE_PUBLIC_TOKENS(HdBasisCurvesTopologySchemaTokens, HD_API, 48 HDBASISCURVESTOPOLOGY_SCHEMA_TOKENS); 49 50 //----------------------------------------------------------------------------- 51 52 class HdBasisCurvesTopologySchema : public HdSchema 53 { 54 public: HdBasisCurvesTopologySchema(HdContainerDataSourceHandle container)55 HdBasisCurvesTopologySchema(HdContainerDataSourceHandle container) 56 : HdSchema(container) {} 57 58 //ACCESSORS 59 60 HD_API 61 HdIntArrayDataSourceHandle GetCurveVertexCounts(); 62 HD_API 63 HdIntArrayDataSourceHandle GetCurveIndices(); 64 HD_API 65 HdTokenDataSourceHandle GetBasis(); 66 HD_API 67 HdTokenDataSourceHandle GetType(); 68 HD_API 69 HdTokenDataSourceHandle GetWrap(); 70 71 // RETRIEVING AND CONSTRUCTING 72 73 /// Builds a container data source which includes the provided child data 74 /// sources. Parameters with nullptr values are excluded. This is a 75 /// low-level interface. For cases in which it's desired to define 76 /// the container with a sparse set of child fields, the Builder class 77 /// is often more convenient and readable. 78 HD_API 79 static HdContainerDataSourceHandle 80 BuildRetained( 81 const HdIntArrayDataSourceHandle &curveVertexCounts, 82 const HdIntArrayDataSourceHandle &curveIndices, 83 const HdTokenDataSourceHandle &basis, 84 const HdTokenDataSourceHandle &type, 85 const HdTokenDataSourceHandle &wrap 86 ); 87 88 /// \class HdBasisCurvesTopologySchema::Builder 89 /// 90 /// Utility class for setting sparse sets of child data source fields to be 91 /// filled as arguments into BuildRetained. Because all setter methods 92 /// return a reference to the instance, this can be used in the "builder 93 /// pattern" form. 94 class Builder 95 { 96 public: 97 HD_API 98 Builder &SetCurveVertexCounts( 99 const HdIntArrayDataSourceHandle &curveVertexCounts); 100 HD_API 101 Builder &SetCurveIndices( 102 const HdIntArrayDataSourceHandle &curveIndices); 103 HD_API 104 Builder &SetBasis( 105 const HdTokenDataSourceHandle &basis); 106 HD_API 107 Builder &SetType( 108 const HdTokenDataSourceHandle &type); 109 HD_API 110 Builder &SetWrap( 111 const HdTokenDataSourceHandle &wrap); 112 113 /// Returns a container data source containing the members set thus far. 114 HD_API 115 HdContainerDataSourceHandle Build(); 116 117 private: 118 HdIntArrayDataSourceHandle _curveVertexCounts; 119 HdIntArrayDataSourceHandle _curveIndices; 120 HdTokenDataSourceHandle _basis; 121 HdTokenDataSourceHandle _type; 122 HdTokenDataSourceHandle _wrap; 123 }; 124 125 /// Retrieves a container data source with the schema's default name token 126 /// "topology" from the parent container and constructs a 127 /// HdBasisCurvesTopologySchema instance. 128 /// Because the requested container data source may not exist, the result 129 /// should be checked with IsDefined() or a bool comparison before use. 130 HD_API 131 static HdBasisCurvesTopologySchema GetFromParent( 132 const HdContainerDataSourceHandle &fromParentContainer); 133 134 /// Returns an HdDataSourceLocator (relative to the prim-level data source) 135 /// where the container representing this schema is found by default. 136 HD_API 137 static const HdDataSourceLocator &GetDefaultLocator(); 138 139 }; 140 141 PXR_NAMESPACE_CLOSE_SCOPE 142 143 #endif