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


C++ ShapeList类代码示例

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


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

示例1: wxASSERT

void wxSFLayoutHorizontalTree::ProcessNode(wxSFShapeBase* node, double x)
{
	wxASSERT( node );
	
	if( node )
	{
		node->MoveTo( x, m_nMinY );
		
		wxRect rctBB = node->GetBoundingBox();
		if( rctBB.GetHeight() > m_nCurrMaxHeight ) m_nCurrMaxHeight = rctBB.GetHeight();
		
		ShapeList lstNeighbours;
		node->GetNeighbours( lstNeighbours, CLASSINFO(wxSFShapeBase), wxSFShapeBase::lineSTARTING );

		if( lstNeighbours.IsEmpty() )
		{
			m_nMinY += m_nCurrMaxHeight + m_VSpace;
		}
		else
		{
			for( ShapeList::iterator it = lstNeighbours.begin(); it != lstNeighbours.end(); ++it )
			{
				if( ! (*it)->GetParentShape() )	ProcessNode( *it, x + rctBB.GetWidth() + m_HSpace );
			}
		}
	}
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:27,代码来源:AutoLayout.cpp

示例2: GetAssignedConnections

void wxSFDiagramManager::GetAssignedConnections(wxSFShapeBase* parent, wxClassInfo* shapeInfo, wxSFShapeBase::CONNECTMODE mode, ShapeList& lines)
{
	wxSFLineShape* pLine;
	
	if( parent->GetId() == -1 ) return;

	SerializableList lstLines;
	// lines are children of root item only so we have not to search recursively...
	GetRootItem()->GetChildren( shapeInfo, lstLines );
	
	if( !lstLines.IsEmpty() )
    {
        SerializableList::compatibility_iterator node = lstLines.GetFirst();
        while(node)
        {
            pLine = (wxSFLineShape*)node->GetData();
            switch(mode)
            {
                case wxSFShapeBase::lineSTARTING:
                    if( pLine->GetSrcShapeId() == parent->GetId() ) lines.Append(pLine);
                    break;

                case wxSFShapeBase::lineENDING:
                    if( pLine->GetTrgShapeId() == parent->GetId() ) lines.Append(pLine);
                    break;

                case wxSFShapeBase::lineBOTH:
                    if( ( pLine->GetSrcShapeId() == parent->GetId() ) ||
					    ( pLine->GetTrgShapeId() == parent->GetId() ) ) lines.Append(pLine);
                    break;
            }
            node = node->GetNext();
        }
    }
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:35,代码来源:DiagramManager.cpp

示例3: CLASSINFO

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

示例4: 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

示例5: wxDataViewColumn

void TableSettings::OnInit(wxInitDialogEvent& event)
{
    m_textName->SetValue( m_pTable->GetName() );

    // fill database data types
    wxArrayString* pDbTypes = m_pDbAdapter->GetDbTypes();
    if( pDbTypes ) {
        wxArrayString choices;
        for (unsigned int i = 0; i < pDbTypes->GetCount(); ++i) {
            choices.Add( pDbTypes->Item(i) );
        }

        m_dvColumns->DeleteColumn( m_dvColumns->GetColumn(1) );
        m_dvColumns->InsertColumn( 1, new wxDataViewColumn( _("Type"), new wxDataViewChoiceRenderer( choices, wxDATAVIEW_CELL_EDITABLE, wxDVR_DEFAULT_ALIGNMENT), 1, -2, wxALIGN_LEFT));

        pDbTypes->Clear();
        delete pDbTypes;
    }

    // fill referenced tables
    ShapeList tables;
    m_choiceRefTable->Append( wxT("") );
    m_pDiagramManager->GetShapes( CLASSINFO(ErdTable), tables );
    for( ShapeList::iterator it = tables.begin(); it != tables.end(); ++it ) {
        Table *t = (Table*) (*it)->GetUserData();
        if( t && t->GetName() != m_pTable->GetName() ) m_choiceRefTable->Append( t->GetName() );
    }

    UpdateView();

    event.Skip();
}
开发者ID:05storm26,项目名称:codelite,代码行数:32,代码来源:TableSettings.cpp

示例6: floor

void wxSFLayoutMesh::DoLayout(ShapeList& shapes)
{
	int i = 0, cols = floor( sqrt( (float)shapes.GetCount() ) );
	
	double roffset, coffset, maxh = -m_HSpace;
	roffset = coffset = 0;

	wxRealPoint nStart = GetTopLeft( shapes );

	for( ShapeList::iterator it = shapes.begin(); it != shapes.end(); ++ it )
	{
		wxSFShapeBase *pShape = *it;
		
		if( i++ % cols == 0 )
		{
			coffset = 0;
			roffset += maxh + m_HSpace;
			maxh = 0;
		}
		
		pShape->MoveTo( nStart.x + coffset, nStart.y + roffset );
		
		wxRect rctBB = pShape->GetBoundingBox();
		coffset += rctBB.GetWidth() + m_VSpace;
		
		if( rctBB.GetHeight() > maxh ) maxh = rctBB.GetHeight();
	}
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:28,代码来源:AutoLayout.cpp

示例7: OnDnDStart

void DbViewerPanel::OnDnDStart(wxTreeEvent& event)
{
    ShapeList lstDnD;
    lstDnD.DeleteContents(true);
    DbItem* item = (DbItem*)m_treeDatabases->GetItemData(event.GetItem());

    ErdPanel* pPanel = wxDynamicCast(m_mgr->GetActivePage(), ErdPanel);

    if(item != NULL) {
        if(pPanel) {
            Table* table = wxDynamicCast(item->GetData(), Table);
            if(table) {
                table = (Table*)table->Clone();
                wxSFShapeBase* pShape = new dndTableShape(table);
                lstDnD.Append(pShape);
                pPanel->GetCanvas()->DoDragDrop(lstDnD);
            }

            View* view = wxDynamicCast(item->GetData(), View);
            if(view) {
                view = (View*)view->Clone();
                wxSFShapeBase* pShape = new dndTableShape(view);
                lstDnD.Append(pShape);
                pPanel->GetCanvas()->DoDragDrop(lstDnD);
            }
        }
    }
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:28,代码来源:DbViewerPanel.cpp

示例8: IsAncestor

bool wxSFShapeBase::IsAncestor(wxSFShapeBase *child)
{
	ShapeList lstChildren;
	
	GetChildShapes( NULL, lstChildren, sfRECURSIVE );
	
	return ( lstChildren.IndexOf(child) != wxNOT_FOUND );	
}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:8,代码来源:ShapeBase.cpp

示例9: IsDescendant

bool wxSFShapeBase::IsDescendant(wxSFShapeBase *parent)
{
	ShapeList lstChildren;
	
	if( parent ) parent->GetChildShapes( NULL, lstChildren, sfRECURSIVE );
	
	return ( lstChildren.IndexOf(this) != wxNOT_FOUND );
}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:8,代码来源:ShapeBase.cpp

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

示例11: CLASSINFO

Table* TableSettings::GetRefTable(const wxString& name)
{
    ShapeList tables;
    m_pDiagramManager->GetShapes( CLASSINFO(ErdTable), tables );

    for( ShapeList::iterator it = tables.begin(); it != tables.end(); ++it ) {
        Table *t = (Table*) (*it)->GetUserData();
        if( t->GetName() == name ) return t;
    }

    return NULL;
}
开发者ID:05storm26,项目名称:codelite,代码行数:12,代码来源:TableSettings.cpp

示例12: CLASSINFO

bool DatabaseCanvas::IsTableDisplayed(const std::wstring &name)
{
    ShapeList listShapes;
    m_pManager.GetShapes( CLASSINFO( MyErdTable ), listShapes );
    bool found = false;
    for( ShapeList::iterator it = listShapes.begin(); it != listShapes.end() && !found; ++it )
    {
        if( dynamic_cast<MyErdTable *>( (*it) )->GetTableName() == name )
            found = true;
    }
    return found;
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例13: RefteshTotalData

void shapeGroup::RefteshTotalData()
{
	ShapeList TMPShapeList = SG_ShapeData;

	ShapeList::iterator	SG_ShapeData_Iterator = TMPShapeList.begin();

	SG_Size = TMPShapeList.size();

	const int	VAOSize = SG_Size * 12;
	const int	ItemSize = SG_Size * 20;

	GLfloat*	SG_TmpTotalData = (GLfloat*)malloc(sizeof(GLfloat) * ItemSize);


	if (SG_TmpTotalData == nullptr)
	{
		std::cout << "[Warning]Can't malloc(" << sizeof(GLfloat) * ItemSize << ")" << std::endl;

		return;
	}

	//start to copy
	for (int LoopShapeNumber = 0; LoopShapeNumber < SG_Size; LoopShapeNumber++)
	{
		//VAO
		SG_TmpTotalData[LoopShapeNumber * 12 + 0] = SG_ShapeData_Iterator->Shape->VAO_Data[0] + SG_ShapeData_Iterator->Location[0];
		SG_TmpTotalData[LoopShapeNumber * 12 + 1] = SG_ShapeData_Iterator->Shape->VAO_Data[1] + SG_ShapeData_Iterator->Location[1];
		SG_TmpTotalData[LoopShapeNumber * 12 + 2] = SG_ShapeData_Iterator->Shape->VAO_Data[2] + SG_ShapeData_Iterator->Location[2];

		SG_TmpTotalData[LoopShapeNumber * 12 + 3] = SG_ShapeData_Iterator->Shape->VAO_Data[3] + SG_ShapeData_Iterator->Location[0];
		SG_TmpTotalData[LoopShapeNumber * 12 + 4] = SG_ShapeData_Iterator->Shape->VAO_Data[4] + SG_ShapeData_Iterator->Location[1];
		SG_TmpTotalData[LoopShapeNumber * 12 + 5] = SG_ShapeData_Iterator->Shape->VAO_Data[5] + SG_ShapeData_Iterator->Location[2];

		SG_TmpTotalData[LoopShapeNumber * 12 + 6] = SG_ShapeData_Iterator->Shape->VAO_Data[6] + SG_ShapeData_Iterator->Location[0];
		SG_TmpTotalData[LoopShapeNumber * 12 + 7] = SG_ShapeData_Iterator->Shape->VAO_Data[7] + SG_ShapeData_Iterator->Location[1];
		SG_TmpTotalData[LoopShapeNumber * 12 + 8] = SG_ShapeData_Iterator->Shape->VAO_Data[8] + SG_ShapeData_Iterator->Location[2];

		SG_TmpTotalData[LoopShapeNumber * 12 + 9] = SG_ShapeData_Iterator->Shape->VAO_Data[9] + SG_ShapeData_Iterator->Location[0];
		SG_TmpTotalData[LoopShapeNumber * 12 + 10] = SG_ShapeData_Iterator->Shape->VAO_Data[10] + SG_ShapeData_Iterator->Location[1];
		SG_TmpTotalData[LoopShapeNumber * 12 + 11] = SG_ShapeData_Iterator->Shape->VAO_Data[11] + SG_ShapeData_Iterator->Location[2];
		//TexturePos
		for (int i = 0; i < 8; i++)
		{
			SG_TmpTotalData[VAOSize + LoopShapeNumber * 8 + i] = SG_ShapeData_Iterator->Shape->TexturePos_Data[i];
		}
		SG_ShapeData_Iterator++;
	}
	SG_TotalData = SG_TmpTotalData;

	SG_NeedRefreshBuffer = true;
	SG_IsRefreshingData = false;
}
开发者ID:GM2000,项目名称:MagicCube2,代码行数:52,代码来源:ShapeGroup.cpp

示例14: saveRectangle

void Rectangle::saveRectangle(string fileName, ShapeList& s_list) // 파일 쓰기용
{
	ofstream fout;
	fout.open(fileName, ios_base::out);

	for (int i = 0; i < s_list.getCount(); i++)
	{
		Shape* s = s_list.getShapeList(i);
		s->print();
	}

	fout.close();
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例15: wxASSERT

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


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