.tax_node = tax_node;
84 info.uids = iter->second;
87<<
" in list of sequences");
113unique_ptr<CTaxTreeBrowser::TTaxTree>
m_Tree;
144 constwxPoint& pos,
constwxSize&
size,
145 longstyle,
constwxValidator& validator,
146 constwxString& name)
149style = style & ~wxTR_MULTIPLE;
150wxTreeCtrl::Create(parent,
id, pos,
size, style, validator, name);
155 constwxPoint& pos,
constwxSize&
size,
159style = style & ~wxTR_MULTIPLE;
160wxTreeCtrl::Create(parent,
id, pos,
size, style);
248wxArrayTreeItemIds selections;
250 if( GetSelections( selections ) ){
251 for(
size_tix = 0; ix < selections.size(); ix++ ){
252wxTreeItemData* item_data = GetItemData( selections[ix] );
261collector.
uids.erase(
262std::unique( collector.
uids.begin(), collector.
uids.end() ),
263collector.
uids.end()
265uids.swap( collector.
uids);
278 if( !
tree->IsLeaf()) {
283 if(++begin2 == end) {
287 for( ; begin != end; ++begin) {
300new_info.
uids.push_back(*iter);
339 str+=
" sequences";
352 switch(delta_level) {
369 returncounter.
uids;
382for (int i = 0; i < node->children(); ++i) {
383SetSelectedUids(uids, node->child(i));
387CRef<CScope> scope = m_DataSource->GetScope();
388const CTaxTreeDataSource::TUidVec& this_uids = tree->GetValue().uids;
389if (this_uids.size() == uids.size()) {
390bool all_match = true;
391ITERATE (CTaxTreeDataSource::TUidVec, it1, this_uids) {
393ITERATE (CTaxTreeDataSource::TUidVec, it2, uids) {
394if (CSeqUtils::Match(**it1, **it2, scope) ) {
408} else if (this_uids.size() > uids.size()) {
410for (int i = 0; i < node->children(); ++i) {
411SetSelectedUids(uids, node->child(i));
419 if(!GetChildrenCount(node)) {
421 tree->GetValue().uids;
423 if(uid_vec.size() != 1) {
433wxTreeItemId parNode = node;
434 while( (parNode=GetItemParent(parNode)).IsOk() ) {
439wxTreeItemIdValue cookie;
441 if(!chNode.IsOk()) {
442chNode = GetFirstChild(parNode, cookie);
444chNode = GetNextChild(parNode, cookie);
446 if( !(bsel=IsSelected(chNode)) ) {
449}
while(chNode!=GetLastChild(parNode));
451SelectItem(parNode, bsel);
457wxTreeItemIdValue ck;
458wxTreeItemId
next= GetNextChild(node, ck);
void x_PopulateTree(wxTreeItemId node, TTaxTree *tree)
populate a given node from a tax tree node
void x_GetName(TTaxTree &node, string &str) const
retrieve a name for a node
size_t x_CountNodes(TTaxTree &node) const
count the number of UIDs held underneath a given tree
CTaxTreeBrowser(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style, const wxValidator &validator, const wxString &name)
default ctor (for FLTK)
void SetReporter(IReporter *reporter)
set the abstract reporter interface
void SetDataSource(CTaxTreeDataSource &ds)
set the data source for this widget
void x_Refresh()
callback function
IReporter * m_Reporter
our reporter interface
void SetSelectedUids(const CTaxTreeDataSource::TUidVec &uids, wxTreeItemId node)
set selected ids
CRef< CTaxTreeDataSource > m_DataSource
the data source we use
void GetObjectSelection(TConstObjects &objs)
Selection API.
unique_ptr< TTaxTree > m_TaxTree
CTaxTreeDataSource::EDisplayMode m_DispMode
display mode
void SetObjectSelection(const CTaxTreeDataSource::TUidVec &uids)
void GetSelectedUids(CTaxTreeDataSource::TUidVec &uids) const
retrieve the selected UIDs
void SetDisplayMode(CTaxTreeDataSource::EDisplayMode mode)
set the current display mode.
virtual objects::ITreeIterator & GetIterator(EDisplayMode mode=eDisplay_Default)=0
virtual void GetTitle(const objects::CSeq_id &uid, string *title) const =0
virtual void GetTaxMap(TTaxMap &taxmap)=0
virtual const CRef< objects::CScope > & GetScope(void)=0
CRef< CTaxTreeDataSource > m_DS
stack< CTaxTreeBrowser::TTaxTree * > m_Nodes
unique_ptr< CTaxTreeBrowser::TTaxTree > m_Tree
CTaxTreeBrowser::TTaxTree * m_Curr
const CTaxTreeBrowser::TTaxMap & m_TaxMap
ITreeIterator::EAction LevelEnd(const ITaxon1Node *tax_node)
ITreeIterator::EAction Execute(const ITaxon1Node *tax_node)
CTreeFiller(CTaxTreeDataSource &ds, const CTaxTreeBrowser::TTaxMap &tax_map)
ITreeIterator::EAction LevelBegin(const ITaxon1Node *tax_node)
definition of a Culling tree
virtual TTaxId GetTaxId() const =0
EAction TraverseDownward(I4Each &, unsigned levels=kMax_UInt)
container_type::const_iterator const_iterator
const_iterator end() const
const_iterator find(const key_type &key) const
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
SStrictId_Tax::TId TTaxId
Taxon id type.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Warning(CExceptionArgs_Base &args)
static bool Match(const objects::CSeq_id &id1, const objects::CSeq_id &id2, objects::CScope *scope=NULL)
check to see if two seq-ids are identical.
virtual void SetMessage(const string &msg)=0
vector< CConstRef< CObject > > TConstObjects
virtual void SetPctCompleted(int pct)=0
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)
Convert size_t to string.
Fun TreeDepthFirstTraverse(TTreeNode &tree_node, Fun func)
Depth-first tree traversal algorithm.
ETreeTraverseCode
Tree traverse code returned by the traverse predicate function.
TNodeList::const_iterator TNodeList_CI
void AddNode(TTreeType *subnode)
Add new subnode.
const TValue & GetValue(void) const
Return node's value.
@ eTreeTraverse
Keep traversal.
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::SIZE size
Int4 delta(size_t dimension_, const Int4 *score_)
our internal tree structure
CTaxTreeDataSource::TUidVec uids
const objects::ITaxon1Node * tax_node
CRef< CTaxTreeDataSource > data_source
CTaxTreeDataSource::TUidVec uids
ETreeTraverseCode operator()(CTaxTreeBrowser::TTaxTree &node, int delta)
ETreeTraverseCode operator()(CTaxTreeBrowser::TTaxTree &node, int delta_level)
wxString ToWxString(const string &s)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4