, m_HighlightsColor(0.4f, 0.4f, 0.4f, 1.0f)
57, m_MinLabelSizePos(1.0)
79vector<CVect2<float> > vb;
81 floatstep = 3.141592653589793238463f / 8;
85 for(
int i= 0;
i< 7; ++
i) {
86 floatcosf = cos(
f), sinf = sin(
f);
166 boolshade_vert)
const 180gl.
Begin(GL_QUADS);
204 boolneg_strand)
const 208 TModelUnit t= neg_strand ? p.
X() - 1.0 : p.
X() + size_x - 1.0;
215GLint from, GLint to)
const 221 const doublePI_180 = 3.1415926 / 180.0;
225gl.
Begin(GL_TRIANGLE_FAN);
228 for(;
f<
t+ step * 0.02;
f+= step) {
230p.
Y() -
r* sin(
f));
238 boolneg_strand)
const 243add = neg_strand ? -add : add;
263gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
289gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
300m(1, 1) = (float)(
size- 0.5);
303m(1, 3) = center.
Y();
313m(1, 1) = (float)
size;
326 boolneed_neck)
const 330 TModelUnitadd_x = neg_strand ? off_x : (-off_x);
343p.
X() + add_x * 1.5
, p.
Y());
347gl.
Begin(GL_TRIANGLES);
376 TModelUnitadd_x = neg_strand ? off_x : (-off_x);
378 DrawLine(p.
X(), p.
Y(), p.
X() + add_x, p.
Y() - off_y);
379 DrawLine(p.
X(), p.
Y(), p.
X() + add_x, p.
Y() + off_y);
380 DrawLine(p.
X(), p.
Y(), p.
X() + add_x * 1.5, p.
Y());
392gl.
Begin(GL_TRIANGLE_STRIP);
400gl.
Begin(GL_TRIANGLES);
416gl.
Begin(GL_LINE_LOOP);
441gl.
Begin(GL_LINES);
477 DrawLine(x1, y1 + y_off, x1, y2 + y_off);
491gl.
Begin(GL_TRIANGLE_STRIP);
529 DrawLine(x1, y1 + y_off, x1, y2 + y_off);
541 intsteps = (y2-y1)/
delta;
548gl.
Begin(GL_LINES);
549 for(
int i=0;
i<steps;
i++) {
550gl.
Color4f(c1.
X(), c1.
Y(), c1.
Z(), c1.
W());
579 TModelUnitmid = line_y1 + (line_y2 - line_y1) * 0.5f;
586gl.
Begin(GL_TRIANGLES);
612 DrawLine(pos_x, line_y1, pos_x + add, line_y1);
613 DrawLine(pos_x, line_y1, pos_x + add, mid);
615 DrawLine(pos_x, line_y2, pos_x + add, line_y2);
616 DrawLine(pos_x, line_y2, pos_x + add, mid);
632 DrawRect(x1 - padding_x, y1 + padding_y, x2 + padding_x, y2 - padding_y);
644gl.
Begin(GL_LINE_LOOP);
677 boolsingle_indicator_center,
678 constvector<TModelRange> *labels_ranges)
const 688 if(start_x < min_v) {
690length -= start_x - start.
X();
692 if(start_x + length > max_v) {
693length = max_v - start_x;
696 intstrand_sign = neg_strand ? -1 : 1;
706 intnum = (
int)floor(length / apart - 0.15) + 1;
707 TModelUnitoff = (length - apart * (num - 1)) * 0.5 - strand_sign * w2 * 0.5;
714 for(
int i= 0;
i< num; ++
i) {
720 if(num % 2 == 1 &&
i== (num - 1) / 2) {
721 if(avoid_center || (single_indicator_center && num > 1)) {
726 if(!single_indicator_center) {
727curr_color.
Darken(
i% 3 * 0.12f);
730curr_color.
Darken(0.12f);
734curr_color.
Darken(
i% 3 * 0.12f);
738 ITERATE(vector<TModelRange>, it_rng, *labels_ranges) {
741 TModelRangeind_range(ind_from < ind_to ? ind_from : ind_to, ind_from < ind_to ? ind_to : ind_from);
742 if(it_rng->IntersectingWith(ind_range)) {
754gl.
Begin(GL_TRIANGLE_STRIP);
755gl.
Vertex2d(off_x + 0.0, off_y + size_y2);
756gl.
Vertex2d(off_x + size_x2 , off_y + size_y1);
757gl.
Vertex2d(off_x + size_x1, off_y + size_y1);
771 TModelUnittri_w = (size_h - two_pixel_w) * 0.5;
773 const char*
label=
"5'";
782rect.
SetTop(y - size_v);
784label_x = x + two_pixel_w;
789rect.
SetTop(y + size_v);
791label_x = x - size_h + tri_w - two_pixel_w * 0.5;
792label_y = y + size_v - 1.0;
798 DrawTriangle(corner_x, y, corner_x, y - tri_h, corner_x - tri_w, y);
800 DrawTriangle(corner_x, corner_y, corner_x - tri_w, corner_y, corner_x, corner_y + tri_h);
803 DrawTriangle(corner_x, y, corner_x, y + tri_h, corner_x + tri_w, y);
805 DrawTriangle(corner_x, corner_y, corner_x + tri_w, corner_y, corner_x, corner_y - tri_h);
819glGetIntegerv(GL_CURRENT_PROGRAM, &prev_shader);
823gl.
Begin(GL_TRIANGLE_STRIP);
833gl.
Enable(GL_LINE_SMOOTH);
847 boolneed_line =
true;
851 color= all_pos.count(pos) > 1 ? c_dark : c_light;
855need_line = all_pos.count(pos) == 1;
859need_line = all_pos.count(pos) >= 2;
863need_line = all_pos.count(pos) == total;
874gl.
Enable(GL_LINE_SMOOTH);
898gl.
Begin(GL_LINE_LOOP);
899 if(compressed_mode) {
911 if(!compressed_mode) {
915 TextOut(&font,
"pA", (x1 + x2) * 0.5, y2 - 2,
true);
922gl.
Begin(GL_LINE_STRIP);
960 DrawLine(x1, y1 + y_off, x1, y2 + y_off);
968gl.
Begin(GL_TRIANGLE_STRIP);
973 while(xoff+
delta<= x2-x1) {
988 if(x1 + xoff < x2) {
1012gl.
Color4f(0.3f, 0.1f, 0.1f, 0.7f);
1014gl.
Color4f(1.0f, 1.0f, 1.0f, 0.7f);
1018gl.
Begin(GL_TRIANGLES);
1038gl.
Color4f(0.3f, 0.1f, 0.1f, 0.3f);
1040gl.
Color4f(1.0f, 1.0f, 1.0f, 0.3f);
1048gl.
Begin(GL_TRIANGLES);
1071 boolp_start,
boolp_stop,
1077 if(x2 - x1 < tex_len)
return;
1083 if(p_stop && (!p_start || (x2 - x1) > 2.0 * tex_len)) {
1116gl.
Begin(GL_QUADS);
1121gl.
Vertex3d(right, top - band_w, 0.0);
1122gl.
Vertex3d(left, top - band_w, 0.0);
1127gl.
Vertex3d(left, bottom + band_w, 0.0);
1128gl.
Vertex3d(right, bottom + band_w, 0.0);
1134gl.
Vertex3d(left - band_w_x, top, 0.0);
1135gl.
Vertex3d(left - band_w_x, bottom, 0.0);
1140gl.
Vertex3d(right + band_w_x, top, 0.0);
1141gl.
Vertex3d(right + band_w_x, bottom, 0.0);
1146gl.
Vertex3d(left, top - band_w, 0.0);
1147gl.
Vertex3d(left - band_w_x, top - band_w, 0.0);
1148gl.
Vertex3d(left - band_w_x, top, 0.0);
1152gl.
Vertex3d(right + band_w_x, top, 0.0);
1153gl.
Vertex3d(right + band_w_x, top - band_w, 0.0);
1154gl.
Vertex3d(right, top - band_w, 0.0);
1159gl.
Vertex3d(left, bottom + band_w, 0.0);
1160gl.
Vertex3d(left - band_w_x, bottom + band_w, 0.0);
1161gl.
Vertex3d(left - band_w_x, bottom, 0.0);
1165gl.
Vertex3d(right + band_w_x, bottom, 0.0);
1166gl.
Vertex3d(right + band_w_x, bottom + band_w, 0.0);
1167gl.
Vertex3d(right, bottom + band_w, 0.0);
1178 boolcenter,
booladjust_flip)
const 1185x +=
m_bHorz? -width * 0.5 : width * 0.5;
1189x +=
m_bHorz? width : -width;
1200 boolcenter,
booladjust_flip)
const 1205x +=
m_bHorz? -width * 0.5 : width * 0.5;
1209x +=
m_bHorz? width : -width;
1221gl.
Begin(GL_LINES);
CGlAttrGuard - guard class for restoring OpenGL attributes.
bool GetIsDrawn(const string &sPName) const
TModelRange m_LimitRange
Model limits.
virtual ~CRenderingContext()
void DrawDisk(const TModelPoint &p, TModelUnit radius, GLint from=0, GLint to=360) const
void PrepareContext(CGlPane &pane, bool horz, bool flipped)
void TextOut(const CGlTextureFont *font, const char *text, TModelUnit x, TModelUnit y, bool center, bool adjust_flip=true) const
CRgbaColor m_HighlightsColor
static const int kLabelSpacePx
extra space for side labeling, in screen pixels
bool m_bHorz
orientation.
TModelUnit m_MinLabelSizePos
minimum label size, in sequence coordinates
void DrawTriangle(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, TModelUnit x3, TModelUnit y3, bool border=false) const
void Draw3DFletch(TModelUnit pos_x, TModelUnit line_y1, TModelUnit line_y2, TModelUnit tail_height, const CRgbaColor &color, bool neg_strand) const
void DrawPseudoBar(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, const CRgbaColor &light_color, const CRgbaColor &dark_color) const
void DrawHighlight(const TModelRect &rect, const CRgbaColor *color=0) const
CGlPane * m_Pane
What we drawing on.
void DrawShadedQuad(const TModelRect &rcm, const CRgbaColor &c1, const CRgbaColor &c2, bool shade_vert=true) const
void DrawArrowBoundary(TModelUnit x1, TModelUnit x2, TModelUnit x3, TModelUnit line_center, TModelUnit bar_h, TModelUnit head_h) const
TModelRange IntersectVisible_Y(const TModelRange &r) const
inttersect with the vertical visible screen space.
void Draw3DQuad_HorzLines(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, const CRgbaColor &color, bool border=false) const
TModelRange m_VisRange
Model visible limits.
void DrawArrow(TModelUnit x1, TModelUnit x2, TModelUnit x3, TModelUnit line_center, TModelUnit bar_h, TModelUnit head_h) const
void DrawHairLine(int opt, size_t total, const multiset< TSeqPos > &all_pos, TSeqPos pos, TModelUnit line_y, const CRgbaColor &c_light, const CRgbaColor &c_dark) const
void DrawUnalignedTail(TModelUnit x1, TModelUnit x2, TModelUnit y1, TModelUnit y2, bool is_polya, const CRgbaColor &color) const
void DrawLine(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2) const
void DrawRect(const TModelRect &rc) const
void DrawQuad(const TModelRect &rc, bool border=false) const
const TModelUnit & GetScale() const
TSeqRange m_VisSeqRange
Visilble sequence range.
void DrawSelection(const TModelRect &rc) const
CIRef< IVboGeom > m_GlyphGeom
void DrawPartialBar(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, bool p_start, bool p_stop, bool loc) const
TModelUnit ScreenToSeq(const TModelUnit &size) const
convert from screen pixels to sequence positions
CGlBitmapFont m_Font_Helv10
fonts.
void DrawDisk2(const TModelPoint &p, TModelUnit size, CRgbaColor color)
void DrawSquare(const TModelPoint &p, TModelUnit size, const CRgbaColor &color, bool neg_strand) const
void Draw3DArrow(const TModelPoint &p, TModelUnit size, bool neg_strand) const
void Draw3DQuad(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, const CRgbaColor &color, bool border=false) const
void DrawTexture(const TModelRect &rc, const TModelRect &rc_coord) const
void SetIsDrawn(const string &sPName, bool isDrawn)
void Draw3DTriangle(const TModelPoint &p, TModelUnit size, const CRgbaColor &color, bool neg_strand, bool need_neck) const
void DrawPartialBarMark(TModelUnit x1, TModelUnit y1, TModelUnit y2, bool loc, TModelUnit dir=1.0) const
Draw partial feature indicator.
void DrawBackground(const TModelRect &rcm, TModelUnit border) const
void DrawStrandIndicators(const TModelPoint &start, TModelUnit length, TModelUnit apart, TModelUnit size, const CRgbaColor &color, bool neg_strand, bool avoid_center=false, bool single_indicator_center=false, const vector< TModelRange > *labels_ranges=nullptr) const
void Draw5Prime(TModelUnit x, TModelUnit y, bool direct, TModelUnit size_h, TModelUnit size_v) const
void DrawGreaterLessSign(TModelUnit x1, TModelUnit x2, TModelUnit bar_h, bool negative) const
class CRgbaColor provides a simple abstraction for managing colors.
iterator_bool insert(const value_type &val)
Include a standard set of the NCBI C++ Toolkit most basic headers.
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
const T * GetData() const
virtual bool IsSimplified() const =0
void Color4fv(const GLfloat *v)
static CGlResMgr & Instance()
virtual void Enable(GLenum glstate)=0
virtual void TextOut(const char *text) const
virtual void UseProgram(GLuint program)=0
For shaders. Only works with OpenGL 2.0+.
virtual void Begin(GLenum mode)=0
Start rendering.
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)=0
Options to be used when GL_BLEND is enabled.
virtual CMatrix4< float > GetModelViewMatrix() const =0
virtual void LineJoinStyle(IGlState::ELineJoinStyle s)=0
PDF-specific rendering state.
IRender & GetGl()
convenience function for getting current render manager
void Vertex2d(GLdouble x, GLdouble y)
virtual void BeginText(const CGlTextureFont *font, const CRgbaColor &color)=0
Text is drawn is pixel coordinates.
virtual void PdfShadeStyle(IGlState::EPdfShadeStyle s)=0
Set (override defualt) shading style for polygons.
virtual TModelUnit TextWidth(const CGlTextureFont *font, const char *text) const =0
TModelUnit GetOffsetY() const
bool IsEnabled(GLenum glstate) const
Return true if option is in m_Enabled list for this state.
virtual void EndText()=0
Pops matrices and attributes after writing text.
virtual TModelUnit TextWidth(const char *text) const
compute the length of a null-terminated string
TModelRect & GetModelLimitsRect(void)
virtual void ShadeModel(GLenum mode)=0
Set shade model for default lighting: glShadeModel(GL_FLAT or GL_SMOOTH)
virtual void End()=0
Finish rendering (create buffer and send to renderer)
void Inflate(T d_x, T d_y)
virtual void PolygonMode(GLenum face, GLenum mode)=0
Set the polygon rasterization mode.
void TexCoord2d(GLdouble s, GLdouble t)
void Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
virtual void WriteText(TModelUnit x, TModelUnit y, const char *text, TModelUnit rotate_degrees=0.0)=0
Write text at specified model coords.
TModelRect & GetVisibleRect(void)
void Vertex3d(GLdouble x, GLdouble y, GLdouble z)
virtual void Disable(GLenum glstate)=0
glDisable()
virtual void LineWidth(GLfloat w)=0
Set line width for drawing: glLineWidth()
TModelUnit GetScaleX(void) const
TModelUnit GetScaleY(void) const
TModelUnit GetOffsetX() const
virtual CRef< CGlState > GetState()=0
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)
@ eFontFace_Helvetica_Bold
float GetBlue(void) const
float GetGreen(void) const
float GetAlpha(void) const
void Lighten(float scale)
float GetRed(void) const
Get specific channels in floating point values.
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null â same effect as Empty().
TThisType IntersectionWith(const TThisType &r) const
TThisType & Set(position_type from, position_type to)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static const char label[]
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
unsigned int
A callback function used to compare two keys in a database.
static void text(MDB_val *v)
const struct ncbi::grid::netcache::search::fields::SIZE size
Int4 delta(size_t dimension_, const Int4 *score_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static const float kMinBarHeight
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