void BFS2::init() { float min_dist = std::numeric_limits<float>::max(); RoadVertexDesc min_v1_desc; RoadVertexDesc min_v2_desc; // テンポラリで、手動でルートを指定 //min_v1_desc = 33; //min_v2_desc = 74; min_v1_desc = 15; min_v2_desc = 5; //findBestRoots(roads1, roads2, min_v1_desc, min_v2_desc); if (tree1 != NULL) delete tree1; if (tree2 != NULL) delete tree2; tree1 = new BFSTree(roads1, min_v1_desc); tree2 = new BFSTree(roads2, min_v2_desc); correspondence = findCorrespondence(roads1, tree1, roads2, tree2); // シーケンスを生成 clearSequence(); for (int i = 0; i <= 20; i++) { float t = 1.0f - (float)i * 0.05f; sequence.push_back(interpolate(t)); } selected = 0; }
void ImageSequenceSource::deinitialize() throw (VoreenException) { outport_.setData(0); clearSequence(); delete imageSequence_; imageSequence_ = 0; RenderProcessor::deinitialize(); }
/* Test that a non-modal child window of a modal dialog is shown in front of the dialog even if the dialog becomes modal after the child window is created. */ void tst_MacGui::nonModalOrder() { clearSequence(); PrimaryWindowDialog primary; primary.resize(400, 400); primary.move(100, 100); primary.exec(); QCOMPARE(primary.frontWidget, primary.secondaryWindow); }
/* Test that a non-modal child window of a modal dialog is shown in front of the dialog even if the dialog becomes modal after the child window is created. */ void tst_MacGui::nonModalOrder() { clearSequence(); PrimaryWindowDialog primary; primary.resize(400, 400); primary.move(100, 100); primary.exec(); QEXPECT_FAIL("", "Non-modal child windows show behind the modal dialig", Abort); QCOMPARE(primary.frontWidget, primary.secondaryWindow); }
void ImageSequenceSource::setImageSequence(ImageSequence* sequence) { if (!isInitialized()) { LERROR("loadImageSequence(): not initialized"); return; } clearSequence(); // now owner of the sequence -> delete it before assigning delete imageSequence_; imageSequence_ = sequence; sequenceOwner_ = false; outport_.setData(imageSequence_); outport_.invalidate(); invalidate(); numImages_.set(sequence ? sequence->size() : 0); }
void MTT::buildTree(float w1, float w2, float w3) { clearSequence(); // 頂点の中で、degreeが1のものをcollapseしていく RoadGraph* r = GraphUtil::copyRoads(roads); collapse(r, w1, w2, w3, &sequence); delete r; return; /* // 生き残っている頂点を探す。 std::list<RoadVertexDesc> v_list; RoadVertexIter vi, vend; for (boost::tie(vi, vend) = boost::vertices(roads->graph); vi != vend; ++vi) { if (!roads->graph[*vi]->valid) continue; v_list.push_back(*vi); } expand(roads); */ }
void GuiTester::clickLater(QWidget *widget, Qt::MouseButtons buttons, int delay) { clearSequence(); addToSequence(new ClickLaterAction(widget, buttons), delay); runSequence(); }
void GuiTester::clickLater(QAccessibleInterface *interface, Qt::MouseButtons buttons, int delay) { clearSequence(); addToSequence(new ClickLaterAction(interface, buttons), delay); runSequence(); }
GuiTester::GuiTester() { clearSequence(); }
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; }
MTT::~MTT() { delete roads; clearSequence(); }