GraphElement.cpp 698 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. // Graph Model
  9. #include <GraphModel/Model/Graph.h>
  10. #include <GraphModel/Model/GraphElement.h>
  11. namespace GraphModel
  12. {
  13. GraphElement::GraphElement(GraphPtr graph) : m_graph(graph)
  14. {
  15. }
  16. GraphPtr GraphElement::GetGraph() const
  17. {
  18. return m_graph.lock();
  19. }
  20. GraphContextPtr GraphElement::GetGraphContext() const
  21. {
  22. GraphPtr graph = m_graph.lock();
  23. return graph ? graph->GetContext() : nullptr;
  24. }
  25. } // namespace GraphModel