NCBI C++ ToolKit
layout_track_proxy.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: layout_track_proxy.cpp 47479 2023-05-02 13:24:02Z ucko $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Liangshou Wu, Dmitry Rudnev
27  *
28  */
29 
30 /// @file
31 ///
32 
33 #include <ncbi_pch.hpp>
35 #include <util/static_map.hpp>
36 #include <gui/objutils/utils.hpp>
37 
38 #include <unordered_set>
39 
41 
42 
43 ///////////////////////////////////////////////////////////////////////////////
44 /// CTempTrackProxy class implementation
45 ///////////////////////////////////////////////////////////////////////////////
46 
47 // default track name base for user-provided tracks spec without 'name' set
48 const string CTempTrackProxy::kAnonTrackName = "SV-Anon";
49 
51  : m_Order(param.GetOrder())
52  , m_Name(param.GetName())
53  , m_Id(param.GetId())
54  , m_DispName(param.GetDisplayName())
55  , m_Profile(param.GetTrackProfile())
56  , m_Source(param.GetSource())
57  , m_Category(param.GetCategory())
58  , m_Subcategory(param.GetSubcategory())
59  , m_SettingGroup(param.GetSettingGroup())
60  , m_UseGroupDefault(param.GetUseGroupDefault())
61  , m_Filter(param.m_Filter)
62  , m_SortBy(param.m_SortBy)
63  , m_Track(NULL)
64  , m_Shown(param.GetShown())
65  , m_Help(param.m_Help)
66  , m_Expanded(param.GetExpanded())
67  , m_Realized(param.IsRealized())
68  , m_Empty(false)
69  , m_Comments(param.m_Comments)
70  , m_Highlights(param.m_Highlights)
71  , m_HighlightsColor(param.m_HighlightsColor)
72  , m_ShowTitle(param.m_ShowTitle)
73  , m_ErrorStatus(param.m_ErrorStatus)
74  , m_isPrivate(param.m_isPrivate)
75  , m_StoredScale(param.m_StoredScale)
76  , m_UId(param.m_UId)
77  , m_SubTracks(param.m_SubTracks)
78  , m_Key(param.m_Key)
79  , m_Subkey(param.m_Subkey)
80  , m_Annots(param.m_Annots)
81  , m_Action(param.m_Action)
82  , m_TimeStamp(param.m_TimeStamp)
83  , m_Batch(param.m_Batch)
84  , m_RemotePath(param.m_RemotePath)
85  , m_RemoteData(param.m_RemoteData)
86  , m_SeqDataKey(param.m_SeqDataKey)
87  , m_BigDataIndex(param.m_BigDataIndex)
88 {
89  ITERATE (TTrackProxies, iter, param.GetChildren()){
90  m_Children.push_back((*iter)->Clone());
91  }
92 }
93 
94 
96 {
97  if (this == &param) return *this;
98 
99  m_Order = param.GetOrder();
100  m_Name = param.GetName();
101  m_Id = param.GetId();
102  m_DispName = param.GetDisplayName();
103  m_Profile = param.GetTrackProfile();
104  m_Source = param.GetSource();
105  m_Category = param.GetCategory();
106  m_Subcategory = param.GetSubcategory();
109  m_Filter = param.m_Filter;
110  m_SortBy = param.m_SortBy;
111  m_Track = NULL;
112  m_Shown = param.GetShown();
113  m_Help = param.m_Help;
114  m_Expanded = param.GetExpanded();
115  m_Realized = param.IsRealized();
116  m_Empty = false;
117  m_Comments = param.m_Comments;
118  m_Highlights = param.m_Highlights;
120  m_ShowTitle = param.m_ShowTitle;
122  m_isPrivate = param.m_isPrivate;
124  m_UId = param.m_UId;
125  m_SubTracks = param.m_SubTracks;
126  m_Key = param.m_Key;
127  m_Subkey = param.m_Subkey;
128  m_Annots = param.m_Annots;
129  m_Action = param.m_Action;
130  m_TimeStamp = param.m_TimeStamp;
131  m_Batch = param.m_Batch;
132  m_RemotePath = param.m_RemotePath;
133  m_RemoteData = param.m_RemoteData;
134  m_SeqDataKey = param.m_SeqDataKey;
136 
137  ITERATE (TTrackProxies, iter, param.GetChildren()){
138  m_Children.push_back((*iter)->Clone());
139  }
140 
141  return *this;
142 }
143 
144 
146 {
147  CRef<CTempTrackProxy> proxy(new CTempTrackProxy(*this));
148  return proxy;
149 }
150 
151 
152 CRef<CTempTrackProxy> CTempTrackProxy::AddTempTrack(const string& name, const string& title)
153 {
154  CRef<CTempTrackProxy> track(new CTempTrackProxy(-1, name, true));
155  int next_order = m_Children.empty() ? 0 : m_Children.back()->GetOrder() + 1;
156  track->SetOrder(next_order);
157  track->SetRealized(false);
159  track->SetCategory(GetCategory());
160  track->SetSubcategory(GetSubcategory());
161  track->SetFilter(GetFilter());
162  track->SetSortBy(GetSortBy());
163  track->SetErrorStatus(GetErrorStatus());
164  track->SetDisplayName(title);
165 
166  m_Children.push_back(track);
167 // LOG_POST(Trace << "AddTempTrack() name: " << name << ", title: " << title);
168  return track;
169 }
170 
172  const string& name, const string& filter, const string& title)
173 {
174  CRef<CTempTrackProxy> track;
175  if (filter.empty()) {
176  track = AddTempTrack(name, title);
177  } else {
178  track = AddTempTrack(name + "-" + filter, title);
179  track->SetFilter(filter);
180  }
181  return track;
182 }
183 
184 
186 CTempTrackProxy::GetChildTempTrack(const string& name) const
187 {
188  string name_modified(name);
189  NStr::ReplaceInPlace(name_modified, ".", "_");
191  if ((*iter)->GetName() == name_modified) {
192  return CConstRef<CTempTrackProxy>(iter->GetPointer());
193  }
194  }
196 }
197 
198 
201 {
202  string name_modified(name);
203  NStr::ReplaceInPlace(name_modified, ".", "_");
205  if ((*iter)->GetName() == name_modified) {
206  // if the child doesn't have a profile, we
207  // want to use its parent's profile.
208  if ((*iter)->GetTrackProfile().empty()) {
209  (*iter)->SetTrackProfile(GetTrackProfile());
210  }
211  if ((*iter)->GetFilter().empty()) {
212  (*iter)->SetFilter(m_Filter);
213  }
214  if ((*iter)->GetSortBy().empty()) {
215  (*iter)->SetSortBy(m_SortBy);
216  }
217  if ((*iter)->GetSource().empty()) {
218  (*iter)->SetSource(name);
219  }
220  return *iter;
221  }
222  }
223  //!! think of where to get the track title here
224  CRef<CTempTrackProxy> track = AddTempTrack(name_modified, "");
225  track->SetSource(name);
226  return track;
227 }
228 
229 
231 {
232 // if(IsExtendedNA()) {
233 // LOG_POST(Trace << "IsNA() when in fact IsExtendedNA() " << m_Source);
234 // }
235  return CSeqUtils::IsNAA(m_Source);
236 }
237 
239 {
241 }
242 
244 {
245  m_NAdata.Reset(&na);
246 
247  SetSource(na.m_Name);
248  if (!na.m_SubCategory.empty())
250  if (!na.m_Title.empty())
252 }
253 
255 {
256  if (m_Annots.empty())
257  return;
258 
259  const CAnnotMetaData* naData = child.GetNAdata();
260  if (!naData)
261  return;
262 
263  if (m_Annots.front() == "NA*") {
264  child.SetShown(true);
265  return;
266  }
267 
268  if (m_Annots.front() == "NA*" ||
269  find(m_Annots.begin(), m_Annots.end(), naData->m_Name) != m_Annots.end()) {
270  child.SetShown(true);
271  }
272 }
273 
274 
275 static const string k_order = "Order";
276 static const string k_category = "Category";
277 static const string k_subcategory = "Subcategory";
278 static const string k_setting_group = "SettingGroup";
279 static const string k_shown = "Shown";
280 static const string k_expanded = "Expanded";
281 static const string k_track_profile = "TrackProfile";
282 static const string k_key = "Key";
283 static const string k_subkey = "Subkey";
284 static const string k_filter = "Filter";
285 static const string k_sortby = "SortBy";
286 static const string k_display_name = "DisplayName";
287 static const string k_help = "Help";
288 static const string k_annots = "Annots";
289 static const string k_annot_separation = "AnnotSeparation";
290 
291 static const string k_id = "Id";
292 static const string k_db = "dbname";
293 static const string k_subtracks = "SubTracks";
294 static const string k_trid = "trid";
295 
296 static const string k_time_stamp = "TimeStamp";
297 
298 static void s_LoadTempTrackRecursive(CTempTrackProxy::TTrackProxies& proxies, const string& path)
299 {
300  time_t defTimeStamp = time(NULL);
301  if (defTimeStamp != -1) defTimeStamp -= 30 * 24 * 60 * 60;
302 
304  string key = path + CGuiRegistry::kDecimalDot + "TempTracks";
305  CRegistryReadView view = registry.GetReadView(key);
307  view.GetTopKeys(keys);
308  ITERATE(CRegistryReadView::TKeys, iter, keys) {
309  string name = iter->key;
310  string sub_key = key + CGuiRegistry::kDecimalDot + name;
311  CRegistryReadView sub_view = registry.GetReadView(sub_key);
313  track->SetOrder(sub_view.GetInt(k_order, -1));
314  track->SetCategory(sub_view.GetString(k_category, kEmptyStr));
315  track->SetSubcategory(sub_view.GetString(k_subcategory, kEmptyStr));
316  track->SetTimeStamp(sub_view.GetInt(k_time_stamp, static_cast<int>(defTimeStamp)));
317 
318  {
319  string setting_g_str = sub_view.GetString(k_setting_group, kEmptyStr);
320  vector<string> tokens;
321  CTrackUtils::TokenizeWithEscape(setting_g_str, "|", tokens, true);
322  if (tokens.size() > 0) {
323  track->SetSettingGroup(NStr::TruncateSpaces(tokens[0]));
324  if (tokens.size() > 1) {
325  try {
327  }
328  catch (CException&) {
329  // ignore it
330  }
331  }
332  }
333  }
334 
335  track->SetShown(sub_view.GetBool(k_shown, true));
336  track->SetExpanded(sub_view.GetBool(k_expanded, true));
337  track->SetName(name);
338  if (CSeqUtils::IsNAA_Name(name))
339  track->SetSource(NStr::Replace(name, "_", "."));
340 
342  track->SetHelp(sub_view.GetString(k_help, kEmptyStr));
344  proxies.push_back(track);
345  s_LoadTempTrackRecursive(track->GetChildren(), sub_key);
346  }
347 }
348 
349 void CTempTrackProxy::LoadFromRegistry(TTrackProxies& proxies, const string& path, bool isMergeWithExisting)
350 {
351  unordered_set<string> ExistingKeys;
352  if(isMergeWithExisting) {
353  for(auto proxy: proxies) {
354  ExistingKeys.insert(proxy->GetKey());
355  }
356  }
357  time_t defTimeStamp = time(NULL);
358 
359  string key = path + ".Tracks";
361  CRegistryReadView view = registry.GetReadView(key);
363  view.GetTopKeys(keys);
364  ITERATE(CRegistryReadView::TKeys, iter, keys) {
365  string base_key = key + CGuiRegistry::kDecimalDot + iter->key;
366  // load settings for this track
367  CRegistryReadView sub_view = registry.GetReadView(base_key);
368  string sKey = sub_view.GetString(k_key);
369 
370  // if merge is requested, skip tracks with existing keys
371  if(isMergeWithExisting && ExistingKeys.count(sKey)) {
372  continue;
373  }
374  CRef<CTrackProxy> track(new CTrackProxy);
375  track->SetKey(sKey);
376  track->SetSubkey(sub_view.GetString(k_subkey, kEmptyStr));
377  track->SetFilter(sub_view.GetString(k_filter, kEmptyStr));
378  track->SetSortBy(sub_view.GetString(k_sortby, kEmptyStr));
379  track->SetDisplayName(sub_view.GetString(k_display_name, kEmptyStr));
380  track->SetHelp(sub_view.GetString(k_help, kEmptyStr));
381  track->SetOrder(sub_view.GetInt(k_order, -1));
382  track->SetId(sub_view.GetString(k_id, ""));
383  track->SetDB(sub_view.GetString(k_db, ""));
384  track->SetCategory(sub_view.GetString(k_category, kEmptyStr));
385  track->SetSubcategory(sub_view.GetString(k_subcategory, kEmptyStr));
386  track->SetTimeStamp(sub_view.GetInt(k_time_stamp, static_cast<int>(defTimeStamp)));
387 
388  {
389  string setting_g_str = sub_view.GetString(k_setting_group, kEmptyStr);
390  vector<string> tokens;
391  CTrackUtils::TokenizeWithEscape(setting_g_str, "|", tokens, true);
392  if (tokens.size() > 0) {
393  track->SetSettingGroup(NStr::TruncateSpaces(tokens[0]));
394  if (tokens.size() > 1) {
395  try {
396  track->SetUseGroupDefault(NStr::StringToBool(NStr::TruncateSpaces(tokens[1])));
397  }
398  catch (CException&) {
399  // ignore it
400  }
401  }
402  }
403  }
404 
405  track->SetShown(sub_view.GetBool(k_shown));
406  track->SetExpanded(sub_view.GetBool(k_expanded, true));
407  track->SetTrackProfile(sub_view.GetString(k_track_profile));
408  string annot_str = sub_view.GetString(k_annots, kEmptyStr);
409  if (annot_str.empty()) {
410  annot_str = sub_view.GetString(k_annot_separation, kEmptyStr);
411  }
412  CTrackProxy::TAnnots annots;
413  NStr::Split(annot_str, ",|", annots);
414  track->SetAnnots(annots);
415  string subtracks_str = sub_view.GetString(k_subtracks, kEmptyStr);
416  CTrackProxy::TSubTracks subtracks;
417  ParseSubtracks(subtracks_str, subtracks);
418  if (!subtracks.empty())
419  track->SetSubTracks() = subtracks;
420  track->SetName(iter->key);
421  proxies.push_back(CRef<CTempTrackProxy>(track.GetPointer()));
422 
423  // load children temporary tracks
424  s_LoadTempTrackRecursive(track->GetChildren(), base_key);
425  // load children tracks
426  LoadFromRegistry(track->GetChildren(), base_key);
427  }
428 
430 }
431 
432 void CTempTrackProxy::SaveToRegistry(const TTrackProxies& proxies, const string& path)
433 {
434  static const size_t kMaxTrackSaved = 100;
435 
437  TTrackProxies settings = proxies;
438 
439  size_t delCount = settings.size() > kMaxTrackSaved ?
440  settings.size() - kMaxTrackSaved : 0;
441 
442  if (delCount > 0) {
443  settings.sort([](const CRef<CTempTrackProxy>& t1, const CRef<CTempTrackProxy>& t2) -> bool
444  { return t1->GetTimeStamp() < t2->GetTimeStamp(); });
445 
446  auto it = settings.begin();
447  while (it != settings.end() && delCount > 0) {
448  it = settings.erase(it);
449  --delCount;
450  }
451  }
452 
453  settings.sort([](const CRef<CTempTrackProxy>& t1, const CRef<CTempTrackProxy>& t2) -> bool
454  { return t1->GetOrder() < t2->GetOrder(); });
455 
456  int off = 0;
457  int pre_id = -1;
458 
459  ITERATE(TTrackProxies, iter, settings) {
460  const CTempTrackProxy* params = *iter;
461  const CTrackProxy* full_params =
462  dynamic_cast<const CTrackProxy*>(iter->GetPointer());
463 
464  // for those unrealized trackd, we ignore them
465  if (!params->IsRealized()) {
466  --off;
467  continue;
468  }
469 
470  string key = path + ".TempTracks";
471  if (full_params) {
472  key = path + ".Tracks";
473  }
474  string sub_key = key + CGuiRegistry::kDecimalDot;
475  sub_key += params->GetName().empty() ? CSeqUtils::GetUnnamedAnnot() : params->GetName();
476  CRegistryWriteView view = registry.GetWriteView(sub_key);
477  if (pre_id == params->GetOrder()) {
478  ++off;
479  }
480 
481  view.Set(k_order, params->GetOrder() + off);
482  view.Set(k_category, params->GetCategory());
483  view.Set(k_subcategory, params->GetSubcategory());
484  time_t timeStamp = params->GetTimeStamp();
485  if (timeStamp != -1) view.Set(k_time_stamp, (int)timeStamp);
486 
487  if (!params->GetSettingGroup().empty()) {
488  view.Set(k_setting_group, params->GetSettingGroup());
489  }
490 
491  bool shown = params->GetShown();
492  if (full_params && full_params->GetContShown())
493  shown = true;
494  view.Set(k_shown, shown);
495 
496  // save collapse state only, by default, a track is expanded.
497  if (!params->GetExpanded()) {
498  view.Set(k_expanded, params->GetExpanded());
499  }
500  if (!params->GetDisplayName().empty()) {
501  view.Set(k_display_name, params->GetDisplayName());
502  }
503  if (!params->GetHelp().empty()) {
504  view.Set(k_help, params->GetHelp());
505  }
506 
507 // cerr << "Checking profile for registry sub_key: " << sub_key << " temp proxy name: " << params->GetName() << " params(CTempTrackProxy) at: " << params << " full_params(CTrackProxy) at: " << full_params << endl;
508 // cerr << "Profile contents: " << params->GetTrackProfile() << endl;
509 
510  if (!params->GetTrackProfile().empty()) {
511 // cerr << "Writing profile" << endl;
512  view.Set(k_track_profile, params->GetTrackProfile());
513 
514  // consider the case where there is only one subtrack so
515  // that the current track profile should actually be saved
516  // to its child track
517  if (!params->GetSource().empty() &&
518  !params->GetTrackProfile().empty()) {
519 // cerr << "Looking for child track with Source: " << params->GetSource() << endl;
520  CConstRef<CTempTrackProxy> c_params =
521  params->GetChildTempTrack(params->GetSource());
522  if (c_params) {
523  CTempTrackProxy* t_params =
524  const_cast<CTempTrackProxy*>(c_params.GetPointer());
525 // cerr << "Child track found at address: " << t_params << endl;
526 // cerr << "Current child track profile : " << t_params->GetTrackProfile() << endl;
527  if(t_params->GetTrackProfile() == "Default") {
528 // cerr << "Overwriting child track profile to: " << params->GetTrackProfile() << endl;
529  t_params->SetTrackProfile(params->GetTrackProfile());
530 // } else {
531 // cerr << "Not overwriting not default child profile" << endl;
532  }
533 // } else {
534 // cerr << "Child track not found" << endl;
535  }
536  }
537  }
538 
539  if (full_params) {
540  view.Set(k_key, full_params->GetKey());
541  if (!full_params->GetSubkey().empty()) {
542  view.Set(k_subkey, full_params->GetSubkey());
543  }
544  if (!full_params->GetFilter().empty()) {
545  view.Set(k_filter, full_params->GetFilter());
546  }
547  if (!full_params->GetSortBy().empty()) {
548  view.Set(k_sortby, full_params->GetSortBy());
549  }
550 
551  CTrackProxy::TAnnots annots = full_params->GetAnnots();
552  CTrackProxy::TAnnots::iterator a_iter =
553  find(annots.begin(), annots.end(),
555  if (a_iter != annots.end()) {
556  annots.erase(a_iter);
557  }
558  if (!annots.empty()) {
559  string annots_str = kEmptyStr;
560  bool first_one = true;
561  ITERATE(CTrackProxy::TAnnots, aa_iter, annots) {
562  if (first_one) {
563  annots_str = *aa_iter;
564  first_one = false;
565  }
566  else {
567  annots_str += "|" + *aa_iter;
568  }
569  }
570  view.Set(k_annots, annots_str);
571  }
572  }
573 
574  if (!params->GetChildren().empty()) {
575  SaveToRegistry(params->GetChildren(), sub_key);
576  }
577 
578  pre_id = params->GetOrder();
579  }
580 }
581 
582 /// convert a string with a list of subtracks to a list of subtracks
583 void CTempTrackProxy::ParseSubtracks(const string& subtracks_str, TSubTracks& subtracks)
584 {
585  NStr::Split(subtracks_str, ",|", subtracks);
586 }
587 
588 
589 ///////////////////////////////////////////////////////////////////////////////
590 /// CTrackProxy class implementation
591 ///////////////////////////////////////////////////////////////////////////////
592 
594  : CTempTrackProxy(param)
595  , m_DB(param.m_DB)
596  , m_DataKey(param.m_DataKey)
597  , m_ContShown(param.m_ContShown)
598 {}
599 
600 
602 {
603  if (this == &param) return *this;
604 
606  m_DB = param.m_DB;
607  m_DataKey = param.m_DataKey;
608  m_ContShown = param.m_ContShown;
609 
610  return *this;
611 }
612 
613 
615 {
616  CRef<CTempTrackProxy> proxy(new CTrackProxy(*this));
617  return proxy;
618 }
619 
620 
#define false
Definition: bool.h:36
Data structure for holding meta information for an annotaion.
Definition: annot_info.hpp:85
CConstRef –.
Definition: ncbiobj.hpp:1266
static const string kDecimalDot
Definition: registry.hpp:45
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:400
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
Definition: reg_view.cpp:230
bool GetBool(const string &key, bool default_val=false) const
Definition: reg_view.cpp:241
list< SKeyInfo > TKeys
retrieve information about all keys in the registry
Definition: reg_view.hpp:68
void GetTopKeys(TKeys &keys) const
Retrieve information about the top level keys in this view.
Definition: reg_view.cpp:278
string GetString(const string &key, const string &default_val=kEmptyStr) const
Definition: reg_view.cpp:246
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
File Description:
const TTrackErrorStatus & GetErrorStatus() const
void UpdateNA_ChildVisibility(CTempTrackProxy &child) const
string m_Batch
AlignDb batch.
string m_Filter
track-specific filter
void SetShown(bool shown)
const string & GetSubkey() const
string m_SortBy
track-specific sortby
const string & GetHelp() const
void SetName(const string &name)
void SetCategory(const string &cat)
const string & GetCategory() const
vector< string > TAnnots
bool m_Expanded
track expanded/collapsed.
CRef< CLayoutTrack > m_Track
the delegated layout track object.
bool m_Shown
track on/off state.
const string & GetDisplayName() const
void SetExpanded(bool f)
virtual CRef< CTempTrackProxy > Clone() const
const string & GetSortBy() const
string m_BigDataIndex
The location of a remote data file containing the index.
TTrackProxies m_Children
settings for children tracks.
string m_HighlightsColor
Color to use for highlighting.
list< CRef< CTempTrackProxy > > TTrackProxies
CRef< CAnnotMetaData > m_NAdata
void SetSource(const string &src)
void SetFilter(const string &filter)
CConstRef< CTempTrackProxy > GetChildTempTrack(const string &name) const
Get track params for child temporary track.
const string & GetKey() const
void SetNAdata(CAnnotMetaData &na)
void SetHelp(const string &help)
vector< string > TSubTracks
string m_DispName
track display name.
int m_Order
track order for vertical ordering in its parent scope.
static void LoadFromRegistry(TTrackProxies &proxies, const string &path, bool isMergeWithExisting=false)
if isMergeWithExisting is true, then load should skip all registry tracks that have keys as in the al...
void SetTrackProfile(const string &profile)
bool m_UseGroupDefault
flag indicating if group default setting applies.
string m_Help
track help string
bool GetUseGroupDefault() const
const TAnnots & GetAnnots() const
string m_Category
track category.
static const string kAnonTrackName
CTempTrackProxy class implementation.
time_t GetTimeStamp() const
void SetSettingGroup(const string &name)
void SetSubcategory(const string &scat)
static void SaveToRegistry(const TTrackProxies &proxies, const string &path)
bool IsExtendedNA() const
check for an extended NA (named annotation::number, as used in e.g. SNP2)
const string & GetId() const
string m_Name
track name, may serve as track title.
string m_Profile
track profile (setting style or list of settings).
string m_Key
may be used for creating a track
const string & GetTrackProfile() const
void SetSortBy(const string &sort_by)
const TTrackProxies & GetChildren() const
TTrackErrorStatus m_ErrorStatus
static void ParseSubtracks(const string &subtracks_str, TSubTracks &subtracks)
convert a string with a list of subtracks to a list of subtracks
CTempTrackProxy & operator=(const CTempTrackProxy &param)
assignment operator.
void SetOrder(int order)
CTempTrackProxy class implementation.
string m_Subcategory
track sub-category.
void SetRealized(bool f)
bool m_Empty
The track proxy is empty.
void SetTimeStamp(time_t timeStamp)
const string & GetName() const
bool m_Realized
Has this been connected to any real track before.
void SetDisplayName(const string &name)
string m_Source
data source.
const CAnnotMetaData * GetNAdata() const
string m_Id
unique track identifier.
const string & GetSource() const
const string & GetSettingGroup() const
void SetUseGroupDefault(bool flag)
string m_SettingGroup
setting group name.
string m_RemotePath
Track remote path.
const string & GetSubcategory() const
CRef< CTempTrackProxy > AddTempTrack(const string &name, const string &title)
add a new template track params.
string m_Subkey
may be used for creating DataSource
void SetErrorStatus(const TTrackErrorStatus &ErrorStatus)
TAnnots m_Annots
can be 'Unnamed', 'Named', or annot names
const string & GetFilter() const
bool GetExpanded() const
CTrackProxy data structure contains information about the position of a track in its parent scope,...
virtual CRef< CTempTrackProxy > Clone() const
string m_DataKey
user-data net storage key (SViewer only)
CTrackProxy & operator=(const CTrackProxy &param)
string m_DB
data source DB name
bool GetContShown() const
static CMemoryRegistry registry
Definition: cn3d_tools.cpp:81
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#define NULL
Definition: ncbistd.hpp:225
static bool IsNAA(const string &annot, bool isStrict=false)
check if a given annotation is a named annotation accession[.version][number] when isSctrict == false...
Definition: utils.cpp:796
static const string & NameTypeValueToStr(TAnnotNameType type)
Definition: utils.cpp:152
string m_SubCategory
annotation subcategory
Definition: annot_info.hpp:106
static const string & GetUnnamedAnnot()
Get the commonly used symbol representing a unnnamed annotation.
Definition: utils.hpp:531
string m_Title
annotation title
Definition: annot_info.hpp:102
static bool IsNAA_Name(const string &annot)
check if a given annotation is a named annotation name with '.' replaced with '_'.
Definition: utils.cpp:801
static bool IsExtendedNAA(const string &annot, bool isStrict=false)
check if a given annotation is an extended NAA (named accession[.version][number],...
Definition: utils.cpp:850
string m_Name
annotation name, e.g. named annotation accession
Definition: annot_info.hpp:100
@ eAnnot_All
all annotations
Definition: utils.hpp:135
static void TokenizeWithEscape(const string &str, const string &delim, vector< string > &tokens, bool remove_escape=false)
Tokenize a string using the delim.
Definition: track_info.cpp:352
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:1684
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static bool StringToBool(const CTempString str)
Convert string to bool.
Definition: ncbistr.cpp:2819
#define kEmptyStr
Definition: ncbistr.hpp:123
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
Definition: ncbistr.cpp:3457
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3310
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3401
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
Definition: ncbistr.cpp:3182
static const string k_help
static const string k_id
static const string k_display_name
static void s_LoadTempTrackRecursive(CTempTrackProxy::TTrackProxies &proxies, const string &path)
static const string k_db
static const string k_key
static const string k_track_profile
static const string k_setting_group
static const string k_category
static const string k_order
static const string k_expanded
static const string k_subtracks
static const string k_time_stamp
static const string k_subcategory
static const string k_subkey
static const string k_shown
static const string k_sortby
static const string k_trid
static const string k_filter
static const string k_annots
static const string k_annot_separation
const struct ncbi::grid::netcache::search::fields::KEY key
static bool s_CompareCRefs(const CRef< CTempTrackProxy > &t1, const CRef< CTempTrackProxy > &t2)
Modified on Wed Mar 27 11:24:16 2024 by modify_doxy.py rev. 669887