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

Go to the SVN repository for this file.

1 /* $Id: seqgraphic_conf.cpp 46646 2021-08-17 20:45:42Z evgeniev $
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: Vlad Lebedev, Liangshou Wu
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
37 
38 
40 
42 
43 static const string kBaseKey("GBPlugins.SeqGraphicView");
44 static const string kFeatParamsKey("GBPlugins.SeqGraphicFeats");
45 static const string kCPParamsKey("GBPlugins.SeqGraphicClonePlacement");
46 static const string kCommentConfigKey("GBPlugins.SeqGraphicCommentConfig");
47 static const string kCustomColorKey("GBPlugins.CustomFeatureColors");
48 static const string kDefFeatKey("Master");
49 
52  const string& theme,
53  const string& color,
54  const string& size,
55  const string& deco,
56  const string& profile,
57  const string& layout,
58  const string& label_pos)
59  : m_Registry( registry ? registry : &CGuiRegistry::GetInstance())
60  , m_CurrTheme(theme)
61  , m_CurrColor(color)
62  , m_CurrSize(size)
63  , m_CurrDeco(deco)
64  , m_CurrProfile(profile)
65  , m_CurrLayout(layout)
66  , m_CurrLabelPos(label_pos)
67  , m_CgiMode(cgi_mode)
68  , m_AnnotDepth(eDepth_unknown)
69  , m_LabelFont(new CGlTextureFont())
70  , m_CommentFont(new CGlTextureFont())
71  , m_TitleFont(new CGlTextureFont())
72  , m_HistParamsManager(new CHistParamsManager)
73  , m_Dirty(false)
74 {
76  LoadSettings();
77 }
78 
79 
81 {
82 }
83 
84 
86 {
88 
89  // In case of using a preset theme, we need to verify it does exist.
90  if ( m_CurrTheme.empty() ||
91  !view.HasField(ThemeKey() + "." + m_CurrTheme) ) {
92  m_CurrTheme = view.GetString("CurrentTheme", DefTheme());
93  }
94 
95  // load theme settings
98  if (m_CurrColor.empty()) {
99  m_CurrColor = view.GetString("ColorTheme", CSGConfigUtils::DefColorTheme());
100  }
101  if (m_CurrSize.empty()) {
102  m_CurrSize = view.GetString("SizeLevel", CSGConfigUtils::DefSizeLevel());
103  }
104  if (m_CurrDeco.empty()) {
105  m_CurrDeco = view.GetString("DecoreateStyle", CSGConfigUtils::DefDecoStyle());
106  }
107  if (m_CurrProfile.empty()) {
108  m_CurrProfile = view.GetString("TrackProfile", CSGConfigUtils::DefTrackProfile());
109  }
110  if (m_CurrLayout.empty()) {
112  }
113  if (m_CurrLabelPos.empty()) {
114  m_CurrLabelPos = view.GetString("LabelPosition", CSGConfigUtils::DefLabelPosition());
115  }
116  if (m_CurrGlobal.empty()) {
118  }
119 
120  // loading size settings
122  m_BarHeight = view.GetReal("BarHeight", 9.0);
123  m_CmmtTopMargin = view.GetReal("CommentTopMargin", 5.0);
124  m_CmmtBottomMargin = view.GetReal("CommentBottomMargin", 2.0);
125  m_ObjSpace = view.GetInt("ObjectSpace", 3);
126  m_IconSize = view.GetInt("IconSize", 12);
127  m_IconSignSize = view.GetInt("IconSignSize", 8);
128 
129  CSGConfigUtils::GetFont(view, "LabelFontFace", "LabelFontSize", *m_LabelFont);
130  CSGConfigUtils::GetFont(view, "CommentFontFace", "CommentFontSize", *m_CommentFont);
131  CSGConfigUtils::GetFont(view, "TitleFontFace", "TitleFontSize", *m_TitleFont);
132 
133  // loading color settings
135  CSGConfigUtils::GetColor(view, "Background", m_Background);
136  CSGConfigUtils::GetColor(view, "SelectionHairlineOne", m_SelHairlineOne);
137  CSGConfigUtils::GetColor(view, "SelectionHairlineMany", m_SelHairlineMany);
138  CSGConfigUtils::GetColor(view, "SelectionHairlineDown", m_SelHairlineDown);
139  CSGConfigUtils::GetColor(view, "BGComment", m_BGComment);
140  CSGConfigUtils::GetColor(view, "FGComment", m_FGComment);
141  CSGConfigUtils::GetColor(view, "TitleBackground", m_TitleBackground);
142  CSGConfigUtils::GetColor(view, "NonNCBITitleBackground", m_NonNCBITitleBackground);
143  CSGConfigUtils::GetColor(view, "SelLabel", m_SelLabel);
144  CSGConfigUtils::GetColor(view, "Selection", m_Selection);
145  CSGConfigUtils::GetColor(view, "GridHorizontal", m_GridHorizontal);
146  CSGConfigUtils::GetColor(view, "GridVertical", m_GridVertical);
147 
148  // loading other global settings
152  m_AdjustRuler = view.GetBool("AdjustRulerToSelection", false);
153  m_ShowComments = view.GetBool("ShowComments", true);
154  m_ShowSimpleComments = view.GetBool("ShowSimpleComments", true);
155  m_ShowMessage = view.GetBool("ShowMessage", true);
156  m_ReserveCmmtSpace = view.GetBool("ShowInvisibleComments", false);
157  m_ShowCmmtBg = view.GetBool("ShowCommentBackground", false);
158  m_RepeatComment = view.GetBool("RepeatComment", false);
159  m_AutoHideTrack = view.GetBool("HideTrackWithNoData", false);
160  m_ShowHorzGrid = view.GetBool("ShowHorizontalGrid", true);
161  m_ShowVertGrid = view.GetBool("ShowVerticalGrid", false);
162  m_ShowTrackMinusPlusSign = view.GetBool("ShowTrackMinusPlusSign", true);
163  m_BackgroundLoading = view.GetBool("BackgroundLoading", true);
164  m_ShowDownwardHairlines = view.GetBool("ShowDownwardHairlines", true);
165 
166  m_HairLineOption = view.GetInt("HairLineOption", 2);
167  m_CmmtRepDist = view.GetInt("CommentRepeatDist", 1024);
168  m_OverviewCutoff = view.GetInt("OverviewCutoff", 1500);
169  m_HistogramCutoff = view.GetInt("HistogramCutoff", 50);
170  m_LineWidth = view.GetReal("LineWidth", 1.0);
171  m_ZoomFactor = view.GetReal("MouseZoomFactor", 25.0);
172  SetAnnotDepth(view.GetInt("AnnotationDepth", -2));
173 
174  // cache the feature parameters
177 }
178 
179 void CSeqGraphicConfig::SaveSettings(bool clear_themes)
180 {
181  // This must come first since it depends on m_CurrColor which is reset if
182  // clear_themes is true
184 
185  if (m_Dirty) {
186  // clean out old settings
190  ITERATE(CRegistryReadView::TKeys, iter, keys) {
191  view.DeleteField(iter->key);
192  }
193 
194  // save theme settings
195  view.Set("CurrentTheme", m_CurrTheme);
196 
197  view = m_Registry->GetWriteView(kBaseKey + "." + ThemeKey()+ "." + m_CurrTheme);
198  view.Set("ColorTheme", m_CurrColor);
199  view.Set("SizeLevel", m_CurrSize);
200  view.Set("DecoreateStyle", m_CurrDeco);
201  view.Set("Layout", m_CurrLayout);
202  view.Set("LabelPosition", m_CurrLabelPos);
203  view.Set("TrackProfile", m_CurrProfile);
204  //view.Set("GlobalSettings", m_CurrGlobal);
205 
206  /// no need to save them since we don't expose them for change currently.
207  /*
208 
209  // saving size settings
210  view = CSGConfigUtils::GetSizeRWView(*m_Registry, kBaseKey, "", m_CurrSize);
211  view.Set("BarHeight", m_BarHeight);
212  view.Set("CommentTopMargin", m_CmmtTopMargin);
213  view.Set("CommentBottomMargin", m_CmmtBottomMargin);
214  view.Set("ObjectSpace", m_ObjSpace);
215  view.Set("IconSize", m_IconSize);
216  view.Set("IconSignSize", m_IconSignSize);
217 
218  CSGConfigUtils::SetFont(view, "LabelFontFace", "LabelFontSize", *m_LabelFont);
219  CSGConfigUtils::SetFont(view, "CommentFontFace", "CommentFontSize", *m_CommentFont);
220  CSGConfigUtils::SetFont(view, "TitleFontFace", "TitleFontSize", *m_TitleFont);
221 
222  // saving color settings
223  view = CSGConfigUtils::GetColorRWView(*m_Registry, kBaseKey, "", m_CurrColor);
224  CSGConfigUtils::SetColor(view, "Background", m_Background);
225  CSGConfigUtils::SetColor(view, "SelectionHairlineOne", m_SelHairlineOne);
226  CSGConfigUtils::SetColor(view, "SelectionHairlineMany", m_SelHairlineMany);
227  CSGConfigUtils::SetColor(view, "BGComment", m_BGComment);
228  CSGConfigUtils::SetColor(view, "FGComment", m_FGComment);
229  CSGConfigUtils::SetColor(view, "SelLabel", m_SelLabel);
230  CSGConfigUtils::SetColor(view, "Selection", m_Selection);
231  CSGConfigUtils::SetColor(view, "GridHorizontal", m_GridHorizontal);
232  CSGConfigUtils::SetColor(view, "GridVertical", m_GridVertical);
233 
234  // saving the global settings
235  view = CSGConfigUtils::GetWriteView(*m_Registry,
236  kBaseKey + "." + CSGConfigUtils::GlobalSettingStyleKey(),
237  m_CurrGlobal, CSGConfigUtils::DefGlobalSettingStyle());
238  view.Set("AdjustRulerToSelection", m_AdjustRuler);
239  view.Set("ShowComments", m_ShowComments);
240  view.Set("ShowSimpleComments", m_ShowSimpleComments);
241  view.Set("ShowMessage", m_ShowMessage);
242  view.Set("ShowInvisibleComments", m_ReserveCmmtSpace);
243  view.Set("ShowCommentBackground", m_ShowCmmtBg);
244  view.Set("RepeatComment", m_RepeatComment);
245  view.Set("HideTrackWithNoData", m_AutoHideTrack);
246  view.Set("ShowHorizontalGrid", m_ShowHorzGrid);
247  view.Set("ShowVerticalGrid", m_ShowVertGrid);
248  view.Set("ShowTrackMinusPlusSign", m_ShowTrackMinusPlusSign);
249  view.Set("BackgroundLoading", m_BackgroundLoading);
250 
251  view.Set("HairLineOption", m_HairLineOption);
252  view.Set("CommentRepeatDist", m_CmmtRepDist);
253  view.Set("OverviewCutoff", m_OverviewCutoff);
254  view.Set("HistogramCutoff", m_HistogramCutoff);
255  view.Set("LineWidth", m_LineWidth);
256  view.Set("MouseZoomFactor", m_ZoomFactor);
257 
258  */
259 
260 
261  // saving color settings
263  CSGConfigUtils::SetColor(view, "SelectionHairlineOne", m_SelHairlineOne);
264  CSGConfigUtils::SetColor(view, "SelectionHairlineMany", m_SelHairlineMany);
265  CSGConfigUtils::SetColor(view, "SelectionHairlineDown", m_SelHairlineDown);
266 
267  // saving the global settings
271  view.Set("AdjustRulerToSelection", m_AdjustRuler);
272  view.Set("HairLineOption", m_HairLineOption);
273  view.Set("ShowDownwardHairlines", m_ShowDownwardHairlines);
274 
275  // reset the current theme and styles, otherwise,
276  // those current theme and style strings won't be
277  // reloaded
278  if (clear_themes) {
284  }
285 
286  m_Dirty = false;
287  }
288 
290 }
291 
292 
295 {
296  const CFeatList& feats(*CSeqFeatData::GetFeatList());
297  vector<string> feat_hierarchy = feats.GetStoragekeys(subtype);
298 
299  // try them in reverse order so the more specific keys get tried first.
300  vector<string>::reverse_iterator riter(feat_hierarchy.end());
301  vector<string>::reverse_iterator rend(feat_hierarchy.begin());
302 
303  for ( ; riter != rend; ++riter) {
305  if ( iter != m_FeatSettings.end()) {
306  return iter->second;
307  }
308  }
309 
310  // shouldn't get here.
311  // means that there wasn't a Master feature item in the global settings.
312  _ASSERT(false);
314 }
315 
316 
318 CSeqGraphicConfig::GetFeatParams(const string& name) const
319 {
321  if (iter == m_FeatSettings.end()) {
323  }
324  return iter->second;
325 }
326 
327 
329 {
331 }
332 
333 
335 {
336  if ( !m_CategoryConfig ) {
337  CCategoryConfig::TGroupMap group_map;
338  CCategoryConfig::TSubgroupMap sub_group_map;
339  InitCategoryConfig(group_map, sub_group_map);
340  }
341  return m_CategoryConfig;
342 }
343 
345  const CCategoryConfig::TSubgroupMap& sub_group_map)
346 {
347  if ( !m_CategoryConfig ) {
349  string key = "GBPlugins.SeqGraphicCategory";
351  CRegistryReadView::TKeys cat_keys;
352  top_view.GetTopKeys(cat_keys);
353  ITERATE(CRegistryReadView::TKeys, iter, cat_keys) {
355  cat.m_Category =
356  CTrackConfigUtils::CreateCategory(iter->key, iter->key, "", -1);
357 
358  CRegistryReadView view =
359  m_Registry->GetReadView(key + "." + iter->key);
361  view.GetTopKeys(keys);
362  ITERATE(CRegistryReadView::TKeys, sub_iter, keys) {
363  const string& key_n = sub_iter->key;
364  if (key_n == "DisplayName") {
365  cat.m_Category->SetDisplay_name() = view.GetString(key_n);
366  } else if (key_n == "Order") {
367  // penalize orders that came from static config so that TMS-defined ones would come first
368  cat.m_Category->SetOrder() = view.GetInt(key_n) + 10000;
369  } else if (key_n == "Help") {
370  cat.m_Category->SetHelp() = view.GetString(key_n);
371  } else {
372  CRegistryReadView sub_view =
373  m_Registry->GetReadView(key + "." + iter->key + "." + key_n);
374 
375  int sub_order = sub_view.GetInt("Order", -1);
376  if(sub_order != -1) {
377  sub_order += 10000;
378  }
380  key_n,
381  sub_view.GetString("DisplayName", key_n),
382  sub_view.GetString("Help", ""),
383  sub_order);
384 
385  cat.AddSubcategory(sub_cat);
386  }
387  }
389  }
390  // after static config has been read, update and augment it with what came from TMS with the same names
391  for(const auto& group: group_map) {
392  CRef<CCategory> cat;
393  cat = m_CategoryConfig->GetCategory(group.first);
394  if ( !cat ) {
395  cat = CTrackConfigUtils::CreateCategory(group.first, group.first, "", group.second);
397  cat_set.m_Category = cat;
398  m_CategoryConfig->AddCategory(cat_set);
399  } else {
400  cat->SetOrder(group.second);
401  }
402  }
403  for(const auto& sub_group: sub_group_map) {
404  CRef<CCategory> sub_cat;
405  sub_cat = m_CategoryConfig->GetSubcategory(sub_group.first.first, sub_group.first.second);
406  if ( !sub_cat ) {
407  sub_cat = CTrackConfigUtils::CreateCategory(sub_group.first.second, sub_group.first.second, "", sub_group.second);
408  m_CategoryConfig->AddSubcategory(sub_group.first.first, sub_cat);
409  } else {
410  sub_cat->SetOrder(sub_group.second);
411  }
412  }
413  }
414 }
415 
416 void CSeqGraphicConfig::LoadSettingStyles(const CGuiRegistry& reg, string& theme,
417  string& color, string& size, string& deco,
418  string& profile, string& label)
419 {
421 
422  // In case of using a preset theme, we need to verify it does exist.
423  if ( theme.empty() ||
424  !view.HasField(ThemeKey() + "." + theme) ) {
425  theme = view.GetString("CurrentTheme", DefTheme());
426  }
427 
428  // load theme settings
429  view = CSGConfigUtils::GetReadView(reg, kBaseKey + "." + ThemeKey(),
430  theme, DefTheme());
431  if (color.empty()) {
432  color = view.GetString("ColorTheme", CSGConfigUtils::DefColorTheme());
433  }
434  if (size.empty()) {
435  size = view.GetString("SizeLevel", CSGConfigUtils::DefSizeLevel());
436  }
437  if (deco.empty()) {
438  deco = view.GetString("DecoreateStyle", CSGConfigUtils::DefDecoStyle());
439  }
440  if (profile.empty()) {
441  profile = view.GetString("TrackProfile", CSGConfigUtils::DefTrackProfile());
442  }
443  if (label.empty()) {
444  label = view.GetString("LabelPosition", CSGConfigUtils::DefLabelPosition());
445  }
446 }
447 
448 
450 {
452  // make sure we find what we expect in the registry.
453  if (view.IsEmpty()) {
454  NCBI_THROW(CException, eUnknown, "CSeqGraphicConfig: there are errors in the settings.");
455  }
456 }
457 
459 {
461 
462  // loading feature's custom colors
463  CRegistryReadView view =
465  if ( !m_CustomFeatColors ) {
467  }
469  CSGConfigUtils::GetColor(view, "LowIdentity", color);
471  CSGConfigUtils::GetColor(view, "MidIdentity", color);
473  CSGConfigUtils::GetColor(view, "HighIdentity", color);
475  CSGConfigUtils::GetColor(view, "CNV", color);
477  CSGConfigUtils::GetColor(view, "Insertion", color);
479  CSGConfigUtils::GetColor(view, "Loss", color);
481  CSGConfigUtils::GetColor(view, "Gain", color);
483  CSGConfigUtils::GetColor(view, "Complex", color);
485  CSGConfigUtils::GetColor(view, "Unknown", color);
487  CSGConfigUtils::GetColor(view, "Inversion", color);
489  CSGConfigUtils::GetColor(view, "Everted", color);
491  CSGConfigUtils::GetColor(view, "Transchr", color);
493  CSGConfigUtils::GetColor(view, "DeletionInsertion", color);
495 
498  view.GetTopKeys(keys);
499  ITERATE(CRegistryReadView::TKeys, iter, keys) {
500  CRegistryReadView sub_view =
504  params->m_ShowNtRuler = sub_view.GetBool("NtRuler", true);
505  params->m_ShowAaRuler = sub_view.GetBool("AaRuler", true);
506  params->m_ShowStrandIndicator = sub_view.GetBool("ShowStrandIndicator", true);
507  params->m_CgiMode = m_CgiMode;
508  params->m_ColorTheme = m_CurrColor;
509 
513  string label_pos = sub_view.GetString("LabelPos");
514  try {
515  params->m_LabelPos =
517  } catch (CException& e) {
518  LOG_POST(Warning << "CSeqGraphicConfig::x_LoadFeatSettings() "
519  << e.GetMsg());
520  }
521 
522  // loading color settings
525  CSGConfigUtils::GetColor(sub_view, "FG", params->m_fgColor);
526  CSGConfigUtils::GetColor(sub_view, "BG", params->m_bgColor);
527  CSGConfigUtils::GetColor(sub_view, "Label", params->m_LabelColor);
528  params->m_NonConsensus = params->m_fgColor; // set a default
529  CSGConfigUtils::GetColor(sub_view, "NonConsensus", params->m_NonConsensus);
530 
531  // loading size settings
534  params->m_BarHeight = sub_view.GetReal("BarHeight", 9.0);
535  params->m_OverviewFactor = sub_view.GetReal("OverviewSizeFactor", 0.5);
536  params->m_LineWidth = sub_view.GetReal("LineWidth", 1.0);
537  CSGConfigUtils::GetFont(sub_view, "LabelFontFace", "LabelFontSize", params->m_LabelFont);
538 
539  // loading decoration settings
540  string curr_key = CSGConfigUtils::ComposeDecoKey(iter->key, m_CurrDeco);
542  sub_view = CSGConfigUtils::GetReadView(*m_Registry, kFeatParamsKey, curr_key, def_key1);
543  params->m_HeadHeight = sub_view.GetReal("HeadHeight", 1.0);
544  params->m_TailHeight = sub_view.GetReal("TailHeight", 1.0);
549  try {
550  if (sub_view.HasField("HeadStyle"))
551  params->m_HeadStyle =
553  sub_view.GetString("HeadStyle"));
554  if (sub_view.HasField("TailStyle"))
555  params->m_TailStyle =
557  sub_view.GetString("TailStyle"));
558  if (sub_view.HasField("LineStyle"))
559  params->m_LineStyle =
561  sub_view.GetString("LineStyle"));
562  if (sub_view.HasField("Connection"))
563  params->m_Connections =
565  sub_view.GetString("Connection"));
566  if (sub_view.HasField("BoxStyle"))
567  params->m_BoxStyle =
569  sub_view.GetString("BoxStyle"));
570  } catch (CException& e) {
571  LOG_POST(Warning << "CSeqGraphicConfig::x_LoadFeatSettings() "
572  << e.GetMsg());
573  }
574 
575  m_FeatSettings[iter->key] = params;
576  }
577 
578  // load settings for clone placement user type feature
579  if ( !m_ClonePlacementSettings ) {
581  }
582 
584 
586  *m_Registry, kCPParamsKey, "Default", m_CurrLabelPos);
588  string label_pos = view.GetString("LabelPos");
589  try {
590  cp_conf->m_LabelPos =
592  } catch (CException& e) {
593  LOG_POST(Warning << "CSeqGraphicConfig::x_LoadFeatSettings() "
594  << e.GetMsg());
595  }
596 
597  // loading color settings
599  *m_Registry, kCPParamsKey, "Default", m_CurrColor);
600  CSGConfigUtils::GetColor(view, "Concordant", cp_conf->m_ConcordantColor);
601  CSGConfigUtils::GetColor(view, "Discordant", cp_conf->m_DiscordantColor);
602  CSGConfigUtils::GetColor(view, "UnknownConcordancy", cp_conf->m_UnknownConcordancyColor);
603  CSGConfigUtils::GetColor(view, "Highlight", cp_conf->m_HighlightColor);
604  CSGConfigUtils::GetColor(view, "CombinedPlacement", cp_conf->m_CombinedPlacementColor);
605  CSGConfigUtils::GetColor(view, "FakeEnd", cp_conf->m_FakeEndColor);
606  CSGConfigUtils::GetColor(view, "Label", cp_conf->m_LabelColor);
607 
608  // loading size settings
610  *m_Registry, kCPParamsKey, "Default", m_CurrSize);
611  cp_conf->m_BarHeight = view.GetReal("BarHeight", 6.0);
612  cp_conf->m_HeadHeight = view.GetReal("HeadHeight", 8.0);
613  cp_conf->m_OverviewFactor = view.GetReal("OverviewSizeFactor", 0.5);
614  CSGConfigUtils::GetFont(view, "LabelFontFace", "LabelFontSize", cp_conf->m_LabelFont);
615 
616 
617  // loading settings for comment
618  if ( !m_CommentConfig ) {
620  }
621  view = m_Registry->GetReadView(kCommentConfigKey + ".Default");
622  m_CommentConfig->m_ShowBoundary = view.GetBool("ShowBoundary", false);
623  m_CommentConfig->m_ShowConnection = view.GetBool("ShowConnection", true);
624  m_CommentConfig->m_Centered = view.GetBool("Centered", true);
625 
626  // loading color settings
631 
632  // loading size settings
634  *m_Registry, kCommentConfigKey, "Default", m_CurrSize);
635  CSGConfigUtils::GetFont(view, "LabelFontFace", "LabelFontSize", m_CommentConfig->m_Font);
636 }
637 
639 {
640  // we don't need to save the setting for features since we don't
641  // expose an interfaces for changing the feature settings.
642 }
643 
644 
646 
data structure holding configuration for a track.
CRef< objects::CCategory > GetCategory(const string &cat_name)
CRef< objects::CCategory > GetSubcategory(const string &cat_name, const string &sub_cat)
void AddCategory(const SCategorySettings &cat)
void AddSubcategory(const string &cat_name, CRef< objects::CCategory > sub_cat)
CClonePlacementParams:
CGlTextureFont m_LabelFont
CRgbaColor m_UnknownConcordancyColor
TModelUnit m_HeadHeight
absolute size (in pixel)
CRgbaColor m_CombinedPlacementColor
TModelUnit m_OverviewFactor
ratio to bar height
CRgbaColor m_ConcordantColor
TLabelPosition m_LabelPos
CRgbaColor m_DiscordantColor
TModelUnit m_BarHeight
absolute size (in pixel)
CCommentConfig – help config class for holding a set of settings for a comment glyph.
CRgbaColor m_LineColor
CGlTextureFont m_Font
CRgbaColor m_LabelColor
bool m_Centered
label is centered against the target.
bool m_ShowConnection
display a connection between the comment and target.
File Description: configuration class for everything needed to render a single feature.
void SetColor(int idx, const CRgbaColor &color)
@ eLowIdentity
feature's default color based on feature type
CConfigurableItems - a static list of items that can be configured.
vector< string > GetStoragekeys(int subtype) const
Get hierarchy of keys above this subtype, starting with "Master" example, eSubtype_gene,...
CFeatureParams: the data structure holding feature rendering parameters.
ELineStyle m_LineStyle
EConnection m_Connections
TModelUnit m_LineWidth
absolute value (in pixel)
static int DecoStrToValue(const string &s)
EHeadStyle m_HeadStyle
CRgbaColor m_LabelColor
TModelUnit m_HeadHeight
ratio to bar height
TModelUnit m_TailHeight
ratio to bar height
CRgbaColor m_NonConsensus
CRgbaColor m_bgColor
ELineStyle
how feature border and exons connections are drawn.
CRef< CCustomFeatureColor > m_CustomColors
custom color code for features with a special attribute.
EBoxStyle m_BoxStyle
TModelUnit m_OverviewFactor
ratio to bar height
EConnection
type of exon connection lines.
CRgbaColor m_fgColor
CGlTextureFont m_LabelFont
ELabelPosition m_LabelPos
EBoxStyle
how the box of the feature is drawn
TModelUnit m_BarHeight
absolute size (in pixel)
@ ePos_Side
always on 5' side
ETailStyle m_TailStyle
bool m_ShowStrandIndicator
EHeadStyle
strand indicator at the beginning.
CRegistryWriteView GetWriteView(const string &section)
get a read-write view at a particular level.
Definition: registry.cpp:462
CRegistryReadView GetReadView(const string &section) const
get a read-only view at a particular level.
Definition: registry.cpp:428
CHistParamsManager: class for manage histogram/graph settings for all feature subtype and various gra...
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
double GetReal(const string &key, double default_val=0) const
Definition: reg_view.cpp:235
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
bool HasField(const string &key) const
Does a field with this section and key exist in this view?
Definition: reg_view.cpp:352
string GetString(const string &key, const string &default_val=kEmptyStr) const
Definition: reg_view.cpp:246
bool IsEmpty()
There is nothing in this view.
Definition: reg_view.cpp:363
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
bool DeleteField(const string &key)
delete the specified field (and any of its subfields) from this view and from its registry.
Definition: reg_view.cpp:523
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
static string ComposeDecoKey(const string &base, const string &key)
static CRegistryReadView GetSizeReadView(const CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
static const string & DefTrackProfile()
static void GetFont(const CRegistryReadView &view, const string &face_key, const string &size_key, CGlTextureFont &f)
static CRegistryReadView GetColorReadView(const CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
Create a read view specifically for 'Color' section.
static CRegistryReadView GetReadView(const CGuiRegistry &reg, const string &base_key, const string &curr_key, const string &def_key1="", const string &def_key2="", const string &def_key3="")
read/readwrite view creation helper methods.
static CRegistryReadView GetLabelPosReadView(const CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
static CRegistryWriteView GetWriteView(CGuiRegistry &reg, const string &base_key, const string &curr_key, const string &def_key1="", const string &def_key2="", const string &def_key3="")
static CRegistryWriteView GetColorRWView(CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
static const string & DefGlobalSettingStyle()
static const string & DefColorTheme()
static const string & DefSizeLevel()
static const string & DefLayout()
static const string & GlobalSettingStyleKey()
static void SetColor(CRegistryWriteView &view, const string &key, const CRgbaColor &color)
static void GetColor(const CRegistryReadView &view, const string &key, CRgbaColor &color)
static const string & DefDecoStyle()
static const string & DefLabelPosition()
static const CFeatList * GetFeatList()
CRef< CGlTextureFont > m_TitleFont
void SetAnnotDepth(int depth)
string m_CurrLayout
layout style
static const string & ThemeKey()
CSeqGraphicConfig inline methods.
static const string & DefTheme()
CRgbaColor m_NonNCBITitleBackground
CRef< CClonePlacementParams > m_ClonePlacementSettings
cached clone placement settings.
CRgbaColor m_SelHairlineOne
CConstRef< CFeatureParams > GetFeatParams(TFeatSubtype subtype) const
Get feature settings using a feature subtype.
static void LoadSettingStyles(const CGuiRegistry &reg, string &theme, string &color, string &size, string &deco, string &profile, string &label)
Utility method helping initializing various settings styles.
void x_VerifySettings() const
CSeqGraphicConfig(bool cgi_mode=false, CGuiRegistry *registry=0, const string &theme="", const string &color="", const string &size="", const string &deco="", const string &profile="", const string &layout="", const string &label="")
CRgbaColor m_SelHairlineMany
CRgbaColor m_SelHairlineDown
CRef< CGuiRegistry > m_Registry
CRef< CCategoryConfig > m_CategoryConfig
string m_CurrSize
size level
CRgbaColor m_GridHorizontal
CRef< CGlTextureFont > m_CommentFont
string m_CurrGlobal
global setting style
CConstRef< CCommentConfig > GetCommentConfig() const
string m_CurrLabelPos
label position style
float m_ZoomFactor
Per pexel of a mouse movement.
string m_CurrTheme
current theme
int m_OverviewCutoff
cut-off between overview and detail mode(base per pixel)
CRgbaColor m_TitleBackground
CRgbaColor m_Background
Cached colors.
void InitCategoryConfig(const CCategoryConfig::TGroupMap &group_map, const CCategoryConfig::TSubgroupMap &sub_group_map)
if the category configuration is not loaded, load it
CRef< CCategoryConfig > GetCategoryConfig()
bool m_AutoHideTrack
Automatically hide tracks w/o data.
string m_CurrProfile
feature panel track profile
string m_CurrDeco
decoration, mainly for features
CRef< CCommentConfig > m_CommentConfig
string m_CurrColor
color theme
int m_HistogramCutoff
Num of features.
TFeatParams m_FeatSettings
cached histogram rendering parameters.
CRef< CGlTextureFont > m_LabelFont
cached fonts.
void LoadSettings()
update the cached settings.
int m_HairLineOption
Cached sizes.
CRef< CCustomFeatureColor > m_CustomFeatColors
int TFeatSubtype
we use int instead of CSeqFeatData::ESubtype for two reasons:
void SaveSettings(bool clear_themes=false)
bool m_CgiMode
not loaded from configure file
static CRef< objects::CCategory > CreateCategory(const string &name, const string &disp_name, const string &help, int order)
const_iterator end() const
Definition: map.hpp:152
void clear()
Definition: map.hpp:169
const_iterator find(const key_type &key) const
Definition: map.hpp:153
static CMemoryRegistry registry
Definition: cn3d_tools.cpp:81
#define false
Definition: bool.h:36
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
const string & GetMsg(void) const
Get message string.
Definition: ncbiexpt.cpp:461
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
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
#define kEmptyStr
Definition: ncbistr.hpp:123
static const char label[]
void SetOrder(TOrder value)
Assign a value to Order data member.
Definition: Category_.hpp:359
n background color
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
USING_SCOPE(objects)
static const string kCommentConfigKey("GBPlugins.SeqGraphicCommentConfig")
static const string kBaseKey("GBPlugins.SeqGraphicView")
static const string kFeatParamsKey("GBPlugins.SeqGraphicFeats")
static const string kCPParamsKey("GBPlugins.SeqGraphicClonePlacement")
static const string kCustomColorKey("GBPlugins.CustomFeatureColors")
static const string kDefFeatKey("Master")
CRef< objects::CCategory > m_Category
void AddSubcategory(CRef< objects::CCategory > sub_cat)
#define _ASSERT
Modified on Mon Apr 22 04:01:35 2024 by modify_doxy.py rev. 669887