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

Method CreatePlotData

Rendering/Annotation/vtkXYPlotActor.cxx:1765–2125  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1763
1764//------------------------------------------------------------------------------
1765void vtkXYPlotActor::CreatePlotData(
1766 int* pos, int* pos2, double xRange[2], double yRange[2], double* lengths, int numDS, int numDO)
1767{
1768 double xyz[3];
1769 xyz[2] = 0.;
1770 int i, numLinePts, doNum, num;
1771 vtkIdType numPts, ptId, id;
1772 double length, x[3], xPrev[3];
1773 vtkDataArray* scalars;
1774 int component;
1775 vtkDataSet* ds;
1776 vtkCellArray* lines;
1777 vtkPoints* pts;
1778 int clippingRequired = 0;
1779
1780 // Allocate resources for the polygonal plots
1781 //
1782 num = (numDS > numDO ? numDS : numDO);
1783 this->InitializeEntries();
1784 this->NumberOfInputs = num;
1785 this->PlotData = new vtkPolyData*[num];
1786 this->PlotGlyph = new vtkGlyph2D*[num];
1787 this->PlotAppend = new vtkAppendPolyData*[num];
1788 this->PlotMapper = new vtkPolyDataMapper2D*[num];
1789 this->PlotActor = new vtkActor2D*[num];
1790 for (i = 0; i < num; i++)
1791 {
1792 this->PlotData[i] = vtkPolyData::New();
1793 this->PlotGlyph[i] = vtkGlyph2D::New();
1794 this->PlotGlyph[i]->SetInputData(this->PlotData[i]);
1795 this->PlotGlyph[i]->SetScaleModeToDataScalingOff();
1796 this->PlotAppend[i] = vtkAppendPolyData::New();
1797 this->PlotAppend[i]->AddInputData(this->PlotData[i]);
1798 if (this->LegendActor->GetEntrySymbol(i) != nullptr &&
1799 this->LegendActor->GetEntrySymbol(i) != this->GlyphSource->GetOutput())
1800 {
1801 this->PlotGlyph[i]->SetSourceData(this->LegendActor->GetEntrySymbol(i));
1802 this->PlotGlyph[i]->SetScaleFactor(this->ComputeGlyphScale(i, pos, pos2));
1803 this->PlotAppend[i]->AddInputConnection(this->PlotGlyph[i]->GetOutputPort());
1804 }
1805 this->PlotMapper[i] = vtkPolyDataMapper2D::New();
1806 this->PlotMapper[i]->SetInputConnection(this->PlotAppend[i]->GetOutputPort());
1807 this->PlotMapper[i]->ScalarVisibilityOff();
1808 this->PlotActor[i] = vtkActor2D::New();
1809 this->PlotActor[i]->SetMapper(this->PlotMapper[i]);
1810 this->PlotActor[i]->GetProperty()->DeepCopy(this->GetProperty());
1811 if (this->LegendActor->GetEntryColor(i)[0] < 0.0)
1812 {
1813 this->PlotActor[i]->GetProperty()->SetColor(this->GetProperty()->GetColor());
1814 }
1815 else
1816 {
1817 this->PlotActor[i]->GetProperty()->SetColor(this->LegendActor->GetEntryColor(i));
1818 }
1819 }
1820
1821 // Prepare to receive data
1822 this->GenerateClipPlanes(pos, pos2);

Callers 1

RenderOpaqueGeometryMethod · 0.95

Calls 15

InitializeEntriesMethod · 0.95
ComputeGlyphScaleMethod · 0.95
GenerateClipPlanesMethod · 0.95
ClipPlotDataMethod · 0.95
GetPlotLinesMethod · 0.95
GetPlotPointsMethod · 0.95
GetEntrySymbolMethod · 0.80
SetScaleFactorMethod · 0.80
GetEntryColorMethod · 0.80
AllocateEstimateMethod · 0.80
SetVertsMethod · 0.80

Tested by

no test coverage detected