1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkScalarBarRepresentation.h
5 
6   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7   All rights reserved.
8   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 // .NAME vtkXYPlotRepresentation - represent XY plot for vtkXYPlotWidget
17 //
18 // .SECTION Description
19 //
20 // This class represents a XY plot for a vtkXYPlotWidget.  This class
21 // provides support for interactively placing a XY plot on the 2D overlay
22 // plane.  The XY plot is defined by an instance of vtkXYPlotActor.
23 //
24 // .SECTION See Also
25 // vtkXYPlotWidget vtkWidgetRepresentation vtkXYPlotActor
26 //
27 // .SECTION Thanks
28 // This class was written by Philippe Pebay, Kitware SAS 2012
29 
30 #ifndef vtkXYPlotRepresentation_h
31 #define vtkXYPlotRepresentation_h
32 
33 #include "vtkInteractionWidgetsModule.h" // For export macro
34 #include "vtkBorderRepresentation.h"
35 
36 class vtkXYPlotActor;
37 
38 class VTKINTERACTIONWIDGETS_EXPORT vtkXYPlotRepresentation : public vtkBorderRepresentation
39 {
40 public:
41   vtkTypeMacro(vtkXYPlotRepresentation, vtkBorderRepresentation);
42   virtual void PrintSelf(ostream &os, vtkIndent indent);
43   static vtkXYPlotRepresentation *New();
44 
45   // Description:
46   // The prop that is placed in the renderer.
47   vtkGetObjectMacro(XYPlotActor, vtkXYPlotActor);
48   virtual void SetXYPlotActor(vtkXYPlotActor *);
49 
50   // Description:
51   // Satisfy the superclass' API.
52   virtual void BuildRepresentation();
53   virtual void WidgetInteraction(double eventPos[2]);
GetSize(double size[2])54   virtual void GetSize(double size[2])
55     {size[0]=2.0; size[1]=2.0;}
56 
57   // Description:
58   // These methods are necessary to make this representation behave as
59   // a vtkProp.
60   virtual int GetVisibility();
61   virtual void SetVisibility(int);
62   virtual void GetActors2D(vtkPropCollection *collection);
63   virtual void ReleaseGraphicsResources(vtkWindow *window);
64   virtual int RenderOverlay(vtkViewport*);
65   virtual int RenderOpaqueGeometry(vtkViewport*);
66   virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
67   virtual int HasTranslucentPolygonalGeometry();
68 
69   // Description:
70   // Set glyph properties
71   void SetGlyphSize(double x);
72   void SetPlotGlyphType(int curve, int glyph);
73 
74   // Description:
75   // Set title properties
76   void SetTitle(const char* title);
77   void SetTitleColor(double r, double g, double b);
78   void SetTitleFontFamily(int x);
79   void SetTitleBold(int x);
80   void SetTitleItalic(int x);
81   void SetTitleShadow(int x);
82   void SetTitleFontSize(int x);
83   void SetTitleJustification(int x);
84   void SetTitleVerticalJustification(int x);
85   void SetAdjustTitlePosition(int x);
86   void SetTitlePosition(double x, double y);
87 
88   // Description:
89   // Set/Get axis properties
90   void SetXAxisColor(double r, double g, double b);
91   void SetYAxisColor(double r, double g, double b);
92   void SetXTitle( const char* ytitle );
93   char* GetXTitle();
94   void SetXRange(double min, double max);
95   void SetYTitle( const char* ytitle );
96   char* GetYTitle();
97   void SetYRange(double min, double max);
98   void SetYTitlePosition (int pos);
99   int GetYTitlePosition() const;
100   void SetXValues(int x);
101 
102   // Description:
103   // Set axis title properties
104   void SetAxisTitleColor(double r, double g, double b);
105   void SetAxisTitleFontFamily(int x);
106   void SetAxisTitleBold(int x);
107   void SetAxisTitleItalic(int x);
108   void SetAxisTitleShadow(int x);
109   void SetAxisTitleFontSize(int x);
110   void SetAxisTitleJustification(int x);
111   void SetAxisTitleVerticalJustification(int x);
112 
113   // Description:
114   // Set axis label properties
115   void SetAxisLabelColor(double r, double g, double b);
116   void SetAxisLabelFontFamily(int x);
117   void SetAxisLabelBold(int x);
118   void SetAxisLabelItalic(int x);
119   void SetAxisLabelShadow(int x);
120   void SetAxisLabelFontSize(int x);
121   void SetAxisLabelJustification(int x);
122   void SetAxisLabelVerticalJustification(int x);
123   void SetXLabelFormat(const char* _arg);
124   void SetYLabelFormat(const char* _arg);
125 
126   // Description:
127   // Set various properties
128   void SetBorder(int x);
129   void RemoveAllActiveCurves();
130   void AddUserCurvesPoint( double c, double x, double y);
131   void SetLegend(int x);
132   void SetLegendBorder(int b);
133   void SetLegendBox(int b);
134   void SetLegendBoxColor(double r, double g, double b);
135   void SetLegendPosition(double x, double y);
136   void SetLegendPosition2(double x, double y);
137   void SetLineWidth(double w);
138   void SetPlotColor(int i, int r, int g, int b);
139   void SetPlotLines(int i);
140   void SetPlotPoints(int i);
141   void SetPlotLabel(int i, const char* label);
142 
143 protected:
144   vtkXYPlotRepresentation();
145   ~vtkXYPlotRepresentation();
146 
147   vtkXYPlotActor *XYPlotActor;
148 private:
149   vtkXYPlotRepresentation(const vtkXYPlotRepresentation &); // Not implemented
150   void operator=(const vtkXYPlotRepresentation &);   // Not implemented
151 };
152 
153 #endif //vtkXYPlotRepresentation_h
154