123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
- #include <SceneAPI/SceneBuilder/ImportContexts/ImportContexts.h>
- #include <SceneAPI/SceneCore/Events/ImportEventContext.h>
- namespace AZ
- {
- namespace SceneAPI
- {
- namespace SceneBuilder
- {
- ImportContext::ImportContext(Containers::Scene& scene,
- Containers::SceneGraph::NodeIndex currentGraphPosition,
- RenamedNodesMap& nodeNameMap)
- : m_scene(scene)
- , m_currentGraphPosition(currentGraphPosition)
- , m_nodeNameMap(nodeNameMap)
- {
- }
- ImportContext::ImportContext(Containers::Scene& scene, RenamedNodesMap& nodeNameMap)
- : m_scene(scene)
- , m_nodeNameMap(nodeNameMap)
- {
- m_currentGraphPosition = Containers::SceneGraph::NodeIndex();
- }
- NodeEncounteredContext::NodeEncounteredContext(Containers::Scene& scene,
- Containers::SceneGraph::NodeIndex currentGraphPosition,
- RenamedNodesMap& nodeNameMap)
- : ImportContext(scene, currentGraphPosition, nodeNameMap)
- {
- }
- NodeEncounteredContext::NodeEncounteredContext(
- Events::ImportEventContext& parent, Containers::SceneGraph::NodeIndex currentGraphPosition,
- RenamedNodesMap& nodeNameMap)
- : ImportContext(parent.GetScene(), currentGraphPosition, nodeNameMap)
- {
- }
- SceneDataPopulatedContextBase::SceneDataPopulatedContextBase(NodeEncounteredContext& parent,
- AZStd::shared_ptr<DataTypes::IGraphObject> graphData, const AZStd::string& dataName)
- : ImportContext(parent.m_scene, parent.m_currentGraphPosition, parent.m_nodeNameMap)
- , m_graphData(AZStd::move(graphData))
- , m_dataName(dataName)
- {
- }
- SceneDataPopulatedContextBase::SceneDataPopulatedContextBase(Containers::Scene& scene,
- Containers::SceneGraph::NodeIndex currentGraphPosition,
- RenamedNodesMap& nodeNameMap,
- AZStd::shared_ptr<DataTypes::IGraphObject> nodeData, const AZStd::string& dataName)
- : ImportContext(scene, currentGraphPosition, nodeNameMap)
- , m_graphData(AZStd::move(nodeData))
- , m_dataName(dataName)
- {
- }
- SceneNodeAppendedContextBase::SceneNodeAppendedContextBase(SceneDataPopulatedContextBase& parent,
- Containers::SceneGraph::NodeIndex newIndex)
- : ImportContext(parent.m_scene, newIndex, parent.m_nodeNameMap)
- {
- }
- SceneNodeAppendedContextBase::SceneNodeAppendedContextBase(Containers::Scene& scene,
- Containers::SceneGraph::NodeIndex currentGraphPosition, RenamedNodesMap& nodeNameMap)
- : ImportContext(scene, currentGraphPosition, nodeNameMap)
- {
- }
- SceneAttributeDataPopulatedContextBase::SceneAttributeDataPopulatedContextBase(SceneNodeAppendedContextBase& parent,
- AZStd::shared_ptr<DataTypes::IGraphObject> nodeData,
- const Containers::SceneGraph::NodeIndex attributeNodeIndex, const AZStd::string& dataName)
- : ImportContext(parent.m_scene, attributeNodeIndex, parent.m_nodeNameMap)
- , m_graphData(AZStd::move(nodeData))
- , m_dataName(dataName)
- {
- }
- SceneAttributeNodeAppendedContextBase::SceneAttributeNodeAppendedContextBase(SceneAttributeDataPopulatedContextBase& parent, Containers::SceneGraph::NodeIndex newIndex)
- : ImportContext(parent.m_scene, newIndex, parent.m_nodeNameMap)
- {
- }
- SceneNodeAddedAttributesContextBase::SceneNodeAddedAttributesContextBase(SceneNodeAppendedContextBase& parent)
- : ImportContext(parent.m_scene, parent.m_currentGraphPosition, parent.m_nodeNameMap)
- {
- }
- SceneNodeFinalizeContextBase::SceneNodeFinalizeContextBase(SceneNodeAddedAttributesContextBase& parent)
- : ImportContext(parent.m_scene, parent.m_currentGraphPosition, parent.m_nodeNameMap)
- {
- }
- FinalizeSceneContextBase::FinalizeSceneContextBase(Containers::Scene& scene, RenamedNodesMap& nodeNameMap)
- : ImportContext(scene, nodeNameMap)
- {
- }
- } // namespace SceneAPI
- } // namespace SceneBuilder
- } // namespace AZ
|