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

Go to the SVN repository for this file.

1 /*
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: Andrei Shkeda
27  *
28  */
29 
30 #include <ncbi_pch.hpp>
43 
45 #include <gui/objutils/utils.hpp>
46 #include <wx/event.h>
47 #include <wx/menu.h>
48 
49 
52 
53 static const string kStacked = "stacked";
54 static const string kValueRange = "range";
55 
57 CGraphOverlay::m_TypeInfo("graph_overlay", "Composite track");
58 
59 
60 ///////////////////////////////////////////////////////////////////////////////
61 /// CGraphOverlayFactory
62 ///////////////////////////////////////////////////////////////////////////////
64 {
65 }
66 
67 
70  ISGDataSourceContext* ds_context,
71  CRenderingContext* r_cntx,
72  const SExtraParams& params,
73  const TAnnotMetaDataList& /*src_annots*/) const
74 {
75  TTrackMap tracks;
77  ds_context->GetDS(typeid(CFeaturePanelDSType).name(), object);
78  CFeaturePanelDS* fp_ds = dynamic_cast<CFeaturePanelDS*>(ds.GetPointer());
79  fp_ds->SetDSContext(ds_context);
80  fp_ds->SetRenderingContext(r_cntx);
81 /*
82  if (!params.m_Annots.empty()) {
83  CRef<CGraphTrackFactory> factory(new CGraphTrackFactory);
84  ITERATE(SExtraParams::TAnnots, iter, params.m_Annots)
85  {
86  SExtraParams new_params = params;
87  new_params.m_Annots.clear();
88  new_params.m_Annots.push_back(*iter);
89  TTrackMap a_tracks = factory->CreateTracks(object, ds_context, r_cntx, new_params);
90  tracks.insert(a_tracks.begin(), a_tracks.end());
91  }
92  }
93 */
94  const static string kGraphOverlay = "graph_overlay";
95  static int s_GraphOverlayNum = 0;
96  CGraphOverlay* track = new CGraphOverlay(r_cntx, fp_ds);
97  //tracks["graph_overlay"] = CRef<CLayoutTrack>(track);
98  string annot = params.m_Annots.empty() ? kGraphOverlay + NStr::NumericToString(s_GraphOverlayNum++) : params.m_Annots.front();
99  tracks[annot] = CRef<CLayoutTrack>(track);
100  track->SetAnnotLevel(params.m_Level);
101  track->SetAdaptive(params.m_Adaptive);
103  return tracks;
104 }
105 
107 {
109 }
110 
112 {
114 }
115 
117 CGraphOverlayFactory::GetSettings(const string& /*profile*/,
118  const TKeyValuePairs& settings,
119  const CTempTrackProxy* track_proxy) const
120 {
121  CRef<CTrackConfigSet> config_set(new CTrackConfigSet);
123  config_set->Set().push_back(config);
124  config->SetLegend_text("anchor_12");
125 
127  CHistParams::EScale stored_scale = track_proxy
130  bool stacked = false;
131  string value_range;
132  bool smooth_curve = false;
133  string fit_step = "5";
134 
135 
136  ITERATE (TKeyValuePairs, iter, settings) try {
137  if (NStr::EqualNocase(iter->first, "height")) {
138  config->SetHidden_settings().push_back
139  (CTrackConfigUtils::CreateHiddenSetting("height", iter->second));
140  } else if (NStr::EqualNocase(iter->first, "Label")) {
141  config->SetHidden_settings().push_back
142  (CTrackConfigUtils::CreateHiddenSetting("Label", iter->second));
143  } else if (NStr::EqualNocase(iter->first, "RulerColor")) {
144  config->SetHidden_settings().push_back
145  (CTrackConfigUtils::CreateHiddenSetting("RulerColor", iter->second));
146  } else if (NStr::EqualNocase(iter->first, "scale")) {
147  scale = CHistParams::ScaleStrToValue(iter->second);
148  } else if (NStr::EqualNocase(iter->first, "stored_scale") || NStr::EqualNocase(iter->first, "is_scaled")) {
149  stored_scale = CHistParams::ScaleStrToValue(iter->second);
150  } else if (NStr::EqualNocase(iter->first, kValueRange)) {
151  value_range =iter->second;
152  } else if (NStr::EqualNocase(iter->first, kStacked)) {
153  stacked = NStr::StringToBool(iter->second);
154  } else if (NStr::EqualNocase(iter->first, "smooth_curve")) {
155  smooth_curve = NStr::StringToBool(iter->second);
156  } else if (NStr::EqualNocase(iter->first, "fit_step")) {
157  fit_step = iter->second;
158  }
159 
160  } catch (std::exception&) {
161  // ignore the errors
162  }
163  if (stored_scale != CHistParams::eLinear && scale == CHistParams::eLinear) {
164  scale = stored_scale;
165  }
166 
167  // Scale parameter
169  ("scale", "Linear/Log Scale",
171  "Scale for graph data");
172  choice->SetValues().push_back
175  "Linear",
176  "Shown at linear scale",
177  "Graph data is shown at linear scale"));
178  choice->SetValues().push_back(
181  "Log Base 10",
182  "Shown at log base 10 scale",
183  "Graph data is shown at logarithmic (base 10) scale"));
184  choice->SetValues().push_back(
187  "Log Base e",
188  "Shown at natural logarithm (base e) scale",
189  "Graph data is shown at natural logrithm (base e) scale"));
190  choice->SetValues().push_back(
193  "Log Base 2",
194  "Shown at log base 2 scale",
195  "Graph data is shown at logarithmic (base 2) scale"));
196  config->SetChoice_list().push_back(choice);
197 
198  config->SetCheck_boxes().push_back(
200  "smooth_curve", "Smooth curve", "Smooth curve", "", smooth_curve));
201 
202  bool range_autoscale = true;
203  string range_min, range_max;
204  if (!value_range.empty()) {
205  string r_min, r_max;
206  CTrackConfigUtils::DecodeValueRange(value_range, r_min, r_max, range_autoscale);
207  if (!r_min.empty() && r_min != "inf") {
208  range_min = (errno) ? "" : r_min;
209  }
210  if (!r_max.empty() && r_max != "inf") {
211  range_max = (errno) ? "" : r_max;
212  }
213  config->SetHidden_settings().push_back(
215  //NStr::Replace(value_range, "~", ":")));
216  }
217 
219  "Set value range (data outside range will be clipped)",
220  "Set value range (data outside range will be clipped)",
221  range_min,
222  range_max,
223  range_autoscale,
224  true);
225  {
226  auto condition = Ref(new objects::CConditional);
227  condition->SetName("scale");
228  condition->SetValue().push_back(CHistParams::ScaleValueToStr(CHistParams::eLog10));
229  condition->SetValue().push_back(CHistParams::ScaleValueToStr(CHistParams::eLog2));
230  condition->SetValue().push_back(CHistParams::ScaleValueToStr(CHistParams::eLoge));
231  condition->SetAction(CConditional::eAction_disable);
232  range_control->SetConditions().push_back(condition);
233  }
234 
235  config->SetRange_controls().push_back(range_control);
236 
237  // Overlay layout
238  config->SetCheck_boxes().push_back(
240  kStacked, "Stacked", "Graphs are stacked under each other", "", stacked));
241 
242  config->SetHelp() = GetThisTypeInfo().GetDescr();
243 
244  return config_set;
245 }
246 
247 
249  public CObject,
250  public wxEvtHandler
251 {
252 public:
253  CGraphOverlayEvtHandler(CGraphOverlay* overlay, int track_id)
254  : m_Overlay(overlay), m_TrackId(track_id)
255  {
256  }
257 
258  void OnContextMenu(wxContextMenuEvent& anEvent);
259 
260 private:
261  /// @name event handlers.
262  /// @{
263  void x_OnTrackSettings(wxCommandEvent& event)
264  {
266  }
267  void x_OnHideTrack(wxCommandEvent& event)
268  {
270  }
271  void x_OnRemoveTrack(wxCommandEvent& event)
272  {
274  }
275  /// @}
276 
277 private:
280 
281  DECLARE_EVENT_TABLE()
282 };
283 
284 
285 BEGIN_EVENT_TABLE(CGraphOverlayEvtHandler, wxEvtHandler)
290 
291 
292 ///////////////////////////////////////////////////////////////////////////////
293 /// CGraphOverlay
294 ///////////////////////////////////////////////////////////////////////////////
295 
297  CTrackContainer(r_cntx, ds)
298  , m_Source(source)
299 {
300  //_ASSERT(!m_Source.empty());
301  if (m_Source.empty())
302  m_Source = "Composite track";
303  //x_RegisterIcon(SIconInfo(eIcon_Settings, "Settings", true, "track_settings"));
304 
305  //CRef<COverlayLayout> p(new COverlayLayout);
306  //CRef<CSimpleLayout> p(new CSimpleLayout);
307  //SetLayoutPolicy(p);
308 
309  CRef<CLayeredLayout> layered_layout(new CLayeredLayout);
310  m_Legend.SetLayoutPolicy(&*layered_layout);
311  m_Legend.SetRenderingContext(r_cntx);
312  m_Legend.SetParent(this);
313 
314  CHistogramGlyph::TMap empty_map;
315  m_Grid.Reset(new CHistogramGlyph(empty_map, NcbiEmptyString));
316  m_Grid->SetRenderingContext(r_cntx);
317  m_Grid->SetShowTitle(false);
318 }
319 
320 
321 void CGraphOverlay::UpdateTrackParams(const string& annot_name)
322 {
323  if (annot_name == m_Source)
324  return;
325  string config_name = annot_name;
326  config_name += CGraphTrack::kOverlayed;
328  if (!conf_mgr->HasSettings(m_Source))
329  return;
330  CRef<CHistParams> curr_params;
331  if (conf_mgr->HasSettings(config_name)) {
332  // Get the corresponding setting for this data track if exists
333  curr_params = conf_mgr->GetHistParams(config_name);
334  } else {
335  if (conf_mgr->HasSettings(annot_name))
336  curr_params = conf_mgr->GetHistParams(annot_name);
337  else
338  curr_params = conf_mgr->GetDefHistParams();
339  }
340 
341  CRef<CHistParams> overlay_params = conf_mgr->GetHistParams(m_Source);
342  CRef<CHistParams> merged_params(new CHistParams);
343  *merged_params = *overlay_params;
344  merged_params->m_fgColor = curr_params->m_fgColor;
345  // overlayed graphs should be rendered in one color
346  // therefore we need override neg color for them
347  //merged_params->m_fgNegColor = (m_Layout == eOverlay) ? curr_params->m_fgColor : curr_params->m_fgNegColor;
348  merged_params->m_fgNegColor = curr_params->m_fgColor;
349  merged_params->m_SmearColorMin = curr_params->m_SmearColorMin;
350  merged_params->m_SmearColorMax = curr_params->m_SmearColorMax;
351  merged_params->m_Type = curr_params->m_Type;
352  //merged_params->m_SmoothCurve = curr_params->m_SmoothCurve;
353  //merged_params->m_ValueRange = curr_params->m_ValueRange;
354  //merged_params->m_RangeMin = curr_params->m_RangeMin;
355  //merged_params->m_RangeMax = curr_params->m_RangeMax;
356  conf_mgr->AddSettings(config_name, merged_params);
357 }
358 
359 
361 {
363  _ASSERT(conf_mgr->HasSettings(m_Source));
364  if (!conf_mgr->HasSettings(m_Source))
365  return;
366  CRef<CHistParams> my_params = conf_mgr->GetHistParams(m_Source);
367  *my_params = params;
368 }
369 
370 
371 void CGraphOverlay::x_UpdateTrackSettings(const string& source_name)
372 {
375  CRef<CHistParams> overlay_params = conf_mgr->GetHistParams(m_Source);
376 
377  string src_name = source_name + CGraphTrack::kOverlayed;
378  CRef<CHistParams> curr_params(new CHistParams);
379  *curr_params = *conf_mgr->GetHistParams(src_name);
380  curr_params->m_NeedRuler = overlay_params->m_NeedRuler;
381  curr_params->m_DrawBg = overlay_params->m_DrawBg;
382 
383  CHistConfigDlg dlg;
384  dlg.SetConfig(curr_params);
385  dlg.SetConfigName(source_name);
386  dlg.SetRegistryPath("Dialogs.GraphRenderingOptions");
387  dlg.CreateX(NULL);
388  if(dlg.ShowModal() == wxID_OK) {
389  CRef<CHistParams> params = dlg.GetConfig();
390  x_UpdateContainerParams(*params);
391  params->m_NeedRuler = m_Layout != eOverlay;
392  params->m_DrawBg = m_Layout != eOverlay;
393  conf_mgr->AddSettings(src_name, params);
395  CGraphTrack* gt = dynamic_cast<CGraphTrack*>(&**gt_it);
396  if (!gt)
397  continue;
398  NON_CONST_ITERATE(CLayoutGroup::TObjectList, hist_it, gt->SetGroup().SetChildren()) {
399  CHistogramGlyph* hg = dynamic_cast<CHistogramGlyph*>(&**hist_it);
400  if (!hg)
401  continue;
402  UpdateTrackParams(gt->GetAnnot());
403  hg->SetAxisRange();
404  hg->Update(true);
405  }
406  }
407  Update(true);
409  }
410 }
411 
413 {
414  for (auto& proxy : m_TrackProxies) {
415  if (proxy->GetOrder() == order) {
416  x_UpdateTrackSettings(proxy->GetSource());
417  break;
418  }
419  }
420 }
421 
422 
423 void CGraphOverlay::x_SaveSettings(const string& preset_style)
424 {
425  CTrackContainer::x_SaveSettings(preset_style);
426 
427  TKeyValuePairs settings;
428  if ( !preset_style.empty())
429  settings["profile"] = preset_style;
431  CRef<CHistParams> overlay_params = conf_mgr->GetHistParams(m_Source);
432 
433  settings["BG"] = overlay_params->m_bgColor.ToString();
434  settings["height"] = NStr::NumericToString(overlay_params->m_Height);
435  settings["scale"] = CHistParams::ScaleValueToStr(overlay_params->m_Scale);
436  settings["stored_scale"] = CHistParams::ScaleValueToStr(overlay_params->m_StoredScale);
437  settings["DrawBg"] = NStr::BoolToString(overlay_params->m_DrawBg);
438  settings["NeedRuler"] = NStr::BoolToString(overlay_params->m_NeedRuler);
439  settings["Label"] = overlay_params->m_LabelColor.ToString();
440  settings["RulerColor"] = overlay_params->m_RulerColor.ToString();
441  //settings["smooth_curve"] = NStr::BoolToString(overlay_params->m_SmoothCurve);
443 }
444 
445 void CGraphOverlay::x_LoadSettings(const string& /*preset_style*/,
446  const TKeyValuePairs& settings)
447 {
448  // Parse known parameters
449  bool parameter_present = false;
450  string scale, stored_scale;
451  bool draw_bg = false, need_ruler = true;
452  string bg_color, label_color, ruler_color, value_range;
453  int height = -1;
454 
455  bool smooth_curve = false;
456  int fit_step = 4;
457 
458  ITERATE (TKeyValuePairs, iter, settings) try {
459  if (NStr::EqualNocase(iter->first, "BG")) {
460  bg_color = iter->second;
461  parameter_present = true;
462  } else if (NStr::EqualNocase(iter->first, "height")) {
463  height = NStr::StringToInt(iter->second);
464  parameter_present = true;
465  } else if (NStr::EqualNocase(iter->first, "scale")) {
466  scale = iter->second;
467  parameter_present = true;
468  } else if (NStr::EqualNocase(iter->first, "stored_scale") || NStr::EqualNocase(iter->first, "is_scaled")) {
469  stored_scale = iter->second;
470  parameter_present = true;
471  } else if (NStr::EqualNocase(iter->first, "DrawBg")) {
472  draw_bg = NStr::StringToBool(iter->second);
473  parameter_present = true;
474  } else if (NStr::EqualNocase(iter->first, "NeedRuler")) {
475  need_ruler = NStr::StringToBool(iter->second);
476  parameter_present = true;
477  } else if (NStr::EqualNocase(iter->first, "Label")) {
478  label_color = iter->second;
479  parameter_present = true;
480  } else if (NStr::EqualNocase(iter->first, "RulerColor")) {
481  ruler_color = iter->second;
482  parameter_present = true;
483  } else if (NStr::EqualNocase(iter->first, kValueRange)) {
484  value_range = iter->second;
485  parameter_present = true;
486  } else if (NStr::EqualNocase(iter->first, kStacked)) {
487  m_Layout = NStr::StringToBool(iter->second) ? eStacked : eOverlay ;
488  } else if (NStr::EqualNocase(iter->first, "smooth_curve")) {
489  try {
490  smooth_curve = NStr::StringToBool(iter->second);
491  } catch (exception& e) {
492  ERR_POST(Error << e.what());
493  }
494  parameter_present = true;
495  } else if (NStr::EqualNocase(iter->first, "fit_step")) {
496  fit_step = NStr::StringToInt(iter->second);
497  parameter_present = true;
498  }
499  } catch (std::exception&) {
500  LOG_POST(Error << "CGraphTrackContainer::x_LoadSettings: invalid settings "
501  << iter->second);
502  }
504  CRef<CHistParams> hist_conf;
505  if (conf_mgr->HasSettings(m_Source)) {
506  // Get the corresponding setting for this data track if exists
507  hist_conf = conf_mgr->GetHistParams(m_Source);
508  } else {
509  CRef<CHistParams> def_conf = conf_mgr->GetDefHistParams();
510  hist_conf.Reset(new CHistParams(*def_conf));
511  conf_mgr->AddTempSettings(m_Source, hist_conf);
512  }
513  if (!parameter_present)
514  return;
515 
516  try {
517  hist_conf->m_DrawBg = draw_bg;
518  hist_conf->m_NeedRuler = need_ruler;
519 
520  if (!bg_color.empty())
521  hist_conf->m_bgColor.FromString(bg_color);
522 
523  if (!label_color.empty())
524  hist_conf->m_LabelColor.FromString(label_color);
525 
526  if (!ruler_color.empty())
527  hist_conf->m_RulerColor.FromString(ruler_color);
528 
529  // use user-provided size
530  if (height > 0)
531  hist_conf->m_Height = height;
532 
533  if (!scale.empty())
534  hist_conf->m_Scale = CHistParams::ScaleStrToValue(scale);
535 
536  hist_conf->m_SmoothCurve = smooth_curve;
537  hist_conf->m_FitStep = fit_step;
538 
539  if (!stored_scale.empty()) {
540  hist_conf->m_StoredScale = CHistParams::ScaleStrToValue(stored_scale);
541  if (hist_conf->m_StoredScale != CHistParams::eLinear)
542  hist_conf->m_Scale = hist_conf->m_StoredScale;
543  }
544  if (!value_range.empty()) {
545  string range_min, range_max;
546  CTrackConfigUtils::DecodeValueRange(value_range, range_min, range_max, hist_conf->m_RangeAutoscale);
547  if (!range_min.empty() && range_min != "inf")
548  hist_conf->m_ValueRange.SetFrom(NStr::StringToNumeric<float>(range_min, NStr::fConvErr_NoThrow));
549  if (!range_max.empty() && range_max != "inf")
550  hist_conf->m_ValueRange.SetTo(NStr::StringToNumeric<float>(range_max, NStr::fConvErr_NoThrow));
551  bool not_empty = hist_conf->m_ValueRange.GetFrom() != hist_conf->m_ValueRange.GetEmptyFrom()
552  && hist_conf->m_ValueRange.GetTo() != hist_conf->m_ValueRange.GetEmptyTo();
553  if (not_empty) {
554  // swap if from > to
555  if (hist_conf->m_ValueRange.GetFrom() > hist_conf->m_ValueRange.GetTo()) {
556  hist_conf->m_ValueRange.Set(hist_conf->m_ValueRange.GetTo(), hist_conf->m_ValueRange.GetFrom());
557  }
558  }
559 
560  }
561 
562  } catch (std::exception&) {
563  LOG_POST(Error << "CGraphTrackContainer::x_LoadSettings: invalid histogram settings");
564  }
565 }
566 
567 
568 void CGraphOverlay::LH_OnItemDblClick(const string& source_name)
569 {
570  x_UpdateTrackSettings(source_name);
571 }
572 
573 static
574 WX_DEFINE_MENU(sLegenItemPopupMenu)
578 WX_END_MENU()
579 
580 
581 void CGraphOverlay::LH_OnItemRightClick(const string& source_name)
582 {
583  int track_id = -1;
584  for (auto& proxy : m_TrackProxies) {
585  if (proxy->GetSource() == source_name) {
586  track_id = proxy->GetOrder();
587  break;
588  }
589  }
590  if (track_id == -1)
591  return;
593  m_LTHost->LTH_PushEventHandler(&*handler);
594  m_LTHost->LTH_PopupMenu(CUICommandRegistry::GetInstance().CreateMenu(sLegenItemPopupMenu));
595  m_LTHost->LTH_PopEventHandler();
596 }
597 
598 
600 {
601  if (GetHeight() == 0 || m_Context->IntersectVisible(this).Empty())
602  return;
603  if (m_Layout == eOverlay && !m_Group.GetChildren().empty())
604  m_Grid->DrawGrid(true);
605  m_Group.Draw();
606  if (!m_Group.GetChildren().empty() && (m_gConfig && !m_gConfig->GetCgiMode()))
607  m_Legend.Draw();
608 }
609 
610 
612 {
613  CRef<CSeqGlyph> glyph;
614  if (IsIn(p)) {
615  TModelPoint pp(p);
616  x_Parent2Local(pp);
617  if (x_HitTitleBar(pp)) {
618  glyph.Reset(this);
619  } else {
620  glyph = m_Group.HitTest(pp);
621  if (!glyph && (m_gConfig && !m_gConfig->GetCgiMode()))
622  glyph = m_Legend.HitTest(pp);
623  }
624  }
625  return glyph;
626 }
627 
628 static const int kLegendBarWidth = 30;
629 static const int kLegendLabelGap = 5;
630 static const int kLegenPadding = 5;
631 
632 
634 {
635  switch (m_Layout) {
636  case eOverlay:
637  if (!m_OverlayLayout)
640  break;
641  case eStacked:
642  if (!m_StackedLayout)
645  break;
646  }
648  m_Legend.Clear();
649  if (!(m_On && m_Expanded))
650  return;
651  TModelRange vis_r = m_Context->IntersectVisible(this);
652  if (vis_r.Empty())
653  return;
654  if (m_Group.GetChildren().empty())
655  return;
657  if (!m_gConfig)
658  return;
659 
660  // Update common track settings
661 
662  // ITERATE(TTrackProxies, iter, m_TrackProxies) {
663  // if (!(*iter)->GetShown())
664  // continue;
665  // if (!(*iter)->TrackNotSet())
666  // UpdateTrackParams((*iter)->GetSource());
667  // }
668  // update Grid
670 
672  if (!(*iter)->GetShown())
673  continue;
674  CGraphTrack* gt = dynamic_cast<CGraphTrack*>((*iter)->GetTrack());
675  if (!gt)
676  continue;
677  NON_CONST_ITERATE(CLayoutGroup::TObjectList, hist_it, gt->SetGroup().SetChildren()) {
678  CHistogramGlyph* hg = dynamic_cast<CHistogramGlyph*>(&**hist_it);
679  if (!hg)
680  continue;
681  m_Grid->SetTop(m_Group.GetTop() + gt->GetTop() + hg->GetTop());
682  m_Grid->SetLeft(hg->GetLeft());
683  m_Grid->SetWidth(hg->GetWidth());
684  m_Grid->SetHeight(hg->GetHeight());
685  break;
686  }
687  break;
688  }
689  x_UpdateLegend();
690 }
691 
692 struct SLegendData {
693  string annot;
694  string label;
695  string track_id; // for sviewer
697 };
698 
700 {
702  // update legend
703  // if (m_gConfig->GetCgiMode())
704  // return;
705 
708  IRender& gl = GetGl();
709 
710  TModelRange vis_r = m_Context->IntersectVisible(this);
711 
712  TModelUnit legend_item_span = 0;
713  vector<SLegendData> legend_fields;
715  if (!(*iter)->GetShown())
716  continue;
718  data.annot = (*iter)->GetSource();
719  CRef<CHistParams> params = conf_mgr->GetHistParams((*iter)->GetSource() + CGraphTrack::kOverlayed);
720  data.params = params.GetPointer();
721  data.track_id = (*iter)->GetId();
722  data.label = CHistParams::TypeValueToStr(params->m_Type);
723  if (!data.label.empty())
724  data.label += ": ";
725  data.label += (*iter)->GetDisplayName().empty() ? data.annot : (*iter)->GetDisplayName();
726  legend_item_span = max((TModelUnit)gl.TextWidth(&*font, data.label.c_str()), legend_item_span);
727  legend_fields.push_back(data);
728  }
729  if (legend_fields.empty())
730  return;
731  legend_item_span += kLegendBarWidth + kLegendLabelGap + kLegenPadding;
732 
733 // if (m_gConfig->GetCgiMode())
734 // legend_item_span *= 1.1; // increase length by 10% percent to fit browser generated text
735 
736  int view_width = m_Context->GetViewWidth();
737  if (view_width == 0)
738  view_width = m_Context->SeqToScreen(vis_r.GetLength());
739  //view_width -= 10;
740 
741  int num_cols = min((int)(view_width/legend_item_span), (int)legend_fields.size());
742  if (num_cols == 0)
743  return;
744  bool cgi_mode = (m_gConfig && m_gConfig->GetCgiMode());
745  // in cgi mode, the position represents HTML area and is expected to be in screen coordinates
746  // in non cgi mode, the position is used for rendering and is expected to be in model coordinates
747 
748  TModelUnit center = cgi_mode ? (view_width/2) : m_Context->SeqToScreen(vis_r.GetFrom() + vis_r.GetLength() / 2);
749 
750  int num_rows = ceil((float)legend_fields.size() / num_cols);
751  TModelUnit row_height = gl.TextHeight (&*font) + 2;
752  for (int row = 0; row < num_rows; ++row) {
753  size_t base_index = row * num_cols;
754  // last row may have less columns
755  if (base_index + num_cols >= legend_fields.size())
756  num_cols = static_cast<int>(legend_fields.size() - base_index);
757  int c = num_cols / 2;
758  TModelUnit left = center;
759  if (num_cols % 2 != 0)
760  left -= legend_item_span/2;
761  for (int col = 0; col < c; ++col) {
762  //left -= 4;
763  left -= legend_item_span;
764  }
765 
766  for (int col = 0; col < num_cols; ++col) {
768  (new CLegendItemGlyph(legend_fields[base_index + col].annot,
769  legend_fields[base_index + col].label,
770  legend_fields[base_index + col].track_id,
771  legend_fields[base_index + col].params->m_fgColor,
772  legend_fields[base_index + col].params->m_LabelColor));
773  g->SetTop(row * row_height + row * 4 + 2);
774  g->SetHeight(row_height);
775 
776  if (cgi_mode) {
777  g->SetWidth(legend_item_span);
778  g->SetLeft(left);
779  } else {
780  g->SetWidth(m_Context->ScreenToSeq(legend_item_span));
781  g->SetLeft(m_Context->ScreenToSeq(left));
782  }
783  g->SetConfig (*m_gConfig);
784  g->SetHost(this);
785  m_Legend.PushBack(&*g);
786  //left += 4;
787  left += legend_item_span;
788  }
789  }
793  m_Legend.SetHeight(row_height * num_rows + num_rows * 4);
795 }
796 
797 
798 
800 {
801  if (GetGroup().GetChildren().empty())
802  return;
803  float axis_min = numeric_limits<float>::max();
804  float axis_max = numeric_limits<float>::min();
806  CRef<CHistParams> params = conf_mgr->GetHistParams(m_Source);
807 
809  if (!(*iter)->GetShown())
810  continue;
811  CGraphTrack* gt = dynamic_cast<CGraphTrack*>((*iter)->GetTrack());
812  if (!gt)
813  continue;
815  NON_CONST_ITERATE(CLayoutGroup::TObjectList, hist_it, gt->SetGroup().SetChildren()) {
816  CHistogramGlyph* hg = dynamic_cast<CHistogramGlyph*>(&**hist_it);
817  if (!hg)
818  continue;
819  axis_max = max(hg->GetMax(), axis_max);
820  axis_min = min(hg->GetMin(), axis_min);
821  }
822  }
823  if (params->m_Scale == CHistParams::eLinear && params->m_RangeAutoscale == false) {
824  if (params->m_ValueRange.GetFrom() != params->m_ValueRange.GetEmptyFrom()) {
825  axis_min = params->m_ValueRange.GetFrom();
826  params->m_ClipOutliers = true;
827  }
828  if (params->m_ValueRange.GetTo() != params->m_ValueRange.GetEmptyTo()) {
829  axis_max = params->m_ValueRange.GetTo();
830  params->m_ClipOutliers = true;
831  }
832  }
833 
835  CGraphTrack* gt = dynamic_cast<CGraphTrack*>(&**obj_it);
836  if (!gt)
837  continue;
838  NON_CONST_ITERATE(CLayoutGroup::TObjectList, hist_it, gt->SetGroup().SetChildren()) {
839  CHistogramGlyph* hg = dynamic_cast<CHistogramGlyph*>(&**hist_it);
840  if (!hg)
841  continue;
843  hg->SetAxisMax(axis_max);
844  hg->SetAxisMin(axis_min);
845  hg->SetFixedScale(true);
846  hg->SetAxisRange();
847  }
848  gt->Update(true);
849  }
850 
852  m_Grid->SetAxisMax(axis_max);
853  m_Grid->SetAxisMin(axis_min);
854  m_Grid->SetFixedScale(true);
855  m_Grid->SetAxisRange();
857 }
858 
860 {
861  return m_TypeInfo;
862 }
863 
865 {
867  // Update common track settings
869  if (!(*iter)->GetShown())
870  continue;
871  if (!(*iter)->TrackNotSet())
872  UpdateTrackParams((*iter)->GetSource());
873  }
874 
875 }
877 {
878  GetGroup().GetHTMLActiveAreas(p_areas);
879  for (const auto& ch : GetGroup().GetChildren()) {
880  auto graph_track = dynamic_cast<const CGraphTrack*>(ch.GetPointer());
881  if (graph_track) {
882  for (auto& glyph : graph_track->GetChildren()) {
883  const CHistogramGlyph* hg = dynamic_cast<const CHistogramGlyph*>(glyph.GetPointer());
884  if (hg) {
885  const_cast<CHistogramGlyph*>(hg)->SetRenderingMode(CHistogramGlyph::eMode_Overlay);
886  hg->GetHTMLActiveAreas(p_areas);
888  }
889  }
890  }
891  }
892  m_Legend.GetHTMLActiveAreas(p_areas);
893  if (!GetId().empty()) {
894  NON_CONST_ITERATE (TAreaVector, iter, *p_areas) {
895  if (iter->m_ParentId.empty()) {
896  iter->m_ParentId = GetId();
897  }
898  }
899  }
900 }
901 
902 
904 {
905  CGraphTrack* gt = dynamic_cast<CGraphTrack*>(&*track);
906  return (gt != 0);
907 }
908 
910 {
911  CGraphTrack* gt = dynamic_cast<CGraphTrack*>(&*track);
912  if (!gt)
913  return false;
914  CTrackContainer* p_track = dynamic_cast<CTrackContainer*>(GetParentTrack());
915  if (!p_track)
916  return false;
917 
918  CTempTrackProxy* current_track_proxy = 0;
919  CTempTrackProxy* new_track_proxy = 0;
920 
922  {
923  if ((*iter)->GetOrder() == gt->GetOrder()) {
924  new_track_proxy = &**iter;
925  } else if ((*iter)->GetOrder() == GetOrder()) {
926  current_track_proxy = &**iter;
927  }
928  if (current_track_proxy && new_track_proxy)
929  break;
930  }
931  _ASSERT(current_track_proxy != 0 && new_track_proxy != 0);
932  if (current_track_proxy == 0 || new_track_proxy == 0)
933  return false;
934  //_ASSERT(new_track_proxy->GetKey() == "graph_track");
935 
937  CRef<CTempTrackProxy> new_overlay = current_track_proxy->Clone();
938 
939  CRef<CTempTrackProxy> subtrack_proxy = new_track_proxy->Clone();
940  int new_order = 1;
941  ITERATE(TTrackProxies, ch_it, new_overlay->GetChildren()) {
942  if ((*ch_it)->GetOrder() >= new_order) {
943  new_order = (*ch_it)->GetOrder() + 1;
944  }
945  }
946  subtrack_proxy->SetOrder(new_order);
947  new_overlay->GetChildren().push_back(subtrack_proxy);
949  CRef<CHistParams> overlay_params = conf_mgr->GetHistParams(m_Source);
950  UpdateSource(new_overlay);
951  conf_mgr->AddTempSettings(m_Source, overlay_params);
952  p_track->RemoveTrack(new_track_proxy->GetOrder());
953  p_track->RemoveTrack(current_track_proxy->GetOrder());
954 
955  p_track->AddNewTrack(dynamic_cast<CTrackProxy*>(new_overlay.GetPointer()));
956 
957  return true;
958 }
959 
961 {
962  if (self_proxy == 0) {
963  CTrackContainer* p_track = dynamic_cast<CTrackContainer*>(GetParentTrack());
964  if (!p_track)
965  return;
966  TTrackProxies::iterator t_it = p_track->GetSubtrackProxies().begin();
967  while (t_it != p_track->GetSubtrackProxies().end() && (*t_it)->GetOrder() != GetOrder())
968  ++t_it;
969  if (t_it == p_track->GetSubtrackProxies().end())
970  return;
971  self_proxy = *t_it;
972  }
973  _ASSERT(self_proxy);
974  vector<string> subtracks;
976  {
977  string id = NcbiEmptyString;
978  if (!(*iter)->GetId().empty())
979  subtracks.push_back((*iter)->GetId());
980  else if (!(*iter)->GetUId().empty()) {
981  subtracks.push_back((*iter)->GetUId());
982  } else {
983  CTrackProxy* proxy = dynamic_cast<CTrackProxy*>(&**iter);
984  if (proxy && !proxy->GetAnnots().empty()) // subtracks with multiple annots are not expected
985  subtracks.push_back(proxy->GetAnnots().front());
986  else if (!(*iter)->GetSource().empty())
987  subtracks.push_back((*iter)->GetSource());
988  }
989  }
990  string source = "graphs";
991  if (!subtracks.empty()) {
992  sort(subtracks.begin(), subtracks.end());
993  source += ":";
994  source += NStr::Join(subtracks, "-");
995  }
996  m_Source = source;
997  self_proxy->SetSource(m_Source);
998 }
999 
1000 
1002 {
1003  CTrackContainer* p_track = dynamic_cast<CTrackContainer*>(GetParentTrack());
1004  if (!p_track)
1005  return;
1006  CRef<CTempTrackProxy> proxy(0);
1008  if ((*t_it)->GetOrder() == track_id) {
1009  proxy = *t_it;
1010  break;
1011  }
1012  }
1013  if (!proxy)
1014  return;
1015  CTrackProxy* overlay_proxy = 0;
1016 
1018  {
1019  if ((*iter)->GetOrder() == GetOrder()) {
1020  overlay_proxy= dynamic_cast<CTrackProxy*>(&**iter);
1021  break;
1022  }
1023  }
1024  _ASSERT(overlay_proxy);
1025  if (!overlay_proxy)
1026  return;
1027 
1028 // CRef<CTempTrackProxy> new_track = proxy->Clone();
1029 // CTrackProxy* new_track_proxy = dynamic_cast<CTrackProxy*>(new_track.GetPointer());
1030 // _ASSERT(new_track_proxy);
1031 // int new_order = p_track->GetSubtrackProxies().back()->GetOrder() + 1;
1032  // new_track->SetOrder(new_order);
1033  int new_order = 1;
1034  ITERATE(TTrackProxies, ch_it, p_track->GetSubtrackProxies())
1035  {
1036  if ((*ch_it)->GetOrder() >= new_order) {
1037  new_order = (*ch_it)->GetOrder() + 1;
1038  }
1039  }
1040 
1041  ERASE_ITERATE(CTrackProxy::TTrackProxies, it, overlay_proxy->GetChildren()) {
1042  if ((*it)->GetOrder() == track_id) {
1043  VECTOR_ERASE(it, overlay_proxy->GetChildren());
1044  break;
1045  }
1046  }
1047 
1048  RemoveTrack(track_id);
1050  CRef<CHistParams> old_params = conf_mgr->GetHistParams(m_Source);
1051  UpdateSource();
1052  conf_mgr->AddTempSettings(m_Source, old_params);
1053 
1054  CRef<CTrackProxy> n_proxy(new CTrackProxy());// new_order, proxy->GetName(), true, "graph_track", NcbiEmptyString));
1055  n_proxy->CTempTrackProxy::operator=(*proxy);
1056  n_proxy->SetKey("graph_track");
1057  n_proxy->SetOrder(new_order);
1058  n_proxy->SetTrack(proxy->GetTrack());
1059  n_proxy->GetTrack()->SetShowTitle(true);
1060  CGraphTrack* gt = dynamic_cast<CGraphTrack*>(n_proxy->GetTrack());
1061  _ASSERT(gt);
1062  if (gt) {
1063  CTrackProxy::TAnnots annots;
1064  annots.push_back(gt->GetAnnot());
1065  n_proxy->SetAnnots(annots);
1066  gt->SetLayout(CGraphTrack::eLayout_Layered);
1067  }
1068  p_track->AddTrackProxy(n_proxy.GetPointer());
1069 
1070  //p_track->AddNewTrack(new_track_proxy);
1071 
1072  // move the new track right after the overlay
1073  p_track->MoveTrack(new_order, GetOrder() + 1);
1074  x_UpdateMsg();
1075 
1076  if (GetChildren().empty()) {
1077  p_track->RemoveTrack(GetOrder());
1078 
1079  }
1080 }
1081 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
virtual void Update(bool layout_only)
Update content and layout including the bounding box.
Definition: data_track.cpp:52
virtual void SetRegistryPath(const string &path)
Definition: dialog.cpp:59
CFeaturePanelDSType.
CFeaturePanelDS.
void SetDSContext(ISGDataSourceContext *ds_context)
void SetRenderingContext(CRenderingContext *r_cntx)
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
CLayoutGroup & SetGroup()
const CLayoutGroup::TObjectList & GetChildren() const
const CLayoutGroup & GetGroup() const
CLayoutGroup::TObjectList & SetChildren()
void SetLayoutPolicy(ILayoutPolicy *policy)
Set policy on how to deploy the layout of its children.
void OnContextMenu(wxContextMenuEvent &anEvent)
CGraphOverlayEvtHandler(CGraphOverlay *overlay, int track_id)
void x_OnTrackSettings(wxCommandEvent &event)
void x_OnHideTrack(wxCommandEvent &event)
CRef< CGraphOverlay > m_Overlay
void x_OnRemoveTrack(wxCommandEvent &event)
virtual const CTrackTypeInfo & GetThisTypeInfo() const
virtual TTrackMap CreateTracks(SConstScopedObject &object, ISGDataSourceContext *ds_context, CRenderingContext *r_cntx, const SExtraParams &params=SExtraParams(), const TAnnotMetaDataList &src_annots=TAnnotMetaDataList()) const
create a layout track based on the input objects and extra parameters.
virtual CRef< objects::CTrackConfigSet > GetSettings(const string &profile, const TKeyValuePairs &settings, const CTempTrackProxy *track_proxy) const
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
CGraphOverlayFactory()
CGraphOverlayFactory.
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
CGraphOverlay container of the graph_tracks that are dispalyed in overlay mode.
virtual void LH_OnItemDblClick(const string &source_name)
notifies the host about changes of the track.
virtual bool CanDrop(CRef< CLayoutTrack > &track)
CRef< CSimpleLayout > m_StackedLayout
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
void UpdateSource(CTempTrackProxy *self_proxy=0)
virtual void OnTrackSettings(int order)
virtual void x_OnAllJobsFinished()
actions to take on all job finished.
void MoveTrackOut(int track_id)
static CTrackTypeInfo m_TypeInfo
CLayoutTrack required track type info.
virtual void x_RenderContent() const
The content rendering must be implemented in the derived layout tracks.
void x_UpdateContainerParams(CHistParams &params)
CRef< CHistogramGlyph > m_Grid
virtual void x_SaveSettings(const string &preset_style)
save the track settings to a profile string.
string m_Source
The unique name - combination of subtracks annots - is used to access the track setting in registry.
CRef< COverlayLayout > m_OverlayLayout
virtual void GetHTMLActiveAreas(TAreaVector *p_areas) const
Get html active areas.
virtual void x_LoadSettings(const string &, const TKeyValuePairs &settings)
load the track settings.
void x_UpdateTrackSettings(const string &source_name)
virtual CRef< CSeqGlyph > HitTest(const TModelPoint &p)
Hit testing.
virtual void x_OnLayoutChanged()
update the layout.
virtual bool Drop(CRef< CLayoutTrack > &track)
virtual const CTrackTypeInfo & GetTypeInfo() const
void UpdateTrackParams(const string &annot_name)
Close a track.
CLayoutGroup m_Legend
CGraphTrack –.
Definition: graph_track.hpp:55
static const string kOverlayed
Definition: graph_track.hpp:66
void SetConfig(CRef< CHistParams > config)
bool CreateX(wxWindow *parent, wxWindowID id=ID_CHISTCONFIGDLG, const wxString &caption=_("Graph Rendering Options"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
CRef< CHistParams > GetConfig() const
void SetConfigName(const string &name)
void AddSettings(const string &name, CRef< CHistParams > hist_params)
Add a new settings for a given name.
void AddTempSettings(const string &name, CRef< CHistParams > hist_params)
Add a temporary settings for a given name.
bool HasSettings(const string &name) const
Check if there is settings for a given name.
CRef< CHistParams > GetDefHistParams() const
CRef< CHistParams > GetHistParams(TFeatSubtype subtype) const
Get histogram settings using feature subtype.
File Description:
CRgbaColor m_fgNegColor
CRgbaColor m_SmearColorMin
CRgbaColor m_LabelColor
EScale m_StoredScale
stored scale of the underlying data (e.g. as reported by TMS)
static EScale ScaleStrToValue(const string &scale)
static const string & TypeValueToStr(CHistParams::EType type)
static const string & ScaleValueToStr(CHistParams::EScale scale)
CRgbaColor m_RulerColor
EScale m_Scale
requested scale
TModelUnit m_Height
CRgbaColor m_bgColor
CRgbaColor m_fgColor
CRange< float > m_ValueRange
CRgbaColor m_SmearColorMax
void SetAxisMin(TDataType min)
TDataType GetMin() const
void SetAnnotName(const string &name)
void SetAxisMax(TDataType max)
void SetFixedScale(bool value)
virtual void GetHTMLActiveAreas(TAreaVector *p_areas) const
Get html active areas.
TDataType GetMax() const
Get the actually density max/min values.
void SetRenderingMode(ERenderingMode mode)
void DrawGrid(bool include_background) const
void SetConfig(const CSeqGraphicConfig &config)
CLayeredLayout is a standard 2D layout policy.
void PushBack(CSeqGlyph *obj)
Append a layout object to the end.
const TObjectList & GetChildren() const
CLayoutGroup inline methods.
virtual void GetHTMLActiveAreas(TAreaVector *p_areas) const
Get html active areas.
virtual CRef< CSeqGlyph > HitTest(const TModelPoint &p)
Hit testing.
ILayoutPolicy::TObjectList TObjectList
bool m_Expanded
is this track in expanded state
virtual void x_SaveSettings(const string &preset_style)
save the track settings to a profile string.
bool m_On
is this track shown
CLayoutTrack * GetParentTrack()
void x_OnLayoutChanged()
update the layout.
const string & GetId() const
int GetOrder() const
bool x_HitTitleBar(const TModelPoint &p) const
hit the title bar?.
void SetProfile(const string &preset_style)
CLayoutTrack inline method implmentation.
CRef< CSeqGraphicConfig > m_gConfig
global configuration.
CObject –.
Definition: ncbiobj.hpp:180
COverlayLayout is the layout policy that arranges glyphs over the top of each other.
CRenderingContext offers the basic context and utility methods for rendering layout objects in featur...
TModelRange IntersectVisible(const CSeqGlyph *obj) const
TModelUnit SeqToScreen(const TModelUnit &size) const
convert from sequence positions to screen pixels
TModelUnit ScreenToSeq(const TModelUnit &size) const
convert from screen pixels to sequence positions
TSeqPos GetViewWidth() const
static string ComposeProfileString(const TKeyValuePairs &settings)
CRenderingContext * m_Context
the rendering context
Definition: seq_glyph.hpp:346
void x_Parent2Local(TModelPoint &pnt) const
Transform the coordiante from parent coord. to local coord.
Definition: seq_glyph.hpp:710
virtual void SetHeight(TModelUnit h)
Definition: seq_glyph.hpp:650
bool IsIn(const TModelPoint &p) const
Hit test for points in PARENT COORD.
Definition: seq_glyph.hpp:569
virtual void SetWidth(TModelUnit w)
Definition: seq_glyph.hpp:646
virtual void SetLeft(TModelUnit l)
Definition: seq_glyph.hpp:654
virtual TModelUnit GetTop() const
Definition: seq_glyph.hpp:599
virtual TModelUnit GetHeight() const
Definition: seq_glyph.hpp:587
virtual void Update(bool)
Update content and layout including the bounding box.
Definition: seq_glyph.cpp:86
virtual void SetTop(TModelUnit b)
Definition: seq_glyph.hpp:658
void Draw() const
render the layout.
Definition: seq_glyph.cpp:92
virtual TModelUnit GetWidth() const
Definition: seq_glyph.hpp:591
virtual TModelUnit GetLeft() const
Definition: seq_glyph.hpp:595
vector< CHTMLActiveArea > TAreaVector
Definition: seq_glyph.hpp:84
CRef< CHistParamsManager > GetHistParamsManager() const
Get histogram config manager.
CRef< CGlTextureFont > GetLabelFont() const
bool GetCgiMode() const
CSimpleLayout is the simpliest layout policy that simply stack a set of glyphs one on top of the othe...
File Description:
vector< string > TAnnots
virtual CRef< CTempTrackProxy > Clone() const
list< CRef< CTempTrackProxy > > TTrackProxies
void SetSource(const string &src)
const TAnnots & GetAnnots() const
const TTrackProxies & GetChildren() const
void SetOrder(int order)
CTempTrackProxy class implementation.
const string & GetStoredScale() const
const CLayoutTrack * GetTrack() const
CTrackConfigSet –.
static CRef< objects::CChoice > CreateChoice(const string &name, const string &disp_name, const string &curr_val, const string &help, bool optional=false)
Definition: layout_conf.hpp:79
static CRef< objects::CHiddenSetting > CreateHiddenSetting(const string &name, const string &value)
static CRef< objects::CCheckBox > CreateCheckBox(const string &name, const string &disp_n, const string &help_text, const string &legend_txt, bool value, bool optional=false)
Definition: layout_conf.hpp:96
static CRef< objects::CRangeControl > CreateRangeControl(const string &name, const string &disp_name, const string &help, const string &value_min, const string &value_max, bool autoscale=true, bool inverse=false, bool optional=false)
static void DecodeValueRange(const string &value_range, string &range_min, string &range_max, bool &range_auto)
static CRef< objects::CChoiceItem > CreateChoiceItem(const string &name, const string &disp_name, const string &help, const string &legend_txt, bool optional=false)
Definition: layout_conf.hpp:61
CTrackConfig –.
Definition: TrackConfig.hpp:66
CTrackContainer - a track container in the form of layout track.
void SetSkipGenuineCheck(bool flag)
const TTrackProxies & GetSubtrackProxies() const
CTrackContainer inline methods.
void AddTrackProxy(CTempTrackProxy *proxy, bool upgateMsg=true)
Add a track proxy.
CTrackProxy * AddNewTrack(const string &track_key, const CTrackProxy::TAnnots &annots, const string &disp_name, const string &name="", const string &filter="", const string &sub_key="")
Add a new empty track proxy.
virtual void OnToggleTrack(int order)
void SetAdaptive(bool flag)
void SetAnnotLevel(int level)
void x_UpdateMsg()
udpate message in track title bar.
virtual void RemoveTrack(int order, bool immediately=true)
completely remove a track from the hierachical tree.
void MoveTrack(int from, int to)
CTempTrackProxy::TTrackProxies TTrackProxies
TTrackProxies m_TrackProxies
all the tracks including on and off.
virtual void x_OnAllJobsFinished()
actions to take on all job finished.
CTrackProxy data structure contains information about the position of a track in its parent scope,...
CTrackTypeInfo - holds description of a layout track type.
const string & GetDescr() const
const string & GetId() const
static CUICommandRegistry & GetInstance()
the main instance associated with the application
Definition: ui_command.cpp:176
ISGDSManager is seqgraphic data source manage that serves as an data source context.
virtual CIRef< ISGDataSource > GetDS(const string &type, SConstScopedObject &object)=0
Get a seqgraphic data source instance of the specified type.
void(*)(CSeq_entry_Handle seh, IWorkbench *wb, const CSerialObject &obj) handler
struct config config
char data[12]
Definition: iconv.c:80
USING_SCOPE(objects)
static const int kLegendBarWidth
static const string kStacked
static const int kLegendLabelGap
static const string kValueRange
static const int kLegenPadding
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define ERASE_ITERATE(Type, Var, Cont)
Non-constant version with ability to erase current element, if container permits.
Definition: ncbimisc.hpp:843
#define VECTOR_ERASE(Var, Cont)
Use this macro inside body of ERASE_ITERATE cycle to erase from vector-like container.
Definition: ncbimisc.hpp:852
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#define NULL
Definition: ncbistd.hpp:225
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
#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
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
GLdouble TModelUnit
Definition: gltypes.hpp:48
IRender & GetGl()
convenience function for getting current render manager
virtual TModelUnit TextHeight(const CGlTextureFont *font) const =0
virtual TModelUnit TextWidth(const CGlTextureFont *font, const char *text) const =0
string ToString(bool printAlpha=true, bool uchars=true) const
Return a string representation of the current color.
Definition: rgba_color.cpp:309
void FromString(const string &str)
Assign color values encoded in a string.
Definition: rgba_color.cpp:363
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
Definition: ncbiobj.hpp:2015
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
position_type GetLength(void) const
Definition: range.hpp:158
static position_type GetEmptyFrom(void)
Definition: range.hpp:290
TThisType & Set(position_type from, position_type to)
Definition: range.hpp:188
static position_type GetEmptyTo(void)
Definition: range.hpp:298
bool Empty(void) const
Definition: range.hpp:148
#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:2812
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
Definition: ncbistr.cpp:630
static const string BoolToString(bool value)
Convert bool to string.
Definition: ncbistr.cpp:2806
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
Definition: ncbistr.hpp:2699
#define NcbiEmptyString
Definition: ncbistr.hpp:122
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5347
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
@ fConvErr_NoThrow
Do not throw an exception on error.
Definition: ncbistr.hpp:285
static const char label[]
void SetFrom(TFrom value)
Assign a value to From data member.
Definition: Range_.hpp:231
TTo GetTo(void) const
Get the To member data.
Definition: Range_.hpp:269
TFrom GetFrom(void) const
Get the From member data.
Definition: Range_.hpp:222
void SetTo(TTo value)
Assign a value to To data member.
Definition: Range_.hpp:278
Tdata & Set(void)
Assign a value to data member.
sat & gt
END_EVENT_TABLE()
constexpr auto sort(_Init &&init)
constexpr bool empty(list< Ts... >) noexcept
const CharType(& source)[N]
Definition: pointer.h:1149
T max(T x_, T y_)
T min(T x_, T y_)
@ eCmdTrackSettings
@ eCmdRemoveTrackFromOverlay
@ eCmdHideTrack
ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN
#define row(bind, expected)
Definition: string_bind.c:73
extra parameter for initializing a track.
bool m_Adaptive
Adaptive/Exact selector.
TAnnots m_Annots
particular annotations the track will be looking at.
int m_Level
layout level that limits feature retrieving used by annotation selector.
bool m_SkipGenuineCheck
Flag indicating if track verification is required.
CHistParams * params
#define _ASSERT
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
Definition: thrddgri.c:44
#define WX_DEFINE_MENU(name)
New macros for defining menus for use with CUICommandRegistry.
Definition: ui_command.hpp:266
#define WX_END_MENU()
Definition: ui_command.hpp:294
#define WX_MENU_ITEM(cmd)
Definition: ui_command.hpp:270
wxMenu * CreateMenu(const CMenuItem *item)
Creates a wxMenu object replicating the structure of CMenuItem.
Definition: wx_utils.cpp:365
#define const
Definition: zconf.h:232
Modified on Fri Sep 20 14:57:54 2024 by modify_doxy.py rev. 669887