本文整理汇总了C++中wxArrayInt::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayInt::Clear方法的具体用法?C++ wxArrayInt::Clear怎么用?C++ wxArrayInt::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxArrayInt
的用法示例。
在下文中一共展示了wxArrayInt::Clear方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoGetPartialTextExtents
bool wxGCDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
{
bool isMeasuringContext = false;
wxGraphicsContext* context = m_graphicContext;
if (!context)
{
context = wxGraphicsRenderer::GetDefaultRenderer()->CreateMeasuringContext();
isMeasuringContext = true;
}
widths.Clear();
widths.Add(0,text.Length());
if ( text.IsEmpty() )
return true;
wxArrayDouble widthsD;
context->GetPartialTextExtents( text, widthsD );
for ( size_t i = 0; i < widths.GetCount(); ++i )
widths[i] = (wxCoord)(widthsD[i] + 0.5);
if (isMeasuringContext)
delete context;
return true;
}
示例2: Query
void CMusikLibrary::Query( const wxString & query, wxArrayInt & aReturn ,bool bClearArray )
{
if(bClearArray)
{
aReturn.Clear();
//--- run the query ---//
aReturn.Alloc( GetSongCount() );
}
MusikDb::ResultCB cb(&aReturn, &db_callbackAddToIntArray);
m_pDB->Exec( ConvQueryToMB( query ), cb );
}
示例3: GetCheckedItems
void xLightsFrame::GetCheckedItems(wxArrayInt& chArray)
{
chArray.Clear();
int maxch = CheckListBoxTestChannels->GetCount();
for (int ch=0; ch < maxch; ch++)
{
if (CheckListBoxTestChannels->IsChecked(ch))
{
chArray.Add(ch);
}
}
}
示例4: DoGetPartialTextExtents
bool wxGCDCImpl::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
{
wxCHECK_MSG( m_graphicContext, false, wxT("wxGCDC(cg)::DoGetPartialTextExtents - invalid DC") );
widths.Clear();
widths.Add(0,text.Length());
if ( text.IsEmpty() )
return true;
wxArrayDouble widthsD;
m_graphicContext->GetPartialTextExtents( text, widthsD );
for ( size_t i = 0; i < widths.GetCount(); ++i )
widths[i] = (wxCoord)(widthsD[i] + 0.5);
return true;
}
示例5: PolyTessGeoGL
//.........这里部分代码省略.........
pidx = npte - ip - 1;
else
pidx = ip;
poly->getExteriorRing()->getPoint(pidx, &p);
x = p.getX();
y = p.getY();
if( ((fabs(x-x0) > EQUAL_EPS) || (fabs(y-y0) > EQUAL_EPS)))
{
GLdouble *ppt_temp = ppt;
if(tess_orient == TESS_VERT)
{
*DPrun++ = x;
*DPrun++ = y;
}
else
{
*DPrun++ = y;
*DPrun++ = x;
}
x0 = x;
y0 = y;
}
else
nPoints--;
}
if(nPoints > 5 && (m_LOD_meters > .01)){
index_keep.Clear();
index_keep.Add(0);
index_keep.Add(nPoints-1);
index_keep.Add(1);
index_keep.Add(nPoints-2);
DouglasPeucker(DPbuffer, 1, nPoints-2, m_LOD_meters/(1852 * 60), &index_keep);
// printf("DP Reduction: %d/%d\n", index_keep.GetCount(), nPoints);
g_keep += index_keep.GetCount();
g_orig += nPoints;
// printf("...................Running: %g\n", (double)g_keep/g_orig);
}
else {
index_keep.Clear();
for(int i = 0 ; i < nPoints ; i++)
index_keep.Add(i);
}
cntr[0] = index_keep.GetCount();
// Mark the keepers by adding a simple constant to X
for(unsigned int i=0 ; i < index_keep.GetCount() ; i++){
int k = index_keep.Item(i);
DPbuffer[2*k] += 2000.;
}
// Declare the gluContour and copy the points
gluTessBeginContour(GLUtessobj);
示例6: OnTimerTest
// called on each Timer tick while Test dialog is open
void xLightsFrame::OnTimerTest(long curtime)
{
static int LastNotebookSelection = -1;
static int LastBgIntensity,LastFgIntensity,LastBgColor[3],LastFgColor[3],*ShimColor,ShimIntensity;
static int LastSequenceSpeed;
static int LastAutomatedTest;
static long NextSequenceStart = -1;
static TestFunctions LastFunc = OFF;
static unsigned int interval, rgbCycle, TestSeqIdx;
static wxArrayInt chArray,TwinkleState;
static float frequency;
int v,BgIntensity,FgIntensity,BgColor[3],FgColor[3];
unsigned int i;
bool ColorChange;
if (!xout) return;
xout->TimerStart(curtime);
int NotebookSelection = NotebookTest->GetSelection();
if (NotebookSelection != LastNotebookSelection)
{
LastNotebookSelection = NotebookSelection;
CheckChannelList = true;
TestSeqIdx=0;
TestButtonsOff();
}
if (TestFunc != LastFunc)
{
LastFunc = TestFunc;
rgbCycle=0;
CheckChannelList = true;
NextSequenceStart = -1;
}
if (CheckChannelList)
{
// get list of checked channels
xout->alloff();
GetCheckedItems(chArray);
LastSequenceSpeed=-1;
LastBgIntensity=-1;
LastFgIntensity=-1;
LastAutomatedTest=-1;
for (i=0; i < 3; i++)
{
LastBgColor[i] = -1;
LastFgColor[i] = -1;
}
if (!CheckBoxLightOutput->IsChecked())
{
StatusBar1->SetStatusText(_("Testing disabled - Output to Lights is not checked"));
}
else if (TestFunc == OFF)
{
StatusBar1->SetStatusText(_("Testing off"));
}
else
{
StatusBar1->SetStatusText(wxString::Format(_("Testing %ld channels"),static_cast<long>(chArray.Count())));
}
CheckChannelList = false;
}
if (TestFunc != OFF && chArray.Count() > 0) switch (NotebookSelection)
{
case 0:
// standard tests
v=SliderChaseSpeed->GetValue(); // 0-100
BgIntensity = SliderBgIntensity->GetValue();
FgIntensity = SliderFgIntensity->GetValue();
ColorChange = BgIntensity != LastBgIntensity || FgIntensity != LastFgIntensity;
LastBgIntensity = BgIntensity;
LastFgIntensity = FgIntensity;
interval = 1600 - v*15;
switch (TestFunc)
{
case DIM:
if (ColorChange)
{
for (i=0; i < chArray.Count(); i++)
{
xout->SetIntensity(chArray[i], BgIntensity);
}
}
break;
case TWINKLE:
if (LastSequenceSpeed < 0)
{
LastSequenceSpeed=0;
TwinkleState.Clear();
for (i=0; i < chArray.Count(); i++)
{
TestSeqIdx = static_cast<int>(rand01()*TwinkleRatio);
TwinkleState.Add(TestSeqIdx == 0 ? -1 : 1);
}
}
for (i=0; i < TwinkleState.Count(); i++)
{
//.........这里部分代码省略.........