Integrating latest 47acbe8
This commit is contained in:
@@ -23,7 +23,6 @@ namespace AZ
|
||||
{
|
||||
namespace Containers
|
||||
{
|
||||
|
||||
size_t RuleContainer::GetRuleCount() const
|
||||
{
|
||||
return m_rules.size();
|
||||
@@ -57,6 +56,13 @@ namespace AZ
|
||||
}
|
||||
|
||||
|
||||
void RuleContainer::InsertRule(const AZStd::shared_ptr<DataTypes::IRule>& rule, size_t position)
|
||||
{
|
||||
AZ_Assert(AZStd::find(m_rules.begin(), m_rules.end(), rule) == m_rules.end(), "Unable to insert rule as it has already been added.");
|
||||
m_rules.insert(m_rules.begin() + position, rule);
|
||||
}
|
||||
|
||||
|
||||
void RuleContainer::RemoveRule(size_t index)
|
||||
{
|
||||
if (index < m_rules.size())
|
||||
@@ -76,7 +82,6 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RuleContainer::Reflect(ReflectContext* context)
|
||||
{
|
||||
SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
|
||||
@@ -156,4 +161,4 @@ namespace AZ
|
||||
|
||||
} // Containers
|
||||
} // SceneAPI
|
||||
} // AZ
|
||||
} // AZ
|
||||
|
||||
@@ -27,7 +27,6 @@ namespace AZ
|
||||
{
|
||||
namespace Containers
|
||||
{
|
||||
|
||||
class RuleContainer
|
||||
{
|
||||
public:
|
||||
@@ -54,6 +53,8 @@ namespace AZ
|
||||
SCENE_CORE_API void AddRule(const AZStd::shared_ptr<DataTypes::IRule>& rule);
|
||||
SCENE_CORE_API void AddRule(AZStd::shared_ptr<DataTypes::IRule>&& rule);
|
||||
|
||||
SCENE_CORE_API void InsertRule(const AZStd::shared_ptr<DataTypes::IRule>& rule, size_t position);
|
||||
|
||||
SCENE_CORE_API void RemoveRule(size_t index);
|
||||
SCENE_CORE_API void RemoveRule(const AZStd::shared_ptr<DataTypes::IRule>& rule);
|
||||
|
||||
|
||||
@@ -43,6 +43,30 @@ namespace AZ
|
||||
AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context);
|
||||
if (behaviorContext)
|
||||
{
|
||||
behaviorContext->Class<SceneGraph::NodeIndex>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene.graph")
|
||||
->Constructor<>()
|
||||
->Constructor<const SceneGraph::NodeIndex&>()
|
||||
->Method("AsNumber", &SceneGraph::NodeIndex::AsNumber)
|
||||
->Method("Distance", &SceneGraph::NodeIndex::Distance)
|
||||
->Method("IsValid", &SceneGraph::NodeIndex::IsValid)
|
||||
->Method("Equal", &SceneGraph::NodeIndex::operator==)
|
||||
->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::Equal)
|
||||
->Method("ToString", [](const SceneGraph::NodeIndex& node) { return AZStd::string::format("%u", node.m_value); })
|
||||
->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
|
||||
;
|
||||
|
||||
behaviorContext->Class<SceneGraph::Name>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene.graph")
|
||||
->Constructor()
|
||||
->Method("GetPath", &SceneGraph::Name::GetPath)
|
||||
->Method("GetName", &SceneGraph::Name::GetName)
|
||||
->Method("ToString", [](const SceneGraph::Name& self){ return self.GetName(); })
|
||||
->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
|
||||
;
|
||||
|
||||
behaviorContext->Class<SceneGraph>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene.graph")
|
||||
@@ -62,41 +86,23 @@ namespace AZ
|
||||
->Method("GetNodeChild", [](const SceneGraph& self, NodeIndex node) { return self.GetNodeChild(node); })
|
||||
->Method("GetNodeCount", &SceneGraph::GetNodeCount)
|
||||
->Method("FindWithPath", [](const SceneGraph& self, const AZStd::string& path)
|
||||
{
|
||||
return self.Find(path);
|
||||
})
|
||||
{
|
||||
return self.Find(path);
|
||||
})
|
||||
->Method("FindWithRootAndPath", [](const SceneGraph& self, NodeIndex root, const AZStd::string& path)
|
||||
{
|
||||
return self.Find(root, path);
|
||||
})
|
||||
{
|
||||
return self.Find(root, path);
|
||||
})
|
||||
->Method("GetNodeContent", [](const SceneGraph& self, NodeIndex node) -> GraphObjectProxy*
|
||||
{
|
||||
auto graphObject = self.GetNodeContent(node);
|
||||
if (graphObject)
|
||||
{
|
||||
auto graphObject = self.GetNodeContent(node);
|
||||
if (graphObject)
|
||||
{
|
||||
GraphObjectProxy* proxy = aznew GraphObjectProxy(graphObject);
|
||||
return proxy;
|
||||
}
|
||||
return nullptr;
|
||||
})
|
||||
;
|
||||
|
||||
behaviorContext->Class<SceneGraph::NodeIndex>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene.graph")
|
||||
->Method("AsNumber", &SceneGraph::NodeIndex::AsNumber)
|
||||
->Method("Distance", &SceneGraph::NodeIndex::Distance)
|
||||
->Method("IsValid", &SceneGraph::NodeIndex::IsValid)
|
||||
->Method("Equal", &SceneGraph::NodeIndex::operator==)
|
||||
->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::Equal)
|
||||
;
|
||||
|
||||
behaviorContext->Class<SceneGraph::Name>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene.graph")
|
||||
->Method("GetPath", &SceneGraph::Name::GetPath)
|
||||
->Method("GetName", &SceneGraph::Name::GetName)
|
||||
;
|
||||
GraphObjectProxy* proxy = aznew GraphObjectProxy(graphObject);
|
||||
return proxy;
|
||||
}
|
||||
return nullptr;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace AZ
|
||||
// Type needs to be able to store an index in a NodeHeader (currently 21-bits).
|
||||
using IndexType = uint32_t;
|
||||
|
||||
NodeIndex() = default;
|
||||
NodeIndex(const NodeIndex& rhs) = default;
|
||||
NodeIndex& operator=(const NodeIndex& rhs) = default;
|
||||
|
||||
@@ -87,10 +88,9 @@ namespace AZ
|
||||
private:
|
||||
static const IndexType INVALID_INDEX = static_cast<IndexType>(-1);
|
||||
|
||||
inline NodeIndex();
|
||||
inline explicit NodeIndex(IndexType value);
|
||||
|
||||
IndexType m_value;
|
||||
IndexType m_value = NodeIndex::INVALID_INDEX;
|
||||
};
|
||||
|
||||
// NodeHeader contains the relationship a node has with its surrounding nodes and additional information about a node.
|
||||
|
||||
@@ -22,11 +22,6 @@ namespace AZ
|
||||
//
|
||||
// NodeIndex
|
||||
//
|
||||
SceneGraph::NodeIndex::NodeIndex()
|
||||
: m_value(NodeIndex::INVALID_INDEX)
|
||||
{
|
||||
}
|
||||
|
||||
bool SceneGraph::NodeIndex::IsValid() const
|
||||
{
|
||||
return m_value != NodeIndex::INVALID_INDEX;
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace AZ
|
||||
RootIterator& operator++();
|
||||
RootIterator operator++(int);
|
||||
|
||||
const Iterator& GetBaseIterator();
|
||||
const Iterator& GetBaseIterator() const;
|
||||
protected:
|
||||
Iterator m_iterator;
|
||||
Function m_converter;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
template<typename Iterator, typename ReturnType>
|
||||
const Iterator& ConvertIterator<Iterator, ReturnType, void>::GetBaseIterator()
|
||||
const Iterator& ConvertIterator<Iterator, ReturnType, void>::GetBaseIterator() const
|
||||
{
|
||||
return m_iterator;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace AZ
|
||||
RootIterator& operator++();
|
||||
RootIterator operator++(int);
|
||||
|
||||
const Iterator& GetBaseIterator();
|
||||
const Iterator& GetBaseIterator() const;
|
||||
|
||||
protected:
|
||||
// Pseudo default constructor.
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
template<typename Iterator>
|
||||
auto FilterIterator<Iterator, void>::GetBaseIterator()->const Iterator&
|
||||
auto FilterIterator<Iterator, void>::GetBaseIterator() const -> const Iterator&
|
||||
{
|
||||
return m_iterator;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,8 @@ namespace AZ
|
||||
Iterator cbegin() const;
|
||||
Iterator cend() const;
|
||||
|
||||
[[nodiscard]] bool empty() const;
|
||||
|
||||
private:
|
||||
Iterator m_begin;
|
||||
Iterator m_end;
|
||||
@@ -59,4 +61,4 @@ namespace AZ
|
||||
} // SceneAPI
|
||||
} // AZ
|
||||
|
||||
#include <SceneAPI/SceneCore/Containers/Views/View.inl>
|
||||
#include <SceneAPI/SceneCore/Containers/Views/View.inl>
|
||||
|
||||
@@ -62,6 +62,12 @@ namespace AZ
|
||||
{
|
||||
return m_end;
|
||||
}
|
||||
|
||||
template<typename Iterator>
|
||||
[[nodiscard]] bool View<Iterator>::empty() const
|
||||
{
|
||||
return m_begin == m_end;
|
||||
}
|
||||
}; // Views
|
||||
} // Containers
|
||||
} // SceneAPI
|
||||
|
||||
Reference in New Issue
Block a user