A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/rendering__ctx_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/seq_graphic/rendering_ctx.cpp Source File

56

, m_HighlightsColor(0.4f, 0.4f, 0.4f, 1.0f)

57

, m_MinLabelSizePos(1.0)

79

vector<CVect2<float> > vb;

81  float

step = 3.141592653589793238463f / 8;

85  for

(

int i

= 0;

i

< 7; ++

i

) {

86  float

cosf = cos(

f

), sinf = sin(

f

);

166  bool

shade_vert)

const 180

gl.

Begin

(GL_QUADS);

204  bool

neg_strand)

const 208  TModelUnit t

= neg_strand ? p.

X

() - 1.0 : p.

X

() + size_x - 1.0;

215

GLint from, GLint to)

const 221  const double

PI_180 = 3.1415926 / 180.0;

225

gl.

Begin

(GL_TRIANGLE_FAN);

228  for

(;

f

<

t

+ step * 0.02;

f

+= step) {

230

p.

Y

() -

r

* sin(

f

));

238  bool

neg_strand)

const 243

add = neg_strand ? -add : add;

263

gl.

BlendFunc

(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

289

gl.

BlendFunc

(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

300

m(1, 1) = (float)(

size

- 0.5);

303

m(1, 3) = center.

Y

();

313

m(1, 1) = (float)

size

;

326  bool

need_neck)

const 330  TModelUnit

add_x = neg_strand ? off_x : (-off_x);

343

p.

X

() + add_x * 1.5

, p.

Y

());

347

gl.

Begin

(GL_TRIANGLES);

376  TModelUnit

add_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

());

392

gl.

Begin

(GL_TRIANGLE_STRIP);

400

gl.

Begin

(GL_TRIANGLES);

416

gl.

Begin

(GL_LINE_LOOP);

441

gl.

Begin

(GL_LINES);

477  DrawLine

(x1, y1 + y_off, x1, y2 + y_off);

491

gl.

Begin

(GL_TRIANGLE_STRIP);

529  DrawLine

(x1, y1 + y_off, x1, y2 + y_off);

541  int

steps = (y2-y1)/

delta

;

548

gl.

Begin

(GL_LINES);

549  for

(

int i

=0;

i

<steps;

i

++) {

550

gl.

Color4f

(c1.

X

(), c1.

Y

(), c1.

Z

(), c1.

W

());

579  TModelUnit

mid = line_y1 + (line_y2 - line_y1) * 0.5f;

586

gl.

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);

644

gl.

Begin

(GL_LINE_LOOP);

677  bool

single_indicator_center,

678  const

vector<TModelRange> *labels_ranges)

const 688  if

(start_x < min_v) {

690

length -= start_x - start.

X

();

692  if

(start_x + length > max_v) {

693

length = max_v - start_x;

696  int

strand_sign = neg_strand ? -1 : 1;

706  int

num = (

int

)floor(length / apart - 0.15) + 1;

707  TModelUnit

off = (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) {

727

curr_color.

Darken

(

i

% 3 * 0.12f);

730

curr_color.

Darken

(0.12f);

734

curr_color.

Darken

(

i

% 3 * 0.12f);

738  ITERATE

(vector<TModelRange>, it_rng, *labels_ranges) {

741  TModelRange

ind_range(ind_from < ind_to ? ind_from : ind_to, ind_from < ind_to ? ind_to : ind_from);

742  if

(it_rng->IntersectingWith(ind_range)) {

754

gl.

Begin

(GL_TRIANGLE_STRIP);

755

gl.

Vertex2d

(off_x + 0.0, off_y + size_y2);

756

gl.

Vertex2d

(off_x + size_x2 , off_y + size_y1);

757

gl.

Vertex2d

(off_x + size_x1, off_y + size_y1);

771  TModelUnit

tri_w = (size_h - two_pixel_w) * 0.5;

773  const char

*

label

=

"5'"

;

782

rect.

SetTop

(y - size_v);

784

label_x = x + two_pixel_w;

789

rect.

SetTop

(y + size_v);

791

label_x = x - size_h + tri_w - two_pixel_w * 0.5;

792

label_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);

819

glGetIntegerv(GL_CURRENT_PROGRAM, &prev_shader);

823

gl.

Begin

(GL_TRIANGLE_STRIP);

833

gl.

Enable

(GL_LINE_SMOOTH);

847  bool

need_line =

true

;

851  color

= all_pos.count(pos) > 1 ? c_dark : c_light;

855

need_line = all_pos.count(pos) == 1;

859

need_line = all_pos.count(pos) >= 2;

863

need_line = all_pos.count(pos) == total;

874

gl.

Enable

(GL_LINE_SMOOTH);

898

gl.

Begin

(GL_LINE_LOOP);

899  if

(compressed_mode) {

911  if

(!compressed_mode) {

915  TextOut

(&font,

"pA"

, (x1 + x2) * 0.5, y2 - 2,

true

);

922

gl.

Begin

(GL_LINE_STRIP);

960  DrawLine

(x1, y1 + y_off, x1, y2 + y_off);

968

gl.

Begin

(GL_TRIANGLE_STRIP);

973  while

(xoff+

delta

<= x2-x1) {

988  if

(x1 + xoff < x2) {

1012

gl.

Color4f

(0.3f, 0.1f, 0.1f, 0.7f);

1014

gl.

Color4f

(1.0f, 1.0f, 1.0f, 0.7f);

1018

gl.

Begin

(GL_TRIANGLES);

1038

gl.

Color4f

(0.3f, 0.1f, 0.1f, 0.3f);

1040

gl.

Color4f

(1.0f, 1.0f, 1.0f, 0.3f);

1048

gl.

Begin

(GL_TRIANGLES);

1071  bool

p_start,

bool

p_stop,

1077  if

(x2 - x1 < tex_len)

return

;

1083  if

(p_stop && (!p_start || (x2 - x1) > 2.0 * tex_len)) {

1116

gl.

Begin

(GL_QUADS);

1121

gl.

Vertex3d

(right, top - band_w, 0.0);

1122

gl.

Vertex3d

(left, top - band_w, 0.0);

1127

gl.

Vertex3d

(left, bottom + band_w, 0.0);

1128

gl.

Vertex3d

(right, bottom + band_w, 0.0);

1134

gl.

Vertex3d

(left - band_w_x, top, 0.0);

1135

gl.

Vertex3d

(left - band_w_x, bottom, 0.0);

1140

gl.

Vertex3d

(right + band_w_x, top, 0.0);

1141

gl.

Vertex3d

(right + band_w_x, bottom, 0.0);

1146

gl.

Vertex3d

(left, top - band_w, 0.0);

1147

gl.

Vertex3d

(left - band_w_x, top - band_w, 0.0);

1148

gl.

Vertex3d

(left - band_w_x, top, 0.0);

1152

gl.

Vertex3d

(right + band_w_x, top, 0.0);

1153

gl.

Vertex3d

(right + band_w_x, top - band_w, 0.0);

1154

gl.

Vertex3d

(right, top - band_w, 0.0);

1159

gl.

Vertex3d

(left, bottom + band_w, 0.0);

1160

gl.

Vertex3d

(left - band_w_x, bottom + band_w, 0.0);

1161

gl.

Vertex3d

(left - band_w_x, bottom, 0.0);

1165

gl.

Vertex3d

(right + band_w_x, bottom, 0.0);

1166

gl.

Vertex3d

(right + band_w_x, bottom + band_w, 0.0);

1167

gl.

Vertex3d

(right, bottom + band_w, 0.0);

1178  bool

center,

bool

adjust_flip)

const 1185

x +=

m_bHorz

? -width * 0.5 : width * 0.5;

1189

x +=

m_bHorz

? width : -width;

1200  bool

center,

bool

adjust_flip)

const 1205

x +=

m_bHorz

? -width * 0.5 : width * 0.5;

1209

x +=

m_bHorz

? width : -width;

1221

gl.

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