00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkTreeLayoutView.h,v $ 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 -------------------------------------------------------------------------*/ 00034 #ifndef __vtkTreeLayoutView_h 00035 #define __vtkTreeLayoutView_h 00036 00037 #include "vtkRenderView.h" 00038 00039 class vtkActor; 00040 class vtkActor2D; 00041 class vtkCoordinate; 00042 class vtkDynamic2DLabelMapper; 00043 class vtkExtractSelectedGraph; 00044 class vtkGraphLayout; 00045 class vtkGraphToPolyData; 00046 class vtkInteractorStyleRubberBand2D; 00047 class vtkKdTreeSelector; 00048 class vtkLookupTable; 00049 class vtkPolyDataMapper; 00050 class vtkTreeLayoutStrategy; 00051 class vtkVertexGlyphFilter; 00052 class vtkViewTheme; 00053 class vtkVisibleCellSelector; 00054 00055 class VTK_VIEWS_EXPORT vtkTreeLayoutView : public vtkRenderView 00056 { 00057 public: 00058 static vtkTreeLayoutView *New(); 00059 vtkTypeRevisionMacro(vtkTreeLayoutView, vtkRenderView); 00060 void PrintSelf(ostream& os, vtkIndent indent); 00061 00063 00064 void SetLabelArrayName(const char* name); 00065 const char* GetLabelArrayName(); 00067 00069 00070 void SetLabelVisibility(bool vis); 00071 bool GetLabelVisibility(); 00072 void LabelVisibilityOn(); 00073 void LabelVisibilityOff(); 00075 00077 00078 void SetVertexColorArrayName(const char* name); 00079 const char* GetVertexColorArrayName(); 00081 00083 00084 void SetColorVertices(bool vis); 00085 bool GetColorVertices(); 00086 void ColorVerticesOn(); 00087 void ColorVerticesOff(); 00089 00091 00092 void SetEdgeColorArrayName(const char* name); 00093 const char* GetEdgeColorArrayName(); 00095 00097 00098 void SetColorEdges(bool vis); 00099 bool GetColorEdges(); 00100 void ColorEdgesOn(); 00101 void ColorEdgesOff(); 00103 00105 00108 void SetAngle(double angle); 00109 double GetAngle(); 00111 00113 00116 void SetRadial(bool radial); 00117 bool GetRadial(); 00118 void RadialOn(); 00119 void RadialOff(); 00121 00123 00126 void SetLogSpacingValue(double value); 00127 double GetLogSpacingValue(); 00129 00131 00134 void SetLeafSpacing(double value); 00135 double GetLeafSpacing(); 00137 00139 00140 const char* GetDistanceArrayName(); 00141 void SetDistanceArrayName(const char* name); 00143 00145 virtual void SetupRenderWindow(vtkRenderWindow* win); 00146 00148 virtual void ApplyViewTheme(vtkViewTheme* theme); 00149 00150 protected: 00151 vtkTreeLayoutView(); 00152 ~vtkTreeLayoutView(); 00153 00155 00156 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, 00157 void* callData); 00159 00162 virtual void AddInputConnection(vtkAlgorithmOutput* conn); 00163 00165 virtual void RemoveInputConnection(vtkAlgorithmOutput* conn); 00166 00168 virtual void SetSelectionLink(vtkSelectionLink* link); 00169 00171 virtual void PrepareForRendering(); 00172 00174 void MapToXYPlane(double displayX, double displayY, double &x, double &y); 00175 00177 00178 vtkGetStringMacro(VertexColorArrayNameInternal); 00179 vtkSetStringMacro(VertexColorArrayNameInternal); 00180 vtkGetStringMacro(EdgeColorArrayNameInternal); 00181 vtkSetStringMacro(EdgeColorArrayNameInternal); 00183 00184 char* VertexColorArrayNameInternal; 00185 char* EdgeColorArrayNameInternal; 00186 00187 // Used for coordinate conversion 00188 vtkCoordinate* Coordinate; 00189 00190 // Representation objects 00191 vtkGraphLayout* GraphLayout; 00192 vtkTreeLayoutStrategy* TreeStrategy; 00193 vtkGraphToPolyData* GraphToPolyData; 00194 vtkVertexGlyphFilter* VertexGlyph; 00195 vtkPolyDataMapper* VertexMapper; 00196 vtkLookupTable* VertexColorLUT; 00197 vtkActor* VertexActor; 00198 vtkPolyDataMapper* OutlineMapper; 00199 vtkActor* OutlineActor; 00200 vtkPolyDataMapper* EdgeMapper; 00201 vtkLookupTable* EdgeColorLUT; 00202 vtkActor* EdgeActor; 00203 vtkDynamic2DLabelMapper* LabelMapper; 00204 vtkActor2D* LabelActor; 00205 00206 // Selection objects 00207 vtkKdTreeSelector* KdTreeSelector; 00208 vtkVisibleCellSelector* VisibleCellSelector; 00209 vtkExtractSelectedGraph* ExtractSelectedGraph; 00210 vtkGraphToPolyData* SelectionToPolyData; 00211 vtkVertexGlyphFilter* SelectionVertexGlyph; 00212 vtkPolyDataMapper* SelectionVertexMapper; 00213 vtkActor* SelectionVertexActor; 00214 vtkPolyDataMapper* SelectionEdgeMapper; 00215 vtkActor* SelectionEdgeActor; 00216 00217 private: 00218 vtkTreeLayoutView(const vtkTreeLayoutView&); // Not implemented. 00219 void operator=(const vtkTreeLayoutView&); // Not implemented. 00220 }; 00221 00222 #endif