本文整理汇总了C++中ShapeList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ShapeList::end方法的具体用法?C++ ShapeList::end怎么用?C++ ShapeList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShapeList
的用法示例。
在下文中一共展示了ShapeList::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnShowComments
void DatabaseCanvas::OnShowComments(wxCommandEvent &WXUNUSED(event))
{
ShapeList list;
m_showComments = !m_showComments;
m_pManager.GetShapes( CLASSINFO( CommentFieldShape ), list );
for( ShapeList::iterator it = list.begin(); it != list.end(); ++it )
{
CommentFieldShape *shape = wxDynamicCast( (*it), CommentFieldShape );
if( m_showComments )
{
shape->SetText( const_cast<Field *>( shape->GetFieldForComment() )->GetComment() );
}
else
{
shape->SetText( wxEmptyString );
}
}
Refresh();
list.clear();
m_pManager.GetShapes( CLASSINFO( CommentTableShape ), list );
for( ShapeList::iterator it = list.begin(); it != list.end(); ++it )
{
CommentTableShape *shape = wxDynamicCast( (*it), CommentTableShape );
if( m_showComments )
{
shape->SetText( const_cast<DatabaseTable *>( shape->GetDatabaseTable() )->GetComment() );
}
else
{
shape->SetText( wxEmptyString );
}
}
Refresh();
}
示例2: ProcessElement
void udCPPClassElementProcessor::ProcessElement(wxSFShapeBase *element)
{
// check existing parent generator
wxASSERT(m_pParentGenerator);
if(!m_pParentGenerator) return;
wxASSERT(element);
if(!element) return;
udClassElementItem *pClass = (udClassElementItem*) udPROJECT::GetDiagramElement( element, udfOMIT_LINKS );
if( !pClass || !pClass->IsGenerated() ) return;
udClassAlgorithm *pAlg = (udClassAlgorithm*) m_pParentGenerator->GetActiveAlgorithm();
// check whether the class is already processed
if( pAlg->GetProcessedElements().IndexOf(element) != wxNOT_FOUND ) return;
// process child classes recursivelly first
ShapeList lstBases;
umlClassDiagram::GetOuterClasses( (umlClassItem*)element, lstBases );
for( ShapeList::iterator it = lstBases.begin(); it != lstBases.end(); ++it )
{
ProcessElement( *it );
}
switch( pAlg->GetGenMode() )
{
case udGenerator::genDECLARATION:
ProcessClassDeclaration( element );
break;
case udGenerator::genDEFINITION:
ProcessClassDefinition( element );
break;
default:
break;
}
// process template bindings
ShapeList lstConnections;
element->GetShapeManager()->GetAssignedConnections( element, CLASSINFO(umlTemplateBindItem), wxSFShapeBase::lineSTARTING, lstConnections );
for( ShapeList::iterator it = lstConnections.begin(); it != lstConnections.end(); ++it )
{
udElementProcessor *pProcessor = pAlg->GetElementProcessor((*it)->GetClassInfo()->GetClassName());
if(pProcessor)
{
pProcessor->ProcessElement(*it);
}
}
// set the state as processes
pAlg->GetProcessedElements().Append(element);
}
示例3: DoLayout
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();
}
}
示例4: OnInit
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();
}
示例5: ProcessNode
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 );
}
}
}
}
示例6: IsTableDisplayed
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;
}
示例7: GetRefTable
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;
}
示例8: GetShapesExtent
wxSize wxSFLayoutAlgorithm::GetShapesExtent(const ShapeList& shapes)
{
int nTotalWidth = 0, nTotalHeight = 0;
for( ShapeList::const_iterator it = shapes.begin(); it != shapes.end(); ++ it )
{
wxRect rctBB = (*it)->GetBoundingBox();
nTotalWidth += rctBB.GetWidth();
nTotalHeight += rctBB.GetHeight();
}
return wxSize( nTotalWidth, nTotalHeight );
}
示例9: GetShapesCenter
wxRealPoint wxSFLayoutAlgorithm::GetShapesCenter(const ShapeList& shapes)
{
wxRealPoint nCenter;
for( ShapeList::const_iterator it = shapes.begin(); it != shapes.end(); ++ it )
{
nCenter = nCenter + (*it)->GetAbsolutePosition();
}
nCenter.x /= shapes.GetCount();
nCenter.y /= shapes.GetCount();
return nCenter;
}
示例10: GetTopLeft
wxRealPoint wxSFLayoutAlgorithm::GetTopLeft(const ShapeList& shapes)
{
double startx = INT_MAX, starty = INT_MAX;
for( ShapeList::const_iterator it = shapes.begin(); it != shapes.end(); ++ it )
{
wxSFShapeBase *pShape = *it;
wxRealPoint nPos = pShape->GetAbsolutePosition();
if( nPos.x < startx ) startx = nPos.x;
if( nPos.y < starty ) starty = nPos.y;
}
return wxRealPoint( startx, starty );
}
示例11: GetBoundingBox
wxRect wxSFLayoutAlgorithm::GetBoundingBox(const ShapeList& shapes)
{
wxRect rctBB;
for( ShapeList::const_iterator it = shapes.begin(); it != shapes.end(); ++ it )
{
wxSFShapeBase *pShape = *it;
if( it == shapes.begin() ) rctBB = pShape->GetBoundingBox();
else
rctBB.Union( pShape->GetBoundingBox() );
}
return rctBB;
}
示例12: init
void Entity::init(const ShapeList & list, const MassProperties mass, const Transform t){
std::vector< ::std::pair<size_t, Transform> > shapes;
size_t compound;
//Create the shapes
for_each(list.begin(), list.end(), [&](const ShapeList::value_type & shape){
switch(shape.first.type){
case E_CAPSULE:
case E_SPHERE:
case E_BOX:
case E_PLANE:
{
size_t s = createShape(
shape.first.type,
Math::Vec4ToVec3(shape.first.data),
Math::VecLast(shape.first.data)
);
Transform t = shape.second;
::std::pair<size_t, Transform> p(s,t);
shapes.push_back(p);
}
break;
case E_MESH:
{
size_t s = createShape(
shape.first.type,
shape.first.rawMesh
);
Transform t = shape.second;
::std::pair<size_t, Transform> p(s,t);
shapes.push_back(p);
}
break;
default:
{
throw "Not valid shape type!";
}
}
});
//Got a list of shapes, make the compound shape
compound = _world->compoundShapes(shapes);
//Put it back on with the compound object first
_shape_index.push_back(compound);
for_each(shapes.begin(),shapes.end(),[&](decltype(shapes)::value_type s){
_shape_index.push_back(s.first);
});
//create body
makeBody(t, mass);
}
示例13: AddQuickQueryFields
void DatabaseCanvas::AddQuickQueryFields(const wxString &tbl, std::vector<Field *> &quickSelectFields, bool quickSelect)
{
ShapeList shapes;
m_pManager.GetShapes( CLASSINFO( FieldShape ), shapes );
for( ShapeList::iterator it = shapes.begin (); it != shapes.end (); ++it )
{
auto fld = wxDynamicCast( (*it), FieldShape );
auto fieldName = wxDynamicCast( (*it), FieldShape )->GetField()->GetFieldName();
auto found = false;
for( std::vector<Field *>::iterator it2 = quickSelectFields.begin(); it2 < quickSelectFields.end() && !false; ++it2 )
{
if( (*it2)->GetFieldName() == fieldName )
{
found = true;
(*it)->Select( true );
dynamic_cast<DrawingView *>( m_view )->AddFieldToQuery( *fld, fld->IsSelected(), tbl.ToStdWstring(), quickSelect );
}
}
}
Refresh();
}
示例14: 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();
}
//.........这里部分代码省略.........
示例15: OnRightDown
void DatabaseCanvas::OnRightDown(wxMouseEvent &event)
{
FieldShape *erdField = NULL;
MyErdTable *erdTable = NULL;
ConstraintSign *erdSign = NULL;
wxPoint pt = event.GetPosition();
ShapeList selection;
this->GetSelectedShapes( selection );
for( ShapeList::iterator it = selection.begin(); it != selection.end(); ++it )
{
MyErdTable *table = wxDynamicCast( (*it), MyErdTable );
if( table )
m_realSelectedShape = table;
}
wxMenu mnu;
int allSelected = 0;
mnu.Bind( wxEVT_COMMAND_MENU_SELECTED, &DatabaseCanvas::OnDropTable, this, wxID_DROPOBJECT );
mnu.Bind( wxEVT_COMMAND_MENU_SELECTED, &DatabaseCanvas::OnDropTable, this, wxID_TABLECLOSE );
m_selectedShape = GetShapeUnderCursor();
ViewType type = dynamic_cast<DrawingView *>( m_view )->GetViewType();
if( m_selectedShape )
{
ShapeList list;
GetShapesAtPosition( pt, list );
if( type == DatabaseView )
if( m_selectedShape->IsKindOf( CLASSINFO( MyErdTable ) ) )
DeselectAll();
wxRect tableRect;
bool fieldSelected = false;
bool signSelected = false;
for( ShapeList::iterator it = list.begin(); it != list.end(); ++it )
{
MyErdTable *table = wxDynamicCast( (*it), MyErdTable );
if( table )
{
if( type == DatabaseView )
table->Select( true );
tableRect = table->GetBoundingBox();
erdTable = table;
}
else
{
FieldShape *field = wxDynamicCast( (*it), FieldShape );
if( field )
{
if( type == DatabaseView )
field->Select( true );
field->SetParentRect( tableRect );
fieldSelected = true;
erdField = field;
}
else
{
ConstraintSign *sign = wxDynamicCast( (*it), ConstraintSign );
if( sign )
{
if( type == DatabaseView )
sign->Select( true );
signSelected = true;
erdSign = sign;
}
}
}
}
if( type == DatabaseView && list.empty() )
{
MyErdTable *table = wxDynamicCast( m_selectedShape, MyErdTable );
if( table )
{
table->Select( true );
}
else
{
table = wxDynamicCast( m_selectedShape->GetParentShape()->GetParentShape(), MyErdTable );
table->Select( true );
}
}
if( type == QueryView )
{
size_t selectedCount = 0;
SerializableList tableFields;
if( erdTable )
{
erdTable->GetChildrenRecursively( CLASSINFO( FieldShape ), tableFields );
SerializableList::compatibility_iterator node = tableFields.GetFirst();
while( node )
{
FieldShape *shape = dynamic_cast<FieldShape *>( node->GetData() );
if( shape->IsSelected() )
selectedCount++;
node = node->GetNext();
}
if( selectedCount == const_cast<DatabaseTable &>( erdTable->GetTable() ).GetFields().size() )
allSelected = 1;
else
allSelected = -1;
}
}
Refresh();
if( type == DatabaseView )
//.........这里部分代码省略.........