本文整理汇总了C++中ProgressBar::setMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgressBar::setMessage方法的具体用法?C++ ProgressBar::setMessage怎么用?C++ ProgressBar::setMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressBar
的用法示例。
在下文中一共展示了ProgressBar::setMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadVolume
void TransFuncListProperty::loadVolume(const std::string& url)
throw (tgt::FileException, std::bad_alloc) {
if (!containsURL(url)) {
LWARNING("loadVolume(): passed URL not contained by this property: " << url);
return;
}
// delete volume, if already loaded and owned by the property
if (getVolume(url) && isOwner(url))
delete getVolume(url);
handleMap_.erase(url);
ownerMap_.erase(url);
ProgressBar* progressBar = getProgressBar();
if (progressBar) {
progressBar->setTitle("Loading volume");
progressBar->setMessage("Loading volume ...");
}
VolumeSerializerPopulator serializerPopulator(progressBar);
VolumeBase* handle = serializerPopulator.getVolumeSerializer()->read(VolumeURL(url));
if (handle) {
// url may have been altered by loading routine
if (url != handle->getOrigin().getURL()) {
bool selected = isSelected(url);
selectionMap_.erase(url);
selectionMap_[handle->getOrigin().getURL()] = selected;
for (size_t i=0; i<value_.size(); i++) {
if (value_[i] == url) {
value_[i] = handle->getOrigin().getURL();
break;
}
}
}
handleMap_[handle->getOrigin().getURL()] = handle;
ownerMap_[handle->getOrigin().getURL()] = true;
}
invalidate();
}
示例2: loadImageSequence
void ImageSequenceSource::loadImageSequence(const std::string& d)
throw (tgt::FileException, std::bad_alloc) {
if (!isInitialized()) {
LERROR("loadImageSequence(): not initialized");
return;
}
// important: d might be cleared by clearSequence
std::string dir(d);
forceReload_ = false;
if (!imageSequence_) {
LERROR("No image sequence present");
return;
}
// clear current sequence
clearSequence();
if (dir.empty())
return;
LINFO("Loading images from directory " << dir << " ...");
currentDir_ = dir;
imageDirectory_.set(dir);
// load images as textures and collect them in an image sequence
std::vector<std::string> filenames = tgt::FileSystem::readDirectory(dir, true, false);
// create progress bar
ProgressBar* progressDialog = 0;
if (showProgressBar_.get() && !filenames.empty()) {
progressDialog = VoreenApplication::app()->createProgressDialog();
if (progressDialog) {
progressDialog->setTitle("Loading Images");
progressDialog->show();
progressDialog->setProgress(0.f);
progressDialog->forceUpdate();
}
}
tgt::Texture::Filter filterMode = textureFiltering_.get() ? tgt::Texture::LINEAR : tgt::Texture::NEAREST;
for (size_t i=0; i<filenames.size(); ++i) {
if (progressDialog) {
progressDialog->setMessage("Loading " + filenames[i] + " ...");
progressDialog->setProgress(static_cast<float>(i) / static_cast<float>(filenames.size()));
}
LINFO("Loading image " << filenames[i] << " ...");
tgt::Texture* texture = TexMgr.load(dir + "/" + filenames[i], filterMode,
false, false, true, false, !GpuCaps.isNpotSupported());
if (texture)
imageSequence_->add(texture);
else
LWARNING("Failed to load image: " << filenames[i]);
}
LGL_ERROR;
// upload texture data
if (uploadTextureData_.get()) {
LINFO("Uploading texture data ...");
for (unsigned int i=0; i<imageSequence_->size(); i++)
imageSequence_->at(i)->uploadTexture();
LGL_ERROR;
}
// clear progress
if (progressDialog) {
progressDialog->hide();
delete progressDialog;
progressDialog = 0;
}
// output sequence
outport_.setData(imageSequence_);
LINFO("Successfully loaded " << imageSequence_->size() << " images.");
numImages_.set(imageSequence_->size());
LGL_ERROR;
}