当前位置: 首页>>代码示例>>C++>>正文


C++ shapelist::compatibility_iterator类代码示例

本文整理汇总了C++中shapelist::compatibility_iterator的典型用法代码示例。如果您正苦于以下问题:C++ compatibility_iterator类的具体用法?C++ compatibility_iterator怎么用?C++ compatibility_iterator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了compatibility_iterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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() );
	}
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:29,代码来源:AutoLayout.cpp

示例2: 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();
	}
}
开发者ID:LETARTARE,项目名称:CodeDesigner,代码行数:30,代码来源:StateChartOptimizer.cpp

示例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();
	}
}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:26,代码来源:ShapeBase.cpp

示例4: 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();
		}
	}
}
开发者ID:GWRon,项目名称:wx.mod,代码行数:58,代码来源:MultiSelRect.cpp

示例5: SetPastedShapes

void wxSFShapePasteEvent::SetPastedShapes(const ShapeList &list)
{
	ShapeList::compatibility_iterator node = list.GetFirst();
	while(node)
	{
		m_lstPastedShapes.Append(node->GetData());
		node = node->GetNext();
	}
}
开发者ID:05storm26,项目名称:codelite,代码行数:9,代码来源:SFEvents.cpp

示例6: 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();
	}
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:13,代码来源:DiagramManager.cpp

示例7: 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();
    }
}
开发者ID:LETARTARE,项目名称:CodeDesigner,代码行数:51,代码来源:LoopCaseAlgorithm.cpp

示例8: 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();
		}
	}
}
开发者ID:GWRon,项目名称:wx.mod,代码行数:49,代码来源:MultiSelRect.cpp

示例9: _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 );
	}
}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:48,代码来源:ShapeBase.cpp

示例10: 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();
	}
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:16,代码来源:DiagramManager.cpp

示例11: 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();
	}
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:16,代码来源:DiagramManager.cpp

示例12: UpdateAll

void wxSFDiagramManager::UpdateAll()
{
	wxSFShapeBase *pShape;
	
	ShapeList lstShapes;
	GetShapes( CLASSINFO(wxSFShapeBase), lstShapes );
	
	ShapeList::compatibility_iterator node = lstShapes.GetFirst();
	while( node )
	{
		pShape = node->GetData();
		// update only shapes withour children because the Update() function is called recursively on all parents
		if( !HasChildren( pShape ) ) pShape->Update();
		
		node = node->GetNext();
	}
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:17,代码来源:DiagramManager.cpp

示例13: 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();
		}
	}
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:46,代码来源:DiagramManager.cpp

示例14: 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();
		}
	}
}
开发者ID:GWRon,项目名称:wx.mod,代码行数:17,代码来源:MultiSelRect.cpp

示例15: UpdateConnections

void wxSFDiagramManager::UpdateConnections()
{
	if( !m_lstLinesForUpdate.IsEmpty() )
	{		
		wxSFLineShape* pLine;
		IDPair* pIDPair;
	
        // now check ids
		long oldSrcId, oldTrgId;
		long newSrcId, newTrgId;
		IDList::compatibility_iterator idnode;
		
		ShapeList::compatibility_iterator node = m_lstLinesForUpdate.GetFirst();
		while(node)
        {
			pLine = (wxSFLineShape*)node->GetData();
			newSrcId = oldSrcId = pLine->GetSrcShapeId();
			newTrgId = oldTrgId = pLine->GetTrgShapeId();
			idnode = m_lstIDPairs.GetFirst();
			while(idnode)
            {
				pIDPair = idnode->GetData();
				/*if(pIDPair->m_nNewID != pIDPair->m_nOldID)
				{*/
				if(oldSrcId == pIDPair->m_nOldID) newSrcId = pIDPair->m_nNewID;
				if(oldTrgId == pIDPair->m_nOldID) newTrgId = pIDPair->m_nNewID;
				/*}*/
				idnode = idnode->GetNext();
			}
			pLine->SetSrcShapeId(newSrcId);
			pLine->SetTrgShapeId(newTrgId);
			
			// check whether line's src and trg shapes really exists
			if(!GetItem(pLine->GetSrcShapeId()) || !GetItem(pLine->GetTrgShapeId()))
            {
                RemoveItem(pLine);
            }
			
			node = node->GetNext();
		}
		
		m_lstLinesForUpdate.Clear();
    }
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:44,代码来源:DiagramManager.cpp


注:本文中的shapelist::compatibility_iterator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。