44 #ifndef SVK_XY_PLOT_ACTOR_H
45 #define SVK_XY_PLOT_ACTOR_H
136 #define VTK_XYPLOT_INDEX 0
137 #define VTK_XYPLOT_ARC_LENGTH 1
138 #define VTK_XYPLOT_NORMALIZED_ARC_LENGTH 2
139 #define VTK_XYPLOT_VALUE 3
141 #define VTK_XYPLOT_ROW 0
142 #define VTK_XYPLOT_COLUMN 1
144 #define VTK_XYPLOT_Y_AXIS_TOP 0
145 #define VTK_XYPLOT_Y_AXIS_HCENTER 1
146 #define VTK_XYPLOT_Y_AXIS_VCENTER 2 // rotate by 90 degrees (y-axis aligned)
149 #include "vtkRenderingAnnotationModule.h"
150 #include "vtkActor2D.h"
151 #include "vtkSmartPointer.h"
153 class vtkAlgorithmOutput;
154 class vtkAppendPolyData;
155 class vtkAxisActor2D;
157 class vtkDataObjectCollection;
159 class vtkDataSetCollection;
160 class vtkDoubleArray;
162 class vtkGlyphSource2D;
164 class vtkLegendBoxActor;
167 class vtkPolyDataMapper2D;
170 class vtkTextProperty;
176 void PrintSelf(ostream& os, vtkIndent indent);
197 void AddDataSetInput(vtkDataSet *ds,
const char* arrayName,
int component);
199 void AddDataSetInputConnection(vtkAlgorithmOutput *in,
const char* arrayName,
int component);
204 void RemoveDataSetInput(vtkDataSet *ds,
const char* arrayName,
int component);
206 void RemoveDataSetInputConnection(vtkAlgorithmOutput *in,
const char* arrayName,
int component);
209 this->RemoveDataSetInputConnection(in, NULL, 0);
215 void RemoveAllDataSetInputConnections();
220 void SetPointComponent(
int i,
int comp);
221 int GetPointComponent(
int i);
234 vtkGetMacro(XValues,
int);
240 const char *GetXValuesAsString();
249 void AddDataObjectInput(vtkDataObject *in);
250 void AddDataObjectInputConnection(vtkAlgorithmOutput *alg);
254 void RemoveDataObjectInputConnection(vtkAlgorithmOutput *aout);
255 void RemoveDataObjectInput(vtkDataObject *in);
262 vtkGetMacro(DataObjectPlotMode,
int);
267 const char *GetDataObjectPlotModeAsString();
276 void SetDataObjectXComponent(
int i,
int comp);
277 int GetDataObjectXComponent(
int i);
286 void SetDataObjectYComponent(
int i,
int comp);
287 int GetDataObjectYComponent(
int i);
295 void SetPlotColor(
int i,
double r,
double g,
double b);
297 this->SetPlotColor(i, color[0], color[1], color[2]); };
298 double *GetPlotColor(
int i);
299 void SetPlotSymbol(
int i,vtkPolyData *input);
300 vtkPolyData *GetPlotSymbol(
int i);
301 void SetPlotLabel(
int i,
const char *label);
302 const char *GetPlotLabel(
int i);
307 vtkGetMacro(PlotCurvePoints,
int);
308 vtkSetMacro(PlotCurvePoints,
int);
309 vtkBooleanMacro(PlotCurvePoints,
int);
311 vtkGetMacro(PlotCurveLines,
int);
312 vtkSetMacro(PlotCurveLines,
int);
313 vtkBooleanMacro(PlotCurveLines,
int);
315 void SetPlotLines(
int i,
int);
316 int GetPlotLines(
int i);
318 void SetPlotPoints(
int i,
int);
319 int GetPlotPoints(
int i);
325 vtkSetMacro(ExchangeAxes,
int);
326 vtkGetMacro(ExchangeAxes,
int);
327 vtkBooleanMacro(ExchangeAxes,
int);
333 vtkSetMacro(ReverseXAxis,
int);
334 vtkGetMacro(ReverseXAxis,
int);
335 vtkBooleanMacro(ReverseXAxis,
int);
341 vtkSetMacro(ReverseYAxis,
int);
342 vtkGetMacro(ReverseYAxis,
int);
343 vtkBooleanMacro(ReverseYAxis,
int);
350 vtkGetObjectMacro(LegendActor,vtkLegendBoxActor);
351 vtkGetObjectMacro(GlyphSource,vtkGlyphSource2D);
355 vtkSetStringMacro(Title);
356 vtkGetStringMacro(Title);
360 vtkSetStringMacro(XTitle);
361 vtkGetStringMacro(XTitle);
365 virtual void SetYTitle(
const char* );
387 vtkSetVector2Macro(XRange,
double);
388 vtkGetVectorMacro(XRange,
double,2);
389 vtkSetVector2Macro(YRange,
double);
390 vtkGetVectorMacro(YRange,
double,2);
392 {this->SetXRange(xmin,xmax); this->SetYRange(ymin,ymax);}
399 vtkSetClampMacro(NumberOfXLabels,
int, 0, 50);
400 vtkGetMacro(NumberOfXLabels,
int);
401 vtkSetClampMacro(NumberOfYLabels,
int, 0, 50);
402 vtkGetMacro(NumberOfYLabels,
int);
404 {this->SetNumberOfXLabels(num); this->SetNumberOfYLabels(num);}
412 void SetAdjustXLabels(
int adjust);
413 vtkGetMacro( AdjustXLabels,
int );
414 void SetAdjustYLabels(
int adjust);
415 vtkGetMacro( AdjustYLabels,
int );
419 void SetNumberOfXMinorTicks(
int num);
420 int GetNumberOfXMinorTicks();
421 void SetNumberOfYMinorTicks(
int num);
422 int GetNumberOfYMinorTicks();
428 vtkSetMacro(Legend,
int);
429 vtkGetMacro(Legend,
int);
430 vtkBooleanMacro(Legend,
int);
435 vtkSetVector2Macro(TitlePosition,
double);
436 vtkGetVector2Macro(TitlePosition,
double);
441 vtkSetMacro(AdjustTitlePosition,
int);
442 vtkGetMacro(AdjustTitlePosition,
int);
443 vtkBooleanMacro(AdjustTitlePosition,
int);
453 AlignAxisLeft = 0x100,
454 AlignAxisRight = 0x200,
455 AlignAxisHCenter = 0x400,
456 AlignAxisTop = 0x1000,
457 AlignAxisBottom = 0x2000,
458 AlignAxisVCenter = 0x4000
467 vtkSetMacro(AdjustTitlePositionMode,
int);
468 vtkGetMacro(AdjustTitlePositionMode,
int);
477 vtkSetVector2Macro(LegendPosition,
double);
478 vtkGetVector2Macro(LegendPosition,
double);
479 vtkSetVector2Macro(LegendPosition2,
double);
480 vtkGetVector2Macro(LegendPosition2,
double);
484 virtual void SetTitleTextProperty(vtkTextProperty *p);
485 vtkGetObjectMacro(TitleTextProperty,vtkTextProperty);
490 virtual void SetAxisTitleTextProperty(vtkTextProperty *p);
491 vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
496 virtual void SetAxisLabelTextProperty(vtkTextProperty *p);
497 vtkGetObjectMacro(AxisLabelTextProperty,vtkTextProperty);
501 vtkSetMacro(Logx,
int);
502 vtkGetMacro(Logx,
int);
503 vtkBooleanMacro(Logx,
int);
508 virtual void SetLabelFormat (
const char* );
511 return this->GetXLabelFormat();
516 virtual void SetXLabelFormat (
const char* );
517 vtkGetStringMacro(XLabelFormat);
521 virtual void SetYLabelFormat (
const char* );
522 vtkGetStringMacro(YLabelFormat);
527 vtkSetClampMacro(Border,
int, 0, 50);
528 vtkGetMacro(Border,
int);
534 vtkGetMacro(PlotPoints,
int);
535 vtkSetMacro(PlotPoints,
int);
536 vtkBooleanMacro(PlotPoints,
int);
541 vtkGetMacro(PlotLines,
int);
542 vtkSetMacro(PlotLines,
int);
543 vtkBooleanMacro(PlotLines,
int);
549 vtkSetClampMacro(GlyphSize,
double, 0.0, 0.2);
550 vtkGetMacro(GlyphSize,
double);
555 void ViewportToPlotCoordinate(vtkViewport *viewport,
double &u,
double &v);
561 void ViewportToPlotCoordinate(vtkViewport *viewport);
562 vtkSetVector2Macro(PlotCoordinate,
double);
563 vtkGetVector2Macro(PlotCoordinate,
double);
567 void PlotToViewportCoordinate(vtkViewport *viewport,
double &u,
double &v);
574 void PlotToViewportCoordinate(vtkViewport *viewport);
575 vtkSetVector2Macro(ViewportCoordinate,
double);
576 vtkGetVector2Macro(ViewportCoordinate,
double);
581 int IsInPlot(vtkViewport *viewport,
double u,
double v);
586 vtkSetMacro(ChartBox,
int);
587 vtkGetMacro(ChartBox,
int);
588 vtkBooleanMacro(ChartBox,
int);
593 vtkSetMacro(ChartBorder,
int);
594 vtkGetMacro(ChartBorder,
int);
595 vtkBooleanMacro(ChartBorder,
int);
603 vtkSetMacro(ShowReferenceXLine,
int);
604 vtkGetMacro(ShowReferenceXLine,
int);
605 vtkBooleanMacro(ShowReferenceXLine,
int);
609 vtkSetMacro(ReferenceXValue,
double);
610 vtkGetMacro(ReferenceXValue,
double);
614 vtkSetMacro(ShowReferenceYLine,
int);
615 vtkGetMacro(ShowReferenceYLine,
int);
616 vtkBooleanMacro(ShowReferenceYLine,
int);
620 vtkSetMacro(ReferenceYValue,
double);
621 vtkGetMacro(ReferenceYValue,
double);
625 unsigned long GetMTime();
629 void PrintAsCSV(ostream &os);
636 int RenderOpaqueGeometry(vtkViewport*);
637 int RenderOverlay(vtkViewport*);
642 virtual int HasTranslucentPolygonalGeometry();
648 void ReleaseGraphicsResources(vtkWindow *);
653 void SetXTitlePosition(
double position);
654 double GetXTitlePosition();
658 vtkSetMacro(YTitlePosition,
int);
659 vtkGetMacro(YTitlePosition,
int);
675 virtual void SetPlotGlyphType(
int,
int );
676 virtual void SetLineWidth(
double );
677 virtual void AddUserCurvesPoint(
double,
double,
double );
678 virtual void RemoveAllActiveCurves();
682 virtual void SetLegendBorder(
int );
683 virtual void SetLegendBox(
int );
684 virtual void SetLegendUseBackground(
int );
685 virtual void SetLegendBackgroundColor(
double,
double,
double );
689 virtual void SetTitleColor(
double,
double,
double );
690 virtual void SetTitleFontFamily(
int );
691 virtual void SetTitleBold(
int );
692 virtual void SetTitleItalic(
int );
693 virtual void SetTitleShadow(
int );
694 virtual void SetTitleFontSize(
int );
695 virtual void SetTitleJustification(
int );
696 virtual void SetTitleVerticalJustification(
int );
700 virtual void SetXAxisColor(
double,
double,
double );
701 virtual void SetYAxisColor(
double,
double,
double );
705 virtual void SetAxisTitleColor(
double,
double,
double );
706 virtual void SetAxisTitleFontFamily(
int );
707 virtual void SetAxisTitleBold(
int );
708 virtual void SetAxisTitleItalic(
int );
709 virtual void SetAxisTitleShadow(
int );
710 virtual void SetAxisTitleFontSize(
int );
711 virtual void SetAxisTitleJustification(
int );
712 virtual void SetAxisTitleVerticalJustification(
int );
716 virtual void SetAxisLabelColor(
double,
double,
double );
717 virtual void SetAxisLabelFontFamily(
int );
718 virtual void SetAxisLabelBold(
int );
719 virtual void SetAxisLabelItalic(
int );
720 virtual void SetAxisLabelShadow(
int );
721 virtual void SetAxisLabelFontSize(
int );
722 virtual void SetAxisLabelJustification(
int );
723 virtual void SetAxisLabelVerticalJustification(
int );
747 double XComputedRange[2];
748 double YComputedRange[2];
760 double TitlePosition[2];
773 double ViewportCoordinate[2];
774 double PlotCoordinate[2];
792 void InitializeEntries();
797 double LegendPosition[2];
798 double LegendPosition2[2];
828 void ComputeXRange(
double range[2],
double *lengths);
829 void ComputeYRange(
double range[2]);
830 void ComputeDORange(
double xrange[2],
double yrange[2],
double *lengths);
832 virtual void CreatePlotData(
int *pos,
int *pos2,
double xRange[2],
833 double yRange[2],
double *norms,
834 int numDS,
int numDO);
835 void PlaceAxes(vtkViewport *viewport,
int *size,
int pos[2],
int pos2[2]);
836 void GenerateClipPlanes(
int *pos,
int *pos2);
837 double ComputeGlyphScale(
int i,
int *pos,
int *pos2);
838 void ClipPlotData(
int *pos,
int *pos2, vtkPolyData *pd);
839 double *TransformPoint(
int pos[2],
int pos2[2],
double x[3],
double xNew[3]);
852 bool DoesConnectionMatch(
int i, vtkAlgorithmOutput* in);
854 int IsInputPresent(vtkAlgorithmOutput* in,
855 const char* arrayName,
874 #endif //SVK_XY_PLOT_ACTOR_H
vtkAxisActor2D * YAxis
Definition: svkXYPlotActor.h:768
void SetPlotRange(double xmin, double ymin, double xmax, double ymax)
Definition: svkXYPlotActor.h:391
vtkPolyData * ReferenceLinesPolyData
Definition: svkXYPlotActor.h:820
vtkTextProperty * AxisLabelTextProperty
Definition: svkXYPlotActor.h:771
void AddDataSetInput(vtkDataSet *ds)
Definition: svkXYPlotActor.h:198
int PlotLines
Definition: svkXYPlotActor.h:750
int ReverseYAxis
Definition: svkXYPlotActor.h:756
#define VTK_XYPLOT_COLUMN
Definition: svkXYPlotActor.h:142
vtkActor2D * ChartBoxActor
Definition: svkXYPlotActor.h:808
Definition: svkXYPlotActor.h:172
vtkPolyData * ChartBorderPolyData
Definition: svkXYPlotActor.h:810
vtkLegendBoxActor * LegendActor
Definition: svkXYPlotActor.h:799
void SetNumberOfLabels(int num)
Definition: svkXYPlotActor.h:403
vtkTextProperty * TitleTextProperty
Definition: svkXYPlotActor.h:765
int PlotCurveLines
Definition: svkXYPlotActor.h:752
double ReferenceYValue
Definition: svkXYPlotActor.h:818
vtkGlyph2D ** PlotGlyph
Definition: svkXYPlotActor.h:788
vtkPolyData ** PlotData
Definition: svkXYPlotActor.h:787
vtkPolyDataMapper2D * ChartBoxMapper
Definition: svkXYPlotActor.h:807
vtkProperty2D * GetChartBoxProperty()
Definition: svkXYPlotActor.h:599
int Border
Definition: svkXYPlotActor.h:749
vtkTextProperty * AxisTitleTextProperty
Definition: svkXYPlotActor.h:770
void SetYTitlePositionToHCenter()
Definition: svkXYPlotActor.h:664
#define VTK_XYPLOT_ARC_LENGTH
Definition: svkXYPlotActor.h:137
int NumberOfInputs
Definition: svkXYPlotActor.h:786
Definition: svkXYPlotActorConnections.h:59
int ActiveCurveIndex
Definition: svkXYPlotActor.h:845
void SetXValuesToNormalizedArcLength()
Definition: svkXYPlotActor.h:237
vtkTextActor * YTitleActor
Definition: svkXYPlotActor.h:738
vtkActor2D * ChartBorderActor
Definition: svkXYPlotActor.h:812
void SetYTitlePositionToVCenter()
Definition: svkXYPlotActor.h:668
vtkPlanes * ClipPlanes
Definition: svkXYPlotActor.h:801
vtkGlyphSource2D * GlyphSource
Definition: svkXYPlotActor.h:800
int NumberOfXLabels
Definition: svkXYPlotActor.h:740
#define VTK_XYPLOT_NORMALIZED_ARC_LENGTH
Definition: svkXYPlotActor.h:138
int AdjustYLabels
Definition: svkXYPlotActor.h:758
#define VTK_XYPLOT_Y_AXIS_VCENTER
Definition: svkXYPlotActor.h:146
int ReverseXAxis
Definition: svkXYPlotActor.h:755
void SetXValuesToArcLength()
Definition: svkXYPlotActor.h:236
vtkIntArray * XComponent
Definition: svkXYPlotActor.h:778
vtkActor2D * TitleActor
Definition: svkXYPlotActor.h:764
int AdjustTitlePosition
Definition: svkXYPlotActor.h:759
void SetXValuesToValue()
Definition: svkXYPlotActor.h:239
vtkIntArray * YComponent
Definition: svkXYPlotActor.h:779
int Legend
Definition: svkXYPlotActor.h:796
char * XLabelFormat
Definition: svkXYPlotActor.h:743
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: svkXYPlotActor.h:638
vtkActor2D ** PlotActor
Definition: svkXYPlotActor.h:791
int PlotPoints
Definition: svkXYPlotActor.h:751
void RemoveDataSetInputConnection(vtkAlgorithmOutput *in)
Definition: svkXYPlotActor.h:207
void SetDataObjectPlotModeToColumns()
Definition: svkXYPlotActor.h:265
void SetYTitlePositionToTop()
Definition: svkXYPlotActor.h:660
void SetXValuesToIndex()
Definition: svkXYPlotActor.h:235
vtkTextMapper * TitleMapper
Definition: svkXYPlotActor.h:763
vtkIntArray * SelectedInputScalarsComponent
Definition: svkXYPlotActor.h:734
double GlyphSize
Definition: svkXYPlotActor.h:802
vtkPolyData * ChartBoxPolyData
Definition: svkXYPlotActor.h:806
#define VTK_XYPLOT_Y_AXIS_TOP
Definition: svkXYPlotActor.h:144
vtkIntArray * PointsOn
Definition: svkXYPlotActor.h:781
int AdjustXLabels
Definition: svkXYPlotActor.h:757
int ChartBox
Definition: svkXYPlotActor.h:805
double ReferenceXValue
Definition: svkXYPlotActor.h:817
int Logx
Definition: svkXYPlotActor.h:742
char ** SelectedInputScalars
Definition: svkXYPlotActor.h:733
vtkPolyDataMapper2D * ReferenceLinesMapper
Definition: svkXYPlotActor.h:821
void RemoveDataSetInput(vtkDataSet *ds)
Definition: svkXYPlotActor.h:205
char * YLabelFormat
Definition: svkXYPlotActor.h:744
int ShowReferenceYLine
Definition: svkXYPlotActor.h:816
int NumberOfYLabels
Definition: svkXYPlotActor.h:741
void AddDataSetInputConnection(vtkAlgorithmOutput *in)
Definition: svkXYPlotActor.h:200
vtkActor2D * ReferenceLinesActor
Definition: svkXYPlotActor.h:822
char * Title
Definition: svkXYPlotActor.h:736
vtkSmartPointer< vtkDoubleArray > ActiveCurve
Definition: svkXYPlotActor.h:842
vtkAxisActor2D * GetXAxisActor2D()
Definition: svkXYPlotActor.h:371
int ChartBorder
Definition: svkXYPlotActor.h:809
vtkAppendPolyData ** PlotAppend
Definition: svkXYPlotActor.h:789
#define VTK_XYPLOT_INDEX
Definition: svkXYPlotActor.h:136
char * XTitle
Definition: svkXYPlotActor.h:737
int DataObjectPlotMode
Definition: svkXYPlotActor.h:777
vtkAxisActor2D * XAxis
Definition: svkXYPlotActor.h:767
#define VTK_XYPLOT_VALUE
Definition: svkXYPlotActor.h:139
int AdjustTitlePositionMode
Definition: svkXYPlotActor.h:761
int PlotCurvePoints
Definition: svkXYPlotActor.h:753
svk::svkXYPlotActorConnections * DataObjectInputConnectionHolder
Definition: svkXYPlotActor.h:735
int ShowReferenceXLine
Definition: svkXYPlotActor.h:815
int YAxisTitleSize
Definition: svkXYPlotActor.h:844
vtkPolyDataMapper2D ** PlotMapper
Definition: svkXYPlotActor.h:790
vtkTimeStamp BuildTime
Definition: svkXYPlotActor.h:826
int XValues
Definition: svkXYPlotActor.h:739
int PlotColorIndex
Definition: svkXYPlotActor.h:846
vtkAxisActor2D * GetYAxisActor2D()
Definition: svkXYPlotActor.h:375
void SetDataObjectPlotModeToRows()
Definition: svkXYPlotActor.h:263
#define VTK_XYPLOT_ROW
Definition: svkXYPlotActor.h:141
svk::svkXYPlotActorConnections * InputConnectionHolder
Definition: svkXYPlotActor.h:732
const char * GetLabelFormat()
Definition: svkXYPlotActor.h:509
void SetPlotColor(int i, const double color[3])
Definition: svkXYPlotActor.h:296
int ExchangeAxes
Definition: svkXYPlotActor.h:754
#define VTK_XYPLOT_Y_AXIS_HCENTER
Definition: svkXYPlotActor.h:145
vtkPolyDataMapper2D * ChartBorderMapper
Definition: svkXYPlotActor.h:811
vtkIntArray * LinesOn
Definition: svkXYPlotActor.h:780
Alignment
Definition: svkXYPlotActor.h:446