本文整理汇总了C++中shapelist::compatibility_iterator::GetNext方法的典型用法代码示例。如果您正苦于以下问题:C++ compatibility_iterator::GetNext方法的具体用法?C++ compatibility_iterator::GetNext怎么用?C++ compatibility_iterator::GetNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shapelist::compatibility_iterator
的用法示例。
在下文中一共展示了compatibility_iterator::GetNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Layout
void wxSFAutoLayout::Layout(wxSFDiagramManager& manager, const wxString& algname)
{
wxSFLayoutAlgorithm *pAlg = m_mapAlgorithms[ algname ];
if( pAlg )
{
ShapeList lstShapes;
manager.GetShapes( CLASSINFO(wxSFShapeBase), lstShapes );
// remove all child shapes
ShapeList::compatibility_iterator it = lstShapes.GetFirst();
while( it )
{
wxSFShapeBase *pShape = it->GetData();
if( pShape->GetParentShape() || pShape->IsKindOf(CLASSINFO(wxSFLineShape)) )
{
lstShapes.DeleteNode( it );
it = lstShapes.GetFirst();
}
else
it = it->GetNext();
}
pAlg->DoLayout( lstShapes );
manager.MoveShapesFromNegatives();
if( manager.GetShapeCanvas() ) UpdateCanvas( manager.GetShapeCanvas() );
}
}
示例3: ScaleChildren
void wxSFShapeBase::ScaleChildren(double x, double y)
{
ShapeList m_lstChildren;
GetChildShapes(sfANY, m_lstChildren, sfRECURSIVE);
ShapeList::compatibility_iterator node = m_lstChildren.GetFirst();
while(node)
{
wxSFShapeBase* pShape = node->GetData();
if((pShape->GetStyle() & sfsSIZE_CHANGE) && !pShape->IsKindOf(CLASSINFO(wxSFTextShape)))
{
pShape->Scale(x, y, sfWITHOUTCHILDREN);
}
if( (pShape->GetStyle() & sfsPOSITION_CHANGE) && ((pShape->GetVAlign() == valignNONE) || (pShape->GetHAlign() == halignNONE)) )
{
pShape->SetRelativePosition(pShape->m_nRelativePosition.x*x, pShape->m_nRelativePosition.y*y);
}
// re-align shapes which have set any alignment mode
pShape->DoAlignment();
node = node->GetNext();
}
}
示例4: RemoveShape
void wxSFDiagramManager::RemoveShape(wxSFShapeBase* shape, bool refresh)
{
if(shape)
{
wxSFShapeBase *pParent = shape->GetParentShape();
// remove connected lines (to all children)
ShapeList lstChildren;
ShapeList lstConnections;
ShapeList lstRemovedConnections;
// get all shape's children
shape->GetChildShapes(sfANY, lstChildren, sfRECURSIVE);
lstChildren.Append(shape);
// retrieve all assigned lines
ShapeList::compatibility_iterator snode = lstChildren.GetFirst();
while(snode)
{
GetAssignedConnections(snode->GetData(), CLASSINFO(wxSFLineShape), wxSFShapeBase::lineBOTH, lstConnections);
snode = snode->GetNext();
}
// remove all assigne lines
ShapeList::compatibility_iterator node = lstConnections.GetFirst();
while(node)
{
// one connection may be used by the parent and also by his child
if(lstRemovedConnections.IndexOf(node->GetData()) == wxNOT_FOUND)
{
lstRemovedConnections.Append(node->GetData());
RemoveShape(node->GetData(), false);
}
node = node->GetNext();
}
// remove the shape also from m_lstCurrentShapes list
if( m_pShapeCanvas ) m_pShapeCanvas->RemoveFromTemporaries( shape );
// remove the shape
RemoveItem(shape);
if( pParent ) pParent->Update();
if( refresh && m_pShapeCanvas ) m_pShapeCanvas->Refresh(false);
}
}
示例5: MoveShapesFromNegatives
void wxSFDiagramManager::MoveShapesFromNegatives()
{
wxSFShapeBase *pShape;
wxRealPoint shapePos;
double minx = 0, miny = 0;
// find the maximal negative position value
ShapeList shapes;
GetShapes(CLASSINFO(wxSFShapeBase), shapes);
ShapeList::compatibility_iterator node = shapes.GetFirst();
while(node)
{
shapePos = node->GetData()->GetAbsolutePosition();
if(node == shapes.GetFirst())
{
minx = shapePos.x;
miny = shapePos.y;
}
else
{
if(shapePos.x < minx)minx = shapePos.x;
if(shapePos.y < miny)miny = shapePos.y;
}
node = node->GetNext();
}
// move all parents shape so they (and their children) will be located in the positive values only
if((minx < 0) || (miny < 0))
{
node = shapes.GetFirst();
while(node)
{
pShape = node->GetData();
if(pShape->GetParentShape() == NULL)
{
if(minx < 0)pShape->MoveBy(abs((int)minx), 0);
if(miny < 0)pShape->MoveBy(0, abs((int)miny));
}
node = node->GetNext();
}
}
}
示例6: OnTopHandle
void wxSFMultiSelRect::OnTopHandle(wxSFShapeHandle& handle)
{
if(GetParentCanvas() && !AnyHeightExceeded(wxPoint(0, -handle.GetDelta().y)))
{
wxXS::RealPointList::compatibility_iterator ptnode;
wxSFLineShape* pLine;
wxRealPoint* pt;
double dy, sy = (GetRectSize().y - 2*sfDEFAULT_ME_OFFSET - handle.GetDelta().y)/(GetRectSize().y - 2*sfDEFAULT_ME_OFFSET);
ShapeList m_lstSelection;
GetParentCanvas()->GetSelectedShapes(m_lstSelection);
ShapeList::compatibility_iterator node = m_lstSelection.GetFirst();
while(node)
{
wxSFShapeBase* pShape = node->GetData();
if(!pShape->IsKindOf(CLASSINFO(wxSFLineShape)))
{
if(pShape->ContainsStyle(sfsPOSITION_CHANGE))
{
if(pShape->GetParentShape())
{
pShape->SetRelativePosition(pShape->GetRelativePosition().x, pShape->GetRelativePosition().y*sy);
}
else
{
double dy = handle.GetDelta().y - (pShape->GetAbsolutePosition().y - (GetAbsolutePosition().y + sfDEFAULT_ME_OFFSET))/(GetRectSize().y - 2*sfDEFAULT_ME_OFFSET)*handle.GetDelta().y;
pShape->MoveBy(0, dy);
}
}
if(pShape->ContainsStyle(sfsSIZE_CHANGE))pShape->Scale(1, sy, sfWITHCHILDREN);
if( ! pShape->ContainsStyle( sfsNO_FIT_TO_CHILDREN ) ) pShape->FitToChildren();
}
else
{
if(pShape->ContainsStyle(sfsPOSITION_CHANGE))
{
pLine = (wxSFLineShape*)pShape;
ptnode = pLine->GetControlPoints().GetFirst();
while(ptnode)
{
pt = ptnode->GetData();
dy = handle.GetDelta().y - (pt->y - (GetAbsolutePosition().y + sfDEFAULT_ME_OFFSET))/(GetRectSize().y - 2*sfDEFAULT_ME_OFFSET)*handle.GetDelta().y;
pt->y += dy;
pt->y = floor(pt->y);
ptnode = ptnode->GetNext();
}
}
}
node = node->GetNext();
}
}
}
示例7: SetPastedShapes
void wxSFShapePasteEvent::SetPastedShapes(const ShapeList &list)
{
ShapeList::compatibility_iterator node = list.GetFirst();
while(node)
{
m_lstPastedShapes.Append(node->GetData());
node = node->GetNext();
}
}
示例8: 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();
}
}
示例9: RemoveShapes
void wxSFDiagramManager::RemoveShapes(const ShapeList& selection)
{
wxSFShapeBase* pShape;
ShapeList::compatibility_iterator node = selection.GetFirst();
while(node)
{
pShape = node->GetData();
// it is important to check whether double-linked shapes already exist before
// they are deleted
if(Contains(pShape))RemoveShape(pShape, false);
node = node->GetNext();
}
}
示例10: ProcessState
void udLoopCaseAlgorithm::ProcessState(wxSFShapeBase *state)
{
wxASSERT(state);
if(!state)return;
// check whether the state is already processed
if( m_lstProcessedElements.IndexOf(state) != wxNOT_FOUND )return;
wxSFDiagramManager *pDiagManager = state->GetShapeManager();
udLanguage *pLang = m_pParentGenerator->GetActiveLanguage();
pLang->SingleLineCommentCmd(wxT("State ID: ") + m_pParentGenerator->MakeIDName(state));
// find state neighbours
ShapeList lstNeighbours;
pDiagManager->GetNeighbours(state, lstNeighbours, CLASSINFO(umlTransitionItem), wxSFShapeBase::lineSTARTING, sfDIRECT);
// find next processable state
if( !lstNeighbours.IsEmpty() && ( m_lstProcessedElements.IndexOf(lstNeighbours.GetFirst()->GetData()) == wxNOT_FOUND ) )
{
m_pNextElement = lstNeighbours.GetFirst()->GetData();
}
else
m_pNextElement = NULL;
// process given element
udElementProcessor *pProcessor = GetElementProcessor(state->GetClassInfo()->GetClassName());
if(pProcessor)
{
pProcessor->ProcessElement(state);
}
else
{
pLang->SingleLineCommentCmd(wxString::Format(wxT( "!!! WARNING: UNSUPPORTED ELEMENT ('%s') !!!"), ((udProjectItem*)state->GetUserData())->GetName().c_str()));
IPluginManager::Get()->Log(wxString::Format(wxT("WARNING: '%s' element is not supported by this algorithm."), ((udProjectItem*)state->GetUserData())->GetName().c_str()));
}
// set the state as processes
m_lstProcessedElements.Append(state);
m_pPrevElement = state;
// process connected states
ShapeList::compatibility_iterator node = lstNeighbours.GetFirst();
while(node)
{
wxSFShapeBase *pNext = node->GetData();
ProcessState( pNext );
node = node->GetNext();
}
}
示例11: OnRightHandle
void wxSFMultiSelRect::OnRightHandle(wxSFShapeHandle& handle)
{
if(GetParentCanvas() && !AnyWidthExceeded(handle.GetDelta()))
{
wxXS::RealPointList::compatibility_iterator ptnode;
wxSFLineShape* pLine;
wxRealPoint* pt;
double dx, sx = (GetRectSize().x - 2*sfDEFAULT_ME_OFFSET + handle.GetDelta().x)/(GetRectSize().x - 2*sfDEFAULT_ME_OFFSET);
ShapeList m_lstSelection;
GetParentCanvas()->GetSelectedShapes(m_lstSelection);
ShapeList::compatibility_iterator node = m_lstSelection.GetFirst();
while(node)
{
wxSFShapeBase* pShape = node->GetData();
// scale main parent shape
if(!pShape->IsKindOf(CLASSINFO(wxSFLineShape)))
{
dx = (pShape->GetAbsolutePosition().x - (GetAbsolutePosition().x + sfDEFAULT_ME_OFFSET))/(GetRectSize().x - 2*sfDEFAULT_ME_OFFSET)*handle.GetDelta().x;
if(pShape->ContainsStyle(sfsSIZE_CHANGE))pShape->Scale(sx, 1, sfWITHCHILDREN);
if(pShape->ContainsStyle(sfsPOSITION_CHANGE))pShape->MoveBy(dx, 0);
if( ! pShape->ContainsStyle( sfsNO_FIT_TO_CHILDREN ) ) pShape->FitToChildren();
}
else
{
if(pShape->ContainsStyle(sfsPOSITION_CHANGE))
{
pLine = (wxSFLineShape*)pShape;
ptnode = pLine->GetControlPoints().GetFirst();
while(ptnode)
{
pt = ptnode->GetData();
dx = ( pt->x - (GetAbsolutePosition().x + sfDEFAULT_ME_OFFSET))/(GetRectSize().x - 2*sfDEFAULT_ME_OFFSET)*handle.GetDelta().x;
pt->x += dx;
pt->x = floor(pt->x);
ptnode = ptnode->GetNext();
}
}
}
node = node->GetNext();
}
}
}
示例12: _OnDragging
void wxSFShapeBase::_OnDragging(const wxPoint& pos)
{
//wxASSERT(m_pParentManager);
if( !m_pParentManager )return;
if(m_fVisible && m_fActive && (m_nStyle & sfsPOSITION_CHANGE))
{
if(m_fFirstMove)
{
m_nMouseOffset = wxRealPoint(pos.x, pos.y) - this->GetAbsolutePosition();
}
// get shape BB BEFORE movement and combine it with BB of assigned lines
wxRect prevBB;
GetCompleteBoundingBox(prevBB, bbSELF | bbCONNECTIONS | bbCHILDREN | bbSHADOW);
this->MoveTo(pos.x - m_nMouseOffset.x, pos.y - m_nMouseOffset.y);
this->OnDragging(pos);
// GUI controls in child control shapes must be updated explicitely
wxSFControlShape *pCtrl;
ShapeList lstChildCtrls;
GetChildShapes( CLASSINFO(wxSFControlShape), lstChildCtrls, sfRECURSIVE );
ShapeList::compatibility_iterator node = lstChildCtrls.GetFirst();
while( node )
{
pCtrl = (wxSFControlShape*) node->GetData();
pCtrl->UpdateControl();
node = node->GetNext();
}
// get shape BB AFTER movement and combine it with BB of assigned lines
wxRect currBB;
GetCompleteBoundingBox(currBB, bbSELF | bbCONNECTIONS | bbCHILDREN | bbSHADOW);
// update canvas
Refresh( prevBB.Union(currBB), sfDELAYED );
m_fFirstMove = false;
}
if( GetParentShape() && (m_nStyle & sfsPROPAGATE_DRAGGING) )
{
GetParentShape()->_OnDragging( pos );
}
}
示例13: 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();
}
}
示例14: 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();
}
}
示例15: OnEndHandle
void wxSFMultiSelRect::OnEndHandle(wxSFShapeHandle& handle)
{
// inform all selected shapes about end of the handle dragging
if(GetParentCanvas())
{
ShapeList lstShapes;
GetParentCanvas()->GetSelectedShapes(lstShapes);
ShapeList::compatibility_iterator node = lstShapes.GetFirst();
while(node)
{
node->GetData()->OnEndHandle(handle);
node = node->GetNext();
}
}
}