本文整理汇总了C++中ShapeList::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ ShapeList::Clear方法的具体用法?C++ ShapeList::Clear怎么用?C++ ShapeList::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShapeList
的用法示例。
在下文中一共展示了ShapeList::Clear方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindTransWithIdenticalActions
void udStateChartOptimizer::FindTransWithIdenticalActions(ShapeList& transitions, ShapeList& sublist)
{
sublist.Clear();
ShapeList::compatibility_iterator node = transitions.GetFirst();
if( !node ) return;
udTransElementItem *pTransElement;
wxSFLineShape *pTrans = (wxSFLineShape*)node->GetData();
wxString sActions, sTemplate = ((udTransElementItem*)pTrans->GetUserData())->GetActionsString();
sTemplate.Replace(wxT(" "), wxT(""));
while(node)
{
pTrans = (wxSFLineShape*)node->GetData();
pTransElement = (udTransElementItem*)pTrans->GetUserData();
sActions = pTransElement->GetActionsString();
sActions.Replace(wxT(" "), wxT(""));
if( sActions == sTemplate )
{
node = node->GetNext();
transitions.DeleteObject(pTrans);
sublist.Append(pTrans);
}
else
node = node->GetNext();
}
}
示例2: GetNeighbours
void wxSFShapeBase::GetNeighbours(ShapeList& neighbours, wxClassInfo *shapeInfo, CONNECTMODE condir, bool direct)
{
if( !this->IsKindOf(CLASSINFO(wxSFLineShape)) )
{
m_lstProcessed.Clear();
this->_GetNeighbours(neighbours, shapeInfo, condir, direct);
// delete starting object if necessary (can be added in a case of complex connection network)
neighbours.DeleteObject(this);
}
}
示例3: GetShapesInside
void wxSFDiagramManager::GetShapesInside(const wxRect& rct, ShapeList& shapes)
{
shapes.Clear();
wxSFShapeBase* pShape;
ShapeList lstShapes;
GetShapes(CLASSINFO(wxSFShapeBase), lstShapes);
ShapeList::compatibility_iterator node = lstShapes.GetFirst();
while(node)
{
pShape = node->GetData();
if(pShape->IsVisible() && pShape->IsActive() && pShape->Intersects(rct))shapes.Append(pShape);
node = node->GetNext();
}
}
示例4: GetShapesAtPosition
void wxSFDiagramManager::GetShapesAtPosition(const wxPoint& pos, ShapeList& shapes)
{
shapes.Clear();
wxSFShapeBase *pShape;
ShapeList lstShapes;
GetShapes(CLASSINFO(wxSFShapeBase), lstShapes);
ShapeList::compatibility_iterator node = lstShapes.GetFirst();
while(node)
{
pShape = node->GetData();
if(pShape->IsVisible() && pShape->IsActive() && pShape->Contains(pos))shapes.Append(pShape);
node = node->GetNext();
}
}
示例5: FindTransWithIdenticalTarget
void udStateChartOptimizer::FindTransWithIdenticalTarget(ShapeList& transitions, ShapeList& sublist)
{
sublist.Clear();
ShapeList::compatibility_iterator node = transitions.GetFirst();
if( !node ) return;
wxSFLineShape *pTrans = (wxSFLineShape*)node->GetData();
int nTrgId = pTrans->GetTrgShapeId();
while(node)
{
pTrans = (wxSFLineShape*)node->GetData();
if( pTrans->GetTrgShapeId() == nTrgId )
{
node = node->GetNext();
transitions.DeleteObject(pTrans);
sublist.Append(pTrans);
}
else
node = node->GetNext();
}
}
示例6: DoLayout
void wxSFLayoutHorizontalTree::DoLayout(ShapeList& shapes)
{
ShapeList lstConnections;
ShapeList lstRoots;
wxRealPoint nStart = GetTopLeft( shapes );
m_nMinY = nStart.y;
// find root items
for( ShapeList::iterator it = shapes.begin(); it != shapes.end(); ++ it )
{
wxSFShapeBase *pShape = *it;
lstConnections.Clear();
pShape->GetAssignedConnections( CLASSINFO(wxSFLineShape), wxSFShapeBase::lineENDING, lstConnections );
if( lstConnections.IsEmpty() )
{
m_nCurrMaxHeight = 0;
ProcessNode( pShape, nStart.x );
}
}
}
示例7: ProcessClassDeclaration
void udCPPClassElementProcessor::ProcessClassDeclaration(wxSFShapeBase* element)
{
udLanguage *pLang = m_pParentGenerator->GetActiveLanguage();
udClassAlgorithm *pAlg = (udClassAlgorithm*) m_pParentGenerator->GetActiveAlgorithm();
// get base classes if exists
ShapeList lstBases;
umlClassDiagram::GetBaseClasses( (umlClassItem*)element, lstBases );
int nTemplateIndex = 0;
wxString sBases;
for( ShapeList::iterator it = lstBases.begin(); it != lstBases.end(); ++it )
{
if( it != lstBases.begin() ) sBases << wxT(", ");
sBases << pLang->MakeValidIdentifier( udPROJECT::GetDiagramElement(*it)->GetName() );
// add template parameter if exists
umlClassTemplateItem *pTemplate = wxDynamicCast( *it, umlClassTemplateItem );
if( pTemplate )
{
// find corespondent template binding connection
ShapeList lstConnections;
element->GetShapeManager()->GetAssignedConnections( element, CLASSINFO(umlTemplateBindItem), wxSFShapeBase::lineSTARTING, lstConnections );
if( !lstConnections.IsEmpty() )
{
// append bind type to the base name
udTemplateBindElementItem *pBindElement = wxDynamicCast( udPROJECT::GetDiagramElement( lstConnections.Item(nTemplateIndex)->GetData() ), udTemplateBindElementItem );
if( pBindElement )
{
sBases << wxT("<") << pBindElement->GetBindType() << wxT(">");
}
}
nTemplateIndex++;
}
}
udClassElementItem *pClass = (udClassElementItem*) udPROJECT::GetDiagramElement(element);
//generate comment if requested
pLang->WriteCodeBlocks( udGenerator::GetComment( pClass, pLang) );
// write template definition if needed
udClassTemplateElementItem *pClassTempl = wxDynamicCast( pClass, udClassTemplateElementItem );
if( pClassTempl )
{
pLang->WriteCodeBlocks( wxT("template <typename ") + pClassTempl->GetTemplateName() + wxT(">") );
}
// generate class declaration
pLang->ClassDeclCmd( pLang->MakeValidIdentifier( pClass->GetName() ), sBases );
pLang->BeginCmd();
// declare class members
int nAccessType = 0;
wxClassInfo *pPrevType;
SerializableList lstMembers;
ShapeList lstAssocs;
while( pLang->GetAccessTypeString( (udLanguage::ACCESSTYPE) nAccessType ) != wxEmptyString )
{
pLang->WriteCodeBlocks( pLang->GetAccessTypeString( (udLanguage::ACCESSTYPE) nAccessType ) + wxT(":") );
pLang->IncIndentation();
lstMembers.Clear();
lstAssocs.Clear();
pPrevType = NULL;
// process associations
umlClassDiagram::GetClassAssociations( (umlClassItem*) element, CLASSINFO(wxSFLineShape), wxSFLineShape::lineSTARTING, (udLanguage::ACCESSTYPE) nAccessType, lstAssocs );
for( ShapeList::iterator it = lstAssocs.begin(); it != lstAssocs.end(); ++it )
{
udElementProcessor *pProcessor = pAlg->GetElementProcessor( (*it)->GetClassInfo()->GetClassName() );
if( pProcessor ) pProcessor->ProcessElement( *it );
}
// process class members
umlClassDiagram::GetClassMembers( (umlClassItem*) element, CLASSINFO(udMemberDataLinkItem), (udLanguage::ACCESSTYPE) nAccessType, lstMembers);
umlClassDiagram::GetClassMembers( (umlClassItem*) element, CLASSINFO(udMemberFunctionLinkItem), (udLanguage::ACCESSTYPE) nAccessType, lstMembers);
for( SerializableList::iterator it = lstMembers.begin(); it != lstMembers.end(); ++it )
{
if( pPrevType && ((*it)->GetClassInfo() != pPrevType) ) pLang->NewLine();
// generate comment
pLang->WriteCodeBlocks( udGenerator::GetComment( ((udCodeLinkItem*)*it)->GetOriginal(), pLang ) );
// generate function decl
pLang->WriteCodeBlocks( ((udCodeLinkItem*)*it)->ToString( udCodeItem::cfDECLARATION, pLang ) );
pPrevType = (*it)->GetClassInfo();
}
nAccessType++;
pLang->DecIndentation();
pLang->NewLine();
}
//.........这里部分代码省略.........
示例8: GetCompleteBoundingBox
void wxSFShapeBase::GetCompleteBoundingBox(wxRect &rct, int mask)
{
m_lstProcessed.Clear();
_GetCompleteBoundingBox(rct, mask);
}