本文整理汇总了C++中wxVector::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ wxVector::push_back方法的具体用法?C++ wxVector::push_back怎么用?C++ wxVector::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxVector
的用法示例。
在下文中一共展示了wxVector::push_back方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void wxGLAPI::glVertex3f(GLfloat x, GLfloat y, GLfloat z)
{
#if wxUSE_OPENGL_EMULATION
if ( s_mode == 0xFF )
{
wxFAIL_MSG("glVertex3f called outside glBegin/glEnd");
}
else
{
s_texCoords.push_back(s_currentTexCoord[0]);
s_texCoords.push_back(s_currentTexCoord[1]);
s_normals.push_back(s_currentNormal[0]);
s_normals.push_back(s_currentNormal[1]);
s_normals.push_back(s_currentNormal[2]);
s_colors.push_back(s_currentColor[0]);
s_colors.push_back(s_currentColor[1]);
s_colors.push_back(s_currentColor[2]);
s_colors.push_back(s_currentColor[3]);
s_vertices.push_back(x);
s_vertices.push_back(y);
s_vertices.push_back(z);
}
#else
::glVertex3f(x,y,z);
#endif
}
示例2: DoPlay
bool wxSound::DoPlay(unsigned flags) const
{
if ( m_data )
{
s_soundsPlaying.push_back(m_data);
if ( !m_data->Play(flags) )
s_soundsPlaying.pop_back();
}
return false;
}
示例3: Notify
void MyClient::Notify()
{
// we shouldn't call wxIPC methods from here directly as we may be called
// from inside an IPC call when using TCP/IP as the sockets are used in
// non-blocking code and so can dispatch events, including the timer ones,
// while waiting for IO and so starting another IPC call would result in
// fatal reentrancies -- instead, just set a flag and perform the test
// indicated by it later from our idle event handler
MyClientTestFunc testfunc = NULL;
switch ( m_step++ )
{
case 0:
testfunc = &MyClient::TestRequest;
break;
case 1:
testfunc = &MyClient::TestPoke;
break;
case 2:
testfunc = &MyClient::TestExecute;
break;
case 3:
testfunc = &MyClient::TestStartAdvise;
break;
case 10:
testfunc = &MyClient::TestStopAdvise;
break;
case 15:
testfunc = &MyClient::TestDisconnect;
// We don't need the timer any more, we're going to exit soon.
Stop();
break;
default:
// No need to wake up idle handling.
return;
}
m_tests.push_back(testfunc);
wxWakeUpIdle();
}
示例4: AddVisibleNotification
void wxNotificationMessageWindow::AddVisibleNotification(wxNotificationMessageWindow* notif)
{
bool found = false;
for ( wxVector<wxNotificationMessageWindow*>::iterator it = ms_visibleNotifications.begin();
it != ms_visibleNotifications.end(); ++it )
{
if ( *it == notif )
{
found = true;
break;
}
}
if ( !found )
ms_visibleNotifications.push_back(notif);
ResizeAndFitVisibleNotifications();
}
示例5: GenerateGLBufferVertices
void GLPolygons::GenerateGLBufferVertices(wxVector<PMSPolygon> &polygons, wxVector<GLfloat> &vertices)
{
unsigned int polygonsCount = polygons.size();
unsigned int i, j;
// Trim down polygons' count.
if (polygonsCount > MAX_POLYGONS_COUNT)
{
polygonsCount = MAX_POLYGONS_COUNT;
}
for (i = 0; i < polygonsCount; ++i)
{
for (j = 0; j < 3; ++j)
{
vertices.push_back((GLfloat)polygons[i].vertices[j].x);
vertices.push_back((GLfloat)polygons[i].vertices[j].y);
vertices.push_back((GLfloat)polygons[i].vertices[j].z);
vertices.push_back((GLfloat)polygons[i].vertices[j].color.red / 255.0);
vertices.push_back((GLfloat)polygons[i].vertices[j].color.green / 255.0);
vertices.push_back((GLfloat)polygons[i].vertices[j].color.blue / 255.0);
vertices.push_back((GLfloat)polygons[i].vertices[j].color.alpha / 255.0);
vertices.push_back((GLfloat)polygons[i].vertices[j].textureS);
vertices.push_back((GLfloat)polygons[i].vertices[j].textureT);
}
}
// Initialization of unused polygons.
for (i = 0; i < MAX_POLYGONS_COUNT - polygonsCount; ++i)
{
for (j = 0; j < 3; ++j)
{
for (unsigned int k = 0; k < GL_POLYGON_VERTEX_SIZE; ++k)
{
vertices.push_back(0.0f);
}
}
}
}
示例6: wxExecute
//.........这里部分代码省略.........
DWORD tid;
HANDLE hThread = ::CreateThread(NULL,
0,
wxExecuteThread,
(void *)data,
0,
&tid);
// resume process we created now - whether the thread creation succeeded or
// not
if ( ::ResumeThread(pi.hThread) == (DWORD)-1 )
{
// ignore it - what can we do?
wxLogLastError(wxT("ResumeThread in wxExecute"));
}
// close unneeded handle
if ( !::CloseHandle(pi.hThread) )
{
wxLogLastError(wxT("CloseHandle(hThread)"));
}
if ( !hThread )
{
wxLogLastError(wxT("CreateThread in wxExecute"));
DestroyWindow(hwnd);
delete data;
// the process still started up successfully...
return pi.dwProcessId;
}
gs_asyncThreads.push_back(hThread);
data->hThread = hThread;
#if wxUSE_IPC
// second part of DDE hack: now establish the DDE conversation with the
// just launched process
if ( !ddeServer.empty() )
{
bool ddeOK;
// give the process the time to init itself
//
// we use a very big timeout hoping that WaitForInputIdle() will return
// much sooner, but not INFINITE just in case the process hangs
// completely - like this we will regain control sooner or later
switch ( ::WaitForInputIdle(pi.hProcess, 10000 /* 10 seconds */) )
{
default:
wxFAIL_MSG( wxT("unexpected WaitForInputIdle() return code") );
// fall through
case WAIT_FAILED:
wxLogLastError(wxT("WaitForInputIdle() in wxExecute"));
case WAIT_TIMEOUT:
wxLogDebug(wxT("Timeout too small in WaitForInputIdle"));
ddeOK = false;
break;
case 0:
// ok, process ready to accept DDE requests
ddeOK = wxExecuteDDE(ddeServer, ddeTopic, ddeCommand);
示例7: Init
void Init()
{
// We use this for some sanity checking
gs_myClassInstances.push_back(this);
}
示例8: ParseCommand
/**
* @brief Parses command.
*
* @param context Parse context.
* @param command Output variable.
* @param errors Container for errors.
*/
static bool ParseCommand(IteratorPair& context, CMakeParser::Command& command,
wxVector<CMakeParser::Error>& errors)
{
command.pos = 0;
command.name.clear();
command.arguments.clear();
Token token;
// Skip spaces and find identifier (command name)
for (GetToken(context, token); !context.IsEof(); GetToken(context, token)) {
// Identifier found
if (token.type == Token::TypeIdentifier) {
break;
}
}
// Done
if (context.IsEof())
return false;
// Must be an identifier
assert(token.type == Token::TypeIdentifier);
// Store command name
command.name = token.value;
command.pos = token.start;
// Skip spaces and find open parenthessis
for (GetToken(context, token); !context.IsEof(); GetToken(context, token)) {
// Identifier found
if (token.type == Token::TypeLeftParen) {
break;
} else if (token.type == Token::TypeSpace) {
continue;
} else {
// Expected open parenthesis
CMakeParser::Error error = {token.start, CMakeParser::ErrorUnexpectedToken};
errors.push_back(error);
// Don't stop parsing, just find the parenthesis
}
}
// Unexpected EOF.
if (context.IsEof())
// TODO add error?
return false;
// Must be a '('
assert(token.type == Token::TypeLeftParen);
// Parse next token
GetToken(context, token);
// Command have arguments
if (token.type != Token::TypeRightParen) {
wxString arg;
// Read tokens
for (; !context.IsEof(); GetToken(context, token)) {
// End of arguments
if (token.type == Token::TypeRightParen) {
break;
}
// Next argument
if (token.type == Token::TypeSpace) {
// Store argument
if (!arg.IsEmpty())
command.arguments.push_back(arg);
arg.Clear();
continue;
}
// Add token value
arg += token.value;
}
// Store last argument
if (!arg.IsEmpty())
command.arguments.push_back(arg);
}
// Command must ends with close paren
return (token.type == Token::TypeRightParen);
}