/////////////////////////////////////////////////////////////////////////////////////
| 720 | |
| 721 | ////////////////////////////////////////////////////////////////////////////////////////// |
| 722 | bool |
| 723 | pcl::visualization::ImageViewer::addLine (unsigned int x_min, unsigned int y_min, |
| 724 | unsigned int x_max, unsigned int y_max, |
| 725 | double r, double g, double b, |
| 726 | const std::string &layer_id, double opacity) |
| 727 | { |
| 728 | // Check to see if this ID entry already exists (has it been already added to the visualizer?) |
| 729 | auto am_it = std::find_if (layer_map_.begin (), layer_map_.end (), LayerComparator (layer_id)); |
| 730 | if (am_it == layer_map_.end ()) |
| 731 | { |
| 732 | PCL_DEBUG ("[pcl::visualization::ImageViewer::addLine] No layer with ID='%s' found. Creating new one...\n", layer_id.c_str ()); |
| 733 | am_it = createLayer (layer_id, getSize ()[0] - 1, getSize ()[1] - 1, opacity, false); |
| 734 | } |
| 735 | |
| 736 | vtkSmartPointer<context_items::Line> line = vtkSmartPointer<context_items::Line>::New (); |
| 737 | line->setColors (static_cast<unsigned char> (255.0 * r), |
| 738 | static_cast<unsigned char> (255.0 * g), |
| 739 | static_cast<unsigned char> (255.0 * b)); |
| 740 | line->setOpacity (opacity); |
| 741 | line->set (static_cast<float> (x_min), static_cast<float> (y_min), |
| 742 | static_cast<float> (x_max), static_cast<float> (y_max)); |
| 743 | am_it->actor->GetScene ()->AddItem (line); |
| 744 | |
| 745 | return (true); |
| 746 | } |
| 747 | |
| 748 | ////////////////////////////////////////////////////////////////////////////////////////// |
| 749 | bool |
no test coverage detected