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/phylo__tree__render_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/phylo_tree/phylo_tree_render.cpp Source File

63 #define PTRENDER_EFFECTS_TIMER_ID 63200 64 #define PHYLO_MOUSE_CLICK_TIMER_ID 63201 65 #define M_NCBI_E 2.71828182845904523536f 91

m_UseSplines =

false

;

92

m_RotatedLabels =

false

;

93

m_ForceSquare =

false

;

94

m_RegenerateTexture =

false

;

95

m_LabelViewPct = 0.6f;

96

m_RenderScale =

true

;

100

m_pMouseZoomHandler =

NULL

;

102

m_SwitchedLayout =

false

;

103

m_ValidLayout = eNeedLayoutAndSize;

109

m_DistanceBarLowerLeft =

true

;

110

m_RasterRect.Init(0, 0, m_DimX, m_DimY);

112

m_BufferdRenderTime = 0.0f;

114

m_HighlightLongerEdges =

false

;

115

m_HighlightFunctionK = 50.0f;

116

m_HighlightFunctionMidpoint = 90.0f;

117

m_HighlightIntensity = 1.0f;

119 #ifdef ATTRIB_MENU_SUPPORT 122

sub_menu->

AddFloatReadOnly

(

"Buffered Render Time"

, &m_BufferdRenderTime);

125

sub_menu->

AddFloat

(

"Highlight K"

, &m_HighlightFunctionK, 50.0f, 1.0f, 500.0f, 10.0f);

126

sub_menu->

AddFloatReadOnly

(

"Highlight Midpoint"

, &m_HighlightFunctionMidpoint);

131

: m_DimX(width), m_DimY(height)

161 #ifdef ATTRIB_MENU_SUPPORT 174 #ifdef ATTRIB_MENU_SUPPORT 203  if

(node_size > 0.0f) {

208  if

(node_size > 0.0f) {

212  float

node_size_scaler = 1.0f;

214  if

(!node.

Expanded

() && node_size > 2.0f) {

216

node_size_scaler = 0.5f;

230

gl.

Translatef

((

float

)p.

X

(), (

float

)p.

Y

(), 0.0);

233

gl.

Color3f

(0.0f, 0.0f, 0.0f);

235

gl.

Enable

(GL_LINE_STIPPLE);

239

gl.

Begin

(GL_LINES);

240

gl.

Vertex2f

(-node_size, -node_size);

241

gl.

Vertex2f

(node_size, -node_size);

243

gl.

Vertex2f

(-node_size, node_size);

244

gl.

Vertex2f

(node_size, node_size);

246

gl.

Vertex2f

(-node_size, -node_size);

247

gl.

Vertex2f

(-node_size, node_size);

249

gl.

Vertex2f

(node_size, -node_size);

250

gl.

Vertex2f

(node_size, node_size);

267

gl.

Color3f

(0.0f, 0.0f, 0.0f);

270

gl.

Enable

(GL_LINE_STIPPLE);

286

gl.

Begin

(GL_LINES);

310

gl.

Color4f

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

313

gl.

BlendFunc

(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

316

gl.

Begin

(GL_LINES);

345  double

rounded = default_scale;

348  if

(default_scale < 1.0) {

350  while

(rounded < 1.0) {

353

rounded = default_scale*multiplier;

356

rounded = (double)((

int

)(floor(rounded) + 0.5));

357

rounded = rounded / multiplier;

362  while

(rounded > 10.0) {

364

rounded = default_scale*multiplier;

366

rounded = (double)((

int

)(floor(rounded) + 0.5));

367

rounded = rounded / multiplier;

391  float

kSpacing = 4.0f;

397  float

total_height = vp_height * (1.0 / pct_visible);

398  float

visible_highlighted_nodes =

std::min

(total_height / kSpacing, tree_size);

406  if

(dist_between_nodes < 0.5f)

424  if

(edge_node !=

NULL

) {

429  if

(sel_edge_node !=

NULL

) {

434  if

(filler_points_node !=

NULL

) {

439  if

(sel_filler_points_node !=

NULL

) {

446  if

(edge_node !=

NULL

) {

451  if

(sel_edge_node !=

NULL

) {

456  if

(filler_points_node !=

NULL

) {

459

filler_points_node->

GetState

().

BlendFunc

(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

461  if

(sel_filler_points_node !=

NULL

) {

464

sel_filler_points_node->

GetState

().

BlendFunc

(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

480  float

final_len = target_len;

483  float

base_ypos = 20.0f;

501

base_xpos = 2.0f*

delta

;

505

(1.5f*target_len + 20.0f);

506

base_xpos =

std::max

(0.0f, base_xpos);

526

final_len = target_len * rounded/default_scale;

528

sprintf(buf_round,

"%.*f"

,

precision

, rounded);

535

gl.

BlendFunc

(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

547

gl.

BlendFunc

(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

549

gl.

Begin

(GL_LINES);

550

gl.

Vertex2f

(base_xpos, base_ypos);

551

gl.

Vertex2f

(base_xpos, base_ypos + bar_height);

553

gl.

Vertex2f

(base_xpos, base_ypos + bar_height/2.0f);

554

gl.

Vertex2f

(base_xpos + final_len, base_ypos + bar_height/2.0f);

556

gl.

Vertex2f

(base_xpos + final_len, base_ypos);

557

gl.

Vertex2f

(base_xpos + final_len, base_ypos + bar_height);

562  float

tx = base_xpos + (float)

delta

;

563  float

ty = base_ypos + bar_height/2.0f + (float)

delta

;

623

std::vector<NodePointer>::iterator niter, erase_iter =

m_NodePointers

.end();

632  double

x = (*node).X();

633  double

y = (*node).Y();

653

gl.

BlendFunc

(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

675  float

proj_len = proj_dir.

Length

();

680  CVect2<float>

arrowhead_base(node_proj_pos.

X

() - proj_dir.

X

()*16.0f,

681

node_proj_pos.

Y

() - proj_dir.

Y

()*16.0f);

684  float

shaft_len = proj_len - 16.0f;

685  if

(shaft_len > 0.0f) {

693

gl.

Begin

(GL_TRIANGLE_STRIP);

706

gl.

Begin

(GL_TRIANGLES);

737  float

node_size_scaler = 1.0f;

739  if

(!active_node.Expanded() && s > 2.0f ) {

741

node_size_scaler = 0.5f;

756

gl.

Translatef

((

float

)p.

X

(), (

float

)p.

Y

(), 0.0);

759

gl.

BlendFunc

(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

764  float delta

= 3.141592653589793238463f / num_lines;

766

gl.

Begin

(GL_TRIANGLE_STRIP);

768  float

angle =

delta

;

769  for

(

int i

= 0;

i

< num_lines - 1;

i

++) {

770  float

sina = sin(angle), cosa = cos(angle);

912  if

(event.Dragging()) {

916

wxPoint ms_pos =

event

.GetPosition();

1004  bool

sel_changed =

false

;

1015

sel_changed =

true

;

1096  else if

(proj >

len

) {

1102

dist =

delta

.Length2();

1124  GetEdgeColor

(child_node, parent_node, c, parent_color);

1127

line_colors.push_back(parent_color.

GetRgbaUC

());

1131

line_coords.push_back(p1);

1132

line_coords.push_back(p2);

1157  bool

selected_edge =

GetEdgeColor

(child_node, parent_node, c, parent_color);

1163  if

(!selected_edge) {

1164

line_colors.push_back(parent_color.

GetRgbaUC

());

1166

line_coords.push_back(p1);

1167

line_coords.push_back(p2);

1170

sel_line_colors.push_back(parent_color.

GetRgbaUC

());

1171

sel_line_colors.push_back(c.

GetRgbaUC

());

1172

sel_line_coords.push_back(p1);

1173

sel_line_coords.push_back(p2);

1198  bool

selected_edge =

GetEdgeColor

(child_node, parent_node, c, parent_color);

1202

vector<CVect2<float> >& tree_edge_vec = selected_edge ? sel_edge_node_coords : edge_node_coords;

1203

vector<CVect4<unsigned char> >&

colors

= selected_edge ? sel_edge_node_colors : edge_node_colors;

1211

vector<CVect3<float> >

buf

;

1213  float

cur_len = 0.0f;

1215  bool

closest =

false

;

1218  for

(

i

=0;

i

<

buf

.size()-1; ++

i

) {

1221

cur_len += (

buf

[

i

+1]-

buf

[

i

]).Length();

1222  float

pct_copied = cur_len/

len

;

1223

col = parent_color*(1.0f-pct_copied) + c*pct_copied;

1229

tree_edge_vec.push_back(p1);

1230

tree_edge_vec.push_back(p2);

1262  bool

selected_edge =

GetEdgeColor

(child_node, parent_node, c, parent_color);

1266

vector<CVect2<float> >& tree_edge_vec = selected_edge ? sel_edge_node_coords : edge_node_coords;

1267

vector<CVect4<unsigned char> >&

colors

= selected_edge ? sel_edge_node_colors : edge_node_colors;

1269

vector<CVect2<float> >

buf

;

1271  float

angle1 = (*parent_node)->GetAngle();

1272  float

angle2 = (*child_node)->GetAngle();

1275  int

steps =

std::abs

((

int

)floorf((angle1-angle2)*resolution));

1277  if

(steps < 2 || radius == 0.0f)

1279  float

tdelta = -1.0f*(angle1-angle2)/(

float

)steps;

1282  for

(

int i

=0;

i

<=steps; ++

i

) {

1289  bool

closest =

false

;

1292  if

(trace_line_coords !=

NULL

&&

offset

.Length2() > 0.0f) {

1297  for

(

i

= 0;

i

<

buf

.size() - 1; ++

i

) {

1298  colors

.push_back(parent_color_uc);

1299  if

(

i

==

buf

.size() - 2)

1302  colors

.push_back(parent_color_uc);

1307

tree_edge_vec.push_back(p1);

1308

tree_edge_vec.push_back(p2);

1322

trace_line_colors->push_back(trace_color_uc);

1323

trace_line_colors->push_back(trace_color_uc);

1324

trace_line_coords->push_back(pt2 -

offset

);

1325

trace_line_coords->push_back(pt2);

1341

trace_point_coords->push_back(pt2 -

offset

);

1342

trace_point_colors->push_back(parent_color_uc);

1345  buf

.push_back(pt2);

1349  for

(

i

= 0;

i

<

buf

.size() - 1; ++

i

) {

1350  colors

.push_back(parent_color_uc);

1351  if

(

i

==

buf

.size() - 2)

1354  colors

.push_back(parent_color_uc);

1359

tree_edge_vec.push_back(p1);

1360

tree_edge_vec.push_back(p2);

1388  bool

selected_edge =

GetEdgeColor

(child_node, parent_node, c, parent_color);

1394  if

(!selected_edge) {

1395

edge_node_colors.push_back(parent_color_uc);

1396

edge_node_colors.push_back(parent_color_uc);

1397

edge_node_colors.push_back(parent_color_uc);

1398

edge_node_colors.push_back(c.

GetRgbaUC

());

1400

edge_node_coords.push_back(pt1);

1401

edge_node_coords.push_back(mid_point);

1402

edge_node_coords.push_back(mid_point);

1403

edge_node_coords.push_back(pt2);

1406

sel_edge_node_colors.push_back(parent_color_uc);

1407

sel_edge_node_colors.push_back(parent_color_uc);

1408

sel_edge_node_colors.push_back(parent_color_uc);

1409

sel_edge_node_colors.push_back(c.

GetRgbaUC

());

1411

sel_edge_node_coords.push_back(pt1);

1412

sel_edge_node_coords.push_back(mid_point);

1413

sel_edge_node_coords.push_back(mid_point);

1414

sel_edge_node_coords.push_back(pt2);

1435  float

cap_end = 100.0f / 512.0f;

1436  float a

= 3.141592653589793238463

1437

- acosf(cap_end / sqrtf((1.0f - cap_end)*(1.0f - cap_end) + 0.5f * 0.5f))

1438

- atan2(0.5f, 1.0f - cap_end);

1440  size_t

steps =

max

((

size_t

)1, circleSegments / 2);

1443  for

(

size_t i

= 0;

i

< steps; ++

i

) {

1444  float

cosa = cosf(

a

);

1445  float

sina = sinf(

a

);

1446

vertices.push_back(

CVect2<float>

(cap_end*(1 - cosa), -cap_end * sina));

1447

vertices.push_back(

CVect2<float>

(cap_end*(1 - cosa), cap_end*sina));

1458  size_t

circleSegments,

1470

vector<CVect2<float> > vb;

1472

geom->SetVertexBuffer2D(vb);

1481  n

->SetVBOGeom(geom);

1488  n

->SetRotationZ(angle);

1499

m(0, 0) = width_scale;

1500

m(1, 1) = node_scale;

1501

m(2, 2) = node_scale;

1502

m(0, 3) = (**node).X() -

delta

.X();

1503

m(1, 3) = (**node).Y() -

delta

.Y();

1517

(*node)->SetNodePixelOffset(

n

->GetPixelOffset());

1519  n

->GetState().BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

1520  n

->GetState().Enable(GL_BLEND);

1521  n

->GetState().Disable(GL_TEXTURE_2D);

1522  n

->GetState().Disable(GL_TEXTURE_1D);

1524  color

.SetAlpha(alpha);

1525  n

->GetState().ColorC(

color

);

1526  n

->GetState().ScaleInvarient(

true

);

1535

glPushAttrib(GL_ALL_ATTRIB_BITS);

1537

vector<CVect2<float> > vb;

1560  if

(cosf((**node).GetAngle()) < 0.0f)

1561

angle = (float)M_PI;

1563  n

->SetRotationZ(angle);

1571  if

(width_scale == 0.0f)

1572

width_scale = node_scale;

1575

m(0, 0) = width_scale;

1576

m(1, 1) = node_scale;

1577

m(2, 2) = node_scale;

1578

m(0, 3) = (**node).X() -

delta

.X();

1579

m(1, 3) = (**node).Y() -

delta

.Y();

1593

(*node)->SetNodePixelOffset(

n

->GetPixelOffset());

1595  n

->GetState().Color4f(

color

.GetRed(),

color

.GetGreen(),

color

.GetBlue(), alpha);

1596  n

->GetState().ScaleInvarient(

true

);

1605

vector<float>& color_coords,

1613  float

this_node_size = def_node_size;

1616  int

num_lines =

int

(

std::max

(2.0f, def_node_size) * 10.0f);

1621  if

(collapsed_node) {

1624  switch

(

GetGl

().GetApi()) {

1655

color_coords.push_back(color_coord);

1661  if

((**node).HasNodeMarker()) {

1672

m(0,3) = (**node).X();

1673

m(1,3) = (**node).Y();

1682

vector<CVect2<float> > vb;

1683

vector<CRgbaColor> cb;

1685  float

target_alpha = 1.0f;

1691  size_t

color_count = (**node).GetMarkerColors().size();

1692  float

color_countf = (float)color_count;

1697  if

((**node).GetNodeSize() > 0)

1698

s2 = (**node).GetNodeSize();

1700

s2 *= (**node).GetMarkerSize();

1702  float delta

= 6.28f/(float)num_lines;

1703  float

angle = 3.14159f/2.0f;

1704  for

(

int i

=0;

i

<num_lines;

i

++){

1705  size_t

color_idx = (size_t)((((

float

)

i

)/(

float

)(num_lines)) * color_countf);

1706

color_idx =

std::min

(color_idx, color_count-1);

1707  CRgbaColor

c = (**node).GetMarkerColors()[color_idx];

1718

s2*sinf(angle+

delta

)));

1727  if

((**node).GetBoundedDisplay()) {

1742

c.

Lighten

(1.0f - node_alpha);

1768  bool

recompute = (

label

!= (*node).GetDisplayLabel());

1774

(*node).SetLabelRect(

r

);

1775

(*node).SetDisplayLabel(

label

);

1781  r

.Init(po.

X

(), po.

Y

(), po.

X

() + pixel_size.

X

(), po.

Y

() + pixel_size.

Y

());

1783

(*node).SetLabelRect(

r

);

1784

(*node).SetDisplayLabel(

label

);

1788

(*node).SetDisplayLabel(

""

);

1796  const string

& layout_type)

1803  if

(!(*node).GetLabel().empty()) {

1815

(*node).GetSubtreeBoundary()->ComputeShapes(

1816

boundary_pts, scale, node_pos, layout_type);

1838  if

(x1 > x2)

swap

(x1, x2);

1839  if

(y1 > y2)

swap

(y1, y2);

1886

std::vector<ProjectionElement>& xexts,

1887

std::vector<ProjectionElement>& yexts,

1893  float

goal = ((float)(

limits

.Right()-

limits

.Left()))/1e04f;

1896  float delta

= 1e10f;

1897  float

prev_delta = 1e10f;

1900  float

viewport_x, viewport_y;

1903  float

left =

limits

.Left();

1904  float

right =

limits

.Right();

1905  float

top =

limits

.Top();

1906  float

bottom =

limits

.Bottom();

1920  while

(

delta

> goal &&

count

++ < max_iterations

) {

1921

prev_delta =

delta

;

1926  float

viewport_maxx = -1e10f;

1927  float

viewport_minx = 1e10f;

1928  float

viewport_maxy = -1e10f;

1929  float

viewport_miny = 1e10f;

1933  float

node_maxx = -1e10f;

1934  float

node_minx = 1e10f;

1935  float

node_maxy = -1e10f;

1936  float

node_miny = 1e10f;

1945  float

label_zoom = 1.0f;

1953  float

distance_between_nodes =

1961

label_zoom =

std::min

(1.0f, distance_between_nodes/height);

1986  for

(

size_t i

=0;

i

<xexts.size(); ++

i

) {

1989

(xexts[

i

].m_NodeCoord*vp_width - left*vp_width)/(right-left);

1993

node_maxx =

std::max

(viewport_x, node_maxx);

1994

node_minx =

std::min

(viewport_x, node_minx);

1996

xexts[

i

].m_ProjectionCood = viewport_x;

1999

viewport_maxx = node_maxx;

2000

viewport_minx = node_minx;

2001

node_extents.

SetRight

(viewport_maxx);

2002

node_extents.

SetLeft

(viewport_minx);

2012  for

(

size_t i

=0;

i

<xexts.size(); ++

i

) {

2014

viewport_x = xexts[

i

].m_ProjectionCood;

2017  float

offsetx = xexts[

i

].m_PixelOffset*label_zoom;

2031

overlap_x = (node_maxx - viewport_x);

2033

overlap_x = (viewport_x - node_minx);

2047  std::min

(non_overlap_x, scaled_width);

2048

offsetx = (offsetx >= 0.0f) ? usable_offsetx : -usable_offsetx;

2052  if

(offsetx != 0.0f) {

2053

viewport_x += offsetx;

2054

viewport_maxx =

std::max

(viewport_x, viewport_maxx);

2055

viewport_minx =

std::min

(viewport_x, viewport_minx);

2059

text_extents.

SetRight

(viewport_maxx);

2060

text_extents.

SetLeft

(viewport_minx);

2062  for

(

size_t i

=0;

i

<yexts.size(); ++

i

) {

2065

(yexts[

i

].m_NodeCoord*vp_height - bottom*vp_height)/(top-bottom);

2066

viewport_maxy =

std::max

(viewport_y, viewport_maxy);

2067

viewport_miny =

std::min

(viewport_y, viewport_miny);

2071

node_maxy =

std::max

(viewport_y, node_maxy);

2072

node_miny =

std::min

(viewport_y, node_miny);

2074

yexts[

i

].m_ProjectionCood = viewport_y;

2077

viewport_maxy = node_maxy;

2078

viewport_miny = node_miny;

2079

node_extents.

SetTop

(viewport_maxy);

2080

node_extents.

SetBottom

(viewport_miny);

2082  for

(

size_t i

=0;

i

<yexts.size(); ++

i

) {

2084

viewport_y = yexts[

i

].m_ProjectionCood;

2087  float

offsety = yexts[

i

].m_PixelOffset*label_zoom;

2093

overlap_y = (node_maxy - viewport_y);

2095

overlap_y = (viewport_y - node_miny);

2104

offsety = (offsety >= 0.0f) ? usable_offsety : -usable_offsety;

2108  if

(offsety != 0.0f) {

2109

viewport_y += offsety;

2110

viewport_maxy =

std::max

(viewport_y, viewport_maxy);

2111

viewport_miny =

std::min

(viewport_y, viewport_miny);

2115

text_extents.

SetTop

(viewport_maxy);

2116

text_extents.

SetBottom

(viewport_miny);

2125  if

(viewport_maxx != -1e10f) {

2127  if

(

fabs

(rd) > 0.0f) {

2129  float

off = (rd/vp_width)*(right-left);

2134  if

(viewport_minx != 1e10f) {

2136  if

(

fabs

(ld) > 0.0f) {

2138  float

off = (ld/vp_width)*(right-left);

2143  if

( viewport_maxy != -1e10f) {

2145  if

(

fabs

(

td

) > 0.0f) {

2147  float

off = (

td

/vp_height)*(top-bottom);

2152  if

( viewport_miny != 1e10f) {

2154  if

(

fabs

(bd) > 0.0f) {

2156  float

off = (bd/vp_height)*(top-bottom);

2161

vp_extent.

Set

(viewport_maxx-viewport_minx,

2162

viewport_maxy-viewport_miny);

2171  if

(right-left > 1000000 || top-bottom > 1000000)

2177  limits

.SetBottom(bottom);

2201  else if

(node_coord >

m_Extents

[0].m_NodeCoord) {

2202  if

(

m_Extents

[0].m_PixelOffset <= pixel_offset) {

2216  float

max_pixel_offset = -FLT_MAX;

2217  bool

resolved =

false

;

2218  size_t

erase_from = -1;

2222  for

(

size_t

ext_idx=0; ext_idx<

m_Extents

.size() && !resolved; ++ext_idx) {

2223

max_pixel_offset =

std::max

(max_pixel_offset,

m_Extents

[ext_idx].m_PixelOffset);

2226  if

(node_coord >

m_Extents

[ext_idx].m_NodeCoord) {

2227  if

(pixel_offset >= max_pixel_offset) {

2228  m_Extents

[ext_idx].m_PixelOffset = pixel_offset;

2229  m_Extents

[ext_idx].m_NodeCoord = node_coord;

2231

erase_from = ext_idx;

2242  else if

(node_coord ==

m_Extents

[ext_idx].m_NodeCoord) {

2243  if

(pixel_offset > max_pixel_offset) {

2245  m_Extents

[ext_idx].m_PixelOffset = pixel_offset;

2246

erase_from = ext_idx;

2252  if

(pixel_offset <= max_pixel_offset) {

2261  if

(!resolved && pixel_offset > max_pixel_offset) {

2272  if

(erase_from != (

size_t

)-1) {

2273  size_t

erase_to = erase_from + 1;

2274  for

(; erase_to <

m_Extents

.size(); ++erase_to)

2275  if

(pixel_offset <

m_Extents

[erase_to].m_PixelOffset)

2278  if

(erase_to > (

size_t

)(erase_from + 1))

2286  for

(

size_t i

=0;

i

<m_Extents.size(); ++

i

) {

2289

dim << m_Extents[

i

].m_NodeCoord <<

" ) Pix: ( "

<<

2290

m_Extents[

i

].m_PixelOffset <<

" ) "

);

2308

GLdouble left_margin, top_margin, right_margin, bottom_margin;

2309  m_SL

->

GetMargins

(left_margin, top_margin, right_margin, bottom_margin);

2319  if

(node->GetDisplayLabel().empty()) {

2341

bottom =

r

.Bottom();

2346  double a

= (double)node->GetAngle();

2348  if

(

a

> (M_PI / 2.0) &&

a

< ((3.0*M_PI) / 2.0)) {

2352  float

cos_a = (float)cos(

a

);

2353  float

sin_a = (float)sin(

a

);

2366  for

(

int

corner = 0; corner < 4; ++corner) {

2370  CVect2<float>

rpos(pos.

X

()*cos_a - pos.

Y

()*sin_a, pos.

X

()*sin_a + pos.

Y

()*cos_a);

2389

vector<ProjectionElement>& yexts)

2393 

xexts = m_MaxX.m_Extents;

2394  for

(

size_t i

=0;

i

<m_MinX.m_Extents.size(); ++

i

) {

2396  ne

.m_NodeCoord = -

ne

.m_NodeCoord;

2397  ne

.m_PixelOffset = -

ne

.m_PixelOffset;

2399

xexts.push_back(

ne

);

2404 

yexts = m_MaxY.m_Extents;

2405  for

(

size_t i

=0;

i

<m_MinY.m_Extents.size(); ++

i

) {

2407  ne

.m_NodeCoord = -

ne

.m_NodeCoord;

2408  ne

.m_PixelOffset = -

ne

.m_PixelOffset;

2410

yexts.push_back(

ne

);

2416  _TRACE

(

"Dumping + X Dimension:"

);

2417

m_MaxX.DumpExtent(

" X Pos: ( "

);

2420  _TRACE

(

"Dumping + Y Dimension:"

);

2421

m_MaxY.DumpExtent(

" Y Pos: ( "

);

2424  _TRACE

(

"Dumping - X Dimension:"

);

2425

m_MinX.DumpExtent(

" -X Pos: ( "

);

2428  _TRACE

(

"Dumping - Y Dimension:"

);

2429

m_MinY.DumpExtent(

" -Y Pos: ( "

);

2434  bool

init_collision_info)

2436

GLdouble top, bottom, left, right;

2453

vector<ProjectionElement> xexts, yexts;

2460  bool

too_small =

false

;

2502  float

left_pct = 0.0f;

2503  float

right_pct = 0.0f;

2504  float

bottom_pct = 0.0f;

2505  float

top_pct = 0.0f;

2507  if

(

limits

.Width() > 0.0 &&

limits

.Height() > 0.0) {

2527  bool

init_collision_info,

2543

render_total.

Start

();

2587  if

(init_collision_info)

2602  float

collision_resolution =

max

(ceilf(sqrtf(

m_DS

->

GetSize

())),

2607

collision_resolution,

2634  float

node_size = 0.0f;

2637

node_size = def_node_size;

2684  if

(edge_node !=

NULL

&&

2685

narrow_edge_node !=

NULL

) {

2691

narrow_edge_node->

SetVisible

(line_width > 1.0f);

2692

sel_narrow_edge_node->

SetVisible

(line_width > 1.0f);

2710  for

(

size_t i

= 0;

i

< nodes.size(); ++

i

) {

2711  if

(nodes[

i

]->GetName() ==

"CollapsedNode"

) {

2712

nodes[

i

]->SetVisible(node_size > 0.0f);

2721  if

(s.

X

() != scale2d.

X

() || s.

Y

() != scale2d.

Y

())

2732

render_total.

Start

();

2754

rmgrgl->Disable(GL_TEXTURE_1D);

2755

rmgrgl->Disable(GL_TEXTURE_2D);

2771

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

2789

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

2804  if

(rpdf ==

NULL

) {

2805  LOG_POST

(

Error

<<

"RenderPdf: unable to cast render manager to CGlRenderPdf"

);

2833  if

(pdf_font_face != current_font_face) {

2836  f

.SetFontFace(pdf_font_face,

false

);

2862  else if

(pdf_font_face != current_font_face) {

2865  f

.SetFontFace(current_font_face,

true

);

2881

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

2898

glPushAttrib(GL_ALL_ATTRIB_BITS);

2900  m_MinimapBuffer

->SetTextureFiltering(GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR);

2907  auto

renderer = [

this

, w, h]() {

2909

GLint vp_width, vp_height;

2912

vp_height = (

int

)(((

float

)vp_width)*((

float

)h) / (

float

)w);

2916

vp_width = (

int

)(((

float

)vp_height)*((

float

)w) / (

float

)h);

2945  m_Texture

->SetFilterMin(GL_LINEAR_MIPMAP_LINEAR);

2956

glDrawBuffer(GL_BACK);

2961

glPixelStorei(GL_PACK_ALIGNMENT, 1);

2963

glReadBuffer(GL_BACK);

2964

glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, image->

SetData

());

2968  m_Texture

->SetFilterMin(GL_LINEAR_MIPMAP_LINEAR);

2975  catch

(std::exception&)

2986  float

& ycoord_limit)

2998

xcoord_limit = 1.0f;

2999

ycoord_limit = ((float)h)/(float)w;

3002

ycoord_limit = 1.0f;

3003

xcoord_limit = ((float)w)/(float)h;

3055  if

(node !=

NULL

) {

3150  float

node_alpha = 1.0f;

3158

CPhyloTree::TSelState::iterator iter =

3163

sel_state = (*iter).second;

3200  short

node_color_idx = (**node).GetNodeFgColorIdx();

3201  if

(node_color_idx != -1)

3202  return

node_color_idx;

3203  else if

((**node).GetClusterColorIdx() != -1)

3204  return

((**node).GetClusterColorIdx());

3212  short

label_color_idx = (**node).GetLabelFgColorIdx();

3213  if

(label_color_idx != -1)

3214  return

label_color_idx;

3225  short

parent_color_idx = -1;

3228  bool

selected_state =

false

;

3236  if

(beg_state != end_state &&

3242

color_idx = (**child_node).GetClusterColorIdx();

3243  if

(color_idx == -1) {

3244

color_idx = (**child_node).GetNodeEdColorIdx();

3245

parent_color_idx = (**parent_node).GetNodeEdColorIdx();

3248  if

(color_idx == -1){

3261  float

transparency = 1.0f / (1.0f + powf(

M_NCBI_E

,

3267

c.

Lighten

(1.0f - transparency);

3283

selected_state =

true

;

3290  if

(parent_color_idx != -1 && (**child_node).GetEdgeColorGradient()) {

3295  return

selected_state;

3305  float

height_factor,

3310

vector<ProjectionElement> xexts, yexts;

3317

label_height = (

int

)min_height;

3323  float

width = ((float)

m_SL

->

GetNodeSize

())*width_factor*tree_height;

3329  float

computed_wh_ratio = width/min_height;

3330  if

(computed_wh_ratio < wh_ratio) {

3331

width = wh_ratio*min_height;

3333  else if

(computed_wh_ratio > wh_ratio) {

3334

min_height = width/wh_ratio;

3338  TVPRect r

(0, 0, width, min_height);

3356  x_FindBestSize

(tmp_pane, xexts, yexts, vr, node_rect, text_rect, 1);

3360

GLdouble top_margin, bottom_margin, left_margin, right_margin;

3361  m_SL

->

GetMargins

(top_margin, bottom_margin, left_margin, right_margin);

3371  TModelUnit

w = width + left_pixels + right_pixels + left_margin + right_margin;

3372  TModelUnit

h = min_height + top_pixels + bottom_pixels + top_margin + bottom_margin;

3378  float

computed_wh_ratio = w/h;

3379  if

(computed_wh_ratio < wh_ratio) {

3382  else if

(computed_wh_ratio > wh_ratio) {

3387  r

.SetRight(

int

(w*1.05));

3388  r

.SetTop(

int

(h*1.05));

3399

GLdouble left, bottom, right, top;

3403

vp_height -= (

int

)(bottom + top);

3443

d = d - (d / 4.0f) + 1.0;

3458  float

actual_size = 0.0f;

3467

actual_size = node_size;

3470

actual_size = def_node_size;

static const char * bgColor

void AddPixelRect(const CVect2< float > &pt, const CGlRect< float > &rect)

Add point in bounded area along with a rectangle based at that point and defined in pixels,...

void AddBoundedPoint(const CVect2< float > &pt)

Add point to be included in bounded area.

static EGUIState wxGetSelectState(const wxMouseEvent &event)

CGlAttrGuard - guard class for restoring OpenGL attributes.

CGlVboNode A rendering node that holds a vertex buffer object.

unsigned char * SetData(void)

virtual bool IsScaleMode() const

virtual EPanMode GetPanMode() const

float GetEdgeScore() const

void SetNodeDisplayColor(const CRgbaColor &c)

Set/get node color.

void SetNodeOffset(const CVect2< float > &o)

void SetVisible(bool b)

Flag to renderer to determine whether to draw label.

void SetTextDisplayColor(const CRgbaColor &c)

Set/get text color.

float GetNodeWidthScaler(const CPhyloTreeScheme *scheme) const

Get modified node width (length) for collapsed nodes. Default is 1.

float GetNodeLayoutSize(const CPhyloTreeScheme *scheme) const

Get modified node size - use this instead of GetDefaultNodeSize when doing layout (doesn't go to 0 if...

float GetAngle(void) const

float GetDefaultNodeSize(const CPhyloTreeScheme *scheme) const

Get modified node size - includes scaled (BOA) size.

void SetAlreadyDrawn(bool b)

Flag set after each drawing and cleared when rendering frame done.

void SetNodeDisplaySize(float s)

set/get node size (this is the result of GetDefaultNodeSize())

unsigned int GetVisibleNodes(void)

void ComputeLengthsFromRoot()

Create sorted array of distances of nodes from the parent (the m_LenDistribution array)

CTreeLabel GetTreeLabel() const

void Relabel(CPhyloTreeScheme *scheme, string labelFmt)

float GetClosestLen(float pct) const

Look in vector of sorted distances of nodes from the root and given a pct (0..1), return the distance...

double GetNormDistance(void)

CTreeGraphicsModel & GetModel()

Get model for rendering.

bool HasLenDistribution() const

Return true if data is available (for trees without distances, may not be)

void SetCollapsedLabel(CPhyloTree::TTreeIdx idx)

Collapse single node, do any relabeling if needed.

CVect2< float > GetNodeLabelOffset(const string &label, CPhyloTreeNode *node, IPhyloTreeLOD *lod, CVect2< float > &pixel_offset) const

Get label rectangle.

bool IsVisible(IPhyloTreeLOD *lod) const

string GetToolTipForNode(const CPhyloTree &tree, const CPhyloTreeNode &node, const string &format, const string &line_break)

string GetLabel(const CPhyloTree &tree, const CPhyloTreeNode &node) const

TVPUnit GetMinVerticalSeparation() const

void SetScheme(CPhyloTreeScheme &sl, const CPhyloTree *tree)

bool Expanded() const

Return true if node is currently not collapsed.

bool IsLeafEx() const

Return true if node is a leaf or is collapsed.

string & SetTooltipFormat(void)

const TLabelsVisibility & GetLabelVisibility(void) const

GLdouble & SetSize(TPhyloTreeSizes obj)

void SetFont(const CGlTextureFont &font)

string & SetLabelFormat(void)

void GetMargins(GLdouble &left, GLdouble &top, GLdouble &right, GLdouble &bottom) const

TSelectionVisibility GetSelectionVisibility() const

float GetNonSelectedAlpha() const

bool GetShowAllSelected() const

short GetColorIdx(TPhyloTreeObject obj, TPhyloTreeColors col)

TZoomBehavior GetZoomBehavior(const string &renderer)

CRgbaColor & SetColor(TPhyloTreeObject obj, TPhyloTreeColors col)

const CGlTextureFont & GetFont(void) const

GLdouble GetNodeSize() const

Tree subclass also has functions and data needed for rendering and selection.

bool SelectByPoint(const CVect2< float > &pt, bool sel, bool toggle, bool labels_visible, bool rotated_labels=false)

Determine if the point pt is close enough to a node to select or deselect it.

void ClearSelection()

Sets selection state of all nodes to eNotSelected and clears m_Selected.

void SetCurrentNode(TTreeIdx node_idx)

Set the index of the currently active node.

TTreeIdx GetCurrentNodeIdx() const

Return the index of the currently active node (may be Null()).

TTreeIdx TestForNode(const CVect2< float > &pt, bool labels_visible, bool rotated_labels=false)

Search nodes to find and return closest node to 'pt' that is within the max.

TTreeIdx FindNodeById(TID id) const

Return index of the node with the given id or Null().

void SetCurrentEdge(TTreeIdx child_idx, TTreeIdx parent_idx)

Set/Get the edge between the two specified nodes as current.

void GetSelState(TSelState &sel_state, TTreeIdx idx, bool sel_children=true, bool sel_parents=true) const

Given the selection of node 'idx', store the selection state (selected, traced, shared) of that node ...

bool SelectByRect(const CVect2< float > &ll, const CVect2< float > &ur, bool toggle)

Select or deselect all nodes in the rectangle bounded by ll and ur.

class CRgbaColor provides a simple abstraction for managing colors.

const CVect2< float > & GetScale() const

void ResizeGrid(const CGlPane &pane, float resolution, bool tilex=true, bool tiley=true)

vector< size_t > & GetNodes()

void UpdateScaled(const CGlPane &pane, const CVect2< float > &scale)

Only update scaled geometry (needed when zoom changes)

void Sync(const CGlPane &pane, CTreeGraphicsModel *m)

Insert data from model (labels/nodes)

virtual void UpdateVisibility(const TModelRect &r)

Find collisions between labels in visible regions to determine visiblity.

CGlVboNode * AddTempCollapsedNode(const vector< CVect2< float > > &vb)

Return a node that can be used to represent a collapsed tree.

vector< size_t > & GetNodeIndices()

Get all the nodes (indicies point to nodes in phylo tree)

CTreeTriFanNode * GetTriFanNode()

CTreeBoundaryNode * GetBoundaryNode()

CRgbaGradColorTable * GetColorTable()

Get color table used a 1D texture map for edges and nodes.

void SetRotateLabels(bool b)

CTreeCollisionModel2D & GetCollisionData()

virtual void ClearArrays()

Clear arrays prior to re-synching with the model.

virtual void SyncBuffers()

Update buffers as needed.

string GetFontName() const

CRgbaColor GetColor() const

TTreeIdx GetParent() const

Get node's parent.

TData & GetValue()

Return the value object for the node.

bool IsLeaf() const

Report whether this is a leaf node.

static TTreeIdx Null()

Static function that returns the null value.

static TTreeIdx Null()

Return the index value that represents a NULL node.

TNodeType & GetNode(TTreeIdx idx)

Return a reference to the node at the given index.

void SetLabelVisibility(bool b)

Set default label visibility (if false, no labels rendered, if true, labels which are turned on and v...

void CreateVbo(size_t numSements)

bool GetLabelVisibility() const

virtual void GHH_ReleaseMouse()=0

releases captured mouse

virtual void GHH_CaptureMouse()=0

captures mouse events in the hosting window for D&D

virtual void GHH_SetCursor(const wxCursor &cursor)=0

changes the cursor in the hosting window

virtual TVPUnit HMGH_GetVPPosByY(int y) const =0

virtual void HMGH_OnRefresh(void)=0

a chnage that requires a redraw but no GL buffer updates

virtual void HMGH_OnChanged(void)=0

a topology or selection (color) change (requires update to buffers

virtual void FireEditEvent(EPhyloTreeEditCommand ec)=0

void UpdateExtent(float node_coord, float pixel_offset, bool has_label)

Compare the new coordinate and pixel offset with the contents of m_Extents.

void DumpExtent(const string &dim)

write out values for debugging purposes

vector< ProjectionElement > m_Extents

Sorted (in decreasing order) set of coordinates and pixel offsets.

void DumpExtents()

Write output to log for debugging.

void ConsolidateExtents(vector< ProjectionElement > &xexts, vector< ProjectionElement > &yexts)

Combine together m_MaxX and m_MinX and m_MaxY and m_MinY.

CExtentDimension m_MinX

the 'leftmost' nodes, except that signs are flipped in order to allow uniform processing in all dimen...

CExtentDimension m_MaxY

Same as for m_MaxX values, but in y dimension.

CExtentDimension m_MinY

the 'bottommost' nodes, with signs flipped.

CExtentDimension m_MaxX

the 'rightmost' nodes and labels (includes the node with the largest x value, and any nodes to the le...

CPhyloTree::TTreeIdx TTreeIdx

virtual ~IPhyloTreeRender()

virtual void x_SetGlRenderOptions(CPhyloTreeDataSource &ds)

Set OpenGL rendering options that depend on layout chosen.

bool m_RenderScale

If true render a scale legend at the bottom of the screen.

float m_TreePixels

Sum of size (height) of all leaf nodes in pixels, without considering labels (accomodates nodes that ...

virtual float GetNodeLabelDist(const CPhyloTreeNode *node) const

float m_ClosestEdgeDistSq

bool LabelsVisible()

Return true if lables are visible according to rendering scheme and at current scale.

bool m_DistanceBarLowerLeft

CGlTextureFont * m_pLabelFont

virtual void RenderPdf(CGlPane &pane, CPhyloTreeDataSource &ds, CRef< CPdf > pdf)

float m_LabelViewPct

When sizing the tree to window, this is the maximum % of screen area (width) that will be allocated t...

void x_RenderSplineVbo(TTreeIdx child_node_idx, CPhyloTreeNode *child_node, CPhyloTreeNode *parent_node, vector< CVect2< float > > &edge_node_coords, vector< CVect4< unsigned char > > &edge_node_colors, vector< CVect2< float > > &sel_edge_node_coords, vector< CVect4< unsigned char > > &sel_edge_node_colors, const CVect3< float > &pt1, const CVect3< float > &pt2, const CVect3< float > &pt3, const CVect3< float > &pt4)

bool x_GetEdgeDist(const CVect2< float > &from, const CVect2< float > &to)

bool GetDistRendering(void) const

short GetNodeColorIdx(CPhyloTreeNode *node)

CVect2< float > m_RightClick

@ eSelRect

selecting a single glyph by point

CRef< CPhyloTreeScheme > m_SL

std::vector< CVect2< float > > m_SelectedEdge

Graphical representation of currently selected edge, if any, and data members needed for the selectio...

CPhyloTree::TSelState m_NodeSingleSelection

When user only wants to display a single, current selection from the selection set (including traced ...

int GetMaxLeavesVisible()

double ComputeScale(double default_scale, int &precision) const

virtual double ComputeDistFromPixels(CGlPane &pane, const CVect2< TModelUnit > &pixpos1, const CVect2< TModelUnit > &pixpos2) const

CTooltipInfo TTHH_GetTooltip(const wxRect &rect)

virtual bool Render(CGlPane &pane, CPhyloTreeDataSource &ds)

Returns false if rendering does not occur (e.g.

virtual float GetNodeLayoutSize(const CPhyloTreeNode *node) const

This is the height of the node for layout purposes.

TTreeIdx m_ActiveTooltipNode

void x_DrawBoundingAreas(CPhyloTreeNode *node)

void OnTimerLeftUp(wxTimerEvent &event)

CPhyloTreeLabel m_LabelExt

virtual float GetLabelViewPct() const

CVect2< float > m_ClosestEdgeDir

void OnLeftDown(wxMouseEvent &event)

event handlers

float m_HighlightFunctionK

Parms for logistics function to highlight edges when zoomed out to the point that many edges overlap ...

virtual string GetDescription(void)=0

virtual wxEvtHandler * GetEvtHandler()

float m_BufferdRenderTime

For performance analysis (time to update VBOs after topology change)

CIRef< I3DFrameBuffer > m_MinimapBuffer

virtual bool SupportsRotatedLabels() const

bool x_SelectByRect(bool toggle)

Returns true if selection status changed (or may have changed..)

void x_GenerateTexture(void)

string TTHH_NeedTooltip(const wxPoint &pt)

virtual void x_ComputeNodeBoundary(CPhyloTree *tree, CPhyloTree::TNodeType &node, CBoundaryPoints &boundary_pts, const string &layout_type)

void InitExtents()

Set extents to default values so CalculateExtents can be called.

void InitLabel(CPhyloTree *tree, CPhyloTree::TNodeType &node)

Initialize (for current layout) label text and extent (label rectangle)

virtual void UpdateDataSource(CPhyloTreeDataSource &ds, CGlPane &p)

void x_RenderCircularVbo(TTreeIdx child_node_idx, CPhyloTreeNode *child_node, CPhyloTreeNode *parent_node, vector< CVect2< float > > *trace_line_coords, vector< CVect4< unsigned char > > *trace_line_colors, vector< CVect2< float > > *trace_point_coords, vector< CVect4< unsigned char > > *trace_point_colors, vector< CVect2< float > > &edge_node_coords, vector< CVect4< unsigned char > > &edge_node_colors, vector< CVect2< float > > &sel_edge_node_coords, vector< CVect4< unsigned char > > &sel_edge_node_colors, float radius, const CVect2< float > &center, const CVect2< float > &offset, float resolution)

virtual void x_RenderVbo(CPhyloTreeDataSource &)

I3DTexture * GetTexture(float &xcoord_limit, float &ycoord_limit)

void x_RenderNodeVbo(CPhyloTreeNode *node, TTreeIdx node_idx, vector< float > &color_coords, const CVect2< float > delta=CVect2< float >(0.0f, 0.0f))

void x_RenderSelection(CGlPane &pane)

void SetActiveTooltipNode(int id)

id is the tip id of the tip that the users mouse is currently on, or -1

void SetHighlightEdges(bool enable)

IGenericHandlerHost * GetGenericHost()

CPhyloTree::TTreeIdx GetHoverNodeIdx(CVect2< float > pt)

void OnMotion(wxMouseEvent &event)

void x_RenderPseudoSplineVbo(TTreeIdx child_node_idx, CPhyloTreeNode *child_node, CPhyloTreeNode *parent_node, vector< CVect2< float > > &edge_node_coords, vector< CVect4< unsigned char > > &edge_node_colors, vector< CVect2< float > > &sel_edge_node_coords, vector< CVect4< unsigned char > > &sel_edge_node_colors, const CVect2< float > &pt1, const CVect2< float > &mid_point, const CVect2< float > &pt2)

virtual TVPUnit DistanceBetweenNodes(void) const

void OnLeftDblClick(wxMouseEvent &event)

virtual void RemoveCurrentDataSource()

bool m_HighlightLongerEdges

If true, highlight longer edges when zoomed out.

CGlCurve< CCurveBezier > m_Curve

wxTimer m_MouseSingleTimer

If user is double clicking, want to avoid mouse single-click actions.

CGlPane * m_pPane

event handling

void x_RenderTreeLabel(CGlPane &pane, IRender &gl)

float m_HighlightIntensity

void x_OnSelectCursor(void)

void x_RenderLineVbo(TTreeIdx child_node_idx, CPhyloTreeNode *child_node, CPhyloTreeNode *parent_node, vector< CVect2< float > > &line_coords, vector< CVect4< unsigned char > > &line_colors, double x1, double y1, double x2, double y2)

virtual void x_Layout(CPhyloTreeDataSource &ds)

void x_RenderTooltipHints(CGlPane &pane)

CPhyloTreeNode * GetHoverNode(CVect2< float > pt)

bool GetEdgeColor(CPhyloTreeNode *child_node, CPhyloTreeNode *parent_node, CRgbaColor &c, CRgbaColor &parent_color)

Returns true if color is from selection (sel, shared, trace)

void PointToNode(int id, wxRect tip_rect, float sec)

point to a particular node from a tooltip to help user spot it rectangle should be the tooltip screen...

void x_RenderNodeHighlight(CGlPane &pane, CPhyloTree::TTreeIdx node_idx, const CRgbaColor &c)

void OnTimer(wxTimerEvent &event)

virtual float DefaultNodeSize()

Return default node size according to scheme or 0 if not visible at current scale.

float m_LabelPixels

Height of tree in pixels when labels are displayed.

CIRef< I3DTexture > m_Texture

virtual TModelUnit x_GetVerticalSeparationFactor() const

layout-spefic constant for label vertical sepatation needed for visibility

virtual float GetDefaultNodeSize(const CPhyloTreeNode *node) const

bool x_AddCollapsedTextureNode(CPhyloTreeNode *node, const CVect2< float > delta, CRgbaColor color, float alpha)

void OnLeftUp(wxMouseEvent &event)

bool GetRotatedLabels(void) const

ELayoutStatus m_ValidLayout

void CalculateExtents(CPhyloTree *tree, CPhyloTree::TNodeType &node)

TModelRect m_ZoomableExtent

void OnRightDown(wxMouseEvent &event)

virtual void SetPane(CGlPane *pane)

void x_RenderScaleMarker(CGlPane &pane, IRender &gl)

CVect2< float > x_FindBestSize(CGlPane &pane, std::vector< ProjectionElement > &xexts, std::vector< ProjectionElement > &yexts, TModelRect &limits, TModelRect &node_extents, TModelRect &text_extents, int max_iterations=500)

Returns viewport projection size in x/y from last iteration and puts optimal viewing (to see whole tr...

float m_HighlightFunctionMidpoint

virtual bool x_WideLines()

Returns true if lines are separated enough to use the wider form of lines (more separation is require...

CProjectionExtents m_ProjectionExtents

void x_AddCollapsedGeomNode(CPhyloTreeNode *node, const CVect2< float > delta, CRgbaColor color, float alpha, size_t circleSegments, bool skip_pdf)

TVPRect GetMinDimensions(CGlPane &pane, const CPhyloTreeDataSource &ds, const CPhyloTreeScheme &sc, int &label_height, TModelRect &node_rect, TModelRect &text_rect, float width_factor, float height_factor=1.0f, float wh_ratio=-1.0f)

virtual void Redraw(void)

CPhyloTreeDataSource * m_DS

bool m_MoveDuringSelection

void ComputeViewingLimits(CGlPane &pane, bool force_square=false, bool init_collision_info=true)

Compute the optimal viewing pane size so that the tree occupies the entire viewing area,...

wxMouseEvent m_LastMouseEvent

event info from last mouse click - used for single click processing

void SetScheme(CPhyloTreeScheme &sl)

std::vector< NodePointer > m_NodePointers

virtual void BufferedRender(CGlPane &pane, CPhyloTreeDataSource &ds, bool init_collision_info=true, bool select_edge=false)

IPhyloTreeRenderHost * m_pHost

short GetLabelColorIdx(CPhyloTreeNode *node)

void x_ComputeEdgeHighlight()

compute coefficients for edge highlighting (if enabled)

virtual bool IsDistanceBarLowerLeft() const

virtual void x_SetElementVisibility()

float SetNodeColoration(CPhyloTreeNode *node, TTreeIdx node_idx)

nodes, edges and labels can be colored for default, trace, shared, select or cluster

virtual void Layout(CPhyloTreeDataSource &ds, CGlPane &p)

float GetNodeSize(const CPhyloTreeNode *node) const

void SetHost(IPhyloTreeRenderHost *pHost)

virtual void RenderForHardcopy(CGlPane &pane, CPhyloTreeDataSource &ds)

CMouseZoomHandler * m_pMouseZoomHandler

static const Colors colors

static const TDS_WORD limits[]

void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)

#define LOG_POST(message)

This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...

void Error(CExceptionArgs_Base &args)

double roundn(double num, unsigned dec=6)

const T * GetData() const

CIRef< IVboGeom > AddGeomObject(GLenum node_type, const string &name)

Add a geometry (vertex buffer object) node.

void SetModelLimitsRect(const TModelRect &R)

void SetVertexBuffer2D(const vector< CVect2< float > > &data)

void Color4fv(const GLfloat *v)

static CGlResMgr & Instance()

void SetViewport(const TVPRect &R)

virtual void Translatef(GLfloat x, GLfloat y, GLfloat z)=0

CVect2< TModelUnit > GetScale() const

virtual void Enable(GLenum glstate)=0

virtual void LineStipple(GLint factor, GLushort pattern)=0

Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+.

vector< CGlVboNode * > & GetTempNodes()

CIRef< IRender > GetRenderer(ERenderTarget target)

Returns first renderer in m_Renderers that renders to 'target'.

virtual void Begin(GLenum mode)=0

Start rendering.

virtual bool IsBitmapFont() const

Returns true if the currently loaded font is from a bitmap.

virtual void BlendFunc(GLenum sfactor, GLenum dfactor)=0

Options to be used when GL_BLEND is enabled.

void Color3f(GLfloat r, GLfloat g, GLfloat b)

virtual void ScaleInvarient(bool b, CVect2< TModelUnit > scale=CVect2< TModelUnit >(TModelUnit(1), TModelUnit(1)))

Generic rendering options not specfically tied to OpenGL (or pdf..)

virtual void MatrixMode(GLenum mode)=0

CIRef< IRender > GetCurrentRenderer()

Returns current renderer, or NULL.

IRender & GetGl()

convenience function for getting current render manager

CIRef< IVboGeom > FindGeomObject(const string &name)

Find a geometry object (just geometry - not a render node) by name.

virtual void ScaleFactor(const CVect2< TModelUnit > &scale)

After setting scale invarient rendering need to update the scale whenever projection matrix changes.

void RectC(const TVPRect &rc)

void Vertex2d(GLdouble x, GLdouble y)

TVPRect & GetViewport(void)

virtual void BeginText(const CGlTextureFont *font, const CRgbaColor &color)=0

Text is drawn is pixel coordinates.

virtual void Enable(GLenum glstate)

glEnable() all options in m_Enabled

virtual void LineWidth(GLfloat w)

Set line width for drawing: glLineWidth()

virtual void LoadIdentity()=0

virtual void EndText()=0

Pops matrices and attributes after writing text.

void SetPosition(const CMatrix4< float > &mat)

Set 1 transformation and have it be "mat".

TModelUnit UnProjectX(TVPUnit m_x) const

virtual void PopMatrix()=0

virtual void BlendEquation(GLenum mode)

Options for glBlendEquation.

float GetColorTexCoord(short idx, float alpha) const

Get position for color with alpha level closest to 'alpha'.

static string PdfBaseFontName(EFontFace face, EFontFace &pdf_face)

Name of basefont for PDF purposes, or "" if not available.

float DrawBuffered(vector< TPoint > &buf) const

draw into an array and return combined length of segments in buf

TModelRect & GetModelLimitsRect(void)

void AddRenderer(CIRef< IRender > rm)

Get/Set Renderer.

virtual void Disable(GLenum glstate)

glDisable() all options in m_Disabled

EFontFace GetFontFace() const

virtual void End()=0

Finish rendering (create buffer and send to renderer)

void Inflate(T d_x, T d_y)

static bool CheckGlError()

Check if there are any OpenGL errors.

virtual void PolygonMode(GLenum face, GLenum mode)=0

Set the polygon rasterization mode.

void Vertex2fv(const GLfloat *v)

TModelUnit UnProjectY(TVPUnit m_y) const

size_t GetVertexCount() const

void SetCurrentRenderer(CIRef< IRender > rm)

Set current renderer (rm must already be in m_Renderers)

void Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)

TModelUnit GetPixelDist(TModelUnit d) const

Return the scaled pixel distance. Only important for pdf rendering.

void SetVisibleRect(const TModelRect &R)

TPoint & SetPoint(size_t i)

EFontFace

Set of pre-defined fonts for which we know we have valid font files.

void SetVisible(bool b)

Set/get node visibility.

virtual void WriteText(TModelUnit x, TModelUnit y, const char *text, TModelUnit rotate_degrees=0.0)=0

Write text at specified model coords.

virtual TModelUnit TextWidth(const char *text) const

Compute and return font metrics.

virtual TModelUnit TextHeight(void) const

TModelRect & GetVisibleRect(void)

void Recalc()

recalculate the curve (curve-specific)

void Vertex2f(GLfloat x, GLfloat y)

virtual void Disable(GLenum glstate)=0

glDisable()

virtual void Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal)=0

void SetColorBuffer(const vector< CRgbaColor > &data)

virtual void LineWidth(GLfloat w)=0

Set line width for drawing: glLineWidth()

virtual void BlendFunc(GLenum sfactor, GLenum dfactor)

Options to be used when GL_BLEND is enabled.

TModelUnit GetScaleX(void) const

TModelUnit GetScaleY(void) const

TModelUnit GetOutputUnitScaler() const

static EFontFace FaceFromString(const string &str)

Selects a font face given a string or eFontFace_LastFont on failure.

unsigned int GetFontSize() const

virtual void ColorC(const CRgbaColor &c)=0

Set current color (glColor{3,4}{f,d}{v,})

virtual void PushMatrix()=0

CGlVboNode * AddTempGeomNode(const string &name, bool visible=true)

Add a geometry node of unspecified type (caller will have to allocate appropriate buffer type for the...

TVPPoint Project(TModelUnit m_x, TModelUnit m_y) const

CVect2< TModelUnit > UnProjectEx(const CVect2< TModelUnit > &pt)

CGlVboNode * FindGeomNode(const string &name)

Find a geometry (vertex buffer object) node by name.

CRgbaColor & GetColor(size_t i)

virtual void Render(CGlPane &pane, CGlModel2D *model)

Specialized for models - which are just collections of buffers.

void SetPdf(CRef< CPdf > &pdf)

m_Pdf does the actually writing to the file

void Lighten(float scale)

const float * GetColorArray(void) const

Access the color array directly.

CVect4< unsigned char > GetRgbaUC()

TObjectType * GetPointer(void) THROWS_NONE

Get pointer,.

void Reset(void)

Reset reference object.

bool IsNull(void) const THROWS_NONE

Check if pointer is null – same effect as Empty().

TObjectType * GetPointerOrNull(void) THROWS_NONE

Get pointer value.

TObjectType & GetNCObject(void) const

Get object.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static string IntToString(int value, TNumToStringFlags flags=0, int base=10)

Convert int to string.

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.

double Elapsed(void) const

Return time elapsed since first Start() or last Restart() call (in seconds).

void Start(void)

Start the timer.

static const char label[]

unsigned int

A callback function used to compare two keys in a database.

<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n td

bool ne(T x_, T y_, T round_)

Int4 delta(size_t dimension_, const Int4 *score_)

double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)

void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)

#define PTRENDER_EFFECTS_TIMER_ID

#define PHYLO_MOUSE_CLICK_TIMER_ID

static void s_GenerateCollapsedNode(vector< CVect2< float > > &vertices, size_t circleSegments)

Predicate to find location of a node in above selection set.

Structure holds a 'pointer' from an active tooltip to its corresponding node.

wxRect m_TipRect

Rectangle defining tooltip in screen coords.

CPhyloTreeNode::TTreeIdx m_NodeIdx

Pointer to the node with id m_NodeID.

TModelPoint m_TipCenter

Center of tooltip widget, in screen coords with (0,0) in lower left.

CPhyloTree::TID m_NodeID

ID of the node to point to.

CStopWatch m_Timer

Timer to track duration of arrow display.

A coord (in one of +x,-x,+y,-y) and pixel offset in the same direction.

#define NULL_TREE_IDX

Global define for a NULL link in the tree used for comparison.

float Dot(iterator1 iter1, iterator1 end1, iterator2 iter2, iterator2 end2)

Dot-product similarity.


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