Version: 6.3.1

src/PIPELINE/VISU_XYPlotActor.hxx

Go to the documentation of this file.
00001 #ifndef VISU_XYPLOTACTOR_HXX_
00002 #define VISU_XYPLOTACTOR_HXX_
00003 
00004 #include "VISUPipeline.hxx"
00005 
00006 /*=========================================================================
00007 
00008   Program:   Visualization Toolkit
00009   Module:    $RCSfile: VISU_XYPlotActor.hxx,v $
00010 
00011   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00012   All rights reserved.
00013   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00017      PURPOSE.  See the above copyright notice for more information.
00018      
00019   *** Modified by OPEN CASCADE
00020 
00021 =========================================================================*/
00022 // .NAME vtkXYPlotActor - generate an x-y plot from input dataset(s) or field data
00023 // .SECTION Description
00024 // vtkXYPlotActor creates an x-y plot of data from one or more input data
00025 // sets or field data. The class plots dataset scalar values (y-axis) against
00026 // the points (x-axis). The x-axis values are generated by taking the point
00027 // ids, computing a cumulative arc length, or a normalized arc length. More
00028 // than one input data set can be specified to generate multiple plots.
00029 // Alternatively, if field data is supplied as input, the class plots one
00030 // component against another. (The user must specify which component to use
00031 // as the x-axis and which for the y-axis.)
00032 //
00033 // To use this class to plot dataset(s), you must specify one or more
00034 // input datasets containing scalar and point data.  You'll probably also
00035 // want to invoke a method to control how the point coordinates are converted
00036 // into x values (by default point ids are used).
00037 //
00038 // To use this class to plot field data, you must specify one or more input
00039 // data objects with its associated field data. You'll also want to specify
00040 // which component to use as the x-axis and which to use as the y-axis.
00041 // Note that when plotting field data, the x and y values are used directly
00042 // (i.e., there are no options to normalize the components).
00043 //
00044 // Once you've set up the plot, you'll want to position it.  The
00045 // PositionCoordinate defines the lower-left location of the x-y plot
00046 // (specified in normalized viewport coordinates) and the Position2Coordinate
00047 // define the upper-right corner. (Note: the Position2Coordinate is relative
00048 // to PositionCoordinate, so you can move the vtkXYPlotActor around the
00049 // viewport by setting just the PositionCoordinate.) The combination of the
00050 // two position coordinates specifies a rectangle in which the plot will lie.
00051 //
00052 // Optional features include the ability to specify axes labels, label
00053 // format and plot title. You can also
00054 // manually specify the x and y plot ranges (by default they are computed
00055 // automatically). The Border instance variable is used to create space 
00056 // between the boundary of the plot window (specified by PositionCoordinate
00057 // and Position2Coordinate) and the plot itself.
00058 //
00059 // The font property of the plot title can be modified through the 
00060 // TitleTextProperty attribute.
00061 // The font property of the axes titles and labels can be modified through the
00062 // AxisTitleTextProperty and AxisLabelTextProperty attributes. You may also
00063 // use the GetXAxisActor2D or GetYAxisActor2D methods 
00064 // to access each individual axis actor to modify their font properties.
00065 // In the same way, the GetLegendBoxActor method can be used to access
00066 // the legend box actor to modify its font properties.
00067 //
00068 // There are several advanced features as well. You can assign per curve 
00069 // properties (such as color and a plot symbol). (Note that each input 
00070 // dataset and/or data object creates a single curve.) Another option is to
00071 // add a plot legend that graphically indicates the correspondance between
00072 // the curve, curve symbols, and the data source. You can also exchange the
00073 // x and y axes if you prefer you plot orientation that way.
00074 
00075 // .SECTION Caveats
00076 // If you are interested in plotting something other than scalar data, you
00077 // can use the vtk data shuffling filters (e.g., 
00078 // vtkAttributeDataToFieldDataFilter and vtkFieldDataToAttributeDataFilter) 
00079 // to convert the data into scalar data and/or points.
00080 
00081 // .SECTION See Also
00082 // vtkActor2D vtkTextMapper vtkScalarBarActor vtkAxisActor2D vtkCubeAxesActor2D
00083 // vtkAttributeDataToFieldDataFilter vtkFieldDataToAttributeDataFilter 
00084 // vtkTextProperty
00085 
00086 #include "vtkActor2D.h"
00087 #include "vtkTransformPolyDataFilter.h" // RKV
00088 
00089 #define VTK_XYPLOT_INDEX                 0
00090 #define VTK_XYPLOT_ARC_LENGTH            1
00091 #define VTK_XYPLOT_NORMALIZED_ARC_LENGTH 2
00092 #define VTK_XYPLOT_VALUE                 3
00093 
00094 #define VTK_XYPLOT_ROW 0
00095 #define VTK_XYPLOT_COLUMN 1
00096 
00097 class vtkAppendPolyData;
00098 class vtkAxisActor2D;
00099 class vtkDataObject;
00100 class vtkDataObjectCollection;
00101 class vtkDataSet;
00102 class vtkDataSetCollection;
00103 class vtkGlyph2D;
00104 class vtkGlyphSource2D;
00105 class vtkIntArray;
00106 class vtkLegendBoxActor;
00107 class vtkPlanes;
00108 class vtkPolyData;
00109 class vtkPolyDataMapper2D;
00110 class vtkTextMapper;
00111 class vtkTextProperty;
00112 
00113 // RKV : Begin
00122 enum VISU_XYPlotLocation { VISU_XYPLOT_BOTTOM = 0,
00123         VISU_XYPLOT_TOP, VISU_XYPLOT_LEFT, VISU_XYPLOT_RIGHT };
00124 // RKV : End
00125 
00126 class VISU_PIPELINE_EXPORT VISU_XYPlotActor : public vtkActor2D
00127 {
00128 public:
00129   vtkTypeRevisionMacro(VISU_XYPlotActor,vtkActor2D);
00130   void PrintSelf(ostream& os, vtkIndent indent);
00131 
00132   // Description:
00133   // Instantiate object with autorange computation; bold, italic, and shadows
00134   // on; arial font family; the number of labels set to 5 for the x and y
00135   // axes; a label format of "%-#6.3g"; and x coordinates computed from point
00136   // ids.
00137   static VISU_XYPlotActor *New();
00138 
00139   //---Data Set Input----------------------------------------------------------
00140   // The following methods are used to plot input datasets. Datasets
00141   // will be plotted if set as input; otherwise the input data objects
00142   // will be plotted (if defined).
00143   
00144   // Description:
00145   // Add a dataset to the list of data to append. The array name specifies
00146   // which point array to plot.  If the array name is NULL, then the default
00147   // scalars are used.  The array can have multiple components, but only the
00148   // first component is ploted.
00149   void AddInput(vtkDataSet *in, const char* arrayName, int component);
00150   void AddInput(vtkDataSet *in) {this->AddInput(in, NULL, 0);}
00151 
00152   // Description:
00153   // Remove a dataset from the list of data to append.
00154   void RemoveInput(vtkDataSet *in, const char* arrayName, int component);
00155   void RemoveInput(vtkDataSet *in) {this->RemoveInput(in, NULL, 0);}
00156 
00157   // Description:
00158   // This removes all of the data set inputs, 
00159   // but does not change the data object inputs.
00160   void RemoveAllInputs();
00161 
00162   // Description:
00163   // Return the list of inputs to this filter.
00164   vtkDataSetCollection *GetInputList() {return this->InputList;}
00165 
00166   // Description:
00167   // If plotting points by value, which component to use to determine the
00168   // value. This sets a value per each input dataset (i.e., the ith dataset).
00169   void SetPointComponent(int i, int comp);
00170   int GetPointComponent(int i);
00171   //---end Data Set Input-----------------------------------------------------
00172 
00173   // Description:
00174   // Specify how the independent (x) variable is computed from the points.
00175   // The independent variable can be the scalar/point index (i.e., point id),
00176   // the accumulated arc length along the points, the normalized arc length,
00177   // or by component value. If plotting datasets (e.g., points), the value
00178   // that is used is specified by the PointComponent ivar.  (Note: these
00179   // methods also control how field data is plotted. Field data is usually
00180   // plotted by value or index, if plotting length 1-dimensional length
00181   // measures are used.)
00182   vtkSetClampMacro(XValues,int,VTK_XYPLOT_INDEX,VTK_XYPLOT_VALUE);
00183   vtkGetMacro(XValues,int);
00184   void SetXValuesToIndex(){this->SetXValues(VTK_XYPLOT_INDEX);};
00185   void SetXValuesToArcLength() {this->SetXValues(VTK_XYPLOT_ARC_LENGTH);};
00186   void SetXValuesToNormalizedArcLength()
00187     {this->SetXValues(VTK_XYPLOT_NORMALIZED_ARC_LENGTH);};
00188   void SetXValuesToValue() {this->SetXValues(VTK_XYPLOT_VALUE);};
00189   const char *GetXValuesAsString();
00190 
00191   //---Data Object Input------------------------------------------------------
00192   // The following methods are used to plot input data objects. Datasets will
00193   // be plotted in preference to data objects if set as input; otherwise the
00194   // input data objects will be plotted (if defined).
00195   
00196   // Description:
00197   // Add a dataset to the list of data to append.
00198   void AddDataObjectInput(vtkDataObject *in);
00199 
00200   // Description:
00201   // Remove a dataset from the list of data to append.
00202   void RemoveDataObjectInput(vtkDataObject *in);
00203 
00204   // Description:
00205   // Return the list of inputs to this filter.
00206   vtkDataObjectCollection *GetDataObjectInputList() 
00207     {return this->DataObjectInputList;}
00208 
00209   // Description:
00210   // Indicate whether to plot rows or columns. If plotting rows, then
00211   // the dependent variables is taken from a specified row,
00212   // versus rows (y). 
00213   vtkSetClampMacro(DataObjectPlotMode,int,VTK_XYPLOT_ROW,VTK_XYPLOT_COLUMN);
00214   vtkGetMacro(DataObjectPlotMode,int);
00215   void SetDataObjectPlotModeToRows()
00216     {this->SetDataObjectPlotMode(VTK_XYPLOT_ROW);}
00217   void SetDataObjectPlotModeToColumns()
00218     {this->SetDataObjectPlotMode(VTK_XYPLOT_COLUMN);}
00219   const char *GetDataObjectPlotModeAsString();
00220 
00221   // Description:
00222   // Specify which component of the input data object to use as the
00223   // independent variable for the ith input data object. (This ivar is
00224   // ignored if plotting the index.) Note that the value is interpreted
00225   // differently depending on DataObjectPlotMode. If the mode is Rows, then
00226   // the value of DataObjectXComponent is the row number; otherwise it's the
00227   // column number.
00228   void SetDataObjectXComponent(int i, int comp);
00229   int GetDataObjectXComponent(int i);
00230 
00231   // Description:
00232   // Specify which component of the input data object to use as the
00233   // dependent variable for the ith input data object. (This ivar is
00234   // ignored if plotting the index.) Note that the value is interpreted
00235   // differently depending on DataObjectPlotMode. If the mode is Rows, then
00236   // the value of DataObjectYComponent is the row number; otherwise it's the
00237   // column number.
00238   void SetDataObjectYComponent(int i, int comp);
00239   int GetDataObjectYComponent(int i);
00240   //---end Data Object Input--------------------------------------------------
00241 
00242   //---Per Curve Properties---------------------------------------------------
00243   // The following methods are used to set properties on each curve that is
00244   // plotted. Each input dataset (or data object) results in one curve. The
00245   // methods that follow have an index i that corresponds to the input dataset
00246   // or data object. 
00247   void SetPlotColor(int i, double r, double g, double b);
00248   void SetPlotColor(int i, const double color[3]) {
00249     this->SetPlotColor(i, color[0], color[1], color[2]); };
00250   double *GetPlotColor(int i);
00251   void SetPlotSymbol(int i,vtkPolyData *input);
00252   vtkPolyData *GetPlotSymbol(int i);
00253   void SetPlotLabel(int i, const char *label);
00254   const char *GetPlotLabel(int i);
00255 
00256   // Allow per-curve specification of line and point rendering.  These override
00257   // global settings PlotPoints and PlotLines.  If not on, the default behavior
00258   // is governed by PlotPoints and PlotLines ivars.
00259   vtkGetMacro(PlotCurvePoints, int);
00260   vtkSetMacro(PlotCurvePoints, int);
00261   vtkBooleanMacro(PlotCurvePoints, int);
00262 
00263   vtkGetMacro(PlotCurveLines, int);
00264   vtkSetMacro(PlotCurveLines, int);
00265   vtkBooleanMacro(PlotCurveLines, int);
00266 
00267   void SetPlotLines(int i, int);
00268   int GetPlotLines(int i);
00269 
00270   void SetPlotPoints(int i, int);
00271   int GetPlotPoints(int i);
00272   //---end Per Curve Properties-----------------------------------------------
00273 
00274   // Description:
00275   // Enable/Disable exchange of the x-y axes (i.e., what was x becomes y, and
00276   // vice-versa). Exchanging axes affects the labeling as well.
00277   vtkSetMacro(ExchangeAxes, int);
00278   vtkGetMacro(ExchangeAxes, int);
00279   vtkBooleanMacro(ExchangeAxes, int);
00280 
00281   // Description:
00282   // Normally the x-axis is plotted from minimum to maximum. Setting this instance
00283   // variable causes the x-axis to be plotted from maximum to minimum. Note that
00284   // boolean always applies to the x-axis even if ExchangeAxes is set.
00285   vtkSetMacro(ReverseXAxis, int);
00286   vtkGetMacro(ReverseXAxis, int);
00287   vtkBooleanMacro(ReverseXAxis, int);
00288 
00289   // Description:
00290   // Normally the y-axis is plotted from minimum to maximum. Setting this instance
00291   // variable causes the y-axis to be plotted from maximum to minimum. Note that
00292   // boolean always applies to the y-axis even if ExchangeAxes is set.
00293   vtkSetMacro(ReverseYAxis, int);
00294   vtkGetMacro(ReverseYAxis, int);
00295   vtkBooleanMacro(ReverseYAxis, int);
00296 
00297   // Description:
00298   // Retrieve handles to the legend box and glyph source. This is useful
00299   // if you would like to change the default behavior of the legend box
00300   // or glyph source. For example, the default glyph can be changed from
00301   // a line to a vertex plus line, etc.)
00302   vtkGetObjectMacro(LegendActor,vtkLegendBoxActor);
00303   vtkGetObjectMacro(GlyphSource,vtkGlyphSource2D);
00304 
00305   // Description:
00306   // Set/Get the title of the x-y plot, and the title along the 
00307   // x and y axes.
00308   vtkSetStringMacro(Title);
00309   vtkGetStringMacro(Title);
00310   vtkSetStringMacro(XTitle);
00311   vtkGetStringMacro(XTitle);
00312   vtkSetStringMacro(YTitle);
00313   vtkGetStringMacro(YTitle);
00314 
00315   // Description:
00316   // Retrieve handles to the X and Y axis (so that you can set their text
00317   // properties for example)
00318   vtkAxisActor2D *GetXAxisActor2D()
00319     {return this->XAxis;}
00320   vtkAxisActor2D *GetYAxisActor2D()
00321     {return this->YAxis;}
00322 
00323   // Description:
00324   // Set the plot range (range of independent and dependent variables)
00325   // to plot. Data outside of the range will be clipped. If the plot
00326   // range of either the x or y variables is set to (v1,v2), where
00327   // v1 == v2, then the range will be computed automatically. Note that
00328   // the x-range values should be consistent with the way the independent
00329   // variable is created (via INDEX, DISTANCE, or ARC_LENGTH).
00330   vtkSetVector2Macro(XRange,double);
00331   vtkGetVectorMacro(XRange,double,2);
00332   vtkSetVector2Macro(YRange,double);
00333   vtkGetVectorMacro(YRange,double,2);
00334   void SetPlotRange(double xmin, double ymin, double xmax, double ymax)
00335     {this->SetXRange(xmin,xmax); this->SetYRange(ymin,ymax);}
00336   
00337   // Description:
00338   // Set/Get the number of annotation labels to show along the x and y axes.
00339   // This values is a suggestion: the number of labels may vary depending
00340   // on the particulars of the data. The convenience method 
00341   // SetNumberOfLables() sets the number of x and y labels to the same value.
00342   vtkSetClampMacro(NumberOfXLabels, int, 0, 50);
00343   vtkGetMacro(NumberOfXLabels, int);
00344   vtkSetClampMacro(NumberOfYLabels, int, 0, 50);
00345   vtkGetMacro(NumberOfYLabels, int);
00346   void SetNumberOfLabels(int num)
00347     {this->SetNumberOfXLabels(num); this->SetNumberOfYLabels(num);}
00348   
00349   // Description:
00350   // Enable/Disable the creation of a legend. If on, the legend labels will
00351   // be created automatically unless the per plot legend symbol has been
00352   // set.
00353   vtkSetMacro(Legend, int);
00354   vtkGetMacro(Legend, int);
00355   vtkBooleanMacro(Legend, int);
00356 
00357   // Description: 
00358   // Use these methods to control the position of the legend. The variables
00359   // LegendPosition and LegendPosition2 define the lower-left and upper-right
00360   // position of the legend. The coordinates are expressed as normalized
00361   // values with respect to the rectangle defined by PositionCoordinate and
00362   // Position2Coordinate. Note that LegendPosition2 is relative to
00363   // LegendPosition.
00364   vtkSetVector2Macro(LegendPosition,double);
00365   vtkGetVector2Macro(LegendPosition,double);
00366   vtkSetVector2Macro(LegendPosition2,double);
00367   vtkGetVector2Macro(LegendPosition2,double);
00368   
00369   // Description:
00370   // Set/Get the title text property.
00371   virtual void SetTitleTextProperty(vtkTextProperty *p);
00372   vtkGetObjectMacro(TitleTextProperty,vtkTextProperty);
00373   
00374   // Description:
00375   // Set/Get the title text property of all axes. Note that each axis can
00376   // be controlled individually through the GetX/YAxisActor2D() methods.
00377   virtual void SetAxisTitleTextProperty(vtkTextProperty *p);
00378   vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
00379   
00380   // Description:
00381   // Set/Get the labels text property of all axes. Note that each axis can
00382   // be controlled individually through the GetX/YAxisActor2D() methods.
00383   virtual void SetAxisLabelTextProperty(vtkTextProperty *p);
00384   vtkGetObjectMacro(AxisLabelTextProperty,vtkTextProperty);
00385       
00386   // Description:
00387   // Enable/Disable plotting of Log of x-values.
00388   vtkSetMacro(Logx, int);
00389   vtkGetMacro(Logx, int);
00390   vtkBooleanMacro(Logx, int);
00391 
00392   // Description:
00393   // Set/Get the format with which to print the labels on the scalar
00394   // bar.
00395   virtual void SetLabelFormat (const char* _arg);
00396   vtkGetStringMacro(LabelFormat);
00397 
00398   // Description:
00399   // Set/Get the spacing between the plot window and the plot. The value
00400   // is specified in pixels.
00401   vtkSetClampMacro(Border, int, 0, 50);
00402   vtkGetMacro(Border, int);
00403 
00404   // Description:
00405   // Set/Get whether the points are rendered.  The point size can be set in
00406   // the property object. This is a global flag which affects the plot only 
00407   // if per curve symbols are not defined.
00408   vtkGetMacro(PlotPoints, int);
00409   vtkSetMacro(PlotPoints, int);
00410   vtkBooleanMacro(PlotPoints, int);
00411 
00412   // Description:
00413   // Set/Get whether the lines are rendered.  The line width can be set in
00414   // the property object. 
00415   vtkGetMacro(PlotLines, int);
00416   vtkSetMacro(PlotLines, int);
00417   vtkBooleanMacro(PlotLines, int);
00418   
00419   // RKV : Begin
00420   // Description:
00421   // Set/Get the location in the viewport 
00422   vtkGetMacro(PlotLocation, VISU_XYPlotLocation);
00423   vtkSetMacro(PlotLocation, VISU_XYPlotLocation);
00424   // RKV : End
00425   
00426   // Description:
00427   // Set/Get the factor that controls how big glyphs are in the plot.
00428   // The number is expressed as a fraction of the length of the diagonal
00429   // of the plot bounding box.
00430   vtkSetClampMacro(GlyphSize, double, 0.0, 0.2);
00431   vtkGetMacro(GlyphSize, double);
00432 
00433   // Description:
00434   // Given a position within the viewport used by the plot, return the
00435   // the plot coordinates (XAxis value, YAxis value)
00436   void ViewportToPlotCoordinate(vtkViewport *viewport, double &u, double &v);
00437 
00438   // Description:
00439   // An alternate form of ViewportToPlotCoordinate() above. This method
00440   // inputs the viewport coordinate pair (defined by the ivar 
00441   // ViewportCoordinate)and then stores them in the ivar PlotCoordinate. 
00442   void ViewportToPlotCoordinate(vtkViewport *viewport);
00443   vtkSetVector2Macro(PlotCoordinate,double);
00444   vtkGetVector2Macro(PlotCoordinate,double);
00445 
00446   // Description:
00447   // Given a plot coordinate, return the viewpoint position
00448   void PlotToViewportCoordinate(vtkViewport *viewport, double &u, double &v);
00449 
00450   // Description:
00451   // An alternate form of PlotToViewportCoordinate() above. This method
00452   // inputs the plot coordinate pair (defined in the ivar PlotCoordinate)
00453   // and then stores them in the ivar ViewportCoordinate. (This method 
00454   // can be wrapped.)
00455   void PlotToViewportCoordinate(vtkViewport *viewport);
00456   vtkSetVector2Macro(ViewportCoordinate,double);
00457   vtkGetVector2Macro(ViewportCoordinate,double);
00458 
00459   // Description:
00460   // Is the specified viewport position within the plot area (as opposed to the
00461   // region used by the plot plus the labels)?
00462   int IsInPlot(vtkViewport *viewport, double u, double v);
00463   
00464   // Description:
00465   // Take into account the modified time of internal helper classes.
00466   unsigned long GetMTime();
00467   
00468   // Description:
00469   // Write the XY Ploat Actor as a CSV (comma separated value) representation.
00470   void PrintAsCSV(ostream &os);
00471 
00472 //BTX  
00473   // Description:
00474   // WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE
00475   // DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS.
00476   // Draw the x-y plot.
00477   int RenderOpaqueGeometry(vtkViewport*);
00478   int RenderOverlay(vtkViewport*);
00479   int RenderTranslucentGeometry(vtkViewport *) {return 0;}
00480 
00481   // Description:
00482   // Release any graphics resources that are being consumed by this actor.
00483   // The parameter window could be used to determine which graphic
00484   // resources to release.
00485   void ReleaseGraphicsResources(vtkWindow *);
00486 //ETX  
00487 
00488 protected:
00489   VISU_XYPlotActor();
00490   ~VISU_XYPlotActor();
00491 
00492   vtkDataSetCollection *InputList; //list of data sets to plot
00493   char** SelectedInputScalars; // list of data set arrays to plot
00494   vtkIntArray* SelectedInputScalarsComponent; // list of componenents
00495   vtkDataObjectCollection *DataObjectInputList; //list of data objects to plot
00496   char  *Title;
00497   char  *XTitle;
00498   char  *YTitle;
00499   int   XValues;
00500   int   NumberOfXLabels;
00501   int   NumberOfYLabels;
00502   int   Logx;
00503   char  *LabelFormat;
00504   double XRange[2];
00505   double YRange[2];
00506   double XComputedRange[2];  //range actually used by plot
00507   double YComputedRange[2];  //range actually used by plot
00508   int Border;
00509   int PlotLines;
00510   int PlotPoints;
00511   int PlotCurveLines;
00512   int PlotCurvePoints;
00513   int ExchangeAxes;
00514   int ReverseXAxis;
00515   int ReverseYAxis;
00516   
00517   vtkTextMapper   *TitleMapper;
00518   vtkActor2D      *TitleActor;
00519   vtkTextProperty *TitleTextProperty;
00520 
00521   vtkAxisActor2D      *XAxis;
00522   vtkAxisActor2D      *YAxis;
00523 
00524   vtkTextProperty *AxisTitleTextProperty;
00525   vtkTextProperty *AxisLabelTextProperty;
00526 
00527   double ViewportCoordinate[2];
00528   double PlotCoordinate[2];
00529   
00530   //Handle data objects and datasets
00531   int DataObjectPlotMode;
00532   vtkIntArray *XComponent;
00533   vtkIntArray *YComponent;
00534   vtkIntArray *LinesOn;
00535   vtkIntArray *PointsOn;
00536 
00537   //The data drawn within the axes. Each curve is one polydata.
00538   //color is controlled by scalar data. The curves are appended
00539   //together, possibly glyphed with point symbols.
00540   int NumberOfInputs;
00541   vtkPolyData             **PlotData; 
00542   vtkGlyph2D              **PlotGlyph;
00543   vtkAppendPolyData       **PlotAppend;
00544   vtkTransformPolyDataFilter  **PlotTransform; // RKV
00545   vtkPolyDataMapper2D     **PlotMapper;
00546   vtkActor2D              **PlotActor;
00547   void                    InitializeEntries();
00548   
00549   // Legends and plot symbols. The legend also keeps track of
00550   // the symbols and such.
00551   int Legend;
00552   double LegendPosition[2];
00553   double LegendPosition2[2];
00554   vtkLegendBoxActor *LegendActor;
00555   vtkGlyphSource2D *GlyphSource;
00556   vtkPlanes *ClipPlanes;
00557   double GlyphSize;
00558 
00559   // Keep track of changes.
00560   VISU_XYPlotLocation PlotLocation; // RKV
00561   int CachedSize[2];
00562   vtkTimeStamp  BuildTime;
00563 
00564   void ComputeXRange(double range[2], double *lengths);
00565   void ComputeYRange(double range[2]);
00566   void ComputeDORange(double xrange[2], double yrange[2], double *lengths);
00567 
00568   virtual void CreatePlotData(int *pos, int *pos2, double xRange[2], 
00569                               double yRange[2], double *norms, 
00570                               int numDS, int numDO);
00571   void PlaceAxes(vtkViewport *viewport, int *size, int pos[2], int pos2[2]);
00572   void GenerateClipPlanes(int *pos, int *pos2);
00573   double ComputeGlyphScale(int i, int *pos, int *pos2);
00574   void ClipPlotData(int *pos, int *pos2, vtkPolyData *pd);
00575   double *TransformPoint(int pos[2], int pos2[2], double x[3], double xNew[3]);
00576   
00577 private:
00578   VISU_XYPlotActor(const VISU_XYPlotActor&);  // Not implemented.
00579   void operator=(const VISU_XYPlotActor&);  // Not implemented.
00580 };
00581 
00582 
00583 #endif /*VISU_XYPLOTACTOR_HXX_*/
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS