Skip to content

Commit

Permalink
Refactor header for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm authored Oct 6, 2024
1 parent 4e40efd commit bbc7dbe
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions source/MaterialXCore/Element.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ class MX_CORE_API Element : public std::enable_shared_from_this<Element>
template <class T> friend class ElementRegistry;

public:
/// @name Comparison interfaces
/// @{

/// Return true if the given element tree, including all descendants,
/// is identical to this one.
bool operator==(const Element& rhs) const;
Expand All @@ -114,27 +111,6 @@ class MX_CORE_API Element : public std::enable_shared_from_this<Element>
/// differs from this one.
bool operator!=(const Element& rhs) const;

/// Return true if the given element treee, including all descendents,
/// is considered to be equivalent to this one based on the equivalence
/// criteria provided.
/// @param rhs Element to compare against
/// @param options Equivalence criteria
/// @param result Results of comparison if argument is specified.
/// @return True if the elements are equivalent. False otherwise.
bool isEquivalent(ConstElementPtr rhs, const ElementEquivalenceOptions& options,
ElementEquivalenceResultVec* result = nullptr) const;

/// Return true if the attribute on a given element is equivalent
/// based on the equivalence criteria provided.
/// @param rhs Element to compare against
/// @param attributeName Name of attribute to compare
/// @param options Equivalence criteria
/// @param result Results of comparison if argument is specified.
/// @return True if the attribute on the elements are equivalent. False otherwise.
virtual bool isAttributeEquivalent(ConstElementPtr rhs, const string& attributeName,
const ElementEquivalenceOptions& options,
ElementEquivalenceResultVec* result = nullptr) const;

/// @}
/// @name Category
/// @{
Expand Down Expand Up @@ -641,6 +617,31 @@ class MX_CORE_API Element : public std::enable_shared_from_this<Element>
return nullptr;
}

/// @}
/// @name Functional Equivalence
/// @{

/// Return true if the given element treee, including all descendents,
/// is considered to be equivalent to this one based on the equivalence
/// criteria provided.
/// @param rhs Element to compare against
/// @param options Equivalence criteria
/// @param result Results of comparison if argument is specified.
/// @return True if the elements are equivalent. False otherwise.
bool isEquivalent(ConstElementPtr rhs, const ElementEquivalenceOptions& options,
ElementEquivalenceResultVec* result = nullptr) const;

/// Return true if the attribute on a given element is equivalent
/// based on the equivalence criteria provided.
/// @param rhs Element to compare against
/// @param attributeName Name of attribute to compare
/// @param options Equivalence criteria
/// @param result Results of comparison if argument is specified.
/// @return True if the attribute on the elements are equivalent. False otherwise.
virtual bool isAttributeEquivalent(ConstElementPtr rhs, const string& attributeName,
const ElementEquivalenceOptions& options,
ElementEquivalenceResultVec* result = nullptr) const;

/// @}
/// @name Traversal
/// @{
Expand Down

0 comments on commit bbc7dbe

Please sign in to comment.