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

Method DrawPlusMarkers

IO/ExportPDF/vtkPDFContextDevice2D.cxx:2025–2055  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2023
2024//------------------------------------------------------------------------------
2025void vtkPDFContextDevice2D::DrawPlusMarkers(
2026 bool highlight, float* points, int n, unsigned char* colors, int nc_comps)
2027{
2028 const float markerSize = this->Pen->GetWidth();
2029 const float delta = markerSize * 0.5f;
2030
2031 this->ApplyLineWidth(highlight ? 1.5f : 0.5f);
2032 this->ApplyLineType(vtkPen::SOLID_LINE);
2033 if (!colors)
2034 {
2035 this->ApplyStrokeColor(this->Pen->GetColorObject().GetData(), 4);
2036 }
2037
2038 for (int i = 0; i < n; ++i)
2039 {
2040 float* p = points + i * 2;
2041 if (colors)
2042 {
2043 if (i != 0)
2044 {
2045 this->Stroke();
2046 }
2047 this->ApplyStrokeColor(colors + i * nc_comps, nc_comps);
2048 }
2049 HPDF_Page_MoveTo(this->Impl->Page, p[0], p[1] + delta);
2050 HPDF_Page_LineTo(this->Impl->Page, p[0], p[1] - delta);
2051 HPDF_Page_MoveTo(this->Impl->Page, p[0] + delta, p[1]);
2052 HPDF_Page_LineTo(this->Impl->Page, p[0] - delta, p[1]);
2053 }
2054 this->Stroke();
2055}
2056
2057//------------------------------------------------------------------------------
2058void vtkPDFContextDevice2D::DrawSquareMarkers(

Callers 1

DrawMarkersMethod · 0.95

Calls 9

ApplyLineWidthMethod · 0.95
ApplyLineTypeMethod · 0.95
ApplyStrokeColorMethod · 0.95
StrokeMethod · 0.95
HPDF_Page_MoveToFunction · 0.85
HPDF_Page_LineToFunction · 0.85
GetWidthMethod · 0.45
GetDataMethod · 0.45
GetColorObjectMethod · 0.45

Tested by

no test coverage detected