MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / printText

Function printText

examples/segmentation/example_cpc_segmentation.cpp:591–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589/// -------------------------| Definitions of helper functions|-------------------------
590
591void
592printText (pcl::visualization::PCLVisualizer::Ptr viewer_arg)
593{
594 std::string on_str = "ON";
595 std::string off_str = "OFF";
596 int top = 100;
597 if (!viewer_arg->updateText ("Press (1-n) to show different elements (d) to disable this", 5, top, 12, textcolor, textcolor, textcolor, "hud_text"))
598 viewer_arg->addText ("Press (1-n) to show different elements", 5, top, 12, textcolor, textcolor, textcolor, "hud_text");
599
600 top -= 12;
601 std::string temp = "(1) Supervoxel Normals, currently " + ( (show_normals) ? on_str : off_str);
602 if (!viewer_arg->updateText (temp, 5, top, 10, textcolor, textcolor, textcolor, "normals_text"))
603 viewer_arg->addText (temp, 5, top, 10, textcolor, textcolor, textcolor, "normals_text");
604
605 top -= 24;
606 temp = "(2) Adjacency Graph, currently " + ( (show_adjacency) ? on_str : off_str) + "\n White: convex; Red: concave, Green: cut";
607 if (!viewer_arg->updateText (temp, 5, top, 10, textcolor, textcolor, textcolor, "graph_text"))
608 viewer_arg->addText (temp, 5, top, 10, textcolor, textcolor, textcolor, "graph_text");
609
610 top -= 12;
611 temp = "(3) Press to show SEGMENTATION";
612 if (!viewer_arg->updateText (temp, 5, top, 10, textcolor, textcolor, textcolor, "seg_text"))
613 viewer_arg->addText (temp, 5, top, 10, textcolor, textcolor, textcolor, "seg_text");
614
615 top -= 12;
616 temp = "(4) Press to show SUPERVOXELS";
617 if (!viewer_arg->updateText (temp, 5, top, 10, textcolor, textcolor, textcolor, "supervoxel_text"))
618 viewer_arg->addText (temp, 5, top, 10, textcolor, textcolor, textcolor, "supervoxel_text");
619
620 top -= 12;
621 temp = "(5/6) Press to increase/decrease normals scale, currently " + boost::str (boost::format ("%.3f") % normals_scale);
622 if (!viewer_arg->updateText (temp, 5, top, 10, textcolor, textcolor, textcolor, "normals_scale_text"))
623 viewer_arg->addText (temp, 5, top, 10, textcolor, textcolor, textcolor, "normals_scale_text");
624 top -= 12;
625 temp = "(7/8) Press to increase/decrease line width, currently " + boost::str (boost::format ("%.3f") % line_width);
626 if (!viewer_arg->updateText (temp, 5, top, 10, textcolor, textcolor, textcolor, "line_width_text"))
627 viewer_arg->addText (temp, 5, top, 10, textcolor, textcolor, textcolor, "line_width_text");
628}
629
630void
631removeText (pcl::visualization::PCLVisualizer::Ptr viewer_arg)

Callers 1

mainFunction · 0.70

Calls 3

updateTextMethod · 0.80
formatEnum · 0.50
addTextMethod · 0.45

Tested by

no test coverage detected