mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-08 21:17:53 +00:00
CNodeSelection: Avoid copy churning
We can return via const reference to avoid making redundant copies of QLists.
This commit is contained in:
@@ -109,17 +109,17 @@ public:
|
|||||||
return mCachedBounds;
|
return mCachedBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Size() const { return mSelectedNodes.size(); }
|
uint32 Size() const { return mSelectedNodes.size(); }
|
||||||
bool IsEmpty() const { return Size() == 0; }
|
bool IsEmpty() const { return Size() == 0; }
|
||||||
CSceneNode* At(uint32 Index) const { return mSelectedNodes[Index]; }
|
CSceneNode* At(uint32 Index) const { return mSelectedNodes[Index]; }
|
||||||
CSceneNode* Front() const { return mSelectedNodes.front(); }
|
CSceneNode* Front() const { return mSelectedNodes.front(); }
|
||||||
CSceneNode* Back() const { return mSelectedNodes.back(); }
|
CSceneNode* Back() const { return mSelectedNodes.back(); }
|
||||||
CSceneNode* operator[](uint32 Index) const { return mSelectedNodes[Index]; }
|
CSceneNode* operator[](uint32 Index) const { return mSelectedNodes[Index]; }
|
||||||
void UpdateBounds() { mBoundsDirty = true; }
|
void UpdateBounds() { mBoundsDirty = true; }
|
||||||
void SetAllowedNodeTypes(FNodeFlags Types) { mAllowedNodes = Types; }
|
void SetAllowedNodeTypes(FNodeFlags Types) { mAllowedNodes = Types; }
|
||||||
bool IsAllowedType(ENodeType Type) const { return (mAllowedNodes & Type) != 0; }
|
bool IsAllowedType(ENodeType Type) const { return (mAllowedNodes & Type) != 0; }
|
||||||
bool IsAllowedType(CSceneNode *pNode) const { return (mAllowedNodes & pNode->NodeType()) != 0; }
|
bool IsAllowedType(CSceneNode *pNode) const { return (mAllowedNodes & pNode->NodeType()) != 0; }
|
||||||
QList<CSceneNode*> SelectedNodeList() const { return mSelectedNodes; }
|
const QList<CSceneNode*>& SelectedNodeList() const { return mSelectedNodes; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void Modified();
|
void Modified();
|
||||||
|
|||||||
Reference in New Issue
Block a user