Standard_Boolean ShHealOper_FillHoles::Fill() { ShapeAnalysis_FreeBounds sab(myInitShape); TopoDS_Compound aCompClosed = sab.GetClosedWires(); TopoDS_Compound aCompOpen = sab.GetOpenWires(); TopTools_SequenceOfShape aFillWires; if(!aCompClosed.IsNull()) { TopoDS_Iterator aIt(aCompClosed); for( ; aIt.More(); aIt.Next()) aFillWires.Append(aIt.Value()); } if(!aCompOpen.IsNull()) { TopoDS_Iterator aIt(aCompOpen); for( ; aIt.More(); aIt.Next()) aFillWires.Append(aIt.Value()); } TopExp_Explorer aExp(myInitShape,TopAbs_EDGE,TopAbs_FACE); for( ; aExp.More(); aExp.Next()) aFillWires.Append(aExp.Current()); return Fill(aFillWires); }
// // private methods // // Use these two methods to copy the input tracks to mOutputTracks, if // doing the processing on them, and replacing the originals only on success (and not cancel). // Copy the group tracks that have tracks selected void Effect::CopyInputTracks(int trackType) { // Reset map mIMap.Clear(); mOMap.Clear(); mOutputTracks = new TrackList(); mOutputTracksType = trackType; //iterate over tracks of type trackType (All types if Track::All) TrackListOfKindIterator aIt(trackType, mTracks); t2bHash added; for (Track *aTrack = aIt.First(); aTrack; aTrack = aIt.Next()) { // Include selected tracks, plus sync-lock selected tracks for Track::All. if (aTrack->GetSelected() || (trackType == Track::All && aTrack->IsSyncLockSelected())) { Track *o = aTrack->Duplicate(); mOutputTracks->Add(o); mIMap.Add(aTrack); mOMap.Add(o); } } }
int CInstaller::install(const QSet<KUrl> &urls) { QSet<KUrl>::ConstIterator it(urls.begin()), end(urls.end()); bool sysInstall(false); CJobRunner *jobRunner=new CJobRunner(itsParent); CJobRunner::startDbusService(); if(!Misc::root()) { switch(KMessageBox::questionYesNoCancel(itsParent, i18n("Do you wish to install the font(s) for personal use " "(only available to you), or " "system-wide (available to all users)?"), i18n("Where to Install"), KGuiItem(i18n(KFI_KIO_FONTS_USER)), KGuiItem(i18n(KFI_KIO_FONTS_SYS)))) { case KMessageBox::No: sysInstall=true; break; case KMessageBox::Cancel: return -1; default: break; } } QSet<KUrl> instUrls; for(; it!=end; ++it) { KUrl local(KIO::NetAccess::mostLocalUrl(*it, NULL)); bool package(false); if(local.isLocalFile()) { QString localFile(local.toLocalFile()); if(Misc::isPackage(localFile)) { instUrls+=FontsPackage::extract(localFile, &itsTempDir); package=true; } } if(!package) { KUrl::List associatedUrls; CJobRunner::getAssociatedUrls(*it, associatedUrls, false, itsParent); instUrls.insert(*it); KUrl::List::Iterator aIt(associatedUrls.begin()), aEnd(associatedUrls.end()); for(; aIt!=aEnd; ++aIt) instUrls.insert(*aIt); } } if(instUrls.count()) { CJobRunner::ItemList list; QSet<KUrl>::ConstIterator it(instUrls.begin()), end(instUrls.end()); for(; it!=end; ++it) list.append(*it); return jobRunner->exec(CJobRunner::CMD_INSTALL, list, Misc::root() || sysInstall); } else return -1; }