| 185 | } |
| 186 | |
| 187 | void vtkGraphItem::PaintBuffers(vtkContext2D* painter) |
| 188 | { |
| 189 | if (this->Internal->EdgePositions.empty()) |
| 190 | { |
| 191 | return; |
| 192 | } |
| 193 | vtkIdType numEdges = static_cast<vtkIdType>(this->Internal->EdgePositions.size()); |
| 194 | for (vtkIdType edgeIdx = 0; edgeIdx < numEdges; ++edgeIdx) |
| 195 | { |
| 196 | if (this->Internal->EdgePositions[edgeIdx].empty()) |
| 197 | { |
| 198 | continue; |
| 199 | } |
| 200 | painter->GetPen()->SetWidth(this->Internal->EdgeWidths[edgeIdx]); |
| 201 | painter->DrawPoly(this->Internal->EdgePositions[edgeIdx][0].GetData(), |
| 202 | static_cast<int>(this->Internal->EdgePositions[edgeIdx].size()), |
| 203 | this->Internal->EdgeColors[edgeIdx][0].GetData(), 4); |
| 204 | } |
| 205 | |
| 206 | if (this->Internal->VertexPositions.empty()) |
| 207 | { |
| 208 | return; |
| 209 | } |
| 210 | painter->GetPen()->SetWidth(this->Internal->VertexSizes[0]); |
| 211 | painter->GetBrush()->SetTextureProperties(vtkBrush::Linear); |
| 212 | painter->DrawPointSprites(this->Sprite, this->Internal->VertexPositions[0].GetData(), |
| 213 | static_cast<int>(this->Internal->VertexPositions.size()), |
| 214 | this->Internal->VertexColors[0].GetData(), 4); |
| 215 | } |
| 216 | |
| 217 | vtkIdType vtkGraphItem::NumberOfVertices() |
| 218 | { |