26 #ifndef PXR_IMAGING_PX_OSD_MESH_TOPOLOGY_VALIDATION_H
27 #define PXR_IMAGING_PX_OSD_MESH_TOPOLOGY_VALIDATION_H
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));
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;
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;
188 return _invalidations ? _invalidations.value().cbegin()
194 return _invalidations ? _invalidations.value().cend()
201 return _invalidations ? _invalidations.value().cbegin()
207 return _invalidations ? _invalidations.value().cend()
Encodes invalid triangle subdivision token value.
std::vector< Invalidation >::const_iterator iterator
PxOsdMeshTopologyValidation & operator=(PxOsdMeshTopologyValidation &&)=default
GLsizei const GLchar *const * string
GLsizei const GLfloat * value
const_iterator cbegin() const
Encodes invalid face varying interpolation rule token value.
Encodes invalid crease method token value.
#define TF_DEV_AXIOM(cond)
Encodes if crease weights are negative.
Encodes invalid vertex interpolation rule token value.
Code
Codes for various invalid states for PxOsdMeshTopology.
std::vector< Invalidation >::const_iterator const_iterator
const_iterator end() const
GLuint const GLchar * name
Encodes invalid scheme token value.
Encodes if the element is negative.
Encodes if a vertex count is less than 3.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
const_iterator begin() const
const_iterator cend() const
Encodes invalid orientation token value.
Encodes if corner weights are negative.
PxOsdMeshTopologyValidation()=default
Encodes crease lengths element less than 2.