本文整理汇总了C++中PtrList类的典型用法代码示例。如果您正苦于以下问题:C++ PtrList类的具体用法?C++ PtrList怎么用?C++ PtrList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PtrList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: forAll
tmp<GeometricField<Type, tetPolyPatchField, tetPointMesh> >
tetPointFieldReconstructor::reconstructTetPointField
(
const IOobject& fieldIoObject
)
{
// Read the field for all the processors
PtrList<GeometricField<Type, tetPolyPatchField, tetPointMesh> > procFields
(
procMeshes_.size()
);
forAll (procMeshes_, procI)
{
procFields.set
(
procI,
new GeometricField<Type, tetPolyPatchField, tetPointMesh>
(
IOobject
(
fieldIoObject.name(),
procMeshes_[procI]().time().timeName(),
procMeshes_[procI](),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
procMeshes_[procI]
)
);
}
开发者ID:GoldenMan123,项目名称:openfoam-extend-foam-extend-3.1,代码行数:31,代码来源:tetPointFieldReconstructorReconstructFields.C
示例2: SetDlgItemText
void CSearchResultDlg::displayPage(int page, BOOL showStatus)
{
if (page < 0 || page >= pageCount)
return;
if (showStatus) {
CString str;
str.Format(IDS_SEARCH_PAGE_NO, page + 1);
SetDlgItemText(IDC_STATUS, str);
}
PtrList *l = pages[page];
PtrList::iterator it;
for (it = l->begin(); it != l->end(); ++it) {
SEARCH_RESULT *p = (SEARCH_RESULT *) *it;
int image = p->face;
if (!p->online)
image += NR_FACES;
CString str;
str.Format("%lu", p->uin);
int i = m_ctlResult.InsertItem(m_ctlResult.GetItemCount(), str, image);
m_ctlResult.SetItemData(i, (DWORD) p);
m_ctlResult.SetItemText(i, 1, p->nick.c_str());
m_ctlResult.SetItemText(i, 2, p->province.c_str());
}
}
示例3: forAll
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
Foam::fvFieldReconstructor::reconstructFvVolumeField
(
const IOobject& fieldIoObject
)
{
// Read the field for all the processors
PtrList<GeometricField<Type, fvPatchField, volMesh> > procFields
(
procMeshes_.size()
);
forAll (procMeshes_, procI)
{
procFields.set
(
procI,
new GeometricField<Type, fvPatchField, volMesh>
(
IOobject
(
fieldIoObject.name(),
procMeshes_[procI].time().timeName(),
procMeshes_[procI],
IOobject::MUST_READ,
IOobject::NO_WRITE
),
procMeshes_[procI]
)
);
}
示例4: forAll
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>>
Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
{
// Read the field for all the processors
PtrList<GeometricField<Type, pointPatchField, pointMesh>> procFields
(
procMeshes_.size()
);
forAll(procMeshes_, proci)
{
procFields.set
(
proci,
new GeometricField<Type, pointPatchField, pointMesh>
(
IOobject
(
fieldIoObject.name(),
procMeshes_[proci]().time().timeName(),
procMeshes_[proci](),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
procMeshes_[proci]
)
);
}
示例5: forAll
Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh>>
Foam::fvFieldReconstructor::reconstructFvVolumeInternalField
(
const IOobject& fieldIoObject
) const
{
// Read the field for all the processors
PtrList<DimensionedField<Type, volMesh>> procFields
(
procMeshes_.size()
);
forAll(procMeshes_, proci)
{
procFields.set
(
proci,
new DimensionedField<Type, volMesh>
(
IOobject
(
fieldIoObject.name(),
procMeshes_[proci].time().timeName(),
procMeshes_[proci],
IOobject::MUST_READ,
IOobject::NO_WRITE
),
procMeshes_[proci]
)
);
}
示例6: Remove
// remove vp from the list
void Remove(T *ip)
{
PtrList *p = Find(ip);
if (p)
{
p->Remove();
}
}
示例7: Add
void Add(T *ip)
{
PtrList *pl = this;
while (pl && pl->m_pNext)
{
pl = pl->Next();
}
pl->m_pNext = new PtrList(ip);
}
示例8: deleteResults
void CSearchResultDlg::deleteResults()
{
for (int i = 0; i < pageCount; i++) {
PtrList *l = pages[i];
PtrList::iterator it;
for (it = l->begin(); it != l->end(); ++it)
delete (SEARCH_RESULT *) *it;
l->clear();
}
curPage = -1;
pageCount = 0;
startUIN = 0;
}
示例9: if
Tile CMapTile::GetTile(CVector Pos, CMap* pMap)
{
PtrList<CEntity*> EntityList = pMap->GetTileEntityList(Pos);
if(!EntityList.empty()) {
if(ContainsPlayer(EntityList))
return pMap->GetPlayer()->GetTile(pMap);
else if(ContainsMobs(EntityList)) {
PtrList<CEntity*> MobList = FilterMobEntities(EntityList);
return MobList[0]->GetTile(pMap);
} else
return EntityList[0]->GetTile(pMap);
}
else return FloorTile;
}
示例10: GetParent
void CGroupSearchResultPage::onGroupListReply(PtrList &l)
{
CGroupSearchWizard *wiz = (CGroupSearchWizard *) GetParent();
int type = wiz->typePage.getGroupType();
PtrList::iterator it;
for (it = l.begin(); it != l.end(); ++it) {
GROUP_INFO *p = (GROUP_INFO *) *it;
p->type = type;
addResult(p);
}
GetDlgItem(IDC_REFRESH)->EnableWindow();
}
示例11: IsPassable
bool CMapTile::IsPassable(CVector Pos, CMap* pMap, CEntity* pTrespasser)
{
if(!Flags.Is_Set(MTF_PASSABLE))
return false;
else {
PtrList<CEntity*> EntityList = pMap->GetTileEntityList(Pos);
for(Uint16 i=0;i<EntityList.size();i++) {
if(EntityList[i] == pTrespasser)
continue;
if(EntityList[i]->EntityFlags.Is_Set(EF_MOB))
return false;
}
}
return true;
}
示例12: XClearWindow
void LAgreementDlg::redraw() {
XClearWindow(xvars->dpy[dpyNum],window);
// Loop over all lines on current page.
Page* page = (Page*)pages.get(currentPage);
const PtrList& lines = page->get_lines();
for (int n = 0; n < lines.length(); n++) {
int length;
const char* text = ((Line*)lines.get(n))->get_text(length);
if (length > 0) {
XDrawString(xvars->dpy[dpyNum],window,xvars->gc[dpyNum],
TEXT_PADDING,
TEXT_PADDING
+ xvars->font[dpyNum]->max_bounds.ascent
+ fontSize.height * n,
text,length);
}
}
// Draw separators.
XDrawLine(xvars->dpy[dpyNum],window,xvars->gc[dpyNum],
0,separatorY_1,windowSize.width - 1,separatorY_1);
XDrawLine(xvars->dpy[dpyNum],window,xvars->gc[dpyNum],
0,separatorY_2,windowSize.width - 1,separatorY_2);
// Buttons will redraw themselves.
}
示例13: OnExamine
void CMapTile::OnExamine(CVector Pos, CMap* pMap, CEntity* pActor)
{
PtrList<CEntity*> EntityList = pMap->GetTileEntityList(Pos);
if(!EntityList.empty()) {
ExamineEntitieList(EntityList);
return;
}
if(this == EmptyTile) {
gMessages.AddMessage("Du schaust in die Weiten des Weltraums WTF!");
return;
}
if(!Flags.Is_Set(MTF_PASSABLE))
gMessages.AddMessage("Du schaust auf ein Stueck feste Wand");
else gMessages.AddMessage("Du kannst dich hier hinbewegen");
}
示例14: forAllIter
void Foam::lagrangianFieldDecomposer::readFields
(
const label cloudI,
const IOobjectList& lagrangianObjects,
PtrList<PtrList<IOField<Type> > >& lagrangianFields
)
{
// Search list of objects for lagrangian fields
IOobjectList lagrangianTypeObjects
(
lagrangianObjects.lookupClass(IOField<Type>::typeName)
);
lagrangianFields.set
(
cloudI,
new PtrList<IOField<Type> >
(
lagrangianTypeObjects.size()
)
);
label lagrangianFieldi = 0;
forAllIter(IOobjectList, lagrangianTypeObjects, iter)
{
lagrangianFields[cloudI].set
(
lagrangianFieldi++,
new IOField<Type>(*iter())
);
}
示例15: forAll
void subsetSurfaceFields
(
const fvMeshSubset& subsetter,
const wordList& fieldNames,
PtrList<GeometricField<Type, fvsPatchField, surfaceMesh> >& subFields
)
{
const fvMesh& baseMesh = subsetter.baseMesh();
forAll(fieldNames, i)
{
const word& fieldName = fieldNames[i];
Info<< "Subsetting field " << fieldName << endl;
GeometricField<Type, fvsPatchField, surfaceMesh> fld
(
IOobject
(
fieldName,
baseMesh.time().timeName(),
baseMesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
baseMesh
);
subFields.set(i, subsetter.interpolate(fld));
}
}