26 #ifndef PXR_IMAGING_PX_OSD_MESH_TOPOLOGY_VALIDATION_H 27 #define PXR_IMAGING_PX_OSD_MESH_TOPOLOGY_VALIDATION_H 34 PXR_NAMESPACE_OPEN_SCOPE
119 class _OptionalInvalidationVector {
120 std::unique_ptr<std::vector<Invalidation>> _value;
123 _OptionalInvalidationVector() =
default;
124 _OptionalInvalidationVector(_OptionalInvalidationVector&&) =
default;
125 _OptionalInvalidationVector& operator=(_OptionalInvalidationVector&&) =
127 _OptionalInvalidationVector(_OptionalInvalidationVector
const& other)
130 _value.reset(
new std::vector<Invalidation>(*other._value));
133 _OptionalInvalidationVector& operator=(
134 _OptionalInvalidationVector
const& other) {
137 _value.reset(
new std::vector<Invalidation>(*other._value));
141 void emplace() { _value.reset(
new std::vector<Invalidation>); }
142 explicit operator bool()
const {
return _value !=
nullptr; }
143 std::vector<Invalidation>& value() {
147 std::vector<Invalidation>
const& value()
const {
153 _OptionalInvalidationVector _invalidations;
156 const char* name,
const TfToken& token,
157 const std::array<TfToken, S>& validTokens);
159 void _AppendInvalidation(
const Invalidation& invalidation) {
160 if (!_invalidations) {
161 _invalidations.emplace();
163 _invalidations.value().push_back(invalidation);
178 explicit operator bool()
const {
179 return !_invalidations || _invalidations.value().empty();
182 using iterator = std::vector<Invalidation>::const_iterator;
183 using const_iterator = std::vector<Invalidation>::const_iterator;
188 return _invalidations ? _invalidations.value().cbegin()
193 const_iterator
end()
const {
194 return _invalidations ? _invalidations.value().cend()
201 return _invalidations ? _invalidations.value().cbegin()
207 return _invalidations ? _invalidations.value().cend()
223 PXR_NAMESPACE_CLOSE_SCOPE
#define TF_DEV_AXIOM(cond)
The same as TF_AXIOM, but compiled only in dev builds.
const_iterator cend() const
Returns an iterator for the end of the invalidation vector if it has been initialized.
A tuple containing a code describing an invalidation and a descriptive message.
Encodes if crease weights is the size of the number of creases or the number of crease edges.
Encodes if a vertex count is less than 3.
Encodes invalid face varying interpolation rule token value.
const_iterator begin() const
Returns an iterator for the beginning of the invalidation vector if it has been initialized.
Encodes if corner weights are negative.
Encodes if crease weights are negative.
Topology data for meshes.
Encodes if the hole indices are negative or greater than the maximum face index (face count - 1)
Token for efficient comparison, assignment, and hashing of known strings.
Encodes if corner weights is not the size of the number of corner indices.
Encodes invalid crease method token value.
Code
Codes for various invalid states for PxOsdMeshTopology.
const_iterator end() const
Returns an iterator for the end of the invalidation vector if it has been initialized.
Encodes invalid vertex interpolation rule token value.
Utility to help validate an OpenSubdiv Mesh topology.
const_iterator cbegin() const
Returns an iterator for the beginning of the invalidation vector if it has been initialized.
Encodes invalid scheme token value.
Encodes corner indices element is not in the face vertex indices vector.
Encodes crease indices size not matching the sum of the lengths array.
Encodes invalid orientation token value.
Encodes crease lengths element less than 2.
Encodes if the indices size does not match the sum of the face vertex counts array.
Encodes if the element is negative.
Encodes crease indices element is not in the face vertex indices vector.
Encodes invalid triangle subdivision token value.