NCBI C++ ToolKit
histogram_graph.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_GL___HISTOGRAM_GRAPH__HPP
2 #define GUI_WIDGETS_GL___HISTOGRAM_GRAPH__HPP
3 
4 /* $Id: histogram_graph.hpp 24846 2011-12-09 20:52:39Z wuliangs $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistl.hpp>
36 
37 #include <gui/opengl/glpane.hpp>
41 
43 
44 
45 ///////////////////////////////////////////////////////////////////////////////
46 /// IHistogramGraphDS interface
48 {
49 public:
50  virtual ~IHistogramGraphDS() {};
51 
52  /// returns start of the series in model space
53  virtual double GetLimit() const = 0;
54 
55  virtual double GetStart() const = 0;
56  virtual double GetStop() const = 0;
57 
58  /// discrete size in model space
59  virtual double GetStep() const = 0;
60 
61  /// number of samples in the series
62  virtual size_t GetCount() const = 0;
63 
64  /// value of the sample with the given index
65  virtual double GetValue(size_t index) = 0;
66 
67  virtual double GetMaxValue() = 0;
68 
69  virtual string GetLabel() const = 0;
70 
71  virtual void Update(double start, double stop) = 0;
72 };
73 
74 
75 ///////////////////////////////////////////////////////////////////////////////
76 /// CHistogramGraph
77 
79  public CObject,
80  public CRenderableImpl
81 {
82 public:
84  public:
87  int m_Margin;
88 
89  SProperties();
90  };
91 
92  CHistogramGraph(bool b_horz);
93  virtual ~CHistogramGraph();
94 
95  virtual void SetDataSource(IHistogramGraphDS* ds);
96  virtual IHistogramGraphDS* GetDataSource();
97  virtual const IHistogramGraphDS* GetDataSource() const;
98 
99  /// @name IRenderable implemenation
100  /// @{
101  virtual void Render(CGlPane& pane);
102 
103  virtual TVPPoint PreferredSize();
104 
105  virtual bool NeedTooltip(CGlPane& pane, int vp_x, int vp_y);
106  virtual string GetTooltip();
107  /// @}
108 
109 
110  const SProperties& GetProperties() const;
111  void SetProperties(const SProperties& props);
112 
113 protected:
114  virtual void x_RenderHistogram(CGlPane& pane);
115 
116 protected:
117  bool m_Horz;
121 };
122 
123 
125 
126 #endif // GUI_WIDGETS_GL___HISTOGRAM_GRAPH__HPP
class CGlPane
Definition: glpane.hpp:62
CHistogramGraph.
CIRef< IHistogramGraphDS > m_DataSource
CRgbaGradColorTable m_ColorTable
SProperties m_Properties
CObject –.
Definition: ncbiobj.hpp:180
CRenderableImpl.
Definition: irenderable.hpp:82
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
CRgbaGradColorTable Provides a storage for colors (to eliminate color creation overhead) and Function...
IHistogramGraphDS interface.
virtual ~IHistogramGraphDS()
virtual double GetStart() const =0
virtual double GetStop() const =0
virtual void Update(double start, double stop)=0
virtual double GetMaxValue()=0
virtual double GetValue(size_t index)=0
value of the sample with the given index
virtual double GetStep() const =0
discrete size in model space
virtual string GetLabel() const =0
virtual double GetLimit() const =0
returns start of the series in model space
virtual size_t GetCount() const =0
number of samples in the series
#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 NCBI_GUIWIDGETS_GL_EXPORT
Definition: gui_export.h:529
The NCBI C++/STL use hints.
Modified on Tue Jun 18 13:37:25 2024 by modify_doxy.py rev. 669887