m_UseSplines =
false;
92m_RotatedLabels =
false;
93m_ForceSquare =
false;
94m_RegenerateTexture =
false;
95m_LabelViewPct = 0.6f;
96m_RenderScale =
true;
100m_pMouseZoomHandler =
NULL;
102m_SwitchedLayout =
false;
103m_ValidLayout = eNeedLayoutAndSize;
109m_DistanceBarLowerLeft =
true;
110m_RasterRect.Init(0, 0, m_DimX, m_DimY);
112m_BufferdRenderTime = 0.0f;
114m_HighlightLongerEdges =
false;
115m_HighlightFunctionK = 50.0f;
116m_HighlightFunctionMidpoint = 90.0f;
117m_HighlightIntensity = 1.0f;
119 #ifdef ATTRIB_MENU_SUPPORT 122sub_menu->
AddFloatReadOnly(
"Buffered Render Time", &m_BufferdRenderTime);
125sub_menu->
AddFloat(
"Highlight K", &m_HighlightFunctionK, 50.0f, 1.0f, 500.0f, 10.0f);
126sub_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 floatnode_size_scaler = 1.0f;
214 if(!node.
Expanded() && node_size > 2.0f) {
216node_size_scaler = 0.5f;
230gl.
Translatef((
float)p.
X(), (
float)p.
Y(), 0.0);
233gl.
Color3f(0.0f, 0.0f, 0.0f);
235gl.
Enable(GL_LINE_STIPPLE);
239gl.
Begin(GL_LINES);
240gl.
Vertex2f(-node_size, -node_size);
241gl.
Vertex2f(node_size, -node_size);
243gl.
Vertex2f(-node_size, node_size);
244gl.
Vertex2f(node_size, node_size);
246gl.
Vertex2f(-node_size, -node_size);
247gl.
Vertex2f(-node_size, node_size);
249gl.
Vertex2f(node_size, -node_size);
250gl.
Vertex2f(node_size, node_size);
267gl.
Color3f(0.0f, 0.0f, 0.0f);
270gl.
Enable(GL_LINE_STIPPLE);
286gl.
Begin(GL_LINES);
310gl.
Color4f(1.0f, 0.0f, 0.0f, 0.3f);
313gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
316gl.
Begin(GL_LINES);
345 doublerounded = default_scale;
348 if(default_scale < 1.0) {
350 while(rounded < 1.0) {
353rounded = default_scale*multiplier;
356rounded = (double)((
int)(floor(rounded) + 0.5));
357rounded = rounded / multiplier;
362 while(rounded > 10.0) {
364rounded = default_scale*multiplier;
366rounded = (double)((
int)(floor(rounded) + 0.5));
367rounded = rounded / multiplier;
391 floatkSpacing = 4.0f;
397 floattotal_height = vp_height * (1.0 / pct_visible);
398 floatvisible_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) {
459filler_points_node->
GetState().
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
461 if(sel_filler_points_node !=
NULL) {
464sel_filler_points_node->
GetState().
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
480 floatfinal_len = target_len;
483 floatbase_ypos = 20.0f;
501base_xpos = 2.0f*
delta;
505(1.5f*target_len + 20.0f);
506base_xpos =
std::max(0.0f, base_xpos);
526final_len = target_len * rounded/default_scale;
528sprintf(buf_round,
"%.*f",
precision, rounded);
535gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
547gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
549gl.
Begin(GL_LINES);
550gl.
Vertex2f(base_xpos, base_ypos);
551gl.
Vertex2f(base_xpos, base_ypos + bar_height);
553gl.
Vertex2f(base_xpos, base_ypos + bar_height/2.0f);
554gl.
Vertex2f(base_xpos + final_len, base_ypos + bar_height/2.0f);
556gl.
Vertex2f(base_xpos + final_len, base_ypos);
557gl.
Vertex2f(base_xpos + final_len, base_ypos + bar_height);
562 floattx = base_xpos + (float)
delta;
563 floatty = base_ypos + bar_height/2.0f + (float)
delta;
623std::vector<NodePointer>::iterator niter, erase_iter =
m_NodePointers.end();
632 doublex = (*node).X();
633 doubley = (*node).Y();
653gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
675 floatproj_len = proj_dir.
Length();
680 CVect2<float>arrowhead_base(node_proj_pos.
X() - proj_dir.
X()*16.0f,
681node_proj_pos.
Y() - proj_dir.
Y()*16.0f);
684 floatshaft_len = proj_len - 16.0f;
685 if(shaft_len > 0.0f) {
693gl.
Begin(GL_TRIANGLE_STRIP);
706gl.
Begin(GL_TRIANGLES);
737 floatnode_size_scaler = 1.0f;
739 if(!active_node.Expanded() && s > 2.0f ) {
741node_size_scaler = 0.5f;
756gl.
Translatef((
float)p.
X(), (
float)p.
Y(), 0.0);
759gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
764 float delta= 3.141592653589793238463f / num_lines;
766gl.
Begin(GL_TRIANGLE_STRIP);
768 floatangle =
delta;
769 for(
int i= 0;
i< num_lines - 1;
i++) {
770 floatsina = sin(angle), cosa = cos(angle);
912 if(event.Dragging()) {
916wxPoint ms_pos =
event.GetPosition();
1004 boolsel_changed =
false;
1015sel_changed =
true;
1096 else if(proj >
len) {
1102dist =
delta.Length2();
1124 GetEdgeColor(child_node, parent_node, c, parent_color);
1127line_colors.push_back(parent_color.
GetRgbaUC());
1131line_coords.push_back(p1);
1132line_coords.push_back(p2);
1157 boolselected_edge =
GetEdgeColor(child_node, parent_node, c, parent_color);
1163 if(!selected_edge) {
1164line_colors.push_back(parent_color.
GetRgbaUC());
1166line_coords.push_back(p1);
1167line_coords.push_back(p2);
1170sel_line_colors.push_back(parent_color.
GetRgbaUC());
1171sel_line_colors.push_back(c.
GetRgbaUC());
1172sel_line_coords.push_back(p1);
1173sel_line_coords.push_back(p2);
1198 boolselected_edge =
GetEdgeColor(child_node, parent_node, c, parent_color);
1202vector<CVect2<float> >& tree_edge_vec = selected_edge ? sel_edge_node_coords : edge_node_coords;
1203vector<CVect4<unsigned char> >&
colors= selected_edge ? sel_edge_node_colors : edge_node_colors;
1211vector<CVect3<float> >
buf;
1213 floatcur_len = 0.0f;
1215 boolclosest =
false;
1218 for(
i=0;
i<
buf.size()-1; ++
i) {
1221cur_len += (
buf[
i+1]-
buf[
i]).Length();
1222 floatpct_copied = cur_len/
len;
1223col = parent_color*(1.0f-pct_copied) + c*pct_copied;
1229tree_edge_vec.push_back(p1);
1230tree_edge_vec.push_back(p2);
1262 boolselected_edge =
GetEdgeColor(child_node, parent_node, c, parent_color);
1266vector<CVect2<float> >& tree_edge_vec = selected_edge ? sel_edge_node_coords : edge_node_coords;
1267vector<CVect4<unsigned char> >&
colors= selected_edge ? sel_edge_node_colors : edge_node_colors;
1269vector<CVect2<float> >
buf;
1271 floatangle1 = (*parent_node)->GetAngle();
1272 floatangle2 = (*child_node)->GetAngle();
1275 intsteps =
std::abs((
int)floorf((angle1-angle2)*resolution));
1277 if(steps < 2 || radius == 0.0f)
1279 floattdelta = -1.0f*(angle1-angle2)/(
float)steps;
1282 for(
int i=0;
i<=steps; ++
i) {
1289 boolclosest =
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);
1307tree_edge_vec.push_back(p1);
1308tree_edge_vec.push_back(p2);
1322trace_line_colors->push_back(trace_color_uc);
1323trace_line_colors->push_back(trace_color_uc);
1324trace_line_coords->push_back(pt2 -
offset);
1325trace_line_coords->push_back(pt2);
1341trace_point_coords->push_back(pt2 -
offset);
1342trace_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);
1359tree_edge_vec.push_back(p1);
1360tree_edge_vec.push_back(p2);
1388 boolselected_edge =
GetEdgeColor(child_node, parent_node, c, parent_color);
1394 if(!selected_edge) {
1395edge_node_colors.push_back(parent_color_uc);
1396edge_node_colors.push_back(parent_color_uc);
1397edge_node_colors.push_back(parent_color_uc);
1398edge_node_colors.push_back(c.
GetRgbaUC());
1400edge_node_coords.push_back(pt1);
1401edge_node_coords.push_back(mid_point);
1402edge_node_coords.push_back(mid_point);
1403edge_node_coords.push_back(pt2);
1406sel_edge_node_colors.push_back(parent_color_uc);
1407sel_edge_node_colors.push_back(parent_color_uc);
1408sel_edge_node_colors.push_back(parent_color_uc);
1409sel_edge_node_colors.push_back(c.
GetRgbaUC());
1411sel_edge_node_coords.push_back(pt1);
1412sel_edge_node_coords.push_back(mid_point);
1413sel_edge_node_coords.push_back(mid_point);
1414sel_edge_node_coords.push_back(pt2);
1435 floatcap_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_tsteps =
max((
size_t)1, circleSegments / 2);
1443 for(
size_t i= 0;
i< steps; ++
i) {
1444 floatcosa = cosf(
a);
1445 floatsina = sinf(
a);
1446vertices.push_back(
CVect2<float>(cap_end*(1 - cosa), -cap_end * sina));
1447vertices.push_back(
CVect2<float>(cap_end*(1 - cosa), cap_end*sina));
1458 size_tcircleSegments,
1470vector<CVect2<float> > vb;
1472geom->SetVertexBuffer2D(vb);
1481 n->SetVBOGeom(geom);
1488 n->SetRotationZ(angle);
1499m(0, 0) = width_scale;
1500m(1, 1) = node_scale;
1501m(2, 2) = node_scale;
1502m(0, 3) = (**node).X() -
delta.X();
1503m(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);
1535glPushAttrib(GL_ALL_ATTRIB_BITS);
1537vector<CVect2<float> > vb;
1560 if(cosf((**node).GetAngle()) < 0.0f)
1561angle = (float)M_PI;
1563 n->SetRotationZ(angle);
1571 if(width_scale == 0.0f)
1572width_scale = node_scale;
1575m(0, 0) = width_scale;
1576m(1, 1) = node_scale;
1577m(2, 2) = node_scale;
1578m(0, 3) = (**node).X() -
delta.X();
1579m(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);
1605vector<float>& color_coords,
1613 floatthis_node_size = def_node_size;
1616 intnum_lines =
int(
std::max(2.0f, def_node_size) * 10.0f);
1621 if(collapsed_node) {
1624 switch(
GetGl().GetApi()) {
1655color_coords.push_back(color_coord);
1661 if((**node).HasNodeMarker()) {
1672m(0,3) = (**node).X();
1673m(1,3) = (**node).Y();
1682vector<CVect2<float> > vb;
1683vector<CRgbaColor> cb;
1685 floattarget_alpha = 1.0f;
1691 size_tcolor_count = (**node).GetMarkerColors().size();
1692 floatcolor_countf = (float)color_count;
1697 if((**node).GetNodeSize() > 0)
1698s2 = (**node).GetNodeSize();
1700s2 *= (**node).GetMarkerSize();
1702 float delta= 6.28f/(float)num_lines;
1703 floatangle = 3.14159f/2.0f;
1704 for(
int i=0;
i<num_lines;
i++){
1705 size_tcolor_idx = (size_t)((((
float)
i)/(
float)(num_lines)) * color_countf);
1706color_idx =
std::min(color_idx, color_count-1);
1707 CRgbaColorc = (**node).GetMarkerColors()[color_idx];
1718s2*sinf(angle+
delta)));
1727 if((**node).GetBoundedDisplay()) {
1742c.
Lighten(1.0f - node_alpha);
1768 boolrecompute = (
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(
1816boundary_pts, scale, node_pos, layout_type);
1838 if(x1 > x2)
swap(x1, x2);
1839 if(y1 > y2)
swap(y1, y2);
1886std::vector<ProjectionElement>& xexts,
1887std::vector<ProjectionElement>& yexts,
1893 floatgoal = ((float)(
limits.Right()-
limits.Left()))/1e04f;
1896 float delta= 1e10f;
1897 floatprev_delta = 1e10f;
1900 floatviewport_x, viewport_y;
1903 floatleft =
limits.Left();
1904 floatright =
limits.Right();
1905 floattop =
limits.Top();
1906 floatbottom =
limits.Bottom();
1920 while(
delta> goal &&
count++ < max_iterations
) {
1921prev_delta =
delta;
1926 floatviewport_maxx = -1e10f;
1927 floatviewport_minx = 1e10f;
1928 floatviewport_maxy = -1e10f;
1929 floatviewport_miny = 1e10f;
1933 floatnode_maxx = -1e10f;
1934 floatnode_minx = 1e10f;
1935 floatnode_maxy = -1e10f;
1936 floatnode_miny = 1e10f;
1945 floatlabel_zoom = 1.0f;
1953 floatdistance_between_nodes =
1961label_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);
1993node_maxx =
std::max(viewport_x, node_maxx);
1994node_minx =
std::min(viewport_x, node_minx);
1996xexts[
i].m_ProjectionCood = viewport_x;
1999viewport_maxx = node_maxx;
2000viewport_minx = node_minx;
2001node_extents.
SetRight(viewport_maxx);
2002node_extents.
SetLeft(viewport_minx);
2012 for(
size_t i=0;
i<xexts.size(); ++
i) {
2014viewport_x = xexts[
i].m_ProjectionCood;
2017 floatoffsetx = xexts[
i].m_PixelOffset*label_zoom;
2031overlap_x = (node_maxx - viewport_x);
2033overlap_x = (viewport_x - node_minx);
2047 std::min(non_overlap_x, scaled_width);
2048offsetx = (offsetx >= 0.0f) ? usable_offsetx : -usable_offsetx;
2052 if(offsetx != 0.0f) {
2053viewport_x += offsetx;
2054viewport_maxx =
std::max(viewport_x, viewport_maxx);
2055viewport_minx =
std::min(viewport_x, viewport_minx);
2059text_extents.
SetRight(viewport_maxx);
2060text_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);
2066viewport_maxy =
std::max(viewport_y, viewport_maxy);
2067viewport_miny =
std::min(viewport_y, viewport_miny);
2071node_maxy =
std::max(viewport_y, node_maxy);
2072node_miny =
std::min(viewport_y, node_miny);
2074yexts[
i].m_ProjectionCood = viewport_y;
2077viewport_maxy = node_maxy;
2078viewport_miny = node_miny;
2079node_extents.
SetTop(viewport_maxy);
2080node_extents.
SetBottom(viewport_miny);
2082 for(
size_t i=0;
i<yexts.size(); ++
i) {
2084viewport_y = yexts[
i].m_ProjectionCood;
2087 floatoffsety = yexts[
i].m_PixelOffset*label_zoom;
2093overlap_y = (node_maxy - viewport_y);
2095overlap_y = (viewport_y - node_miny);
2104offsety = (offsety >= 0.0f) ? usable_offsety : -usable_offsety;
2108 if(offsety != 0.0f) {
2109viewport_y += offsety;
2110viewport_maxy =
std::max(viewport_y, viewport_maxy);
2111viewport_miny =
std::min(viewport_y, viewport_miny);
2115text_extents.
SetTop(viewport_maxy);
2116text_extents.
SetBottom(viewport_miny);
2125 if(viewport_maxx != -1e10f) {
2127 if(
fabs(rd) > 0.0f) {
2129 floatoff = (rd/vp_width)*(right-left);
2134 if(viewport_minx != 1e10f) {
2136 if(
fabs(ld) > 0.0f) {
2138 floatoff = (ld/vp_width)*(right-left);
2143 if( viewport_maxy != -1e10f) {
2145 if(
fabs(
td) > 0.0f) {
2147 floatoff = (
td/vp_height)*(top-bottom);
2152 if( viewport_miny != 1e10f) {
2154 if(
fabs(bd) > 0.0f) {
2156 floatoff = (bd/vp_height)*(top-bottom);
2161vp_extent.
Set(viewport_maxx-viewport_minx,
2162viewport_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 floatmax_pixel_offset = -FLT_MAX;
2217 boolresolved =
false;
2218 size_terase_from = -1;
2222 for(
size_text_idx=0; ext_idx<
m_Extents.size() && !resolved; ++ext_idx) {
2223max_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;
2231erase_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;
2246erase_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_terase_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) {
2289dim << m_Extents[
i].m_NodeCoord <<
" ) Pix: ( "<<
2290m_Extents[
i].m_PixelOffset <<
" ) ");
2308GLdouble 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()) {
2341bottom =
r.Bottom();
2346 double a= (double)node->GetAngle();
2348 if(
a> (M_PI / 2.0) &&
a< ((3.0*M_PI) / 2.0)) {
2352 floatcos_a = (float)cos(
a);
2353 floatsin_a = (float)sin(
a);
2366 for(
intcorner = 0; corner < 4; ++corner) {
2370 CVect2<float>rpos(pos.
X()*cos_a - pos.
Y()*sin_a, pos.
X()*sin_a + pos.
Y()*cos_a);
2389vector<ProjectionElement>& yexts)
2393xexts = 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;
2399xexts.push_back(
ne);
2404yexts = 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;
2410yexts.push_back(
ne);
2416 _TRACE(
"Dumping + X Dimension:");
2417m_MaxX.DumpExtent(
" X Pos: ( ");
2420 _TRACE(
"Dumping + Y Dimension:");
2421m_MaxY.DumpExtent(
" Y Pos: ( ");
2424 _TRACE(
"Dumping - X Dimension:");
2425m_MinX.DumpExtent(
" -X Pos: ( ");
2428 _TRACE(
"Dumping - Y Dimension:");
2429m_MinY.DumpExtent(
" -Y Pos: ( ");
2434 boolinit_collision_info)
2436GLdouble top, bottom, left, right;
2453vector<ProjectionElement> xexts, yexts;
2460 booltoo_small =
false;
2502 floatleft_pct = 0.0f;
2503 floatright_pct = 0.0f;
2504 floatbottom_pct = 0.0f;
2505 floattop_pct = 0.0f;
2507 if(
limits.Width() > 0.0 &&
limits.Height() > 0.0) {
2527 boolinit_collision_info,
2543render_total.
Start();
2587 if(init_collision_info)
2602 floatcollision_resolution =
max(ceilf(sqrtf(
m_DS->
GetSize())),
2607collision_resolution,
2634 floatnode_size = 0.0f;
2637node_size = def_node_size;
2684 if(edge_node !=
NULL&&
2685narrow_edge_node !=
NULL) {
2691narrow_edge_node->
SetVisible(line_width > 1.0f);
2692sel_narrow_edge_node->
SetVisible(line_width > 1.0f);
2710 for(
size_t i= 0;
i< nodes.size(); ++
i) {
2711 if(nodes[
i]->GetName() ==
"CollapsedNode") {
2712nodes[
i]->SetVisible(node_size > 0.0f);
2721 if(s.
X() != scale2d.
X() || s.
Y() != scale2d.
Y())
2732render_total.
Start();
2754rmgrgl->Disable(GL_TEXTURE_1D);
2755rmgrgl->Disable(GL_TEXTURE_2D);
2771glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2789glClear(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);
2881glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2898glPushAttrib(GL_ALL_ATTRIB_BITS);
2900 m_MinimapBuffer->SetTextureFiltering(GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR);
2907 autorenderer = [
this, w, h]() {
2909GLint vp_width, vp_height;
2912vp_height = (
int)(((
float)vp_width)*((
float)h) / (
float)w);
2916vp_width = (
int)(((
float)vp_height)*((
float)w) / (
float)h);
2945 m_Texture->SetFilterMin(GL_LINEAR_MIPMAP_LINEAR);
2956glDrawBuffer(GL_BACK);
2961glPixelStorei(GL_PACK_ALIGNMENT, 1);
2963glReadBuffer(GL_BACK);
2964glReadPixels(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)
2998xcoord_limit = 1.0f;
2999ycoord_limit = ((float)h)/(float)w;
3002ycoord_limit = 1.0f;
3003xcoord_limit = ((float)w)/(float)h;
3055 if(node !=
NULL) {
3150 floatnode_alpha = 1.0f;
3158CPhyloTree::TSelState::iterator iter =
3163sel_state = (*iter).second;
3200 shortnode_color_idx = (**node).GetNodeFgColorIdx();
3201 if(node_color_idx != -1)
3202 returnnode_color_idx;
3203 else if((**node).GetClusterColorIdx() != -1)
3204 return((**node).GetClusterColorIdx());
3212 shortlabel_color_idx = (**node).GetLabelFgColorIdx();
3213 if(label_color_idx != -1)
3214 returnlabel_color_idx;
3225 shortparent_color_idx = -1;
3228 boolselected_state =
false;
3236 if(beg_state != end_state &&
3242color_idx = (**child_node).GetClusterColorIdx();
3243 if(color_idx == -1) {
3244color_idx = (**child_node).GetNodeEdColorIdx();
3245parent_color_idx = (**parent_node).GetNodeEdColorIdx();
3248 if(color_idx == -1){
3261 floattransparency = 1.0f / (1.0f + powf(
M_NCBI_E,
3267c.
Lighten(1.0f - transparency);
3283selected_state =
true;
3290 if(parent_color_idx != -1 && (**child_node).GetEdgeColorGradient()) {
3295 returnselected_state;
3305 floatheight_factor,
3310vector<ProjectionElement> xexts, yexts;
3317label_height = (
int)min_height;
3323 floatwidth = ((float)
m_SL->
GetNodeSize())*width_factor*tree_height;
3329 floatcomputed_wh_ratio = width/min_height;
3330 if(computed_wh_ratio < wh_ratio) {
3331width = wh_ratio*min_height;
3333 else if(computed_wh_ratio > wh_ratio) {
3334min_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);
3360GLdouble top_margin, bottom_margin, left_margin, right_margin;
3361 m_SL->
GetMargins(top_margin, bottom_margin, left_margin, right_margin);
3371 TModelUnitw = width + left_pixels + right_pixels + left_margin + right_margin;
3372 TModelUnith = min_height + top_pixels + bottom_pixels + top_margin + bottom_margin;
3378 floatcomputed_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));
3399GLdouble left, bottom, right, top;
3403vp_height -= (
int)(bottom + top);
3443d = d - (d / 4.0f) + 1.0;
3458 floatactual_size = 0.0f;
3467actual_size = node_size;
3470actual_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 > ¢er, 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