: m_MinColor(1.0f, 1.0f, 1.0f),
44m_MaxColor(0.0f, 0.0f, 0.0f),
97 const static doublekMaxRatio = 4.0;
98 const static doublekRatio = 2.0;
109 booloutside = vis_start < start || vis_stop > (stop + 1);
111 TModelUnitratio = (vis_stop - vis_start) / (stop - start + 1);
112 boolbad_scale = ratio > kMaxRatio || ratio < (1 / kMaxRatio);
114 if(outside || bad_scale) {
116 TModelUnitcenter = (vis_start + vis_stop) / 2;
117 TModelUnitrange = (vis_stop - vis_start) * kRatio;
120range =
min(range, max_pos);
122new_start = center - range / 2;
123new_stop = new_start + range;
126new_stop = new_start + range;
127}
else if(new_stop > max_pos) {
129new_start = new_stop - range;
144 CGlAttrGuardguard(GL_LINE_BIT | GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT );
148gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
171 for(
auto i= 0;
i<
count;
i++ ) {
173 doublenorm = (max_v > 0.00001) ? (
value/ max_v) : 0;
178 doublepos = start +
i* d;
181gl.
Rectd(x1, z1, x1 + d, z2);
184gl.
Rectd(z1, y1, z2, y1 + d);
196 static const intkGraphSize = 12;
197 return TVPPoint(kGraphSize, kGraphSize);
CGlAttrGuard - guard class for restoring OpenGL attributes.
virtual ~CHistogramGraph()
CHistogramGraph(bool b_horz)
virtual bool NeedTooltip(CGlPane &pane, int vp_x, int vp_y)
void SetProperties(const SProperties &props)
virtual IHistogramGraphDS * GetDataSource()
CIRef< IHistogramGraphDS > m_DataSource
virtual string GetTooltip()
CRgbaGradColorTable m_ColorTable
virtual TVPPoint PreferredSize()
virtual void x_RenderHistogram(CGlPane &pane)
virtual void SetDataSource(IHistogramGraphDS *ds)
virtual void Render(CGlPane &pane)
const SProperties & GetProperties() const
class CRgbaColor provides a simple abstraction for managing colors.
IHistogramGraphDS interface.
virtual void Enable(GLenum glstate)=0
CGlPoint< TVPUnit > TVPPoint
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)=0
Options to be used when GL_BLEND is enabled.
IRender & GetGl()
convenience function for getting current render manager
void RectC(const TVPRect &rc)
TModelUnit GetOffsetY() const
void SetSize(size_t size)
void FillGradient(const CRgbaColor &start_c, const CRgbaColor &end_c)
initialize the whole table with gradient colors in [start_c, end_c] range
bool PtInRect(T x, T y) const
virtual void PolygonMode(GLenum face, GLenum mode)=0
Set the polygon rasterization mode.
int GetIndex(double norm) const
returns color index by the normalized value; normalized values is a value in the [0....
TModelRect & GetVisibleRect(void)
virtual void Disable(GLenum glstate)=0
glDisable()
TModelUnit GetOffsetX() const
virtual void ColorC(const CRgbaColor &c)=0
Set current color (glColor{3,4}{f,d}{v,})
void Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
CRgbaColor & GetColor(size_t i)
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const GenericPointer< typename T::ValueType > T2 value
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4