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

Method DrawPolygon

IO/ExportPDF/vtkPDFContextDevice2D.cxx:1012–1038  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1010
1011//------------------------------------------------------------------------------
1012void vtkPDFContextDevice2D::DrawPolygon(float* f, int n)
1013{
1014 assert(n > 0);
1015 assert(f != nullptr);
1016
1017 if (this->Brush->GetColorObject().GetAlpha() == 0 && this->Brush->GetTexture() == nullptr)
1018 {
1019 return;
1020 }
1021
1022 this->PushGraphicsState();
1023 this->ApplyBrushState();
1024 this->RegisterTexturePoints(f, n);
1025
1026 HPDF_Page_MoveTo(this->Impl->Page, f[0], f[1]);
1027
1028 for (int i = 1; i < n; ++i)
1029 {
1030 HPDF_Page_LineTo(this->Impl->Page, f[i * 2], f[i * 2 + 1]);
1031 }
1032
1033 HPDF_Page_ClosePath(this->Impl->Page);
1034
1035 this->Fill();
1036
1037 this->PopGraphicsState();
1038}
1039
1040//------------------------------------------------------------------------------
1041void vtkPDFContextDevice2D::DrawColoredPolygon(

Callers 2

DrawColoredPolygonMethod · 0.95
PaintMethod · 0.45

Calls 12

PushGraphicsStateMethod · 0.95
ApplyBrushStateMethod · 0.95
RegisterTexturePointsMethod · 0.95
FillMethod · 0.95
PopGraphicsStateMethod · 0.95
HPDF_Page_MoveToFunction · 0.85
HPDF_Page_LineToFunction · 0.85
HPDF_Page_ClosePathFunction · 0.85
GetAlphaMethod · 0.80
assertFunction · 0.50
GetColorObjectMethod · 0.45
GetTextureMethod · 0.45

Tested by 1

PaintMethod · 0.36