Skip to content

Commit

Permalink
Cleanup cycle on PointAndTangentArrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
furby-tm committed Apr 4, 2024
1 parent 5d909bc commit 5d4558e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Sources/UsdGeom/include/UsdGeom/hermiteCurves.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,16 @@ class UsdGeomHermiteCurves : public UsdGeomCurves
PointAndTangentArrays() = default;
PointAndTangentArrays(const PointAndTangentArrays&) = default;
PointAndTangentArrays(PointAndTangentArrays&&) = default;
PointAndTangentArrays& operator=(const PointAndTangentArrays&) =
default;
PointAndTangentArrays& operator=(const PointAndTangentArrays&) = default;
PointAndTangentArrays& operator=(PointAndTangentArrays&&) = default;

/// Initializes \p points and \p tangents if they are the same size.
///
/// If points and tangents are not the same size, an empty container
/// is created.
PointAndTangentArrays(const VtVec3fArray& points,
const VtVec3fArray& tangents)
: _points(points), _tangents(tangents) {
explicit PointAndTangentArrays(const VtVec3fArray& points,
const VtVec3fArray& tangents)
: _points(points), _tangents(tangents) {
if (_points.size() != _tangents.size()) {
TF_RUNTIME_ERROR("Points and tangents must be the same size.");
_points.clear();
Expand Down Expand Up @@ -271,12 +270,15 @@ class UsdGeomHermiteCurves : public UsdGeomCurves
/// Get separated tangents array
const VtVec3fArray& GetTangents() const { return _tangents; }

bool operator==(const PointAndTangentArrays& other) const {
return (GetPoints() == other.GetPoints()) &&
(GetTangents() == other.GetTangents());
friend bool operator==(const PointAndTangentArrays &lhs,
const PointAndTangentArrays &rhs) {
return (lhs.GetPoints() == rhs.GetPoints()) &&
(lhs.GetTangents() == rhs.GetTangents());
}
bool operator!=(const PointAndTangentArrays& other) const {
return !((*this) == other);

friend bool operator!=(const PointAndTangentArrays &lhs,
const PointAndTangentArrays &rhs) {
return !(lhs == rhs);
}
};
};
Expand Down

0 comments on commit 5d4558e

Please sign in to comment.