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


C++ wxArrayInt::Clear方法代码示例

本文整理汇总了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;
}
开发者ID:EdgarTx,项目名称:wx,代码行数:27,代码来源:dcgraph.cpp

示例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 );
}
开发者ID:BackupTheBerlios,项目名称:musik-svn,代码行数:12,代码来源:MusikLibrary.cpp

示例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);
        }
    }
}
开发者ID:josephcsible,项目名称:xLights,代码行数:12,代码来源:TabTest.cpp

示例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;
}
开发者ID:animecomico,项目名称:wxWidgets,代码行数:16,代码来源:dcgraph.cpp

示例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);
    
开发者ID:balp,项目名称:OpenCPN,代码行数:66,代码来源:mygeom.cpp

示例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++)
                {
//.........这里部分代码省略.........
开发者ID:josephcsible,项目名称:xLights,代码行数:101,代码来源:TabTest.cpp


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