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

Method DrawCrossMarkers

IO/ExportPDF/vtkPDFContextDevice2D.cxx:1992–2022  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1990
1991//------------------------------------------------------------------------------
1992void vtkPDFContextDevice2D::DrawCrossMarkers(
1993 bool highlight, float* points, int n, unsigned char* colors, int nc_comps)
1994{
1995 const float markerSize = this->Pen->GetWidth();
1996 const float delta = markerSize * 0.5f;
1997
1998 this->ApplyLineWidth(highlight ? 1.5f : 0.5f);
1999 this->ApplyLineType(vtkPen::SOLID_LINE);
2000 if (!colors)
2001 {
2002 this->ApplyStrokeColor(this->Pen->GetColorObject().GetData(), 4);
2003 }
2004
2005 for (int i = 0; i < n; ++i)
2006 {
2007 float* p = points + i * 2;
2008 if (colors)
2009 {
2010 if (i != 0)
2011 {
2012 this->Stroke();
2013 }
2014 this->ApplyStrokeColor(colors + i * nc_comps, nc_comps);
2015 }
2016 HPDF_Page_MoveTo(this->Impl->Page, p[0] + delta, p[1] + delta);
2017 HPDF_Page_LineTo(this->Impl->Page, p[0] - delta, p[1] - delta);
2018 HPDF_Page_MoveTo(this->Impl->Page, p[0] + delta, p[1] - delta);
2019 HPDF_Page_LineTo(this->Impl->Page, p[0] - delta, p[1] + delta);
2020 }
2021 this->Stroke();
2022}
2023
2024//------------------------------------------------------------------------------
2025void vtkPDFContextDevice2D::DrawPlusMarkers(

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