MCPcopy Create free account
hub / github.com/Kitware/VTK / DrawPoints

Method DrawPoints

IO/ExportPDF/vtkPDFContextDevice2D.cxx:761–791  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

759
760//------------------------------------------------------------------------------
761void vtkPDFContextDevice2D::DrawPoints(float* points, int n, unsigned char* colors, int nc_comps)
762{
763 assert(nc_comps == 0 || colors != nullptr);
764 assert(n > 0);
765 assert(points != nullptr);
766
767 if (!colors && this->Pen->GetColorObject().GetAlpha() == 0)
768 {
769 return;
770 }
771
772 this->PushGraphicsState();
773 this->ApplyPenStateAsFill();
774
775 const vtkVector2f width = this->GetUnscaledPenWidth();
776 const vtkVector2f halfWidth = width * 0.5f;
777
778 for (int i = 0; i < n; ++i)
779 {
780 if (nc_comps > 0)
781 {
782 this->ApplyFillColor(colors + i * nc_comps, nc_comps);
783 }
784 float originX = points[i * 2] - halfWidth[0];
785 float originY = points[i * 2 + 1] - halfWidth[1];
786 HPDF_Page_Rectangle(this->Impl->Page, originX, originY, width[0], width[1]);
787 this->Fill();
788 }
789
790 this->PopGraphicsState();
791}
792
793//------------------------------------------------------------------------------
794void vtkPDFContextDevice2D::DrawPointSprites(

Callers 1

PaintMethod · 0.45

Calls 10

PushGraphicsStateMethod · 0.95
ApplyPenStateAsFillMethod · 0.95
GetUnscaledPenWidthMethod · 0.95
ApplyFillColorMethod · 0.95
FillMethod · 0.95
PopGraphicsStateMethod · 0.95
HPDF_Page_RectangleFunction · 0.85
GetAlphaMethod · 0.80
assertFunction · 0.50
GetColorObjectMethod · 0.45

Tested by 1

PaintMethod · 0.36