本文整理汇总了C++中CAtlList::GetTailPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CAtlList::GetTailPosition方法的具体用法?C++ CAtlList::GetTailPosition怎么用?C++ CAtlList::GetTailPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAtlList
的用法示例。
在下文中一共展示了CAtlList::GetTailPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddPoint
void CEllipseCenterGroup::AddPoint(CAtlList<EllipseCenter>& centers, IntersectFunction intersect, int x, int y)
{
POSITION pos = centers.GetTailPosition();
while (pos) {
POSITION posCur = pos;
auto& center = centers.GetPrev(pos);
int dyIntersect = intersect(x - center.x, y - center.y);
if (dyIntersect != CEllipse::NO_INTERSECT_INNER) {
int yIntersect = (dyIntersect == CEllipse::NO_INTERSECT_OUTER) ? (y - m_pEllipse->GetYRadius() - 1) : (center.y + dyIntersect);
if (yIntersect < center.yStopDrawing) {
center.yStopDrawing = yIntersect;
if (pos && center.yStopDrawing <= centers.GetAt(pos).yStopDrawing) {
centers.RemoveAt(posCur);
}
} else {
break;
}
}
}
auto& center = centers.GetAt(centers.AddTail());
center.x = x;
center.y = y;
center.yStopDrawing = y + m_pEllipse->GetYRadius();
}
示例2: depNode
//THIS FUNCTION IS QUITE COMPLICATED BECAUSE
//IT HAS TO DEAL WITH MAYA NAME MANGLING!
//tokenize the path.
//add each token into the element list which tracks the attributes and indices
//for each entry added make sure there are no parents left out from maya name mangling.
//after the list is populated and missing elements area added
//we reiterate and produce the final result.
MPlug FxInternal::DecodePlug(const CStringA& plugStr)
{
MPlug result;
MFnDependencyNode depNode(GetSite());
CAtlList<PathDecodeElement> elementList;
//tokenize the path
int iLastPos=0;
int iThisPos=0;
CStringA subStr;
while( iLastPos= iThisPos,
subStr=plugStr.Tokenize(".[]", iThisPos),
iThisPos != -1 )
{
//char lastChar= subStr[iLastPos];
//char thisChar= subStr[iThisPos];
//are we looking at a named portion?
if(iLastPos == 0
|| plugStr[iLastPos-1]=='.'
|| (plugStr[iLastPos-1]==']' && plugStr[iLastPos]=='.'))
{
//if the name is length zero then it must be the case when
// you do last[#]. The situation is caused by the sequence "]."
//if we dont have a name we can skip since only 1d arrays are allowed.
if(subStr.GetLength() > 0)
{
//everything we add is going to be based on the current tail.
//because we are adding parents, as we find parents we can continue
//to add them to this position so that they will order themselves properly
POSITION insertPos= elementList.GetTailPosition();
//calculate the cancel condition.
//it is the current tail's object if a tail exists otherwise NULL
//NULL indicates go all the way to the root
MObject cancelObj= MObject::kNullObj;
if(elementList.GetCount() > 0)
{
cancelObj= elementList.GetTail().Attribute.object();
}
//get the object we are currently working with
MObject thisObj= depNode.attribute(subStr.GetString());
if(thisObj.isNull())
return MPlug();//Critical element of the path was not found...return NULL
//add it to the list so that we have something to insertBefore
elementList.AddTail();
elementList.GetTail().Name= subStr;
elementList.GetTail().Attribute.setObject(thisObj);
//walk through all of the parents until we reach cancel condition.
//we can add the current element onto the list in the same way.
for( MFnAttribute itrAttr( elementList.GetTail().Attribute.parent() );
!itrAttr.object().isNull() && (cancelObj != itrAttr.object());
itrAttr.setObject(itrAttr.parent()))
{
PathDecodeElement element;
element.Attribute.setObject( itrAttr.object() );
//we change the position so that the grandparent is inserted before the parent
insertPos= elementList.InsertBefore( insertPos, element);
}
}
}
//are we looking at a numbered portion?
else if(plugStr[iLastPos-1]=='[' && plugStr[iThisPos-1]==']')
{
//if so change the array index.
elementList.GetTail().IsArray= true;
elementList.GetTail().Index = atoi( subStr.GetString() );
}
else
DXCC_ASSERT(false);//VERY POORLY FORMED STRING
}
//produce the result plug off of the elementList.
bool first= true;
for(POSITION pos= elementList.GetHeadPosition();
pos != NULL;
elementList.GetNext(pos))
{
PathDecodeElement& element= elementList.GetAt(pos);
//.........这里部分代码省略.........