本文整理汇总了C++中SmartPtr::AddObject方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartPtr::AddObject方法的具体用法?C++ SmartPtr::AddObject怎么用?C++ SmartPtr::AddObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartPtr
的用法示例。
在下文中一共展示了SmartPtr::AddObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
HRESULT SceneGraphEditor::Initialize(__in ISceneGraph *pSceneGraph, __in ISceneObjectCamera *pCamera, const bool &bDrawGrid)
{
if (!pSceneGraph || !pCamera)
return E_INVALIDARG;
HRESULT hr = CreateGroup(L"SceneGraphEditor", &m_spContent);
IF_FAILED_RETURN(hr);
SmartPtr<ISceneObjectGroup> spRoot;
hr = pSceneGraph->GetSceneRoot(&spRoot);
IF_FAILED_RETURN(hr);
m_spSceneGraph = pSceneGraph;
hr = spRoot->AddObject(m_spContent.CastTo<ISceneObject>());
IF_FAILED_RETURN(hr);
m_DrawGrid = bDrawGrid;
m_spCamera = pCamera;
if (bDrawGrid)
{
hr = CreateSceneGrid();
}
return hr;
}
示例2: AddToGroup
HRESULT SceneGraphEditor::AddToGroup(__in ISceneObject *pObject, __in UINT depth)
{
// Invalid depth
if (m_PendingGroups.Length() != depth)
{
return E_INVALIDARG;
}
HRESULT hr;
if (m_PendingGroups.Length() == 0)
{
hr = m_spContent->AddObject(pObject);
}
else
{
SmartPtr<ISceneObjectGroup> spGroup = m_PendingGroups.GetLast();
hr = spGroup->AddObject(pObject);
}
return m_spSceneGraph->Validate();
}