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

Method addLine

visualization/src/image_viewer.cpp:722–746  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

720
721//////////////////////////////////////////////////////////////////////////////////////////
722bool
723pcl::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//////////////////////////////////////////////////////////////////////////////////////////
749bool

Callers 8

showCamerasFunction · 0.45
drawCameraFunction · 0.45
processMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 7

LayerComparatorClass · 0.85
NewFunction · 0.85
addLineFunction · 0.85
setColorsMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected