88 #ifndef vtkXYPlotActor_h
89 #define vtkXYPlotActor_h
91 #define VTK_XYPLOT_INDEX 0
92 #define VTK_XYPLOT_ARC_LENGTH 1
93 #define VTK_XYPLOT_NORMALIZED_ARC_LENGTH 2
94 #define VTK_XYPLOT_VALUE 3
96 #define VTK_XYPLOT_ROW 0
97 #define VTK_XYPLOT_COLUMN 1
99 #define VTK_XYPLOT_Y_AXIS_TOP 0
100 #define VTK_XYPLOT_Y_AXIS_HCENTER 1
101 #define VTK_XYPLOT_Y_AXIS_VCENTER 2 // rotate by 90 degrees (y-axis aligned)
104 #include "vtkRenderingAnnotationModule.h"
107 class vtkXYPlotActorConnections;
160 this->AddDataSetInputConnection(in,
nullptr, 0);
173 this->RemoveDataSetInputConnection(in,
nullptr, 0);
181 void RemoveAllDataSetInputConnections();
188 void SetPointComponent(
int i,
int comp);
189 int GetPointComponent(
int i);
205 vtkGetMacro(XValues,
int);
210 const char* GetXValuesAsString();
241 vtkGetMacro(DataObjectPlotMode,
int);
244 const char* GetDataObjectPlotModeAsString();
256 void SetDataObjectXComponent(
int i,
int comp);
257 int GetDataObjectXComponent(
int i);
269 void SetDataObjectYComponent(
int i,
int comp);
270 int GetDataObjectYComponent(
int i);
279 void SetPlotColor(
int i,
double r,
double g,
double b);
287 void SetPlotLabel(
int i,
const char* label);
288 const char* GetPlotLabel(
int i);
301 void SetPlotLines(
int i,
int);
302 int GetPlotLines(
int i);
304 void SetPlotPoints(
int i,
int);
305 int GetPlotPoints(
int i);
355 vtkSetStringMacro(Title);
356 vtkGetStringMacro(Title);
363 vtkSetStringMacro(XTitle);
364 vtkGetStringMacro(XTitle);
371 virtual void SetYTitle(
const char*);
393 vtkSetVector2Macro(XRange,
double);
394 vtkGetVectorMacro(XRange,
double, 2);
395 vtkSetVector2Macro(YRange,
double);
396 vtkGetVectorMacro(YRange,
double, 2);
399 this->SetXRange(xmin, xmax);
400 this->SetYRange(ymin, ymax);
411 vtkSetClampMacro(NumberOfXLabels,
int, 0, 50);
412 vtkGetMacro(NumberOfXLabels,
int);
413 vtkSetClampMacro(NumberOfYLabels,
int, 0, 50);
414 vtkGetMacro(NumberOfYLabels,
int);
417 this->SetNumberOfXLabels(num);
418 this->SetNumberOfYLabels(num);
430 void SetAdjustXLabels(
int adjust);
431 vtkGetMacro(AdjustXLabels,
int);
432 void SetAdjustYLabels(
int adjust);
433 vtkGetMacro(AdjustYLabels,
int);
440 void SetNumberOfXMinorTicks(
int num);
441 int GetNumberOfXMinorTicks();
442 void SetNumberOfYMinorTicks(
int num);
443 int GetNumberOfYMinorTicks();
462 vtkSetVector2Macro(TitlePosition,
double);
463 vtkGetVector2Macro(TitlePosition,
double);
484 AlignAxisLeft = 0x100,
485 AlignAxisRight = 0x200,
486 AlignAxisHCenter = 0x400,
487 AlignAxisTop = 0x1000,
488 AlignAxisBottom = 0x2000,
489 AlignAxisVCenter = 0x4000
500 vtkSetMacro(AdjustTitlePositionMode,
int);
501 vtkGetMacro(AdjustTitlePositionMode,
int);
513 vtkSetVector2Macro(LegendPosition,
double);
514 vtkGetVector2Macro(LegendPosition,
double);
515 vtkSetVector2Macro(LegendPosition2,
double);
516 vtkGetVector2Macro(LegendPosition2,
double);
559 virtual void SetLabelFormat(
const char*);
567 virtual void SetXLabelFormat(
const char*);
568 vtkGetStringMacro(XLabelFormat);
575 virtual void SetYLabelFormat(
const char*);
576 vtkGetStringMacro(YLabelFormat);
584 vtkSetClampMacro(Border,
int, 0, 50);
585 vtkGetMacro(Border,
int);
615 vtkSetClampMacro(GlyphSize,
double, 0.0, 0.2);
616 vtkGetMacro(GlyphSize,
double);
623 void ViewportToPlotCoordinate(
vtkViewport* viewport,
double& u,
double& v);
631 void ViewportToPlotCoordinate(
vtkViewport* viewport);
632 vtkSetVector2Macro(PlotCoordinate,
double);
633 vtkGetVector2Macro(PlotCoordinate,
double);
639 void PlotToViewportCoordinate(
vtkViewport* viewport,
double& u,
double& v);
648 void PlotToViewportCoordinate(
vtkViewport* viewport);
649 vtkSetVector2Macro(ViewportCoordinate,
double);
650 vtkGetVector2Macro(ViewportCoordinate,
double);
657 int IsInPlot(
vtkViewport* viewport,
double u,
double v);
697 vtkSetMacro(ReferenceXValue,
double);
698 vtkGetMacro(ReferenceXValue,
double);
714 vtkSetMacro(ReferenceYValue,
double);
715 vtkGetMacro(ReferenceYValue,
double);
726 void PrintAsCSV(ostream& os);
755 void SetXTitlePosition(
double position);
756 double GetXTitlePosition();
763 vtkSetMacro(YTitlePosition,
int);
764 vtkGetMacro(YTitlePosition,
int);
774 virtual void SetPlotGlyphType(
int,
int);
775 virtual void SetLineWidth(
double);
776 virtual void AddUserCurvesPoint(
double,
double,
double);
777 virtual void RemoveAllActiveCurves();
784 virtual void SetLegendBorder(
int);
785 virtual void SetLegendBox(
int);
786 virtual void SetLegendUseBackground(
int);
787 virtual void SetLegendBackgroundColor(
double,
double,
double);
794 virtual void SetTitleColor(
double,
double,
double);
795 virtual void SetTitleFontFamily(
int);
796 virtual void SetTitleBold(
int);
797 virtual void SetTitleItalic(
int);
798 virtual void SetTitleShadow(
int);
799 virtual void SetTitleFontSize(
int);
800 virtual void SetTitleJustification(
int);
801 virtual void SetTitleVerticalJustification(
int);
808 virtual void SetXAxisColor(
double,
double,
double);
809 virtual void SetYAxisColor(
double,
double,
double);
816 virtual void SetAxisTitleColor(
double,
double,
double);
817 virtual void SetAxisTitleFontFamily(
int);
818 virtual void SetAxisTitleBold(
int);
819 virtual void SetAxisTitleItalic(
int);
820 virtual void SetAxisTitleShadow(
int);
821 virtual void SetAxisTitleFontSize(
int);
822 virtual void SetAxisTitleJustification(
int);
823 virtual void SetAxisTitleVerticalJustification(
int);
830 virtual void SetAxisLabelColor(
double,
double,
double);
831 virtual void SetAxisLabelFontFamily(
int);
832 virtual void SetAxisLabelBold(
int);
833 virtual void SetAxisLabelItalic(
int);
834 virtual void SetAxisLabelShadow(
int);
835 virtual void SetAxisLabelFontSize(
int);
836 virtual void SetAxisLabelJustification(
int);
837 virtual void SetAxisLabelVerticalJustification(
int);
859 double XComputedRange[2];
860 double YComputedRange[2];
872 double TitlePosition[2];
885 double ViewportCoordinate[2];
886 double PlotCoordinate[2];
904 void InitializeEntries();
909 double LegendPosition[2];
910 double LegendPosition2[2];
940 void ComputeXRange(
double range[2],
double* lengths);
941 void ComputeYRange(
double range[2]);
942 void ComputeDORange(
double xrange[2],
double yrange[2],
double* lengths);
944 virtual void CreatePlotData(
945 int* pos,
int* pos2,
double xRange[2],
double yRange[2],
double* norms,
int numDS,
int numDO);
946 void PlaceAxes(
vtkViewport* viewport,
const int*
size,
int pos[2],
int pos2[2]);
947 void GenerateClipPlanes(
int* pos,
int* pos2);
948 double ComputeGlyphScale(
int i,
int* pos,
int* pos2);
949 void ClipPlotData(
int* pos,
int* pos2,
vtkPolyData* pd);
950 double* TransformPoint(
int pos[2],
int pos2[2],
double x[3],
double xNew[3]);