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