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

Function printText

examples/segmentation/example_supervoxels.cpp:512–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510
511
512void printText (pcl::visualization::PCLVisualizer::Ptr viewer)
513{
514 std::string on_str = "on";
515 std::string off_str = "off";
516 if (!viewer->updateText ("Press (1-n) to show different elements (h) to disable this", 5, 72, 12, 1.0, 1.0, 1.0,"hud_text"))
517 viewer->addText ("Press 1-n to show different elements", 5, 72, 12, 1.0, 1.0, 1.0,"hud_text");
518
519 std::string temp = "(1) Voxels currently " + ((show_voxel_centroids)?on_str:off_str);
520 if (!viewer->updateText (temp, 5, 60, 10, 1.0, 1.0, 1.0, "voxel_text"))
521 viewer->addText (temp, 5, 60, 10, 1.0, 1.0, 1.0, "voxel_text");
522
523 temp = "(2) Supervoxels currently "+ ((show_supervoxels)?on_str:off_str);
524 if (!viewer->updateText (temp, 5, 50, 10, 1.0, 1.0, 1.0, "supervoxel_text") )
525 viewer->addText (temp, 5, 50, 10, 1.0, 1.0, 1.0, "supervoxel_text");
526
527 temp = "(3) Graph currently "+ ((show_graph)?on_str:off_str);
528 if (!viewer->updateText (temp, 5, 40, 10, 1.0, 1.0, 1.0, "graph_text") )
529 viewer->addText (temp, 5, 40, 10, 1.0, 1.0, 1.0, "graph_text");
530
531 temp = "(4) Voxel Normals currently "+ ((show_normals)?on_str:off_str);
532 if (!viewer->updateText (temp, 5, 30, 10, 1.0, 1.0, 1.0, "voxel_normals_text") )
533 viewer->addText (temp, 5, 30, 10, 1.0, 1.0, 1.0, "voxel_normals_text");
534
535 temp = "(5) Supervoxel Normals currently "+ ((show_supervoxel_normals)?on_str:off_str);
536 if (!viewer->updateText (temp, 5, 20, 10, 1.0, 1.0, 1.0, "supervoxel_normals_text") )
537 viewer->addText (temp, 5, 20, 10, 1.0, 1.0, 1.0, "supervoxel_normals_text");
538
539 temp = "(0) Showing "+ std::string((show_refined)?"":"UN-") + "refined supervoxels and normals";
540 if (!viewer->updateText (temp, 5, 10, 10, 1.0, 1.0, 1.0, "refined_text") )
541 viewer->addText (temp, 5, 10, 10, 1.0, 1.0, 1.0, "refined_text");
542}
543
544void removeText (pcl::visualization::PCLVisualizer::Ptr viewer)
545{

Callers 1

mainFunction · 0.70

Calls 2

updateTextMethod · 0.80
addTextMethod · 0.45

Tested by

no test coverage detected