VTK
dox/Views/vtkRenderedTreeAreaRepresentation.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkRenderedTreeAreaRepresentation.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 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00031 #ifndef __vtkRenderedTreeAreaRepresentation_h
00032 #define __vtkRenderedTreeAreaRepresentation_h
00033 
00034 #include "vtkRenderedRepresentation.h"
00035 
00036 class vtkActor;
00037 class vtkActor2D;
00038 class vtkAreaLayout;
00039 class vtkAreaLayoutStrategy;
00040 class vtkConvertSelection;
00041 class vtkEdgeCenters;
00042 class vtkExtractSelectedPolyDataIds;
00043 class vtkLabeledDataMapper;
00044 class vtkPointSetToLabelHierarchy;
00045 class vtkPolyData;
00046 class vtkPolyDataAlgorithm;
00047 class vtkPolyDataMapper;
00048 class vtkScalarBarWidget;
00049 class vtkTextProperty;
00050 class vtkTreeFieldAggregator;
00051 class vtkTreeLevelsFilter;
00052 class vtkVertexDegree;
00053 class vtkWorldPointPicker;
00054 
00055 class VTK_VIEWS_EXPORT vtkRenderedTreeAreaRepresentation : public vtkRenderedRepresentation
00056 {
00057 public:
00058   static vtkRenderedTreeAreaRepresentation* New();
00059   vtkTypeMacro(vtkRenderedTreeAreaRepresentation, vtkRenderedRepresentation);
00060   void PrintSelf(ostream& os, vtkIndent indent);
00061 
00065   virtual void SetLabelRenderMode(int mode);
00066 
00068 
00069   virtual void SetAreaLabelArrayName(const char* name);
00070   virtual const char* GetAreaLabelArrayName();
00072 
00074 
00075   virtual void SetAreaSizeArrayName(const char* name);
00076   virtual const char* GetAreaSizeArrayName();
00078 
00080 
00082   virtual void SetAreaLabelPriorityArrayName(const char* name);
00083   virtual const char* GetAreaLabelPriorityArrayName();
00085 
00087 
00088   virtual void SetGraphEdgeLabelArrayName(const char* name)
00089     { this->SetGraphEdgeLabelArrayName(name, 0); }
00090   virtual void SetGraphEdgeLabelArrayName(const char* name, int idx);
00091   virtual const char* GetGraphEdgeLabelArrayName()
00092     { return this->GetGraphEdgeLabelArrayName(0); }
00093   virtual const char* GetGraphEdgeLabelArrayName(int idx);
00095 
00097 
00098   virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty* tp)
00099     { this->SetGraphEdgeLabelTextProperty(tp, 0); }
00100   virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty* tp, int idx);
00101   virtual vtkTextProperty* GetGraphEdgeLabelTextProperty()
00102     { return this->GetGraphEdgeLabelTextProperty(0); }
00103   virtual vtkTextProperty* GetGraphEdgeLabelTextProperty(int idx);
00105 
00107 
00109   vtkSetStringMacro(AreaHoverArrayName);
00110   vtkGetStringMacro(AreaHoverArrayName);
00112 
00114 
00115   virtual void SetAreaLabelVisibility(bool vis);
00116   virtual bool GetAreaLabelVisibility();
00117   vtkBooleanMacro(AreaLabelVisibility, bool);
00119 
00121 
00122   virtual void SetAreaLabelTextProperty(vtkTextProperty* tp);
00123   virtual vtkTextProperty* GetAreaLabelTextProperty();
00125 
00127 
00128   virtual void SetGraphEdgeLabelVisibility(bool vis)
00129     { this->SetGraphEdgeLabelVisibility(vis, 0); }
00130   virtual void SetGraphEdgeLabelVisibility(bool vis, int idx);
00131   virtual bool GetGraphEdgeLabelVisibility()
00132     { return this->GetGraphEdgeLabelVisibility(0); }
00133   virtual bool GetGraphEdgeLabelVisibility(int idx);
00134   vtkBooleanMacro(GraphEdgeLabelVisibility, bool);
00136 
00138 
00139   void SetAreaColorArrayName(const char* name);
00140   const char* GetAreaColorArrayName();
00142 
00144 
00145   virtual void SetColorAreasByArray(bool vis);
00146   virtual bool GetColorAreasByArray();
00147   vtkBooleanMacro(ColorAreasByArray, bool);
00149 
00151 
00152   virtual void SetGraphEdgeColorArrayName(const char* name)
00153     { this->SetGraphEdgeColorArrayName(name, 0); }
00154   virtual void SetGraphEdgeColorArrayName(const char* name, int idx);
00155   virtual const char* GetGraphEdgeColorArrayName()
00156     { return this->GetGraphEdgeColorArrayName(0); }
00157   virtual const char* GetGraphEdgeColorArrayName(int idx);
00159 
00161 
00162   virtual void SetGraphEdgeColorToSplineFraction()
00163     { this->SetGraphEdgeColorToSplineFraction(0); }
00164   virtual void SetGraphEdgeColorToSplineFraction(int idx);
00166 
00168 
00169   virtual void SetColorGraphEdgesByArray(bool vis)
00170     { this->SetColorGraphEdgesByArray(vis, 0); }
00171   virtual void SetColorGraphEdgesByArray(bool vis, int idx);
00172   virtual bool GetColorGraphEdgesByArray()
00173     { return this->GetColorGraphEdgesByArray(0); }
00174   virtual bool GetColorGraphEdgesByArray(int idx);
00175   vtkBooleanMacro(ColorGraphEdgesByArray, bool);
00177 
00179 
00181   virtual void SetGraphHoverArrayName(const char* name)
00182     { this->SetGraphHoverArrayName(name, 0); }
00183   virtual void SetGraphHoverArrayName(const char* name, int idx);
00184   virtual const char* GetGraphHoverArrayName()
00185     { return this->GetGraphHoverArrayName(0); }
00186   virtual const char* GetGraphHoverArrayName(int idx);
00188 
00190 
00191   virtual void SetShrinkPercentage(double value);
00192   virtual double GetShrinkPercentage();
00194 
00196 
00197   virtual void SetGraphBundlingStrength(double strength)
00198     { this->SetGraphBundlingStrength(strength, 0); }
00199   virtual void SetGraphBundlingStrength(double strength, int idx);
00200   virtual double GetGraphBundlingStrength()
00201     { return this->GetGraphBundlingStrength(0); }
00202   virtual double GetGraphBundlingStrength(int idx);
00204 
00206 
00209   virtual void SetGraphSplineType(int type, int idx);
00210   virtual int GetGraphSplineType(int idx);
00212 
00214 
00215   virtual void SetAreaLayoutStrategy(vtkAreaLayoutStrategy* strategy);
00216   virtual vtkAreaLayoutStrategy* GetAreaLayoutStrategy();
00218 
00220 
00223   virtual void SetAreaToPolyData(vtkPolyDataAlgorithm* areaToPoly);
00224   vtkGetObjectMacro(AreaToPolyData, vtkPolyDataAlgorithm);
00226 
00228 
00229   vtkSetMacro(UseRectangularCoordinates, bool);
00230   vtkGetMacro(UseRectangularCoordinates, bool);
00231   vtkBooleanMacro(UseRectangularCoordinates, bool);
00233 
00235 
00237   virtual void SetAreaLabelMapper(vtkLabeledDataMapper* mapper);
00238   vtkGetObjectMacro(AreaLabelMapper, vtkLabeledDataMapper);
00240   
00242   virtual void ApplyViewTheme(vtkViewTheme* theme);
00243 
00245 
00246   virtual void SetEdgeScalarBarVisibility(bool b);
00247   virtual bool GetEdgeScalarBarVisibility();
00249 
00250 protected:
00251   vtkRenderedTreeAreaRepresentation();
00252   ~vtkRenderedTreeAreaRepresentation();
00253 
00255 
00256   virtual bool AddToView(vtkView* view);
00257   virtual bool RemoveFromView(vtkView* view);
00259   
00260   virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* sel);
00261 
00262   virtual int FillInputPortInformation(int port, vtkInformation* info);
00263 
00264   virtual int RequestData(
00265     vtkInformation*,
00266     vtkInformationVector**,
00267     vtkInformationVector*);
00268 
00269   virtual void PrepareForRendering(vtkRenderView* view);
00270 
00271   bool ValidIndex(int idx);
00272 
00273   void UpdateHoverHighlight(vtkView* view, int x, int y);
00274 
00275   virtual vtkUnicodeString GetHoverTextInternal(vtkSelection* sel);
00276 
00277   //BTX
00278   class Internals;
00279   Internals* Implementation;
00280   //ETX
00281 
00282   //BTX
00283   vtkSmartPointer<vtkWorldPointPicker>             Picker;
00284   vtkSmartPointer<vtkApplyColors>                  ApplyColors;
00285   vtkSmartPointer<vtkTreeLevelsFilter>             TreeLevels;
00286   vtkSmartPointer<vtkVertexDegree>                 VertexDegree;
00287   vtkSmartPointer<vtkTreeFieldAggregator>          TreeAggregation;
00288   vtkSmartPointer<vtkAreaLayout>                   AreaLayout;
00289   vtkSmartPointer<vtkPolyDataMapper>               AreaMapper;
00290   vtkSmartPointer<vtkActor>                        AreaActor;
00291   vtkSmartPointer<vtkActor2D>                      AreaLabelActor;
00292   vtkSmartPointer<vtkPolyData>                     HighlightData;
00293   vtkSmartPointer<vtkPolyDataMapper>               HighlightMapper;
00294   vtkSmartPointer<vtkActor>                        HighlightActor;
00295   vtkPolyDataAlgorithm*                            AreaToPolyData;
00296   vtkLabeledDataMapper*                            AreaLabelMapper;
00297   vtkSmartPointer<vtkScalarBarWidget>              EdgeScalarBar;
00298   vtkSmartPointer<vtkPointSetToLabelHierarchy>     AreaLabelHierarchy;
00299   vtkSmartPointer<vtkPolyData>                     EmptyPolyData;
00300   //ETX
00301   
00302   vtkSetStringMacro(AreaSizeArrayNameInternal);
00303   vtkGetStringMacro(AreaSizeArrayNameInternal);
00304   char* AreaSizeArrayNameInternal;
00305   vtkSetStringMacro(AreaColorArrayNameInternal);
00306   vtkGetStringMacro(AreaColorArrayNameInternal);
00307   char* AreaColorArrayNameInternal;
00308   vtkSetStringMacro(AreaLabelArrayNameInternal);
00309   vtkGetStringMacro(AreaLabelArrayNameInternal);
00310   char* AreaLabelArrayNameInternal;
00311   vtkSetStringMacro(AreaLabelPriorityArrayNameInternal);
00312   vtkGetStringMacro(AreaLabelPriorityArrayNameInternal);
00313   char* AreaLabelPriorityArrayNameInternal;
00314   vtkSetStringMacro(GraphEdgeColorArrayNameInternal);
00315   vtkGetStringMacro(GraphEdgeColorArrayNameInternal);
00316   char* GraphEdgeColorArrayNameInternal;
00317   vtkGetStringMacro(AreaHoverTextInternal);
00318   vtkSetStringMacro(AreaHoverTextInternal);
00319   char* AreaHoverTextInternal;
00320   char* AreaHoverArrayName;
00321 
00322   bool UseRectangularCoordinates;
00323 
00324 private:
00325   vtkRenderedTreeAreaRepresentation(const vtkRenderedTreeAreaRepresentation&); // Not implemented
00326   void operator=(const vtkRenderedTreeAreaRepresentation&);   // Not implemented
00327 };
00328 
00329 #endif
00330