本文整理汇总了C++中NodeAttribute::IsLinkedToNodeGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeAttribute::IsLinkedToNodeGeometry方法的具体用法?C++ NodeAttribute::IsLinkedToNodeGeometry怎么用?C++ NodeAttribute::IsLinkedToNodeGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeAttribute
的用法示例。
在下文中一共展示了NodeAttribute::IsLinkedToNodeGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: map
/********************************************************************************************
> static CCAttrMap * CCAttrMap::MakeAttrMapFromRenderRegion(RenderRegion * pRegion)
Author: David_McClarnon (Xara Group Ltd) <[email protected]>
Created: 24/2/2000
Inputs: The render region to get the attribute map from
Outputs: An attribute map (copied) from the render region
Returns: -
Purpose: Makes an attribute out of the render region's current attribute state
Notes: You MUST call DeleteAttributes afterwards to release memory - delete is
not sufficient
SeeAlso: -
********************************************************************************************/
CCAttrMap * CCAttrMap::MakeAttrMapFromRenderRegion(RenderRegion * pRegion)
{
CCAttrMap * pMap = new CCAttrMap;
ENSURE(pMap,"No mem for attrmap");
if(!pMap)
return NULL;
// let's get every attribute in the render region
AttributeValue * pAttrVal = NULL;
NodeAttribute * pNewAttr = NULL;
for (UINT32 i = 0; i < ATTR_FIRST_FREE_ID; i++)
{
pAttrVal = pRegion->GetCurrentAttribute(i);
// make a new node out of this attribute value
pNewAttr = pAttrVal->MakeNode();
// Karim 12/04/2000
// AttributeValues _do_not_have_to_have_ a corresponding NodeAttribute,
// so can we please *check* that MakeNode didn't just return NULL!
if (pNewAttr != NULL)
{
if(!pNewAttr->IsLinkedToNodeGeometry())
pMap->SetAt(pNewAttr->GetAttributeType(),pNewAttr);
else
{
delete pNewAttr;
pNewAttr = AttributeManager::GetDefaultAttribute((AttrIndex) i);
if(pNewAttr)
{
ENSURE(pNewAttr->IsLinkedToNodeGeometry(),"Incorrect NodeAttribute returned by GetDefaultAttribute");
pMap->SetAt(pNewAttr->GetAttributeType(), pNewAttr);
}
else
return NULL;
}
}
}
pMap->attrMapCreator = NULL;
return pMap;
}