GME
13
|
00001 // SearchAlg.h: interface for the CSearch class. 00002 // 00004 00005 #ifndef AFX_SEARCHALG_H 00006 #define AFX_SEARCHALG_H 00007 00008 #if _MSC_VER > 1000 00009 #pragma once 00010 #endif // _MSC_VER > 1000 00011 00012 #include "ComHelp.h" 00013 #include "Input.h" 00014 #include <afxcmn.h> 00015 //#include "GMESearchDialog.h" 00016 00023 class CSearch 00024 { 00025 public: 00026 CSearch(CInput inp); 00027 // CSearch(CInput inp, CGMESearchDialog *Searcher); 00028 virtual ~CSearch(); 00040 void Search(IMgaFolder *root, IMgaObjects* scope, IMgaFCO *selected, CComPtr<IMgaFCOs> disp, CProgressCtrl *Progress); 00041 void SearchResults(CComPtr<IMgaFCOs> old_results,CComPtr<IMgaFCOs> disp, CProgressCtrl *Progress); 00042 bool Check(IMgaFCO* fco,int type); 00043 bool CheckLogicalCombination(IMgaFCO* fco,bool (CSearch::*Chk)(IMgaFCO* fco,bool first)); 00044 int Matches(IMgaFCO* fco,bool first); 00045 bool PerformLogical(int first,int second); 00046 00047 private: 00048 00054 void SearchFolderHierarchy(IMgaFolder *root); 00060 void SearchModelHierarchy(IMgaModel *root); 00066 void SearchReferences(IMgaFCO *referenced); 00067 00073 void CheckAllAtoms(IMgaFCOs *allObjects); 00074 00075 //check all connections for matches 00076 void CheckAllConnections(IMgaFCOs *allObjects); 00082 void CheckAllReferences(IMgaFCOs *allObjects); 00088 void CheckAllSets(IMgaFCOs *allObjects); 00094 void CheckAllModels(IMgaFCOs *allObjects); 00095 00099 bool CheckModel(IMgaFCO *Model); 00103 bool CheckAtom(IMgaFCO *Atom); 00104 00105 //check connection against search criteria 00106 bool CheckConnection(IMgaFCO *Connection); 00110 bool CheckReference(IMgaFCO *Reference); 00114 bool CheckSet(IMgaFCO *Set); 00115 00119 bool CheckAttributes(IMgaFCO *obj,bool first=true); 00120 00121 // bool CheckAttributes2(IMgaFCO *obj,BOOL first=1); 00122 00123 00125 CComPtr<IMgaFCOs> results; 00126 // Progress bar 00127 CProgressCtrl *m_pgsSearch; 00128 00130 CInput filter; 00131 00132 bool EvaluateResult(std::vector<Attribute>& attrs); 00133 00134 00135 // CGMESearchDialog *SearchDialog; 00136 }; 00137 00138 #endif