From bbc7dbefb17c6c031cd9bf1edd4a64dc2be71514 Mon Sep 17 00:00:00 2001 From: Jonathan Stone Date: Sun, 6 Oct 2024 12:21:12 -0700 Subject: [PATCH] Refactor header for clarity --- source/MaterialXCore/Element.h | 49 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/source/MaterialXCore/Element.h b/source/MaterialXCore/Element.h index 368b15c8a1..1d0cae233c 100644 --- a/source/MaterialXCore/Element.h +++ b/source/MaterialXCore/Element.h @@ -103,9 +103,6 @@ class MX_CORE_API Element : public std::enable_shared_from_this template 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; @@ -114,27 +111,6 @@ class MX_CORE_API Element : public std::enable_shared_from_this /// 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 /// @{ @@ -641,6 +617,31 @@ class MX_CORE_API Element : public std::enable_shared_from_this 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 /// @{