Implements Impala::Core::Database::DataDocumentListener. Definition at line 113 of file AnnotationTableGui.h. References Impala::Visualization::ImagesWindow::AddImage(), Impala::Visualization::ImageSetIdxGrid::AddImageSetIdx(), Impala::Visualization::ImageSetIdxGrid::Clear(), Impala::Core::Database::DataDocument::GetConcept(), Impala::Core::Database::DataDocument::GetConceptIdx(), OglGui::StringSelector::GetCurrentStringIdx(), Impala::Core::Database::RawDataSet::GetDatabase(), Impala::Core::Database::RawDataSet::GetFilePathAnnotation(), Impala::Core::VideoSet::Keyframes::GetFrameId(), Impala::Core::ImageSet::IxsDocument::GetImageSet(), Impala::Core::VideoSet::SegmentationDocument::GetImSetKeyframes(), Impala::Core::VideoSet::SegmentationDocument::GetKeyframes(), Impala::Core::Database::RawDataSet::GetLocator(), Impala::Core::VideoSet::SegmentationDocument::GetVideoSet(), ILOG_INFO, Impala::Core::Table::AnnotationTable::MakeFromFile(), mAnno, mAnnoSet, mCurConcept, mDataDoc, mImagesSet, mImSetIdxGrid, Impala::Min(), mIxsDoc, mSegDoc, mStringSelector, mVisibleKeys, Impala::QUID_CLASS_FRAME, Impala::QUID_CLASS_IMAGE, Impala::Visualization::ImagesWindow::RemoveImages(), OglGui::StringSelector::SetCurrentString(), Impala::Visualization::ImageSet::SetFirstVisY(), and Impala::Visualization::ImageSetIdxGrid::UpdateLayout(). Referenced by StringSelectionEvent(). 00114 { 00115 int concept = mDataDoc->GetConceptIdx(); 00116 if (concept != mStringSelector->GetCurrentStringIdx()) 00117 mStringSelector->SetCurrentString(concept, true); 00118 if (concept == mCurConcept) 00119 return; 00120 00121 mCurConcept = concept; 00122 if (mImagesSet) 00123 { 00124 mImagesSet->RemoveImages(); 00125 mImagesSet->SetFirstVisY(0, true); 00126 } 00127 if (mImSetIdxGrid) 00128 mImSetIdxGrid->Clear(); 00129 mVisibleKeys.clear(); 00130 Core::VideoSet::Keyframes* keys = mSegDoc ? mSegDoc->GetKeyframes() : 0; 00131 if (mSegDoc && !keys) 00132 return; 00133 00134 Core::ImageSet::ImageSet* imSet = 00135 mSegDoc ? mSegDoc->GetImSetKeyframes(true) : mIxsDoc->GetImageSet(); 00136 if (!imSet) 00137 return; 00138 00139 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00140 Util::Database* db; 00141 String conceptTab = mDataDoc->GetConcept()+".tab"; 00142 String fName; 00143 if (mSegDoc) 00144 { 00145 Core::VideoSet::VideoSet* vidSet = mSegDoc->GetVideoSet(); 00146 fName = vidSet->GetFilePathAnnotation(QUID_CLASS_FRAME, mAnnoSet, 00147 conceptTab, false, false); 00148 db = vidSet->GetDatabase(); 00149 } 00150 if (mIxsDoc) 00151 { 00152 Core::ImageSet::ImageSet* ixsSet = mIxsDoc->GetImageSet(); 00153 fName = ixsSet->GetFilePathAnnotation(QUID_CLASS_IMAGE, mAnnoSet, 00154 conceptTab, false, false); 00155 db = ixsSet->GetDatabase(); 00156 } 00157 if (fName.empty()) 00158 return; 00159 00160 if (mAnno) 00161 delete mAnno; 00162 mAnno = Core::Table::AnnotationTable::MakeFromFile 00163 (mDataDoc->GetConcept(),fName, db); 00164 #else // REPOSITORY_USED 00165 typedef Persistency::AnnotationTableLocator AnnoLoc; 00166 AnnoLoc loc; 00167 if (mSegDoc) 00168 { 00169 Core::VideoSet::VideoSet* vidSet = mSegDoc->GetVideoSet(); 00170 loc = AnnoLoc(vidSet->GetLocator(), QUID_CLASS_FRAME, mAnnoSet, 00171 mDataDoc->GetConcept()); 00172 } 00173 if (mIxsDoc) 00174 { 00175 Core::ImageSet::ImageSet* ixsSet = mIxsDoc->GetImageSet(); 00176 loc = AnnoLoc(ixsSet->GetLocator(), QUID_CLASS_IMAGE, mAnnoSet, 00177 mDataDoc->GetConcept()); 00178 } 00179 if (! Persistency::AnnotationTableRepository().Exists(loc)) 00180 return; 00181 00182 if (mAnno) 00183 delete mAnno; 00184 mAnno = Persistency::AnnotationTableRepository().Get(loc); 00185 #endif // REPOSITORY_USED 00186 int sz = mAnno->Size(); 00187 int maxNr = mImagesSet ? Min(sz, 1000) : sz; 00188 //int maxNr = Min<int>(mAnno->Size(), 1000); 00189 int nrFound = 0; 00190 int s = 0; 00191 while ((s < mAnno->Size()) && (nrFound < maxNr)) 00192 { 00193 if (mAnno->IsPositive(s)) 00194 { 00195 Quid q = mAnno->Get1(s); 00196 int keyfr = keys ? keys->GetFrameId(q) : mAnno->GetIndex(q); 00197 if (keyfr != -1) 00198 { 00199 if (mImagesSet) 00200 mImagesSet->AddImage(keyfr, imSet); 00201 if (mImSetIdxGrid) 00202 mImSetIdxGrid->AddImageSetIdx(imSet,keyfr); 00203 mVisibleKeys.push_back(keyfr); 00204 nrFound++; 00205 } 00206 } 00207 s++; 00208 } 00209 if (mImSetIdxGrid) 00210 mImSetIdxGrid->UpdateLayout(true); 00211 ILOG_INFO("Found " << nrFound << " of " << mAnno->GetNrPositive() 00212 << " positive annotations"); 00213 }
Here is the call graph for this function:
|