Skip to content

Commit

Permalink
Minor refactoring for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm authored Oct 11, 2024
1 parent 884f0d9 commit ca832a2
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions source/MaterialXCore/Document.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,28 @@ class MX_CORE_API Document : public GraphElement
removeChildOfType<UnitTypeDef>(name);
}

/// @}
/// @name Data Libraries
/// @{

/// Store a reference to a data library in this document.
void setDataLibrary(ConstDocumentPtr dataLibrary)
{
_dataLibrary = dataLibrary;
}

/// Return true if this document has a data library.
bool hasDataLibrary() const
{
return (_dataLibrary != nullptr);
}

/// Return the data library, if any, referenced by this document.
ConstDocumentPtr getDataLibrary() const
{
return _dataLibrary;
}

/// @}
/// @name Version
/// @{
Expand Down Expand Up @@ -666,32 +688,6 @@ class MX_CORE_API Document : public GraphElement

/// @}

/// @name MaterialX data library
/// @{

/// Set the given document as MaterialX data library for document
/// The MaterialX data library can be created using the loadLibraries utility
/// For improved performance it is recommended the data library
/// is on the document instead of importing it
/// @param Data Library document to register.
void setDataLibrary(ConstDocumentPtr dataLibrary)
{
_dataLibrary = dataLibrary;
}

/// Gets the data library assinged to the document
ConstDocumentPtr getDataLibrary() const
{
return _dataLibrary;
}

/// Returns true if a data library is set for the document.
bool hasDataLibrary() const
{
return (_dataLibrary != nullptr);
}
/// @}

//
// These are deprecated wrappers for older versions of the function interfaces in this module.
// Clients using these interfaces should update them to the latest API.
Expand Down

0 comments on commit ca832a2

Please sign in to comment.