本文整理汇总了C++中Progress函数的典型用法代码示例。如果您正苦于以下问题:C++ Progress函数的具体用法?C++ Progress怎么用?C++ Progress使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Progress函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeKeyMaterial
PERROR MakeKeyMaterial( FRAME *frame, UBYTE *passphrase, struct PPTBase *PPTBase )
{
ROWPTR cp, tmprow;
WORD row;
struct ExecBase *SysBase = PPTBase->lb_Sys;
SHA_INFO sha = {0};
PERROR res = PERR_OK;
sha_init( &sha );
InitProgress(frame,"Building key...", 0, frame->pix->height );
/*
* First, use the passphrase for the key.
*/
if( strlen(passphrase) > 0 ) sha_update( &sha, passphrase, strlen(passphrase) );
if( tmprow = AllocVec( frame->pix->bytes_per_row, 0L ) ) {
for( row = 0; row < frame->pix->height; row++ ) {
WORD col;
cp = GetPixelRow( frame, row );
if( Progress( frame, row ) ) {
res = PERR_BREAK;
break;
}
for( col = 0; col < frame->pix->bytes_per_row; col++ ) {
/* Use only significant bytes */
tmprow[col] = cp[col] & 0xFE;
}
sha_update( &sha, tmprow, frame->pix->bytes_per_row );
}
// Use the passphrase again (why?)
if( strlen(passphrase) > 0 ) sha_update( &sha, passphrase, strlen(passphrase) );
FinishProgress( frame );
sha_final( &sha );
memcpy( key, &sha.digest[0], SHA_DIGESTSIZE );
D(sha_print( &sha ) );
FreeVec( tmprow );
} else {
SetErrorCode( frame, PERR_OUTOFMEMORY );
res = PERR_OUTOFMEMORY;
}
return res;
}
示例2: QDialog
EditTagDialog::EditTagDialog(Application* app, QWidget* parent)
: QDialog(parent),
ui_(new Ui_EditTagDialog),
app_(app),
album_cover_choice_controller_(new AlbumCoverChoiceController(this)),
loading_(false),
ignore_edits_(false),
tag_fetcher_(new TagFetcher(this)),
cover_art_id_(0),
cover_art_is_set_(false),
results_dialog_(new TrackSelectionDialog(this))
{
cover_options_.default_output_image_ =
AlbumCoverLoader::ScaleAndPad(cover_options_, QImage(":nocover.png"));
connect(app_->album_cover_loader(), SIGNAL(ImageLoaded(quint64,QImage,QImage)),
SLOT(ArtLoaded(quint64,QImage,QImage)));
connect(tag_fetcher_, SIGNAL(ResultAvailable(Song, SongList)),
results_dialog_, SLOT(FetchTagFinished(Song, SongList)),
Qt::QueuedConnection);
connect(tag_fetcher_, SIGNAL(Progress(Song,QString)),
results_dialog_, SLOT(FetchTagProgress(Song,QString)));
connect(results_dialog_, SIGNAL(SongChosen(Song, Song)),
SLOT(FetchTagSongChosen(Song, Song)));
connect(results_dialog_, SIGNAL(finished(int)), tag_fetcher_, SLOT(Cancel()));
album_cover_choice_controller_->SetApplication(app_);
ui_->setupUi(this);
ui_->splitter->setSizes(QList<int>() << 200 << width() - 200);
ui_->loading_label->hide();
// An editable field is one that has a label as a buddy. The label is
// important because it gets turned bold when the field is changed.
foreach (QLabel* label, findChildren<QLabel*>()) {
QWidget* widget = label->buddy();
if (widget) {
// Store information about the field
fields_ << FieldData(label, widget, widget->objectName());
// Connect the Reset signal
if (dynamic_cast<ExtendedEditor*>(widget)) {
connect(widget, SIGNAL(Reset()), SLOT(ResetField()));
}
// Connect the edited signal
if (qobject_cast<QLineEdit*>(widget)) {
connect(widget, SIGNAL(textChanged(QString)), SLOT(FieldValueEdited()));
} else if (qobject_cast<QPlainTextEdit*>(widget)) {
connect(widget, SIGNAL(textChanged()), SLOT(FieldValueEdited()));
} else if (qobject_cast<QSpinBox*>(widget)) {
connect(widget, SIGNAL(valueChanged(int)), SLOT(FieldValueEdited()));
}
}
}
示例3:
void CGameGraphBuilder::fill_distances (const float &start, const float &amount)
{
Progress (start);
m_distances.resize (graph().vertices().size());
{
DISTANCES::iterator I = m_distances.begin();
DISTANCES::iterator E = m_distances.end();
for ( ; I != E; I++) {
(*I).resize (level_graph().header().vertex_count());
xr_vector<u32>::iterator i = (*I).begin();
xr_vector<u32>::iterator e = (*I).end();
for ( ; i != e; i++)
*i = u32(-1);
}
}
Progress (start + amount);
}
示例4: Progress
void Cf3Replay::Record()
{
(*m_iPointer).pressed[m_nPointer]=(*m_iPointer).pushed[m_nPointer]=0;
for (int i=0; i<8; i++) {
if (f3Input.GetKeyPressed(i+1)) (*m_iPointer).pressed [m_nPointer] |= (1<<i);
if (f3Input.GetKeyPushed(i+1)) (*m_iPointer).pushed [m_nPointer] |= (1<<i);
}
Progress();
m_nSize++;
}
示例5: MainScreenSize
bool OGL_LoadScreen::Start()
{
// load the image
FileSpecifier File;
if (path.size() == 0) return use = false;
if (!File.SetNameWithPath(path.c_str())) return use = false;
if (!image.LoadFromFile(File, ImageLoader_Colors, 0)) return use = false;
if (!blitter.Load(image)) return use = false;
int screenWidth, screenHeight;
MainScreenSize(screenWidth, screenHeight);
bound_screen();
// the true width/height
int imageWidth = static_cast<int>(image.GetWidth() * image.GetVScale());
int imageHeight = static_cast<int>(image.GetHeight() * image.GetUScale());
if (scale)
{
if (stretch)
{
m_dst.w = screenWidth;
m_dst.h = screenHeight;
}
else if (imageWidth / imageHeight > screenWidth / screenHeight)
{
m_dst.w = screenWidth;
m_dst.h = imageHeight * screenWidth / imageWidth;
}
else
{
m_dst.w = imageWidth * screenHeight / imageHeight;
m_dst.h = screenHeight;
}
}
else
{
m_dst.w = imageWidth;
m_dst.h = imageHeight;
}
m_dst.x = (screenWidth - m_dst.w) / 2;
m_dst.y = (screenHeight - m_dst.h) / 2;
x_offset = m_dst.x;
y_offset = m_dst.y;
x_scale = m_dst.w / (double) imageWidth;
y_scale = m_dst.h / (double) imageHeight;
OGL_ClearScreen();
Progress(0);
return use = true;
}
示例6: lc_global_data
void CBuild::u_Tesselate(tesscb_estimator* cb_E, tesscb_face* cb_F, tesscb_vertex* cb_V)
{
// main process
FPU::m64r ();
Status ("Tesselating...");
g_bUnregister = false;
u32 counter_create = 0;
u32 cnt_verts = lc_global_data()->g_vertices().size();
//u32 cnt_faces = g_faces.size();
for (u32 I=0; I<lc_global_data()->g_faces().size(); ++I)
{
Face* F = lc_global_data()->g_faces()[I];
if (0==F)
continue;
if( !check_and_destroy_splited( I ) )
continue;
Progress (float(I)/float(lc_global_data()->g_faces().size()));
int max_id = -1;
if( !do_tesselate_face( *F, cb_E, max_id ) )
continue;
xr_vector<Face*> adjacent_vec;
Vertex *V1,*V2;
CollectProblematicFaces( *F, max_id, adjacent_vec, &V1, &V2 );
++counter_create;
if (0==(counter_create%10000))
{
for (u32 I=0; I<lc_global_data()->g_vertices().size(); ++I)
if (lc_global_data()->g_vertices()[I]->m_adjacents.empty())
lc_global_data()->destroy_vertex (lc_global_data()->g_vertices()[I]);
Status ("Working: %d verts created, %d(now) / %d(was) ...",counter_create,lc_global_data()->g_vertices().size(),cnt_verts);
FlushLog ();
}
tessalate_faces( adjacent_vec, V1, V2, cb_F, cb_V );
}
// Cleanup
for (u32 I=0; I<lc_global_data()->g_faces().size(); ++I)
if (0!=lc_global_data()->g_faces()[I] && lc_global_data()->g_faces()[I]->flags.bSplitted)
lc_global_data()->destroy_face (lc_global_data()->g_faces()[I]);
for (u32 I=0; I<lc_global_data()->g_vertices().size(); ++I)
if (lc_global_data()->g_vertices()[I]->m_adjacents.empty())
lc_global_data()->destroy_vertex (lc_global_data()->g_vertices()[I]);
lc_global_data()->g_faces().erase (std::remove(lc_global_data()->g_faces().begin(),lc_global_data()->g_faces().end(),(Face*)0),lc_global_data()->g_faces().end());
lc_global_data()->g_vertices().erase (std::remove(lc_global_data()->g_vertices().begin(),lc_global_data()->g_vertices().end(),(Vertex*)0),lc_global_data()->g_vertices().end());
g_bUnregister = true;
}
示例7: if
void CBuild::CorrectTJunctions()
{
Status ("Processing...");
vecJunctions = xr_new<xr_vector<record> > (); vecJunctions->reserve (1024);
vecEdges = xr_new<xr_vector<record> > (); vecEdges->reserve (1024);
for (u32 I=0; I<g_faces.size(); I++)
{
Face* F = g_faces[I];
// Iterate on edges
for (u32 e=0; e<3; e++)
{
Vertex *vA,*vB;
F->EdgeVerts (e,&vA,&vB);
// Iterate on 'vA'-adjacent faces
for (u32 f1=0; f1!=vA->adjacent.size(); f1++)
{
Face* F1 = vA->adjacent[f1];
// Iterate on it's edges
for (u32 e1=0; e1<3; e1++)
{
Vertex *v1,*v2;
F1->EdgeVerts (e1,&v1,&v2);
edge (v1,v2);
if (v1==vA && v2!=vB) check(vA,vB,v2);
else if (v2==vA && v1!=vB) check(vA,vB,v1);
}
}
// Iterate on 'vB'-adjacent faces
for (u32 f2=0; f2!=vB->adjacent.size(); f2++)
{
Face* F2 = vB->adjacent[f2];
// Iterate on it's edges
for (u32 e1=0; e1<3; e1++)
{
Vertex *v1,*v2;
F2->EdgeVerts (e1,&v1,&v2);
edge (v1,v2);
if (v1==vB && v2!=vA) check(vA,vB,v2);
else if (v2==vB && v1!=vA) check(vA,vB,v1);
}
}
}
Progress(float(I)/float(g_faces.size()));
}
clMsg("*** %d junctions and %d long edges found.",vecJunctions->size(),vecEdges->size());
xr_delete(vecJunctions);
xr_delete(vecEdges);
}
示例8: MtProgress_Set
SRes MtProgress_Set(CMtProgress *p, unsigned index, UInt64 inSize, UInt64 outSize)
{
SRes res;
CriticalSection_Enter(&p->cs);
UPDATE_PROGRESS(inSize, p->inSizes[index], p->totalInSize)
UPDATE_PROGRESS(outSize, p->outSizes[index], p->totalOutSize)
if (p->res == SZ_OK)
p->res = Progress(p->progress, p->totalInSize, p->totalOutSize);
res = p->res;
CriticalSection_Leave(&p->cs);
return res;
}
示例9: CancelCommand
ECommandResult::Type FPerforceSourceControlProvider::ExecuteSynchronousCommand(FPerforceSourceControlCommand& InCommand, const FText& Task, bool bSuppressResponseMsg)
{
ECommandResult::Type Result = ECommandResult::Failed;
struct Local
{
static void CancelCommand(FPerforceSourceControlCommand* InControlCommand)
{
InControlCommand->Cancel();
}
};
// Display the progress dialog
FScopedSourceControlProgress Progress(Task, FSimpleDelegate::CreateStatic(&Local::CancelCommand, &InCommand));
// Perform the command asynchronously
IssueCommand( InCommand, false );
// Wait until the command has been processed
while (!InCommand.bCancelledWhileTryingToConnect && CommandQueue.Contains(&InCommand))
{
// Tick the command queue and update progress.
Tick();
Progress.Tick();
// Sleep for a bit so we don't busy-wait so much.
FPlatformProcess::Sleep(0.01f);
}
if (InCommand.bCancelled)
{
Result = ECommandResult::Cancelled;
}
else if (InCommand.bCommandSuccessful)
{
Result = ECommandResult::Succeeded;
}
// If the command failed, inform the user that they need to try again
if ( !InCommand.bCancelled && Result != ECommandResult::Succeeded && !bSuppressResponseMsg )
{
FMessageDialog::Open( EAppMsgType::Ok, LOCTEXT("Perforce_ServerUnresponsive", "Perforce server is unresponsive. Please check your connection and try again.") );
}
// Delete the command now if not marked as auto-delete
if (!InCommand.bAutoDelete)
{
delete &InCommand;
}
return Result;
}
示例10: u32
void CBuild::SaveTREE (IWriter &fs)
{
CMemoryWriter MFS;
Status ("Geometry buffers...");
xr_vector<u32> remap;
remap.reserve (g_tree.size());
for (u32 rid=0; rid<g_tree.size(); rid++) {
OGF* o = dynamic_cast<OGF*> (g_tree[rid]);
if (o) remap.push_back(rid);
}
std::stable_sort (remap.begin(),remap.end(),remap_order);
clMsg ("remap-size: %d / %d",remap.size(),g_tree.size());
for (u32 sid=0; sid<remap.size(); sid++) {
u32 id = remap[sid];
//clMsg ("%3d: subdiv: %d",sid,id);
g_tree[id]->PreSave (id);
}
Status ("Visuals...");
fs.open_chunk (fsL_VISUALS);
for (xr_vector<OGF_Base*>::iterator it = g_tree.begin(); it!=g_tree.end(); it++) {
u32 idx = u32(it-g_tree.begin());
MFS.open_chunk (idx);
(*it)->Save (MFS);
MFS.close_chunk ();
Progress (float(idx)/float(g_tree.size()));
}
fs.w (MFS.pointer(),MFS.size());
fs.close_chunk ();
clMsg ("Average: %d verts/%d faces, 50(%2.1f), 100(%2.1f), 500(%2.1f), 1000(%2.1f), 5000(%2.1f)",
g_batch_verts/g_batch_count,
g_batch_faces/g_batch_count,
100.f * float(g_batch_50)/float(g_batch_count),
100.f * float(g_batch_100)/float(g_batch_count),
100.f * float(g_batch_500)/float(g_batch_count),
100.f * float(g_batch_1000)/float(g_batch_count),
100.f * float(g_batch_5000)/float(g_batch_count)
);
mem_Compact ();
SaveGEOMs ("level.geom", g_VB,g_IB,g_SWI); // Normal
SaveGEOMs ("level.geomx", x_VB,x_IB,x_SWI); // Fast-Path
Status ("Shader table...");
fs.open_chunk (fsL_SHADERS);
fs.w_u32 (g_Shaders.size());
for (xr_vector<LPCSTR>::iterator T=g_Shaders.begin(); T!=g_Shaders.end(); T++)
fs.w_stringZ (*T);
fs.close_chunk ();
//mem_Compact ();
}
示例11: SetAway
//CALLBACK!
void
Jabber::Authorized()
{
SetAway(false);
fPerc +=0.3333;
fAuth=true;
Progress("Jabber Login", "Jabber: Authorized", fPerc);
LOG(kProtocolName, liDebug, "Jabber:Login %f - Authorized",fPerc) ;
CheckLoginStatus();
JabberHandler::Authorized();
}
示例12: vfRecurseUpdate
void vfRecurseUpdate(u32 dwStartNodeID, u32 percent, u32 iVertexCount)
{
xr_vector<u32> curr_fringe, next_fringe;
curr_fringe.reserve (g_tDistances->size());
next_fringe.reserve (g_tDistances->size());
g_tDistances->assign (g_tDistances->size(),u32(-1));
curr_fringe.push_back (dwStartNodeID);
u32 curr_dist = 0, total_count = 0;
Progress (float(percent)/float(iVertexCount));
for (;!curr_fringe.empty();) {
xr_vector<u32>::iterator I = curr_fringe.begin();
xr_vector<u32>::iterator E = curr_fringe.end();
for ( ; I != E; ++I) {
(*g_tDistances)[*I] = curr_dist;
CLevelGraph::const_iterator i, e;
CLevelGraph::CVertex *node = (*g_tMap).vertex(*I);
(*g_tMap).begin (*I,i,e);
for ( ; i != e; ++i) {
u32 dwNexNodeID = node->link(i);
if (!(*g_tMap).valid_vertex_id(dwNexNodeID) || (*g_tMarks)[dwNexNodeID])
continue;
if ((*g_tDistances)[dwNexNodeID] > curr_dist) {
next_fringe.push_back(dwNexNodeID);
(*g_tMarks)[dwNexNodeID] = true;
}
}
}
I = curr_fringe.begin();
E = curr_fringe.end();
for ( ; I != E; ++I)
(*g_tMarks)[*I] = false;
total_count += curr_fringe.size();
curr_fringe = next_fringe;
next_fringe.clear();
++curr_dist;
Progress (float(percent)/float(iVertexCount) + float(total_count)/(float(iVertexCount)*float(g_tMap->header().vertex_count())));
}
}
示例13: Progress
DFUEngine::Result DFUEngineBase::DoRecover(const DFUEngine::Result &failure)
{
DFUEngine::Result result;
DFURequests::DFUStatus status;
// Delay a little before starting the recovery action
Progress(DFUEngine::recover_clean_up, failure);
Sleep(recoverDelay);
// Ensure that the transport has been started
result = DoConnect(false, false);
if (!result) return result;
// Abort any DFU operation
result = transport->GetStatus(status);
if (result && transport->CanAbort(status.bState))
{
result = transport->Abort();
}
if (result && transport->CanClrStatus(status.bState))
{
result = transport->ClrStatus();
}
if (!result)
{
// Disconnect and reconnect the transport if any problem
Progress(DFUEngine::recover_fail, failure);
result = transport->Disconnect();
if (result) result = DoConnect(false, false);
if (!result) return result;
}
// Perform a reset and disconnect the transport
result = transport->Reset(false);
if (!result) return result;
// Assume successful if this point reached
return DFUEngine::success;
}
示例14: Progress
ECommandResult::Type FSubversionSourceControlProvider::ExecuteSynchronousCommand(FSubversionSourceControlCommand& InCommand, const FText& Task, bool bSuppressResponseMsg)
{
ECommandResult::Type Result = ECommandResult::Failed;
// Display the progress dialog if a string was provided
{
FScopedSourceControlProgress Progress(Task);
// Perform the command asynchronously
IssueCommand( InCommand, false );
while(!InCommand.bExecuteProcessed)
{
// Tick the command queue and update progress.
Tick();
Progress.Tick();
// Sleep for a bit so we don't busy-wait so much.
FPlatformProcess::Sleep(0.01f);
}
// always do one more Tick() to make sure the command queue is cleaned up.
Tick();
if(InCommand.bCommandSuccessful)
{
Result = ECommandResult::Succeeded;
}
}
// If the command failed, inform the user that they need to try again
if ( Result != ECommandResult::Succeeded && !bSuppressResponseMsg )
{
FMessageDialog::Open( EAppMsgType::Ok, LOCTEXT("Subversion_ServerUnresponsive", "Subversion repository is unresponsive. Please check your connection and try again.") );
}
// Delete the command now
check(!InCommand.bAutoDelete);
// ensure commands that are not auto deleted do not end up in the command queue
if ( CommandQueue.Contains( &InCommand ) )
{
CommandQueue.Remove( &InCommand );
}
delete &InCommand;
return Result;
}
示例15: TestBackTrace
void TestBackTrace ()
{
bool rc = true;
TestHeader("backtrace test");
Tracker2 t;
t.doTest(25);
Progress(rc, "minimal functionality");
t.doTest(25);
rc = (t._codepoints[10] != 0);
Progress(rc, "many levels");
rc = (t.found() > 10);
Progress(rc, "many levels retval");
t.doTest(8);
rc = (t.found() == 8);
Progress(rc, "few levels retval");
rc = (t._codepoints[8] == 0);
Progress(rc, "few levels");
PrintSeparator();
}