VTK
dox/Rendering/Annotation/vtkParallelCoordinatesActor.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkParallelCoordinatesActor.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00062 #ifndef __vtkParallelCoordinatesActor_h
00063 #define __vtkParallelCoordinatesActor_h
00064 
00065 #include "vtkRenderingAnnotationModule.h" // For export macro
00066 #include "vtkActor2D.h"
00067 
00068 class vtkAlgorithmOutput;
00069 class vtkAxisActor2D;
00070 class vtkDataObject;
00071 class vtkPolyData;
00072 class vtkPolyDataMapper2D;
00073 class vtkTextMapper;
00074 class vtkTextProperty;
00075 class vtkParallelCoordinatesActorConnection;
00076 
00077 #define VTK_IV_COLUMN 0
00078 #define VTK_IV_ROW    1
00079 
00080 class VTKRENDERINGANNOTATION_EXPORT vtkParallelCoordinatesActor : public vtkActor2D
00081 {
00082 public:
00083   vtkTypeMacro(vtkParallelCoordinatesActor,vtkActor2D);
00084   void PrintSelf(ostream& os, vtkIndent indent);
00085 
00089   static vtkParallelCoordinatesActor *New();
00090 
00092 
00095   vtkSetClampMacro(IndependentVariables,int,VTK_IV_COLUMN, VTK_IV_ROW);
00096   vtkGetMacro(IndependentVariables,int);
00097   void SetIndependentVariablesToColumns()
00098     {this->SetIndependentVariables(VTK_IV_COLUMN);};
00099   void SetIndependentVariablesToRows()
00100     {this->SetIndependentVariables(VTK_IV_ROW);};
00102 
00104 
00105   vtkSetStringMacro(Title);
00106   vtkGetStringMacro(Title);
00108 
00110 
00113   vtkSetClampMacro(NumberOfLabels, int, 0, 50);
00114   vtkGetMacro(NumberOfLabels, int);
00116 
00118 
00119   vtkSetStringMacro(LabelFormat);
00120   vtkGetStringMacro(LabelFormat);
00122 
00124 
00125   virtual void SetTitleTextProperty(vtkTextProperty *p);
00126   vtkGetObjectMacro(TitleTextProperty,vtkTextProperty);
00128 
00130 
00131   virtual void SetLabelTextProperty(vtkTextProperty *p);
00132   vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
00134 
00136 
00137   int RenderOpaqueGeometry(vtkViewport*);
00138   int RenderOverlay(vtkViewport*);
00139   virtual int RenderTranslucentPolygonalGeometry(vtkViewport *) {return 0;}
00141 
00143   virtual int HasTranslucentPolygonalGeometry();
00144 
00147   virtual void SetInputConnection(vtkAlgorithmOutput*);
00148 
00151   virtual void SetInputData(vtkDataObject*);
00152 
00154   vtkDataObject* GetInput();
00155 
00159   void ReleaseGraphicsResources(vtkWindow *);
00160 
00161 protected:
00162   vtkParallelCoordinatesActor();
00163   ~vtkParallelCoordinatesActor();
00164 
00165 private:
00166 
00167   vtkParallelCoordinatesActorConnection* ConnectionHolder;
00168 
00169   int IndependentVariables;    // Use column or row
00170   vtkIdType N;                 // The number of independent variables
00171   double *Mins;                 // Minimum data value along this row/column
00172   double *Maxs;                 // Maximum data value along this row/column
00173   int   *Xs;                   // Axes x-values (in viewport coordinates)
00174   int   YMin;                  // Axes y-min-value (in viewport coordinates)
00175   int   YMax;                  // Axes y-max-value (in viewport coordinates)
00176   int   NumberOfLabels;        // Along each axis
00177   char  *LabelFormat;
00178   char  *Title;
00179 
00180   vtkAxisActor2D **Axes;
00181   vtkTextMapper  *TitleMapper;
00182   vtkActor2D     *TitleActor;
00183 
00184   vtkTextProperty *TitleTextProperty;
00185   vtkTextProperty *LabelTextProperty;
00186 
00187   vtkPolyData         *PlotData;    // The lines drawn within the axes
00188   vtkPolyDataMapper2D *PlotMapper;
00189   vtkActor2D          *PlotActor;
00190 
00191   vtkTimeStamp  BuildTime;
00192 
00193   int   LastPosition[2];
00194   int   LastPosition2[2];
00195 
00196   void Initialize();
00197   int PlaceAxes(vtkViewport *viewport, int *size);
00198 
00199 private:
00200   vtkParallelCoordinatesActor(const vtkParallelCoordinatesActor&);  // Not implemented.
00201   void operator=(const vtkParallelCoordinatesActor&);  // Not implemented.
00202 };
00203 
00204 
00205 #endif
00206