本文整理汇总了C++中GetAt函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAt函数的具体用法?C++ GetAt怎么用?C++ GetAt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetAt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: while
int CDiagramEntityContainer::Find( CDiagramEntity* testobj )
/* ============================================================
Function : CDiagramEntityContainer::Find
Description : Finds the index of object testobj in the
data array.
Return : int - Index of the
object or -1
if not found.
Parameters : CDiagramEntity* testobj - Object to find.
Usage : Internal function.
============================================================*/
{
int index = -1;
CDiagramEntity* obj;
int count = 0;
while( ( obj = GetAt( count ) ) )
{
if( obj == testobj )
index = count;
count++;
}
return index;
}
开发者ID:Admin-Yukiko,项目名称:Iris1_DeveloperTools,代码行数:29,代码来源:DiagramEntityContainer.cpp
示例2:
int CDiagramEntityContainer::GetSelectCount() const
{
int count=0;
for (int i = 0; i < GetSize(); i++)
if (GetAt(i)->IsSelected()) count++;
return count;
}
开发者ID:Admin-Yukiko,项目名称:Iris1_DeveloperTools,代码行数:7,代码来源:DiagramEntityContainer.cpp
示例3: GetAt
void CDiagramEntityContainer::RemoveAt( int index )
/* ============================================================
Function : CDiagramEntityContainer::RemoveAt
Description : Removes the object at index.
Return : void
Parameters : int index - The index of the object
to remove.
Usage : Call to remove a specific object. Memory is
freed.
============================================================*/
{
CDiagramEntity* obj = GetAt( index );
if( obj )
{
if (obj == m_lastSelObj) m_lastSelObj = NULL;
delete obj;
m_objs.RemoveAt( index );
SetModified( TRUE );
}
}
开发者ID:Admin-Yukiko,项目名称:Iris1_DeveloperTools,代码行数:25,代码来源:DiagramEntityContainer.cpp
示例4: GetSize
void CDiagramEntityContainer::Export( CStringArray& stra, UINT format ) const
/* ============================================================
Function : CDiagramEntityContainer::Export
Description : Exports all objects to format format.
Return : void
Parameters : CStringArray& stra - CStingArray that
will be filled with
data on return.
UINT format - Format to save to.
Usage : Call to export the contents of the container
to a CStringArray. Export will - of course -
have to be defined for the derived objects.
============================================================*/
{
int max = GetSize();
for( int t = 0 ; t < max ; t++ )
{
CDiagramEntity* obj = GetAt( t );
stra.Add( obj->Export( format ) );
}
}
开发者ID:Admin-Yukiko,项目名称:Iris1_DeveloperTools,代码行数:26,代码来源:DiagramEntityContainer.cpp
示例5: GetAt
void Display::CComplexFillSymbol::Zoom(float rate)
{
for( int i = 0 ; i < GetSize() ; i++ )
{
GetAt(i)->Zoom(rate);
}
}
开发者ID:lozpeng,项目名称:applesales,代码行数:7,代码来源:ComplexFillSymbol.cpp
示例6: Add
bool CBoardCollectionArray::Add(DataStruct &board, CCEtoODBDoc &doc)
{
// look to see if this data will fit
for (int i=0; i<GetCount(); i++)
{
if (GetAt(i)->Add(board, doc))
return true;
}
CBoardCollection *brdColl = new CBoardCollection(m_bUseAsRows);
BlockStruct *block = doc.getBlockAt(board.getInsert()->getBlockNumber());
if (block == NULL)
return false;
CExtent ext = block->getExtent();
double toleranceDistance = 0.;
if (m_bUseAsRows)
toleranceDistance = ext.getYsize() * ((double)m_iTolerancePercent / 100.);
else
toleranceDistance = ext.getXsize() * ((double)m_iTolerancePercent / 100.);
brdColl->SetTolerance(toleranceDistance);
if (brdColl->Add(board, doc))
CTypedArrayContainer<CPtrArray, CBoardCollection*>::Add(brdColl);
else
return false;
return true;
}
开发者ID:mpatwa,项目名称:CCEtoODB_Translator,代码行数:29,代码来源:PanelLib.cpp
示例7: GetAt
/** Find the building center closest to the given point, if it is within
* 'epsilon' distance. The building index, and distance from the given
* point are returned by reference.
*
* \return True if a building was found.
*/
bool vtStructureArray::FindClosestBuildingCenter(const DPoint2 &point,
double epsilon, int &building, double &closest)
{
if (IsEmpty())
return false;
building = -1;
DPoint2 loc;
double dist;
closest = 1E8;
for (uint i = 0; i < GetSize(); i++)
{
vtStructure *str = GetAt(i);
vtBuilding *bld = str->GetBuilding();
if (!bld)
continue;
bld->GetBaseLevelCenter(loc);
dist = (loc - point).Length();
if (dist > epsilon)
continue;
if (dist < closest)
{
building = i;
closest = dist;
}
}
return (building != -1);
}
开发者ID:kalwalt,项目名称:ofxVTerrain,代码行数:36,代码来源:StructArray.cpp
示例8: MOVETO
void CXTPTaskPanelGroup::OnAnimate(int nStep)
{
if (nStep < 1)
{
m_rcGroupCurrent = m_rcGroupTarget;
}
else
{
MOVETO(m_rcGroupCurrent.top, m_rcGroupTarget.top, nStep);
MOVETO(m_rcGroupCurrent.bottom, m_rcGroupTarget.bottom, nStep);
}
if (!IsDirty() && m_bExpanding)
{
m_bExpanding = FALSE;
m_pPanel->NotifyOwner(XTP_TPN_GROUPEXPANDED, (LPARAM)this);
}
for (int i = 0; i < GetItemCount(); i++)
{
CXTPTaskPanelGroupItem* pItem = GetAt(i);
pItem->OnAnimate(nStep);
}
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:25,代码来源:XTPTaskPanelGroup.cpp
示例9: GetAt
/**--------------------------------------------------------------------------<BR>
C2DBaseSet::SnapToGrid
\brief SnapToGrid.
<P>---------------------------------------------------------------------------*/
void C2DBaseSet::SnapToGrid(void)
{
for (unsigned int i = 0 ; i < size(); i++)
{
GetAt(i)->SnapToGrid();
}
}
开发者ID:Ic3C0ld,项目名称:QtGeometry7316,代码行数:11,代码来源:C2DBaseSet.cpp
示例10: GetAt
void* CFX_BaseSegmentedArray::Add()
{
if (m_DataSize % m_SegmentSize) {
return GetAt(m_DataSize ++);
}
void* pSegment = FX_Alloc(FX_BYTE, m_UnitSize * m_SegmentSize);
if (!pSegment) {
return NULL;
}
if (m_pIndex == NULL) {
m_pIndex = pSegment;
m_DataSize ++;
return pSegment;
}
if (m_IndexDepth == 0) {
void** pIndex = (void**)FX_Alloc(void*, m_IndexSize);
if (pIndex == NULL) {
FX_Free(pSegment);
return NULL;
}
pIndex[0] = m_pIndex;
pIndex[1] = pSegment;
m_pIndex = pIndex;
m_DataSize ++;
m_IndexDepth ++;
return pSegment;
}
开发者ID:Gardenya,项目名称:pdfium,代码行数:27,代码来源:fx_basic_array.cpp
示例11: ADDTOCALLSTACK
bool CContainer::r_GetRefContainer( LPCTSTR & pszKey, CScriptObj * & pRef )
{
ADDTOCALLSTACK("CContainer::r_GetRefContainer");
if ( !strnicmp(pszKey, "FIND", 4) ) // find*
{
pszKey += 4;
if ( !strnicmp(pszKey, "ID", 2) ) // findid
{
pszKey += 2;
SKIP_SEPARATORS(pszKey);
pRef = ContentFind(g_Cfg.ResourceGetID(RES_ITEMDEF, pszKey));
SKIP_SEPARATORS(pszKey);
return true;
}
else if ( !strnicmp(pszKey, "CONT", 4) ) // findcont
{
pszKey += 4;
SKIP_SEPARATORS(pszKey);
pRef = GetAt(Exp_GetSingle(pszKey));
SKIP_SEPARATORS(pszKey);
return true;
}
else if ( !strnicmp(pszKey, "TYPE", 4) ) // findtype
{
pszKey += 4;
SKIP_SEPARATORS(pszKey);
pRef = ContentFind(g_Cfg.ResourceGetID(RES_TYPEDEF, pszKey));
SKIP_SEPARATORS(pszKey);
return true;
}
}
return false;
}
开发者ID:greeduomacro,项目名称:Source,代码行数:33,代码来源:CContain.cpp
示例12: GetAt
void CCSClones::cleanup()
{
for (int i = 0; i < GetSize(); ++i)
delete GetAt(i);
RemoveAll();
}
开发者ID:AmesianX,项目名称:BinClone,代码行数:7,代码来源:CSClone.cpp
示例13: fPath
BOOL CMediaFormats::IsUnPlayableFile(CString szFilename, bool bRestrict){
CPath fPath(szFilename);
CString szThisExtention = fPath.GetExtension();
BOOL bDefaultRet = false;
if(bRestrict)
bDefaultRet = true;
for(size_t i = 0; i < GetCount(); i++)
{
CMediaFormatCategory& mfc = GetAt(i);
if( mfc.FindExt(szThisExtention) ){
CString szLabel = mfc.GetLabel();
if ( szLabel.Find(_T("Subtitle")) >= 0 || szLabel.Find(_T("字幕")) >= 0){
return TRUE;
}
if ( szLabel.Find(_T("Image file")) >= 0 || szLabel.Find(_T("图片")) >= 0){
return TRUE;
}
if ( szLabel.Find(_T("Real Script file")) >= 0 || szLabel.Find(_T("脚本")) >= 0){
return TRUE;
}
return FALSE;
}
}
return bDefaultRet;
}
开发者ID:XyzalZhang,项目名称:SPlayer,代码行数:27,代码来源:MediaFormats.cpp
示例14: GetCount
// Calling this function with bEnable equals to true when
// shuffle is already enabled will re-shuffle the tracks.
void CPlaylist::SetShuffle(bool bEnable)
{
m_bShuffle = bEnable;
if (bEnable && !IsEmpty()) {
m_nShuffledListSize = GetCount();
CAtlArray<plsort_t> positions;
positions.SetCount(m_nShuffledListSize + 1);
srand((unsigned int)time(nullptr));
POSITION pos = GetHeadPosition();
for (size_t i = 0; pos; i++, GetNext(pos)) {
positions[i].n = rand();
positions[i].pos = pos;
}
qsort(positions.GetData(), m_nShuffledListSize, sizeof(plsort_t), compare);
positions[m_nShuffledListSize].pos = nullptr; // Termination
m_posHeadShuffle = positions[0].pos;
m_posTailShuffle = nullptr;
for (size_t i = 0; i < m_nShuffledListSize; i++) {
pos = positions[i].pos;
CPlaylistItem& pli = GetAt(pos);
pli.m_posPrevShuffle = m_posTailShuffle;
pli.m_posNextShuffle = positions[i + 1].pos;
m_posTailShuffle = pos;
}
} else {
m_posHeadShuffle = m_posTailShuffle = nullptr;
m_nShuffledListSize = 0;
}
}
开发者ID:JanChou,项目名称:mpc-hc,代码行数:33,代码来源:Playlist.cpp
示例15: AddTail
void CPTRList::InsertBefore( int n,void *pData)
{
if ( n<0 )
{
AddTail(pData);
return;
}
if ( n==0 )
{
AddHead(pData);
return ;
}
GetAt(n);
nCurrentBlk = -1;
PTR_BLK *pNew = new PTR_BLK;
pNew->pData = pData;
pNew->pPrev = pCur->pPrev;
pNew->pNext = pCur;
pCur->pPrev->pNext = pNew;
pCur->pPrev = pNew;
nMax++;
}
开发者ID:dalek7,项目名称:AR,代码行数:25,代码来源:PTRList.cpp
示例16: GetScrollOffsetPos
CXTPTaskPanelGroupItem* CXTPTaskPanelGroup::HitTest(CPoint pt, CRect* lpRect) const
{
if (!IsExpanded())
return NULL;
int nOffset = m_pPanel->GetScrollOffset() - m_nCaptionHeight - m_rcGroupCurrent.top + GetScrollOffsetPos();
pt.y += nOffset;
for (int i = 0; i < GetItemCount(); i++)
{
CXTPTaskPanelGroupItem* pItem = GetAt(i);
CRect rcItem = pItem->GetItemRect();
if (rcItem.PtInRect(pt) && pItem->IsVisible())
{
if (lpRect)
{
rcItem.OffsetRect(0, -nOffset);
*lpRect = rcItem;
}
return pItem;
}
}
return NULL;
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:25,代码来源:XTPTaskPanelGroup.cpp
示例17: FindKeyWordReverse
int CESBolanStack::FindKeyWordReverse(int KeyWord,int StartPos,int StopKeyWord)
{
if(StartPos>=(int)GetSize())
return -1;
for(;StartPos>=0;StartPos--)
{
if(GetAt(StartPos)->Type==BOLAN_TYPE_KEYWORD)
{
if(StopKeyWord>0&&GetAt(StartPos)->Index==StopKeyWord)
return -1;
if(GetAt(StartPos)->Index==KeyWord)
return StartPos;
}
}
return -1;
}
开发者ID:EnoroF,项目名称:easygamelibs,代码行数:16,代码来源:ESBolanStack.cpp
示例18: GetSize
void vtStructureArray::Offset(const DPoint2 &delta)
{
uint npoints = GetSize();
if (!npoints)
return;
uint i, j;
DPoint2 temp;
for (i = 0; i < npoints; i++)
{
vtStructure *str = GetAt(i);
vtBuilding *bld = str->GetBuilding();
if (bld)
bld->Offset(delta);
vtFence *fen = str->GetFence();
if (fen)
{
DLine2 line = fen->GetFencePoints();
for (j = 0; j < line.GetSize(); j++)
line.GetAt(j) += delta;
}
vtStructInstance *inst = str->GetInstance();
if (inst)
inst->Offset(delta);
}
}
开发者ID:kalwalt,项目名称:ofxVTerrain,代码行数:26,代码来源:StructArray.cpp
示例19: GetSize
int PyView::setSlice(int s, int e, const PWOSequence& lst) {
int sz = GetSize();
if (s < 0)
s += sz;
if (e < 0)
e += sz;
if (e > sz)
e = sz;
int i = 0;
for (; i < lst.len() && s < e; i++, s++)
setItem(s, lst[i]);
for (; i < lst.len(); i++, s++)
{
if (_base)
Fail(PyExc_RuntimeError, "Can't insert in this view");
insertAt(s, lst[i]);
}
if (s < e)
if (_base)
while (s < e)
{
int ndx = _base->GetIndexOf(GetAt(s));
_base->RemoveAt(ndx, 1);
--e;
}
else
RemoveAt(s, e - s);
return 0;
}
开发者ID:SASfit,项目名称:SASfit,代码行数:29,代码来源:PyView.cpp
示例20: CPath
engine_t CMediaFormats::GetEngine(CString path)
{
path.Trim().MakeLower();
if(!m_fRtspFileExtFirst && path.Find(_T("rtsp://")) == 0)
return m_iRtspHandler;
CString ext = CPath(path).GetExtension();
ext.MakeLower();
if(!ext.IsEmpty())
{
if(path.Find(_T("rtsp://")) == 0)
{
if(ext == _T(".ram") || ext == _T(".rm") || ext == _T(".ra"))
return RealMedia;
if(ext == _T(".qt") || ext == _T(".mov"))
return QuickTime;
}else if(ext == _T(".ram")){
return RealMedia;
}
for(size_t i = 0; i < GetCount(); i++)
{
CMediaFormatCategory& mfc = GetAt(i);
if(mfc.FindExt(ext))
return mfc.GetEngineType();
}
}
if(m_fRtspFileExtFirst && path.Find(_T("rtsp://")) == 0)
return m_iRtspHandler;
return DirectShow;
}
开发者ID:XyzalZhang,项目名称:SPlayer,代码行数:34,代码来源:MediaFormats.cpp
注:本文中的GetAt函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论