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

Method DrawQuad

IO/ExportPDF/vtkPDFContextDevice2D.cxx:950–978  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

948
949//------------------------------------------------------------------------------
950void vtkPDFContextDevice2D::DrawQuad(float* p, int n)
951{
952 assert(n > 0);
953 assert(p != nullptr);
954
955 if (this->Brush->GetColorObject().GetAlpha() == 0 && this->Brush->GetTexture() == nullptr)
956 {
957 return;
958 }
959
960 this->PushGraphicsState();
961 this->ApplyBrushState();
962 this->RegisterTexturePoints(p, n);
963
964 size_t numQuads = n / 4;
965 for (size_t quad = 0; quad < numQuads; ++quad)
966 {
967 const size_t i = quad * 8; // (4 verts / quad) * (2 floats / vert)
968
969 HPDF_Page_MoveTo(this->Impl->Page, p[i], p[i + 1]);
970 HPDF_Page_LineTo(this->Impl->Page, p[i + 2], p[i + 3]);
971 HPDF_Page_LineTo(this->Impl->Page, p[i + 4], p[i + 5]);
972 HPDF_Page_LineTo(this->Impl->Page, p[i + 6], p[i + 7]);
973 HPDF_Page_ClosePath(this->Impl->Page);
974 }
975
976 this->Fill();
977 this->PopGraphicsState();
978}
979
980//------------------------------------------------------------------------------
981void vtkPDFContextDevice2D::DrawQuadStrip(float* p, int n)

Callers 1

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